@synap-core/workspace-templates 0.5.0 → 0.6.1
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.
- package/dist/index.d.ts +734 -17
- package/dist/index.js +25031 -20
- package/dist/index.js.map +1 -0
- package/package.json +7 -5
- package/src/agent-fleet.yaml +16 -8
- package/src/blockchain-ecosystem.yaml +372 -0
- package/src/catalog.test.ts +156 -0
- package/src/catalog.ts +285 -0
- package/src/communication.yaml +689 -0
- package/src/content-os.yaml +252 -771
- package/src/crm.yaml +181 -2071
- package/src/define.ts +292 -6
- package/src/dev-dashboard.yaml +3 -0
- package/src/ecosystem.yaml +478 -0
- package/src/enterprise-os.yaml +183 -0
- package/src/foundation.yaml +226 -0
- package/src/grants.yaml +1096 -0
- package/src/hr.yaml +6 -0
- package/src/index.ts +32 -5
- package/src/internal-runbook.yaml +499 -0
- package/src/legal.yaml +6 -6
- package/src/marketing.yaml +48 -12
- package/src/operations.yaml +146 -420
- package/src/social.yaml +246 -0
- package/src/templates.ts +12812 -12260
- package/src/the-arch.yaml +182 -0
- package/src/types.ts +105 -0
- package/dist/define.d.ts +0 -97
- package/dist/define.d.ts.map +0 -1
- package/dist/define.js +0 -91
- package/dist/index.d.ts.map +0 -1
- package/dist/templates.d.ts +0 -7
- package/dist/templates.d.ts.map +0 -1
- package/dist/templates.js +0 -24237
- package/dist/types.d.ts +0 -350
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -8
- package/src/radar.yaml +0 -297
|
@@ -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
|
@@ -53,6 +53,10 @@ export interface TemplateProfile {
|
|
|
53
53
|
scope?: string;
|
|
54
54
|
/** Semantic slug for system profiles. */
|
|
55
55
|
semanticSlug?: string;
|
|
56
|
+
/** Kind vs role profile. Omit for default ('kind'). */
|
|
57
|
+
profileKind?: "kind" | "role";
|
|
58
|
+
/** For profileKind='role': which base-kind profile slugs this role can attach to. */
|
|
59
|
+
applicableKinds?: string[];
|
|
56
60
|
properties: TemplateProperty[];
|
|
57
61
|
}
|
|
58
62
|
|
|
@@ -329,6 +333,99 @@ export interface TemplateExtendsRef {
|
|
|
329
333
|
};
|
|
330
334
|
}
|
|
331
335
|
|
|
336
|
+
// ============================================================================
|
|
337
|
+
// Dependencies — the template composition graph (base + overlay)
|
|
338
|
+
// ============================================================================
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* A dependency this template declares on ANOTHER template/package. The install
|
|
342
|
+
* resolver (backend `POST /api/hub/packages/apply`) reads these to build the
|
|
343
|
+
* pod's template graph: every dependency is ensured present before this
|
|
344
|
+
* template is applied — missing ones install first (topologically) — and a
|
|
345
|
+
* `compose` dependency LAYERS this template's schema additively onto the
|
|
346
|
+
* dependency's workspace instead of creating a second workspace.
|
|
347
|
+
*
|
|
348
|
+
* This is the general composition primitive: a BASE template carries the
|
|
349
|
+
* agnostic data model; an OVERLAY template `compose`s onto it and adds the
|
|
350
|
+
* use-case-specific data (e.g. `blockchain-ecosystem` → `ecosystem`,
|
|
351
|
+
* `grants` → `operations`). Distinct from `extends` (which imports from a live
|
|
352
|
+
* workspace, tRPC-only) — `dependencies` is template→template.
|
|
353
|
+
*/
|
|
354
|
+
/**
|
|
355
|
+
* PACKAGE_DEPENDENCY_KINDS — the dependency-kind vocabulary, declared ONCE.
|
|
356
|
+
*
|
|
357
|
+
* This tuple exists so consumers can IMPORT the vocabulary instead of
|
|
358
|
+
* hand-copying it. `TemplateDependency` is currently mirrored by hand in six
|
|
359
|
+
* other places, four of which carry a comment promising they match "VERBATIM so
|
|
360
|
+
* the wire shape never drifts" — a comment doing a type's job. A comment cannot
|
|
361
|
+
* fail a build; an import can. Those mirrors live in repos this package does not
|
|
362
|
+
* own, so this tuple does not fix them by existing — it makes the fix possible:
|
|
363
|
+
*
|
|
364
|
+
* - marketplace `types.ts:102`
|
|
365
|
+
* - onboarding `workspace-templates.ts:27`
|
|
366
|
+
* - synap-backend `package-definition.ts:204` (exports its own
|
|
367
|
+
* `PackageDependencyKind` — the closest peer)
|
|
368
|
+
* - hub-protocol REST `rest/packages.ts:140` (zod enum)
|
|
369
|
+
* - browser `InstallPackageDialog.tsx:262`
|
|
370
|
+
* - control-plane-api `routes/packages.ts:436` (zod enum)
|
|
371
|
+
*
|
|
372
|
+
* ⚠️ `'automation'` IS RETIRED VOCABULARY, deliberately still listed here.
|
|
373
|
+
* CP migration `0049_package_vocabulary` retired the `automation` package
|
|
374
|
+
* category in favour of `workflow` ("workflow — a triggered/sequenced run
|
|
375
|
+
* (absorbs 'automation' + 'playbook')", `PACKAGE_TYPES` in CP
|
|
376
|
+
* `db/schema/packages.ts`). A dependency's `kind` names the TYPE of package it
|
|
377
|
+
* points at, so this vocabulary should track `PACKAGE_TYPES` — meaning the live
|
|
378
|
+
* spelling is `workflow`, not `automation`.
|
|
379
|
+
*
|
|
380
|
+
* It is NOT renamed here, on purpose. This is latent, not live: 0/21 templates
|
|
381
|
+
* declare any `kind` other than the default `'workspace'`. And all four wire
|
|
382
|
+
* enums (CP + hub zod, above) still accept `'automation'` and do NOT accept
|
|
383
|
+
* `'workflow'` — so emitting `'workflow'` today would be rejected with a 400 at
|
|
384
|
+
* both doors, and dropping `'automation'` from this tuple would make any
|
|
385
|
+
* consumer that derives a zod enum from it start rejecting a value the wire
|
|
386
|
+
* still legally accepts (a published third-party package may carry it; CP's own
|
|
387
|
+
* schema permits it). Narrowing must therefore follow the wire, not lead it.
|
|
388
|
+
*
|
|
389
|
+
* ORDERED FIX (each step deployable alone, no flag day):
|
|
390
|
+
* 1. Widen the CP + hub zod enums to accept BOTH `'automation'` and `'workflow'`.
|
|
391
|
+
* 2. Add `'workflow'` here; mark `'automation'` deprecated; migrate any authored use.
|
|
392
|
+
* 3. Once no payload carries `'automation'`, drop it from the wire enums and this tuple.
|
|
393
|
+
*/
|
|
394
|
+
export const PACKAGE_DEPENDENCY_KINDS = [
|
|
395
|
+
'workspace',
|
|
396
|
+
'capability',
|
|
397
|
+
/** @deprecated Retired by CP 0049 in favour of `workflow`. See note above. */
|
|
398
|
+
'automation',
|
|
399
|
+
] as const;
|
|
400
|
+
|
|
401
|
+
/** What a `TemplateDependency` points at. Derived — never re-declare the list. */
|
|
402
|
+
export type PackageDependencyKind = (typeof PACKAGE_DEPENDENCY_KINDS)[number];
|
|
403
|
+
|
|
404
|
+
export interface TemplateDependency {
|
|
405
|
+
/** Slug of the template/package this one depends on. */
|
|
406
|
+
slug: string;
|
|
407
|
+
/**
|
|
408
|
+
* What the dependency is. Default `'workspace'`. Only `'workspace'`
|
|
409
|
+
* dependencies can be `compose`d; `'capability'`/`'automation'` are always
|
|
410
|
+
* `require`d present without merging.
|
|
411
|
+
*/
|
|
412
|
+
kind?: PackageDependencyKind;
|
|
413
|
+
/**
|
|
414
|
+
* How this template relates to the dependency:
|
|
415
|
+
* - `'compose'`: this template is an OVERLAY on the dependency's workspace.
|
|
416
|
+
* The base is installed first if absent, then this template's profiles /
|
|
417
|
+
* roles / relations / views are applied ADDITIVELY onto the base workspace
|
|
418
|
+
* — no separate workspace is created for this template.
|
|
419
|
+
* - `'require'` (default): the dependency must be present on the pod as its
|
|
420
|
+
* own artifact, but this template does not merge into it.
|
|
421
|
+
*/
|
|
422
|
+
relation?: 'compose' | 'require';
|
|
423
|
+
/**
|
|
424
|
+
* Short human reason shown in the install-time "this also installs…" prompt.
|
|
425
|
+
*/
|
|
426
|
+
reason?: string;
|
|
427
|
+
}
|
|
428
|
+
|
|
332
429
|
// ============================================================================
|
|
333
430
|
// Top-level template definition (YAML shape)
|
|
334
431
|
// ============================================================================
|
|
@@ -429,6 +526,14 @@ export interface WorkspaceYaml {
|
|
|
429
526
|
|
|
430
527
|
/** Inherit profiles/views from other workspaces */
|
|
431
528
|
extends?: TemplateExtendsRef[];
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Template-composition dependencies — other templates this one needs. The
|
|
532
|
+
* install resolver installs missing dependencies first and, for a `compose`
|
|
533
|
+
* dependency, layers this template additively onto the dependency's
|
|
534
|
+
* workspace. See {@link TemplateDependency}.
|
|
535
|
+
*/
|
|
536
|
+
dependencies?: TemplateDependency[];
|
|
432
537
|
}
|
|
433
538
|
|
|
434
539
|
// ============================================================================
|
package/dist/define.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synap-core/workspace-templates — Definition adapter
|
|
3
|
-
*
|
|
4
|
-
* Converts a YAML template (WorkspaceYaml) into the flat payload shape that
|
|
5
|
-
* the backend `workspaces.createFromDefinition` mutation + Hub REST
|
|
6
|
-
* `/workspaces/from-definition` endpoint expect.
|
|
7
|
-
*
|
|
8
|
-
* This is the single canonical seam: every consumer (browser app, onboarding,
|
|
9
|
-
* CLI, marketplace) provisions a workspace through this function so the wire
|
|
10
|
-
* shape never drifts per call-site.
|
|
11
|
-
*/
|
|
12
|
-
import type { WorkspaceYaml } from './types.js';
|
|
13
|
-
/** The flat definition object accepted by createFromDefinition. */
|
|
14
|
-
export interface WorkspaceDefinitionInput {
|
|
15
|
-
workspaceName: string;
|
|
16
|
-
description: string;
|
|
17
|
-
proposalId?: string;
|
|
18
|
-
profiles: WorkspaceYaml['profiles'];
|
|
19
|
-
views: NonNullable<WorkspaceYaml['views']>;
|
|
20
|
-
entityLinks: NonNullable<WorkspaceYaml['entityLinks']>;
|
|
21
|
-
seedEntities: NonNullable<WorkspaceYaml['seedEntities']>;
|
|
22
|
-
suggestedRelations?: WorkspaceYaml['suggestedRelations'];
|
|
23
|
-
displayTemplates?: WorkspaceYaml['displayTemplates'];
|
|
24
|
-
layoutConfig: WorkspaceYaml['layout'] | undefined;
|
|
25
|
-
bentoViewName?: string;
|
|
26
|
-
bentoViewBlocks?: NonNullable<WorkspaceYaml['bento']>['blocks'];
|
|
27
|
-
profileEntityBentoTemplates?: WorkspaceYaml['profileEntityBentoTemplates'];
|
|
28
|
-
workspaceSubtype?: string;
|
|
29
|
-
workspaceType?: NonNullable<WorkspaceYaml['workspace']>['workspaceType'];
|
|
30
|
-
workspaceVisibility?: string;
|
|
31
|
-
workspaceCapabilities?: string[];
|
|
32
|
-
sourceRoles?: NonNullable<WorkspaceYaml['workspace']>['sourceRoles'];
|
|
33
|
-
defaultSources?: NonNullable<WorkspaceYaml['workspace']>['defaultSources'];
|
|
34
|
-
/** Per-workspace onboarding context — written to settings.onboarding. */
|
|
35
|
-
onboarding?: WorkspaceYaml['onboarding'];
|
|
36
|
-
}
|
|
37
|
-
export interface ToDefinitionResult {
|
|
38
|
-
definition: WorkspaceDefinitionInput;
|
|
39
|
-
/** Stable idempotency key — the template's proposalId or slug. */
|
|
40
|
-
proposalId: string;
|
|
41
|
-
/** Display name for the new workspace. */
|
|
42
|
-
workspaceName: string;
|
|
43
|
-
/** Template id for telemetry / dedup. */
|
|
44
|
-
templateId: string;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Resolve a template (by slug or YAML object) into the createFromDefinition
|
|
48
|
-
* payload. Pass `nameOverride` to rename the workspace at creation time.
|
|
49
|
-
*/
|
|
50
|
-
export declare function toWorkspaceDefinition(slugOrYaml: string | WorkspaceYaml, nameOverride?: string): ToDefinitionResult;
|
|
51
|
-
/**
|
|
52
|
-
* The unified `PackageDefinition` shape consumed by `POST /api/hub/packages/apply`
|
|
53
|
-
* (CLI `synap launch`) and the CP package registry seeder. It composes the
|
|
54
|
-
* workspace definition with the capability/playbook/onboarding layers. Mirrors
|
|
55
|
-
* `PackageDefinition` in synap-backend `package-definition.ts`. Typed loosely on
|
|
56
|
-
* the layered fields to avoid a backend import; the wire validation lives in the
|
|
57
|
-
* apply endpoint.
|
|
58
|
-
*/
|
|
59
|
-
export interface PackageDefinitionOutput {
|
|
60
|
-
_meta: {
|
|
61
|
-
slug: string;
|
|
62
|
-
icon?: string;
|
|
63
|
-
color?: string;
|
|
64
|
-
tags?: string[];
|
|
65
|
-
isPublic?: boolean;
|
|
66
|
-
requiredTier?: string | null;
|
|
67
|
-
};
|
|
68
|
-
workspaceName: string;
|
|
69
|
-
description: string;
|
|
70
|
-
workspaceType?: WorkspaceYaml['workspace']['workspaceType'];
|
|
71
|
-
workspaceSubtype?: string;
|
|
72
|
-
workspaceVisibility?: string;
|
|
73
|
-
workspaceCapabilities?: string[];
|
|
74
|
-
sourceRoles?: WorkspaceYaml['workspace']['sourceRoles'];
|
|
75
|
-
defaultSources?: WorkspaceYaml['workspace']['defaultSources'];
|
|
76
|
-
profiles: WorkspaceYaml['profiles'];
|
|
77
|
-
views: NonNullable<WorkspaceYaml['views']>;
|
|
78
|
-
suggestedEntities: NonNullable<WorkspaceYaml['seedEntities']>;
|
|
79
|
-
suggestedRelations?: WorkspaceYaml['suggestedRelations'];
|
|
80
|
-
displayTemplates?: WorkspaceYaml['displayTemplates'];
|
|
81
|
-
entityLinks?: WorkspaceYaml['entityLinks'];
|
|
82
|
-
bentoLayout?: NonNullable<WorkspaceYaml['bento']>['blocks'];
|
|
83
|
-
bentoViewName?: string;
|
|
84
|
-
profileEntityBentoTemplates?: WorkspaceYaml['profileEntityBentoTemplates'];
|
|
85
|
-
layoutConfig?: WorkspaceYaml['layout'];
|
|
86
|
-
capabilities?: WorkspaceYaml['integrations'];
|
|
87
|
-
playbooks?: WorkspaceYaml['playbooks'];
|
|
88
|
-
onboarding?: WorkspaceYaml['onboarding'];
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Resolve a template (by slug or YAML object) into the full `PackageDefinition`
|
|
92
|
-
* accepted by `POST /api/hub/packages/apply` and the CP registry seeder. This is
|
|
93
|
-
* the single seam the CLI and control-plane use so they read from the canonical
|
|
94
|
-
* package instead of disk-stored JSON.
|
|
95
|
-
*/
|
|
96
|
-
export declare function toPackageDefinition(slugOrYaml: string | WorkspaceYaml): PackageDefinitionOutput;
|
|
97
|
-
//# sourceMappingURL=define.d.ts.map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,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACpC,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,iBAAiB,EAAE,WAAW,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;IAC9D,kBAAkB,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IACzD,gBAAgB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B,CAAC,EAAE,aAAa,CAAC,6BAA6B,CAAC,CAAC;IAC3E,YAAY,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,YAAY,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC7C,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CAC1C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GAAG,aAAa,GACjC,uBAAuB,CAuCzB"}
|
package/dist/define.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synap-core/workspace-templates — Definition adapter
|
|
3
|
-
*
|
|
4
|
-
* Converts a YAML template (WorkspaceYaml) into the flat payload shape that
|
|
5
|
-
* the backend `workspaces.createFromDefinition` mutation + Hub REST
|
|
6
|
-
* `/workspaces/from-definition` endpoint expect.
|
|
7
|
-
*
|
|
8
|
-
* This is the single canonical seam: every consumer (browser app, onboarding,
|
|
9
|
-
* CLI, marketplace) provisions a workspace through this function so the wire
|
|
10
|
-
* shape never drifts per call-site.
|
|
11
|
-
*/
|
|
12
|
-
import { getWorkspaceTemplate } from './templates.js';
|
|
13
|
-
/**
|
|
14
|
-
* Resolve a template (by slug or YAML object) into the createFromDefinition
|
|
15
|
-
* payload. Pass `nameOverride` to rename the workspace at creation time.
|
|
16
|
-
*/
|
|
17
|
-
export function toWorkspaceDefinition(slugOrYaml, nameOverride) {
|
|
18
|
-
const tpl = typeof slugOrYaml === 'string' ? getWorkspaceTemplate(slugOrYaml) : slugOrYaml;
|
|
19
|
-
if (!tpl) {
|
|
20
|
-
throw new Error(`Workspace template not found: ${String(slugOrYaml)}`);
|
|
21
|
-
}
|
|
22
|
-
const ws = tpl.workspace;
|
|
23
|
-
const name = nameOverride ?? ws.name;
|
|
24
|
-
const proposalId = ws.proposalId ?? `${tpl.meta.slug}-v1`;
|
|
25
|
-
const definition = {
|
|
26
|
-
workspaceName: name,
|
|
27
|
-
description: ws.description,
|
|
28
|
-
proposalId,
|
|
29
|
-
profiles: tpl.profiles,
|
|
30
|
-
views: tpl.views ?? [],
|
|
31
|
-
entityLinks: tpl.entityLinks ?? [],
|
|
32
|
-
seedEntities: tpl.seedEntities ?? [],
|
|
33
|
-
suggestedRelations: tpl.suggestedRelations,
|
|
34
|
-
displayTemplates: tpl.displayTemplates,
|
|
35
|
-
layoutConfig: tpl.layout,
|
|
36
|
-
bentoViewName: tpl.bento?.viewName,
|
|
37
|
-
bentoViewBlocks: tpl.bento?.blocks,
|
|
38
|
-
profileEntityBentoTemplates: tpl.profileEntityBentoTemplates,
|
|
39
|
-
workspaceSubtype: ws.subtype,
|
|
40
|
-
workspaceType: ws.workspaceType,
|
|
41
|
-
workspaceVisibility: ws.visibility,
|
|
42
|
-
workspaceCapabilities: ws.capabilities,
|
|
43
|
-
sourceRoles: ws.sourceRoles,
|
|
44
|
-
defaultSources: ws.defaultSources,
|
|
45
|
-
onboarding: tpl.onboarding,
|
|
46
|
-
};
|
|
47
|
-
return { definition, proposalId, workspaceName: name, templateId: tpl.meta.slug };
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Resolve a template (by slug or YAML object) into the full `PackageDefinition`
|
|
51
|
-
* accepted by `POST /api/hub/packages/apply` and the CP registry seeder. This is
|
|
52
|
-
* the single seam the CLI and control-plane use so they read from the canonical
|
|
53
|
-
* package instead of disk-stored JSON.
|
|
54
|
-
*/
|
|
55
|
-
export function toPackageDefinition(slugOrYaml) {
|
|
56
|
-
const tpl = typeof slugOrYaml === 'string' ? getWorkspaceTemplate(slugOrYaml) : slugOrYaml;
|
|
57
|
-
if (!tpl) {
|
|
58
|
-
throw new Error(`Workspace template not found: ${String(slugOrYaml)}`);
|
|
59
|
-
}
|
|
60
|
-
const ws = tpl.workspace;
|
|
61
|
-
return {
|
|
62
|
-
_meta: {
|
|
63
|
-
slug: tpl.meta.slug,
|
|
64
|
-
icon: tpl.meta.icon,
|
|
65
|
-
color: tpl.meta.color,
|
|
66
|
-
tags: tpl.meta.tags,
|
|
67
|
-
isPublic: tpl.meta.isPublic ?? true,
|
|
68
|
-
},
|
|
69
|
-
workspaceName: ws.name,
|
|
70
|
-
description: ws.description,
|
|
71
|
-
workspaceType: ws.workspaceType,
|
|
72
|
-
workspaceSubtype: ws.subtype,
|
|
73
|
-
workspaceVisibility: ws.visibility,
|
|
74
|
-
workspaceCapabilities: ws.capabilities,
|
|
75
|
-
sourceRoles: ws.sourceRoles,
|
|
76
|
-
defaultSources: ws.defaultSources,
|
|
77
|
-
profiles: tpl.profiles,
|
|
78
|
-
views: tpl.views ?? [],
|
|
79
|
-
suggestedEntities: tpl.seedEntities ?? [],
|
|
80
|
-
suggestedRelations: tpl.suggestedRelations,
|
|
81
|
-
displayTemplates: tpl.displayTemplates,
|
|
82
|
-
entityLinks: tpl.entityLinks,
|
|
83
|
-
bentoLayout: tpl.bento?.blocks,
|
|
84
|
-
bentoViewName: tpl.bento?.viewName,
|
|
85
|
-
profileEntityBentoTemplates: tpl.profileEntityBentoTemplates,
|
|
86
|
-
layoutConfig: tpl.layout,
|
|
87
|
-
capabilities: tpl.integrations,
|
|
88
|
-
playbooks: tpl.playbooks,
|
|
89
|
-
onboarding: tpl.onboarding,
|
|
90
|
-
};
|
|
91
|
-
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,YAAY,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,mCAAmC,EACnC,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,+BAA+B,EAC/B,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACzE,YAAY,EACV,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,aAAa,CAAC"}
|
package/dist/templates.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceYaml } from './types.js';
|
|
2
|
-
export declare const WORKSPACE_TEMPLATES: Record<string, WorkspaceYaml>;
|
|
3
|
-
export type WorkspaceTemplateSlug = keyof typeof WORKSPACE_TEMPLATES;
|
|
4
|
-
export declare function getWorkspaceTemplate(slug: string): WorkspaceYaml | undefined;
|
|
5
|
-
export declare function listWorkspaceTemplates(): WorkspaceYaml[];
|
|
6
|
-
export declare function listPublicTemplates(): WorkspaceYaml[];
|
|
7
|
-
//# sourceMappingURL=templates.d.ts.map
|
package/dist/templates.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAkqvBhD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAQ,CAAC;AAEvE,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAErE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAE5E;AAED,wBAAgB,sBAAsB,IAAI,aAAa,EAAE,CAExD;AAED,wBAAgB,mBAAmB,IAAI,aAAa,EAAE,CAErD"}
|