@growthub/cli 0.10.0 → 0.12.0

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 (28) hide show
  1. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/helper/apply/route.js +307 -0
  2. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/helper/query/route.js +372 -0
  3. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/helper/receipts/route.js +47 -0
  4. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/DataModelShell.jsx +664 -82
  5. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/HelperSidecar.jsx +1371 -0
  6. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/globals.css +1383 -24
  7. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/settings/integrations/page.jsx +7 -21
  8. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/settings/ownership/ownership-panel.jsx +222 -0
  9. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/settings/ownership/page.jsx +19 -0
  10. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/settings/settings-shell.jsx +2 -1
  11. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workspace-builder.jsx +116 -24
  12. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workspace-rail.jsx +497 -0
  13. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/growthub.config.json +20 -4
  14. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/sandboxes/default-local-intelligence.js +19 -4
  15. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-data-model.js +23 -5
  16. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-helper-apply.js +473 -0
  17. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-helper.js +583 -0
  18. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/package-lock.json +34 -0
  19. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/package.json +3 -1
  20. package/assets/worker-kits/growthub-custom-workspace-starter-v1/helpers/export-training-traces.mjs +144 -0
  21. package/assets/worker-kits/growthub-custom-workspace-starter-v1/helpers/grade-raw-pairs.mjs +279 -0
  22. package/assets/worker-kits/growthub-custom-workspace-starter-v1/helpers/harvest-cursor-traces.mjs +288 -0
  23. package/assets/worker-kits/growthub-custom-workspace-starter-v1/helpers/upload-graded-traces.mjs +128 -0
  24. package/assets/worker-kits/growthub-custom-workspace-starter-v1/kit.json +19 -0
  25. package/assets/worker-kits/growthub-custom-workspace-starter-v1/templates/seeded-configs/alignment-loop.config.json +264 -0
  26. package/assets/worker-kits/growthub-custom-workspace-starter-v1/workers/custom-workspace-operator/CLAUDE.md +38 -0
  27. package/dist/index.js +1416 -2627
  28. package/package.json +1 -1
@@ -0,0 +1,264 @@
1
+ {
2
+ "id": "workspace-builder-default",
3
+ "name": "Growthub Workspace",
4
+ "description": "Default no-code composition for the official Growthub Custom Workspace Starter. The interface starts as a governed dashboard workspace and can be customized by editing this file or by future governed UI controls.",
5
+ "branding": {
6
+ "name": "Growthub Workspace",
7
+ "logoUrl": "",
8
+ "accent": "#3f68ff"
9
+ },
10
+ "capabilities": [
11
+ "dashboards",
12
+ "canvas",
13
+ "widgets",
14
+ "bindings",
15
+ "integrations",
16
+ "settings"
17
+ ],
18
+ "pipelines": [],
19
+ "integrations": [],
20
+ "dashboards": [
21
+ {
22
+ "id": "untitled-dashboard",
23
+ "name": "Untitled",
24
+ "createdBy": "Workspace owner",
25
+ "updatedAt": "new",
26
+ "status": "draft"
27
+ }
28
+ ],
29
+ "widgetTypes": [
30
+ { "kind": "chart", "label": "Chart", "icon": "C" },
31
+ { "kind": "view", "label": "View", "icon": "V" },
32
+ { "kind": "iframe", "label": "iFrame", "icon": "I" },
33
+ { "kind": "rich-text", "label": "Rich Text", "icon": "T" }
34
+ ],
35
+ "canvas": {
36
+ "id": "workspace-canvas",
37
+ "name": "Tab 1",
38
+ "scope": "workspace",
39
+ "layout": {
40
+ "columns": 12,
41
+ "rowHeight": 64,
42
+ "gap": 16,
43
+ "responsive": true
44
+ },
45
+ "widgets": [],
46
+ "bindings": {
47
+ "chatToCanvas": true,
48
+ "workflowOutputsToArtifacts": true,
49
+ "sessionContext": true,
50
+ "configDrivenCanvas": true
51
+ }
52
+ },
53
+ "provenance": {
54
+ "createdBy": "cli",
55
+ "mirrors": "growthub-custom-workspace-starter-v1",
56
+ "note": "Shipped with growthub-custom-workspace-starter-v1; safe to edit inside a governed fork and validate through the starter export smoke path."
57
+ },
58
+ "dataModel": {
59
+ "objects": [
60
+ {
61
+ "id": "sandboxes-alignment-loop",
62
+ "label": "Alignment Sandboxes",
63
+ "source": "Sandboxes",
64
+ "objectType": "sandbox-environment",
65
+ "icon": "Terminal",
66
+ "columns": [
67
+ "Name",
68
+ "lifecycleStatus",
69
+ "version",
70
+ "runLocality",
71
+ "schedulerRegistryId",
72
+ "runtime",
73
+ "adapter",
74
+ "agentHost",
75
+ "intelligenceType",
76
+ "localModel",
77
+ "localEndpoint",
78
+ "intelligenceAdapterMode",
79
+ "envRefs",
80
+ "networkAllow",
81
+ "allowList",
82
+ "instructions",
83
+ "command",
84
+ "orchestrationConfig",
85
+ "timeoutMs",
86
+ "resolverTemplateId",
87
+ "connectorKind",
88
+ "executionLane",
89
+ "status",
90
+ "lastTested",
91
+ "lastRunId",
92
+ "lastSourceId",
93
+ "lastResponse"
94
+ ],
95
+ "rows": [
96
+ {
97
+ "Name": "workspace-expert",
98
+ "lifecycleStatus": "live",
99
+ "version": "1",
100
+ "runLocality": "local",
101
+ "schedulerRegistryId": "",
102
+ "runtime": "node",
103
+ "adapter": "local-intelligence",
104
+ "agentHost": "",
105
+ "intelligenceType": "local-intelligence",
106
+ "localModel": "gemma3:4b",
107
+ "localEndpoint": "http://127.0.0.1:11434/v1/chat/completions",
108
+ "intelligenceAdapterMode": "ollama",
109
+ "envRefs": "",
110
+ "networkAllow": "false",
111
+ "allowList": "",
112
+ "instructions": "You are workspace-expert for Growthub AWaC V2 running on Antonio's local governed workspace. Anchor answers to AGENTS.md contract order, governed primitives, schema boundaries, and PATCH allowlist invariants. For any task, first map required primitive(s), list safety checks, then provide the safest executable path. If a request violates invariants or touches protected boundaries, explicitly block and explain the compliant alternative.",
113
+ "command": "As workspace-expert, explain the safest path for this task with exact primitives and constraints.",
114
+ "orchestrationConfig": "{\"version\":\"1\",\"graph\":{\"nodes\":[{\"id\":\"workspace-expert\",\"type\":\"thinAdapter\",\"sandbox\":\"workspace-expert\"},{\"id\":\"executor-worker\",\"type\":\"thinAdapter\",\"sandbox\":\"executor-worker\"},{\"id\":\"critic-grader\",\"type\":\"thinAdapter\",\"sandbox\":\"critic-grader\"}],\"edges\":[{\"from\":\"workspace-expert\",\"to\":\"executor-worker\"},{\"from\":\"executor-worker\",\"to\":\"critic-grader\"}]}}",
115
+ "timeoutMs": "60000",
116
+ "resolverTemplateId": "alignment-loop",
117
+ "connectorKind": "local-intelligence",
118
+ "executionLane": "planner",
119
+ "status": "connected",
120
+ "lastTested": "",
121
+ "lastRunId": "",
122
+ "lastSourceId": "",
123
+ "lastResponse": ""
124
+ },
125
+ {
126
+ "Name": "executor-worker",
127
+ "lifecycleStatus": "live",
128
+ "version": "1",
129
+ "runLocality": "local",
130
+ "schedulerRegistryId": "",
131
+ "runtime": "node",
132
+ "adapter": "local-agent-host",
133
+ "agentHost": "claude_local",
134
+ "intelligenceType": "agent-host",
135
+ "localModel": "",
136
+ "localEndpoint": "",
137
+ "intelligenceAdapterMode": "ollama",
138
+ "envRefs": "",
139
+ "networkAllow": "false",
140
+ "allowList": "",
141
+ "instructions": "Primary execution lane. Default agentHost is claude_local and can be overridden to cursor/codex_local or any supported local host on this machine.",
142
+ "command": "Execute the approved plan safely and report changed files, validation results, and open risks.",
143
+ "orchestrationConfig": "{\"version\":\"1\",\"graph\":{\"nodes\":[{\"id\":\"workspace-expert\",\"type\":\"thinAdapter\",\"sandbox\":\"workspace-expert\"},{\"id\":\"executor-worker\",\"type\":\"thinAdapter\",\"sandbox\":\"executor-worker\"},{\"id\":\"critic-grader\",\"type\":\"thinAdapter\",\"sandbox\":\"critic-grader\"}],\"edges\":[{\"from\":\"workspace-expert\",\"to\":\"executor-worker\"},{\"from\":\"executor-worker\",\"to\":\"critic-grader\"}]}}",
144
+ "timeoutMs": "180000",
145
+ "resolverTemplateId": "alignment-loop",
146
+ "connectorKind": "agent-host",
147
+ "executionLane": "executor",
148
+ "status": "connected",
149
+ "lastTested": "",
150
+ "lastRunId": "",
151
+ "lastSourceId": "",
152
+ "lastResponse": ""
153
+ },
154
+ {
155
+ "Name": "critic-grader",
156
+ "lifecycleStatus": "live",
157
+ "version": "1",
158
+ "runLocality": "local",
159
+ "schedulerRegistryId": "",
160
+ "runtime": "node",
161
+ "adapter": "local-intelligence",
162
+ "agentHost": "",
163
+ "intelligenceType": "local-intelligence",
164
+ "localModel": "gemma3:4b",
165
+ "localEndpoint": "http://127.0.0.1:11434/v1/chat/completions",
166
+ "intelligenceAdapterMode": "ollama",
167
+ "envRefs": "",
168
+ "networkAllow": "false",
169
+ "allowList": "",
170
+ "instructions": "Grade executor output against AWaC V2 invariants, repo structure, schema boundaries, and safety rules. Return only strict JSON: {\"score\": X, \"reason\": \"one sentence\"}.",
171
+ "command": "Score this output from 1-5 for invariant accuracy and safety.",
172
+ "orchestrationConfig": "{\"version\":\"1\",\"graph\":{\"nodes\":[{\"id\":\"workspace-expert\",\"type\":\"thinAdapter\",\"sandbox\":\"workspace-expert\"},{\"id\":\"executor-worker\",\"type\":\"thinAdapter\",\"sandbox\":\"executor-worker\"},{\"id\":\"critic-grader\",\"type\":\"thinAdapter\",\"sandbox\":\"critic-grader\"}],\"edges\":[{\"from\":\"workspace-expert\",\"to\":\"executor-worker\"},{\"from\":\"executor-worker\",\"to\":\"critic-grader\"}]}}",
173
+ "timeoutMs": "60000",
174
+ "resolverTemplateId": "alignment-loop",
175
+ "connectorKind": "local-intelligence",
176
+ "executionLane": "critic",
177
+ "status": "connected",
178
+ "lastTested": "",
179
+ "lastRunId": "",
180
+ "lastSourceId": "",
181
+ "lastResponse": ""
182
+ }
183
+ ],
184
+ "binding": {
185
+ "mode": "manual",
186
+ "source": "Data Model"
187
+ },
188
+ "relations": [
189
+ {
190
+ "id": "scheduler-registry-binding",
191
+ "name": "Scheduler (serverless)",
192
+ "field": "schedulerRegistryId",
193
+ "targetObjectType": "api-registry",
194
+ "type": "belongs-to",
195
+ "description": "When runLocality is serverless, sandbox-run posts growthub-sandbox-run-v1 to this API Registry record."
196
+ }
197
+ ],
198
+ "fieldSettings": {
199
+ "hidden": [],
200
+ "order": [
201
+ "Name",
202
+ "lifecycleStatus",
203
+ "version",
204
+ "runLocality",
205
+ "schedulerRegistryId",
206
+ "runtime",
207
+ "adapter",
208
+ "agentHost",
209
+ "intelligenceType",
210
+ "localModel",
211
+ "localEndpoint",
212
+ "intelligenceAdapterMode",
213
+ "envRefs",
214
+ "networkAllow",
215
+ "allowList",
216
+ "instructions",
217
+ "command",
218
+ "orchestrationConfig",
219
+ "timeoutMs",
220
+ "resolverTemplateId",
221
+ "connectorKind",
222
+ "executionLane",
223
+ "status",
224
+ "lastTested",
225
+ "lastRunId",
226
+ "lastSourceId",
227
+ "lastResponse"
228
+ ]
229
+ }
230
+ },
231
+ {
232
+ "id": "training-traces",
233
+ "label": "Training Traces",
234
+ "source": "Data Model",
235
+ "objectType": "custom",
236
+ "icon": "NotebookPen",
237
+ "columns": [
238
+ "sessionDate",
239
+ "inputPrompt",
240
+ "agentOutput",
241
+ "qualityScore",
242
+ "reason",
243
+ "exported"
244
+ ],
245
+ "rows": [],
246
+ "binding": {
247
+ "mode": "manual",
248
+ "source": "Data Model"
249
+ },
250
+ "fieldSettings": {
251
+ "hidden": [],
252
+ "order": [
253
+ "sessionDate",
254
+ "inputPrompt",
255
+ "agentOutput",
256
+ "qualityScore",
257
+ "reason",
258
+ "exported"
259
+ ]
260
+ }
261
+ }
262
+ ]
263
+ }
264
+ }
@@ -49,6 +49,44 @@ You are the Custom Workspace Operator — the agent wired to this Growthub custo
49
49
  - `growthub skills validate` — check SKILL.md frontmatter + helper/sub-skill paths
50
50
  - `growthub skills session show` — print the current `.growthub-fork/project.md`
51
51
 
52
+ ## Workspace Helper verbs (propose → review → apply loop)
53
+
54
+ The workspace helper is a governed, workspace-grammar-aware planning engine. It returns structured proposals — never silent mutations. Always use `mode: propose` and present proposals to the user before applying.
55
+
56
+ **Query (propose only — no writes):**
57
+ ```
58
+ POST /api/workspace/helper/query
59
+ { "intent": "build_dashboard|create_widget|register_api|create_object|edit_view|repair|explain",
60
+ "userPrompt": "<business brief>",
61
+ "mode": "propose" }
62
+ → { "ok": true, "summary": "...", "proposals": [...], "warnings": [...], "receipts": {...} }
63
+ ```
64
+
65
+ **Apply (explicit governed action — requires prior query):**
66
+ ```
67
+ POST /api/workspace/helper/apply
68
+ { "proposals": [...accepted proposals from query response...], "reviewedBy": "<agent-slug>" }
69
+ → { "ok": true, "applied": [...receipts...], "skipped": [...], "workspaceConfig": {...} }
70
+ ```
71
+
72
+ **Receipt history:**
73
+ ```
74
+ GET /api/workspace/helper/receipts?limit=25
75
+ → { "ok": true, "records": [...apply receipts...] }
76
+ ```
77
+
78
+ **CLI equivalents:**
79
+ - `growthub workspace helper query --intent <intent> --prompt "..." [--json > proposals.json]`
80
+ - `growthub workspace helper apply --proposal-file proposals.json [--yes]`
81
+ - `growthub workspace helper receipts [--limit 25]`
82
+
83
+ **Helper apply rules for this operator:**
84
+ - Never call `/api/workspace/helper/apply` without first presenting proposals to the user.
85
+ - Every apply appends a receipt to `trace.jsonl` — do not bypass this with direct PATCH calls.
86
+ - The PATCH allowlist (`dashboards`, `widgetTypes`, `canvas`, `dataModel`) is the hard ceiling. Proposals outside this boundary are rejected by the apply route automatically.
87
+ - `explain.object` proposals are informational — no config write occurs.
88
+ - After a successful apply, refresh the workspace config snapshot before generating new proposals.
89
+
52
90
  ## Output contract
53
91
 
54
92
  All user-facing artifacts for a custom workspace run write to `output/<client-slug>/<project-slug>/`. Machine-readable manifests should be shape-compatible with the bundle descriptor in `bundles/`.