ctxr-cli 0.35.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.
Files changed (150) hide show
  1. package/LICENSE +21 -201
  2. package/README.md +39 -11
  3. package/dist/commands/land.d.ts +1 -1
  4. package/dist/commands/land.d.ts.map +1 -1
  5. package/dist/commands/land.js +8 -4
  6. package/dist/commands/land.js.map +1 -1
  7. package/dist/commands/plugin-build.d.ts +21 -11
  8. package/dist/commands/plugin-build.d.ts.map +1 -1
  9. package/dist/commands/plugin-build.js +45 -24
  10. package/dist/commands/plugin-build.js.map +1 -1
  11. package/dist/commands/serve.d.ts +3 -0
  12. package/dist/commands/serve.d.ts.map +1 -1
  13. package/dist/commands/serve.js +121 -23
  14. package/dist/commands/serve.js.map +1 -1
  15. package/dist/commands/session-submit.d.ts.map +1 -1
  16. package/dist/commands/session-submit.js +2 -0
  17. package/dist/commands/session-submit.js.map +1 -1
  18. package/dist/commands/sync.d.ts +50 -0
  19. package/dist/commands/sync.d.ts.map +1 -0
  20. package/dist/commands/sync.js +186 -0
  21. package/dist/commands/sync.js.map +1 -0
  22. package/dist/commands/version.d.ts.map +1 -1
  23. package/dist/commands/version.js +6 -3
  24. package/dist/commands/version.js.map +1 -1
  25. package/dist/config/defaults.d.ts +13 -0
  26. package/dist/config/defaults.d.ts.map +1 -1
  27. package/dist/config/defaults.js +11 -0
  28. package/dist/config/defaults.js.map +1 -1
  29. package/dist/config/schema.d.ts +1 -0
  30. package/dist/config/schema.d.ts.map +1 -1
  31. package/dist/config/schema.js +7 -0
  32. package/dist/config/schema.js.map +1 -1
  33. package/dist/core/approval/sessions.d.ts.map +1 -1
  34. package/dist/core/approval/sessions.js +4 -2
  35. package/dist/core/approval/sessions.js.map +1 -1
  36. package/dist/core/browse/approve.d.ts.map +1 -1
  37. package/dist/core/browse/approve.js +12 -2
  38. package/dist/core/browse/approve.js.map +1 -1
  39. package/dist/core/browse/page-url.d.ts +13 -0
  40. package/dist/core/browse/page-url.d.ts.map +1 -1
  41. package/dist/core/browse/page-url.js +17 -0
  42. package/dist/core/browse/page-url.js.map +1 -1
  43. package/dist/core/browse/pull-preview.d.ts +67 -0
  44. package/dist/core/browse/pull-preview.d.ts.map +1 -0
  45. package/dist/core/browse/pull-preview.js +154 -0
  46. package/dist/core/browse/pull-preview.js.map +1 -0
  47. package/dist/core/browse/webhook.d.ts +38 -0
  48. package/dist/core/browse/webhook.d.ts.map +1 -0
  49. package/dist/core/browse/webhook.js +102 -0
  50. package/dist/core/browse/webhook.js.map +1 -0
  51. package/dist/core/command.d.ts +5 -3
  52. package/dist/core/command.d.ts.map +1 -1
  53. package/dist/core/errors.d.ts +16 -0
  54. package/dist/core/errors.d.ts.map +1 -1
  55. package/dist/core/errors.js +27 -0
  56. package/dist/core/errors.js.map +1 -1
  57. package/dist/core/git/exec.d.ts +16 -1
  58. package/dist/core/git/exec.d.ts.map +1 -1
  59. package/dist/core/git/exec.js +15 -4
  60. package/dist/core/git/exec.js.map +1 -1
  61. package/dist/core/git/fast-forward.d.ts +23 -0
  62. package/dist/core/git/fast-forward.d.ts.map +1 -1
  63. package/dist/core/git/fast-forward.js +24 -0
  64. package/dist/core/git/fast-forward.js.map +1 -1
  65. package/dist/core/git/hardened.d.ts +15 -0
  66. package/dist/core/git/hardened.d.ts.map +1 -0
  67. package/dist/core/git/hardened.js +123 -0
  68. package/dist/core/git/hardened.js.map +1 -0
  69. package/dist/core/install-kind.d.ts +10 -3
  70. package/dist/core/install-kind.d.ts.map +1 -1
  71. package/dist/core/install-kind.js +48 -14
  72. package/dist/core/install-kind.js.map +1 -1
  73. package/dist/core/mcp/surface.js +1 -1
  74. package/dist/core/mcp/surface.js.map +1 -1
  75. package/dist/core/mcp/sync.d.ts +4 -1
  76. package/dist/core/mcp/sync.d.ts.map +1 -1
  77. package/dist/core/mcp/sync.js +6 -5
  78. package/dist/core/mcp/sync.js.map +1 -1
  79. package/dist/core/mcp/tool-map.d.ts +13 -11
  80. package/dist/core/mcp/tool-map.d.ts.map +1 -1
  81. package/dist/core/mcp/tool-map.js +13 -11
  82. package/dist/core/mcp/tool-map.js.map +1 -1
  83. package/dist/core/mcp/tools/gather.d.ts.map +1 -1
  84. package/dist/core/mcp/tools/gather.js +5 -4
  85. package/dist/core/mcp/tools/gather.js.map +1 -1
  86. package/dist/core/mcp/tools/index.d.ts +9 -1
  87. package/dist/core/mcp/tools/index.d.ts.map +1 -1
  88. package/dist/core/mcp/tools/index.js +20 -3
  89. package/dist/core/mcp/tools/index.js.map +1 -1
  90. package/dist/core/npm-prefix.d.ts +10 -0
  91. package/dist/core/npm-prefix.d.ts.map +1 -0
  92. package/dist/core/npm-prefix.js +11 -0
  93. package/dist/core/npm-prefix.js.map +1 -0
  94. package/dist/core/plugin/build.d.ts +53 -26
  95. package/dist/core/plugin/build.d.ts.map +1 -1
  96. package/dist/core/plugin/build.js +153 -50
  97. package/dist/core/plugin/build.js.map +1 -1
  98. package/dist/core/plugin/commands.d.ts +11 -0
  99. package/dist/core/plugin/commands.d.ts.map +1 -0
  100. package/dist/core/plugin/commands.js +23 -0
  101. package/dist/core/plugin/commands.js.map +1 -0
  102. package/dist/core/plugin/routes.d.ts +11 -7
  103. package/dist/core/plugin/routes.d.ts.map +1 -1
  104. package/dist/core/plugin/routes.js +27 -24
  105. package/dist/core/plugin/routes.js.map +1 -1
  106. package/dist/core/session/submit.d.ts +7 -0
  107. package/dist/core/session/submit.d.ts.map +1 -1
  108. package/dist/core/session/submit.js +14 -3
  109. package/dist/core/session/submit.js.map +1 -1
  110. package/dist/core/shared-stores.d.ts +5 -0
  111. package/dist/core/shared-stores.d.ts.map +1 -1
  112. package/dist/core/shared-stores.js +10 -0
  113. package/dist/core/shared-stores.js.map +1 -1
  114. package/dist/core/skill-placeholders.d.ts +51 -0
  115. package/dist/core/skill-placeholders.d.ts.map +1 -0
  116. package/dist/core/skill-placeholders.js +55 -0
  117. package/dist/core/skill-placeholders.js.map +1 -0
  118. package/dist/core/skills.d.ts +37 -12
  119. package/dist/core/skills.d.ts.map +1 -1
  120. package/dist/core/skills.js +78 -89
  121. package/dist/core/skills.js.map +1 -1
  122. package/dist/core/store-update-runner.d.ts +57 -0
  123. package/dist/core/store-update-runner.d.ts.map +1 -0
  124. package/dist/core/{approval/lander.js → store-update-runner.js} +41 -17
  125. package/dist/core/store-update-runner.js.map +1 -0
  126. package/dist/run.d.ts.map +1 -1
  127. package/dist/run.js +37 -6
  128. package/dist/run.js.map +1 -1
  129. package/dist/version.d.ts +1 -1
  130. package/dist/version.js +1 -1
  131. package/package.json +3 -2
  132. package/templates/approve/pages-note-pull.md +1 -0
  133. package/templates/conventions/baseline-conventions.md +5 -0
  134. package/templates/mcp/server-instructions.md +16 -0
  135. package/templates/plugin/README.md +30 -8
  136. package/templates/plugin/chatgpt-README.md +16 -0
  137. package/templates/plugin/claude-plugin.json +9 -1
  138. package/templates/plugin/command.md +7 -0
  139. package/templates/plugin/page.html +19 -8
  140. package/templates/skills/_surfaces.md +30 -0
  141. package/templates/skills/ctxr-placement.md +1 -1
  142. package/templates/skills/ctxr-session-lifecycle.md +6 -5
  143. package/templates/skills/ctxr-upgrade.md +5 -5
  144. package/templates/skills/mcp/_layer-step.md +18 -0
  145. package/templates/skills/mcp/_relation-grouping-step.md +5 -0
  146. package/dist/core/approval/lander.d.ts +0 -38
  147. package/dist/core/approval/lander.d.ts.map +0 -1
  148. package/dist/core/approval/lander.js.map +0 -1
  149. package/templates/plugin/claude-mcp.json +0 -8
  150. package/templates/skills/mcp/_preamble.md +0 -44
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The one place ctxr spawns npm: `npm prefix -g`, to learn where `npm install -g` writes, so the
3
+ * version report can tell whether that install would replace the running executable
4
+ * (install-tools-in-the-home D4). Only asked when NPM_CONFIG_PREFIX / npm_config_prefix do not
5
+ * already answer.
6
+ */
7
+ export type NpmPrefixRunner = () => Promise<string | null>;
8
+ /** `npm prefix -g`, or null when npm is not on PATH, fails, or does not answer in time. */
9
+ export declare const askNpmForPrefix: NpmPrefixRunner;
10
+ //# sourceMappingURL=npm-prefix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npm-prefix.d.ts","sourceRoot":"","sources":["../../src/core/npm-prefix.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAI3D,2FAA2F;AAC3F,eAAO,MAAM,eAAe,EAAE,eAO1B,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { execFile } from 'node:child_process';
2
+ import path from 'node:path';
3
+ const NPM_PREFIX_TIMEOUT_MS = 5_000;
4
+ /** `npm prefix -g`, or null when npm is not on PATH, fails, or does not answer in time. */
5
+ export const askNpmForPrefix = () => new Promise((resolve) => {
6
+ execFile('npm', ['prefix', '-g'], { timeout: NPM_PREFIX_TIMEOUT_MS, killSignal: 'SIGKILL', shell: process.platform === 'win32' }, (err, stdout) => {
7
+ const answer = String(stdout ?? '').trim();
8
+ resolve(err || answer === '' || !path.isAbsolute(answer) ? null : answer);
9
+ });
10
+ });
11
+ //# sourceMappingURL=npm-prefix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npm-prefix.js","sourceRoot":"","sources":["../../src/core/npm-prefix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,IAAI,MAAM,WAAW,CAAC;AAU7B,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAEpC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,eAAe,GAAoB,GAAG,EAAE,CACnD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IACtB,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,EAC9H,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;QACd,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3C,OAAO,CAAC,GAAG,IAAI,MAAM,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -2,16 +2,26 @@ import type { StoreConfig } from '../../config/schema.js';
2
2
  import { ContextureError } from '../errors.js';
3
3
  import type { GitRunner } from '../git/exec.js';
4
4
  /**
5
- * serve-the-session-lifecycle-to-chat-apps D7 (harness-portability spec,
6
- * *`ctxr plugin build` writes the store's chat-app plugins*): the one builder
7
- * behind both `ctxr plugin build` and serve's `/plugin/` downloads. It does no
8
- * I/O of its own beyond reading the packaged templates, so the command writes
9
- * what it returns to disk and the server answers with it from memory.
5
+ * The one builder behind `ctxr plugin build`, `npm run plugin` and serve's
6
+ * `/plugin/` page. It does no I/O of its own beyond reading the packaged
7
+ * templates, so the command writes what it returns to disk and the server
8
+ * answers with it from memory.
10
9
  *
11
- * Each plugin is the MCP render of the owned skills plus one remote MCP server
12
- * entry at `serve.base_url` + `/mcp`, in that vendor's manifest format. Neither
13
- * carries a credential (sign-in is the server's own OAuth with dynamic client
14
- * registration), a variable in the address, a hook, a local server or a
10
+ * publish-one-contexture-plugin D1 (harness-portability spec, *contexture
11
+ * publishes one plugin for every store*): the Claude plugin is contexture's,
12
+ * not a store's. It is the MCP render of the owned skills, which takes no
13
+ * configuration, with a README and contexture's license, and no MCP server
14
+ * entry: each member adds their store's connector once, by its `/mcp` address.
15
+ * Its version is the CLI's, so a member's marketplace installs a new copy
16
+ * exactly at a release (D3). The repository commits it under `plugins/contexture/`.
17
+ *
18
+ * The ChatGPT plugin stays the store's (serve-the-session-lifecycle-to-chat-apps
19
+ * D7): ChatGPT has no marketplace on a personal plan, so it is the store's zip
20
+ * from `/plugin/`, carrying the same skills and one remote MCP server entry at
21
+ * `serve.base_url` + `/mcp`.
22
+ *
23
+ * Neither carries a credential (sign-in is the server's own OAuth with dynamic
24
+ * client registration), a variable in an address, a hook, a local server or a
15
25
  * top-level `bin/` directory: the trees below are the whole of what is written.
16
26
  */
17
27
  export declare const PLUGIN_TARGETS: readonly ['claude', 'chatgpt'];
@@ -19,34 +29,36 @@ export type PluginTarget = (typeof PLUGIN_TARGETS)[number];
19
29
  /** Both vendors cap a plugin's and a skill's name at 64 characters, and a skill's description at 1,024. */
20
30
  export declare const MAX_NAME_LENGTH = 64;
21
31
  export declare const MAX_DESCRIPTION_LENGTH = 1024;
22
- export interface PluginBuildInput {
23
- config: StoreConfig;
24
- /** The store's name, which the plugin's name and display name derive from. */
25
- storeName: string;
26
- cliVersion: string;
27
- /** The commit the plugin is rendered from; null in a repository with no commit yet. */
28
- commit: string | null;
29
- }
32
+ /** The general Claude plugin's name (D5, revision 11: `contexture`, the product's name as plugins conventionally are, so its commands read `/contexture:submit`), and the marketplace in contexture's repository that lists it (D1). */
33
+ export declare const CLAUDE_PLUGIN_NAME = "contexture";
34
+ export declare const CLAUDE_PLUGIN_DISPLAY_NAME = "contexture";
35
+ export declare const PLUGIN_MARKETPLACE = "ayxuerui/contexture";
30
36
  export interface BuiltPlugin {
31
37
  target: PluginTarget;
38
+ name: string;
39
+ version: string;
32
40
  /** Every file of the plugin directory, by posix path relative to it. */
33
41
  files: ReadonlyMap<string, string>;
34
- /** `<name>-<target>.zip`. */
42
+ /** The skill directories it carries. */
43
+ skills: string[];
35
44
  archiveName: string;
36
45
  /** The same files, as one ZIP archive with the manifest at its root. */
37
46
  archive: Buffer;
38
47
  }
39
- export interface PluginBundle {
48
+ export interface StorePluginInput {
49
+ config: StoreConfig;
50
+ /** The store's name, which the ChatGPT plugin's name and display name derive from. */
51
+ storeName: string;
52
+ cliVersion: string;
53
+ /** The commit the plugin is rendered from; null in a repository with no commit yet. */
54
+ commit: string | null;
55
+ }
56
+ export interface StorePlugin extends BuiltPlugin {
40
57
  storeName: string;
41
- name: string;
42
58
  displayName: string;
43
- version: string;
44
59
  mcpUrl: string;
45
- /** The skill directories both plugins carry. */
46
- skills: string[];
47
- plugins: BuiltPlugin[];
48
60
  }
49
- /** The configuration error a store without the MCP surface gets: there is no server for a plugin to name. */
61
+ /** The configuration error a store without the MCP surface gets for its ChatGPT plugin: there is no server for it to name. */
50
62
  export declare class PluginWithoutMcpError extends ContextureError {
51
63
  constructor();
52
64
  }
@@ -57,7 +69,22 @@ export declare function fillPluginTemplate(file: string, values: Readonly<Record
57
69
  export declare function pluginName(storeName: string): string;
58
70
  /** The CLI version, with the rendered commit as semver build metadata. */
59
71
  export declare function pluginVersion(cliVersion: string, commit: string | null): string;
60
- export declare function buildPlugins(input: PluginBuildInput): PluginBundle;
72
+ /** A rendered skill's text below its frontmatter: what a command opening it carries. */
73
+ export declare function skillBody(content: string): string;
74
+ /**
75
+ * publish-one-contexture-plugin D1, D3: contexture's Claude plugin, read from
76
+ * nothing but the package. `cliVersion` is the version it carries, the CLI's.
77
+ */
78
+ export declare function buildClaudePlugin(cliVersion: string): BuiltPlugin;
79
+ /** The store's ChatGPT plugin, with its connector: refused for a store that declares no `mcp` block. */
80
+ export declare function buildChatgptPlugin(input: StorePluginInput): StorePlugin;
81
+ /**
82
+ * publish-one-contexture-plugin D3 (harness-portability spec, *The committed
83
+ * plugin is checked against the render*): the first path at which a plugin
84
+ * directory on disk differs from a build, or null when every file matches
85
+ * byte for byte and the directory holds nothing else.
86
+ */
87
+ export declare function firstDifference(plugin: BuiltPlugin, dir: string): Promise<string | null>;
61
88
  /**
62
89
  * The store's name: its directory in the canonical clone, so a build run from
63
90
  * a session worktree names the store, not the worktree. A store below the
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/core/plugin/build.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,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAE/E;AAYD,wFAAwF;AACxF,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIjD;AAmDD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAajE;AAED,wGAAwG;AACxG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,CAmBvE;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAU9F;AAkBD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMhF;AAED,8FAA8F;AAC9F,wBAAsB,cAAc,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGzF"}
@@ -1,23 +1,35 @@
1
1
  import { readFileSync } from 'node:fs';
2
+ import { readdir, readFile } from 'node:fs/promises';
2
3
  import path from 'node:path';
3
4
  import { fileURLToPath } from 'node:url';
4
5
  import { escapeHtml } from '../browse/render.js';
5
6
  import { SKILL_FILE_NAME } from '../conventions.js';
6
7
  import { ContextureError } from '../errors.js';
7
8
  import { ExitCode } from '../exit-codes.js';
8
- import { renderSkills } from '../skills.js';
9
+ import { renderMcpSkills } from '../skills.js';
10
+ import { commandMapProblems, PLUGIN_COMMANDS } from './commands.js';
9
11
  import { createZip } from './zip.js';
10
12
  /**
11
- * serve-the-session-lifecycle-to-chat-apps D7 (harness-portability spec,
12
- * *`ctxr plugin build` writes the store's chat-app plugins*): the one builder
13
- * behind both `ctxr plugin build` and serve's `/plugin/` downloads. It does no
14
- * I/O of its own beyond reading the packaged templates, so the command writes
15
- * what it returns to disk and the server answers with it from memory.
13
+ * The one builder behind `ctxr plugin build`, `npm run plugin` and serve's
14
+ * `/plugin/` page. It does no I/O of its own beyond reading the packaged
15
+ * templates, so the command writes what it returns to disk and the server
16
+ * answers with it from memory.
16
17
  *
17
- * Each plugin is the MCP render of the owned skills plus one remote MCP server
18
- * entry at `serve.base_url` + `/mcp`, in that vendor's manifest format. Neither
19
- * carries a credential (sign-in is the server's own OAuth with dynamic client
20
- * registration), a variable in the address, a hook, a local server or a
18
+ * publish-one-contexture-plugin D1 (harness-portability spec, *contexture
19
+ * publishes one plugin for every store*): the Claude plugin is contexture's,
20
+ * not a store's. It is the MCP render of the owned skills, which takes no
21
+ * configuration, with a README and contexture's license, and no MCP server
22
+ * entry: each member adds their store's connector once, by its `/mcp` address.
23
+ * Its version is the CLI's, so a member's marketplace installs a new copy
24
+ * exactly at a release (D3). The repository commits it under `plugins/contexture/`.
25
+ *
26
+ * The ChatGPT plugin stays the store's (serve-the-session-lifecycle-to-chat-apps
27
+ * D7): ChatGPT has no marketplace on a personal plan, so it is the store's zip
28
+ * from `/plugin/`, carrying the same skills and one remote MCP server entry at
29
+ * `serve.base_url` + `/mcp`.
30
+ *
31
+ * Neither carries a credential (sign-in is the server's own OAuth with dynamic
32
+ * client registration), a variable in an address, a hook, a local server or a
21
33
  * top-level `bin/` directory: the trees below are the whole of what is written.
22
34
  */
23
35
  export const PLUGIN_TARGETS = ['claude', 'chatgpt'];
@@ -25,13 +37,17 @@ export const PLUGIN_TARGETS = ['claude', 'chatgpt'];
25
37
  export const MAX_NAME_LENGTH = 64;
26
38
  export const MAX_DESCRIPTION_LENGTH = 1024;
27
39
  const NAME_PREFIX = 'contexture-';
28
- /** The configuration error a store without the MCP surface gets: there is no server for a plugin to name. */
40
+ /** The general Claude plugin's name (D5, revision 11: `contexture`, the product's name as plugins conventionally are, so its commands read `/contexture:submit`), and the marketplace in contexture's repository that lists it (D1). */
41
+ export const CLAUDE_PLUGIN_NAME = 'contexture';
42
+ export const CLAUDE_PLUGIN_DISPLAY_NAME = 'contexture';
43
+ export const PLUGIN_MARKETPLACE = 'ayxuerui/contexture';
44
+ /** The configuration error a store without the MCP surface gets for its ChatGPT plugin: there is no server for it to name. */
29
45
  export class PluginWithoutMcpError extends ContextureError {
30
46
  constructor() {
31
47
  super(ExitCode.Usage, {
32
48
  code: 'plugin.mcp_not_declared',
33
49
  severity: 'error',
34
- message: 'This store declares no mcp block in contexture.yaml, so there is no MCP server for a chat-app plugin to connect to. Declare mcp (which needs change_approval and serve.base_url) first.',
50
+ message: 'This store declares no mcp block in contexture.yaml, so there is no MCP server for a ChatGPT plugin to connect to. Declare mcp (which needs change_approval and serve.base_url) first.',
35
51
  });
36
52
  }
37
53
  }
@@ -48,6 +64,10 @@ function pluginTemplate(file) {
48
64
  }
49
65
  return text;
50
66
  }
67
+ /** A file at the package root (LICENSE, package.json), which npm ships with every install. */
68
+ function packageFile(file) {
69
+ return readFileSync(fileURLToPath(new URL(`../../../${file}`, import.meta.url)), 'utf8');
70
+ }
51
71
  const asJsonString = (value) => JSON.stringify(value).slice(1, -1);
52
72
  const asIs = (value) => value;
53
73
  /** One pass, so a substituted value that happens to contain a token is never substituted again. */
@@ -88,7 +108,82 @@ function checkSkillFrontmatter(folder, content) {
88
108
  if (description.length === 0 || description.length > MAX_DESCRIPTION_LENGTH)
89
109
  throw new Error(`skill ${folder}'s description is not 1 to ${MAX_DESCRIPTION_LENGTH} characters`);
90
110
  }
91
- export function buildPlugins(input) {
111
+ /** A rendered skill's text below its frontmatter: what a command opening it carries. */
112
+ export function skillBody(content) {
113
+ const match = /^---\n[^]*?\n---\n\n?/.exec(content);
114
+ if (match === null)
115
+ throw new Error('a rendered skill carries no frontmatter');
116
+ return content.slice(match[0].length).replace(/\n+$/, '');
117
+ }
118
+ /**
119
+ * publish-one-contexture-plugin D5: `commands/<name>.md` for each entry of the
120
+ * command map, from `templates/plugin/command.md`: a `description` worded as a
121
+ * typed shortcut and nothing else in the frontmatter, then the whole MCP render
122
+ * of the skill, then the person's `$ARGUMENTS`. Whichever of the two Claude
123
+ * loads, it has the whole procedure. A command whose skill the plugin does not
124
+ * carry fails the build.
125
+ */
126
+ function commandFiles(skills, commands = PLUGIN_COMMANDS) {
127
+ const problems = commandMapProblems(commands, skills.map((skill) => skill.file));
128
+ if (problems.length > 0)
129
+ throw new Error(problems.join('; '));
130
+ const files = new Map();
131
+ for (const [command, skill] of Object.entries(commands)) {
132
+ const content = skills.find((s) => s.file === skill).content;
133
+ files.set(`commands/${command}.md`, fillPluginTemplate('command.md', { PLUGIN: CLAUDE_PLUGIN_NAME, COMMAND: command, SKILL: skill, BODY: skillBody(content) }));
134
+ }
135
+ return files;
136
+ }
137
+ /** The MCP render's skills, as plugin files: the same text in both plugins and for every store. */
138
+ function skillFiles() {
139
+ const skills = renderMcpSkills();
140
+ const files = new Map();
141
+ for (const skill of skills) {
142
+ checkSkillFrontmatter(skill.file, skill.content);
143
+ files.set(`skills/${skill.file}/${SKILL_FILE_NAME}`, skill.content);
144
+ for (const [rel, content] of skill.supportingFiles)
145
+ files.set(`skills/${skill.file}/${rel}`, content);
146
+ }
147
+ return { skills: skills.map((skill) => skill.file), files };
148
+ }
149
+ function finish(target, name, version, skills, files, archiveName) {
150
+ for (const file of files.keys()) {
151
+ // A Claude plugin with a top-level bin/ is refused at upload, and neither app runs a hook from a plugin we ship.
152
+ if (file === 'bin' || file.startsWith('bin/') || file.startsWith('hooks/') || file === '.mcp.json')
153
+ throw new Error(`plugin file ${file} is one this plugin may not carry`);
154
+ }
155
+ // Sorted by path, so the archive and a directory comparison never depend on insertion order.
156
+ const sorted = new Map([...files].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)));
157
+ return {
158
+ target,
159
+ name,
160
+ version,
161
+ files: sorted,
162
+ skills,
163
+ archiveName,
164
+ archive: createZip([...sorted].map(([file, content]) => ({ path: file, data: Buffer.from(content, 'utf8') }))),
165
+ };
166
+ }
167
+ /**
168
+ * publish-one-contexture-plugin D1, D3: contexture's Claude plugin, read from
169
+ * nothing but the package. `cliVersion` is the version it carries, the CLI's.
170
+ */
171
+ export function buildClaudePlugin(cliVersion) {
172
+ const license = JSON.parse(packageFile('package.json')).license;
173
+ const values = { NAME: CLAUDE_PLUGIN_NAME, DISPLAY_NAME: CLAUDE_PLUGIN_DISPLAY_NAME, VERSION: cliVersion, LICENSE: license, MARKETPLACE: PLUGIN_MARKETPLACE };
174
+ const { skills, files } = skillFiles();
175
+ const commands = Object.entries(PLUGIN_COMMANDS).map(([command, skill]) => `- \`/${CLAUDE_PLUGIN_NAME}:${command}\` opens \`${skill}\``);
176
+ const tree = new Map([
177
+ ['.claude-plugin/plugin.json', jsonDocument('claude-plugin.json', values)],
178
+ ['README.md', fillPluginTemplate('README.md', { ...values, COMMANDS: commands.join('\n') })],
179
+ ['LICENSE', packageFile('LICENSE')],
180
+ ...files,
181
+ ...commandFiles(renderMcpSkills()),
182
+ ]);
183
+ return finish('claude', CLAUDE_PLUGIN_NAME, cliVersion, skills, tree, `${CLAUDE_PLUGIN_NAME}-claude.zip`);
184
+ }
185
+ /** The store's ChatGPT plugin, with its connector: refused for a store that declares no `mcp` block. */
186
+ export function buildChatgptPlugin(input) {
92
187
  const { config } = input;
93
188
  const baseUrl = config.serve?.base_url;
94
189
  if (config.mcp === undefined || baseUrl === undefined)
@@ -99,44 +194,52 @@ export function buildPlugins(input) {
99
194
  const version = pluginVersion(input.cliVersion, input.commit);
100
195
  const displayName = `${input.storeName} (contexture)`;
101
196
  const values = { NAME: name, DISPLAY_NAME: displayName, VERSION: version, STORE_NAME: input.storeName, MCP_URL: mcpUrl, BASE_URL: origin };
102
- const skills = renderSkills(config, 'mcp');
103
- const skillFiles = new Map();
104
- for (const skill of skills) {
105
- checkSkillFrontmatter(skill.file, skill.content);
106
- skillFiles.set(`skills/${skill.file}/${SKILL_FILE_NAME}`, skill.content);
107
- for (const [rel, content] of skill.supportingFiles)
108
- skillFiles.set(`skills/${skill.file}/${rel}`, content);
197
+ const { skills, files } = skillFiles();
198
+ const tree = new Map([
199
+ ['plugin.json', jsonDocument('chatgpt-plugin.json', values)],
200
+ ['mcp.json', jsonDocument('chatgpt-mcp.json', values)],
201
+ ['README.md', fillPluginTemplate('chatgpt-README.md', values)],
202
+ ...files,
203
+ ]);
204
+ return { ...finish('chatgpt', name, version, skills, tree, `${name}-chatgpt.zip`), storeName: input.storeName, displayName, mcpUrl };
205
+ }
206
+ /**
207
+ * publish-one-contexture-plugin D3 (harness-portability spec, *The committed
208
+ * plugin is checked against the render*): the first path at which a plugin
209
+ * directory on disk differs from a build, or null when every file matches
210
+ * byte for byte and the directory holds nothing else.
211
+ */
212
+ export async function firstDifference(plugin, dir) {
213
+ const onDisk = await listFiles(dir);
214
+ const paths = [...new Set([...plugin.files.keys(), ...onDisk])].sort();
215
+ for (const file of paths) {
216
+ const wanted = plugin.files.get(file);
217
+ if (wanted === undefined)
218
+ return `${file}: on disk, but not in the build`;
219
+ if (!onDisk.includes(file))
220
+ return `${file}: in the build, but missing on disk`;
221
+ if (!(await readFile(path.join(dir, ...file.split('/')))).equals(Buffer.from(wanted, 'utf8')))
222
+ return `${file}: differs from the build`;
109
223
  }
110
- const readme = fillPluginTemplate('README.md', values);
111
- const trees = {
112
- claude: new Map([
113
- ['.claude-plugin/plugin.json', jsonDocument('claude-plugin.json', values)],
114
- ['.mcp.json', jsonDocument('claude-mcp.json', values)],
115
- ['README.md', readme],
116
- ...skillFiles,
117
- ]),
118
- chatgpt: new Map([
119
- ['plugin.json', jsonDocument('chatgpt-plugin.json', values)],
120
- ['mcp.json', jsonDocument('chatgpt-mcp.json', values)],
121
- ['README.md', readme],
122
- ...skillFiles,
123
- ]),
124
- };
125
- const plugins = PLUGIN_TARGETS.map((target) => {
126
- const files = trees[target];
127
- for (const file of files.keys()) {
128
- // A Claude plugin with a top-level bin/ is refused at upload, and neither app runs a hook from a plugin we ship.
129
- if (file === 'bin' || file.startsWith('bin/') || file.startsWith('hooks/'))
130
- throw new Error(`plugin file ${file} is one neither app may be shipped`);
131
- }
132
- return {
133
- target,
134
- files,
135
- archiveName: `${name}-${target}.zip`,
136
- archive: createZip([...files].map(([file, content]) => ({ path: file, data: Buffer.from(content, 'utf8') }))),
137
- };
138
- });
139
- return { storeName: input.storeName, name, displayName, version, mcpUrl, skills: skills.map((skill) => skill.file), plugins };
224
+ return null;
225
+ }
226
+ async function listFiles(dir, sub = '') {
227
+ let entries;
228
+ try {
229
+ entries = await readdir(path.join(dir, sub), { withFileTypes: true });
230
+ }
231
+ catch {
232
+ return [];
233
+ }
234
+ const out = [];
235
+ for (const entry of entries) {
236
+ const rel = sub === '' ? entry.name : `${sub}/${entry.name}`;
237
+ if (entry.isDirectory())
238
+ out.push(...(await listFiles(dir, rel)));
239
+ else
240
+ out.push(rel);
241
+ }
242
+ return out;
140
243
  }
141
244
  /**
142
245
  * The store's name: its directory in the canonical clone, so a build run from
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/core/plugin/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAU,CAAC;AAG7D,2GAA2G;AAC3G,MAAM,CAAC,MAAM,eAAe,GAA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CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,8FAA8F;AAC9F,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAc,EAAE,IAAY;IAC/D,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IACrH,OAAO,IAAI,CAAC,QAAQ,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACtF,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * publish-one-contexture-plugin D5 (harness-portability spec, *The plugin's
3
+ * commands open its skills*): the plugin's typed commands, each mapped by
4
+ * name to the skill it opens. Declared here, never derived from a skill's
5
+ * name, so `/contexture:session` can open `ctxr-session-lifecycle` and a skill
6
+ * without a command stays without one.
7
+ */
8
+ export declare const PLUGIN_COMMANDS: Readonly<Record<string, string>>;
9
+ /** Each command whose skill the plugin does not carry, named with the skill it asks for. */
10
+ export declare function commandMapProblems(commands: Readonly<Record<string, string>>, carried: readonly string[]): string[];
11
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/core/plugin/commands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ5D,CAAC;AAEF,4FAA4F;AAC5F,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAInH"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * publish-one-contexture-plugin D5 (harness-portability spec, *The plugin's
3
+ * commands open its skills*): the plugin's typed commands, each mapped by
4
+ * name to the skill it opens. Declared here, never derived from a skill's
5
+ * name, so `/contexture:session` can open `ctxr-session-lifecycle` and a skill
6
+ * without a command stays without one.
7
+ */
8
+ export const PLUGIN_COMMANDS = {
9
+ capture: 'ctxr-capture',
10
+ ingest: 'ctxr-ingest-orchestration',
11
+ research: 'ctxr-research',
12
+ rollup: 'ctxr-rollup',
13
+ mission: 'ctxr-mission',
14
+ session: 'ctxr-session-lifecycle',
15
+ submit: 'ctxr-submit',
16
+ };
17
+ /** Each command whose skill the plugin does not carry, named with the skill it asks for. */
18
+ export function commandMapProblems(commands, carried) {
19
+ return Object.entries(commands)
20
+ .filter(([, skill]) => !carried.includes(skill))
21
+ .map(([command, skill]) => `command ${command} opens ${skill}, which the plugin does not carry`);
22
+ }
23
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/core/plugin/commands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqC;IAC/D,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,2BAA2B;IACnC,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,aAAa;IACrB,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,wBAAwB;IACjC,MAAM,EAAE,aAAa;CACtB,CAAC;AAEF,4FAA4F;AAC5F,MAAM,UAAU,kBAAkB,CAAC,QAA0C,EAAE,OAA0B;IACvG,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SAC5B,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC/C,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,WAAW,OAAO,UAAU,KAAK,mCAAmC,CAAC,CAAC;AACrG,CAAC"}
@@ -3,11 +3,15 @@ import type { ApprovalServer } from '../browse/approve.js';
3
3
  import type { GitRunner } from '../git/exec.js';
4
4
  import type { Store } from '../store.js';
5
5
  /**
6
- * serve-the-session-lifecycle-to-chat-apps D7 (remote-access spec, *Members
7
- * download the store's plugins from the server*): `GET /plugin/` names the two
8
- * downloads and how to install each, and `GET /plugin/<name>-<app>.zip` is that
9
- * archive, built in memory by the builder `ctxr plugin build` uses, from the
10
- * configuration the server last loaded.
6
+ * publish-one-contexture-plugin D4 (remote-access spec, *The server's connect
7
+ * page tells a member how to add the plugin and this store's connector*):
8
+ * `GET /plugin/` is the store's connect page. It names contexture's
9
+ * marketplace and plugin for Claude, this store's connector address and how
10
+ * to add it in each app, and links the store's ChatGPT plugin. There is no
11
+ * Claude archive any more: Claude's plugin is contexture's, installed from its
12
+ * marketplace. `GET /plugin/<name>-chatgpt.zip` is the ChatGPT archive, built
13
+ * in memory by the builder `ctxr plugin build` uses, from the configuration
14
+ * the server last loaded (serve-the-session-lifecycle-to-chat-apps D7).
11
15
  *
12
16
  * The routes exist only while the MCP surface is configured, and every one
13
17
  * needs the verified identity assertion the approval routes need, so they are
@@ -25,11 +29,11 @@ export interface PluginReply {
25
29
  }
26
30
  export declare class PluginDownloads {
27
31
  private readonly git;
28
- /** The last bundle built, keyed by the commit and the configuration it was built from. */
32
+ /** The last ChatGPT plugin built, keyed by the commit and the configuration it was built from. */
29
33
  private cached;
30
34
  private storeName;
31
35
  constructor(git: GitRunner);
32
- private bundleFor;
36
+ private chatgptFor;
33
37
  handle(store: Store, approval: ApprovalServer | null, approvalError: string | null, req: IncomingMessage, pathname: string): Promise<PluginReply>;
34
38
  }
35
39
  //# sourceMappingURL=routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/core/plugin/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAID,qBAAa,eAAe;IAKd,OAAO,CAAC,QAAQ,CAAC,GAAG;IAJhC,0FAA0F;IAC1F,OAAO,CAAC,MAAM,CAAsD;IACpE,OAAO,CAAC,SAAS,CAA8B;IAE/C,YAA6B,GAAG,EAAE,SAAS,EAAI;YAEjC,SAAS;IAUjB,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAgCtJ;CACF"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/core/plugin/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAs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