@agimon-ai/doompi-domain 0.0.1-alpha.7 → 0.0.1-alpha.71
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/README.md +10 -0
- package/dist/apiContracts.cjs +17 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +13 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/apply.cjs +3 -1
- package/dist/apply.d.mts +23 -2
- package/dist/apply.d.mts.map +1 -0
- package/dist/apply.mjs +2 -1
- package/dist/applyDomains-CSdAZe5P.mjs +85 -0
- package/dist/applyDomains-CSdAZe5P.mjs.map +1 -0
- package/dist/applyDomains-L5ywYh8d.cjs +87 -0
- package/dist/applyDomains-L5ywYh8d.cjs.map +1 -0
- package/dist/domainText-DOsRzOiP.cjs +227 -0
- package/dist/domainText-DOsRzOiP.cjs.map +1 -0
- package/dist/domainText-edEmt_4b.mjs +108 -0
- package/dist/domainText-edEmt_4b.mjs.map +1 -0
- package/dist/extensions/mcp.cjs +26 -0
- package/dist/extensions/mcp.cjs.map +1 -0
- package/dist/extensions/mcp.d.mts +5 -0
- package/dist/extensions/mcp.d.mts.map +1 -0
- package/dist/extensions/mcp.mjs +21 -0
- package/dist/extensions/mcp.mjs.map +1 -0
- package/dist/extensions/pi.cjs +501 -1
- package/dist/extensions/pi.cjs.map +1 -0
- package/dist/extensions/pi.d.mts +6 -2
- package/dist/extensions/pi.d.mts.map +1 -0
- package/dist/extensions/pi.mjs +496 -1
- package/dist/extensions/pi.mjs.map +1 -0
- package/dist/extensions/server.cjs +211 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +203 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +26 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/index-B7ETtmXn.d.mts +207 -0
- package/dist/index-B7ETtmXn.d.mts.map +1 -0
- package/dist/index.cjs +35 -1
- package/dist/index.d.mts +2 -13
- package/dist/index.mjs +4 -1
- package/dist/mcp.cjs +32 -1
- package/dist/mcp.cjs.map +1 -0
- package/dist/mcp.d.mts +51 -3
- package/dist/mcp.d.mts.map +1 -0
- package/dist/mcp.mjs +19 -1
- package/dist/mcp.mjs.map +1 -0
- package/dist/mcpFilter-ChoM_vWa.mjs +151 -0
- package/dist/mcpFilter-ChoM_vWa.mjs.map +1 -0
- package/dist/mcpFilter-CsTk699I.cjs +189 -0
- package/dist/mcpFilter-CsTk699I.cjs.map +1 -0
- package/dist/pluginMaterializer-D4xOC_Oc.cjs +263 -0
- package/dist/pluginMaterializer-D4xOC_Oc.cjs.map +1 -0
- package/dist/pluginMaterializer-D9qFOmKW.mjs +255 -0
- package/dist/pluginMaterializer-D9qFOmKW.mjs.map +1 -0
- package/dist/plugins.cjs +3 -1
- package/dist/plugins.d.mts +14 -2
- package/dist/plugins.d.mts.map +1 -0
- package/dist/plugins.mjs +2 -1
- package/dist/resourceCollector-Bj_pmQ4Q.cjs +838 -0
- package/dist/resourceCollector-Bj_pmQ4Q.cjs.map +1 -0
- package/dist/resourceCollector-D4b4QO6b.mjs +774 -0
- package/dist/resourceCollector-D4b4QO6b.mjs.map +1 -0
- package/dist/{types/resources.d.cts → resources-C2ZA4jRJ.d.mts} +4 -3
- package/dist/resources-C2ZA4jRJ.d.mts.map +1 -0
- package/dist/resources.cjs +12 -1
- package/dist/resources.d.mts +43 -4
- package/dist/resources.d.mts.map +1 -0
- package/dist/resources.mjs +2 -1
- package/dist/rolldown-runtime-C0BPl7ul.cjs +43 -0
- package/dist/telemetry-BNR2sOfC.mjs +277 -0
- package/dist/telemetry-BNR2sOfC.mjs.map +1 -0
- package/dist/telemetry-Dqr0U-t6.cjs +354 -0
- package/dist/telemetry-Dqr0U-t6.cjs.map +1 -0
- package/dist/toolNames-Ckp5VLMD.mjs +43 -0
- package/dist/toolNames-Ckp5VLMD.mjs.map +1 -0
- package/dist/toolNames-Cuu-u8r1.cjs +48 -0
- package/dist/toolNames-Cuu-u8r1.cjs.map +1 -0
- package/package.json +77 -20
- package/src/prompts/doompi-author-domain/SKILL.md +3 -1
- package/dist/_virtual/_rolldown/runtime.cjs +0 -1
- package/dist/adapters/applyDomains.cjs +0 -2
- package/dist/adapters/applyDomains.cjs.map +0 -1
- package/dist/adapters/applyDomains.d.cts +0 -24
- package/dist/adapters/applyDomains.d.cts.map +0 -1
- package/dist/adapters/applyDomains.d.mts +0 -24
- package/dist/adapters/applyDomains.d.mts.map +0 -1
- package/dist/adapters/applyDomains.mjs +0 -2
- package/dist/adapters/applyDomains.mjs.map +0 -1
- package/dist/adapters/domainCatalog.cjs +0 -2
- package/dist/adapters/domainCatalog.cjs.map +0 -1
- package/dist/adapters/domainCatalog.d.cts +0 -21
- package/dist/adapters/domainCatalog.d.cts.map +0 -1
- package/dist/adapters/domainCatalog.d.mts +0 -21
- package/dist/adapters/domainCatalog.d.mts.map +0 -1
- package/dist/adapters/domainCatalog.mjs +0 -2
- package/dist/adapters/domainCatalog.mjs.map +0 -1
- package/dist/adapters/domainSwitchHandoff.cjs +0 -2
- package/dist/adapters/domainSwitchHandoff.cjs.map +0 -1
- package/dist/adapters/domainSwitchHandoff.d.cts +0 -10
- package/dist/adapters/domainSwitchHandoff.d.cts.map +0 -1
- package/dist/adapters/domainSwitchHandoff.d.mts +0 -10
- package/dist/adapters/domainSwitchHandoff.d.mts.map +0 -1
- package/dist/adapters/domainSwitchHandoff.mjs +0 -2
- package/dist/adapters/domainSwitchHandoff.mjs.map +0 -1
- package/dist/adapters/mcpFilter.cjs +0 -3
- package/dist/adapters/mcpFilter.cjs.map +0 -1
- package/dist/adapters/mcpFilter.d.cts +0 -39
- package/dist/adapters/mcpFilter.d.cts.map +0 -1
- package/dist/adapters/mcpFilter.d.mts +0 -39
- package/dist/adapters/mcpFilter.d.mts.map +0 -1
- package/dist/adapters/mcpFilter.mjs +0 -3
- package/dist/adapters/mcpFilter.mjs.map +0 -1
- package/dist/adapters/mcpSessionEnvironment.cjs +0 -2
- package/dist/adapters/mcpSessionEnvironment.cjs.map +0 -1
- package/dist/adapters/mcpSessionEnvironment.d.cts +0 -14
- package/dist/adapters/mcpSessionEnvironment.d.cts.map +0 -1
- package/dist/adapters/mcpSessionEnvironment.d.mts +0 -14
- package/dist/adapters/mcpSessionEnvironment.d.mts.map +0 -1
- package/dist/adapters/mcpSessionEnvironment.mjs +0 -2
- package/dist/adapters/mcpSessionEnvironment.mjs.map +0 -1
- package/dist/adapters/pi/extension.cjs +0 -2
- package/dist/adapters/pi/extension.cjs.map +0 -1
- package/dist/adapters/pi/extension.d.cts +0 -8
- package/dist/adapters/pi/extension.d.cts.map +0 -1
- package/dist/adapters/pi/extension.d.mts +0 -8
- package/dist/adapters/pi/extension.d.mts.map +0 -1
- package/dist/adapters/pi/extension.mjs +0 -2
- package/dist/adapters/pi/extension.mjs.map +0 -1
- package/dist/adapters/pi/voiceTool.cjs +0 -2
- package/dist/adapters/pi/voiceTool.cjs.map +0 -1
- package/dist/adapters/pi/voiceTool.d.cts +0 -19
- package/dist/adapters/pi/voiceTool.d.cts.map +0 -1
- package/dist/adapters/pi/voiceTool.d.mts +0 -19
- package/dist/adapters/pi/voiceTool.d.mts.map +0 -1
- package/dist/adapters/pi/voiceTool.mjs +0 -2
- package/dist/adapters/pi/voiceTool.mjs.map +0 -1
- package/dist/adapters/pluginMaterializer.cjs +0 -2
- package/dist/adapters/pluginMaterializer.cjs.map +0 -1
- package/dist/adapters/pluginMaterializer.d.cts +0 -14
- package/dist/adapters/pluginMaterializer.d.cts.map +0 -1
- package/dist/adapters/pluginMaterializer.d.mts +0 -14
- package/dist/adapters/pluginMaterializer.d.mts.map +0 -1
- package/dist/adapters/pluginMaterializer.mjs +0 -2
- package/dist/adapters/pluginMaterializer.mjs.map +0 -1
- package/dist/adapters/resourceCollector.cjs +0 -3
- package/dist/adapters/resourceCollector.cjs.map +0 -1
- package/dist/adapters/resourceCollector.d.cts +0 -27
- package/dist/adapters/resourceCollector.d.cts.map +0 -1
- package/dist/adapters/resourceCollector.d.mts +0 -27
- package/dist/adapters/resourceCollector.d.mts.map +0 -1
- package/dist/adapters/resourceCollector.mjs +0 -3
- package/dist/adapters/resourceCollector.mjs.map +0 -1
- package/dist/adapters/skillCacheLocation.cjs +0 -2
- package/dist/adapters/skillCacheLocation.cjs.map +0 -1
- package/dist/adapters/skillCacheLocation.d.cts +0 -16
- package/dist/adapters/skillCacheLocation.d.cts.map +0 -1
- package/dist/adapters/skillCacheLocation.d.mts +0 -16
- package/dist/adapters/skillCacheLocation.d.mts.map +0 -1
- package/dist/adapters/skillCacheLocation.mjs +0 -2
- package/dist/adapters/skillCacheLocation.mjs.map +0 -1
- package/dist/adapters/telemetry/logSinkTelemetry.cjs +0 -2
- package/dist/adapters/telemetry/logSinkTelemetry.cjs.map +0 -1
- package/dist/adapters/telemetry/logSinkTelemetry.d.cts +0 -14
- package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +0 -1
- package/dist/adapters/telemetry/logSinkTelemetry.d.mts +0 -14
- package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +0 -1
- package/dist/adapters/telemetry/logSinkTelemetry.mjs +0 -2
- package/dist/adapters/telemetry/logSinkTelemetry.mjs.map +0 -1
- package/dist/apply.d.cts +0 -2
- package/dist/commands/domainsCommand.cjs +0 -2
- package/dist/commands/domainsCommand.cjs.map +0 -1
- package/dist/commands/domainsCommand.d.cts +0 -28
- package/dist/commands/domainsCommand.d.cts.map +0 -1
- package/dist/commands/domainsCommand.d.mts +0 -28
- package/dist/commands/domainsCommand.d.mts.map +0 -1
- package/dist/commands/domainsCommand.mjs +0 -2
- package/dist/commands/domainsCommand.mjs.map +0 -1
- package/dist/extensions/pi.d.cts +0 -2
- package/dist/index.d.cts +0 -13
- package/dist/mcp.d.cts +0 -4
- package/dist/plugins.d.cts +0 -2
- package/dist/resources.d.cts +0 -4
- package/dist/schemas/domainVoiceTools.cjs +0 -2
- package/dist/schemas/domainVoiceTools.cjs.map +0 -1
- package/dist/schemas/domainVoiceTools.d.cts +0 -22
- package/dist/schemas/domainVoiceTools.d.cts.map +0 -1
- package/dist/schemas/domainVoiceTools.d.mts +0 -22
- package/dist/schemas/domainVoiceTools.d.mts.map +0 -1
- package/dist/schemas/domainVoiceTools.mjs +0 -2
- package/dist/schemas/domainVoiceTools.mjs.map +0 -1
- package/dist/services/domainText.cjs +0 -2
- package/dist/services/domainText.cjs.map +0 -1
- package/dist/services/domainText.d.cts +0 -30
- package/dist/services/domainText.d.cts.map +0 -1
- package/dist/services/domainText.d.mts +0 -30
- package/dist/services/domainText.d.mts.map +0 -1
- package/dist/services/domainText.mjs +0 -2
- package/dist/services/domainText.mjs.map +0 -1
- package/dist/services/toolNames.cjs +0 -2
- package/dist/services/toolNames.cjs.map +0 -1
- package/dist/services/toolNames.d.cts +0 -21
- package/dist/services/toolNames.d.cts.map +0 -1
- package/dist/services/toolNames.d.mts +0 -21
- package/dist/services/toolNames.d.mts.map +0 -1
- package/dist/services/toolNames.mjs +0 -2
- package/dist/services/toolNames.mjs.map +0 -1
- package/dist/types/domains.cjs +0 -2
- package/dist/types/domains.cjs.map +0 -1
- package/dist/types/domains.d.cts +0 -33
- package/dist/types/domains.d.cts.map +0 -1
- package/dist/types/domains.d.mts +0 -33
- package/dist/types/domains.d.mts.map +0 -1
- package/dist/types/domains.mjs +0 -2
- package/dist/types/domains.mjs.map +0 -1
- package/dist/types/handoff.d.cts +0 -35
- package/dist/types/handoff.d.cts.map +0 -1
- package/dist/types/handoff.d.mts +0 -35
- package/dist/types/handoff.d.mts.map +0 -1
- package/dist/types/resources.d.cts.map +0 -1
- package/dist/types/resources.d.mts +0 -65
- package/dist/types/resources.d.mts.map +0 -1
- package/dist/types/telemetry.cjs +0 -2
- package/dist/types/telemetry.cjs.map +0 -1
- package/dist/types/telemetry.d.cts +0 -15
- package/dist/types/telemetry.d.cts.map +0 -1
- package/dist/types/telemetry.d.mts +0 -15
- package/dist/types/telemetry.d.mts.map +0 -1
- package/dist/types/telemetry.mjs +0 -2
- package/dist/types/telemetry.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -83,3 +83,13 @@ it. It is not selectable from `.doom/modes.yaml`; it reads `.doom/domains.yaml`.
|
|
|
83
83
|
## License
|
|
84
84
|
|
|
85
85
|
MIT
|
|
86
|
+
|
|
87
|
+
Pi, server, and web entries live in `src/extensions`; the Node entries build directly to
|
|
88
|
+
`/extensions/pi` and `/extensions/server`. Flat public exports expose domain catalogs,
|
|
89
|
+
resource selection, MCP configuration, and plugin materialization helpers.
|
|
90
|
+
|
|
91
|
+
The Pi declaration installs optional Config, Transition, and Voice service bindings, then
|
|
92
|
+
registers command and event declarations. Session startup waits for the runtime bindings before
|
|
93
|
+
publishing domain status. `onStop` cancels a pending catalog-settle notification and disposes
|
|
94
|
+
handoffs; `onDispose` also handles partial startup cleanup. The heavy picker and domain application
|
|
95
|
+
modules remain lazy imports.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
//#region src/schemas/apiContracts.ts
|
|
6
|
+
/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
7
|
+
const apiContracts = (0, require("@agimon-ai/doompi-core/apiContracts").defineApiContract)({
|
|
8
|
+
version: 1,
|
|
9
|
+
http: [],
|
|
10
|
+
sockets: [],
|
|
11
|
+
dynamic: []
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.apiContracts = apiContracts;
|
|
15
|
+
exports.default = apiContracts;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=apiContracts.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/doompi-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,gDAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//#region src/schemas/apiContracts.d.ts
|
|
2
|
+
/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
3
|
+
export declare const apiContracts: {
|
|
4
|
+
version: 1;
|
|
5
|
+
protocols?: Record<string, string> | undefined;
|
|
6
|
+
schemas?: Record<string, boolean | object> | undefined;
|
|
7
|
+
http: {
|
|
8
|
+
id: string;
|
|
9
|
+
scope: "global" | "session" | "workspace";
|
|
10
|
+
basePath?: string | undefined;
|
|
11
|
+
path: string;
|
|
12
|
+
method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
|
|
13
|
+
description: string;
|
|
14
|
+
availability?: string | undefined;
|
|
15
|
+
authentication: "device" | "none" | "owner";
|
|
16
|
+
parameters?: {
|
|
17
|
+
name: string;
|
|
18
|
+
in: "header" | "path" | "query";
|
|
19
|
+
required: boolean;
|
|
20
|
+
schema: boolean | object;
|
|
21
|
+
}[] | undefined;
|
|
22
|
+
body?: {
|
|
23
|
+
contentType: string;
|
|
24
|
+
contentTypes?: string[] | undefined;
|
|
25
|
+
required: boolean;
|
|
26
|
+
schema: boolean | object;
|
|
27
|
+
} | undefined;
|
|
28
|
+
responses: Record<string, {
|
|
29
|
+
description: string;
|
|
30
|
+
contentType?: string | undefined;
|
|
31
|
+
schema?: boolean | object | undefined;
|
|
32
|
+
events?: Record<string, boolean | object> | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
}[];
|
|
35
|
+
sockets: {
|
|
36
|
+
id: string;
|
|
37
|
+
scope: "global" | "session" | "workspace";
|
|
38
|
+
description: string;
|
|
39
|
+
availability?: string | undefined;
|
|
40
|
+
service: string;
|
|
41
|
+
member: string;
|
|
42
|
+
direction: "client-to-server" | "server-to-client";
|
|
43
|
+
kind: "channel" | "method" | "state";
|
|
44
|
+
input: boolean | object;
|
|
45
|
+
output?: boolean | object | undefined;
|
|
46
|
+
errors?: boolean | object | undefined;
|
|
47
|
+
}[];
|
|
48
|
+
dynamic: string[];
|
|
49
|
+
gaps?: string[] | undefined;
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { apiContracts as default };
|
|
53
|
+
//# sourceMappingURL=apiContracts.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineApiContract } from "@agimon-ai/doompi-core/apiContracts";
|
|
2
|
+
//#region src/schemas/apiContracts.ts
|
|
3
|
+
/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
4
|
+
const apiContracts = defineApiContract({
|
|
5
|
+
version: 1,
|
|
6
|
+
http: [],
|
|
7
|
+
sockets: [],
|
|
8
|
+
dynamic: []
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { apiContracts, apiContracts as default };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=apiContracts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/doompi-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
|
package/dist/apply.cjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_applyDomains = require("./applyDomains-L5ywYh8d.cjs");
|
|
3
|
+
exports.applyDomains = require_applyDomains.applyDomains;
|
package/dist/apply.d.mts
CHANGED
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { DoomHarnessContext, HarnessState } from "@agimon-ai/doompi-config/types";
|
|
2
|
+
//#region src/services/applyDomains/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Live domain switching: skills, plugin hooks, MCP config and subagent directories.
|
|
5
|
+
*
|
|
6
|
+
* Writes through the harness state module and relies on Pi's reload
|
|
7
|
+
* re-executing extension modules. The replacement Config factory publishes the
|
|
8
|
+
* persisted MCP projection on the new session's Cordis root.
|
|
9
|
+
*
|
|
10
|
+
* What reload cannot do is change the SET of loaded extensions: Pi freezes the
|
|
11
|
+
* CLI --extension list at construction and re-resolves that same array on every
|
|
12
|
+
* reload. Callers report those parts as needing a relaunch instead of pretending
|
|
13
|
+
* they applied.
|
|
14
|
+
*
|
|
15
|
+
* The major-mode and profile switches live in
|
|
16
|
+
* @agimon-ai/doompi-config/selectionSwitch: they are config writes with no
|
|
17
|
+
* resource staging, and the synced startup path applies them before any command
|
|
18
|
+
* exists to run. Domains stays here because it stages plugins, skills and MCP
|
|
19
|
+
* config.
|
|
20
|
+
*/
|
|
21
|
+
export declare function applyDomains(domainNames: string[], state: DoomHarnessContext): Promise<HarnessState>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//# sourceMappingURL=apply.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.d.mts","names":[],"sources":["../src/services/applyDomains/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBA6BsB,aAAa,uBAAuB,OAAO,qBAAqB,QAAQ"}
|
package/dist/apply.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { t as applyDomains } from "./applyDomains-CSdAZe5P.mjs";
|
|
2
|
+
export { applyDomains };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { o as resolveMcpAllowlist } from "./mcpFilter-ChoM_vWa.mjs";
|
|
2
|
+
import { t as materializePluginEntries } from "./pluginMaterializer-D9qFOmKW.mjs";
|
|
3
|
+
import { r as collectResources } from "./resourceCollector-D4b4QO6b.mjs";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { resolvePluginEntries, resolveSharedSkills } from "@agimon-ai/doompi-config/domains";
|
|
7
|
+
import { requireHarnessPaths, updateHarnessState } from "@agimon-ai/doompi-config/harnessStore";
|
|
8
|
+
//#region \0rolldown/runtime.js
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __exportAll = (all, no_symbols) => {
|
|
11
|
+
let target = {};
|
|
12
|
+
for (var name in all) __defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/services/applyDomains/index.ts
|
|
21
|
+
var applyDomains_exports = /* @__PURE__ */ __exportAll({ applyDomains: () => applyDomains });
|
|
22
|
+
/**
|
|
23
|
+
* Live domain switching: skills, plugin hooks, MCP config and subagent directories.
|
|
24
|
+
*
|
|
25
|
+
* Writes through the harness state module and relies on Pi's reload
|
|
26
|
+
* re-executing extension modules. The replacement Config factory publishes the
|
|
27
|
+
* persisted MCP projection on the new session's Cordis root.
|
|
28
|
+
*
|
|
29
|
+
* What reload cannot do is change the SET of loaded extensions: Pi freezes the
|
|
30
|
+
* CLI --extension list at construction and re-resolves that same array on every
|
|
31
|
+
* reload. Callers report those parts as needing a relaunch instead of pretending
|
|
32
|
+
* they applied.
|
|
33
|
+
*
|
|
34
|
+
* The major-mode and profile switches live in
|
|
35
|
+
* @agimon-ai/doompi-config/selectionSwitch: they are config writes with no
|
|
36
|
+
* resource staging, and the synced startup path applies them before any command
|
|
37
|
+
* exists to run. Domains stays here because it stages plugins, skills and MCP
|
|
38
|
+
* config.
|
|
39
|
+
*/
|
|
40
|
+
async function applyDomains(domainNames, state) {
|
|
41
|
+
const { root, temporaryDirectory } = requireHarnessPaths(state);
|
|
42
|
+
const pluginEntries = await materializePluginEntries(resolvePluginEntries(root, domainNames, [...state.pluginDirectories]));
|
|
43
|
+
const mcpAllowlist = resolveMcpAllowlist(root, domainNames);
|
|
44
|
+
const candidateDirectory = await fs.promises.mkdtemp(path.join(temporaryDirectory, "domains-"));
|
|
45
|
+
let resources;
|
|
46
|
+
try {
|
|
47
|
+
resources = await collectResources(root, pluginEntries, {
|
|
48
|
+
agents: state.agents,
|
|
49
|
+
mcp: state.mcp,
|
|
50
|
+
temporaryDirectory: candidateDirectory,
|
|
51
|
+
sharedSkills: resolveSharedSkills(root, domainNames),
|
|
52
|
+
mcpAllowlist
|
|
53
|
+
});
|
|
54
|
+
} catch (error) {
|
|
55
|
+
await fs.promises.rm(candidateDirectory, {
|
|
56
|
+
recursive: true,
|
|
57
|
+
force: true
|
|
58
|
+
});
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
let updated;
|
|
62
|
+
try {
|
|
63
|
+
updated = updateHarnessState({
|
|
64
|
+
domains: domainNames,
|
|
65
|
+
skillDirectories: resources.skillDirectories,
|
|
66
|
+
agentDirectories: resources.agentDirectories,
|
|
67
|
+
pluginHooks: resources.pluginHooks,
|
|
68
|
+
mcpConfigPath: resources.mcpConfigPath,
|
|
69
|
+
mcpProjection: resources.mcpProjection
|
|
70
|
+
});
|
|
71
|
+
} catch (error) {
|
|
72
|
+
await fs.promises.rm(candidateDirectory, {
|
|
73
|
+
recursive: true,
|
|
74
|
+
force: true
|
|
75
|
+
});
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
process.env.PI_SUBAGENT_EXTRA_AGENT_DIRS = resources.agentDirectories.join(path.delimiter);
|
|
79
|
+
process.env.PI_SUBAGENT_EXTRA_SKILL_DIRS = resources.skillDirectories.join(path.delimiter);
|
|
80
|
+
return updated;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { applyDomains_exports as n, applyDomains as t };
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=applyDomains-CSdAZe5P.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyDomains-CSdAZe5P.mjs","names":[],"sources":["../src/services/applyDomains/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { resolvePluginEntries, resolveSharedSkills } from '@agimon-ai/doompi-config/domains';\nimport { requireHarnessPaths, updateHarnessState } from '@agimon-ai/doompi-config/harnessStore';\nimport type { DoomHarnessContext, HarnessState } from '@agimon-ai/doompi-config/types';\n\nimport { resolveMcpAllowlist } from '../mcpFilter';\nimport { materializePluginEntries } from '../pluginMaterializer';\nimport { collectResources } from '../resourceCollector';\n\n/**\n * Live domain switching: skills, plugin hooks, MCP config and subagent directories.\n *\n * Writes through the harness state module and relies on Pi's reload\n * re-executing extension modules. The replacement Config factory publishes the\n * persisted MCP projection on the new session's Cordis root.\n *\n * What reload cannot do is change the SET of loaded extensions: Pi freezes the\n * CLI --extension list at construction and re-resolves that same array on every\n * reload. Callers report those parts as needing a relaunch instead of pretending\n * they applied.\n *\n * The major-mode and profile switches live in\n * @agimon-ai/doompi-config/selectionSwitch: they are config writes with no\n * resource staging, and the synced startup path applies them before any command\n * exists to run. Domains stays here because it stages plugins, skills and MCP\n * config.\n */\nexport async function applyDomains(domainNames: string[], state: DoomHarnessContext): Promise<HarnessState> {\n const { root, temporaryDirectory } = requireHarnessPaths(state);\n\n const pluginEntries = await materializePluginEntries(\n resolvePluginEntries(root, domainNames, [...state.pluginDirectories]),\n );\n const mcpAllowlist = resolveMcpAllowlist(root, domainNames);\n // Keep the active generation untouched while the candidate is parsed and\n // normalized. Pi's reload later removes the whole process-owned run root, so\n // retired generations need no eager destructive cleanup here.\n const candidateDirectory = await fs.promises.mkdtemp(path.join(temporaryDirectory, 'domains-'));\n let resources: Awaited<ReturnType<typeof collectResources>>;\n try {\n resources = await collectResources(root, pluginEntries, {\n agents: state.agents,\n mcp: state.mcp,\n temporaryDirectory: candidateDirectory,\n sharedSkills: resolveSharedSkills(root, domainNames),\n mcpAllowlist,\n });\n } catch (error) {\n await fs.promises.rm(candidateDirectory, { recursive: true, force: true });\n throw error;\n }\n\n let updated: HarnessState;\n try {\n updated = updateHarnessState({\n domains: domainNames,\n skillDirectories: resources.skillDirectories,\n agentDirectories: resources.agentDirectories,\n pluginHooks: resources.pluginHooks,\n mcpConfigPath: resources.mcpConfigPath,\n mcpProjection: resources.mcpProjection,\n });\n } catch (error) {\n await fs.promises.rm(candidateDirectory, { recursive: true, force: true });\n throw error;\n }\n process.env.PI_SUBAGENT_EXTRA_AGENT_DIRS = resources.agentDirectories.join(path.delimiter);\n process.env.PI_SUBAGENT_EXTRA_SKILL_DIRS = resources.skillDirectories.join(path.delimiter);\n return updated;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,eAAsB,aAAa,aAAuB,OAAkD;CAC1G,MAAM,EAAE,MAAM,uBAAuB,oBAAoB,KAAK;CAE9D,MAAM,gBAAgB,MAAM,yBAC1B,qBAAqB,MAAM,aAAa,CAAC,GAAG,MAAM,iBAAiB,CAAC,CACtE;CACA,MAAM,eAAe,oBAAoB,MAAM,WAAW;CAI1D,MAAM,qBAAqB,MAAM,GAAG,SAAS,QAAQ,KAAK,KAAK,oBAAoB,UAAU,CAAC;CAC9F,IAAI;CACJ,IAAI;EACF,YAAY,MAAM,iBAAiB,MAAM,eAAe;GACtD,QAAQ,MAAM;GACd,KAAK,MAAM;GACX,oBAAoB;GACpB,cAAc,oBAAoB,MAAM,WAAW;GACnD;EACF,CAAC;CACH,SAAS,OAAO;EACd,MAAM,GAAG,SAAS,GAAG,oBAAoB;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EACzE,MAAM;CACR;CAEA,IAAI;CACJ,IAAI;EACF,UAAU,mBAAmB;GAC3B,SAAS;GACT,kBAAkB,UAAU;GAC5B,kBAAkB,UAAU;GAC5B,aAAa,UAAU;GACvB,eAAe,UAAU;GACzB,eAAe,UAAU;EAC3B,CAAC;CACH,SAAS,OAAO;EACd,MAAM,GAAG,SAAS,GAAG,oBAAoB;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EACzE,MAAM;CACR;CACA,QAAQ,IAAI,+BAA+B,UAAU,iBAAiB,KAAK,KAAK,SAAS;CACzF,QAAQ,IAAI,+BAA+B,UAAU,iBAAiB,KAAK,KAAK,SAAS;CACzF,OAAO;AACT"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
2
|
+
const require_mcpFilter = require("./mcpFilter-CsTk699I.cjs");
|
|
3
|
+
const require_pluginMaterializer = require("./pluginMaterializer-D4xOC_Oc.cjs");
|
|
4
|
+
const require_resourceCollector = require("./resourceCollector-Bj_pmQ4Q.cjs");
|
|
5
|
+
let node_fs = require("node:fs");
|
|
6
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
7
|
+
let node_path = require("node:path");
|
|
8
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
9
|
+
let _agimon_ai_doompi_config_domains = require("@agimon-ai/doompi-config/domains");
|
|
10
|
+
let _agimon_ai_doompi_config_harnessStore = require("@agimon-ai/doompi-config/harnessStore");
|
|
11
|
+
//#region src/services/applyDomains/index.ts
|
|
12
|
+
var applyDomains_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ applyDomains: () => applyDomains });
|
|
13
|
+
/**
|
|
14
|
+
* Live domain switching: skills, plugin hooks, MCP config and subagent directories.
|
|
15
|
+
*
|
|
16
|
+
* Writes through the harness state module and relies on Pi's reload
|
|
17
|
+
* re-executing extension modules. The replacement Config factory publishes the
|
|
18
|
+
* persisted MCP projection on the new session's Cordis root.
|
|
19
|
+
*
|
|
20
|
+
* What reload cannot do is change the SET of loaded extensions: Pi freezes the
|
|
21
|
+
* CLI --extension list at construction and re-resolves that same array on every
|
|
22
|
+
* reload. Callers report those parts as needing a relaunch instead of pretending
|
|
23
|
+
* they applied.
|
|
24
|
+
*
|
|
25
|
+
* The major-mode and profile switches live in
|
|
26
|
+
* @agimon-ai/doompi-config/selectionSwitch: they are config writes with no
|
|
27
|
+
* resource staging, and the synced startup path applies them before any command
|
|
28
|
+
* exists to run. Domains stays here because it stages plugins, skills and MCP
|
|
29
|
+
* config.
|
|
30
|
+
*/
|
|
31
|
+
async function applyDomains(domainNames, state) {
|
|
32
|
+
const { root, temporaryDirectory } = (0, _agimon_ai_doompi_config_harnessStore.requireHarnessPaths)(state);
|
|
33
|
+
const pluginEntries = await require_pluginMaterializer.materializePluginEntries((0, _agimon_ai_doompi_config_domains.resolvePluginEntries)(root, domainNames, [...state.pluginDirectories]));
|
|
34
|
+
const mcpAllowlist = require_mcpFilter.resolveMcpAllowlist(root, domainNames);
|
|
35
|
+
const candidateDirectory = await node_fs.default.promises.mkdtemp(node_path.default.join(temporaryDirectory, "domains-"));
|
|
36
|
+
let resources;
|
|
37
|
+
try {
|
|
38
|
+
resources = await require_resourceCollector.collectResources(root, pluginEntries, {
|
|
39
|
+
agents: state.agents,
|
|
40
|
+
mcp: state.mcp,
|
|
41
|
+
temporaryDirectory: candidateDirectory,
|
|
42
|
+
sharedSkills: (0, _agimon_ai_doompi_config_domains.resolveSharedSkills)(root, domainNames),
|
|
43
|
+
mcpAllowlist
|
|
44
|
+
});
|
|
45
|
+
} catch (error) {
|
|
46
|
+
await node_fs.default.promises.rm(candidateDirectory, {
|
|
47
|
+
recursive: true,
|
|
48
|
+
force: true
|
|
49
|
+
});
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
let updated;
|
|
53
|
+
try {
|
|
54
|
+
updated = (0, _agimon_ai_doompi_config_harnessStore.updateHarnessState)({
|
|
55
|
+
domains: domainNames,
|
|
56
|
+
skillDirectories: resources.skillDirectories,
|
|
57
|
+
agentDirectories: resources.agentDirectories,
|
|
58
|
+
pluginHooks: resources.pluginHooks,
|
|
59
|
+
mcpConfigPath: resources.mcpConfigPath,
|
|
60
|
+
mcpProjection: resources.mcpProjection
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
await node_fs.default.promises.rm(candidateDirectory, {
|
|
64
|
+
recursive: true,
|
|
65
|
+
force: true
|
|
66
|
+
});
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
process.env.PI_SUBAGENT_EXTRA_AGENT_DIRS = resources.agentDirectories.join(node_path.default.delimiter);
|
|
70
|
+
process.env.PI_SUBAGENT_EXTRA_SKILL_DIRS = resources.skillDirectories.join(node_path.default.delimiter);
|
|
71
|
+
return updated;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
Object.defineProperty(exports, "applyDomains", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function() {
|
|
77
|
+
return applyDomains;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, "applyDomains_exports", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function() {
|
|
83
|
+
return applyDomains_exports;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=applyDomains-L5ywYh8d.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyDomains-L5ywYh8d.cjs","names":["requireHarnessPaths","materializePluginEntries","resolvePluginEntries","resolveMcpAllowlist","fs","path","collectResources","resolveSharedSkills","updateHarnessState"],"sources":["../src/services/applyDomains/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { resolvePluginEntries, resolveSharedSkills } from '@agimon-ai/doompi-config/domains';\nimport { requireHarnessPaths, updateHarnessState } from '@agimon-ai/doompi-config/harnessStore';\nimport type { DoomHarnessContext, HarnessState } from '@agimon-ai/doompi-config/types';\n\nimport { resolveMcpAllowlist } from '../mcpFilter';\nimport { materializePluginEntries } from '../pluginMaterializer';\nimport { collectResources } from '../resourceCollector';\n\n/**\n * Live domain switching: skills, plugin hooks, MCP config and subagent directories.\n *\n * Writes through the harness state module and relies on Pi's reload\n * re-executing extension modules. The replacement Config factory publishes the\n * persisted MCP projection on the new session's Cordis root.\n *\n * What reload cannot do is change the SET of loaded extensions: Pi freezes the\n * CLI --extension list at construction and re-resolves that same array on every\n * reload. Callers report those parts as needing a relaunch instead of pretending\n * they applied.\n *\n * The major-mode and profile switches live in\n * @agimon-ai/doompi-config/selectionSwitch: they are config writes with no\n * resource staging, and the synced startup path applies them before any command\n * exists to run. Domains stays here because it stages plugins, skills and MCP\n * config.\n */\nexport async function applyDomains(domainNames: string[], state: DoomHarnessContext): Promise<HarnessState> {\n const { root, temporaryDirectory } = requireHarnessPaths(state);\n\n const pluginEntries = await materializePluginEntries(\n resolvePluginEntries(root, domainNames, [...state.pluginDirectories]),\n );\n const mcpAllowlist = resolveMcpAllowlist(root, domainNames);\n // Keep the active generation untouched while the candidate is parsed and\n // normalized. Pi's reload later removes the whole process-owned run root, so\n // retired generations need no eager destructive cleanup here.\n const candidateDirectory = await fs.promises.mkdtemp(path.join(temporaryDirectory, 'domains-'));\n let resources: Awaited<ReturnType<typeof collectResources>>;\n try {\n resources = await collectResources(root, pluginEntries, {\n agents: state.agents,\n mcp: state.mcp,\n temporaryDirectory: candidateDirectory,\n sharedSkills: resolveSharedSkills(root, domainNames),\n mcpAllowlist,\n });\n } catch (error) {\n await fs.promises.rm(candidateDirectory, { recursive: true, force: true });\n throw error;\n }\n\n let updated: HarnessState;\n try {\n updated = updateHarnessState({\n domains: domainNames,\n skillDirectories: resources.skillDirectories,\n agentDirectories: resources.agentDirectories,\n pluginHooks: resources.pluginHooks,\n mcpConfigPath: resources.mcpConfigPath,\n mcpProjection: resources.mcpProjection,\n });\n } catch (error) {\n await fs.promises.rm(candidateDirectory, { recursive: true, force: true });\n throw error;\n }\n process.env.PI_SUBAGENT_EXTRA_AGENT_DIRS = resources.agentDirectories.join(path.delimiter);\n process.env.PI_SUBAGENT_EXTRA_SKILL_DIRS = resources.skillDirectories.join(path.delimiter);\n return updated;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,eAAsB,aAAa,aAAuB,OAAkD;CAC1G,MAAM,EAAE,MAAM,wBAAA,GAAuBA,sCAAAA,oBAAAA,CAAoB,KAAK;CAE9D,MAAM,gBAAgB,MAAMC,2BAAAA,0BAAAA,GAC1BC,iCAAAA,qBAAAA,CAAqB,MAAM,aAAa,CAAC,GAAG,MAAM,iBAAiB,CAAC,CACtE;CACA,MAAM,eAAeC,kBAAAA,oBAAoB,MAAM,WAAW;CAI1D,MAAM,qBAAqB,MAAMC,QAAAA,QAAG,SAAS,QAAQC,UAAAA,QAAK,KAAK,oBAAoB,UAAU,CAAC;CAC9F,IAAI;CACJ,IAAI;EACF,YAAY,MAAMC,0BAAAA,iBAAiB,MAAM,eAAe;GACtD,QAAQ,MAAM;GACd,KAAK,MAAM;GACX,oBAAoB;GACpB,eAAA,GAAcC,iCAAAA,oBAAAA,CAAoB,MAAM,WAAW;GACnD;EACF,CAAC;CACH,SAAS,OAAO;EACd,MAAMH,QAAAA,QAAG,SAAS,GAAG,oBAAoB;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EACzE,MAAM;CACR;CAEA,IAAI;CACJ,IAAI;EACF,WAAA,GAAUI,sCAAAA,mBAAAA,CAAmB;GAC3B,SAAS;GACT,kBAAkB,UAAU;GAC5B,kBAAkB,UAAU;GAC5B,aAAa,UAAU;GACvB,eAAe,UAAU;GACzB,eAAe,UAAU;EAC3B,CAAC;CACH,SAAS,OAAO;EACd,MAAMJ,QAAAA,QAAG,SAAS,GAAG,oBAAoB;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EACzE,MAAM;CACR;CACA,QAAQ,IAAI,+BAA+B,UAAU,iBAAiB,KAAKC,UAAAA,QAAK,SAAS;CACzF,QAAQ,IAAI,+BAA+B,UAAU,iBAAiB,KAAKA,UAAAA,QAAK,SAAS;CACzF,OAAO;AACT"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
let _agimon_ai_doompi_core_voiceTools = require("@agimon-ai/doompi-core/voiceTools");
|
|
2
|
+
//#region src/types/domains.ts
|
|
3
|
+
/** The npm name this package registers its voice tools and contributions under. */
|
|
4
|
+
const DOMAIN_SOURCE = "@agimon-ai/doompi-domain";
|
|
5
|
+
/**
|
|
6
|
+
* The only names a domain, an operation or a handoff token may carry.
|
|
7
|
+
*
|
|
8
|
+
* Selections arrive from the model and from the command line, and every one of
|
|
9
|
+
* them ends up in a filesystem path or a process environment variable, so the
|
|
10
|
+
* shape is constrained once here and reused by the schema and the validator.
|
|
11
|
+
*/
|
|
12
|
+
const SAFE_DOMAIN_NAME = /^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$/u;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/services/domainText/index.ts
|
|
15
|
+
const DOMAIN_SEPARATOR = ",";
|
|
16
|
+
const DOMAIN_COMMAND = "domains";
|
|
17
|
+
/** Footer status key the cockpit's domains axis reads. */
|
|
18
|
+
const DOMAIN_STATUS_KEY = "doom-domain";
|
|
19
|
+
const VOICE_SWITCH_TOKEN_PREFIX = "--voice-switch-token=";
|
|
20
|
+
/** What an empty selection reads as, which is a real state rather than an error. */
|
|
21
|
+
const NONE = "(none)";
|
|
22
|
+
/** Splits the comma-separated argument the command and the autocomplete share. */
|
|
23
|
+
function splitDomains(value) {
|
|
24
|
+
return value.split(DOMAIN_SEPARATOR).map((item) => item.trim()).filter(Boolean);
|
|
25
|
+
}
|
|
26
|
+
/** The published axis content: the active domains in the same comma-separated shape splitDomains reads. */
|
|
27
|
+
function domainStatus(domains) {
|
|
28
|
+
return domains.join(DOMAIN_SEPARATOR);
|
|
29
|
+
}
|
|
30
|
+
/** Picker rows for the domain multi-select. */
|
|
31
|
+
function domainItems(names, descriptions = {}) {
|
|
32
|
+
return names.map((name) => ({
|
|
33
|
+
value: name,
|
|
34
|
+
label: name,
|
|
35
|
+
...descriptions[name] ? { description: descriptions[name] } : {}
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
function domainSummary(listing) {
|
|
39
|
+
return `Active domains: ${listing.effective.join(", ") || "(none)"}\nAvailable domains: ${listing.available.join(", ")}\nUse /${DOMAIN_COMMAND} <name[,name...]> to switch.`;
|
|
40
|
+
}
|
|
41
|
+
function switchedSummary(domains) {
|
|
42
|
+
return `Switched domains to: ${domains.join(", ") || "(none)"}`;
|
|
43
|
+
}
|
|
44
|
+
function unchangedSummary(domains) {
|
|
45
|
+
return `Domains already active: ${domains.join(", ") || "(none)"}`;
|
|
46
|
+
}
|
|
47
|
+
function pickerTitle(listing) {
|
|
48
|
+
return `Domains (active: ${listing.effective.join(", ") || "(none)"})`;
|
|
49
|
+
}
|
|
50
|
+
const MARK_ON = "[x]";
|
|
51
|
+
const MARK_OFF = "[ ]";
|
|
52
|
+
const OPTION_PREFIX = /^\[[ x]\] /;
|
|
53
|
+
/**
|
|
54
|
+
* Rows for a single-pick select where domains compose: each row shows the
|
|
55
|
+
* membership it would flip, so a client without a multi-select still reaches
|
|
56
|
+
* every set one toggle at a time.
|
|
57
|
+
*/
|
|
58
|
+
function domainToggleOptions(listing) {
|
|
59
|
+
const active = new Set(listing.effective);
|
|
60
|
+
return listing.available.map((name) => `${active.has(name) ? MARK_ON : MARK_OFF} ${name}`);
|
|
61
|
+
}
|
|
62
|
+
/** The domain a toggle row names. */
|
|
63
|
+
function toggleOptionDomain(option) {
|
|
64
|
+
return option.replace(OPTION_PREFIX, "").trim();
|
|
65
|
+
}
|
|
66
|
+
/** The effective set with one domain flipped, order preserved for the rest. */
|
|
67
|
+
function toggledDomains(effective, name) {
|
|
68
|
+
return effective.includes(name) ? effective.filter((domain) => domain !== name) : [...effective, name];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Deduplicates a requested selection and rejects anything unsafe.
|
|
72
|
+
*
|
|
73
|
+
* Bounded before the manifest is read, because a selection large enough to
|
|
74
|
+
* matter comes from the model rather than from a person typing the command.
|
|
75
|
+
*/
|
|
76
|
+
function normalizeDomainNames(values) {
|
|
77
|
+
if (values.length > _agimon_ai_doompi_core_voiceTools.VOICE_TOOL_MAX_DOMAIN_COUNT) throw new Error(`A maximum of ${_agimon_ai_doompi_core_voiceTools.VOICE_TOOL_MAX_DOMAIN_COUNT} domains may be selected.`);
|
|
78
|
+
const result = [];
|
|
79
|
+
const seen = /* @__PURE__ */ new Set();
|
|
80
|
+
for (const value of values) {
|
|
81
|
+
const name = value.trim();
|
|
82
|
+
if (!name || name.length > _agimon_ai_doompi_core_voiceTools.VOICE_TOOL_MAX_IDENTIFIER_LENGTH || !SAFE_DOMAIN_NAME.test(name)) throw new Error(`Invalid domain name: ${value}`);
|
|
83
|
+
if (seen.has(name)) continue;
|
|
84
|
+
seen.add(name);
|
|
85
|
+
result.push(name);
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
/** The opaque token a voice switch hands to the follow-up command invocation. */
|
|
90
|
+
function voiceSwitchToken(args) {
|
|
91
|
+
const trimmed = args.trim();
|
|
92
|
+
if (!trimmed.startsWith("--voice-switch-token=")) return void 0;
|
|
93
|
+
const parts = trimmed.split(/\s+/u);
|
|
94
|
+
if (parts.length !== 1) throw new Error("The voice domain switch token must be the only command argument.");
|
|
95
|
+
const token = parts[0]?.slice(21).trim();
|
|
96
|
+
if (!token) throw new Error("The voice domain switch token is missing.");
|
|
97
|
+
return token;
|
|
98
|
+
}
|
|
99
|
+
function errorMessage(error) {
|
|
100
|
+
return error instanceof Error ? error.message : String(error);
|
|
101
|
+
}
|
|
102
|
+
function transitionError(result) {
|
|
103
|
+
return /* @__PURE__ */ new Error(`Domain transition was ${result.outcome}: ${result.diagnostics.join(", ")}`);
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
Object.defineProperty(exports, "DOMAIN_COMMAND", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function() {
|
|
109
|
+
return DOMAIN_COMMAND;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(exports, "DOMAIN_SOURCE", {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
get: function() {
|
|
115
|
+
return DOMAIN_SOURCE;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "DOMAIN_STATUS_KEY", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function() {
|
|
121
|
+
return DOMAIN_STATUS_KEY;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(exports, "NONE", {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function() {
|
|
127
|
+
return NONE;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(exports, "SAFE_DOMAIN_NAME", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function() {
|
|
133
|
+
return SAFE_DOMAIN_NAME;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
Object.defineProperty(exports, "VOICE_SWITCH_TOKEN_PREFIX", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function() {
|
|
139
|
+
return VOICE_SWITCH_TOKEN_PREFIX;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(exports, "domainItems", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function() {
|
|
145
|
+
return domainItems;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(exports, "domainStatus", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function() {
|
|
151
|
+
return domainStatus;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(exports, "domainSummary", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function() {
|
|
157
|
+
return domainSummary;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, "domainToggleOptions", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function() {
|
|
163
|
+
return domainToggleOptions;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(exports, "errorMessage", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
get: function() {
|
|
169
|
+
return errorMessage;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(exports, "normalizeDomainNames", {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function() {
|
|
175
|
+
return normalizeDomainNames;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, "pickerTitle", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function() {
|
|
181
|
+
return pickerTitle;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(exports, "splitDomains", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function() {
|
|
187
|
+
return splitDomains;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
Object.defineProperty(exports, "switchedSummary", {
|
|
191
|
+
enumerable: true,
|
|
192
|
+
get: function() {
|
|
193
|
+
return switchedSummary;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(exports, "toggleOptionDomain", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
get: function() {
|
|
199
|
+
return toggleOptionDomain;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(exports, "toggledDomains", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
get: function() {
|
|
205
|
+
return toggledDomains;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(exports, "transitionError", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function() {
|
|
211
|
+
return transitionError;
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(exports, "unchangedSummary", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
get: function() {
|
|
217
|
+
return unchangedSummary;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(exports, "voiceSwitchToken", {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
get: function() {
|
|
223
|
+
return voiceSwitchToken;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
//# sourceMappingURL=domainText-DOsRzOiP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domainText-DOsRzOiP.cjs","names":["VOICE_TOOL_MAX_DOMAIN_COUNT","VOICE_TOOL_MAX_IDENTIFIER_LENGTH"],"sources":["../src/types/domains.ts","../src/services/domainText/index.ts"],"sourcesContent":["/** The npm name this package registers its voice tools and contributions under. */\nexport const DOMAIN_SOURCE = '@agimon-ai/doompi-domain';\n\n/**\n * The only names a domain, an operation or a handoff token may carry.\n *\n * Selections arrive from the model and from the command line, and every one of\n * them ends up in a filesystem path or a process environment variable, so the\n * shape is constrained once here and reused by the schema and the validator.\n */\nexport const SAFE_DOMAIN_NAME = /^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$/u;\n\n/**\n * The selection as the command, the picker and the voice tool all need to see it.\n *\n * `active` is what the session persisted and `effective` is what it is running\n * with, which differ while a major mode contributes its default domains.\n */\nexport interface DomainListing {\n readonly active: string[];\n readonly effective: string[];\n readonly available: string[];\n}\n\n/** One comma-triggered autocomplete response for the `/domains` argument. */\nexport interface DomainCompletion {\n readonly prefix: string;\n readonly items: Array<{ value: string; label: string }>;\n}\n","import type { DoomTransitionResult } from '@agimon-ai/doompi-core/transition';\nimport { VOICE_TOOL_MAX_DOMAIN_COUNT, VOICE_TOOL_MAX_IDENTIFIER_LENGTH } from '@agimon-ai/doompi-core/voiceTools';\nimport type { SelectItem } from '@earendil-works/pi-tui';\n\nimport { type DomainListing, SAFE_DOMAIN_NAME } from '../../types/domains';\n\nconst DOMAIN_SEPARATOR = ',';\nexport const DOMAIN_COMMAND = 'domains';\n/** Footer status key the cockpit's domains axis reads. */\nexport const DOMAIN_STATUS_KEY = 'doom-domain';\nexport const VOICE_SWITCH_TOKEN_PREFIX = '--voice-switch-token=';\n/** What an empty selection reads as, which is a real state rather than an error. */\nexport const NONE = '(none)';\n\n/** Splits the comma-separated argument the command and the autocomplete share. */\nexport function splitDomains(value: string): string[] {\n return value\n .split(DOMAIN_SEPARATOR)\n .map((item) => item.trim())\n .filter(Boolean);\n}\n\n/** The published axis content: the active domains in the same comma-separated shape splitDomains reads. */\nexport function domainStatus(domains: readonly string[]): string {\n return domains.join(DOMAIN_SEPARATOR);\n}\n\n/** Picker rows for the domain multi-select. */\nexport function domainItems(\n names: string[],\n descriptions: Readonly<Record<string, string | undefined>> = {},\n): SelectItem[] {\n return names.map((name) => ({\n value: name,\n label: name,\n ...(descriptions[name] ? { description: descriptions[name] } : {}),\n }));\n}\n\nexport function domainSummary(listing: DomainListing): string {\n const active = listing.effective.join(', ') || NONE;\n return `Active domains: ${active}\\nAvailable domains: ${listing.available.join(', ')}\\nUse /${DOMAIN_COMMAND} <name[,name...]> to switch.`;\n}\n\nexport function switchedSummary(domains: readonly string[]): string {\n return `Switched domains to: ${domains.join(', ') || NONE}`;\n}\n\nexport function unchangedSummary(domains: readonly string[]): string {\n return `Domains already active: ${domains.join(', ') || NONE}`;\n}\n\nexport function pickerTitle(listing: DomainListing): string {\n return `Domains (active: ${listing.effective.join(', ') || NONE})`;\n}\n\nconst MARK_ON = '[x]';\nconst MARK_OFF = '[ ]';\nconst OPTION_PREFIX = /^\\[[ x]\\] /;\n\n/**\n * Rows for a single-pick select where domains compose: each row shows the\n * membership it would flip, so a client without a multi-select still reaches\n * every set one toggle at a time.\n */\nexport function domainToggleOptions(listing: DomainListing): string[] {\n const active = new Set(listing.effective);\n return listing.available.map((name) => `${active.has(name) ? MARK_ON : MARK_OFF} ${name}`);\n}\n\n/** The domain a toggle row names. */\nexport function toggleOptionDomain(option: string): string {\n return option.replace(OPTION_PREFIX, '').trim();\n}\n\n/** The effective set with one domain flipped, order preserved for the rest. */\nexport function toggledDomains(effective: readonly string[], name: string): string[] {\n return effective.includes(name) ? effective.filter((domain) => domain !== name) : [...effective, name];\n}\n\n/**\n * Deduplicates a requested selection and rejects anything unsafe.\n *\n * Bounded before the manifest is read, because a selection large enough to\n * matter comes from the model rather than from a person typing the command.\n */\nexport function normalizeDomainNames(values: readonly string[]): string[] {\n if (values.length > VOICE_TOOL_MAX_DOMAIN_COUNT) {\n throw new Error(`A maximum of ${VOICE_TOOL_MAX_DOMAIN_COUNT} domains may be selected.`);\n }\n const result: string[] = [];\n const seen = new Set<string>();\n for (const value of values) {\n const name = value.trim();\n if (!name || name.length > VOICE_TOOL_MAX_IDENTIFIER_LENGTH || !SAFE_DOMAIN_NAME.test(name)) {\n throw new Error(`Invalid domain name: ${value}`);\n }\n if (seen.has(name)) continue;\n seen.add(name);\n result.push(name);\n }\n return result;\n}\n\n/** The opaque token a voice switch hands to the follow-up command invocation. */\nexport function voiceSwitchToken(args: string): string | undefined {\n const trimmed = args.trim();\n if (!trimmed.startsWith(VOICE_SWITCH_TOKEN_PREFIX)) return undefined;\n const parts = trimmed.split(/\\s+/u);\n if (parts.length !== 1) throw new Error('The voice domain switch token must be the only command argument.');\n const token = parts[0]?.slice(VOICE_SWITCH_TOKEN_PREFIX.length).trim();\n if (!token) throw new Error('The voice domain switch token is missing.');\n return token;\n}\n\nexport function errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport function transitionError(result: DoomTransitionResult): Error {\n return new Error(`Domain transition was ${result.outcome}: ${result.diagnostics.join(', ')}`);\n}\n"],"mappings":";;;AACA,MAAa,gBAAgB;;;;;;;;AAS7B,MAAa,mBAAmB;;;ACJhC,MAAM,mBAAmB;AACzB,MAAa,iBAAiB;;AAE9B,MAAa,oBAAoB;AACjC,MAAa,4BAA4B;;AAEzC,MAAa,OAAO;;AAGpB,SAAgB,aAAa,OAAyB;CACpD,OAAO,MACJ,MAAM,gBAAgB,CAAC,CACvB,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,OAAO,OAAO;AACnB;;AAGA,SAAgB,aAAa,SAAoC;CAC/D,OAAO,QAAQ,KAAK,gBAAgB;AACtC;;AAGA,SAAgB,YACd,OACA,eAA6D,CAAC,GAChD;CACd,OAAO,MAAM,KAAK,UAAU;EAC1B,OAAO;EACP,OAAO;EACP,GAAI,aAAa,QAAQ,EAAE,aAAa,aAAa,MAAM,IAAI,CAAC;CAClE,EAAE;AACJ;AAEA,SAAgB,cAAc,SAAgC;CAE5D,OAAO,mBADQ,QAAQ,UAAU,KAAK,IAAI,KAAA,SACT,uBAAuB,QAAQ,UAAU,KAAK,IAAI,EAAE,SAAS,eAAe;AAC/G;AAEA,SAAgB,gBAAgB,SAAoC;CAClE,OAAO,wBAAwB,QAAQ,KAAK,IAAI,KAAA;AAClD;AAEA,SAAgB,iBAAiB,SAAoC;CACnE,OAAO,2BAA2B,QAAQ,KAAK,IAAI,KAAA;AACrD;AAEA,SAAgB,YAAY,SAAgC;CAC1D,OAAO,oBAAoB,QAAQ,UAAU,KAAK,IAAI,KAAA,SAAU;AAClE;AAEA,MAAM,UAAU;AAChB,MAAM,WAAW;AACjB,MAAM,gBAAgB;;;;;;AAOtB,SAAgB,oBAAoB,SAAkC;CACpE,MAAM,SAAS,IAAI,IAAI,QAAQ,SAAS;CACxC,OAAO,QAAQ,UAAU,KAAK,SAAS,GAAG,OAAO,IAAI,IAAI,IAAI,UAAU,SAAS,GAAG,MAAM;AAC3F;;AAGA,SAAgB,mBAAmB,QAAwB;CACzD,OAAO,OAAO,QAAQ,eAAe,EAAE,CAAC,CAAC,KAAK;AAChD;;AAGA,SAAgB,eAAe,WAA8B,MAAwB;CACnF,OAAO,UAAU,SAAS,IAAI,IAAI,UAAU,QAAQ,WAAW,WAAW,IAAI,IAAI,CAAC,GAAG,WAAW,IAAI;AACvG;;;;;;;AAQA,SAAgB,qBAAqB,QAAqC;CACxE,IAAI,OAAO,SAASA,kCAAAA,6BAClB,MAAM,IAAI,MAAM,gBAAgBA,kCAAAA,4BAA4B,0BAA0B;CAExF,MAAM,SAAmB,CAAC;CAC1B,MAAM,uBAAO,IAAI,IAAY;CAC7B,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,OAAO,MAAM,KAAK;EACxB,IAAI,CAAC,QAAQ,KAAK,SAASC,kCAAAA,oCAAoC,CAAC,iBAAiB,KAAK,IAAI,GACxF,MAAM,IAAI,MAAM,wBAAwB,OAAO;EAEjD,IAAI,KAAK,IAAI,IAAI,GAAG;EACpB,KAAK,IAAI,IAAI;EACb,OAAO,KAAK,IAAI;CAClB;CACA,OAAO;AACT;;AAGA,SAAgB,iBAAiB,MAAkC;CACjE,MAAM,UAAU,KAAK,KAAK;CAC1B,IAAI,CAAC,QAAQ,WAAA,uBAAoC,GAAG,OAAO,KAAA;CAC3D,MAAM,QAAQ,QAAQ,MAAM,MAAM;CAClC,IAAI,MAAM,WAAW,GAAG,MAAM,IAAI,MAAM,kEAAkE;CAC1G,MAAM,QAAQ,MAAM,EAAE,EAAE,MAAM,EAAgC,CAAC,CAAC,KAAK;CACrE,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,2CAA2C;CACvE,OAAO;AACT;AAEA,SAAgB,aAAa,OAAwB;CACnD,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;AAEA,SAAgB,gBAAgB,QAAqC;CACnE,uBAAO,IAAI,MAAM,yBAAyB,OAAO,QAAQ,IAAI,OAAO,YAAY,KAAK,IAAI,GAAG;AAC9F"}
|