@cortex-agent/server 2026.10.15-2 → 2026.10.21
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 +70 -31
- package/defaults/board/board.css +140 -62
- package/defaults/board/scaffold.html +36 -13
- package/defaults/plugins/cortex-board/skills/board/SKILL.md +30 -22
- package/defaults/plugins/cortex-system/plugin.json +2 -2
- package/defaults/plugins/cortex-system/skills/browser/SKILL.md +56 -0
- package/dist/agent-adapter/claude/adapter.d.ts +2 -5
- package/dist/agent-adapter/claude/adapter.js +6 -5
- package/dist/agent-adapter/claude/assistant-blocks.d.ts +5 -0
- package/dist/agent-adapter/claude/assistant-blocks.js +61 -0
- package/dist/agent-adapter/claude/cache-refresh.d.ts +58 -0
- package/dist/agent-adapter/claude/cache-refresh.js +145 -0
- package/dist/agent-adapter/claude/cache-touch.d.ts +12 -0
- package/dist/agent-adapter/claude/cache-touch.js +75 -0
- package/dist/agent-adapter/claude/event-parser.d.ts +8 -3
- package/dist/agent-adapter/claude/event-parser.js +33 -17
- package/dist/agent-adapter/claude/event-translator.d.ts +2 -0
- package/dist/agent-adapter/claude/event-translator.js +2 -0
- package/dist/agent-adapter/claude/session-options.d.ts +0 -4
- package/dist/agent-adapter/claude/session-options.js +0 -9
- package/dist/agent-adapter/claude/spawn-args.d.ts +0 -3
- package/dist/agent-adapter/claude/spawn-args.js +2 -5
- package/dist/agent-adapter/claude/transcript-clear.d.ts +42 -0
- package/dist/agent-adapter/claude/transcript-clear.js +217 -0
- package/dist/agent-adapter/claude/turn-machine.d.ts +3 -2
- package/dist/agent-adapter/claude/turn-machine.js +21 -68
- package/dist/agent-adapter/claude/window-warmup.d.ts +13 -0
- package/dist/agent-adapter/claude/window-warmup.js +38 -0
- package/dist/agent-adapter/continuation-phase.js +3 -0
- package/dist/agent-adapter/normalize/event-types.d.ts +8 -0
- package/dist/agent-adapter/pi/event-parser.d.ts +1 -1
- package/dist/agent-adapter/pi/event-parser.js +43 -27
- package/dist/agent-adapter/pi/mcp-bridge.d.ts +1 -1
- package/dist/agent-adapter/pi/pi-session.d.ts +2 -0
- package/dist/agent-adapter/pi/pi-session.js +15 -0
- package/dist/agent-adapter/pi/session-options.d.ts +2 -6
- package/dist/agent-adapter/pi/session-options.js +2 -11
- package/dist/agent-adapter/run-events.d.ts +10 -0
- package/dist/agent-adapter/run-events.js +2 -0
- package/dist/agent-adapter/types.d.ts +1 -1
- package/dist/client-bundle/manifest.json +1 -1
- package/dist/core/locales/en.d.ts +1 -0
- package/dist/core/locales/slices/commands.d.ts +1 -0
- package/dist/core/locales/slices/commands.js +2 -0
- package/dist/core/settings-spec.d.ts +25 -0
- package/dist/core/settings-spec.js +34 -0
- package/dist/domain/agents/engine-selection.js +1 -1
- package/dist/domain/agents/subagent/registry.d.ts +2 -0
- package/dist/domain/agents/subagent/registry.js +8 -0
- package/dist/domain/agents/subagent/runner.js +0 -1
- package/dist/domain/browser/broker.d.ts +99 -0
- package/dist/domain/browser/broker.js +487 -0
- package/dist/domain/costs/claude-account.js +21 -0
- package/dist/domain/costs/rate-limit-throttle.js +3 -1
- package/dist/domain/costs/reset-account.d.ts +2 -0
- package/dist/domain/costs/usage-service.d.ts +1 -1
- package/dist/domain/costs/usage-service.js +20 -7
- package/dist/domain/mcp/tools/ui-file.js +1 -1
- package/dist/domain/remote/device-browser.js +1 -1
- package/dist/domain/remote/device-chrome-commands.js +2 -0
- package/dist/domain/remote/device-port.js +2 -2
- package/dist/domain/runs/builders.d.ts +2 -2
- package/dist/domain/runs/builders.js +2 -3
- package/dist/domain/runs/engine-spec.d.ts +5 -0
- package/dist/domain/runs/engine-spec.js +1 -2
- package/dist/domain/runs/request.d.ts +0 -1
- package/dist/domain/sessions/session-lifecycle.d.ts +0 -4
- package/dist/domain/sessions/session-lifecycle.js +1 -1
- package/dist/domain/system/own-bin-path.d.ts +13 -0
- package/dist/domain/system/own-bin-path.js +36 -0
- package/dist/domain/system/terminal-cli/index.d.ts +58 -0
- package/dist/domain/system/terminal-cli/index.js +100 -0
- package/dist/domain/system/terminal-cli/posix-profiles.d.ts +23 -0
- package/dist/domain/system/terminal-cli/posix-profiles.js +74 -0
- package/dist/domain/system/terminal-cli/registrar.d.ts +12 -0
- package/dist/domain/system/terminal-cli/registrar.js +1 -0
- package/dist/domain/system/terminal-cli/shims.d.ts +27 -0
- package/dist/domain/system/terminal-cli/shims.js +108 -0
- package/dist/domain/system/terminal-cli/state.d.ts +7 -0
- package/dist/domain/system/terminal-cli/state.js +36 -0
- package/dist/domain/system/terminal-cli/windows-user-path.d.ts +13 -0
- package/dist/domain/system/terminal-cli/windows-user-path.js +67 -0
- package/dist/domain/tui-session/tui-session-service.js +1 -1
- package/dist/domain/tui-session/types.d.ts +1 -1
- package/dist/domain/ui-service/app-router.d.ts +17 -6
- package/dist/domain/ui-service/app-router.js +3 -1
- package/dist/domain/ui-service/assistant-snapshots.js +2 -0
- package/dist/domain/ui-service/inline-media-types.d.ts +18 -0
- package/dist/domain/ui-service/inline-media-types.js +1 -0
- package/dist/domain/ui-service/input-schemas.d.ts +17 -17
- package/dist/domain/ui-service/input-schemas.js +9 -9
- package/dist/domain/ui-service/mutate/models.d.ts +3 -0
- package/dist/domain/ui-service/mutate/models.js +21 -2
- package/dist/domain/ui-service/mutate/resolve-media.d.ts +4 -0
- package/dist/domain/ui-service/mutate/resolve-media.js +17 -0
- package/dist/domain/ui-service/mutate/sessions.js +1 -4
- package/dist/domain/ui-service/query/sessions.js +1 -1
- package/dist/domain/ui-service/types.d.ts +8 -10
- package/dist/domain/ui-service/ui-service.d.ts +9 -6
- package/dist/domain/ui-service/ui-service.js +4 -1
- package/dist/entry/app.js +23 -0
- package/dist/entry/browser-cli.d.ts +39 -0
- package/dist/entry/browser-cli.js +317 -0
- package/dist/entry/cli-help.d.ts +1 -0
- package/dist/entry/cli-help.js +30 -0
- package/dist/entry/cli.js +2 -0
- package/dist/entry/daemon.js +2 -0
- package/dist/entry/path-cli.d.ts +4 -0
- package/dist/entry/path-cli.js +65 -0
- package/dist/entry/shutdown.js +7 -0
- package/dist/entry/start-ui-http.js +8 -0
- package/dist/entry/ui-service-wiring.js +2 -0
- package/dist/events/event-types.d.ts +2 -1
- package/dist/orchestration/agent-runner.d.ts +2 -2
- package/dist/orchestration/agent-runner.js +6 -6
- package/dist/orchestration/browser-webhook.d.ts +11 -0
- package/dist/orchestration/browser-webhook.js +28 -0
- package/dist/orchestration/cache-keep-warm.d.ts +77 -0
- package/dist/orchestration/cache-keep-warm.js +213 -0
- package/dist/orchestration/claude-window-warmup.d.ts +40 -0
- package/dist/orchestration/claude-window-warmup.js +126 -0
- package/dist/orchestration/conversation-request.d.ts +4 -7
- package/dist/orchestration/conversation-request.js +1 -2
- package/dist/orchestration/delta-coalescer.d.ts +4 -2
- package/dist/orchestration/delta-coalescer.js +5 -5
- package/dist/orchestration/edit-retry.js +3 -6
- package/dist/orchestration/inline-media-eager.d.ts +13 -0
- package/dist/orchestration/inline-media-eager.js +58 -0
- package/dist/orchestration/inline-media.d.ts +22 -0
- package/dist/orchestration/inline-media.js +151 -0
- package/dist/orchestration/interactions/ask-user-resume.js +3 -7
- package/dist/orchestration/routing/commands/usage-format.js +3 -0
- package/dist/orchestration/routing/webhook.js +4 -0
- package/dist/orchestration/session-compact.js +5 -7
- package/dist/orchestration/session-events.d.ts +2 -1
- package/dist/orchestration/session-events.js +1 -0
- package/dist/orchestration/transcript-sink.d.ts +6 -0
- package/dist/orchestration/transcript-sink.js +21 -2
- package/dist/orchestration/turn/turn-prep.d.ts +0 -8
- package/dist/orchestration/turn/turn-prep.js +0 -51
- package/dist/orchestration/turn/turn.js +4 -0
- package/dist/platform/adapters/tui/ports.d.ts +1 -1
- package/dist/platform/adapters/tui/tui-transcript.js +2 -0
- package/dist/platform/browser/agent-browser.d.ts +50 -0
- package/dist/platform/browser/agent-browser.js +165 -0
- package/dist/platform/browser/managed-browser.d.ts +1 -11
- package/dist/platform/browser/managed-browser.js +4 -12
- package/dist/platform/ui-http/browser-stream.d.ts +110 -0
- package/dist/platform/ui-http/browser-stream.js +447 -0
- package/dist/platform/ui-http/ui-http-server.d.ts +12 -0
- package/dist/platform/ui-http/ui-http-server.js +23 -6
- package/dist/store/conversation-history-reader.js +8 -0
- package/dist/store/conversation-history-repo.d.ts +8 -1
- package/dist/store/conversation-history-repo.js +5 -0
- package/dist/store/session-registry-journal.d.ts +0 -8
- package/dist/store/session-registry-journal.js +5 -17
- package/dist/store/session-registry-repo.d.ts +2 -3
- package/dist/store/session-registry-repo.js +0 -2
- package/package.json +4 -2
- package/web/dist/assets/board-math-css-CB4GJ6qO.js +2 -0
- package/web/dist/assets/index-CaSZPg_H.css +1 -0
- package/web/dist/assets/index-CzOR7Edh.js +522 -0
- package/web/dist/assets/{index-DaViXAg-.js → index-cIGFv27z.js} +1 -1
- package/web/dist/index.html +3 -2
- package/web/dist/theme.css +6 -0
- package/dist/agent-adapter/browser-mcp-server.d.ts +0 -13
- package/dist/agent-adapter/browser-mcp-server.js +0 -28
- package/dist/agent-adapter/claude/browser-mcp.d.ts +0 -9
- package/dist/agent-adapter/claude/browser-mcp.js +0 -10
- package/web/dist/assets/index-Cgx3gdHV.css +0 -1
- package/web/dist/assets/index-CpZWBVHr.js +0 -494
|
@@ -401,7 +401,6 @@ function assertSessionRecord(raw, expectedId) {
|
|
|
401
401
|
boardId: toOptionalNullableString(row?.boardId ?? row?.commissionId),
|
|
402
402
|
boardBlockFor: toOptionalNullableString(row?.boardBlockFor ?? row?.commissionBlockFor),
|
|
403
403
|
contextUsage: row?.contextUsage,
|
|
404
|
-
browser: toOptionalBrowserValue(row?.browser),
|
|
405
404
|
teamLeadId: toOptionalNullableString(row?.teamLeadId),
|
|
406
405
|
workerName: toOptionalNullableString(row?.workerName),
|
|
407
406
|
workerBrief: toOptionalNullableString(row?.workerBrief),
|
|
@@ -453,18 +452,6 @@ function toOptionalNullableString(value) {
|
|
|
453
452
|
return undefined;
|
|
454
453
|
return toNullableString(value);
|
|
455
454
|
}
|
|
456
|
-
/** Replay guard for the browser opt-in. Was missing from both asserts (fields not whitelisted
|
|
457
|
-
* here are silently dropped on replay), so every restart lost per-session browser opt-ins. */
|
|
458
|
-
function toOptionalBrowserValue(value) {
|
|
459
|
-
if (value === undefined)
|
|
460
|
-
return undefined;
|
|
461
|
-
if (value === null)
|
|
462
|
-
return null;
|
|
463
|
-
const device = value.device;
|
|
464
|
-
if (typeof device !== 'string' || !device)
|
|
465
|
-
throw new Error('Invalid session registry browser option');
|
|
466
|
-
return { device };
|
|
467
|
-
}
|
|
468
455
|
function toKindValue(value) {
|
|
469
456
|
if (value === 'local' || value === 'scheduled')
|
|
470
457
|
return value;
|
|
@@ -501,7 +488,7 @@ function toTurnStatus(value) {
|
|
|
501
488
|
throw new Error('Invalid session registry turn status');
|
|
502
489
|
}
|
|
503
490
|
/** Whitelist for the `patch` payload. Every field a record can carry (minus identity) has a strict
|
|
504
|
-
* converter here; a key not listed is DROPPED on replay (
|
|
491
|
+
* converter here; a key not listed is DROPPED on replay (§8.1). */
|
|
505
492
|
const PATCH_FIELD_READERS = {
|
|
506
493
|
projectId: toStringValue,
|
|
507
494
|
channel: toStringValue,
|
|
@@ -521,7 +508,6 @@ const PATCH_FIELD_READERS = {
|
|
|
521
508
|
boardId: toOptionalNullableString,
|
|
522
509
|
boardBlockFor: toOptionalNullableString,
|
|
523
510
|
contextUsage: value => value,
|
|
524
|
-
browser: toOptionalBrowserValue,
|
|
525
511
|
teamLeadId: toOptionalNullableString,
|
|
526
512
|
workerName: toOptionalNullableString,
|
|
527
513
|
workerBrief: toOptionalNullableString,
|
|
@@ -534,13 +520,15 @@ const PATCH_KEY_SET = new Set(PATCH_KEYS);
|
|
|
534
520
|
/** Patch keys written by earlier versions. Journals keep them until compaction, so replay maps them
|
|
535
521
|
* onto current fields (null: dropped). A record row is mapped the same way in assertSessionRecord.
|
|
536
522
|
* A legacy `commissionBlockFor` holds `active:<id>`, which never equals a boardId, so such a session
|
|
537
|
-
* receives the [Board] block once. `workerRetiredAt` went when workers began folding by idle time
|
|
523
|
+
* receives the [Board] block once. `workerRetiredAt` went when workers began folding by idle time;
|
|
524
|
+
* `browser` held a per-session browser opt-in that no longer exists. */
|
|
538
525
|
const LEGACY_PATCH_KEYS = {
|
|
539
526
|
commissionId: 'boardId',
|
|
540
527
|
commissionBlockFor: 'boardBlockFor',
|
|
541
528
|
commissionDraft: null,
|
|
542
529
|
workerRetiredAt: null,
|
|
543
530
|
profileName: null,
|
|
531
|
+
browser: null,
|
|
544
532
|
};
|
|
545
533
|
function patchKeyOf(key) {
|
|
546
534
|
return Object.hasOwn(LEGACY_PATCH_KEYS, key) ? LEGACY_PATCH_KEYS[key] : key;
|
|
@@ -610,7 +598,7 @@ function assertPartialTurn(raw) {
|
|
|
610
598
|
return fields;
|
|
611
599
|
}
|
|
612
600
|
/** Whitelist for the `conversation set` payload. A key not listed is DROPPED on replay (the same
|
|
613
|
-
*
|
|
601
|
+
* trap that silently lost fields, §8.1) — keep in lock-step with the header. */
|
|
614
602
|
const CONVERSATION_FIELD_READERS = {
|
|
615
603
|
sessionId: toTurnNullableString,
|
|
616
604
|
backend: toStringValue,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EngineSelection } from '../domain/agents/engine-selection.js';
|
|
2
2
|
import type { SessionContextUsage } from '../core/types/agent-types.js';
|
|
3
|
-
import { type ConversationFields, type ConversationHeader, type SessionDeleteCleanup, type
|
|
3
|
+
import { type ConversationFields, type ConversationHeader, type SessionDeleteCleanup, type SessionOrigin, type SessionRecord, type SessionRegistryJournalOptions, type TurnRecord } from './session-registry-journal.js';
|
|
4
4
|
export declare const REGISTRY_FILE: string;
|
|
5
5
|
export { type SessionOrigin, type TurnRecord, type ConversationFields, type ConversationHeader, };
|
|
6
6
|
/** In-memory channel→sessionId resolver (never persisted). A resolver that returns a string wins
|
|
@@ -16,7 +16,7 @@ export interface PendingDeletion {
|
|
|
16
16
|
}
|
|
17
17
|
export type SessionRegistryData = Record<string, Session>;
|
|
18
18
|
export type SessionRegistryRepoOptions = SessionRegistryJournalOptions;
|
|
19
|
-
type UpdateFields = Partial<Pick<Session, 'lastUsedAt' | 'label' | 'selection' | 'backend' | 'agentName' | 'backendSessionId' | 'contextUsage'
|
|
19
|
+
type UpdateFields = Partial<Pick<Session, 'lastUsedAt' | 'label' | 'selection' | 'backend' | 'agentName' | 'backendSessionId' | 'contextUsage'>> & {
|
|
20
20
|
sessionId?: never;
|
|
21
21
|
};
|
|
22
22
|
export interface RegisterSessionOpts {
|
|
@@ -31,7 +31,6 @@ export interface RegisterSessionOpts {
|
|
|
31
31
|
agentName?: string | null;
|
|
32
32
|
backendSessionId?: string | null;
|
|
33
33
|
scheduleId?: string | null;
|
|
34
|
-
browser?: SessionBrowserOption | null;
|
|
35
34
|
boardId?: string | null;
|
|
36
35
|
teamLeadId?: string | null;
|
|
37
36
|
workerName?: string | null;
|
|
@@ -96,7 +96,6 @@ export class SessionRegistryRepo {
|
|
|
96
96
|
agentName: opts.agentName ?? null,
|
|
97
97
|
backendSessionId: opts.backendSessionId ?? null,
|
|
98
98
|
scheduleId: opts.scheduleId ?? null,
|
|
99
|
-
browser: opts.browser ?? null,
|
|
100
99
|
boardId: opts.boardId ?? null,
|
|
101
100
|
...(opts.teamLeadId
|
|
102
101
|
? {
|
|
@@ -133,7 +132,6 @@ export class SessionRegistryRepo {
|
|
|
133
132
|
backendSessionId: updates.backendSessionId !== undefined
|
|
134
133
|
? updates.backendSessionId
|
|
135
134
|
: current.backendSessionId,
|
|
136
|
-
browser: updates.browser !== undefined ? updates.browser : current.browser,
|
|
137
135
|
contextUsage: updates.contextUsage !== undefined ? updates.contextUsage : current.contextUsage,
|
|
138
136
|
});
|
|
139
137
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortex-agent/server",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Agent workbench for auto research, self-improvement loops, and long-running work — multi-agent teams, persistent project memory, cross-machine GPU training.",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=22.19.0"
|
|
9
9
|
},
|
|
10
10
|
"main": "dist/entry/app.js",
|
|
11
11
|
"bin": {
|
|
12
12
|
"cortex": "dist/entry/cortex-cli.js",
|
|
13
|
+
"cortex-browser": "dist/entry/browser-cli.js",
|
|
13
14
|
"cortex-evidence-export": "dist/entry/production-evidence-export-cli.js",
|
|
14
15
|
"cortex-hook": "dist/entry/hook-cli.js",
|
|
15
16
|
"cortex-signal": "dist/entry/signal-cli.js"
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
"@slack/bolt": "^4.6.0",
|
|
50
51
|
"@slack/web-api": "^7.14.1",
|
|
51
52
|
"@trpc/server": "^11",
|
|
53
|
+
"agent-browser": "0.39.1",
|
|
52
54
|
"aistatus": "~0.0.11",
|
|
53
55
|
"dotenv": "^16.4.7",
|
|
54
56
|
"ink": "^5.2.1",
|