@agimon-ai/po-hook 0.0.0-alpha.0

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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +177 -0
  3. package/dist/apiContracts.cjs +17 -0
  4. package/dist/apiContracts.cjs.map +1 -0
  5. package/dist/apiContracts.d.mts +53 -0
  6. package/dist/apiContracts.d.mts.map +1 -0
  7. package/dist/apiContracts.mjs +13 -0
  8. package/dist/apiContracts.mjs.map +1 -0
  9. package/dist/authoring.cjs +10 -0
  10. package/dist/authoring.cjs.map +1 -0
  11. package/dist/authoring.d.mts +7 -0
  12. package/dist/authoring.d.mts.map +1 -0
  13. package/dist/authoring.mjs +9 -0
  14. package/dist/authoring.mjs.map +1 -0
  15. package/dist/extensions/mcp.cjs +26 -0
  16. package/dist/extensions/mcp.cjs.map +1 -0
  17. package/dist/extensions/mcp.d.mts +5 -0
  18. package/dist/extensions/mcp.d.mts.map +1 -0
  19. package/dist/extensions/mcp.mjs +21 -0
  20. package/dist/extensions/mcp.mjs.map +1 -0
  21. package/dist/extensions/server.cjs +611 -0
  22. package/dist/extensions/server.cjs.map +1 -0
  23. package/dist/extensions/server.d.mts +5 -0
  24. package/dist/extensions/server.d.mts.map +1 -0
  25. package/dist/extensions/server.mjs +606 -0
  26. package/dist/extensions/server.mjs.map +1 -0
  27. package/dist/hookModule-f-HwSbmi.d.mts +54 -0
  28. package/dist/hookModule-f-HwSbmi.d.mts.map +1 -0
  29. package/dist/hookModules-DSheklXp.cjs +899 -0
  30. package/dist/hookModules-DSheklXp.cjs.map +1 -0
  31. package/dist/hookModules-GoRDG8mg.mjs +749 -0
  32. package/dist/hookModules-GoRDG8mg.mjs.map +1 -0
  33. package/dist/index.cjs +23 -0
  34. package/dist/index.d.mts +362 -0
  35. package/dist/index.d.mts.map +1 -0
  36. package/dist/index.mjs +2 -0
  37. package/llms.txt +11 -0
  38. package/package.json +122 -0
  39. package/src/prompts/po-author-hook/SKILL.md +128 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vuong Ngo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,177 @@
1
+ # @agimon-ai/po-hook
2
+
3
+ Repository, personal, and Claude Code-compatible plugin hooks for
4
+ [Po](https://www.npmjs.com/package/@agimon-ai/po) sessions. Registry rows can run shell commands or compiled TypeScript/JavaScript modules.
5
+
6
+ > **Alpha:** hook configuration and runtime contracts may change between releases.
7
+
8
+ ## Requirements
9
+
10
+ - Node.js 24 or newer
11
+ - `/bin/bash` for command hooks
12
+
13
+ ## Registry and activation
14
+
15
+ ```yaml
16
+ # .po/hooks.yaml
17
+ groups:
18
+ safety:
19
+ core: true
20
+ hooks:
21
+ - event: PreToolUse
22
+ pi:
23
+ matcher: Bash
24
+ module: .po/hooks/guard.ts
25
+ timeout: 10
26
+ order: 0
27
+ workflow:
28
+ hooks:
29
+ - event: Stop
30
+ pi:
31
+ command: .po/hooks/close-workflow-step.sh
32
+ skipInSubagent: true
33
+ ```
34
+
35
+ Each `pi` binding declares exactly one of `command` or `module`. Module paths resolve relative to the declaring repository root or personal `~/.po` root, not the directory containing `hooks.yaml`. Personal configuration is `~/.po/hooks.yaml`; repository configuration is `<repo>/.po/hooks.yaml`. A repository group replaces the personal group of the same ID completely.
36
+
37
+ The distribution activates this package by default through the `default.packages` list written by `po init` or `dpi init`. Keep it there, or declare it in a selected layer. Layers only declare the `hookGroups` to select; they do not define hook implementations:
38
+
39
+ ```yaml
40
+ # .po/modes.yaml
41
+ layers:
42
+ repository-hooks:
43
+ hookGroups: [safety, workflow]
44
+ ```
45
+
46
+ `core: true` always loads. Unset `hookGroups` means all groups; explicit `hookGroups: []` means core groups only. An explicit nonempty list selects those groups plus core. Lower `order` values run first, with declaration order breaking ties. Registry commands and modules interleave in that order, followed by plugin commands. An explicit denial ends the chain.
47
+
48
+ `matcher` is a regular expression over Claude tool names such as `Bash` and `Write`. Modules receive native Pi events and tool names such as `bash`, not translated command payloads. `skipInSubagent: true` excludes a registry row from child tool dispatch. Use it for parent-owned work; it does not enable child lifecycle dispatch.
49
+
50
+ ## Compiled module authoring
51
+
52
+ Use the dependency-free public authoring subpath, not the extension/runtime entry:
53
+
54
+ ```ts
55
+ import { defineDoomHook } from '@agimon-ai/po-hook/authoring';
56
+
57
+ export default defineDoomHook({
58
+ setup(ctx) {
59
+ let calls = 0;
60
+ return {
61
+ tool_call(event, ctx) {
62
+ calls += 1;
63
+ if (event.toolName === 'bash' && String(event.input.command).includes('rm -rf')) {
64
+ return { block: true, reason: 'Use a non-destructive command.' };
65
+ }
66
+ },
67
+ async dispose() {
68
+ // Release resources owned by this session's setup.
69
+ },
70
+ };
71
+ },
72
+ });
73
+ ```
74
+
75
+ `defineDoomHook` checks the contract while preserving inference. The default export must have `setup(ctx)`, returning handlers synchronously or asynchronously. Only handlers selected by registry rows run:
76
+
77
+ | Registry event | Native module handler | Result |
78
+ | -------------- | --------------------------- | ------------------------------------------------ |
79
+ | `SessionStart` | `session_start(event, ctx)` | `void` |
80
+ | `PreToolUse` | `tool_call(event, ctx)` | `void` or `{ block?: boolean, reason?: string }` |
81
+ | `PostToolUse` | `tool_result(event, ctx)` | `void` or `{ content?, details?, isError? }` |
82
+ | `Stop` | `agent_settled(event, ctx)` | `void`, cannot send messages |
83
+
84
+ Optional `dispose()` returns void or a promise. There is no module `SessionEnd` handler. Tool-call handlers may mutate `event.input`, which must remain a JSON object. Accepted mutations flow to later rows and the tool. Tool-result patches accept text/image content, JSON-compatible details, and a boolean error flag. Failed, invalid, or late invocations cannot publish input mutations or result patches. Lifecycle handlers cannot return decisions.
85
+
86
+ ### Full HookContext contract
87
+
88
+ The authoring subpath exports `HookContext`, `HookHandlers`, `HookModule`, `HookModuleDescriptor`, `AgentSettledEvent`, `Awaitable`, and `JsonValue` types.
89
+
90
+ ```ts
91
+ interface HookContext {
92
+ readonly sessionId: string;
93
+ readonly parentSessionId?: string;
94
+ readonly agent?: string;
95
+ readonly isSubagent: boolean;
96
+ readonly cwd: string;
97
+ readonly repoRoot: string;
98
+ readonly model?: { readonly provider: string; readonly id: string };
99
+ readonly signal: AbortSignal;
100
+ sendMessage(text: string, delivery: 'steer' | 'followUp'): Promise<void>;
101
+ appendCustomEntry(type: string, data: JsonValue): Promise<void>;
102
+ }
103
+ ```
104
+
105
+ `cwd` is the session working directory; `repoRoot` is its resolved repository root. Optional identity/model fields may be absent, including model in native children. Await context effects. Message delivery uses host prompt admission; admission failures propagate, they are not converted to advisory hook failures. `appendCustomEntry` records JSON-compatible data in session history.
106
+
107
+ Setup and row calls for the same module and session are serialized. A module referenced by multiple rows shares one setup instance in that session. Keep mutable state inside `setup`, not at module scope: imported modules may be shared across sessions, while setup closures are session-local. In-memory state is not durable across reloads. Explicitly record history entries when durability is needed.
108
+
109
+ Setup receives a lifetime context; handlers receive an invocation context whose signal also reflects cancellation. Invocation effects are revoked after completion. Setup failure, setup/handler timeout, or cancellation quarantines the instance and revokes its context effects. Cooperate with `signal`; revocation cannot stop arbitrary JavaScript or undo already completed external effects.
110
+
111
+ ## Command payloads and decisions
112
+
113
+ Commands run through `/bin/bash -c` in the repository root with a Claude-compatible JSON payload on stdin. The environment includes `CLAUDE_PROJECT_DIR`, `CODEX_REPO_ROOT`, `ORIGINAL_REPO_PATH`, and `CLAUDE_PLUGIN_ROOT`. The last field names the root declaring the repository, personal, or plugin configuration. Native child tool payloads use the child's own `session_id` and include `parent_session_id` and `agent_type`.
114
+
115
+ The last stdout line beginning with `{` is parsed as the decision. Denial is `decision: "block"` or `hookSpecificOutput.permissionDecision: "deny"`; the reason is top-level `reason` or `hookSpecificOutput.reason`. Context is `hookSpecificOutput.additionalContext`.
116
+
117
+ | Event | Command decision behavior |
118
+ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
119
+ | `SessionStart` | Adds additional context to the conversation |
120
+ | `PreToolUse` | Denial blocks the call. Additional context also blocks the current call with that text as its reason, allowing the agent to reconsider; it does not silently steer an executing tool |
121
+ | `PostToolUse` | Appends additional context or reason to the result; denial marks it as an error |
122
+ | `Stop` | Denial with a reason requests a follow-up turn, capped at five consecutive refusals |
123
+ | `SessionEnd` | Plugin commands only, run for side effects |
124
+
125
+ Stop payloads include `stop_hook_active` when a prior refusal is active. After five consecutive refusals, a further refusal is reported without another follow-up turn. A stop without a refusal reason resets the count. This continuation contract belongs to commands, not module `agent_settled` handlers.
126
+
127
+ ## Event ownership and children
128
+
129
+ Native server facets own lifecycle rows (`SessionStart`, `Stop`, and plugin-only `SessionEnd`) and tool dispatch with shared session-local module setup. Session-start readiness precedes dependent turns/tools. Session-end runs once during shutdown before service disposal.
130
+
131
+ Native children run only `PreToolUse` and `PostToolUse`. Registry and plugin tool hooks run, excluding registry rows marked `skipInSubagent`. Children do not run `SessionStart`, `Stop`, or `SessionEnd`. Each child has its own module setup/state and pins its launch selection and module generation, even after the parent reloads or disposes.
132
+
133
+ ## Sync, reload, and failure handling
134
+
135
+ After changing a module or its imports, registry, or mode selection:
136
+
137
+ 1. Run `po sync` (or `dpi sync`). Sync compiles core modules plus the union of mode-selected groups; if any mode leaves selection unset, it compiles all groups.
138
+ 2. Run `po sync --check` to check drift.
139
+ 3. Reopen headless sessions to adopt the published generation, then exercise the intended events.
140
+
141
+ Module imports use compiled artifacts from a synchronized descriptor, never a live source fallback. The runtime pins the descriptor at binding creation, including cold lazy imports after configuration replacement. A compilation failure preserves the previous published generation. Sync alone does not replace modules in a running session.
142
+
143
+ `timeout` is a positive finite number of seconds, defaulting to 10. For modules, the invocation budget includes first import/setup and the handler. Module execution/setup errors, invalid results, and timeouts are advisory, reported as missed checks rather than automatically denying tools. Host readiness, cancellation, and context effect/admission failures are not advisory execution failures. A quarantined module does not resume checking later rows in that session.
144
+
145
+ Command nonzero exits, spawn failures, invalid JSON, and timeouts are likewise advisory. Timed-out command process groups receive `SIGTERM`, then `SIGKILL` two seconds later.
146
+
147
+ ## Trust and isolation limits
148
+
149
+ Hooks are executable trusted code. Compilation and generation pinning provide artifact consistency, not a sandbox or authorization boundary. Modules execute in the host Node.js process with its filesystem, network, and process privileges; commands inherit host privileges too. A synchronous infinite loop, `process.exit`, or out-of-memory failure cannot be contained in-process. Prefer `command:` when process isolation and hard termination matter. Session-local setup and serialized calls do not isolate module globals or external side effects. Context revocation only gates the exposed context effects. Do not load untrusted hooks or treat advisory checks as guaranteed enforcement.
150
+
151
+ ## Verification scope
152
+
153
+ ## Help, install, and public API
154
+
155
+ Help minor mode contributes `po-author-hook` while this package and its Help provider are active.
156
+
157
+ ```ts
158
+ import { createBashHookRunner } from '@agimon-ai/po-hook';
159
+ import type { HookDecision, HookEventName } from '@agimon-ai/po-hook';
160
+ ```
161
+
162
+ ## Development
163
+
164
+ ```bash
165
+ pnpm build
166
+ pnpm typecheck
167
+ pnpm test
168
+ pnpm lint
169
+ ```
170
+
171
+ Routed roots and named handlers live under `src/extensions/workspaces/sessions/(backend)/`. `services/hookRuntime/` owns readiness and session lifetimes. The package build generates server entries; `src/exports/` publishes reusable capabilities.
172
+
173
+ Maintained by [Agimon](https://agimon.ai/about).
174
+
175
+ ## License
176
+
177
+ MIT
@@ -0,0 +1,17 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ //#region src/schemas/apiContracts.ts
6
+ /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
7
+ const apiContracts = (0, require("@agimon-ai/po-core/apiContracts").defineApiContract)({
8
+ version: 1,
9
+ http: [],
10
+ sockets: [],
11
+ dynamic: []
12
+ });
13
+ //#endregion
14
+ exports.apiContracts = apiContracts;
15
+ exports.default = apiContracts;
16
+
17
+ //# sourceMappingURL=apiContracts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,4CAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
@@ -0,0 +1,53 @@
1
+ //#region src/schemas/apiContracts.d.ts
2
+ /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
3
+ export declare const apiContracts: {
4
+ version: 1;
5
+ protocols?: Record<string, string> | undefined;
6
+ schemas?: Record<string, boolean | object> | undefined;
7
+ http: {
8
+ id: string;
9
+ scope: "global" | "session" | "workspace";
10
+ basePath?: string | undefined;
11
+ path: string;
12
+ method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
13
+ description: string;
14
+ availability?: string | undefined;
15
+ authentication: "device" | "none" | "owner";
16
+ parameters?: {
17
+ name: string;
18
+ in: "header" | "path" | "query";
19
+ required: boolean;
20
+ schema: boolean | object;
21
+ }[] | undefined;
22
+ body?: {
23
+ contentType: string;
24
+ contentTypes?: string[] | undefined;
25
+ required: boolean;
26
+ schema: boolean | object;
27
+ } | undefined;
28
+ responses: Record<string, {
29
+ description: string;
30
+ contentType?: string | undefined;
31
+ schema?: boolean | object | undefined;
32
+ events?: Record<string, boolean | object> | undefined;
33
+ }>;
34
+ }[];
35
+ sockets: {
36
+ id: string;
37
+ scope: "global" | "session" | "workspace";
38
+ description: string;
39
+ availability?: string | undefined;
40
+ service: string;
41
+ member: string;
42
+ direction: "client-to-server" | "server-to-client";
43
+ kind: "channel" | "method" | "state";
44
+ input: boolean | object;
45
+ output?: boolean | object | undefined;
46
+ errors?: boolean | object | undefined;
47
+ }[];
48
+ dynamic: string[];
49
+ gaps?: string[] | undefined;
50
+ };
51
+ //#endregion
52
+ export { apiContracts as default };
53
+ //# sourceMappingURL=apiContracts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
@@ -0,0 +1,13 @@
1
+ import { defineApiContract } from "@agimon-ai/po-core/apiContracts";
2
+ //#region src/schemas/apiContracts.ts
3
+ /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
4
+ const apiContracts = defineApiContract({
5
+ version: 1,
6
+ http: [],
7
+ sockets: [],
8
+ dynamic: []
9
+ });
10
+ //#endregion
11
+ export { apiContracts, apiContracts as default };
12
+
13
+ //# sourceMappingURL=apiContracts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/services/hookAuthoring/index.ts
3
+ /** Preserve the author's inferred module type while checking the hook contract. */
4
+ function defineDoomHook(module) {
5
+ return module;
6
+ }
7
+ //#endregion
8
+ exports.defineDoomHook = defineDoomHook;
9
+
10
+ //# sourceMappingURL=authoring.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring.cjs","names":[],"sources":["../src/services/hookAuthoring/index.ts"],"sourcesContent":["import type { HookModule } from '../../types/hookModule';\n\n/** Preserve the author's inferred module type while checking the hook contract. */\nexport function defineDoomHook<T extends HookModule>(module: T): T {\n return module;\n}\n"],"mappings":";;;AAGA,SAAgB,eAAqC,QAAc;CACjE,OAAO;AACT"}
@@ -0,0 +1,7 @@
1
+ import { a as HookModule, i as HookHandlers, l as JsonValue, n as Awaitable, o as HookModuleDescriptor, r as HookContext, t as AgentSettledEvent } from "./hookModule-f-HwSbmi.mjs";
2
+ //#region src/services/hookAuthoring/index.d.ts
3
+ /** Preserve the author's inferred module type while checking the hook contract. */
4
+ export declare function defineDoomHook<T extends HookModule>(module: T): T;
5
+ //#endregion
6
+ export type { AgentSettledEvent, Awaitable, HookContext, HookHandlers, HookModule, HookModuleDescriptor, JsonValue };
7
+ //# sourceMappingURL=authoring.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring.d.mts","names":[],"sources":["../src/services/hookAuthoring/index.ts"],"mappings":";;;wBAGgB,eAAe,UAAU,YAAY,QAAQ,IAAI"}
@@ -0,0 +1,9 @@
1
+ //#region src/services/hookAuthoring/index.ts
2
+ /** Preserve the author's inferred module type while checking the hook contract. */
3
+ function defineDoomHook(module) {
4
+ return module;
5
+ }
6
+ //#endregion
7
+ export { defineDoomHook };
8
+
9
+ //# sourceMappingURL=authoring.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring.mjs","names":[],"sources":["../src/services/hookAuthoring/index.ts"],"sourcesContent":["import type { HookModule } from '../../types/hookModule';\n\n/** Preserve the author's inferred module type while checking the hook contract. */\nexport function defineDoomHook<T extends HookModule>(module: T): T {\n return module;\n}\n"],"mappings":";;AAGA,SAAgB,eAAqC,QAAc;CACjE,OAAO;AACT"}
@@ -0,0 +1,26 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ let _agimon_ai_po_core_mcpFacet = require("@agimon-ai/po-core/mcpFacet");
6
+ let _agimon_ai_po_core_serverFacet = require("@agimon-ai/po-core/serverFacet");
7
+ //#region src/extensions/workspaces/sessions/(backend)/skill/po-author-hook.mcp.ts
8
+ var po_author_hook_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpSkill)({
9
+ name: "po-author-hook",
10
+ description: "Author Po repository or plugin hooks. Use when creating or changing .po/hooks.yaml, selecting hook groups from modes.yaml, writing hook commands, or adapting Claude Code hook payloads and decisions to Po.",
11
+ read: () => (0, _agimon_ai_po_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-author-hook/SKILL.md")
12
+ });
13
+ //#endregion
14
+ //#region generated/mcp.ts
15
+ const at = (value, context) => typeof value === "function" ? value(context) : value;
16
+ const mcp = (0, _agimon_ai_po_core_mcpFacet.defineMcpPlugin)({
17
+ name: "@agimon-ai/po-hook",
18
+ session: (context) => ({ get skills() {
19
+ return [at(po_author_hook_mcp_default, context)];
20
+ } })
21
+ });
22
+ //#endregion
23
+ exports.default = mcp;
24
+ exports.mcp = mcp;
25
+
26
+ //# sourceMappingURL=mcp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.cjs","names":["defineMcpSkill","readPackageResource","defineMcpPlugin","skillPoAuthorHook"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-author-hook.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-author-hook',\n description:\n 'Author Po repository or plugin hooks. Use when creating or changing .po/hooks.yaml, selecting hook groups from modes.yaml, writing hook commands, or adapting Claude Code hook payloads and decisions to Po.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-author-hook/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoAuthorHook from '../src/extensions/workspaces/sessions/(backend)/skill/po-author-hook.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-hook',\n session: (context) => ({\n get skills(): DoomMcpSessionPlugin['skills'] { return [at(skillPoAuthorHook, context)]; },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;AAGA,IAAA,8BAAA,GAAeA,4BAAAA,eAAAA,CAAe;CAC5B,MAAM;CACN,aACE;CACF,aAAA,GAAYC,+BAAAA,oBAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,MAAqC,qCAAqC;AACxF,CAAC;;;ACFD,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AAEpE,MAAa,OAAA,GAAMC,4BAAAA,gBAAAA,CAAgB;CACjC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,SAAyC;EAAE,OAAO,CAAC,GAAGC,4BAAmB,OAAO,CAAC;CAAG,EAC1F;AACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ //#region generated/mcp.d.ts
2
+ export declare const mcp: import("@agimon-ai/po-core/mcpFacet").DoomMcpPluginDefinition;
3
+ //#endregion
4
+ export { mcp as default };
5
+ //# sourceMappingURL=mcp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.mts","names":[],"sources":["../../generated/mcp.ts"],"mappings":";qBASa,2CAAG"}
@@ -0,0 +1,21 @@
1
+ import { defineMcpPlugin, defineMcpSkill } from "@agimon-ai/po-core/mcpFacet";
2
+ import { readPackageResource } from "@agimon-ai/po-core/serverFacet";
3
+ //#region src/extensions/workspaces/sessions/(backend)/skill/po-author-hook.mcp.ts
4
+ var po_author_hook_mcp_default = defineMcpSkill({
5
+ name: "po-author-hook",
6
+ description: "Author Po repository or plugin hooks. Use when creating or changing .po/hooks.yaml, selecting hook groups from modes.yaml, writing hook commands, or adapting Claude Code hook payloads and decisions to Po.",
7
+ read: () => readPackageResource(import.meta.url, "src/prompts/po-author-hook/SKILL.md")
8
+ });
9
+ //#endregion
10
+ //#region generated/mcp.ts
11
+ const at = (value, context) => typeof value === "function" ? value(context) : value;
12
+ const mcp = defineMcpPlugin({
13
+ name: "@agimon-ai/po-hook",
14
+ session: (context) => ({ get skills() {
15
+ return [at(po_author_hook_mcp_default, context)];
16
+ } })
17
+ });
18
+ //#endregion
19
+ export { mcp as default, mcp };
20
+
21
+ //# sourceMappingURL=mcp.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.mjs","names":["skillPoAuthorHook"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-author-hook.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-author-hook',\n description:\n 'Author Po repository or plugin hooks. Use when creating or changing .po/hooks.yaml, selecting hook groups from modes.yaml, writing hook commands, or adapting Claude Code hook payloads and decisions to Po.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-author-hook/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoAuthorHook from '../src/extensions/workspaces/sessions/(backend)/skill/po-author-hook.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-hook',\n session: (context) => ({\n get skills(): DoomMcpSessionPlugin['skills'] { return [at(skillPoAuthorHook, context)]; },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;AAGA,IAAA,6BAAe,eAAe;CAC5B,MAAM;CACN,aACE;CACF,YAAY,oBAAoB,YAAY,KAAK,qCAAqC;AACxF,CAAC;;;ACFD,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AAEpE,MAAa,MAAM,gBAAgB;CACjC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,SAAyC;EAAE,OAAO,CAAC,GAAGA,4BAAmB,OAAO,CAAC;CAAG,EAC1F;AACF,CAAC"}