@dsh-ray/coding-subscription-provider 0.0.1-seed.0 → 0.2.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 (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -1
  3. package/cordis.patch.yml +8 -0
  4. package/lib/adapter.d.ts +120 -0
  5. package/lib/adapter.d.ts.map +1 -0
  6. package/lib/adapter.js +742 -0
  7. package/lib/adapter.js.map +1 -0
  8. package/lib/auth.d.ts +33 -0
  9. package/lib/auth.d.ts.map +1 -0
  10. package/lib/auth.js +101 -0
  11. package/lib/auth.js.map +1 -0
  12. package/lib/codex-catalog.d.ts +57 -0
  13. package/lib/codex-catalog.d.ts.map +1 -0
  14. package/lib/codex-catalog.js +369 -0
  15. package/lib/codex-catalog.js.map +1 -0
  16. package/lib/codex-direct-auth.d.ts +35 -0
  17. package/lib/codex-direct-auth.d.ts.map +1 -0
  18. package/lib/codex-direct-auth.js +626 -0
  19. package/lib/codex-direct-auth.js.map +1 -0
  20. package/lib/codex-direct-responses.d.ts +57 -0
  21. package/lib/codex-direct-responses.d.ts.map +1 -0
  22. package/lib/codex-direct-responses.js +1759 -0
  23. package/lib/codex-direct-responses.js.map +1 -0
  24. package/lib/config.d.ts +65 -0
  25. package/lib/config.d.ts.map +1 -0
  26. package/lib/config.js +105 -0
  27. package/lib/config.js.map +1 -0
  28. package/lib/index.d.ts +10 -0
  29. package/lib/index.d.ts.map +1 -0
  30. package/lib/index.js +70 -0
  31. package/lib/index.js.map +1 -0
  32. package/lib/process.d.ts +131 -0
  33. package/lib/process.d.ts.map +1 -0
  34. package/lib/process.js +1131 -0
  35. package/lib/process.js.map +1 -0
  36. package/lib/prompt.d.ts +15 -0
  37. package/lib/prompt.d.ts.map +1 -0
  38. package/lib/prompt.js +299 -0
  39. package/lib/prompt.js.map +1 -0
  40. package/lib/providers.d.ts +43 -0
  41. package/lib/providers.d.ts.map +1 -0
  42. package/lib/providers.js +179 -0
  43. package/lib/providers.js.map +1 -0
  44. package/lib/session-cwd.d.ts +26 -0
  45. package/lib/session-cwd.d.ts.map +1 -0
  46. package/lib/session-cwd.js +57 -0
  47. package/lib/session-cwd.js.map +1 -0
  48. package/lib/subscription-catalog.d.ts +51 -0
  49. package/lib/subscription-catalog.d.ts.map +1 -0
  50. package/lib/subscription-catalog.js +290 -0
  51. package/lib/subscription-catalog.js.map +1 -0
  52. package/lib/version.d.ts +2 -0
  53. package/lib/version.d.ts.map +1 -0
  54. package/lib/version.js +2 -0
  55. package/lib/version.js.map +1 -0
  56. package/package.json +82 -4
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Codex 0.147 feature keys that can expose a provider-owned executor, lifecycle
3
+ * hook, skill/plugin instruction, or capability-discovery path. Keep this list
4
+ * mirrored by scripts/capture-cli-fixtures.mjs and covered by the exact argv
5
+ * tests below. The protocol decoder remains the final fail-closed boundary.
6
+ */
7
+ export const CODEX_DISABLED_NATIVE_FEATURES = [
8
+ 'shell_tool',
9
+ 'shell_zsh_fork',
10
+ 'unified_exec_zsh_fork',
11
+ 'shell_snapshot',
12
+ 'deferred_executor',
13
+ 'js_repl',
14
+ 'js_repl_tools_only',
15
+ 'view_image',
16
+ 'hooks',
17
+ 'code_mode',
18
+ 'code_mode_buffered_exec',
19
+ 'code_mode_host',
20
+ 'code_mode_only',
21
+ 'web_search_request',
22
+ 'web_search_cached',
23
+ 'search_tool',
24
+ 'memories',
25
+ 'external_agent_memory_import',
26
+ 'apply_patch_freeform',
27
+ 'apply_patch_streaming_events',
28
+ 'exec_permission_approvals',
29
+ 'request_rule',
30
+ 'multi_agent',
31
+ 'multi_agent_v2',
32
+ 'multi_agent_mode',
33
+ 'collaboration_modes',
34
+ 'apps',
35
+ 'enable_mcp_apps',
36
+ 'mcp_2026_07_28',
37
+ 'apps_mcp_path_override',
38
+ 'tool_search',
39
+ 'deferred_tool_world_state',
40
+ 'non_prefixed_mcp_tool_names',
41
+ 'unavailable_dummy_tools',
42
+ 'tool_suggest',
43
+ 'recommended_plugins',
44
+ 'plugins',
45
+ 'executor_capability_discovery',
46
+ 'plugin_hooks',
47
+ 'in_app_browser',
48
+ 'browser_use',
49
+ 'browser_use_full_cdp_access',
50
+ 'browser_use_external',
51
+ 'computer_use',
52
+ 'remote_plugin',
53
+ 'plugin_sharing',
54
+ 'image_generation',
55
+ 'skill_mcp_dependency_install',
56
+ 'skill_search',
57
+ 'skill_env_var_dependency_prompt',
58
+ 'standalone_web_search',
59
+ 'default_mode_request_user_input',
60
+ 'request_permissions_tool',
61
+ 'token_budget',
62
+ 'current_time_reminder',
63
+ 'terminal_visualization_instructions',
64
+ 'guardian_approval',
65
+ 'guardianv2',
66
+ 'goals',
67
+ 'tool_call_mcp_elicitation',
68
+ 'auth_elicitation',
69
+ 'artifact',
70
+ 'workspace_dependencies',
71
+ ];
72
+ const codexDisabledNativeFeatureArgs = CODEX_DISABLED_NATIVE_FEATURES
73
+ .flatMap(feature => ['--disable', feature]);
74
+ /** Codex config paths that suppress repository-, skill-, and host-owned prompt/tool injection. */
75
+ export const CODEX_NATIVE_BOUNDARY_CONFIG_OVERRIDES = [
76
+ 'project_doc_max_bytes=0',
77
+ 'skills.include_instructions=false',
78
+ 'skills.bundled.enabled=false',
79
+ 'orchestrator.skills.enabled=false',
80
+ 'orchestrator.mcp.enabled=false',
81
+ 'include_apps_instructions=false',
82
+ 'include_permissions_instructions=false',
83
+ 'include_environment_context=false',
84
+ 'include_collaboration_mode_instructions=false',
85
+ 'tools.update_plan.enabled=false',
86
+ 'tools.experimental_request_user_input.enabled=false',
87
+ 'web_search="disabled"',
88
+ 'agents.enabled=false',
89
+ ];
90
+ const codexNativeBoundaryConfigArgs = CODEX_NATIVE_BOUNDARY_CONFIG_OVERRIDES
91
+ .flatMap(value => ['--config', value]);
92
+ export const providerPresets = {
93
+ codex: {
94
+ id: 'codex',
95
+ command: 'codex',
96
+ // Codex owns its own authenticated subscription session. Ignore local config/rules,
97
+ // remove known model-visible native capabilities, and keep residual built-ins read-only.
98
+ // The stdout decoder still rejects any native tool lifecycle event that escapes
99
+ // these best-effort launch boundaries.
100
+ args: [
101
+ 'exec', '--json', '--ephemeral', '--ignore-user-config', '--ignore-rules',
102
+ // The cwd has already been reconstructed from the live Host session and
103
+ // compared by canonical realpath. The standard assistant workspace is
104
+ // intentionally not required to be a Git repository.
105
+ '--skip-git-repo-check',
106
+ ...codexDisabledNativeFeatureArgs,
107
+ ...codexNativeBoundaryConfigArgs,
108
+ '--sandbox', 'read-only',
109
+ ],
110
+ output: 'ndjson',
111
+ },
112
+ claude: {
113
+ id: 'claude',
114
+ command: 'claude',
115
+ // Disable Claude-native tools; DSH calls return through the outer JSON bridge.
116
+ args: ['-p', '--output-format', 'stream-json', '--verbose', '--include-partial-messages', '--no-session-persistence', '--safe-mode', '--permission-mode', 'dontAsk', '--tools', ''],
117
+ output: 'ndjson',
118
+ },
119
+ cursor: {
120
+ id: 'cursor',
121
+ command: 'cursor-agent',
122
+ // Ask mode is the strongest current headless boundary. Intentionally never
123
+ // pass --force or another approval bypass; read-only search may still occur.
124
+ args: ['--print', '--output-format', 'stream-json', '--mode=ask'],
125
+ output: 'ndjson',
126
+ },
127
+ grok: {
128
+ id: 'grok',
129
+ command: 'grok',
130
+ // Grok treats an empty --tools value as no filter, so allow then deny its
131
+ // always-on MCP meta-tools to produce an actually empty native tool set. DSH
132
+ // calls use the outer JSON bridge instead of Grok's internal executor.
133
+ args: [
134
+ '--output-format', 'streaming-json', '--permission-mode', 'dontAsk',
135
+ '--no-auto-update', '--no-memory', '--no-subagents', '--disable-web-search', '--verbatim',
136
+ '--tools', 'search_tool', '--disallowed-tools', 'search_tool,use_tool',
137
+ ],
138
+ output: 'ndjson',
139
+ },
140
+ };
141
+ export function buildInvocation(provider, options, _platform = process.platform) {
142
+ const preset = providerPresets[provider];
143
+ // Grok 1.0.5 reopens its --prompt-file path instead of consuming the inherited
144
+ // stdin stream. `/dev/stdin` can therefore fail with ENXIO under child_process,
145
+ // so use the same private-file transport on every supported platform.
146
+ const promptTransport = provider === 'grok'
147
+ ? 'secure-temporary-file'
148
+ : 'stdin';
149
+ const args = [...preset.args];
150
+ if (options.model && options.model !== 'default')
151
+ args.push('--model', options.model);
152
+ if (provider === 'codex' && options.reasoningEffort) {
153
+ args.push('--config', `model_reasoning_effort=${JSON.stringify(options.reasoningEffort)}`);
154
+ }
155
+ else if (provider === 'claude' && options.reasoningEffort) {
156
+ args.push('--effort', options.reasoningEffort);
157
+ }
158
+ else if (provider === 'grok' && options.reasoningEffort) {
159
+ args.push('--reasoning-effort', options.reasoningEffort);
160
+ }
161
+ if (options.maxTurns !== undefined && (provider === 'claude' || provider === 'grok')) {
162
+ args.push('--max-turns', String(options.maxTurns));
163
+ }
164
+ // Use the documented positional sentinel even though some Codex releases
165
+ // also infer stdin when PROMPT is omitted. Keeping it last prevents a future
166
+ // parser change from treating a following option as prompt content.
167
+ if (provider === 'codex')
168
+ args.push('-');
169
+ return {
170
+ provider,
171
+ command: options.command ?? preset.command,
172
+ args,
173
+ prompt: options.prompt,
174
+ promptTransport,
175
+ cwd: options.cwd,
176
+ shell: false,
177
+ };
178
+ }
179
+ //# sourceMappingURL=providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAmCA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,YAAY;IACZ,gBAAgB;IAChB,uBAAuB;IACvB,gBAAgB;IAChB,mBAAmB;IACnB,SAAS;IACT,oBAAoB;IACpB,YAAY;IACZ,OAAO;IACP,WAAW;IACX,yBAAyB;IACzB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,mBAAmB;IACnB,aAAa;IACb,UAAU;IACV,8BAA8B;IAC9B,sBAAsB;IACtB,8BAA8B;IAC9B,2BAA2B;IAC3B,cAAc;IACd,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,qBA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OAAO,CAAC,MAAM;QACtB,eAAe;QACf,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,KAAK;KACb,CAAA;AACH,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type GenerateOptions } from '@deepseek-ai/dsh-llm';
2
+ import type { AgentLoopRequestAttestor } from '@dsh-ray/llm-route-capabilities';
3
+ export interface LiveSessionCwd {
4
+ readonly id: NonNullable<GenerateOptions['sessionId']>;
5
+ readonly header: {
6
+ readonly cwd?: string;
7
+ };
8
+ }
9
+ export interface LiveSessionLookup {
10
+ get(id: NonNullable<GenerateOptions['sessionId']>): LiveSessionCwd | undefined;
11
+ }
12
+ export declare class TrustedSessionCwdError extends Error {
13
+ constructor();
14
+ }
15
+ /**
16
+ * Resolves the only cwd a local coding process may receive for this request.
17
+ * A same-module marker or the Host-owned exact live-agent proof is mandatory;
18
+ * copied request fields or a persisted/stale session id cannot select a path.
19
+ */
20
+ export declare function resolveTrustedSessionCwd(input: {
21
+ request: GenerateOptions;
22
+ configuredCwd: string;
23
+ sessions: LiveSessionLookup | undefined;
24
+ attestor?: AgentLoopRequestAttestor;
25
+ }): string;
26
+ //# sourceMappingURL=session-cwd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-cwd.d.ts","sourceRoot":"","sources":["../src/session-cwd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAE/E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,WAAW,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAA;IACtD,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,EAAE,WAAW,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,GAAG,cAAc,GAAG,SAAS,CAAA;CAC/E;AAED,qBAAa,sBAAuB,SAAQ,KAAK;;CAIhD;AAkBD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,OAAO,EAAE,eAAe,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,EAAE,wBAAwB,CAAA;CACpC,GAAG,MAAM,CAsBT"}
@@ -0,0 +1,57 @@
1
+ import { realpathSync } from 'node:fs';
2
+ import { isAbsolute } from 'node:path';
3
+ import { isAgentLoopRequest } from '@deepseek-ai/dsh-llm';
4
+ export class TrustedSessionCwdError extends Error {
5
+ constructor() {
6
+ super('local provider requires a matching live loop session and canonical cwd');
7
+ }
8
+ }
9
+ function canonicalDirectory(path) {
10
+ if (!isAbsolute(path))
11
+ throw new TrustedSessionCwdError();
12
+ try {
13
+ return realpathSync.native(path);
14
+ }
15
+ catch {
16
+ throw new TrustedSessionCwdError();
17
+ }
18
+ }
19
+ function ownEnumerableDataField(value, key) {
20
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
21
+ if (descriptor === undefined)
22
+ return undefined;
23
+ if (!descriptor.enumerable || !Object.hasOwn(descriptor, 'value'))
24
+ throw new TrustedSessionCwdError();
25
+ return descriptor;
26
+ }
27
+ /**
28
+ * Resolves the only cwd a local coding process may receive for this request.
29
+ * A same-module marker or the Host-owned exact live-agent proof is mandatory;
30
+ * copied request fields or a persisted/stale session id cannot select a path.
31
+ */
32
+ export function resolveTrustedSessionCwd(input) {
33
+ const sessionId = ownEnumerableDataField(input.request, 'sessionId')?.value;
34
+ if (typeof sessionId !== 'string' || sessionId.length === 0 || sessionId.length > 512) {
35
+ throw new TrustedSessionCwdError();
36
+ }
37
+ const session = input.sessions?.get(sessionId);
38
+ if (session === undefined || session.id !== sessionId || typeof session.header.cwd !== 'string') {
39
+ throw new TrustedSessionCwdError();
40
+ }
41
+ const purpose = ownEnumerableDataField(input.request, 'purpose');
42
+ const hasPurpose = purpose !== undefined;
43
+ const loopOwned = hasPurpose
44
+ ? purpose.value === 'compaction'
45
+ && input.attestor?.claimCompaction?.(input.request, session) === true
46
+ && Object.isFrozen(input.request)
47
+ : Object.isFrozen(input.request)
48
+ && (isAgentLoopRequest(input.request) || input.attestor?.claim(input.request, session) === true);
49
+ if (!loopOwned)
50
+ throw new TrustedSessionCwdError();
51
+ const configuredCwd = canonicalDirectory(input.configuredCwd);
52
+ const sessionCwd = canonicalDirectory(session.header.cwd);
53
+ if (configuredCwd !== sessionCwd)
54
+ throw new TrustedSessionCwdError();
55
+ return sessionCwd;
56
+ }
57
+ //# sourceMappingURL=session-cwd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-cwd.js","sourceRoot":"","sources":["../src/session-cwd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAwB,MAAM,sBAAsB,CAAA;AAY/E,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C;QACE,KAAK,CAAC,wEAAwE,CAAC,CAAA;IACjF,CAAC;CACF;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,sBAAsB,EAAE,CAAA;IACzD,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,sBAAsB,EAAE,CAAA;IACpC,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAa,EAAE,GAAW;IACxD,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAC9D,IAA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B,CAAC,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,CAAA;IACpG,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,sBAAsB,EAAE,CAAA;IAClD,MAAM,aAAa,GAAG,kBAAkB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IAC7D,MAAM,UAAU,GAAG,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACzD,IAAI,aAAa,KAAK,UAAU;QAAE,MAAM,IAAI,sBAAsB,EAAE,CAAA;IACpE,OAAO,UAAU,CAAA;AACnB,CAAC"}
@@ -0,0 +1,51 @@
1
+ export interface SubscriptionCatalogInvocation {
2
+ readonly command: string;
3
+ readonly cwd: string;
4
+ }
5
+ export interface SubscriptionCatalogReasoningEffort {
6
+ readonly id: string;
7
+ readonly name: string;
8
+ readonly description?: string;
9
+ }
10
+ export interface SubscriptionCatalogModel {
11
+ readonly id: string;
12
+ readonly name: string;
13
+ readonly description?: string;
14
+ readonly reasoning?: {
15
+ readonly efforts: readonly SubscriptionCatalogReasoningEffort[];
16
+ readonly defaultEffort?: string;
17
+ };
18
+ readonly inputModalities: readonly string[];
19
+ }
20
+ export interface SubscriptionCatalog {
21
+ readonly models: readonly SubscriptionCatalogModel[];
22
+ readonly defaultModel?: string;
23
+ readonly observedAt: number;
24
+ }
25
+ export interface CatalogCommandResult {
26
+ readonly exitCode: number;
27
+ readonly signal: NodeJS.Signals | null;
28
+ readonly stdout: string;
29
+ readonly stderr: string;
30
+ }
31
+ export interface CatalogCommandOptions {
32
+ readonly cwd: string;
33
+ readonly timeoutMs: number;
34
+ readonly maxOutputBytes: number;
35
+ readonly extraEnvNames: readonly string[];
36
+ readonly stdin: string;
37
+ readonly signal?: AbortSignal;
38
+ }
39
+ export type CatalogCommandRunner = (command: string, args: readonly string[], options: CatalogCommandOptions) => Promise<CatalogCommandResult>;
40
+ export interface DiscoverSubscriptionCatalogOptions {
41
+ readonly runCommand?: CatalogCommandRunner;
42
+ readonly signal?: AbortSignal;
43
+ readonly timeoutMs?: number;
44
+ readonly maxOutputBytes?: number;
45
+ readonly extraEnvNames?: readonly string[];
46
+ }
47
+ export declare function discoverClaudeModels(invocation: SubscriptionCatalogInvocation, options?: DiscoverSubscriptionCatalogOptions): Promise<SubscriptionCatalog>;
48
+ export declare function discoverGrokModels(invocation: SubscriptionCatalogInvocation, options?: DiscoverSubscriptionCatalogOptions): Promise<SubscriptionCatalog>;
49
+ export declare function discoverCursorModels(invocation: SubscriptionCatalogInvocation, options?: DiscoverSubscriptionCatalogOptions): Promise<SubscriptionCatalog>;
50
+ export declare const runCatalogCommand: CatalogCommandRunner;
51
+ //# sourceMappingURL=subscription-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-catalog.d.ts","sourceRoot":"","sources":["../src/subscription-catalog.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE;QACnB,QAAQ,CAAC,OAAO,EAAE,SAAS,kCAAkC,EAAE,CAAA;QAC/D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CA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,MAAM,EAAE,CAAA;CAC3C;AAwBD,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,6BAA6B,EACzC,OAAO,GAAE,kCAAuC,GAC/C,OAAO,CAAC,mBAAmB,CAAC,CAuB9B;AAED,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,6BAA6B,EACzC,OAAO,GAAE,kCAAuC,GAC/C,OAAO,CAAC,mBAAmB,CAAC,CAwB9B;AAED,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,6BAA6B,EACzC,OAAO,GAAE,kCAAuC,GAC/C,OAAO,CAAC,mBAAmB,CAAC,CAoB9B;AAED,eAAO,MAAM,iBAAiB,EAAE,oBA8C9B,CAAA"}
@@ -0,0 +1,290 @@
1
+ import { execFile as nodeExecFile } from 'node:child_process';
2
+ import { isAbsolute } from 'node:path';
3
+ import { buildSubscriptionEnv } from './process.js';
4
+ import { version } from './version.js';
5
+ const CLAUDE_REQUEST_ID = 'dsh-model-catalog';
6
+ const GROK_REQUEST_ID = 1;
7
+ const defaults = { timeoutMs: 10_000, maxOutputBytes: 32 * 1024 };
8
+ const effortDescriptions = {
9
+ low: 'Minimal reasoning, fastest responses',
10
+ medium: 'Balanced reasoning depth and latency',
11
+ high: 'Deep reasoning for complex tasks',
12
+ xhigh: 'Extra-high reasoning depth',
13
+ max: 'Maximum reasoning effort',
14
+ };
15
+ const claudeArgs = [
16
+ '-p',
17
+ '--input-format', 'stream-json',
18
+ '--output-format', 'stream-json',
19
+ '--verbose',
20
+ '--no-session-persistence',
21
+ '--safe-mode',
22
+ '--permission-mode', 'dontAsk',
23
+ '--tools', '',
24
+ ];
25
+ export async function discoverClaudeModels(invocation, options = {}) {
26
+ const result = await execute(invocation, claudeArgs, `${JSON.stringify({
27
+ type: 'control_request',
28
+ request_id: CLAUDE_REQUEST_ID,
29
+ request: { subtype: 'initialize' },
30
+ })}\n`, options);
31
+ const messages = parseJsonLines(result.stdout);
32
+ const envelope = messages.find(message => {
33
+ const candidate = jsonObject(message);
34
+ const response = jsonObject(candidate?.response);
35
+ return candidate?.type === 'control_response' && response?.request_id === CLAUDE_REQUEST_ID;
36
+ });
37
+ const outer = jsonObject(jsonObject(envelope)?.response);
38
+ const payload = jsonObject(outer?.response);
39
+ if (outer?.subtype !== 'success' || !Array.isArray(payload?.models))
40
+ throw catalogError('protocol');
41
+ const models = disambiguateClaudeModelNames(payload.models.map(parseClaudeModel));
42
+ validateModels(models);
43
+ return {
44
+ models,
45
+ ...(models.some(model => model.id === 'default') ? { defaultModel: 'default' } : {}),
46
+ observedAt: Date.now(),
47
+ };
48
+ }
49
+ export async function discoverGrokModels(invocation, options = {}) {
50
+ const result = await execute(invocation, ['agent', 'stdio'], `${JSON.stringify({
51
+ jsonrpc: '2.0',
52
+ id: GROK_REQUEST_ID,
53
+ method: 'initialize',
54
+ params: {
55
+ protocolVersion: 1,
56
+ clientCapabilities: {},
57
+ clientInfo: { name: 'dsh-ray', title: 'DSH Ray', version },
58
+ },
59
+ })}\n`, options);
60
+ const messages = parseJsonLines(result.stdout);
61
+ const envelope = messages.map(jsonObject).find(message => message?.jsonrpc === '2.0' && message.id === GROK_REQUEST_ID);
62
+ const initialized = jsonObject(envelope?.result);
63
+ const meta = jsonObject(initialized?._meta);
64
+ const modelState = jsonObject(meta?.modelState);
65
+ if (initialized?.protocolVersion !== 1 || typeof modelState?.currentModelId !== 'string'
66
+ || !Array.isArray(modelState.availableModels)) {
67
+ throw catalogError('protocol');
68
+ }
69
+ const models = modelState.availableModels.map(parseGrokModel);
70
+ validateModels(models);
71
+ if (!models.some(model => model.id === modelState.currentModelId))
72
+ throw catalogError('protocol');
73
+ return { models, defaultModel: modelState.currentModelId, observedAt: Date.now() };
74
+ }
75
+ export async function discoverCursorModels(invocation, options = {}) {
76
+ const result = await execute(invocation, ['--list-models'], '', options);
77
+ const lines = stripAnsi(result.stdout).split(/\r?\n/);
78
+ const header = lines.findIndex(line => /^\s*available models\s*:\s*$/i.test(line));
79
+ if (header < 0)
80
+ throw catalogError('protocol');
81
+ let defaultModel;
82
+ const models = [];
83
+ for (const line of lines.slice(header + 1)) {
84
+ if (line.trim().length === 0)
85
+ continue;
86
+ const match = /^\s*[*•-]\s+([A-Za-z0-9][A-Za-z0-9._:/+-]*)(?:\s+\((default)\))?\s*$/.exec(line);
87
+ if (match === null)
88
+ throw catalogError('protocol');
89
+ const id = match[1];
90
+ if (match[2] !== undefined || id.toLowerCase() === 'auto') {
91
+ if (defaultModel !== undefined && defaultModel !== id)
92
+ throw catalogError('protocol');
93
+ defaultModel = id;
94
+ }
95
+ models.push({ id, name: id, inputModalities: ['text'] });
96
+ }
97
+ validateModels(models);
98
+ return { models, ...(defaultModel === undefined ? {} : { defaultModel }), observedAt: Date.now() };
99
+ }
100
+ export const runCatalogCommand = (command, args, options) => new Promise((resolve, reject) => {
101
+ let settled = false;
102
+ const settle = (operation) => {
103
+ if (settled)
104
+ return;
105
+ settled = true;
106
+ operation();
107
+ };
108
+ const child = nodeExecFile(command, [...args], {
109
+ cwd: options.cwd,
110
+ env: buildSubscriptionEnv(options.extraEnvNames),
111
+ encoding: 'utf8',
112
+ maxBuffer: options.maxOutputBytes,
113
+ timeout: options.timeoutMs,
114
+ signal: options.signal,
115
+ shell: false,
116
+ windowsHide: true,
117
+ }, (error, stdout, stderr) => {
118
+ if (error === null) {
119
+ settle(() => resolve({ exitCode: 0, signal: null, stdout, stderr }));
120
+ return;
121
+ }
122
+ if (options.signal?.aborted) {
123
+ settle(() => reject(abortError(options.signal)));
124
+ return;
125
+ }
126
+ if (error.killed) {
127
+ settle(() => reject(catalogError('timeout')));
128
+ return;
129
+ }
130
+ if (error.code === 'ENOENT') {
131
+ settle(() => reject(error));
132
+ return;
133
+ }
134
+ if (typeof error.code === 'number') {
135
+ settle(() => resolve({
136
+ exitCode: error.code,
137
+ signal: error.signal,
138
+ stdout,
139
+ stderr,
140
+ }));
141
+ return;
142
+ }
143
+ settle(() => reject(new Error('subscription model catalog exceeded its safety limit', { cause: 'output-limit' })));
144
+ });
145
+ child.stdin?.once('error', error => settle(() => reject(error)));
146
+ child.stdin?.end(options.stdin);
147
+ });
148
+ async function execute(invocation, args, stdin, options) {
149
+ if (invocation.command.trim().length === 0 || !isAbsolute(invocation.cwd))
150
+ throw catalogError('protocol');
151
+ if (options.signal?.aborted)
152
+ throw abortError(options.signal);
153
+ const result = await (options.runCommand ?? runCatalogCommand)(invocation.command, args, {
154
+ cwd: invocation.cwd,
155
+ timeoutMs: positiveInteger(options.timeoutMs, defaults.timeoutMs),
156
+ maxOutputBytes: positiveInteger(options.maxOutputBytes, defaults.maxOutputBytes),
157
+ extraEnvNames: options.extraEnvNames ?? [],
158
+ stdin,
159
+ ...(options.signal === undefined ? {} : { signal: options.signal }),
160
+ });
161
+ if (result.exitCode !== 0 || result.signal !== null)
162
+ throw catalogError('process-exit');
163
+ return result;
164
+ }
165
+ function parseClaudeModel(value) {
166
+ const model = jsonObject(value);
167
+ if (typeof model?.value !== 'string' || model.value.length === 0
168
+ || typeof model.displayName !== 'string' || model.displayName.length === 0
169
+ || typeof model.description !== 'string') {
170
+ throw catalogError('protocol');
171
+ }
172
+ let reasoning;
173
+ if (model.supportsEffort === true) {
174
+ if (!Array.isArray(model.supportedEffortLevels) || model.supportedEffortLevels.length === 0)
175
+ throw catalogError('protocol');
176
+ const efforts = model.supportedEffortLevels.map(value => {
177
+ if (typeof value !== 'string' || effortDescriptions[value] === undefined)
178
+ throw catalogError('protocol');
179
+ return { id: value, name: displayEffort(value), description: effortDescriptions[value] };
180
+ });
181
+ if (new Set(efforts.map(effort => effort.id)).size !== efforts.length)
182
+ throw catalogError('protocol');
183
+ reasoning = { efforts };
184
+ }
185
+ else if (model.supportsEffort !== false && model.supportsEffort !== undefined) {
186
+ throw catalogError('protocol');
187
+ }
188
+ return {
189
+ id: model.value,
190
+ name: model.displayName,
191
+ ...(model.description.length === 0 ? {} : { description: model.description }),
192
+ ...(reasoning === undefined ? {} : { reasoning }),
193
+ inputModalities: ['text'],
194
+ };
195
+ }
196
+ function disambiguateClaudeModelNames(models) {
197
+ const counts = new Map();
198
+ for (const model of models)
199
+ counts.set(model.name, (counts.get(model.name) ?? 0) + 1);
200
+ return models.map(model => counts.get(model.name) === 1
201
+ ? model
202
+ : { ...model, name: `${displayEffort(model.id)} (${model.name})` });
203
+ }
204
+ function parseGrokModel(value) {
205
+ const model = jsonObject(value);
206
+ const meta = jsonObject(model?._meta);
207
+ if (typeof model?.modelId !== 'string' || model.modelId.length === 0
208
+ || typeof model.name !== 'string' || model.name.length === 0
209
+ || (model.description !== undefined && typeof model.description !== 'string')
210
+ || typeof meta?.supportsReasoningEffort !== 'boolean') {
211
+ throw catalogError('protocol');
212
+ }
213
+ let reasoning;
214
+ if (meta.supportsReasoningEffort) {
215
+ if (!Array.isArray(meta.reasoningEfforts) || meta.reasoningEfforts.length === 0
216
+ || typeof meta.reasoningEffort !== 'string') {
217
+ throw catalogError('protocol');
218
+ }
219
+ const efforts = meta.reasoningEfforts.map(value => {
220
+ const effort = jsonObject(value);
221
+ if (typeof effort?.id !== 'string' || effort.id.length === 0 || effort.value !== effort.id
222
+ || typeof effort.label !== 'string' || effort.label.length === 0
223
+ || (effort.description !== undefined && typeof effort.description !== 'string')) {
224
+ throw catalogError('protocol');
225
+ }
226
+ return {
227
+ id: effort.id,
228
+ name: effort.label,
229
+ ...(typeof effort.description === 'string' && effort.description.length > 0
230
+ ? { description: effort.description }
231
+ : {}),
232
+ };
233
+ });
234
+ if (new Set(efforts.map(effort => effort.id)).size !== efforts.length
235
+ || !efforts.some(effort => effort.id === meta.reasoningEffort)) {
236
+ throw catalogError('protocol');
237
+ }
238
+ reasoning = { efforts, defaultEffort: meta.reasoningEffort };
239
+ }
240
+ return {
241
+ id: model.modelId,
242
+ name: model.name,
243
+ ...(typeof model.description === 'string' && model.description.length > 0
244
+ ? { description: model.description }
245
+ : {}),
246
+ ...(reasoning === undefined ? {} : { reasoning }),
247
+ inputModalities: ['text'],
248
+ };
249
+ }
250
+ function parseJsonLines(value) {
251
+ const lines = value.split(/\r?\n/).filter(line => line.trim().length > 0);
252
+ if (lines.length === 0)
253
+ throw catalogError('protocol');
254
+ try {
255
+ return lines.map(line => JSON.parse(line));
256
+ }
257
+ catch {
258
+ throw catalogError('protocol');
259
+ }
260
+ }
261
+ function validateModels(models) {
262
+ if (models.length === 0 || new Set(models.map(model => model.id)).size !== models.length)
263
+ throw catalogError('protocol');
264
+ }
265
+ function displayEffort(value) {
266
+ return value.split(/[-_]/).map(part => part.length === 0 ? part : `${part[0].toUpperCase()}${part.slice(1)}`).join(' ');
267
+ }
268
+ function stripAnsi(value) {
269
+ const escape = String.fromCodePoint(0x1b);
270
+ return value.replace(new RegExp(`${escape}\\[[0-?]*[ -/]*[@-~]`, 'g'), '');
271
+ }
272
+ function jsonObject(value) {
273
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
274
+ ? value
275
+ : undefined;
276
+ }
277
+ function positiveInteger(value, fallback) {
278
+ if (value === undefined)
279
+ return fallback;
280
+ if (!Number.isSafeInteger(value) || value <= 0)
281
+ throw catalogError('protocol');
282
+ return value;
283
+ }
284
+ function catalogError(cause) {
285
+ return new Error(`subscription model catalog ${cause}`, { cause });
286
+ }
287
+ function abortError(signal) {
288
+ return signal.reason instanceof Error ? signal.reason : new Error('subscription model catalog aborted', { cause: 'abort' });
289
+ }
290
+ //# sourceMappingURL=subscription-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-catalog.js","sourceRoot":"","sources":["../src/subscription-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AA4DtC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AAC7C,MAAM,eAAe,GAAG,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