ctxr-cli 0.36.0 → 0.37.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/LICENSE +21 -201
- package/README.md +14 -9
- package/dist/commands/plugin-build.d.ts +21 -11
- package/dist/commands/plugin-build.d.ts.map +1 -1
- package/dist/commands/plugin-build.js +45 -24
- package/dist/commands/plugin-build.js.map +1 -1
- package/dist/core/command.d.ts +5 -3
- package/dist/core/command.d.ts.map +1 -1
- package/dist/core/mcp/surface.js +1 -1
- package/dist/core/mcp/surface.js.map +1 -1
- package/dist/core/mcp/sync.d.ts +4 -1
- package/dist/core/mcp/sync.d.ts.map +1 -1
- package/dist/core/mcp/sync.js +6 -5
- package/dist/core/mcp/sync.js.map +1 -1
- package/dist/core/mcp/tool-map.d.ts +13 -11
- package/dist/core/mcp/tool-map.d.ts.map +1 -1
- package/dist/core/mcp/tool-map.js +13 -11
- package/dist/core/mcp/tool-map.js.map +1 -1
- package/dist/core/mcp/tools/gather.d.ts.map +1 -1
- package/dist/core/mcp/tools/gather.js +5 -4
- package/dist/core/mcp/tools/gather.js.map +1 -1
- package/dist/core/mcp/tools/index.d.ts +9 -1
- package/dist/core/mcp/tools/index.d.ts.map +1 -1
- package/dist/core/mcp/tools/index.js +20 -3
- package/dist/core/mcp/tools/index.js.map +1 -1
- package/dist/core/plugin/build.d.ts +53 -26
- package/dist/core/plugin/build.d.ts.map +1 -1
- package/dist/core/plugin/build.js +153 -50
- package/dist/core/plugin/build.js.map +1 -1
- package/dist/core/plugin/commands.d.ts +11 -0
- package/dist/core/plugin/commands.d.ts.map +1 -0
- package/dist/core/plugin/commands.js +23 -0
- package/dist/core/plugin/commands.js.map +1 -0
- package/dist/core/plugin/routes.d.ts +11 -7
- package/dist/core/plugin/routes.d.ts.map +1 -1
- package/dist/core/plugin/routes.js +27 -24
- package/dist/core/plugin/routes.js.map +1 -1
- package/dist/core/session/submit.d.ts.map +1 -1
- package/dist/core/session/submit.js +6 -3
- package/dist/core/session/submit.js.map +1 -1
- package/dist/core/shared-stores.d.ts +5 -0
- package/dist/core/shared-stores.d.ts.map +1 -1
- package/dist/core/shared-stores.js +10 -0
- package/dist/core/shared-stores.js.map +1 -1
- package/dist/core/skill-placeholders.d.ts +51 -0
- package/dist/core/skill-placeholders.d.ts.map +1 -0
- package/dist/core/skill-placeholders.js +55 -0
- package/dist/core/skill-placeholders.js.map +1 -0
- package/dist/core/skills.d.ts +37 -12
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +78 -89
- package/dist/core/skills.js.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +25 -6
- package/dist/run.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
- package/templates/mcp/server-instructions.md +16 -0
- package/templates/plugin/README.md +30 -8
- package/templates/plugin/chatgpt-README.md +16 -0
- package/templates/plugin/claude-plugin.json +9 -1
- package/templates/plugin/command.md +7 -0
- package/templates/plugin/page.html +19 -8
- package/templates/skills/_surfaces.md +30 -0
- package/templates/skills/ctxr-placement.md +1 -1
- package/templates/skills/ctxr-session-lifecycle.md +6 -5
- package/templates/skills/mcp/_layer-step.md +18 -0
- package/templates/skills/mcp/_relation-grouping-step.md +5 -0
- package/templates/plugin/claude-mcp.json +0 -8
- package/templates/skills/mcp/_preamble.md +0 -44
|
@@ -39,6 +39,11 @@ export interface ReadView {
|
|
|
39
39
|
* it (D5). A store with no mounts gets exactly its own notes and no scopes.
|
|
40
40
|
*/
|
|
41
41
|
export declare function listReadView(storeRoot: string, config: StoreConfig): Promise<ReadView>;
|
|
42
|
+
/**
|
|
43
|
+
* Where a read-view note's file is on disk: a mounted note under its mount's root, which lives in the main
|
|
44
|
+
* working tree (so not under a linked worktree's root), and anything else under the store's own root.
|
|
45
|
+
*/
|
|
46
|
+
export declare function readViewFilePath(storeRoot: string, view: ReadView, notePath: string): string;
|
|
42
47
|
/** The graph of a store's read view: the one build every caller that writes or compares the persisted graph uses. */
|
|
43
48
|
export declare function buildReadViewGraph(storeRoot: string, config: StoreConfig): Promise<{
|
|
44
49
|
graph: GraphBuildResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-stores.d.ts","sourceRoot":"","sources":["../../src/core/shared-stores.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAA0C,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAIvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAElH,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GACpG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,GAC9E;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtG,mGAAmG;AACnG,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,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AAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAI5F;AAED,qHAAqH;AACrH,wBAAsB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAGrI;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,GAAG,WAAW,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,6DAA6D;AAC7D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,gBAAgB,EAAE,CAOnF;AAED,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;IACpB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAetF"}
|
|
@@ -55,6 +55,16 @@ export async function listReadView(storeRoot, config) {
|
|
|
55
55
|
}
|
|
56
56
|
return { notes, scopes, mounts };
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Where a read-view note's file is on disk: a mounted note under its mount's root, which lives in the main
|
|
60
|
+
* working tree (so not under a linked worktree's root), and anything else under the store's own root.
|
|
61
|
+
*/
|
|
62
|
+
export function readViewFilePath(storeRoot, view, notePath) {
|
|
63
|
+
const mount = view.mounts.find((m) => m.state === 'present' && notePath.startsWith(`${m.location}/`));
|
|
64
|
+
if (mount === undefined)
|
|
65
|
+
return path.join(storeRoot, notePath);
|
|
66
|
+
return path.join(mount.root, notePath.slice(mount.location.length + 1));
|
|
67
|
+
}
|
|
58
68
|
/** The graph of a store's read view: the one build every caller that writes or compares the persisted graph uses. */
|
|
59
69
|
export async function buildReadViewGraph(storeRoot, config) {
|
|
60
70
|
const view = await listReadView(storeRoot, config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-stores.js","sourceRoot":"","sources":["../../src/core/shared-stores.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAyB,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,SAAS,EAAa,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE5I,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAOlH,mGAAmG;AACnG,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,SAAiB,EAAE,MAAmB;IACxE,MAAM,QAAQ,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAChD,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,aAAa,IAAI,EAAE,EAAE,CAAC;QAC/C,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ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,CAAC,CAAC;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,sBAAsB;QAAE,OAAO,IAAI,CAAC;IACrE,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAChE,IAAI,MAAmB,CAAC;IACxB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IACzF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { StoreConfig } from '../config/schema.js';
|
|
2
|
+
/**
|
|
3
|
+
* publish-one-contexture-plugin D2: every value an owned skill's template
|
|
4
|
+
* takes from one store, as a `__TOKEN__` in the template, with the label the
|
|
5
|
+
* store-independent MCP render writes in its place (`<inbox path>`) and the
|
|
6
|
+
* value a store gives it. The one list both readers use: the CLI render
|
|
7
|
+
* substitutes `value`, the MCP render substitutes the label, and the server
|
|
8
|
+
* instructions' *This store* section names each label with this store's value,
|
|
9
|
+
* so a label in a skill and the label the connector answers it with cannot drift.
|
|
10
|
+
*
|
|
11
|
+
* The computed blocks (`__LAYER_STEP__`, `__RELATION_GROUPING_STEP__`) are not
|
|
12
|
+
* here: they are whole steps, rendered from the taxonomy and the relation
|
|
13
|
+
* vocabulary, and the MCP render points them at the layers and the vocabulary
|
|
14
|
+
* the instructions list.
|
|
15
|
+
*/
|
|
16
|
+
export interface StorePlaceholder {
|
|
17
|
+
/** The template token, without its surrounding underscores. */
|
|
18
|
+
token: string;
|
|
19
|
+
/** What the MCP render names the value: `<label>`. */
|
|
20
|
+
label: string;
|
|
21
|
+
/** This store's value, as the CLI render writes it. */
|
|
22
|
+
value: (config: StoreConfig) => string;
|
|
23
|
+
/**
|
|
24
|
+
* The templates write this token outside a code span, so the MCP render
|
|
25
|
+
* wraps its label in one: a bare `<label>` is an HTML tag to a markdown reader.
|
|
26
|
+
*/
|
|
27
|
+
bare?: true;
|
|
28
|
+
}
|
|
29
|
+
/** Where this store's operator-authored conventions live, for a skill to name by path. */
|
|
30
|
+
export declare function houseConventionsPath(config: StoreConfig): string;
|
|
31
|
+
export declare const STORE_PLACEHOLDERS: readonly StorePlaceholder[];
|
|
32
|
+
/** `<label>`, as a skill in the MCP render and the *This store* section both write it. */
|
|
33
|
+
export declare function placeholderName(placeholder: StorePlaceholder): string;
|
|
34
|
+
/**
|
|
35
|
+
* A token map whose values are computed when a template reads them, so a
|
|
36
|
+
* render reads only the configuration its templates name (a fixture seed
|
|
37
|
+
* with a partial configuration renders, as it did before the map existed).
|
|
38
|
+
*/
|
|
39
|
+
export declare function lazyValues(entries: Iterable<readonly [string, () => string]>): Readonly<Record<string, string>>;
|
|
40
|
+
/** The CLI render's entry for each placeholder: its value in this store. */
|
|
41
|
+
export declare function storeValueEntries(config: StoreConfig): (readonly [string, () => string])[];
|
|
42
|
+
/** The token map the MCP render fills a template with: each placeholder's label, and no configuration. */
|
|
43
|
+
export declare function placeholderValues(): Record<string, string>;
|
|
44
|
+
/**
|
|
45
|
+
* One pass over `__TOKEN__`s, so a value that happens to contain a token is
|
|
46
|
+
* never substituted again, and a function replacement, so a `$` in a value is
|
|
47
|
+
* written as it is. A token the map does not name is left in place; the tests
|
|
48
|
+
* assert that none survives a render.
|
|
49
|
+
*/
|
|
50
|
+
export declare function fillTokens(text: string, values: Readonly<Record<string, string>>): string;
|
|
51
|
+
//# sourceMappingURL=skill-placeholders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-placeholders.d.ts","sourceRoot":"","sources":["../../src/core/skill-placeholders.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,MAAM,CAAC;IACvC;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAEhE;AAED,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,EAczD,CAAC;AAEF,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,WAAW,EAAE,gBAAgB,GAAG,MAAM,CAErE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAI/G;AAED,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC,CAAC,EAAE,CAE1F;AAED,0GAA0G;AAC1G,wBAAgB,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAEzF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { DEFAULT_HOUSE_CONVENTIONS_FILE_NAME, DEFAULT_LOG_PATH, DEFAULT_MISSION_MAX_BYTES, DEFAULT_SCRATCH_PATH } from '../config/defaults.js';
|
|
3
|
+
import { GRAPH_DOCUMENT_RELATIVE_PATH } from './graph/persist.js';
|
|
4
|
+
/** Where this store's operator-authored conventions live, for a skill to name by path. */
|
|
5
|
+
export function houseConventionsPath(config) {
|
|
6
|
+
return path.join(config.harness.guidance_path, DEFAULT_HOUSE_CONVENTIONS_FILE_NAME).split(path.sep).join('/');
|
|
7
|
+
}
|
|
8
|
+
export const STORE_PLACEHOLDERS = [
|
|
9
|
+
{ token: 'DEFAULT_BRANCH', label: 'default branch', value: (config) => config.git.default_branch },
|
|
10
|
+
{ token: 'INBOX_PATH', label: 'inbox path', value: (config) => config.ingest.inbox_path },
|
|
11
|
+
{ token: 'CAPTURE_ROOT', label: 'capture root', value: (config) => config.ingest.capture_root },
|
|
12
|
+
{ token: 'TEMPLATES_PATH', label: 'templates path', value: (config) => config.templates.path },
|
|
13
|
+
{ token: 'LOG_PATH', label: 'log path', value: (config) => config.organize.log_path ?? DEFAULT_LOG_PATH },
|
|
14
|
+
{ token: 'GRAPH_DOCUMENT_PATH', label: 'graph document', value: () => GRAPH_DOCUMENT_RELATIVE_PATH },
|
|
15
|
+
{ token: 'CLUSTER_DEPTH', label: 'cluster depth', value: (config) => String(config.retrieval.graph.cluster_depth), bare: true },
|
|
16
|
+
{ token: 'MISSION_MAX_BYTES', label: 'mission size limit', value: (config) => String(config.organize.mission_max_bytes ?? DEFAULT_MISSION_MAX_BYTES) },
|
|
17
|
+
{ token: 'HOUSE_CONVENTIONS_PATH', label: 'house conventions path', value: houseConventionsPath },
|
|
18
|
+
{ token: 'ARCHIVE_DESTINATION', label: 'archive destination', value: (config) => config.organize.archive_destination },
|
|
19
|
+
{ token: 'SCRATCH_PATH', label: 'scratch path', value: (config) => config.harness.scratch_path ?? DEFAULT_SCRATCH_PATH },
|
|
20
|
+
// The shared opening section's session root (publish-one-contexture-plugin D7): `<worktrees path><directory>/`.
|
|
21
|
+
{ token: 'WORKTREES_PATH', label: 'worktrees path', value: (config) => config.session.worktrees_path.replace(/\/*$/, '/') },
|
|
22
|
+
];
|
|
23
|
+
/** `<label>`, as a skill in the MCP render and the *This store* section both write it. */
|
|
24
|
+
export function placeholderName(placeholder) {
|
|
25
|
+
return `<${placeholder.label}>`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A token map whose values are computed when a template reads them, so a
|
|
29
|
+
* render reads only the configuration its templates name (a fixture seed
|
|
30
|
+
* with a partial configuration renders, as it did before the map existed).
|
|
31
|
+
*/
|
|
32
|
+
export function lazyValues(entries) {
|
|
33
|
+
const values = {};
|
|
34
|
+
for (const [token, compute] of entries)
|
|
35
|
+
Object.defineProperty(values, token, { enumerable: true, get: compute });
|
|
36
|
+
return values;
|
|
37
|
+
}
|
|
38
|
+
/** The CLI render's entry for each placeholder: its value in this store. */
|
|
39
|
+
export function storeValueEntries(config) {
|
|
40
|
+
return STORE_PLACEHOLDERS.map((p) => [p.token, () => p.value(config)]);
|
|
41
|
+
}
|
|
42
|
+
/** The token map the MCP render fills a template with: each placeholder's label, and no configuration. */
|
|
43
|
+
export function placeholderValues() {
|
|
44
|
+
return Object.fromEntries(STORE_PLACEHOLDERS.map((p) => [p.token, p.bare === true ? `\`${placeholderName(p)}\`` : placeholderName(p)]));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* One pass over `__TOKEN__`s, so a value that happens to contain a token is
|
|
48
|
+
* never substituted again, and a function replacement, so a `$` in a value is
|
|
49
|
+
* written as it is. A token the map does not name is left in place; the tests
|
|
50
|
+
* assert that none survives a render.
|
|
51
|
+
*/
|
|
52
|
+
export function fillTokens(text, values) {
|
|
53
|
+
return text.replace(/__([A-Z][A-Z0-9_]*?)__/g, (whole, token) => values[token] ?? whole);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=skill-placeholders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-placeholders.js","sourceRoot":"","sources":["../../src/core/skill-placeholders.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,mCAAmC,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE/I,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AA8BlE,0FAA0F;AAC1F,MAAM,UAAU,oBAAoB,CAAC,MAAmB;IACtD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,mCAAmC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAgC;IAC7D,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE;IAClG,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;IACzF,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE;IAC/F,EAAE,KAAK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B,EAAE,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;AACnG,CAAC"}
|
package/dist/core/skills.d.ts
CHANGED
|
@@ -32,12 +32,19 @@ export interface Skill {
|
|
|
32
32
|
/** Packaged files beside SKILL.md, as relative-path -> content. Empty for a skill that is one file. */
|
|
33
33
|
supportingFiles: ReadonlyMap<string, string>;
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The text each `__TOKEN__` of a skill template takes: one store's values for
|
|
37
|
+
* the CLI render, the named placeholders for the MCP render
|
|
38
|
+
* (publish-one-contexture-plugin D2). A seed's body reads nothing else, which
|
|
39
|
+
* is what lets the MCP render take no configuration.
|
|
40
|
+
*/
|
|
41
|
+
export type SkillValues = Readonly<Record<string, string>>;
|
|
35
42
|
export interface SkillSeed {
|
|
36
43
|
file: string;
|
|
37
44
|
name: string;
|
|
38
45
|
description: string;
|
|
39
|
-
/** The markdown body below the H1, one entry per line, rendered against the
|
|
40
|
-
body: (
|
|
46
|
+
/** The markdown body below the H1, one entry per line, rendered against the values of one render. */
|
|
47
|
+
body: (values: SkillValues) => string[];
|
|
41
48
|
/**
|
|
42
49
|
* Packaged files beside SKILL.md. Absent for a skill that is one file.
|
|
43
50
|
* circleback-sweep: given the store's config, so a skill whose runner cannot
|
|
@@ -63,24 +70,42 @@ export declare function activeSkillSeeds(config: StoreConfig): SkillSeed[];
|
|
|
63
70
|
export declare const SKILLS: readonly SkillSeed[];
|
|
64
71
|
/**
|
|
65
72
|
* serve-the-session-lifecycle-to-chat-apps D6: the owned skills a chat app's
|
|
66
|
-
* plugin carries, rendered from the same templates as the CLI copies.
|
|
73
|
+
* plugin carries, rendered from the same templates as the CLI copies.
|
|
74
|
+
* publish-one-contexture-plugin D7: these are the shared skills, one text on
|
|
75
|
+
* both surfaces: each opens with `templates/skills/_surfaces.md`, in a
|
|
76
|
+
* store's copy and the plugin's alike, saying which store, whether to work in
|
|
77
|
+
* a shell or through the store's server, and how a step is done there. Left
|
|
67
78
|
* out: the skills that run local programs (upgrade, second opinion,
|
|
68
79
|
* Circleback), landing (a person lands from the approval page), and the
|
|
69
80
|
* derived-artifacts, organize-audit and publish procedures, whose steps the
|
|
70
81
|
* surface does not offer.
|
|
71
82
|
*/
|
|
72
83
|
export declare const MCP_SKILL_FILES: readonly string[];
|
|
73
|
-
/** Which surface a render is for: the store's own skills copies, or the chat-app plugin's (D6). */
|
|
74
|
-
export type SkillTarget = 'cli' | 'mcp';
|
|
75
84
|
/**
|
|
76
|
-
* The
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
85
|
+
* The values the CLI render fills each template with: this store's value for
|
|
86
|
+
* every placeholder, the placement step computed from its taxonomy, the
|
|
87
|
+
* relation-grouping step, and the skills path the Circleback skill's runner
|
|
88
|
+
* is invoked from.
|
|
89
|
+
*/
|
|
90
|
+
export declare function cliSkillValues(config: StoreConfig): SkillValues;
|
|
91
|
+
/**
|
|
92
|
+
* publish-one-contexture-plugin D2, revision 3: the values the MCP render fills
|
|
93
|
+
* each template with, which no store configuration enters. Each store value is
|
|
94
|
+
* its named placeholder, and the two computed steps are generic text pointing
|
|
95
|
+
* at the layers and the relation vocabulary the connector's instructions list
|
|
96
|
+
* under *This store*. Skills the MCP render leaves out (Circleback's runner
|
|
97
|
+
* path) have no entry, so a token they use cannot reach the plugin.
|
|
98
|
+
*/
|
|
99
|
+
export declare function mcpSkillValues(): SkillValues;
|
|
100
|
+
/** The owned skills, rendered against one store's configuration: what `syncShippedSkills` writes. */
|
|
101
|
+
export declare function renderSkills(config: StoreConfig): Skill[];
|
|
102
|
+
/**
|
|
103
|
+
* The owned skills a chat app's plugin carries: the shared subset, each the
|
|
104
|
+
* same text a store's copy is (publish-one-contexture-plugin D7), with every
|
|
105
|
+
* store value as its placeholder. It takes no configuration, so every store
|
|
106
|
+
* gets the same text, and the connector's instructions give the values (D2).
|
|
80
107
|
*/
|
|
81
|
-
export declare function
|
|
82
|
-
/** `templates/skills/mcp/_preamble.md`, rendered against the store's configuration. */
|
|
83
|
-
export declare function mcpPreamble(config: StoreConfig): string;
|
|
108
|
+
export declare function renderMcpSkills(): Skill[];
|
|
84
109
|
/**
|
|
85
110
|
* entry-doc-generation spec: every skill actually on disk — the contexture-
|
|
86
111
|
* owned ones plus any operator-authored ones. This is what the AGENTS.md
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAwCjF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,KAAK;IACpB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,uGAAuG;IACvG,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3D,MAAM,WAAW,SAAS;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|
import { mkdir, readdir, readFile, rm } from 'node:fs/promises';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import { DEFAULT_CIRCLEBACK_DECLINE_TAG,
|
|
6
|
+
import { DEFAULT_CIRCLEBACK_DECLINE_TAG, RELATION_DIRECTEDNESS_NOTE, RELATION_VOCABULARY } from '../config/defaults.js';
|
|
7
7
|
import { scanDocsDir, SKILL_FILE_NAME } from './conventions.js';
|
|
8
|
-
import { GRAPH_DOCUMENT_RELATIVE_PATH } from './graph/persist.js';
|
|
9
8
|
import { writeFileAtomic } from './fs/atomic.js';
|
|
9
|
+
import { fillTokens, lazyValues, placeholderValues, storeValueEntries } from './skill-placeholders.js';
|
|
10
10
|
import { packagedTemplate } from './templates.js';
|
|
11
|
-
import { GIT_STEP_TOOLS, SESSION_COMMAND_TOOLS, UNAVAILABLE_COMMANDS } from './mcp/tool-map.js';
|
|
12
11
|
/**
|
|
13
12
|
* The canonical skill bodies live as plain markdown under
|
|
14
13
|
* `templates/skills/` — see `templates.ts` for why they are loaded
|
|
@@ -60,7 +59,7 @@ export function terminatingLayers(config) {
|
|
|
60
59
|
export function retiredLayers(config) {
|
|
61
60
|
return config.taxonomy.layers.filter((layer) => RETIRED_PATTERN.test(layer.description));
|
|
62
61
|
}
|
|
63
|
-
function skillDocument(seed,
|
|
62
|
+
function skillDocument(seed, values) {
|
|
64
63
|
const lines = [
|
|
65
64
|
'---',
|
|
66
65
|
`name: ${seed.file}`,
|
|
@@ -71,10 +70,15 @@ function skillDocument(seed, config) {
|
|
|
71
70
|
'',
|
|
72
71
|
`# ${seed.name}`,
|
|
73
72
|
'',
|
|
74
|
-
...seed.
|
|
73
|
+
...(MCP_SKILL_FILES.includes(seed.file) ? [fillTokens(packagedTemplate('skills', '_surfaces'), values), ''] : []),
|
|
74
|
+
...seed.body(values),
|
|
75
75
|
];
|
|
76
76
|
return `${lines.join('\n')}\n`;
|
|
77
77
|
}
|
|
78
|
+
/** A body that is its template with every token filled from the render's values. */
|
|
79
|
+
function templateBody(slug) {
|
|
80
|
+
return (values) => fillTokens(skillTemplate(slug), values).split('\n');
|
|
81
|
+
}
|
|
78
82
|
function joinNames(layers) {
|
|
79
83
|
return layers.map((layer) => `**${layer.name}**`).join(' / ');
|
|
80
84
|
}
|
|
@@ -111,11 +115,7 @@ const PLACEMENT = {
|
|
|
111
115
|
file: 'ctxr-placement',
|
|
112
116
|
name: 'Placement',
|
|
113
117
|
description: 'Choose the right taxonomy layer and location for a new or relocated note in this contexture store, with the reasoning.',
|
|
114
|
-
body: (
|
|
115
|
-
.replace('__LAYER_STEP__', placementLayerStep(config).join('\n'))
|
|
116
|
-
.replaceAll('__TEMPLATES_PATH__', config.templates.path)
|
|
117
|
-
.replaceAll('__CLUSTER_DEPTH__', String(config.retrieval.graph.cluster_depth))
|
|
118
|
-
.split('\n'),
|
|
118
|
+
body: templateBody('ctxr-placement'),
|
|
119
119
|
};
|
|
120
120
|
/**
|
|
121
121
|
* capture-is-an-owned-skill spec: the capture stage's procedure. Named for
|
|
@@ -129,26 +129,19 @@ const CAPTURE = {
|
|
|
129
129
|
file: 'ctxr-capture',
|
|
130
130
|
name: 'Capture',
|
|
131
131
|
description: 'Bring material from outside the store into the inbox as a faithful record carrying its source identity, then hand off to ingest.',
|
|
132
|
-
body: (
|
|
133
|
-
.replaceAll('__INBOX_PATH__', config.ingest.inbox_path)
|
|
134
|
-
.replaceAll('__CAPTURE_ROOT__', config.ingest.capture_root)
|
|
135
|
-
.split('\n'),
|
|
132
|
+
body: templateBody('ctxr-capture'),
|
|
136
133
|
};
|
|
137
134
|
const INGEST_ORCHESTRATION = {
|
|
138
135
|
file: 'ctxr-ingest-orchestration',
|
|
139
136
|
name: 'Ingest orchestration',
|
|
140
137
|
description: 'Capture raw material into the inbox, run the dedupe check, read the existing cluster, decide new/update/merge/restructure, and ingest with source identity via the contexture CLI.',
|
|
141
|
-
body: (
|
|
142
|
-
.replaceAll('__GRAPH_DOCUMENT_PATH__', GRAPH_DOCUMENT_RELATIVE_PATH)
|
|
143
|
-
.replaceAll('__TEMPLATES_PATH__', config.templates.path)
|
|
144
|
-
.replaceAll('__LOG_PATH__', config.organize.log_path ?? DEFAULT_LOG_PATH)
|
|
145
|
-
.split('\n'),
|
|
138
|
+
body: templateBody('ctxr-ingest-orchestration'),
|
|
146
139
|
};
|
|
147
140
|
const CONNECTION_FINDING = {
|
|
148
141
|
file: 'ctxr-connection-finding',
|
|
149
142
|
name: 'Connection finding',
|
|
150
143
|
description: 'Traverse the wikilink graph of the store (neighbors, paths, hubs, orphans) to find what a note already connects to.',
|
|
151
|
-
body: (
|
|
144
|
+
body: templateBody('ctxr-connection-finding'),
|
|
152
145
|
};
|
|
153
146
|
/**
|
|
154
147
|
* graph-context-document spec: the proposal skill groups by the CONFIGURED
|
|
@@ -176,83 +169,67 @@ const CONNECTION_PROPOSAL = {
|
|
|
176
169
|
file: 'ctxr-connection-proposal',
|
|
177
170
|
name: 'Connection proposal',
|
|
178
171
|
description: 'Discover the links a note should have, read each candidate before proposing, group by the store relation vocabulary, and write only approved links.',
|
|
179
|
-
body: (
|
|
172
|
+
body: templateBody('ctxr-connection-proposal'),
|
|
180
173
|
};
|
|
181
174
|
const ROLLUP = {
|
|
182
175
|
file: 'ctxr-rollup',
|
|
183
176
|
name: 'Rollup',
|
|
184
177
|
description: 'Regenerate the synthesized current-state region of an entity note from every source that references it, with provenance for every fact.',
|
|
185
|
-
body: (
|
|
178
|
+
body: templateBody('ctxr-rollup'),
|
|
186
179
|
};
|
|
187
180
|
const MISSION = {
|
|
188
181
|
file: 'ctxr-mission',
|
|
189
182
|
name: 'Mission',
|
|
190
183
|
description: "Keep the store's mission core current — the primary mission, the top priorities in rank order with status/purpose/next action, and what is not now — with the back burner, sunset candidates, and open debt in a linked register; propose changes and write only on the operator's confirmation.",
|
|
191
|
-
body: (
|
|
192
|
-
.replaceAll('__LOG_PATH__', config.organize.log_path ?? DEFAULT_LOG_PATH)
|
|
193
|
-
.replaceAll('__MISSION_MAX_BYTES__', String(config.organize.mission_max_bytes ?? DEFAULT_MISSION_MAX_BYTES))
|
|
194
|
-
.split('\n'),
|
|
184
|
+
body: templateBody('ctxr-mission'),
|
|
195
185
|
};
|
|
196
186
|
const SUBMIT = {
|
|
197
187
|
file: 'ctxr-submit',
|
|
198
188
|
name: 'Submit',
|
|
199
189
|
description: 'End a working session — re-scan, capture once, hold one unit, validate, and open the reviewed pull request with ctxr session submit, which gates, commits, pushes and writes the generated sections.',
|
|
200
|
-
body: (
|
|
190
|
+
body: templateBody('ctxr-submit'),
|
|
201
191
|
};
|
|
202
192
|
const LAND = {
|
|
203
193
|
file: 'ctxr-land',
|
|
204
194
|
name: 'Land',
|
|
205
195
|
description: 'Complete a reviewed session — read pull-request state, merge it with gh, sync the default branch, and reclaim the worktree — every step gated and named explicitly.',
|
|
206
|
-
body: (
|
|
196
|
+
body: templateBody('ctxr-land'),
|
|
207
197
|
};
|
|
208
198
|
const SESSION_LIFECYCLE = {
|
|
209
199
|
file: 'ctxr-session-lifecycle',
|
|
210
200
|
name: 'Session lifecycle',
|
|
211
201
|
description: 'Start a session worktree, re-scan before any plan, resolve conflicts, sequence multiple pull requests, and reclaim worktrees with the ctxr session commands — the frame ctxr-submit and ctxr-land sit inside.',
|
|
212
|
-
body: (
|
|
202
|
+
body: templateBody('ctxr-session-lifecycle'),
|
|
213
203
|
};
|
|
214
|
-
/** Where this store's operator-authored conventions live, for a skill to name by path. */
|
|
215
|
-
function houseConventionsPath(config) {
|
|
216
|
-
return path
|
|
217
|
-
.join(config.harness.guidance_path, DEFAULT_HOUSE_CONVENTIONS_FILE_NAME)
|
|
218
|
-
.split(path.sep)
|
|
219
|
-
.join('/');
|
|
220
|
-
}
|
|
221
204
|
const UPGRADE = {
|
|
222
205
|
file: 'ctxr-upgrade',
|
|
223
206
|
name: 'Upgrade',
|
|
224
207
|
description: 'Upgrade the installed ctxr to the latest published release and re-render this store with it — reading the live version check, refusing a non-global install, gating on the operator, and ordering the package upgrade before the store update.',
|
|
225
|
-
body: (
|
|
208
|
+
body: templateBody('ctxr-upgrade'),
|
|
226
209
|
};
|
|
227
210
|
const SESSION_CAPTURE = {
|
|
228
211
|
file: 'ctxr-session-capture',
|
|
229
212
|
name: 'Session capture',
|
|
230
213
|
description: 'At the end of a session, propose in one message both the durable notes it produced and any house convention it earned, with per-item approval, then write only what was approved.',
|
|
231
|
-
body: (
|
|
232
|
-
.replaceAll('__HOUSE_CONVENTIONS_PATH__', houseConventionsPath(config))
|
|
233
|
-
.replaceAll('__TEMPLATES_PATH__', config.templates.path)
|
|
234
|
-
.split('\n'),
|
|
214
|
+
body: templateBody('ctxr-session-capture'),
|
|
235
215
|
};
|
|
236
216
|
const DERIVED_ARTIFACTS = {
|
|
237
217
|
file: 'ctxr-derived-artifacts',
|
|
238
218
|
name: 'Derived artifacts',
|
|
239
219
|
description: 'Refresh a generated artifact safely — check before build, read the counts back, never hand-edit inside a fence, keep derived files out of content commits.',
|
|
240
|
-
body: (
|
|
220
|
+
body: templateBody('ctxr-derived-artifacts'),
|
|
241
221
|
};
|
|
242
222
|
const ORGANIZE_AUDIT = {
|
|
243
223
|
file: 'ctxr-organize-audit',
|
|
244
224
|
name: 'Organize audit',
|
|
245
225
|
description: 'Audit store health with ctxr lint (observations) and ctxr doctor (blocking invariants), retire by moving, and classify broken links before fixing them.',
|
|
246
|
-
body: (
|
|
247
|
-
.replaceAll('__LOG_PATH__', config.organize.log_path ?? DEFAULT_LOG_PATH)
|
|
248
|
-
.replaceAll('__ARCHIVE_DESTINATION__', config.organize.archive_destination)
|
|
249
|
-
.split('\n'),
|
|
226
|
+
body: templateBody('ctxr-organize-audit'),
|
|
250
227
|
};
|
|
251
228
|
const PUBLISH = {
|
|
252
229
|
file: 'ctxr-publish',
|
|
253
230
|
name: 'Publish',
|
|
254
231
|
description: 'Turn store content into a shareable HTML page for a subtree, note, or entity, resolving its source notes before any content is copied out.',
|
|
255
|
-
body: (
|
|
232
|
+
body: templateBody('ctxr-publish'),
|
|
256
233
|
};
|
|
257
234
|
/**
|
|
258
235
|
* ship-a-cross-model-second-opinion-skill, revised by
|
|
@@ -268,7 +245,7 @@ const SECOND_OPINION = {
|
|
|
268
245
|
file: 'ctxr-second-opinion',
|
|
269
246
|
name: 'Second opinion',
|
|
270
247
|
description: 'Get an independent critique of a plan, or a poll on a taste call, from three different model families run in parallel, and synthesize their answers without running the plan.',
|
|
271
|
-
body: (
|
|
248
|
+
body: templateBody('ctxr-second-opinion'),
|
|
272
249
|
};
|
|
273
250
|
/**
|
|
274
251
|
* research-and-capture-identity: the research method, written against whatever
|
|
@@ -280,10 +257,7 @@ const RESEARCH = {
|
|
|
280
257
|
file: 'ctxr-research',
|
|
281
258
|
name: 'Research',
|
|
282
259
|
description: 'Research a question against real sources and land the findings in the store, with a brief and a findings ledger, several perspectives, source tiers, a contradiction map, and every claim verified against a source you opened before anyone acts on it, using whatever web access the harness provides.',
|
|
283
|
-
body: (
|
|
284
|
-
.replaceAll('__SCRATCH_PATH__', config.harness.scratch_path ?? DEFAULT_SCRATCH_PATH)
|
|
285
|
-
.replaceAll('__LOG_PATH__', config.organize.log_path ?? DEFAULT_LOG_PATH)
|
|
286
|
-
.split('\n'),
|
|
260
|
+
body: templateBody('ctxr-research'),
|
|
287
261
|
};
|
|
288
262
|
/**
|
|
289
263
|
* circleback-sweep, revised by capture-circleback-is-retrieval: the first
|
|
@@ -303,11 +277,7 @@ const CAPTURE_CIRCLEBACK = {
|
|
|
303
277
|
file: 'ctxr-capture-circleback',
|
|
304
278
|
name: 'Capture from Circleback',
|
|
305
279
|
description: "Retrieve the Circleback meetings this store's tag says it owes, written into the inbox as verbatim records with their identity, then continue with ctxr-capture from step 2.",
|
|
306
|
-
body: (
|
|
307
|
-
.replaceAll('__SKILLS_PATH__', config.harness.skills_path.replace(/\/+$/, ''))
|
|
308
|
-
.replaceAll('__INBOX_PATH__', config.ingest.inbox_path)
|
|
309
|
-
.replaceAll('__DEFAULT_BRANCH__', config.git.default_branch)
|
|
310
|
-
.split('\n'),
|
|
280
|
+
body: templateBody('ctxr-capture-circleback'),
|
|
311
281
|
supportingFiles: (config) => {
|
|
312
282
|
const files = new Map(skillSupportingFiles('ctxr-capture-circleback'));
|
|
313
283
|
files.set('settings.json', circlebackSettings(config));
|
|
@@ -357,7 +327,11 @@ export const SKILLS = [
|
|
|
357
327
|
];
|
|
358
328
|
/**
|
|
359
329
|
* serve-the-session-lifecycle-to-chat-apps D6: the owned skills a chat app's
|
|
360
|
-
* plugin carries, rendered from the same templates as the CLI copies.
|
|
330
|
+
* plugin carries, rendered from the same templates as the CLI copies.
|
|
331
|
+
* publish-one-contexture-plugin D7: these are the shared skills, one text on
|
|
332
|
+
* both surfaces: each opens with `templates/skills/_surfaces.md`, in a
|
|
333
|
+
* store's copy and the plugin's alike, saying which store, whether to work in
|
|
334
|
+
* a shell or through the store's server, and how a step is done there. Left
|
|
361
335
|
* out: the skills that run local programs (upgrade, second opinion,
|
|
362
336
|
* Circleback), landing (a person lands from the approval page), and the
|
|
363
337
|
* derived-artifacts, organize-audit and publish procedures, whose steps the
|
|
@@ -377,46 +351,61 @@ export const MCP_SKILL_FILES = [
|
|
|
377
351
|
RESEARCH,
|
|
378
352
|
].map((seed) => seed.file);
|
|
379
353
|
/**
|
|
380
|
-
* The
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
354
|
+
* The values the CLI render fills each template with: this store's value for
|
|
355
|
+
* every placeholder, the placement step computed from its taxonomy, the
|
|
356
|
+
* relation-grouping step, and the skills path the Circleback skill's runner
|
|
357
|
+
* is invoked from.
|
|
384
358
|
*/
|
|
385
|
-
export function
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
359
|
+
export function cliSkillValues(config) {
|
|
360
|
+
return lazyValues([
|
|
361
|
+
...storeValueEntries(config),
|
|
362
|
+
['LAYER_STEP', () => placementLayerStep(config).join('\n')],
|
|
363
|
+
['RELATION_GROUPING_STEP', () => relationGroupingStep().join('\n')],
|
|
364
|
+
['SKILLS_PATH', () => config.harness.skills_path.replace(/\/+$/, '')],
|
|
365
|
+
]);
|
|
391
366
|
}
|
|
392
|
-
/**
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
367
|
+
/**
|
|
368
|
+
* publish-one-contexture-plugin D2, revision 3: the values the MCP render fills
|
|
369
|
+
* each template with, which no store configuration enters. Each store value is
|
|
370
|
+
* its named placeholder, and the two computed steps are generic text pointing
|
|
371
|
+
* at the layers and the relation vocabulary the connector's instructions list
|
|
372
|
+
* under *This store*. Skills the MCP render leaves out (Circleback's runner
|
|
373
|
+
* path) have no entry, so a token they use cannot reach the plugin.
|
|
374
|
+
*/
|
|
375
|
+
export function mcpSkillValues() {
|
|
376
|
+
return {
|
|
377
|
+
...placeholderValues(),
|
|
378
|
+
LAYER_STEP: packagedTemplate('skills/mcp', '_layer-step'),
|
|
379
|
+
RELATION_GROUPING_STEP: packagedTemplate('skills/mcp', '_relation-grouping-step'),
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
/** The owned skills, rendered against one store's configuration: what `syncShippedSkills` writes. */
|
|
383
|
+
export function renderSkills(config) {
|
|
384
|
+
return renderSkillSeeds(activeSkillSeeds(config), config);
|
|
404
385
|
}
|
|
405
|
-
/**
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
386
|
+
/**
|
|
387
|
+
* The owned skills a chat app's plugin carries: the shared subset, each the
|
|
388
|
+
* same text a store's copy is (publish-one-contexture-plugin D7), with every
|
|
389
|
+
* store value as its placeholder. It takes no configuration, so every store
|
|
390
|
+
* gets the same text, and the connector's instructions give the values (D2).
|
|
391
|
+
*/
|
|
392
|
+
export function renderMcpSkills() {
|
|
393
|
+
const values = mcpSkillValues();
|
|
394
|
+
return SKILLS.filter((seed) => MCP_SKILL_FILES.includes(seed.file)).map((seed) => ({
|
|
395
|
+
file: seed.file,
|
|
396
|
+
name: seed.name,
|
|
397
|
+
description: seed.description,
|
|
398
|
+
content: skillDocument(seed, values),
|
|
399
|
+
supportingFiles: new Map(),
|
|
400
|
+
}));
|
|
413
401
|
}
|
|
414
402
|
function renderSkillSeeds(seeds, config) {
|
|
403
|
+
const values = cliSkillValues(config);
|
|
415
404
|
return seeds.map((seed) => ({
|
|
416
405
|
file: seed.file,
|
|
417
406
|
name: seed.name,
|
|
418
407
|
description: seed.description,
|
|
419
|
-
content: skillDocument(seed,
|
|
408
|
+
content: skillDocument(seed, values),
|
|
420
409
|
supportingFiles: seed.supportingFiles?.(config) ?? new Map(),
|
|
421
410
|
}));
|
|
422
411
|
}
|