@canonmsg/codex-plugin 0.18.9 → 0.18.10

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/host.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { type CanonRuntimeCommandDescriptor } from '@canonmsg/core';
2
+ import { type CanonRuntimeCommandDescriptor, type ExecutionEnvironmentMode } from '@canonmsg/core';
3
3
  import { type CodexSkillMetadata } from './app-server-adapter.js';
4
4
  interface HostSessionState {
5
5
  lastError?: string;
@@ -17,6 +17,21 @@ export declare function buildCodexInitialSessionState(input: {
17
17
  permissionMode?: string;
18
18
  effort?: string | null;
19
19
  }): HostSessionState;
20
+ export declare function buildCodexLiveSessionConfig(input: {
21
+ model?: string;
22
+ permissionMode?: string;
23
+ effort?: string;
24
+ workspaceId?: string | null;
25
+ executionMode: ExecutionEnvironmentMode;
26
+ executionBranch?: string | null;
27
+ }): {
28
+ executionMode: ExecutionEnvironmentMode;
29
+ executionBranch: string | null;
30
+ workspaceId?: string | undefined;
31
+ effort?: string | undefined;
32
+ permissionMode?: string | undefined;
33
+ model?: string | undefined;
34
+ };
20
35
  /** GPT reasoning-effort levels, applied next turn via model_reasoning_effort. */
21
36
  export declare const CODEX_EFFORT_OPTIONS: readonly [{
22
37
  readonly value: "minimal";
@@ -34,6 +49,7 @@ export declare const CODEX_EFFORT_OPTIONS: readonly [{
34
49
  readonly value: "xhigh";
35
50
  readonly label: "Extra high";
36
51
  }];
52
+ export declare const CODEX_SESSION_CONFIG_FIELDS: readonly ["permissionMode", "effort"];
37
53
  export declare function buildCodexSkillCommands(skills: ReadonlyArray<CodexSkillMetadata>): CanonRuntimeCommandDescriptor[];
38
54
  export declare function main(): Promise<void>;
39
55
  export {};
package/dist/host.js CHANGED
@@ -61,6 +61,16 @@ export function buildCodexInitialSessionState(input) {
61
61
  state: 'idle',
62
62
  };
63
63
  }
64
+ export function buildCodexLiveSessionConfig(input) {
65
+ return {
66
+ ...(input.model ? { model: input.model } : {}),
67
+ ...(input.permissionMode ? { permissionMode: input.permissionMode } : {}),
68
+ ...(input.effort ? { effort: input.effort } : {}),
69
+ ...(input.workspaceId ? { workspaceId: input.workspaceId } : {}),
70
+ executionMode: input.executionMode,
71
+ executionBranch: input.executionBranch ?? null,
72
+ };
73
+ }
64
74
  const MAX_SESSIONS = 12;
65
75
  const IDLE_TIMEOUT_MS = 30 * 60 * 1000;
66
76
  const HEARTBEAT_MS = 30_000;
@@ -85,6 +95,7 @@ export const CODEX_EFFORT_OPTIONS = [
85
95
  { value: 'xhigh', label: 'Extra high' },
86
96
  ];
87
97
  const CODEX_EFFORT_VALUES = new Set(CODEX_EFFORT_OPTIONS.map((option) => option.value));
98
+ export const CODEX_SESSION_CONFIG_FIELDS = ['permissionMode', 'effort'];
88
99
  const MAX_CODEX_SKILL_COMMAND_CHOICES = 50;
89
100
  export function buildCodexSkillCommands(skills) {
90
101
  return skills
@@ -224,7 +235,7 @@ async function loadSessionConfig(conversationId, agentId) {
224
235
  return loadHostSessionConfig({
225
236
  conversationId,
226
237
  agentId,
227
- extraStringFields: ['permissionMode', 'effort'],
238
+ extraStringFields: CODEX_SESSION_CONFIG_FIELDS,
228
239
  });
229
240
  }
230
241
  function resolveSessionExecutionMode(config) {
@@ -1872,18 +1883,19 @@ export async function main() {
1872
1883
  runtime: runtimeDescriptor,
1873
1884
  workspaceOptions,
1874
1885
  defaultCwd: workingDir,
1875
- extraSessionConfigFields: ['permissionMode'],
1886
+ extraSessionConfigFields: CODEX_SESSION_CONFIG_FIELDS,
1876
1887
  liveSessionConfigByConversation: new Map(Array.from(sessions.values()).map((session) => {
1877
1888
  const workspaceId = resolveWorkspaceIdForBaseCwd(session.environment.baseCwd);
1878
1889
  return [
1879
1890
  session.conversationId,
1880
- {
1881
- ...(session.state.model ? { model: session.state.model } : {}),
1882
- ...(session.state.permissionMode ? { permissionMode: session.state.permissionMode } : {}),
1883
- ...(workspaceId ? { workspaceId } : {}),
1891
+ buildCodexLiveSessionConfig({
1892
+ model: session.state.model,
1893
+ permissionMode: session.state.permissionMode,
1894
+ effort: session.state.effort,
1895
+ workspaceId,
1884
1896
  executionMode: session.environment.mode,
1885
1897
  executionBranch: session.environment.branch ?? null,
1886
- },
1898
+ }),
1887
1899
  ];
1888
1900
  })),
1889
1901
  }).catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/codex-plugin",
3
- "version": "0.18.9",
3
+ "version": "0.18.10",
4
4
  "description": "Canon host integration for Codex CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",