@agimon-ai/doompi-domain 0.0.1-alpha.6 → 0.0.1-alpha.60
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 +30 -13
- 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-DY2FCwyW.cjs +87 -0
- package/dist/applyDomains-DY2FCwyW.cjs.map +1 -0
- package/dist/applyDomains-ilQ3j-RJ.mjs +85 -0
- package/dist/applyDomains-ilQ3j-RJ.mjs.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 +144 -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 +137 -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 +52 -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-CABxbOYj.cjs +833 -0
- package/dist/resourceCollector-CABxbOYj.cjs.map +1 -0
- package/dist/resourceCollector-Rp68la05.mjs +769 -0
- package/dist/resourceCollector-Rp68la05.mjs.map +1 -0
- package/dist/{types/resources.d.cts → resources-BlKmrq97.d.mts} +3 -3
- package/dist/resources-BlKmrq97.d.mts.map +1 -0
- package/dist/resources.cjs +12 -1
- package/dist/resources.d.mts +41 -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/llms.txt +7 -2
- package/package.json +78 -21
- package/src/prompts/doompi-author-domain/SKILL.md +18 -0
- package/src/prompts/doompi-author-domain/references/domains-contract.md +165 -0
- 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 -3
- 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
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Domain selection for [DoomPi](https://www.npmjs.com/package/@agimon-ai/doompi) sessions.
|
|
4
4
|
|
|
5
|
-
**Domains** are one of the four axes of a DoomPi selection, alongside the major mode, the profile
|
|
6
|
-
and the minor modes. Unlike a major mode, domains compose: a session selects a set of them, and
|
|
7
|
-
union of what they contribute is what the model sees.
|
|
5
|
+
**Domains** are one of the four axes of a DoomPi selection, alongside the major mode, the profile,
|
|
6
|
+
and the minor modes. Unlike a major mode, domains compose: a session selects a set of them, and
|
|
7
|
+
the union of what they contribute is what the model sees.
|
|
8
8
|
|
|
9
9
|
```yaml
|
|
10
10
|
# .doom/domains.yaml
|
|
@@ -14,12 +14,12 @@ plugins:
|
|
|
14
14
|
infra: plugins/infra
|
|
15
15
|
domains:
|
|
16
16
|
development:
|
|
17
|
-
description: Application code, tests and review tooling.
|
|
17
|
+
description: Application code, tests, and review tooling.
|
|
18
18
|
plugins: [frontend]
|
|
19
19
|
mcp:
|
|
20
20
|
servers: [code-intel]
|
|
21
21
|
platform:
|
|
22
|
-
description: Deployment, infrastructure and incident tooling.
|
|
22
|
+
description: Deployment, infrastructure, and incident tooling.
|
|
23
23
|
plugins: [infra]
|
|
24
24
|
aliases:
|
|
25
25
|
everything: [development, platform]
|
|
@@ -27,7 +27,7 @@ aliases:
|
|
|
27
27
|
|
|
28
28
|
## What it registers
|
|
29
29
|
|
|
30
|
-
| Surface |
|
|
30
|
+
| Surface | Behavior |
|
|
31
31
|
| --------------------------- | ------------------------------------------------------------- |
|
|
32
32
|
| `/domains` | prints the selection, or switches to `name[,name...]` |
|
|
33
33
|
| `/domains` with no argument | opens a multi-select picker in the TUI |
|
|
@@ -36,20 +36,26 @@ aliases:
|
|
|
36
36
|
| autocomplete | comma-triggered completion of domain names inside `/domains` |
|
|
37
37
|
| `resources_discover` | re-answers with the current selection's skills after a reload |
|
|
38
38
|
|
|
39
|
+
When the `@agimon-ai/doompi-help` minor mode is active, this package contributes the
|
|
40
|
+
`doompi-author-domain` skill. It provides package-owned guidance for plugin catalogs, domain
|
|
41
|
+
filters, aliases, defaults, shared skills, and MCP scopes in `domains.yaml`. The contribution is
|
|
42
|
+
registered through the session's `doom/help` Cordis service and is withdrawn with this package's
|
|
43
|
+
plugin fiber.
|
|
44
|
+
|
|
39
45
|
## What a switch stages
|
|
40
46
|
|
|
41
47
|
A domain switch is not just a config write, which is why it does not live in
|
|
42
48
|
`@agimon-ai/doompi-config/selectionSwitch` with the major-mode and profile switches. Applying a
|
|
43
49
|
selection:
|
|
44
50
|
|
|
45
|
-
- materializes any remote (
|
|
51
|
+
- materializes any remote (Git or npm) plugins the selected domains name into a content-addressed
|
|
46
52
|
cache guarded by an install marker;
|
|
47
53
|
- discovers the exact `SKILL.md` files behind the selection, through a manifest cache keyed by
|
|
48
54
|
worktree so a second session does not rescan the tree;
|
|
49
55
|
- adapts each plugin's Claude-authored agent definitions into the form Pi loads, and stages them
|
|
50
56
|
privately (`0600`) beside a dispatcher agent;
|
|
51
57
|
- merges the repository and legacy plugin `.mcp.json` layers, and validates root `mcp.json` for
|
|
52
|
-
schema-gated Agent Plugins v1 (including plugin-relative commands, data directories and transport
|
|
58
|
+
schema-gated Agent Plugins v1 (including plugin-relative commands, data directories, and transport
|
|
53
59
|
normalization);
|
|
54
60
|
- applies the selected domains' MCP allowlists and rewrites the proxy's upstream list into a
|
|
55
61
|
private per-run config; and
|
|
@@ -63,16 +69,27 @@ silently lose its tools.
|
|
|
63
69
|
|
|
64
70
|
## Switching from voice
|
|
65
71
|
|
|
66
|
-
The voice tool never applies a switch itself. It plans the transition, parks the validated
|
|
67
|
-
in a TTL-bounded store and sends `/domains --voice-switch-token=…` back as a follow-up,
|
|
68
|
-
happens inside a command handler where it can be the terminal action. The selection
|
|
69
|
-
store rather than in the follow-up text, and the token is bound to the session that
|
|
72
|
+
The voice tool never applies a switch itself. It plans the transition, parks the validated
|
|
73
|
+
selection in a TTL-bounded store, and sends `/domains --voice-switch-token=…` back as a follow-up,
|
|
74
|
+
so the reload happens inside a command handler where it can be the terminal action. The selection
|
|
75
|
+
travels in the store rather than in the follow-up text, and the token is bound to the session that
|
|
76
|
+
minted it.
|
|
70
77
|
|
|
71
78
|
## Installation
|
|
72
79
|
|
|
73
80
|
DoomPi depends on this package and activates it as fixed host core, so a DoomPi install already has
|
|
74
|
-
it. It is not selectable from `.doom/
|
|
81
|
+
it. It is not selectable from `.doom/modes.yaml`; it reads `.doom/domains.yaml`.
|
|
75
82
|
|
|
76
83
|
## License
|
|
77
84
|
|
|
78
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-DY2FCwyW.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-ilQ3j-RJ.mjs";
|
|
2
|
+
export { applyDomains };
|
|
@@ -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-CABxbOYj.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-DY2FCwyW.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyDomains-DY2FCwyW.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,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-Rp68la05.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-ilQ3j-RJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyDomains-ilQ3j-RJ.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,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
|