@adhdev/daemon-core 0.9.82-rc.200 → 0.9.82-rc.201
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 +46 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -2
- package/dist/index.mjs.map +1 -1
- package/dist/providers/spec/cli-adapter.d.ts +3 -0
- package/dist/providers/spec/driver.d.ts +5 -0
- package/package.json +1 -1
- package/src/commands/router.ts +7 -3
- package/src/providers/spec/cli-adapter.ts +35 -0
- package/src/providers/spec/driver.ts +8 -0
package/dist/index.mjs
CHANGED
|
@@ -27267,6 +27267,18 @@ var SpecDriver = class {
|
|
|
27267
27267
|
getSpecPath() {
|
|
27268
27268
|
return this.opts.specPath;
|
|
27269
27269
|
}
|
|
27270
|
+
getScreen() {
|
|
27271
|
+
return this.adapter.snapshot();
|
|
27272
|
+
}
|
|
27273
|
+
getSections() {
|
|
27274
|
+
try {
|
|
27275
|
+
const screen = this.adapter.snapshot();
|
|
27276
|
+
const ev = evaluate(this.spec, screen, void 0);
|
|
27277
|
+
return ev.sections.map((s) => ({ id: s.id, text: s.text }));
|
|
27278
|
+
} catch {
|
|
27279
|
+
return null;
|
|
27280
|
+
}
|
|
27281
|
+
}
|
|
27270
27282
|
// ────────────────────────────────────────────────────────────────────
|
|
27271
27283
|
// Loading & adapter wiring
|
|
27272
27284
|
// ────────────────────────────────────────────────────────────────────
|
|
@@ -28041,6 +28053,38 @@ var SpecCliAdapter = class {
|
|
|
28041
28053
|
this.interactivePromptTransport = "tui";
|
|
28042
28054
|
this.statusCallback?.();
|
|
28043
28055
|
}
|
|
28056
|
+
getDebugState() {
|
|
28057
|
+
const screen = this.driver.getScreen?.() ?? "";
|
|
28058
|
+
const history = this.driver.getStateHistory();
|
|
28059
|
+
const status = this.getStatus();
|
|
28060
|
+
return {
|
|
28061
|
+
type: this.cliType,
|
|
28062
|
+
name: this.cliName,
|
|
28063
|
+
status: status.status,
|
|
28064
|
+
rawStatus: status.status,
|
|
28065
|
+
projectedStatus: status.status,
|
|
28066
|
+
ready: this.spawned,
|
|
28067
|
+
screenText: screen,
|
|
28068
|
+
sections: this.driver.getSections?.() ?? null,
|
|
28069
|
+
stateHistory: history,
|
|
28070
|
+
specPath: this.driver.opts?.specPath ?? null
|
|
28071
|
+
};
|
|
28072
|
+
}
|
|
28073
|
+
getTraceState(limit = 120) {
|
|
28074
|
+
const history = this.driver.getStateHistory();
|
|
28075
|
+
return {
|
|
28076
|
+
status: this.getStatus().status,
|
|
28077
|
+
stateHistory: history.slice(-limit),
|
|
28078
|
+
screenText: this.driver.getScreen?.() ?? ""
|
|
28079
|
+
};
|
|
28080
|
+
}
|
|
28081
|
+
getProviderResolutionMeta() {
|
|
28082
|
+
return {
|
|
28083
|
+
type: this.cliType,
|
|
28084
|
+
providerDir: null,
|
|
28085
|
+
resolvedVersion: null
|
|
28086
|
+
};
|
|
28087
|
+
}
|
|
28044
28088
|
};
|
|
28045
28089
|
|
|
28046
28090
|
// src/providers/spec/route.ts
|
|
@@ -40844,8 +40888,8 @@ var DaemonCommandRouter = class {
|
|
|
40844
40888
|
if (!sessionId) return { success: false, error: "targetSessionId required" };
|
|
40845
40889
|
const target = this.deps.sessionRegistry.get(sessionId);
|
|
40846
40890
|
if (!target) return { success: false, error: "Session not found", sessionId };
|
|
40847
|
-
const
|
|
40848
|
-
const snapshot =
|
|
40891
|
+
const adapterObj = this.deps.cliManager.findAdapter(target.providerType, { instanceKey: sessionId })?.adapter;
|
|
40892
|
+
const snapshot = adapterObj ? typeof adapterObj.getDebugSnapshot === "function" ? adapterObj.getDebugSnapshot() : typeof adapterObj.getDebugState === "function" ? adapterObj.getDebugState() : null : null;
|
|
40849
40893
|
return {
|
|
40850
40894
|
success: true,
|
|
40851
40895
|
sessionId,
|