@synap-core/workspace-templates 0.71.0 → 0.72.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synap-core/workspace-templates",
3
- "version": "0.71.0",
3
+ "version": "0.72.0",
4
4
  "type": "module",
5
5
  "description": "Canonical workspace definitions — YAML source + typed exports for browser, backend, CLI, and marketplace",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -35,7 +35,7 @@ Search before the name sticks. A name that already means something else costs a
35
35
 
36
36
  - the pod: `synap_ask "<name>"`, `synap_find` on apps (`devplane_app`) and spaces;
37
37
  - the catalog: `meta.name` / `meta.slug` in `synap-app/packages/workspace-templates/src/*.yaml`, capability keys;
38
- - deprecated and live surfaces: `DEPRECATED_SURFACES` in `@synap-core/types/surfaces`, the browser app manifest
38
+ - deprecated and live host apps and tabs: `DEPRECATED_IN_HOSTS` in `@synap-core/types/hosts`, the browser app manifest
39
39
  (`browser/electron/renderer/src/apps/manifest.ts`), relay routes;
40
40
  - repos and hosts: `gh repo list Synap-core`, the `*.synap.live` hosts you know of.
41
41
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Apify's `capture_social_post` is a PURE URL READER ("Any link → data",
2
+ * Apify's `capture_social_post` (its "Social post capture" add-on) is a PURE URL READER ("Any link → data",
3
3
  * 2026-10-15): same verb id, intent `read_webpage`, `metadata.readOnly`,
4
4
  * declared `urls`, and it returns the UrlRead shape (`@synap-core/types/url-read`).
5
5
  * It writes nothing: the Library item is the one home of a kept post.
@@ -22,9 +22,14 @@ import { describe, expect, it } from "vitest";
22
22
  import { matchUrlPattern, normalizeUrlRead, type ReaderStamp } from "@synap-core/types/url-read";
23
23
 
24
24
  const HERE = dirname(fileURLToPath(import.meta.url));
25
- const manifest = JSON.parse(readFileSync(join(HERE, "../capabilities/apify.capability.json"), "utf8"));
25
+ const readManifest = (file: string) => JSON.parse(readFileSync(join(HERE, "../capabilities", file), "utf8"));
26
26
  type Skill = { name: string; intent?: string; code?: string; urls?: string[]; metadata?: { readOnly?: boolean } };
27
- const skills = manifest.spec.skills as Skill[];
27
+ // The reader is the "Social post capture" add-on's action since D6 (an add-on of
28
+ // Apify, same action id); the other Apify verbs stay on the base.
29
+ const skills = [
30
+ ...readManifest("apify.capability.json").spec.skills,
31
+ ...readManifest("apify-social-post-capture.capability.json").spec.skills,
32
+ ] as Skill[];
28
33
  const reader = skills.find((s) => s.name === "capture_social_post")!;
29
34
 
30
35
  const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor as new (
@@ -0,0 +1,111 @@
1
+ /**
2
+ * The Builder's works views (founder, 30 Nov 2026, cockpit plan 488556d7,
3
+ * session e3599615): a work is the session that works a `devplane_feature`,
4
+ * and the feature carries the work's TYPE (`change`: feature, fix, polish,
5
+ * chore) and the repositories it touches (`repos`). The views every renderer
6
+ * can offer sort and colour works by those two fields.
7
+ *
8
+ * Reachability, not shape (guards-and-tests.md): a card field or a colour
9
+ * field that names no property of the kind renders nothing, and a criterion
10
+ * that lists a type the field does not hold teaches an agent a value it cannot
11
+ * write. So every field a works view names must be a property of the kind,
12
+ * and the Shape criteria must list exactly the field's values.
13
+ *
14
+ * Negative control (devbox lane-c1-neg, 30 Nov 2026): on builder.yaml as it
15
+ * was before this change (no `repos`, `change` = feature/refactor/chore, no
16
+ * works views) the first four tests go red. The Shape test stays green there:
17
+ * it proves the criteria and the field AGREE, not which values they hold (the
18
+ * first test pins those). It goes red when only one side changes.
19
+ *
20
+ * Not covered: grouping works by the Claude Code session that worked them.
21
+ * That id lives on the session, not the feature; it waits on a pod read.
22
+ */
23
+ import { describe, expect, it } from "vitest";
24
+ import { readYamlTemplates } from "./generate.mjs";
25
+
26
+ type Property = {
27
+ slug: string;
28
+ valueType: string;
29
+ inputType?: string;
30
+ enumValues?: string[];
31
+ constraints?: { defaultValue?: unknown };
32
+ };
33
+ type View = {
34
+ name: string;
35
+ type: string;
36
+ scopeProfileSlug?: string;
37
+ config?: {
38
+ groupByField?: string;
39
+ cardFields?: string[];
40
+ cardSettings?: { colorField?: string };
41
+ };
42
+ };
43
+ type Playbook = {
44
+ name: string;
45
+ stages?: { key: string; criteria?: { key: string; statement: string }[] }[];
46
+ };
47
+ type Template = {
48
+ profiles: { slug: string; properties: Property[]; lifecycle?: { property: string } }[];
49
+ views: View[];
50
+ playbooks: Playbook[];
51
+ };
52
+
53
+ const builder = readYamlTemplates().find((t) => t.slug === "builder-workspace")!
54
+ .data as unknown as Template;
55
+ const feature = builder.profiles.find((p) => p.slug === "devplane_feature")!;
56
+ const prop = (slug: string) => feature.properties.find((p) => p.slug === slug);
57
+ const bare = (field: string) => field.replace(/^properties\./, "");
58
+
59
+ const TYPES = ["feature", "fix", "polish", "chore"];
60
+
61
+ describe("a work's type and repositories live on the feature", () => {
62
+ it("change is a select of feature, fix, polish, chore, defaulting to feature", () => {
63
+ const change = prop("change");
64
+ expect(change?.inputType).toBe("select");
65
+ expect(change?.enumValues).toEqual(TYPES);
66
+ expect(change?.constraints?.defaultValue).toBe("feature");
67
+ });
68
+
69
+ it("repos is a list of tags", () => {
70
+ expect(prop("repos")).toMatchObject({ valueType: "array", inputType: "tags" });
71
+ });
72
+ });
73
+
74
+ describe("the works views", () => {
75
+ const views = builder.views.filter((v) => v.scopeProfileSlug === "devplane_feature");
76
+ const byName = (name: string) => views.find((v) => v.name === name);
77
+
78
+ it("a board by state coloured by type, a board by type, a list and cards", () => {
79
+ expect(byName("Feature Board")).toMatchObject({
80
+ type: "kanban",
81
+ config: { groupByField: feature.lifecycle!.property, cardSettings: { colorField: "change" } },
82
+ });
83
+ expect(byName("Features by type")).toMatchObject({ type: "kanban", config: { groupByField: "change" } });
84
+ expect(byName("Feature list")?.type).toBe("list");
85
+ expect(byName("Feature cards")).toMatchObject({ type: "grid", config: { cardSettings: { colorField: "change" } } });
86
+ });
87
+
88
+ it("every field a works view names is a property of the feature (non-vacuity: 4 views)", () => {
89
+ const works = ["Feature Board", "Features by type", "Feature list", "Feature cards"].map(byName);
90
+ expect(works.every(Boolean)).toBe(true);
91
+ const named = works.flatMap((v) => [
92
+ ...(v!.config?.cardFields ?? []),
93
+ ...(v!.config?.groupByField ? [v!.config.groupByField] : []),
94
+ ...(v!.config?.cardSettings?.colorField ? [v!.config.cardSettings.colorField] : []),
95
+ ]);
96
+ expect(named).toEqual(expect.arrayContaining(["change", "repos"]));
97
+ expect(named.map(bare).filter((f) => !prop(f))).toEqual([]);
98
+ });
99
+ });
100
+
101
+ describe("the Shape step teaches the same types the field holds", () => {
102
+ it("Ship a change and Build a change list exactly the field's values", () => {
103
+ const enumValues = prop("change")!.enumValues!;
104
+ for (const name of ["Ship a change", "Build a change"]) {
105
+ const shape = builder.playbooks.find((p) => p.name === name)!.stages!.find((s) => s.key === "shape")!;
106
+ const typed = shape.criteria!.find((c) => c.key === "shape-change-typed")!.statement;
107
+ const listed = typed.match(/\(([^)]*)\)/)![1].split(/,\s*|\s+or\s+/).filter(Boolean);
108
+ expect({ name, listed }).toEqual({ name, listed: enumValues });
109
+ }
110
+ });
111
+ });