@eddyskywalker/dsh-chatgpt-subscription 0.30.0 → 0.32.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 (110) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +64 -1
  3. package/lib/client.js +34034 -2768
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +33214 -24259
  6. package/lib/types/client/cline-pass/ClinePassComposerQuota.d.ts +20 -0
  7. package/lib/types/client/cline-pass/ClinePassComposerQuota.d.ts.map +1 -0
  8. package/lib/types/client/cline-pass/ClinePassSection.d.ts +17 -0
  9. package/lib/types/client/cline-pass/ClinePassSection.d.ts.map +1 -0
  10. package/lib/types/client/cline-pass/api.d.ts +84 -0
  11. package/lib/types/client/cline-pass/api.d.ts.map +1 -0
  12. package/lib/types/client/cline-pass/locales.d.ts +1025 -0
  13. package/lib/types/client/cline-pass/locales.d.ts.map +1 -0
  14. package/lib/types/client/cline-pass/styles.d.ts +7 -0
  15. package/lib/types/client/cline-pass/styles.d.ts.map +1 -0
  16. package/lib/types/client/hub/brand-icons.d.ts +2 -2
  17. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  18. package/lib/types/client/hub/providers.d.ts.map +1 -1
  19. package/lib/types/client/index.d.ts +2 -0
  20. package/lib/types/client/index.d.ts.map +1 -1
  21. package/lib/types/client/mermaid/renderer.d.ts +23 -0
  22. package/lib/types/client/mermaid/renderer.d.ts.map +1 -1
  23. package/lib/types/client/minimax-code/MinimaxCodeSection.d.ts.map +1 -1
  24. package/lib/types/client/minimax-code/MinimaxVideoDocumentBody.d.ts +86 -0
  25. package/lib/types/client/minimax-code/MinimaxVideoDocumentBody.d.ts.map +1 -0
  26. package/lib/types/client/minimax-code/MinimaxVideoToolView.d.ts +83 -0
  27. package/lib/types/client/minimax-code/MinimaxVideoToolView.d.ts.map +1 -0
  28. package/lib/types/client/minimax-code/VideoFormDialog.d.ts +90 -0
  29. package/lib/types/client/minimax-code/VideoFormDialog.d.ts.map +1 -0
  30. package/lib/types/client/minimax-code/VideoSettingsSections.d.ts +73 -0
  31. package/lib/types/client/minimax-code/VideoSettingsSections.d.ts.map +1 -0
  32. package/lib/types/client/minimax-code/commands-contract.d.ts +35 -0
  33. package/lib/types/client/minimax-code/commands-contract.d.ts.map +1 -0
  34. package/lib/types/client/minimax-code/document-preview.d.ts +45 -0
  35. package/lib/types/client/minimax-code/document-preview.d.ts.map +1 -0
  36. package/lib/types/client/minimax-code/locales.d.ts +206 -2
  37. package/lib/types/client/minimax-code/locales.d.ts.map +1 -1
  38. package/lib/types/client/minimax-code/styles.d.ts.map +1 -1
  39. package/lib/types/client/minimax-code/video-command-host.d.ts +61 -0
  40. package/lib/types/client/minimax-code/video-command-host.d.ts.map +1 -0
  41. package/lib/types/client/minimax-code/video-command.d.ts +126 -0
  42. package/lib/types/client/minimax-code/video-command.d.ts.map +1 -0
  43. package/lib/types/client/minimax-code/video-contract.d.ts +208 -0
  44. package/lib/types/client/minimax-code/video-contract.d.ts.map +1 -0
  45. package/lib/types/client/minimax-code/video-defaults-store.d.ts +61 -0
  46. package/lib/types/client/minimax-code/video-defaults-store.d.ts.map +1 -0
  47. package/lib/types/client/minimax-code/video-form-rules.d.ts +288 -0
  48. package/lib/types/client/minimax-code/video-form-rules.d.ts.map +1 -0
  49. package/lib/types/client/minimax-code/video-media.d.ts +61 -0
  50. package/lib/types/client/minimax-code/video-media.d.ts.map +1 -0
  51. package/lib/types/client/minimax-code/video-slots.d.ts +140 -0
  52. package/lib/types/client/minimax-code/video-slots.d.ts.map +1 -0
  53. package/lib/types/client/progress-updates/markdown-lite.d.ts +19 -6
  54. package/lib/types/client/progress-updates/markdown-lite.d.ts.map +1 -1
  55. package/lib/types/host/antigravity/adapter.d.ts.map +1 -1
  56. package/lib/types/host/cline-pass/account-pool.d.ts +63 -0
  57. package/lib/types/host/cline-pass/account-pool.d.ts.map +1 -0
  58. package/lib/types/host/cline-pass/adapter.d.ts +49 -0
  59. package/lib/types/host/cline-pass/adapter.d.ts.map +1 -0
  60. package/lib/types/host/cline-pass/catalog.d.ts +49 -0
  61. package/lib/types/host/cline-pass/catalog.d.ts.map +1 -0
  62. package/lib/types/host/cline-pass/client.d.ts +118 -0
  63. package/lib/types/host/cline-pass/client.d.ts.map +1 -0
  64. package/lib/types/host/cline-pass/engine.d.ts +223 -0
  65. package/lib/types/host/cline-pass/engine.d.ts.map +1 -0
  66. package/lib/types/host/cline-pass/line.d.ts +55 -0
  67. package/lib/types/host/cline-pass/line.d.ts.map +1 -0
  68. package/lib/types/host/cline-pass/mapper.d.ts +112 -0
  69. package/lib/types/host/cline-pass/mapper.d.ts.map +1 -0
  70. package/lib/types/host/cline-pass/oauth.d.ts +134 -0
  71. package/lib/types/host/cline-pass/oauth.d.ts.map +1 -0
  72. package/lib/types/host/cline-pass/protocol.d.ts +186 -0
  73. package/lib/types/host/cline-pass/protocol.d.ts.map +1 -0
  74. package/lib/types/host/cline-pass/routes.d.ts +71 -0
  75. package/lib/types/host/cline-pass/routes.d.ts.map +1 -0
  76. package/lib/types/host/cline-pass/store.d.ts +97 -0
  77. package/lib/types/host/cline-pass/store.d.ts.map +1 -0
  78. package/lib/types/host/cline-pass/token-store.d.ts +168 -0
  79. package/lib/types/host/cline-pass/token-store.d.ts.map +1 -0
  80. package/lib/types/host/cline-pass/tools.d.ts +21 -0
  81. package/lib/types/host/cline-pass/tools.d.ts.map +1 -0
  82. package/lib/types/host/cline-pass/types.d.ts +168 -0
  83. package/lib/types/host/cline-pass/types.d.ts.map +1 -0
  84. package/lib/types/host/common/model-request-control.d.ts +1 -1
  85. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  86. package/lib/types/host/common/request-diagnostics.d.ts +1 -1
  87. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  88. package/lib/types/host/minimax-code/client.d.ts.map +1 -1
  89. package/lib/types/host/minimax-code/iso-bmff-duration.d.ts +84 -0
  90. package/lib/types/host/minimax-code/iso-bmff-duration.d.ts.map +1 -0
  91. package/lib/types/host/minimax-code/matrix-client.d.ts +168 -0
  92. package/lib/types/host/minimax-code/matrix-client.d.ts.map +1 -0
  93. package/lib/types/host/minimax-code/media-store.d.ts +153 -0
  94. package/lib/types/host/minimax-code/media-store.d.ts.map +1 -0
  95. package/lib/types/host/minimax-code/routes.d.ts.map +1 -1
  96. package/lib/types/host/minimax-code/video-history.d.ts +240 -0
  97. package/lib/types/host/minimax-code/video-history.d.ts.map +1 -0
  98. package/lib/types/host/minimax-code/video-submit-rules.d.ts +40 -0
  99. package/lib/types/host/minimax-code/video-submit-rules.d.ts.map +1 -0
  100. package/lib/types/host/minimax-code/video-tool.d.ts +757 -0
  101. package/lib/types/host/minimax-code/video-tool.d.ts.map +1 -0
  102. package/lib/types/host/progress-updates/index.d.ts +6 -0
  103. package/lib/types/host/progress-updates/index.d.ts.map +1 -1
  104. package/lib/types/host/progress-updates/projection.d.ts +214 -0
  105. package/lib/types/host/progress-updates/projection.d.ts.map +1 -0
  106. package/lib/types/index.d.ts +12 -0
  107. package/lib/types/index.d.ts.map +1 -1
  108. package/lib/types/shared/cline-pass-contracts.d.ts +267 -0
  109. package/lib/types/shared/cline-pass-contracts.d.ts.map +1 -0
  110. package/package.json +14 -4
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Static facts about the Cline Pass subscription and its gateway.
3
+ *
4
+ * The upstream is an OpenAI-compatible `chat/completions` endpoint
5
+ * (`https://api.cline.bot/api/v1`) that fronts several model providers. Routing
6
+ * is decided by that gateway, and the two pipelines it can use spell an upstream
7
+ * pin differently — see `protocol.ts`. Authentication is a static API key in
8
+ * `Authorization: Bearer`: there is no OAuth flow and no token expiry.
9
+ *
10
+ * The model table below is transcribed from the Cline Pass subscription list and
11
+ * the public `models.dev` catalog. It is a fallback, not a ceiling: a model the
12
+ * live catalog scan discovers is described by what that scan published, and a
13
+ * model this release has never heard of is adopted with conservative metadata
14
+ * rather than hidden.
15
+ */
16
+ import type { ClinePassPinMode } from '../../shared/cline-pass-contracts.ts';
17
+ export declare const PROVIDER_ID = "cline-pass";
18
+ export declare const PROVIDER_NAME = "Cline Pass";
19
+ /** Default gateway. Overridable per deployment and per account. */
20
+ export declare const DEFAULT_BASE_URL = "https://api.cline.bot/api/v1";
21
+ /** Public endpoint that lists subscription models without auth. */
22
+ export declare const RECOMMENDED_MODELS_URL = "https://api.cline.bot/api/v1/ai/cline/recommended-models";
23
+ /** The upstream gateway's own catalog: the only source naming reasoning levels. */
24
+ export declare const VERCEL_MODELS_URL = "https://ai-gateway.vercel.sh/v1/models";
25
+ /** The community model registry, a metadata backstop. */
26
+ export declare const MODELS_DEV_URL = "https://models.dev/api.json";
27
+ /** OpenRouter's public API, used only for direct-pipeline endpoint detail. */
28
+ export declare const OPENROUTER_API = "https://openrouter.ai/api/v1";
29
+ /** Authenticated sub-paths on the gateway. */
30
+ export declare const USAGE_LIMITS_PATH = "/users/me/plan/usage-limits";
31
+ export declare const PROFILE_PATH = "/users/me";
32
+ export declare const USAGE_PAGE_SIZE = 200;
33
+ export declare const USAGE_MAX_PAGES = 12;
34
+ /** Conservative context capacity for a model no catalog describes. */
35
+ export declare const DEFAULT_CONTEXT_WINDOW = 128000;
36
+ /**
37
+ * Per-request output budget when the caller states none.
38
+ *
39
+ * A budget, not a ceiling: the harness reserves it as completion room before it
40
+ * compacts, so this decides how much of the window stays available. 64k keeps
41
+ * the reserve far below the compaction ratio while leaving room for a
42
+ * tool-calling agent's longest turn.
43
+ */
44
+ export declare const DEFAULT_MAX_TOKENS = 64000;
45
+ /** Streams one account may keep open at once; `0` lifts the cap. */
46
+ export declare const DEFAULT_MAX_CONCURRENT_REQUESTS = 16;
47
+ /** Idle budget for one Cline Pass stream. */
48
+ export declare const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 300000;
49
+ /** Request-history rows retained in memory. */
50
+ export declare const DEFAULT_HISTORY_LIMIT = 100;
51
+ /**
52
+ * How long one account-level refusal keeps an account out of the pool.
53
+ *
54
+ * Only the two refusals that are about the ACCOUNT are listed: a transient 429
55
+ * is answered by the channel retry, and standing an account down for it would
56
+ * cost capacity the request never proved was gone.
57
+ */
58
+ export declare const POOL_COOLDOWN_MS: number;
59
+ export declare const AUTH_COOLDOWN_MS: number;
60
+ /** How many channels one model's list may hold. */
61
+ export declare const MAX_UPSTREAMS = 64;
62
+ /** How many channels one validation run tests concurrently. */
63
+ export declare const VALIDATE_CONCURRENCY = 5;
64
+ /** Reasoning levels the gateway accepts for every reasoning-capable model. */
65
+ export declare const REASONING_EFFORTS: readonly [{
66
+ readonly id: "none";
67
+ readonly name: "None";
68
+ readonly description: "No extra thinking; fastest and cheapest.";
69
+ }, {
70
+ readonly id: "minimal";
71
+ readonly name: "Minimal";
72
+ readonly description: "A bare minimum of reasoning.";
73
+ }, {
74
+ readonly id: "low";
75
+ readonly name: "Low";
76
+ readonly description: "Prefer for routine or latency-sensitive work.";
77
+ }, {
78
+ readonly id: "medium";
79
+ readonly name: "Medium";
80
+ readonly description: "A balanced amount of reasoning.";
81
+ }, {
82
+ readonly id: "high";
83
+ readonly name: "High";
84
+ readonly description: "More thorough reasoning for multi-step work.";
85
+ }, {
86
+ readonly id: "xhigh";
87
+ readonly name: "Extra high";
88
+ readonly description: "For difficult work that rewards more thinking.";
89
+ }, {
90
+ readonly id: "max";
91
+ readonly name: "Max";
92
+ readonly description: "Reserve for the hardest quality-first tasks.";
93
+ }];
94
+ export type ClinePassReasoningEffort = typeof REASONING_EFFORTS[number]['id'];
95
+ /** One published model entry. */
96
+ export interface ClinePassModelMeta {
97
+ name: string;
98
+ contextWindow: number;
99
+ maxTokens: number;
100
+ reasoning: boolean;
101
+ /** Levels this model offers; absent keeps the whole vocabulary. */
102
+ efforts?: readonly string[];
103
+ input: readonly string[];
104
+ }
105
+ /**
106
+ * Published metadata for the shipped Cline Pass models.
107
+ *
108
+ * `name` mirrors the provider's own label where one is published and falls back
109
+ * to the model id. `maxTokens` is the published output ceiling, used to clamp the
110
+ * configured request budget rather than taken as the budget itself.
111
+ */
112
+ export declare const MODEL_CATALOG: Readonly<Record<string, ClinePassModelMeta>>;
113
+ /** Subscriptions models current at release time; refreshed on demand. */
114
+ export declare const DEFAULT_MODELS: readonly string[];
115
+ /** Published entry for one model id, if the shipped table knows it. */
116
+ export declare function catalogEntry(model: string): ClinePassModelMeta | undefined;
117
+ /** One stored pin, as the settings file keeps it. */
118
+ export interface ClinePassPinSettings {
119
+ upstreams: string[];
120
+ exclude: string[];
121
+ pinMode: ClinePassPinMode;
122
+ sort: string;
123
+ }
124
+ /** The default pin: automatic routing, no exclusions. */
125
+ export declare function defaultPin(): ClinePassPinSettings;
126
+ /**
127
+ * One model as the live catalog describes it, after merging the shipped table,
128
+ * the last official scan and any per-model override.
129
+ */
130
+ export interface ClinePassModelInfo {
131
+ id: string;
132
+ displayName: string;
133
+ contextWindow: number;
134
+ maxTokens: number;
135
+ reasoning: boolean;
136
+ efforts: readonly string[];
137
+ input: readonly string[];
138
+ }
139
+ /** Connection facts one request is built from. */
140
+ export interface ClinePassConnection {
141
+ baseURL: string;
142
+ displayName: string;
143
+ models: ClinePassModelInfo[];
144
+ defaultContextWindow: number;
145
+ maxTokens: number;
146
+ streamIdleTimeoutMs: number;
147
+ maxConcurrentRequests: number;
148
+ pinSpelling: string;
149
+ }
150
+ /** One model's metadata as the last official scan published it. */
151
+ export interface ClinePassDiscoveredModel {
152
+ name?: string;
153
+ contextWindow?: number;
154
+ maxTokens?: number;
155
+ /** The seam vocabulary spelling (`models.dev`). */
156
+ input?: string[];
157
+ /** The upstream gateway's spelling. */
158
+ inputModalities?: string[];
159
+ reasoning?: boolean;
160
+ efforts?: string[];
161
+ }
162
+ /** The whole official scan: ids, per-model metadata, and the sources that answered. */
163
+ export interface ClinePassCatalogScan {
164
+ models: string[];
165
+ catalog: Record<string, ClinePassDiscoveredModel>;
166
+ sources: string[];
167
+ }
168
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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AAE,MAAM,CAAA;IACnB,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,mEAAmE;AACnE,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,uFAAuF;AACvF,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAA;IACjD,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB"}
@@ -1,5 +1,5 @@
1
1
  import { ConcurrencyGate } from './concurrency-gate.ts';
2
- export declare const CONTROLLED_PROVIDERS: readonly ["codex-chatgpt", "claude", "antigravity", "kimi-code", "minimax-code", "command-code", "workbuddy", "ollama", "glm-coding-plan", "step-code"];
2
+ export declare const CONTROLLED_PROVIDERS: readonly ["codex-chatgpt", "claude", "antigravity", "kimi-code", "minimax-code", "command-code", "workbuddy", "ollama", "glm-coding-plan", "step-code", "cline-pass"];
3
3
  export type ControlledProvider = typeof CONTROLLED_PROVIDERS[number];
4
4
  export interface ModelRequestLimits {
5
5
  /** Per credential limits, not guessed subscription entitlements. Zero disables. */
@@ -1 +1 @@
1
- {"version":3,"file":"model-request-control.d.ts","sourceRoot":"","sources":["../../../../src/host/common/model-request-control.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,eAAO,MAAM,oBAAoB,yJAA0J,CAAA;AAC3L,MAAM,MAAM,kBAAkB,GAAG,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAA;AACpE,MAAM,WAAW,kBAAkB;IACjC,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAA;IACvD,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,kBAAkB,CAqB/F;AAED,kGAAkG;AAClG,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAO9F;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,MAAM,EAAE,kBAAkB,CAAA;IAC1B,IAAI,CAAC,EAAE,eAAe,CAAA;CACvB;AAED,4FAA4F;AAC5F,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,OAAO,KAAK,EAAE,OAAO,EAAE,0BAA0B,GAAG,OAAO,KAAK,CAmErH"}
1
+ {"version":3,"file":"model-request-control.d.ts","sourceRoot":"","sources":["../../../../src/host/common/model-request-control.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,eAAO,MAAM,oBAAoB,uKAAwK,CAAA;AACzM,MAAM,MAAM,kBAAkB,GAAG,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAA;AACpE,MAAM,WAAW,kBAAkB;IACjC,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAA;IACvD,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,kBAAkB,CAqB/F;AAED,kGAAkG;AAClG,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAO9F;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,MAAM,EAAE,kBAAkB,CAAA;IAC1B,IAAI,CAAC,EAAE,eAAe,CAAA;CACvB;AAED,4FAA4F;AAC5F,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,OAAO,KAAK,EAAE,OAAO,EAAE,0BAA0B,GAAG,OAAO,KAAK,CAmErH"}
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * @module dsh-chatgpt-subscription/request-diagnostics
15
15
  */
16
- export declare const DIAGNOSTIC_PROVIDERS: readonly ["codex-chatgpt", "claude-subscription", "antigravity", "kimi-code", "minimax-code", "command-code", "workbuddy-subscription", "ollama", "claude", "workbuddy", "codex", "glm-coding-plan", "step-code"];
16
+ export declare const DIAGNOSTIC_PROVIDERS: readonly ["codex-chatgpt", "claude-subscription", "antigravity", "kimi-code", "minimax-code", "command-code", "workbuddy-subscription", "ollama", "claude", "workbuddy", "codex", "glm-coding-plan", "step-code", "cline-pass"];
17
17
  export type DiagnosticProviderId = (typeof DIAGNOSTIC_PROVIDERS)[number];
18
18
  export declare const KNOWN_WIRE_ENDPOINTS: readonly ["messages", "responses", "chat_completions", "generate_content", "stream_generate_content", "ollama_chat", "ollama_generate", "workbuddy_chat", "unknown"];
19
19
  export type KnownWireEndpoint = (typeof KNOWN_WIRE_ENDPOINTS)[number];
@@ -1 +1 @@
1
- {"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C;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAgBhE;AAiCD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,GAAE,MAAmB,GAAG,gBAAgB,GAAG,IAAI,CA8DvG;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,sBAAsB,EACnC,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;IACtB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAA;IAC9D;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CACtC,GACL,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CA2GlC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,sBAAsB,GAAG,IAAI,GAAG,kBAAkB,GAAG,IAAI,CAEzG;AAED,OAAO,EAAE,4BAA4B,EAAE,YAAY,EAAE,aAAa,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAA;AAC1I,YAAY,EAAE,iBAAiB,EAAE,CAAA"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * The smallest ISO BMFF duration reader this route needs, with no decoder.
3
+ *
4
+ * WHY IT EXISTS. A reference video must be sent to the generation service with
5
+ * its length in seconds beside it (docs/minimax-video-extended-spec.md section
6
+ * 4), and upstream reads that number out of the container itself rather than
7
+ * asking the caller for it - `readIsoBmffDurationSeconds` is the name of the
8
+ * upstream file too. A LOCAL reference video therefore owes the caller no
9
+ * `referenceVideoDurationSeconds` argument: this module supplies it.
10
+ *
11
+ * WHY IT IS NOT AFFMPEG. The number lives in exactly one box, `moov/mvhd`, at a
12
+ * fixed byte offset inside it. Reaching it is an eight-byte header walk, not a
13
+ * demux; pulling in a media toolchain (or a native binding) to read two integers
14
+ * would dwarf the rest of this plugin.
15
+ *
16
+ * THE TWO LAYOUTS, which is the whole reason the walk is written the way it is:
17
+ *
18
+ * | layout | box order | what a whole-file read would cost |
19
+ * | ------------- | -------------------- | --------------------------------- |
20
+ * | faststart | `ftyp moov mdat` | the moov is near the front |
21
+ * | ordinary mp4 | `ftyp mdat moov` | the moov is AFTER tens of megabytes |
22
+ *
23
+ * So the reader NEVER loads the file. It opens a handle, `stat`s the size, and
24
+ * seeks: it reads the eight-byte header of each TOP-LEVEL box only, jumps over a
25
+ * `mdat` by its declared size, and - once it lands on `moov` - reads that box's
26
+ * own child headers the same way until it finds `mvhd`, of which it keeps the
27
+ * last 32 bytes. A 500 MB clip costs a few dozen bytes of I/O.
28
+ *
29
+ * WHAT IT REFUSES, deliberately, instead of guessing:
30
+ * - a file that is not ISO BMFF at all (a WebM's EBML magic is not a box
31
+ * header) -> `MINIMAX_VIDEO_NOT_ISO_BMFF`;
32
+ * - a box header that runs past the end of its container, or a box smaller
33
+ * than its own header -> `MINIMAX_VIDEO_NOT_ISO_BMFF`;
34
+ * - an ISO BMFF file with no `moov`, no `mvhd`, or a `mvhd` too short to hold
35
+ * its own fields -> `MINIMAX_VIDEO_DURATION_UNREADABLE`;
36
+ * - a `timescale` of zero (the division has no answer) -> the same code;
37
+ * - `mvhd`'s documented "unknown duration" sentinels (all bits set) -> the
38
+ * same code, because reporting a made-up length is worse than refusing.
39
+ *
40
+ * Every refusal is an ERROR, never `undefined`: a caller that silently got no
41
+ * duration would send a reference video with no length, or `null`, and neither
42
+ * is a thing the service asked for.
43
+ *
44
+ * @module dsh-chatgpt-subscription/minimax-code/iso-bmff-duration
45
+ */
46
+ import { HarnessError } from '@deepseek-ai/dsh-llm';
47
+ /**
48
+ * Raised when a file's length cannot be read out of its ISO BMFF container.
49
+ *
50
+ * A `HarnessError` subclass rather than a bare `Error`, so the tool layer can
51
+ * hand its `code` straight to the caller without re-wrapping the message.
52
+ */
53
+ export declare class IsoBmffDurationError extends HarnessError {
54
+ constructor(message: string, code: string);
55
+ }
56
+ /**
57
+ * Read one mp4/mov file's length in seconds, without decoding a frame.
58
+ *
59
+ * The walk, in full:
60
+ *
61
+ * 1. `stat` the file - the size is the only bound needed, and nothing is read
62
+ * before it is known.
63
+ * 2. From offset 0, read each TOP-LEVEL box header and jump to the next one, so
64
+ * an `mdat` is skipped by arithmetic rather than by reading it. The first box
65
+ * must be one of {@link ISO_BMFF_LEADING_BOX_TYPES}, which is where a
66
+ * non-mp4 file is caught.
67
+ * 3. On `moov`, walk ITS direct children the same way until `mvhd` appears. A
68
+ * `trak` is skipped by size, exactly like `mdat`.
69
+ * 4. Read the first {@link MVHD_MAX_READ_BYTES} bytes of `mvhd` and divide
70
+ * `duration` by `timescale`.
71
+ *
72
+ * Both measured layouts work for the same reason: the walk is driven by the
73
+ * sizes the boxes declare, so it does not care whether `moov` came before or
74
+ * after the media data. Faststart files find it on the first or second hop; a
75
+ * camera/encoder file finds it after one seek over the entire `mdat`.
76
+ *
77
+ * @param filePath - absolute path to the file to read.
78
+ * @returns the clip length in seconds, as an exact ratio.
79
+ * @throws IsoBmffDurationError (a `HarnessError`) whenever the length cannot be
80
+ * established - a missing file, a non-ISO-BMFF file, a truncated box, a
81
+ * missing `moov`/`mvhd`, an unreadable `mvhd`, or a zero timescale.
82
+ */
83
+ export declare function readIsoBmffDurationSeconds(filePath: string): Promise<number>;
84
+ //# sourceMappingURL=iso-bmff-duration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iso-bmff-duration.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/iso-bmff-duration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,YAAY;gBACxC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAI1C;AAyOD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkFlF"}
@@ -0,0 +1,168 @@
1
+ /**
2
+ * The Matrix media gateway client for the MiniMax Code subscription.
3
+ *
4
+ * The Messages route (`{agentBase}/mavis/api/v1/llm/v1/messages`) carries the
5
+ * chat surface only. Everything else the subscription can do — video generation,
6
+ * video understanding, image and audio tools — lives behind a SECOND prefix on
7
+ * the SAME origin: `{agentBase}/mavis/api/v1/mcp/<tool>`. Nothing in
8
+ * ./client.ts reaches it, and this module is that missing half.
9
+ *
10
+ * Why the endpoint set is what it is (docs/minimax-video-design-spec.md section
11
+ * 3, and the live probe in scripts/probe-minimax-matrix-gateway.probe.ts):
12
+ *
13
+ * - the host is the AGENT host, not the API host. cn is `https://agent.minimax.cn`
14
+ * and global is `https://agent.minimax.io`, both already named by
15
+ * ./types.ts's REGION_HOSTS. `agent.minimaxi.com` is the CHECK-IN surface's
16
+ * host — the upstream tree spells it LEGACY (matrix-env.ts:28) — and pointing
17
+ * a media call at it would miss.
18
+ * - authentication is the subscription bearer and nothing else. The measured
19
+ * request carried exactly accept / authorization / content-type / user-agent
20
+ * and was answered HTTP 200 `base_resp.status_code: 0`. The `yy` /
21
+ * `x-timestamp` / `x-signature` triple belongs to the check-in surface, and
22
+ * `user_id` / `biz_id` / `request_sk` are gated on a non-prod build env and
23
+ * resolve to {} in prod, so none of them is sent here either.
24
+ *
25
+ * TWO FAILURE KINDS, and they are not the same verdict:
26
+ *
27
+ * - a BUSINESS failure is HTTP 200 with `base_resp.status_code !== 0` OR with a
28
+ * non-zero TOP-LEVEL `code`. Both are the service accepting the request,
29
+ * understanding it, and refusing it: retrying the same body asks the same
30
+ * question again and gets the same answer, so it is terminal. Upstream proves
31
+ * the same pair (packages/agent-tools/src/cloud/matrix-tools/client.ts:140-158)
32
+ * and a client that only reads the first one reports a refusal as a success.
33
+ * - a REQUEST failure is a non-2xx status. Which one it is (a refused
34
+ * credential, back-pressure, an overloaded gateway, a malformed body) is
35
+ * decided by {@link classifyMinimaxFailure}, which this line already uses for
36
+ * every other refusal it reports.
37
+ *
38
+ * The classification SHAPE is reused rather than reinvented: `code`,
39
+ * `message`, `retryable`, `accountScoped`. A caller that reads a verdict from
40
+ * the Messages route and a caller that reads one from here must not have to
41
+ * know which surface produced it.
42
+ *
43
+ * @module dsh-chatgpt-subscription/minimax-code/matrix-client
44
+ */
45
+ import { HarnessError } from '@deepseek-ai/dsh-llm';
46
+ import type { MinimaxCodeRegion } from '../../shared/minimax-code-contracts.ts';
47
+ import { type MinimaxFailureClassification } from './adapter.ts';
48
+ /** Prefix every Matrix media tool hangs off. */
49
+ export declare const MATRIX_API_PREFIX = "/mavis/api/v1/mcp";
50
+ /**
51
+ * User agent the gateway was measured to accept.
52
+ *
53
+ * NOT the package's own product token (./types.ts USER_AGENT). A media call is
54
+ * a first-party-client surface rather than an LLM endpoint, and the measured
55
+ * shape sent this literal; the note in ./types.ts about not impersonating the
56
+ * official app is about the TELEMETRY headers (`yy` and friends), which are
57
+ * still never sent.
58
+ */
59
+ export declare const MATRIX_USER_AGENT = "MiniMaxAgent";
60
+ /** Default per-call time budget, matching the upstream media-tool timeout table. */
61
+ export declare const MATRIX_DEFAULT_TIMEOUT_MS = 120000;
62
+ /** Path segment of the video-understanding tool. */
63
+ export declare const MATRIX_TOOL_VIDEOS_UNDERSTAND = "videos_understand";
64
+ /** Path segment of the async video-generation submit tool. */
65
+ export declare const MATRIX_TOOL_SUBMIT_VIDEO = "submit_video_generation";
66
+ /** Path segment of the async video-generation query tool. */
67
+ export declare const MATRIX_TOOL_QUERY_VIDEO = "query_video_generation";
68
+ /** Path segment of the presigned-upload broker. */
69
+ export declare const MATRIX_TOOL_GET_UPLOAD_URL = "get_upload_url";
70
+ type FetchLike = typeof fetch;
71
+ /**
72
+ * The Matrix media route for one region and tool.
73
+ *
74
+ * @param region - subscription region (`cn` or `global`).
75
+ * @param tool - tool path segment, e.g. `videos_understand`.
76
+ * @returns the absolute endpoint URL.
77
+ */
78
+ export declare function matrixToolUrl(region: MinimaxCodeRegion, tool: string): string;
79
+ /**
80
+ * The complete header set of one Matrix request: exactly four entries.
81
+ *
82
+ * Kept as a function of the token alone so a test can assert the absence of the
83
+ * check-in surface's signature headers and the routing headers by name, rather
84
+ * than trusting that nobody added one later.
85
+ *
86
+ * @param accessToken - subscription access token.
87
+ * @returns the four headers, in the measured spelling.
88
+ */
89
+ export declare function matrixRequestHeaders(accessToken: string): Record<string, string>;
90
+ /**
91
+ * One settled Matrix call.
92
+ *
93
+ * `body` is the parsed JSON envelope with `base_resp` still on it, so a caller
94
+ * can read `status_msg` when it needs the service's own wording. Payload fields
95
+ * sit at the TOP level of that envelope on every tool this line has read.
96
+ *
97
+ * The one top-level key that is NOT a payload field is `code`: it is the
98
+ * envelope's second status code, already proven zero by the time a response is
99
+ * returned (see {@link businessStatusOf}).
100
+ */
101
+ export interface MatrixToolResponse {
102
+ /** The tool the call named. */
103
+ readonly tool: string;
104
+ /** HTTP status of the answer. */
105
+ readonly status: number;
106
+ /** Parsed JSON object body. */
107
+ readonly body: Record<string, unknown>;
108
+ }
109
+ /** One Matrix failure, carrying the verdict the rest of the line speaks. */
110
+ export declare class MatrixToolError extends HarnessError {
111
+ /** The reused classification: `code`/`message`/`retryable`/`accountScoped`. */
112
+ readonly classification: MinimaxFailureClassification;
113
+ /** HTTP status when there was one; undefined for a transport failure. */
114
+ readonly status: number | undefined;
115
+ /** The tool the failing call named. */
116
+ readonly tool: string;
117
+ constructor(message: string, code: string, classification: MinimaxFailureClassification, tool: string, status?: number);
118
+ }
119
+ /** Error code for a business refusal (HTTP 200, `base_resp.status_code !== 0`). */
120
+ export declare const MATRIX_BUSINESS_ERROR_CODE = "MINIMAX_MATRIX_BUSINESS_ERROR";
121
+ /** Error code for a non-2xx answer. */
122
+ export declare const MATRIX_HTTP_ERROR_CODE = "MINIMAX_MATRIX_HTTP_ERROR";
123
+ /** Error code for a request that never produced a response. */
124
+ export declare const MATRIX_TRANSPORT_ERROR_CODE = "MINIMAX_MATRIX_TRANSPORT_ERROR";
125
+ /** Error code for a call that outlived its budget. */
126
+ export declare const MATRIX_TIMEOUT_ERROR_CODE = "MINIMAX_MATRIX_TIMEOUT";
127
+ /** Options for {@link callMatrixTool}. */
128
+ export interface CallMatrixToolOptions {
129
+ /** Subscription region; decides which agent host is used. */
130
+ readonly region: MinimaxCodeRegion;
131
+ /** Subscription access token (bearer). */
132
+ readonly accessToken: string;
133
+ /** Tool path segment, e.g. `videos_understand`. */
134
+ readonly tool: string;
135
+ /** JSON request body. */
136
+ readonly body: Record<string, unknown>;
137
+ /** Injected fetch, so tests never touch the network. */
138
+ readonly fetchFn?: FetchLike;
139
+ /** Caller cancellation. */
140
+ readonly signal?: AbortSignal;
141
+ /** Per-call budget; defaults to {@link MATRIX_DEFAULT_TIMEOUT_MS}. */
142
+ readonly timeoutMs?: number;
143
+ }
144
+ /**
145
+ * Call one Matrix media tool and return its parsed envelope.
146
+ *
147
+ * @param options - region, credential, tool, body and the injectable transport.
148
+ * @returns the parsed envelope, with the business status already proven zero.
149
+ * @throws MatrixToolError for a business refusal, a non-2xx answer, a transport
150
+ * failure, or a timeout. Every one carries a reused classification.
151
+ */
152
+ export declare function callMatrixTool(options: CallMatrixToolOptions): Promise<MatrixToolResponse>;
153
+ /**
154
+ * Read one payload field out of an envelope, trying the shapes this gateway
155
+ * has been observed to use.
156
+ *
157
+ * Top level first — that is where every measured tool puts its payload — then
158
+ * `data` and `result` for a tool that nests it. Undefined when none of them
159
+ * carries the key, so the caller refuses rather than reading a missing field as
160
+ * an empty string.
161
+ *
162
+ * @param body - the parsed envelope.
163
+ * @param key - the field name the tool documents.
164
+ * @returns the value, whatever it is, or undefined.
165
+ */
166
+ export declare function matrixPayloadField(body: Record<string, unknown>, key: string): unknown;
167
+ export {};
168
+ //# sourceMappingURL=matrix-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix-client.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/matrix-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,OAAO,EAA0B,KAAK,4BAA4B,EAAE,MAAM,cAAc,CAAA;AAIxF,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,sBAAsB,CAAA;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,iBAAiB,CAAA;AAE/C,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,SAAU,CAAA;AAEhD,oDAAoD;AACpD,eAAO,MAAM,6BAA6B,sBAAsB,CAAA;AAChE,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,4BAA4B,CAAA;AACjE,6DAA6D;AAC7D,eAAO,MAAM,uBAAuB,2BAA2B,CAAA;AAC/D,mDAAmD;AACnD,eAAO,MAAM,0BAA0B,mBAAmB,CAAA;AAE1D,KAAK,SAAS,GAAG,OAAO,KAAK,CAAA;AAE7B;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EA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CAAC,EAAE,SAAS,CAAA;IAC5B,2BAA2B;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AA8DD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA8GhG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAOtF"}
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Where a generated video is written, and how the path it gets is derived.
3
+ *
4
+ * WHY THE SESSION WORKSPACE AND NOT A PRIVATE DIRECTORY. The sidebar's video
5
+ * preview is a DOCUMENT preview: it renders a file the workspace can address,
6
+ * because that is what the preview registry is keyed on. A clip parked in
7
+ * `$DSH_HOME/storages/...` — which is where the Kimi line's attachment store
8
+ * lives — is invisible to that surface: the tool would report success and the
9
+ * user would have no player to open it in. So the bytes land in the session's
10
+ * own working directory, and this module's whole job is to do that without
11
+ * letting a caller name a path.
12
+ *
13
+ * HOW THE ROOT IS RESOLVED (the answer to "what can a tool actually see here"):
14
+ *
15
+ * 1. `ctx.get('workingDirectory')` then `ensure(agent, signal)` — the same call
16
+ * the harness itself makes. `packages/core/tools/src/index.ts:949-956` uses
17
+ * it to capture `run_code`'s cwd, and `packages/deliverables/tool-present/
18
+ * src/index.ts:82` uses it to resolve the directory `present` addresses.
19
+ * It is the CURRENT directory, which is what a user means by "the
20
+ * workspace" after they change it mid-session.
21
+ * 2. `agent.session.header.cwd` — `packages/core/session/src/types.ts:106`
22
+ * documents it as "Absolute working directory the session was created in".
23
+ * This is the fallback when the working-directory service is not composed
24
+ * (a headless host), and it is a plain field, so reading it cannot fail.
25
+ * 3. Neither: the call FAILS. There is deliberately no third fallback to a
26
+ * plugin-owned directory, because the product contract is that the file is
27
+ * reachable from the workspace; silently writing somewhere else would report
28
+ * a success the user cannot open. The error names both remedies.
29
+ *
30
+ * The host's own workspace-file scope agrees with the same decision:
31
+ * `packages/api/workspace-files/src/index.ts:218` resolves a session's root as
32
+ * `header.cwd ?? scope.sandboxPolicy.workspaceRoot`, i.e. the header first.
33
+ *
34
+ * @module dsh-chatgpt-subscription/minimax-code/media-store
35
+ */
36
+ import { HarnessError } from '@deepseek-ai/dsh-llm';
37
+ /**
38
+ * Largest single generated video this route will write.
39
+ *
40
+ * A 15-second 2K H3 clip is a few tens of megabytes, so 200 MB is not a
41
+ * prediction of the output size — it is the ceiling that stops a runaway
42
+ * download (a wrong URL that streams an ISO, a redirect to something huge) from
43
+ * filling the user's disk. Nothing legitimate comes near it.
44
+ */
45
+ export declare const MAX_GENERATED_VIDEO_BYTES: number;
46
+ /** Directory, under the workspace root, that generated videos land in. */
47
+ export declare const GENERATED_VIDEO_DIR = "minimax-videos";
48
+ /** Raised when a write cannot produce a usable workspace path. */
49
+ export declare class MediaStoreError extends HarnessError {
50
+ constructor(message: string, code: string);
51
+ }
52
+ /** The one place a generated video may be written, and how to name it. */
53
+ export interface MediaStoreTarget {
54
+ /** Absolute workspace root. */
55
+ readonly root: string;
56
+ /** Absolute directory the file is written into. */
57
+ readonly directory: string;
58
+ /**
59
+ * Whether the root came from the working-directory service (true) or from
60
+ * the session header (false). Reported so a caller can tell a live directory
61
+ * from the creation-time one.
62
+ */
63
+ readonly fromWorkingDirectory: boolean;
64
+ }
65
+ /**
66
+ * The least a tool execution must expose for {@link resolveMediaStoreTarget}.
67
+ *
68
+ * Structural rather than the registry's own `ToolRunContext` so a test can
69
+ * hand in a plain object; every field is optional because a tool is also
70
+ * executed by tooling that composes no agent at all.
71
+ */
72
+ export interface MediaStoreExec {
73
+ readonly signal?: AbortSignal;
74
+ readonly agent?: {
75
+ readonly session?: {
76
+ readonly header?: {
77
+ readonly cwd?: string;
78
+ };
79
+ };
80
+ };
81
+ }
82
+ /** The part of the harness `workingDirectory` service this module reads. */
83
+ export interface WorkingDirectoryLookup {
84
+ ensure(agent: unknown, signal?: AbortSignal): Promise<string>;
85
+ }
86
+ /**
87
+ * The session's current working directory, or undefined when nothing can name
88
+ * one.
89
+ *
90
+ * @param ctx - anything with a `get` that returns the harness services.
91
+ * @param exec - the tool execution naming the agent and its cancellation.
92
+ * @returns an absolute directory, or undefined.
93
+ */
94
+ export declare function resolveSessionRoot(ctx: {
95
+ get(name: string): unknown;
96
+ }, exec: MediaStoreExec): Promise<{
97
+ root: string;
98
+ fromWorkingDirectory: boolean;
99
+ } | undefined>;
100
+ /**
101
+ * Resolve where a generated video will be written for one execution.
102
+ *
103
+ * @param ctx - host context, for the working-directory service.
104
+ * @param exec - the tool execution.
105
+ * @returns the resolved target.
106
+ * @throws MediaStoreError when no workspace directory can be named at all.
107
+ */
108
+ export declare function resolveMediaStoreTarget(ctx: {
109
+ get(name: string): unknown;
110
+ }, exec: MediaStoreExec): Promise<MediaStoreTarget>;
111
+ /**
112
+ * A filesystem-safe file name derived from values this module controls.
113
+ *
114
+ * Every part is generated here — a timestamp, the task id the service issued and
115
+ * a fixed extension — and everything outside `[A-Za-z0-9._-]` is replaced, so a
116
+ * task id carrying a separator cannot climb out of the directory. The caller
117
+ * never supplies a path, which is what makes path traversal impossible rather
118
+ * than merely filtered.
119
+ *
120
+ * @param taskId - upstream task id (or an equivalent generated identity).
121
+ * @param extension - leading-dot extension, e.g. `.mp4`.
122
+ * @param now - clock, injected so a test can pin the name.
123
+ * @returns a leaf file name with no directory component.
124
+ */
125
+ export declare function generatedVideoFileName(taskId: string, extension: string, now?: number): string;
126
+ /** A file extension for one media type, defaulting to .mp4. */
127
+ export declare function extensionForMediaType(mediaType: string): string;
128
+ /** Result of one committed write. */
129
+ export interface StoredVideo {
130
+ /** Path relative to the workspace root, always POSIX-separated. */
131
+ readonly relativePath: string;
132
+ /** Absolute path on this machine. */
133
+ readonly absolutePath: string;
134
+ /** Exact byte length written. */
135
+ readonly bytes: number;
136
+ }
137
+ /**
138
+ * Write one generated video into the workspace.
139
+ *
140
+ * @param target - the resolved target from {@link resolveMediaStoreTarget}.
141
+ * @param data - the complete video bytes.
142
+ * @param taskId - upstream task id, used to derive the file name.
143
+ * @param mediaType - media type the response declared, for the extension.
144
+ * @param now - clock, injected for a pinned test name.
145
+ * @returns the workspace-relative path and its absolute counterpart.
146
+ * @throws MediaStoreError for an empty or oversized payload.
147
+ */
148
+ export declare function writeGeneratedVideo(target: MediaStoreTarget, data: Uint8Array, options: {
149
+ taskId: string;
150
+ mediaType: string;
151
+ now?: number;
152
+ }): Promise<StoredVideo>;
153
+ //# sourceMappingURL=media-store.d.ts.map