@synap-core/workspace-templates 0.71.0 → 0.73.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/README.md +10 -3
- package/automations/github-pr-events.automation.json +1 -1
- package/automations/ship-a-change-checks-green.automation.json +1 -1
- package/automations/ship-a-change-checks-red.automation.json +1 -1
- package/automations/ship-a-change-deployed.automation.json +1 -1
- package/automations/ship-a-change-pr-merged.automation.json +1 -1
- package/automations/ship-a-change-pr-opened.automation.json +1 -1
- package/capabilities/apify-linkedin-profiles.capability.json +45 -0
- package/capabilities/apify-social-post-capture.capability.json +57 -0
- package/capabilities/apify.capability.json +2 -50
- package/capabilities/github-issues.capability.json +176 -0
- package/capabilities/stripe-payments.capability.json +176 -0
- package/capabilities/test-api-3.capability.json +104 -0
- package/capabilities/unipile-linkedin.capability.json +5 -3
- package/dist/index.js +1128 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/app-factory-research/SKILL.md +1 -1
- package/src/apify-social-reader.test.ts +8 -3
- package/src/builder-work-views.template.test.ts +207 -0
- package/src/builder.yaml +523 -32
- package/src/content-os.piece-model.template.test.ts +8 -6
- package/src/content-os.yaml +7 -0
- package/src/crm.yaml +4 -3
- package/src/dev-flow-change.template.test.ts +192 -0
- package/src/kanban-grouping.test.ts +16 -0
- package/src/retired-names.test.ts +68 -0
- package/src/templates.ts +906 -30
- package/src/validate.ts +56 -5
- package/automations/ship-a-change-deployed.catalog.json +0 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synap-core/workspace-templates",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.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
|
|
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
|
|
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
|
-
|
|
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,207 @@
|
|
|
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
|
+
* The Claude Code session (backend#1449, migration 0468): the POD writes
|
|
21
|
+
* `workedIn` / `workedInAll` on a work from the sessions that took it as
|
|
22
|
+
* subject. The catalog only DECLARES them, so a board can group by
|
|
23
|
+
* `workedIn` and a view can filter on `workedInAll`; nothing in the catalog
|
|
24
|
+
* may give them a value (the pod's triggers would strip it anyway). The key
|
|
25
|
+
* set is pinned to the backend's `SERVER_DERIVED_PROPERTY_KEYS` when the
|
|
26
|
+
* synap-backend sibling is beside this repo (the devbox gate tree; skipped,
|
|
27
|
+
* with a warning, where it is absent).
|
|
28
|
+
*
|
|
29
|
+
* Not covered: what the pod actually writes, and how a board labels a column
|
|
30
|
+
* (the humanized id): NEEDS-DOGFOOD on a pod with the Builder updated.
|
|
31
|
+
*/
|
|
32
|
+
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
33
|
+
import { dirname, join } from "node:path";
|
|
34
|
+
import { fileURLToPath } from "node:url";
|
|
35
|
+
import { describe, expect, it } from "vitest";
|
|
36
|
+
import { readYamlTemplates } from "./generate.mjs";
|
|
37
|
+
import { SERVER_DERIVED_PROPERTY_KEYS, validateTemplate } from "./validate.js";
|
|
38
|
+
import type { WorkspaceYaml } from "./types.js";
|
|
39
|
+
|
|
40
|
+
type Property = {
|
|
41
|
+
slug: string;
|
|
42
|
+
valueType: string;
|
|
43
|
+
inputType?: string;
|
|
44
|
+
enumValues?: string[];
|
|
45
|
+
label?: string;
|
|
46
|
+
constraints?: { defaultValue?: unknown };
|
|
47
|
+
};
|
|
48
|
+
type View = {
|
|
49
|
+
name: string;
|
|
50
|
+
type: string;
|
|
51
|
+
scopeProfileSlug?: string;
|
|
52
|
+
config?: {
|
|
53
|
+
groupByField?: string;
|
|
54
|
+
cardFields?: string[];
|
|
55
|
+
cardSettings?: { colorField?: string };
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
type Playbook = {
|
|
59
|
+
name: string;
|
|
60
|
+
stages?: { key: string; criteria?: { key: string; statement: string }[] }[];
|
|
61
|
+
};
|
|
62
|
+
type Template = {
|
|
63
|
+
profiles: { slug: string; properties: Property[]; lifecycle?: { property: string } }[];
|
|
64
|
+
views: View[];
|
|
65
|
+
playbooks: Playbook[];
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const corpus = readYamlTemplates();
|
|
69
|
+
const builder = corpus.find((t) => t.slug === "builder-workspace")!.data as unknown as Template;
|
|
70
|
+
const feature = builder.profiles.find((p) => p.slug === "devplane_feature")!;
|
|
71
|
+
const prop = (slug: string) => feature.properties.find((p) => p.slug === slug);
|
|
72
|
+
const bare = (field: string) => field.replace(/^properties\./, "");
|
|
73
|
+
|
|
74
|
+
const TYPES = ["feature", "fix", "polish", "chore"];
|
|
75
|
+
|
|
76
|
+
describe("a work's type and repositories live on the feature", () => {
|
|
77
|
+
it("change is a select of feature, fix, polish, chore, defaulting to feature", () => {
|
|
78
|
+
const change = prop("change");
|
|
79
|
+
expect(change?.inputType).toBe("select");
|
|
80
|
+
expect(change?.enumValues).toEqual(TYPES);
|
|
81
|
+
expect(change?.constraints?.defaultValue).toBe("feature");
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("repos is a list of tags", () => {
|
|
85
|
+
expect(prop("repos")).toMatchObject({ valueType: "array", inputType: "tags" });
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe("the works views", () => {
|
|
90
|
+
const views = builder.views.filter((v) => v.scopeProfileSlug === "devplane_feature");
|
|
91
|
+
const byName = (name: string) => views.find((v) => v.name === name);
|
|
92
|
+
|
|
93
|
+
it("a board by state coloured by type, a board by type, a list and cards", () => {
|
|
94
|
+
expect(byName("Feature Board")).toMatchObject({
|
|
95
|
+
type: "kanban",
|
|
96
|
+
config: { groupByField: feature.lifecycle!.property, cardSettings: { colorField: "change" } },
|
|
97
|
+
});
|
|
98
|
+
expect(byName("Features by type")).toMatchObject({ type: "kanban", config: { groupByField: "change" } });
|
|
99
|
+
expect(byName("Feature list")?.type).toBe("list");
|
|
100
|
+
expect(byName("Feature cards")).toMatchObject({ type: "grid", config: { cardSettings: { colorField: "change" } } });
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("every field a works view names is a property of the feature (non-vacuity: 5 views)", () => {
|
|
104
|
+
const works = ["Feature Board", "Features by type", "Feature list", "Feature cards", "Features by Claude Code session"].map(byName);
|
|
105
|
+
expect(works.every(Boolean)).toBe(true);
|
|
106
|
+
const named = works.flatMap((v) => [
|
|
107
|
+
...(v!.config?.cardFields ?? []),
|
|
108
|
+
...(v!.config?.groupByField ? [v!.config.groupByField] : []),
|
|
109
|
+
...(v!.config?.cardSettings?.colorField ? [v!.config.cardSettings.colorField] : []),
|
|
110
|
+
]);
|
|
111
|
+
expect(named.map(bare)).toEqual(expect.arrayContaining(["change", "repos", "workedIn"]));
|
|
112
|
+
expect(named.map(bare).filter((f) => !prop(f))).toEqual([]);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
describe("the Shape step teaches the same types the field holds", () => {
|
|
117
|
+
it("Ship a change and Build a change list exactly the field's values", () => {
|
|
118
|
+
const enumValues = prop("change")!.enumValues!;
|
|
119
|
+
for (const name of ["Ship a change", "Build a change"]) {
|
|
120
|
+
const shape = builder.playbooks.find((p) => p.name === name)!.stages!.find((s) => s.key === "shape")!;
|
|
121
|
+
const typed = shape.criteria!.find((c) => c.key === "shape-change-typed")!.statement;
|
|
122
|
+
const listed = typed.match(/\(([^)]*)\)/)![1].split(/,\s*|\s+or\s+/).filter(Boolean);
|
|
123
|
+
expect({ name, listed }).toEqual({ name, listed: enumValues });
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
describe("the Claude Code session: the pod writes it, the catalog only declares it", () => {
|
|
129
|
+
const PKG = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
130
|
+
const MONO = join(PKG, "../../..");
|
|
131
|
+
const BACKEND_KEYS = join(MONO, "synap-backend/packages/database/src/utils/worked-in.ts");
|
|
132
|
+
|
|
133
|
+
it("workedIn (one string) and workedInAll (a list) are declared with plain labels and no value", () => {
|
|
134
|
+
expect(prop("workedIn")).toMatchObject({ valueType: "string", label: "Claude Code session" });
|
|
135
|
+
expect(prop("workedInAll")).toMatchObject({ valueType: "array", label: "All Claude Code sessions" });
|
|
136
|
+
for (const slug of SERVER_DERIVED_PROPERTY_KEYS) {
|
|
137
|
+
expect({ slug, enumValues: prop(slug)?.enumValues, constraints: prop(slug)?.constraints }).toEqual({
|
|
138
|
+
slug,
|
|
139
|
+
enumValues: undefined,
|
|
140
|
+
constraints: undefined,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it("a board groups works by workedIn, with Feature Board's cards", () => {
|
|
146
|
+
const board = builder.views.find((v) => v.name === "Features by Claude Code session");
|
|
147
|
+
const featureBoard = builder.views.find((v) => v.name === "Feature Board")!;
|
|
148
|
+
expect(board).toMatchObject({ type: "kanban", scopeProfileSlug: "devplane_feature", config: { groupByField: "properties.workedIn" } });
|
|
149
|
+
expect(board!.config!.cardFields).toEqual(featureBoard.config!.cardFields);
|
|
150
|
+
expect(board!.config!.cardSettings).toEqual(featureBoard.config!.cardSettings);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("no template, example, playbook, view filter or automation in the catalog names them otherwise", () => {
|
|
154
|
+
// Every YAML template, with the two declarations and the one grouping removed.
|
|
155
|
+
const stray = corpus.flatMap((t) => {
|
|
156
|
+
const data = structuredClone(t.data) as unknown as Template;
|
|
157
|
+
if (t.slug === "builder-workspace") {
|
|
158
|
+
const f = data.profiles.find((p) => p.slug === "devplane_feature")!;
|
|
159
|
+
f.properties = f.properties.filter((p) => !SERVER_DERIVED_PROPERTY_KEYS.includes(p.slug));
|
|
160
|
+
data.views = data.views.filter((v) => v.name !== "Features by Claude Code session");
|
|
161
|
+
}
|
|
162
|
+
return SERVER_DERIVED_PROPERTY_KEYS.some((k) => JSON.stringify(data).includes(k)) ? [t.slug] : [];
|
|
163
|
+
});
|
|
164
|
+
expect(stray).toEqual([]);
|
|
165
|
+
// Every other catalog file (automations, capabilities, skills, agents, views).
|
|
166
|
+
const files: string[] = [];
|
|
167
|
+
const walk = (dir: string) => {
|
|
168
|
+
if (!existsSync(dir)) return;
|
|
169
|
+
for (const name of readdirSync(dir)) {
|
|
170
|
+
const path = join(dir, name);
|
|
171
|
+
if (statSync(path).isDirectory()) walk(path);
|
|
172
|
+
else files.push(path);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
for (const dir of ["automations", "capabilities", "skills", "agents", "views"]) walk(join(PKG, dir));
|
|
176
|
+
expect(files.length).toBeGreaterThan(50);
|
|
177
|
+
const named = files.filter((f) => SERVER_DERIVED_PROPERTY_KEYS.some((k) => readFileSync(f, "utf8").includes(k)));
|
|
178
|
+
expect(named).toEqual([]);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it("a template that gives them a value is refused (property-server-derived-value)", () => {
|
|
182
|
+
const data = structuredClone(builder) as unknown as Template;
|
|
183
|
+
data.profiles.find((p) => p.slug === "devplane_feature")!.properties.find((p) => p.slug === "workedIn")!.constraints = {
|
|
184
|
+
defaultValue: "claude-code:x",
|
|
185
|
+
};
|
|
186
|
+
const rules = validateTemplate(data as unknown as WorkspaceYaml, { corpus: corpus.map((t) => t.data as WorkspaceYaml) })
|
|
187
|
+
.errors.map((e) => e.rule);
|
|
188
|
+
expect(rules).toContain("property-server-derived-value");
|
|
189
|
+
const clean = validateTemplate(builder as unknown as WorkspaceYaml, { corpus: corpus.map((t) => t.data as WorkspaceYaml) })
|
|
190
|
+
.errors.map((e) => e.rule);
|
|
191
|
+
expect(clean).not.toContain("property-server-derived-value");
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const hasBackend = existsSync(BACKEND_KEYS);
|
|
195
|
+
if (!hasBackend) console.warn(`[builder-work-views] SKIP the backend pin: ${BACKEND_KEYS} is absent`);
|
|
196
|
+
it.skipIf(!hasBackend)("the key set equals the backend's SERVER_DERIVED_PROPERTY_KEYS", () => {
|
|
197
|
+
const text = readFileSync(BACKEND_KEYS, "utf8");
|
|
198
|
+
const consts = Object.fromEntries(
|
|
199
|
+
[...text.matchAll(/export const (\w+) = "([^"]+)";/g)].map((m) => [m[1], m[2]])
|
|
200
|
+
);
|
|
201
|
+
const set = text.match(/SERVER_DERIVED_PROPERTY_KEYS[^=]*=\s*new Set\(\[([^\]]*)\]\)/);
|
|
202
|
+
expect(set).not.toBeNull();
|
|
203
|
+
const keys = set![1].split(",").map((s) => s.trim()).filter(Boolean).map((id) => consts[id] ?? id.replace(/"/g, ""));
|
|
204
|
+
expect(keys.length).toBeGreaterThanOrEqual(2);
|
|
205
|
+
expect([...keys].sort()).toEqual([...SERVER_DERIVED_PROPERTY_KEYS].sort());
|
|
206
|
+
});
|
|
207
|
+
});
|