@khorsheed/dsh-local-agent-codex 0.1.0-rc.8 → 0.2.0-rc.3

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 (40) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.en.md +34 -20
  3. package/README.i18n.yaml +2 -2
  4. package/README.md +34 -20
  5. package/cordis.patch.yml +16 -24
  6. package/lib/client.js +816 -322
  7. package/lib/index.js +501 -104
  8. package/lib/tool.js +40 -0
  9. package/lib/types/client/SettingsCard.d.ts +73 -24
  10. package/lib/types/client/SettingsCard.js +110 -140
  11. package/lib/types/client/index.d.ts +6 -26
  12. package/lib/types/client/index.js +136 -50
  13. package/lib/types/client/locales.d.ts +34 -24
  14. package/lib/types/client/locales.js +38 -28
  15. package/lib/types/codex-cli-provider.d.ts +21 -4
  16. package/lib/types/codex-cli-provider.js +60 -27
  17. package/lib/types/endpoint-auth.d.ts +194 -0
  18. package/lib/types/endpoint-auth.js +300 -0
  19. package/lib/types/index.d.ts +19 -3
  20. package/lib/types/index.js +127 -28
  21. package/lib/types/live-driver.d.ts +9 -0
  22. package/lib/types/live-driver.js +16 -2
  23. package/lib/types/live-switch.d.ts +7 -0
  24. package/lib/types/live-switch.js +1 -0
  25. package/lib/types/model-broker.d.ts +12 -2
  26. package/lib/types/model-broker.js +9 -5
  27. package/lib/types/model-catalog.d.ts +53 -9
  28. package/lib/types/model-catalog.js +95 -12
  29. package/lib/types/provision.d.ts +12 -27
  30. package/lib/types/provision.js +19 -40
  31. package/lib/types/records.d.ts +0 -7
  32. package/lib/types/records.js +1 -19
  33. package/lib/types/tool.d.ts +54 -0
  34. package/lib/types/tool.js +34 -0
  35. package/locale/en.json +2 -2
  36. package/locale/zh.json +2 -2
  37. package/package.json +25 -23
  38. package/lib/invariant.js +0 -31
  39. package/lib/types/invariant.d.ts +0 -16
  40. package/lib/types/invariant.js +0 -33
@@ -0,0 +1,34 @@
1
+ import { mountSubagentDelegationTool, subagentToolConfigSchema } from '@khorsheed/dsh-local-agent/tool-factory';
2
+ const PACKAGE_NAME = '@khorsheed/dsh-local-agent-codex';
3
+ /** This entry's own defaults: a preset row needs no config. */
4
+ const DEFAULT_PROVIDER = 'codex-local';
5
+ const DEFAULT_TOOL_NAME = 'subagent_codex';
6
+ /** Cordis plugin name used by loader diagnostics. */
7
+ export const name = 'local-agent-codex-tool';
8
+ /**
9
+ * The family core's `localAgent` service is a declared inject (the
10
+ * owning-family companion exception to the community-service probe rule): a
11
+ * preset's standing scope mounts at registry-activation time, BEFORE the
12
+ * profile's later bundle rows provide the core, so a one-shot ctx.get probe
13
+ * at apply saw ABSENT there and nothing re-ran the row (rc.1 boot order; the
14
+ * worktrees `./tool` entry documents the incident). The declared inject pends
15
+ * the row until the core provides, then the body applies.
16
+ */
17
+ export const inject = ['tools', 'subagents', 'localAgent'];
18
+ // Bare `z` annotation per the shared helper's variance note.
19
+ export const Config = subagentToolConfigSchema(DEFAULT_PROVIDER, DEFAULT_TOOL_NAME);
20
+ /**
21
+ * Plugin body: mount the delegation tool through the family factory, stamped
22
+ * with THIS package as the tool-origin owner (AGENTS.md § Tool origin
23
+ * tagging — the shared factory never hardcodes an owner).
24
+ * @param ctx - Cordis context (the preset's agent-plane mount).
25
+ * @param config - row config (schema defaults already applied; the `??`
26
+ * fallbacks cover a direct ctx.plugin caller that bypassed validation).
27
+ */
28
+ export function apply(ctx, config) {
29
+ const resolved = {
30
+ provider: config.provider ?? DEFAULT_PROVIDER,
31
+ toolName: config.toolName ?? DEFAULT_TOOL_NAME,
32
+ };
33
+ mountSubagentDelegationTool(ctx, resolved, PACKAGE_NAME);
34
+ }
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
- "title": "Codex Delegation",
4
- "description": "Delegate coding tasks to your locally installed Codex CLI."
3
+ "title": "Local Codex Delegation",
4
+ "description": "Delegate coding tasks to this machine's Codex CLI."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
- "title": "Codex 委派",
4
- "description": "把编码任务委派给本地 Codex CLI,在隔离作用域中运行。"
3
+ "title": "本机 Codex 委派",
4
+ "description": "把编码任务委派给本机的 Codex CLI,在隔离作用域中运行。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khorsheed/dsh-local-agent-codex",
3
- "description": "Codex harness for dsh-local-agent: scoped CODEX_HOME, one-shot codex exec delegation visible in the 子代理 surface, rollout-file session records",
3
+ "description": "Codex harness for dsh-local-agent: scoped CODEX_HOME, one-shot codex exec delegation visible in the 子代理 surface, rollout-file session records; the session-granted `subagent_codex` delegation tool ships as the package's `./tool` composition entry",
4
4
  "keywords": [
5
5
  "dsh",
6
6
  "dsh-plugin",
@@ -8,7 +8,7 @@
8
8
  "local-agent",
9
9
  "codex"
10
10
  ],
11
- "version": "0.1.0-rc.8",
11
+ "version": "0.2.0-rc.3",
12
12
  "type": "module",
13
13
  "main": "lib/index.js",
14
14
  "types": "lib/types/index.d.ts",
@@ -17,14 +17,14 @@
17
17
  "types": "./lib/types/index.d.ts",
18
18
  "default": "./lib/index.js"
19
19
  },
20
- "./invariant": {
21
- "types": "./lib/types/invariant.d.ts",
22
- "default": "./lib/invariant.js"
23
- },
24
20
  "./records": {
25
21
  "types": "./lib/types/records.d.ts",
26
22
  "default": "./lib/records.js"
27
23
  },
24
+ "./tool": {
25
+ "types": "./lib/types/tool.d.ts",
26
+ "default": "./lib/tool.js"
27
+ },
28
28
  "./client": {
29
29
  "types": "./lib/types/client/index.d.ts",
30
30
  "default": "./lib/client.js"
@@ -32,7 +32,8 @@
32
32
  "./src/*": "./src/*",
33
33
  "./cordis.patch.yml": "./cordis.patch.yml",
34
34
  "./package.json": "./package.json",
35
- "./locale/*.json": "./locale/*.json"
35
+ "./locale/*.json": "./locale/*.json",
36
+ "./tool/locale/*.json": "./locale/*.json"
36
37
  },
37
38
  "dsh": {
38
39
  "references": [
@@ -53,8 +54,8 @@
53
54
  },
54
55
  "compat": {
55
56
  "minHost": "0.1.5-rc.1",
56
- "notes": "Live output uses the local-agent transient Remote and public Conversation nodes, with incremental durable recovery checkpoints; native final messages retain their existing transcript and usage semantics. End-to-end latency acceptance is tracked by the room coordinator proposal.",
57
- "verifiedHost": "0.1.5-rc.1"
57
+ "notes": "Live output uses the local-agent transient Remote and public Conversation nodes, with incremental durable recovery checkpoints; native final messages retain their existing transcript and usage semantics. End-to-end latency acceptance is tracked by the room coordinator proposal. The settings card mounts only on host 0.1.7-alpha.1+ (the Plugins page plugins.item seat, gated by configForms.whileServed on the served namespace); 0.1.5 renders no card (the host removed the settings.plugin.item seat) — every other surface is unchanged.",
58
+ "verifiedHost": "0.2.1-rc.1"
58
59
  }
59
60
  },
60
61
  "files": [
@@ -64,24 +65,25 @@
64
65
  "CHANGELOG.md"
65
66
  ],
66
67
  "license": "MIT",
68
+ "engines": {
69
+ "dsh": ">=0.1.5-rc.1 <0.3.0-0"
70
+ },
67
71
  "dependencies": {
68
- "@khorsheed/dsh-local-agent": "^0.1.0-rc.8",
69
- "@khorsheed/dsh-local-agent-tool-subagent": "^0.1.0-rc.8"
72
+ "@khorsheed/dsh-local-agent": "^0.2.0-rc.3"
70
73
  },
71
74
  "peerDependencies": {
72
75
  "@deepseek-ai/cordis": "^4.0.1",
73
- "@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.6 || ^0.2.0-rc.1",
74
- "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6 || ^0.2.0-rc.1",
75
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6 || ^0.2.0-rc.1",
76
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6 || ^0.2.0-rc.1",
77
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6 || ^0.2.0-rc.1",
78
- "@deepseek-ai/dsh-commands": "^0.1.0-rc.8 || ^0.2.0-rc.1",
79
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6 || ^0.2.0-rc.1",
80
- "@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.2.0-rc.1",
81
- "@deepseek-ai/dsh-session": "^0.1.0-rc.8 || ^0.2.0-rc.1",
82
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6 || ^0.2.0-rc.1",
83
- "@deepseek-ai/dsh-subagent": "^0.1.0-rc.6 || ^0.2.0-rc.1",
84
- "@deepseek-ai/dsh-subprocess": "^0.1.0-rc.6 || ^0.2.0-rc.1",
76
+ "@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
77
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
78
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
79
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
80
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
81
+ "@deepseek-ai/dsh-commands": "^0.1.0-rc.8 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
82
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
83
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.8 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
84
+ "@deepseek-ai/dsh-settings": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
85
+ "@deepseek-ai/dsh-subagent": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
86
+ "@deepseek-ai/dsh-subprocess": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1",
85
87
  "react": "^18.2.0"
86
88
  },
87
89
  "peerDependenciesMeta": {
package/lib/invariant.js DELETED
@@ -1,31 +0,0 @@
1
- //#region lib/types/invariant.js
2
- /**
3
- * Package-owned invariant companion for `@khorsheed/dsh-local-agent-codex`.
4
- * @module @khorsheed/dsh-local-agent-codex/invariant
5
- */
6
- const PACKAGE_NAME = "@khorsheed/dsh-local-agent-codex";
7
- /** Cordis companion plugin name. */
8
- const name = "local-agent-codex-invariant";
9
- /** Service required before the companion can reserve package ownership. */
10
- const inject = ["invariants"];
11
- /**
12
- * The codex harness definition is this bundle's contract with the core
13
- * registry: whenever a `codex` harness registers, its scoped-home variable
14
- * must be the one this bundle pins.
15
- */
16
- const install = (ctx, fail) => {
17
- ctx.on("internal/dispatch", (_mode, eventName, args) => {
18
- if (eventName !== "localAgent/harness-added") return;
19
- const harness = args[0];
20
- if (harness.name !== "codex") return;
21
- if (harness.homeEnvVar !== "CODEX_HOME") fail("codex harness registered with a home env other than the local-agent-codex contract");
22
- }, { global: true });
23
- };
24
- /**
25
- * Register this package's invariant companion.
26
- * @param ctx - plugin context carrying the invariant registry.
27
- * @returns the installed registration's disposer.
28
- */
29
- const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
30
- //#endregion
31
- export { apply, inject, name };
@@ -1,16 +0,0 @@
1
- /**
2
- * Package-owned invariant companion for `@khorsheed/dsh-local-agent-codex`.
3
- * @module @khorsheed/dsh-local-agent-codex/invariant
4
- */
5
- import type { Context } from '@deepseek-ai/cordis';
6
- /** Cordis companion plugin name. */
7
- export declare const name = "local-agent-codex-invariant";
8
- /** Service required before the companion can reserve package ownership. */
9
- export declare const inject: string[];
10
- /**
11
- * Register this package's invariant companion.
12
- * @param ctx - plugin context carrying the invariant registry.
13
- * @returns the installed registration's disposer.
14
- */
15
- export declare const apply: (ctx: Context) => Promise<() => void>;
16
- //# sourceMappingURL=invariant.d.ts.map
@@ -1,33 +0,0 @@
1
- /**
2
- * Package-owned invariant companion for `@khorsheed/dsh-local-agent-codex`.
3
- * @module @khorsheed/dsh-local-agent-codex/invariant
4
- */
5
- const PACKAGE_NAME = '@khorsheed/dsh-local-agent-codex';
6
- /** Cordis companion plugin name. */
7
- export const name = 'local-agent-codex-invariant';
8
- /** Service required before the companion can reserve package ownership. */
9
- export const inject = ['invariants'];
10
- /**
11
- * The codex harness definition is this bundle's contract with the core
12
- * registry: whenever a `codex` harness registers, its scoped-home variable
13
- * must be the one this bundle pins.
14
- */
15
- const install = (ctx, fail) => {
16
- ctx.on('internal/dispatch', (_mode, eventName, args) => {
17
- if (eventName !== 'localAgent/harness-added')
18
- return;
19
- const harness = args[0];
20
- if (harness.name !== 'codex')
21
- return;
22
- if (harness.homeEnvVar !== 'CODEX_HOME') {
23
- fail('codex harness registered with a home env other than the local-agent-codex contract');
24
- }
25
- }, { global: true });
26
- };
27
- /**
28
- * Register this package's invariant companion.
29
- * @param ctx - plugin context carrying the invariant registry.
30
- * @returns the installed registration's disposer.
31
- */
32
- export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
33
- /* jscpd:ignore-end */