Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat: show agents that need Node.js and let Codync add it

leepokai9dd70fa46fee
diff --git a/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx b/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx
index d83c52ba..cf2640b0 100644
--- a/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx
+++ b/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState, type ReactNode } from 'react'
import type { Backend } from '@shared/models'
import { agentIconURL } from '../../components/AgentIcon'
-import { CardForm, CardSection, IconButton, Spinner } from '../../components/Controls'
+import { Button, CardForm, CardSection, IconButton, Spinner } from '../../components/Controls'
import { Icon } from '../../components/Icon'
import { ModalHeader } from '../../components/Overlay'
import { ThinkingOrb } from '../../components/ThinkingOrb'
@@ -11,7 +11,7 @@ import { errorText, market, type AgentAuth, type AuthMethod } from './market-mod
import { ErrorText, Field, ScreenHeader, SlideStack, WebLink, filled, lineClamp } from './pieces'
import { SetupTerminalView } from './SetupTerminal'
-type SetupRoute = { kind: 'install' } | { kind: 'terminal'; method: AuthMethod | null } | { kind: 'keys'; method: AuthMethod }
+type SetupRoute = { kind: 'install' } | { kind: 'node' } | { kind: 'terminal'; method: AuthMethod | null } | { kind: 'keys'; method: AuthMethod }
/** Registry logos are one-color; paint the ones with a known brand color in it. */
export function agentTint(registry: string | null | undefined) {
@@ -54,7 +54,26 @@ function TintedAgentIcon({ registry, size }: { registry?: string | null; size: n
}
/**
- * Getting an agent ready on the computer: install it, then sign in. Sign-in
+ * Above the agents while some of them run on Node.js and the computer has none: one place to
+ * add Codync's copy for all of them.
+ */
+export function NodeNotice({ onAdd }: { onAdd: () => void }) {
+ const store = useStore()
+ return (
+ <div className="node-notice fade-in">
+ <Icon name="shippingbox" size={15} color="var(--secondary)" />
+ <span style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 1, minWidth: 0 }}>
+ <span style={{ ...font('subheadline', 'semibold'), color: 'var(--text)' }}>Node.js isn't on {store.hostName}</span>
+ <span style={{ ...font('caption'), color: 'var(--secondary)' }}>Some agents need it to run. Codync can add a copy just for them.</span>
+ </span>
+ <Button onClick={onAdd}>Add Node.js</Button>
+ </div>
+ )
+}
+
+/**
+ * Getting an agent ready on the computer: install it, add Node.js when it runs on Node and
+ * the computer has none, then sign in. Sign-in
* options come from the agent itself (ACP), plus Codync's own command for
* CLIs it knows. Bots are made from New chat, not here.
*/
@@ -72,6 +91,7 @@ export function AgentSheet({ initial }: { initial: Backend }) {
const installed = backend.installed === true
const curated = backend.curated === true
const signedIn = auth?.signedIn ?? backend.signedIn ?? null
+ const nodeMissing = backend.node === 'missing'
const host = store.hostName
const check = async () => {
@@ -104,9 +124,10 @@ export function AgentSheet({ initial }: { initial: Backend }) {
await store.refreshBackends()
}
- // A known "signed in" needs no agent start; everything else asks the agent.
+ // A known "signed in" needs no agent start; everything else asks the agent (which can't
+ // start without its Node.js).
useEffect(() => {
- if (backend.signedIn !== true) void check()
+ if (backend.signedIn !== true && !nodeMissing) void check()
}, [])
// Back from a terminal or key form: see what changed.
@@ -119,12 +140,14 @@ export function AgentSheet({ initial }: { initial: Backend }) {
const back = () => setRoute(null)
const routed = route === null ? null
: route.kind === 'install' ? <SetupTerminalView backend={backend} step="install" back={back} />
+ : route.kind === 'node' ? <SetupTerminalView backend={backend} step="node" back={back} />
: route.kind === 'terminal' ? <SetupTerminalView backend={backend} step="login" method={route.method} back={back} />
: <AgentKeysForm backend={backend} method={route.method} saved={auth?.savedEnv ?? []} back={back} done={setAuth} />
const statusText = checking
? (auth === null ? `Checking with ${backend.name}… The first check can download it.` : 'Checking…')
: signedIn === true ? 'Signed in.'
+ : nodeMissing ? 'Add Node.js first.'
: signedIn === false ? 'Not signed in yet.'
: `Couldn't tell. Skip this if you've already signed in on ${host}.`
@@ -186,6 +209,17 @@ export function AgentSheet({ initial }: { initial: Backend }) {
/>
</CardSection>
) : null}
+ {backend.node ? (
+ <CardSection>
+ <SetupStepRow
+ number={curated ? 2 : 1}
+ title="Node.js"
+ detail={nodeMissing ? `${backend.name} runs on Node.js. Codync adds its own copy.` : `Added on ${host}.`}
+ done={!nodeMissing}
+ action={nodeMissing ? { label: 'Add', run: () => setRoute({ kind: 'node' }) } : null}
+ />
+ </CardSection>
+ ) : null}
<CardSection
footer={signedIn !== true && auth?.methods.some((m) => m.kind === 'agent')
? `Browser sign-ins open on ${host} itself. Away from it? Use Remote screen to finish there.`
@@ -193,7 +227,7 @@ export function AgentSheet({ initial }: { initial: Backend }) {
>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ flex: 1, minWidth: 0 }}>
- <SetupStepRow number={curated ? 2 : 1} title="Sign in" detail={statusText} done={signedIn === true} action={null} />
+ <SetupStepRow number={1 + Number(curated) + Number(backend.node !== undefined)} title="Sign in" detail={statusText} done={signedIn === true} action={null} />
</div>
{checking ? (
<ThinkingOrb state="connecting" size={16} color="var(--secondary)" />
diff --git a/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsx b/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsx
index 43a63f7d..8c72be1c 100644
--- a/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsx
+++ b/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsx
@@ -6,10 +6,11 @@ import { Dialog, useDismiss } from '../../components/Overlay'
import { font } from '../../lib/fonts'
import { useStore } from '../../store/context'
import { ComputerBadge } from '../ComputerBadge'
-import { AgentSheet, AgentTile } from './AgentSheet'
+import { AgentSheet, AgentTile, NodeNotice } from './AgentSheet'
import { ComposioSection } from './ComposioViews'
import { CredentialsView } from './CredentialsView'
import { CustomConnectorSheet, InstallConnectorSheet, NewSkillSheet } from './ConnectorSheets'
+import { SetupTerminalView } from './SetupTerminal'
import { SkillSheet, type SkillRef } from './SkillSheet'
import {
appendPage, emptyPage, errorText, hasHiddenItems, market, needsSignIn, replacePage, revealMore, visible,
@@ -47,6 +48,7 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = f
const [writingSkill, setWritingSkill] = useState(false)
const [viewingSkill, setViewingSkill] = useState<SkillRef | null>(null)
const [agent, setAgent] = useState<Backend | null>(null)
+ const [addingNode, setAddingNode] = useState(false)
/** Agents shown before "Load more agents" (two rows of the grid). */
const [agentLimit, setAgentLimit] = useState(10)
const [showInstalled, setShowInstalled] = useState(false)
@@ -219,6 +221,7 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = f
{appsFirst ? <ComposioSection query={query} searchToken={searchToken} /> : null}
{agents.length > 0 ? (
<MarketSection title={query ? `Agents matching “${query}”` : 'Agents'}>
+ {allAgents.some((b) => b.node === 'missing') ? <NodeNotice onAdd={() => setAddingNode(true)} /> : null}
<div className="agent-grid">
{agents.slice(0, agentLimit).map((b) => <AgentCard key={b.id} backend={b} onClick={() => setAgent(b)} />)}
</div>
@@ -323,6 +326,9 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = f
<FormSheet open={viewingSkill !== null} onClose={() => setViewingSkill(null)}>
{viewingSkill ? <SkillSheet key={viewingSkill.name} skill={viewingSkill} /> : null}
</FormSheet>
+ <FormSheet open={addingNode} onClose={() => setAddingNode(false)} width={560} height={560}>
+ {addingNode ? <SetupTerminalView backend={null} step="node" back={() => setAddingNode(false)} /> : null}
+ </FormSheet>
<FormSheet open={agent !== null} onClose={() => setAgent(null)} width={560} height={560}>
{agent ? <AgentSheet key={agent.id} initial={agent} /> : null}
</FormSheet>
@@ -331,9 +337,11 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = f
}
function AgentCard({ backend, onClick }: { backend: Backend; onClick: () => void }) {
- const status = backend.installed === true
- ? (backend.signedIn === false ? 'Not signed in' : 'Installed')
- : backend.curated === true ? 'Not installed' : 'Sets up on first use'
+ const status = backend.installed !== true && backend.curated === true ? 'Not installed'
+ : backend.node === 'missing' ? 'Needs Node.js'
+ : backend.installed !== true ? 'Sets up on first use'
+ : backend.signedIn === false ? 'Not signed in'
+ : 'Installed'
return (
<button className="agent-card" title={backend.name} onClick={onClick}>
<AgentTile registry={backend.registry ?? backend.id} icon={24} tile={40} radius={11} />
diff --git a/apps/desktop/src/renderer/views/marketplace/SetupTerminal.tsx b/apps/desktop/src/renderer/views/marketplace/SetupTerminal.tsx
index 3e75d2df..9a663d0d 100644
--- a/apps/desktop/src/renderer/views/marketplace/SetupTerminal.tsx
+++ b/apps/desktop/src/renderer/views/marketplace/SetupTerminal.tsx
@@ -18,11 +18,12 @@ const openLink = (uri: string) => {
}
/**
- * Installing or signing in to an agent, live: the command runs in a terminal
- * on the computer and this screen is that terminal (links open here).
+ * Installing or signing in to an agent, or adding Node.js, live: the command runs in a
+ * terminal on the computer and this screen is that terminal (links open here).
*/
export function SetupTerminalView({ backend, step, method, back }: {
- backend: Backend
+ /** Null only for the `node` step, which belongs to the computer. */
+ backend: Backend | null
step: SetupStep
/** A terminal sign-in method the agent offered; null runs Codync's own command. */
method?: AuthMethod | null
@@ -132,7 +133,7 @@ export function SetupTerminalView({ backend, step, method, back }: {
void (async () => {
try {
const client = await store.ready()
- const id = await market.agentSetup(client, backend.id, step, method?.id ?? null, size.cols, size.rows)
+ const id = await market.agentSetup(client, backend?.id ?? '', step, method?.id ?? null, size.cols, size.rows)
if (cancelled) {
void market.termClose(client, id).catch(() => {})
return
@@ -162,9 +163,10 @@ export function SetupTerminalView({ backend, step, method, back }: {
if (exited === null && client && termId) void market.termClose(client, termId).catch(() => {})
term.dispose()
}
- }, [store, backend.id, step, method?.id])
+ }, [store, backend?.id, step, method?.id])
- const title = step === 'install' ? `Install ${backend.name}` : (method?.name ?? `Sign in to ${backend.name}`)
+ const name = backend?.name ?? 'the agent'
+ const title = step === 'node' ? 'Add Node.js' : step === 'install' ? `Install ${name}` : (method?.name ?? `Sign in to ${name}`)
return (
<div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>
<ScreenHeader title={title} onBack={back} />
diff --git a/apps/desktop/src/renderer/views/marketplace/market-models.ts b/apps/desktop/src/renderer/views/marketplace/market-models.ts
index 1a2347f3..e5a22ac6 100644
--- a/apps/desktop/src/renderer/views/marketplace/market-models.ts
+++ b/apps/desktop/src/renderer/views/marketplace/market-models.ts
@@ -170,7 +170,7 @@ export interface AgentAuth {
}
/** What a setup terminal on the computer runs. */
-export type SetupStep = 'install' | 'login'
+export type SetupStep = 'install' | 'node' | 'login'
const s = (n: number) => n * 1000
diff --git a/apps/desktop/src/renderer/views/marketplace/marketplace.css b/apps/desktop/src/renderer/views/marketplace/marketplace.css
index 6e665f82..2aa6c221 100644
--- a/apps/desktop/src/renderer/views/marketplace/marketplace.css
+++ b/apps/desktop/src/renderer/views/marketplace/marketplace.css
@@ -78,6 +78,16 @@
row-gap: 4px;
}
+/* Node.js missing for some agents: one filled row above the grid (no border on a fill). */
+.node-notice {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 12px 14px;
+ border-radius: 12px;
+ background: var(--bubble-agent);
+}
+
.agent-card {
display: flex;
flex-direction: row;
diff --git a/apps/desktop/src/shared/models.ts b/apps/desktop/src/shared/models.ts
index 54e9e116..9da26d40 100644
--- a/apps/desktop/src/shared/models.ts
+++ b/apps/desktop/src/shared/models.ts
@@ -238,6 +238,8 @@ export interface Backend {
curated?: boolean
signedIn?: boolean
canInstall?: boolean
+ /** Only for an agent that runs on Node.js, on a computer without its own: Codync's copy is missing or added. */
+ node?: 'missing' | 'added'
}
export interface ScreenDisplay {
diff --git a/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift b/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift
index c36786af..ebeeb15c 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift
+++ b/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift
@@ -213,6 +213,12 @@ public struct Backend: Codable, Hashable, Sendable, Identifiable {
/// Missing when the host can't tell.
public var signedIn: Bool?
public var canInstall: Bool?
+ /// Only for an agent that runs on Node.js, on a computer without its own: Codync's copy
+ /// is `missing` or `added`.
+ public var node: String?
+
+ /// It can't run until Node.js is added to the computer.
+ public var needsNode: Bool { node == "missing" }
}
/// How an agent can be signed in, from asking the agent itself.
@@ -254,7 +260,7 @@ public struct AuthMethod: Decodable, Sendable, Identifiable, Hashable {
/// What a setup terminal on the computer runs.
public enum SetupStep: String, Codable, Sendable {
- case install, login
+ case install, node, login
}
public struct Hello: Codable, Sendable {
diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentSheet.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentSheet.swift
index bbc59a4d..4a5c3dd5 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentSheet.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentSheet.swift
@@ -1,9 +1,39 @@
import CodyncKit
import SwiftUI
-/// Getting an agent ready on the computer: install it, then sign in. Sign-in
-/// options come from the agent itself (ACP), plus Codync's own command for
-/// CLIs it knows. Bots are made from New chat, not here.
+/// Above the agents while some of them run on Node.js and the computer has none: one place
+/// to add Codync's copy for all of them.
+struct NodeNotice: View {
+ let add: () -> Void
+ @Environment(BotStore.self) private var model
+
+ var body: some View {
+ HStack(spacing: 12) {
+ Image(systemName: "shippingbox")
+ .font(.body)
+ .foregroundStyle(Palette.secondary)
+ .accessibilityHidden(true)
+ VStack(alignment: .leading, spacing: 2) {
+ Text("Node.js isn't on \(model.hostName)").font(.subheadline.weight(.semibold)).foregroundStyle(Palette.text)
+ Text("Some agents need it to run. Codync can add a copy just for them.")
+ .font(.caption)
+ .foregroundStyle(Palette.secondary)
+ }
+ Spacer(minLength: 8)
+ Button("Add Node.js", action: add)
+ .buttonStyle(PrimaryButtonStyle())
+ .fixedSize()
+ }
+ .padding(.horizontal, 14)
+ .padding(.vertical, 12)
+ .background(Palette.bubbleAgent.opacity(0.45), in: RoundedRectangle(cornerRadius: 18, style: .continuous))
+ .transition(.opacity)
+ }
+}
+
+/// Getting an agent ready on the computer: install it, add Node.js when it runs on Node and
+/// the computer has none, then sign in. Sign-in options come from the agent itself (ACP),
+/// plus Codync's own command for CLIs it knows. Bots are made from New chat, not here.
struct AgentSheet: View {
let initial: Backend
@Environment(BotStore.self) private var model
@@ -32,8 +62,9 @@ struct AgentSheet: View {
}
}
.frame(minWidth: 0, minHeight: 0)
- // A known "signed in" needs no agent start; everything else asks the agent.
- .task { if backend.signedIn != true { await check() } }
+ // A known "signed in" needs no agent start; everything else asks the agent (which
+ // can't start without its Node.js).
+ .task { if backend.signedIn != true, !backend.needsNode { await check() } }
.onChange(of: route) { old, new in
// Back from a terminal or key form: see what changed.
if new == nil, old != nil { Task { await check() } }
@@ -44,6 +75,7 @@ struct AgentSheet: View {
let back = { withAnimation(Motion.layout) { self.route = nil } }
switch route {
case .install: SetupTerminalView(backend: backend, step: .install, back: back)
+ case .node: SetupTerminalView(backend: backend, step: .node, back: back)
case .terminal(let method): SetupTerminalView(backend: backend, step: .login, method: method, back: back)
case .keys(let method): AgentKeysForm(backend: backend, method: method, saved: auth?.savedEnv ?? [], back: back) { auth = $0 }
}
@@ -82,6 +114,19 @@ struct AgentSheet: View {
)
}
}
+ if backend.node != nil {
+ CardSection {
+ SetupStepRow(
+ number: curated ? 2 : 1,
+ title: "Node.js",
+ detail: backend.needsNode
+ ? "\(backend.name) runs on Node.js. Codync adds its own copy."
+ : "Added on \(model.hostName).",
+ done: !backend.needsNode,
+ action: backend.needsNode ? ("Add", { go(.node) }) : nil
+ )
+ }
+ }
signInSection
if let error {
CardSection { Text(error).foregroundStyle(Palette.danger).textSelection(.enabled) }
@@ -94,7 +139,13 @@ struct AgentSheet: View {
? "Browser sign-ins open on \(model.hostName) itself. Away from it? Use Remote screen to finish there."
: nil) {
HStack(spacing: 0) {
- SetupStepRow(number: curated ? 2 : 1, title: "Sign in", detail: statusText, done: signedIn == true, action: nil)
+ SetupStepRow(
+ number: 1 + (curated ? 1 : 0) + (backend.node != nil ? 1 : 0),
+ title: "Sign in",
+ detail: statusText,
+ done: signedIn == true,
+ action: nil
+ )
if checking {
ThinkingOrb(state: .connecting, size: 16, color: Palette.secondary)
} else {
@@ -146,6 +197,7 @@ struct AgentSheet: View {
if checking { return auth == nil ? "Checking with \(backend.name)… The first check can download it." : "Checking…" }
switch signedIn {
case true?: return "Signed in."
+ case _ where backend.needsNode: return "Add Node.js first."
case false?: return "Not signed in yet."
case nil: return "Couldn't tell. Skip this if you've already signed in on \(model.hostName)."
}
@@ -205,6 +257,7 @@ struct AgentSheet: View {
private enum SetupRoute: Hashable {
case install
+ case node
case terminal(AuthMethod?)
case keys(AuthMethod)
}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketRows.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketRows.swift
index 4cd8e9c8..729992e5 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketRows.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketRows.swift
@@ -28,11 +28,10 @@ struct AgentCard: View {
@State private var hovering = false
private var status: String {
- switch (backend.installed == true, backend.signedIn) {
- case (true, false?): "Not signed in"
- case (true, _): "Installed"
- case (false, _): backend.curated == true ? "Not installed" : "Sets up on first use"
- }
+ if backend.installed != true, backend.curated == true { return "Not installed" }
+ if backend.needsNode { return "Needs Node.js" }
+ if backend.installed != true { return "Sets up on first use" }
+ return backend.signedIn == false ? "Not signed in" : "Installed"
}
var body: some View {
diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swift
index af6d845f..46b208b1 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swift
@@ -25,6 +25,7 @@ public struct MarketplaceView: View {
@State private var writingSkill = false
@State private var viewingSkill: SkillRef?
@State private var agent: Backend?
+ @State private var addingNode = false
/// Agents shown before "Load more agents".
@State private var agentLimit = 10
@State private var showInstalled = false
@@ -82,6 +83,7 @@ public struct MarketplaceView: View {
.codyncSheet(item: $viewingSkill) { SkillSheet(skill: $0) }
.codyncSheet(isPresented: $writingSkill) { NewSkillSheet() }
.codyncSheet(item: $agent) { b in AgentSheet(initial: b) }
+ .codyncSheet(isPresented: $addingNode) { SetupTerminalView(backend: nil, step: .node) { addingNode = false } }
}
private var page: some View {
@@ -91,6 +93,9 @@ public struct MarketplaceView: View {
searchField
if !agents.isEmpty {
MarketSection(title: query.isEmpty ? "Agents" : "Agents matching “\(query)”") {
+ if model.hello?.backends.contains(where: \.needsNode) == true {
+ NodeNotice { addingNode = true }
+ }
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack(spacing: 10) {
ForEach(agents.prefix(agentLimit)) { b in agentCard(b).frame(width: 128) }
diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/SetupTerminal.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/SetupTerminal.swift
index 169e5aca..82059ab9 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/SetupTerminal.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/SetupTerminal.swift
@@ -3,10 +3,11 @@ import SwiftTerm
import SwiftUI
import UIKit
-/// Installing or signing in to an agent, live: the command runs in a terminal
-/// on the computer and this screen is that terminal (links open here).
+/// Installing or signing in to an agent, or adding Node.js, live: the command runs in a
+/// terminal on the computer and this screen is that terminal (links open here).
struct SetupTerminalView: View {
- let backend: Backend
+ /// Nil only for the `node` step, which belongs to the computer.
+ let backend: Backend?
let step: SetupStep
/// A terminal sign-in method the agent offered; nil runs Codync's own command.
var method: AuthMethod?
@@ -16,12 +17,21 @@ struct SetupTerminalView: View {
@Environment(\.openURL) private var openURL
@State private var session = TermSession()
+ private var title: String {
+ let name = backend?.name ?? "the agent"
+ switch step {
+ case .node: return "Add Node.js"
+ case .install: return "Install \(name)"
+ case .login: return method?.name ?? "Sign in to \(name)"
+ }
+ }
+
var body: some View {
VStack(spacing: 0) {
ScreenHeader {
BackButton(action: back).keyboardShortcut(.cancelAction)
} title: {
- Text(step == .install ? "Install \(backend.name)" : method?.name ?? "Sign in to \(backend.name)")
+ Text(title)
.font(.body.weight(.semibold))
.foregroundStyle(Palette.text)
.lineLimit(1)
@@ -36,7 +46,7 @@ struct SetupTerminalView: View {
.background(Palette.background)
.task {
guard let client = model.client else { return }
- await session.run(client, backend: backend.id, step: step, method: method?.id)
+ await session.run(client, backend: backend?.id ?? "", step: step, method: method?.id)
await model.refreshBackends()
}
.onDisappear { session.close() }
diff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.md
index 81517054..861d7705 100644
--- a/apps/ios/WhatsNew.md
+++ b/apps/ios/WhatsNew.md
@@ -5,14 +5,14 @@ listing what iPhone users notice. tools/asc-submit.py reads the released version
a version without one gets a generic "Bug fixes and improvements" line. Delete old sections.
-->
-## 2.16.0
+## 2.16.1
### zh-Hant
-- 新增 oh-my-pi(omp):在電腦上裝好並登入後,就能選它當 bot 的 agent。
-- 「Marketplace」改名為「Extensions」:agent、連接器和技能都在這裡。
+- 電腦上沒有 Node.js 時,Extensions 會標出需要它的 agent,按一下就能讓 Codync 幫那台電腦加上。
+- Windows 電腦上的 Claude Code、Codex 等 agent 現在可以正常啟動了。
### en-US
-- Bots can now run on oh-my-pi (omp): once it's installed and signed in on your computer, pick it as a bot's agent.
-- Marketplace is now called Extensions: agents, connectors and skills all live there.
+- When your computer doesn't have Node.js, Extensions shows which agents need it, and one tap has Codync add it.
+- Claude Code, Codex and other agents now start on Windows computers.
diff --git a/docs/archive/windows-npm-agents-2026-10-14.md b/docs/archive/windows-npm-agents-2026-10-14.md
index c869103e..b4e86940 100644
--- a/docs/archive/windows-npm-agents-2026-10-14.md
+++ b/docs/archive/windows-npm-agents-2026-10-14.md
@@ -66,8 +66,8 @@ failed download reports the last stderr line that isn't an `npm notice`.
## Seen, not fixed
- Without Node.js, an npx-only agent couldn't start at all, and its install hint named the harness
- setup (Claude Code), which was already done. Resolved in the same release: Codync provides
- Node.js itself and installs Claude Code and Codex with npm ([agent setup](../features/marketplace.md)).
+ setup (Claude Code), which was already done. Resolved in the same release: Extensions and the
+ agent's setup offer to add Codync's own Node.js ([agent setup](../features/marketplace.md)).
- Every new bot on Windows posts `Memory is unavailable; … installing Engram: Access is denied.
(os error 5)`.
diff --git a/docs/features/marketplace.md b/docs/features/marketplace.md
index bbcdd738..6271e0a3 100644
--- a/docs/features/marketplace.md
+++ b/docs/features/marketplace.md
@@ -9,7 +9,7 @@ The Extensions screen configures capabilities installed on the selected computer
| Connected apps | `host/src/market/composio.rs` | Expose connected Composio apps as connectors |
| Skills | `host/src/market/skills.rs` | Instruction folders containing `SKILL.md`, stored under `~/.codync/skills/<id>`; on for every bot unless a bot turns it off |
-Agents never need Node.js installed first. Install for an npm CLI (Claude Code `@anthropic-ai/claude-code`, Codex `@openai/codex`, Pi) runs `codync-host npm install -g <package>` in a setup terminal: npm on the computer's own Node when it has one, else on Codync's. Codync's Node is the official build of a pinned version (`VERSION` and SHA-256s in `node.rs`), downloaded once into `~/.codync/node/<version>`; npm installs CLIs with it into `~/.codync/node/global`. Agents launched through `npx` (the Claude and Codex ACP adapters, Gemini, Qwen…) use the same Node, downloaded on their first start if missing. Both folders come last on the agent search path, so the computer's own Node and CLIs always win. Linux builds of Node need glibc: on musl distros (Alpine) install Node.js yourself.
+Install runs the CLI's own native installer where it has one (Claude Code, Codex, Cursor, OpenCode…, `Install` in `backends.rs`); CLIs published only on npm install with `codync-host npm install -g <package>`, npm on the computer's own Node or else on Codync's. Many agents' ACP adapters run through `npx` (Claude, Codex, Gemini, Qwen…). On a computer without Node.js, the agent list marks each of them `node: "missing"` (only then is the field there; `added` once Codync's copy is in place) and they aren't available; Extensions shows one *Add Node.js* notice above the agents, each such agent reads *Needs Node.js*, and its setup sheet gets a Node.js step between Install and Sign in. Adding it (`agentSetup {step: "node"}`, a setup terminal running `codync-host node`) downloads the official Node.js of a pinned version (`VERSION` and SHA-256s in `node.rs`) once into `~/.codync/node/<version>`; npm installs with it go to `~/.codync/node/global`. Both folders come last on the agent search path, so the computer's own Node and CLIs always win, and nothing outside `~/.codync` changes. Linux builds of Node need glibc: on musl distros (Alpine) install Node.js yourself.
The Connectors shelf opens with a short featured list, then pages through the whole MCP Registry (`marketConnectors {search, cursor}` → `{items, nextCursor}`, 60 metadata records per API page; the UI initially shows 12 and reveals another 12 only when *Load more connectors* is pressed). Apps through Composio use the same 12-at-a-time display with *Load more apps*. Searching resets the visible batch; late responses from an older search are ignored. Scrolling never triggers another catalog fetch. Listed: stdio npm/PyPI/OCI/NuGet packages (the registry's runtime and package arguments become inputs) and streamable-HTTP or SSE remotes (URL `{variables}` become inputs). Not listed: MCPB bundles and packages that serve HTTP locally; add those as a custom connector.
diff --git a/docs/guides/linux-servers.md b/docs/guides/linux-servers.md
index 45cde327..23183ace 100644
--- a/docs/guides/linux-servers.md
+++ b/docs/guides/linux-servers.md
@@ -9,7 +9,7 @@
| x86_64 or arm64 Linux | Release builds exist for both architectures |
| `ca-certificates` | HTTPS to the ACP registry, push relay and cloud. Every normal VM image has it; bare container images (`debian`, `ubuntu`) need `apt-get install ca-certificates`. Without it every command exits with `TLS setup failed: install the ca-certificates package` |
| systemd | Only for `codync-host install` (background service). Without systemd, run `codync-host serve` under your own supervisor |
-| Node.js (optional) | Claude Code, Codex and Pi run through ACP adapters fetched with `npx`. Without Node, Codync downloads its own (glibc distros); on musl distros (Alpine) install Node.js |
+| Node.js (optional) | Claude Code, Codex and Pi run through ACP adapters fetched with `npx`. Without Node, an agent's setup offers to add Codync's own copy (glibc distros; over SSH: `codync-host node`); on musl distros (Alpine) install Node.js |
| The agents you want, signed in | The host drives the CLIs installed on this machine with their own credentials. Sign in over SSH (`claude`, `codex login`…) as the same user that runs the host |
Distro and C library don't matter. From the first release built by the updated workflow, Linux release binaries are static musl builds with no glibc dependency. Earlier releases (≤ 2.1.0) were built against glibc 2.39 and only start on Ubuntu 24.04 or newer. On older distros they fail with `GLIBC_2.39 not found`; build from source or use a newer release there.
diff --git a/docs/guides/windows-testing.md b/docs/guides/windows-testing.md
index 107858d7..2171e33f 100644
--- a/docs/guides/windows-testing.md
+++ b/docs/guides/windows-testing.md
@@ -42,10 +42,11 @@ when a change or a bug depends on Windows itself (paths, `cmd.exe`, `.cmd` shims
`createBot`, `send` and `history` cover most agent checks; a failed start shows up as an error
notice in `history`. Host logs are under `%USERPROFILE%\.codync`.
-4. Agents: *Install* in the agent sheet (or the CLI's own installer). Agents that come from npm
- (Claude, Codex, Gemini, Qwen, …) don't need Node.js on the VM: without one, Codync downloads its
- own into `%USERPROFILE%\.codync\node` (see [agent setup](../features/marketplace.md)). To test
- the computer's own Node instead, `winget install OpenJS.NodeJS`.
+4. Agents: *Install* in the agent sheet runs the CLI's native installer. Agents whose ACP adapter
+ comes from npm (Claude, Codex, Gemini, Qwen, …) need Node.js: without one on the VM, Extensions
+ shows *Add Node.js*, which puts Codync's own copy in `%USERPROFILE%\.codync\node` (see
+ [agent setup](../features/marketplace.md)). To test the computer's own Node instead,
+ `winget install OpenJS.NodeJS`.
## Limits
diff --git a/host/src/agent/backends.rs b/host/src/agent/backends.rs
index 2631d666..951dbdf4 100644
--- a/host/src/agent/backends.rs
+++ b/host/src/agent/backends.rs
@@ -7,7 +7,7 @@
//! back to the official ACP registry build (npx / uvx / downloaded binary).
use crate::LockExt;
-use crate::agent::registry;
+use crate::agent::{node, registry};
use crate::shell;
use serde_json::{Value, json};
use std::collections::HashSet;
@@ -90,7 +90,10 @@ pub const HARNESSES: &[Harness] = &[
local: None,
registry: Some("claude-acp"),
setup: "Install Claude Code and run `claude auth login`.",
- install: Some(Install::Npm("@anthropic-ai/claude-code")),
+ install: Some(Install::Scripts {
+ unix: "curl -fsSL https://claude.ai/install.sh | bash",
+ windows: "powershell -NoProfile -ExecutionPolicy Bypass -Command \"irm https://claude.ai/install.ps1 | iex\"",
+ }),
login: "{bin} auth login",
signed_in: Some(SignInCheck { args: "auth status", ok: claude_signed_in }),
},
@@ -101,7 +104,10 @@ pub const HARNESSES: &[Harness] = &[
local: None,
registry: Some("codex-acp"),
setup: "Install Codex CLI and run `codex login --device-auth`.",
- install: Some(Install::Npm("@openai/codex")),
+ install: Some(Install::Scripts {
+ unix: "curl -fsSL https://chatgpt.com/codex/install.sh | sh",
+ windows: "powershell -NoProfile -ExecutionPolicy Bypass -Command \"irm https://chatgpt.com/codex/install.ps1 | iex\"",
+ }),
login: "{bin} login --device-auth",
signed_in: Some(SignInCheck { args: "login status", ok: exit_ok }),
},
@@ -477,7 +483,7 @@ fn well_known_dirs() -> Vec<PathBuf> {
dirs.extend(versions.into_iter().map(|p| p.join("bin")));
}
// Last, so the computer's own Node comes first.
- dirs.extend(crate::agent::node::search_dirs());
+ dirs.extend(node::search_dirs());
dirs
}
@@ -548,8 +554,9 @@ pub fn list() -> Vec<Value> {
.map(|h| {
let path = h.bins.iter().find_map(|b| which(b));
let reg = h.registry.and_then(|id| registry.iter().find(|a| a["id"] == id));
- let runnable =
- (path.is_some() && h.local.is_some()) || reg.is_some_and(|a| registry::launch_kind(a).is_some());
+ let native = path.is_some() && h.local.is_some();
+ let runnable = native || reg.is_some_and(|a| registry::launch_kind(a).is_some());
+ let node = if native { None } else { reg.filter(|a| registry::needs_node(a)).and_then(|_| node::state()) };
json!({
"id": h.id,
"name": h.name,
@@ -560,6 +567,7 @@ pub fn list() -> Vec<Value> {
"installHint": h.setup,
"signedIn": signed_in(h.id),
"canInstall": h.install.and_then(Install::command).is_some(),
+ "node": node.map(node::State::name),
"command": h.local.unwrap_or_default(),
"registry": h.registry,
"curated": true,
@@ -582,6 +590,7 @@ pub fn list() -> Vec<Value> {
"description": a["description"],
"installHint": format!("Codync installs it automatically. Sign in to {} on this computer first if it needs an account.", a["name"].as_str().unwrap_or(id)),
"signedIn": signed_in(id),
+ "node": node::state().filter(|_| registry::needs_node(a)).map(node::State::name),
"command": "",
"registry": id,
"curated": false,
diff --git a/host/src/agent/node.rs b/host/src/agent/node.rs
index 349fc73e..03590c19 100644
--- a/host/src/agent/node.rs
+++ b/host/src/agent/node.rs
@@ -1,6 +1,7 @@
-//! Node.js for the agents that come from npm (Claude, Codex, Gemini, …) and for installing npm
-//! CLIs: the computer's own when it has one, else a checksum-pinned official build Codync
-//! downloads once into `~/.codync/node`, so installing an agent never needs Node.js first.
+//! Node.js for the agents whose ACP adapter comes from npm (Claude, Codex, Gemini, …) and for
+//! installing npm CLIs: the computer's own when it has one, else a checksum-pinned official
+//! build that Codync adds into `~/.codync/node` when the user asks (an agent's setup, or
+//! installing an npm CLI).
use crate::agent::{backends, registry};
use anyhow::{Context, Result, ensure};
@@ -45,18 +46,38 @@ pub fn search_dirs() -> [PathBuf; 2] {
[bin_dir(root()), bin_dir(global_prefix())]
}
-/// Codync can run npm agents here: the computer has Node, or Codync has one for it.
-pub fn available() -> bool {
- backends::on_path("npx") || archive(std::env::consts::OS, std::env::consts::ARCH).is_some()
+/// Node.js on a computer without its own: Codync's, missing or added.
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum State {
+ Missing,
+ Added,
}
-/// Makes `npx` runnable for agents, downloading Codync's Node the first time it's missing.
-pub async fn ensure(progress: &impl Fn(&str)) -> Result<()> {
- if backends::on_path("npx") {
+impl State {
+ pub fn name(self) -> &'static str {
+ match self {
+ Self::Missing => "missing",
+ Self::Added => "added",
+ }
+ }
+}
+
+/// `None` while the computer has its own Node; otherwise whether Codync's is there.
+pub fn state() -> Option<State> {
+ if backends::which("npx").is_some_and(|npx| !npx.starts_with(root())) {
+ return None;
+ }
+ Some(if root().join(".installed").exists() { State::Added } else { State::Missing })
+}
+
+/// `codync-host node`: adds Codync's Node (an agent's setup step runs it in a terminal).
+pub async fn add() -> Result<()> {
+ if state().is_none() {
+ println!("This computer already has Node.js.");
return Ok(());
}
- install(progress).await?;
- tokio::task::spawn_blocking(backends::hydrate_path).await?;
+ install(&|line| println!("{line}")).await?;
+ println!("Node.js {VERSION} is ready.");
Ok(())
}
diff --git a/host/src/agent/registry.rs b/host/src/agent/registry.rs
index 6c7b3f16..c900c716 100644
--- a/host/src/agent/registry.rs
+++ b/host/src/agent/registry.rs
@@ -92,7 +92,7 @@ pub fn launch_kind(agent: &Value) -> Option<Launch> {
{
return Some(Launch::Download);
}
- if d["npx"].is_object() && crate::agent::node::available() {
+ if d["npx"].is_object() && on_path("npx") {
return Some(Launch::Npx);
}
if d["uvx"].is_object() && on_path("uvx") {
@@ -101,6 +101,12 @@ pub fn launch_kind(agent: &Value) -> Option<Launch> {
None
}
+/// The agent runs through `npx` here (no build of its own for this platform).
+pub fn needs_node(agent: &Value) -> bool {
+ let d = &agent["distribution"];
+ d["npx"].is_object() && !platform().is_some_and(|p| d["binary"][p].is_object())
+}
+
fn args_of(v: &Value) -> String {
v["args"]
.as_array()
@@ -160,7 +166,6 @@ pub async fn command(agent: &Value, progress: impl Fn(&str)) -> Result<Cmd> {
})
}
Some(Launch::Npx) => {
- crate::agent::node::ensure(&progress).await?;
prepare_npx(d["npx"]["package"].as_str().unwrap_or_default(), name, &progress).await?;
Ok(npx_cmd(&d["npx"]))
}
@@ -172,10 +177,10 @@ pub async fn command(agent: &Value, progress: impl Fn(&str)) -> Result<Cmd> {
),
args: args_of(&d["uvx"]),
}),
- None => bail!(
- "{name} has no build for this computer (needs {})",
- if d["uvx"].is_object() { "uv" } else { "Node.js" }
- ),
+ None if needs_node(agent) => {
+ bail!("{name} needs Node.js on this computer: add it in {name}'s setup in Extensions")
+ }
+ None => bail!("{name} has no build for this computer (needs uv)"),
}
}
diff --git a/host/src/agent/term.rs b/host/src/agent/term.rs
index 21825c2f..5e454edb 100644
--- a/host/src/agent/term.rs
+++ b/host/src/agent/term.rs
@@ -25,6 +25,8 @@ const LINGER: Duration = Duration::from_secs(10 * 60);
#[serde(rename_all = "camelCase")]
pub enum Step {
Install,
+ /// Codync's Node.js, for agents that run on it (one terminal for every agent).
+ Node,
Login,
}
@@ -103,6 +105,7 @@ impl Terms {
let h = backends::harness(backend);
let name = h.map_or(backend, |h| h.name);
let command = match step {
+ Step::Node => format!("{} node", crate::shell::quote(&crate::service::current_exe()?.to_string_lossy())),
Step::Install => {
let h = h.ok_or_else(|| anyhow!("Codync downloads {name} by itself"))?;
h.install.and_then(backends::Install::command).ok_or_else(|| anyhow!("{}", h.setup))?
diff --git a/host/src/api/host.rs b/host/src/api/host.rs
index e4df59df..e18f527d 100644
--- a/host/src/api/host.rs
+++ b/host/src/api/host.rs
@@ -97,7 +97,9 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value
let step: crate::agent::term::Step =
serde_json::from_value(b["step"].clone()).context("`step` is install or login")?;
let (cols, rows) = term_size(&b);
- json!({"term": hub.terms.start(str_arg(&b, "backend")?, step, b["method"].as_str(), cols, rows).await?})
+ // Node.js belongs to the computer, not to one agent.
+ let backend = if step == crate::agent::term::Step::Node { "" } else { str_arg(&b, "backend")? };
+ json!({"term": hub.terms.start(backend, step, b["method"].as_str(), cols, rows).await?})
}
"agentModels" => crate::agent::auth::models(&hub.store, str_arg(&b, "backend")?).await?,
"agentAuth" => crate::agent::auth::check(&hub.store, str_arg(&b, "backend")?).await?,
diff --git a/host/src/main.rs b/host/src/main.rs
index fc07ceca..c0ad5b23 100644
--- a/host/src/main.rs
+++ b/host/src/main.rs
@@ -188,6 +188,9 @@ enum Sub {
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
args: Vec<String>,
},
+ /// Add Codync's own Node.js, for agents that run on it (an agent's setup step).
+ #[command(hide = true)]
+ Node,
/// Built-in MCP servers that bots are started with (stdio).
#[command(hide = true)]
Mcp {
@@ -472,6 +475,7 @@ async fn main() -> Result<()> {
);
Ok(())
}
+ Sub::Node => agent::node::add().await,
Sub::Npm { args } => std::process::exit(agent::node::npm(&args).await?),
Sub::Statusline { port, wrapped } => {
statusline(port, wrapped.join(" ")).await;
diff --git a/host/src/tui/manage/agent.rs b/host/src/tui/manage/agent.rs
index 93775033..6a7979dc 100644
--- a/host/src/tui/manage/agent.rs
+++ b/host/src/tui/manage/agent.rs
@@ -8,7 +8,9 @@ use super::{AgentSetup, Fields, Input, Reply, SetupRow, Submit, ctrl, s};
impl App {
pub fn open_agent(&mut self, backend: &str) {
- let known = self.backends.iter().find(|b| b["id"] == backend).is_some_and(|b| b["signedIn"] == true);
+ let b = self.backends.iter().find(|b| b["id"] == backend);
+ // An agent without its Node.js can't start, so there's nothing to ask it yet.
+ let known = b.is_some_and(|b| b["signedIn"] == true || b["node"] == "missing");
let mut a = AgentSetup { backend: backend.to_owned(), auth: None, busy: false, cursor: 0, error: None };
if !known {
a.busy = true;
@@ -23,6 +25,9 @@ impl App {
if b.is_some_and(|b| b["curated"] == true && b["installed"] != true && b["canInstall"] == true) {
rows.push(SetupRow::Install);
}
+ if b.is_some_and(|b| b["node"] == "missing") {
+ rows.push(SetupRow::Node);
+ }
let signed_in =
a.auth.as_ref().map_or_else(|| b.map(|b| &b["signedIn"]) == Some(&json!(true)), |v| v["signedIn"] == true);
if !signed_in && !a.busy {
@@ -49,6 +54,7 @@ impl App {
let size = json!({"cols": cols, "rows": rows_n});
match rows.get(a.cursor) {
Some(SetupRow::Install) => self.start_setup(&backend, "install", None, &size),
+ Some(SetupRow::Node) => self.start_setup(&backend, "node", None, &size),
Some(SetupRow::Login) => self.start_setup(&backend, "login", None, &size),
Some(SetupRow::Method(m)) => match m["kind"].as_str() {
Some("terminal") => self.start_setup(&backend, "login", m["id"].as_str(), &size),
@@ -89,7 +95,7 @@ impl App {
Some(Overlay::Agent(a))
}
- fn start_setup(&mut self, backend: &str, step: &str, method: Option<&str>, size: &Value) {
+ pub(super) fn start_setup(&mut self, backend: &str, step: &str, method: Option<&str>, size: &Value) {
let mut body = json!({"backend": backend, "step": step, "cols": size["cols"], "rows": size["rows"]});
if let Some(m) = method {
body["method"] = m.into();
diff --git a/host/src/tui/manage/market.rs b/host/src/tui/manage/market.rs
index 9ef22025..c57e793b 100644
--- a/host/src/tui/manage/market.rs
+++ b/host/src/tui/manage/market.rs
@@ -34,13 +34,14 @@ impl App {
fuzzy(q, &fields)
};
match m.tab {
- Tab::Agents => self
- .backends
- .iter()
- .filter(|b| b["available"] == true || b["installed"] == true || b["curated"] == true)
- .filter(|b| hit(b, &["name", "id"]))
- .map(Row::Agent)
- .collect(),
+ Tab::Agents => {
+ let agents = self
+ .backends
+ .iter()
+ .filter(|b| b["available"] == true || b["installed"] == true || b["curated"] == true);
+ let node = agents.clone().any(|b| b["node"] == "missing").then_some(Row::Node);
+ node.into_iter().chain(agents.filter(|b| hit(b, &["name", "id"])).map(Row::Agent)).collect()
+ }
Tab::Connectors => {
let installed: Vec<&str> = self.plugins.0.iter().filter_map(|c| c["registryName"].as_str()).collect();
let mut rows: Vec<Row> =
@@ -140,6 +141,7 @@ impl App {
fn market_enter(&mut self, mut m: Box<Market>) -> Option<Overlay> {
enum Act {
+ Node,
Agent(String),
SignIn(String),
Custom,
@@ -149,6 +151,7 @@ impl App {
None,
}
let act = match self.market_rows(&m).get(m.cursor) {
+ Some(Row::Node) => Act::Node,
Some(Row::Agent(b)) => Act::Agent(s(b, "id")),
Some(Row::Installed(c)) if c["auth"] == "signedOut" => Act::SignIn(s(c, "id")),
Some(Row::Custom) => Act::Custom,
@@ -159,6 +162,10 @@ impl App {
_ => Act::None,
};
match act {
+ Act::Node => {
+ let (cols, rows) = crossterm::terminal::size().unwrap_or((80, 24));
+ self.start_setup("", "node", None, &json!({"cols": cols, "rows": rows}));
+ }
Act::Agent(id) => {
self.overlays.push(Overlay::Market(m));
self.open_agent(&id);
diff --git a/host/src/tui/manage/mod.rs b/host/src/tui/manage/mod.rs
index 703aba2e..b953a657 100644
--- a/host/src/tui/manage/mod.rs
+++ b/host/src/tui/manage/mod.rs
@@ -123,6 +123,8 @@ pub struct Market {
}
pub enum Row<'a> {
+ /// Some agents run on Node.js and the computer has none: adds Codync's copy.
+ Node,
Agent(&'a Value),
Installed(&'a Value),
Custom,
@@ -143,6 +145,7 @@ pub struct AgentSetup {
pub enum SetupRow {
Install,
+ Node,
Login,
Method(Value),
Check,
diff --git a/host/src/tui/sheets.rs b/host/src/tui/sheets.rs
index 1316421e..561c3f04 100644
--- a/host/src/tui/sheets.rs
+++ b/host/src/tui/sheets.rs
@@ -198,12 +198,19 @@ pub fn market(buf: &mut Buffer, area: Rect, app: &App, m: &Market) {
for (i, item) in rows.iter().enumerate().skip(window(m.cursor, list_h)).take(list_h) {
let base = row(buf, inner, y, i == m.cursor);
let (mark, name, detail, right): (&str, String, String, String) = match item {
+ Row::Node => (
+ "+",
+ "Add Node.js".into(),
+ "Some agents need it to run. Codync adds a copy just for them.".into(),
+ String::new(),
+ ),
Row::Agent(b) => {
let status = match (b["installed"] == true, b["signedIn"].as_bool()) {
+ (false, _) if b["curated"] == true => "not installed",
+ _ if b["node"] == "missing" => "needs Node.js",
(_, Some(true)) => "signed in",
(true, Some(false)) => "not signed in",
(true, None) => "installed",
- (false, _) if b["curated"] == true => "not installed",
(false, _) => "sets up on first use",
};
let mark = if b["signedIn"] == true || b["installed"] == true { "✓" } else { "↓" };
@@ -265,6 +272,8 @@ pub fn agent(buf: &mut Buffer, area: Rect, app: &App, a: &AgentSetup) {
} else {
"Working…".into()
}
+ } else if signed_in != Some(true) && b.is_some_and(|b| b["node"] == "missing") {
+ "Add Node.js first.".into()
} else {
match signed_in {
Some(true) => "Signed in.".into(),
@@ -289,6 +298,9 @@ pub fn agent(buf: &mut Buffer, area: Rect, app: &App, a: &AgentSetup) {
let base = row(buf, inner, y, i == a.cursor);
let (icon, title, detail) = match rw {
SetupRow::Install => ("↓", "Install".to_owned(), format!("Runs the official installer on {}.", app.host)),
+ SetupRow::Node => {
+ ("↓", "Add Node.js".to_owned(), format!("{name} runs on Node.js. Codync adds its own copy."))
+ }
SetupRow::Login => ("›_", "Sign in".to_owned(), format!("In a terminal on {}.", app.host)),
SetupRow::Method(m) => {
let (icon, fallback) = match s(m, "kind") {