@agimon-ai/doompi-help 0.0.1-alpha.55 → 0.0.1-alpha.58
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/package.json +11 -9
- package/dist/_virtual/_rolldown/runtime.cjs +0 -1
- package/dist/api-contracts.cjs +0 -1
- package/dist/api-contracts.d.cts +0 -2
- package/dist/api-contracts.d.mts +0 -2
- package/dist/api-contracts.mjs +0 -1
- package/dist/constants/help.cjs +0 -2
- package/dist/constants/help.cjs.map +0 -1
- package/dist/constants/help.mjs +0 -2
- package/dist/constants/help.mjs.map +0 -1
- package/dist/controllers/helpCommand.cjs +0 -2
- package/dist/controllers/helpCommand.cjs.map +0 -1
- package/dist/controllers/helpCommand.mjs +0 -2
- package/dist/controllers/helpCommand.mjs.map +0 -1
- package/dist/controllers/helpMode.cjs +0 -2
- package/dist/controllers/helpMode.cjs.map +0 -1
- package/dist/controllers/helpMode.mjs +0 -2
- package/dist/controllers/helpMode.mjs.map +0 -1
- package/dist/controllers/helpPiRuntime.cjs +0 -2
- package/dist/controllers/helpPiRuntime.cjs.map +0 -1
- package/dist/controllers/helpPiRuntime.mjs +0 -2
- package/dist/controllers/helpPiRuntime.mjs.map +0 -1
- package/dist/controllers/helpServerSession.cjs +0 -2
- package/dist/controllers/helpServerSession.cjs.map +0 -1
- package/dist/controllers/helpServerSession.mjs +0 -2
- package/dist/controllers/helpServerSession.mjs.map +0 -1
- package/dist/extensions/pi.cjs +0 -2
- package/dist/extensions/pi.cjs.map +0 -1
- package/dist/extensions/pi.d.cts +0 -6
- package/dist/extensions/pi.d.cts.map +0 -1
- package/dist/extensions/pi.d.mts +0 -6
- package/dist/extensions/pi.d.mts.map +0 -1
- package/dist/extensions/pi.mjs +0 -2
- package/dist/extensions/pi.mjs.map +0 -1
- package/dist/extensions/server.cjs +0 -2
- package/dist/extensions/server.cjs.map +0 -1
- package/dist/extensions/server.d.cts +0 -5
- package/dist/extensions/server.d.cts.map +0 -1
- package/dist/extensions/server.d.mts +0 -5
- package/dist/extensions/server.d.mts.map +0 -1
- package/dist/extensions/server.mjs +0 -2
- package/dist/extensions/server.mjs.map +0 -1
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -6
- package/dist/index.d.mts +0 -6
- package/dist/index.mjs +0 -1
- package/dist/schemas/apiContracts.cjs +0 -2
- package/dist/schemas/apiContracts.cjs.map +0 -1
- package/dist/schemas/apiContracts.d.cts +0 -53
- package/dist/schemas/apiContracts.d.cts.map +0 -1
- package/dist/schemas/apiContracts.d.mts +0 -53
- package/dist/schemas/apiContracts.d.mts.map +0 -1
- package/dist/schemas/apiContracts.mjs +0 -2
- package/dist/schemas/apiContracts.mjs.map +0 -1
- package/dist/services/helpActivation/index.cjs +0 -2
- package/dist/services/helpActivation/index.cjs.map +0 -1
- package/dist/services/helpActivation/index.d.cts +0 -25
- package/dist/services/helpActivation/index.d.cts.map +0 -1
- package/dist/services/helpActivation/index.d.mts +0 -25
- package/dist/services/helpActivation/index.d.mts.map +0 -1
- package/dist/services/helpActivation/index.mjs +0 -2
- package/dist/services/helpActivation/index.mjs.map +0 -1
- package/dist/services/helpResources/index.cjs +0 -2
- package/dist/services/helpResources/index.cjs.map +0 -1
- package/dist/services/helpResources/index.mjs +0 -2
- package/dist/services/helpResources/index.mjs.map +0 -1
- package/dist/services/helpRuntime/index.cjs +0 -2
- package/dist/services/helpRuntime/index.cjs.map +0 -1
- package/dist/services/helpRuntime/index.d.cts +0 -17
- package/dist/services/helpRuntime/index.d.cts.map +0 -1
- package/dist/services/helpRuntime/index.d.mts +0 -17
- package/dist/services/helpRuntime/index.d.mts.map +0 -1
- package/dist/services/helpRuntime/index.mjs +0 -2
- package/dist/services/helpRuntime/index.mjs.map +0 -1
- package/dist/services/helpStorage/index.cjs +0 -2
- package/dist/services/helpStorage/index.cjs.map +0 -1
- package/dist/services/helpStorage/index.d.cts +0 -26
- package/dist/services/helpStorage/index.d.cts.map +0 -1
- package/dist/services/helpStorage/index.d.mts +0 -26
- package/dist/services/helpStorage/index.d.mts.map +0 -1
- package/dist/services/helpStorage/index.mjs +0 -2
- package/dist/services/helpStorage/index.mjs.map +0 -1
- package/dist/services/llmsContent/index.cjs +0 -2
- package/dist/services/llmsContent/index.cjs.map +0 -1
- package/dist/services/llmsContent/index.mjs +0 -2
- package/dist/services/llmsContent/index.mjs.map +0 -1
- package/dist/services/llmsResolver/index.cjs +0 -2
- package/dist/services/llmsResolver/index.cjs.map +0 -1
- package/dist/services/llmsResolver/index.d.cts +0 -18
- package/dist/services/llmsResolver/index.d.cts.map +0 -1
- package/dist/services/llmsResolver/index.d.mts +0 -18
- package/dist/services/llmsResolver/index.d.mts.map +0 -1
- package/dist/services/llmsResolver/index.mjs +0 -2
- package/dist/services/llmsResolver/index.mjs.map +0 -1
- package/dist/types/help.d.cts +0 -60
- package/dist/types/help.d.cts.map +0 -1
- package/dist/types/help.d.mts +0 -60
- package/dist/types/help.d.mts.map +0 -1
- package/src/extensions/web.ts +0 -23
- package/src/web/tsconfig.json +0 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/doompi-help",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.58",
|
|
4
4
|
"description": "Activation-gated package guidance and help skills for DoomPi and Pi extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-documentation",
|
|
@@ -27,8 +27,6 @@
|
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist",
|
|
30
|
-
"src/web",
|
|
31
|
-
"src/extensions/web.ts",
|
|
32
30
|
"llms.txt",
|
|
33
31
|
"src/prompts",
|
|
34
32
|
"README.md",
|
|
@@ -55,18 +53,22 @@
|
|
|
55
53
|
"import": "./dist/extensions/server.mjs",
|
|
56
54
|
"require": "./dist/extensions/server.cjs"
|
|
57
55
|
},
|
|
56
|
+
"./extensions/web": {
|
|
57
|
+
"import": "./dist/extensions/web.mjs"
|
|
58
|
+
},
|
|
58
59
|
"./package.json": "./package.json"
|
|
59
60
|
},
|
|
60
61
|
"publishConfig": {
|
|
61
62
|
"access": "public"
|
|
62
63
|
},
|
|
63
64
|
"dependencies": {
|
|
64
|
-
"@agimon-ai/doompi-core": "0.0.1-alpha.
|
|
65
|
-
"@agimon-ai/doompi-minor-mode": "0.0.1-alpha.
|
|
65
|
+
"@agimon-ai/doompi-core": "0.0.1-alpha.75",
|
|
66
|
+
"@agimon-ai/doompi-minor-mode": "0.0.1-alpha.75",
|
|
66
67
|
"@deepseek-ai/cordis": "4.0.2"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
|
-
"@agimon-ai/
|
|
70
|
+
"@agimon-ai/doompi-build": "0.0.1-alpha.4",
|
|
71
|
+
"@agimon-ai/vibe-lint-plugin-doom-extension": "0.0.1-alpha.70",
|
|
70
72
|
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
71
73
|
"@types/node": "26.5.1",
|
|
72
74
|
"@vitest/coverage-v8": "5.0.0",
|
|
@@ -86,7 +88,7 @@
|
|
|
86
88
|
"node": ">=22.19.0"
|
|
87
89
|
},
|
|
88
90
|
"doompiServer": {
|
|
89
|
-
"entry": "./
|
|
91
|
+
"entry": "./generated/server.ts",
|
|
90
92
|
"dist": "./dist/extensions/server.mjs",
|
|
91
93
|
"scopes": [
|
|
92
94
|
"session"
|
|
@@ -99,7 +101,7 @@
|
|
|
99
101
|
"doompiWeb": {
|
|
100
102
|
"pluginId": "help",
|
|
101
103
|
"channels": [],
|
|
102
|
-
"client": "./
|
|
104
|
+
"client": "./dist/extensions/web.mjs",
|
|
103
105
|
"scopes": [
|
|
104
106
|
"session"
|
|
105
107
|
]
|
|
@@ -112,7 +114,7 @@
|
|
|
112
114
|
"scripts": {
|
|
113
115
|
"build": "tsdown",
|
|
114
116
|
"test": "vitest --run",
|
|
115
|
-
"typecheck": "tsc --noEmit && tsc --noEmit -p
|
|
117
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.web.json",
|
|
116
118
|
"lint": "oxlint . && oxfmt . --check",
|
|
117
119
|
"fixcode": "oxlint . --fix && oxfmt ."
|
|
118
120
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));exports.__toESM=s;
|
package/dist/api-contracts.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./schemas/apiContracts.cjs");exports.apiContracts=e.apiContracts,exports.default=e.apiContracts;
|
package/dist/api-contracts.d.cts
DELETED
package/dist/api-contracts.d.mts
DELETED
package/dist/api-contracts.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{apiContracts as e}from"./schemas/apiContracts.mjs";export{e as apiContracts,e as default};
|
package/dist/constants/help.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"help.cjs","names":[],"sources":["../../src/constants/help.ts"],"sourcesContent":["export const HELP_COMMAND_NAME = 'doom-help';\nexport const HELP_COMMAND_DESCRIPTION = 'Toggle package Help guidance';\n"],"mappings":""}
|
package/dist/constants/help.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"help.mjs","names":[],"sources":["../../src/constants/help.ts"],"sourcesContent":["export const HELP_COMMAND_NAME = 'doom-help';\nexport const HELP_COMMAND_DESCRIPTION = 'Toggle package Help guidance';\n"],"mappings":"AAAA,MAAa,EAAoB,YACpB,EAA2B"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("../constants/help.cjs");let t=require("@agimon-ai/doompi-core/pi-extension");function n(n){return(0,t.defineCommand)({name:e.HELP_COMMAND_NAME,description:e.HELP_COMMAND_DESCRIPTION,execute:async(e,t)=>{let r=n(),i=r.getState().activation===`inactive`?await r.activate():r.deactivate(),a=i.activation===`inactive`?`Package Help deactivated.`:`Package Help activated.`;await t.notify({body:a,level:i.activation===`degraded`?`warning`:`info`})}})}exports.createHelpCommand=n;
|
|
2
|
-
//# sourceMappingURL=helpCommand.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpCommand.cjs","names":["defineCommand","HELP_COMMAND_NAME","HELP_COMMAND_DESCRIPTION"],"sources":["../../src/controllers/helpCommand.ts"],"sourcesContent":["import { defineCommand, type DoomPluginCommand } from '@agimon-ai/doompi-core/pi-extension';\n\nimport { HELP_COMMAND_NAME, HELP_COMMAND_DESCRIPTION } from '../constants/help';\nimport type { HelpActivationService } from '../types/help';\n\nexport type RequireHelpActivation = () => HelpActivationService;\n\nexport function createHelpCommand(requireActivation: RequireHelpActivation): DoomPluginCommand {\n return defineCommand({\n name: HELP_COMMAND_NAME,\n description: HELP_COMMAND_DESCRIPTION,\n execute: async (_arguments, execution) => {\n const activation = requireActivation();\n const current = activation.getState();\n const next = current.activation === 'inactive' ? await activation.activate() : activation.deactivate();\n const message = next.activation === 'inactive' ? 'Package Help deactivated.' : 'Package Help activated.';\n await execution.notify({ body: message, level: next.activation === 'degraded' ? 'warning' : 'info' });\n },\n });\n}\n\nexport { HELP_COMMAND_NAME, HELP_COMMAND_DESCRIPTION } from '../constants/help';\n"],"mappings":"8FAOA,SAAgB,EAAkB,EAA6D,CAC7F,OAAA,EAAOA,EAAAA,cAAAA,CAAc,CACnB,KAAMC,EAAAA,kBACN,YAAaC,EAAAA,yBACb,QAAS,MAAO,EAAY,IAAc,CACxC,IAAM,EAAa,EAAkB,EAE/B,EADU,EAAW,SACR,CAAC,CAAC,aAAe,WAAa,MAAM,EAAW,SAAS,EAAI,EAAW,WAAW,EAC/F,EAAU,EAAK,aAAe,WAAa,4BAA8B,0BAC/E,MAAM,EAAU,OAAO,CAAE,KAAM,EAAS,MAAO,EAAK,aAAe,WAAa,UAAY,MAAO,CAAC,CACtG,CACF,CAAC,CACH"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{HELP_COMMAND_DESCRIPTION as e,HELP_COMMAND_NAME as t}from"../constants/help.mjs";import{defineCommand as n}from"@agimon-ai/doompi-core/pi-extension";function r(r){return n({name:t,description:e,execute:async(e,t)=>{let n=r(),i=n.getState().activation===`inactive`?await n.activate():n.deactivate(),a=i.activation===`inactive`?`Package Help deactivated.`:`Package Help activated.`;await t.notify({body:a,level:i.activation===`degraded`?`warning`:`info`})}})}export{r as createHelpCommand};
|
|
2
|
-
//# sourceMappingURL=helpCommand.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpCommand.mjs","names":[],"sources":["../../src/controllers/helpCommand.ts"],"sourcesContent":["import { defineCommand, type DoomPluginCommand } from '@agimon-ai/doompi-core/pi-extension';\n\nimport { HELP_COMMAND_NAME, HELP_COMMAND_DESCRIPTION } from '../constants/help';\nimport type { HelpActivationService } from '../types/help';\n\nexport type RequireHelpActivation = () => HelpActivationService;\n\nexport function createHelpCommand(requireActivation: RequireHelpActivation): DoomPluginCommand {\n return defineCommand({\n name: HELP_COMMAND_NAME,\n description: HELP_COMMAND_DESCRIPTION,\n execute: async (_arguments, execution) => {\n const activation = requireActivation();\n const current = activation.getState();\n const next = current.activation === 'inactive' ? await activation.activate() : activation.deactivate();\n const message = next.activation === 'inactive' ? 'Package Help deactivated.' : 'Package Help activated.';\n await execution.notify({ body: message, level: next.activation === 'degraded' ? 'warning' : 'info' });\n },\n });\n}\n\nexport { HELP_COMMAND_NAME, HELP_COMMAND_DESCRIPTION } from '../constants/help';\n"],"mappings":"4JAOA,SAAgB,EAAkB,EAA6D,CAC7F,OAAO,EAAc,CACnB,KAAM,EACN,YAAa,EACb,QAAS,MAAO,EAAY,IAAc,CACxC,IAAM,EAAa,EAAkB,EAE/B,EADU,EAAW,SACR,CAAC,CAAC,aAAe,WAAa,MAAM,EAAW,SAAS,EAAI,EAAW,WAAW,EAC/F,EAAU,EAAK,aAAe,WAAa,4BAA8B,0BAC/E,MAAM,EAAU,OAAO,CAAE,KAAM,EAAS,MAAO,EAAK,aAAe,WAAa,UAAY,MAAO,CAAC,CACtG,CACF,CAAC,CACH"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
let e=require("@agimon-ai/doompi-minor-mode");const t=`@agimon-ai/doompi-help`,n=`help`,r=`help.toggle`,i={key:`h`,label:`help`,detail:`package docs and logs`,order:70},a=`activate`,o=`deactivate`;function s(e){return e.slice(0,160)}function c(e){if(e.activation===`activating`)return{activation:`activating`,condition:`queued`,detail:`loading package Help`,actions:[{id:a,enabled:!1,disabledReason:`Help activation is already running.`},{id:o,enabled:!0}]};if(e.activation===`active`||e.activation===`degraded`){let t=e.activation===`degraded`;return{activation:`active`,condition:t?`degraded`:`ready`,detail:s(`${e.skills.length} package Help skill${e.skills.length===1?``:`s`}`),...t?{color:`warning`}:{color:`accent`},actions:[{id:a,enabled:!1,disabledReason:`Help is already active.`},{id:o,enabled:!0}]}}let t=e.diagnostics[0]?.message;return{activation:`inactive`,condition:t?`failed`:`ready`,...t?{detail:s(t),color:`warning`}:{},actions:[{id:a,enabled:!0},{id:o,enabled:!1,disabledReason:`Help is not active.`}]}}function l(e){let t=e.activation!==`inactive`;return[{id:`help.toggle`,path:[i,t?{key:`e`,label:`exit`,detail:`hide package Help`}:{key:`e`,label:`enter`,detail:`load package Help`}],action:{name:r}}]}function u(e){queueMicrotask(()=>{throw e instanceof Error?e:Error(String(e))})}function d(r,i){let l=(0,e.registerMinorModeOwner)(r,{descriptor:{source:t,id:n,label:`Help`,description:`Activation-gated package guidance from exact installed package versions.`,order:50,actions:[{id:a,label:`Activate`,description:`Load package-owned Help indexes and expose their generated skills.`,contexts:[`tui`,`headless`],parameters:[]},{id:o,label:`Deactivate`,description:`Remove all active package Help skills immediately.`,contexts:[`tui`,`headless`],parameters:[]}]},initialState:c(i.getState()),async handleAction(e,t,n){if(e===a){let e=await i.activate(n.signal);return{message:s(`Activated ${e.skills.length} package Help skill${e.skills.length===1?``:`s`}${e.activation===`degraded`?` with diagnostics.`:`.`}`)}}if(e===o)return i.deactivate(),{message:`Package Help deactivated.`};throw Error(`Unknown Help mode action: ${e}`)},onError:u}),d=i.subscribe(e=>l.publish(c(e))),f=!1;return{mode:l,dispose(){f||(f=!0,d(),l.dispose())}}}function f(e,n){let i=e.registerLeader({source:t,bindings:l(n.getState())}),a=e.registerLeaderActions({source:t,handlers:{[r]:async e=>{n.getState().activation===`inactive`?await n.activate():n.deactivate(),e.hasUI&&e.ui.notify(n.getState().activation===`inactive`?`Package Help deactivated.`:`Package Help activated.`,`info`)}},onError:(e,t,n)=>{n.hasUI?n.ui.notify(e instanceof Error?e.message:String(e),`error`):u(e)}}),o=n.subscribe(e=>i.update(l(e))),s=!1;return()=>{s||(s=!0,o(),a(),i.dispose())}}exports.HELP_LEADER_ACTION=r,exports.HELP_MODE_ID=n,exports.HELP_PACKAGE_SOURCE=t,exports.helpMinorModeState=c,exports.registerHelpModeIntegration=d,exports.registerHelpUiIntegration=f;
|
|
2
|
-
//# sourceMappingURL=helpMode.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpMode.cjs","names":["registerMinorModeOwner"],"sources":["../../src/controllers/helpMode.ts"],"sourcesContent":["import type { LeaderBinding } from '@agimon-ai/doompi-core/leader';\nimport type { DoomUiHubService } from '@agimon-ai/doompi-core/ui-hub';\nimport {\n type MinorModeCatalogService,\n type MinorModeOwnerHandle,\n type MinorModeState,\n registerMinorModeOwner,\n} from '@agimon-ai/doompi-minor-mode';\nimport type { ExtensionContext } from '@earendil-works/pi-coding-agent';\n\nimport type { HelpActivationService, HelpRuntimeState } from '../types/help';\n\nexport const HELP_PACKAGE_SOURCE = '@agimon-ai/doompi-help';\nexport const HELP_MODE_ID = 'help';\nexport const HELP_MODE_ORDER = 50;\nexport const HELP_LEADER_ACTION = 'help.toggle';\n\nconst HELP_GROUP = { key: 'h', label: 'help', detail: 'package docs and logs', order: 70 } as const;\nconst MODE_ACTION_ACTIVATE = 'activate';\nconst MODE_ACTION_DEACTIVATE = 'deactivate';\nconst MAX_MODE_DETAIL_LENGTH = 160;\n\nfunction boundedDetail(value: string): string {\n return value.slice(0, MAX_MODE_DETAIL_LENGTH);\n}\n\nexport function helpMinorModeState(state: HelpRuntimeState): MinorModeState {\n if (state.activation === 'activating') {\n return {\n activation: 'activating',\n condition: 'queued',\n detail: 'loading package Help',\n actions: [\n { id: MODE_ACTION_ACTIVATE, enabled: false, disabledReason: 'Help activation is already running.' },\n { id: MODE_ACTION_DEACTIVATE, enabled: true },\n ],\n };\n }\n if (state.activation === 'active' || state.activation === 'degraded') {\n const degraded = state.activation === 'degraded';\n return {\n activation: 'active',\n condition: degraded ? 'degraded' : 'ready',\n detail: boundedDetail(`${state.skills.length} package Help skill${state.skills.length === 1 ? '' : 's'}`),\n ...(degraded ? { color: 'warning' as const } : { color: 'accent' as const }),\n actions: [\n { id: MODE_ACTION_ACTIVATE, enabled: false, disabledReason: 'Help is already active.' },\n { id: MODE_ACTION_DEACTIVATE, enabled: true },\n ],\n };\n }\n const failure = state.diagnostics[0]?.message;\n return {\n activation: 'inactive',\n condition: failure ? 'failed' : 'ready',\n ...(failure ? { detail: boundedDetail(failure), color: 'warning' as const } : {}),\n actions: [\n { id: MODE_ACTION_ACTIVATE, enabled: true },\n { id: MODE_ACTION_DEACTIVATE, enabled: false, disabledReason: 'Help is not active.' },\n ],\n };\n}\n\nfunction leaderBindings(state: HelpRuntimeState): LeaderBinding[] {\n const active = state.activation !== 'inactive';\n return [\n {\n id: 'help.toggle',\n path: [\n HELP_GROUP,\n active\n ? { key: 'e', label: 'exit', detail: 'hide package Help' }\n : { key: 'e', label: 'enter', detail: 'load package Help' },\n ],\n action: { name: HELP_LEADER_ACTION },\n },\n ];\n}\n\nfunction reportAsync(error: unknown): void {\n queueMicrotask(() => {\n throw error instanceof Error ? error : new Error(String(error));\n });\n}\n\nexport interface HelpModeIntegration {\n mode: MinorModeOwnerHandle;\n dispose(): void;\n}\n\nexport function registerHelpModeIntegration(\n catalog: MinorModeCatalogService,\n activation: HelpActivationService,\n): HelpModeIntegration {\n const mode = registerMinorModeOwner<ExtensionContext>(catalog, {\n descriptor: {\n source: HELP_PACKAGE_SOURCE,\n id: HELP_MODE_ID,\n label: 'Help',\n description: 'Activation-gated package guidance from exact installed package versions.',\n order: HELP_MODE_ORDER,\n actions: [\n {\n id: MODE_ACTION_ACTIVATE,\n label: 'Activate',\n description: 'Load package-owned Help indexes and expose their generated skills.',\n contexts: ['tui', 'headless'],\n parameters: [],\n },\n {\n id: MODE_ACTION_DEACTIVATE,\n label: 'Deactivate',\n description: 'Remove all active package Help skills immediately.',\n contexts: ['tui', 'headless'],\n parameters: [],\n },\n ],\n },\n initialState: helpMinorModeState(activation.getState()),\n async handleAction(actionId, _arguments, execution) {\n if (actionId === MODE_ACTION_ACTIVATE) {\n const state = await activation.activate(execution.signal);\n return {\n message: boundedDetail(\n `Activated ${state.skills.length} package Help skill${state.skills.length === 1 ? '' : 's'}${state.activation === 'degraded' ? ' with diagnostics.' : '.'}`,\n ),\n };\n }\n if (actionId === MODE_ACTION_DEACTIVATE) {\n activation.deactivate();\n return { message: 'Package Help deactivated.' };\n }\n throw new Error(`Unknown Help mode action: ${actionId}`);\n },\n onError: reportAsync,\n });\n const stateDisposer = activation.subscribe((state) => mode.publish(helpMinorModeState(state)));\n let disposed = false;\n return {\n mode,\n dispose() {\n if (disposed) return;\n disposed = true;\n stateDisposer();\n mode.dispose();\n },\n };\n}\n\nexport function registerHelpUiIntegration(hub: DoomUiHubService, activation: HelpActivationService): () => void {\n const leader = hub.registerLeader({\n source: HELP_PACKAGE_SOURCE,\n bindings: leaderBindings(activation.getState()),\n });\n const actionDisposer = hub.registerLeaderActions<ExtensionContext>({\n source: HELP_PACKAGE_SOURCE,\n handlers: {\n [HELP_LEADER_ACTION]: async (context) => {\n const state = activation.getState();\n if (state.activation === 'inactive') await activation.activate();\n else activation.deactivate();\n if (context.hasUI) {\n context.ui.notify(\n activation.getState().activation === 'inactive' ? 'Package Help deactivated.' : 'Package Help activated.',\n 'info',\n );\n }\n },\n },\n onError: (error, _action, context) => {\n if (context.hasUI) context.ui.notify(error instanceof Error ? error.message : String(error), 'error');\n else reportAsync(error);\n },\n });\n const stateDisposer = activation.subscribe((state) => leader.update(leaderBindings(state)));\n let disposed = false;\n return () => {\n if (disposed) return;\n disposed = true;\n stateDisposer();\n actionDisposer();\n leader.dispose();\n };\n}\n"],"mappings":"8CAYA,MAAa,EAAsB,yBACtB,EAAe,OAEf,EAAqB,cAE5B,EAAa,CAAE,IAAK,IAAK,MAAO,OAAQ,OAAQ,wBAAyB,MAAO,EAAG,EACnF,EAAuB,WACvB,EAAyB,aAG/B,SAAS,EAAc,EAAuB,CAC5C,OAAO,EAAM,MAAM,EAAG,GAAsB,CAC9C,CAEA,SAAgB,EAAmB,EAAyC,CAC1E,GAAI,EAAM,aAAe,aACvB,MAAO,CACL,WAAY,aACZ,UAAW,SACX,OAAQ,uBACR,QAAS,CACP,CAAE,GAAI,EAAsB,QAAS,GAAO,eAAgB,qCAAsC,EAClG,CAAE,GAAI,EAAwB,QAAS,EAAK,CAC9C,CACF,EAEF,GAAI,EAAM,aAAe,UAAY,EAAM,aAAe,WAAY,CACpE,IAAM,EAAW,EAAM,aAAe,WACtC,MAAO,CACL,WAAY,SACZ,UAAW,EAAW,WAAa,QACnC,OAAQ,EAAc,GAAG,EAAM,OA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ACP,IACJ,EAAW,GACX,EAAc,EACd,EAAe,EACf,EAAO,QAAQ,EACjB,CACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{registerMinorModeOwner as e}from"@agimon-ai/doompi-minor-mode";const t=`@agimon-ai/doompi-help`,n=`help`,r=`help.toggle`,i={key:`h`,label:`help`,detail:`package docs and logs`,order:70},a=`activate`,o=`deactivate`;function s(e){return e.slice(0,160)}function c(e){if(e.activation===`activating`)return{activation:`activating`,condition:`queued`,detail:`loading package Help`,actions:[{id:a,enabled:!1,disabledReason:`Help activation is already running.`},{id:o,enabled:!0}]};if(e.activation===`active`||e.activation===`degraded`){let t=e.activation===`degraded`;return{activation:`active`,condition:t?`degraded`:`ready`,detail:s(`${e.skills.length} package Help skill${e.skills.length===1?``:`s`}`),...t?{color:`warning`}:{color:`accent`},actions:[{id:a,enabled:!1,disabledReason:`Help is already active.`},{id:o,enabled:!0}]}}let t=e.diagnostics[0]?.message;return{activation:`inactive`,condition:t?`failed`:`ready`,...t?{detail:s(t),color:`warning`}:{},actions:[{id:a,enabled:!0},{id:o,enabled:!1,disabledReason:`Help is not active.`}]}}function l(e){let t=e.activation!==`inactive`;return[{id:`help.toggle`,path:[i,t?{key:`e`,label:`exit`,detail:`hide package Help`}:{key:`e`,label:`enter`,detail:`load package Help`}],action:{name:r}}]}function u(e){queueMicrotask(()=>{throw e instanceof Error?e:Error(String(e))})}function d(r,i){let l=e(r,{descriptor:{source:t,id:n,label:`Help`,description:`Activation-gated package guidance from exact installed package versions.`,order:50,actions:[{id:a,label:`Activate`,description:`Load package-owned Help indexes and expose their generated skills.`,contexts:[`tui`,`headless`],parameters:[]},{id:o,label:`Deactivate`,description:`Remove all active package Help skills immediately.`,contexts:[`tui`,`headless`],parameters:[]}]},initialState:c(i.getState()),async handleAction(e,t,n){if(e===a){let e=await i.activate(n.signal);return{message:s(`Activated ${e.skills.length} package Help skill${e.skills.length===1?``:`s`}${e.activation===`degraded`?` with diagnostics.`:`.`}`)}}if(e===o)return i.deactivate(),{message:`Package Help deactivated.`};throw Error(`Unknown Help mode action: ${e}`)},onError:u}),d=i.subscribe(e=>l.publish(c(e))),f=!1;return{mode:l,dispose(){f||(f=!0,d(),l.dispose())}}}function f(e,n){let i=e.registerLeader({source:t,bindings:l(n.getState())}),a=e.registerLeaderActions({source:t,handlers:{[r]:async e=>{n.getState().activation===`inactive`?await n.activate():n.deactivate(),e.hasUI&&e.ui.notify(n.getState().activation===`inactive`?`Package Help deactivated.`:`Package Help activated.`,`info`)}},onError:(e,t,n)=>{n.hasUI?n.ui.notify(e instanceof Error?e.message:String(e),`error`):u(e)}}),o=n.subscribe(e=>i.update(l(e))),s=!1;return()=>{s||(s=!0,o(),a(),i.dispose())}}export{r as HELP_LEADER_ACTION,n as HELP_MODE_ID,t as HELP_PACKAGE_SOURCE,c as helpMinorModeState,d as registerHelpModeIntegration,f as registerHelpUiIntegration};
|
|
2
|
-
//# sourceMappingURL=helpMode.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpMode.mjs","names":[],"sources":["../../src/controllers/helpMode.ts"],"sourcesContent":["import type { LeaderBinding } from '@agimon-ai/doompi-core/leader';\nimport type { DoomUiHubService } from '@agimon-ai/doompi-core/ui-hub';\nimport {\n type MinorModeCatalogService,\n type MinorModeOwnerHandle,\n type MinorModeState,\n registerMinorModeOwner,\n} from '@agimon-ai/doompi-minor-mode';\nimport type { ExtensionContext } from '@earendil-works/pi-coding-agent';\n\nimport type { HelpActivationService, HelpRuntimeState } from '../types/help';\n\nexport const HELP_PACKAGE_SOURCE = '@agimon-ai/doompi-help';\nexport const HELP_MODE_ID = 'help';\nexport const HELP_MODE_ORDER = 50;\nexport const HELP_LEADER_ACTION = 'help.toggle';\n\nconst HELP_GROUP = { key: 'h', label: 'help', detail: 'package docs and logs', order: 70 } as const;\nconst MODE_ACTION_ACTIVATE = 'activate';\nconst MODE_ACTION_DEACTIVATE = 'deactivate';\nconst MAX_MODE_DETAIL_LENGTH = 160;\n\nfunction boundedDetail(value: string): string {\n return value.slice(0, MAX_MODE_DETAIL_LENGTH);\n}\n\nexport function helpMinorModeState(state: HelpRuntimeState): MinorModeState {\n if (state.activation === 'activating') {\n return {\n activation: 'activating',\n condition: 'queued',\n detail: 'loading package Help',\n actions: [\n { id: MODE_ACTION_ACTIVATE, enabled: false, disabledReason: 'Help activation is already running.' },\n { id: MODE_ACTION_DEACTIVATE, enabled: true },\n ],\n };\n }\n if (state.activation === 'active' || state.activation === 'degraded') {\n const degraded = state.activation === 'degraded';\n return {\n activation: 'active',\n condition: degraded ? 'degraded' : 'ready',\n detail: boundedDetail(`${state.skills.length} package Help skill${state.skills.length === 1 ? '' : 's'}`),\n ...(degraded ? { color: 'warning' as const } : { color: 'accent' as const }),\n actions: [\n { id: MODE_ACTION_ACTIVATE, enabled: false, disabledReason: 'Help is already active.' },\n { id: MODE_ACTION_DEACTIVATE, enabled: true },\n ],\n };\n }\n const failure = state.diagnostics[0]?.message;\n return {\n activation: 'inactive',\n condition: failure ? 'failed' : 'ready',\n ...(failure ? { detail: boundedDetail(failure), color: 'warning' as const } : {}),\n actions: [\n { id: MODE_ACTION_ACTIVATE, enabled: true },\n { id: MODE_ACTION_DEACTIVATE, enabled: false, disabledReason: 'Help is not active.' },\n ],\n };\n}\n\nfunction leaderBindings(state: HelpRuntimeState): LeaderBinding[] {\n const active = state.activation !== 'inactive';\n return [\n {\n id: 'help.toggle',\n path: [\n HELP_GROUP,\n active\n ? { key: 'e', label: 'exit', detail: 'hide package Help' }\n : { key: 'e', label: 'enter', detail: 'load package Help' },\n ],\n action: { name: HELP_LEADER_ACTION },\n },\n ];\n}\n\nfunction reportAsync(error: unknown): void {\n queueMicrotask(() => {\n throw error instanceof Error ? error : new Error(String(error));\n });\n}\n\nexport interface HelpModeIntegration {\n mode: MinorModeOwnerHandle;\n dispose(): void;\n}\n\nexport function registerHelpModeIntegration(\n catalog: MinorModeCatalogService,\n activation: HelpActivationService,\n): HelpModeIntegration {\n const mode = registerMinorModeOwner<ExtensionContext>(catalog, {\n descriptor: {\n source: HELP_PACKAGE_SOURCE,\n id: HELP_MODE_ID,\n label: 'Help',\n description: 'Activation-gated package guidance from exact installed package versions.',\n order: HELP_MODE_ORDER,\n actions: [\n {\n id: MODE_ACTION_ACTIVATE,\n label: 'Activate',\n description: 'Load package-owned Help indexes and expose their generated skills.',\n contexts: ['tui', 'headless'],\n parameters: [],\n },\n {\n id: MODE_ACTION_DEACTIVATE,\n label: 'Deactivate',\n description: 'Remove all active package Help skills immediately.',\n contexts: ['tui', 'headless'],\n parameters: [],\n },\n ],\n },\n initialState: helpMinorModeState(activation.getState()),\n async handleAction(actionId, _arguments, execution) {\n if (actionId === MODE_ACTION_ACTIVATE) {\n const state = await activation.activate(execution.signal);\n return {\n message: boundedDetail(\n `Activated ${state.skills.length} package Help skill${state.skills.length === 1 ? '' : 's'}${state.activation === 'degraded' ? ' with diagnostics.' : '.'}`,\n ),\n };\n }\n if (actionId === MODE_ACTION_DEACTIVATE) {\n activation.deactivate();\n return { message: 'Package Help deactivated.' };\n }\n throw new Error(`Unknown Help mode action: ${actionId}`);\n },\n onError: reportAsync,\n });\n const stateDisposer = activation.subscribe((state) => mode.publish(helpMinorModeState(state)));\n let disposed = false;\n return {\n mode,\n dispose() {\n if (disposed) return;\n disposed = true;\n stateDisposer();\n mode.dispose();\n },\n };\n}\n\nexport function registerHelpUiIntegration(hub: DoomUiHubService, activation: HelpActivationService): () => void {\n const leader = hub.registerLeader({\n source: HELP_PACKAGE_SOURCE,\n bindings: leaderBindings(activation.getState()),\n });\n const actionDisposer = hub.registerLeaderActions<ExtensionContext>({\n source: HELP_PACKAGE_SOURCE,\n handlers: {\n [HELP_LEADER_ACTION]: async (context) => {\n const state = activation.getState();\n if (state.activation === 'inactive') await activation.activate();\n else activation.deactivate();\n if (context.hasUI) {\n context.ui.notify(\n activation.getState().activation === 'inactive' ? 'Package Help deactivated.' : 'Package Help activated.',\n 'info',\n );\n }\n },\n },\n onError: (error, _action, context) => {\n if (context.hasUI) context.ui.notify(error instanceof Error ? error.message : String(error), 'error');\n else reportAsync(error);\n },\n });\n const stateDisposer = activation.subscribe((state) => leader.update(leaderBindings(state)));\n let disposed = false;\n return () => {\n if (disposed) return;\n disposed = true;\n stateDisposer();\n actionDisposer();\n leader.dispose();\n };\n}\n"],"mappings":"sEAYA,MAAa,EAAsB,yBACtB,EAAe,OAEf,EAAqB,cAE5B,EAAa,CAAE,IAAK,IAAK,MAAO,OAAQ,OAAQ,wBAAyB,MAAO,EAAG,EACnF,EAAuB,WACvB,EAAyB,aAG/B,SAAS,EAAc,EAAuB,CAC5C,OAAO,EAAM,MAAM,EAAG,GAAsB,CAC9C,CAEA,SAAgB,EAAmB,EAAyC,CAC1E,GAAI,EAAM,aAAe,aACvB,MAAO,CACL,WAAY,aACZ,UAAW,SACX,OAAQ,uBACR,QAAS,CACP,CAAE,GAAI,EAAsB,QAAS,GAAO,eAAgB,qCAAsC,EAClG,CAAE,GAAI,EAAwB,QAAS,EAAK,CAC9C,CACF,EAEF,GAAI,EAAM,aAAe,UAAY,EAAM,aAAe,WAAY,CACpE,IAAM,EAAW,EAAM,aAAe,WACtC,MAAO,CACL,WAAY,SACZ,UAAW,EAAW,WAAa,QACnC,OAAQ,EAAc,GAAG,EAAM,OAAO,OAAO,qBAAqB,EAAM,OAAO,SAAW,EAAI,GAAK,KAAK,EACxG,GAAI,EAAW,CAAE,MAAO,SAAmB,EAAI,CAAE,MAAO,QAAkB,EAC1E,QAAS,CACP,CAAE,GAAI,EAAsB,QAAS,GAAO,eAAgB,yBAA0B,EACtF,CAAE,GAAI,EAAwB,QAAS,EAAK,CAC9C,CACF,CACF,CACA,IAAM,EAAU,EAAM,YAAY,EAAE,EAAE,QACtC,MAAO,CACL,WAAY,WACZ,UAAW,EAAU,SAAW,QAChC,GAAI,EAAU,CAAE,OAAQ,EAAc,CAAO,EAAG,MAAO,SAAmB,EAAI,CAAC,EAC/E,QAAS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,EACK,EAAgB,EAAW,UAAW,GAAU,EAAK,QAAQ,EAAmB,CAAK,CAAC,CAAC,EACzF,EAAW,GACf,MAAO,CACL,OACA,SAAU,CACJ,IACJ,EAAW,GACX,EAAc,EACd,EAAK,QAAQ,EACf,CACF,CACF,CAEA,SAAgB,EAA0B,EAAuB,EAA+C,CAC9G,IAAM,EAAS,EAAI,eAAe,CAChC,OAAQ,EACR,SAAU,EAAe,EAAW,SAAS,CAAC,CAChD,CAAC,EACK,EAAiB,EAAI,sBAAwC,CACjE,OAAQ,EACR,SAAU,EACP,GAAqB,KAAO,IAAY,CACzB,EAAW,SACjB,CAAC,CAAC,aAAe,WAAY,MAAM,EAAW,SAAS,EAC1D,EAAW,WAAW,EACvB,EAAQ,OACV,EAAQ,GAAG,OACT,EAAW,SAAS,CAAC,CAAC,aAAe,WAAa,4BAA8B,0BAChF,MACF,CAEJ,CACF,EACA,SAAU,EAAO,EAAS,IAAY,CAChC,EAAQ,MAAO,EAAQ,GAAG,OAAO,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,EAAG,OAAO,EAC/F,EAAY,CAAK,CACxB,CACF,CAAC,EACK,EAAgB,EAAW,UAAW,GAAU,EAAO,OAAO,EAAe,CAAK,CAAC,CAAC,EACtF,EAAW,GACf,UAAa,CACP,IACJ,EAAW,GACX,EAAc,EACd,EAAe,EACf,EAAO,QAAQ,EACjB,CACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("../services/helpRuntime/index.cjs"),t=require("./helpCommand.cjs"),n=require("./helpMode.cjs");let r=require("@agimon-ai/doompi-core/help"),i=require("@agimon-ai/doompi-core/cordis-host"),a=require("@agimon-ai/doompi-core/ui-hub"),o=require("@agimon-ai/doompi-minor-mode");function s(s,c){let l;return{services:[t=>{t.inject([i.DOOM_CORDIS_SESSION_SERVICE],t=>{let u=t.get(i.DOOM_CORDIS_SESSION_SERVICE),d=(0,r.createDoomHelpService)(`${u.generation}:help`),f=d.register({source:`@agimon-ai/doompi-help`,moduleUrl:c,skills:[{name:`doompi-use-help`,description:`Use Doom Pi Help to activate package guidance, load exact-version skills, and diagnose unavailable or conflicting contributions.`}]}),p=e.createHelpRuntime(d,s);l=p.activation;try{t.provide(r.DOOM_HELP_SERVICE,d),t.inject([o.DOOM_MINOR_MODE_CATALOG_SERVICE],e=>{let t=n.registerHelpModeIntegration((0,o.requireMinorModeCatalog)(e),p.activation);return()=>t.dispose()}),t.inject([a.DOOM_UI_HUB_SERVICE],e=>n.registerHelpUiIntegration((0,a.requireDoomUiHub)(e),p.activation))}catch(e){throw l===p.activation&&(l=void 0),p.dispose(),f.dispose(),d.dispose(),e}return()=>{l===p.activation&&(l=void 0),p.dispose(),f.dispose(),d.dispose()}})}],commands:[t.createHelpCommand(()=>{if(!l)throw Error(`Doom Help is waiting for the active session service.`);return l})],onStop(){l=void 0}}}exports.createHelpPiRuntime=s;
|
|
2
|
-
//# sourceMappingURL=helpPiRuntime.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpPiRuntime.cjs","names":["DOOM_CORDIS_SESSION_SERVICE","createDoomHelpService","createHelpRuntime","DOOM_HELP_SERVICE","DOOM_MINOR_MODE_CATALOG_SERVICE","registerHelpModeIntegration","requireMinorModeCatalog","DOOM_UI_HUB_SERVICE","registerHelpUiIntegration","requireDoomUiHub","createHelpCommand"],"sources":["../../src/controllers/helpPiRuntime.ts"],"sourcesContent":["import { DOOM_CORDIS_SESSION_SERVICE, type DoomCordisSessionService } from '@agimon-ai/doompi-core/cordis-host';\nimport { createDoomHelpService, DOOM_HELP_SERVICE, type DoomHelpService } from '@agimon-ai/doompi-core/help';\nimport { type PiPluginContributions } from '@agimon-ai/doompi-core/pi-extension';\nimport { DOOM_UI_HUB_SERVICE, requireDoomUiHub } from '@agimon-ai/doompi-core/ui-hub';\nimport { DOOM_MINOR_MODE_CATALOG_SERVICE, requireMinorModeCatalog } from '@agimon-ai/doompi-minor-mode';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { createHelpRuntime, type HelpRuntimeOptions } from '../services/helpRuntime';\nimport type { HelpActivationService } from '../types/help';\nimport { createHelpCommand } from './helpCommand';\nimport { registerHelpModeIntegration, registerHelpUiIntegration } from './helpMode';\n\nconst PACKAGE_SOURCE = '@agimon-ai/doompi-help';\n\n/** Install Help resources into its host-owned Cordis plugin fiber. */\nexport function createHelpPiRuntime(\n options: HelpRuntimeOptions,\n moduleUrl: string,\n): PiPluginContributions<HelpRuntimeOptions> {\n let activeActivation: HelpActivationService | undefined;\n\n return {\n services: [\n (cordis: Context) => {\n cordis.inject([DOOM_CORDIS_SESSION_SERVICE], (sessionContext) => {\n const session = sessionContext.get(DOOM_CORDIS_SESSION_SERVICE) as DoomCordisSessionService;\n const service: DoomHelpService = createDoomHelpService(`${session.generation}:help`);\n const selfContribution = service.register({\n source: PACKAGE_SOURCE,\n moduleUrl,\n skills: [\n {\n name: 'doompi-use-help',\n description:\n 'Use Doom Pi Help to activate package guidance, load exact-version skills, and diagnose unavailable or conflicting contributions.',\n },\n ],\n });\n const runtime = createHelpRuntime(service, options);\n activeActivation = runtime.activation;\n try {\n sessionContext.provide(DOOM_HELP_SERVICE, service);\n sessionContext.inject([DOOM_MINOR_MODE_CATALOG_SERVICE], (modeContext) => {\n const mode = registerHelpModeIntegration(requireMinorModeCatalog(modeContext), runtime.activation);\n return () => mode.dispose();\n });\n sessionContext.inject([DOOM_UI_HUB_SERVICE], (uiContext) =>\n registerHelpUiIntegration(requireDoomUiHub(uiContext), runtime.activation),\n );\n } catch (error) {\n if (activeActivation === runtime.activation) activeActivation = undefined;\n runtime.dispose();\n selfContribution.dispose();\n service.dispose();\n throw error;\n }\n return () => {\n if (activeActivation === runtime.activation) activeActivation = undefined;\n runtime.dispose();\n selfContribution.dispose();\n service.dispose();\n };\n });\n },\n ],\n commands: [\n createHelpCommand(() => {\n if (!activeActivation) throw new Error('Doom Help is waiting for the active session service.');\n return activeActivation;\n }),\n ],\n onStop() {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ACrB,CACF,CACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createHelpRuntime as e}from"../services/helpRuntime/index.mjs";import{createHelpCommand as t}from"./helpCommand.mjs";import{registerHelpModeIntegration as n,registerHelpUiIntegration as r}from"./helpMode.mjs";import{DOOM_HELP_SERVICE as i,createDoomHelpService as a}from"@agimon-ai/doompi-core/help";import{DOOM_CORDIS_SESSION_SERVICE as o}from"@agimon-ai/doompi-core/cordis-host";import{DOOM_UI_HUB_SERVICE as s,requireDoomUiHub as c}from"@agimon-ai/doompi-core/ui-hub";import{DOOM_MINOR_MODE_CATALOG_SERVICE as l,requireMinorModeCatalog as u}from"@agimon-ai/doompi-minor-mode";function d(d,f){let p;return{services:[t=>{t.inject([o],t=>{let m=t.get(o),h=a(`${m.generation}:help`),g=h.register({source:`@agimon-ai/doompi-help`,moduleUrl:f,skills:[{name:`doompi-use-help`,description:`Use Doom Pi Help to activate package guidance, load exact-version skills, and diagnose unavailable or conflicting contributions.`}]}),_=e(h,d);p=_.activation;try{t.provide(i,h),t.inject([l],e=>{let t=n(u(e),_.activation);return()=>t.dispose()}),t.inject([s],e=>r(c(e),_.activation))}catch(e){throw p===_.activation&&(p=void 0),_.dispose(),g.dispose(),h.dispose(),e}return()=>{p===_.activation&&(p=void 0),_.dispose(),g.dispose(),h.dispose()}})}],commands:[t(()=>{if(!p)throw Error(`Doom Help is waiting for the active session service.`);return p})],onStop(){p=void 0}}}export{d as createHelpPiRuntime};
|
|
2
|
-
//# sourceMappingURL=helpPiRuntime.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpPiRuntime.mjs","names":[],"sources":["../../src/controllers/helpPiRuntime.ts"],"sourcesContent":["import { DOOM_CORDIS_SESSION_SERVICE, type DoomCordisSessionService } from '@agimon-ai/doompi-core/cordis-host';\nimport { createDoomHelpService, DOOM_HELP_SERVICE, type DoomHelpService } from '@agimon-ai/doompi-core/help';\nimport { type PiPluginContributions } from '@agimon-ai/doompi-core/pi-extension';\nimport { DOOM_UI_HUB_SERVICE, requireDoomUiHub } from '@agimon-ai/doompi-core/ui-hub';\nimport { DOOM_MINOR_MODE_CATALOG_SERVICE, requireMinorModeCatalog } from '@agimon-ai/doompi-minor-mode';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { createHelpRuntime, type HelpRuntimeOptions } from '../services/helpRuntime';\nimport type { HelpActivationService } from '../types/help';\nimport { createHelpCommand } from './helpCommand';\nimport { registerHelpModeIntegration, registerHelpUiIntegration } from './helpMode';\n\nconst PACKAGE_SOURCE = '@agimon-ai/doompi-help';\n\n/** Install Help resources into its host-owned Cordis plugin fiber. */\nexport function createHelpPiRuntime(\n options: HelpRuntimeOptions,\n moduleUrl: string,\n): PiPluginContributions<HelpRuntimeOptions> {\n let activeActivation: HelpActivationService | undefined;\n\n return {\n services: [\n (cordis: Context) => {\n cordis.inject([DOOM_CORDIS_SESSION_SERVICE], (sessionContext) => {\n const session = sessionContext.get(DOOM_CORDIS_SESSION_SERVICE) as DoomCordisSessionService;\n const service: DoomHelpService = createDoomHelpService(`${session.generation}:help`);\n const selfContribution = service.register({\n source: PACKAGE_SOURCE,\n moduleUrl,\n skills: [\n {\n name: 'doompi-use-help',\n description:\n 'Use Doom Pi Help to activate package guidance, load exact-version skills, and diagnose unavailable or conflicting contributions.',\n },\n ],\n });\n const runtime = createHelpRuntime(service, options);\n activeActivation = runtime.activation;\n try {\n sessionContext.provide(DOOM_HELP_SERVICE, service);\n sessionContext.inject([DOOM_MINOR_MODE_CATALOG_SERVICE], (modeContext) => {\n const mode = registerHelpModeIntegration(requireMinorModeCatalog(modeContext), runtime.activation);\n return () => mode.dispose();\n });\n sessionContext.inject([DOOM_UI_HUB_SERVICE], (uiContext) =>\n registerHelpUiIntegration(requireDoomUiHub(uiContext), runtime.activation),\n );\n } catch (error) {\n if (activeActivation === runtime.activation) activeActivation = undefined;\n runtime.dispose();\n selfContribution.dispose();\n service.dispose();\n throw error;\n }\n return () => {\n if (activeActivation === runtime.activation) activeActivation = undefined;\n runtime.dispose();\n selfContribution.dispose();\n service.dispose();\n };\n });\n },\n ],\n commands: [\n createHelpCommand(() => {\n if (!activeActivation) throw new Error('Doom Help is waiting for the active session service.');\n return activeActivation;\n }),\n ],\n onStop() {\n activeActivation = undefined;\n },\n };\n}\n"],"mappings":"0kBAeA,SAAgB,EACd,EACA,EAC2C,CAC3C,IAAI,EAEJ,MAAO,CACL,SAAU,CACP,GAAoB,CACnB,EAAO,OAAO,CAAC,CAA2B,EAAI,GAAmB,CAC/D,IAAM,EAAU,EAAe,IAAI,CAA2B,EACxD,EAA2B,EAAsB,GAAG,EAAQ,WAAW,MAAM,EAC7E,EAAmB,EAAQ,SAAS,CACxC,OAAQ,yBACR,YACA,OAAQ,CACN,CACE,KAAM,kBACN,YACE,kIACJ,CACF,CACF,CAAC,EACK,EAAU,EAAkB,EAAS,CAAO,EAClD,EAAmB,EAAQ,WAC3B,GAAI,CACF,EAAe,QAAQ,EAAmB,CAAO,EACjD,EAAe,OAAO,CAAC,CAA+B,EAAI,GAAgB,CACxE,IAAM,EAAO,EAA4B,EAAwB,CAAW,EAAG,EAAQ,UAAU,EACjG,UAAa,EAAK,QAAQ,CAC5B,CAAC,EACD,EAAe,OAAO,CAAC,CAAmB,EAAI,GAC5C,EAA0B,EAAiB,CAAS,EAAG,EAAQ,UAAU,CAC3E,CACF,OAAS,EAAO,CAKd,MAJI,IAAqB,EAAQ,aAAY,EAAmB,IAAA,IAChE,EAAQ,QAAQ,EAChB,EAAiB,QAAQ,EACzB,EAAQ,QAAQ,EACV,CACR,CACA,UAAa,CACP,IAAqB,EAAQ,aAAY,EAAmB,IAAA,IAChE,EAAQ,QAAQ,EAChB,EAAiB,QAAQ,EACzB,EAAQ,QAAQ,CAClB,CACF,CAAC,CACH,CACF,EACA,SAAU,CACR,MAAwB,CACtB,GAAI,CAAC,EAAkB,MAAU,MAAM,sDAAsD,EAC7F,OAAO,CACT,CAAC,CACH,EACA,QAAS,CACP,EAAmB,IAAA,EACrB,CACF,CACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("../services/helpResources/index.cjs");let t=require("@agimon-ai/doompi-minor-mode");const n=`help`;function r(r){let i,a=()=>{let e=(r.context.selection.state?.[`minor-mode`]??[]).includes(n);return{activation:e?`active`:`inactive`,condition:`ready`,...e?{detail:`package help resources available`}:{},actions:[{id:`activate`,enabled:!e,...e?{disabledReason:`Help mode is already active.`}:{}},{id:`deactivate`,enabled:e,...e?{}:{disabledReason:`Help mode is not active.`}}]}},o=async e=>{let t=(r.context.selection.state?.[`minor-mode`]??[]).filter(e=>e!==n);await r.changeSelection({axis:`state`,key:`minor-mode`,values:e?[...t,n]:t}),i?.publish()},s=[{when:{state:{"minor-mode":n},attribution:{kind:`minor`,mode:n}},name:`doompi-help`,kind:`context`,read:()=>e.readHelpResource(`llms.txt`)},{when:{state:{"minor-mode":n},attribution:{kind:`minor`,mode:n}},name:`doompi-use-help`,kind:`skill`,read:()=>e.readHelpResource(`src/prompts/doompi-use-help/SKILL.md`)}];return i=(0,t.defineMinorMode)({descriptor:{source:`@agimon-ai/doompi-help`,id:n,label:`Help`,description:`Activation-gated package guidance from the installed Help resources.`,order:50,actions:[{id:`activate`,label:`Activate`,description:`Expose package Help resources to the session.`,contexts:[`headless`],parameters:[]},{id:`deactivate`,label:`Deactivate`,description:`Hide package Help resources from the session.`,contexts:[`headless`],parameters:[]}]},state:()=>a(),async handleAction(e,t,n,{signal:r}){if(r.throwIfAborted(),t===`activate`)return await o(!0),{message:`Help mode activated.`};if(t===`deactivate`)return await o(!1),{message:`Help mode deactivated.`};throw Error(`Unknown Help mode action: ${t}`)}}).createOwner(void 0),{services:[(0,t.serverMinorModes)([i])],resources:s,commands:[{name:`doom-help`,description:`Show DoomPi help resources available in this session.`,async execute(t,n){await n.client.notify({title:`DoomPi help`,body:await e.readHelpResource(`llms.txt`),level:`info`})}}]}}exports.createHelpServerSession=r;
|
|
2
|
-
//# sourceMappingURL=helpServerSession.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpServerSession.cjs","names":["readHelpResource","defineMinorMode","serverMinorModes"],"sources":["../../src/controllers/helpServerSession.ts"],"sourcesContent":["import { type DoomHeadlessCommand, type DoomHeadlessResource } from '@agimon-ai/doompi-core/headless';\nimport { serverMinorModes } from '@agimon-ai/doompi-minor-mode';\nimport { defineMinorMode, type MinorModeOwner, type MinorModeState } from '@agimon-ai/doompi-minor-mode';\n\nimport { readHelpResource } from '../services/helpResources';\n\nconst HELP_MODE_ID = 'help';\n\nimport { type DoomHeadlessHostService } from '@agimon-ai/doompi-core/headless';\nimport { type DoomServerSessionPlugin } from '@agimon-ai/doompi-core/server-facet';\nexport function createHelpServerSession(host: DoomHeadlessHostService): DoomServerSessionPlugin {\n let modeOwner: MinorModeOwner | undefined;\n const modeState = (): MinorModeState => {\n const active = (host.context.selection.state?.['minor-mode'] ?? []).includes(HELP_MODE_ID);\n return {\n activation: active ? 'active' : 'inactive',\n condition: 'ready',\n ...(active ? { detail: 'package help resources available' } : {}),\n actions: [\n {\n id: 'activate',\n enabled: !active,\n ...(!active ? {} : { disabledReason: 'Help mode is already active.' }),\n },\n {\n id: 'deactivate',\n enabled: active,\n ...(active ? {} : { disabledReason: 'Help mode is not active.' }),\n },\n ],\n };\n };\n const selectMode = async (enabled: boolean): Promise<void> => {\n const modes = (host.context.selection.state?.['minor-mode'] ?? []).filter((mode) => mode !== HELP_MODE_ID);\n await host.changeSelection({\n axis: 'state',\n key: 'minor-mode',\n values: enabled ? [...modes, HELP_MODE_ID] : modes,\n });\n modeOwner?.publish();\n };\n const resources: DoomHeadlessResource[] = [\n {\n when: { state: { 'minor-mode': HELP_MODE_ID }, attribution: { kind: 'minor', mode: HELP_MODE_ID } },\n name: 'doompi-help',\n kind: 'context',\n read: () => readHelpResource('llms.txt'),\n },\n {\n when: { state: { 'minor-mode': HELP_MODE_ID }, attribution: { kind: 'minor', mode: HELP_MODE_ID } },\n name: 'doompi-use-help',\n kind: 'skill',\n read: () => readHelpResource('src/prompts/doompi-use-help/SKILL.md'),\n },\n ];\n const command: DoomHeadlessCommand = {\n name: 'doom-help',\n description: 'Show DoomPi help resources available in this session.',\n async execute(_args, execution) {\n await execution.client.notify({ title: 'DoomPi help', body: await readHelpResource('llms.txt'), level: 'info' });\n },\n };\n modeOwner = defineMinorMode({\n descriptor: {\n source: '@agimon-ai/doompi-help',\n id: HELP_MODE_ID,\n label: 'Help',\n description: 'Activation-gated package guidance from the installed Help resources.',\n order: 50,\n actions: [\n {\n id: 'activate',\n label: 'Activate',\n description: 'Expose package Help resources to the session.',\n contexts: ['headless'],\n parameters: [],\n },\n {\n id: 'deactivate',\n label: 'Deactivate',\n description: 'Hide package Help resources from the session.',\n contexts: ['headless'],\n parameters: [],\n },\n ],\n },\n state: () => modeState(),\n async handleAction(_runtime, actionId, _argumentsValue, { signal }) {\n signal.throwIfAborted();\n if (actionId === 'activate') {\n await selectMode(true);\n return { message: 'Help mode activated.' };\n }\n if (actionId === 'deactivate') {\n await selectMode(false);\n return { message: 'Help mode deactivated.' };\n }\n throw new Error(`Unknown Help mode action: ${actionId}`);\n },\n }).createOwner(undefined);\n return {\n services: [serverMinorModes([modeOwner])],\n resources,\n commands: [command],\n };\n}\n"],"mappings":"qGAMA,MAAM,EAAe,OAIrB,SAAgB,EAAwB,EAAwD,CAC9F,IAAI,EACE,MAAkC,CACtC,IAAM,GAAU,EAAK,QAAQ,UAAU,QAAQ,eAAiB,CAAC,EAAA,CAAG,SAAS,CAAY,EACzF,MAAO,CACL,WAAY,EAAS,SAAW,WAChC,UAAW,QACX,GAAI,EAAS,CAAE,OAAQ,kCAAmC,EAAI,CAAC,EAC/D,QAAS,CACP,CACE,GAAI,WACJ,QAAS,CAAC,EACV,GAAK,EAAc,CAAE,eAAgB,8BAA+B,EAAtD,CAAC,CACjB,EACA,CACE,GAAI,aACJ,QAAS,EACT,GAAI,EAAS,CAAC,EA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C,CAAC,YAAY,IAAA,EAAS,EACjB,CACL,SAAU,EAAA,EAACC,EAAAA,iBAAAA,CAAiB,CAAC,CAAS,CAAC,CAAC,EACxC,YACA,SAAU,CAAC,CA/CX,KAAM,YACN,YAAa,wDACb,MAAM,QAAQ,EAAO,EAAW,CAC9B,MAAM,EAAU,OAAO,OAAO,CAAE,MAAO,cAAe,KAAM,MAAMF,EAAAA,iBAAiB,UAAU,EAAG,MAAO,MAAO,CAAC,CACjH,CA2CW,CAAO,CACpB,CACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{readHelpResource as e}from"../services/helpResources/index.mjs";import{defineMinorMode as t,serverMinorModes as n}from"@agimon-ai/doompi-minor-mode";const r=`help`;function i(i){let a,o=()=>{let e=(i.context.selection.state?.[`minor-mode`]??[]).includes(r);return{activation:e?`active`:`inactive`,condition:`ready`,...e?{detail:`package help resources available`}:{},actions:[{id:`activate`,enabled:!e,...e?{disabledReason:`Help mode is already active.`}:{}},{id:`deactivate`,enabled:e,...e?{}:{disabledReason:`Help mode is not active.`}}]}},s=async e=>{let t=(i.context.selection.state?.[`minor-mode`]??[]).filter(e=>e!==r);await i.changeSelection({axis:`state`,key:`minor-mode`,values:e?[...t,r]:t}),a?.publish()},c=[{when:{state:{"minor-mode":r},attribution:{kind:`minor`,mode:r}},name:`doompi-help`,kind:`context`,read:()=>e(`llms.txt`)},{when:{state:{"minor-mode":r},attribution:{kind:`minor`,mode:r}},name:`doompi-use-help`,kind:`skill`,read:()=>e(`src/prompts/doompi-use-help/SKILL.md`)}];return a=t({descriptor:{source:`@agimon-ai/doompi-help`,id:r,label:`Help`,description:`Activation-gated package guidance from the installed Help resources.`,order:50,actions:[{id:`activate`,label:`Activate`,description:`Expose package Help resources to the session.`,contexts:[`headless`],parameters:[]},{id:`deactivate`,label:`Deactivate`,description:`Hide package Help resources from the session.`,contexts:[`headless`],parameters:[]}]},state:()=>o(),async handleAction(e,t,n,{signal:r}){if(r.throwIfAborted(),t===`activate`)return await s(!0),{message:`Help mode activated.`};if(t===`deactivate`)return await s(!1),{message:`Help mode deactivated.`};throw Error(`Unknown Help mode action: ${t}`)}}).createOwner(void 0),{services:[n([a])],resources:c,commands:[{name:`doom-help`,description:`Show DoomPi help resources available in this session.`,async execute(t,n){await n.client.notify({title:`DoomPi help`,body:await e(`llms.txt`),level:`info`})}}]}}export{i as createHelpServerSession};
|
|
2
|
-
//# sourceMappingURL=helpServerSession.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpServerSession.mjs","names":[],"sources":["../../src/controllers/helpServerSession.ts"],"sourcesContent":["import { type DoomHeadlessCommand, type DoomHeadlessResource } from '@agimon-ai/doompi-core/headless';\nimport { serverMinorModes } from '@agimon-ai/doompi-minor-mode';\nimport { defineMinorMode, type MinorModeOwner, type MinorModeState } from '@agimon-ai/doompi-minor-mode';\n\nimport { readHelpResource } from '../services/helpResources';\n\nconst HELP_MODE_ID = 'help';\n\nimport { type DoomHeadlessHostService } from '@agimon-ai/doompi-core/headless';\nimport { type DoomServerSessionPlugin } from '@agimon-ai/doompi-core/server-facet';\nexport function createHelpServerSession(host: DoomHeadlessHostService): DoomServerSessionPlugin {\n let modeOwner: MinorModeOwner | undefined;\n const modeState = (): MinorModeState => {\n const active = (host.context.selection.state?.['minor-mode'] ?? []).includes(HELP_MODE_ID);\n return {\n activation: active ? 'active' : 'inactive',\n condition: 'ready',\n ...(active ? { detail: 'package help resources available' } : {}),\n actions: [\n {\n id: 'activate',\n enabled: !active,\n ...(!active ? {} : { disabledReason: 'Help mode is already active.' }),\n },\n {\n id: 'deactivate',\n enabled: active,\n ...(active ? {} : { disabledReason: 'Help mode is not active.' }),\n },\n ],\n };\n };\n const selectMode = async (enabled: boolean): Promise<void> => {\n const modes = (host.context.selection.state?.['minor-mode'] ?? []).filter((mode) => mode !== HELP_MODE_ID);\n await host.changeSelection({\n axis: 'state',\n key: 'minor-mode',\n values: enabled ? [...modes, HELP_MODE_ID] : modes,\n });\n modeOwner?.publish();\n };\n const resources: DoomHeadlessResource[] = [\n {\n when: { state: { 'minor-mode': HELP_MODE_ID }, attribution: { kind: 'minor', mode: HELP_MODE_ID } },\n name: 'doompi-help',\n kind: 'context',\n read: () => readHelpResource('llms.txt'),\n },\n {\n when: { state: { 'minor-mode': HELP_MODE_ID }, attribution: { kind: 'minor', mode: HELP_MODE_ID } },\n name: 'doompi-use-help',\n kind: 'skill',\n read: () => readHelpResource('src/prompts/doompi-use-help/SKILL.md'),\n },\n ];\n const command: DoomHeadlessCommand = {\n name: 'doom-help',\n description: 'Show DoomPi help resources available in this session.',\n async execute(_args, execution) {\n await execution.client.notify({ title: 'DoomPi help', body: await readHelpResource('llms.txt'), level: 'info' });\n },\n };\n modeOwner = defineMinorMode({\n descriptor: {\n source: '@agimon-ai/doompi-help',\n id: HELP_MODE_ID,\n label: 'Help',\n description: 'Activation-gated package guidance from the installed Help resources.',\n order: 50,\n actions: [\n {\n id: 'activate',\n label: 'Activate',\n description: 'Expose package Help resources to the session.',\n contexts: ['headless'],\n parameters: [],\n },\n {\n id: 'deactivate',\n label: 'Deactivate',\n description: 'Hide package Help resources from the session.',\n contexts: ['headless'],\n parameters: [],\n },\n ],\n },\n state: () => modeState(),\n async handleAction(_runtime, actionId, _argumentsValue, { signal }) {\n signal.throwIfAborted();\n if (actionId === 'activate') {\n await selectMode(true);\n return { message: 'Help mode activated.' };\n }\n if (actionId === 'deactivate') {\n await selectMode(false);\n return { message: 'Help mode deactivated.' };\n }\n throw new Error(`Unknown Help mode action: ${actionId}`);\n },\n }).createOwner(undefined);\n return {\n services: [serverMinorModes([modeOwner])],\n resources,\n commands: [command],\n };\n}\n"],"mappings":"4JAMA,MAAM,EAAe,OAIrB,SAAgB,EAAwB,EAAwD,CAC9F,IAAI,EACE,MAAkC,CACtC,IAAM,GAAU,EAAK,QAAQ,UAAU,QAAQ,eAAiB,CAAC,EAAA,CAAG,SAAS,CAAY,EACzF,MAAO,CACL,WAAY,EA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IAAa,WAEf,OADA,MAAM,EAAW,EAAI,EACd,CAAE,QAAS,sBAAuB,EAE3C,GAAI,IAAa,aAEf,OADA,MAAM,EAAW,EAAK,EACf,CAAE,QAAS,wBAAyB,EAE7C,MAAU,MAAM,6BAA6B,GAAU,CACzD,CACF,CAAC,CAAC,CAAC,YAAY,IAAA,EAAS,EACjB,CACL,SAAU,CAAC,EAAiB,CAAC,CAAS,CAAC,CAAC,EACxC,YACA,SAAU,CAAC,CA/CX,KAAM,YACN,YAAa,wDACb,MAAM,QAAQ,EAAO,EAAW,CAC9B,MAAM,EAAU,OAAO,OAAO,CAAE,MAAO,cAAe,KAAM,MAAM,EAAiB,UAAU,EAAG,MAAO,MAAO,CAAC,CACjH,CA2CW,CAAO,CACpB,CACF"}
|
package/dist/extensions/pi.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../controllers/helpPiRuntime.cjs"),t=(0,require("@agimon-ai/doompi-core/pi-extension").definePiExtension)(`@agimon-ai/doompi-help`,({options:t})=>e.createHelpPiRuntime(t??{},require("url").pathToFileURL(__filename).href));exports.default=t,exports.helpExtension=t;
|
|
2
|
-
//# sourceMappingURL=pi.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pi.cjs","names":["definePiExtension","createHelpPiRuntime"],"sources":["../../src/extensions/pi.ts"],"sourcesContent":["import { definePiExtension } from '@agimon-ai/doompi-core/pi-extension';\n\nimport { createHelpPiRuntime } from '../controllers/helpPiRuntime';\nimport type { HelpRuntimeOptions } from '../services/helpRuntime';\n\nexport const helpExtension = definePiExtension<HelpRuntimeOptions>('@agimon-ai/doompi-help', ({ options }) =>\n createHelpPiRuntime(options ?? {}, import.meta.url),\n);\nexport default helpExtension;\n"],"mappings":"mJAKa,GAAA,+CAAgBA,CAAAA,CAAAA,kBAAAA,CAAsC,0BAA2B,CAAE,aAC9FC,EAAAA,oBAAoB,GAAW,CAAC,EAAA,QAAA,KAAA,CAAA,CAAA,cAAA,UAAA,CAAA,CAAA,IAAkB,CACpD"}
|
package/dist/extensions/pi.d.cts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { HelpRuntimeOptions } from "../services/helpRuntime/index.cjs";
|
|
2
|
-
//#region src/extensions/pi.d.ts
|
|
3
|
-
export declare const helpExtension: import("@agimon-ai/doompi-core/runtime-pi-extension").DefinedPiExtension<HelpRuntimeOptions>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { helpExtension as default };
|
|
6
|
-
//# sourceMappingURL=pi.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pi.d.cts","names":[],"sources":["../../src/extensions/pi.ts"],"mappings":";;qBAKa,qEAAa,mBAAA"}
|
package/dist/extensions/pi.d.mts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { HelpRuntimeOptions } from "../services/helpRuntime/index.mjs";
|
|
2
|
-
//#region src/extensions/pi.d.ts
|
|
3
|
-
export declare const helpExtension: import("@agimon-ai/doompi-core/runtime-pi-extension").DefinedPiExtension<HelpRuntimeOptions>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { helpExtension as default };
|
|
6
|
-
//# sourceMappingURL=pi.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pi.d.mts","names":[],"sources":["../../src/extensions/pi.ts"],"mappings":";;qBAKa,qEAAa,mBAAA"}
|
package/dist/extensions/pi.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createHelpPiRuntime as e}from"../controllers/helpPiRuntime.mjs";import{definePiExtension as t}from"@agimon-ai/doompi-core/pi-extension";const n=t(`@agimon-ai/doompi-help`,({options:t})=>e(t??{},import.meta.url));export{n as default,n as helpExtension};
|
|
2
|
-
//# sourceMappingURL=pi.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pi.mjs","names":[],"sources":["../../src/extensions/pi.ts"],"sourcesContent":["import { definePiExtension } from '@agimon-ai/doompi-core/pi-extension';\n\nimport { createHelpPiRuntime } from '../controllers/helpPiRuntime';\nimport type { HelpRuntimeOptions } from '../services/helpRuntime';\n\nexport const helpExtension = definePiExtension<HelpRuntimeOptions>('@agimon-ai/doompi-help', ({ options }) =>\n createHelpPiRuntime(options ?? {}, import.meta.url),\n);\nexport default helpExtension;\n"],"mappings":"+IAKA,MAAa,EAAgB,EAAsC,0BAA2B,CAAE,aAC9F,EAAoB,GAAW,CAAC,EAAG,YAAY,GAAG,CACpD"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../controllers/helpServerSession.cjs"),t=(0,require("@agimon-ai/doompi-core/server-facet").defineServerPlugin)({name:`@agimon-ai/doompi-help`,session:({agent:t})=>t?e.createHelpServerSession(t):{}});exports.default=t,exports.helpServerFacet=t;
|
|
2
|
-
//# sourceMappingURL=server.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.cjs","names":["defineServerPlugin","createHelpServerSession"],"sources":["../../src/extensions/server.ts"],"sourcesContent":["import { defineServerPlugin } from '@agimon-ai/doompi-core/server-facet';\n\nimport { createHelpServerSession } from '../controllers/helpServerSession';\n\nexport const helpServerFacet = defineServerPlugin({\n name: '@agimon-ai/doompi-help',\n session: ({ agent }) => (agent ? createHelpServerSession(agent) : {}),\n});\nexport default helpServerFacet;\n"],"mappings":"uJAIa,GAAA,+CAAkBA,CAAAA,CAAAA,mBAAAA,CAAmB,CAChD,KAAM,yBACN,SAAU,CAAE,WAAa,EAAQC,EAAAA,wBAAwB,CAAK,EAAI,CAAC,CACrE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.cts","names":[],"sources":["../../src/extensions/server.ts"],"mappings":";qBAIa,+DAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.mts","names":[],"sources":["../../src/extensions/server.ts"],"mappings":";qBAIa,+DAAe"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createHelpServerSession as e}from"../controllers/helpServerSession.mjs";import{defineServerPlugin as t}from"@agimon-ai/doompi-core/server-facet";const n=t({name:`@agimon-ai/doompi-help`,session:({agent:t})=>t?e(t):{}});export{n as default,n as helpServerFacet};
|
|
2
|
-
//# sourceMappingURL=server.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","names":[],"sources":["../../src/extensions/server.ts"],"sourcesContent":["import { defineServerPlugin } from '@agimon-ai/doompi-core/server-facet';\n\nimport { createHelpServerSession } from '../controllers/helpServerSession';\n\nexport const helpServerFacet = defineServerPlugin({\n name: '@agimon-ai/doompi-help',\n session: ({ agent }) => (agent ? createHelpServerSession(agent) : {}),\n});\nexport default helpServerFacet;\n"],"mappings":"wJAIA,MAAa,EAAkB,EAAmB,CAChD,KAAM,yBACN,SAAU,CAAE,WAAa,EAAQ,EAAwB,CAAK,EAAI,CAAC,CACrE,CAAC"}
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./services/helpActivation/index.cjs"),t=require("./services/helpStorage/index.cjs"),n=require("./services/llmsResolver/index.cjs"),r=require("./services/helpRuntime/index.cjs");exports.DefaultHelpActivationService=e.DefaultHelpActivationService,exports.DefaultHelpIndexResolver=n.DefaultHelpIndexResolver,exports.DefaultHelpSkillMaterializer=t.DefaultHelpSkillMaterializer,exports.HelpIndexCache=t.HelpIndexCache,exports.createHelpRuntime=r.createHelpRuntime,exports.defaultHelpCacheRoot=t.defaultHelpCacheRoot;
|
package/dist/index.d.cts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { HelpActivationDependencies, HelpActivationService, HelpFetch, HelpFetchResponse, HelpIndexLocation, HelpIndexResolver, HelpPackageIdentity, HelpRuntimeState, HelpSkillMaterializer, HelpSnapshotPublisher, ResolvedHelpIndex } from "./types/help.cjs";
|
|
2
|
-
import { DefaultHelpActivationService } from "./services/helpActivation/index.cjs";
|
|
3
|
-
import { HelpRuntimeComposition, HelpRuntimeOptions, createHelpRuntime } from "./services/helpRuntime/index.cjs";
|
|
4
|
-
import { DefaultHelpSkillMaterializer, HelpIndexCache, defaultHelpCacheRoot } from "./services/helpStorage/index.cjs";
|
|
5
|
-
import { DefaultHelpIndexResolver } from "./services/llmsResolver/index.cjs";
|
|
6
|
-
export { DefaultHelpActivationService, DefaultHelpIndexResolver, DefaultHelpSkillMaterializer, type HelpActivationDependencies, type HelpActivationService, type HelpFetch, type HelpFetchResponse, HelpIndexCache, type HelpIndexLocation, type HelpIndexResolver, type HelpPackageIdentity, type HelpRuntimeComposition, type HelpRuntimeOptions, type HelpRuntimeState, type HelpSkillMaterializer, type HelpSnapshotPublisher, type ResolvedHelpIndex, createHelpRuntime, defaultHelpCacheRoot };
|
package/dist/index.d.mts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { HelpActivationDependencies, HelpActivationService, HelpFetch, HelpFetchResponse, HelpIndexLocation, HelpIndexResolver, HelpPackageIdentity, HelpRuntimeState, HelpSkillMaterializer, HelpSnapshotPublisher, ResolvedHelpIndex } from "./types/help.mjs";
|
|
2
|
-
import { DefaultHelpActivationService } from "./services/helpActivation/index.mjs";
|
|
3
|
-
import { HelpRuntimeComposition, HelpRuntimeOptions, createHelpRuntime } from "./services/helpRuntime/index.mjs";
|
|
4
|
-
import { DefaultHelpSkillMaterializer, HelpIndexCache, defaultHelpCacheRoot } from "./services/helpStorage/index.mjs";
|
|
5
|
-
import { DefaultHelpIndexResolver } from "./services/llmsResolver/index.mjs";
|
|
6
|
-
export { DefaultHelpActivationService, DefaultHelpIndexResolver, DefaultHelpSkillMaterializer, type HelpActivationDependencies, type HelpActivationService, type HelpFetch, type HelpFetchResponse, HelpIndexCache, type HelpIndexLocation, type HelpIndexResolver, type HelpPackageIdentity, type HelpRuntimeComposition, type HelpRuntimeOptions, type HelpRuntimeState, type HelpSkillMaterializer, type HelpSnapshotPublisher, type ResolvedHelpIndex, createHelpRuntime, defaultHelpCacheRoot };
|
package/dist/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DefaultHelpActivationService as e}from"./services/helpActivation/index.mjs";import{DefaultHelpSkillMaterializer as t,HelpIndexCache as n,defaultHelpCacheRoot as r}from"./services/helpStorage/index.mjs";import{DefaultHelpIndexResolver as i}from"./services/llmsResolver/index.mjs";import{createHelpRuntime as a}from"./services/helpRuntime/index.mjs";export{e as DefaultHelpActivationService,i as DefaultHelpIndexResolver,t as DefaultHelpSkillMaterializer,n as HelpIndexCache,a as createHelpRuntime,r as defaultHelpCacheRoot};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/doompi-core/api-contracts';\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,GAAA,gDAAeA,CAAAA,CAAAA,kBAAAA,CAAkB,CAAE,QAAS,EAAG,KAAM,CAAC,EAAG,QAAS,CAAC,EAAG,QAAS,CAAC,CAAE,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
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.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.d.cts","names":[],"sources":["../../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
|
|
@@ -1,53 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/doompi-core/api-contracts';\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":"yEAGA,MAAa,EAAe,EAAkB,CAAE,QAAS,EAAG,KAAM,CAAC,EAAG,QAAS,CAAC,EAAG,QAAS,CAAC,CAAE,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require("../llmsContent/index.cjs");let e=require("@agimon-ai/doompi-core/help");const t=`Help activation was cancelled.`;var n=class extends Error{constructor(e=`No package Help source could be activated.`){super(e),this.name=`HelpActivationError`}};function r(e){return{source:e.source,moduleUrl:e.moduleUrl,skills:e.skills.map(e=>({...e}))}}function i(e){return{activation:e.activation,skills:e.skills.map(e=>({...e})),diagnostics:e.diagnostics.map(e=>({...e}))}}function a(t,n,r){return{source:t,code:n,message:((r instanceof Error?r.message:String(r))||`Unknown Help activation failure.`).slice(0,e.DOOM_HELP_MAX_DIAGNOSTIC_LENGTH)}}function o(e){return JSON.stringify(e.map(e=>({source:e.source,moduleUrl:e.moduleUrl,skills:e.skills})))}var s=class{dependencies;listeners=new Set;contributions=[];fingerprint=`[]`;state={activation:`inactive`,skills:[],diagnostics:[]};settledState={activation:`inactive`,skills:[],diagnostics:[]};generation=0;controller;disposed=!1;constructor(e){this.dependencies=e}getState(){return i(this.state)}replaceContributions(e){if(this.disposed)return;let t=e.map(r).sort((e,t)=>e.source.localeCompare(t.source)),i=o(t);i!==this.fingerprint&&(this.contributions=t,this.fingerprint=i,this.state.activation!==`inactive`&&this.activate().catch(e=>{e instanceof n||this.dependencies.onBackgroundError(e)}))}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}publish(e){this.state=i(e),e.activation!==`activating`&&(this.settledState=i(e)),this.dependencies.publisher.publish(this.state);for(let e of this.listeners)e(i(this.state));return this.getState()}async loadSources(e){let r=Array.from({length:this.contributions.length}),i=0,a=async()=>{for(;i<this.contributions.length;){let a=i;i+=1;let o=this.contributions[a];if(!o)return;if(e.aborted)throw new n(t);try{let t=await this.dependencies.resolver.resolve(o,e),n=await this.dependencies.materializer.materialize(o,t,e);r[a]={source:o.source,loaded:{contribution:o,index:t,skills:n}}}catch(i){if(e.aborted)throw new n(t);r[a]={source:o.source,error:i}}}},o=Math.min(4,this.contributions.length);return await Promise.all(Array.from({length:o},()=>a())),r}async activate(r){if(this.disposed)throw new n(`Help runtime is disposed.`);this.controller?.abort(`Help activation generation replaced.`);let o=new AbortController;this.controller=o;let s=++this.generation,c=()=>o.abort(r?.reason);r?.addEventListener(`abort`,c,{once:!0}),r?.aborted&&c();let l=i(this.settledState);this.publish({activation:`activating`,skills:l.skills,diagnostics:l.diagnostics});try{let r=await this.loadSources(o.signal);if(o.signal.aborted||s!==this.generation)throw new n(t);let i=[],c=[],l=0;for(let e of r)if(e){if(e.error||!e.loaded){i.push(a(e.source,`HELP_SOURCE_FAILED`,e.error));continue}if(l+e.loaded.index.byteLength>4194304){i.push(a(e.source,`HELP_AGGREGATE_LIMIT`,`The aggregate llms.txt byte limit was exceeded.`));continue}l+=e.loaded.index.byteLength,c.push(e.loaded)}let u=[],d=new Set;for(let t of c)for(let n of t.skills){if(u.length>=e.DOOM_HELP_MAX_SKILLS){i.push(a(t.contribution.source,`HELP_SKILL_LIMIT`,`The Help skill limit was reached.`));break}if(d.has(n.name)){i.push(a(t.contribution.source,`HELP_SKILL_COLLISION`,`Help skill '${n.name}' was already provided by an earlier package source.`));continue}d.add(n.name),u.push({...n})}let f=i.slice(0,e.DOOM_HELP_MAX_DIAGNOSTICS);if(u.length===0)throw this.publish({activation:`inactive`,skills:[],diagnostics:f}),new n;return this.publish({activation:f.length>0?`degraded`:`active`,skills:u,diagnostics:f})}catch(e){throw s===this.generation&&this.state.activation===`activating`&&this.publish(l),e}finally{r?.removeEventListener(`abort`,c),this.controller===o&&(this.controller=void 0)}}deactivate(){return this.generation+=1,this.controller?.abort(`Help deactivated.`),this.controller=void 0,this.publish({activation:`inactive`,skills:[],diagnostics:[]})}dispose(){this.disposed||(this.deactivate(),this.disposed=!0,this.listeners.clear())}};exports.DefaultHelpActivationService=s,exports.HelpActivationError=n;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["DOOM_HELP_MAX_DIAGNOSTIC_LENGTH","DOOM_HELP_MAX_SKILLS","DOOM_HELP_MAX_DIAGNOSTICS"],"sources":["../../../src/services/helpActivation/index.ts"],"sourcesContent":["import {\n DOOM_HELP_MAX_DIAGNOSTIC_LENGTH,\n DOOM_HELP_MAX_DIAGNOSTICS,\n DOOM_HELP_MAX_SKILLS,\n type DoomHelpContribution,\n type DoomHelpDiagnostic,\n type DoomHelpSkill,\n} from '@agimon-ai/doompi-core/help';\n\nimport type {\n HelpActivationDependencies,\n HelpActivationService,\n HelpRuntimeState,\n ResolvedHelpIndex,\n} from '../../types/help';\nimport { MAX_AGGREGATE_LLMS_BYTES } from '../llmsContent';\n\nconst MAX_RESOLUTION_CONCURRENCY = 4;\nconst FAILURE_MESSAGE = 'No package Help source could be activated.';\nconst CANCELLATION_MESSAGE = 'Help activation was cancelled.';\n\ninterface LoadedSource {\n contribution: DoomHelpContribution;\n index: ResolvedHelpIndex;\n skills: readonly DoomHelpSkill[];\n}\n\ninterface SourceOutcome {\n source: string;\n loaded?: LoadedSource;\n error?: unknown;\n}\n\nexport class HelpActivationError extends Error {\n constructor(message = FAILURE_MESSAGE) {\n super(message);\n this.name = 'HelpActivationError';\n }\n}\n\nfunction cloneContribution(contribution: DoomHelpContribution): DoomHelpContribution {\n return {\n source: contribution.source,\n moduleUrl: contribution.moduleUrl,\n skills: contribution.skills.map((skill) => ({ ...skill })),\n };\n}\n\nfunction cloneState(state: HelpRuntimeState): HelpRuntimeState {\n return {\n activation: state.activation,\n skills: state.skills.map((skill) => ({ ...skill })),\n diagnostics: state.diagnostics.map((diagnostic) => ({ ...diagnostic })),\n };\n}\n\nfunction diagnostic(source: string, code: string, error: unknown): DoomHelpDiagnostic {\n const raw = error instanceof Error ? error.message : String(error);\n const message = (raw || 'Unknown Help activation failure.').slice(0, DOOM_HELP_MAX_DIAGNOSTIC_LENGTH);\n return { source, code, message };\n}\n\nfunction contributionFingerprint(contributions: readonly DoomHelpContribution[]): string {\n return JSON.stringify(\n contributions.map((contribution) => ({\n source: contribution.source,\n moduleUrl: contribution.moduleUrl,\n skills: contribution.skills,\n })),\n );\n}\n\nexport class DefaultHelpActivationService implements HelpActivationService {\n private readonly dependencies: HelpActivationDependencies;\n private readonly listeners = new Set<(state: HelpRuntimeState) => void>();\n private contributions: DoomHelpContribution[] = [];\n private fingerprint = '[]';\n private state: HelpRuntimeState = { activation: 'inactive', skills: [], diagnostics: [] };\n private settledState: HelpRuntimeState = { activation: 'inactive', skills: [], diagnostics: [] };\n private generation = 0;\n private controller: AbortController | undefined;\n private disposed = false;\n\n constructor(dependencies: HelpActivationDependencies) {\n this.dependencies = dependencies;\n }\n\n getState(): HelpRuntimeState {\n return cloneState(this.state);\n }\n\n replaceContributions(contributions: readonly DoomHelpContribution[]): void {\n if (this.disposed) return;\n const next = contributions.map(cloneContribution).sort((left, right) => left.source.localeCompare(right.source));\n const fingerprint = contributionFingerprint(next);\n if (fingerprint === this.fingerprint) return;\n this.contributions = next;\n this.fingerprint = fingerprint;\n if (this.state.activation !== 'inactive') {\n void this.activate().catch((error: unknown) => {\n // Activation failures publish a bounded settled state before rejecting.\n // Only unexpected implementation failures need an out-of-band report.\n if (error instanceof HelpActivationError) return;\n this.dependencies.onBackgroundError(error);\n });\n }\n }\n\n subscribe(listener: (state: HelpRuntimeState) => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n private publish(state: HelpRuntimeState): HelpRuntimeState {\n this.state = cloneState(state);\n if (state.activation !== 'activating') this.settledState = cloneState(state);\n this.dependencies.publisher.publish(this.state);\n for (const listener of this.listeners) listener(cloneState(this.state));\n return this.getState();\n }\n\n private async loadSources(signal: AbortSignal): Promise<SourceOutcome[]> {\n const outcomes: SourceOutcome[] = Array.from({ length: this.contributions.length });\n let cursor = 0;\n const worker = async (): Promise<void> => {\n while (cursor < this.contributions.length) {\n const index = cursor;\n cursor += 1;\n const contribution = this.contributions[index];\n if (!contribution) return;\n if (signal.aborted) throw new HelpActivationError(CANCELLATION_MESSAGE);\n try {\n const resolved = await this.dependencies.resolver.resolve(contribution, signal);\n const skills = await this.dependencies.materializer.materialize(contribution, resolved, signal);\n outcomes[index] = { source: contribution.source, loaded: { contribution, index: resolved, skills } };\n } catch (error) {\n if (signal.aborted) throw new HelpActivationError(CANCELLATION_MESSAGE);\n outcomes[index] = { source: contribution.source, error };\n }\n }\n };\n const count = Math.min(MAX_RESOLUTION_CONCURRENCY, this.contributions.length);\n await Promise.all(Array.from({ length: count }, () => worker()));\n return outcomes;\n }\n\n async activate(externalSignal?: AbortSignal): Promise<HelpRuntimeState> {\n if (this.disposed) throw new HelpActivationError('Help runtime is disposed.');\n this.controller?.abort('Help activation generation replaced.');\n const controller = new AbortController();\n this.controller = controller;\n const generation = ++this.generation;\n const abortFromExternal = () => controller.abort(externalSignal?.reason);\n externalSignal?.addEventListener('abort', abortFromExternal, { once: true });\n if (externalSignal?.aborted) abortFromExternal();\n\n const settledState = cloneState(this.settledState);\n this.publish({ activation: 'activating', skills: settledState.skills, diagnostics: settledState.diagnostics });\n try {\n const outcomes = await this.loadSources(controller.signal);\n if (controller.signal.aborted || generation !== this.generation) {\n throw new HelpActivationError(CANCELLATION_MESSAGE);\n }\n\n const diagnostics: DoomHelpDiagnostic[] = [];\n const loaded: LoadedSource[] = [];\n let aggregateBytes = 0;\n for (const outcome of outcomes) {\n if (!outcome) continue;\n if (outcome.error || !outcome.loaded) {\n diagnostics.push(diagnostic(outcome.source, 'HELP_SOURCE_FAILED', outcome.error));\n continue;\n }\n if (aggregateBytes + outcome.loaded.index.byteLength > MAX_AGGREGATE_LLMS_BYTES) {\n diagnostics.push(\n diagnostic(outcome.source, 'HELP_AGGREGATE_LIMIT', 'The aggregate llms.txt byte limit was exceeded.'),\n );\n continue;\n }\n aggregateBytes += outcome.loaded.index.byteLength;\n loaded.push(outcome.loaded);\n }\n\n const skills: DoomHelpSkill[] = [];\n const names = new Set<string>();\n for (const source of loaded) {\n for (const skill of source.skills) {\n if (skills.length >= DOOM_HELP_MAX_SKILLS) {\n diagnostics.push(\n diagnostic(source.contribution.source, 'HELP_SKILL_LIMIT', 'The Help skill limit was reached.'),\n );\n break;\n }\n if (names.has(skill.name)) {\n diagnostics.push(\n diagnostic(\n source.contribution.source,\n 'HELP_SKILL_COLLISION',\n `Help skill '${skill.name}' was already provided by an earlier package source.`,\n ),\n );\n continue;\n }\n names.add(skill.name);\n skills.push({ ...skill });\n }\n }\n\n const boundedDiagnostics = diagnostics.slice(0, DOOM_HELP_MAX_DIAGNOSTICS);\n if (skills.length === 0) {\n this.publish({ activation: 'inactive', skills: [], diagnostics: boundedDiagnostics });\n throw new HelpActivationError();\n }\n return this.publish({\n activation: boundedDiagnostics.length > 0 ? 'degraded' : 'active',\n skills,\n diagnostics: boundedDiagnostics,\n });\n } catch (error) {\n if (generation === this.generation && this.state.activation === 'activating') this.publish(settledState);\n throw error;\n } finally {\n externalSignal?.removeEventListener('abort', abortFromExternal);\n if (this.controller === controller) this.controller = undefined;\n }\n }\n\n deactivate(): HelpRuntimeState {\n this.generation += 1;\n this.controller?.abort('Help deactivated.');\n this.controller = undefined;\n return this.publish({ activation: 'inactive', skills: [], diagnostics: [] });\n }\n\n dispose(): void {\n if (this.disposed) return;\n this.deactivate();\n this.disposed = true;\n this.listeners.clear();\n }\n}\n"],"mappings":"iFAiBA,MAEM,EAAuB,iCAc7B,IAAa,EAAb,cAAyC,KAAM,CAC7C,YAAY,EAAU,6CAAiB,CACrC,MAAM,CAAO,EACb,KAAK,KAAO,qBACd,CACF,EAEA,SAAS,EAAkB,EAA0D,CACnF,MAAO,CACL,OAAQ,EAAa,OACrB,UAAW,EAAa,UACxB,OAAQ,EAAa,OAAO,IAAK,IAAW,CAAE,GAAG,CAAM,EAAE,CAC3D,CACF,CAEA,SAAS,EAAW,EAA2C,CAC7D,MAAO,CACL,WAAY,EAAM,WAClB,OAAQ,EAAM,OAAO,IAAK,IAAW,CAAE,GAAG,CAAM,EAAE,EAClD,YAAa,EAAM,YAAY,IAAK,IAAgB,CAAE,GAAG,CAAW,EAAE,CACxE,CACF,CAEA,SAAS,EAAW,EAAgB,EAAc,EAAoC,CAGpF,MAAO,CAAE,SAAQ,OAAM,UAFX,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,IACzC,mCAAA,CAAoC,MAAM,EAAGA,EAAAA,+BACxC,CAAE,CACjC,CAEA,SAAS,EAAwB,EAAwD,CACvF,OAAO,KAAK,UACV,EAAc,IAAK,IAAkB,CACnC,OAAQ,EAAa,OACrB,UAAW,EAAa,UACxB,OAAQ,EAAa,MACvB,EAAE,CACJ,CACF,CAEA,IAAa,EAAb,KAA2E,CACzE,aACA,UAA6B,IAAI,IACjC,cAAgD,CAAC,EACjD,YAAsB,KACtB,MAAkC,CAAE,WAAY,WAAY,OAAQ,CAAC,EAAG,YAAa,CAAC,CAAE,EACxF,aAAyC,CAAE,WAAY,WAAY,OAAQ,CAAC,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