@growthub/cli 0.13.1 → 0.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/refresh-sources/route.js +24 -2
  2. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/route.js +14 -0
  3. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/sandbox-agent-auth/login/route.js +74 -0
  4. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/sandbox-agent-auth/logout/route.js +67 -0
  5. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/sandbox-agent-auth/status/route.js +77 -0
  6. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/sandbox-run/route.js +48 -3
  7. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/DataModelShell.jsx +123 -27
  8. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/OrchestrationNodeConfigPanel.jsx +136 -0
  9. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/OrchestrationRunTracePanel.jsx +713 -92
  10. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/SandboxAgentAuthPanel.jsx +224 -0
  11. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/SandboxRunPanel.jsx +32 -1
  12. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/globals.css +514 -9
  13. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/page.jsx +8 -1
  14. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/settings/integrations/page.jsx +10 -7
  15. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workflows/RunSetupPanel.jsx +261 -0
  16. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workflows/WorkflowSurface.jsx +72 -7
  17. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workspace-builder.jsx +778 -140
  18. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workspace-rail.jsx +91 -14
  19. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/docs/sandbox-environment-primitive.md +35 -0
  20. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/orchestration-graph-runner.js +15 -3
  21. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/orchestration-run-console.js +384 -0
  22. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/orchestration-run-inputs.js +323 -0
  23. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/orchestration-run-trace.js +32 -3
  24. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/sandbox-agent-auth-eligibility.js +50 -0
  25. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/sandbox-agent-auth-redaction.js +64 -0
  26. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/sandbox-agent-auth.js +629 -0
  27. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/sandbox-agent-host-catalog.js +168 -0
  28. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-chart-values.js +542 -0
  29. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-data-model.js +164 -7
  30. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-helper.js +11 -0
  31. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-schema.js +111 -1
  32. package/assets/worker-kits/growthub-custom-workspace-starter-v1/kit.json +9 -0
  33. package/package.json +1 -1
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Local agent host capability catalog — auth onboarding side.
3
+ *
4
+ * The execution catalog lives in
5
+ * `lib/adapters/sandboxes/default-local-agent-host.js` (HOST_CATALOG). That
6
+ * one is intentionally minimal — `{ binary, argv, inputMode, installHint }`
7
+ * — so the thin adapter can spawn the CLI and capture stdout/stderr without
8
+ * knowing anything about auth state.
9
+ *
10
+ * This catalog is the **auth onboarding sidecar** mirror. For each canonical
11
+ * host slug it declares:
12
+ *
13
+ * label human-readable name surfaced in the sandbox sidecar.
14
+ * binary default binary to invoke when the row has no override.
15
+ * installHint verbatim install hint, identical to the execution
16
+ * catalog so the UI does not drift.
17
+ * versionProbe argv used as a cheap reachability check. Exit 0 → CLI
18
+ * is installed and callable. NEVER promotes to "active";
19
+ * only "reachable".
20
+ * authStatusProbe (optional) argv that the CLI exposes to report current
21
+ * auth state. Exit 0 → "active". Stale-pattern output →
22
+ * "stale". Unknown-subcommand output → fall back to
23
+ * versionProbe.
24
+ * loginCommand (optional) argv that opens an interactive (or
25
+ * URL-printing) login flow.
26
+ * logoutCommand (optional) argv that clears the CLI's on-disk session.
27
+ * loginTimeoutMs override for the login subprocess timeout.
28
+ * notes user-facing note explaining why login may be missing
29
+ * for a host we do not have a documented login flow for.
30
+ *
31
+ * Hosts where we do not have authoritative knowledge of a login subcommand
32
+ * intentionally OMIT `loginCommand` / `logoutCommand`. The UI then surfaces
33
+ * only the reachability probe and the install hint — we never invent a
34
+ * subcommand we cannot verify against the upstream tool.
35
+ *
36
+ * Adding a new host:
37
+ * 1. Add a slug to `KNOWN_SANDBOX_AGENT_HOSTS` in `workspace-schema.js`.
38
+ * 2. Add the corresponding execution entry to `HOST_CATALOG` in
39
+ * `default-local-agent-host.js`.
40
+ * 3. Add the corresponding auth onboarding entry here. If the host has no
41
+ * documented login subcommand, ship it with only `versionProbe` + a
42
+ * `notes` string.
43
+ */
44
+
45
+ const DEFAULT_LOGIN_TIMEOUT_MS = 300_000;
46
+ const DEFAULT_LOGOUT_TIMEOUT_MS = 10_000;
47
+ const DEFAULT_PROBE_TIMEOUT_MS = 10_000;
48
+
49
+ const HOST_AUTH_CATALOG = Object.freeze({
50
+ claude_local: {
51
+ label: "Claude Code (local)",
52
+ binary: "claude",
53
+ installHint: "Install Claude Code: npm i -g @anthropic-ai/claude-code",
54
+ versionProbe: ["--version"],
55
+ authStatusProbe: ["auth", "status"],
56
+ loginCommand: ["auth", "login"],
57
+ logoutCommand: ["auth", "logout"],
58
+ loginTimeoutMs: DEFAULT_LOGIN_TIMEOUT_MS,
59
+ notes: ""
60
+ },
61
+ codex_local: {
62
+ label: "Codex CLI (local)",
63
+ binary: "codex",
64
+ installHint: "Install Codex CLI: npm i -g @openai/codex",
65
+ versionProbe: ["--version"],
66
+ authStatusProbe: ["login", "status"],
67
+ loginCommand: ["login"],
68
+ logoutCommand: ["logout"],
69
+ loginTimeoutMs: DEFAULT_LOGIN_TIMEOUT_MS,
70
+ notes: ""
71
+ },
72
+ cursor: {
73
+ label: "Cursor Agent (local)",
74
+ binary: "cursor-agent",
75
+ installHint: "Install Cursor Agent CLI: curl https://cursor.com/install -fsS | bash",
76
+ versionProbe: ["--version"],
77
+ authStatusProbe: ["status"],
78
+ loginCommand: ["login"],
79
+ logoutCommand: ["logout"],
80
+ loginTimeoutMs: DEFAULT_LOGIN_TIMEOUT_MS,
81
+ notes: ""
82
+ },
83
+ gemini_local: {
84
+ label: "Gemini CLI (local)",
85
+ binary: "gemini",
86
+ installHint: "Install Gemini CLI: npm i -g @google/gemini-cli",
87
+ versionProbe: ["--version"],
88
+ notes: ""
89
+ },
90
+ opencode_local: {
91
+ label: "OpenCode (local)",
92
+ binary: "opencode",
93
+ installHint: "Install OpenCode: npm i -g opencode-ai",
94
+ versionProbe: ["--version"],
95
+ notes: ""
96
+ },
97
+ pi_local: {
98
+ label: "Pi (local)",
99
+ binary: "pi",
100
+ installHint: "Install Pi CLI: refer to your Paperclip Pi distribution",
101
+ versionProbe: ["--version"],
102
+ notes: ""
103
+ },
104
+ qwen_local: {
105
+ label: "Qwen Code (local)",
106
+ binary: "qwen",
107
+ installHint: "Install Qwen Code CLI: refer to your Qwen distribution",
108
+ versionProbe: ["--version"],
109
+ notes: ""
110
+ },
111
+ hermes_local: {
112
+ label: "Hermes Paperclip (local)",
113
+ binary: "hermes",
114
+ installHint: "Install Hermes Paperclip adapter: npm i -g hermes-paperclip-adapter",
115
+ versionProbe: ["--version"],
116
+ notes: ""
117
+ },
118
+ openclaw_gateway: {
119
+ label: "OpenClaw Gateway (local)",
120
+ binary: "openclaw",
121
+ installHint: "Install OpenClaw Gateway: refer to your Paperclip distribution",
122
+ versionProbe: ["--version"],
123
+ notes: ""
124
+ }
125
+ });
126
+
127
+ const KNOWN_HOST_AUTH_SLUGS = Object.freeze(Object.keys(HOST_AUTH_CATALOG));
128
+
129
+ function getHostAuthSpec(slug) {
130
+ return HOST_AUTH_CATALOG[String(slug || "").trim()] || null;
131
+ }
132
+
133
+ /**
134
+ * Returns the capability flags the UI needs to decide which buttons to show
135
+ * for a row. Always safe to call — returns `null` for unknown / non-eligible
136
+ * rows so the caller can fall back to a no-panel state.
137
+ */
138
+ function getAgentHostCapabilities(row) {
139
+ if (!row || typeof row !== "object" || Array.isArray(row)) return null;
140
+ const adapter = String(row.adapter || "").trim();
141
+ const agentHost = String(row.agentHost || "").trim();
142
+ const runLocality = String(row.runLocality || "").trim().toLowerCase();
143
+ if (adapter !== "local-agent-host") return null;
144
+ if (runLocality === "serverless") return null;
145
+ const spec = getHostAuthSpec(agentHost);
146
+ if (!spec) return null;
147
+ return {
148
+ slug: agentHost,
149
+ label: spec.label,
150
+ binary: spec.binary,
151
+ installHint: spec.installHint,
152
+ notes: spec.notes || "",
153
+ canCheckStatus: true,
154
+ canLogin: Array.isArray(spec.loginCommand) && spec.loginCommand.length > 0,
155
+ canLogout: Array.isArray(spec.logoutCommand) && spec.logoutCommand.length > 0,
156
+ hasAuthStatusProbe: Array.isArray(spec.authStatusProbe) && spec.authStatusProbe.length > 0
157
+ };
158
+ }
159
+
160
+ export {
161
+ DEFAULT_LOGIN_TIMEOUT_MS,
162
+ DEFAULT_LOGOUT_TIMEOUT_MS,
163
+ DEFAULT_PROBE_TIMEOUT_MS,
164
+ HOST_AUTH_CATALOG,
165
+ KNOWN_HOST_AUTH_SLUGS,
166
+ getAgentHostCapabilities,
167
+ getHostAuthSpec
168
+ };