@makaio/client-codex 1.0.0-dev-1789642522820 → 1.0.0-dev-1790087128488
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-BrCcbB06.mjs → codex-client-session-service-uk6l5Kri.mjs} +34 -1
- package/dist/index.mjs +2 -2
- package/dist/runtime/codex-client-session-service.d.ts +1 -0
- package/dist/runtime/package.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/{src-D25LSa6Y.mjs → src-CoiDO0ce.mjs} +1 -1
- package/package.json +1 -1
package/dist/{codex-client-session-service-BrCcbB06.mjs → codex-client-session-service-uk6l5Kri.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { codexCapabilityMap, createClientDefinition } from "@makaio/framework/contracts";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { AbsolutePathSchema, BinaryNotFoundError, ClientSubjects, ClientWiringApplyResponseSchema, ClientWiringListResponseSchema, ClientWiringRemoveResponseSchema, DEFAULT_HOOK_HANDLE_TIMEOUT_MS, NOOP_HOOK_HANDLE_RESPONSE, assertAbsoluteProjectDir, atomicModifyFile, buildClientCommand, buildHookCommand, collectContributions, createClientNamespace, deriveSessionEventDescriptors, pickNonEmptyString } from "@makaio/framework/clients";
|
|
3
|
+
import { AbsolutePathSchema, BinaryNotFoundError, ClientSubjects, ClientWiringApplyResponseSchema, ClientWiringListResponseSchema, ClientWiringRemoveResponseSchema, DEFAULT_HOOK_HANDLE_TIMEOUT_MS, NOOP_HOOK_HANDLE_RESPONSE, assertAbsoluteProjectDir, atomicModifyFile, buildClientCommand, buildHookCommand, collectContributions, createClientNamespace, deriveSessionEventDescriptors, pickNonEmptyString, pickNonEmptyStringValue } from "@makaio/framework/clients";
|
|
4
4
|
import { MakaioBus, RequestError } from "@makaio/framework/bus";
|
|
5
5
|
import { BaseService } from "@makaio/framework/service-base";
|
|
6
6
|
import * as fs$1 from "node:fs/promises";
|
|
@@ -3519,6 +3519,7 @@ var CodexClientSessionService = class extends BaseService {
|
|
|
3519
3519
|
*/
|
|
3520
3520
|
async handleHookReceived(raw) {
|
|
3521
3521
|
const events = normalizeCodexHook(raw, this.machineId);
|
|
3522
|
+
await this.observeRootRuntime(raw, events);
|
|
3522
3523
|
if (events.length === 0 && (raw.eventName === "SubagentStart" || raw.eventName === "SubagentStop")) console.warn(`[CodexClientSessionService] ${raw.eventName} hook produced no normalized events — agent_id is likely absent. The hook remains raw-only on client:codex.*.`);
|
|
3523
3524
|
const sharedAdapterSessionId = events[0]?.payload.adapterSessionId;
|
|
3524
3525
|
const isManagedSession = this.isAdapterManagedSession(sharedAdapterSessionId);
|
|
@@ -3570,6 +3571,38 @@ var CodexClientSessionService = class extends BaseService {
|
|
|
3570
3571
|
if (firstError !== void 0) throw firstError;
|
|
3571
3572
|
}
|
|
3572
3573
|
/**
|
|
3574
|
+
* Enrich a supervisor-owned Codex runtime with the native session ID observed
|
|
3575
|
+
* on its root `SessionStart` hook.
|
|
3576
|
+
*
|
|
3577
|
+
* Subagent hooks never produce `client.session.started`, so they cannot bind
|
|
3578
|
+
* a root runtime. The supervisor correlation key joins observations; it does
|
|
3579
|
+
* not grant ownership of an arbitrary native session.
|
|
3580
|
+
* @param raw - Raw hook payload delivered on `client:codex.hook.received`.
|
|
3581
|
+
* @param events - Normalized events derived from the raw hook.
|
|
3582
|
+
*/
|
|
3583
|
+
async observeRootRuntime(raw, events) {
|
|
3584
|
+
if (raw.eventName !== "SessionStart") return;
|
|
3585
|
+
const supervisorSessionId = pickNonEmptyStringValue(raw.metadata?.supervisorSessionId);
|
|
3586
|
+
const rootStart = events.find((event) => event.subject === ClientSubjects.session.started);
|
|
3587
|
+
const adapterSessionId = rootStart?.payload.adapterSessionId;
|
|
3588
|
+
if (supervisorSessionId === void 0 || rootStart === void 0 || adapterSessionId === void 0) return;
|
|
3589
|
+
try {
|
|
3590
|
+
if (!(await this.bus.requestOptional(ClientSubjects.runtime.observe, {
|
|
3591
|
+
clientId: CLIENT_ID,
|
|
3592
|
+
source: {
|
|
3593
|
+
layer: "client-hook",
|
|
3594
|
+
producer: "codex-client-session-service"
|
|
3595
|
+
},
|
|
3596
|
+
observedAt: raw.receivedAt,
|
|
3597
|
+
supervisorSessionId,
|
|
3598
|
+
adapterSessionId,
|
|
3599
|
+
...rootStart.payload.startMode === "clear" && { adapterSessionTransition: "root-clear" }
|
|
3600
|
+
})).handled) console.warn("[CodexClientSessionService] Runtime identity join is unavailable.");
|
|
3601
|
+
} catch {
|
|
3602
|
+
console.warn("[CodexClientSessionService] Runtime identity join is unavailable.");
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
/**
|
|
3573
3606
|
* Determine whether a normalized native hook belongs to an adapter-managed
|
|
3574
3607
|
* session whose global observed-semantics events are already emitted by the
|
|
3575
3608
|
* adapter layer.
|
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-uk6l5Kri.mjs";
|
|
2
|
+
import { t as codexPackage } from "./src-CoiDO0ce.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 };
|
|
@@ -199,6 +199,7 @@ export declare class CodexClientSessionService extends BaseService {
|
|
|
199
199
|
*/
|
|
200
200
|
private handleRuntimeStarted;
|
|
201
201
|
private handleHookReceived;
|
|
202
|
+
private observeRootRuntime;
|
|
202
203
|
/**
|
|
203
204
|
* Determine whether a normalized native hook belongs to an adapter-managed
|
|
204
205
|
* session whose global observed-semantics events are already emitted by the
|
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-uk6l5Kri.mjs";
|
|
2
2
|
import { dep } from "@makaio/framework/contracts";
|
|
3
3
|
import { ClientsCoreToken } from "@makaio/framework/clients";
|
|
4
4
|
|
package/dist/server.mjs
CHANGED