@a5c-ai/hooks-mux-adapter-pi 5.0.1-staging.37ca18bd
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/dist/adapter.d.ts +12 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +35 -0
- package/dist/adapter.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/integration.d.ts +38 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +48 -0
- package/dist/integration.js.map +1 -0
- package/dist/mappings.d.ts +19 -0
- package/dist/mappings.d.ts.map +1 -0
- package/dist/mappings.js +64 -0
- package/dist/mappings.js.map +1 -0
- package/dist/normalizer.d.ts +64 -0
- package/dist/normalizer.d.ts.map +1 -0
- package/dist/normalizer.js +140 -0
- package/dist/normalizer.js.map +1 -0
- package/dist/renderer.d.ts +55 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/renderer.js +91 -0
- package/dist/renderer.js.map +1 -0
- package/dist/session-resolver.d.ts +26 -0
- package/dist/session-resolver.d.ts.map +1 -0
- package/dist/session-resolver.js +47 -0
- package/dist/session-resolver.js.map +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AdapterCapabilities } from '@a5c-ai/hooks-mux-core';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the Pi adapter capability descriptor.
|
|
4
|
+
*
|
|
5
|
+
* Pi is an in-process harness with native session IDs,
|
|
6
|
+
* extension-state persistence, and mutable tool input semantics
|
|
7
|
+
* (later handlers see earlier mutations).
|
|
8
|
+
*
|
|
9
|
+
* Spec section 17.6.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createAdapter(): AdapterCapabilities;
|
|
12
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,mBAAmB,CAqBnD"}
|
package/dist/adapter.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAdapter = createAdapter;
|
|
4
|
+
/**
|
|
5
|
+
* Creates the Pi adapter capability descriptor.
|
|
6
|
+
*
|
|
7
|
+
* Pi is an in-process harness with native session IDs,
|
|
8
|
+
* extension-state persistence, and mutable tool input semantics
|
|
9
|
+
* (later handlers see earlier mutations).
|
|
10
|
+
*
|
|
11
|
+
* Spec section 17.6.
|
|
12
|
+
*/
|
|
13
|
+
function createAdapter() {
|
|
14
|
+
return {
|
|
15
|
+
name: 'pi',
|
|
16
|
+
family: 'in-process',
|
|
17
|
+
sessionIdQuality: 'native',
|
|
18
|
+
supportsOrderedFanout: true,
|
|
19
|
+
supportsNativeAdditionalContext: false,
|
|
20
|
+
supportsBlock: true,
|
|
21
|
+
supportsAsk: false,
|
|
22
|
+
supportsToolInputMutation: true,
|
|
23
|
+
supportsToolResultMutation: false,
|
|
24
|
+
supportsPersistedEnv: true,
|
|
25
|
+
envPersistenceMode: 'runtime_hook',
|
|
26
|
+
toolInterceptionScope: 'all',
|
|
27
|
+
notes: [
|
|
28
|
+
'Library-only adapter — Pi hooks are in-process, not shell subprocesses',
|
|
29
|
+
'Tool input mutation is in-place; later handlers see earlier mutations',
|
|
30
|
+
'Session persistence via native extension-state; does not automatically enter model context',
|
|
31
|
+
'No stdin parsing required — input arrives as programmatic objects',
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":";;AAWA,sCAqBC;AA9BD;;;;;;;;GAQG;AACH,SAAgB,aAAa;IAC3B,OAAO;QACL,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,YAAY;QACpB,gBAAgB,EAAE,QAAQ;QAC1B,qBAAqB,EAAE,IAAI;QAC3B,+BAA+B,EAAE,KAAK;QACtC,aAAa,EAAE,IAAI;QACnB,WAAW,EAAE,KAAK;QAClB,yBAAyB,EAAE,IAAI;QAC/B,0BAA0B,EAAE,KAAK;QACjC,oBAAoB,EAAE,IAAI;QAC1B,kBAAkB,EAAE,cAAc;QAClC,qBAAqB,EAAE,KAAK;QAC5B,KAAK,EAAE;YACL,wEAAwE;YACxE,uEAAuE;YACvE,4FAA4F;YAC5F,mEAAmE;SACpE;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { createAdapter } from './adapter';
|
|
2
|
+
export { PI_PHASE_MAPPINGS, getPiPhaseMapping, getSupportedPhases } from './mappings';
|
|
3
|
+
export { createConfiguredEngine } from './integration';
|
|
4
|
+
export { normalizePi, coerceInput, buildExecutionContext, buildPayload } from './normalizer';
|
|
5
|
+
export type { PiEventBase, PiSessionStartPayload, PiToolCallPayload, PiContextPayload, PiBeforeProviderRequestPayload, } from './normalizer';
|
|
6
|
+
export { renderPiOutput, buildExtensionState } from './renderer';
|
|
7
|
+
export type { PiToolCallOutput, PiSessionStartOutput, PiContextOutput, PiBeforeProviderRequestOutput, PiGenericOutput, } from './renderer';
|
|
8
|
+
export { resolveSessionId } from './session-resolver';
|
|
9
|
+
export type { SessionResolutionResult } from './session-resolver';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7F,YAAY,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,8BAA8B,GAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjE,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,6BAA6B,EAC7B,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveSessionId = exports.buildExtensionState = exports.renderPiOutput = exports.buildPayload = exports.buildExecutionContext = exports.coerceInput = exports.normalizePi = exports.createConfiguredEngine = exports.getSupportedPhases = exports.getPiPhaseMapping = exports.PI_PHASE_MAPPINGS = exports.createAdapter = void 0;
|
|
4
|
+
var adapter_1 = require("./adapter");
|
|
5
|
+
Object.defineProperty(exports, "createAdapter", { enumerable: true, get: function () { return adapter_1.createAdapter; } });
|
|
6
|
+
var mappings_1 = require("./mappings");
|
|
7
|
+
Object.defineProperty(exports, "PI_PHASE_MAPPINGS", { enumerable: true, get: function () { return mappings_1.PI_PHASE_MAPPINGS; } });
|
|
8
|
+
Object.defineProperty(exports, "getPiPhaseMapping", { enumerable: true, get: function () { return mappings_1.getPiPhaseMapping; } });
|
|
9
|
+
Object.defineProperty(exports, "getSupportedPhases", { enumerable: true, get: function () { return mappings_1.getSupportedPhases; } });
|
|
10
|
+
var integration_1 = require("./integration");
|
|
11
|
+
Object.defineProperty(exports, "createConfiguredEngine", { enumerable: true, get: function () { return integration_1.createConfiguredEngine; } });
|
|
12
|
+
var normalizer_1 = require("./normalizer");
|
|
13
|
+
Object.defineProperty(exports, "normalizePi", { enumerable: true, get: function () { return normalizer_1.normalizePi; } });
|
|
14
|
+
Object.defineProperty(exports, "coerceInput", { enumerable: true, get: function () { return normalizer_1.coerceInput; } });
|
|
15
|
+
Object.defineProperty(exports, "buildExecutionContext", { enumerable: true, get: function () { return normalizer_1.buildExecutionContext; } });
|
|
16
|
+
Object.defineProperty(exports, "buildPayload", { enumerable: true, get: function () { return normalizer_1.buildPayload; } });
|
|
17
|
+
var renderer_1 = require("./renderer");
|
|
18
|
+
Object.defineProperty(exports, "renderPiOutput", { enumerable: true, get: function () { return renderer_1.renderPiOutput; } });
|
|
19
|
+
Object.defineProperty(exports, "buildExtensionState", { enumerable: true, get: function () { return renderer_1.buildExtensionState; } });
|
|
20
|
+
var session_resolver_1 = require("./session-resolver");
|
|
21
|
+
Object.defineProperty(exports, "resolveSessionId", { enumerable: true, get: function () { return session_resolver_1.resolveSessionId; } });
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAAjC,wGAAA,aAAa,OAAA;AACtB,uCAAsF;AAA7E,6GAAA,iBAAiB,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAAE,8GAAA,kBAAkB,OAAA;AACjE,6CAAuD;AAA9C,qHAAA,sBAAsB,OAAA;AAC/B,2CAA6F;AAApF,yGAAA,WAAW,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,mHAAA,qBAAqB,OAAA;AAAE,0GAAA,YAAY,OAAA;AAQtE,uCAAiE;AAAxD,0GAAA,cAAc,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAQ5C,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Programmatic engine integration for the Pi adapter.
|
|
3
|
+
*
|
|
4
|
+
* Creates a pre-configured HooksEngine wired to the Pi adapter's
|
|
5
|
+
* capabilities and phase mappings, ready for in-process hook execution.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { createConfiguredEngine } from '@a5c-ai/hooks-mux-adapter-pi';
|
|
10
|
+
*
|
|
11
|
+
* const engine = createConfiguredEngine();
|
|
12
|
+
*
|
|
13
|
+
* engine.registerHandler({
|
|
14
|
+
* id: 'my-handler',
|
|
15
|
+
* pluginId: 'my-plugin',
|
|
16
|
+
* phase: 'session.start',
|
|
17
|
+
* priority: 10,
|
|
18
|
+
* handler: async (event) => ({
|
|
19
|
+
* persistEnv: { MY_PLUGIN_READY: '1' },
|
|
20
|
+
* }),
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // When Pi fires a session_start event:
|
|
24
|
+
* const result = await engine.processEvent({
|
|
25
|
+
* nativeEventName: 'session_start',
|
|
26
|
+
* payload: { sessionId: 'abc', cwd: '/project' },
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
import { type HooksEngine } from '@a5c-ai/hooks-mux-core';
|
|
31
|
+
/**
|
|
32
|
+
* Create a pre-configured hooks engine for the Pi adapter.
|
|
33
|
+
* Ready to register handlers and process events.
|
|
34
|
+
*/
|
|
35
|
+
export declare function createConfiguredEngine(options?: {
|
|
36
|
+
sessionDir?: string;
|
|
37
|
+
}): HooksEngine;
|
|
38
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI7E;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAOrF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Programmatic engine integration for the Pi adapter.
|
|
4
|
+
*
|
|
5
|
+
* Creates a pre-configured HooksEngine wired to the Pi adapter's
|
|
6
|
+
* capabilities and phase mappings, ready for in-process hook execution.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { createConfiguredEngine } from '@a5c-ai/hooks-mux-adapter-pi';
|
|
11
|
+
*
|
|
12
|
+
* const engine = createConfiguredEngine();
|
|
13
|
+
*
|
|
14
|
+
* engine.registerHandler({
|
|
15
|
+
* id: 'my-handler',
|
|
16
|
+
* pluginId: 'my-plugin',
|
|
17
|
+
* phase: 'session.start',
|
|
18
|
+
* priority: 10,
|
|
19
|
+
* handler: async (event) => ({
|
|
20
|
+
* persistEnv: { MY_PLUGIN_READY: '1' },
|
|
21
|
+
* }),
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* // When Pi fires a session_start event:
|
|
25
|
+
* const result = await engine.processEvent({
|
|
26
|
+
* nativeEventName: 'session_start',
|
|
27
|
+
* payload: { sessionId: 'abc', cwd: '/project' },
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.createConfiguredEngine = createConfiguredEngine;
|
|
33
|
+
const hooks_mux_core_1 = require("@a5c-ai/hooks-mux-core");
|
|
34
|
+
const adapter_1 = require("./adapter");
|
|
35
|
+
const mappings_1 = require("./mappings");
|
|
36
|
+
/**
|
|
37
|
+
* Create a pre-configured hooks engine for the Pi adapter.
|
|
38
|
+
* Ready to register handlers and process events.
|
|
39
|
+
*/
|
|
40
|
+
function createConfiguredEngine(options) {
|
|
41
|
+
return (0, hooks_mux_core_1.createHooksEngine)({
|
|
42
|
+
adapter: 'pi',
|
|
43
|
+
capabilities: (0, adapter_1.createAdapter)(),
|
|
44
|
+
phaseMappings: mappings_1.PI_PHASE_MAPPINGS,
|
|
45
|
+
sessionDir: options?.sessionDir,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.js","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;AAUH,wDAOC;AAfD,2DAA6E;AAC7E,uCAA0C;AAC1C,yCAA+C;AAE/C;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,OAAiC;IACtE,OAAO,IAAA,kCAAiB,EAAC;QACvB,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,IAAA,uBAAa,GAAE;QAC7B,aAAa,EAAE,4BAAiB;QAChC,UAAU,EAAE,OAAO,EAAE,UAAU;KAChC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PhaseMapping } from '@a5c-ai/hooks-mux-core';
|
|
2
|
+
/**
|
|
3
|
+
* Pi native event name to canonical phase mappings.
|
|
4
|
+
*
|
|
5
|
+
* Pi extension events:
|
|
6
|
+
* session_start, tool_call, context, before_provider_request
|
|
7
|
+
*
|
|
8
|
+
* Spec section 8.2 / 17.6.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PI_PHASE_MAPPINGS: PhaseMapping[];
|
|
11
|
+
/**
|
|
12
|
+
* Look up the phase mapping for a given Pi native event name.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getPiPhaseMapping(nativeEventName: string): PhaseMapping | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Get all canonical phases supported by the Pi adapter.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getSupportedPhases(): string[];
|
|
19
|
+
//# sourceMappingURL=mappings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappings.d.ts","sourceRoot":"","sources":["../src/mappings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAqC3C,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEnF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C"}
|
package/dist/mappings.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PI_PHASE_MAPPINGS = void 0;
|
|
4
|
+
exports.getPiPhaseMapping = getPiPhaseMapping;
|
|
5
|
+
exports.getSupportedPhases = getSupportedPhases;
|
|
6
|
+
/**
|
|
7
|
+
* Pi native event name to canonical phase mappings.
|
|
8
|
+
*
|
|
9
|
+
* Pi extension events:
|
|
10
|
+
* session_start, tool_call, context, before_provider_request
|
|
11
|
+
*
|
|
12
|
+
* Spec section 8.2 / 17.6.
|
|
13
|
+
*/
|
|
14
|
+
exports.PI_PHASE_MAPPINGS = [
|
|
15
|
+
{
|
|
16
|
+
canonicalPhase: 'session.start',
|
|
17
|
+
nativeHook: 'session_start',
|
|
18
|
+
supportLevel: 'native',
|
|
19
|
+
blockCapability: false,
|
|
20
|
+
mutationCapability: false,
|
|
21
|
+
scope: 'session',
|
|
22
|
+
notes: 'Fires when a Pi session begins. Extension-state is available for persistence.',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
canonicalPhase: 'tool.before',
|
|
26
|
+
nativeHook: 'tool_call',
|
|
27
|
+
supportLevel: 'native',
|
|
28
|
+
blockCapability: true,
|
|
29
|
+
mutationCapability: true,
|
|
30
|
+
scope: 'tool',
|
|
31
|
+
notes: 'Tool input mutation is in-place; later handlers see earlier mutations.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
canonicalPhase: 'turn.before_agent',
|
|
35
|
+
nativeHook: 'context',
|
|
36
|
+
supportLevel: 'native',
|
|
37
|
+
blockCapability: false,
|
|
38
|
+
mutationCapability: false,
|
|
39
|
+
scope: 'turn',
|
|
40
|
+
notes: 'Context injection point before the agent processes a turn.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
canonicalPhase: 'model.before_request',
|
|
44
|
+
nativeHook: 'before_provider_request',
|
|
45
|
+
supportLevel: 'native',
|
|
46
|
+
blockCapability: false,
|
|
47
|
+
mutationCapability: false,
|
|
48
|
+
scope: 'model',
|
|
49
|
+
notes: 'Fires before the provider (LLM) request is sent.',
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
/**
|
|
53
|
+
* Look up the phase mapping for a given Pi native event name.
|
|
54
|
+
*/
|
|
55
|
+
function getPiPhaseMapping(nativeEventName) {
|
|
56
|
+
return exports.PI_PHASE_MAPPINGS.find((m) => m.nativeHook === nativeEventName);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get all canonical phases supported by the Pi adapter.
|
|
60
|
+
*/
|
|
61
|
+
function getSupportedPhases() {
|
|
62
|
+
return exports.PI_PHASE_MAPPINGS.map((m) => m.canonicalPhase);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=mappings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappings.js","sourceRoot":"","sources":["../src/mappings.ts"],"names":[],"mappings":";;;AAoDA,8CAEC;AAKD,gDAEC;AA3DD;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAmB;IAC/C;QACE,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,eAAe;QAC3B,YAAY,EAAE,QAAQ;QACtB,eAAe,EAAE,KAAK;QACtB,kBAAkB,EAAE,KAAK;QACzB,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,+EAA+E;KACvF;IACD;QACE,cAAc,EAAE,aAAa;QAC7B,UAAU,EAAE,WAAW;QACvB,YAAY,EAAE,QAAQ;QACtB,eAAe,EAAE,IAAI;QACrB,kBAAkB,EAAE,IAAI;QACxB,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,wEAAwE;KAChF;IACD;QACE,cAAc,EAAE,mBAAmB;QACnC,UAAU,EAAE,SAAS;QACrB,YAAY,EAAE,QAAQ;QACtB,eAAe,EAAE,KAAK;QACtB,kBAAkB,EAAE,KAAK;QACzB,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,4DAA4D;KACpE;IACD;QACE,cAAc,EAAE,sBAAsB;QACtC,UAAU,EAAE,yBAAyB;QACrC,YAAY,EAAE,QAAQ;QACtB,eAAe,EAAE,KAAK;QACtB,kBAAkB,EAAE,KAAK;QACzB,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,kDAAkD;KAC1D;CACF,CAAC;AAEF;;GAEG;AACH,SAAgB,iBAAiB,CAAC,eAAuB;IACvD,OAAO,yBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,eAAe,CAAC,CAAC;AACzE,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB;IAChC,OAAO,yBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { UnifiedHookEvent, UnifiedExecutionContext } from '@a5c-ai/hooks-mux-core';
|
|
2
|
+
/**
|
|
3
|
+
* Pi programmatic event payload shapes.
|
|
4
|
+
*
|
|
5
|
+
* Pi passes hook input as in-process objects (not stdin),
|
|
6
|
+
* so no stdin parsing is needed.
|
|
7
|
+
*/
|
|
8
|
+
/** Common fields present across Pi hook events. */
|
|
9
|
+
export interface PiEventBase {
|
|
10
|
+
sessionId?: string;
|
|
11
|
+
cwd?: string;
|
|
12
|
+
model?: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
/** session_start-specific fields. */
|
|
16
|
+
export interface PiSessionStartPayload extends PiEventBase {
|
|
17
|
+
/** Initial prompt or message that started the session. */
|
|
18
|
+
initialPrompt?: string;
|
|
19
|
+
}
|
|
20
|
+
/** tool_call-specific fields. */
|
|
21
|
+
export interface PiToolCallPayload extends PiEventBase {
|
|
22
|
+
toolName?: string;
|
|
23
|
+
toolCallId?: string;
|
|
24
|
+
/** Mutable tool input — later handlers see earlier mutations. */
|
|
25
|
+
toolInput?: unknown;
|
|
26
|
+
}
|
|
27
|
+
/** context-specific fields. */
|
|
28
|
+
export interface PiContextPayload extends PiEventBase {
|
|
29
|
+
/** Context content to inject into the turn. */
|
|
30
|
+
contextContent?: string;
|
|
31
|
+
}
|
|
32
|
+
/** before_provider_request-specific fields. */
|
|
33
|
+
export interface PiBeforeProviderRequestPayload extends PiEventBase {
|
|
34
|
+
/** The messages about to be sent to the provider. */
|
|
35
|
+
messages?: unknown[];
|
|
36
|
+
/** Provider configuration. */
|
|
37
|
+
providerConfig?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Coerce raw input to a record. Pi input is always programmatic objects,
|
|
41
|
+
* but we handle edge cases defensively.
|
|
42
|
+
*/
|
|
43
|
+
export declare function coerceInput(raw: unknown): Record<string, unknown>;
|
|
44
|
+
/**
|
|
45
|
+
* Build a UnifiedExecutionContext from a Pi event payload.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildExecutionContext(data: Record<string, unknown>, nativeEventName: string, extensionState?: Record<string, string>): UnifiedExecutionContext;
|
|
48
|
+
/**
|
|
49
|
+
* Build the payload portion of the unified event from Pi event data.
|
|
50
|
+
* Extracts event-specific fields into the normalized payload.
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildPayload(nativeEventName: string, data: Record<string, unknown>): Record<string, unknown>;
|
|
53
|
+
/**
|
|
54
|
+
* Normalize a Pi hook invocation into a UnifiedHookEvent.
|
|
55
|
+
*
|
|
56
|
+
* Unlike shell-hook adapters, Pi events arrive as in-process objects.
|
|
57
|
+
* No stdin parsing is required.
|
|
58
|
+
*
|
|
59
|
+
* @param nativeEventName - The Pi event name (e.g. 'session_start', 'tool_call').
|
|
60
|
+
* @param rawInput - The programmatic event object from Pi.
|
|
61
|
+
* @param extensionState - Extension-state key-value pairs for session persistence.
|
|
62
|
+
*/
|
|
63
|
+
export declare function normalizePi(nativeEventName: string, rawInput: unknown, extensionState?: Record<string, string>): UnifiedHookEvent;
|
|
64
|
+
//# sourceMappingURL=normalizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../src/normalizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAGxF;;;;;GAKG;AAEH,mDAAmD;AACnD,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,qCAAqC;AACrC,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iCAAiC;AACjC,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,+BAA+B;AAC/B,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,+CAA+C;AAC/C,MAAM,WAAW,8BAA+B,SAAQ,WAAW;IACjE,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQjE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,eAAe,EAAE,MAAM,EACvB,cAAc,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAC1C,uBAAuB,CAmCzB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkCzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,OAAO,EACjB,cAAc,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAC1C,gBAAgB,CAmClB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.coerceInput = coerceInput;
|
|
4
|
+
exports.buildExecutionContext = buildExecutionContext;
|
|
5
|
+
exports.buildPayload = buildPayload;
|
|
6
|
+
exports.normalizePi = normalizePi;
|
|
7
|
+
const mappings_1 = require("./mappings");
|
|
8
|
+
/**
|
|
9
|
+
* Coerce raw input to a record. Pi input is always programmatic objects,
|
|
10
|
+
* but we handle edge cases defensively.
|
|
11
|
+
*/
|
|
12
|
+
function coerceInput(raw) {
|
|
13
|
+
if (raw == null) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
if (typeof raw === 'object' && !Array.isArray(raw)) {
|
|
17
|
+
return raw;
|
|
18
|
+
}
|
|
19
|
+
return { raw };
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Build a UnifiedExecutionContext from a Pi event payload.
|
|
23
|
+
*/
|
|
24
|
+
function buildExecutionContext(data, nativeEventName, extensionState = {}) {
|
|
25
|
+
const persistedEnv = {};
|
|
26
|
+
const contextVars = {};
|
|
27
|
+
// Collect persisted state from extension-state
|
|
28
|
+
for (const [key, value] of Object.entries(extensionState)) {
|
|
29
|
+
if (key.startsWith('HOOKS_PROXY_PERSIST_')) {
|
|
30
|
+
persistedEnv[key] = value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const sessionId = data.sessionId
|
|
34
|
+
?? extensionState['AGENT_SESSION_ID']
|
|
35
|
+
?? null;
|
|
36
|
+
return {
|
|
37
|
+
sessionId,
|
|
38
|
+
turnId: extensionState['HOOKS_PROXY_TURN_ID'] ?? null,
|
|
39
|
+
conversationId: extensionState['HOOKS_PROXY_CONVERSATION_ID'] ?? null,
|
|
40
|
+
adapter: 'pi',
|
|
41
|
+
cwd: data.cwd ?? null,
|
|
42
|
+
worktree: extensionState['HOOKS_PROXY_WORKTREE'] ?? null,
|
|
43
|
+
transcriptPath: null,
|
|
44
|
+
source: null,
|
|
45
|
+
model: data.model ?? extensionState['HOOKS_PROXY_MODEL'] ?? null,
|
|
46
|
+
agentType: null,
|
|
47
|
+
permissionMode: null,
|
|
48
|
+
toolName: data.toolName ?? null,
|
|
49
|
+
toolCallId: data.toolCallId ?? null,
|
|
50
|
+
nativeEventName,
|
|
51
|
+
rawEventScope: null,
|
|
52
|
+
persistedEnv,
|
|
53
|
+
contextVars,
|
|
54
|
+
metadata: {},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Build the payload portion of the unified event from Pi event data.
|
|
59
|
+
* Extracts event-specific fields into the normalized payload.
|
|
60
|
+
*/
|
|
61
|
+
function buildPayload(nativeEventName, data) {
|
|
62
|
+
const payload = {};
|
|
63
|
+
switch (nativeEventName) {
|
|
64
|
+
case 'session_start':
|
|
65
|
+
if (data.initialPrompt != null)
|
|
66
|
+
payload.initialPrompt = data.initialPrompt;
|
|
67
|
+
break;
|
|
68
|
+
case 'tool_call':
|
|
69
|
+
if (data.toolName != null)
|
|
70
|
+
payload.toolName = data.toolName;
|
|
71
|
+
if (data.toolCallId != null)
|
|
72
|
+
payload.toolCallId = data.toolCallId;
|
|
73
|
+
if (data.toolInput != null)
|
|
74
|
+
payload.toolInput = data.toolInput;
|
|
75
|
+
break;
|
|
76
|
+
case 'context':
|
|
77
|
+
if (data.contextContent != null)
|
|
78
|
+
payload.contextContent = data.contextContent;
|
|
79
|
+
break;
|
|
80
|
+
case 'before_provider_request':
|
|
81
|
+
if (data.messages != null)
|
|
82
|
+
payload.messages = data.messages;
|
|
83
|
+
if (data.providerConfig != null)
|
|
84
|
+
payload.providerConfig = data.providerConfig;
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
// Unknown event: pass through all non-common fields
|
|
88
|
+
for (const [key, value] of Object.entries(data)) {
|
|
89
|
+
if (!['sessionId', 'cwd', 'model'].includes(key)) {
|
|
90
|
+
payload[key] = value;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
return payload;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Normalize a Pi hook invocation into a UnifiedHookEvent.
|
|
99
|
+
*
|
|
100
|
+
* Unlike shell-hook adapters, Pi events arrive as in-process objects.
|
|
101
|
+
* No stdin parsing is required.
|
|
102
|
+
*
|
|
103
|
+
* @param nativeEventName - The Pi event name (e.g. 'session_start', 'tool_call').
|
|
104
|
+
* @param rawInput - The programmatic event object from Pi.
|
|
105
|
+
* @param extensionState - Extension-state key-value pairs for session persistence.
|
|
106
|
+
*/
|
|
107
|
+
function normalizePi(nativeEventName, rawInput, extensionState = {}) {
|
|
108
|
+
const data = coerceInput(rawInput);
|
|
109
|
+
const mapping = (0, mappings_1.getPiPhaseMapping)(nativeEventName);
|
|
110
|
+
const phase = mapping?.canonicalPhase ?? 'unknown';
|
|
111
|
+
const supportLevel = mapping?.supportLevel ?? 'unsupported';
|
|
112
|
+
const execution = buildExecutionContext(data, nativeEventName, extensionState);
|
|
113
|
+
const payload = buildPayload(nativeEventName, data);
|
|
114
|
+
// Split extension-state into input and persisted buckets
|
|
115
|
+
const inputEnv = {};
|
|
116
|
+
const persistedEnv = {};
|
|
117
|
+
for (const [key, value] of Object.entries(extensionState)) {
|
|
118
|
+
if (key.startsWith('HOOKS_PROXY_PERSIST_')) {
|
|
119
|
+
persistedEnv[key] = value;
|
|
120
|
+
}
|
|
121
|
+
else if (key.startsWith('HOOKS_PROXY_')) {
|
|
122
|
+
inputEnv[key] = value;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
version: 'a5c.hooks.v1',
|
|
127
|
+
adapter: 'pi',
|
|
128
|
+
phase,
|
|
129
|
+
rawEventName: nativeEventName,
|
|
130
|
+
supportLevel,
|
|
131
|
+
execution,
|
|
132
|
+
payload,
|
|
133
|
+
env: {
|
|
134
|
+
input: inputEnv,
|
|
135
|
+
persisted: persistedEnv,
|
|
136
|
+
},
|
|
137
|
+
raw: rawInput,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=normalizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizer.js","sourceRoot":"","sources":["../src/normalizer.ts"],"names":[],"mappings":";;AAkDA,kCAQC;AAKD,sDAuCC;AAMD,oCAqCC;A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QACxB,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,IAAI;QACb,KAAK;QACL,YAAY,EAAE,eAAe;QAC7B,YAAY;QACZ,SAAS;QACT,OAAO;QACP,GAAG,EAAE;YACH,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,YAAY;SACxB;QACD,GAAG,EAAE,QAAQ;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { UnifiedHookResult } from '@a5c-ai/hooks-mux-core';
|
|
2
|
+
/**
|
|
3
|
+
* Pi native hook output formats.
|
|
4
|
+
*
|
|
5
|
+
* Pi hooks communicate results as in-process return objects.
|
|
6
|
+
* The shape depends on the event type.
|
|
7
|
+
*/
|
|
8
|
+
/** tool_call hook output: permission decision and optional tool input mutation. */
|
|
9
|
+
export interface PiToolCallOutput {
|
|
10
|
+
decision?: 'allow' | 'deny';
|
|
11
|
+
reason?: string;
|
|
12
|
+
/** Mutated tool input — Pi supports in-place mutation. */
|
|
13
|
+
toolInput?: unknown;
|
|
14
|
+
}
|
|
15
|
+
/** session_start hook output. */
|
|
16
|
+
export interface PiSessionStartOutput {
|
|
17
|
+
/** Additional context to inject (not native — must be handled by the hook layer). */
|
|
18
|
+
additionalContext?: string;
|
|
19
|
+
/** State to persist via extension-state. */
|
|
20
|
+
persistState?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
/** context hook output. */
|
|
23
|
+
export interface PiContextOutput {
|
|
24
|
+
/** Context content to inject into the model context. */
|
|
25
|
+
contextContent?: string;
|
|
26
|
+
}
|
|
27
|
+
/** before_provider_request hook output. */
|
|
28
|
+
export interface PiBeforeProviderRequestOutput {
|
|
29
|
+
/** Modified messages to send to the provider. */
|
|
30
|
+
messages?: unknown[];
|
|
31
|
+
}
|
|
32
|
+
/** Generic output shape for unrecognized events. */
|
|
33
|
+
export interface PiGenericOutput {
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Render a UnifiedHookResult back to Pi's native output format.
|
|
38
|
+
*
|
|
39
|
+
* @param result - The unified hook result from handler execution.
|
|
40
|
+
* @param nativeEventName - The original Pi event name.
|
|
41
|
+
* @returns The native output object to return to Pi.
|
|
42
|
+
*/
|
|
43
|
+
export declare function renderPiOutput(result: UnifiedHookResult, nativeEventName: string): Record<string, unknown>;
|
|
44
|
+
/**
|
|
45
|
+
* Build extension-state entries for Pi session persistence.
|
|
46
|
+
*
|
|
47
|
+
* Pi uses its native extension-state mechanism for key-value persistence
|
|
48
|
+
* across hook invocations. Unlike Claude's env-file approach, this is
|
|
49
|
+
* an in-process API — no file I/O needed.
|
|
50
|
+
*
|
|
51
|
+
* @param persistEnv - Key-value pairs to persist.
|
|
52
|
+
* @returns Record of key-value pairs to store in extension-state.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildExtensionState(persistEnv: Record<string, string>): Record<string, string>;
|
|
55
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;;GAKG;AAEH,mFAAmF;AACnF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,iCAAiC;AACjC,MAAM,WAAW,oBAAoB;IACnC,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED,2BAA2B;AAC3B,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,2CAA2C;AAC3C,MAAM,WAAW,6BAA6B;IAC5C,iDAAiD;IACjD,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,iBAAiB,EACzB,eAAe,EAAE,MAAM,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAazB;AAuED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE9F"}
|
package/dist/renderer.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderPiOutput = renderPiOutput;
|
|
4
|
+
exports.buildExtensionState = buildExtensionState;
|
|
5
|
+
/**
|
|
6
|
+
* Render a UnifiedHookResult back to Pi's native output format.
|
|
7
|
+
*
|
|
8
|
+
* @param result - The unified hook result from handler execution.
|
|
9
|
+
* @param nativeEventName - The original Pi event name.
|
|
10
|
+
* @returns The native output object to return to Pi.
|
|
11
|
+
*/
|
|
12
|
+
function renderPiOutput(result, nativeEventName) {
|
|
13
|
+
switch (nativeEventName) {
|
|
14
|
+
case 'tool_call':
|
|
15
|
+
return renderToolCallOutput(result);
|
|
16
|
+
case 'session_start':
|
|
17
|
+
return renderSessionStartOutput(result);
|
|
18
|
+
case 'context':
|
|
19
|
+
return renderContextOutput(result);
|
|
20
|
+
case 'before_provider_request':
|
|
21
|
+
return renderBeforeProviderRequestOutput(result);
|
|
22
|
+
default:
|
|
23
|
+
return renderGenericOutput(result);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function renderToolCallOutput(result) {
|
|
27
|
+
const output = {};
|
|
28
|
+
// Map unified decision to Pi's permission decision
|
|
29
|
+
if (result.decision === 'allow') {
|
|
30
|
+
output['decision'] = 'allow';
|
|
31
|
+
}
|
|
32
|
+
else if (result.decision === 'deny') {
|
|
33
|
+
output['decision'] = 'deny';
|
|
34
|
+
}
|
|
35
|
+
// 'ask', 'continue', and 'noop' are not natively supported by Pi;
|
|
36
|
+
// 'ask' falls through to no decision (Pi defaults to allow)
|
|
37
|
+
if (result.reason != null) {
|
|
38
|
+
output['reason'] = result.reason;
|
|
39
|
+
}
|
|
40
|
+
// Tool input mutation: Pi supports in-place mutation via toolMutation
|
|
41
|
+
if (result.toolMutation != null) {
|
|
42
|
+
output['toolInput'] = result.toolMutation.value;
|
|
43
|
+
}
|
|
44
|
+
return output;
|
|
45
|
+
}
|
|
46
|
+
function renderSessionStartOutput(result) {
|
|
47
|
+
const output = {};
|
|
48
|
+
if (result.additionalContext != null) {
|
|
49
|
+
output['additionalContext'] = result.additionalContext;
|
|
50
|
+
}
|
|
51
|
+
// Collect env to persist via extension-state
|
|
52
|
+
if (result.persistEnv != null && Object.keys(result.persistEnv).length > 0) {
|
|
53
|
+
output['persistState'] = result.persistEnv;
|
|
54
|
+
}
|
|
55
|
+
return output;
|
|
56
|
+
}
|
|
57
|
+
function renderContextOutput(result) {
|
|
58
|
+
const output = {};
|
|
59
|
+
if (result.additionalContext != null) {
|
|
60
|
+
output['contextContent'] = result.additionalContext;
|
|
61
|
+
}
|
|
62
|
+
return output;
|
|
63
|
+
}
|
|
64
|
+
function renderBeforeProviderRequestOutput(result) {
|
|
65
|
+
const output = {};
|
|
66
|
+
if (result.systemMessage != null) {
|
|
67
|
+
output['systemMessage'] = result.systemMessage;
|
|
68
|
+
}
|
|
69
|
+
return output;
|
|
70
|
+
}
|
|
71
|
+
function renderGenericOutput(result) {
|
|
72
|
+
const output = {};
|
|
73
|
+
if (result.additionalContext != null) {
|
|
74
|
+
output['additionalContext'] = result.additionalContext;
|
|
75
|
+
}
|
|
76
|
+
return output;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Build extension-state entries for Pi session persistence.
|
|
80
|
+
*
|
|
81
|
+
* Pi uses its native extension-state mechanism for key-value persistence
|
|
82
|
+
* across hook invocations. Unlike Claude's env-file approach, this is
|
|
83
|
+
* an in-process API — no file I/O needed.
|
|
84
|
+
*
|
|
85
|
+
* @param persistEnv - Key-value pairs to persist.
|
|
86
|
+
* @returns Record of key-value pairs to store in extension-state.
|
|
87
|
+
*/
|
|
88
|
+
function buildExtensionState(persistEnv) {
|
|
89
|
+
return { ...persistEnv };
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":";;AAiDA,wCAgBC;AAiFD,kDAEC;AA1GD;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,MAAyB,EACzB,eAAuB;IAEvB,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,WAAW;YACd,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACtC,KAAK,eAAe;YAClB,OAAO,wBAAwB,CAAC,MAAM,CAAC,CAAC;QAC1C,KAAK,SAAS;YACZ,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACrC,KAAK,yBAAyB;YAC5B,OAAO,iCAAiC,CAAC,MAAM,CAAC,CAAC;QACnD;YACE,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAyB;IACrD,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,mDAAmD;IACnD,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QAChC,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC;IAC/B,CAAC;SAAM,IAAI,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MAAM,CAAC,aAAa,IAAI,IAAI,EAAE,CAAC;QACjC,MAAM,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC;IACjD,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAyB;IACpD,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,IAAI,MAAM,CAAC,iBAAiB,IAAI,IAAI,EAAE,CAAC;QACrC,MAAM,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACzD,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,mBAAmB,CAAC,UAAkC;IACpE,OAAO,EAAE,GAAG,UAAU,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session ID resolution for Pi.
|
|
3
|
+
*
|
|
4
|
+
* Pi provides a native session ID via its programmatic API,
|
|
5
|
+
* so the resolution quality is 'native'.
|
|
6
|
+
*
|
|
7
|
+
* Resolution precedence (spec section 9.2):
|
|
8
|
+
* 1. Explicit override (e.g. from caller)
|
|
9
|
+
* 2. Explicit env/extension-state AGENT_SESSION_ID
|
|
10
|
+
* 3. Native sessionId from Pi event payload
|
|
11
|
+
* 4. PI_SESSION_ID from extension-state
|
|
12
|
+
* 5. Fallback: null
|
|
13
|
+
*/
|
|
14
|
+
export interface SessionResolutionResult {
|
|
15
|
+
sessionId: string | null;
|
|
16
|
+
source: 'explicit_override' | 'explicit_env' | 'native' | 'harness_env' | 'none';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolve the session ID for a Pi hook invocation.
|
|
20
|
+
*
|
|
21
|
+
* @param data - Parsed event payload from Pi.
|
|
22
|
+
* @param extensionState - Extension-state key-value pairs.
|
|
23
|
+
* @param explicitSessionId - Explicit session ID override from caller, if any.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveSessionId(data: Record<string, unknown>, extensionState?: Record<string, string>, explicitSessionId?: string): SessionResolutionResult;
|
|
26
|
+
//# sourceMappingURL=session-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-resolver.d.ts","sourceRoot":"","sources":["../src/session-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,mBAAmB,GAAG,cAAc,GAAG,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;CAClF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,cAAc,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EAC3C,iBAAiB,CAAC,EAAE,MAAM,GACzB,uBAAuB,CA0BzB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Session ID resolution for Pi.
|
|
4
|
+
*
|
|
5
|
+
* Pi provides a native session ID via its programmatic API,
|
|
6
|
+
* so the resolution quality is 'native'.
|
|
7
|
+
*
|
|
8
|
+
* Resolution precedence (spec section 9.2):
|
|
9
|
+
* 1. Explicit override (e.g. from caller)
|
|
10
|
+
* 2. Explicit env/extension-state AGENT_SESSION_ID
|
|
11
|
+
* 3. Native sessionId from Pi event payload
|
|
12
|
+
* 4. PI_SESSION_ID from extension-state
|
|
13
|
+
* 5. Fallback: null
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.resolveSessionId = resolveSessionId;
|
|
17
|
+
/**
|
|
18
|
+
* Resolve the session ID for a Pi hook invocation.
|
|
19
|
+
*
|
|
20
|
+
* @param data - Parsed event payload from Pi.
|
|
21
|
+
* @param extensionState - Extension-state key-value pairs.
|
|
22
|
+
* @param explicitSessionId - Explicit session ID override from caller, if any.
|
|
23
|
+
*/
|
|
24
|
+
function resolveSessionId(data, extensionState = {}, explicitSessionId) {
|
|
25
|
+
// 1. Explicit override
|
|
26
|
+
if (explicitSessionId) {
|
|
27
|
+
return { sessionId: explicitSessionId, source: 'explicit_override' };
|
|
28
|
+
}
|
|
29
|
+
// 2. Explicit env
|
|
30
|
+
const envSessionId = extensionState['AGENT_SESSION_ID'];
|
|
31
|
+
if (envSessionId) {
|
|
32
|
+
return { sessionId: envSessionId, source: 'explicit_env' };
|
|
33
|
+
}
|
|
34
|
+
// 3. Native sessionId from Pi event
|
|
35
|
+
const nativeSessionId = data.sessionId;
|
|
36
|
+
if (typeof nativeSessionId === 'string' && nativeSessionId.length > 0) {
|
|
37
|
+
return { sessionId: nativeSessionId, source: 'native' };
|
|
38
|
+
}
|
|
39
|
+
// 4. PI_SESSION_ID from extension-state
|
|
40
|
+
const piSessionId = extensionState['PI_SESSION_ID'];
|
|
41
|
+
if (piSessionId) {
|
|
42
|
+
return { sessionId: piSessionId, source: 'harness_env' };
|
|
43
|
+
}
|
|
44
|
+
// 5. No session ID available
|
|
45
|
+
return { sessionId: null, source: 'none' };
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=session-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-resolver.js","sourceRoot":"","sources":["../src/session-resolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAcH,4CA8BC;AArCD;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAC9B,IAA6B,EAC7B,iBAAyC,EAAE,EAC3C,iBAA0B;IAE1B,uBAAuB;IACvB,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;IACvE,CAAC;IAED,kBAAkB;IAClB,MAAM,YAAY,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACxD,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IAC7D,CAAC;IAED,oCAAoC;IACpC,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC;IACvC,IAAI,OAAO,eAAe,KAAK,QAAQ,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC1D,CAAC;IAED,wCAAwC;IACxC,MAAM,WAAW,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;IACpD,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;IAC3D,CAAC;IAED,6BAA6B;IAC7B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC7C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@a5c-ai/hooks-mux-adapter-pi",
|
|
3
|
+
"version": "5.0.1-staging.37ca18bd",
|
|
4
|
+
"description": "Pi harness adapter for the hooks-mux system",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/a5c-ai/babysitter.git",
|
|
15
|
+
"directory": "packages/hooks-mux/adapter-pi"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json",
|
|
22
|
+
"clean": "rimraf dist",
|
|
23
|
+
"lint": "eslint \"src/**/*.ts\" --max-warnings=0",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:watch": "vitest"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@a5c-ai/hooks-mux-core": "5.0.1-staging.37ca18bd"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "^5.7.0",
|
|
32
|
+
"vitest": "^3.0.0",
|
|
33
|
+
"rimraf": "^6.0.0"
|
|
34
|
+
}
|
|
35
|
+
}
|