@adhdev/daemon-core 0.9.82-rc.164 → 0.9.82-rc.165
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/dist/index.js +40 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -15
- package/dist/index.mjs.map +1 -1
- package/dist/providers/spec/cli-adapter.d.ts +9 -0
- package/package.json +1 -1
- package/src/providers/cli-provider-instance.ts +9 -1
- package/src/providers/provider-loader.ts +21 -11
- package/src/providers/sdk/v1/schemas/cli/provider.schema.json +4 -3
- package/src/providers/spec/cli-adapter.ts +9 -0
- package/src/providers/spec/native-history-executor.ts +13 -2
package/dist/index.mjs
CHANGED
|
@@ -4926,14 +4926,15 @@ var init_provider_schema = __esm({
|
|
|
4926
4926
|
minItems: 1,
|
|
4927
4927
|
items: {
|
|
4928
4928
|
type: "object",
|
|
4929
|
-
required: ["
|
|
4929
|
+
required: ["ideVersion"],
|
|
4930
4930
|
additionalProperties: false,
|
|
4931
4931
|
properties: {
|
|
4932
4932
|
ideVersion: { type: "string", description: "SemVer range." },
|
|
4933
|
-
scriptDir: { type: "string", pattern: "^scripts/[^/]+$" }
|
|
4933
|
+
scriptDir: { type: "string", pattern: "^scripts/[^/]+$" },
|
|
4934
|
+
spec: { type: "string", pattern: "^specs/[^/]+\\.json$", description: "Path to declarative spec.json driving SpecCliAdapter for this version range." }
|
|
4934
4935
|
}
|
|
4935
4936
|
},
|
|
4936
|
-
description: "Maps installed agent versions to script subdirectories."
|
|
4937
|
+
description: "Maps installed agent versions to script subdirectories and/or declarative specs."
|
|
4937
4938
|
},
|
|
4938
4939
|
defaultScriptDir: {
|
|
4939
4940
|
type: "string",
|
|
@@ -10527,9 +10528,17 @@ function expandPath2(template, input) {
|
|
|
10527
10528
|
});
|
|
10528
10529
|
if (out.startsWith("~/")) out = path24.join(os17.homedir(), out.slice(2));
|
|
10529
10530
|
const now = /* @__PURE__ */ new Date();
|
|
10531
|
+
const workspaceRaw = input.workspace ?? "";
|
|
10532
|
+
let workspaceResolved = workspaceRaw;
|
|
10533
|
+
if (workspaceRaw) {
|
|
10534
|
+
try {
|
|
10535
|
+
workspaceResolved = fs12.realpathSync(workspaceRaw);
|
|
10536
|
+
} catch {
|
|
10537
|
+
}
|
|
10538
|
+
}
|
|
10530
10539
|
const vars = {
|
|
10531
|
-
cwd:
|
|
10532
|
-
cwd_dashed:
|
|
10540
|
+
cwd: workspaceResolved,
|
|
10541
|
+
cwd_dashed: workspaceResolved.replace(/\//g, "-"),
|
|
10533
10542
|
session_id: input.providerSessionId || input.sessionId || input.historySessionId || "",
|
|
10534
10543
|
yyyy: String(now.getUTCFullYear()),
|
|
10535
10544
|
mm: String(now.getUTCMonth() + 1).padStart(2, "0"),
|
|
@@ -26875,6 +26884,15 @@ var SpecCliAdapter = class {
|
|
|
26875
26884
|
cliType;
|
|
26876
26885
|
cliName;
|
|
26877
26886
|
workingDir;
|
|
26887
|
+
/**
|
|
26888
|
+
* Marker the daemon's finalization gate checks: `getStatus()` returns
|
|
26889
|
+
* `messages: []` by design here (chat history lives in the daemon's
|
|
26890
|
+
* native-history pipeline, not the adapter). Without this flag,
|
|
26891
|
+
* cli-provider-instance's `missing_final_assistant` gate would stall
|
|
26892
|
+
* every turn until the 30s safety timeout because it expects the
|
|
26893
|
+
* adapter to surface the final assistant message.
|
|
26894
|
+
*/
|
|
26895
|
+
chatMessagesOwnedExternally = true;
|
|
26878
26896
|
driver;
|
|
26879
26897
|
spec;
|
|
26880
26898
|
lastEvent = null;
|
|
@@ -27858,7 +27876,10 @@ var CliProviderInstance = class {
|
|
|
27858
27876
|
return { reason: `parsed_status:${parsedStatus}`, terminal: isCliGeneratingLikeStatus(parsedStatus) };
|
|
27859
27877
|
}
|
|
27860
27878
|
if (parsed?.activeModal || parsed?.modal) return { reason: "parsed_modal_active", terminal: true };
|
|
27861
|
-
|
|
27879
|
+
const adapterOwnsMessagesElsewhere = this.adapter?.chatMessagesOwnedExternally === true;
|
|
27880
|
+
if (!adapterOwnsMessagesElsewhere && !this.completionHasFinalAssistantMessage(parsed?.messages)) {
|
|
27881
|
+
return { reason: "missing_final_assistant" };
|
|
27882
|
+
}
|
|
27862
27883
|
try {
|
|
27863
27884
|
const screenText = typeof this.adapter.getScreenText === "function" ? String(this.adapter.getScreenText() || "") : "";
|
|
27864
27885
|
if (screenText) {
|
|
@@ -31920,16 +31941,20 @@ var ProviderLoader = class _ProviderLoader {
|
|
|
31920
31941
|
let matched = false;
|
|
31921
31942
|
for (const entry of compat) {
|
|
31922
31943
|
if (this.matchesVersion(currentVersion, entry.ideVersion)) {
|
|
31923
|
-
|
|
31924
|
-
|
|
31925
|
-
|
|
31926
|
-
|
|
31927
|
-
|
|
31928
|
-
|
|
31929
|
-
|
|
31930
|
-
|
|
31931
|
-
|
|
31944
|
+
if (entry.scriptDir) {
|
|
31945
|
+
const loaded = this.loadScriptsFromDir(type, entry.scriptDir);
|
|
31946
|
+
if (loaded) {
|
|
31947
|
+
resolved.scripts = loaded;
|
|
31948
|
+
this.debugLog(` [compatibility] ${type} v${currentVersion} \u2192 ${entry.scriptDir}`);
|
|
31949
|
+
resolved._resolvedScriptDir = entry.scriptDir;
|
|
31950
|
+
resolved._resolvedScriptsSource = `compatibility:${entry.ideVersion}`;
|
|
31951
|
+
if (providerDir) {
|
|
31952
|
+
const fullDir = path30.join(providerDir, entry.scriptDir);
|
|
31953
|
+
resolved._resolvedScriptsPath = fs18.existsSync(path30.join(fullDir, "scripts.js")) ? path30.join(fullDir, "scripts.js") : fullDir;
|
|
31954
|
+
}
|
|
31955
|
+
matched = true;
|
|
31932
31956
|
}
|
|
31957
|
+
} else {
|
|
31933
31958
|
matched = true;
|
|
31934
31959
|
}
|
|
31935
31960
|
break;
|