@agimon-ai/doompi-profile 0.0.1-alpha.7 → 0.0.1-alpha.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -1
- 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/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/persona.cjs +84 -1
- package/dist/extensions/persona.cjs.map +1 -0
- package/dist/extensions/persona.d.mts +6 -2
- package/dist/extensions/persona.d.mts.map +1 -0
- package/dist/extensions/persona.mjs +56 -1
- package/dist/extensions/persona.mjs.map +1 -0
- package/dist/extensions/pi.cjs +412 -1
- package/dist/extensions/pi.cjs.map +1 -0
- package/dist/extensions/pi.d.mts +7 -2
- package/dist/extensions/pi.d.mts.map +1 -0
- package/dist/extensions/pi.mjs +407 -1
- package/dist/extensions/pi.mjs.map +1 -0
- package/dist/extensions/server.cjs +116 -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 +111 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +25 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/index-DrtLtJlo.d.mts +32 -0
- package/dist/index-DrtLtJlo.d.mts.map +1 -0
- package/dist/index.cjs +11 -1
- package/dist/index.d.mts +3 -6
- package/dist/index.mjs +3 -1
- package/dist/profileText-BYb57wNe.mjs +63 -0
- package/dist/profileText-BYb57wNe.mjs.map +1 -0
- package/dist/profileText-CRnFPyw8.cjs +128 -0
- package/dist/profileText-CRnFPyw8.cjs.map +1 -0
- package/dist/telemetry-B2D0Q6lp.mjs +33 -0
- package/dist/telemetry-B2D0Q6lp.mjs.map +1 -0
- package/dist/{types/telemetry.d.cts → telemetry-Dq9kXhpl.d.mts} +2 -2
- package/dist/telemetry-Dq9kXhpl.d.mts.map +1 -0
- package/dist/telemetry-DvWU4Brr.cjs +44 -0
- package/dist/telemetry-DvWU4Brr.cjs.map +1 -0
- package/package.json +76 -18
- package/src/prompts/doompi-author-profile/references/profiles-contract.md +57 -2
- package/dist/_virtual/_rolldown/runtime.cjs +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 -10
- package/dist/adapters/pi/extension.d.cts.map +0 -1
- package/dist/adapters/pi/extension.d.mts +0 -10
- 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/persona.cjs +0 -2
- package/dist/adapters/pi/persona.cjs.map +0 -1
- package/dist/adapters/pi/persona.d.cts +0 -8
- package/dist/adapters/pi/persona.d.cts.map +0 -1
- package/dist/adapters/pi/persona.d.mts +0 -8
- package/dist/adapters/pi/persona.d.mts.map +0 -1
- package/dist/adapters/pi/persona.mjs +0 -2
- package/dist/adapters/pi/persona.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/commands/profileCommand.cjs +0 -2
- package/dist/commands/profileCommand.cjs.map +0 -1
- package/dist/commands/profileCommand.mjs +0 -2
- package/dist/commands/profileCommand.mjs.map +0 -1
- package/dist/extensions/persona.d.cts +0 -2
- package/dist/extensions/pi.d.cts +0 -2
- package/dist/index.d.cts +0 -6
- package/dist/services/profileText.cjs +0 -3
- package/dist/services/profileText.cjs.map +0 -1
- package/dist/services/profileText.d.cts +0 -12
- package/dist/services/profileText.d.cts.map +0 -1
- package/dist/services/profileText.d.mts +0 -12
- package/dist/services/profileText.d.mts.map +0 -1
- package/dist/services/profileText.mjs +0 -3
- package/dist/services/profileText.mjs.map +0 -1
- package/dist/types/telemetry.cjs +0 -2
- package/dist/types/telemetry.cjs.map +0 -1
- package/dist/types/telemetry.d.cts.map +0 -1
- package/dist/types/telemetry.d.mts +0 -16
- 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
|
@@ -22,6 +22,33 @@ harness assembles them into one file in the run directory and records its path;
|
|
|
22
22
|
appends that file to the system prompt on every agent start, so the repository's own `AGENTS.md`
|
|
23
23
|
keeps applying underneath it.
|
|
24
24
|
|
|
25
|
+
## Persona identity
|
|
26
|
+
|
|
27
|
+
A persona can say who it is in YAML front-matter at the top of its `profile.md`:
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
---
|
|
31
|
+
name: Rhea
|
|
32
|
+
icon: avatar.png
|
|
33
|
+
voice:
|
|
34
|
+
voice: Karen
|
|
35
|
+
rate: 175
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
You are Rhea, a blunt systems architect.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The cockpit shows `name` and `icon` beside each assistant message, and `voice` shadows the spoken
|
|
42
|
+
voice from `config.yaml` for this persona only. Every field is optional, front-matter is stripped
|
|
43
|
+
from the prompt, and a persona that declares none behaves exactly as before. Identity lives in the
|
|
44
|
+
persona folder rather than in `profiles.yaml`, so discovered profiles get it too.
|
|
45
|
+
|
|
46
|
+
Because a message keeps the identity it was written under, switching profiles mid-conversation
|
|
47
|
+
leaves earlier replies attributed to the persona that produced them.
|
|
48
|
+
|
|
49
|
+
See the [profiles contract](./src/prompts/doompi-author-profile/references/profiles-contract.md)
|
|
50
|
+
for the icon rules and the exact precedence.
|
|
51
|
+
|
|
25
52
|
## What it registers
|
|
26
53
|
|
|
27
54
|
| Entry | Surface |
|
|
@@ -44,7 +71,10 @@ before the reload and restored after it.
|
|
|
44
71
|
|
|
45
72
|
Personal profiles load from `~/.pi/.doom/profiles.yaml`, then repository profiles load from
|
|
46
73
|
`.doom/profiles.yaml`. Roots discover either one persona folder or direct-child persona folders.
|
|
47
|
-
Explicit entries provide a persona path and optional string environment defaults.
|
|
74
|
+
Explicit entries provide a persona path and optional string environment defaults. `defaultProfile`
|
|
75
|
+
names the persona a run starts on when nothing else does, mirroring `defaultMajorMode` in
|
|
76
|
+
`modes.yaml` and `defaultDomains` in `domains.yaml`; `--profile` and an inherited `DOOMPI_PROFILE`
|
|
77
|
+
both override it. Resolution runs
|
|
48
78
|
from personal discovery to repository discovery, then personal explicit entries to repository
|
|
49
79
|
explicit entries. A later profile replaces an earlier profile with the same name.
|
|
50
80
|
|
|
@@ -68,3 +98,5 @@ it. It is not selectable from `.doom/modes.yaml`.
|
|
|
68
98
|
## License
|
|
69
99
|
|
|
70
100
|
MIT
|
|
101
|
+
|
|
102
|
+
Plugin entries live in `src/extensions`. Controllers connect host events and commands to services, while `src/exports` contains public helpers and types. Pi service bindings are owned by `definePiExtension`; startup mounts services before publishing commands and events, and disposal releases those bindings. The separate persona entry supports child sessions without a transition coordinator.
|
|
@@ -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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
let _agimon_ai_doompi_core_mcpFacet = require("@agimon-ai/doompi-core/mcpFacet");
|
|
6
|
+
let _agimon_ai_doompi_core_serverFacet = require("@agimon-ai/doompi-core/serverFacet");
|
|
7
|
+
//#region src/extensions/workspaces/sessions/(backend)/skill/doompi-author-profile.mcp.ts
|
|
8
|
+
var doompi_author_profile_mcp_default = (0, _agimon_ai_doompi_core_mcpFacet.defineMcpSkill)({
|
|
9
|
+
name: "doompi-author-profile",
|
|
10
|
+
description: "Configure DoomPi profile discovery, personas, environment defaults, and precedence in profiles.yaml. Use when creating or changing personal or repository profiles. Do not use for config.yaml runtime settings, modes.yaml, or domains.yaml.",
|
|
11
|
+
read: () => (0, _agimon_ai_doompi_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/doompi-author-profile/SKILL.md")
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region generated/mcp.ts
|
|
15
|
+
const at = (value, context) => typeof value === "function" ? value(context) : value;
|
|
16
|
+
const mcp = (0, _agimon_ai_doompi_core_mcpFacet.defineMcpPlugin)({
|
|
17
|
+
name: "@agimon-ai/doompi-profile",
|
|
18
|
+
session: (context) => ({ get skills() {
|
|
19
|
+
return [at(doompi_author_profile_mcp_default, context)];
|
|
20
|
+
} })
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.default = mcp;
|
|
24
|
+
exports.mcp = mcp;
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=mcp.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.cjs","names":["defineMcpSkill","readPackageResource","defineMcpPlugin","skillDoompiAuthorProfile"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/doompi-author-profile.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/doompi-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/doompi-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'doompi-author-profile',\n description:\n 'Configure DoomPi profile discovery, personas, environment defaults, and precedence in profiles.yaml. Use when creating or changing personal or repository profiles. Do not use for config.yaml runtime settings, modes.yaml, or domains.yaml.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/doompi-author-profile/SKILL.md'),\n});\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport skillDoompiAuthorProfile from '../src/extensions/workspaces/sessions/(backend)/skill/doompi-author-profile.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/doompi-profile',\n session: (context) => ({\n get skills(): DoomMcpSessionPlugin['skills'] { return [at(skillDoompiAuthorProfile, context)]; },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;AAGA,IAAA,qCAAA,GAAeA,gCAAAA,eAAAA,CAAe;CAC5B,MAAM;CACN,aACE;CACF,aAAA,GAAYC,mCAAAA,oBAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,MAAqC,4CAA4C;AAC/F,CAAC;;;ACFD,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AAEpE,MAAa,OAAA,GAAMC,gCAAAA,gBAAAA,CAAgB;CACjC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,SAAyC;EAAE,OAAO,CAAC,GAAGC,mCAA0B,OAAO,CAAC;CAAG,EACjG;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.mts","names":[],"sources":["../../generated/mcp.ts"],"mappings":";qBASa,+CAAG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineMcpPlugin, defineMcpSkill } from "@agimon-ai/doompi-core/mcpFacet";
|
|
2
|
+
import { readPackageResource } from "@agimon-ai/doompi-core/serverFacet";
|
|
3
|
+
//#region src/extensions/workspaces/sessions/(backend)/skill/doompi-author-profile.mcp.ts
|
|
4
|
+
var doompi_author_profile_mcp_default = defineMcpSkill({
|
|
5
|
+
name: "doompi-author-profile",
|
|
6
|
+
description: "Configure DoomPi profile discovery, personas, environment defaults, and precedence in profiles.yaml. Use when creating or changing personal or repository profiles. Do not use for config.yaml runtime settings, modes.yaml, or domains.yaml.",
|
|
7
|
+
read: () => readPackageResource(import.meta.url, "src/prompts/doompi-author-profile/SKILL.md")
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region generated/mcp.ts
|
|
11
|
+
const at = (value, context) => typeof value === "function" ? value(context) : value;
|
|
12
|
+
const mcp = defineMcpPlugin({
|
|
13
|
+
name: "@agimon-ai/doompi-profile",
|
|
14
|
+
session: (context) => ({ get skills() {
|
|
15
|
+
return [at(doompi_author_profile_mcp_default, context)];
|
|
16
|
+
} })
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { mcp as default, mcp };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=mcp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.mjs","names":["skillDoompiAuthorProfile"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/doompi-author-profile.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/doompi-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/doompi-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'doompi-author-profile',\n description:\n 'Configure DoomPi profile discovery, personas, environment defaults, and precedence in profiles.yaml. Use when creating or changing personal or repository profiles. Do not use for config.yaml runtime settings, modes.yaml, or domains.yaml.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/doompi-author-profile/SKILL.md'),\n});\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport skillDoompiAuthorProfile from '../src/extensions/workspaces/sessions/(backend)/skill/doompi-author-profile.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/doompi-profile',\n session: (context) => ({\n get skills(): DoomMcpSessionPlugin['skills'] { return [at(skillDoompiAuthorProfile, context)]; },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;AAGA,IAAA,oCAAe,eAAe;CAC5B,MAAM;CACN,aACE;CACF,YAAY,oBAAoB,YAAY,KAAK,4CAA4C;AAC/F,CAAC;;;ACFD,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AAEpE,MAAa,MAAM,gBAAgB;CACjC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,SAAyC;EAAE,OAAO,CAAC,GAAGA,mCAA0B,OAAO,CAAC;CAAG,EACjG;AACF,CAAC"}
|
|
@@ -1 +1,84 @@
|
|
|
1
|
-
Object.defineProperties(exports,{
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
|
+
var __create = Object.create;
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
+
key = keys[i];
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: ((k) => from[k]).bind(null, key),
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
//#endregion
|
|
27
|
+
const require_telemetry = require("../telemetry-DvWU4Brr.cjs");
|
|
28
|
+
let _agimon_ai_doompi_core_piExtension = require("@agimon-ai/doompi-core/piExtension");
|
|
29
|
+
let _agimon_ai_doompi_core_config = require("@agimon-ai/doompi-core/config");
|
|
30
|
+
let node_fs = require("node:fs");
|
|
31
|
+
node_fs = __toESM(node_fs, 1);
|
|
32
|
+
let _agimon_ai_doompi_config = require("@agimon-ai/doompi-config");
|
|
33
|
+
//#region src/services/personaExtension/runtime.ts
|
|
34
|
+
/**
|
|
35
|
+
* Appends the selected profile's persona to the system prompt.
|
|
36
|
+
*
|
|
37
|
+
* The harness writes the assembled persona to a file in the run directory and
|
|
38
|
+
* records the path in the harness state, so agents/ stays the single source of
|
|
39
|
+
* persona material and is never copied into config.
|
|
40
|
+
*
|
|
41
|
+
* This is a separate Pi entry from the /profile command because detached
|
|
42
|
+
* children need the persona without the command: they have no transition
|
|
43
|
+
* coordinator to run a switch through.
|
|
44
|
+
*/
|
|
45
|
+
function createPersonaEvents(telemetry, cordisContext) {
|
|
46
|
+
return { before_agent_start: async (event, _ctx) => {
|
|
47
|
+
const { personaFile } = (0, _agimon_ai_doompi_config.requireDoomConfigContext)(cordisContext()).harness;
|
|
48
|
+
if (!personaFile) return void 0;
|
|
49
|
+
try {
|
|
50
|
+
const content = (await node_fs.default.promises.readFile(personaFile, "utf8")).trim();
|
|
51
|
+
return content ? { systemPrompt: `${event.systemPrompt}\n\n${content}` } : void 0;
|
|
52
|
+
} catch (error) {
|
|
53
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
54
|
+
telemetry.recordError(require_telemetry.PROFILE_EVENT.personaReadFailed, error);
|
|
55
|
+
process.stderr.write(`[pi-persona] could not read ${personaFile}: ${reason}\n`);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
} };
|
|
59
|
+
}
|
|
60
|
+
function createPersonaRuntime(telemetry) {
|
|
61
|
+
let activeContext;
|
|
62
|
+
return {
|
|
63
|
+
services: [(cordis) => {
|
|
64
|
+
cordis.inject([_agimon_ai_doompi_core_config.DOOM_CONFIG_SERVICE], (context) => {
|
|
65
|
+
activeContext = context;
|
|
66
|
+
return () => {
|
|
67
|
+
if (activeContext === context) activeContext = void 0;
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
}],
|
|
71
|
+
events: createPersonaEvents(telemetry, () => {
|
|
72
|
+
if (!activeContext) throw new Error("Doom persona runtime is waiting for the session config service.");
|
|
73
|
+
return activeContext;
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/services/personaExtension/index.ts
|
|
79
|
+
const personaExtension = (0, _agimon_ai_doompi_core_piExtension.definePiExtension)("@agimon-ai/doompi-profile/persona", ({ options }) => createPersonaRuntime(options ?? require_telemetry.createProfileTelemetry()));
|
|
80
|
+
//#endregion
|
|
81
|
+
exports.default = personaExtension;
|
|
82
|
+
exports.personaExtension = personaExtension;
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=persona.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona.cjs","names":["requireDoomConfigContext","fs","PROFILE_EVENT","DOOM_CONFIG_SERVICE","definePiExtension","createProfileTelemetry"],"sources":["../../src/services/personaExtension/runtime.ts","../../src/services/personaExtension/index.ts"],"sourcesContent":["import fs from 'node:fs';\n\nimport { requireDoomConfigContext } from '@agimon-ai/doompi-config';\nimport { DOOM_CONFIG_SERVICE } from '@agimon-ai/doompi-core/config';\nimport { type PiEventHandlers, type PiPluginContributions } from '@agimon-ai/doompi-core/piExtension';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { PROFILE_EVENT, type ProfileTelemetry } from '../../types/telemetry';\n\n/**\n * Appends the selected profile's persona to the system prompt.\n *\n * The harness writes the assembled persona to a file in the run directory and\n * records the path in the harness state, so agents/ stays the single source of\n * persona material and is never copied into config.\n *\n * This is a separate Pi entry from the /profile command because detached\n * children need the persona without the command: they have no transition\n * coordinator to run a switch through.\n */\n\nexport function createPersonaEvents(telemetry: ProfileTelemetry, cordisContext: () => Context): PiEventHandlers {\n return {\n before_agent_start: async (event, _ctx) => {\n const { personaFile } = requireDoomConfigContext(cordisContext()).harness;\n if (!personaFile) return undefined;\n\n try {\n const content = (await fs.promises.readFile(personaFile, 'utf8')).trim();\n return content ? { systemPrompt: `${event.systemPrompt}\\n\\n${content}` } : undefined;\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n void telemetry.recordError(PROFILE_EVENT.personaReadFailed, error);\n process.stderr.write(`[pi-persona] could not read ${personaFile}: ${reason}\\n`);\n return undefined;\n }\n },\n };\n}\n\nexport function createPersonaRuntime(telemetry: ProfileTelemetry): PiPluginContributions<ProfileTelemetry> {\n let activeContext: Context | undefined;\n return {\n services: [\n (cordis: Context) => {\n cordis.inject([DOOM_CONFIG_SERVICE], (context) => {\n activeContext = context;\n return () => {\n if (activeContext === context) activeContext = undefined;\n };\n });\n },\n ],\n events: createPersonaEvents(telemetry, () => {\n if (!activeContext) throw new Error('Doom persona runtime is waiting for the session config service.');\n return activeContext;\n }),\n };\n}\n","import { definePiExtension } from '@agimon-ai/doompi-core/piExtension';\n\nimport type { ProfileTelemetry } from '../../types/telemetry';\nimport { createProfileTelemetry } from '../logSinkTelemetry';\nimport { createPersonaRuntime } from './runtime';\nexport const personaExtension = definePiExtension<ProfileTelemetry>(\n '@agimon-ai/doompi-profile/persona',\n ({ options }) => createPersonaRuntime(options ?? createProfileTelemetry()),\n);\nexport default personaExtension;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,oBAAoB,WAA6B,eAA+C;CAC9G,OAAO,EACL,oBAAoB,OAAO,OAAO,SAAS;EACzC,MAAM,EAAE,iBAAA,GAAgBA,yBAAAA,yBAAAA,CAAyB,cAAc,CAAC,CAAC,CAAC;EAClE,IAAI,CAAC,aAAa,OAAO,KAAA;EAEzB,IAAI;GACF,MAAM,WAAW,MAAMC,QAAAA,QAAG,SAAS,SAAS,aAAa,MAAM,EAAA,CAAG,KAAK;GACvE,OAAO,UAAU,EAAE,cAAc,GAAG,MAAM,aAAa,MAAM,UAAU,IAAI,KAAA;EAC7E,SAAS,OAAO;GACd,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;GACpE,UAAe,YAAYC,kBAAAA,cAAc,mBAAmB,KAAK;GACjE,QAAQ,OAAO,MAAM,+BAA+B,YAAY,IAAI,OAAO,GAAG;GAC9E;EACF;CACF,EACF;AACF;AAEA,SAAgB,qBAAqB,WAAsE;CACzG,IAAI;CACJ,OAAO;EACL,UAAU,EACP,WAAoB;GACnB,OAAO,OAAO,CAACC,8BAAAA,mBAAmB,IAAI,YAAY;IAChD,gBAAgB;IAChB,aAAa;KACX,IAAI,kBAAkB,SAAS,gBAAgB,KAAA;IACjD;GACF,CAAC;EACH,CACF;EACA,QAAQ,oBAAoB,iBAAiB;GAC3C,IAAI,CAAC,eAAe,MAAM,IAAI,MAAM,iEAAiE;GACrG,OAAO;EACT,CAAC;CACH;AACF;;;ACrDA,MAAa,oBAAA,GAAmBC,mCAAAA,kBAAAA,CAC9B,sCACC,EAAE,cAAc,qBAAqB,WAAWC,kBAAAA,uBAAuB,CAAC,CAC3E"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { i as ProfileTelemetry } from "../telemetry-Dq9kXhpl.mjs";
|
|
2
|
+
//#region src/services/personaExtension/index.d.ts
|
|
3
|
+
export declare const personaExtension: import("@agimon-ai/doompi-core/runtimePiExtension").DefinedPiExtension<ProfileTelemetry>;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { personaExtension as default };
|
|
6
|
+
//# sourceMappingURL=persona.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona.d.mts","names":[],"sources":["../../src/services/personaExtension/index.ts"],"mappings":";;qBAKa,sEAAgB,mBAAA"}
|
|
@@ -1 +1,56 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { n as createProfileTelemetry, t as PROFILE_EVENT } from "../telemetry-B2D0Q6lp.mjs";
|
|
2
|
+
import { definePiExtension } from "@agimon-ai/doompi-core/piExtension";
|
|
3
|
+
import { DOOM_CONFIG_SERVICE } from "@agimon-ai/doompi-core/config";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import { requireDoomConfigContext } from "@agimon-ai/doompi-config";
|
|
6
|
+
//#region src/services/personaExtension/runtime.ts
|
|
7
|
+
/**
|
|
8
|
+
* Appends the selected profile's persona to the system prompt.
|
|
9
|
+
*
|
|
10
|
+
* The harness writes the assembled persona to a file in the run directory and
|
|
11
|
+
* records the path in the harness state, so agents/ stays the single source of
|
|
12
|
+
* persona material and is never copied into config.
|
|
13
|
+
*
|
|
14
|
+
* This is a separate Pi entry from the /profile command because detached
|
|
15
|
+
* children need the persona without the command: they have no transition
|
|
16
|
+
* coordinator to run a switch through.
|
|
17
|
+
*/
|
|
18
|
+
function createPersonaEvents(telemetry, cordisContext) {
|
|
19
|
+
return { before_agent_start: async (event, _ctx) => {
|
|
20
|
+
const { personaFile } = requireDoomConfigContext(cordisContext()).harness;
|
|
21
|
+
if (!personaFile) return void 0;
|
|
22
|
+
try {
|
|
23
|
+
const content = (await fs.promises.readFile(personaFile, "utf8")).trim();
|
|
24
|
+
return content ? { systemPrompt: `${event.systemPrompt}\n\n${content}` } : void 0;
|
|
25
|
+
} catch (error) {
|
|
26
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
27
|
+
telemetry.recordError(PROFILE_EVENT.personaReadFailed, error);
|
|
28
|
+
process.stderr.write(`[pi-persona] could not read ${personaFile}: ${reason}\n`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
} };
|
|
32
|
+
}
|
|
33
|
+
function createPersonaRuntime(telemetry) {
|
|
34
|
+
let activeContext;
|
|
35
|
+
return {
|
|
36
|
+
services: [(cordis) => {
|
|
37
|
+
cordis.inject([DOOM_CONFIG_SERVICE], (context) => {
|
|
38
|
+
activeContext = context;
|
|
39
|
+
return () => {
|
|
40
|
+
if (activeContext === context) activeContext = void 0;
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}],
|
|
44
|
+
events: createPersonaEvents(telemetry, () => {
|
|
45
|
+
if (!activeContext) throw new Error("Doom persona runtime is waiting for the session config service.");
|
|
46
|
+
return activeContext;
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/services/personaExtension/index.ts
|
|
52
|
+
const personaExtension = definePiExtension("@agimon-ai/doompi-profile/persona", ({ options }) => createPersonaRuntime(options ?? createProfileTelemetry()));
|
|
53
|
+
//#endregion
|
|
54
|
+
export { personaExtension as default, personaExtension };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=persona.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona.mjs","names":[],"sources":["../../src/services/personaExtension/runtime.ts","../../src/services/personaExtension/index.ts"],"sourcesContent":["import fs from 'node:fs';\n\nimport { requireDoomConfigContext } from '@agimon-ai/doompi-config';\nimport { DOOM_CONFIG_SERVICE } from '@agimon-ai/doompi-core/config';\nimport { type PiEventHandlers, type PiPluginContributions } from '@agimon-ai/doompi-core/piExtension';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { PROFILE_EVENT, type ProfileTelemetry } from '../../types/telemetry';\n\n/**\n * Appends the selected profile's persona to the system prompt.\n *\n * The harness writes the assembled persona to a file in the run directory and\n * records the path in the harness state, so agents/ stays the single source of\n * persona material and is never copied into config.\n *\n * This is a separate Pi entry from the /profile command because detached\n * children need the persona without the command: they have no transition\n * coordinator to run a switch through.\n */\n\nexport function createPersonaEvents(telemetry: ProfileTelemetry, cordisContext: () => Context): PiEventHandlers {\n return {\n before_agent_start: async (event, _ctx) => {\n const { personaFile } = requireDoomConfigContext(cordisContext()).harness;\n if (!personaFile) return undefined;\n\n try {\n const content = (await fs.promises.readFile(personaFile, 'utf8')).trim();\n return content ? { systemPrompt: `${event.systemPrompt}\\n\\n${content}` } : undefined;\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n void telemetry.recordError(PROFILE_EVENT.personaReadFailed, error);\n process.stderr.write(`[pi-persona] could not read ${personaFile}: ${reason}\\n`);\n return undefined;\n }\n },\n };\n}\n\nexport function createPersonaRuntime(telemetry: ProfileTelemetry): PiPluginContributions<ProfileTelemetry> {\n let activeContext: Context | undefined;\n return {\n services: [\n (cordis: Context) => {\n cordis.inject([DOOM_CONFIG_SERVICE], (context) => {\n activeContext = context;\n return () => {\n if (activeContext === context) activeContext = undefined;\n };\n });\n },\n ],\n events: createPersonaEvents(telemetry, () => {\n if (!activeContext) throw new Error('Doom persona runtime is waiting for the session config service.');\n return activeContext;\n }),\n };\n}\n","import { definePiExtension } from '@agimon-ai/doompi-core/piExtension';\n\nimport type { ProfileTelemetry } from '../../types/telemetry';\nimport { createProfileTelemetry } from '../logSinkTelemetry';\nimport { createPersonaRuntime } from './runtime';\nexport const personaExtension = definePiExtension<ProfileTelemetry>(\n '@agimon-ai/doompi-profile/persona',\n ({ options }) => createPersonaRuntime(options ?? createProfileTelemetry()),\n);\nexport default personaExtension;\n"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,SAAgB,oBAAoB,WAA6B,eAA+C;CAC9G,OAAO,EACL,oBAAoB,OAAO,OAAO,SAAS;EACzC,MAAM,EAAE,gBAAgB,yBAAyB,cAAc,CAAC,CAAC,CAAC;EAClE,IAAI,CAAC,aAAa,OAAO,KAAA;EAEzB,IAAI;GACF,MAAM,WAAW,MAAM,GAAG,SAAS,SAAS,aAAa,MAAM,EAAA,CAAG,KAAK;GACvE,OAAO,UAAU,EAAE,cAAc,GAAG,MAAM,aAAa,MAAM,UAAU,IAAI,KAAA;EAC7E,SAAS,OAAO;GACd,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;GACpE,UAAe,YAAY,cAAc,mBAAmB,KAAK;GACjE,QAAQ,OAAO,MAAM,+BAA+B,YAAY,IAAI,OAAO,GAAG;GAC9E;EACF;CACF,EACF;AACF;AAEA,SAAgB,qBAAqB,WAAsE;CACzG,IAAI;CACJ,OAAO;EACL,UAAU,EACP,WAAoB;GACnB,OAAO,OAAO,CAAC,mBAAmB,IAAI,YAAY;IAChD,gBAAgB;IAChB,aAAa;KACX,IAAI,kBAAkB,SAAS,gBAAgB,KAAA;IACjD;GACF,CAAC;EACH,CACF;EACA,QAAQ,oBAAoB,iBAAiB;GAC3C,IAAI,CAAC,eAAe,MAAM,IAAI,MAAM,iEAAiE;GACrG,OAAO;EACT,CAAC;CACH;AACF;;;ACrDA,MAAa,mBAAmB,kBAC9B,sCACC,EAAE,cAAc,qBAAqB,WAAW,uBAAuB,CAAC,CAC3E"}
|