@zoraxylia/dsh-codex-adapter 0.1.3 → 0.1.4
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/.claude-plugin/plugin.json +1 -1
- package/lib/server.mjs +3 -2
- package/package.json +1 -1
- package/src/hub/index.mjs +19 -4
- package/src/server.mjs +10 -3
package/lib/server.mjs
CHANGED
|
@@ -15059,7 +15059,7 @@ function describeBindings(config = {}) {
|
|
|
15059
15059
|
}
|
|
15060
15060
|
|
|
15061
15061
|
// src/server.mjs
|
|
15062
|
-
var server = new McpServer({ name: "dsh-adapter", version: "0.1.
|
|
15062
|
+
var server = new McpServer({ name: "dsh-adapter", version: "0.1.4" });
|
|
15063
15063
|
var tierSchema = external_exports.enum(["flash", "pro"]).optional().describe("Worker model tier. flash = mechanical, well-scoped work (single-file edits, lookups, formatting); pro = multi-file changes, debugging, design judgment. Omit to use the session default. Ignored when worker= is set.");
|
|
15064
15064
|
var effortSchema = external_exports.enum(["off", "high", "max"]).optional().describe("Reasoning effort for the worker. Omit to use the session default. With worker= it only applies when passed explicitly and the profile supports it (agy maps to low/medium/high).");
|
|
15065
15065
|
var workerSchema = external_exports.string().optional().describe('Named CLI worker profile (e.g. "agy" or "grok"). Explicit opt-in only: set it when the user explicitly asks for that external coding CLI, never as a default. When set, dispatch bypasses tier/mode and runs the task through that CLI; the profile pins backend\xD7model\xD7effort. See dsh_worker_config output, worker_profiles field, for the available profiles.');
|
|
@@ -15087,7 +15087,8 @@ var sessionConfig = {
|
|
|
15087
15087
|
origin_depth_limit: DEFAULT_ORIGIN_DEPTH_LIMIT
|
|
15088
15088
|
};
|
|
15089
15089
|
function bindingForTier(tier) {
|
|
15090
|
-
|
|
15090
|
+
const pinned = [sessionConfig[`${tier}_provider`], sessionConfig[`${tier}_model`]].some((v) => typeof v === "string" && v.trim() !== "");
|
|
15091
|
+
return pinned ? resolveTierBinding(tier, sessionConfig) : {};
|
|
15091
15092
|
}
|
|
15092
15093
|
function presetForTier(tier) {
|
|
15093
15094
|
const p = tier === "flash" ? sessionConfig.preset_flash : sessionConfig.preset_pro;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoraxylia/dsh-codex-adapter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/hub/index.mjs",
|
|
6
6
|
"description": "DeepSeek Harness plugin: dispatch work to DSH agents from Claude Code / Codex, as native subagents with live progress",
|
package/src/hub/index.mjs
CHANGED
|
@@ -437,18 +437,33 @@ export async function apply(ctx) {
|
|
|
437
437
|
// hub_url goes stale after each restart and the host-side MCP shim falls
|
|
438
438
|
// back to standalone mode. Publish this instance's origin into the shared
|
|
439
439
|
// config instead; a hub_url that names another machine is left untouched.
|
|
440
|
+
const originOf = () => {
|
|
441
|
+
try {
|
|
442
|
+
const value = webServer.getOrigin?.();
|
|
443
|
+
if (typeof value === 'string' && value) return value;
|
|
444
|
+
} catch { /* listener not bound yet */ }
|
|
445
|
+
try {
|
|
446
|
+
const port = webServer.port;
|
|
447
|
+
if (Number.isInteger(port) && port > 0) return 'http://127.0.0.1:' + port;
|
|
448
|
+
} catch { /* port accessor unavailable */ }
|
|
449
|
+
return undefined;
|
|
450
|
+
};
|
|
440
451
|
const syncHubUrl = (attempt = 0) => {
|
|
452
|
+
const origin = originOf();
|
|
453
|
+
if (!origin) {
|
|
454
|
+
// The listener can bind well after plugins apply; keep trying quietly.
|
|
455
|
+
if (attempt < 15) { setTimeout(() => syncHubUrl(attempt + 1), 2000).unref?.(); return; }
|
|
456
|
+
ctx.logger?.warn?.('dsh-adapter: hub_url sync gave up waiting for the listener');
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
441
459
|
try {
|
|
442
|
-
const origin = webServer.getOrigin?.();
|
|
443
460
|
const current = readGlobalConfig();
|
|
444
461
|
const isLocal = /^https?:\/\/(127\.0\.0\.1|localhost|\[::1\]):\d+$/.test(current.hub_url ?? '');
|
|
445
|
-
if (
|
|
462
|
+
if ((!current.hub_url || isLocal) && current.hub_url !== origin) {
|
|
446
463
|
writeGlobalConfig({ hub_url: origin });
|
|
447
464
|
ctx.logger?.info?.('dsh-adapter: hub_url synced to ' + origin);
|
|
448
465
|
}
|
|
449
466
|
} catch (err) {
|
|
450
|
-
// getOrigin() throws until the listener is bound; retry briefly.
|
|
451
|
-
if (attempt < 3) { setTimeout(() => syncHubUrl(attempt + 1), 1500).unref?.(); return; }
|
|
452
467
|
ctx.logger?.warn?.('dsh-adapter: hub_url sync skipped: ' + (err?.message ?? err));
|
|
453
468
|
}
|
|
454
469
|
};
|
package/src/server.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import { acquireCwdLock, releaseCwdLockByJobId, updateCwdLockHolder, getCwdLocks
|
|
|
12
12
|
import { resolveWorkerCwd } from './paths.mjs';
|
|
13
13
|
import { detectOrchestrator } from './process-info.mjs';
|
|
14
14
|
|
|
15
|
-
const server = new McpServer({ name: 'dsh-adapter', version: '0.1.
|
|
15
|
+
const server = new McpServer({ name: 'dsh-adapter', version: '0.1.4' });
|
|
16
16
|
|
|
17
17
|
const tierSchema = z.enum(['flash', 'pro']).optional().describe('Worker model tier. flash = mechanical, well-scoped work (single-file edits, lookups, formatting); pro = multi-file changes, debugging, design judgment. Omit to use the session default. Ignored when worker= is set.');
|
|
18
18
|
const effortSchema = z.enum(['off', 'high', 'max']).optional().describe('Reasoning effort for the worker. Omit to use the session default. With worker= it only applies when passed explicitly and the profile supports it (agy maps to low/medium/high).');
|
|
@@ -46,9 +46,16 @@ const sessionConfig = {
|
|
|
46
46
|
origin_depth_limit: DEFAULT_ORIGIN_DEPTH_LIMIT,
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* The {provider, model} this session pins for `tier`, or {} when the user has
|
|
51
|
+
* not pinned anything. Sending the resolved default here would look like an
|
|
52
|
+
* explicit choice to the hub and disable its usable-route fallback, which is
|
|
53
|
+
* exactly how an install without DEEPSEEK_API_KEY kept failing.
|
|
54
|
+
*/
|
|
50
55
|
function bindingForTier(tier) {
|
|
51
|
-
|
|
56
|
+
const pinned = [sessionConfig[`${tier}_provider`], sessionConfig[`${tier}_model`]]
|
|
57
|
+
.some((v) => typeof v === 'string' && v.trim() !== '');
|
|
58
|
+
return pinned ? resolveTierBinding(tier, sessionConfig) : {};
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
function presetForTier(tier) {
|