@myagentroam/node 0.9.8 → 0.9.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/capabilities.js +2 -92
- package/dist/claude-agent-sdk.js +2 -330
- package/dist/claude-channel.js +2 -44
- package/dist/codex-app-server.js +2 -503
- package/dist/config.js +2 -56
- package/dist/connector/node-connector-options.js +2 -1
- package/dist/connector/node-operation-router.js +2 -22
- package/dist/connector.js +2 -841
- package/dist/control-outbound-scheduler.js +2 -154
- package/dist/database.js +2 -1418
- package/dist/event-buffer.js +2 -19
- package/dist/fake-runner.js +2 -129
- package/dist/health.js +2 -3
- package/dist/main.js +2 -54
- package/dist/migrations/v001.js +3 -144
- package/dist/migrations/v002.js +2 -143
- package/dist/migrations/v003.js +2 -44
- package/dist/migrations/v004.js +34 -30
- package/dist/native-jsonl-reader.js +2 -186
- package/dist/native-session-history.js +2 -1119
- package/dist/opencode-runtime.js +2 -80
- package/dist/opencode-server.js +2 -263
- package/dist/operational.js +2 -122
- package/dist/process-tree.js +2 -18
- package/dist/rotating-log.js +2 -67
- package/dist/runner/abstract-runner.js +2 -232
- package/dist/runner/claude/managed-run-controller.js +2 -345
- package/dist/runner/claude-code-runner.js +2 -303
- package/dist/runner/codex/composer-image-markers.js +2 -0
- package/dist/runner/codex/conversation-parser.js +2 -861
- package/dist/runner/codex/managed-run-controller.js +2 -460
- package/dist/runner/codex-runner.js +2 -628
- package/dist/runner/fake-test-runner.js +2 -47
- package/dist/runner/opencode/conversation-parser.js +2 -221
- package/dist/runner/opencode/managed-run-controller.js +2 -537
- package/dist/runner/opencode-runner.js +2 -448
- package/dist/runner/runner-registry.js +2 -90
- package/dist/runner-command-engine.js +2 -70
- package/dist/runner-profiles.js +2 -215
- package/dist/runner-usage.js +2 -190
- package/dist/runtime-command-detector.js +2 -73
- package/dist/runtime-state.js +2 -973
- package/dist/service/attachment-domain-state.js +2 -7
- package/dist/service/conversation-history-service.js +2 -457
- package/dist/service/conversation-segment-service.js +2 -162
- package/dist/service/external-session-resume-service.js +2 -118
- package/dist/service/fake-managed-run-service.js +2 -60
- package/dist/service/managed-runner-session-service.js +2 -35
- package/dist/service/mcp-installation-verifier.js +2 -87
- package/dist/service/mcp-node-operation-service.js +2 -90
- package/dist/service/mcp-package-installer.js +2 -136
- package/dist/service/native-session-projection-service.js +2 -280
- package/dist/service/native-session-watch-service.js +2 -383
- package/dist/service/node-connection-lifecycle-service.js +2 -83
- package/dist/service/node-control-channel.js +2 -85
- package/dist/service/node-control-message-service.js +2 -107
- package/dist/service/node-request-service.js +2 -52
- package/dist/service/node-run-event-bridge.js +2 -83
- package/dist/service/node-terminal-channel.js +2 -182
- package/dist/service/node-upgrade-coordinator.js +2 -137
- package/dist/service/node-workspace-coordinator.js +2 -70
- package/dist/service/recent-run-projection-service.js +2 -0
- package/dist/service/run-attachment-service.js +2 -194
- package/dist/service/run-domain-state.js +2 -4
- package/dist/service/run-event-service.js +2 -193
- package/dist/service/run-workbench-service.js +2 -104
- package/dist/service/runner-channel-message-service.js +2 -20
- package/dist/service/runner-interaction-service.js +2 -243
- package/dist/service/runner-service.js +2 -71
- package/dist/service/session-catalog-service.js +2 -224
- package/dist/service/session-command-service.js +2 -76
- package/dist/service/session-context-service.js +2 -101
- package/dist/service/session-domain-state.js +2 -9
- package/dist/service/session-identity-service.js +2 -86
- package/dist/service/session-lifecycle-service.js +2 -240
- package/dist/service/session-message-service.js +2 -173
- package/dist/service/session-presentation-service.js +2 -43
- package/dist/service/session-query-service.js +2 -82
- package/dist/service/skill-directory-service.js +2 -238
- package/dist/service/skill-install-service.js +2 -434
- package/dist/service/skill-node-operation-service.js +2 -206
- package/dist/service/terminal-relay-state.js +2 -3
- package/dist/service/terminal-service.js +2 -52
- package/dist/service/workbench-event-service.js +2 -19
- package/dist/service/workbench-manifest-service.js +2 -69
- package/dist/service/workspace-change-service.js +2 -86
- package/dist/service/workspace-content-search-service.js +2 -477
- package/dist/service/workspace-domain-state.js +2 -41
- package/dist/service/workspace-file-service.js +2 -122
- package/dist/service/workspace-git-exclude-service.js +2 -119
- package/dist/service/workspace-queue-workbench-service.js +2 -304
- package/dist/service/workspace-service.js +2 -69
- package/dist/service/workspace-session-service.js +2 -139
- package/dist/service/workspace-upload-service.js +2 -262
- package/dist/service/workspace-watch-service.js +2 -146
- package/dist/service/workspace-workbench-service.js +2 -405
- package/dist/service.js +2 -38
- package/dist/storage.js +2 -32
- package/dist/supervisor.js +2 -136
- package/dist/terminal.js +2 -416
- package/dist/util/node-operation-parsers.js +2 -382
- package/dist/util/personal-instructions.js +2 -31
- package/dist/util/runner-error.js +2 -52
- package/dist/util/runner-native-session-parsers.js +2 -490
- package/dist/util/safe-error.js +2 -5
- package/dist/util/secret-environment.js +2 -25
- package/dist/workspace.js +2 -1519
- package/package.json +3 -3
- package/dist/capabilities.d.ts +0 -12
- package/dist/claude-agent-sdk.d.ts +0 -92
- package/dist/claude-channel.d.ts +0 -28
- package/dist/codex-app-server.d.ts +0 -133
- package/dist/config.d.ts +0 -18
- package/dist/connector/node-connector-options.d.ts +0 -27
- package/dist/connector/node-operation-router.d.ts +0 -9
- package/dist/connector.d.ts +0 -93
- package/dist/control-outbound-scheduler.d.ts +0 -29
- package/dist/database.d.ts +0 -305
- package/dist/event-buffer.d.ts +0 -9
- package/dist/fake-runner.d.ts +0 -42
- package/dist/health.d.ts +0 -4
- package/dist/main.d.ts +0 -2
- package/dist/migrations/v001.d.ts +0 -3
- package/dist/migrations/v002.d.ts +0 -4
- package/dist/migrations/v003.d.ts +0 -4
- package/dist/migrations/v004.d.ts +0 -4
- package/dist/native-jsonl-reader.d.ts +0 -35
- package/dist/native-session-history.d.ts +0 -126
- package/dist/opencode-runtime.d.ts +0 -33
- package/dist/opencode-server.d.ts +0 -49
- package/dist/operational.d.ts +0 -39
- package/dist/process-tree.d.ts +0 -9
- package/dist/rotating-log.d.ts +0 -17
- package/dist/runner/abstract-runner.d.ts +0 -172
- package/dist/runner/claude/managed-run-controller.d.ts +0 -51
- package/dist/runner/claude-code-runner.d.ts +0 -72
- package/dist/runner/codex/conversation-parser.d.ts +0 -59
- package/dist/runner/codex/managed-run-controller.d.ts +0 -90
- package/dist/runner/codex-runner.d.ts +0 -103
- package/dist/runner/fake-test-runner.d.ts +0 -26
- package/dist/runner/opencode/conversation-parser.d.ts +0 -31
- package/dist/runner/opencode/managed-run-controller.d.ts +0 -82
- package/dist/runner/opencode-runner.d.ts +0 -71
- package/dist/runner/runner-registry.d.ts +0 -19
- package/dist/runner-command-engine.d.ts +0 -28
- package/dist/runner-profiles.d.ts +0 -15
- package/dist/runner-usage.d.ts +0 -33
- package/dist/runtime-command-detector.d.ts +0 -3
- package/dist/runtime-state.d.ts +0 -169
- package/dist/service/attachment-domain-state.d.ts +0 -7
- package/dist/service/conversation-history-service.d.ts +0 -43
- package/dist/service/conversation-segment-service.d.ts +0 -20
- package/dist/service/external-session-resume-service.d.ts +0 -34
- package/dist/service/fake-managed-run-service.d.ts +0 -28
- package/dist/service/managed-runner-session-service.d.ts +0 -12
- package/dist/service/mcp-installation-verifier.d.ts +0 -9
- package/dist/service/mcp-node-operation-service.d.ts +0 -11
- package/dist/service/mcp-package-installer.d.ts +0 -8
- package/dist/service/native-session-projection-service.d.ts +0 -52
- package/dist/service/native-session-watch-service.d.ts +0 -62
- package/dist/service/node-connection-lifecycle-service.d.ts +0 -35
- package/dist/service/node-control-channel.d.ts +0 -32
- package/dist/service/node-control-message-service.d.ts +0 -27
- package/dist/service/node-request-service.d.ts +0 -14
- package/dist/service/node-run-event-bridge.d.ts +0 -40
- package/dist/service/node-terminal-channel.d.ts +0 -29
- package/dist/service/node-upgrade-coordinator.d.ts +0 -29
- package/dist/service/node-workspace-coordinator.d.ts +0 -29
- package/dist/service/run-attachment-service.d.ts +0 -38
- package/dist/service/run-domain-state.d.ts +0 -4
- package/dist/service/run-event-service.d.ts +0 -33
- package/dist/service/run-workbench-service.d.ts +0 -25
- package/dist/service/runner-channel-message-service.d.ts +0 -13
- package/dist/service/runner-interaction-service.d.ts +0 -39
- package/dist/service/runner-service.d.ts +0 -46
- package/dist/service/session-catalog-service.d.ts +0 -45
- package/dist/service/session-command-service.d.ts +0 -24
- package/dist/service/session-context-service.d.ts +0 -35
- package/dist/service/session-domain-state.d.ts +0 -9
- package/dist/service/session-identity-service.d.ts +0 -24
- package/dist/service/session-lifecycle-service.d.ts +0 -31
- package/dist/service/session-message-service.d.ts +0 -33
- package/dist/service/session-presentation-service.d.ts +0 -34
- package/dist/service/session-query-service.d.ts +0 -35
- package/dist/service/skill-directory-service.d.ts +0 -20
- package/dist/service/skill-install-service.d.ts +0 -21
- package/dist/service/skill-node-operation-service.d.ts +0 -44
- package/dist/service/terminal-relay-state.d.ts +0 -6
- package/dist/service/terminal-service.d.ts +0 -12
- package/dist/service/workbench-event-service.d.ts +0 -9
- package/dist/service/workbench-manifest-service.d.ts +0 -90
- package/dist/service/workspace-change-service.d.ts +0 -9
- package/dist/service/workspace-content-search-service.d.ts +0 -14
- package/dist/service/workspace-domain-state.d.ts +0 -79
- package/dist/service/workspace-file-service.d.ts +0 -18
- package/dist/service/workspace-git-exclude-service.d.ts +0 -4
- package/dist/service/workspace-queue-workbench-service.d.ts +0 -86
- package/dist/service/workspace-service.d.ts +0 -15
- package/dist/service/workspace-session-service.d.ts +0 -23
- package/dist/service/workspace-upload-service.d.ts +0 -39
- package/dist/service/workspace-watch-service.d.ts +0 -23
- package/dist/service/workspace-workbench-service.d.ts +0 -58
- package/dist/service.d.ts +0 -4
- package/dist/storage.d.ts +0 -2
- package/dist/supervisor.d.ts +0 -1
- package/dist/terminal.d.ts +0 -133
- package/dist/util/node-operation-parsers.d.ts +0 -92
- package/dist/util/personal-instructions.d.ts +0 -2
- package/dist/util/runner-error.d.ts +0 -6
- package/dist/util/runner-native-session-parsers.d.ts +0 -74
- package/dist/util/safe-error.d.ts +0 -2
- package/dist/util/secret-environment.d.ts +0 -1
- package/dist/workspace.d.ts +0 -217
|
@@ -1,303 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { AbstractRunner } from './abstract-runner.js';
|
|
3
|
-
import { claudeDefaultModel, declaredRunnerProfiles } from '../runner-profiles.js';
|
|
4
|
-
import { withClaudePlanTag } from '../runner-command-engine.js';
|
|
5
|
-
import { discoverNativeSessions, readNativeSession, readClaudeNativeContextUsage } from '../native-session-history.js';
|
|
6
|
-
import { claudeDiscoveredSession, deduplicateDirectSessions, isNativeHistory, isWithinWorkspace, latestNativeActivity } from './codex/conversation-parser.js';
|
|
7
|
-
export class ClaudeCodeRunner extends AbstractRunner {
|
|
8
|
-
client;
|
|
9
|
-
environment;
|
|
10
|
-
name = 'claude-code';
|
|
11
|
-
discoveryScope = 'WORKSPACE_REQUIRED';
|
|
12
|
-
execution = new ClaudeExecutionState();
|
|
13
|
-
constructor(client = new ClaudeAgentSdkAdapter(), environment = process.env) {
|
|
14
|
-
super();
|
|
15
|
-
this.client = client;
|
|
16
|
-
this.environment = environment;
|
|
17
|
-
}
|
|
18
|
-
profile(capabilities) {
|
|
19
|
-
return declaredRunnerProfiles({
|
|
20
|
-
codexAvailable: capabilities.codex.available,
|
|
21
|
-
claudeCodeAvailable: capabilities.claudeCode.available,
|
|
22
|
-
environment: this.environment,
|
|
23
|
-
openCodeAvailable: capabilities.openCode?.available === true
|
|
24
|
-
}).find((profile) => profile.runner === this.name);
|
|
25
|
-
}
|
|
26
|
-
available(capabilities) {
|
|
27
|
-
return capabilities.claudeCode.available;
|
|
28
|
-
}
|
|
29
|
-
profileForValidation() {
|
|
30
|
-
return this.profile({
|
|
31
|
-
platform: 'linux',
|
|
32
|
-
architecture: 'validation',
|
|
33
|
-
nodeAppVersion: 'validation',
|
|
34
|
-
nodeVersion: 'validation',
|
|
35
|
-
codex: { available: false },
|
|
36
|
-
claudeCode: { available: true },
|
|
37
|
-
openCode: { available: false }
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
defaultConfiguration() {
|
|
41
|
-
return {
|
|
42
|
-
runner: this.name,
|
|
43
|
-
model: claudeDefaultModel(this.environment),
|
|
44
|
-
effort: 'medium',
|
|
45
|
-
access: 'default'
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
mcpConfiguration(raw, secrets) {
|
|
49
|
-
const servers = super.mcpConfiguration(raw, secrets);
|
|
50
|
-
return Object.fromEntries(servers.map((server) => [
|
|
51
|
-
server.name,
|
|
52
|
-
server.transport === 'STDIO'
|
|
53
|
-
? {
|
|
54
|
-
type: 'stdio',
|
|
55
|
-
command: server.command,
|
|
56
|
-
args: [...(server.args ?? [])],
|
|
57
|
-
env: { ...(server.environment ?? {}) }
|
|
58
|
-
}
|
|
59
|
-
: { type: 'http', url: server.url, headers: { ...(server.headers ?? {}) } }
|
|
60
|
-
]));
|
|
61
|
-
}
|
|
62
|
-
async resumeExternal(external, context) {
|
|
63
|
-
if (external.runner !== this.name ||
|
|
64
|
-
external.nativeControl !== 'EXTERNAL' ||
|
|
65
|
-
external.externalSessionId === null ||
|
|
66
|
-
!context.available)
|
|
67
|
-
return {
|
|
68
|
-
failureCode: 'RUNNER_UNAVAILABLE',
|
|
69
|
-
messageFailureCode: 'SESSION_RESUME_REJECTED'
|
|
70
|
-
};
|
|
71
|
-
const nativeAlias = context.managedAliasFor(external);
|
|
72
|
-
if (nativeAlias !== undefined)
|
|
73
|
-
return { session: context.ensureConfiguration(nativeAlias), activity: 'IDLE' };
|
|
74
|
-
const existing = context.currentResumed(external.id);
|
|
75
|
-
if (existing !== undefined)
|
|
76
|
-
return { session: context.ensureConfiguration(existing), activity: 'IDLE' };
|
|
77
|
-
try {
|
|
78
|
-
const sessionInfo = await this.sessionInfo(external.externalSessionId, external.cwd);
|
|
79
|
-
if (sessionInfo === undefined)
|
|
80
|
-
return {
|
|
81
|
-
failureCode: 'RUNNER_SESSION_NOT_FOUND',
|
|
82
|
-
messageFailureCode: 'SESSION_RESUME_REJECTED'
|
|
83
|
-
};
|
|
84
|
-
const workspacePath = context.workspacePath(external.workspaceId);
|
|
85
|
-
if (workspacePath === undefined ||
|
|
86
|
-
(typeof sessionInfo.cwd === 'string' && !isWithinWorkspace(sessionInfo.cwd, workspacePath)))
|
|
87
|
-
return {
|
|
88
|
-
failureCode: 'RUNNER_SESSION_WORKSPACE_MISMATCH',
|
|
89
|
-
messageFailureCode: 'SESSION_RESUME_REJECTED'
|
|
90
|
-
};
|
|
91
|
-
const resumed = context.currentResumed(external.id);
|
|
92
|
-
if (resumed !== undefined)
|
|
93
|
-
return { session: context.ensureConfiguration(resumed), activity: 'IDLE' };
|
|
94
|
-
const projection = context.projectionFor(external);
|
|
95
|
-
const session = projection === undefined ? context.create(external) : context.promote(projection.id);
|
|
96
|
-
if (session === undefined)
|
|
97
|
-
return {
|
|
98
|
-
failureCode: 'RUNNER_RESUME_FAILED',
|
|
99
|
-
messageFailureCode: 'SESSION_RESUME_REJECTED'
|
|
100
|
-
};
|
|
101
|
-
const configured = context.ensureConfiguration(session);
|
|
102
|
-
context.rememberManagedNative(external.externalSessionId, configured.id);
|
|
103
|
-
return { session: configured, activity: 'IDLE' };
|
|
104
|
-
}
|
|
105
|
-
catch {
|
|
106
|
-
return {
|
|
107
|
-
failureCode: 'RUNNER_RESUME_FAILED',
|
|
108
|
-
messageFailureCode: 'SESSION_RESUME_REJECTED'
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
async discoverSessions(context, workspace) {
|
|
113
|
-
const sessions = [];
|
|
114
|
-
for (const target of workspace === undefined ? context.workspaces : [workspace]) {
|
|
115
|
-
let official = [];
|
|
116
|
-
try {
|
|
117
|
-
official = await this.listSessions(target.path);
|
|
118
|
-
}
|
|
119
|
-
catch {
|
|
120
|
-
// Native transcripts remain authoritative when SDK listing is unavailable.
|
|
121
|
-
}
|
|
122
|
-
const native = await discoverNativeSessions(this.name, target.path);
|
|
123
|
-
sessions.push(...this.projectDiscoveredSessions(context, target, [
|
|
124
|
-
...official.flatMap((value) => {
|
|
125
|
-
const parsed = claudeDiscoveredSession(value, target.path);
|
|
126
|
-
return parsed === undefined ? [] : [parsed];
|
|
127
|
-
}),
|
|
128
|
-
...native
|
|
129
|
-
]));
|
|
130
|
-
}
|
|
131
|
-
return deduplicateDirectSessions(sessions);
|
|
132
|
-
}
|
|
133
|
-
readContextUsage(session) {
|
|
134
|
-
return session.externalSessionId === null
|
|
135
|
-
? Promise.resolve(undefined)
|
|
136
|
-
: readClaudeNativeContextUsage(session.cwd, session.externalSessionId);
|
|
137
|
-
}
|
|
138
|
-
async readConversationHistory(readers) {
|
|
139
|
-
const native = await readers.native();
|
|
140
|
-
return native === undefined ? undefined : { ...native, source: 'native' };
|
|
141
|
-
}
|
|
142
|
-
forkNative(session, boundary, title) {
|
|
143
|
-
if (session.externalSessionId === null)
|
|
144
|
-
throw new Error('SESSION_REWIND_UNAVAILABLE');
|
|
145
|
-
return boundary === null
|
|
146
|
-
? Promise.resolve(null)
|
|
147
|
-
: this.client.forkSession(session.externalSessionId, session.cwd, boundary, title);
|
|
148
|
-
}
|
|
149
|
-
presentSession(session, capabilities, context) {
|
|
150
|
-
if (capabilities.claudeCode.available && session.nativeControl === 'MAR_MANAGED') {
|
|
151
|
-
const runtimeCapabilities = [
|
|
152
|
-
'history.read',
|
|
153
|
-
'events.live',
|
|
154
|
-
'turn.start',
|
|
155
|
-
'turn.queue',
|
|
156
|
-
'turn.interrupt',
|
|
157
|
-
'run.cancel',
|
|
158
|
-
'approval.respond',
|
|
159
|
-
'session.rename',
|
|
160
|
-
'session.remove',
|
|
161
|
-
'session.pin',
|
|
162
|
-
...(session.externalSessionId === null ? [] : ['session.rewind'])
|
|
163
|
-
];
|
|
164
|
-
return {
|
|
165
|
-
activity: context.managedActive ? 'MANAGED_ACTIVE' : 'IDLE',
|
|
166
|
-
control: {
|
|
167
|
-
level: 'MANAGED',
|
|
168
|
-
capabilities: ['history.read', 'events.live', 'turn.start', 'turn.interrupt']
|
|
169
|
-
},
|
|
170
|
-
commandStates: context.commandStates,
|
|
171
|
-
runtime: { level: 'MANAGED', capabilities: runtimeCapabilities, reasonCode: null }
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
if (capabilities.claudeCode.available && session.externalSessionId !== null) {
|
|
175
|
-
const runtimeCapabilities = [
|
|
176
|
-
'history.read',
|
|
177
|
-
'turn.start',
|
|
178
|
-
'session.rename',
|
|
179
|
-
'session.remove',
|
|
180
|
-
'session.pin',
|
|
181
|
-
'session.rewind'
|
|
182
|
-
];
|
|
183
|
-
return {
|
|
184
|
-
activity: 'IDLE',
|
|
185
|
-
control: { level: 'RESUMABLE', capabilities: ['history.read', 'turn.start'] },
|
|
186
|
-
commandStates: context.commandStates,
|
|
187
|
-
runtime: { level: 'RESUMABLE', capabilities: runtimeCapabilities, reasonCode: null }
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
const runtimeCapabilities = [
|
|
191
|
-
'history.read',
|
|
192
|
-
'events.live',
|
|
193
|
-
'session.rename',
|
|
194
|
-
'session.remove',
|
|
195
|
-
'session.pin'
|
|
196
|
-
];
|
|
197
|
-
return {
|
|
198
|
-
activity: 'UNAVAILABLE',
|
|
199
|
-
control: { level: 'OBSERVE_ONLY', capabilities: ['history.read', 'events.live'] },
|
|
200
|
-
commandStates: context.commandStates,
|
|
201
|
-
runtime: {
|
|
202
|
-
level: 'OBSERVE_ONLY',
|
|
203
|
-
capabilities: runtimeCapabilities,
|
|
204
|
-
reasonCode: 'EXTERNAL_SESSION_OBSERVE_ONLY'
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
prepareMessageInput(input, collaborationMode) {
|
|
209
|
-
return collaborationMode === 'plan' ? withClaudePlanTag(input) : input;
|
|
210
|
-
}
|
|
211
|
-
channelToken(sessionId) {
|
|
212
|
-
return [...this.execution.runs.values()].find((run) => run.marSessionId === sessionId)?.gate
|
|
213
|
-
.token;
|
|
214
|
-
}
|
|
215
|
-
deliverChannel(sessionId, messageId, senderId, token, content, notify) {
|
|
216
|
-
const found = [...this.execution.runs.entries()].find(([, value]) => value.marSessionId === sessionId);
|
|
217
|
-
if (found === undefined)
|
|
218
|
-
return 'REJECTED';
|
|
219
|
-
const [runId, active] = found;
|
|
220
|
-
const prior = active.gate.delivery(messageId);
|
|
221
|
-
const accepted = active.gate.accept({ id: messageId, senderId, token, content });
|
|
222
|
-
if (accepted === 'REJECTED') {
|
|
223
|
-
if (prior === undefined)
|
|
224
|
-
notify(runId, messageId, 'REJECTED');
|
|
225
|
-
return 'REJECTED';
|
|
226
|
-
}
|
|
227
|
-
if (prior === undefined && accepted === 'PENDING_RECEIPT') {
|
|
228
|
-
void active.handle.deliver(content).then(() => notify(runId, messageId, active.gate.acknowledge({ messageId, result: 'STEERED' })), () => notify(runId, messageId, active.gate.acknowledge({ messageId, result: 'REJECTED' })));
|
|
229
|
-
}
|
|
230
|
-
return accepted;
|
|
231
|
-
}
|
|
232
|
-
managedAliasId(nativeSessionId) {
|
|
233
|
-
return this.execution.managedSessionByNativeId.get(nativeSessionId);
|
|
234
|
-
}
|
|
235
|
-
nativeAliasesFor(managedSessionId) {
|
|
236
|
-
return [...this.execution.managedSessionByNativeId]
|
|
237
|
-
.filter(([, sessionId]) => sessionId === managedSessionId)
|
|
238
|
-
.map(([nativeSessionId]) => nativeSessionId);
|
|
239
|
-
}
|
|
240
|
-
forgetNativeAlias(nativeSessionId) {
|
|
241
|
-
this.execution.managedSessionByNativeId.delete(nativeSessionId);
|
|
242
|
-
this.execution.managedNativeIds.delete(nativeSessionId);
|
|
243
|
-
}
|
|
244
|
-
rememberManagedNative(session, nativeSessionId) {
|
|
245
|
-
this.execution.managedNativeIds.add(nativeSessionId);
|
|
246
|
-
this.execution.managedSessionByNativeId.set(nativeSessionId, session.id);
|
|
247
|
-
}
|
|
248
|
-
async readManagedRunnerTitle(session, nativeSessionId) {
|
|
249
|
-
let history = await readNativeSession(this.name, session.cwd, nativeSessionId);
|
|
250
|
-
if (history === undefined) {
|
|
251
|
-
const discovered = await discoverNativeSessions(this.name, session.cwd);
|
|
252
|
-
history = discovered.find((candidate) => candidate.externalSessionId === nativeSessionId);
|
|
253
|
-
}
|
|
254
|
-
return history?.title;
|
|
255
|
-
}
|
|
256
|
-
projectDiscoveredSessions(context, workspace, discovered) {
|
|
257
|
-
const sessions = [];
|
|
258
|
-
for (const item of discovered) {
|
|
259
|
-
if (!isWithinWorkspace(item.cwd, workspace.path))
|
|
260
|
-
continue;
|
|
261
|
-
const session = context.createProjection({
|
|
262
|
-
workspace,
|
|
263
|
-
runner: this.name,
|
|
264
|
-
externalSessionId: item.externalSessionId,
|
|
265
|
-
cwd: item.cwd,
|
|
266
|
-
...(item.title === undefined ? {} : { title: item.title }),
|
|
267
|
-
...(isNativeHistory(item) ? { lastActivityAt: latestNativeActivity(item) } : {})
|
|
268
|
-
});
|
|
269
|
-
const index = sessions.findIndex((candidate) => candidate.id === session.id);
|
|
270
|
-
if (index < 0)
|
|
271
|
-
sessions.push(session);
|
|
272
|
-
else if (session.lastActivityAt >= sessions[index].lastActivityAt) {
|
|
273
|
-
const existing = sessions[index];
|
|
274
|
-
sessions[index] = {
|
|
275
|
-
...session,
|
|
276
|
-
runnerTitle: session.runnerTitle ?? existing.runnerTitle,
|
|
277
|
-
titleSource: session.runnerTitle === null ? existing.titleSource : session.titleSource
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return deduplicateDirectSessions(sessions);
|
|
282
|
-
}
|
|
283
|
-
stop() { }
|
|
284
|
-
start(input) {
|
|
285
|
-
return this.client.start(input);
|
|
286
|
-
}
|
|
287
|
-
startChannel(input) {
|
|
288
|
-
return this.client.startChannel(input);
|
|
289
|
-
}
|
|
290
|
-
listSessions(cwd) {
|
|
291
|
-
return this.client.listSessions(cwd);
|
|
292
|
-
}
|
|
293
|
-
sessionInfo(sessionId, cwd) {
|
|
294
|
-
return this.client.sessionInfo(sessionId, cwd);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
export class ClaudeExecutionState {
|
|
298
|
-
runs = new Map();
|
|
299
|
-
managedNativeIds = new Set();
|
|
300
|
-
managedSessionByNativeId = new Map();
|
|
301
|
-
approvals = new Map();
|
|
302
|
-
userInputs = new Map();
|
|
303
|
-
}
|
|
1
|
+
/* mar-release-protected */
|
|
2
|
+
const _0x2c013c=_0x316f;(function(_0x3a0d51,_0x569a75){const _0x2b3f4b=_0x316f,_0x2b0e69=_0x3a0d51();while(!![]){try{const _0x2beaf5=-parseInt(_0x2b3f4b(0xed))/(0x11b7+-0x9f1+0x297*-0x3)*(parseInt(_0x2b3f4b(0xdb))/(0x1075+0x16f+0x6d*-0x2a))+-parseInt(_0x2b3f4b(0x98))/(0x91a+0x17a+-0xa91*0x1)+-parseInt(_0x2b3f4b(0xc3))/(0x248b+-0x2058+-0x42f)*(parseInt(_0x2b3f4b(0xb0))/(0x1e1d+-0x96e+-0x14aa))+parseInt(_0x2b3f4b(0xc8))/(-0x2f*0x37+-0x1*-0xc33+-0x13*0x1c)+parseInt(_0x2b3f4b(0xec))/(-0x185b*-0x1+0x1*-0x101e+-0x41b*0x2)*(-parseInt(_0x2b3f4b(0xa2))/(0x8*0x76+0x1bd+-0x565))+parseInt(_0x2b3f4b(0x88))/(0x13*0x8d+-0x2*0xc5d+0x5*0x2dc)+parseInt(_0x2b3f4b(0xb8))/(-0x1a79+0x1f7f+-0x4fc);if(_0x2beaf5===_0x569a75)break;else _0x2b0e69['push'](_0x2b0e69['shift']());}catch(_0x58da4a){_0x2b0e69['push'](_0x2b0e69['shift']());}}}(_0x3f01,0xcaad8+0x13*-0xb332+-0xf*-0xae8e));import{ClaudeAgentSdkAdapter}from'../claude-agent-sdk.js';import{AbstractRunner}from'./abstract-runner.js';function _0x3f01(){const _0x3ffaa7=['Cgf0Aa','C2v0','CMvTzw1Izxjnyw5Hz2vKtMf0AxzL','D29YA3nWywnLugf0Aa','DMfSDwvZ','zgvMyxvSDa','D29YA3nWywnLCW','BwfUywDLze5HDgL2zuLKCW','CNvUlMnHBMnLBa','ywrK','y2XPzw50','C3rHCNrdAgfUBMvS','CMvZDw1LrxH0zxjUywW','CNvUCW','mZqWmdiYowTmrxfNsG','mJrruxvpDeq','surmrq','yxjNCW','u0vtu0LptL9srvnvtuvFuKvkrunuruq','zxzLBNrZlMXPDMu','C2vZC2LVBI5YzxDPBMq','C2vZC2LVBI5Yzw5HBwu','zgvSzxrL','BwfW','DgL0BgvtB3vYy2u','zM9YA05HDgL2zq','u1resu8','zxH0zxjUywXtzxnZAw9Uswq','zMXHDe1HCa','tufoquDfrf9bq1rjvKu','ChvZAa','BgLZDfnLC3nPB25Z','C2vZC2LVBKLUzM8','C3rHCNq','CMvZB2X2zq','zw52AxjVBM1LBNq','zgvSAxzLCKnOyw5UzwW','BwfUywDLzefSAwfZrM9Y','zw5ZDxjLq29UzMLNDxjHDgLVBG','AgLZDg9YEs5YzwfK','zgvMyxvSDenVBMzPz3vYyxrPB24','tufoquDfra','BwfUywDLzefJDgL2zq','uLvotKvsx1jfu1vnrv9gquLmruq','zgLZy292zxj5u2nVCgu','rvHurvjoquXFu0vtu0LptL9pqLnfuLzfx09otfK','y29TBwfUza','CgXHBG','DhjHBNnWB3j0','AgvHzgvYCW','DhvYBI5XDwv1zq','zNjVBuvUDhjPzxm','BwfYu2vZC2LVBKLK','mtaWnJiYmdDtt3vRAMS','BMf0AxzLqwXPyxnLC0zVCG','CNvUBMvY','zMLUza','D29YA3nWywnLswq','uevoreLor19srunfsvbu','uLvotKvsx1nfu1njt05Fv09ss1nqqunfx01ju01bveni','BMfTzq','BwfUywDLzefSAwfZswq','C3rKAw8','ChjVAMvJDerPC2nVDMvYzwrtzxnZAw9UCW','zxHLy3v0Aw9U','yxbWCM92ywWUCMvZCg9Uza','Dg9Rzw4','zgLZy292zxjtzxnZAw9UCW','CMvHze1HBMfNzwrsDw5UzxjuAxrSzq','mtq2mJKZmKPVCeTNva','y3vYCMvUDfjLC3vTzwq','BMf0AxzL','uLvotKvsx1nfu1njt05FtK9ux0zpvu5e','C3rYAw5N','BwfUywDLzfnLC3nPB25cEu5HDgL2zuLK','uKvkrunuruq','BwvKAxvT','zM9Yz2v0tMf0AxzLqwXPyxm','y3jLyxrL','oerhEhrovG','zMLUzeLUzgv4','tufsx01btKfhruq','zgvSAxzLCNK','DMfSAwrHDgLVBG','v09ss1nqqunfx1jfuvvjuKve','CMvHzenVBNrLEhrvC2fNzq','y3jLyxrLuhjVAMvJDgLVBG','vu5bvKfjtefcteu','u0vtu0LptL9srvDjtKrFvu5bvKfjtefcteu','CNvUBMvYvgL0Bgu','yxzHAwXHyMXL','zgvSAxzLCG','ChjVzMLSzuzVCLzHBgLKyxrPB24','mJi0ntuXnuf3yuLkyG','DxnLCKLUChv0CW','y2XHDwrLlwnVzgu','y2XHDwrLq29Kzq','yxbWCM92ywXZ','u1rfrvjfra','C2vZC2LVBI5Yzw1VDMu','uLvotKvsx1voqvzbsuXbqKXf','nJCYmZC1mhfosLvowq','y2HHBM5LBfrVA2vU','ywnJzxb0','rvHurvjoquW','DhvYBI5ZDgfYDa','z2f0zq','ChjLC2vUDfnLC3nPB24','zM9YA1nLC3nPB24','uKvtvu1bqKXf','C2vZC2LVBI5WAw4','BgfZDefJDgL2Axr5qxq','og9dAKXAsG','BwnWq29UzMLNDxjHDgLVBG','DhvYBI5PBNrLCNj1Chq','BgLUDxG','y29KzxG','ndm3mdaZnhfIzvHNAa','ChjVBw90zq','DxjS','CMvHzenVBNzLCNnHDgLVBKHPC3rVCNK','ywnRBM93BgvKz2u','zw50CMLLCW','z2v0','B3bLBKnVzgu','t0jtrvjwrv9ptKXz','y29TBwfUzfn0yxrLCW','AgfUzgXL','DgHLBG','zMLSDgvY','ChjVzMLSzq','ChjVAMvJDgLVBKzVCG','C3rVCa','BMf0AxzLq29UDhjVBa','ChjLCgfYzu1LC3nHz2vjBNb1Da','Ahr0Ca','mtuYngPJzKf0CG','DgL0Bgu','y3DK'];_0x3f01=function(){return _0x3ffaa7;};return _0x3f01();}import{claudeDefaultModel,declaredRunnerProfiles}from'../runner-profiles.js';import{withClaudePlanTag}from'../runner-command-engine.js';import{discoverNativeSessions,readNativeSession,readClaudeNativeContextUsage}from'../native-session-history.js';function _0x316f(_0x125f29,_0x1add1f){_0x125f29=_0x125f29-(0x1*-0x18e0+-0x124f+0x2b9b);const _0x450986=_0x3f01();let _0x21ea41=_0x450986[_0x125f29];if(_0x316f['ZXSzma']===undefined){var _0x1121e4=function(_0x1d33bf){const _0xda350c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4b4ca8='',_0x1d4627='';for(let _0x5a1279=0x1998+-0x789+-0x120f,_0x58e878,_0x1f6a9e,_0x8dba81=-0x2*-0x96d+-0xe95*0x1+-0x445*0x1;_0x1f6a9e=_0x1d33bf['charAt'](_0x8dba81++);~_0x1f6a9e&&(_0x58e878=_0x5a1279%(0xd4d*0x2+-0x68*-0x45+-0x2*0x1b4f)?_0x58e878*(-0x64d*-0x5+0x920+-0x2861*0x1)+_0x1f6a9e:_0x1f6a9e,_0x5a1279++%(-0x191a+-0x1*0x26ef+0x400d))?_0x4b4ca8+=String['fromCharCode'](-0x1831+0x21a3+0x135*-0x7&_0x58e878>>(-(-0xe65+0x105*0x7+0x744)*_0x5a1279&0x230f*-0x1+0x1364+0xfb1)):-0x1*0x10ff+-0x14d0+0x25cf){_0x1f6a9e=_0xda350c['indexOf'](_0x1f6a9e);}for(let _0x2ff3a6=0x19d+-0x1*0x16+0x11*-0x17,_0x2afc2c=_0x4b4ca8['length'];_0x2ff3a6<_0x2afc2c;_0x2ff3a6++){_0x1d4627+='%'+('00'+_0x4b4ca8['charCodeAt'](_0x2ff3a6)['toString'](-0x869*0x2+-0x38f*-0x7+0x2ad*-0x3))['slice'](-(0xe7d+-0x32a+-0x1*0xb51));}return decodeURIComponent(_0x1d4627);};_0x316f['BYSzjd']=_0x1121e4,_0x316f['PzksAf']={},_0x316f['ZXSzma']=!![];}const _0x380b07=_0x450986[0x1*0x12b2+0x2*0xc5e+-0x2b6e*0x1];_0x316f['jGUSbI']!==_0x380b07&&(_0x316f['PzksAf']={},_0x316f['jGUSbI']=_0x380b07);const _0x2efec6=_0x316f['PzksAf'][_0x125f29];return _0x2efec6===undefined?(_0x21ea41=_0x316f['BYSzjd'](_0x21ea41),_0x316f['PzksAf'][_0x125f29]=_0x21ea41):_0x21ea41=_0x2efec6,_0x21ea41;}import{claudeDiscoveredSession,deduplicateDirectSessions,isNativeHistory,isWithinWorkspace,latestNativeActivity}from'./codex/conversation-parser.js';export class ClaudeCodeRunner extends AbstractRunner{[_0x2c013c(0xe8)];[_0x2c013c(0x76)];[_0x2c013c(0x8f)]=_0x2c013c(0xb2);[_0x2c013c(0x7f)]=_0x2c013c(0xa7);[_0x2c013c(0x93)]=new ClaudeExecutionState();constructor(_0x360393=new ClaudeAgentSdkAdapter(),_0x131934=process.env){const _0x2ccc95=_0x2c013c;super(),this[_0x2ccc95(0xe8)]=_0x360393,this[_0x2ccc95(0x76)]=_0x131934;}[_0x2c013c(0xd5)](_0x502881){const _0x34bc69=_0x2c013c;return declaredRunnerProfiles({'codexAvailable':_0x502881[_0x34bc69(0xc7)][_0x34bc69(0xad)],'claudeCodeAvailable':_0x502881[_0x34bc69(0xb3)][_0x34bc69(0xad)],'environment':this[_0x34bc69(0x76)],'openCodeAvailable':_0x502881[_0x34bc69(0xcf)]?.[_0x34bc69(0xad)]===!![]})[_0x34bc69(0x8b)](_0x51e6b5=>_0x51e6b5[_0x34bc69(0x8a)]===this[_0x34bc69(0x8f)]);}[_0x2c013c(0xad)](_0x42a785){const _0x414f1d=_0x2c013c;return _0x42a785[_0x414f1d(0xb3)][_0x414f1d(0xad)];}[_0x2c013c(0xaf)](){const _0x3a2c75=_0x2c013c;return this[_0x3a2c75(0xd5)]({'platform':_0x3a2c75(0xc6),'architecture':_0x3a2c75(0xa6),'nodeAppVersion':_0x3a2c75(0xa6),'nodeVersion':_0x3a2c75(0xa6),'codex':{'available':![]},'claudeCode':{'available':!![]},'openCode':{'available':![]}});}[_0x2c013c(0x7b)](){const _0x4da7ce=_0x2c013c;return{'runner':this[_0x4da7ce(0x8f)],'model':claudeDefaultModel(this[_0x4da7ce(0x76)]),'effort':_0x4da7ce(0x9f),'access':_0x4da7ce(0xe3)};}[_0x2c013c(0xc4)](_0x5bbe0f,_0x351ed1){const _0x400e5d=_0x2c013c,_0x164cbd=super[_0x400e5d(0xc4)](_0x5bbe0f,_0x351ed1);return Object[_0x400e5d(0x86)](_0x164cbd[_0x400e5d(0xf5)](_0x5b363f=>[_0x5b363f[_0x400e5d(0x8f)],_0x5b363f[_0x400e5d(0x83)]===_0x400e5d(0x6d)?{'type':_0x400e5d(0x91),'command':_0x5b363f[_0x400e5d(0x81)],'args':[..._0x5b363f[_0x400e5d(0xef)]??[]],'env':{..._0x5b363f[_0x400e5d(0x76)]??{}}}:{'type':_0x400e5d(0xda),'url':_0x5b363f[_0x400e5d(0xca)],'headers':{..._0x5b363f[_0x400e5d(0x84)]??{}}}]));}async[_0x2c013c(0xea)](_0x211f5a,_0x562353){const _0x68c381=_0x2c013c;if(_0x211f5a[_0x68c381(0x8a)]!==this[_0x68c381(0x8f)]||_0x211f5a[_0x68c381(0xd8)]!==_0x68c381(0xbb)||_0x211f5a[_0x68c381(0x6e)]===null||!_0x562353[_0x68c381(0xad)])return{'failureCode':_0x68c381(0xb7),'messageFailureCode':_0x68c381(0xf0)};const _0x3ad349=_0x562353[_0x68c381(0x78)](_0x211f5a);if(_0x3ad349!==undefined)return{'session':_0x562353[_0x68c381(0x79)](_0x3ad349),'activity':_0x68c381(0xee)};const _0x331e11=_0x562353[_0x68c381(0x99)](_0x211f5a['id']);if(_0x331e11!==undefined)return{'session':_0x562353[_0x68c381(0x79)](_0x331e11),'activity':_0x68c381(0xee)};try{const _0x10dc92=await this[_0x68c381(0x73)](_0x211f5a[_0x68c381(0x6e)],_0x211f5a[_0x68c381(0xdd)]);if(_0x10dc92===undefined)return{'failureCode':_0x68c381(0x9b),'messageFailureCode':_0x68c381(0xf0)};const _0x17cc01=_0x562353[_0x68c381(0xe1)](_0x211f5a[_0x68c381(0x8c)]);if(_0x17cc01===undefined||typeof _0x10dc92[_0x68c381(0xdd)]===_0x68c381(0x9c)&&!isWithinWorkspace(_0x10dc92[_0x68c381(0xdd)],_0x17cc01))return{'failureCode':_0x68c381(0x8e),'messageFailureCode':_0x68c381(0xf0)};const _0x5e0edb=_0x562353[_0x68c381(0x99)](_0x211f5a['id']);if(_0x5e0edb!==undefined)return{'session':_0x562353[_0x68c381(0x79)](_0x5e0edb),'activity':_0x68c381(0xee)};const _0xbdd009=_0x562353[_0x68c381(0xd6)](_0x211f5a),_0x110daa=_0xbdd009===undefined?_0x562353[_0x68c381(0xa1)](_0x211f5a):_0x562353[_0x68c381(0xc9)](_0xbdd009['id']);if(_0x110daa===undefined)return{'failureCode':_0x68c381(0x7e),'messageFailureCode':_0x68c381(0xf0)};const _0x2bbdb=_0x562353[_0x68c381(0x79)](_0x110daa);return _0x562353[_0x68c381(0xe0)](_0x211f5a[_0x68c381(0x6e)],_0x2bbdb['id']),{'session':_0x2bbdb,'activity':_0x68c381(0xee)};}catch{return{'failureCode':_0x68c381(0x7e),'messageFailureCode':_0x68c381(0xf0)};}}async[_0x2c013c(0x96)](_0x1a250d,_0x3eee13){const _0x48258a=_0x2c013c,_0x1ffd94=[];for(const _0x22fc4a of _0x3eee13===undefined?_0x1a250d[_0x48258a(0xe4)]:[_0x3eee13]){let _0x12293d=[];try{_0x12293d=await this[_0x48258a(0x72)](_0x22fc4a[_0x48258a(0xde)]);}catch{}const _0x58bd93=await discoverNativeSessions(this[_0x48258a(0x8f)],_0x22fc4a[_0x48258a(0xde)]);_0x1ffd94[_0x48258a(0x71)](...this[_0x48258a(0x92)](_0x1a250d,_0x22fc4a,[..._0x12293d[_0x48258a(0x6f)](_0x2c0bbb=>{const _0xad20fe=_0x48258a,_0xcb78d4=claudeDiscoveredSession(_0x2c0bbb,_0x22fc4a[_0xad20fe(0xde)]);return _0xcb78d4===undefined?[]:[_0xcb78d4];}),..._0x58bd93]));}return deduplicateDirectSessions(_0x1ffd94);}[_0x2c013c(0xa8)](_0x5280d4){const _0x261ac1=_0x2c013c;return _0x5280d4[_0x261ac1(0x6e)]===null?Promise[_0x261ac1(0x75)](undefined):readClaudeNativeContextUsage(_0x5280d4[_0x261ac1(0xdd)],_0x5280d4[_0x261ac1(0x6e)]);}async[_0x2c013c(0xcb)](_0x51e5dd){const _0x5b3a08=_0x2c013c,_0x1e1e46=await _0x51e5dd[_0x5b3a08(0x9a)]();return _0x1e1e46===undefined?undefined:{..._0x1e1e46,'source':_0x5b3a08(0x9a)};}[_0x2c013c(0x6c)](_0x386596,_0x2c8093,_0x5b6680){const _0x38788f=_0x2c013c;if(_0x386596[_0x38788f(0x6e)]===null)throw new Error(_0x38788f(0xab));return _0x2c8093===null?Promise[_0x38788f(0x75)](null):this[_0x38788f(0xe8)][_0x38788f(0xbf)](_0x386596[_0x38788f(0x6e)],_0x386596[_0x38788f(0xdd)],_0x2c8093,_0x5b6680);}[_0x2c013c(0xbe)](_0x5739a6,_0x1c2d88,_0x4e59f6){const _0x596725=_0x2c013c;if(_0x1c2d88[_0x596725(0xb3)][_0x596725(0xad)]&&_0x5739a6[_0x596725(0xd8)]===_0x596725(0xa4)){const _0x3fee13=[_0x596725(0x7a),_0x596725(0xf1),_0x596725(0xbc),_0x596725(0x85),_0x596725(0xc5),_0x596725(0xe6),_0x596725(0x94),_0x596725(0xf3),_0x596725(0xb6),_0x596725(0xc1),..._0x5739a6[_0x596725(0x6e)]===null?[]:[_0x596725(0xf2)]];return{'activity':_0x4e59f6[_0x596725(0x7d)]?_0x596725(0x70):_0x596725(0xee),'control':{'level':_0x596725(0x7c),'capabilities':[_0x596725(0x7a),_0x596725(0xf1),_0x596725(0xbc),_0x596725(0xc5)]},'commandStates':_0x4e59f6[_0x596725(0xd1)],'runtime':{'level':_0x596725(0x7c),'capabilities':_0x3fee13,'reasonCode':null}};}if(_0x1c2d88[_0x596725(0xb3)][_0x596725(0xad)]&&_0x5739a6[_0x596725(0x6e)]!==null){const _0x58a259=[_0x596725(0x7a),_0x596725(0xbc),_0x596725(0xf3),_0x596725(0xb6),_0x596725(0xc1),_0x596725(0xf2)];return{'activity':_0x596725(0xee),'control':{'level':_0x596725(0xc0),'capabilities':[_0x596725(0x7a),_0x596725(0xbc)]},'commandStates':_0x4e59f6[_0x596725(0xd1)],'runtime':{'level':_0x596725(0xc0),'capabilities':_0x58a259,'reasonCode':null}};}const _0x475aa4=[_0x596725(0x7a),_0x596725(0xf1),_0x596725(0xf3),_0x596725(0xb6),_0x596725(0xc1)];return{'activity':_0x596725(0xaa),'control':{'level':_0x596725(0xd0),'capabilities':[_0x596725(0x7a),_0x596725(0xf1)]},'commandStates':_0x4e59f6[_0x596725(0xd1)],'runtime':{'level':_0x596725(0xd0),'capabilities':_0x475aa4,'reasonCode':_0x596725(0x80)}};}[_0x2c013c(0xd9)](_0x1cdde9,_0x7cc2f0){const _0x413ef9=_0x2c013c;return _0x7cc2f0===_0x413ef9(0x82)?withClaudePlanTag(_0x1cdde9):_0x1cdde9;}[_0x2c013c(0xb9)](_0x1af215){const _0x26dfc0=_0x2c013c;return[...this[_0x26dfc0(0x93)][_0x26dfc0(0xeb)][_0x26dfc0(0xe2)]()][_0x26dfc0(0x8b)](_0x16490d=>_0x16490d[_0x26dfc0(0x87)]===_0x1af215)?.[_0x26dfc0(0xbd)][_0x26dfc0(0x95)];}[_0x2c013c(0x77)](_0x50925f,_0x299967,_0x10f7d4,_0xae0bfa,_0x31a847,_0x2f95cc){const _0x326f86=_0x2c013c,_0xe4ab01=[...this[_0x326f86(0x93)][_0x326f86(0xeb)][_0x326f86(0xcd)]()][_0x326f86(0x8b)](([,_0x1b281c])=>_0x1b281c[_0x326f86(0x87)]===_0x50925f);if(_0xe4ab01===undefined)return _0x326f86(0x9e);const [_0x5993f3,_0x29f113]=_0xe4ab01,_0x39725c=_0x29f113[_0x326f86(0xbd)][_0x326f86(0xa5)](_0x299967),_0x4126da=_0x29f113[_0x326f86(0xbd)][_0x326f86(0xba)]({'id':_0x299967,'senderId':_0x10f7d4,'token':_0xae0bfa,'content':_0x31a847});if(_0x4126da===_0x326f86(0x9e)){if(_0x39725c===undefined)_0x2f95cc(_0x5993f3,_0x299967,_0x326f86(0x9e));return _0x326f86(0x9e);}return _0x39725c===undefined&&_0x4126da===_0x326f86(0x8d)&&void _0x29f113[_0x326f86(0xd2)][_0x326f86(0xae)](_0x31a847)[_0x326f86(0xd3)](()=>_0x2f95cc(_0x5993f3,_0x299967,_0x29f113[_0x326f86(0xbd)][_0x326f86(0xcc)]({'messageId':_0x299967,'result':_0x326f86(0xb5)})),()=>_0x2f95cc(_0x5993f3,_0x299967,_0x29f113[_0x326f86(0xbd)][_0x326f86(0xcc)]({'messageId':_0x299967,'result':_0x326f86(0x9e)}))),_0x4126da;}[_0x2c013c(0x90)](_0x4e178a){const _0x4b39d2=_0x2c013c;return this[_0x4b39d2(0x93)][_0x4b39d2(0x9d)][_0x4b39d2(0xce)](_0x4e178a);}[_0x2c013c(0x89)](_0x4d1e17){const _0x2daae1=_0x2c013c;return[...this[_0x2daae1(0x93)][_0x2daae1(0x9d)]][_0x2daae1(0xd4)](([,_0x115a3d])=>_0x115a3d===_0x4d1e17)[_0x2daae1(0xf5)](([_0x4000f2])=>_0x4000f2);}[_0x2c013c(0xa0)](_0x17cce6){const _0x66f5d7=_0x2c013c;this[_0x66f5d7(0x93)][_0x66f5d7(0x9d)][_0x66f5d7(0xf4)](_0x17cce6),this[_0x66f5d7(0x93)][_0x66f5d7(0xe5)][_0x66f5d7(0xf4)](_0x17cce6);}[_0x2c013c(0xe0)](_0x5ea34e,_0x58da6d){const _0x55bf02=_0x2c013c;this[_0x55bf02(0x93)][_0x55bf02(0xe5)][_0x55bf02(0xe7)](_0x58da6d),this[_0x55bf02(0x93)][_0x55bf02(0x9d)][_0x55bf02(0xdf)](_0x58da6d,_0x5ea34e['id']);}async[_0x2c013c(0x97)](_0x415fac,_0x2bd389){const _0x4030fa=_0x2c013c;let _0x2bd55a=await readNativeSession(this[_0x4030fa(0x8f)],_0x415fac[_0x4030fa(0xdd)],_0x2bd389);if(_0x2bd55a===undefined){const _0x1483a5=await discoverNativeSessions(this[_0x4030fa(0x8f)],_0x415fac[_0x4030fa(0xdd)]);_0x2bd55a=_0x1483a5[_0x4030fa(0x8b)](_0x314d85=>_0x314d85[_0x4030fa(0x6e)]===_0x2bd389);}return _0x2bd55a?.[_0x4030fa(0xdc)];}[_0x2c013c(0x92)](_0x283335,_0x4681ce,_0x4de076){const _0x2757cd=_0x2c013c,_0x5a1626=[];for(const _0x37f9c5 of _0x4de076){if(!isWithinWorkspace(_0x37f9c5[_0x2757cd(0xdd)],_0x4681ce[_0x2757cd(0xde)]))continue;const _0x5e9ac5=_0x283335[_0x2757cd(0xa9)]({'workspace':_0x4681ce,'runner':this[_0x2757cd(0x8f)],'externalSessionId':_0x37f9c5[_0x2757cd(0x6e)],'cwd':_0x37f9c5[_0x2757cd(0xdd)],..._0x37f9c5[_0x2757cd(0xdc)]===undefined?{}:{'title':_0x37f9c5[_0x2757cd(0xdc)]},...isNativeHistory(_0x37f9c5)?{'lastActivityAt':latestNativeActivity(_0x37f9c5)}:{}}),_0x3d1df9=_0x5a1626[_0x2757cd(0xa3)](_0x442eae=>_0x442eae['id']===_0x5e9ac5['id']);if(_0x3d1df9<-0x1c01+-0x2*-0x96d+-0xd5*-0xb)_0x5a1626[_0x2757cd(0x71)](_0x5e9ac5);else{if(_0x5e9ac5[_0x2757cd(0xc2)]>=_0x5a1626[_0x3d1df9][_0x2757cd(0xc2)]){const _0x2fb59b=_0x5a1626[_0x3d1df9];_0x5a1626[_0x3d1df9]={..._0x5e9ac5,'runnerTitle':_0x5e9ac5[_0x2757cd(0xac)]??_0x2fb59b[_0x2757cd(0xac)],'titleSource':_0x5e9ac5[_0x2757cd(0xac)]===null?_0x2fb59b[_0x2757cd(0xf6)]:_0x5e9ac5[_0x2757cd(0xf6)]};}}}return deduplicateDirectSessions(_0x5a1626);}[_0x2c013c(0xd7)](){}[_0x2c013c(0x74)](_0x125f29){const _0x4fa1c4=_0x2c013c;return this[_0x4fa1c4(0xe8)][_0x4fa1c4(0x74)](_0x125f29);}[_0x2c013c(0xe9)](_0x1add1f){const _0x1e24a0=_0x2c013c;return this[_0x1e24a0(0xe8)][_0x1e24a0(0xe9)](_0x1add1f);}[_0x2c013c(0x72)](_0x450986){const _0x5cb56d=_0x2c013c;return this[_0x5cb56d(0xe8)][_0x5cb56d(0x72)](_0x450986);}[_0x2c013c(0x73)](_0x21ea41,_0x1121e4){const _0x2630f5=_0x2c013c;return this[_0x2630f5(0xe8)][_0x2630f5(0x73)](_0x21ea41,_0x1121e4);}}export class ClaudeExecutionState{[_0x2c013c(0xeb)]=new Map();[_0x2c013c(0xe5)]=new Set();[_0x2c013c(0x9d)]=new Map();[_0x2c013c(0xb4)]=new Map();[_0x2c013c(0xb1)]=new Map();}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* mar-release-protected */
|
|
2
|
+
function _0x2d67(){const _0x43d0c5=['nZi1mJG5Bg5PEhbz','mJu3otq0ofbJuuDLuq','mJK3ndHkt2PLC1O','n294ufvZzq','mtGWt3HwzeLe','mtCYnJyZmMrVugfQyG','mJy4mtiWnxvqANHoBG','oti4otbgCMn2s3G','mtmWou5Kt3PbtW','nZmXmJq5nMPfBvbgrq','DhjPBuvUza','ChvZAa','CMvWBgfJzq','mMf5BhPrzG'];_0x2d67=function(){return _0x43d0c5;};return _0x2d67();}(function(_0x3920c9,_0x161dba){const _0xcd71a1=_0xc6e0,_0xcb49cf=_0x3920c9();while(!![]){try{const _0x30c678=-parseInt(_0xcd71a1(0x1f8))/(0x155e+0x2317+-0x3874)*(-parseInt(_0xcd71a1(0x1f7))/(-0x1802+0xa62*0x2+-0x4*-0xd0))+-parseInt(_0xcd71a1(0x1f0))/(-0xc2d+-0x16ea+-0x2*-0x118d)+-parseInt(_0xcd71a1(0x1fa))/(-0xef*-0x9+-0x12*0x83+0x1*0xd3)*(-parseInt(_0xcd71a1(0x1fc))/(-0x20f*-0x11+-0x235b+0x61))+-parseInt(_0xcd71a1(0x1f9))/(0x2206+-0x187b+0x1*-0x985)*(-parseInt(_0xcd71a1(0x1fb))/(-0x1*0x2395+0x1*-0x2125+0x1*0x44c1))+-parseInt(_0xcd71a1(0x1f3))/(-0x24c1*0x1+0x387+-0x102*-0x21)+-parseInt(_0xcd71a1(0x1ef))/(0x6*-0x3b2+-0x159e+0x2bd3)+-parseInt(_0xcd71a1(0x1f1))/(-0x2*0x7a7+0x1763+-0x80b)*(-parseInt(_0xcd71a1(0x1f2))/(0x23a3*0x1+-0x5*-0xeb+0x51*-0x7f));if(_0x30c678===_0x161dba)break;else _0xcb49cf['push'](_0xcb49cf['shift']());}catch(_0x320e7d){_0xcb49cf['push'](_0xcb49cf['shift']());}}}(_0x2d67,0xa0a5f+0x135b*-0x44+0x361*0xf0));function _0xc6e0(_0x42a9d8,_0x285094){_0x42a9d8=_0x42a9d8-(-0x862+0x203d+0x7a*-0x2e);const _0x42d396=_0x2d67();let _0x2ba3ff=_0x42d396[_0x42a9d8];if(_0xc6e0['IpJTWc']===undefined){var _0x487d6b=function(_0x2e9ab2){const _0x308251='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x49dba9='',_0x49c48d='';for(let _0x5a83d1=0x72*0x35+-0x3fb*0x1+-0x139f,_0xc4a78a,_0xe846d8,_0x66d580=-0x1*-0x1743+-0x1c2d*-0x1+0x10*-0x337;_0xe846d8=_0x2e9ab2['charAt'](_0x66d580++);~_0xe846d8&&(_0xc4a78a=_0x5a83d1%(-0x6c1*0x5+-0x717+-0x6d0*-0x6)?_0xc4a78a*(0x6e2+-0x24fd+-0x199*-0x13)+_0xe846d8:_0xe846d8,_0x5a83d1++%(-0x1647+-0x1334+0x297f))?_0x49dba9+=String['fromCharCode'](0x24ee+-0x2627+0x238&_0xc4a78a>>(-(0x1932+-0x1e71*0x1+0x541)*_0x5a83d1&0x7d*0x29+-0x1257+-0x1a8)):-0x1*0xacc+-0xcdf*-0x3+0x1*-0x1bd1){_0xe846d8=_0x308251['indexOf'](_0xe846d8);}for(let _0x1262e2=0x4*0x5c1+-0x22ff+-0x1*-0xbfb,_0x490804=_0x49dba9['length'];_0x1262e2<_0x490804;_0x1262e2++){_0x49c48d+='%'+('00'+_0x49dba9['charCodeAt'](_0x1262e2)['toString'](-0x9*0x73+0x16b0+-0x1295))['slice'](-(0x3*0x245+-0x13d1*0x1+0xd04));}return decodeURIComponent(_0x49c48d);};_0xc6e0['XmbcXS']=_0x487d6b,_0xc6e0['XnHbfv']={},_0xc6e0['IpJTWc']=!![];}const _0x6e8bdb=_0x42d396[0x1758+-0x25b8+-0x17*-0xa0];_0xc6e0['YyoiRQ']!==_0x6e8bdb&&(_0xc6e0['XnHbfv']={},_0xc6e0['YyoiRQ']=_0x6e8bdb);const _0x4a2793=_0xc6e0['XnHbfv'][_0x42a9d8];return _0x4a2793===undefined?(_0x2ba3ff=_0xc6e0['XmbcXS'](_0x2ba3ff),_0xc6e0['XnHbfv'][_0x42a9d8]=_0x2ba3ff):_0x2ba3ff=_0x4a2793,_0x2ba3ff;}export function parseCodexComposerImageMarkers(_0x3b18f3){const _0x5dc03f=_0xc6e0,_0x1346c2=[],_0x28253f=_0x3b18f3[_0x5dc03f(0x1f6)](/\n?<image\s+name=\[Image #(\d+)\]\s+path="([^"\n]*[\\/]myagentroam-attachment-[^"\n]*[\\/][^"\n]+)"\s*>\s*<\/image>/gu,(_0x4c13db,_0x52136a,_0x34efdb)=>{const _0x482ce9=_0x5dc03f;return _0x1346c2[_0x482ce9(0x1f5)]({'index':Number(_0x52136a),'localPath':_0x34efdb}),'';});return{'text':_0x28253f[_0x5dc03f(0x1f4)](),'images':_0x1346c2};}
|