@makaio/client-codex 1.0.0-dev-1795255531146 → 1.0.0-dev-1795406265449

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.
@@ -1,7 +1,7 @@
1
1
  import { codexCapabilityMap, createClientDefinition } from "@makaio/framework/contracts";
2
2
  import { z } from "zod";
3
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
- import { MakaioBus, RequestError } from "@makaio/framework/bus";
4
+ import { RequestError } from "@makaio/framework/bus";
5
5
  import { BaseService } from "@makaio/framework/service-base";
6
6
  import * as fs$1 from "node:fs/promises";
7
7
  import fs, { open } from "node:fs/promises";
@@ -1932,16 +1932,17 @@ function resolveSessionTokenScope(eventName, rawPayload) {
1932
1932
  }
1933
1933
  /**
1934
1934
  * Compose one terminal Codex native hook response.
1935
+ * @param call - Call of the hook-request message being answered.
1935
1936
  * @param registry - Active response contributor registry.
1936
1937
  * @param payload - Normalized native hook payload.
1937
1938
  * @param options - Request deadline, cancellation, diagnostics hooks, and
1938
1939
  * optional session-token sink.
1939
1940
  * @returns The composed native response envelope.
1940
1941
  */
1941
- async function composeCodexHookResponse(registry, payload, options) {
1942
+ async function composeCodexHookResponse(call, registry, payload, options) {
1942
1943
  const snapshot = registry.snapshot(CODEX_CLIENT_ID, CODEX_CONTRACT_ID, payload.eventName, capabilities(payload.eventName));
1943
1944
  if (!snapshot.length) return NOOP_HOOK_HANDLE_RESPONSE;
1944
- const result = await collectContributions(snapshot, CODEX_CLIENT_ID, options?.deadline, options?.signal, payload.eventName, payload.payload, codexProviderContractCatalog);
1945
+ const result = await collectContributions(call, snapshot, CODEX_CLIENT_ID, options?.deadline, options?.signal, payload.eventName, payload.payload, codexProviderContractCatalog);
1945
1946
  if (result.diagnostics.length) options?.onDiagnostics?.(result.diagnostics);
1946
1947
  if (result.closedFailure) return renderCodexNativeResponse(payload.eventName, [{
1947
1948
  clientId: CODEX_CLIENT_ID,
@@ -1965,7 +1966,8 @@ async function composeCodexHookResponse(registry, payload, options) {
1965
1966
  /**
1966
1967
  * Codex client namespace registration.
1967
1968
  *
1968
- * Registers `client:codex` on the singleton bus using the shared
1969
+ * Defines `client:codex` (registered by the extension coordinator through the
1970
+ * runtime manifest's `namespaces`) using the shared
1969
1971
  * {@link createClientNamespace} factory, which pre-registers the raw catch-all
1970
1972
  * hook ingress subject `hook.received` with the canonical
1971
1973
  * {@link RawClientHookPayloadSchema}.
@@ -1987,7 +1989,7 @@ async function composeCodexHookResponse(registry, payload, options) {
1987
1989
  * namespace after the {@link CodexHookNormalizer} maps them.
1988
1990
  * @packageDocumentation
1989
1991
  */
1990
- const { subjects, namespaceDomain } = createClientNamespace("codex", {
1992
+ const { subjects, namespaceDomain, definition } = createClientNamespace("codex", {
1991
1993
  ...CodexConfigSchemas,
1992
1994
  ...CodexWiringSchemas,
1993
1995
  "config.prime": ClientConfigPrimeSchema,
@@ -2024,6 +2026,11 @@ const CodexClientSubjects = subjects;
2024
2026
  * Value: `'client:codex'`
2025
2027
  */
2026
2028
  const CODEX_CLIENT_NAMESPACE = namespaceDomain;
2029
+ /**
2030
+ * Namespace definition for `client:codex`, declared in the runtime manifest's
2031
+ * `namespaces` so the extension coordinator registers it on load.
2032
+ */
2033
+ const CodexClientNamespace = definition;
2027
2034
 
2028
2035
  //#endregion
2029
2036
  //#region src/runtime/native-auth-errors.ts
@@ -3308,7 +3315,7 @@ var CodexClientSessionService = class extends BaseService {
3308
3315
  sessionTokens;
3309
3316
  /**
3310
3317
  * Creates a new Codex client session service.
3311
- * @param bus - Bus instance used for subscribing and emitting events
3318
+ * @param bus - Bus instance used for subscribing and emitting events (required, no process-wide default)
3312
3319
  * @param settings - Optional {@link CodexClientSettings} instance for tests
3313
3320
  * that need exact filesystem paths. Production callers should omit it so
3314
3321
  * the service can resolve the active managed config dir via the bus.
@@ -3326,7 +3333,7 @@ var CodexClientSessionService = class extends BaseService {
3326
3333
  * sees the token value. Codex declares no session-token capability, so
3327
3334
  * this will typically be `undefined`.
3328
3335
  */
3329
- constructor(bus = MakaioBus, settings, machineId, sessionConfigHandler = new CodexSessionConfigHandler(), providerContractRegistry, hookResponseRegistry, sessionTokens) {
3336
+ constructor(bus, settings, machineId, sessionConfigHandler = new CodexSessionConfigHandler(), providerContractRegistry, hookResponseRegistry, sessionTokens) {
3330
3337
  super(bus);
3331
3338
  this.settingsOverride = settings;
3332
3339
  this.machineId = machineId;
@@ -3359,8 +3366,8 @@ var CodexClientSessionService = class extends BaseService {
3359
3366
  this.registerHandler(ClientSubjects.version.changed, ({ payload }) => {
3360
3367
  if (payload.clientId === CLIENT_ID) this.cachedConfigDir = void 0;
3361
3368
  });
3362
- this.registerHandler(CodexClientSubjects.hook.received, async ({ payload }) => {
3363
- await this.handleHookReceived(payload);
3369
+ this.registerHandler(CodexClientSubjects.hook.received, async ({ payload, call }) => {
3370
+ await this.handleHookReceived(call, payload);
3364
3371
  });
3365
3372
  this.registerHookHandleHandler();
3366
3373
  this.registerHandler(CodexClientSubjects.config.hooks.list, async (ctx) => {
@@ -3428,7 +3435,7 @@ var CodexClientSessionService = class extends BaseService {
3428
3435
  });
3429
3436
  return;
3430
3437
  }
3431
- return composeCodexHookResponse(this.hookResponseRegistry, ctx.payload, {
3438
+ return composeCodexHookResponse(ctx.call, this.hookResponseRegistry, ctx.payload, {
3432
3439
  deadline: ctx.deadline,
3433
3440
  signal: ctx.signal,
3434
3441
  onDiagnostics: (diagnostics) => diagnostics.forEach((diagnostic) => console.warn(`[CodexClientSessionService] Hook contributor '${diagnostic.contributorId}': ${diagnostic.message}`)),
@@ -3470,13 +3477,16 @@ var CodexClientSessionService = class extends BaseService {
3470
3477
  }
3471
3478
  /**
3472
3479
  * Resolve the active Codex config dir via `client.resolveBinary`.
3480
+ *
3481
+ * The result is cached and shared by every requester, so the lookup serves no
3482
+ * single caller and sends with the service's own shared-work context.
3473
3483
  * @returns Config directory returned by the binary resolver, or `undefined`
3474
3484
  * when no resolver/global binary is available.
3475
3485
  */
3476
3486
  async doResolveConfigDir() {
3477
3487
  let result;
3478
3488
  try {
3479
- result = await this.bus.requestOptional(ClientSubjects.resolveBinary, { clientId: CLIENT_ID });
3489
+ result = await this.bus.requestOptional(this.bus.own("shared-work"), ClientSubjects.resolveBinary, { clientId: CLIENT_ID });
3480
3490
  } catch (error) {
3481
3491
  if (isResolveBinaryMissingGlobalBinary(error)) return;
3482
3492
  throw error;
@@ -3520,11 +3530,12 @@ var CodexClientSessionService = class extends BaseService {
3520
3530
  * One raw hook may produce multiple normalized events (e.g. `UserPromptSubmit`
3521
3531
  * yields `turn.started` then `userPrompt.submitted`). Events are emitted in
3522
3532
  * the order returned by the normalizer.
3533
+ * @param call - Call context of the `client:codex.hook.received` message; every emission follows it
3523
3534
  * @param raw - Raw hook payload delivered on `client:codex.hook.received`
3524
3535
  */
3525
- async handleHookReceived(raw) {
3536
+ async handleHookReceived(call, raw) {
3526
3537
  const events = normalizeCodexHook(raw, this.machineId);
3527
- await this.observeRootRuntime(raw, events);
3538
+ await this.observeRootRuntime(call, raw, events);
3528
3539
  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.*.`);
3529
3540
  const sharedAdapterSessionId = events[0]?.payload.adapterSessionId;
3530
3541
  const isManagedSession = this.isAdapterManagedSession(sharedAdapterSessionId);
@@ -3534,36 +3545,36 @@ var CodexClientSessionService = class extends BaseService {
3534
3545
  try {
3535
3546
  switch (normalized.subject) {
3536
3547
  case ClientSubjects.session.started:
3537
- await this.bus.emit(ClientSubjects.session.started, await this.enrichForkLineage(normalized.payload));
3548
+ await this.bus.emit(call, ClientSubjects.session.started, await this.enrichForkLineage(normalized.payload));
3538
3549
  break;
3539
3550
  case ClientSubjects.session.userPrompt.submitted:
3540
- await this.bus.emit(ClientSubjects.session.userPrompt.submitted, normalized.payload);
3551
+ await this.bus.emit(call, ClientSubjects.session.userPrompt.submitted, normalized.payload);
3541
3552
  break;
3542
3553
  case ClientSubjects.session.turn.started:
3543
- await this.bus.emit(ClientSubjects.session.turn.started, normalized.payload);
3554
+ await this.bus.emit(call, ClientSubjects.session.turn.started, normalized.payload);
3544
3555
  break;
3545
3556
  case ClientSubjects.session.turn.completed:
3546
- await this.bus.emit(ClientSubjects.session.turn.completed, normalized.payload);
3557
+ await this.bus.emit(call, ClientSubjects.session.turn.completed, normalized.payload);
3547
3558
  break;
3548
3559
  case ClientSubjects.session.tool.pre:
3549
- await this.bus.emit(ClientSubjects.session.tool.pre, normalized.payload);
3560
+ await this.bus.emit(call, ClientSubjects.session.tool.pre, normalized.payload);
3550
3561
  break;
3551
3562
  case ClientSubjects.session.tool.post:
3552
- await this.bus.emit(ClientSubjects.session.tool.post, normalized.payload);
3563
+ await this.bus.emit(call, ClientSubjects.session.tool.post, normalized.payload);
3553
3564
  break;
3554
3565
  case ClientSubjects.session.subagent.started: {
3555
3566
  const { payload: subagentStartedPayload } = normalized;
3556
- await this.bus.emit(ClientSubjects.session.subagent.started, subagentStartedPayload);
3567
+ await this.bus.emit(call, ClientSubjects.session.subagent.started, subagentStartedPayload);
3557
3568
  break;
3558
3569
  }
3559
3570
  case ClientSubjects.session.subagent.completed: {
3560
3571
  const { payload: subagentCompletedPayload } = normalized;
3561
- await this.bus.emit(ClientSubjects.session.subagent.completed, subagentCompletedPayload);
3572
+ await this.bus.emit(call, ClientSubjects.session.subagent.completed, subagentCompletedPayload);
3562
3573
  break;
3563
3574
  }
3564
3575
  case ClientSubjects.session.compaction.pre: {
3565
3576
  const { payload: compactionPrePayload } = normalized;
3566
- await this.bus.emit(ClientSubjects.session.compaction.pre, compactionPrePayload);
3577
+ await this.bus.emit(call, ClientSubjects.session.compaction.pre, compactionPrePayload);
3567
3578
  break;
3568
3579
  }
3569
3580
  default: throwUnhandledNormalizedEvent(normalized);
@@ -3582,17 +3593,18 @@ var CodexClientSessionService = class extends BaseService {
3582
3593
  * Subagent hooks never produce `client.session.started`, so they cannot bind
3583
3594
  * a root runtime. The supervisor correlation key joins observations; it does
3584
3595
  * not grant ownership of an arbitrary native session.
3596
+ * @param call - Call context of the hook message being processed.
3585
3597
  * @param raw - Raw hook payload delivered on `client:codex.hook.received`.
3586
3598
  * @param events - Normalized events derived from the raw hook.
3587
3599
  */
3588
- async observeRootRuntime(raw, events) {
3600
+ async observeRootRuntime(call, raw, events) {
3589
3601
  if (raw.eventName !== "SessionStart") return;
3590
3602
  const supervisorSessionId = pickNonEmptyStringValue(raw.metadata?.supervisorSessionId);
3591
3603
  const rootStart = events.find((event) => event.subject === ClientSubjects.session.started);
3592
3604
  const adapterSessionId = rootStart?.payload.adapterSessionId;
3593
3605
  if (supervisorSessionId === void 0 || rootStart === void 0 || adapterSessionId === void 0) return;
3594
3606
  try {
3595
- if (!(await this.bus.requestOptional(ClientSubjects.runtime.observe, {
3607
+ if (!(await this.bus.requestOptional(call, ClientSubjects.runtime.observe, {
3596
3608
  clientId: CLIENT_ID,
3597
3609
  source: {
3598
3610
  layer: "client-hook",
@@ -3707,4 +3719,4 @@ function isResolveBinaryMissingGlobalBinary(error) {
3707
3719
  }
3708
3720
 
3709
3721
  //#endregion
3710
- export { CodexConfigHooksAddResponseSchema as A, CodexScopeHookRecordSchema as B, createCodexStopBlockEffect as C, CodexWiringSchemas as D, normalizeCodexHook as E, CodexConfigSchemas as F, CODEX_HOOK_RESPONSE_CAPABILITIES as H, CodexHookEntrySchema as I, CodexNativeCommandHookSchema as L, CodexConfigHooksListResponseSchema as M, CodexConfigHooksRemoveRequestSchema as N, AbsolutePathSchema as O, CodexConfigHooksRemoveResponseSchema as P, CodexNativeHookMatcherGroupSchema as R, createCodexSessionStartContextEffect as S, createCodexUserPromptSubmitContextEffect as T, clientDefinition as U, CodexScopeSchema as V, createCodexPreToolUseBlockEffect as _, CODEX_CLIENT_NAMESPACE as a, createCodexPreToolUseUpdateEffect as b, CODEX_CLIENT_ID as c, CODEX_INTERACTION_BLOCKABILITY as d, CODEX_RESPONSE_CAPABILITIES as f, createCodexPostToolUseContextEffect as g, createCodexPostToolUseBlockEffect as h, withCodexNativeAuthSourceLock as i, CodexConfigHooksListRequestSchema as j, CodexConfigHooksAddRequestSchema as k, CODEX_CONTRACT_ID as l, codexProviderContractCatalog as m, buildCodexNativeAuthSourceLockPath as n, CodexClientSubjects as o, CODEX_SUPPORTED_INTERACTIONS as p, executeCodexNativeAuthSourceLock as r, composeCodexHookResponse as s, CodexClientSessionService as t, CODEX_CONTRACT_VERSION as u, createCodexPreToolUseContextEffect as v, createCodexUserPromptSubmitBlockEffect as w, createCodexSessionStartBlockEffect as x, createCodexPreToolUseDenyEffect as y, CodexNativeHooksFileSchema as z };
3722
+ export { CodexConfigHooksAddRequestSchema as A, CodexNativeHooksFileSchema as B, createCodexSessionStartContextEffect as C, normalizeCodexHook as D, createCodexUserPromptSubmitContextEffect as E, CodexConfigHooksRemoveResponseSchema as F, CodexScopeSchema as H, CodexConfigSchemas as I, CodexHookEntrySchema as L, CodexConfigHooksListRequestSchema as M, CodexConfigHooksListResponseSchema as N, CodexWiringSchemas as O, CodexConfigHooksRemoveRequestSchema as P, CodexNativeCommandHookSchema as R, createCodexSessionStartBlockEffect as S, createCodexUserPromptSubmitBlockEffect as T, CODEX_HOOK_RESPONSE_CAPABILITIES as U, CodexScopeHookRecordSchema as V, clientDefinition as W, createCodexPostToolUseContextEffect as _, CODEX_CLIENT_NAMESPACE as a, createCodexPreToolUseDenyEffect as b, composeCodexHookResponse as c, CODEX_CONTRACT_VERSION as d, CODEX_INTERACTION_BLOCKABILITY as f, createCodexPostToolUseBlockEffect as g, codexProviderContractCatalog as h, withCodexNativeAuthSourceLock as i, CodexConfigHooksAddResponseSchema as j, AbsolutePathSchema as k, CODEX_CLIENT_ID as l, CODEX_SUPPORTED_INTERACTIONS as m, buildCodexNativeAuthSourceLockPath as n, CodexClientNamespace as o, CODEX_RESPONSE_CAPABILITIES as p, executeCodexNativeAuthSourceLock as r, CodexClientSubjects as s, CodexClientSessionService as t, CODEX_CONTRACT_ID as u, createCodexPreToolUseBlockEffect as v, createCodexStopBlockEffect as w, createCodexPreToolUseUpdateEffect as x, createCodexPreToolUseContextEffect as y, CodexNativeHookMatcherGroupSchema as z };
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-SDzI8cot.mjs";
2
- import { t as codexPackage } from "./src-D8eg77KO.mjs";
1
+ import { A as CodexConfigHooksAddRequestSchema, B as CodexNativeHooksFileSchema, F as CodexConfigHooksRemoveResponseSchema, H as CodexScopeSchema, I as CodexConfigSchemas, L as CodexHookEntrySchema, M as CodexConfigHooksListRequestSchema, N as CodexConfigHooksListResponseSchema, O as CodexWiringSchemas, P as CodexConfigHooksRemoveRequestSchema, R as CodexNativeCommandHookSchema, V as CodexScopeHookRecordSchema, W as clientDefinition, j as CodexConfigHooksAddResponseSchema, k as AbsolutePathSchema, s as CodexClientSubjects, t as CodexClientSessionService, z as CodexNativeHookMatcherGroupSchema } from "./codex-client-session-service-Lspq_7Kb.mjs";
2
+ import { t as codexPackage } from "./src-i0EhLBOS.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 };
@@ -119,7 +119,7 @@ export declare class CodexClientSessionService extends BaseService {
119
119
  private readonly sessionTokens;
120
120
  /**
121
121
  * Creates a new Codex client session service.
122
- * @param bus - Bus instance used for subscribing and emitting events
122
+ * @param bus - Bus instance used for subscribing and emitting events (required, no process-wide default)
123
123
  * @param settings - Optional {@link CodexClientSettings} instance for tests
124
124
  * that need exact filesystem paths. Production callers should omit it so
125
125
  * the service can resolve the active managed config dir via the bus.
@@ -137,7 +137,7 @@ export declare class CodexClientSessionService extends BaseService {
137
137
  * sees the token value. Codex declares no session-token capability, so
138
138
  * this will typically be `undefined`.
139
139
  */
140
- constructor(bus?: IMakaioBus, settings?: CodexClientSettings, machineId?: string, sessionConfigHandler?: CodexSessionConfigHandler, providerContractRegistry?: ClientHookProviderContractRegistry, hookResponseRegistry?: ClientHookResponseRegistry, sessionTokens?: ClientSessionTokenSink);
140
+ constructor(bus: IMakaioBus, settings?: CodexClientSettings, machineId?: string, sessionConfigHandler?: CodexSessionConfigHandler, providerContractRegistry?: ClientHookProviderContractRegistry, hookResponseRegistry?: ClientHookResponseRegistry, sessionTokens?: ClientSessionTokenSink);
141
141
  /**
142
142
  * Register the raw hook ingress handler, the `hook.handle` request handler,
143
143
  * config management request handlers, wiring management request handlers,
@@ -1,4 +1,5 @@
1
1
  import type { CanonicalEffect, ProviderContributionEnvelope } from '@makaio/framework/contracts/client';
2
+ import type { CallContext } from '@makaio/framework/core';
2
3
  import { type ClientHookHandleResponse, type ClientHookResponseRegistry, type CollectionDiagnostic } from '@makaio/framework/clients';
3
4
  import { type RawClientHookPayload } from './schemas.js';
4
5
  export interface ComposeCodexHookResponseOptions {
@@ -43,10 +44,11 @@ export interface ComposeCodexHookResponseOptions {
43
44
  export declare function renderCodexNativeResponse(eventName: string, effects: readonly (CanonicalEffect | ProviderContributionEnvelope)[]): ClientHookHandleResponse;
44
45
  /**
45
46
  * Compose one terminal Codex native hook response.
47
+ * @param call - Call of the hook-request message being answered.
46
48
  * @param registry - Active response contributor registry.
47
49
  * @param payload - Normalized native hook payload.
48
50
  * @param options - Request deadline, cancellation, diagnostics hooks, and
49
51
  * optional session-token sink.
50
52
  * @returns The composed native response envelope.
51
53
  */
52
- export declare function composeCodexHookResponse(registry: ClientHookResponseRegistry, payload: RawClientHookPayload, options?: ComposeCodexHookResponseOptions): Promise<ClientHookHandleResponse>;
54
+ export declare function composeCodexHookResponse(call: CallContext, registry: ClientHookResponseRegistry, payload: RawClientHookPayload, options?: ComposeCodexHookResponseOptions): Promise<ClientHookHandleResponse>;
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Codex client namespace registration.
3
3
  *
4
- * Registers `client:codex` on the singleton bus using the shared
4
+ * Defines `client:codex` (registered by the extension coordinator through the
5
+ * runtime manifest's `namespaces`) using the shared
5
6
  * {@link createClientNamespace} factory, which pre-registers the raw catch-all
6
7
  * hook ingress subject `hook.received` with the canonical
7
8
  * {@link RawClientHookPayloadSchema}.
@@ -219,3 +220,180 @@ export declare const CodexClientSubjects: import("@makaio/framework/core").BusSu
219
220
  * Value: `'client:codex'`
220
221
  */
221
222
  export declare const CODEX_CLIENT_NAMESPACE: string;
223
+ /**
224
+ * Namespace definition for `client:codex`, declared in the runtime manifest's
225
+ * `namespaces` so the extension coordinator registers it on load.
226
+ */
227
+ export declare const CodexClientNamespace: import("@makaio/framework/core").BusNamespaceDefinition<`client:${string}`, {
228
+ 'hook.received': import("zod").ZodObject<{
229
+ eventName: import("zod").ZodString;
230
+ receivedAt: import("zod").ZodNumber;
231
+ payload: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
232
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
233
+ }, import("zod/v4/core").$strip>;
234
+ 'hook.handle': import("@makaio/framework/core").HostLocalRequestSubjectSchema<{
235
+ request: import("zod").ZodObject<{
236
+ eventName: import("zod").ZodString;
237
+ receivedAt: import("zod").ZodNumber;
238
+ payload: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
239
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
240
+ }, import("zod/v4/core").$strip>;
241
+ response: import("zod").ZodObject<{
242
+ exitCode: import("zod").ZodDefault<import("zod").ZodNumber>;
243
+ stdout: import("zod").ZodDefault<import("zod").ZodString>;
244
+ stderr: import("zod").ZodDefault<import("zod").ZodString>;
245
+ }, import("zod/v4/core").$strip>;
246
+ }>;
247
+ } & {
248
+ 'config.hooks.list': {
249
+ request: import("zod").ZodObject<{
250
+ projectDir: import("zod").ZodOptional<import("zod").ZodString>;
251
+ eventName: import("zod").ZodOptional<import("zod").ZodString>;
252
+ }, import("zod/v4/core").$strip>;
253
+ response: import("zod").ZodObject<{
254
+ effective: import("zod").ZodArray<import("zod").ZodObject<{
255
+ event: import("zod").ZodString;
256
+ matcher: import("zod").ZodOptional<import("zod").ZodString>;
257
+ command: import("zod").ZodString;
258
+ timeout: import("zod").ZodOptional<import("zod").ZodNumber>;
259
+ }, import("zod/v4/core").$strip>>;
260
+ perScope: import("zod").ZodArray<import("zod").ZodObject<{
261
+ scope: import("zod").ZodEnum<{
262
+ global: "global";
263
+ project: "project";
264
+ }>;
265
+ path: import("zod").ZodString;
266
+ writable: import("zod").ZodBoolean;
267
+ hooks: import("zod").ZodArray<import("zod").ZodObject<{
268
+ event: import("zod").ZodString;
269
+ matcher: import("zod").ZodOptional<import("zod").ZodString>;
270
+ command: import("zod").ZodString;
271
+ timeout: import("zod").ZodOptional<import("zod").ZodNumber>;
272
+ }, import("zod/v4/core").$strip>>;
273
+ }, import("zod/v4/core").$strip>>;
274
+ }, import("zod/v4/core").$strip>;
275
+ };
276
+ 'config.hooks.add': {
277
+ request: import("zod").ZodObject<{
278
+ event: import("zod").ZodString;
279
+ matcher: import("zod").ZodOptional<import("zod").ZodString>;
280
+ command: import("zod").ZodString;
281
+ timeout: import("zod").ZodOptional<import("zod").ZodNumber>;
282
+ projectDir: import("zod").ZodOptional<import("zod").ZodString>;
283
+ scope: import("zod").ZodEnum<{
284
+ global: "global";
285
+ project: "project";
286
+ }>;
287
+ }, import("zod/v4/core").$strip>;
288
+ response: import("zod").ZodObject<{
289
+ added: import("zod").ZodBoolean;
290
+ }, import("zod/v4/core").$strip>;
291
+ };
292
+ 'config.hooks.remove': {
293
+ request: import("zod").ZodObject<{
294
+ projectDir: import("zod").ZodOptional<import("zod").ZodString>;
295
+ scope: import("zod").ZodEnum<{
296
+ global: "global";
297
+ project: "project";
298
+ }>;
299
+ event: import("zod").ZodString;
300
+ match: import("zod").ZodObject<{
301
+ commandContains: import("zod").ZodString;
302
+ }, import("zod/v4/core").$strip>;
303
+ }, import("zod/v4/core").$strip>;
304
+ response: import("zod").ZodObject<{
305
+ removed: import("zod").ZodNumber;
306
+ }, import("zod/v4/core").$strip>;
307
+ };
308
+ 'wiring.list': {
309
+ request: import("zod").ZodObject<{
310
+ projectDir: import("zod").ZodOptional<import("zod").ZodString>;
311
+ makaioCommand: import("zod").ZodString;
312
+ }, import("zod/v4/core").$strip>;
313
+ response: import("zod").ZodObject<{
314
+ entries: import("zod").ZodArray<import("zod").ZodObject<{
315
+ group: import("zod").ZodString;
316
+ name: import("zod").ZodString;
317
+ installed: import("zod").ZodBoolean;
318
+ command: import("zod").ZodString;
319
+ }, import("zod/v4/core").$strip>>;
320
+ }, import("zod/v4/core").$strip>;
321
+ };
322
+ 'wiring.apply': {
323
+ request: import("zod").ZodObject<{
324
+ scope: import("zod").ZodEnum<{
325
+ global: "global";
326
+ project: "project";
327
+ }>;
328
+ projectDir: import("zod").ZodOptional<import("zod").ZodString>;
329
+ makaioCommand: import("zod").ZodString;
330
+ }, import("zod/v4/core").$strip>;
331
+ response: import("zod").ZodObject<{
332
+ applied: import("zod").ZodNumber;
333
+ skipped: import("zod").ZodNumber;
334
+ }, import("zod/v4/core").$strip>;
335
+ };
336
+ 'wiring.remove': {
337
+ request: import("zod").ZodObject<{
338
+ scope: import("zod").ZodEnum<{
339
+ global: "global";
340
+ project: "project";
341
+ }>;
342
+ projectDir: import("zod").ZodOptional<import("zod").ZodString>;
343
+ }, import("zod/v4/core").$strip>;
344
+ response: import("zod").ZodObject<{
345
+ removed: import("zod").ZodNumber;
346
+ }, import("zod/v4/core").$strip>;
347
+ };
348
+ 'config.prime': {
349
+ request: import("zod").ZodObject<{
350
+ clientId: import("zod").ZodString;
351
+ configDir: import("zod").ZodString;
352
+ phase: import("zod").ZodEnum<{
353
+ "managed-install": "managed-install";
354
+ "profile-create": "profile-create";
355
+ "session-create": "session-create";
356
+ }>;
357
+ binaryVersion: import("zod").ZodOptional<import("zod").ZodString>;
358
+ adapterName: import("zod").ZodOptional<import("zod").ZodString>;
359
+ projectDir: import("zod").ZodOptional<import("zod").ZodString>;
360
+ }, import("zod/v4/core").$strip>;
361
+ response: import("zod").ZodObject<{
362
+ primed: import("zod").ZodBoolean;
363
+ }, import("zod/v4/core").$strip>;
364
+ };
365
+ 'sessionConfig.setup': {
366
+ request: import("zod").ZodObject<{
367
+ sessionDir: import("zod").ZodString;
368
+ baseConfigDir: import("zod").ZodString;
369
+ projectDir: import("zod").ZodOptional<import("zod").ZodString>;
370
+ platform: import("zod").ZodEnum<{
371
+ darwin: "darwin";
372
+ linux: "linux";
373
+ win32: "win32";
374
+ }>;
375
+ configInheritance: import("zod").ZodEnum<{
376
+ "auth-only": "auth-only";
377
+ empty: "empty";
378
+ full: "full";
379
+ }>;
380
+ }, import("zod/v4/core").$strip>;
381
+ response: import("zod").ZodObject<{
382
+ env: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
383
+ authMaterialized: import("zod").ZodBoolean;
384
+ }, import("zod/v4/core").$strip>;
385
+ };
386
+ 'sessionConfig.destroy': {
387
+ request: import("zod").ZodObject<{
388
+ sessionDir: import("zod").ZodString;
389
+ platform: import("zod").ZodEnum<{
390
+ darwin: "darwin";
391
+ linux: "linux";
392
+ win32: "win32";
393
+ }>;
394
+ }, import("zod/v4/core").$strip>;
395
+ response: import("zod").ZodObject<{
396
+ success: import("zod").ZodBoolean;
397
+ }, import("zod/v4/core").$strip>;
398
+ };
399
+ }>;
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import type { IMakaioBus } from '@makaio/framework/bus';
15
15
  import type { MakaioNodeExtension } from '@makaio/framework/contracts';
16
- export { CodexClientSubjects, CODEX_CLIENT_NAMESPACE } from './namespace.js';
16
+ export { CodexClientSubjects, CodexClientNamespace, CODEX_CLIENT_NAMESPACE } from './namespace.js';
17
17
  export { CodexClientSessionService } from './codex-client-session-service.js';
18
18
  export { normalizeCodexHook } from './hook-normalizer.js';
19
19
  export type { CodexNormalizedEvent, CodexNormalizedSubject } from './hook-normalizer.js';
@@ -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-SDzI8cot.mjs";
1
+ import { C as createCodexSessionStartContextEffect, D as normalizeCodexHook, E as createCodexUserPromptSubmitContextEffect, S as createCodexSessionStartBlockEffect, T as createCodexUserPromptSubmitBlockEffect, U as CODEX_HOOK_RESPONSE_CAPABILITIES, _ as createCodexPostToolUseContextEffect, a as CODEX_CLIENT_NAMESPACE, b as createCodexPreToolUseDenyEffect, c as composeCodexHookResponse, d as CODEX_CONTRACT_VERSION, f as CODEX_INTERACTION_BLOCKABILITY, g as createCodexPostToolUseBlockEffect, h as codexProviderContractCatalog, i as withCodexNativeAuthSourceLock, l as CODEX_CLIENT_ID, m as CODEX_SUPPORTED_INTERACTIONS, n as buildCodexNativeAuthSourceLockPath, o as CodexClientNamespace, p as CODEX_RESPONSE_CAPABILITIES, r as executeCodexNativeAuthSourceLock, s as CodexClientSubjects, t as CodexClientSessionService, u as CODEX_CONTRACT_ID, v as createCodexPreToolUseBlockEffect, w as createCodexStopBlockEffect, x as createCodexPreToolUseUpdateEffect, y as createCodexPreToolUseContextEffect } from "../codex-client-session-service-Lspq_7Kb.mjs";
2
2
  import { dep } from "@makaio/framework/contracts";
3
3
  import { ClientsCoreToken } from "@makaio/framework/clients";
4
4
 
@@ -32,6 +32,7 @@ const codexClientRuntimePackage = {
32
32
  displayName: "Codex Client Runtime",
33
33
  version: "0.1.0",
34
34
  dependencies: [dep("makaio.clients-core")],
35
+ namespaces: [CodexClientNamespace],
35
36
  /**
36
37
  * Create the Codex client session service bound to the runtime bus.
37
38
  *
@@ -49,4 +50,4 @@ const codexClientRuntimePackage = {
49
50
  };
50
51
 
51
52
  //#endregion
52
- export { CODEX_CLIENT_ID, CODEX_CLIENT_NAMESPACE, CODEX_CONTRACT_ID, CODEX_CONTRACT_VERSION, CODEX_HOOK_RESPONSE_CAPABILITIES, CODEX_INTERACTION_BLOCKABILITY, CODEX_RESPONSE_CAPABILITIES, CODEX_SUPPORTED_INTERACTIONS, CodexClientSessionService, CodexClientSubjects, buildCodexNativeAuthSourceLockPath, codexClientRuntimePackage, codexProviderContractCatalog, composeCodexHookResponse, createCodexPostToolUseBlockEffect, createCodexPostToolUseContextEffect, createCodexPreToolUseBlockEffect, createCodexPreToolUseContextEffect, createCodexPreToolUseDenyEffect, createCodexPreToolUseUpdateEffect, createCodexSessionStartBlockEffect, createCodexSessionStartContextEffect, createCodexStopBlockEffect, createCodexUserPromptSubmitBlockEffect, createCodexUserPromptSubmitContextEffect, executeCodexNativeAuthSourceLock, normalizeCodexHook, withCodexNativeAuthSourceLock };
53
+ export { CODEX_CLIENT_ID, CODEX_CLIENT_NAMESPACE, CODEX_CONTRACT_ID, CODEX_CONTRACT_VERSION, CODEX_HOOK_RESPONSE_CAPABILITIES, CODEX_INTERACTION_BLOCKABILITY, CODEX_RESPONSE_CAPABILITIES, CODEX_SUPPORTED_INTERACTIONS, CodexClientNamespace, CodexClientSessionService, CodexClientSubjects, buildCodexNativeAuthSourceLockPath, codexClientRuntimePackage, codexProviderContractCatalog, composeCodexHookResponse, createCodexPostToolUseBlockEffect, createCodexPostToolUseContextEffect, createCodexPreToolUseBlockEffect, createCodexPreToolUseContextEffect, createCodexPreToolUseDenyEffect, createCodexPreToolUseUpdateEffect, createCodexSessionStartBlockEffect, createCodexSessionStartContextEffect, createCodexStopBlockEffect, createCodexUserPromptSubmitBlockEffect, createCodexUserPromptSubmitContextEffect, executeCodexNativeAuthSourceLock, normalizeCodexHook, withCodexNativeAuthSourceLock };
package/dist/server.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as codexPackage } from "./src-D8eg77KO.mjs";
1
+ import { t as codexPackage } from "./src-i0EhLBOS.mjs";
2
2
  import { codexClientRuntimePackage } from "./runtime/package.mjs";
3
3
 
4
4
  //#region src/server.ts
@@ -1,4 +1,4 @@
1
- import { U as clientDefinition } from "./codex-client-session-service-SDzI8cot.mjs";
1
+ import { W as clientDefinition } from "./codex-client-session-service-Lspq_7Kb.mjs";
2
2
 
3
3
  //#region src/package.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makaio/client-codex",
3
- "version": "1.0.0-dev-1795255531146",
3
+ "version": "1.0.0-dev-1795406265449",
4
4
  "type": "module",
5
5
  "main": "dist/index.mjs",
6
6
  "exports": {