@sagmans/dsh-provider-extra 0.2.1 → 0.3.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 (2) hide show
  1. package/dist/index.js +16 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@
28
28
  */
29
29
  import Schema from '@deepseek-ai/schemastery';
30
30
  import { PiAiAdapter } from '@deepseek-ai/dsh-llm-pi-ai';
31
- import { LlmError, assertUsableApiKey } from '@deepseek-ai/dsh-llm';
31
+ import { LlmError, assertUsableApiKey, resolveImageAttachmentAccess } from '@deepseek-ai/dsh-llm';
32
32
  import { createModels } from '@earendil-works/pi-ai';
33
33
  import { builtinProviders } from '@earendil-works/pi-ai/providers/all';
34
34
  import { DEFAULT_EXTRA_MODEL_TEMPLATE, DEFAULT_OPENCODE_API_KEY_ENV, OPENCODE_GO_PROVIDER_ID, buildOpenCodeGoProfile, } from "./opencode-go.js";
@@ -158,6 +158,21 @@ export function apply(ctx, config) {
158
158
  // the request-level override (preferred over every store read), so the
159
159
  // harness-backed grant store serves Codex while changing nothing for it.
160
160
  auth: codexAuth(() => ctx.get('credentials')),
161
+ // Both routes carry images: history with a read_image result reaches this
162
+ // adapter as durable references, and pi-ai refuses the whole turn unless
163
+ // the composition's attachment store resolves their bytes here. The
164
+ // execution-world mapping is separately optional — a composition without
165
+ // the filesystem service still sends the image, only without the
166
+ // model-facing normalized-copy path.
167
+ resolveAttachments: () => ctx.get('attachments'),
168
+ resolveImageAccess: (attachments, ref) => resolveImageAttachmentAccess(attachments, hostPath => ctx.get('fs')?.processPathFromHostPath(hostPath), ref),
169
+ // A stored replay state the installed pi-ai cannot reconstruct already
170
+ // degrades to provider-neutral content; naming it keeps that downgrade
171
+ // diagnosable instead of silent.
172
+ onReplayDegrade: ({ provider, model, reason }) => {
173
+ ctx.logger.warn('dsh-provider-extra: unusable replay state on assistant history for route "'
174
+ + provider + '/' + model + '"; sending that message as provider-neutral content (' + reason + ')');
175
+ },
161
176
  });
162
177
  // A route another adapter already owns (opencode-go configured under
163
178
  // llm-pi-ai) must not brick the whole composition: the refusal names the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sagmans/dsh-provider-extra",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Extra LLM provider routes for DeepSeek Harness: OpenCode Go with per-session x-opencode-session routing, and OpenAI Codex over ChatGPT-subscription OAuth.",
5
5
  "keywords": [
6
6
  "deepseek-harness",