@growthub/cli 0.9.3 → 0.9.5

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 (46) hide show
  1. package/assets/worker-kits/growthub-agency-portal-starter-v1/apps/agency-portal/growthub.config.json +112 -0
  2. package/assets/worker-kits/growthub-agency-portal-starter-v1/apps/agency-portal/package.json +1 -1
  3. package/assets/worker-kits/growthub-agency-portal-starter-v1/bundles/growthub-agency-portal-starter-v1.json +1 -0
  4. package/assets/worker-kits/growthub-agency-portal-starter-v1/kit.json +2 -0
  5. package/assets/worker-kits/growthub-creative-video-pipeline-v1/apps/creative-video-pipeline/package.json +1 -1
  6. package/assets/worker-kits/growthub-custom-workspace-starter-v1/SKILL.md +35 -1
  7. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/.env.example +41 -0
  8. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/README.md +38 -0
  9. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/settings/integrations/route.js +13 -0
  10. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/route.js +91 -0
  11. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/globals.css +912 -0
  12. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/layout.jsx +14 -0
  13. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/page.jsx +23 -0
  14. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/settings/integrations/page.jsx +105 -0
  15. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/workspace-builder.jsx +680 -0
  16. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/growthub.config.json +53 -0
  17. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/jsconfig.json +8 -0
  18. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/auth/index.js +21 -0
  19. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/env.js +28 -0
  20. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/growthub-connection-normalizer.js +95 -0
  21. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/index.js +198 -0
  22. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/payments/index.js +13 -0
  23. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/persistence/index.js +13 -0
  24. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/persistence/postgres.js +16 -0
  25. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/persistence/provider-managed.js +16 -0
  26. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/persistence/qstash-kv.js +16 -0
  27. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/domain/integrations.js +185 -0
  28. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/domain/portal.js +150 -0
  29. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-config.js +232 -0
  30. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/next.config.js +10 -0
  31. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/package-lock.json +976 -0
  32. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/package.json +17 -0
  33. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/postcss.config.mjs +3 -0
  34. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/vercel.json +5 -0
  35. package/assets/worker-kits/growthub-custom-workspace-starter-v1/bundles/growthub-custom-workspace-starter-v1.json +13 -0
  36. package/assets/worker-kits/growthub-custom-workspace-starter-v1/docs/adapter-contracts.md +86 -0
  37. package/assets/worker-kits/growthub-custom-workspace-starter-v1/docs/vercel-serverless-deployment.md +46 -0
  38. package/assets/worker-kits/growthub-custom-workspace-starter-v1/growthub.config.json +49 -0
  39. package/assets/worker-kits/growthub-custom-workspace-starter-v1/helpers/check-self-improving-health.sh +60 -0
  40. package/assets/worker-kits/growthub-custom-workspace-starter-v1/helpers/promote-capability.mjs +37 -0
  41. package/assets/worker-kits/growthub-custom-workspace-starter-v1/helpers/propose-capability.mjs +38 -0
  42. package/assets/worker-kits/growthub-custom-workspace-starter-v1/kit.json +45 -0
  43. package/assets/worker-kits/growthub-custom-workspace-starter-v1/templates/deployment-handoff.md +61 -0
  44. package/assets/worker-kits/growthub-custom-workspace-starter-v1/templates/supabase-setup-plan.md +26 -0
  45. package/dist/index.js +2903 -1596
  46. package/package.json +2 -1
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "growthub-workspace-app",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "next dev",
8
+ "build": "next build --webpack",
9
+ "start": "next start",
10
+ "lint": "next lint"
11
+ },
12
+ "dependencies": {
13
+ "next": "16.2.4",
14
+ "react": "19.2.4",
15
+ "react-dom": "19.2.4"
16
+ }
17
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "framework": "nextjs",
3
+ "buildCommand": "npm run build",
4
+ "installCommand": "npm install"
5
+ }
@@ -27,6 +27,7 @@
27
27
  "output-standards.md",
28
28
  "runtime-assumptions.md",
29
29
  "validation-checklist.md",
30
+ "growthub.config.json",
30
31
  "workers/custom-workspace-operator/CLAUDE.md",
31
32
  "brands/_template/brand-kit.md",
32
33
  "brands/growthub/brand-kit.md",
@@ -45,6 +46,8 @@
45
46
  "docs/starter-kit-overview.md",
46
47
  "docs/fork-sync-integration.md",
47
48
  "docs/vite-ui-shell-guide.md",
49
+ "docs/adapter-contracts.md",
50
+ "docs/vercel-serverless-deployment.md",
48
51
  "studio/index.html",
49
52
  "studio/package.json",
50
53
  "studio/vite.config.js",
@@ -52,6 +55,16 @@
52
55
  "studio/src/main.jsx",
53
56
  "studio/src/App.jsx",
54
57
  "studio/src/app.css",
58
+ "apps/workspace/package.json",
59
+ "apps/workspace/package-lock.json",
60
+ "apps/workspace/next.config.js",
61
+ "apps/workspace/growthub.config.json",
62
+ "apps/workspace/app/page.jsx",
63
+ "apps/workspace/app/settings/integrations/page.jsx",
64
+ "apps/workspace/lib/adapters/env.js",
65
+ "apps/workspace/lib/adapters/integrations/index.js",
66
+ "apps/workspace/lib/adapters/integrations/growthub-connection-normalizer.js",
67
+ "apps/workspace/lib/domain/integrations.js",
55
68
  "growthub-meta/README.md",
56
69
  "growthub-meta/kit-standard.md",
57
70
  "docs/governed-workspace-primitives.md"
@@ -0,0 +1,86 @@
1
+ # Adapter Contracts — Workspace Starter
2
+
3
+ The worker-kit contract is provider-agnostic. Concrete providers are configured through environment variables and adapter documentation, not through kit identity.
4
+
5
+ ## Persistence
6
+
7
+ `AGENCY_PORTAL_DATA_ADAPTER` selects the persistence layer:
8
+
9
+ | Value | Required env | Runtime target |
10
+ |---|---|---|
11
+ | `postgres` | `DATABASE_URL` | Any Postgres-compatible database |
12
+ | `qstash-kv` | `QSTASH_KV_REST_URL`, `QSTASH_KV_REST_TOKEN` | Qstash/Vercel KV-style HTTP storage |
13
+ | `provider-managed` | Provider-specific env in `.env` | Hosted database surface managed outside the kit |
14
+
15
+ The app payload under `apps/workspace/` exposes these adapters as code-level interfaces. Treat any future provider-specific implementation as replaceable behind this contract.
16
+
17
+ ## Auth
18
+
19
+ `AGENCY_PORTAL_AUTH_ADAPTER` selects the auth layer:
20
+
21
+ | Value | Required env |
22
+ |---|---|
23
+ | `oidc` | `AUTH_SECRET`, `AUTH_ISSUER`, `AUTH_CLIENT_ID`, `AUTH_CLIENT_SECRET` |
24
+ | `clerk` | provider-specific Clerk env |
25
+ | `authjs` | Auth.js-compatible env |
26
+ | `provider-managed` | provider-specific env |
27
+
28
+ ## Payments
29
+
30
+ `AGENCY_PORTAL_PAYMENT_ADAPTER` selects payment support:
31
+
32
+ | Value | Required env |
33
+ |---|---|
34
+ | `none` | none |
35
+ | `stripe` | `PAYMENT_SECRET_KEY`, optional `PAYMENT_WEBHOOK_SECRET` |
36
+ | `polar` | `PAYMENT_SECRET_KEY`, optional `PAYMENT_WEBHOOK_SECRET` |
37
+
38
+ ## Reporting
39
+
40
+ `AGENCY_PORTAL_REPORTING_ADAPTER` is optional. Use `windsor` for the first-party reporting path. Windsor AI is treated as a reporting/data-source adapter, not as the database. The starter keeps persistence selected by `AGENCY_PORTAL_DATA_ADAPTER`.
41
+
42
+ The intended Windsor pattern is:
43
+
44
+ 1. Connect Windsor AI through the Growthub GH app/MCP bridge.
45
+ 2. Use Windsor's blended data support to publish or sync blended marketing datasets into Google Sheets when spreadsheet-backed reporting is preferred.
46
+ 3. Read normalized connection state through the integration adapter rather than storing Windsor, Google Analytics, Shopify, or Meta credentials in the starter app.
47
+
48
+ ## Integrations
49
+
50
+ `AGENCY_PORTAL_INTEGRATION_ADAPTER` selects how Settings resolves data sources and workspace integrations:
51
+
52
+ | Value | Required env | Authority |
53
+ |---|---|---|
54
+ | `growthub-bridge` | `GROWTHUB_BRIDGE_BASE_URL`, `GROWTHUB_BRIDGE_ACCESS_TOKEN` | Growthub GH app MCP connection authority |
55
+ | `byo-api-key` | `AGENCY_PORTAL_BYO_CONNECTIONS_JSON` or `WINDSOR_API_KEY` for Windsor-only setup | Workspace-owned explicit provider setup |
56
+ | `static` | none | Local starter catalog for development and exported workspaces without hosted authority |
57
+
58
+ The bridge adapter is intentionally thin. It expects a JSON endpoint configured by `GROWTHUB_BRIDGE_INTEGRATIONS_PATH` (default `/api/mcp/accounts`) and normalizes the response into two lanes:
59
+
60
+ - **Data sources**: Windsor AI, Google Sheets blended data, Google Analytics, Shopify, Meta Facebook/Instagram.
61
+ - **Workspace integrations**: Asana, Slack, GoHighLevel, Google Drive, Notion.
62
+
63
+ The GH app authority pattern observed in `/Users/antonio/gh-app` is CMS catalog rows plus active `mcp_connections` rows. The starter does not query that database directly. It consumes the bridge API so the hosted app keeps ownership of user auth, tokens, verification, account IDs, scopes, and provider metadata.
64
+
65
+ The kit-local primitive for this is `apps/workspace/lib/adapters/integrations/growthub-connection-normalizer.js`. It accepts the SDK/profile-style integration shape:
66
+
67
+ ```json
68
+ { "integrations": [{ "provider": "slack", "label": "Slack", "connectedAt": "...", "scopes": [], "handle": "...", "ready": true }] }
69
+ ```
70
+
71
+ It also accepts the GH app MCP accounts shape returned by `/api/mcp/accounts`:
72
+
73
+ ```json
74
+ { "success": true, "accounts": [{ "id": "...", "provider": "slack", "connectionName": "Slack", "connectionType": "oauth_first_party", "isActive": true, "isVerified": true, "metadata": {}, "createdAt": "...", "updatedAt": "...", "appSlug": "slack" }] }
75
+ ```
76
+
77
+ Both shapes normalize into the same `AgencyPortalIntegration` object used by the BYO path. Unknown connected providers are preserved as discovered workspace integrations instead of being dropped.
78
+
79
+ The BYO path uses the same normalized object shape, but expects the workspace operator to provide the connection metadata and secret env names explicitly. Windsor is first-class: when `WINDSOR_API_KEY` is set with `AGENCY_PORTAL_INTEGRATION_ADAPTER=byo-api-key`, the app marks the Windsor AI data pipeline object as connected without requiring a larger JSON payload. The hosted Growthub bridge remains the lower-friction first-party path for user-owned MCP connections.
80
+
81
+ The starter also supports a safe hybrid mode for new users: keep `AGENCY_PORTAL_INTEGRATION_ADAPTER=growthub-bridge` for hosted account authority, and set `WINDSOR_API_KEY` locally when Windsor reporting is being bootstrapped before the hosted bridge has returned a Windsor account row. In that mode the app overlays a connected Windsor state onto:
82
+
83
+ - `windsor-ai`
84
+ - `google-sheets` blended data
85
+
86
+ This preserves the bridge as the source of truth for the rest of the integration catalog while letting the portal surface Windsor-backed reporting setup end to end from first boot.
@@ -0,0 +1,46 @@
1
+ # Vercel Serverless Deployment
2
+
3
+ The clean cloud deployment lane is the app payload:
4
+
5
+ ```text
6
+ apps/workspace/
7
+ ```
8
+
9
+ The Growthub local-first workspace remains the kit root, and the Vite operator shell remains:
10
+
11
+ ```text
12
+ studio/
13
+ ```
14
+
15
+ ## Vercel project settings
16
+
17
+ - Root directory: `apps/workspace`
18
+ - Build command: `npm run build`
19
+ - Install command: `npm install`
20
+ - Framework preset: Next.js
21
+
22
+ ## Required adapter env
23
+
24
+ At minimum, set:
25
+
26
+ ```text
27
+ AGENCY_PORTAL_DEPLOY_TARGET=vercel
28
+ AGENCY_PORTAL_DATA_ADAPTER=<postgres|qstash-kv|provider-managed>
29
+ AGENCY_PORTAL_AUTH_ADAPTER=<oidc|clerk|authjs|provider-managed>
30
+ AGENCY_PORTAL_PAYMENT_ADAPTER=<none|stripe|polar>
31
+ AGENCY_PORTAL_INTEGRATION_ADAPTER=<static|growthub-bridge|byo-api-key>
32
+ ```
33
+
34
+ Then set the provider-specific env required by `docs/adapter-contracts.md`.
35
+
36
+ For hosted Growthub authority, set:
37
+
38
+ ```text
39
+ GROWTHUB_BRIDGE_BASE_URL=<growthub-gh-app-url>
40
+ GROWTHUB_BRIDGE_INTEGRATIONS_PATH=/api/mcp/accounts
41
+ GROWTHUB_BRIDGE_ACCESS_TOKEN=<bridge-token-issued-by-growthub-authority>
42
+ ```
43
+
44
+ The deployed app reads normalized integration state from the bridge. It does not require raw Shopify, Meta, Google Analytics, Asana, Slack, GoHighLevel, Google Drive, Notion, Windsor, or Google Sheets secrets.
45
+
46
+ If `AGENCY_PORTAL_INTEGRATION_ADAPTER=byo-api-key`, set `AGENCY_PORTAL_BYO_CONNECTIONS_JSON` with the same normalized integration object fields and secret env names. This is more detailed setup, but keeps the worker kit contract composable.
@@ -0,0 +1,49 @@
1
+ {
2
+ "id": "custom-workspace-default",
3
+ "name": "Custom Workspace Canvas",
4
+ "description": "Default no-code composition shipped by growthub-custom-workspace-starter-v1. It keeps the canonical custom workspace primitive agnostic: chat session, workflow runner, and artifact viewer wired to session memory and trace primitives. Forks can edit ids, layouts, and bindings to tailor the canvas to the workspace domain.",
5
+ "capabilities": [],
6
+ "pipelines": [],
7
+ "integrations": [],
8
+ "canvas": {
9
+ "id": "workspace-default",
10
+ "name": "Custom workspace dashboard",
11
+ "scope": "workspace",
12
+ "layout": {
13
+ "columns": 12,
14
+ "rowHeight": 64,
15
+ "gap": 16,
16
+ "responsive": true
17
+ },
18
+ "widgets": [
19
+ {
20
+ "id": "agent-chat",
21
+ "kind": "chat-session",
22
+ "title": "Agent chat",
23
+ "position": { "x": 0, "y": 0, "w": 6, "h": 4 }
24
+ },
25
+ {
26
+ "id": "active-workflow",
27
+ "kind": "workflow-runner",
28
+ "title": "Active workflow",
29
+ "position": { "x": 6, "y": 0, "w": 6, "h": 4 }
30
+ },
31
+ {
32
+ "id": "session-artifacts",
33
+ "kind": "artifact-viewer",
34
+ "title": "Session artifacts",
35
+ "mediaPreview": true,
36
+ "position": { "x": 0, "y": 4, "w": 12, "h": 3 }
37
+ }
38
+ ],
39
+ "bindings": {
40
+ "chatToCanvas": true,
41
+ "workflowOutputsToArtifacts": true,
42
+ "sessionContext": true
43
+ }
44
+ },
45
+ "provenance": {
46
+ "createdBy": "cli",
47
+ "note": "Shipped with growthub-custom-workspace-starter-v1; safe to edit inside a governed fork and validate through the starter export smoke path."
48
+ }
49
+ }
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env bash
2
+ # helpers/check-self-improving-health.sh
3
+ # Self-improving workspace health check (optional feature extension).
4
+ #
5
+ # Usage: bash helpers/check-self-improving-health.sh [--json]
6
+ # Returns non-zero when any FAIL check is found.
7
+ set -euo pipefail
8
+
9
+ FORK_DIR=".growthub-fork"
10
+ JSON_MODE=false
11
+ [[ "${1:-}" == "--json" ]] && JSON_MODE=true
12
+
13
+ pass=()
14
+ warn=()
15
+ fail=()
16
+
17
+ # Core governed primitives
18
+ [[ -f "SKILL.md" ]] && pass+=("SKILL.md present") || fail+=("SKILL.md missing")
19
+ [[ -f "templates/project.md" ]] && pass+=("templates/project.md present") || warn+=("templates/project.md missing")
20
+ [[ -f "templates/self-eval.md" ]] && pass+=("templates/self-eval.md present") || warn+=("templates/self-eval.md missing")
21
+ [[ -d "helpers" ]] && pass+=("helpers/ present") || warn+=("helpers/ missing")
22
+ [[ -d "skills" ]] && pass+=("skills/ present") || warn+=("skills/ missing")
23
+
24
+ # Fork state
25
+ [[ -d "${FORK_DIR}" ]] && pass+=(".growthub-fork/ exists") || warn+=(".growthub-fork/ missing — run: growthub kit fork register .")
26
+ [[ -f "${FORK_DIR}/trace.jsonl" ]] && pass+=("trace.jsonl present") || warn+=("trace.jsonl missing")
27
+
28
+ # Self-improving feature checks (optional)
29
+ [[ -d "${FORK_DIR}/capabilities/proposals" ]] \
30
+ && pass+=("capabilities/proposals/ exists ($(ls "${FORK_DIR}/capabilities/proposals/"*.json 2>/dev/null | wc -l | tr -d ' ') proposals)") \
31
+ || warn+=("No proposals yet — run: growthub workspace improve propose --from-run demo")
32
+ [[ -d "${FORK_DIR}/capabilities/promoted" ]] \
33
+ && pass+=("capabilities/promoted/ exists ($(ls "${FORK_DIR}/capabilities/promoted/"*.json 2>/dev/null | wc -l | tr -d ' ') promoted)") \
34
+ || pass+=("No promoted capabilities yet (ok)")
35
+ [[ -f "helpers/propose-capability.mjs" ]] && pass+=("propose-capability.mjs present") || warn+=("propose-capability.mjs missing")
36
+ [[ -f "helpers/promote-capability.mjs" ]] && pass+=("promote-capability.mjs present") || warn+=("promote-capability.mjs missing")
37
+
38
+ PASS_COUNT=${#pass[@]}
39
+ WARN_COUNT=${#warn[@]}
40
+ FAIL_COUNT=${#fail[@]}
41
+
42
+ if $JSON_MODE; then
43
+ printf '{\n "pass": [%s],\n "warn": [%s],\n "fail": [%s],\n "summary": "pass=%d warn=%d fail=%d"\n}\n' \
44
+ "$(printf '"%s",' "${pass[@]:-}" | sed 's/,$//')" \
45
+ "$(printf '"%s",' "${warn[@]:-}" | sed 's/,$//')" \
46
+ "$(printf '"%s",' "${fail[@]:-}" | sed 's/,$//')" \
47
+ "$PASS_COUNT" "$WARN_COUNT" "$FAIL_COUNT"
48
+ else
49
+ echo ""
50
+ echo "Self-Improving Workspace Health"
51
+ echo "================================"
52
+ for m in "${pass[@]:-}"; do echo " PASS $m"; done
53
+ for m in "${warn[@]:-}"; do echo " WARN $m"; done
54
+ for m in "${fail[@]:-}"; do echo " FAIL $m"; done
55
+ echo ""
56
+ echo " pass=${PASS_COUNT} warn=${WARN_COUNT} fail=${FAIL_COUNT}"
57
+ echo ""
58
+ fi
59
+
60
+ [[ ${FAIL_COUNT} -gt 0 ]] && exit 1 || exit 0
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * helpers/promote-capability.mjs
4
+ * Self-improving workspace helper (primitive #6).
5
+ *
6
+ * Thin wrapper: calls `growthub workspace improve promote` so agents have
7
+ * a single-invocation helper that follows the primitive #6 convention.
8
+ *
9
+ * Usage:
10
+ * node helpers/promote-capability.mjs <slug> [--yes] [--json]
11
+ *
12
+ * Works identically on:
13
+ * - a maintainer's machine with growthub installed globally
14
+ * - CI / cloud agents with only the source tree (uses cli/dist/index.js)
15
+ */
16
+ import { spawnSync } from "node:child_process";
17
+ import { fileURLToPath } from "node:url";
18
+ import path from "node:path";
19
+ import fs from "node:fs";
20
+
21
+ const args = process.argv.slice(2);
22
+
23
+ function resolveGrowthubCli() {
24
+ const distPath = path.resolve(
25
+ path.dirname(fileURLToPath(import.meta.url)),
26
+ "../../../../cli/dist/index.js",
27
+ );
28
+ if (fs.existsSync(distPath)) return [process.execPath, distPath];
29
+ return ["growthub"];
30
+ }
31
+
32
+ const [exec, ...rest] = resolveGrowthubCli();
33
+ const result = spawnSync(exec, [...rest, "workspace", "improve", "promote", ...args], {
34
+ stdio: "inherit",
35
+ env: process.env,
36
+ });
37
+ process.exit(result.status ?? 1);
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * helpers/propose-capability.mjs
4
+ * Self-improving workspace helper (primitive #6).
5
+ *
6
+ * Thin wrapper: calls `growthub workspace improve propose` so agents have
7
+ * a single-invocation helper that follows the primitive #6 convention.
8
+ *
9
+ * Usage:
10
+ * node helpers/propose-capability.mjs --from-run <run-id> [--summary "..."] [--json]
11
+ *
12
+ * Works identically on:
13
+ * - a maintainer's machine with growthub installed globally
14
+ * - CI / cloud agents with only the source tree (uses cli/dist/index.js)
15
+ */
16
+ import { spawnSync } from "node:child_process";
17
+ import { fileURLToPath } from "node:url";
18
+ import path from "node:path";
19
+ import fs from "node:fs";
20
+
21
+ const args = process.argv.slice(2);
22
+
23
+ function resolveGrowthubCli() {
24
+ // Three-step ladder: dist → installed binary
25
+ const distPath = path.resolve(
26
+ path.dirname(fileURLToPath(import.meta.url)),
27
+ "../../../../cli/dist/index.js",
28
+ );
29
+ if (fs.existsSync(distPath)) return [process.execPath, distPath];
30
+ return ["growthub"];
31
+ }
32
+
33
+ const [exec, ...rest] = resolveGrowthubCli();
34
+ const result = spawnSync(exec, [...rest, "workspace", "improve", "propose", ...args], {
35
+ stdio: "inherit",
36
+ env: process.env,
37
+ });
38
+ process.exit(result.status ?? 1);
@@ -30,6 +30,7 @@
30
30
  "output-standards.md",
31
31
  "runtime-assumptions.md",
32
32
  "validation-checklist.md",
33
+ "growthub.config.json",
33
34
  "workers/custom-workspace-operator/CLAUDE.md",
34
35
  "brands/_template/brand-kit.md",
35
36
  "brands/growthub/brand-kit.md",
@@ -43,11 +44,16 @@
43
44
  "templates/project.md",
44
45
  "templates/self-eval.md",
45
46
  "helpers/README.md",
47
+ "helpers/propose-capability.mjs",
48
+ "helpers/promote-capability.mjs",
49
+ "helpers/check-self-improving-health.sh",
46
50
  "skills/README.md",
47
51
  "examples/workspace-sample.md",
48
52
  "docs/starter-kit-overview.md",
49
53
  "docs/fork-sync-integration.md",
50
54
  "docs/vite-ui-shell-guide.md",
55
+ "docs/adapter-contracts.md",
56
+ "docs/vercel-serverless-deployment.md",
51
57
  "studio/index.html",
52
58
  "studio/package.json",
53
59
  "studio/vite.config.js",
@@ -55,6 +61,32 @@
55
61
  "studio/src/main.jsx",
56
62
  "studio/src/App.jsx",
57
63
  "studio/src/app.css",
64
+ "apps/workspace/README.md",
65
+ "apps/workspace/.env.example",
66
+ "apps/workspace/package.json",
67
+ "apps/workspace/package-lock.json",
68
+ "apps/workspace/next.config.js",
69
+ "apps/workspace/postcss.config.mjs",
70
+ "apps/workspace/vercel.json",
71
+ "apps/workspace/growthub.config.json",
72
+ "apps/workspace/jsconfig.json",
73
+ "apps/workspace/app/layout.jsx",
74
+ "apps/workspace/app/page.jsx",
75
+ "apps/workspace/app/globals.css",
76
+ "apps/workspace/app/settings/integrations/page.jsx",
77
+ "apps/workspace/app/api/workspace/route.js",
78
+ "apps/workspace/app/api/settings/integrations/route.js",
79
+ "apps/workspace/lib/domain/portal.js",
80
+ "apps/workspace/lib/domain/integrations.js",
81
+ "apps/workspace/lib/adapters/env.js",
82
+ "apps/workspace/lib/adapters/auth/index.js",
83
+ "apps/workspace/lib/adapters/integrations/index.js",
84
+ "apps/workspace/lib/adapters/integrations/growthub-connection-normalizer.js",
85
+ "apps/workspace/lib/adapters/payments/index.js",
86
+ "apps/workspace/lib/adapters/persistence/index.js",
87
+ "apps/workspace/lib/adapters/persistence/postgres.js",
88
+ "apps/workspace/lib/adapters/persistence/qstash-kv.js",
89
+ "apps/workspace/lib/adapters/persistence/provider-managed.js",
58
90
  "growthub-meta/README.md",
59
91
  "growthub-meta/kit-standard.md",
60
92
  "docs/governed-workspace-primitives.md"
@@ -74,6 +106,7 @@
74
106
  "bundles/growthub-custom-workspace-starter-v1.json",
75
107
  "SKILL.md",
76
108
  "skills.md",
109
+ "growthub.config.json",
77
110
  "workers/custom-workspace-operator/CLAUDE.md",
78
111
  "brands/_template/brand-kit.md",
79
112
  "brands/growthub/brand-kit.md",
@@ -85,11 +118,23 @@
85
118
  "templates",
86
119
  "templates/project.md",
87
120
  "templates/self-eval.md",
121
+ "templates/deployment-handoff.md",
122
+ "templates/supabase-setup-plan.md",
88
123
  "helpers",
89
124
  "helpers/README.md",
125
+ "helpers/propose-capability.mjs",
126
+ "helpers/promote-capability.mjs",
127
+ "helpers/check-self-improving-health.sh",
90
128
  "skills",
91
129
  "skills/README.md",
92
130
  "docs",
131
+ "docs/adapter-contracts.md",
132
+ "docs/vercel-serverless-deployment.md",
133
+ "apps/workspace",
134
+ "apps/workspace/package-lock.json",
135
+ "apps/workspace/next.config.js",
136
+ "apps/workspace/growthub.config.json",
137
+ "apps/workspace/lib/adapters",
93
138
  "growthub-meta",
94
139
  "docs/governed-workspace-primitives.md"
95
140
  ]
@@ -0,0 +1,61 @@
1
+ # Deployment Handoff
2
+
3
+ Client:
4
+ Project:
5
+ Fork id:
6
+ GitHub repo:
7
+ Vercel project:
8
+
9
+ ## Validated Commands
10
+
11
+ ```bash
12
+ node setup/verify-env.mjs
13
+ cd studio && npm run build
14
+ cd apps/workspace && npm run build
15
+ growthub kit fork status <fork-id>
16
+ ```
17
+
18
+ ## Vercel Settings
19
+
20
+ - Root directory: `apps/workspace`
21
+ - Install command: `npm install`
22
+ - Build command: `npm run build`
23
+ - Framework preset: Next.js
24
+
25
+ ## Environment
26
+
27
+ ```text
28
+ AGENCY_PORTAL_DEPLOY_TARGET=vercel
29
+ AGENCY_PORTAL_DATA_ADAPTER=
30
+ AGENCY_PORTAL_AUTH_ADAPTER=
31
+ AGENCY_PORTAL_PAYMENT_ADAPTER=
32
+ AGENCY_PORTAL_REPORTING_ADAPTER=
33
+ AGENCY_PORTAL_INTEGRATION_ADAPTER=
34
+ ```
35
+
36
+ Growthub bridge env, if used:
37
+
38
+ ```text
39
+ GROWTHUB_BRIDGE_BASE_URL=
40
+ GROWTHUB_BRIDGE_INTEGRATIONS_PATH=/api/mcp/accounts
41
+ GROWTHUB_BRIDGE_ACCESS_TOKEN=<set in Vercel only>
42
+ GROWTHUB_BRIDGE_USER_ID=<set when the selected bridge endpoint requires explicit user scoping>
43
+ ```
44
+
45
+ BYO env, if used:
46
+
47
+ ```text
48
+ AGENCY_PORTAL_BYO_CONNECTIONS_JSON=<set in Vercel only>
49
+ WINDSOR_API_KEY=<set in Vercel only when BYO Windsor is used>
50
+ ```
51
+
52
+ ## Integration Validation
53
+
54
+ - `/settings/integrations` loaded:
55
+ - Data pipeline objects connected:
56
+ - MCP connection integrations connected:
57
+ - Active badges match Growthub bridge or BYO metadata:
58
+
59
+ ## Handoff Notes
60
+
61
+ Record any remaining manual steps, provider-side OAuth actions, or client account permissions.
@@ -0,0 +1,26 @@
1
+ # Database Provider Setup Plan
2
+
3
+ This file name is retained for compatibility with older workspace notes. The v1 worker-kit contract is not Supabase-specific.
4
+
5
+ Use `AGENCY_PORTAL_DATA_ADAPTER` to select persistence:
6
+
7
+ - `postgres` with `DATABASE_URL`
8
+ - `qstash-kv` with `QSTASH_KV_REST_URL` and `QSTASH_KV_REST_TOKEN`
9
+ - `provider-managed` for a hosted database surface outside this kit
10
+
11
+ Supabase may be used only as one Postgres-compatible provider behind `DATABASE_URL`. Do not add Supabase SDK dependencies or Supabase-only assumptions to the starter unless a user explicitly chooses that provider in their own fork.
12
+
13
+ ## Selected Provider
14
+
15
+ - Adapter:
16
+ - Provider:
17
+ - Required env:
18
+ - Migration owner:
19
+ - Backup owner:
20
+
21
+ ## Validation
22
+
23
+ ```bash
24
+ node setup/verify-env.mjs
25
+ cd apps/workspace && npm run build
26
+ ```