@canonmsg/codex-plugin 0.11.5 → 0.11.6
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.js +26 -1
- package/package.json +3 -3
package/dist/host.js
CHANGED
|
@@ -4,7 +4,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
4
4
|
import { dirname } from 'node:path';
|
|
5
5
|
import { parseArgs } from 'node:util';
|
|
6
6
|
import { getCodexImagePath, materializeMessageMedia, materializeReplyContextMedia, } from '@canonmsg/agent-sdk';
|
|
7
|
-
import { RUNTIME_NEW_SESSION_ACTION, RUNTIME_STOP_ACTION, RUNTIME_STOP_AND_DROP_ACTION, buildCanonHostPrompt, buildConfiguredWorkspaceOptionsWithRoots, buildFirstPartyCodingRuntimeDescriptor, buildHydratedInboundContext, diffCanonMemberIds, buildPublicWorkspaceRoots, buildPublicWorkspaceOptions, createConversationMetadataLoader, createRuntimeStatePublisher, EXECUTION_ENVIRONMENT_MODES, ExecutionEnvironmentError, CanonClient, CanonStream, DEFAULT_PARTICIPATION_HISTORY_FETCH_LIMIT, DEFAULT_RUNTIME_CAPABILITIES, FINAL_MESSAGE_HANDOFF_MS, getActiveProfileLock, initRTDBAuth, buildLocalRuntimeId, heartbeatLocalRuntimeEntry, loadRuntimeSessionState, markLocalRuntimeStopped, normalizeTurnMetadata, normalizeTurnState, prepareConversationEnvironment, loadHostSessionConfig, releaseConversationEnvironment, resolveCanonAgent, rtdbRead, rtdbWrite, shouldTriggerAgentTurn, saveRuntimeSessionState, publishHostAgentRuntime, publishHostSessionSnapshots, renderCanonHostInboundContent, resolveHostWorkspaceCwd, upsertLocalRuntimeEntry, } from '@canonmsg/core';
|
|
7
|
+
import { RUNTIME_NEW_SESSION_ACTION, RUNTIME_STOP_ACTION, RUNTIME_STOP_AND_DROP_ACTION, buildCanonHostPrompt, buildConfiguredWorkspaceOptionsWithRoots, buildFirstPartyCodingRuntimeDescriptor, buildHydratedInboundContext, diffCanonMemberIds, buildPublicWorkspaceRoots, buildPublicWorkspaceOptions, buildRuntimePresentationPolicy, DEFAULT_FIRST_PARTY_RUNTIME_PRESENTATION, createConversationMetadataLoader, createRuntimeStatePublisher, EXECUTION_ENVIRONMENT_MODES, ExecutionEnvironmentError, CanonClient, CanonStream, DEFAULT_PARTICIPATION_HISTORY_FETCH_LIMIT, DEFAULT_RUNTIME_CAPABILITIES, FINAL_MESSAGE_HANDOFF_MS, getActiveProfileLock, initRTDBAuth, buildLocalRuntimeId, heartbeatLocalRuntimeEntry, loadRuntimeSessionState, markLocalRuntimeStopped, normalizeTurnMetadata, normalizeTurnState, prepareConversationEnvironment, loadHostSessionConfig, releaseConversationEnvironment, resolveCanonAgent, rtdbRead, rtdbWrite, shouldTriggerAgentTurn, saveRuntimeSessionState, publishHostAgentRuntime, publishHostSessionSnapshots, renderCanonHostInboundContent, resolveHostWorkspaceCwd, upsertLocalRuntimeEntry, } from '@canonmsg/core';
|
|
8
8
|
import { buildInboundContextLines, decideAutoReply, } from './inbound-policy.js';
|
|
9
9
|
import { CodexConversationAdapter, } from './adapter.js';
|
|
10
10
|
import { clearStoredThreadId, buildCodexThreadPolicyFingerprint, loadStoredThreadId, saveStoredThreadId, } from './session-store.js';
|
|
@@ -27,6 +27,10 @@ COMMON FLAGS
|
|
|
27
27
|
--full-auto Allow non-interactive write access
|
|
28
28
|
--codex-bin <path> Codex CLI binary to run
|
|
29
29
|
--config <key=value> Forward config to Codex CLI
|
|
30
|
+
--runtime-visibility <normal|minimal|full>
|
|
31
|
+
Detail visibility preset
|
|
32
|
+
--show-runtime-detail <field> Override a hidden detail field
|
|
33
|
+
--hide-runtime-detail <field> Hide a runtime detail field
|
|
30
34
|
--help, -h Show this help
|
|
31
35
|
--version, -V Show package version
|
|
32
36
|
|
|
@@ -83,6 +87,7 @@ function buildCodexRuntimeDescriptor(input) {
|
|
|
83
87
|
executionModes: input.executionModes,
|
|
84
88
|
permissionModes: input.permissionModes,
|
|
85
89
|
defaultPermissionMode: input.defaultPermissionMode,
|
|
90
|
+
presentation: input.presentation,
|
|
86
91
|
streamingTextMode: 'snapshot',
|
|
87
92
|
commands,
|
|
88
93
|
actions: [
|
|
@@ -230,6 +235,14 @@ function sleep(ms) {
|
|
|
230
235
|
function uniqueStrings(values) {
|
|
231
236
|
return Array.from(new Set(values.filter((value) => value.trim().length > 0)));
|
|
232
237
|
}
|
|
238
|
+
function parseRuntimeVisibilityPreset(value) {
|
|
239
|
+
return value === 'normal' || value === 'minimal' || value === 'full' ? value : undefined;
|
|
240
|
+
}
|
|
241
|
+
function stringArgs(value) {
|
|
242
|
+
return Array.isArray(value)
|
|
243
|
+
? value.filter((item) => typeof item === 'string' && item.trim().length > 0)
|
|
244
|
+
: undefined;
|
|
245
|
+
}
|
|
233
246
|
export async function main() {
|
|
234
247
|
setDefaultResultOrder('ipv4first');
|
|
235
248
|
const { values: args } = parseArgs({
|
|
@@ -244,6 +257,9 @@ export async function main() {
|
|
|
244
257
|
'workspace-root': { type: 'string', multiple: true },
|
|
245
258
|
config: { type: 'string', multiple: true },
|
|
246
259
|
'codex-bin': { type: 'string' },
|
|
260
|
+
'runtime-visibility': { type: 'string' },
|
|
261
|
+
'show-runtime-detail': { type: 'string', multiple: true },
|
|
262
|
+
'hide-runtime-detail': { type: 'string', multiple: true },
|
|
247
263
|
'full-auto': { type: 'boolean' },
|
|
248
264
|
'dangerously-bypass-approvals-and-sandbox': { type: 'boolean' },
|
|
249
265
|
},
|
|
@@ -939,6 +955,12 @@ export async function main() {
|
|
|
939
955
|
];
|
|
940
956
|
const codexPermissionEnvelope = deriveCodexPermissionEnvelope(args);
|
|
941
957
|
const codexModelOptions = buildCodexModelOptions(args.model);
|
|
958
|
+
const runtimePresentation = buildRuntimePresentationPolicy({
|
|
959
|
+
base: DEFAULT_FIRST_PARTY_RUNTIME_PRESENTATION,
|
|
960
|
+
preset: parseRuntimeVisibilityPreset(args['runtime-visibility']),
|
|
961
|
+
show: stringArgs(args['show-runtime-detail']),
|
|
962
|
+
hide: stringArgs(args['hide-runtime-detail']),
|
|
963
|
+
});
|
|
942
964
|
let runtimeDescriptor = {
|
|
943
965
|
defaultWorkspaceId: workspaceOptions[0]?.id,
|
|
944
966
|
...(typeof args.model === 'string' ? { defaultModel: args.model } : {}),
|
|
@@ -955,6 +977,7 @@ export async function main() {
|
|
|
955
977
|
executionModes: hostAvailableExecutionModes,
|
|
956
978
|
permissionModes: [...codexPermissionEnvelope.availablePermissionModes],
|
|
957
979
|
defaultPermissionMode: codexPermissionEnvelope.defaultPermissionMode,
|
|
980
|
+
presentation: runtimePresentation,
|
|
958
981
|
}),
|
|
959
982
|
};
|
|
960
983
|
async function baselineControlSignal(conversationId) {
|
|
@@ -1142,6 +1165,7 @@ export async function main() {
|
|
|
1142
1165
|
executionModes: hostAvailableExecutionModes,
|
|
1143
1166
|
permissionModes: [...codexPermissionEnvelope.availablePermissionModes],
|
|
1144
1167
|
defaultPermissionMode: codexPermissionEnvelope.defaultPermissionMode,
|
|
1168
|
+
presentation: runtimePresentation,
|
|
1145
1169
|
}),
|
|
1146
1170
|
};
|
|
1147
1171
|
}
|
|
@@ -1161,6 +1185,7 @@ export async function main() {
|
|
|
1161
1185
|
executionModes: hostAvailableExecutionModes,
|
|
1162
1186
|
permissionModes: [...codexPermissionEnvelope.availablePermissionModes],
|
|
1163
1187
|
defaultPermissionMode: codexPermissionEnvelope.defaultPermissionMode,
|
|
1188
|
+
presentation: runtimePresentation,
|
|
1164
1189
|
}),
|
|
1165
1190
|
};
|
|
1166
1191
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonmsg/codex-plugin",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"description": "Canon host integration for Codex CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"prepack": "npm run build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@canonmsg/agent-sdk": "^1.5.
|
|
33
|
-
"@canonmsg/core": "^0.19.
|
|
32
|
+
"@canonmsg/agent-sdk": "^1.5.1",
|
|
33
|
+
"@canonmsg/core": "^0.19.2"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=18.0.0"
|