dsh-workbuddy-connect 0.6.1 → 0.6.2

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.
package/lib/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { D as WorkBuddyUpstreamClient, E as WorkBuddyAtRestKeyProvider, Y as resolveAppVersion, b as WorkBuddyCredentialStore, f as WORKBUDDY_CONNECT_VERSION, g as FALLBACK_WORKBUDDY_MODELS, h as FALLBACK_WORKBUDDY_AI_MODELS, i as variantFor, l as readHostHeartbeat, n as CN_VARIANT, r as WORKBUDDY_VARIANTS, s as isHeartbeatProcessAlive, u as workbuddyHostHeartbeatPath } from "./variants-Cdp_ii6z.js";
2
+ import { D as WorkBuddyUpstreamClient, E as WorkBuddyAtRestKeyProvider, Y as resolveAppVersion, b as WorkBuddyCredentialStore, f as WORKBUDDY_CONNECT_VERSION, g as FALLBACK_WORKBUDDY_MODELS, h as FALLBACK_WORKBUDDY_AI_MODELS, i as variantFor, l as readHostHeartbeat, n as CN_VARIANT, r as WORKBUDDY_VARIANTS, s as isHeartbeatProcessAlive, u as workbuddyHostHeartbeatPath } from "./variants-B3Pa4EBr.js";
3
3
  import { realpathSync } from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  //#region src/bin.ts
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
2
  import "@earendil-works/pi-ai";
3
- import { PiAiAdapter } from "@deepseek-ai/dsh-llm-pi-ai";
3
+ import { PiAiAdapter, PiAiAdapterOptions } from "@deepseek-ai/dsh-llm-pi-ai";
4
4
  import { Context } from "@deepseek-ai/cordis";
5
5
  import { SettingsNamespace } from "@deepseek-ai/dsh-settings";
6
6
  import { AttachmentStore } from "@deepseek-ai/dsh-attachment";
@@ -1206,6 +1206,8 @@ interface WorkBuddyAdapterOptions {
1206
1206
  catalog: WorkBuddyCatalog;
1207
1207
  /** Resolve the durable attachment service at request time, when present. */
1208
1208
  resolveAttachments?: () => AttachmentStore | undefined;
1209
+ /** Resolve one image's path in the current model-tool execution world. */
1210
+ resolveImageAccess?: NonNullable<PiAiAdapterOptions['resolveImageAccess']>;
1209
1211
  /**
1210
1212
  * Look up a local probe observation for a model. Consulted only for rows the
1211
1213
  * upstream left undeclared; absent means declared-set-only behavior.
package/lib/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { A as normalizeCredits, B as chatUserAgent, C as desktopAuthCandidatesFor, D as WorkBuddyUpstreamClient, E as WorkBuddyAtRestKeyProvider, F as PROBE_EFFORT_CANDIDATES, G as WORKBUDDY_APP_VERSION_FILENAME, H as readCliVersion, I as probeModel, J as readBundleVersion, K as appUserAgent, L as randomSentinel, M as prepareChatBody, N as prepareInternationalChatBody, O as classifyUpstreamError, P as regionOf, R as CN_APP_VERSION_FILENAME, S as defaultDesktopAuthPath, T as workbuddyOwnAuthPath, U as resolveChatIdentity, V as fallbackChatIdentity, W as validCliVersion, X as validAppVersion, Y as resolveAppVersion, _ as WorkBuddyCatalog, a as WORKBUDDY_HOST_HEARTBEAT_FILENAME, b as WorkBuddyCredentialStore, c as processStartTimeMs, d as writeHostHeartbeat, f as WORKBUDDY_CONNECT_VERSION, g as FALLBACK_WORKBUDDY_MODELS, h as FALLBACK_WORKBUDDY_AI_MODELS, i as variantFor, j as parseModelCatalog, k as modelWithCurrentPromotion, l as readHostHeartbeat, n as CN_VARIANT, o as clearHostHeartbeat, q as installedAppVersion, r as WORKBUDDY_VARIANTS, s as isHeartbeatProcessAlive, t as AI_VARIANT, u as workbuddyHostHeartbeatPath, v as WORKBUDDY_AUTH_FILENAME, w as parseWorkBuddyAuth, x as defaultDesktopAuthCandidates, y as WORKBUDDY_AUTH_FILE_ENV, z as FALLBACK_CN_APP_VERSION } from "./variants-Cdp_ii6z.js";
1
+ import { A as normalizeCredits, B as chatUserAgent, C as desktopAuthCandidatesFor, D as WorkBuddyUpstreamClient, E as WorkBuddyAtRestKeyProvider, F as PROBE_EFFORT_CANDIDATES, G as WORKBUDDY_APP_VERSION_FILENAME, H as readCliVersion, I as probeModel, J as readBundleVersion, K as appUserAgent, L as randomSentinel, M as prepareChatBody, N as prepareInternationalChatBody, O as classifyUpstreamError, P as regionOf, R as CN_APP_VERSION_FILENAME, S as defaultDesktopAuthPath, T as workbuddyOwnAuthPath, U as resolveChatIdentity, V as fallbackChatIdentity, W as validCliVersion, X as validAppVersion, Y as resolveAppVersion, _ as WorkBuddyCatalog, a as WORKBUDDY_HOST_HEARTBEAT_FILENAME, b as WorkBuddyCredentialStore, c as processStartTimeMs, d as writeHostHeartbeat, f as WORKBUDDY_CONNECT_VERSION, g as FALLBACK_WORKBUDDY_MODELS, h as FALLBACK_WORKBUDDY_AI_MODELS, i as variantFor, j as parseModelCatalog, k as modelWithCurrentPromotion, l as readHostHeartbeat, n as CN_VARIANT, o as clearHostHeartbeat, q as installedAppVersion, r as WORKBUDDY_VARIANTS, s as isHeartbeatProcessAlive, t as AI_VARIANT, u as workbuddyHostHeartbeatPath, v as WORKBUDDY_AUTH_FILENAME, w as parseWorkBuddyAuth, x as defaultDesktopAuthCandidates, y as WORKBUDDY_AUTH_FILE_ENV, z as FALLBACK_CN_APP_VERSION } from "./variants-B3Pa4EBr.js";
2
2
  import z from "@deepseek-ai/schemastery";
3
+ import { resolveImageAttachmentAccess, resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
3
4
  import { dirname, join, resolve } from "node:path";
4
5
  import { resolveDshHome } from "@deepseek-ai/dsh-home-paths";
5
6
  import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
6
7
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
7
8
  import { createProvider } from "@earendil-works/pi-ai";
8
9
  import { openAICompletionsApi } from "@earendil-works/pi-ai/api/openai-completions.lazy";
9
- import { resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
10
10
  import { PiAiAdapter } from "@deepseek-ai/dsh-llm-pi-ai";
11
11
  import { createServer } from "node:http";
12
12
  import { Readable } from "node:stream";
@@ -328,6 +328,7 @@ const NO_COST = {
328
328
  */
329
329
  function withLegacyImageBudget(store) {
330
330
  return new Proxy(store, { get(target, property, receiver) {
331
+ if (property === "imageHostPath") return target.imageHostPath.bind(target);
331
332
  if (property !== "readImageRequest") return Reflect.get(target, property, receiver);
332
333
  return (...args) => {
333
334
  const [ref, policy, signal] = args;
@@ -458,7 +459,7 @@ function toPiModel(info, baseUrl, observed, providerId = WORKBUDDY_PROVIDER) {
458
459
  * `modelErrors` since 0.1.5-alpha.2 (#12).
459
460
  */
460
461
  function createWorkBuddyAdapter(options) {
461
- const { shim, store, catalog, resolveAttachments, observe, hidden } = options;
462
+ const { shim, store, catalog, resolveAttachments, resolveImageAccess, observe, hidden } = options;
462
463
  const providerId = options.providerId ?? "workbuddy";
463
464
  const displayName = options.displayName ?? "WorkBuddy";
464
465
  const buildModels = () => {
@@ -503,7 +504,8 @@ function createWorkBuddyAdapter(options) {
503
504
  ...resolveAttachments === void 0 ? {} : { resolveAttachments: () => {
504
505
  const store = resolveAttachments();
505
506
  return store === void 0 ? void 0 : withLegacyImageBudget(store);
506
- } }
507
+ } },
508
+ ...resolveImageAccess === void 0 ? {} : { resolveImageAccess }
507
509
  }),
508
510
  invalidate: () => {
509
511
  profiles = /* @__PURE__ */ new Map([[providerId, profile]]);
@@ -1707,6 +1709,7 @@ async function startVariant(ctx, runtime) {
1707
1709
  store,
1708
1710
  catalog,
1709
1711
  resolveAttachments: () => ctx.get("attachments"),
1712
+ resolveImageAccess: (attachments, ref) => resolveImageAttachmentAccess(attachments, (hostPath) => ctx.get("fs")?.processPathFromHostPath(hostPath), ref),
1710
1713
  observe: (modelId) => probeService.recordFor(modelId),
1711
1714
  hidden: () => {
1712
1715
  const account = runtime.account();
@@ -3229,7 +3229,7 @@ const WORKBUDDY_AI_STATUS_PATH = "/plugins/dsh-workbuddy-connect/ai/status";
3229
3229
  const WORKBUDDY_AI_PROBE_PATH = "/plugins/dsh-workbuddy-connect/ai/probe";
3230
3230
  //#endregion
3231
3231
  //#region src/version.ts
3232
- const WORKBUDDY_CONNECT_VERSION = "0.6.1";
3232
+ const WORKBUDDY_CONNECT_VERSION = "0.6.2";
3233
3233
  //#endregion
3234
3234
  //#region src/host-heartbeat.ts
3235
3235
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-workbuddy-connect",
3
3
  "displayName": "DSH WorkBuddy Connect",
4
4
  "description": "将 WorkBuddy 桌面 App 包含的模型自动接入 DeepSeek Harness — bring WorkBuddy desktop app models into DeepSeek Harness with zero configuration.",
5
- "version": "0.6.1",
5
+ "version": "0.6.2",
6
6
  "author": "corrinehu",
7
7
  "keywords": [
8
8
  "dsh-plugin",