@synap-core/workspace-templates 0.10.0 → 0.11.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.
- package/dist/index.d.ts +59 -34
- package/dist/index.js +375 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__fixtures__/report-automation-flow.json +2 -2
- package/src/base.yaml +2 -2
- package/src/blockchain-ecosystem.yaml +106 -0
- package/src/catalog.ts +36 -0
- package/src/grants.yaml +248 -1
- package/src/networking.yaml +14 -3
- package/src/templates.ts +360 -5
- package/src/the-arch.yaml +4 -0
- package/src/types.ts +32 -34
package/dist/index.d.ts
CHANGED
|
@@ -455,43 +455,37 @@ interface TemplateExtendsRef {
|
|
|
455
455
|
* PACKAGE_DEPENDENCY_KINDS — the dependency-kind vocabulary, declared ONCE.
|
|
456
456
|
*
|
|
457
457
|
* This tuple exists so consumers can IMPORT the vocabulary instead of
|
|
458
|
-
* hand-copying it. `TemplateDependency` is
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
* fail a build; an import can. Those mirrors live in repos this package does not
|
|
462
|
-
* own, so this tuple does not fix them by existing — it makes the fix possible:
|
|
458
|
+
* hand-copying it. `TemplateDependency` is mirrored by hand in several other
|
|
459
|
+
* places — a comment cannot fail a build, an import can, but these mirrors live
|
|
460
|
+
* in repos this package does not own, so they must match this list EXACTLY:
|
|
463
461
|
*
|
|
464
|
-
* - marketplace `types.ts
|
|
465
|
-
* - onboarding `workspace-templates.ts
|
|
466
|
-
* -
|
|
467
|
-
*
|
|
468
|
-
* - hub-protocol REST `rest/packages.ts
|
|
469
|
-
* -
|
|
470
|
-
*
|
|
462
|
+
* - marketplace `features/marketplace/src/types.ts`
|
|
463
|
+
* - onboarding `features/onboarding/src/{templates/workspace-templates,components/WorkspacePreview}.ts(x)`
|
|
464
|
+
* - browser `InstallPackageDialog.tsx`
|
|
465
|
+
* - synap-backend `package-definition.ts` (`PackageDependencyKind`)
|
|
466
|
+
* - hub-protocol REST `rest/packages.ts` (zod enum)
|
|
467
|
+
* - control-plane-api `db/schema/packages.ts` (`TemplateDependency` type)
|
|
468
|
+
* + `routes/packages.ts` (`DEPENDENCY_KINDS` zod enum)
|
|
471
469
|
*
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
* `db/schema/packages.ts`). A dependency's `kind` names the TYPE of package it
|
|
477
|
-
* points at, so this vocabulary should track `PACKAGE_TYPES` — meaning the live
|
|
478
|
-
* spelling is `workflow`, not `automation`.
|
|
470
|
+
* These are the 7 literals the wire accepts, in lockstep with the CP publish
|
|
471
|
+
* enum (`DEPENDENCY_KINDS = [...PACKAGE_TYPES, "automation"]`, CP
|
|
472
|
+
* `routes/packages.ts`), the hub install enum (`rest/packages.ts`), and the
|
|
473
|
+
* backend resolver's `PackageDependencyKind` (`@synap/database`).
|
|
479
474
|
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
*
|
|
483
|
-
* `
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
* still legally accepts (a published third-party package may carry it; CP's own
|
|
487
|
-
* schema permits it). Narrowing must therefore follow the wire, not lead it.
|
|
475
|
+
* Resolver behaviour (backend `package-dependency-resolver.ts`):
|
|
476
|
+
* - `workspace` → resolve+install; the ONLY kind that may `compose`.
|
|
477
|
+
* - `capability` / `cell` → resolve+install, always `require`d (presence).
|
|
478
|
+
* - `skill` / `workflow` / `view` / `automation` → ACCEPTED and `require`d
|
|
479
|
+
* present, surfaced as `required-absent` (non-fatal) — no standalone by-slug
|
|
480
|
+
* applier on the pod yet; when one grows, give the kind its own branch.
|
|
488
481
|
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
482
|
+
* `'automation'` is legacy vocabulary: CP migration `0049_package_vocabulary`
|
|
483
|
+
* renamed the `automation` package category → `workflow` (which absorbs
|
|
484
|
+
* automation + playbook, `PACKAGE_TYPES` in CP `db/schema/packages.ts`). It
|
|
485
|
+
* stays accepted on the wire — and therefore in this tuple — for back-compat
|
|
486
|
+
* with dependencies published before the rename.
|
|
493
487
|
*/
|
|
494
|
-
declare const PACKAGE_DEPENDENCY_KINDS: readonly ["workspace", "capability", "automation"];
|
|
488
|
+
declare const PACKAGE_DEPENDENCY_KINDS: readonly ["workspace", "capability", "skill", "workflow", "view", "cell", "automation"];
|
|
495
489
|
/** What a `TemplateDependency` points at. Derived — never re-declare the list. */
|
|
496
490
|
type PackageDependencyKind = (typeof PACKAGE_DEPENDENCY_KINDS)[number];
|
|
497
491
|
interface TemplateDependency {
|
|
@@ -499,8 +493,8 @@ interface TemplateDependency {
|
|
|
499
493
|
slug: string;
|
|
500
494
|
/**
|
|
501
495
|
* What the dependency is. Default `'workspace'`. Only `'workspace'`
|
|
502
|
-
* dependencies can be `compose`d;
|
|
503
|
-
*
|
|
496
|
+
* dependencies can be `compose`d; every other kind is always `require`d
|
|
497
|
+
* present without merging.
|
|
504
498
|
*/
|
|
505
499
|
kind?: PackageDependencyKind;
|
|
506
500
|
/**
|
|
@@ -681,6 +675,19 @@ declare function listPublicTemplates(): WorkspaceYaml[];
|
|
|
681
675
|
* in the consumers; this door only merges arrays they already fetched.
|
|
682
676
|
*/
|
|
683
677
|
|
|
678
|
+
/**
|
|
679
|
+
* A lightweight, QUERY-TIME summary of one sub-object a package carries (a cell
|
|
680
|
+
* today; the shape generalizes to views/automations without change). Rides the
|
|
681
|
+
* catalog LIST projection so a surface can match/surface a sub-item WITHOUT the
|
|
682
|
+
* full `definition` — it carries `key + name` only, never the sub-object's code.
|
|
683
|
+
* `kind` is DERIVED (in the CP SELECT, from which sub-array the row came from),
|
|
684
|
+
* never a stored taxonomy.
|
|
685
|
+
*/
|
|
686
|
+
interface PackageItemSummary {
|
|
687
|
+
kind: string;
|
|
688
|
+
key: string;
|
|
689
|
+
name: string;
|
|
690
|
+
}
|
|
684
691
|
/**
|
|
685
692
|
* A bundled template — the canonical `WorkspaceYaml` this package ships. Callers
|
|
686
693
|
* pass `listPublicTemplates()` (18) or `listWorkspaceTemplates()` (21); the door
|
|
@@ -716,6 +723,13 @@ interface RemoteEntry {
|
|
|
716
723
|
* never "unknown-so-hide".
|
|
717
724
|
*/
|
|
718
725
|
isPrivate?: boolean;
|
|
726
|
+
/**
|
|
727
|
+
* Lightweight computed summary of the row's sub-objects (cells), carried on the
|
|
728
|
+
* LIST projection so a surface can surface a matching sub-item without the full
|
|
729
|
+
* `definition`. `undefined` on sources that don't compute it (bundled) — treated
|
|
730
|
+
* as "no known sub-items". See `PackageItemSummary`.
|
|
731
|
+
*/
|
|
732
|
+
items?: PackageItemSummary[];
|
|
719
733
|
/**
|
|
720
734
|
* The CP `definition` jsonb — opaque install payload. The door reads only
|
|
721
735
|
* `definition.sourcePackage.version` (the winner signal). Absent on browse rows
|
|
@@ -775,6 +789,11 @@ interface CpPackageRow {
|
|
|
775
789
|
icon?: string | null;
|
|
776
790
|
/** Present only on `/mine` rows. `false` ⇒ private. Browse rows omit it. */
|
|
777
791
|
isPublic?: boolean;
|
|
792
|
+
/**
|
|
793
|
+
* Computed sub-object summary from `GET /api/packages` / `/mine` (query-time,
|
|
794
|
+
* not a stored column). Carries `key + name` per cell; never the cell code.
|
|
795
|
+
*/
|
|
796
|
+
items?: PackageItemSummary[];
|
|
778
797
|
}
|
|
779
798
|
/**
|
|
780
799
|
* Map a CP list row into the merge door's `RemoteEntry`. THE canonical mapping —
|
|
@@ -800,6 +819,12 @@ interface CatalogEntryBase {
|
|
|
800
819
|
icon?: string | null;
|
|
801
820
|
/** `true` ⇒ not publicly listed (internal bundled template, or private CP row). */
|
|
802
821
|
isPrivate: boolean;
|
|
822
|
+
/**
|
|
823
|
+
* The entry's sub-object summary (cells). Always present (defaults to `[]`) so a
|
|
824
|
+
* consumer can match sub-items uniformly. Bundled workspace templates carry no
|
|
825
|
+
* cells → `[]` (honest); a remote row carries its CP-computed `items`.
|
|
826
|
+
*/
|
|
827
|
+
items: PackageItemSummary[];
|
|
803
828
|
}
|
|
804
829
|
/** A catalog entry backed by a bundled template. Install via `toWorkspaceDefinition()` / `toPackageDefinition()` on `template`. */
|
|
805
830
|
interface BundledCatalogEntry extends CatalogEntryBase {
|