@growthub/cli 0.13.0 → 0.13.2

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 (27) hide show
  1. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/sandbox-run/route.js +50 -25
  2. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/ApiRegistryActionCard.jsx +141 -0
  3. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/ApiRegistryReviewModal.jsx +38 -0
  4. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/DataModelShell.jsx +522 -35
  5. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/OrchestrationGraphCanvas.jsx +242 -0
  6. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/OrchestrationGraphEmptyCanvas.jsx +52 -0
  7. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/OrchestrationNodeConfigPanel.jsx +1203 -0
  8. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/OrchestrationRunTracePanel.jsx +163 -0
  9. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/SandboxOrchestrationEditorPanel.jsx +190 -0
  10. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/SandboxToolConfirmModal.jsx +64 -0
  11. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/SandboxToolDraftPanel.jsx +376 -0
  12. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/page.jsx +6 -1
  13. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/globals.css +1062 -2
  14. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/page.jsx +10 -7
  15. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workflows/WorkflowSurface.jsx +906 -0
  16. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workflows/page.jsx +12 -0
  17. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workspace-builder.jsx +492 -28
  18. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workspace-rail.jsx +114 -30
  19. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/data-model/field-contracts.js +1 -0
  20. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/nav-workflows.js +54 -0
  21. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/orchestration-graph-runner.js +322 -0
  22. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/orchestration-graph.js +734 -0
  23. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/orchestration-run-trace.js +73 -0
  24. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/orchestration-sidecar-routing.js +24 -0
  25. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-data-model.js +2 -0
  26. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-schema.js +21 -1
  27. package/package.json +1 -1
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Parse sandbox row lastResponse / source-record run entries for trace viewer UI.
3
+ */
4
+
5
+ import { redactSecretsFromText } from "./orchestration-graph.js";
6
+
7
+ function safeParseJson(text) {
8
+ const raw = String(text || "").trim();
9
+ if (!raw) return null;
10
+ try {
11
+ return JSON.parse(raw);
12
+ } catch {
13
+ return null;
14
+ }
15
+ }
16
+
17
+ function parseSandboxRunTrace(lastResponse) {
18
+ const parsed = safeParseJson(lastResponse);
19
+ if (!parsed || typeof parsed !== "object") {
20
+ return {
21
+ status: "",
22
+ runId: "",
23
+ exitCode: null,
24
+ durationMs: null,
25
+ runtime: "",
26
+ adapter: "",
27
+ runLocality: "",
28
+ error: "",
29
+ stdout: "",
30
+ stderr: "",
31
+ output: "",
32
+ ranAt: "",
33
+ envRefsResolved: [],
34
+ envRefsMissing: []
35
+ };
36
+ }
37
+ const outputRaw = parsed.output ?? parsed.normalizedOutput ?? parsed.response;
38
+ return {
39
+ status: parsed.status || (parsed.exitCode === 0 && !parsed.error ? "connected" : parsed.error ? "failed" : ""),
40
+ runId: String(parsed.runId || "").trim(),
41
+ exitCode: parsed.exitCode ?? null,
42
+ durationMs: parsed.durationMs ?? null,
43
+ runtime: String(parsed.runtime || "").trim(),
44
+ adapter: String(parsed.adapter || "").trim(),
45
+ runLocality: String(parsed.runLocality || "").trim(),
46
+ error: redactSecretsFromText(parsed.error || ""),
47
+ stdout: redactSecretsFromText(typeof parsed.stdout === "string" ? parsed.stdout : JSON.stringify(parsed.stdout ?? "", null, 2)),
48
+ stderr: redactSecretsFromText(parsed.stderr || ""),
49
+ output: redactSecretsFromText(
50
+ typeof outputRaw === "string" ? outputRaw : JSON.stringify(outputRaw ?? "", null, 2)
51
+ ),
52
+ ranAt: String(parsed.ranAt || "").trim(),
53
+ envRefsResolved: Array.isArray(parsed.envRefsResolved) ? parsed.envRefsResolved : [],
54
+ envRefsMissing: Array.isArray(parsed.envRefsMissing) ? parsed.envRefsMissing : []
55
+ };
56
+ }
57
+
58
+ function normalizeRunRecord(record) {
59
+ if (!record || typeof record !== "object") return null;
60
+ return {
61
+ runId: String(record.runId || "").trim(),
62
+ ranAt: String(record.ranAt || "").trim(),
63
+ exitCode: record.exitCode ?? null,
64
+ durationMs: record.durationMs ?? null,
65
+ error: redactSecretsFromText(record.error || ""),
66
+ stdout: redactSecretsFromText(typeof record.stdout === "string" ? record.stdout : ""),
67
+ stderr: redactSecretsFromText(record.stderr || ""),
68
+ lifecycleStatus: String(record.lifecycleStatus || "").trim(),
69
+ version: String(record.version || "").trim()
70
+ };
71
+ }
72
+
73
+ export { parseSandboxRunTrace, normalizeRunRecord, safeParseJson };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Pure routing for connector menu → node + config tab (sidecar UX contract).
3
+ */
4
+
5
+ function resolveConnectorAction({ from, to, action }) {
6
+ const result = { nodeId: "input", tab: "node" };
7
+ if (action === "filter") {
8
+ if (to === "transform" || from === "api-request") {
9
+ result.nodeId = "transform";
10
+ } else {
11
+ result.nodeId = "input";
12
+ }
13
+ result.tab = "filters";
14
+ } else if (action === "map") {
15
+ result.nodeId = "transform";
16
+ result.tab = "node";
17
+ } else if (action === "preview") {
18
+ result.nodeId = "result";
19
+ result.tab = "preview";
20
+ }
21
+ return result;
22
+ }
23
+
24
+ export { resolveConnectorAction };
@@ -731,6 +731,8 @@ const OBJECT_TYPE_PRESETS = {
731
731
  "lastRunId",
732
732
  "lastSourceId",
733
733
  "lastResponse",
734
+ "orchestrationGraph",
735
+ "description",
734
736
  "resolverTemplateId",
735
737
  "connectorKind",
736
738
  "executionLane"
@@ -963,6 +963,11 @@ function validateSandboxEnvironmentRow(row, path, errors) {
963
963
  errors.push(`${path}.intelligenceAdapterMode must be one of ${INTELLIGENCE_ADAPTER_MODES.join(", ")}`);
964
964
  }
965
965
  }
966
+ if (row.orchestrationGraph !== undefined && row.orchestrationGraph !== null && row.orchestrationGraph !== "") {
967
+ if (typeof row.orchestrationGraph !== "string" && (typeof row.orchestrationGraph !== "object" || Array.isArray(row.orchestrationGraph))) {
968
+ errors.push(`${path}.orchestrationGraph must be a JSON string or plain object`);
969
+ }
970
+ }
966
971
  if (row.envRefs !== undefined && typeof row.envRefs !== "string" && !Array.isArray(row.envRefs)) {
967
972
  errors.push(`${path}.envRefs must be a comma-separated string or array of env-ref slugs (never values)`);
968
973
  }
@@ -1003,7 +1008,7 @@ function validateSandboxEnvironmentRow(row, path, errors) {
1003
1008
  const NAV_FOLDERS_OBJECT_ID = "nav-folders";
1004
1009
  const NAV_FOLDER_NAME_MAX = 60;
1005
1010
  const NAV_ITEM_LABEL_MAX = 80;
1006
- const NAV_ITEM_TYPES = ["dashboard", "view"];
1011
+ const NAV_ITEM_TYPES = ["dashboard", "view", "workflow"];
1007
1012
 
1008
1013
  function validateNavFolderRow(row, path, errors) {
1009
1014
  if (!isPlainObject(row)) return;
@@ -1091,6 +1096,21 @@ function validateNavFolderRow(row, path, errors) {
1091
1096
  }
1092
1097
  }
1093
1098
  }
1099
+ } else if (item.type === "workflow") {
1100
+ if (typeof item.objectId !== "string" || !item.objectId.trim()) {
1101
+ errors.push(`${ipfx}.objectId must be a non-empty string for workflow items`);
1102
+ }
1103
+ if (typeof item.rowId !== "string" || !item.rowId.trim()) {
1104
+ errors.push(`${ipfx}.rowId must be a non-empty string for workflow items`);
1105
+ }
1106
+ if (item.fieldName !== undefined) {
1107
+ if (typeof item.fieldName !== "string" || !item.fieldName.trim()) {
1108
+ errors.push(`${ipfx}.fieldName must be a non-empty string when present`);
1109
+ }
1110
+ }
1111
+ if (item.orchestrationGraph !== undefined) {
1112
+ errors.push(`${ipfx} must not embed orchestrationGraph — workflow items are shortcuts only`);
1113
+ }
1094
1114
  }
1095
1115
  });
1096
1116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growthub/cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "CLI control plane for Growthub Local and Agent Workspace as Code: export, fork, inspect, operate, sync, and optionally activate governed AI workspaces.",
5
5
  "type": "module",
6
6
  "bin": {