@agimon-ai/po-domain 0.0.0-alpha.2 → 0.0.0-alpha.4
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 +1 -1
- package/dist/apply.cjs +2 -2
- package/dist/apply.cjs.map +1 -1
- package/dist/apply.d.mts +2 -2
- package/dist/apply.d.mts.map +1 -1
- package/dist/apply.mjs +2 -2
- package/dist/apply.mjs.map +1 -1
- package/dist/{domainText-UIRIz6-_.cjs → domainText-CbpBLX_M.cjs} +2 -2
- package/dist/domainText-CbpBLX_M.cjs.map +1 -0
- package/dist/{domainText-Dm8k7p4z.mjs → domainText-D0iurn8D.mjs} +2 -2
- package/dist/domainText-D0iurn8D.mjs.map +1 -0
- package/dist/extensions/mcp.cjs.map +1 -1
- package/dist/extensions/mcp.d.mts +1 -1
- package/dist/extensions/mcp.mjs.map +1 -1
- package/dist/extensions/native.mjs +1 -1
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/server.cjs +47 -57
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts +1 -1
- package/dist/extensions/server.mjs +51 -58
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +1 -1
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/mcp.cjs +2 -2
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.d.mts +13 -12
- package/dist/mcp.d.mts.map +1 -1
- package/dist/mcp.mjs +3 -3
- package/dist/mcp.mjs.map +1 -1
- package/dist/{mcpFilter-Cf-czy8O.mjs → mcpFilter-CKUbKmxz.mjs} +41 -28
- package/dist/mcpFilter-CKUbKmxz.mjs.map +1 -0
- package/dist/{mcpFilter-CZNmU_VF.cjs → mcpFilter-CghXZ2K-.cjs} +45 -26
- package/dist/mcpFilter-CghXZ2K-.cjs.map +1 -0
- package/dist/plugins.mjs +1 -2
- package/dist/{resourceCollector-CRY5cmeY.mjs → resourceCollector-CLxre4tE.mjs} +71 -67
- package/dist/resourceCollector-CLxre4tE.mjs.map +1 -0
- package/dist/{resourceCollector-Cu-lp5hJ.cjs → resourceCollector-YOEwhNIR.cjs} +68 -64
- package/dist/resourceCollector-YOEwhNIR.cjs.map +1 -0
- package/dist/{resources-BEjxE3Zn.d.mts → resources-COT3OnLs.d.mts} +8 -8
- package/dist/{resources-BEjxE3Zn.d.mts.map → resources-COT3OnLs.d.mts.map} +1 -1
- package/dist/resources.cjs +1 -1
- package/dist/resources.d.mts +8 -4
- package/dist/resources.d.mts.map +1 -1
- package/dist/resources.mjs +1 -2
- package/llms.txt +2 -2
- package/package.json +15 -15
- package/src/prompts/po-author-domain/references/domains-contract.md +1 -1
- package/dist/domainText-Dm8k7p4z.mjs.map +0 -1
- package/dist/domainText-UIRIz6-_.cjs.map +0 -1
- package/dist/mcpFilter-CZNmU_VF.cjs.map +0 -1
- package/dist/mcpFilter-Cf-czy8O.mjs.map +0 -1
- package/dist/resourceCollector-CRY5cmeY.mjs.map +0 -1
- package/dist/resourceCollector-Cu-lp5hJ.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ aliases:
|
|
|
34
34
|
When the `@agimon-ai/po-help` minor mode is active, this package contributes the
|
|
35
35
|
`po-author-domain` skill. It provides package-owned guidance for plugin catalogs, domain
|
|
36
36
|
filters, aliases, defaults, shared skills, and MCP scopes in `domains.yaml`. The contribution is
|
|
37
|
-
registered through the session's `
|
|
37
|
+
registered through the session's `po/help` Cordis service and is withdrawn with this package's
|
|
38
38
|
plugin fiber.
|
|
39
39
|
|
|
40
40
|
## What a switch stages
|
package/dist/apply.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
3
|
-
const require_mcpFilter = require("./mcpFilter-
|
|
3
|
+
const require_mcpFilter = require("./mcpFilter-CghXZ2K-.cjs");
|
|
4
4
|
const require_pluginMaterializer = require("./pluginMaterializer-C8IZ1PSY.cjs");
|
|
5
|
-
const require_resourceCollector = require("./resourceCollector-
|
|
5
|
+
const require_resourceCollector = require("./resourceCollector-YOEwhNIR.cjs");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
8
8
|
let node_path = require("node:path");
|
package/dist/apply.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.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/po-config/domains';\nimport { requireHarnessPaths, updateHarnessState } from '@agimon-ai/po-config/harnessStore';\nimport type {
|
|
1
|
+
{"version":3,"file":"apply.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/po-config/domains';\nimport { requireHarnessPaths, updateHarnessState } from '@agimon-ai/po-config/harnessStore';\nimport type { PoHarnessContext, HarnessState } from '@agimon-ai/po-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/po-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: PoHarnessContext): 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,OA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
|
|
2
2
|
//#region src/services/applyDomains/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Live domain switching: skills, plugin hooks, MCP config and subagent directories.
|
|
@@ -18,6 +18,6 @@ import { DoomHarnessContext, HarnessState } from "@agimon-ai/po-config/types";
|
|
|
18
18
|
* exists to run. Domains stays here because it stages plugins, skills and MCP
|
|
19
19
|
* config.
|
|
20
20
|
*/
|
|
21
|
-
export declare function applyDomains(domainNames: string[], state:
|
|
21
|
+
export declare function applyDomains(domainNames: string[], state: PoHarnessContext): Promise<HarnessState>;
|
|
22
22
|
//#endregion
|
|
23
23
|
//# sourceMappingURL=apply.d.mts.map
|
package/dist/apply.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.mts","names":[],"sources":["../src/services/applyDomains/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBA6BsB,aAAa,uBAAuB,OAAO,
|
|
1
|
+
{"version":3,"file":"apply.d.mts","names":[],"sources":["../src/services/applyDomains/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBA6BsB,aAAa,uBAAuB,OAAO,mBAAmB,QAAQ"}
|
package/dist/apply.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as resolveMcpAllowlist } from "./mcpFilter-CKUbKmxz.mjs";
|
|
2
2
|
import { t as materializePluginEntries } from "./pluginMaterializer-D9-oDF-b.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { t as collectResources } from "./resourceCollector-CLxre4tE.mjs";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { resolvePluginEntries, resolveSharedSkills } from "@agimon-ai/po-config/domains";
|
package/dist/apply.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.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/po-config/domains';\nimport { requireHarnessPaths, updateHarnessState } from '@agimon-ai/po-config/harnessStore';\nimport type {
|
|
1
|
+
{"version":3,"file":"apply.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/po-config/domains';\nimport { requireHarnessPaths, updateHarnessState } from '@agimon-ai/po-config/harnessStore';\nimport type { PoHarnessContext, HarnessState } from '@agimon-ai/po-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/po-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: PoHarnessContext): 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,OAAgD;CACxG,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"}
|
|
@@ -15,7 +15,7 @@ const SAFE_DOMAIN_NAME = /^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$/u;
|
|
|
15
15
|
const DOMAIN_SEPARATOR = ",";
|
|
16
16
|
const DOMAIN_COMMAND = "domains";
|
|
17
17
|
/** Footer status key the cockpit's domains axis reads. */
|
|
18
|
-
const DOMAIN_STATUS_KEY = "
|
|
18
|
+
const DOMAIN_STATUS_KEY = "po-domain";
|
|
19
19
|
/** What an empty selection reads as, which is a real state rather than an error. */
|
|
20
20
|
const NONE = "(none)";
|
|
21
21
|
/** Splits the comma-separated argument the command and the autocomplete share. */
|
|
@@ -201,4 +201,4 @@ Object.defineProperty(exports, "unchangedSummary", {
|
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
|
|
204
|
-
//# sourceMappingURL=domainText-
|
|
204
|
+
//# sourceMappingURL=domainText-CbpBLX_M.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domainText-CbpBLX_M.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/po-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 { PoTransitionResult } from '@agimon-ai/po-core/transition';\nimport { VOICE_TOOL_MAX_DOMAIN_COUNT, VOICE_TOOL_MAX_IDENTIFIER_LENGTH } from '@agimon-ai/po-core/voiceTools';\n\nimport { type DomainListing, SAFE_DOMAIN_NAME } from '../../types/domains';\n\ninterface SelectItem {\n value: string;\n label: string;\n description?: string;\n}\n\nconst DOMAIN_SEPARATOR = ',';\nexport const DOMAIN_COMMAND = 'domains';\n/** Footer status key the cockpit's domains axis reads. */\nexport const DOMAIN_STATUS_KEY = 'po-domain';\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\nexport function errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport function transitionError(result: PoTransitionResult): Error {\n return new Error(`Domain transition was ${result.outcome}: ${result.diagnostics.join(', ')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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,8BAAAA,6BAClB,MAAM,IAAI,MAAM,gBAAgBA,8BAAAA,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,8BAAAA,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;AAEA,SAAgB,aAAa,OAAwB;CACnD,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;AAEA,SAAgB,gBAAgB,QAAmC;CACjE,uBAAO,IAAI,MAAM,yBAAyB,OAAO,QAAQ,IAAI,OAAO,YAAY,KAAK,IAAI,GAAG;AAC9F"}
|
|
@@ -15,7 +15,7 @@ const SAFE_DOMAIN_NAME = /^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$/u;
|
|
|
15
15
|
const DOMAIN_SEPARATOR = ",";
|
|
16
16
|
const DOMAIN_COMMAND = "domains";
|
|
17
17
|
/** Footer status key the cockpit's domains axis reads. */
|
|
18
|
-
const DOMAIN_STATUS_KEY = "
|
|
18
|
+
const DOMAIN_STATUS_KEY = "po-domain";
|
|
19
19
|
/** What an empty selection reads as, which is a real state rather than an error. */
|
|
20
20
|
const NONE = "(none)";
|
|
21
21
|
/** Splits the comma-separated argument the command and the autocomplete share. */
|
|
@@ -94,4 +94,4 @@ function transitionError(result) {
|
|
|
94
94
|
//#endregion
|
|
95
95
|
export { DOMAIN_SOURCE as _, domainStatus as a, errorMessage as c, splitDomains as d, switchedSummary as f, unchangedSummary as g, transitionError as h, domainItems as i, normalizeDomainNames as l, toggledDomains as m, DOMAIN_STATUS_KEY as n, domainSummary as o, toggleOptionDomain as p, NONE as r, domainToggleOptions as s, DOMAIN_COMMAND as t, pickerTitle as u, SAFE_DOMAIN_NAME as v };
|
|
96
96
|
|
|
97
|
-
//# sourceMappingURL=domainText-
|
|
97
|
+
//# sourceMappingURL=domainText-D0iurn8D.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domainText-D0iurn8D.mjs","names":[],"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/po-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 { PoTransitionResult } from '@agimon-ai/po-core/transition';\nimport { VOICE_TOOL_MAX_DOMAIN_COUNT, VOICE_TOOL_MAX_IDENTIFIER_LENGTH } from '@agimon-ai/po-core/voiceTools';\n\nimport { type DomainListing, SAFE_DOMAIN_NAME } from '../../types/domains';\n\ninterface SelectItem {\n value: string;\n label: string;\n description?: string;\n}\n\nconst DOMAIN_SEPARATOR = ',';\nexport const DOMAIN_COMMAND = 'domains';\n/** Footer status key the cockpit's domains axis reads. */\nexport const DOMAIN_STATUS_KEY = 'po-domain';\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\nexport function errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport function transitionError(result: PoTransitionResult): Error {\n return new Error(`Domain transition was ${result.outcome}: ${result.diagnostics.join(', ')}`);\n}\n"],"mappings":";;;AACA,MAAa,gBAAgB;;;;;;;;AAS7B,MAAa,mBAAmB;;;ACChC,MAAM,mBAAmB;AACzB,MAAa,iBAAiB;;AAE9B,MAAa,oBAAoB;;AAEjC,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,CAA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AI,KAAK,IAAI,IAAI,GAAG;EACpB,KAAK,IAAI,IAAI;EACb,OAAO,KAAK,IAAI;CAClB;CACA,OAAO;AACT;AAEA,SAAgB,aAAa,OAAwB;CACnD,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;AAEA,SAAgB,gBAAgB,QAAmC;CACjE,uBAAO,IAAI,MAAM,yBAAyB,OAAO,QAAQ,IAAI,OAAO,YAAY,KAAK,IAAI,GAAG;AAC9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.cjs","names":["defineMcpSkill","readPackageResource","defineMcpPlugin","skillPoAuthorDomain"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-author-domain.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-author-domain',\n description:\n 'Configure Po plugin catalogs and domain resource selections in domains.yaml. Use when creating or editing .po/domains.yaml or ~/.po/domains.yaml, choosing local, Git, or npm plugins, filtering plugin resources, setting aliases or defaults, or verifying resolved domain composition.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-author-domain/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type
|
|
1
|
+
{"version":3,"file":"mcp.cjs","names":["defineMcpSkill","readPackageResource","defineMcpPlugin","skillPoAuthorDomain"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-author-domain.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-author-domain',\n description:\n 'Configure Po plugin catalogs and domain resource selections in domains.yaml. Use when creating or editing .po/domains.yaml or ~/.po/domains.yaml, choosing local, Git, or npm plugins, filtering plugin resources, setting aliases or defaults, or verifying resolved domain composition.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-author-domain/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type PoMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoAuthorDomain from '../src/extensions/workspaces/sessions/(backend)/skill/po-author-domain.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-domain',\n session: (context) => ({\n get skills(): PoMcpSessionPlugin['skills'] { return [at(skillPoAuthorDomain, context)]; },\n }) satisfies PoMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;AAGA,IAAA,gCAAA,GAAeA,4BAAAA,eAAAA,CAAe;CAC5B,MAAM;CACN,aACE;CACF,aAAA,GAAYC,+BAAAA,oBAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,MAAqC,uCAAuC;AAC1F,CAAC;;;ACFD,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AAEpE,MAAa,OAAA,GAAMC,4BAAAA,gBAAAA,CAAgB;CACjC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,SAAuC;EAAE,OAAO,CAAC,GAAGC,8BAAqB,OAAO,CAAC;CAAG,EAC1F;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region generated/mcp.d.ts
|
|
2
|
-
export declare const mcp: import("@agimon-ai/po-core/mcpFacet").
|
|
2
|
+
export declare const mcp: import("@agimon-ai/po-core/mcpFacet").PoMcpPluginDefinition;
|
|
3
3
|
//#endregion
|
|
4
4
|
export { mcp as default };
|
|
5
5
|
//# sourceMappingURL=mcp.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.mjs","names":["skillPoAuthorDomain"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-author-domain.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-author-domain',\n description:\n 'Configure Po plugin catalogs and domain resource selections in domains.yaml. Use when creating or editing .po/domains.yaml or ~/.po/domains.yaml, choosing local, Git, or npm plugins, filtering plugin resources, setting aliases or defaults, or verifying resolved domain composition.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-author-domain/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type
|
|
1
|
+
{"version":3,"file":"mcp.mjs","names":["skillPoAuthorDomain"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-author-domain.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-author-domain',\n description:\n 'Configure Po plugin catalogs and domain resource selections in domains.yaml. Use when creating or editing .po/domains.yaml or ~/.po/domains.yaml, choosing local, Git, or npm plugins, filtering plugin resources, setting aliases or defaults, or verifying resolved domain composition.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-author-domain/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type PoMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoAuthorDomain from '../src/extensions/workspaces/sessions/(backend)/skill/po-author-domain.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-domain',\n session: (context) => ({\n get skills(): PoMcpSessionPlugin['skills'] { return [at(skillPoAuthorDomain, context)]; },\n }) satisfies PoMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;AAGA,IAAA,+BAAe,eAAe;CAC5B,MAAM;CACN,aACE;CACF,YAAY,oBAAoB,YAAY,KAAK,uCAAuC;AAC1F,CAAC;;;ACFD,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AAEpE,MAAa,MAAM,gBAAgB;CACjC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,SAAuC;EAAE,OAAO,CAAC,GAAGA,8BAAqB,OAAO,CAAC;CAAG,EAC1F;AACF,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { defineNativePlugin, defineSelectionAxis } from "@agimon-ai/po-core/nati
|
|
|
3
3
|
var domains_native_default = defineSelectionAxis({
|
|
4
4
|
name: "domains",
|
|
5
5
|
command: "domains",
|
|
6
|
-
statusKey: "
|
|
6
|
+
statusKey: "po-domain",
|
|
7
7
|
emptyLabel: "no domains",
|
|
8
8
|
multi: true,
|
|
9
9
|
order: 20
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.mjs","names":["selectionAxisDomains"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/selection-axis/domains.native.ts","../../generated/native.ts"],"sourcesContent":["import { defineSelectionAxis } from '@agimon-ai/po-core/native';\n\nexport default defineSelectionAxis({\n name: 'domains',\n command: 'domains',\n statusKey: '
|
|
1
|
+
{"version":3,"file":"native.mjs","names":["selectionAxisDomains"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/selection-axis/domains.native.ts","../../generated/native.ts"],"sourcesContent":["import { defineSelectionAxis } from '@agimon-ai/po-core/native';\n\nexport default defineSelectionAxis({\n name: 'domains',\n command: 'domains',\n statusKey: 'po-domain',\n emptyLabel: 'no domains',\n multi: true,\n order: 20,\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport selectionAxisDomains from '../src/extensions/workspaces/sessions/(frontend)/selection-axis/domains.native';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const nativePlugin = defineNativePlugin({\n id: 'domain',\n session: {\n get selectionAxes(): WebPluginContributions['selectionAxes'] { return [via({ name: 'domains' }, selectionAxisDomains)]; },\n },\n});\n"],"mappings":";;AAEA,IAAA,yBAAe,oBAAoB;CACjC,MAAM;CACN,SAAS;CACT,WAAW;CACX,YAAY;CACZ,OAAO;CACP,OAAO;AACT,CAAC;;;ACJD,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,eAAe,mBAAmB;CAC7C,IAAI;CACJ,SAAS,EACP,IAAI,gBAAyD;EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,UAAU,GAAGA,sBAAoB,CAAC;CAAG,EAC1H;AACF,CAAC"}
|
|
@@ -2,31 +2,26 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const
|
|
6
|
-
const require_mcpFilter = require("../mcpFilter-CZNmU_VF.cjs");
|
|
5
|
+
const require_mcpFilter = require("../mcpFilter-CghXZ2K-.cjs");
|
|
7
6
|
const require_pluginMaterializer = require("../pluginMaterializer-C8IZ1PSY.cjs");
|
|
8
|
-
const require_resourceCollector = require("../resourceCollector-
|
|
9
|
-
const require_domainText = require("../domainText-
|
|
10
|
-
let node_path = require("node:path");
|
|
11
|
-
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
7
|
+
const require_resourceCollector = require("../resourceCollector-YOEwhNIR.cjs");
|
|
8
|
+
const require_domainText = require("../domainText-CbpBLX_M.cjs");
|
|
12
9
|
let _agimon_ai_po_config_domains = require("@agimon-ai/po-config/domains");
|
|
13
10
|
let _agimon_ai_po_config_harnessStore = require("@agimon-ai/po-config/harnessStore");
|
|
14
|
-
let node_os = require("node:os");
|
|
15
|
-
node_os = require_rolldown_runtime.__toESM(node_os, 1);
|
|
16
11
|
let _agimon_ai_po_core_mcpProjection = require("@agimon-ai/po-core/mcpProjection");
|
|
17
12
|
let _agimon_ai_po_core_serverFacet = require("@agimon-ai/po-core/serverFacet");
|
|
18
13
|
let _agimon_ai_po_core_extensionFile = require("@agimon-ai/po-core/extensionFile");
|
|
19
|
-
let
|
|
14
|
+
let _agimon_ai_po_core_platform = require("@agimon-ai/po-core/platform");
|
|
20
15
|
let _agimon_ai_po_core_skills = require("@agimon-ai/po-core/skills");
|
|
21
16
|
//#region src/extensions/workspaces/sessions/(backend)/_lib/domainServerResources.ts
|
|
22
17
|
/** Retain valid domains behind selection conditions; a broken neighbor must not prevent startup. */
|
|
23
|
-
async function domainServerResources(context) {
|
|
18
|
+
async function domainServerResources(context, fs, io) {
|
|
24
19
|
const resources = [];
|
|
25
|
-
const home = context.environment.HOME ??
|
|
26
|
-
for (const domain of (0, _agimon_ai_po_config_domains.
|
|
27
|
-
const temporaryDirectory =
|
|
20
|
+
const home = context.environment.HOME ?? _agimon_ai_po_core_platform.nodeHost.homeDirectory();
|
|
21
|
+
for (const domain of await (0, _agimon_ai_po_config_domains.listDomainNamesAsync)(fs, context.repoRoot, io, home)) {
|
|
22
|
+
const temporaryDirectory = (0, _agimon_ai_po_core_platform.getOrThrow)(await fs.createTempDir("po-domain-", io));
|
|
28
23
|
try {
|
|
29
|
-
const plugins = await require_pluginMaterializer.materializePluginEntries((0, _agimon_ai_po_config_domains.
|
|
24
|
+
const plugins = await require_pluginMaterializer.materializePluginEntries(await (0, _agimon_ai_po_config_domains.resolvePluginEntriesAsync)(fs, context.repoRoot, [domain], [], io, home));
|
|
30
25
|
const collected = await require_resourceCollector.collectResources(context.repoRoot, plugins, {
|
|
31
26
|
agents: false,
|
|
32
27
|
mcp: false,
|
|
@@ -45,7 +40,7 @@ async function domainServerResources(context) {
|
|
|
45
40
|
mode: domain
|
|
46
41
|
}
|
|
47
42
|
},
|
|
48
|
-
read: () => (0,
|
|
43
|
+
read: async () => (0, _agimon_ai_po_core_platform.getOrThrow)(await fs.readTextFile(skill.path, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT))
|
|
49
44
|
});
|
|
50
45
|
} catch (error) {
|
|
51
46
|
await context.client.notify({
|
|
@@ -54,53 +49,48 @@ async function domainServerResources(context) {
|
|
|
54
49
|
level: "warning"
|
|
55
50
|
});
|
|
56
51
|
} finally {
|
|
57
|
-
await (0,
|
|
58
|
-
recursive: true,
|
|
59
|
-
force: true
|
|
60
|
-
});
|
|
52
|
+
await (0, _agimon_ai_po_core_platform.removePath)(fs, temporaryDirectory, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT);
|
|
61
53
|
}
|
|
62
54
|
}
|
|
63
55
|
return resources;
|
|
64
56
|
}
|
|
65
57
|
//#endregion
|
|
66
58
|
//#region src/extensions/workspaces/sessions/(backend)/root.server.ts
|
|
67
|
-
var root_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoot)(async ({ agent }) => {
|
|
59
|
+
var root_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoot)(async ({ agent, context: root, signal }) => {
|
|
68
60
|
const services = [];
|
|
69
|
-
if (agent) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
provider.provide(_agimon_ai_po_core_mcpProjection.DOOM_MCP_PROJECTION_RESOLVER_SERVICE, resolver);
|
|
99
|
-
});
|
|
61
|
+
if (!agent) return {
|
|
62
|
+
value: { resources: [] },
|
|
63
|
+
services
|
|
64
|
+
};
|
|
65
|
+
const fs = (0, _agimon_ai_po_core_platform.requirePoFs)(root);
|
|
66
|
+
const io = (0, _agimon_ai_po_core_platform.withAbortSignal)(signal, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT);
|
|
67
|
+
const execution = agent.context;
|
|
68
|
+
const home = execution.environment.HOME ?? _agimon_ai_po_core_platform.nodeHost.homeDirectory();
|
|
69
|
+
const resolver = { async resolve(domains) {
|
|
70
|
+
const { state } = await (0, _agimon_ai_po_config_harnessStore.loadHarnessStateAsync)(fs, { ...execution.environment }, io);
|
|
71
|
+
const directory = (0, _agimon_ai_po_core_platform.getOrThrow)(await fs.createTempDir("po-domain-mcp-", io));
|
|
72
|
+
try {
|
|
73
|
+
const plugins = await require_pluginMaterializer.materializePluginEntries(await (0, _agimon_ai_po_config_domains.resolvePluginEntriesAsync)(fs, execution.repoRoot, [...domains], [...state.pluginDirectories], io, home));
|
|
74
|
+
return {
|
|
75
|
+
projection: (await require_resourceCollector.stageMcpResources(execution.repoRoot, plugins, {
|
|
76
|
+
enabled: true,
|
|
77
|
+
temporaryDirectory: directory,
|
|
78
|
+
mcpAllowlist: await require_mcpFilter.resolveMcpAllowlistAsync(fs, execution.repoRoot, [...domains], io)
|
|
79
|
+
})).mcpProjection,
|
|
80
|
+
cleanup: () => (0, _agimon_ai_po_core_platform.removePath)(fs, directory, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT)
|
|
81
|
+
};
|
|
82
|
+
} catch (error) {
|
|
83
|
+
await (0, _agimon_ai_po_core_platform.removePath)(fs, directory, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT);
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
} };
|
|
87
|
+
services.push((cordis) => {
|
|
88
|
+
cordis.plugin((provider) => {
|
|
89
|
+
provider.provide(_agimon_ai_po_core_mcpProjection.PO_MCP_PROJECTION_RESOLVER_SERVICE, resolver);
|
|
100
90
|
});
|
|
101
|
-
}
|
|
91
|
+
});
|
|
102
92
|
return {
|
|
103
|
-
value: { resources:
|
|
93
|
+
value: { resources: await domainServerResources(agent.context, fs, io) },
|
|
104
94
|
services
|
|
105
95
|
};
|
|
106
96
|
});
|
|
@@ -115,12 +105,12 @@ function domainSelectionReply(answer) {
|
|
|
115
105
|
if (typeof reply !== "object" || reply === null || !("kind" in reply) || reply.kind !== DOMAIN_SELECTION_KIND || !("version" in reply) || reply.version !== DOMAIN_SELECTION_VERSION || !("domains" in reply) || !Array.isArray(reply.domains) || !reply.domains.every((name) => typeof name === "string")) throw new Error("Invalid domains selection reply");
|
|
116
106
|
return reply.domains;
|
|
117
107
|
}
|
|
118
|
-
function createDomainServerCommand(host) {
|
|
108
|
+
function createDomainServerCommand(host, fs) {
|
|
119
109
|
return {
|
|
120
110
|
name: require_domainText.DOMAIN_COMMAND,
|
|
121
111
|
description: "Show or change the active Po domains.",
|
|
122
112
|
async execute(args, execution) {
|
|
123
|
-
const available = (0, _agimon_ai_po_config_domains.
|
|
113
|
+
const available = await (0, _agimon_ai_po_config_domains.listDomainNamesAsync)(fs, execution.repoRoot, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT);
|
|
124
114
|
let requested = require_domainText.splitDomains(args);
|
|
125
115
|
let fullSet = false;
|
|
126
116
|
if (requested.length === 0) {
|
|
@@ -159,13 +149,13 @@ function createDomainServerCommand(host) {
|
|
|
159
149
|
version: 1,
|
|
160
150
|
revision: Date.now()
|
|
161
151
|
};
|
|
162
|
-
await execution.session.appendCustomEntry(_agimon_ai_po_core_skills.
|
|
152
|
+
await execution.session.appendCustomEntry(_agimon_ai_po_core_skills.PO_RESOURCE_CATALOG_ENTRY_TYPE, projection);
|
|
163
153
|
}
|
|
164
154
|
};
|
|
165
155
|
}
|
|
166
156
|
//#endregion
|
|
167
157
|
//#region src/extensions/workspaces/sessions/(backend)/command/domains.server.ts
|
|
168
|
-
var domains_server_default$1 = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)(({ agent }) => agent ? createDomainServerCommand(agent) : void 0, { cardinality: "optional" });
|
|
158
|
+
var domains_server_default$1 = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)(({ agent, context }) => agent ? createDomainServerCommand(agent, (0, _agimon_ai_po_core_platform.requirePoFs)(context)) : void 0, { cardinality: "optional" });
|
|
169
159
|
//#endregion
|
|
170
160
|
//#region src/extensions/workspaces/sessions/(backend)/resource/domains.server.ts
|
|
171
161
|
var domains_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)((context) => context.root.resources, { cardinality: "many" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.cjs","names":["os","listDomainNames","mkdtemp","path","materializePluginEntries","resolvePluginEntries","collectResources","readFile","rm","defineRoot","os","loadHarnessState","mkdtemp","path","materializePluginEntries","resolvePluginEntries","stageMcpResources","resolveMcpAllowlist","rm","DOOM_MCP_PROJECTION_RESOLVER_SERVICE","DOMAIN_COMMAND","listDomainNames","splitDomains","pickerTitle","domainToggleOptions","toggledDomains","toggleOptionDomain","normalizeDomainNames","DOOM_RESOURCE_CATALOG_ENTRY_TYPE","defineRoutedContribution","defineRoutedContribution","defineResource","packageResourcePath","readPackageResource","defineServerPlugin","composeServerProviderOverrides","rootSession","composeRootHooks","commandDomains","resourceDomains","resourcePoAuthorDomain"],"sources":["../../src/extensions/workspaces/sessions/(backend)/_lib/domainServerResources.ts","../../src/extensions/workspaces/sessions/(backend)/root.server.ts","../../src/extensions/workspaces/sessions/(backend)/_lib/domainServerCommand.ts","../../src/extensions/workspaces/sessions/(backend)/command/domains.server.ts","../../src/extensions/workspaces/sessions/(backend)/resource/domains.server.ts","../../src/extensions/workspaces/sessions/(backend)/resource/poAuthorDomain.server.ts","../../generated/server.ts"],"sourcesContent":["import { mkdtemp, readFile, rm } from 'node:fs/promises';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { listDomainNames, resolvePluginEntries } from '@agimon-ai/po-config/domains';\nimport type { DoomHeadlessExecutionContext, DoomHeadlessResource } from '@agimon-ai/po-core/headless';\n\nimport { materializePluginEntries } from '../../../../../services/pluginMaterializer';\nimport { collectResources } from '../../../../../services/resourceCollector';\n\n/** Retain valid domains behind selection conditions; a broken neighbor must not prevent startup. */\nexport async function domainServerResources(context: DoomHeadlessExecutionContext): Promise<DoomHeadlessResource[]> {\n const resources: DoomHeadlessResource[] = [];\n const home = context.environment.HOME ?? os.homedir();\n for (const domain of listDomainNames(context.repoRoot, home)) {\n // Own staging here so collection failures also release their temporary files.\n const temporaryDirectory = await mkdtemp(path.join(os.tmpdir(), 'doom-domain-'));\n try {\n const plugins = await materializePluginEntries(resolvePluginEntries(context.repoRoot, [domain], [], home));\n const collected = await collectResources(context.repoRoot, plugins, {\n agents: false,\n mcp: false,\n sharedSkills: false,\n temporaryDirectory,\n });\n for (const skill of collected.skillSources) {\n resources.push({\n name: skill.name,\n description: skill.description,\n path: skill.path,\n kind: 'skill',\n when: { domain, attribution: { kind: 'domain', mode: domain } },\n read: () => readFile(skill.path, 'utf8'),\n });\n }\n } catch (error) {\n await context.client.notify({\n title: `Po domain ${domain} unavailable`,\n body: error instanceof Error ? error.message : String(error),\n level: 'warning',\n });\n } finally {\n await rm(temporaryDirectory, { recursive: true, force: true });\n }\n }\n return resources;\n}\n","import { mkdtemp, rm } from 'node:fs/promises';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { resolvePluginEntries } from '@agimon-ai/po-config/domains';\nimport { loadHarnessState } from '@agimon-ai/po-config/harnessStore';\nimport { defineRoot } from '@agimon-ai/po-core/extensionFile';\nimport {\n DOOM_MCP_PROJECTION_RESOLVER_SERVICE,\n type DoomMcpProjectionResolverService,\n} from '@agimon-ai/po-core/mcpProjection';\nimport type { DoomServerPluginContext } from '@agimon-ai/po-core/serverFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { resolveMcpAllowlist } from '../../../../services/mcpFilter';\nimport { materializePluginEntries } from '../../../../services/pluginMaterializer';\nimport { stageMcpResources } from '../../../../services/resourceCollector';\nimport { domainServerResources } from './_lib/domainServerResources';\nimport type { DomainServerScope } from './_lib/serverScope';\n\nexport default defineRoot(async ({ agent }: DoomServerPluginContext) => {\n const services: Array<(cordis: Context) => void> = [];\n if (agent) {\n const execution = agent.context;\n const home = execution.environment.HOME ?? os.homedir();\n const resolver: DoomMcpProjectionResolverService = {\n async resolve(domains) {\n const { state } = loadHarnessState({ ...execution.environment });\n const directory = await mkdtemp(path.join(os.tmpdir(), 'doom-domain-mcp-'));\n try {\n const plugins = await materializePluginEntries(\n resolvePluginEntries(execution.repoRoot, [...domains], [...state.pluginDirectories], home),\n );\n const staged = await stageMcpResources(execution.repoRoot, plugins, {\n enabled: true,\n temporaryDirectory: directory,\n mcpAllowlist: resolveMcpAllowlist(execution.repoRoot, [...domains]),\n });\n return {\n projection: staged.mcpProjection,\n cleanup: () => rm(directory, { recursive: true, force: true }),\n };\n } catch (error) {\n await rm(directory, { recursive: true, force: true });\n throw error;\n }\n },\n };\n services.push((cordis) => {\n cordis.plugin((provider) => {\n provider.provide(DOOM_MCP_PROJECTION_RESOLVER_SERVICE, resolver);\n });\n });\n }\n return {\n value: { resources: agent ? await domainServerResources(agent.context) : [] } satisfies DomainServerScope,\n services,\n };\n});\n","import { listDomainNames } from '@agimon-ai/po-config/domains';\nimport { type DoomHeadlessCommand, type DoomHeadlessHostService } from '@agimon-ai/po-core/headless';\nimport { DOOM_RESOURCE_CATALOG_ENTRY_TYPE, type ResourceCatalogProjection } from '@agimon-ai/po-core/skills';\n\nimport {\n DOMAIN_COMMAND,\n domainToggleOptions,\n normalizeDomainNames,\n pickerTitle,\n splitDomains,\n toggledDomains,\n toggleOptionDomain,\n} from '../../../../../services/domainText';\n\nconst DOMAIN_SELECTION_KIND = 'po-domains-selection';\nconst DOMAIN_SELECTION_VERSION = 1;\n\n/** Full-set web replies share the string transport with legacy single-toggle labels. */\nfunction domainSelectionReply(answer: string): string[] | null {\n if (!answer.trimStart().startsWith('{')) return null;\n const reply: unknown = JSON.parse(answer);\n if (\n typeof reply !== 'object' ||\n reply === null ||\n !('kind' in reply) ||\n reply.kind !== DOMAIN_SELECTION_KIND ||\n !('version' in reply) ||\n reply.version !== DOMAIN_SELECTION_VERSION ||\n !('domains' in reply) ||\n !Array.isArray(reply.domains) ||\n !reply.domains.every((name: unknown): name is string => typeof name === 'string')\n ) {\n throw new Error('Invalid domains selection reply');\n }\n return reply.domains;\n}\n\nexport function createDomainServerCommand(host: DoomHeadlessHostService): DoomHeadlessCommand {\n return {\n name: DOMAIN_COMMAND,\n description: 'Show or change the active Po domains.',\n async execute(args, execution) {\n const available = listDomainNames(execution.repoRoot);\n let requested = splitDomains(args);\n let fullSet = false;\n if (requested.length === 0) {\n const listing = {\n active: [...execution.selection.domains],\n effective: [...execution.selection.domains],\n available,\n };\n const selected = await execution.client.request({\n kind: 'select',\n title: pickerTitle(listing),\n options: domainToggleOptions(listing).map((label) => ({ label, value: label })),\n });\n if (typeof selected !== 'string' || !selected) return;\n const domains = domainSelectionReply(selected);\n fullSet = domains !== null;\n requested = domains ?? toggledDomains(listing.effective, toggleOptionDomain(selected));\n }\n requested = normalizeDomainNames(requested);\n const unknown = requested.filter((name) => !available.includes(name));\n if (unknown.length > 0) throw new Error(`Unknown domain: ${unknown.join(', ')}`);\n if (fullSet) {\n const wanted = new Set(requested);\n const current = new Set(execution.selection.domains);\n requested = [\n ...execution.selection.domains.filter((name) => wanted.has(name)),\n ...available.filter((name) => wanted.has(name) && !current.has(name)),\n ];\n }\n if (\n requested.length === execution.selection.domains.length &&\n requested.every((name, index) => name === execution.selection.domains[index])\n ) {\n return;\n }\n await host.changeSelection({ axis: 'domains', domains: requested });\n // The web composer caches get_commands for `$` completion. Signal only after\n // the headless host has reconciled commands so the re-read sees this selection.\n const projection: ResourceCatalogProjection = { version: 1, revision: Date.now() };\n await execution.session.appendCustomEntry(DOOM_RESOURCE_CATALOG_ENTRY_TYPE, projection);\n },\n };\n}\n","import { defineRoutedContribution } from '@agimon-ai/po-core/extensionFile';\nimport type { DoomServerPluginContext } from '@agimon-ai/po-core/serverFacet';\n\nimport { createDomainServerCommand } from '../_lib/domainServerCommand';\nexport default defineRoutedContribution(\n ({ agent }: DoomServerPluginContext) => (agent ? createDomainServerCommand(agent) : undefined),\n { cardinality: 'optional' },\n);\n","import { defineRoutedContribution } from '@agimon-ai/po-core/extensionFile';\nimport type { WithRoot } from '@agimon-ai/po-core/extensionFile';\nimport type { DoomServerPluginContext } from '@agimon-ai/po-core/serverFacet';\n\nimport type { DomainServerScope } from '../_lib/serverScope';\n\nexport default defineRoutedContribution(\n (context: WithRoot<DoomServerPluginContext, DomainServerScope>) => context.root.resources,\n { cardinality: 'many' },\n);\n","import { defineResource } from '@agimon-ai/po-core/extensionFile';\nimport { packageResourcePath, readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineResource({\n name: 'po-author-domain',\n description:\n 'Configure Po plugin catalogs and domain resource selections in domains.yaml. Use when creating or editing .po/domains.yaml or ~/.po/domains.yaml, choosing local, Git, or npm plugins, filtering plugin resources, setting aliases or defaults, or verifying resolved domain composition.',\n when: { state: { 'minor-mode': 'help' }, attribution: { kind: 'minor' as const, mode: 'help' } },\n kind: 'skill' as const,\n path: packageResourcePath(import.meta.url, 'src/prompts/po-author-domain/SKILL.md'),\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-author-domain/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineServerPlugin, type DoomServerSessionPlugin } from '@agimon-ai/po-core/serverFacet';\nimport { composeServerProviderOverrides } from '@agimon-ai/po-core/serverFacet';\nimport { composeRootHooks } from '@agimon-ai/po-core/extensionFile';\n\nimport rootSession from '../src/extensions/workspaces/sessions/(backend)/root.server';\nimport commandDomains from '../src/extensions/workspaces/sessions/(backend)/command/domains.server';\nimport resourceDomains from '../src/extensions/workspaces/sessions/(backend)/resource/domains.server';\nimport resourcePoAuthorDomain from '../src/extensions/workspaces/sessions/(backend)/resource/poAuthorDomain.server';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\ntype ManyFactory<T, C> = (context: C) => T | readonly T[];\nconst many = <T, C>(value: T | readonly T[] | ManyFactory<T, C>, context: C): readonly T[] => {\n const resolved = typeof value === 'function' ? (value as ManyFactory<T, C>)(context) : value;\n return Array.isArray(resolved) ? resolved : [resolved as T];\n};\n/* v8 ignore next -- generated normalization branch */\nconst defined = <T>(values: readonly (T | undefined)[]): T[] =>\n values.filter((value): value is T => value !== undefined);\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const facet = defineServerPlugin({\n name: '@agimon-ai/po-domain',\n providerOverrides: composeServerProviderOverrides(rootSession),\n session: async (context) => {\n const scopeSession = await rootSession(context);\n const contextSession = { ...context, root: scopeSession.value };\n return {\n ...composeRootHooks(scopeSession),\n get commands(): DoomServerSessionPlugin['commands'] { return defined([via({ name: 'domains' }, at(commandDomains, contextSession))]); },\n get resources(): DoomServerSessionPlugin['resources'] { return [...many(resourceDomains, contextSession), at(resourcePoAuthorDomain, contextSession)]; },\n services: [...(scopeSession.services ?? [])],\n get activities(): DoomServerSessionPlugin['activities'] { return [...(scopeSession.activities ?? [])]; },\n };\n },\n});\n\nexport default facet;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAWA,eAAsB,sBAAsB,SAAwE;CAClH,MAAM,YAAoC,CAAC;CAC3C,MAAM,OAAO,QAAQ,YAAY,QAAQA,QAAAA,QAAG,QAAQ;CACpD,KAAK,MAAM,WAAA,GAAUC,6BAAAA,gBAAAA,CAAgB,QAAQ,UAAU,IAAI,GAA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,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAa;AAC5D;;AAEA,MAAM,WAAc,WAClB,OAAO,QAAQ,UAAsB,UAAU,KAAA,CAAS;AAC1D,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,SAAA,GAAQC,+BAAAA,mBAAAA,CAAmB;CACtC,MAAM;CACN,oBAAA,GAAmBC,+BAAAA,+BAAAA,CAA+BC,mBAAW;CAC7D,SAAS,OAAO,YAAY;EAC1B,MAAM,eAAe,MAAMA,oBAAY,OAAO;EAC9C,MAAM,iBAAiB;GAAE,GAAG;GAAS,MAAM,aAAa;EAAM;EAC9D,OAAO;GACL,IAAA,GAAGC,iCAAAA,iBAAAA,CAAiB,YAAY;GAChC,IAAI,WAAgD;IAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,MAAM,UAAU,GAAG,GAAGC,0BAAgB,cAAc,CAAC,CAAC,CAAC;GAAG;GACtI,IAAI,YAAkD;IAAE,OAAO,CAAC,GAAG,KAAKC,wBAAiB,cAAc,GAAG,GAAGC,+BAAwB,cAAc,CAAC;GAAG;GACvJ,UAAU,CAAC,GAAI,aAAa,YAAY,CAAC,CAAE;GAC3C,IAAI,aAAoD;IAAE,OAAO,CAAC,GAAI,aAAa,cAAc,CAAC,CAAE;GAAG;EACzG;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"server.cjs","names":["nodeHost","listDomainNamesAsync","getOrThrow","materializePluginEntries","resolvePluginEntriesAsync","collectResources","BACKGROUND_CONTEXT","removePath","defineRoot","requirePoFs","withAbortSignal","BACKGROUND_CONTEXT","nodeHost","loadHarnessStateAsync","getOrThrow","materializePluginEntries","resolvePluginEntriesAsync","stageMcpResources","resolveMcpAllowlistAsync","removePath","PO_MCP_PROJECTION_RESOLVER_SERVICE","DOMAIN_COMMAND","listDomainNamesAsync","BACKGROUND_CONTEXT","splitDomains","pickerTitle","domainToggleOptions","toggledDomains","toggleOptionDomain","normalizeDomainNames","PO_RESOURCE_CATALOG_ENTRY_TYPE","defineRoutedContribution","requirePoFs","defineRoutedContribution","defineResource","packageResourcePath","readPackageResource","defineServerPlugin","composeServerProviderOverrides","rootSession","composeRootHooks","commandDomains","resourceDomains","resourcePoAuthorDomain"],"sources":["../../src/extensions/workspaces/sessions/(backend)/_lib/domainServerResources.ts","../../src/extensions/workspaces/sessions/(backend)/root.server.ts","../../src/extensions/workspaces/sessions/(backend)/_lib/domainServerCommand.ts","../../src/extensions/workspaces/sessions/(backend)/command/domains.server.ts","../../src/extensions/workspaces/sessions/(backend)/resource/domains.server.ts","../../src/extensions/workspaces/sessions/(backend)/resource/poAuthorDomain.server.ts","../../generated/server.ts"],"sourcesContent":["import { listDomainNamesAsync, resolvePluginEntriesAsync } from '@agimon-ai/po-config/domains';\nimport type { PoHeadlessExecutionContext, PoHeadlessResource } from '@agimon-ai/po-core/headless';\nimport { BACKGROUND_CONTEXT, getOrThrow, nodeHost, removePath, type FileSystem } from '@agimon-ai/po-core/platform';\n\nimport { materializePluginEntries } from '../../../../../services/pluginMaterializer';\nimport { collectResources } from '../../../../../services/resourceCollector';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\n/** Retain valid domains behind selection conditions; a broken neighbor must not prevent startup. */\nexport async function domainServerResources(\n context: PoHeadlessExecutionContext,\n fs: FileSystem,\n io: IoContext,\n): Promise<PoHeadlessResource[]> {\n const resources: PoHeadlessResource[] = [];\n const home = context.environment.HOME ?? nodeHost.homeDirectory();\n for (const domain of await listDomainNamesAsync(fs, context.repoRoot, io, home)) {\n // Own staging here so collection failures also release their temporary files.\n const temporaryDirectory = getOrThrow(await fs.createTempDir('po-domain-', io));\n try {\n const plugins = await materializePluginEntries(\n await resolvePluginEntriesAsync(fs, context.repoRoot, [domain], [], io, home),\n );\n const collected = await collectResources(context.repoRoot, plugins, {\n agents: false,\n mcp: false,\n sharedSkills: false,\n temporaryDirectory,\n });\n for (const skill of collected.skillSources) {\n resources.push({\n name: skill.name,\n description: skill.description,\n path: skill.path,\n kind: 'skill',\n when: { domain, attribution: { kind: 'domain', mode: domain } },\n read: async () => getOrThrow(await fs.readTextFile(skill.path, BACKGROUND_CONTEXT)),\n });\n }\n } catch (error) {\n await context.client.notify({\n title: `Po domain ${domain} unavailable`,\n body: error instanceof Error ? error.message : String(error),\n level: 'warning',\n });\n } finally {\n await removePath(fs, temporaryDirectory, BACKGROUND_CONTEXT);\n }\n }\n return resources;\n}\n","import { resolvePluginEntriesAsync } from '@agimon-ai/po-config/domains';\nimport { loadHarnessStateAsync } from '@agimon-ai/po-config/harnessStore';\nimport { defineRoot } from '@agimon-ai/po-core/extensionFile';\nimport {\n PO_MCP_PROJECTION_RESOLVER_SERVICE,\n type PoMcpProjectionResolverService,\n} from '@agimon-ai/po-core/mcpProjection';\nimport {\n BACKGROUND_CONTEXT,\n getOrThrow,\n nodeHost,\n removePath,\n requirePoFs,\n withAbortSignal,\n} from '@agimon-ai/po-core/platform';\nimport type { PoServerPluginContext } from '@agimon-ai/po-core/serverFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { resolveMcpAllowlistAsync } from '../../../../services/mcpFilter';\nimport { materializePluginEntries } from '../../../../services/pluginMaterializer';\nimport { stageMcpResources } from '../../../../services/resourceCollector';\nimport { domainServerResources } from './_lib/domainServerResources';\nimport type { DomainServerScope } from './_lib/serverScope';\n\nexport default defineRoot(async ({ agent, context: root, signal }: PoServerPluginContext) => {\n const services: Array<(cordis: Context) => void> = [];\n if (!agent) return { value: { resources: [] } satisfies DomainServerScope, services };\n const fs = requirePoFs(root);\n const io = withAbortSignal(signal, BACKGROUND_CONTEXT);\n const execution = agent.context;\n const home = execution.environment.HOME ?? nodeHost.homeDirectory();\n const resolver: PoMcpProjectionResolverService = {\n async resolve(domains) {\n const { state } = await loadHarnessStateAsync(fs, { ...execution.environment }, io);\n const directory = getOrThrow(await fs.createTempDir('po-domain-mcp-', io));\n try {\n const plugins = await materializePluginEntries(\n await resolvePluginEntriesAsync(fs, execution.repoRoot, [...domains], [...state.pluginDirectories], io, home),\n );\n const staged = await stageMcpResources(execution.repoRoot, plugins, {\n enabled: true,\n temporaryDirectory: directory,\n mcpAllowlist: await resolveMcpAllowlistAsync(fs, execution.repoRoot, [...domains], io),\n });\n return {\n projection: staged.mcpProjection,\n cleanup: () => removePath(fs, directory, BACKGROUND_CONTEXT),\n };\n } catch (error) {\n await removePath(fs, directory, BACKGROUND_CONTEXT);\n throw error;\n }\n },\n };\n services.push((cordis) => {\n cordis.plugin((provider) => {\n provider.provide(PO_MCP_PROJECTION_RESOLVER_SERVICE, resolver);\n });\n });\n return {\n value: { resources: await domainServerResources(agent.context, fs, io) } satisfies DomainServerScope,\n services,\n };\n});\n","import { listDomainNamesAsync } from '@agimon-ai/po-config/domains';\nimport { type PoHeadlessCommand, type PoHeadlessHostService } from '@agimon-ai/po-core/headless';\nimport { BACKGROUND_CONTEXT, type FileSystem } from '@agimon-ai/po-core/platform';\nimport { PO_RESOURCE_CATALOG_ENTRY_TYPE, type ResourceCatalogProjection } from '@agimon-ai/po-core/skills';\n\nimport {\n DOMAIN_COMMAND,\n domainToggleOptions,\n normalizeDomainNames,\n pickerTitle,\n splitDomains,\n toggledDomains,\n toggleOptionDomain,\n} from '../../../../../services/domainText';\n\nconst DOMAIN_SELECTION_KIND = 'po-domains-selection';\nconst DOMAIN_SELECTION_VERSION = 1;\n\n/** Full-set web replies share the string transport with legacy single-toggle labels. */\nfunction domainSelectionReply(answer: string): string[] | null {\n if (!answer.trimStart().startsWith('{')) return null;\n const reply: unknown = JSON.parse(answer);\n if (\n typeof reply !== 'object' ||\n reply === null ||\n !('kind' in reply) ||\n reply.kind !== DOMAIN_SELECTION_KIND ||\n !('version' in reply) ||\n reply.version !== DOMAIN_SELECTION_VERSION ||\n !('domains' in reply) ||\n !Array.isArray(reply.domains) ||\n !reply.domains.every((name: unknown): name is string => typeof name === 'string')\n ) {\n throw new Error('Invalid domains selection reply');\n }\n return reply.domains;\n}\n\nexport function createDomainServerCommand(host: PoHeadlessHostService, fs: FileSystem): PoHeadlessCommand {\n return {\n name: DOMAIN_COMMAND,\n description: 'Show or change the active Po domains.',\n async execute(args, execution) {\n const available = await listDomainNamesAsync(fs, execution.repoRoot, BACKGROUND_CONTEXT);\n let requested = splitDomains(args);\n let fullSet = false;\n if (requested.length === 0) {\n const listing = {\n active: [...execution.selection.domains],\n effective: [...execution.selection.domains],\n available,\n };\n const selected = await execution.client.request({\n kind: 'select',\n title: pickerTitle(listing),\n options: domainToggleOptions(listing).map((label) => ({ label, value: label })),\n });\n if (typeof selected !== 'string' || !selected) return;\n const domains = domainSelectionReply(selected);\n fullSet = domains !== null;\n requested = domains ?? toggledDomains(listing.effective, toggleOptionDomain(selected));\n }\n requested = normalizeDomainNames(requested);\n const unknown = requested.filter((name) => !available.includes(name));\n if (unknown.length > 0) throw new Error(`Unknown domain: ${unknown.join(', ')}`);\n if (fullSet) {\n const wanted = new Set(requested);\n const current = new Set(execution.selection.domains);\n requested = [\n ...execution.selection.domains.filter((name) => wanted.has(name)),\n ...available.filter((name) => wanted.has(name) && !current.has(name)),\n ];\n }\n if (\n requested.length === execution.selection.domains.length &&\n requested.every((name, index) => name === execution.selection.domains[index])\n ) {\n return;\n }\n await host.changeSelection({ axis: 'domains', domains: requested });\n // The web composer caches get_commands for `$` completion. Signal only after\n // the headless host has reconciled commands so the re-read sees this selection.\n const projection: ResourceCatalogProjection = { version: 1, revision: Date.now() };\n await execution.session.appendCustomEntry(PO_RESOURCE_CATALOG_ENTRY_TYPE, projection);\n },\n };\n}\n","import { defineRoutedContribution } from '@agimon-ai/po-core/extensionFile';\nimport { requirePoFs } from '@agimon-ai/po-core/platform';\nimport type { PoServerPluginContext } from '@agimon-ai/po-core/serverFacet';\n\nimport { createDomainServerCommand } from '../_lib/domainServerCommand';\nexport default defineRoutedContribution(\n ({ agent, context }: PoServerPluginContext) =>\n agent ? createDomainServerCommand(agent, requirePoFs(context)) : undefined,\n { cardinality: 'optional' },\n);\n","import { defineRoutedContribution } from '@agimon-ai/po-core/extensionFile';\nimport type { WithRoot } from '@agimon-ai/po-core/extensionFile';\nimport type { PoServerPluginContext } from '@agimon-ai/po-core/serverFacet';\n\nimport type { DomainServerScope } from '../_lib/serverScope';\n\nexport default defineRoutedContribution(\n (context: WithRoot<PoServerPluginContext, DomainServerScope>) => context.root.resources,\n { cardinality: 'many' },\n);\n","import { defineResource } from '@agimon-ai/po-core/extensionFile';\nimport { packageResourcePath, readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineResource({\n name: 'po-author-domain',\n description:\n 'Configure Po plugin catalogs and domain resource selections in domains.yaml. Use when creating or editing .po/domains.yaml or ~/.po/domains.yaml, choosing local, Git, or npm plugins, filtering plugin resources, setting aliases or defaults, or verifying resolved domain composition.',\n when: { state: { 'minor-mode': 'help' }, attribution: { kind: 'minor' as const, mode: 'help' } },\n kind: 'skill' as const,\n path: packageResourcePath(import.meta.url, 'src/prompts/po-author-domain/SKILL.md'),\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-author-domain/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineServerPlugin, type PoServerSessionPlugin } from '@agimon-ai/po-core/serverFacet';\nimport { composeServerProviderOverrides } from '@agimon-ai/po-core/serverFacet';\nimport { composeRootHooks } from '@agimon-ai/po-core/extensionFile';\n\nimport rootSession from '../src/extensions/workspaces/sessions/(backend)/root.server';\nimport commandDomains from '../src/extensions/workspaces/sessions/(backend)/command/domains.server';\nimport resourceDomains from '../src/extensions/workspaces/sessions/(backend)/resource/domains.server';\nimport resourcePoAuthorDomain from '../src/extensions/workspaces/sessions/(backend)/resource/poAuthorDomain.server';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\ntype ManyFactory<T, C> = (context: C) => T | readonly T[];\nconst many = <T, C>(value: T | readonly T[] | ManyFactory<T, C>, context: C): readonly T[] => {\n const resolved = typeof value === 'function' ? (value as ManyFactory<T, C>)(context) : value;\n return Array.isArray(resolved) ? resolved : [resolved as T];\n};\n/* v8 ignore next -- generated normalization branch */\nconst defined = <T>(values: readonly (T | undefined)[]): T[] =>\n values.filter((value): value is T => value !== undefined);\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const facet = defineServerPlugin({\n name: '@agimon-ai/po-domain',\n providerOverrides: composeServerProviderOverrides(rootSession),\n session: async (context) => {\n const scopeSession = await rootSession(context);\n const contextSession = { ...context, root: scopeSession.value };\n return {\n ...composeRootHooks(scopeSession),\n get commands(): PoServerSessionPlugin['commands'] { return defined([via({ name: 'domains' }, at(commandDomains, contextSession))]); },\n get resources(): PoServerSessionPlugin['resources'] { return [...many(resourceDomains, contextSession), at(resourcePoAuthorDomain, contextSession)]; },\n services: [...(scopeSession.services ?? [])],\n get activities(): PoServerSessionPlugin['activities'] { return [...(scopeSession.activities ?? [])]; },\n };\n },\n});\n\nexport default facet;\n"],"mappings":";;;;;;;;;;;;;;;;;AAUA,eAAsB,sBACpB,SACA,IACA,IAC+B;CAC/B,MAAM,YAAkC,CAAC;CACzC,MAAM,OAAO,QAAQ,YAAY,QAAQA,4BAAAA,SAAS,cAAc;CAChE,KAAK,MAAM,UAAU,OAAA,GAAMC,6BAAAA,qBAAAA,CAAqB,IAAI,QAAQ,UAAU,IAAI,IAAI,GAAG;EAE/E,MAAM,sBAAA,GAAqBC,4BAAAA,WAAAA,CAAW,MAAM,GAAG,cAAc,cAAc,EAAE,CAAC;EAC9E,IAAI;GACF,MAAM,UAAU,MAAMC,2BAAAA,yBACpB,OAAA,GAAMC,6BAAAA,0BAAAA,CAA0B,IAAI,QAAQ,UAAU,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,IAAI,CAC9E;GACA,MAAM,YAAY,MAAM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,OAAO,IAAI;CACvF,OAAO,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAa;AAC5D;;AAEA,MAAM,WAAc,WAClB,OAAO,QAAQ,UAAsB,UAAU,KAAA,CAAS;AAC1D,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,SAAA,GAAQC,+BAAAA,mBAAAA,CAAmB;CACtC,MAAM;CACN,oBAAA,GAAmBC,+BAAAA,+BAAAA,CAA+BC,mBAAW;CAC7D,SAAS,OAAO,YAAY;EAC1B,MAAM,eAAe,MAAMA,oBAAY,OAAO;EAC9C,MAAM,iBAAiB;GAAE,GAAG;GAAS,MAAM,aAAa;EAAM;EAC9D,OAAO;GACL,IAAA,GAAGC,iCAAAA,iBAAAA,CAAiB,YAAY;GAChC,IAAI,WAA8C;IAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,MAAM,UAAU,GAAG,GAAGC,0BAAgB,cAAc,CAAC,CAAC,CAAC;GAAG;GACpI,IAAI,YAAgD;IAAE,OAAO,CAAC,GAAG,KAAKC,wBAAiB,cAAc,GAAG,GAAGC,+BAAwB,cAAc,CAAC;GAAG;GACrJ,UAAU,CAAC,GAAI,aAAa,YAAY,CAAC,CAAE;GAC3C,IAAI,aAAkD;IAAE,OAAO,CAAC,GAAI,aAAa,cAAc,CAAC,CAAE;GAAG;EACvG;CACF;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region generated/server.d.ts
|
|
2
|
-
export declare const facet: import("@agimon-ai/po-core/serverFacet").
|
|
2
|
+
export declare const facet: import("@agimon-ai/po-core/serverFacet").PoServerFacet;
|
|
3
3
|
//#endregion
|
|
4
4
|
export { facet as default };
|
|
5
5
|
//# sourceMappingURL=server.d.mts.map
|