@agimon-ai/doompi-profile 0.0.1-alpha.4 → 0.0.1-alpha.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -10
- package/dist/adapters/pi/extension.cjs +1 -1
- package/dist/adapters/pi/extension.cjs.map +1 -1
- package/dist/adapters/pi/extension.d.cts +2 -2
- package/dist/adapters/pi/extension.d.cts.map +1 -1
- package/dist/adapters/pi/extension.d.mts +2 -2
- package/dist/adapters/pi/extension.d.mts.map +1 -1
- package/dist/adapters/pi/extension.mjs +1 -1
- package/dist/adapters/pi/extension.mjs.map +1 -1
- package/dist/adapters/pi/persona.d.cts +2 -2
- package/dist/adapters/pi/persona.d.cts.map +1 -1
- package/dist/adapters/pi/persona.d.mts +2 -2
- package/dist/adapters/pi/persona.d.mts.map +1 -1
- package/dist/adapters/telemetry/logSinkTelemetry.d.cts +2 -3
- package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +1 -1
- package/dist/adapters/telemetry/logSinkTelemetry.d.mts +2 -3
- package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +1 -1
- package/dist/commands/profileCommand.cjs +1 -1
- package/dist/commands/profileCommand.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/services/profileText.cjs +2 -2
- package/dist/services/profileText.cjs.map +1 -1
- package/dist/services/profileText.d.cts +12 -5
- package/dist/services/profileText.d.cts.map +1 -1
- package/dist/services/profileText.d.mts +12 -5
- package/dist/services/profileText.d.mts.map +1 -1
- package/dist/services/profileText.mjs +2 -2
- package/dist/services/profileText.mjs.map +1 -1
- package/dist/types/telemetry.d.cts +7 -8
- package/dist/types/telemetry.d.cts.map +1 -1
- package/dist/types/telemetry.d.mts +7 -8
- package/dist/types/telemetry.d.mts.map +1 -1
- package/llms.txt +8 -3
- package/package.json +35 -18
- package/src/exports/webClient.ts +1 -0
- package/src/prompts/doompi-author-profile/SKILL.md +20 -0
- package/src/prompts/doompi-author-profile/references/profiles-contract.md +100 -0
- package/src/web/index.ts +14 -0
- package/src/web/tsconfig.json +22 -0
package/README.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Persona and environment profile switching for [DoomPi](https://www.npmjs.com/package/@agimon-ai/doompi)
|
|
4
4
|
sessions.
|
|
5
5
|
|
|
6
|
-
A **profile** is one of the four axes of a DoomPi selection, alongside domains, the major mode
|
|
7
|
-
the minor modes. It names a persona directory and a set of environment defaults:
|
|
6
|
+
A **profile** is one of the four axes of a DoomPi selection, alongside domains, the major mode,
|
|
7
|
+
and the minor modes. It names a persona directory and a set of environment defaults:
|
|
8
8
|
|
|
9
9
|
```yaml
|
|
10
10
|
# .doom/profiles.yaml
|
|
@@ -17,21 +17,21 @@ profiles:
|
|
|
17
17
|
REVIEW_STRICTNESS: high
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
The persona is `profile.md`, `SOUL.md
|
|
20
|
+
The persona is `profile.md`, `SOUL.md`, and `AGENTS.md` concatenated from the named directory. The
|
|
21
21
|
harness assembles them into one file in the run directory and records its path; the persona entry
|
|
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
25
|
## What it registers
|
|
26
26
|
|
|
27
|
-
| Entry | Surface
|
|
28
|
-
| ---------------------- |
|
|
29
|
-
| `./extensions/pi` | the `/profile` command
|
|
30
|
-
| `./extensions/persona` | a `before_agent_start` hook that appends the active persona to the system prompt
|
|
27
|
+
| Entry | Surface |
|
|
28
|
+
| ---------------------- | -------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `./extensions/pi` | the `/profile` command, which lists profiles, switches persona and environment, then reloads |
|
|
30
|
+
| `./extensions/persona` | a `before_agent_start` hook that appends the active persona to the system prompt |
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
DoomPi uses two entries because a detached child session needs the persona but has no transition
|
|
33
|
+
coordinator to run a switch through. DoomPi activates `./extensions/pi` in the parent and
|
|
34
|
+
`./extensions/persona` in both.
|
|
35
35
|
|
|
36
36
|
## Switching
|
|
37
37
|
|
|
@@ -40,6 +40,26 @@ A profile change is always a `pi-reload`: the extension set does not change, but
|
|
|
40
40
|
have to be dropped so every extension re-reads the environment. Active minor modes are captured
|
|
41
41
|
before the reload and restored after it.
|
|
42
42
|
|
|
43
|
+
## Configuration
|
|
44
|
+
|
|
45
|
+
Personal profiles load from `~/.pi/.doom/profiles.yaml`, then repository profiles load from
|
|
46
|
+
`.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. Resolution runs
|
|
48
|
+
from personal discovery to repository discovery, then personal explicit entries to repository
|
|
49
|
+
explicit entries. A later profile replaces an earlier profile with the same name.
|
|
50
|
+
|
|
51
|
+
Persona paths must stay inside the declaring config's `agents/` directory or a profile root from
|
|
52
|
+
that same file. Directory and persona-file symlinks cannot escape those boundaries. See the
|
|
53
|
+
shipped [profiles contract](./src/prompts/doompi-author-profile/references/profiles-contract.md) for
|
|
54
|
+
the full configuration model and verification steps.
|
|
55
|
+
|
|
56
|
+
## Help
|
|
57
|
+
|
|
58
|
+
The package registers `doompi-author-profile` with the session's `doom/help` Cordis service. Its
|
|
59
|
+
package guidance becomes visible to the AI only while the parent Help minor mode is active. The
|
|
60
|
+
registration follows the Help provider lifecycle and is withdrawn when this package or the provider
|
|
61
|
+
is disposed.
|
|
62
|
+
|
|
43
63
|
## Installation
|
|
44
64
|
|
|
45
65
|
DoomPi depends on this package and activates it as fixed host core, so a DoomPi install already has
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../telemetry/logSinkTelemetry.cjs"),t=require("../../commands/profileCommand.cjs");let
|
|
1
|
+
const e=require("../telemetry/logSinkTelemetry.cjs"),t=require("../../types/telemetry.cjs"),n=require("../../services/profileText.cjs"),r=require("../../commands/profileCommand.cjs");let i=require("@agimon-ai/doompi-extension-contracts/config"),a=require("@agimon-ai/doompi-extension-contracts/cordis-host"),o=require("@agimon-ai/doompi-config/piContext"),s=require("@agimon-ai/doompi-extension-contracts/help"),c=require("@agimon-ai/doompi-extension-contracts/transition");const l=`@agimon-ai/doompi-profile`;async function u(e,n){try{let[{requireHarnessRoot:t},{loadProfiles:n}]=await Promise.all([import(`@agimon-ai/doompi-config/harnessStore`),import(`@agimon-ai/doompi-config/profiles`)]);return n(t(e)).length>0}catch(e){return n.recordError(t.PROFILE_EVENT.profileLoadFailed,e),!0}}async function d(t,n=e.createProfileTelemetry()){let r=await(0,a.connectDoomCordisHost)(t,l),i=r.root.plugin(f,{pi:t,telemetry:n});try{await i}catch(e){try{await i.dispose()}finally{await r.dispose()}throw e}let o;t.on(`session_shutdown`,()=>o??=(async()=>{try{await i.dispose()}finally{await r.dispose()}})())}function f(e,t){e.inject([s.DOOM_HELP_SERVICE],e=>{let t=(0,s.requireDoomHelpService)(e).register({source:l,moduleUrl:require("url").pathToFileURL(__filename).href,skills:[{name:`doompi-author-profile`,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.`}]});return()=>t.dispose()});let a,d=e.inject([i.DOOM_CONFIG_SERVICE,c.DOOM_TRANSITION_SERVICE],e=>(a=e,()=>{a===e&&(a=void 0)})),f=()=>{if(!a)throw Error(`Doom profile runtime is waiting for the session config service.`);return a};e.effect(function*(){r.registerProfileCommand(t.pi,t.telemetry,f),t.pi.on(`session_start`,async(e,r)=>{await d.await();let i=(0,o.requireDoomConfigContext)(f()).harness,a=n.profileStatus(i.profile,await u(i,t.telemetry));a!==void 0&&r.ui.setStatus(n.PROFILE_STATUS_KEY,a)}),yield()=>void 0},l)}exports.default=d,exports.profileExtension=d;
|
|
2
2
|
//# sourceMappingURL=extension.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.cjs","names":["createProfileTelemetry","connectDoomCordisHost","DOOM_CONFIG_SERVICE","DOOM_TRANSITION_SERVICE"],"sources":["../../../src/adapters/pi/extension.ts"],"sourcesContent":["import { DOOM_CONFIG_SERVICE } from '@agimon-ai/doompi-extension-contracts/config';\nimport { connectDoomCordisHost } from '@agimon-ai/doompi-extension-contracts/cordis-host';\nimport { DOOM_TRANSITION_SERVICE } from '@agimon-ai/doompi-extension-contracts/transition';\nimport type { Context } from '@deepseek-ai/cordis';\nimport type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport { registerProfileCommand } from '../../commands/profileCommand.ts';\nimport
|
|
1
|
+
{"version":3,"file":"extension.cjs","names":["PROFILE_EVENT","createProfileTelemetry","connectDoomCordisHost","DOOM_HELP_SERVICE","requireDoomHelpService","DOOM_CONFIG_SERVICE","DOOM_TRANSITION_SERVICE","requireDoomConfigContext","profileStatus","PROFILE_STATUS_KEY"],"sources":["../../../src/adapters/pi/extension.ts"],"sourcesContent":["import type { HarnessState } from '@agimon-ai/doompi-config/types';\nimport { requireDoomConfigContext } from '@agimon-ai/doompi-config/piContext';\nimport { DOOM_CONFIG_SERVICE } from '@agimon-ai/doompi-extension-contracts/config';\nimport { connectDoomCordisHost } from '@agimon-ai/doompi-extension-contracts/cordis-host';\nimport { DOOM_HELP_SERVICE, requireDoomHelpService } from '@agimon-ai/doompi-extension-contracts/help';\nimport { DOOM_TRANSITION_SERVICE } from '@agimon-ai/doompi-extension-contracts/transition';\nimport type { Context } from '@deepseek-ai/cordis';\nimport type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport { registerProfileCommand } from '../../commands/profileCommand.ts';\nimport { PROFILE_STATUS_KEY, profileStatus } from '../../services/profileText.ts';\nimport { PROFILE_EVENT, type ProfileTelemetry } from '../../types/telemetry.ts';\nimport { createProfileTelemetry } from '../telemetry/logSinkTelemetry.ts';\n\nconst PACKAGE_SOURCE = '@agimon-ai/doompi-profile';\n\n/**\n * Whether the session has any profiles to offer. Reading the catalogue is\n * the one startup cost the axis needs; a broken catalogue reports true so\n * the axis stays on the bar and /profile can explain the failure.\n */\nasync function profileCatalogueExists(\n state: Pick<HarnessState, 'root'>,\n telemetry: ProfileTelemetry,\n): Promise<boolean> {\n try {\n const [{ requireHarnessRoot }, { loadProfiles }] = await Promise.all([\n import('@agimon-ai/doompi-config/harnessStore'),\n import('@agimon-ai/doompi-config/profiles'),\n ]);\n return loadProfiles(requireHarnessRoot(state)).length > 0;\n } catch (error) {\n void telemetry.recordError(PROFILE_EVENT.profileLoadFailed, error);\n return true;\n }\n}\n\n/**\n * The package's single standard Pi factory.\n */\nexport async function profileExtension(\n pi: ExtensionAPI,\n telemetry: ProfileTelemetry = createProfileTelemetry(),\n): Promise<void> {\n const connection = await connectDoomCordisHost(pi, PACKAGE_SOURCE);\n const fiber = connection.root.plugin(profilePlugin, { pi, telemetry });\n try {\n await fiber;\n } catch (error) {\n try {\n await fiber.dispose();\n } finally {\n await connection.dispose();\n }\n throw error;\n }\n let disposal: Promise<void> | undefined;\n pi.on(\n 'session_shutdown',\n () =>\n (disposal ??= (async () => {\n try {\n await fiber.dispose();\n } finally {\n await connection.dispose();\n }\n })()),\n );\n}\n\ninterface ProfilePluginConfig {\n readonly pi: ExtensionAPI;\n readonly telemetry: ProfileTelemetry;\n}\n\nfunction profilePlugin(cordis: Context, config: ProfilePluginConfig): void {\n cordis.inject([DOOM_HELP_SERVICE], (helpContext) => {\n const contribution = requireDoomHelpService(helpContext).register({\n source: PACKAGE_SOURCE,\n moduleUrl: import.meta.url,\n skills: [\n {\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 },\n ],\n });\n return () => contribution.dispose();\n });\n\n let activeContext: Context | undefined;\n const runtimeInjection = cordis.inject([DOOM_CONFIG_SERVICE, DOOM_TRANSITION_SERVICE], (context) => {\n activeContext = context;\n return () => {\n if (activeContext === context) activeContext = undefined;\n };\n });\n const requireRuntimeContext = (): Context => {\n if (!activeContext) throw new Error('Doom profile runtime is waiting for the session config service.');\n return activeContext;\n };\n cordis.effect(function* () {\n registerProfileCommand(config.pi, config.telemetry, requireRuntimeContext);\n config.pi.on('session_start', async (_event, ctx) => {\n await runtimeInjection.await();\n const state = requireDoomConfigContext(requireRuntimeContext()).harness;\n const status = profileStatus(state.profile, await profileCatalogueExists(state, config.telemetry));\n if (status !== undefined) ctx.ui.setStatus(PROFILE_STATUS_KEY, status);\n });\n yield () => undefined;\n }, PACKAGE_SOURCE);\n}\n\nexport default profileExtension;\n"],"mappings":"0dAaA,MAAM,EAAiB,4BAOvB,eAAe,EACb,EACA,EACkB,CAClB,GAAI,CACF,GAAM,CAAC,CAAE,sBAAsB,CAAE,iBAAkB,MAAM,QAAQ,IAAI,CACnE,OAAO,yCACP,OAAO,oCACT,CAAC,EACD,OAAO,EAAa,EAAmB,CAAK,CAAC,CAAC,CAAC,OAAS,CAC1D,OAAS,EAAO,CAEd,OADA,EAAe,YAAYA,EAAAA,cAAc,kBAAmB,CAAK,EAC1D,EACT,CACF,CAKA,eAAsB,EACpB,EACA,EAA8BC,EAAAA,uBAAuB,EACtC,CACf,IAAM,EAAa,MAAA,EAAMC,EAAAA,sBAAAA,CAAsB,EAAI,CAAc,EAC3D,EAAQ,EAAW,KAAK,OAAO,EAAe,CAAE,KAAI,WAAU,CAAC,EACrE,GAAI,CACF,MAAM,CACR,OAAS,EAAO,CACd,GAAI,CACF,MAAM,EAAM,QAAQ,CACtB,QAAU,CACR,MAAM,EAAW,QAAQ,CAC3B,CACA,MAAM,CACR,CACA,IAAI,EACJ,EAAG,GACD,uBAEG,KAAc,SAAY,CACzB,GAAI,CACF,MAAM,EAAM,QAAQ,CACtB,QAAU,CACR,MAAM,EAAW,QAAQ,CAC3B,CACF,EAAA,CAAG,CACP,CACF,CAOA,SAAS,EAAc,EAAiB,EAAmC,CACzE,EAAO,OAAO,CAACC,EAAAA,iBAAiB,EAAI,GAAgB,CAClD,IAAM,GAAA,EAAeC,EAAAA,uBAAAA,CAAuB,CAAW,CAAC,CAAC,SAAS,CAChE,OAAQ,EACR,UAAA,QAAA,KAAA,CAAA,CAAA,cAAA,UAAA,CAAA,CAAA,KACA,OAAQ,CACN,CACE,KAAM,wBACN,YACE,+OACJ,CACF,CACF,CAAC,EACD,UAAa,EAAa,QAAQ,CACpC,CAAC,EAED,IAAI,EACE,EAAmB,EAAO,OAAO,CAACC,EAAAA,oBAAqBC,EAAAA,uBAAuB,EAAI,IACtF,EAAgB,MACH,CACP,IAAkB,IAAS,EAAgB,IAAA,GACjD,EACD,EACK,MAAuC,CAC3C,GAAI,CAAC,EAAe,MAAU,MAAM,iEAAiE,EACrG,OAAO,CACT,EACA,EAAO,OAAO,WAAa,CACzB,EAAA,uBAAuB,EAAO,GAAI,EAAO,UAAW,CAAqB,EACzE,EAAO,GAAG,GAAG,gBAAiB,MAAO,EAAQ,IAAQ,CACnD,MAAM,EAAiB,MAAM,EAC7B,IAAM,GAAA,EAAQC,EAAAA,yBAAAA,CAAyB,EAAsB,CAAC,CAAC,CAAC,QAC1D,EAASC,EAAAA,cAAc,EAAM,QAAS,MAAM,EAAuB,EAAO,EAAO,SAAS,CAAC,EAC7F,IAAW,IAAA,IAAW,EAAI,GAAG,UAAUC,EAAAA,mBAAoB,CAAM,CACvE,CAAC,EACD,SAAY,IAAA,EACd,EAAG,CAAc,CACnB"}
|
|
@@ -4,7 +4,7 @@ import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
|
4
4
|
/**
|
|
5
5
|
* The package's single standard Pi factory.
|
|
6
6
|
*/
|
|
7
|
-
declare function profileExtension(pi: ExtensionAPI, telemetry?: ProfileTelemetry): Promise<void>;
|
|
7
|
+
export declare function profileExtension(pi: ExtensionAPI, telemetry?: ProfileTelemetry): Promise<void>;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { profileExtension as default
|
|
9
|
+
export { profileExtension as default };
|
|
10
10
|
//# sourceMappingURL=extension.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.cts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"extension.d.cts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;;;;;wBAuCsB,iBACpB,IAAI,cACJ,YAAW,mBACV"}
|
|
@@ -4,7 +4,7 @@ import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
|
4
4
|
/**
|
|
5
5
|
* The package's single standard Pi factory.
|
|
6
6
|
*/
|
|
7
|
-
declare function profileExtension(pi: ExtensionAPI, telemetry?: ProfileTelemetry): Promise<void>;
|
|
7
|
+
export declare function profileExtension(pi: ExtensionAPI, telemetry?: ProfileTelemetry): Promise<void>;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { profileExtension as default
|
|
9
|
+
export { profileExtension as default };
|
|
10
10
|
//# sourceMappingURL=extension.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.mts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"extension.d.mts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;;;;;wBAuCsB,iBACpB,IAAI,cACJ,YAAW,mBACV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createProfileTelemetry as e}from"../telemetry/logSinkTelemetry.mjs";import{
|
|
1
|
+
import{createProfileTelemetry as e}from"../telemetry/logSinkTelemetry.mjs";import{PROFILE_EVENT as t}from"../../types/telemetry.mjs";import{PROFILE_STATUS_KEY as n,profileStatus as r}from"../../services/profileText.mjs";import{registerProfileCommand as i}from"../../commands/profileCommand.mjs";import{DOOM_CONFIG_SERVICE as a}from"@agimon-ai/doompi-extension-contracts/config";import{connectDoomCordisHost as o}from"@agimon-ai/doompi-extension-contracts/cordis-host";import{requireDoomConfigContext as s}from"@agimon-ai/doompi-config/piContext";import{DOOM_HELP_SERVICE as c,requireDoomHelpService as l}from"@agimon-ai/doompi-extension-contracts/help";import{DOOM_TRANSITION_SERVICE as u}from"@agimon-ai/doompi-extension-contracts/transition";const d=`@agimon-ai/doompi-profile`;async function f(e,n){try{let[{requireHarnessRoot:t},{loadProfiles:n}]=await Promise.all([import(`@agimon-ai/doompi-config/harnessStore`),import(`@agimon-ai/doompi-config/profiles`)]);return n(t(e)).length>0}catch(e){return n.recordError(t.profileLoadFailed,e),!0}}async function p(t,n=e()){let r=await o(t,d),i=r.root.plugin(m,{pi:t,telemetry:n});try{await i}catch(e){try{await i.dispose()}finally{await r.dispose()}throw e}let a;t.on(`session_shutdown`,()=>a??=(async()=>{try{await i.dispose()}finally{await r.dispose()}})())}function m(e,t){e.inject([c],e=>{let t=l(e).register({source:d,moduleUrl:import.meta.url,skills:[{name:`doompi-author-profile`,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.`}]});return()=>t.dispose()});let o,p=e.inject([a,u],e=>(o=e,()=>{o===e&&(o=void 0)})),m=()=>{if(!o)throw Error(`Doom profile runtime is waiting for the session config service.`);return o};e.effect(function*(){i(t.pi,t.telemetry,m),t.pi.on(`session_start`,async(e,i)=>{await p.await();let a=s(m()).harness,o=r(a.profile,await f(a,t.telemetry));o!==void 0&&i.ui.setStatus(n,o)}),yield()=>void 0},d)}export{p as default,p as profileExtension};
|
|
2
2
|
//# sourceMappingURL=extension.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.mjs","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"sourcesContent":["import { DOOM_CONFIG_SERVICE } from '@agimon-ai/doompi-extension-contracts/config';\nimport { connectDoomCordisHost } from '@agimon-ai/doompi-extension-contracts/cordis-host';\nimport { DOOM_TRANSITION_SERVICE } from '@agimon-ai/doompi-extension-contracts/transition';\nimport type { Context } from '@deepseek-ai/cordis';\nimport type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport { registerProfileCommand } from '../../commands/profileCommand.ts';\nimport
|
|
1
|
+
{"version":3,"file":"extension.mjs","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"sourcesContent":["import type { HarnessState } from '@agimon-ai/doompi-config/types';\nimport { requireDoomConfigContext } from '@agimon-ai/doompi-config/piContext';\nimport { DOOM_CONFIG_SERVICE } from '@agimon-ai/doompi-extension-contracts/config';\nimport { connectDoomCordisHost } from '@agimon-ai/doompi-extension-contracts/cordis-host';\nimport { DOOM_HELP_SERVICE, requireDoomHelpService } from '@agimon-ai/doompi-extension-contracts/help';\nimport { DOOM_TRANSITION_SERVICE } from '@agimon-ai/doompi-extension-contracts/transition';\nimport type { Context } from '@deepseek-ai/cordis';\nimport type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport { registerProfileCommand } from '../../commands/profileCommand.ts';\nimport { PROFILE_STATUS_KEY, profileStatus } from '../../services/profileText.ts';\nimport { PROFILE_EVENT, type ProfileTelemetry } from '../../types/telemetry.ts';\nimport { createProfileTelemetry } from '../telemetry/logSinkTelemetry.ts';\n\nconst PACKAGE_SOURCE = '@agimon-ai/doompi-profile';\n\n/**\n * Whether the session has any profiles to offer. Reading the catalogue is\n * the one startup cost the axis needs; a broken catalogue reports true so\n * the axis stays on the bar and /profile can explain the failure.\n */\nasync function profileCatalogueExists(\n state: Pick<HarnessState, 'root'>,\n telemetry: ProfileTelemetry,\n): Promise<boolean> {\n try {\n const [{ requireHarnessRoot }, { loadProfiles }] = await Promise.all([\n import('@agimon-ai/doompi-config/harnessStore'),\n import('@agimon-ai/doompi-config/profiles'),\n ]);\n return loadProfiles(requireHarnessRoot(state)).length > 0;\n } catch (error) {\n void telemetry.recordError(PROFILE_EVENT.profileLoadFailed, error);\n return true;\n }\n}\n\n/**\n * The package's single standard Pi factory.\n */\nexport async function profileExtension(\n pi: ExtensionAPI,\n telemetry: ProfileTelemetry = createProfileTelemetry(),\n): Promise<void> {\n const connection = await connectDoomCordisHost(pi, PACKAGE_SOURCE);\n const fiber = connection.root.plugin(profilePlugin, { pi, telemetry });\n try {\n await fiber;\n } catch (error) {\n try {\n await fiber.dispose();\n } finally {\n await connection.dispose();\n }\n throw error;\n }\n let disposal: Promise<void> | undefined;\n pi.on(\n 'session_shutdown',\n () =>\n (disposal ??= (async () => {\n try {\n await fiber.dispose();\n } finally {\n await connection.dispose();\n }\n })()),\n );\n}\n\ninterface ProfilePluginConfig {\n readonly pi: ExtensionAPI;\n readonly telemetry: ProfileTelemetry;\n}\n\nfunction profilePlugin(cordis: Context, config: ProfilePluginConfig): void {\n cordis.inject([DOOM_HELP_SERVICE], (helpContext) => {\n const contribution = requireDoomHelpService(helpContext).register({\n source: PACKAGE_SOURCE,\n moduleUrl: import.meta.url,\n skills: [\n {\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 },\n ],\n });\n return () => contribution.dispose();\n });\n\n let activeContext: Context | undefined;\n const runtimeInjection = cordis.inject([DOOM_CONFIG_SERVICE, DOOM_TRANSITION_SERVICE], (context) => {\n activeContext = context;\n return () => {\n if (activeContext === context) activeContext = undefined;\n };\n });\n const requireRuntimeContext = (): Context => {\n if (!activeContext) throw new Error('Doom profile runtime is waiting for the session config service.');\n return activeContext;\n };\n cordis.effect(function* () {\n registerProfileCommand(config.pi, config.telemetry, requireRuntimeContext);\n config.pi.on('session_start', async (_event, ctx) => {\n await runtimeInjection.await();\n const state = requireDoomConfigContext(requireRuntimeContext()).harness;\n const status = profileStatus(state.profile, await profileCatalogueExists(state, config.telemetry));\n if (status !== undefined) ctx.ui.setStatus(PROFILE_STATUS_KEY, status);\n });\n yield () => undefined;\n }, PACKAGE_SOURCE);\n}\n\nexport default profileExtension;\n"],"mappings":"wuBAaA,MAAM,EAAiB,4BAOvB,eAAe,EACb,EACA,EACkB,CAClB,GAAI,CACF,GAAM,CAAC,CAAE,sBAAsB,CAAE,iBAAkB,MAAM,QAAQ,IAAI,CACnE,OAAO,yCACP,OAAO,oCACT,CAAC,EACD,OAAO,EAAa,EAAmB,CAAK,CAAC,CAAC,CAAC,OAAS,CAC1D,OAAS,EAAO,CAEd,OADA,EAAe,YAAY,EAAc,kBAAmB,CAAK,EAC1D,EACT,CACF,CAKA,eAAsB,EACpB,EACA,EAA8B,EAAuB,EACtC,CACf,IAAM,EAAa,MAAM,EAAsB,EAAI,CAAc,EAC3D,EAAQ,EAAW,KAAK,OAAO,EAAe,CAAE,KAAI,WAAU,CAAC,EACrE,GAAI,CACF,MAAM,CACR,OAAS,EAAO,CACd,GAAI,CACF,MAAM,EAAM,QAAQ,CACtB,QAAU,CACR,MAAM,EAAW,QAAQ,CAC3B,CACA,MAAM,CACR,CACA,IAAI,EACJ,EAAG,GACD,uBAEG,KAAc,SAAY,CACzB,GAAI,CACF,MAAM,EAAM,QAAQ,CACtB,QAAU,CACR,MAAM,EAAW,QAAQ,CAC3B,CACF,EAAA,CAAG,CACP,CACF,CAOA,SAAS,EAAc,EAAiB,EAAmC,CACzE,EAAO,OAAO,CAAC,CAAiB,EAAI,GAAgB,CAClD,IAAM,EAAe,EAAuB,CAAW,CAAC,CAAC,SAAS,CAChE,OAAQ,EACR,UAAW,YAAY,IACvB,OAAQ,CACN,CACE,KAAM,wBACN,YACE,+OACJ,CACF,CACF,CAAC,EACD,UAAa,EAAa,QAAQ,CACpC,CAAC,EAED,IAAI,EACE,EAAmB,EAAO,OAAO,CAAC,EAAqB,CAAuB,EAAI,IACtF,EAAgB,MACH,CACP,IAAkB,IAAS,EAAgB,IAAA,GACjD,EACD,EACK,MAAuC,CAC3C,GAAI,CAAC,EAAe,MAAU,MAAM,iEAAiE,EACrG,OAAO,CACT,EACA,EAAO,OAAO,WAAa,CACzB,EAAuB,EAAO,GAAI,EAAO,UAAW,CAAqB,EACzE,EAAO,GAAG,GAAG,gBAAiB,MAAO,EAAQ,IAAQ,CACnD,MAAM,EAAiB,MAAM,EAC7B,IAAM,EAAQ,EAAyB,EAAsB,CAAC,CAAC,CAAC,QAC1D,EAAS,EAAc,EAAM,QAAS,MAAM,EAAuB,EAAO,EAAO,SAAS,CAAC,EAC7F,IAAW,IAAA,IAAW,EAAI,GAAG,UAAU,EAAoB,CAAM,CACvE,CAAC,EACD,SAAY,IAAA,EACd,EAAG,CAAc,CACnB"}
|
|
@@ -2,7 +2,7 @@ import { ProfileTelemetry } from "../../types/telemetry.cjs";
|
|
|
2
2
|
import "@deepseek-ai/cordis";
|
|
3
3
|
import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
//#region src/adapters/pi/persona.d.ts
|
|
5
|
-
declare function personaExtension(pi: ExtensionAPI, telemetry?: ProfileTelemetry): Promise<void>;
|
|
5
|
+
export declare function personaExtension(pi: ExtensionAPI, telemetry?: ProfileTelemetry): Promise<void>;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { personaExtension as default
|
|
7
|
+
export { personaExtension as default };
|
|
8
8
|
//# sourceMappingURL=persona.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persona.d.cts","names":[],"sources":["../../../src/adapters/pi/persona.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"persona.d.cts","names":[],"sources":["../../../src/adapters/pi/persona.ts"],"mappings":";;;;wBA8DsB,iBACpB,IAAI,cACJ,YAAW,mBACV"}
|
|
@@ -2,7 +2,7 @@ import { ProfileTelemetry } from "../../types/telemetry.mjs";
|
|
|
2
2
|
import "@deepseek-ai/cordis";
|
|
3
3
|
import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
//#region src/adapters/pi/persona.d.ts
|
|
5
|
-
declare function personaExtension(pi: ExtensionAPI, telemetry?: ProfileTelemetry): Promise<void>;
|
|
5
|
+
export declare function personaExtension(pi: ExtensionAPI, telemetry?: ProfileTelemetry): Promise<void>;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { personaExtension as default
|
|
7
|
+
export { personaExtension as default };
|
|
8
8
|
//# sourceMappingURL=persona.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persona.d.mts","names":[],"sources":["../../../src/adapters/pi/persona.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"persona.d.mts","names":[],"sources":["../../../src/adapters/pi/persona.ts"],"mappings":";;;;wBA8DsB,iBACpB,IAAI,cACJ,YAAW,mBACV"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ProfileTelemetry } from "../../types/telemetry.cjs";
|
|
2
2
|
import { DoomTelemetryOptions } from "@agimon-ai/doompi-telemetry";
|
|
3
3
|
//#region src/adapters/telemetry/logSinkTelemetry.d.ts
|
|
4
|
-
interface ProfileTelemetryOptions {
|
|
4
|
+
export interface ProfileTelemetryOptions {
|
|
5
5
|
cwd?: string;
|
|
6
6
|
workspaceRoot?: string;
|
|
7
7
|
env?: NodeJS.ProcessEnv;
|
|
8
8
|
telemetryFactory?: NonNullable<DoomTelemetryOptions['telemetryFactory']>;
|
|
9
9
|
warn?: (message: string) => void;
|
|
10
10
|
}
|
|
11
|
-
declare function createProfileTelemetry(options?: ProfileTelemetryOptions): ProfileTelemetry;
|
|
11
|
+
export declare function createProfileTelemetry(options?: ProfileTelemetryOptions): ProfileTelemetry;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { ProfileTelemetryOptions, createProfileTelemetry };
|
|
14
13
|
//# sourceMappingURL=logSinkTelemetry.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logSinkTelemetry.d.cts","names":[],"sources":["../../../src/adapters/telemetry/logSinkTelemetry.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"logSinkTelemetry.d.cts","names":[],"sources":["../../../src/adapters/telemetry/logSinkTelemetry.ts"],"mappings":";;;iBAMiB;EACf;EACA;EACA,MAAM,OAAO;EACb,mBAAmB,YAAY;EAC/B,QAAQ;;wBAGM,uBAAuB,UAAS,0BAA+B"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ProfileTelemetry } from "../../types/telemetry.mjs";
|
|
2
2
|
import { DoomTelemetryOptions } from "@agimon-ai/doompi-telemetry";
|
|
3
3
|
//#region src/adapters/telemetry/logSinkTelemetry.d.ts
|
|
4
|
-
interface ProfileTelemetryOptions {
|
|
4
|
+
export interface ProfileTelemetryOptions {
|
|
5
5
|
cwd?: string;
|
|
6
6
|
workspaceRoot?: string;
|
|
7
7
|
env?: NodeJS.ProcessEnv;
|
|
8
8
|
telemetryFactory?: NonNullable<DoomTelemetryOptions['telemetryFactory']>;
|
|
9
9
|
warn?: (message: string) => void;
|
|
10
10
|
}
|
|
11
|
-
declare function createProfileTelemetry(options?: ProfileTelemetryOptions): ProfileTelemetry;
|
|
11
|
+
export declare function createProfileTelemetry(options?: ProfileTelemetryOptions): ProfileTelemetry;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { ProfileTelemetryOptions, createProfileTelemetry };
|
|
14
13
|
//# sourceMappingURL=logSinkTelemetry.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logSinkTelemetry.d.mts","names":[],"sources":["../../../src/adapters/telemetry/logSinkTelemetry.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"logSinkTelemetry.d.mts","names":[],"sources":["../../../src/adapters/telemetry/logSinkTelemetry.ts"],"mappings":";;;iBAMiB;EACf;EACA;EACA,MAAM,OAAO;EACb,mBAAmB,YAAY;EAC/B,QAAQ;;wBAGM,uBAAuB,UAAS,0BAA+B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../types/telemetry.cjs"),t=require("../services/profileText.cjs");let n=require("@agimon-ai/doompi-
|
|
1
|
+
const e=require("../types/telemetry.cjs"),t=require("../services/profileText.cjs");let n=require("@agimon-ai/doompi-config/piContext"),r=require("@agimon-ai/doompi-extension-contracts/transition");const i=`warning`,a=`info`,o=`.doom/profiles.yaml`;function s(){let e,t,n,r,i;return{harnessStore:()=>e??=import(`@agimon-ai/doompi-config/harnessStore`),journal:()=>t??=import(`@agimon-ai/doompi-config/piContext`),picker:()=>n??=import(`@agimon-ai/doompi-ui/components/matrixPicker`),profiles:()=>r??=import(`@agimon-ai/doompi-config/profiles`),selection:()=>i??=import(`@agimon-ai/doompi-config/selectionSwitch`)}}async function c(e,n,r,i){let a=t.profileTitle(r);if(e.mode!==`tui`)return e.ui.select(a,n.map(e=>e.name));let{MatrixPickerComponent:o}=await i();return(await e.ui.custom((e,i,s,c)=>new o({title:a,items:t.profileItems(n),selected:r?[r]:[],multi:!1},i,s,c)))?.[0]}function l(l,u,d){let f=s();l.registerCommand(`profile`,{description:`Show profiles and load a different persona and environment`,handler:async(s,p)=>{let m=d(),h=(0,n.requireDoomConfigContext)(m).harness,[{requireHarnessRoot:g},{loadProfiles:_}]=await Promise.all([f.harnessStore(),f.profiles()]),v=g(h),y=h.profile,b;try{b=_(v)}catch(t){let n=t instanceof Error?t.message:String(t);u.recordError(e.PROFILE_EVENT.profileLoadFailed,t),p.ui.notify(`Could not load ${o}: ${n}`,i);return}if(b.length===0){p.ui.notify(`No profiles found in ${o}.`,i);return}let x=await c(p,b,y,f.picker),S=b.find(e=>e.name===x);if(!S)return;if(S.name===y){p.ui.notify(t.profileSummary(S),a);return}let C=(0,r.requireDoomTransitionCoordinator)(m),w,T=await C.execute({sessionId:p.sessionManager.getSessionId(),hostGeneration:C.hostGeneration,operationId:crypto.randomUUID(),source:p.mode===`tui`?`ui`:`command`,target:{axis:`profile`,profile:S.name}},async(t,n)=>{w=(0,r.prepareMinorModeReloadHandoff)(m,p.sessionManager.getSessionId(),C.hostGeneration,n.operationId,n.previous.minorModes);try{let{applyProfile:t}=await f.selection();p.ui.notify(await t(S,h),a);let{persistHarnessSelection:r}=await f.journal();return r(l,{...h,profile:S.name}),u.recordEvent(e.PROFILE_EVENT.profileApplied,{"harness.profile":S.name,...y?{"harness.profile.previous":y}:{},"harness.transition.disposition":n.disposition,"harness.transition.operation_id":n.operationId}),`applied`}catch(e){throw w?.discard(),w=void 0,e}});if(T.outcome===`rejected`||T.outcome===`stale`){w?.discard(),p.ui.notify(`Profile transition was ${T.outcome}: ${T.diagnostics.join(`, `)}`,i);return}if(T.outcome!==`applied`){w?.discard();return}try{await p.waitForIdle(),await p.reload()}catch(e){throw w?.discard(),e}}})}exports.registerProfileCommand=l;
|
|
2
2
|
//# sourceMappingURL=profileCommand.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{PROFILE_EVENT as e}from"../types/telemetry.mjs";import{profileItems as t,profileSummary as n,profileTitle as r}from"../services/profileText.mjs";import{
|
|
1
|
+
import{PROFILE_EVENT as e}from"../types/telemetry.mjs";import{profileItems as t,profileSummary as n,profileTitle as r}from"../services/profileText.mjs";import{requireDoomConfigContext as i}from"@agimon-ai/doompi-config/piContext";import{prepareMinorModeReloadHandoff as a,requireDoomTransitionCoordinator as o}from"@agimon-ai/doompi-extension-contracts/transition";const s=`warning`,c=`info`,l=`.doom/profiles.yaml`;function u(){let e,t,n,r,i;return{harnessStore:()=>e??=import(`@agimon-ai/doompi-config/harnessStore`),journal:()=>t??=import(`@agimon-ai/doompi-config/piContext`),picker:()=>n??=import(`@agimon-ai/doompi-ui/components/matrixPicker`),profiles:()=>r??=import(`@agimon-ai/doompi-config/profiles`),selection:()=>i??=import(`@agimon-ai/doompi-config/selectionSwitch`)}}async function d(e,n,i,a){let o=r(i);if(e.mode!==`tui`)return e.ui.select(o,n.map(e=>e.name));let{MatrixPickerComponent:s}=await a();return(await e.ui.custom((e,r,a,c)=>new s({title:o,items:t(n),selected:i?[i]:[],multi:!1},r,a,c)))?.[0]}function f(t,r,f){let p=u();t.registerCommand(`profile`,{description:`Show profiles and load a different persona and environment`,handler:async(u,m)=>{let h=f(),g=i(h).harness,[{requireHarnessRoot:_},{loadProfiles:v}]=await Promise.all([p.harnessStore(),p.profiles()]),y=_(g),b=g.profile,x;try{x=v(y)}catch(t){let n=t instanceof Error?t.message:String(t);r.recordError(e.profileLoadFailed,t),m.ui.notify(`Could not load ${l}: ${n}`,s);return}if(x.length===0){m.ui.notify(`No profiles found in ${l}.`,s);return}let S=await d(m,x,b,p.picker),C=x.find(e=>e.name===S);if(!C)return;if(C.name===b){m.ui.notify(n(C),c);return}let w=o(h),T,E=await w.execute({sessionId:m.sessionManager.getSessionId(),hostGeneration:w.hostGeneration,operationId:crypto.randomUUID(),source:m.mode===`tui`?`ui`:`command`,target:{axis:`profile`,profile:C.name}},async(n,i)=>{T=a(h,m.sessionManager.getSessionId(),w.hostGeneration,i.operationId,i.previous.minorModes);try{let{applyProfile:n}=await p.selection();m.ui.notify(await n(C,g),c);let{persistHarnessSelection:a}=await p.journal();return a(t,{...g,profile:C.name}),r.recordEvent(e.profileApplied,{"harness.profile":C.name,...b?{"harness.profile.previous":b}:{},"harness.transition.disposition":i.disposition,"harness.transition.operation_id":i.operationId}),`applied`}catch(e){throw T?.discard(),T=void 0,e}});if(E.outcome===`rejected`||E.outcome===`stale`){T?.discard(),m.ui.notify(`Profile transition was ${E.outcome}: ${E.diagnostics.join(`, `)}`,s);return}if(E.outcome!==`applied`){T?.discard();return}try{await m.waitForIdle(),await m.reload()}catch(e){throw T?.discard(),e}}})}export{f as registerProfileCommand};
|
|
2
2
|
//# sourceMappingURL=profileCommand.mjs.map
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./adapters/telemetry/logSinkTelemetry.cjs"),t=require("./types/telemetry.cjs"),n=require("./adapters/pi/persona.cjs"),r=require("./services/profileText.cjs"),i=require("./adapters/pi/extension.cjs");exports.PROFILE_EVENT=t.PROFILE_EVENT,exports.createProfileTelemetry=e.createProfileTelemetry,exports.personaExtension=n.default,exports.profileDescription=r.profileDescription,exports.profileExtension=i.default,exports.profileItems=r.profileItems,exports.profileSummary=r.profileSummary,exports.profileTitle=r.profileTitle;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./adapters/telemetry/logSinkTelemetry.cjs"),t=require("./types/telemetry.cjs"),n=require("./adapters/pi/persona.cjs"),r=require("./services/profileText.cjs"),i=require("./adapters/pi/extension.cjs");exports.PROFILE_EVENT=t.PROFILE_EVENT,exports.PROFILE_STATUS_KEY=r.PROFILE_STATUS_KEY,exports.createProfileTelemetry=e.createProfileTelemetry,exports.personaExtension=n.default,exports.profileDescription=r.profileDescription,exports.profileExtension=i.default,exports.profileItems=r.profileItems,exports.profileStatus=r.profileStatus,exports.profileSummary=r.profileSummary,exports.profileTitle=r.profileTitle;
|
package/dist/index.d.cts
CHANGED
|
@@ -2,5 +2,5 @@ import { PROFILE_EVENT, ProfileEventAttributes, ProfileEventName, ProfileTelemet
|
|
|
2
2
|
import personaExtension from "./adapters/pi/persona.cjs";
|
|
3
3
|
import profileExtension from "./adapters/pi/extension.cjs";
|
|
4
4
|
import { ProfileTelemetryOptions, createProfileTelemetry } from "./adapters/telemetry/logSinkTelemetry.cjs";
|
|
5
|
-
import { profileDescription, profileItems, profileSummary, profileTitle } from "./services/profileText.cjs";
|
|
6
|
-
export { PROFILE_EVENT, type ProfileEventAttributes, type ProfileEventName, type ProfileTelemetry, type ProfileTelemetryOptions, createProfileTelemetry, personaExtension, profileDescription, profileExtension, profileItems, profileSummary, profileTitle };
|
|
5
|
+
import { PROFILE_STATUS_KEY, profileDescription, profileItems, profileStatus, profileSummary, profileTitle } from "./services/profileText.cjs";
|
|
6
|
+
export { PROFILE_EVENT, PROFILE_STATUS_KEY, type ProfileEventAttributes, type ProfileEventName, type ProfileTelemetry, type ProfileTelemetryOptions, createProfileTelemetry, personaExtension, profileDescription, profileExtension, profileItems, profileStatus, profileSummary, profileTitle };
|
package/dist/index.d.mts
CHANGED
|
@@ -2,5 +2,5 @@ import { PROFILE_EVENT, ProfileEventAttributes, ProfileEventName, ProfileTelemet
|
|
|
2
2
|
import personaExtension from "./adapters/pi/persona.mjs";
|
|
3
3
|
import profileExtension from "./adapters/pi/extension.mjs";
|
|
4
4
|
import { ProfileTelemetryOptions, createProfileTelemetry } from "./adapters/telemetry/logSinkTelemetry.mjs";
|
|
5
|
-
import { profileDescription, profileItems, profileSummary, profileTitle } from "./services/profileText.mjs";
|
|
6
|
-
export { PROFILE_EVENT, type ProfileEventAttributes, type ProfileEventName, type ProfileTelemetry, type ProfileTelemetryOptions, createProfileTelemetry, personaExtension, profileDescription, profileExtension, profileItems, profileSummary, profileTitle };
|
|
5
|
+
import { PROFILE_STATUS_KEY, profileDescription, profileItems, profileStatus, profileSummary, profileTitle } from "./services/profileText.mjs";
|
|
6
|
+
export { PROFILE_EVENT, PROFILE_STATUS_KEY, type ProfileEventAttributes, type ProfileEventName, type ProfileTelemetry, type ProfileTelemetryOptions, createProfileTelemetry, personaExtension, profileDescription, profileExtension, profileItems, profileStatus, profileSummary, profileTitle };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createProfileTelemetry as e}from"./adapters/telemetry/logSinkTelemetry.mjs";import{PROFILE_EVENT as t}from"./types/telemetry.mjs";import n from"./adapters/pi/persona.mjs";import{
|
|
1
|
+
import{createProfileTelemetry as e}from"./adapters/telemetry/logSinkTelemetry.mjs";import{PROFILE_EVENT as t}from"./types/telemetry.mjs";import n from"./adapters/pi/persona.mjs";import{PROFILE_STATUS_KEY as r,profileDescription as i,profileItems as a,profileStatus as o,profileSummary as s,profileTitle as c}from"./services/profileText.mjs";import l from"./adapters/pi/extension.mjs";export{t as PROFILE_EVENT,r as PROFILE_STATUS_KEY,e as createProfileTelemetry,n as personaExtension,i as profileDescription,l as profileExtension,a as profileItems,o as profileStatus,s as profileSummary,c as profileTitle};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const e=`(none)`;function t(e){return e.map(e=>({value:e.name,label:e.name,description:
|
|
2
|
-
`)}function
|
|
1
|
+
const e=`(none)`;function t(e,t){return e||(t?``:void 0)}function n(e){return e.map(e=>({value:e.name,label:e.name,description:r(e)}))}function r(e){let t=Object.keys(e.env).sort();return t.length>0?`${e.persona} (env: ${t.join(`, `)})`:e.persona}function i(t){let n=Object.keys(t.env).sort();return[`Profile ${t.name}`,`Persona: ${t.persona}`,`Env: ${n.join(`, `)||e}`,`Already loaded.`].join(`
|
|
2
|
+
`)}function a(t){return`Profile (current: ${t??e})`}exports.PROFILE_STATUS_KEY=`doom-profile`,exports.profileDescription=r,exports.profileItems=n,exports.profileStatus=t,exports.profileSummary=i,exports.profileTitle=a;
|
|
3
3
|
//# sourceMappingURL=profileText.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileText.cjs","names":[],"sources":["../../src/services/profileText.ts"],"sourcesContent":["import type { AgentProfile } from '@agimon-ai/doompi-config/profiles';\nimport type { SelectItem } from '@earendil-works/pi-tui';\n\nconst NONE = '(none)';\n\n/** Rows for the single-select profile picker. */\nexport function profileItems(profiles: AgentProfile[]): SelectItem[] {\n return profiles.map((profile) => ({\n value: profile.name,\n label: profile.name,\n description: profileDescription(profile),\n }));\n}\n\nexport function profileDescription(profile: AgentProfile): string {\n const environmentKeys = Object.keys(profile.env).sort();\n return environmentKeys.length > 0 ? `${profile.persona} (env: ${environmentKeys.join(', ')})` : profile.persona;\n}\n\n/** Shown when the picked profile is already active. */\nexport function profileSummary(profile: AgentProfile): string {\n const environmentKeys = Object.keys(profile.env).sort();\n return [\n `Profile ${profile.name}`,\n `Persona: ${profile.persona}`,\n `Env: ${environmentKeys.join(', ') || NONE}`,\n 'Already loaded.',\n ].join('\\n');\n}\n\nexport function profileTitle(current?: string): string {\n return `Profile (current: ${current ?? NONE})`;\n}\n"],"mappings":"AAGA,MAAM,EAAO,
|
|
1
|
+
{"version":3,"file":"profileText.cjs","names":[],"sources":["../../src/services/profileText.ts"],"sourcesContent":["import type { AgentProfile } from '@agimon-ai/doompi-config/profiles';\nimport type { SelectItem } from '@earendil-works/pi-tui';\n\nconst NONE = '(none)';\n\n/** Footer status key the cockpit's profile axis reads. */\nexport const PROFILE_STATUS_KEY = 'doom-profile';\n\n/**\n * The published axis content: the active profile's name, empty while\n * profiles exist with none active, and undefined to withhold the status so\n * the cockpit keeps the axis off the bar entirely.\n */\nexport function profileStatus(current: string | undefined, hasProfiles: boolean): string | undefined {\n if (current) return current;\n return hasProfiles ? '' : undefined;\n}\n\n/** Rows for the single-select profile picker. */\nexport function profileItems(profiles: AgentProfile[]): SelectItem[] {\n return profiles.map((profile) => ({\n value: profile.name,\n label: profile.name,\n description: profileDescription(profile),\n }));\n}\n\nexport function profileDescription(profile: AgentProfile): string {\n const environmentKeys = Object.keys(profile.env).sort();\n return environmentKeys.length > 0 ? `${profile.persona} (env: ${environmentKeys.join(', ')})` : profile.persona;\n}\n\n/** Shown when the picked profile is already active. */\nexport function profileSummary(profile: AgentProfile): string {\n const environmentKeys = Object.keys(profile.env).sort();\n return [\n `Profile ${profile.name}`,\n `Persona: ${profile.persona}`,\n `Env: ${environmentKeys.join(', ') || NONE}`,\n 'Already loaded.',\n ].join('\\n');\n}\n\nexport function profileTitle(current?: string): string {\n return `Profile (current: ${current ?? NONE})`;\n}\n"],"mappings":"AAGA,MAAM,EAAO,SAUb,SAAgB,EAAc,EAA6B,EAA0C,CAEnG,OADI,IACG,EAAc,GAAK,IAAA,GAC5B,CAGA,SAAgB,EAAa,EAAwC,CACnE,OAAO,EAAS,IAAK,IAAa,CAChC,MAAO,EAAQ,KACf,MAAO,EAAQ,KACf,YAAa,EAAmB,CAAO,CACzC,EAAE,CACJ,CAEA,SAAgB,EAAmB,EAA+B,CAChE,IAAM,EAAkB,OAAO,KAAK,EAAQ,GAAG,CAAC,CAAC,KAAK,EACtD,OAAO,EAAgB,OAAS,EAAI,GAAG,EAAQ,QAAQ,SAAS,EAAgB,KAAK,IAAI,EAAE,GAAK,EAAQ,OAC1G,CAGA,SAAgB,EAAe,EAA+B,CAC5D,IAAM,EAAkB,OAAO,KAAK,EAAQ,GAAG,CAAC,CAAC,KAAK,EACtD,MAAO,CACL,WAAW,EAAQ,OACnB,YAAY,EAAQ,UACpB,QAAQ,EAAgB,KAAK,IAAI,GAAK,IACtC,iBACF,CAAC,CAAC,KAAK;CAAI,CACb,CAEA,SAAgB,EAAa,EAA0B,CACrD,MAAO,qBAAqB,GAAW,EAAK,EAC9C"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { AgentProfile } from "@agimon-ai/doompi-config/profiles";
|
|
2
2
|
import { SelectItem } from "@earendil-works/pi-tui";
|
|
3
3
|
//#region src/services/profileText.d.ts
|
|
4
|
+
/** Footer status key the cockpit's profile axis reads. */
|
|
5
|
+
export declare const PROFILE_STATUS_KEY = "doom-profile";
|
|
6
|
+
/**
|
|
7
|
+
* The published axis content: the active profile's name, empty while
|
|
8
|
+
* profiles exist with none active, and undefined to withhold the status so
|
|
9
|
+
* the cockpit keeps the axis off the bar entirely.
|
|
10
|
+
*/
|
|
11
|
+
export declare function profileStatus(current: string | undefined, hasProfiles: boolean): string | undefined;
|
|
4
12
|
/** Rows for the single-select profile picker. */
|
|
5
|
-
declare function profileItems(profiles: AgentProfile[]): SelectItem[];
|
|
6
|
-
declare function profileDescription(profile: AgentProfile): string;
|
|
13
|
+
export declare function profileItems(profiles: AgentProfile[]): SelectItem[];
|
|
14
|
+
export declare function profileDescription(profile: AgentProfile): string;
|
|
7
15
|
/** Shown when the picked profile is already active. */
|
|
8
|
-
declare function profileSummary(profile: AgentProfile): string;
|
|
9
|
-
declare function profileTitle(current?: string): string;
|
|
16
|
+
export declare function profileSummary(profile: AgentProfile): string;
|
|
17
|
+
export declare function profileTitle(current?: string): string;
|
|
10
18
|
//#endregion
|
|
11
|
-
export { profileDescription, profileItems, profileSummary, profileTitle };
|
|
12
19
|
//# sourceMappingURL=profileText.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileText.d.cts","names":[],"sources":["../../src/services/profileText.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"profileText.d.cts","names":[],"sources":["../../src/services/profileText.ts"],"mappings":";;;;qBAMa;;;;;;wBAOG,cAAc,6BAA6B;;wBAM3C,aAAa,UAAU,iBAAiB;wBAQxC,mBAAmB,SAAS;;wBAM5B,eAAe,SAAS;wBAUxB,aAAa"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { AgentProfile } from "@agimon-ai/doompi-config/profiles";
|
|
2
2
|
import { SelectItem } from "@earendil-works/pi-tui";
|
|
3
3
|
//#region src/services/profileText.d.ts
|
|
4
|
+
/** Footer status key the cockpit's profile axis reads. */
|
|
5
|
+
export declare const PROFILE_STATUS_KEY = "doom-profile";
|
|
6
|
+
/**
|
|
7
|
+
* The published axis content: the active profile's name, empty while
|
|
8
|
+
* profiles exist with none active, and undefined to withhold the status so
|
|
9
|
+
* the cockpit keeps the axis off the bar entirely.
|
|
10
|
+
*/
|
|
11
|
+
export declare function profileStatus(current: string | undefined, hasProfiles: boolean): string | undefined;
|
|
4
12
|
/** Rows for the single-select profile picker. */
|
|
5
|
-
declare function profileItems(profiles: AgentProfile[]): SelectItem[];
|
|
6
|
-
declare function profileDescription(profile: AgentProfile): string;
|
|
13
|
+
export declare function profileItems(profiles: AgentProfile[]): SelectItem[];
|
|
14
|
+
export declare function profileDescription(profile: AgentProfile): string;
|
|
7
15
|
/** Shown when the picked profile is already active. */
|
|
8
|
-
declare function profileSummary(profile: AgentProfile): string;
|
|
9
|
-
declare function profileTitle(current?: string): string;
|
|
16
|
+
export declare function profileSummary(profile: AgentProfile): string;
|
|
17
|
+
export declare function profileTitle(current?: string): string;
|
|
10
18
|
//#endregion
|
|
11
|
-
export { profileDescription, profileItems, profileSummary, profileTitle };
|
|
12
19
|
//# sourceMappingURL=profileText.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileText.d.mts","names":[],"sources":["../../src/services/profileText.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"profileText.d.mts","names":[],"sources":["../../src/services/profileText.ts"],"mappings":";;;;qBAMa;;;;;;wBAOG,cAAc,6BAA6B;;wBAM3C,aAAa,UAAU,iBAAiB;wBAQxC,mBAAmB,SAAS;;wBAM5B,eAAe,SAAS;wBAUxB,aAAa"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const e=`(none)`;function t(e){return e.map(e=>({value:e.name,label:e.name,description:
|
|
2
|
-
`)}function
|
|
1
|
+
const e=`(none)`,t=`doom-profile`;function n(e,t){return e||(t?``:void 0)}function r(e){return e.map(e=>({value:e.name,label:e.name,description:i(e)}))}function i(e){let t=Object.keys(e.env).sort();return t.length>0?`${e.persona} (env: ${t.join(`, `)})`:e.persona}function a(t){let n=Object.keys(t.env).sort();return[`Profile ${t.name}`,`Persona: ${t.persona}`,`Env: ${n.join(`, `)||e}`,`Already loaded.`].join(`
|
|
2
|
+
`)}function o(t){return`Profile (current: ${t??e})`}export{t as PROFILE_STATUS_KEY,i as profileDescription,r as profileItems,n as profileStatus,a as profileSummary,o as profileTitle};
|
|
3
3
|
//# sourceMappingURL=profileText.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileText.mjs","names":[],"sources":["../../src/services/profileText.ts"],"sourcesContent":["import type { AgentProfile } from '@agimon-ai/doompi-config/profiles';\nimport type { SelectItem } from '@earendil-works/pi-tui';\n\nconst NONE = '(none)';\n\n/** Rows for the single-select profile picker. */\nexport function profileItems(profiles: AgentProfile[]): SelectItem[] {\n return profiles.map((profile) => ({\n value: profile.name,\n label: profile.name,\n description: profileDescription(profile),\n }));\n}\n\nexport function profileDescription(profile: AgentProfile): string {\n const environmentKeys = Object.keys(profile.env).sort();\n return environmentKeys.length > 0 ? `${profile.persona} (env: ${environmentKeys.join(', ')})` : profile.persona;\n}\n\n/** Shown when the picked profile is already active. */\nexport function profileSummary(profile: AgentProfile): string {\n const environmentKeys = Object.keys(profile.env).sort();\n return [\n `Profile ${profile.name}`,\n `Persona: ${profile.persona}`,\n `Env: ${environmentKeys.join(', ') || NONE}`,\n 'Already loaded.',\n ].join('\\n');\n}\n\nexport function profileTitle(current?: string): string {\n return `Profile (current: ${current ?? NONE})`;\n}\n"],"mappings":"AAGA,MAAM,EAAO,
|
|
1
|
+
{"version":3,"file":"profileText.mjs","names":[],"sources":["../../src/services/profileText.ts"],"sourcesContent":["import type { AgentProfile } from '@agimon-ai/doompi-config/profiles';\nimport type { SelectItem } from '@earendil-works/pi-tui';\n\nconst NONE = '(none)';\n\n/** Footer status key the cockpit's profile axis reads. */\nexport const PROFILE_STATUS_KEY = 'doom-profile';\n\n/**\n * The published axis content: the active profile's name, empty while\n * profiles exist with none active, and undefined to withhold the status so\n * the cockpit keeps the axis off the bar entirely.\n */\nexport function profileStatus(current: string | undefined, hasProfiles: boolean): string | undefined {\n if (current) return current;\n return hasProfiles ? '' : undefined;\n}\n\n/** Rows for the single-select profile picker. */\nexport function profileItems(profiles: AgentProfile[]): SelectItem[] {\n return profiles.map((profile) => ({\n value: profile.name,\n label: profile.name,\n description: profileDescription(profile),\n }));\n}\n\nexport function profileDescription(profile: AgentProfile): string {\n const environmentKeys = Object.keys(profile.env).sort();\n return environmentKeys.length > 0 ? `${profile.persona} (env: ${environmentKeys.join(', ')})` : profile.persona;\n}\n\n/** Shown when the picked profile is already active. */\nexport function profileSummary(profile: AgentProfile): string {\n const environmentKeys = Object.keys(profile.env).sort();\n return [\n `Profile ${profile.name}`,\n `Persona: ${profile.persona}`,\n `Env: ${environmentKeys.join(', ') || NONE}`,\n 'Already loaded.',\n ].join('\\n');\n}\n\nexport function profileTitle(current?: string): string {\n return `Profile (current: ${current ?? NONE})`;\n}\n"],"mappings":"AAGA,MAAM,EAAO,SAGA,EAAqB,eAOlC,SAAgB,EAAc,EAA6B,EAA0C,CAEnG,OADI,IACG,EAAc,GAAK,IAAA,GAC5B,CAGA,SAAgB,EAAa,EAAwC,CACnE,OAAO,EAAS,IAAK,IAAa,CAChC,MAAO,EAAQ,KACf,MAAO,EAAQ,KACf,YAAa,EAAmB,CAAO,CACzC,EAAE,CACJ,CAEA,SAAgB,EAAmB,EAA+B,CAChE,IAAM,EAAkB,OAAO,KAAK,EAAQ,GAAG,CAAC,CAAC,KAAK,EACtD,OAAO,EAAgB,OAAS,EAAI,GAAG,EAAQ,QAAQ,SAAS,EAAgB,KAAK,IAAI,EAAE,GAAK,EAAQ,OAC1G,CAGA,SAAgB,EAAe,EAA+B,CAC5D,IAAM,EAAkB,OAAO,KAAK,EAAQ,GAAG,CAAC,CAAC,KAAK,EACtD,MAAO,CACL,WAAW,EAAQ,OACnB,YAAY,EAAQ,UACpB,QAAQ,EAAgB,KAAK,IAAI,GAAK,IACtC,iBACF,CAAC,CAAC,KAAK;CAAI,CACb,CAEA,SAAgB,EAAa,EAA0B,CACrD,MAAO,qBAAqB,GAAW,EAAK,EAC9C"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
//#region src/types/telemetry.d.ts
|
|
2
2
|
/** Telemetry events this package reports, and the port that records them. */
|
|
3
|
-
declare const PROFILE_EVENT: {
|
|
4
|
-
readonly profileApplied:
|
|
5
|
-
readonly profileLoadFailed:
|
|
6
|
-
readonly personaReadFailed:
|
|
3
|
+
export declare const PROFILE_EVENT: {
|
|
4
|
+
readonly profileApplied: 'doom_pi_profile.applied';
|
|
5
|
+
readonly profileLoadFailed: 'doom_pi_profile.load_failed';
|
|
6
|
+
readonly personaReadFailed: 'doom_pi_profile.persona_read_failed';
|
|
7
7
|
};
|
|
8
|
-
type ProfileEventName = (typeof PROFILE_EVENT)[keyof typeof PROFILE_EVENT];
|
|
9
|
-
type ProfileEventAttributes = Record<string, string | number | boolean>;
|
|
10
|
-
interface ProfileTelemetry {
|
|
8
|
+
export type ProfileEventName = (typeof PROFILE_EVENT)[keyof typeof PROFILE_EVENT];
|
|
9
|
+
export type ProfileEventAttributes = Record<string, string | number | boolean>;
|
|
10
|
+
export interface ProfileTelemetry {
|
|
11
11
|
recordError(event: ProfileEventName, error: unknown, attributes?: ProfileEventAttributes): Promise<void>;
|
|
12
12
|
recordEvent(event: ProfileEventName, attributes?: ProfileEventAttributes): Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
|
-
export { PROFILE_EVENT, ProfileEventAttributes, ProfileEventName, ProfileTelemetry };
|
|
16
15
|
//# sourceMappingURL=telemetry.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.cts","names":[],"sources":["../../src/types/telemetry.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"telemetry.d.cts","names":[],"sources":["../../src/types/telemetry.ts"],"mappings":";;qBACa;WACX;WACA;WACA;;YAGU,2BAA2B,4BAA4B;YACvD,yBAAyB;iBAEpB;EACf,YAAY,OAAO,kBAAkB,gBAAgB,aAAa,yBAAyB;EAC3F,YAAY,OAAO,kBAAkB,aAAa,yBAAyB"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
//#region src/types/telemetry.d.ts
|
|
2
2
|
/** Telemetry events this package reports, and the port that records them. */
|
|
3
|
-
declare const PROFILE_EVENT: {
|
|
4
|
-
readonly profileApplied:
|
|
5
|
-
readonly profileLoadFailed:
|
|
6
|
-
readonly personaReadFailed:
|
|
3
|
+
export declare const PROFILE_EVENT: {
|
|
4
|
+
readonly profileApplied: 'doom_pi_profile.applied';
|
|
5
|
+
readonly profileLoadFailed: 'doom_pi_profile.load_failed';
|
|
6
|
+
readonly personaReadFailed: 'doom_pi_profile.persona_read_failed';
|
|
7
7
|
};
|
|
8
|
-
type ProfileEventName = (typeof PROFILE_EVENT)[keyof typeof PROFILE_EVENT];
|
|
9
|
-
type ProfileEventAttributes = Record<string, string | number | boolean>;
|
|
10
|
-
interface ProfileTelemetry {
|
|
8
|
+
export type ProfileEventName = (typeof PROFILE_EVENT)[keyof typeof PROFILE_EVENT];
|
|
9
|
+
export type ProfileEventAttributes = Record<string, string | number | boolean>;
|
|
10
|
+
export interface ProfileTelemetry {
|
|
11
11
|
recordError(event: ProfileEventName, error: unknown, attributes?: ProfileEventAttributes): Promise<void>;
|
|
12
12
|
recordEvent(event: ProfileEventName, attributes?: ProfileEventAttributes): Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
|
-
export { PROFILE_EVENT, ProfileEventAttributes, ProfileEventName, ProfileTelemetry };
|
|
16
15
|
//# sourceMappingURL=telemetry.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.mts","names":[],"sources":["../../src/types/telemetry.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"telemetry.d.mts","names":[],"sources":["../../src/types/telemetry.ts"],"mappings":";;qBACa;WACX;WACA;WACA;;YAGU,2BAA2B,4BAA4B;YACvD,yBAAyB;iBAEpB;EACf,YAAY,OAAO,kBAAkB,gBAAgB,aAAa,yBAAyB;EAC3F,YAAY,OAAO,kBAAkB,aAAa,yBAAyB"}
|
package/llms.txt
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# Doom Pi Profile
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Package-owned guidance for DoomPi profile discovery, personas, environment defaults, and precedence.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## How to author
|
|
6
6
|
|
|
7
|
-
- [
|
|
7
|
+
- [Author DoomPi profiles](./src/prompts/doompi-author-profile/SKILL.md): Configure personal and repository profiles.
|
|
8
|
+
- [Profiles authoring contract](./src/prompts/doompi-author-profile/references/profiles-contract.md): File locations, discovery, precedence, path safety, environment defaults, and verification.
|
|
9
|
+
|
|
10
|
+
## Package reference
|
|
11
|
+
|
|
12
|
+
- [Package README](./README.md): Profile behavior, activation, and public package entries.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/doompi-profile",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.42",
|
|
4
4
|
"description": "Persona and environment profile switching for DoomPi sessions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-persona",
|
|
@@ -15,12 +15,23 @@
|
|
|
15
15
|
"system-prompt"
|
|
16
16
|
],
|
|
17
17
|
"homepage": "https://agimon.ai",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/AgiFlow/doompi/issues"
|
|
20
|
+
},
|
|
18
21
|
"license": "MIT",
|
|
19
22
|
"author": "Vuong Ngo",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/AgiFlow/doompi.git",
|
|
26
|
+
"directory": "packages/core/doompi-profile"
|
|
27
|
+
},
|
|
20
28
|
"files": [
|
|
21
29
|
"dist",
|
|
30
|
+
"src/web",
|
|
31
|
+
"src/exports/webClient.ts",
|
|
22
32
|
"llms.txt",
|
|
23
33
|
"README.md",
|
|
34
|
+
"src/prompts",
|
|
24
35
|
"LICENSE",
|
|
25
36
|
"package.json"
|
|
26
37
|
],
|
|
@@ -50,26 +61,27 @@
|
|
|
50
61
|
"access": "public"
|
|
51
62
|
},
|
|
52
63
|
"dependencies": {
|
|
53
|
-
"@deepseek-ai/cordis": "4.0.
|
|
54
|
-
"@agimon-ai/doompi-
|
|
55
|
-
"@agimon-ai/doompi-
|
|
56
|
-
"@agimon-ai/doompi-
|
|
57
|
-
"@agimon-ai/doompi-
|
|
64
|
+
"@deepseek-ai/cordis": "4.0.2",
|
|
65
|
+
"@agimon-ai/doompi-config": "0.0.1-alpha.63",
|
|
66
|
+
"@agimon-ai/doompi-telemetry": "0.0.1-alpha.62",
|
|
67
|
+
"@agimon-ai/doompi-ui": "0.0.1-alpha.64",
|
|
68
|
+
"@agimon-ai/doompi-web-contracts": "0.0.1-alpha.26",
|
|
69
|
+
"@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.63"
|
|
58
70
|
},
|
|
59
71
|
"devDependencies": {
|
|
60
|
-
"@deepseek-ai/cordis": "4.0.
|
|
61
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
62
|
-
"@earendil-works/pi-tui": "0.
|
|
63
|
-
"@types/node": "26.
|
|
64
|
-
"@vitest/coverage-v8": "
|
|
65
|
-
"tsdown": "0.
|
|
66
|
-
"typescript": "
|
|
67
|
-
"vitest": "
|
|
68
|
-
"@agimon-ai/vibe-lint-plugin-doom-extension": "0.0.1-alpha.
|
|
72
|
+
"@deepseek-ai/cordis": "4.0.2",
|
|
73
|
+
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
74
|
+
"@earendil-works/pi-tui": "0.85.1",
|
|
75
|
+
"@types/node": "26.4.1",
|
|
76
|
+
"@vitest/coverage-v8": "5.0.0",
|
|
77
|
+
"tsdown": "0.23.0",
|
|
78
|
+
"typescript": "7.0.2",
|
|
79
|
+
"vitest": "5.0.0",
|
|
80
|
+
"@agimon-ai/vibe-lint-plugin-doom-extension": "0.0.1-alpha.60"
|
|
69
81
|
},
|
|
70
82
|
"peerDependencies": {
|
|
71
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
72
|
-
"@earendil-works/pi-tui": "0.
|
|
83
|
+
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
84
|
+
"@earendil-works/pi-tui": "0.85.1"
|
|
73
85
|
},
|
|
74
86
|
"peerDependenciesMeta": {
|
|
75
87
|
"@earendil-works/pi-coding-agent": {
|
|
@@ -82,6 +94,11 @@
|
|
|
82
94
|
"engines": {
|
|
83
95
|
"node": ">=22.19.0"
|
|
84
96
|
},
|
|
97
|
+
"doompiWeb": {
|
|
98
|
+
"pluginId": "profile",
|
|
99
|
+
"channels": [],
|
|
100
|
+
"client": "./src/exports/webClient.ts"
|
|
101
|
+
},
|
|
85
102
|
"pi": {
|
|
86
103
|
"extensions": [
|
|
87
104
|
"./dist/extensions/pi.mjs"
|
|
@@ -90,7 +107,7 @@
|
|
|
90
107
|
"scripts": {
|
|
91
108
|
"build": "tsdown",
|
|
92
109
|
"test": "vitest --run",
|
|
93
|
-
"typecheck": "tsc --noEmit",
|
|
110
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p src/web/tsconfig.json",
|
|
94
111
|
"lint": "oxlint . && oxfmt . --check",
|
|
95
112
|
"fixcode": "oxlint . --fix && oxfmt ."
|
|
96
113
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { webPlugin } from '../web/index.ts';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doompi-author-profile
|
|
3
|
+
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.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Author DoomPi profiles
|
|
7
|
+
|
|
8
|
+
Configure a profile as one persona plus optional environment defaults.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. Read both `~/.pi/.doom/profiles.yaml` and the repository's `.doom/profiles.yaml` when they exist.
|
|
13
|
+
2. Use `profiles.roots` for one-level persona discovery. Use `profiles.entries` when a profile needs an explicit persona path or environment defaults.
|
|
14
|
+
3. Resolve relative roots and persona paths against the file that declares them. Keep an explicit persona inside that file's `agents/` directory or one of its configured roots.
|
|
15
|
+
4. Put instructions in `profile.md`, `SOUL.md`, or `AGENTS.md`. DoomPi concatenates non-empty files in that order.
|
|
16
|
+
5. Keep every `env` value a string. Treat it as a default because an already exported value wins.
|
|
17
|
+
6. Preserve the precedence rules. Explicit entries override discoveries, and repository entries override personal entries at the same precedence level.
|
|
18
|
+
7. Verify the selection with `doompi --profile <name> --explain`, then smoke-test `/profile` when changing live switching behavior.
|
|
19
|
+
|
|
20
|
+
Read [references/profiles-contract.md](references/profiles-contract.md) before changing discovery, precedence, path handling, or profile application.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# DoomPi profiles authoring contract
|
|
2
|
+
|
|
3
|
+
## Sources and shape
|
|
4
|
+
|
|
5
|
+
DoomPi reads profile declarations in this order:
|
|
6
|
+
|
|
7
|
+
1. `~/.pi/.doom/profiles.yaml`
|
|
8
|
+
2. `<repoRoot>/.doom/profiles.yaml`
|
|
9
|
+
|
|
10
|
+
The current catalog shape is:
|
|
11
|
+
|
|
12
|
+
```yaml
|
|
13
|
+
profiles:
|
|
14
|
+
roots: [agents/acme]
|
|
15
|
+
entries:
|
|
16
|
+
writer:
|
|
17
|
+
persona: agents/special/writer
|
|
18
|
+
env:
|
|
19
|
+
BRAND: acme
|
|
20
|
+
TONE: concise
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The document may contain only the `profiles` mapping. In catalog form, `profiles` may contain only
|
|
24
|
+
`roots` and `entries`. DoomPi still accepts the earlier flat form, where profile names appear
|
|
25
|
+
directly below `profiles`, but new configuration should use catalog form.
|
|
26
|
+
|
|
27
|
+
Every relative root or persona path resolves against the file that declares it. Repository paths
|
|
28
|
+
resolve from the repository root. Personal paths resolve from `~/.pi/.doom`.
|
|
29
|
+
|
|
30
|
+
## Root discovery
|
|
31
|
+
|
|
32
|
+
Each `profiles.roots` value must resolve to an existing directory.
|
|
33
|
+
|
|
34
|
+
- If the root directly contains `profile.md`, `SOUL.md`, or `AGENTS.md`, the root is one profile.
|
|
35
|
+
Its directory name is the profile name, and its children are not scanned.
|
|
36
|
+
- Otherwise, DoomPi inspects only the root's direct-child directories. A child becomes a profile
|
|
37
|
+
when it directly contains at least one persona file.
|
|
38
|
+
- Discovery does not recurse. Add another root or an explicit entry for a deeper persona.
|
|
39
|
+
- A discovered profile has an empty environment mapping.
|
|
40
|
+
- Unreadable candidates and candidates whose real path or persona files escape the configured root
|
|
41
|
+
are ignored. An invalid configured root itself is an error.
|
|
42
|
+
|
|
43
|
+
## Explicit entries and path confinement
|
|
44
|
+
|
|
45
|
+
An explicit entry may contain only `persona` and `env`. `persona` is required, must be a non-empty
|
|
46
|
+
relative path, and must resolve to a directory containing readable persona content.
|
|
47
|
+
|
|
48
|
+
The persona must remain inside either:
|
|
49
|
+
|
|
50
|
+
- the `agents/` directory beside the declaring repository root or personal `.doom` directory, or
|
|
51
|
+
- one of the `profiles.roots` directories declared in that same file.
|
|
52
|
+
|
|
53
|
+
DoomPi checks both the lexical path and the real filesystem path. A persona-directory symlink cannot
|
|
54
|
+
escape an allowed root. Each resolved persona file must also remain inside the real persona
|
|
55
|
+
directory, so a file symlink cannot import instructions from outside it. Invalid explicit entries
|
|
56
|
+
fail loading instead of being skipped.
|
|
57
|
+
|
|
58
|
+
Persona content is assembled from non-empty files in this order:
|
|
59
|
+
|
|
60
|
+
1. `profile.md`
|
|
61
|
+
2. `SOUL.md`
|
|
62
|
+
3. `AGENTS.md`
|
|
63
|
+
|
|
64
|
+
## Precedence
|
|
65
|
+
|
|
66
|
+
DoomPi resolves names in four passes, from lowest to highest precedence:
|
|
67
|
+
|
|
68
|
+
1. Personal root discoveries
|
|
69
|
+
2. Repository root discoveries
|
|
70
|
+
3. Personal explicit entries
|
|
71
|
+
4. Repository explicit entries
|
|
72
|
+
|
|
73
|
+
A later profile replaces an earlier profile with the same name. This means any explicit entry
|
|
74
|
+
overrides discovery, including a personal explicit entry replacing a repository discovery. A
|
|
75
|
+
repository explicit entry wins over a personal explicit entry. Unrelated names from all sources
|
|
76
|
+
remain available, and the final list is sorted by profile name.
|
|
77
|
+
|
|
78
|
+
## Environment defaults and activation
|
|
79
|
+
|
|
80
|
+
Every `env` key maps to a string. Applying a profile writes only variables that are not already
|
|
81
|
+
exported by the caller. When switching profiles, DoomPi removes a value contributed by the previous
|
|
82
|
+
profile only if that value has not since changed, then applies the next profile's defaults.
|
|
83
|
+
|
|
84
|
+
The `/profile` command resolves the named profile and executes the change through the session
|
|
85
|
+
transition coordinator. A profile change uses Pi reload so extensions re-read the environment.
|
|
86
|
+
DoomPi assembles the persona into a private run-directory file, and the persona Pi entry appends
|
|
87
|
+
that content to the system prompt after reload.
|
|
88
|
+
|
|
89
|
+
## Verification
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
pnpm nx test @agimon-ai/doompi-config
|
|
93
|
+
pnpm nx typecheck @agimon-ai/doompi-config
|
|
94
|
+
pnpm nx test @agimon-ai/doompi-profile
|
|
95
|
+
pnpm nx typecheck @agimon-ai/doompi-profile
|
|
96
|
+
pnpm --filter @agimon-ai/doompi exec doompi --profile writer --explain
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Use an actual parent session to smoke-test `/profile` when changing transition, environment, or
|
|
100
|
+
persona application behavior.
|
package/src/web/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineWebPlugin } from '@agimon-ai/doompi-web-contracts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This package's cockpit presence: pure metadata. The selection bar renders
|
|
5
|
+
* the profile axis from what the session reports through the 'doom-profile'
|
|
6
|
+
* footer status; a session with no profiles publishes nothing and the axis
|
|
7
|
+
* stays off the bar.
|
|
8
|
+
*/
|
|
9
|
+
export const webPlugin = defineWebPlugin({
|
|
10
|
+
id: 'profile',
|
|
11
|
+
selectionAxes: [
|
|
12
|
+
{ name: 'profile', command: 'profile', statusKey: 'doom-profile', emptyLabel: 'no profile', order: 10 },
|
|
13
|
+
],
|
|
14
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "Bundler",
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noImplicitAny": true,
|
|
10
|
+
"noUnusedLocals": true,
|
|
11
|
+
"noUnusedParameters": true,
|
|
12
|
+
"noImplicitReturns": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"esModuleInterop": true,
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"allowImportingTsExtensions": true,
|
|
19
|
+
"forceConsistentCasingInFileNames": true
|
|
20
|
+
},
|
|
21
|
+
"include": [".", "../types", "../exports/webClient.ts"]
|
|
22
|
+
}
|