@adhdev/daemon-core 0.6.77 → 0.7.0
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.d.mts +2342 -0
- package/dist/index.d.ts +86 -932
- package/dist/index.js +879 -664
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14702 -0
- package/dist/index.mjs.map +1 -0
- package/dist/normalize-S2PmiRgB.d.mts +843 -0
- package/dist/normalize-S2PmiRgB.d.ts +843 -0
- package/dist/status/normalize.d.mts +1 -0
- package/dist/status/normalize.d.ts +1 -0
- package/dist/status/normalize.js +73 -0
- package/dist/status/normalize.js.map +1 -0
- package/dist/status/normalize.mjs +45 -0
- package/dist/status/normalize.mjs.map +1 -0
- package/package.json +8 -1
- package/src/agent-stream/manager.ts +213 -150
- package/src/agent-stream/poller.ts +57 -45
- package/src/boot/daemon-lifecycle.ts +30 -12
- package/src/cdp/initializer.ts +47 -0
- package/src/cdp/manager.ts +45 -4
- package/src/cdp/setup.ts +26 -11
- package/src/commands/chat-commands.ts +136 -88
- package/src/commands/cli-manager.ts +31 -6
- package/src/commands/handler.ts +71 -109
- package/src/commands/router.ts +4 -20
- package/src/commands/stream-commands.ts +34 -156
- package/src/daemon-core.ts +3 -9
- package/src/index.ts +8 -5
- package/src/logging/command-log.ts +1 -1
- package/src/providers/acp-provider-instance.ts +4 -0
- package/src/providers/provider-instance-manager.ts +1 -0
- package/src/sessions/registry.ts +76 -0
- package/src/shared-types.ts +45 -54
- package/src/status/builders.ts +157 -120
- package/src/status/normalize.ts +64 -0
- package/src/status/reporter.ts +16 -15
- package/src/status/snapshot.ts +3 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { w as ManagedStatus, O as isManagedStatusWaiting, Q as isManagedStatusWorking, X as normalizeActiveChatData, Y as normalizeManagedStatus } from '../normalize-S2PmiRgB.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { w as ManagedStatus, O as isManagedStatusWaiting, Q as isManagedStatusWorking, X as normalizeActiveChatData, Y as normalizeManagedStatus } from '../normalize-S2PmiRgB.js';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/status/normalize.ts
|
|
21
|
+
var normalize_exports = {};
|
|
22
|
+
__export(normalize_exports, {
|
|
23
|
+
isManagedStatusWaiting: () => isManagedStatusWaiting,
|
|
24
|
+
isManagedStatusWorking: () => isManagedStatusWorking,
|
|
25
|
+
normalizeActiveChatData: () => normalizeActiveChatData,
|
|
26
|
+
normalizeManagedStatus: () => normalizeManagedStatus
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(normalize_exports);
|
|
29
|
+
var WORKING_STATUSES = /* @__PURE__ */ new Set([
|
|
30
|
+
"generating",
|
|
31
|
+
"streaming",
|
|
32
|
+
"loading",
|
|
33
|
+
"loading_reference",
|
|
34
|
+
"thinking",
|
|
35
|
+
"active"
|
|
36
|
+
]);
|
|
37
|
+
function hasApprovalButtons(activeModal) {
|
|
38
|
+
return (activeModal?.buttons?.length ?? 0) > 0;
|
|
39
|
+
}
|
|
40
|
+
function normalizeManagedStatus(status, opts) {
|
|
41
|
+
if (hasApprovalButtons(opts?.activeModal)) return "waiting_approval";
|
|
42
|
+
const normalized = String(status || "idle").trim().toLowerCase();
|
|
43
|
+
if (normalized === "waiting_approval") return "waiting_approval";
|
|
44
|
+
if (WORKING_STATUSES.has(normalized)) return "generating";
|
|
45
|
+
if (normalized === "error") return "error";
|
|
46
|
+
if (normalized === "stopped") return "stopped";
|
|
47
|
+
if (normalized === "starting") return "starting";
|
|
48
|
+
if (normalized === "panel_hidden") return "panel_hidden";
|
|
49
|
+
if (normalized === "not_monitored") return "not_monitored";
|
|
50
|
+
if (normalized === "disconnected") return "disconnected";
|
|
51
|
+
return "idle";
|
|
52
|
+
}
|
|
53
|
+
function isManagedStatusWorking(status) {
|
|
54
|
+
return normalizeManagedStatus(status) === "generating";
|
|
55
|
+
}
|
|
56
|
+
function isManagedStatusWaiting(status, opts) {
|
|
57
|
+
return normalizeManagedStatus(status, opts) === "waiting_approval";
|
|
58
|
+
}
|
|
59
|
+
function normalizeActiveChatData(activeChat) {
|
|
60
|
+
if (!activeChat) return activeChat;
|
|
61
|
+
return {
|
|
62
|
+
...activeChat,
|
|
63
|
+
status: normalizeManagedStatus(activeChat.status, { activeModal: activeChat.activeModal })
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
isManagedStatusWaiting,
|
|
69
|
+
isManagedStatusWorking,
|
|
70
|
+
normalizeActiveChatData,
|
|
71
|
+
normalizeManagedStatus
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/status/normalize.ts"],"sourcesContent":["import type { ActiveChatData } from '../providers/provider-instance.js';\n\nexport type ManagedStatus =\n | 'idle'\n | 'generating'\n | 'waiting_approval'\n | 'error'\n | 'stopped'\n | 'starting'\n | 'panel_hidden'\n | 'not_monitored'\n | 'disconnected';\n\nconst WORKING_STATUSES = new Set([\n 'generating',\n 'streaming',\n 'loading',\n 'loading_reference',\n 'thinking',\n 'active',\n]);\n\nfunction hasApprovalButtons(activeModal?: { buttons?: unknown[] | null } | null): boolean {\n return (activeModal?.buttons?.length ?? 0) > 0;\n}\n\nexport function normalizeManagedStatus(\n status?: string | null,\n opts?: { activeModal?: { buttons?: unknown[] | null } | null },\n): ManagedStatus {\n if (hasApprovalButtons(opts?.activeModal)) return 'waiting_approval';\n\n const normalized = String(status || 'idle').trim().toLowerCase();\n if (normalized === 'waiting_approval') return 'waiting_approval';\n if (WORKING_STATUSES.has(normalized)) return 'generating';\n if (normalized === 'error') return 'error';\n if (normalized === 'stopped') return 'stopped';\n if (normalized === 'starting') return 'starting';\n if (normalized === 'panel_hidden') return 'panel_hidden';\n if (normalized === 'not_monitored') return 'not_monitored';\n if (normalized === 'disconnected') return 'disconnected';\n return 'idle';\n}\n\nexport function isManagedStatusWorking(status?: string | null): boolean {\n return normalizeManagedStatus(status) === 'generating';\n}\n\nexport function isManagedStatusWaiting(\n status?: string | null,\n opts?: { activeModal?: { buttons?: unknown[] | null } | null },\n): boolean {\n return normalizeManagedStatus(status, opts) === 'waiting_approval';\n}\n\nexport function normalizeActiveChatData<T extends ActiveChatData | null | undefined>(\n activeChat: T,\n): T {\n if (!activeChat) return activeChat;\n return {\n ...activeChat,\n status: normalizeManagedStatus(activeChat.status, { activeModal: activeChat.activeModal }),\n } as T;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,IAAM,mBAAmB,oBAAI,IAAI;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAED,SAAS,mBAAmB,aAA8D;AACtF,UAAQ,aAAa,SAAS,UAAU,KAAK;AACjD;AAEO,SAAS,uBACZ,QACA,MACa;AACb,MAAI,mBAAmB,MAAM,WAAW,EAAG,QAAO;AAElD,QAAM,aAAa,OAAO,UAAU,MAAM,EAAE,KAAK,EAAE,YAAY;AAC/D,MAAI,eAAe,mBAAoB,QAAO;AAC9C,MAAI,iBAAiB,IAAI,UAAU,EAAG,QAAO;AAC7C,MAAI,eAAe,QAAS,QAAO;AACnC,MAAI,eAAe,UAAW,QAAO;AACrC,MAAI,eAAe,WAAY,QAAO;AACtC,MAAI,eAAe,eAAgB,QAAO;AAC1C,MAAI,eAAe,gBAAiB,QAAO;AAC3C,MAAI,eAAe,eAAgB,QAAO;AAC1C,SAAO;AACX;AAEO,SAAS,uBAAuB,QAAiC;AACpE,SAAO,uBAAuB,MAAM,MAAM;AAC9C;AAEO,SAAS,uBACZ,QACA,MACO;AACP,SAAO,uBAAuB,QAAQ,IAAI,MAAM;AACpD;AAEO,SAAS,wBACZ,YACC;AACD,MAAI,CAAC,WAAY,QAAO;AACxB,SAAO;AAAA,IACH,GAAG;AAAA,IACH,QAAQ,uBAAuB,WAAW,QAAQ,EAAE,aAAa,WAAW,YAAY,CAAC;AAAA,EAC7F;AACJ;","names":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// src/status/normalize.ts
|
|
2
|
+
var WORKING_STATUSES = /* @__PURE__ */ new Set([
|
|
3
|
+
"generating",
|
|
4
|
+
"streaming",
|
|
5
|
+
"loading",
|
|
6
|
+
"loading_reference",
|
|
7
|
+
"thinking",
|
|
8
|
+
"active"
|
|
9
|
+
]);
|
|
10
|
+
function hasApprovalButtons(activeModal) {
|
|
11
|
+
return (activeModal?.buttons?.length ?? 0) > 0;
|
|
12
|
+
}
|
|
13
|
+
function normalizeManagedStatus(status, opts) {
|
|
14
|
+
if (hasApprovalButtons(opts?.activeModal)) return "waiting_approval";
|
|
15
|
+
const normalized = String(status || "idle").trim().toLowerCase();
|
|
16
|
+
if (normalized === "waiting_approval") return "waiting_approval";
|
|
17
|
+
if (WORKING_STATUSES.has(normalized)) return "generating";
|
|
18
|
+
if (normalized === "error") return "error";
|
|
19
|
+
if (normalized === "stopped") return "stopped";
|
|
20
|
+
if (normalized === "starting") return "starting";
|
|
21
|
+
if (normalized === "panel_hidden") return "panel_hidden";
|
|
22
|
+
if (normalized === "not_monitored") return "not_monitored";
|
|
23
|
+
if (normalized === "disconnected") return "disconnected";
|
|
24
|
+
return "idle";
|
|
25
|
+
}
|
|
26
|
+
function isManagedStatusWorking(status) {
|
|
27
|
+
return normalizeManagedStatus(status) === "generating";
|
|
28
|
+
}
|
|
29
|
+
function isManagedStatusWaiting(status, opts) {
|
|
30
|
+
return normalizeManagedStatus(status, opts) === "waiting_approval";
|
|
31
|
+
}
|
|
32
|
+
function normalizeActiveChatData(activeChat) {
|
|
33
|
+
if (!activeChat) return activeChat;
|
|
34
|
+
return {
|
|
35
|
+
...activeChat,
|
|
36
|
+
status: normalizeManagedStatus(activeChat.status, { activeModal: activeChat.activeModal })
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
isManagedStatusWaiting,
|
|
41
|
+
isManagedStatusWorking,
|
|
42
|
+
normalizeActiveChatData,
|
|
43
|
+
normalizeManagedStatus
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=normalize.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/status/normalize.ts"],"sourcesContent":["import type { ActiveChatData } from '../providers/provider-instance.js';\n\nexport type ManagedStatus =\n | 'idle'\n | 'generating'\n | 'waiting_approval'\n | 'error'\n | 'stopped'\n | 'starting'\n | 'panel_hidden'\n | 'not_monitored'\n | 'disconnected';\n\nconst WORKING_STATUSES = new Set([\n 'generating',\n 'streaming',\n 'loading',\n 'loading_reference',\n 'thinking',\n 'active',\n]);\n\nfunction hasApprovalButtons(activeModal?: { buttons?: unknown[] | null } | null): boolean {\n return (activeModal?.buttons?.length ?? 0) > 0;\n}\n\nexport function normalizeManagedStatus(\n status?: string | null,\n opts?: { activeModal?: { buttons?: unknown[] | null } | null },\n): ManagedStatus {\n if (hasApprovalButtons(opts?.activeModal)) return 'waiting_approval';\n\n const normalized = String(status || 'idle').trim().toLowerCase();\n if (normalized === 'waiting_approval') return 'waiting_approval';\n if (WORKING_STATUSES.has(normalized)) return 'generating';\n if (normalized === 'error') return 'error';\n if (normalized === 'stopped') return 'stopped';\n if (normalized === 'starting') return 'starting';\n if (normalized === 'panel_hidden') return 'panel_hidden';\n if (normalized === 'not_monitored') return 'not_monitored';\n if (normalized === 'disconnected') return 'disconnected';\n return 'idle';\n}\n\nexport function isManagedStatusWorking(status?: string | null): boolean {\n return normalizeManagedStatus(status) === 'generating';\n}\n\nexport function isManagedStatusWaiting(\n status?: string | null,\n opts?: { activeModal?: { buttons?: unknown[] | null } | null },\n): boolean {\n return normalizeManagedStatus(status, opts) === 'waiting_approval';\n}\n\nexport function normalizeActiveChatData<T extends ActiveChatData | null | undefined>(\n activeChat: T,\n): T {\n if (!activeChat) return activeChat;\n return {\n ...activeChat,\n status: normalizeManagedStatus(activeChat.status, { activeModal: activeChat.activeModal }),\n } as T;\n}\n"],"mappings":";AAaA,IAAM,mBAAmB,oBAAI,IAAI;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAED,SAAS,mBAAmB,aAA8D;AACtF,UAAQ,aAAa,SAAS,UAAU,KAAK;AACjD;AAEO,SAAS,uBACZ,QACA,MACa;AACb,MAAI,mBAAmB,MAAM,WAAW,EAAG,QAAO;AAElD,QAAM,aAAa,OAAO,UAAU,MAAM,EAAE,KAAK,EAAE,YAAY;AAC/D,MAAI,eAAe,mBAAoB,QAAO;AAC9C,MAAI,iBAAiB,IAAI,UAAU,EAAG,QAAO;AAC7C,MAAI,eAAe,QAAS,QAAO;AACnC,MAAI,eAAe,UAAW,QAAO;AACrC,MAAI,eAAe,WAAY,QAAO;AACtC,MAAI,eAAe,eAAgB,QAAO;AAC1C,MAAI,eAAe,gBAAiB,QAAO;AAC3C,MAAI,eAAe,eAAgB,QAAO;AAC1C,SAAO;AACX;AAEO,SAAS,uBAAuB,QAAiC;AACpE,SAAO,uBAAuB,MAAM,MAAM;AAC9C;AAEO,SAAS,uBACZ,QACA,MACO;AACP,SAAO,uBAAuB,QAAQ,IAAI,MAAM;AACpD;AAEO,SAAS,wBACZ,YACC;AACD,MAAI,CAAC,WAAY,QAAO;AACxB,SAAO;AAAA,IACH,GAAG;AAAA,IACH,QAAQ,uBAAuB,WAAW,QAAQ,EAAE,aAAa,WAAW,YAAY,CAAC;AAAA,EAC7F;AACJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adhdev/daemon-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
10
11
|
"require": "./dist/index.js",
|
|
11
12
|
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./status/normalize": {
|
|
15
|
+
"types": "./dist/status/normalize.d.ts",
|
|
16
|
+
"import": "./dist/status/normalize.mjs",
|
|
17
|
+
"require": "./dist/status/normalize.js",
|
|
18
|
+
"default": "./dist/status/normalize.js"
|
|
12
19
|
}
|
|
13
20
|
},
|
|
14
21
|
"scripts": {
|