@synap-core/workspace-templates 0.6.0 → 0.6.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.
@@ -0,0 +1,182 @@
1
+ # The Arch — the private command layer (addon on top of Enterprise OS)
2
+ # =====================================================================
3
+ # A PRIVATE suite template (isPublic: false → served only through the Control
4
+ # Plane to its owner, never in the public catalog). It is the full company brain:
5
+ # the whole public Enterprise OS PLUS the private flagship workspaces that make it
6
+ # "The Arch" — the grant pipeline, the web3 ecosystem overlay, and the dev
7
+ # dashboard.
8
+ #
9
+ # What it composes:
10
+ # • enterprise-os — the whole public operating core (transitively brings
11
+ # foundation / ecosystem / operations / crm)
12
+ # • grants — the grant-agency pipeline (composes onto operations)
13
+ # • blockchain-ecosystem — web3 market actors + relations (composes onto ecosystem)
14
+ # • dev-dashboard — the engineering/ops dashboard
15
+ #
16
+ # Ordering is safe by construction: `require` is deps-first, and grants /
17
+ # blockchain-ecosystem declare their OWN compose bases (operations / ecosystem)
18
+ # which enterprise-os installs first — so the overlays always land on a base that
19
+ # already exists. Idempotent: install Enterprise OS first, then The Arch, and the
20
+ # resolver reuses the OS workspaces instead of duplicating them.
21
+
22
+ meta:
23
+ slug: the-arch
24
+ name: The Arch
25
+ description: The complete private company brain — the whole Enterprise OS plus the grant pipeline, the web3 ecosystem overlay, and the dev dashboard.
26
+ icon: landmark
27
+ color: "#7C3AED"
28
+ tags: [suite, private, arch, grants, web3, flagship]
29
+ isPublic: false
30
+
31
+ # `require` (deps-first). enterprise-os brings the public core; the three private
32
+ # flagships overlay onto it (grants→operations, blockchain-ecosystem→ecosystem)
33
+ # or stand alongside it (dev-dashboard). Transitive: enterprise-os's own deps
34
+ # resolve before the overlays that compose onto them.
35
+ dependencies:
36
+ - slug: enterprise-os
37
+ kind: workspace
38
+ relation: require
39
+ reason: "The whole public operating core — strategy, market, operations, and pipeline — that the private flagships extend."
40
+ - slug: grants
41
+ kind: workspace
42
+ relation: require
43
+ reason: "The grant-agency pipeline; composes its operations onto the Operations workspace the OS installs."
44
+ - slug: blockchain-ecosystem
45
+ kind: workspace
46
+ relation: require
47
+ reason: "Web3 market actors + relations; composes onto the Ecosystem workspace the OS installs."
48
+ - slug: dev-dashboard
49
+ kind: workspace
50
+ relation: require
51
+ reason: "The engineering / ops dashboard — the build-side view of the company."
52
+
53
+ workspace:
54
+ name: The Arch
55
+ description: The private command layer over the full company brain — track the cross-workspace initiatives that span the operating system and its private flagships.
56
+ subtype: the-arch
57
+ visibility: private
58
+
59
+ profiles:
60
+ # The Arch's one native profile: a cross-cutting initiative that spans several
61
+ # of the workspaces this suite installs (a grant round that touches operations,
62
+ # ecosystem, and the dev dashboard, say). The place to stand above the lenses.
63
+ - slug: initiative
64
+ displayName: Initiative
65
+ icon: flag
66
+ color: "#7C3AED"
67
+ description: A cross-workspace initiative that spans the operating system and its private flagships.
68
+ properties:
69
+ - slug: summary
70
+ label: Summary
71
+ valueType: string
72
+ inputType: textarea
73
+ - slug: stage
74
+ label: Stage
75
+ valueType: string
76
+ inputType: select
77
+ enumValues: [shaping, active, blocked, shipped, archived]
78
+ constraints: { defaultValue: shaping }
79
+ - slug: lead
80
+ label: Lead
81
+ valueType: string
82
+ inputType: text
83
+ - slug: priority
84
+ label: Priority
85
+ valueType: string
86
+ inputType: select
87
+ enumValues: [low, medium, high, critical]
88
+ constraints: { defaultValue: medium }
89
+ - slug: dueDate
90
+ label: Due Date
91
+ valueType: date
92
+ inputType: date
93
+
94
+ views:
95
+ - name: Initiatives
96
+ slug: initiatives
97
+ type: table
98
+ scopeProfileSlug: initiative
99
+ description: The cross-workspace initiatives spanning the full company brain, by stage and priority.
100
+ defaultView: true
101
+ config:
102
+ columns: [title, stage, priority, lead, dueDate]
103
+ - name: Initiative Board
104
+ slug: initiative-board
105
+ type: kanban
106
+ scopeProfileSlug: initiative
107
+ description: Initiatives grouped by stage — the command view over everything in flight.
108
+ config:
109
+ groupBy: stage
110
+
111
+ onboarding:
112
+ goal: >
113
+ Name the cross-workspace initiatives that span the operating system and its
114
+ private flagships — the few big things in flight that touch more than one
115
+ lens — so The Arch is a real command layer, not just an aggregate of apps.
116
+ framing: |
117
+ THE FOUNDER'S COMMAND LAYER: Act from the seat above every lens. The whole
118
+ company brain is installed — operating core plus the private grant, web3, and
119
+ dev flagships. Your job is to surface the handful of initiatives that cut
120
+ across them and give each a stage, a lead, and a priority.
121
+ expertise:
122
+ starters:
123
+ - >
124
+ Name the cross-cutting few. An initiative earns a place here only if it
125
+ spans more than one workspace — a grant round that pulls in operations,
126
+ ecosystem, and dev. Single-lens work stays in its lens.
127
+ - >
128
+ Give each initiative a real stage and lead. Shaping / active / blocked /
129
+ shipped is the honest status; a lead is who to ask. Without them the
130
+ command layer is a wish list.
131
+ blindSpots:
132
+ - >
133
+ Everything marked "high priority" is the same as nothing marked. Force
134
+ the ranking — what is actually critical this week?
135
+ - >
136
+ A blocked initiative with no note about the blocker is invisible risk.
137
+ Name what is stuck and on whom.
138
+ bar: >
139
+ A short command board: the few genuinely cross-workspace initiatives, each
140
+ with a stage, a lead, and an honest priority — sitting over a fully
141
+ installed company brain.
142
+ collect:
143
+ - profileSlug: initiative
144
+ what: The cross-workspace initiatives currently in flight.
145
+ cardinality: few
146
+ keyFields: [stage, priority, lead]
147
+ openingQuestions:
148
+ - "What are the few big initiatives in flight that span more than one part of the company?"
149
+ - "For each, what stage is it in and who is the lead?"
150
+ doneWhen: A few cross-workspace initiatives captured, each with a stage and a lead.
151
+
152
+ app:
153
+ kind: stored
154
+ cellKey: entity-detail
155
+
156
+ layout:
157
+ defaultView: Initiatives
158
+ defaultApp: null
159
+ pinnedApps: [dashboard, data]
160
+ sidebarItems:
161
+ - kind: view
162
+ viewName: Initiatives
163
+ label: Initiatives
164
+ icon: flag
165
+ - kind: view
166
+ viewName: Initiative Board
167
+ label: Board
168
+ icon: kanban-square
169
+ - kind: app
170
+ appId: data
171
+ label: Data
172
+ icon: database
173
+
174
+ bento:
175
+ viewName: Initiatives
176
+ blocks:
177
+ - kind: view
178
+ viewName: Initiatives
179
+ pos: { x: 0, y: 0, w: 8, h: 4 }
180
+ - kind: view
181
+ viewName: Initiative Board
182
+ pos: { x: 8, y: 0, w: 4, h: 4 }
package/src/types.ts CHANGED
@@ -299,6 +299,13 @@ export interface TemplatePlaybook {
299
299
  schedule?: { cron: string } | null;
300
300
  /** tool/skill keys this playbook grants. */
301
301
  grants?: string[];
302
+ /**
303
+ * The entity kind this playbook operates over, persisted to
304
+ * `playbooks.subject_profile`. Makes the playbook matchable by
305
+ * `playbooks.matchForEntity` (filters `subject_profile->>'profileSlug'`), so a
306
+ * captured entity of this kind can auto-launch the playbook as a session.
307
+ */
308
+ subjectProfile?: { profileSlug: string; filter?: Record<string, unknown> };
302
309
  status?: 'draft' | 'active' | 'paused';
303
310
  }
304
311
 
@@ -351,6 +358,56 @@ export interface TemplateExtendsRef {
351
358
  * `grants` → `operations`). Distinct from `extends` (which imports from a live
352
359
  * workspace, tRPC-only) — `dependencies` is template→template.
353
360
  */
361
+ /**
362
+ * PACKAGE_DEPENDENCY_KINDS — the dependency-kind vocabulary, declared ONCE.
363
+ *
364
+ * This tuple exists so consumers can IMPORT the vocabulary instead of
365
+ * hand-copying it. `TemplateDependency` is currently mirrored by hand in six
366
+ * other places, four of which carry a comment promising they match "VERBATIM so
367
+ * the wire shape never drifts" — a comment doing a type's job. A comment cannot
368
+ * fail a build; an import can. Those mirrors live in repos this package does not
369
+ * own, so this tuple does not fix them by existing — it makes the fix possible:
370
+ *
371
+ * - marketplace `types.ts:102`
372
+ * - onboarding `workspace-templates.ts:27`
373
+ * - synap-backend `package-definition.ts:204` (exports its own
374
+ * `PackageDependencyKind` — the closest peer)
375
+ * - hub-protocol REST `rest/packages.ts:140` (zod enum)
376
+ * - browser `InstallPackageDialog.tsx:262`
377
+ * - control-plane-api `routes/packages.ts:436` (zod enum)
378
+ *
379
+ * ⚠️ `'automation'` IS RETIRED VOCABULARY, deliberately still listed here.
380
+ * CP migration `0049_package_vocabulary` retired the `automation` package
381
+ * category in favour of `workflow` ("workflow — a triggered/sequenced run
382
+ * (absorbs 'automation' + 'playbook')", `PACKAGE_TYPES` in CP
383
+ * `db/schema/packages.ts`). A dependency's `kind` names the TYPE of package it
384
+ * points at, so this vocabulary should track `PACKAGE_TYPES` — meaning the live
385
+ * spelling is `workflow`, not `automation`.
386
+ *
387
+ * It is NOT renamed here, on purpose. This is latent, not live: 0/21 templates
388
+ * declare any `kind` other than the default `'workspace'`. And all four wire
389
+ * enums (CP + hub zod, above) still accept `'automation'` and do NOT accept
390
+ * `'workflow'` — so emitting `'workflow'` today would be rejected with a 400 at
391
+ * both doors, and dropping `'automation'` from this tuple would make any
392
+ * consumer that derives a zod enum from it start rejecting a value the wire
393
+ * still legally accepts (a published third-party package may carry it; CP's own
394
+ * schema permits it). Narrowing must therefore follow the wire, not lead it.
395
+ *
396
+ * ORDERED FIX (each step deployable alone, no flag day):
397
+ * 1. Widen the CP + hub zod enums to accept BOTH `'automation'` and `'workflow'`.
398
+ * 2. Add `'workflow'` here; mark `'automation'` deprecated; migrate any authored use.
399
+ * 3. Once no payload carries `'automation'`, drop it from the wire enums and this tuple.
400
+ */
401
+ export const PACKAGE_DEPENDENCY_KINDS = [
402
+ 'workspace',
403
+ 'capability',
404
+ /** @deprecated Retired by CP 0049 in favour of `workflow`. See note above. */
405
+ 'automation',
406
+ ] as const;
407
+
408
+ /** What a `TemplateDependency` points at. Derived — never re-declare the list. */
409
+ export type PackageDependencyKind = (typeof PACKAGE_DEPENDENCY_KINDS)[number];
410
+
354
411
  export interface TemplateDependency {
355
412
  /** Slug of the template/package this one depends on. */
356
413
  slug: string;
@@ -359,7 +416,7 @@ export interface TemplateDependency {
359
416
  * dependencies can be `compose`d; `'capability'`/`'automation'` are always
360
417
  * `require`d present without merging.
361
418
  */
362
- kind?: 'workspace' | 'capability' | 'automation';
419
+ kind?: PackageDependencyKind;
363
420
  /**
364
421
  * How this template relates to the dependency:
365
422
  * - `'compose'`: this template is an OVERLAY on the dependency's workspace.