@harness-mix/cli 0.1.5 → 0.1.7
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/README.md +86 -56
- package/docs/harness-management.md +4 -4
- package/docs/multi-agent-collaboration.md +9 -9
- package/docs/storage-verification-design.md +49 -0
- package/output/native-build/renderer-extension.js +4210 -2273
- package/package.json +11 -9
- package/scripts/codebuddy-migration-test.cjs +1 -1
- package/scripts/collaboration-test.cjs +8 -3
- package/scripts/collaboration-ui-smoke.cjs +40 -26
- package/scripts/core-runtime-test.cjs +9 -1
- package/scripts/integrations-test.cjs +63 -4
- package/scripts/integrations-ui-smoke.cjs +77 -16
- package/scripts/native-protocol-test.cjs +113 -2
- package/scripts/native-sidebar-test.cjs +7 -0
- package/scripts/native-skill-roots-test.cjs +90 -0
- package/scripts/native-ui-smoke.cjs +23 -4
- package/scripts/projector-test.cjs +13 -0
- package/scripts/storage-verification-test.cjs +78 -0
- package/scripts/switch-harness-test.cjs +1 -1
- package/scripts/test-live-mentions.cjs +152 -0
- package/src/main/adapters/antigravity.js +20 -17
- package/src/main/adapters/claude.js +41 -8
- package/src/main/adapters/codebuddy.js +1 -0
- package/src/main/adapters/codex.js +20 -2
- package/src/main/adapters/cursor.js +5 -1
- package/src/main/adapters/dsh.js +8 -1
- package/src/main/adapters/grok.js +4 -1
- package/src/main/adapters/hermes.js +8 -0
- package/src/main/adapters/kiro.js +2 -1
- package/src/main/adapters/managed-mcp.js +15 -2
- package/src/main/adapters/omp.js +11 -0
- package/src/main/adapters/openclaw.js +6 -0
- package/src/main/adapters/opencode.js +5 -1
- package/src/main/adapters/pi.js +5 -1
- package/src/main/adapters/qoder.js +1 -0
- package/src/main/adapters/trae.js +4 -0
- package/src/main/adapters/zcode.js +3 -0
- package/src/main/host/collaboration.js +59 -11
- package/src/main/host/core-session.js +7 -1
- package/src/main/host/handoff-checkpoints.js +8 -1
- package/src/main/host/integrations.js +164 -26
- package/src/main/host/runtime.js +270 -116
- package/src/main/host/store.js +32 -11
- package/src/main/host/thread-storage.js +73 -0
- package/src/main/host/thread-store.js +123 -0
- package/src/main/host/verification-gates.js +118 -0
- package/src/main/native/protocol.js +209 -83
- package/src/main/native/thread-list.js +3 -0
- package/src/main/protocol-core/projector.js +20 -3
- package/src/main/shared-contracts/event.js +2 -1
- package/src/main/shared-contracts/item.js +1 -0
- package/src/native-ui/renderer-extension/dist/types/harness-mix-settings.d.ts +2 -2
- package/src/native-ui/renderer-extension/dist/types/harness-mix-settings.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/renderer-binding-probe.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/renderer-chatgpt-context.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/renderer-harness-mentions.d.ts +11 -0
- package/src/native-ui/renderer-extension/dist/types/renderer-harness-mentions.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/renderer-integrations-client.d.ts +29 -4
- package/src/native-ui/renderer-extension/dist/types/renderer-integrations-client.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/renderer-model-client.d.ts +5 -0
- package/src/native-ui/renderer-extension/dist/types/renderer-model-client.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/renderer-settings-lifecycle.d.ts +2 -1
- package/src/native-ui/renderer-extension/dist/types/renderer-settings-lifecycle.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/settings/icons.d.ts +1 -1
- package/src/native-ui/renderer-extension/dist/types/settings/icons.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/settings/integrations-page.d.ts +2 -1
- package/src/native-ui/renderer-extension/dist/types/settings/integrations-page.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/settings/localization.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/settings/pages.d.ts +5 -3
- package/src/native-ui/renderer-extension/dist/types/settings/pages.d.ts.map +1 -1
- package/src/native-ui/renderer-extension/dist/types/settings/storage-page.d.ts +20 -0
- package/src/native-ui/renderer-extension/dist/types/settings/storage-page.d.ts.map +1 -0
- package/src/native-ui/renderer-extension/dist/types/tsconfig.tsbuildinfo +1 -1
- package/src/native-ui/renderer-extension/src/harness-mix-settings.ts +8 -88
- package/src/native-ui/renderer-extension/src/renderer-binding-probe.ts +150 -168
- package/src/native-ui/renderer-extension/src/renderer-chatgpt-context.ts +5 -1
- package/src/native-ui/renderer-extension/src/renderer-harness-mentions.ts +556 -123
- package/src/native-ui/renderer-extension/src/renderer-integrations-client.ts +36 -3
- package/src/native-ui/renderer-extension/src/renderer-model-client.ts +4 -0
- package/src/native-ui/renderer-extension/src/renderer-settings-lifecycle.ts +12 -0
- package/src/native-ui/renderer-extension/src/settings/icons.ts +6 -3
- package/src/native-ui/renderer-extension/src/settings/integrations-page.ts +1434 -62
- package/src/native-ui/renderer-extension/src/settings/localization.ts +8 -4
- package/src/native-ui/renderer-extension/src/settings/pages.ts +17 -8
- package/src/native-ui/renderer-extension/src/settings/shell.css +103 -8
- package/src/native-ui/renderer-extension/src/settings/storage-page.ts +74 -0
- package/src/native-ui/renderer-extension/test/renderer-chatgpt-context.test.ts +4 -1
- package/src/native-ui/renderer-extension/test/renderer-model-client.test.ts +2 -0
- package/src/native-ui/renderer-extension/test/settings/harness-settings.test.ts +5 -0
- package/src/native-ui/renderer-extension/test/settings/localization.test.ts +1 -1
- package/src/native-ui/renderer-extension/test/settings/pages.test.ts +50 -4
- package/src/native-ui/renderer-extension/test/settings/shell.test.ts +8 -2
|
@@ -20,8 +20,8 @@ const {
|
|
|
20
20
|
compareVersions,
|
|
21
21
|
readState,
|
|
22
22
|
} = require('./update-state');
|
|
23
|
-
const { nativeEnvironment } = require('./config');
|
|
24
|
-
const { CodexAccountManager } = require('./codex-accounts');
|
|
23
|
+
const { nativeEnvironment } = require('./config');
|
|
24
|
+
const { CodexAccountManager } = require('./codex-accounts');
|
|
25
25
|
|
|
26
26
|
const REPO_ROOT = path.resolve(__dirname, '../../..');
|
|
27
27
|
const PACKAGE_JSON_PATH = path.join(REPO_ROOT, 'package.json');
|
|
@@ -32,8 +32,8 @@ const modelRef = model => ({ id: Buffer.from(JSON.stringify({ id: model.id, prov
|
|
|
32
32
|
const routeModel = harnessId => ['pi', 'claude-code', 'deepseek-harness', 'antigravity', 'omp', 'opencode', 'grok'].includes(harnessId)
|
|
33
33
|
? `codexhost/${harnessId}-native`
|
|
34
34
|
: `codexhost/plugin-v1@${Buffer.from(JSON.stringify({ harnessId })).toString('hex')}`;
|
|
35
|
-
const terminal = status => ['completed', 'cancelled', 'error', 'failed'].includes(status);
|
|
36
|
-
const turnStatus = status => ({ cancelled: 'interrupted', error: 'failed', failed: 'failed', completed: 'completed' }[status] || 'inProgress');
|
|
35
|
+
const terminal = status => ['completed', 'cancelled', 'error', 'failed'].includes(status);
|
|
36
|
+
const turnStatus = status => ({ cancelled: 'interrupted', error: 'failed', failed: 'failed', completed: 'completed' }[status] || 'inProgress');
|
|
37
37
|
const HARNESS_INSTALL_COMMANDS = {
|
|
38
38
|
qoder: { win32: 'npm install -g @qoder-ai/qodercli', default: 'npm install -g @qoder-ai/qodercli' },
|
|
39
39
|
codex: { win32: 'npm install -g @openai/codex', default: 'npm install -g @openai/codex' },
|
|
@@ -184,24 +184,32 @@ function projectItem(item) {
|
|
|
184
184
|
const kind = change.changeType === 'deleted' ? { type: 'delete' } : change.changeType === 'added' ? { type: 'add' } : { type: 'update', move_path: null };
|
|
185
185
|
return { path: change.path || change.file || '', kind, diff: unifiedDiff(change, kind.type) };
|
|
186
186
|
}) };
|
|
187
|
-
if (item.type === 'context_compaction' || item.type === 'contextCompaction') return { ...base, type: 'contextCompaction' };
|
|
187
|
+
if (item.type === 'context_compaction' || item.type === 'contextCompaction') return { ...base, type: 'contextCompaction' };
|
|
188
|
+
if (item.type === 'verification_report') {
|
|
189
|
+
const report = item.report ?? {};
|
|
190
|
+
const failed = report.status === 'failed';
|
|
191
|
+
return { ...base, type: 'mcpToolCall', server: 'harness-mix', tool: 'verification_gate',
|
|
192
|
+
arguments: { mode: report.mode ?? 'off' }, result: { content: [{ type: 'text', text: JSON.stringify(report) }], structuredContent: report },
|
|
193
|
+
status: failed ? 'failed' : 'completed', error: failed ? { message: 'Verification gate failed' } : null, durationMs: Math.max(0, (report.completedAt ?? 0) - (report.startedAt ?? 0)) };
|
|
194
|
+
}
|
|
188
195
|
return null;
|
|
189
196
|
}
|
|
190
197
|
|
|
191
198
|
class NativeProtocol {
|
|
192
|
-
constructor(runtime, emit, requestOfficial = null) {
|
|
199
|
+
constructor(runtime, emit, requestOfficial = null) {
|
|
193
200
|
this.runtime = runtime;
|
|
194
201
|
this.emit = emit;
|
|
195
|
-
this.requestOfficial = requestOfficial;
|
|
196
|
-
this.codexAccounts = new CodexAccountManager({
|
|
197
|
-
dataDirectory: nativeEnvironment().CODEXHOST_DATA_DIR,
|
|
198
|
-
requestOfficial,
|
|
199
|
-
emit,
|
|
200
|
-
});
|
|
202
|
+
this.requestOfficial = requestOfficial;
|
|
203
|
+
this.codexAccounts = new CodexAccountManager({
|
|
204
|
+
dataDirectory: nativeEnvironment().CODEXHOST_DATA_DIR,
|
|
205
|
+
requestOfficial,
|
|
206
|
+
emit,
|
|
207
|
+
});
|
|
201
208
|
this.approvals = new Map();
|
|
202
209
|
this.published = new Map();
|
|
203
210
|
this.steering = new Map(); // threadId -> in-flight steer promise
|
|
204
211
|
this.steerReceipts = new Map(); // `${threadId}\0${clientUserMessageId}` -> bounded delivery receipt
|
|
212
|
+
this.queues = new Map(); // threadId -> Array<{ id, input, clientUserMessageId, createdAt }>
|
|
205
213
|
this.unsubscribe = runtime.core.subscribe(({ event, projected }) => this.onCore(event, projected));
|
|
206
214
|
// Host 侧新建的线程(协作子任务等)也要通知 Desktop 侧栏,与 thread/start 同一契约
|
|
207
215
|
this.unsubscribeRuntime = runtime.subscribe(event => {
|
|
@@ -211,7 +219,17 @@ class NativeProtocol {
|
|
|
211
219
|
}
|
|
212
220
|
});
|
|
213
221
|
}
|
|
214
|
-
|
|
222
|
+
getQueue(threadId) {
|
|
223
|
+
if (!this.queues.has(threadId)) this.queues.set(threadId, []);
|
|
224
|
+
return this.queues.get(threadId);
|
|
225
|
+
}
|
|
226
|
+
emitQueueChanged(threadId) {
|
|
227
|
+
this.emit({ method: 'thread/queue/changed', params: { threadId } });
|
|
228
|
+
}
|
|
229
|
+
thread(id) {
|
|
230
|
+
if (!id) return undefined;
|
|
231
|
+
return this.runtime.threads.some(t => t.id === id) ? this.runtime.getThread(id) : undefined;
|
|
232
|
+
}
|
|
215
233
|
owns(id) { return Boolean(this.thread(id)); }
|
|
216
234
|
turn(turn) { return { id: turn.id, status: turnStatus(turn.status), error: turn.error ? { message: String(turn.error), codexErrorInfo: null, additionalDetails: null } : null,
|
|
217
235
|
items: this.runtime.core.getItemsForTurn(turn.id).map(projectItem).filter(Boolean) }; }
|
|
@@ -219,7 +237,7 @@ class NativeProtocol {
|
|
|
219
237
|
// Projection shape mirrors the upstream codexhost external-thread contract: every
|
|
220
238
|
// field the Desktop sidebar/composer reads must be present with the same defaults.
|
|
221
239
|
const updatedAt = Math.floor((thread.updatedAt || thread.createdAt) / 1000);
|
|
222
|
-
return { id: thread.id, preview: thread.messages
|
|
240
|
+
return { id: thread.id, preview: thread.messages?.find(m => m.role === 'user')?.text || thread.preview || thread.title,
|
|
223
241
|
ephemeral: thread.ephemeral === true, modelProvider: 'codexhost', model: routeModel(externalId(thread.harnessId)), reasoningEffort: null,
|
|
224
242
|
section: thread.section ?? null, sectionEnteredAt: thread.sectionEnteredAt ?? null, projectId: thread.projectId ?? null,
|
|
225
243
|
createdAt: Math.floor(thread.createdAt / 1000),
|
|
@@ -322,34 +340,34 @@ class NativeProtocol {
|
|
|
322
340
|
if (!model) throw new Error('Selected model is no longer in the native catalog');
|
|
323
341
|
return model;
|
|
324
342
|
}
|
|
325
|
-
async request(method, params = {}) {
|
|
326
|
-
if (method === 'codexhost/integrations/catalog') return this.runtime.integrations.catalog();
|
|
327
|
-
if (method === 'codexhost/integrations/list') return this.runtime.integrations.list(params);
|
|
328
|
-
if (method === 'codexhost/integrations/mcp/save') return this.runtime.integrations.save(params);
|
|
329
|
-
if (method === 'codexhost/integrations/mcp/remove') return this.runtime.integrations.remove(params);
|
|
330
|
-
if (method === 'codexhost/integrations/skill/change') return this.runtime.integrations.skillChange(params);
|
|
343
|
+
async request(method, params = {}) {
|
|
344
|
+
if (method === 'codexhost/integrations/catalog') return this.runtime.integrations.catalog();
|
|
345
|
+
if (method === 'codexhost/integrations/list') return this.runtime.integrations.list(params);
|
|
346
|
+
if (method === 'codexhost/integrations/mcp/save') return this.runtime.integrations.save(params);
|
|
347
|
+
if (method === 'codexhost/integrations/mcp/remove') return this.runtime.integrations.remove(params);
|
|
348
|
+
if (method === 'codexhost/integrations/skill/change') return this.runtime.integrations.skillChange(params);
|
|
331
349
|
if (method === 'codexhost/harness/session-import/sources') return this.runtime.history.sources();
|
|
332
350
|
if (method === 'codexhost/harness/session-import/list') return this.runtime.history.list(params);
|
|
333
351
|
if (method === 'codexhost/harness/session-import/import') return this.runtime.history.import(params);
|
|
334
352
|
if (method === 'codexhost/collaboration/agents') return [...this.runtime.adapters.values()].map(a => ({ id: externalId(a.manifest.id), name: a.manifest.name, available: !!this.runtime.status[a.manifest.id]?.available, lead: a.manifest.capabilities?.collaborationTools === true }));
|
|
335
353
|
const thread = this.thread(params.threadId);
|
|
336
|
-
if (method === 'harness-mix/runtime/inspect') return {
|
|
337
|
-
owner: 'harness-mix',
|
|
338
|
-
runtime: 'src/main/host/runtime.js',
|
|
339
|
-
core: 'src/main/protocol-core/protocol-core.js',
|
|
340
|
-
threads: this.runtime.threads.length,
|
|
341
|
-
codex: {
|
|
342
|
-
mode: 'official-passthrough',
|
|
343
|
-
// `codex` remains owned by the stock app-server. Only the explicit
|
|
344
|
-
// `codex-harness` route creates a HostRuntime-managed Codex worker.
|
|
345
|
-
managedRoute: 'codex-harness',
|
|
346
|
-
},
|
|
347
|
-
};
|
|
348
|
-
if (method === 'harness-mix/runtime/version') {
|
|
349
|
-
let version = '0.0.0';
|
|
350
|
-
try { version = JSON.parse(fs.readFileSync(PACKAGE_JSON_PATH, 'utf8')).version || version; } catch {}
|
|
351
|
-
return { version };
|
|
352
|
-
}
|
|
354
|
+
if (method === 'harness-mix/runtime/inspect') return {
|
|
355
|
+
owner: 'harness-mix',
|
|
356
|
+
runtime: 'src/main/host/runtime.js',
|
|
357
|
+
core: 'src/main/protocol-core/protocol-core.js',
|
|
358
|
+
threads: this.runtime.threads.length,
|
|
359
|
+
codex: {
|
|
360
|
+
mode: 'official-passthrough',
|
|
361
|
+
// `codex` remains owned by the stock app-server. Only the explicit
|
|
362
|
+
// `codex-harness` route creates a HostRuntime-managed Codex worker.
|
|
363
|
+
managedRoute: 'codex-harness',
|
|
364
|
+
},
|
|
365
|
+
};
|
|
366
|
+
if (method === 'harness-mix/runtime/version') {
|
|
367
|
+
let version = '0.0.0';
|
|
368
|
+
try { version = JSON.parse(fs.readFileSync(PACKAGE_JSON_PATH, 'utf8')).version || version; } catch {}
|
|
369
|
+
return { version };
|
|
370
|
+
}
|
|
353
371
|
// Updates
|
|
354
372
|
if (method === 'codexhost/update/check') {
|
|
355
373
|
const dataDir = nativeEnvironment().CODEXHOST_DATA_DIR;
|
|
@@ -455,22 +473,22 @@ class NativeProtocol {
|
|
|
455
473
|
return { status: null };
|
|
456
474
|
}
|
|
457
475
|
|
|
458
|
-
// Each extra Account is an isolated native CODEX_HOME. Harness Mix stores
|
|
459
|
-
// only the profile label/path; auth.json and token refresh remain owned by Codex.
|
|
460
|
-
if (method === 'codexhost/account/list') return this.codexAccounts.list(false);
|
|
461
|
-
if (method === 'codexhost/account/refresh') return this.codexAccounts.list(true);
|
|
462
|
-
if (method === 'codexhost/account/create') return this.codexAccounts.create(params.label);
|
|
463
|
-
if (method === 'codexhost/account/delete') return this.codexAccounts.delete(params.accountId);
|
|
464
|
-
if (method === 'codexhost/account/activate') return this.codexAccounts.activate(params.accountId);
|
|
465
|
-
if (method === 'codexhost/account/usage/inspect') return this.codexAccounts.usage(params.accountId);
|
|
466
|
-
if (method === 'codexhost/account/login/start') return this.codexAccounts.startLogin(params.accountId);
|
|
467
|
-
if (method === 'codexhost/account/login/cancel') return this.codexAccounts.cancelLogin(params.loginId);
|
|
468
|
-
if (method === 'codexhost/account/logout') {
|
|
469
|
-
if (!this.requestOfficial) throw new Error('Official Codex logout is unavailable');
|
|
470
|
-
await this.requestOfficial('account/logout', undefined);
|
|
471
|
-
return this.codexAccounts.signedOutOfficial();
|
|
472
|
-
}
|
|
473
|
-
if (method === 'codexhost/account/rate-limit-reset/consume') return this.codexAccounts.consumeReset(params.accountId, params.idempotencyKey);
|
|
476
|
+
// Each extra Account is an isolated native CODEX_HOME. Harness Mix stores
|
|
477
|
+
// only the profile label/path; auth.json and token refresh remain owned by Codex.
|
|
478
|
+
if (method === 'codexhost/account/list') return this.codexAccounts.list(false);
|
|
479
|
+
if (method === 'codexhost/account/refresh') return this.codexAccounts.list(true);
|
|
480
|
+
if (method === 'codexhost/account/create') return this.codexAccounts.create(params.label);
|
|
481
|
+
if (method === 'codexhost/account/delete') return this.codexAccounts.delete(params.accountId);
|
|
482
|
+
if (method === 'codexhost/account/activate') return this.codexAccounts.activate(params.accountId);
|
|
483
|
+
if (method === 'codexhost/account/usage/inspect') return this.codexAccounts.usage(params.accountId);
|
|
484
|
+
if (method === 'codexhost/account/login/start') return this.codexAccounts.startLogin(params.accountId);
|
|
485
|
+
if (method === 'codexhost/account/login/cancel') return this.codexAccounts.cancelLogin(params.loginId);
|
|
486
|
+
if (method === 'codexhost/account/logout') {
|
|
487
|
+
if (!this.requestOfficial) throw new Error('Official Codex logout is unavailable');
|
|
488
|
+
await this.requestOfficial('account/logout', undefined);
|
|
489
|
+
return this.codexAccounts.signedOutOfficial();
|
|
490
|
+
}
|
|
491
|
+
if (method === 'codexhost/account/rate-limit-reset/consume') return this.codexAccounts.consumeReset(params.accountId, params.idempotencyKey);
|
|
474
492
|
if (method === 'codexhost/harness/account/login') {
|
|
475
493
|
const extId = params.harnessId;
|
|
476
494
|
const meta = HARNESS_AUTH_INFO[extId] || HARNESS_AUTH_INFO[ALIASES[extId]];
|
|
@@ -557,7 +575,9 @@ class NativeProtocol {
|
|
|
557
575
|
}
|
|
558
576
|
return { accounts };
|
|
559
577
|
}
|
|
560
|
-
if (method === 'codexhost/harness/plugins/list') return { plugins: this.runtime.snapshot().adapters.map(a => ({ id: externalId(a.id), name: a.id === 'codex' ? 'Codex(协作)' : a.name, version: '0.1.0', icon: `data:image/svg+xml;base64,${Buffer.from(getHarnessSvg(a.id)).toString('base64')}` })) };
|
|
578
|
+
if (method === 'codexhost/harness/plugins/list') return { plugins: this.runtime.snapshot().adapters.map(a => ({ id: externalId(a.id), name: a.id === 'codex' ? 'Codex(协作)' : a.name, version: '0.1.0', icon: `data:image/svg+xml;base64,${Buffer.from(getHarnessSvg(a.id)).toString('base64')}` })) };
|
|
579
|
+
if (method === 'codexhost/storage/inspect') return this.runtime.inspectStorage();
|
|
580
|
+
if (method === 'codexhost/storage/optimize') return this.runtime.optimizeStorage();
|
|
561
581
|
if (method === 'codexhost/harness/inspect') return this.inspect(params.harnessId);
|
|
562
582
|
if (method === 'codexhost/harness/install') {
|
|
563
583
|
const local = ALIASES[params.harnessId] || params.harnessId;
|
|
@@ -609,24 +629,24 @@ class NativeProtocol {
|
|
|
609
629
|
...(usage ? { usage: projectUsage(usage) } : {}),
|
|
610
630
|
...(credits ? { accountCredits: credits } : {}) };
|
|
611
631
|
}
|
|
612
|
-
if (method === 'thread/start') {
|
|
613
|
-
const route = decodeRoute(params.model);
|
|
614
|
-
const accountContext = typeof params.__codexhostAccountId === 'string'
|
|
615
|
-
? this.codexAccounts.executionContext(params.__codexhostAccountId) : null;
|
|
616
|
-
if (!route && !accountContext) return undefined;
|
|
617
|
-
const effectiveRoute = route || { harnessId: 'codex-harness', ...(typeof params.model === 'string' ? { model: { id: params.model } } : {}) };
|
|
618
|
-
const id = ALIASES[effectiveRoute.harnessId] || effectiveRoute.harnessId;
|
|
619
|
-
if (!this.runtime.adapters.has(id)) throw new Error(`Unsupported Harness: ${id}`);
|
|
632
|
+
if (method === 'thread/start') {
|
|
633
|
+
const route = decodeRoute(params.model);
|
|
634
|
+
const accountContext = typeof params.__codexhostAccountId === 'string'
|
|
635
|
+
? this.codexAccounts.executionContext(params.__codexhostAccountId) : null;
|
|
636
|
+
if (!route && !accountContext) return undefined;
|
|
637
|
+
const effectiveRoute = route || { harnessId: 'codex-harness', ...(typeof params.model === 'string' ? { model: { id: params.model } } : {}) };
|
|
638
|
+
const id = ALIASES[effectiveRoute.harnessId] || effectiveRoute.harnessId;
|
|
639
|
+
if (!this.runtime.adapters.has(id)) throw new Error(`Unsupported Harness: ${id}`);
|
|
620
640
|
if (params.ephemeral && params.threadSource) throw new Error('Ephemeral background thread is not supported');
|
|
621
|
-
const isWorktree = params.worktree === true || params.options?.worktree === true;
|
|
622
|
-
const selectedModel = accountContext && typeof params.model === 'string'
|
|
623
|
-
? (await this.runtime.describe(id)).models.find(model => model.id === params.model)
|
|
624
|
-
: await this.resolveModel(id, effectiveRoute.model);
|
|
625
|
-
const created = await this.runtime.createThread({ harnessId: id, cwd: params.cwd, ephemeral: params.ephemeral === true,
|
|
641
|
+
const isWorktree = params.worktree === true || params.options?.worktree === true;
|
|
642
|
+
const selectedModel = accountContext && typeof params.model === 'string'
|
|
643
|
+
? (await this.runtime.describe(id)).models.find(model => model.id === params.model)
|
|
644
|
+
: await this.resolveModel(id, effectiveRoute.model);
|
|
645
|
+
const created = await this.runtime.createThread({ harnessId: id, cwd: params.cwd, ephemeral: params.ephemeral === true,
|
|
626
646
|
worktree: isWorktree,
|
|
627
647
|
options: {
|
|
628
|
-
model: selectedModel, thinking: effectiveRoute.thinkingOptionId, permissionMode: effectiveRoute.permissionModeId,
|
|
629
|
-
...(accountContext || {}),
|
|
648
|
+
model: selectedModel, thinking: effectiveRoute.thinkingOptionId, permissionMode: effectiveRoute.permissionModeId,
|
|
649
|
+
...(accountContext || {}),
|
|
630
650
|
...(isWorktree ? { worktree: true } : {}),
|
|
631
651
|
} });
|
|
632
652
|
if (created.error) throw new Error(created.error);
|
|
@@ -638,15 +658,92 @@ class NativeProtocol {
|
|
|
638
658
|
if (method === 'codexhost/thread/workspace/review') return this.runtime.reviewThreadWorkspace(params.threadId);
|
|
639
659
|
if (method === 'codexhost/thread/workspace/apply') return this.runtime.applyThreadWorkspace(params.threadId, params.digest);
|
|
640
660
|
if (method === 'codexhost/thread/workspace/discard') return this.runtime.discardThreadWorkspace(params.threadId);
|
|
641
|
-
if (method === 'codexhost/thread/workspace/push') return this.runtime.pushThreadWorkspace(params.threadId, params);
|
|
661
|
+
if (method === 'codexhost/thread/workspace/push') return this.runtime.pushThreadWorkspace(params.threadId, params);
|
|
662
|
+
if (method === 'codexhost/thread/verification/get') return this.runtime.verificationState(params.threadId);
|
|
663
|
+
if (method === 'codexhost/thread/verification/configure') return this.runtime.configureVerification(params.threadId, params.policy);
|
|
664
|
+
if (method === 'codexhost/thread/verification/run') return this.runtime.runVerification(params.threadId);
|
|
642
665
|
if (!thread) {
|
|
643
666
|
if (method.startsWith('codexhost/')) throw new Error(`Harness Mix does not implement ${method}`);
|
|
644
667
|
return undefined;
|
|
645
668
|
}
|
|
646
669
|
if (method === 'thread/read') return { thread: this.projectThread(thread, params.includeTurns !== false) };
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
670
|
+
if (method === 'thread/queue/list') {
|
|
671
|
+
const queue = this.getQueue(thread.id);
|
|
672
|
+
return {
|
|
673
|
+
data: queue.map(item => ({
|
|
674
|
+
id: item.id,
|
|
675
|
+
input: item.input,
|
|
676
|
+
clientUserMessageId: item.clientUserMessageId,
|
|
677
|
+
createdAt: item.createdAt,
|
|
678
|
+
})),
|
|
679
|
+
nextCursor: null,
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
if (method === 'thread/queue/add') {
|
|
683
|
+
const input = Array.isArray(params.input) ? params.input : [];
|
|
684
|
+
if (!input.length) throw new Error('Queue submission requires non-empty input');
|
|
685
|
+
const queue = this.getQueue(thread.id);
|
|
686
|
+
const submission = {
|
|
687
|
+
id: randomUUID(),
|
|
688
|
+
input,
|
|
689
|
+
clientUserMessageId: typeof params.clientUserMessageId === 'string' && params.clientUserMessageId ? params.clientUserMessageId : null,
|
|
690
|
+
createdAt: Date.now(),
|
|
691
|
+
};
|
|
692
|
+
queue.push(submission);
|
|
693
|
+
this.emitQueueChanged(thread.id);
|
|
694
|
+
return { queuedSubmission: submission };
|
|
695
|
+
}
|
|
696
|
+
if (method === 'thread/queue/delete') {
|
|
697
|
+
const queue = this.getQueue(thread.id);
|
|
698
|
+
const idx = queue.findIndex(item => item.id === params.queuedSubmissionId);
|
|
699
|
+
if (idx !== -1) {
|
|
700
|
+
queue.splice(idx, 1);
|
|
701
|
+
this.emitQueueChanged(thread.id);
|
|
702
|
+
return { deleted: true };
|
|
703
|
+
}
|
|
704
|
+
return { deleted: false };
|
|
705
|
+
}
|
|
706
|
+
if (method === 'thread/queue/update') {
|
|
707
|
+
const queue = this.getQueue(thread.id);
|
|
708
|
+
const item = queue.find(it => it.id === params.queuedSubmissionId);
|
|
709
|
+
if (!item) throw new Error('Queued submission not found');
|
|
710
|
+
if (Array.isArray(params.input)) item.input = params.input;
|
|
711
|
+
this.emitQueueChanged(thread.id);
|
|
712
|
+
return { queuedSubmission: item };
|
|
713
|
+
}
|
|
714
|
+
if (method === 'thread/queue/reorder') {
|
|
715
|
+
const queue = this.getQueue(thread.id);
|
|
716
|
+
const ids = Array.isArray(params.queuedSubmissionIds) ? params.queuedSubmissionIds : [];
|
|
717
|
+
const map = new Map(queue.map(item => [item.id, item]));
|
|
718
|
+
const reordered = ids.map(id => map.get(id)).filter(Boolean);
|
|
719
|
+
for (const item of queue) {
|
|
720
|
+
if (!ids.includes(item.id)) reordered.push(item);
|
|
721
|
+
}
|
|
722
|
+
this.queues.set(thread.id, reordered);
|
|
723
|
+
this.emitQueueChanged(thread.id);
|
|
724
|
+
return {};
|
|
725
|
+
}
|
|
726
|
+
if (method === 'thread/queue/start') {
|
|
727
|
+
const queue = this.getQueue(thread.id);
|
|
728
|
+
const idx = params.queuedSubmissionId
|
|
729
|
+
? queue.findIndex(item => item.id === params.queuedSubmissionId)
|
|
730
|
+
: 0;
|
|
731
|
+
if (idx === -1 || !queue[idx]) throw new Error('Queued submission not found');
|
|
732
|
+
const [submission] = queue.splice(idx, 1);
|
|
733
|
+
this.emitQueueChanged(thread.id);
|
|
734
|
+
const { text, attachments } = await prepareInput(submission.input, thread.cwd);
|
|
735
|
+
if (attachments.length && !this.runtime.getCapabilities(thread.harnessId).conversation.attachments) {
|
|
736
|
+
throw new Error('当前 Harness 不支持图片附件');
|
|
737
|
+
}
|
|
738
|
+
if (this.runtime.execution.isRunning(thread.id)) {
|
|
739
|
+
// 正在执行中:打断当前回合并立即执行该排队消息
|
|
740
|
+
const turnId = await this.steerExclusive(thread, thread.currentTurn?.id, text, attachments);
|
|
741
|
+
const started = this.runtime.core.getTurn(turnId) || thread.currentTurn;
|
|
742
|
+
return { turn: this.turn(started) };
|
|
743
|
+
}
|
|
744
|
+
const turn = await this.startNativeTurn(thread, text, attachments);
|
|
745
|
+
return { turn: this.turn(turn) };
|
|
746
|
+
}
|
|
650
747
|
if (method === 'thread/metadata/update') return { thread: this.projectThread(await this.runtime.updateThreadMetadata(thread.id, params.gitInfo)) };
|
|
651
748
|
if (method === 'thread/section/move') {
|
|
652
749
|
if (params.sectionId !== null && (typeof params.sectionId !== 'string' || !params.sectionId)) throw new Error('Invalid sectionId');
|
|
@@ -707,7 +804,17 @@ class NativeProtocol {
|
|
|
707
804
|
}
|
|
708
805
|
if (method === 'thread/rollback') return { thread: this.projectThread(await this.runtime.rollbackThread(thread.id, params.numTurns)) };
|
|
709
806
|
if (method === 'thread/name/set') { await this.runtime.renameThread(thread.id, params.name); return {}; }
|
|
710
|
-
if (method === 'thread/archive' || method === 'thread/unarchive') {
|
|
807
|
+
if (method === 'thread/archive' || method === 'thread/unarchive') {
|
|
808
|
+
const isArchive = method === 'thread/archive';
|
|
809
|
+
await this.runtime.setThreadArchived(thread.id, isArchive);
|
|
810
|
+
if (isArchive) {
|
|
811
|
+
this.emit({ method: 'thread/archived', params: { threadId: thread.id } });
|
|
812
|
+
return {};
|
|
813
|
+
}
|
|
814
|
+
const projected = this.projectThread(thread);
|
|
815
|
+
this.emit({ method: 'thread/unarchived', params: { thread: projected } });
|
|
816
|
+
return { thread: projected };
|
|
817
|
+
}
|
|
711
818
|
if (method === 'thread/loaded/list') return { data: [...this.runtime.sessions.keys()] };
|
|
712
819
|
if (method === 'codexhost/thread/usage/inspect') {
|
|
713
820
|
const usage = params.refresh === 'exact' ? await this.runtime.refreshUsage(thread.id) : this.runtime.core.getThread(thread.id)?.usage;
|
|
@@ -743,14 +850,14 @@ class NativeProtocol {
|
|
|
743
850
|
return this.configuration(thread);
|
|
744
851
|
}
|
|
745
852
|
// 原地切换 Harness:会话历史保留,下条消息携带一次性上下文信封(/switch 指令的 RPC 等价物)
|
|
746
|
-
if (method === 'codexhost/thread/harness/switch') {
|
|
747
|
-
await this.runtime.switchHarness(thread.id, ALIASES[params.harnessId] || params.harnessId, {
|
|
748
|
-
note: typeof params.note === 'string' ? params.note : undefined,
|
|
749
|
-
intent: params.intent,
|
|
750
|
-
includes: params.includes,
|
|
751
|
-
});
|
|
752
|
-
return { threadId: thread.id, checkpointId: thread.pendingHandoff.checkpointId };
|
|
753
|
-
}
|
|
853
|
+
if (method === 'codexhost/thread/harness/switch') {
|
|
854
|
+
await this.runtime.switchHarness(thread.id, ALIASES[params.harnessId] || params.harnessId, {
|
|
855
|
+
note: typeof params.note === 'string' ? params.note : undefined,
|
|
856
|
+
intent: params.intent,
|
|
857
|
+
includes: params.includes,
|
|
858
|
+
});
|
|
859
|
+
return { threadId: thread.id, checkpointId: thread.pendingHandoff.checkpointId };
|
|
860
|
+
}
|
|
754
861
|
if (method === 'thread/fork' || method === 'codexhost/thread/fork') {
|
|
755
862
|
if (params.ephemeral || params.threadSource || params.excludeTurns) {
|
|
756
863
|
throw new Error('Ephemeral fork is not supported');
|
|
@@ -811,6 +918,25 @@ class NativeProtocol {
|
|
|
811
918
|
if (Array.isArray(projected.turn.itemIds)) {
|
|
812
919
|
for (const id of projected.turn.itemIds) this.published.delete(id);
|
|
813
920
|
}
|
|
921
|
+
for (const [id, app] of this.approvals.entries()) {
|
|
922
|
+
if (app.threadId === threadId) this.approvals.delete(id);
|
|
923
|
+
}
|
|
924
|
+
if (projected.turn.status === 'completed') {
|
|
925
|
+
setTimeout(async () => {
|
|
926
|
+
const queue = this.getQueue(threadId);
|
|
927
|
+
const currentThread = this.thread(threadId);
|
|
928
|
+
if (queue.length > 0 && currentThread && !this.runtime.execution.isRunning(threadId) && !this.steering.has(threadId) && !this.runtime.sending?.has(threadId)) {
|
|
929
|
+
const [submission] = queue.splice(0, 1);
|
|
930
|
+
this.emitQueueChanged(threadId);
|
|
931
|
+
try {
|
|
932
|
+
const { text, attachments } = await prepareInput(submission.input, currentThread.cwd);
|
|
933
|
+
await this.startNativeTurn(currentThread, text, attachments);
|
|
934
|
+
} catch (err) {
|
|
935
|
+
console.error(`Failed to auto-drain queued submission for thread ${threadId}:`, err);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}, 2500);
|
|
939
|
+
}
|
|
814
940
|
}
|
|
815
941
|
}
|
|
816
942
|
async startNativeTurn(thread, text, attachments, commandId) {
|
|
@@ -882,6 +1008,6 @@ class NativeProtocol {
|
|
|
882
1008
|
this.approvals.delete(message.id);
|
|
883
1009
|
return true;
|
|
884
1010
|
}
|
|
885
|
-
close() { this.codexAccounts.close(); this.unsubscribe(); this.unsubscribeRuntime(); }
|
|
1011
|
+
close() { this.codexAccounts.close(); this.unsubscribe(); this.unsubscribeRuntime(); }
|
|
886
1012
|
}
|
|
887
1013
|
module.exports = { NativeProtocol, decodeRoute, projectItem, externalId, routeModel };
|
|
@@ -26,6 +26,9 @@ function mergeThreadPage(page, threads, query, project) {
|
|
|
26
26
|
const local = threads.filter(thread => includesThread(thread, query, threads));
|
|
27
27
|
if (query.sortKey === 'section_position') local.sort((a, b) => (a.sectionPosition || 0) - (b.sectionPosition || 0));
|
|
28
28
|
const byId = new Map(page.data.map(thread => [thread.id, thread]));
|
|
29
|
+
for (const thread of threads) {
|
|
30
|
+
if (!includesThread(thread, query, threads)) byId.delete(thread.id);
|
|
31
|
+
}
|
|
29
32
|
for (const thread of local) byId.set(thread.id, project(thread));
|
|
30
33
|
const data = [...byId.values()];
|
|
31
34
|
if (query.sortKey !== 'section_position') {
|
|
@@ -83,11 +83,28 @@ class Projector {
|
|
|
83
83
|
item.updatedAt = event.timestamp;
|
|
84
84
|
return { item };
|
|
85
85
|
}
|
|
86
|
-
case 'usage.updated': {
|
|
86
|
+
case 'usage.updated': {
|
|
87
87
|
const item = this.#upsertUsageItem(event);
|
|
88
88
|
const thread = this.threads.update(event.threadId, { usage: event.payload }, event.timestamp);
|
|
89
|
-
return { item, thread };
|
|
90
|
-
}
|
|
89
|
+
return { item, thread };
|
|
90
|
+
}
|
|
91
|
+
case 'verification.updated': {
|
|
92
|
+
const turn = this.turns.get(event.turnId);
|
|
93
|
+
if (!turn) return {};
|
|
94
|
+
const itemId = event.itemId ?? `verification_${turn.id}`;
|
|
95
|
+
let item = this.items.get(itemId);
|
|
96
|
+
if (!item) {
|
|
97
|
+
item = createItem({ id: itemId, threadId: event.threadId, turnId: turn.id,
|
|
98
|
+
type: 'verification_report', status: 'completed', report: structuredClone(event.payload.report) }, event.timestamp);
|
|
99
|
+
this.items.set(item.id, item);
|
|
100
|
+
if (!turn.itemIds.includes(item.id)) turn.itemIds.push(item.id);
|
|
101
|
+
} else {
|
|
102
|
+
item.report = structuredClone(event.payload.report);
|
|
103
|
+
item.status = 'completed';
|
|
104
|
+
item.updatedAt = event.timestamp;
|
|
105
|
+
}
|
|
106
|
+
return { item };
|
|
107
|
+
}
|
|
91
108
|
default:
|
|
92
109
|
return {};
|
|
93
110
|
}
|
|
@@ -19,7 +19,8 @@ const EVENT_TYPES = [
|
|
|
19
19
|
'item.completed',
|
|
20
20
|
'usage.updated',
|
|
21
21
|
'files.updated',
|
|
22
|
-
'plan.updated',
|
|
22
|
+
'plan.updated',
|
|
23
|
+
'verification.updated',
|
|
23
24
|
];
|
|
24
25
|
|
|
25
26
|
function createCoreEvent({ eventId, sequence, timestamp, threadId, turnId, itemId, source, nativeRef, type, payload } = {}, now = Date.now()) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { installRendererSettingsLifecycle, } from './renderer-settings-lifecycle.js';
|
|
2
|
+
export type { RendererSettingsLifecycleControl, RendererSettingsLifecycleOptions, } from './renderer-settings-lifecycle.js';
|
|
3
3
|
//# sourceMappingURL=harness-mix-settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-mix-settings.d.ts","sourceRoot":"","sources":["../../src/harness-mix-settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"harness-mix-settings.d.ts","sourceRoot":"","sources":["../../src/harness-mix-settings.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gCAAgC,GACjC,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACV,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,kCAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-binding-probe.d.ts","sourceRoot":"","sources":["../../src/renderer-binding-probe.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAEpB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAErB,KAAK,mBAAmB,EACxB,KAAK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AA4I;AAC3M,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAG7F;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAM/E;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAIlE;AAGD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAMzE;AAQD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,GAAG,IAAI,CAIlF;AACD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAIrF;AAQD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,2BAA2B,GAAG,oBAAoB,CAEtG"}
|
|
@@ -3,6 +3,7 @@ export interface CollaborationAgent {
|
|
|
3
3
|
name: string;
|
|
4
4
|
available: boolean;
|
|
5
5
|
lead: boolean;
|
|
6
|
+
description?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface CollaborationSession {
|
|
8
9
|
id: string;
|
|
@@ -11,13 +12,23 @@ export interface CollaborationSession {
|
|
|
11
12
|
cwd: string;
|
|
12
13
|
running: boolean | null;
|
|
13
14
|
}
|
|
15
|
+
export interface NativeCodexOption {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
category: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
action?: string;
|
|
22
|
+
}
|
|
14
23
|
export interface CollaborationMentionCatalog {
|
|
15
24
|
agents: CollaborationAgent[];
|
|
16
25
|
sessions: CollaborationSession[];
|
|
26
|
+
codexOptions?: NativeCodexOption[];
|
|
17
27
|
canDelegate?: boolean;
|
|
18
28
|
}
|
|
19
29
|
/** Adds native-Harness suggestions while preserving the original composer editor. */
|
|
20
30
|
export declare function installHarnessMentions(load: (editor: Element, query: string) => Promise<CollaborationMentionCatalog>): {
|
|
31
|
+
sync(target: HTMLElement): void;
|
|
21
32
|
dispose(): void;
|
|
22
33
|
};
|
|
23
34
|
//# sourceMappingURL=renderer-harness-mentions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-harness-mentions.d.ts","sourceRoot":"","sources":["../../src/renderer-harness-mentions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderer-harness-mentions.d.ts","sourceRoot":"","sources":["../../src/renderer-harness-mentions.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA+GD,qFAAqF;AACrF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,2BAA2B,CAAC;iBA2jBpG,WAAW;;EAuB3B"}
|
|
@@ -6,8 +6,19 @@ declare const snapshotSchema: z.ZodObject<{
|
|
|
6
6
|
servers: z.ZodArray<z.ZodObject<{
|
|
7
7
|
id: z.ZodString;
|
|
8
8
|
name: z.ZodString;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
transportType: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
stdio: "stdio";
|
|
11
|
+
streamable_http: "streamable_http";
|
|
12
|
+
}>>;
|
|
13
|
+
command: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
14
|
+
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
15
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
16
|
+
env_vars: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
cwd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
url: z.ZodOptional<z.ZodString>;
|
|
19
|
+
bearer_token_env_var: z.ZodOptional<z.ZodString>;
|
|
20
|
+
http_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
21
|
+
env_http_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
11
22
|
enabled: z.ZodBoolean;
|
|
12
23
|
scope: z.ZodEnum<{
|
|
13
24
|
global: "global";
|
|
@@ -53,15 +64,29 @@ export interface IntegrationScope {
|
|
|
53
64
|
cwd?: string;
|
|
54
65
|
}
|
|
55
66
|
export interface ManagedServer {
|
|
67
|
+
id?: string | undefined;
|
|
56
68
|
name: string;
|
|
57
|
-
|
|
58
|
-
|
|
69
|
+
transportType?: 'stdio' | 'streamable_http' | undefined;
|
|
70
|
+
command?: string | undefined;
|
|
71
|
+
args?: string[] | undefined;
|
|
72
|
+
env?: Record<string, string> | undefined;
|
|
73
|
+
env_vars?: string[] | undefined;
|
|
74
|
+
cwd?: string | null | undefined;
|
|
75
|
+
url?: string | undefined;
|
|
76
|
+
bearer_token_env_var?: string | undefined;
|
|
77
|
+
http_headers?: Record<string, string> | undefined;
|
|
78
|
+
env_http_headers?: Record<string, string> | undefined;
|
|
59
79
|
enabled: boolean;
|
|
60
80
|
}
|
|
81
|
+
export interface DroppedSkillFile {
|
|
82
|
+
path: string;
|
|
83
|
+
contentBase64: string;
|
|
84
|
+
}
|
|
61
85
|
export interface SkillChange {
|
|
62
86
|
name: string;
|
|
63
87
|
root?: string;
|
|
64
88
|
source?: string;
|
|
89
|
+
files?: DroppedSkillFile[];
|
|
65
90
|
action: 'install' | 'enable' | 'disable';
|
|
66
91
|
}
|
|
67
92
|
export interface RendererIntegrationsClient {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-integrations-client.d.ts","sourceRoot":"","sources":["../../src/renderer-integrations-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"renderer-integrations-client.d.ts","sourceRoot":"","sources":["../../src/renderer-integrations-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAuS,CAAC;AAC5T,QAAA,MAAM,aAAa;;;;;;;;iBAAkJ,CAAC;AACtK,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACjE,MAAM,WAAW,gBAAgB;IAAG,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE;AAClG,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,IA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