@makaio/client-codex 1.0.0-dev-1784806252593 → 1.0.0-dev-1785347612784
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/{codex-client-session-service-CTJ576Q4.mjs → codex-client-session-service-epcEX-w5.mjs} +8 -3
- package/dist/index.mjs +2 -2
- package/dist/runtime/hook-response-composer.d.ts +13 -0
- package/dist/runtime/package.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/{src-DXsdjc9S.mjs → src-BMTPLcPK.mjs} +1 -1
- package/package.json +1 -1
package/dist/{codex-client-session-service-CTJ576Q4.mjs → codex-client-session-service-epcEX-w5.mjs}
RENAMED
|
@@ -1439,11 +1439,16 @@ function renderPreToolUse(collected, blockReason, hookSpecificOutput) {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
/**
|
|
1441
1441
|
* Reduce ordered effects into one provider-valid Codex response.
|
|
1442
|
+
*
|
|
1443
|
+
* The single place that knows what Codex native hook output looks like. Both
|
|
1444
|
+
* the terminal `hook.handle` composer and the evidence-capture probe resolve
|
|
1445
|
+
* their native shape through this function, so a shape proven against the
|
|
1446
|
+
* pinned binary and a shape emitted at runtime cannot drift apart.
|
|
1442
1447
|
* @param eventName - Native Codex hook event name.
|
|
1443
1448
|
* @param effects - Deterministically ordered effects to reduce.
|
|
1444
1449
|
* @returns The terminal native hook response.
|
|
1445
1450
|
*/
|
|
1446
|
-
function
|
|
1451
|
+
function renderCodexNativeResponse(eventName, effects) {
|
|
1447
1452
|
const collected = collectEffects(eventName, effects);
|
|
1448
1453
|
if (collected.updates.length > 1 && collected.updates.some((candidate) => !isDeepStrictEqual(candidate, collected.updates[0]))) throw new Error("Conflicting Codex PreToolUse input.update effects");
|
|
1449
1454
|
const hookSpecificOutput = { hookEventName: eventName };
|
|
@@ -1468,7 +1473,7 @@ async function composeCodexHookResponse(registry, payload, options) {
|
|
|
1468
1473
|
if (!snapshot.length) return NOOP_HOOK_HANDLE_RESPONSE;
|
|
1469
1474
|
const result = await collectContributions(snapshot, CODEX_CLIENT_ID, options?.deadline, options?.signal, payload.eventName, payload.payload, codexProviderContractCatalog);
|
|
1470
1475
|
if (result.diagnostics.length) options?.onDiagnostics?.(result.diagnostics);
|
|
1471
|
-
if (result.closedFailure) return
|
|
1476
|
+
if (result.closedFailure) return renderCodexNativeResponse(payload.eventName, [{
|
|
1472
1477
|
clientId: CODEX_CLIENT_ID,
|
|
1473
1478
|
contractId: CODEX_CONTRACT_ID,
|
|
1474
1479
|
effects: {
|
|
@@ -1476,7 +1481,7 @@ async function composeCodexHookResponse(registry, payload, options) {
|
|
|
1476
1481
|
reason: result.closedFailure.detail
|
|
1477
1482
|
}
|
|
1478
1483
|
}]);
|
|
1479
|
-
return
|
|
1484
|
+
return renderCodexNativeResponse(payload.eventName, result.outcomes.flatMap((outcome) => outcome.effects ?? []));
|
|
1480
1485
|
}
|
|
1481
1486
|
|
|
1482
1487
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as CodexConfigHooksAddResponseSchema, B as CodexScopeHookRecordSchema, D as CodexWiringSchemas, F as CodexConfigSchemas, I as CodexHookEntrySchema, L as CodexNativeCommandHookSchema, M as CodexConfigHooksListResponseSchema, N as CodexConfigHooksRemoveRequestSchema, O as AbsolutePathSchema, P as CodexConfigHooksRemoveResponseSchema, R as CodexNativeHookMatcherGroupSchema, U as clientDefinition, V as CodexScopeSchema, j as CodexConfigHooksListRequestSchema, k as CodexConfigHooksAddRequestSchema, o as CodexClientSubjects, t as CodexClientSessionService, z as CodexNativeHooksFileSchema } from "./codex-client-session-service-
|
|
2
|
-
import { t as codexPackage } from "./src-
|
|
1
|
+
import { A as CodexConfigHooksAddResponseSchema, B as CodexScopeHookRecordSchema, D as CodexWiringSchemas, F as CodexConfigSchemas, I as CodexHookEntrySchema, L as CodexNativeCommandHookSchema, M as CodexConfigHooksListResponseSchema, N as CodexConfigHooksRemoveRequestSchema, O as AbsolutePathSchema, P as CodexConfigHooksRemoveResponseSchema, R as CodexNativeHookMatcherGroupSchema, U as clientDefinition, V as CodexScopeSchema, j as CodexConfigHooksListRequestSchema, k as CodexConfigHooksAddRequestSchema, o as CodexClientSubjects, t as CodexClientSessionService, z as CodexNativeHooksFileSchema } from "./codex-client-session-service-epcEX-w5.mjs";
|
|
2
|
+
import { t as codexPackage } from "./src-BMTPLcPK.mjs";
|
|
3
3
|
|
|
4
4
|
export { AbsolutePathSchema, CodexClientSessionService, CodexClientSubjects, CodexConfigHooksAddRequestSchema, CodexConfigHooksAddResponseSchema, CodexConfigHooksListRequestSchema, CodexConfigHooksListResponseSchema, CodexConfigHooksRemoveRequestSchema, CodexConfigHooksRemoveResponseSchema, CodexConfigSchemas, CodexHookEntrySchema, CodexNativeCommandHookSchema, CodexNativeHookMatcherGroupSchema, CodexNativeHooksFileSchema, CodexScopeHookRecordSchema, CodexScopeSchema, CodexWiringSchemas, clientDefinition, codexPackage };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CanonicalEffect, ProviderContributionEnvelope } from '@makaio/framework/contracts/client';
|
|
1
2
|
import { type ClientHookHandleResponse, type ClientHookResponseRegistry, type CollectionDiagnostic } from '@makaio/framework/clients';
|
|
2
3
|
import { type RawClientHookPayload } from './schemas.js';
|
|
3
4
|
export interface ComposeCodexHookResponseOptions {
|
|
@@ -5,6 +6,18 @@ export interface ComposeCodexHookResponseOptions {
|
|
|
5
6
|
readonly signal?: AbortSignal;
|
|
6
7
|
readonly onDiagnostics?: (diagnostics: readonly CollectionDiagnostic[]) => void;
|
|
7
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Reduce ordered effects into one provider-valid Codex response.
|
|
11
|
+
*
|
|
12
|
+
* The single place that knows what Codex native hook output looks like. Both
|
|
13
|
+
* the terminal `hook.handle` composer and the evidence-capture probe resolve
|
|
14
|
+
* their native shape through this function, so a shape proven against the
|
|
15
|
+
* pinned binary and a shape emitted at runtime cannot drift apart.
|
|
16
|
+
* @param eventName - Native Codex hook event name.
|
|
17
|
+
* @param effects - Deterministically ordered effects to reduce.
|
|
18
|
+
* @returns The terminal native hook response.
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderCodexNativeResponse(eventName: string, effects: readonly (CanonicalEffect | ProviderContributionEnvelope)[]): ClientHookHandleResponse;
|
|
8
21
|
/**
|
|
9
22
|
* Compose one terminal Codex native hook response.
|
|
10
23
|
* @param registry - Active response contributor registry.
|
package/dist/runtime/package.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as createCodexStopBlockEffect, E as normalizeCodexHook, H as CODEX_HOOK_RESPONSE_CAPABILITIES, S as createCodexSessionStartContextEffect, T as createCodexUserPromptSubmitContextEffect, _ as createCodexPreToolUseBlockEffect, a as CODEX_CLIENT_NAMESPACE, b as createCodexPreToolUseUpdateEffect, c as CODEX_CLIENT_ID, d as CODEX_INTERACTION_BLOCKABILITY, f as CODEX_RESPONSE_CAPABILITIES, g as createCodexPostToolUseContextEffect, h as createCodexPostToolUseBlockEffect, i as withCodexNativeAuthSourceLock, l as CODEX_CONTRACT_ID, m as codexProviderContractCatalog, n as buildCodexNativeAuthSourceLockPath, o as CodexClientSubjects, p as CODEX_SUPPORTED_INTERACTIONS, r as executeCodexNativeAuthSourceLock, s as composeCodexHookResponse, t as CodexClientSessionService, u as CODEX_CONTRACT_VERSION, v as createCodexPreToolUseContextEffect, w as createCodexUserPromptSubmitBlockEffect, x as createCodexSessionStartBlockEffect, y as createCodexPreToolUseDenyEffect } from "../codex-client-session-service-
|
|
1
|
+
import { C as createCodexStopBlockEffect, E as normalizeCodexHook, H as CODEX_HOOK_RESPONSE_CAPABILITIES, S as createCodexSessionStartContextEffect, T as createCodexUserPromptSubmitContextEffect, _ as createCodexPreToolUseBlockEffect, a as CODEX_CLIENT_NAMESPACE, b as createCodexPreToolUseUpdateEffect, c as CODEX_CLIENT_ID, d as CODEX_INTERACTION_BLOCKABILITY, f as CODEX_RESPONSE_CAPABILITIES, g as createCodexPostToolUseContextEffect, h as createCodexPostToolUseBlockEffect, i as withCodexNativeAuthSourceLock, l as CODEX_CONTRACT_ID, m as codexProviderContractCatalog, n as buildCodexNativeAuthSourceLockPath, o as CodexClientSubjects, p as CODEX_SUPPORTED_INTERACTIONS, r as executeCodexNativeAuthSourceLock, s as composeCodexHookResponse, t as CodexClientSessionService, u as CODEX_CONTRACT_VERSION, v as createCodexPreToolUseContextEffect, w as createCodexUserPromptSubmitBlockEffect, x as createCodexSessionStartBlockEffect, y as createCodexPreToolUseDenyEffect } from "../codex-client-session-service-epcEX-w5.mjs";
|
|
2
2
|
import { dep } from "@makaio/framework/contracts";
|
|
3
3
|
import { ClientsCoreToken } from "@makaio/framework/clients";
|
|
4
4
|
|
package/dist/server.mjs
CHANGED