@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.js
CHANGED
|
@@ -4933,14 +4933,15 @@ var init_provider_schema = __esm({
|
|
|
4933
4933
|
minItems: 1,
|
|
4934
4934
|
items: {
|
|
4935
4935
|
type: "object",
|
|
4936
|
-
required: ["
|
|
4936
|
+
required: ["ideVersion"],
|
|
4937
4937
|
additionalProperties: false,
|
|
4938
4938
|
properties: {
|
|
4939
4939
|
ideVersion: { type: "string", description: "SemVer range." },
|
|
4940
|
-
scriptDir: { type: "string", pattern: "^scripts/[^/]+$" }
|
|
4940
|
+
scriptDir: { type: "string", pattern: "^scripts/[^/]+$" },
|
|
4941
|
+
spec: { type: "string", pattern: "^specs/[^/]+\\.json$", description: "Path to declarative spec.json driving SpecCliAdapter for this version range." }
|
|
4941
4942
|
}
|
|
4942
4943
|
},
|
|
4943
|
-
description: "Maps installed agent versions to script subdirectories."
|
|
4944
|
+
description: "Maps installed agent versions to script subdirectories and/or declarative specs."
|
|
4944
4945
|
},
|
|
4945
4946
|
defaultScriptDir: {
|
|
4946
4947
|
type: "string",
|
|
@@ -10529,9 +10530,17 @@ function expandPath2(template, input) {
|
|
|
10529
10530
|
});
|
|
10530
10531
|
if (out.startsWith("~/")) out = path24.join(os17.homedir(), out.slice(2));
|
|
10531
10532
|
const now = /* @__PURE__ */ new Date();
|
|
10533
|
+
const workspaceRaw = input.workspace ?? "";
|
|
10534
|
+
let workspaceResolved = workspaceRaw;
|
|
10535
|
+
if (workspaceRaw) {
|
|
10536
|
+
try {
|
|
10537
|
+
workspaceResolved = fs12.realpathSync(workspaceRaw);
|
|
10538
|
+
} catch {
|
|
10539
|
+
}
|
|
10540
|
+
}
|
|
10532
10541
|
const vars = {
|
|
10533
|
-
cwd:
|
|
10534
|
-
cwd_dashed:
|
|
10542
|
+
cwd: workspaceResolved,
|
|
10543
|
+
cwd_dashed: workspaceResolved.replace(/\//g, "-"),
|
|
10535
10544
|
session_id: input.providerSessionId || input.sessionId || input.historySessionId || "",
|
|
10536
10545
|
yyyy: String(now.getUTCFullYear()),
|
|
10537
10546
|
mm: String(now.getUTCMonth() + 1).padStart(2, "0"),
|
|
@@ -27172,6 +27181,15 @@ var SpecCliAdapter = class {
|
|
|
27172
27181
|
cliType;
|
|
27173
27182
|
cliName;
|
|
27174
27183
|
workingDir;
|
|
27184
|
+
/**
|
|
27185
|
+
* Marker the daemon's finalization gate checks: `getStatus()` returns
|
|
27186
|
+
* `messages: []` by design here (chat history lives in the daemon's
|
|
27187
|
+
* native-history pipeline, not the adapter). Without this flag,
|
|
27188
|
+
* cli-provider-instance's `missing_final_assistant` gate would stall
|
|
27189
|
+
* every turn until the 30s safety timeout because it expects the
|
|
27190
|
+
* adapter to surface the final assistant message.
|
|
27191
|
+
*/
|
|
27192
|
+
chatMessagesOwnedExternally = true;
|
|
27175
27193
|
driver;
|
|
27176
27194
|
spec;
|
|
27177
27195
|
lastEvent = null;
|
|
@@ -28155,7 +28173,10 @@ var CliProviderInstance = class {
|
|
|
28155
28173
|
return { reason: `parsed_status:${parsedStatus}`, terminal: isCliGeneratingLikeStatus(parsedStatus) };
|
|
28156
28174
|
}
|
|
28157
28175
|
if (parsed?.activeModal || parsed?.modal) return { reason: "parsed_modal_active", terminal: true };
|
|
28158
|
-
|
|
28176
|
+
const adapterOwnsMessagesElsewhere = this.adapter?.chatMessagesOwnedExternally === true;
|
|
28177
|
+
if (!adapterOwnsMessagesElsewhere && !this.completionHasFinalAssistantMessage(parsed?.messages)) {
|
|
28178
|
+
return { reason: "missing_final_assistant" };
|
|
28179
|
+
}
|
|
28159
28180
|
try {
|
|
28160
28181
|
const screenText = typeof this.adapter.getScreenText === "function" ? String(this.adapter.getScreenText() || "") : "";
|
|
28161
28182
|
if (screenText) {
|
|
@@ -32212,16 +32233,20 @@ var ProviderLoader = class _ProviderLoader {
|
|
|
32212
32233
|
let matched = false;
|
|
32213
32234
|
for (const entry of compat) {
|
|
32214
32235
|
if (this.matchesVersion(currentVersion, entry.ideVersion)) {
|
|
32215
|
-
|
|
32216
|
-
|
|
32217
|
-
|
|
32218
|
-
|
|
32219
|
-
|
|
32220
|
-
|
|
32221
|
-
|
|
32222
|
-
|
|
32223
|
-
|
|
32236
|
+
if (entry.scriptDir) {
|
|
32237
|
+
const loaded = this.loadScriptsFromDir(type, entry.scriptDir);
|
|
32238
|
+
if (loaded) {
|
|
32239
|
+
resolved.scripts = loaded;
|
|
32240
|
+
this.debugLog(` [compatibility] ${type} v${currentVersion} \u2192 ${entry.scriptDir}`);
|
|
32241
|
+
resolved._resolvedScriptDir = entry.scriptDir;
|
|
32242
|
+
resolved._resolvedScriptsSource = `compatibility:${entry.ideVersion}`;
|
|
32243
|
+
if (providerDir) {
|
|
32244
|
+
const fullDir = path30.join(providerDir, entry.scriptDir);
|
|
32245
|
+
resolved._resolvedScriptsPath = fs18.existsSync(path30.join(fullDir, "scripts.js")) ? path30.join(fullDir, "scripts.js") : fullDir;
|
|
32246
|
+
}
|
|
32247
|
+
matched = true;
|
|
32224
32248
|
}
|
|
32249
|
+
} else {
|
|
32225
32250
|
matched = true;
|
|
32226
32251
|
}
|
|
32227
32252
|
break;
|