@cortex-agent/server 2026.9.15 → 2026.9.25
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 +3 -2
- package/defaults/config/hooks/08-agents-md-injector-post-tool.json +10 -0
- package/defaults/config/hooks/{10-cortex-md-injector-session-start.json → 10-agents-md-injector-session-start.json} +3 -3
- package/defaults/config/hooks/{CORTEX.md → AGENTS.md} +2 -2
- package/defaults/config/thread-templates/agents/creative.json +17 -0
- package/defaults/hooks/{CORTEX.md → AGENTS.md} +1 -1
- package/defaults/hooks/{cortex-md-injector.mjs → agents-md-injector.mjs} +117 -26
- package/defaults/hooks/cortex-hook-api.mjs +2 -2
- package/defaults/hooks/new-session-hook.mjs +2 -2
- package/defaults/hooks/rules-loader.mjs +2 -2
- package/defaults/hooks/status-md-guard.mjs +8 -8
- package/defaults/hooks/task-status-check.mjs +18 -76
- package/defaults/hooks/tasks-yaml-guard.mjs +2 -2
- package/defaults/plugins/cortex-feishu/skills/feishu-doc/SKILL.md +1 -1
- package/defaults/plugins/cortex-system/skills/client-manage/SKILL.md +2 -2
- package/defaults/plugins/cortex-system/skills/project-init/SKILL.md +4 -4
- package/defaults/plugins/cortex-system/skills/task/SKILL.md +1 -1
- package/defaults/prompts/systemPrompts/creative.md +13 -0
- package/defaults/prompts/systemPrompts/direct.md +1 -1
- package/defaults/rules/{cortex-md.md → agents-md.md} +4 -4
- package/defaults/rules/decision-records.md +1 -1
- package/defaults/rules/meta-conventions.md +4 -4
- package/defaults/rules/mission-md.md +1 -1
- package/dist/agent-adapter/claude/adapter.d.ts +12 -0
- package/dist/agent-adapter/claude/adapter.js +19 -1
- package/dist/agent-adapter/claude/hooks-builder.js +2 -2
- package/dist/agent-adapter/claude/spawn-args.d.ts +7 -0
- package/dist/agent-adapter/claude/spawn-args.js +14 -0
- package/dist/agent-adapter/claude/turn-machine.d.ts +11 -0
- package/dist/agent-adapter/claude/turn-machine.js +46 -5
- package/dist/agent-adapter/normalize/prompt-builder.d.ts +16 -1
- package/dist/agent-adapter/normalize/prompt-builder.js +24 -6
- package/dist/agent-adapter/pi/child-runner.d.ts +4 -2
- package/dist/agent-adapter/pi/child-runner.js +5 -1
- package/dist/agent-adapter/pi/event-parser.d.ts +3 -2
- package/dist/agent-adapter/pi/event-parser.js +46 -2
- package/dist/agent-adapter/pi/extensions.d.ts +7 -1
- package/dist/agent-adapter/pi/extensions.js +10 -3
- package/dist/agent-adapter/pi/mcp-bridge.js +8 -8
- package/dist/agent-adapter/pi/pi-session.js +5 -0
- package/dist/agent-adapter/pi/runtime.js +3 -0
- package/dist/agent-adapter/pi/session-options.js +5 -1
- package/dist/agent-adapter/pi/subagent.d.ts +15 -3
- package/dist/agent-adapter/pi/subagent.js +18 -0
- package/dist/agent-adapter/pi/tool-shims.d.ts +6 -1
- package/dist/agent-adapter/pi/tool-shims.js +34 -1
- package/dist/agent-adapter/types.d.ts +6 -0
- package/dist/core/agents/subagent/types.d.ts +3 -0
- package/dist/core/config-generator.js +17 -2
- package/dist/core/debug-mode.d.ts +11 -10
- package/dist/core/debug-mode.js +12 -18
- package/dist/core/exec-async.d.ts +26 -0
- package/dist/core/exec-async.js +47 -0
- package/dist/core/locales/en.d.ts +14 -1
- package/dist/core/locales/slices/commands.d.ts +12 -1
- package/dist/core/locales/slices/commands.js +24 -2
- package/dist/core/locales/slices/startup.d.ts +2 -0
- package/dist/core/locales/slices/startup.js +4 -0
- package/dist/core/mcp-tool-gate.js +1 -0
- package/dist/core/media-types.d.ts +10 -0
- package/dist/core/media-types.js +34 -0
- package/dist/core/platform-settings-spec.js +1 -1
- package/dist/core/rebuild-progress.d.ts +58 -0
- package/dist/core/rebuild-progress.js +103 -0
- package/dist/core/resilient-watch.js +5 -3
- package/dist/core/run-registry.d.ts +7 -0
- package/dist/core/run-registry.js +6 -0
- package/dist/core/settings-spec.d.ts +21 -0
- package/dist/core/settings-spec.js +28 -1
- package/dist/core/types/agent-types.d.ts +3 -1
- package/dist/core/types/thread-types.d.ts +23 -4
- package/dist/core/utils.d.ts +1 -1
- package/dist/core/utils.js +1 -1
- package/dist/domain/agents/agent-state.d.ts +7 -0
- package/dist/domain/agents/agent-state.js +9 -1
- package/dist/domain/agents/agent-switch.d.ts +38 -0
- package/dist/domain/agents/agent-switch.js +106 -0
- package/dist/domain/agents/config.d.ts +20 -2
- package/dist/domain/agents/config.js +58 -4
- package/dist/domain/agents/index.d.ts +1 -0
- package/dist/domain/agents/index.js +1 -0
- package/dist/domain/agents/profile-manager.d.ts +6 -0
- package/dist/domain/agents/profile-manager.js +14 -1
- package/dist/domain/executions/registry.d.ts +3 -2
- package/dist/domain/executions/registry.js +84 -10
- package/dist/domain/mcp/bundled-server.js +4 -3
- package/dist/domain/mcp/feishu/file.js +37 -18
- package/dist/domain/mcp/feishu/types.d.ts +3 -0
- package/dist/domain/mcp/feishu-server.js +1 -1
- package/dist/domain/mcp/tools/{cortex-md.d.ts → agents-md.d.ts} +6 -6
- package/dist/domain/mcp/tools/{cortex-md.js → agents-md.js} +6 -6
- package/dist/domain/mcp/tools/remote-file.d.ts +20 -0
- package/dist/domain/mcp/tools/remote-file.js +44 -0
- package/dist/domain/mcp/tools/slack.d.ts +2 -0
- package/dist/domain/mcp/tools/slack.js +22 -7
- package/dist/domain/mcp/tools/task-ops.js +5 -13
- package/dist/domain/mcp/tools/ui-file.js +23 -10
- package/dist/domain/mcp/tools/waitpoint.d.ts +3 -0
- package/dist/domain/mcp/tools/waitpoint.js +122 -0
- package/dist/domain/memory/agents-md-injector.d.ts +24 -0
- package/dist/domain/memory/{cortex-md-injector.js → agents-md-injector.js} +10 -7
- package/dist/domain/plugins/runtime.js +1 -1
- package/dist/domain/plugins/skill-projection.d.ts +8 -2
- package/dist/domain/plugins/skill-projection.js +76 -19
- package/dist/domain/projects/project-store.d.ts +1 -1
- package/dist/domain/projects/project-store.js +3 -3
- package/dist/domain/remote/client-bootstrap.js +1 -1
- package/dist/domain/remote/client-hot-reload.d.ts +1 -1
- package/dist/domain/remote/client-hot-reload.js +30 -24
- package/dist/domain/remote/client-manager.js +39 -119
- package/dist/domain/remote/cortex-client-config.d.ts +1 -1
- package/dist/domain/remote/cortex-client-config.js +1 -1
- package/dist/domain/remote/device-file.d.ts +51 -0
- package/dist/domain/remote/device-file.js +193 -0
- package/dist/domain/remote/device-port.js +3 -0
- package/dist/domain/remote/reverse-stream.d.ts +18 -7
- package/dist/domain/remote/reverse-stream.js +19 -6
- package/dist/domain/runs/engine-spec.js +4 -0
- package/dist/domain/runs/request.d.ts +6 -0
- package/dist/domain/runs/run.js +1 -0
- package/dist/domain/runs/spec-loader.d.ts +4 -3
- package/dist/domain/runs/spec-loader.js +4 -3
- package/dist/domain/scheduling/jobs/sync-public.js +6 -6
- package/dist/domain/scheduling/scheduler.js +14 -12
- package/dist/domain/sessions/session-lifecycle.d.ts +5 -0
- package/dist/domain/sessions/session-lifecycle.js +13 -1
- package/dist/domain/system/rebuild-hold.d.ts +44 -0
- package/dist/domain/system/rebuild-hold.js +91 -0
- package/dist/domain/system/server-update-check.d.ts +2 -1
- package/dist/domain/system/server-update-check.js +15 -13
- package/dist/domain/tasks/archiver.js +21 -13
- package/dist/domain/tasks/claim-recovery.js +2 -2
- package/dist/domain/tasks/dispatch-utils.d.ts +10 -1
- package/dist/domain/tasks/dispatch-utils.js +46 -1
- package/dist/domain/tasks/dispatcher.js +4 -5
- package/dist/domain/tasks/mutator.d.ts +2 -2
- package/dist/domain/tasks/mutator.js +62 -61
- package/dist/domain/tasks/system/task-cli.js +2 -2
- package/dist/domain/tasks/system/task-completion.d.ts +7 -2
- package/dist/domain/tasks/system/task-completion.js +69 -6
- package/dist/domain/tasks/system/task-lifecycle-edit.d.ts +6 -1
- package/dist/domain/tasks/system/task-lifecycle-edit.js +21 -2
- package/dist/domain/tasks/system/task-lock.d.ts +23 -0
- package/dist/domain/tasks/system/task-lock.js +29 -1
- package/dist/domain/tasks/system/task-mutations.d.ts +14 -1
- package/dist/domain/tasks/system/task-mutations.js +25 -2
- package/dist/domain/tasks/system/task-state.d.ts +12 -1
- package/dist/domain/tasks/system/task-state.js +20 -3
- package/dist/domain/threads/prompt-builder.d.ts +9 -6
- package/dist/domain/threads/prompt-builder.js +28 -10
- package/dist/domain/threads/runner.js +10 -4
- package/dist/domain/threads/state-machine.js +15 -11
- package/dist/domain/threads/template-loader.js +6 -4
- package/dist/domain/threads/template-validate.d.ts +43 -6
- package/dist/domain/threads/template-validate.js +12 -0
- package/dist/domain/ui-service/app-router.d.ts +34 -3
- package/dist/domain/ui-service/app-router.js +9 -14
- package/dist/domain/ui-service/input-schemas.d.ts +28 -5
- package/dist/domain/ui-service/input-schemas.js +24 -9
- package/dist/domain/ui-service/mutate/platform-settings.js +1 -1
- package/dist/domain/ui-service/mutate/sessions.d.ts +6 -1
- package/dist/domain/ui-service/mutate/sessions.js +54 -0
- package/dist/domain/ui-service/mutate/tasks.js +4 -3
- package/dist/domain/ui-service/mutate/waitpoints.d.ts +2 -0
- package/dist/domain/ui-service/mutate/waitpoints.js +20 -0
- package/dist/domain/ui-service/platform-settings.js +1 -1
- package/dist/domain/ui-service/plugins-shared.js +1 -1
- package/dist/domain/ui-service/query/config.js +20 -2
- package/dist/domain/ui-service/query/executions.js +0 -2
- package/dist/domain/ui-service/query/machine-detail.js +3 -8
- package/dist/domain/ui-service/query/memory.js +29 -35
- package/dist/domain/ui-service/query/sessions.js +96 -12
- package/dist/domain/ui-service/query/system.js +19 -0
- package/dist/domain/ui-service/query/threads.js +1 -54
- package/dist/domain/ui-service/query/waitpoints.d.ts +30 -0
- package/dist/domain/ui-service/query/waitpoints.js +117 -0
- package/dist/domain/ui-service/query-input-schemas.d.ts +4 -0
- package/dist/domain/ui-service/query-input-schemas.js +5 -0
- package/dist/domain/ui-service/trpc.js +1 -1
- package/dist/domain/ui-service/types.d.ts +229 -51
- package/dist/domain/ui-service/types.js +1 -1
- package/dist/domain/ui-service/ui-service.js +8 -31
- package/dist/domain/waitpoints/notices.d.ts +21 -0
- package/dist/domain/waitpoints/notices.js +115 -0
- package/dist/domain/waitpoints/service.d.ts +91 -0
- package/dist/domain/waitpoints/service.js +243 -0
- package/dist/entry/app.js +52 -11
- package/dist/entry/auth-login-cli.js +1 -1
- package/dist/entry/auth-login-terminal.js +1 -1
- package/dist/entry/daemon-notice.d.ts +10 -1
- package/dist/entry/daemon-notice.js +16 -1
- package/dist/entry/daemon.d.ts +43 -2
- package/dist/entry/daemon.js +163 -9
- package/dist/entry/init-auth.js +1 -1
- package/dist/entry/init.js +6 -6
- package/dist/entry/signal-cli.d.ts +30 -0
- package/dist/entry/signal-cli.js +207 -0
- package/dist/entry/start-ui-http.d.ts +1 -1
- package/dist/entry/start-ui-http.js +2 -2
- package/dist/events/event-types.d.ts +0 -7
- package/dist/hooks/{cortex-md-injector.mjs → agents-md-injector.mjs} +117 -26
- package/dist/hooks/cortex-hook-api.mjs +2 -2
- package/dist/hooks/new-session-hook.mjs +2 -2
- package/dist/hooks/rules-loader.mjs +2 -2
- package/dist/hooks/status-md-guard.mjs +8 -8
- package/dist/hooks/task-status-check.mjs +18 -76
- package/dist/hooks/tasks-yaml-guard.mjs +2 -2
- package/dist/orchestration/agent-file-send.d.ts +9 -0
- package/dist/orchestration/agent-file-send.js +21 -2
- package/dist/orchestration/agent-runner.d.ts +3 -2
- package/dist/orchestration/agent-runner.js +33 -12
- package/dist/orchestration/attachments-store.d.ts +31 -0
- package/dist/orchestration/attachments-store.js +184 -0
- package/dist/orchestration/conversation-request.d.ts +37 -0
- package/dist/orchestration/conversation-request.js +91 -22
- package/dist/orchestration/interactions/plan-approvals.js +1 -1
- package/dist/orchestration/mid-turn-inject.d.ts +3 -0
- package/dist/orchestration/mid-turn-inject.js +9 -4
- package/dist/orchestration/outputs-store.d.ts +11 -0
- package/dist/orchestration/outputs-store.js +32 -6
- package/dist/orchestration/resume-dispatcher.js +4 -2
- package/dist/orchestration/routing/commands/mode.js +114 -63
- package/dist/orchestration/routing/file-handler.d.ts +23 -2
- package/dist/orchestration/routing/file-handler.js +22 -5
- package/dist/orchestration/routing/webhook.js +193 -39
- package/dist/orchestration/session-gateway.d.ts +1 -1
- package/dist/orchestration/session-gateway.js +1 -0
- package/dist/orchestration/thread-executor.d.ts +2 -0
- package/dist/orchestration/thread-executor.js +24 -1
- package/dist/orchestration/thread-input.d.ts +3 -2
- package/dist/orchestration/thread-input.js +8 -9
- package/dist/orchestration/turn/turn-prep.d.ts +15 -1
- package/dist/orchestration/turn/turn-prep.js +19 -8
- package/dist/orchestration/turn/turn.js +1 -0
- package/dist/orchestration/waitpoint-ingress.d.ts +41 -0
- package/dist/orchestration/waitpoint-ingress.js +172 -0
- package/dist/orchestration/waitpoint-notifier.d.ts +21 -0
- package/dist/orchestration/waitpoint-notifier.js +119 -0
- package/dist/orchestration/waitpoint-remote-drain.d.ts +20 -0
- package/dist/orchestration/waitpoint-remote-drain.js +147 -0
- package/dist/orchestration/waitpoint-sweep.d.ts +42 -0
- package/dist/orchestration/waitpoint-sweep.js +87 -0
- package/dist/platform/adapters/feishu-image.d.ts +19 -0
- package/dist/platform/adapters/feishu-image.js +71 -0
- package/dist/platform/adapters/feishu.d.ts +2 -0
- package/dist/platform/adapters/feishu.js +26 -16
- package/dist/platform/ui-http/listening-ports.d.ts +1 -1
- package/dist/platform/ui-http/listening-ports.js +1 -1
- package/dist/platform/ui-http/ui-session.js +1 -1
- package/dist/store/conversation-display-projection.d.ts +9 -1
- package/dist/store/conversation-display-projection.js +13 -6
- package/dist/store/conversation-history-reader.d.ts +19 -0
- package/dist/store/conversation-history-reader.js +163 -44
- package/dist/store/conversation-history-repo.d.ts +37 -10
- package/dist/store/conversation-history-repo.js +161 -139
- package/dist/store/conversation-ledger-repo.js +1 -1
- package/dist/store/execution-repo.d.ts +1 -19
- package/dist/store/execution-repo.js +1 -18
- package/dist/store/project-notes-repo.js +11 -2
- package/dist/store/prompt-migration-replacements.js +1 -1
- package/dist/store/session-registry-import.js +1 -1
- package/dist/store/session-registry-journal.d.ts +4 -0
- package/dist/store/session-registry-journal.js +5 -1
- package/dist/store/session-registry-repo.d.ts +2 -1
- package/dist/store/session-registry-repo.js +3 -1
- package/dist/store/task-repo.d.ts +6 -3
- package/dist/store/task-repo.js +26 -10
- package/dist/store/version-migrations.d.ts +13 -3
- package/dist/store/version-migrations.js +254 -24
- package/dist/store/waitpoint-repo.d.ts +108 -0
- package/dist/store/waitpoint-repo.js +94 -0
- package/package.json +3 -2
- package/web/dist/AGENTS.md +10 -0
- package/web/dist/assets/index-B1dBi8Za.css +1 -0
- package/web/dist/assets/{index-CEZ0DSei.js → index-BAeLybF0.js} +1 -1
- package/web/dist/assets/index-BcQI8Fh5.js +445 -0
- package/web/dist/index.html +12 -4
- package/web/dist/theme.css +211 -40
- package/defaults/config/hooks/08-cortex-md-injector-post-tool.json +0 -10
- package/dist/domain/executions/log-tailer.d.ts +0 -71
- package/dist/domain/executions/log-tailer.js +0 -194
- package/dist/domain/memory/cortex-md-injector.d.ts +0 -24
- package/dist/domain/memory/cortex-md-scanner.d.ts +0 -10
- package/dist/domain/memory/cortex-md-scanner.js +0 -66
- package/dist/domain/remote/cortex-client.d.ts +0 -1
- package/dist/domain/remote/cortex-client.js +0 -662
- package/dist/domain/tasks/system/cortex-run.d.ts +0 -25
- package/dist/domain/tasks/system/cortex-run.js +0 -360
- package/web/dist/assets/index-CRDJo39X.css +0 -1
- package/web/dist/assets/index-DjuPJVZE.js +0 -444
- /package/defaults/{CORTEX.md → AGENTS.md} +0 -0
- /package/defaults/config/{CORTEX.md → AGENTS.md} +0 -0
- /package/defaults/context/{CORTEX.md → AGENTS.md} +0 -0
- /package/defaults/context/ideas/{CORTEX.md → AGENTS.md} +0 -0
- /package/defaults/context/projects/{CORTEX.md → AGENTS.md} +0 -0
- /package/defaults/context/scans/{CORTEX.md → AGENTS.md} +0 -0
- /package/defaults/context/user/{CORTEX.md → AGENTS.md} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { effectiveBackendSessionId } from '../../../store/session-registry-repo.js';
|
|
2
|
+
import { countWaitingOn } from './waitpoints.js';
|
|
2
3
|
import { sessionTotalsCarry } from '../../../store/session-totals-repo.js';
|
|
3
4
|
import { addTotalsAcc, emptyTotalsAcc, foldExecution, toSessionTotals, } from '../../../store/session-totals.js';
|
|
4
5
|
import { projectCompactHistory, projectSubagentHistory } from '../../../store/conversation-display-projection.js';
|
|
5
|
-
import { isDebugMode
|
|
6
|
+
import { isDebugMode } from '../../../core/debug-mode.js';
|
|
6
7
|
export async function handleSessionsList(deps, params) {
|
|
7
8
|
const { projectId, resumable, origin } = params;
|
|
8
9
|
let sessions;
|
|
@@ -67,6 +68,21 @@ export async function handleSessionsList(deps, params) {
|
|
|
67
68
|
const live = totalsBySession.get(sessionId);
|
|
68
69
|
totalsBySession.set(sessionId, addTotalsAcc(live ?? emptyTotalsAcc(), carried));
|
|
69
70
|
}
|
|
71
|
+
// Every row asks the same question — can this session's profile compact? — and the answer is a
|
|
72
|
+
// function of (backend, profileName) alone, of which a list holds a handful. Asking per row made
|
|
73
|
+
// a 300-session list resolve (and revalidate) profiles.json 300 times per request.
|
|
74
|
+
const compactionByProfile = new Map();
|
|
75
|
+
const supportsCompaction = (session) => {
|
|
76
|
+
if (!deps.supportsSessionCompaction)
|
|
77
|
+
return false;
|
|
78
|
+
const key = `${session.backend}\u0000${session.profileName ?? ''}`;
|
|
79
|
+
const known = compactionByProfile.get(key);
|
|
80
|
+
if (known !== undefined)
|
|
81
|
+
return known;
|
|
82
|
+
const supported = deps.supportsSessionCompaction(session);
|
|
83
|
+
compactionByProfile.set(key, supported);
|
|
84
|
+
return supported;
|
|
85
|
+
};
|
|
70
86
|
const resolveNumTurns = (sessionId, inTurn, liveNumTurns) => {
|
|
71
87
|
if (inTurn)
|
|
72
88
|
return liveNumTurns;
|
|
@@ -79,6 +95,11 @@ export async function handleSessionsList(deps, params) {
|
|
|
79
95
|
return null;
|
|
80
96
|
return sessionId ? (lastRunBySession.get(sessionId)?.costUsd ?? null) : null;
|
|
81
97
|
};
|
|
98
|
+
// Armed waitpoints, fetched once for the whole page (the repo read is an in-memory cache hit).
|
|
99
|
+
// Counted per session by the shared ownership rule so `waitingOn` and `waitpoints.list` can never
|
|
100
|
+
// disagree. Absent dep (fixtures / TUI) ⇒ every session reports 0.
|
|
101
|
+
const armedWaitpoints = deps.waitpointRegistry ? await deps.waitpointRegistry.listArmed() : [];
|
|
102
|
+
const waitingOnBySession = countWaitingOn(armedWaitpoints, sessions.map((s) => ({ sessionId: s.sessionId, channel: s.channel ?? null })));
|
|
82
103
|
const infos = sessions.map((s) => {
|
|
83
104
|
// Busy snapshot: the registry's single answer for this session. Snapshot + delta — this field
|
|
84
105
|
// is the queryable snapshot, the `session.status` event stream is the delta.
|
|
@@ -118,16 +139,19 @@ export async function handleSessionsList(deps, params) {
|
|
|
118
139
|
resumable: s.kind !== 'scheduled',
|
|
119
140
|
label: s.label ?? null,
|
|
120
141
|
profileName: s.profileName ?? null,
|
|
142
|
+
// The environment half of the same question: which agent template the session runs as.
|
|
143
|
+
agentName: s.agentName ?? null,
|
|
121
144
|
// The other half of "what will the next turn run": the profile alone would misreport every
|
|
122
145
|
// session whose model or thinking level the user picked in the composer.
|
|
123
146
|
selectionOverride: deps.getChannelSelectionOverride?.(s.channel) ?? null,
|
|
124
147
|
browser: s.browser ?? null,
|
|
125
148
|
contextUsage: s.contextUsage ?? null,
|
|
126
149
|
todos: deps.getSessionTodos?.(s.sessionId) ?? null,
|
|
127
|
-
contextCompactionSupported:
|
|
150
|
+
contextCompactionSupported: supportsCompaction({ backend: s.backend, profileName: s.profileName ?? null }),
|
|
128
151
|
running,
|
|
129
152
|
backgroundRunning: bgHeld,
|
|
130
153
|
awaitingInput,
|
|
154
|
+
waitingOn: waitingOnBySession.get(s.sessionId) ?? 0,
|
|
131
155
|
numTurns: resolveNumTurns(s.sessionId, inTurn, state.numTurns),
|
|
132
156
|
costUsd: resolveCost(s.sessionId, inTurn),
|
|
133
157
|
// Cumulative over every finished run this session has had (plus its Agent-tool children's
|
|
@@ -174,8 +198,9 @@ function transcriptDebugDetails(ev) {
|
|
|
174
198
|
return undefined;
|
|
175
199
|
if (ev.type !== 'tool')
|
|
176
200
|
return ev.debug;
|
|
177
|
-
|
|
178
|
-
|
|
201
|
+
// Stamped by the fold from the row's own serialized size; the query trusts it rather than
|
|
202
|
+
// re-weighing the parsed input once per tool row per request.
|
|
203
|
+
const warned = ev.debug.overCharacterThreshold === true;
|
|
179
204
|
if (!ev.debug.toolRef && !warned)
|
|
180
205
|
return undefined;
|
|
181
206
|
return {
|
|
@@ -290,6 +315,55 @@ async function compactHistory(deps, sessionId) {
|
|
|
290
315
|
const history = await deps.conversationHistory.getHistory(sessionId, { includeToolDebug: false });
|
|
291
316
|
return history ? projectCompactHistory(history) : null;
|
|
292
317
|
}
|
|
318
|
+
/** Compact history plus the cursor a client passes back as `since`. Stores that cannot produce a
|
|
319
|
+
* cursor simply do not get deltas — every response stays a full transcript. */
|
|
320
|
+
async function compactHistoryAt(deps, sessionId) {
|
|
321
|
+
if (deps.conversationHistory.getCompactHistoryAt) {
|
|
322
|
+
return deps.conversationHistory.getCompactHistoryAt(sessionId);
|
|
323
|
+
}
|
|
324
|
+
return { value: await compactHistory(deps, sessionId), cursor: undefined };
|
|
325
|
+
}
|
|
326
|
+
/** A row whose rendered form depends on wall-clock time or live server state rather than on the
|
|
327
|
+
* stored history, so its revision cannot say whether it changed. Always re-sent in a delta. */
|
|
328
|
+
function isVolatileRow(event) {
|
|
329
|
+
// Only a PENDING interaction is derived: its card can expire on the clock or flip when the
|
|
330
|
+
// server stops holding the question open. Once resolved the row renders from stored fields.
|
|
331
|
+
return event.type === 'interaction' && !!event.id && (event.status ?? 'pending') === 'pending';
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Rows added or changed since `sinceRev`. Walks the whole event stream — `elapsedMs` is a
|
|
335
|
+
* difference against the PREVIOUS row, so the running timestamp has to be carried across rows that
|
|
336
|
+
* are not being sent — but only builds a DTO for the rows it emits, which is the part that costs.
|
|
337
|
+
*/
|
|
338
|
+
function transcriptDeltaRows(deps, events, revs, sinceRev) {
|
|
339
|
+
const changed = [];
|
|
340
|
+
let previousMs = null;
|
|
341
|
+
events.forEach((event, index) => {
|
|
342
|
+
const elapsed = eventElapsedMs(event, previousMs);
|
|
343
|
+
previousMs = nextPreviousMs(event);
|
|
344
|
+
if ((revs[index] ?? 0) <= sinceRev && !isVolatileRow(event))
|
|
345
|
+
return;
|
|
346
|
+
changed.push({ index, turnIndex: event.turnIndex, message: messageFromEvent(deps, event, elapsed) });
|
|
347
|
+
});
|
|
348
|
+
return changed;
|
|
349
|
+
}
|
|
350
|
+
/** `<epoch>:<revision>`; a differing epoch means the session was rewritten and the cursor is void. */
|
|
351
|
+
function parseCursor(cursor) {
|
|
352
|
+
if (!cursor)
|
|
353
|
+
return null;
|
|
354
|
+
const at = cursor.lastIndexOf(':');
|
|
355
|
+
if (at <= 0)
|
|
356
|
+
return null;
|
|
357
|
+
const revision = Number(cursor.slice(at + 1));
|
|
358
|
+
return Number.isSafeInteger(revision) && revision >= 0 ? { epoch: cursor.slice(0, at), revision } : null;
|
|
359
|
+
}
|
|
360
|
+
function transcriptDelta(deps, events, revs, since, cursor) {
|
|
361
|
+
const from = parseCursor(since);
|
|
362
|
+
const now = parseCursor(cursor);
|
|
363
|
+
if (!from || !now || !revs || from.epoch !== now.epoch || from.revision > now.revision)
|
|
364
|
+
return null;
|
|
365
|
+
return { changed: transcriptDeltaRows(deps, events, revs, from.revision), total: events.length };
|
|
366
|
+
}
|
|
293
367
|
async function subagentHistory(deps, sessionId, subagentId) {
|
|
294
368
|
if (deps.conversationHistory.getSubagentHistory) {
|
|
295
369
|
return deps.conversationHistory.getSubagentHistory(sessionId, subagentId);
|
|
@@ -309,8 +383,21 @@ async function fullTranscript(deps, params, pendingSnapshot) {
|
|
|
309
383
|
return sessionTranscript(deps, params.sessionId, history?.events ?? [], pendingMessages(pendingSnapshot, history?.committedSourceIds));
|
|
310
384
|
}
|
|
311
385
|
async function compactTranscript(deps, params, pendingSnapshot) {
|
|
312
|
-
const history = await
|
|
313
|
-
|
|
386
|
+
const { value: history, cursor } = await compactHistoryAt(deps, params.sessionId);
|
|
387
|
+
const events = history?.events ?? [];
|
|
388
|
+
const pendingUserMessages = pendingMessages(pendingSnapshot, history?.committedSourceIds);
|
|
389
|
+
const subagentSummaries = history?.subagentSummaries ?? [];
|
|
390
|
+
// Pending messages and subagent summaries are per-session, not per-row, and small: they ride
|
|
391
|
+
// every response whole, so a delta only ever has to describe transcript ROWS.
|
|
392
|
+
const delta = cursor === undefined
|
|
393
|
+
? null
|
|
394
|
+
: transcriptDelta(deps, events, history?.eventRevs, params.since, cursor);
|
|
395
|
+
// Built only when it is going to be sent — assembling every row's DTO is the server-side cost a
|
|
396
|
+
// delta exists to avoid, so the whole-transcript path must not run underneath it.
|
|
397
|
+
if (delta)
|
|
398
|
+
return { sessionId: params.sessionId, turns: [], pendingUserMessages, subagentSummaries, cursor, delta };
|
|
399
|
+
const base = sessionTranscript(deps, params.sessionId, events, pendingUserMessages, subagentSummaries);
|
|
400
|
+
return cursor === undefined ? base : { ...base, cursor };
|
|
314
401
|
}
|
|
315
402
|
export async function handleSessionsTranscript(deps, params) {
|
|
316
403
|
const pendingSnapshot = await pendingUserSnapshot(deps, params.sessionId);
|
|
@@ -329,12 +416,9 @@ export async function handleSessionsSubagentTranscript(deps, params) {
|
|
|
329
416
|
export async function handleSessionsDebugDetails(deps, params) {
|
|
330
417
|
if (!isDebugMode() || !deps.conversationHistory.getToolDebugDetails)
|
|
331
418
|
return null;
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
if (!isDebugToolOverWarningThreshold(details))
|
|
336
|
-
return details;
|
|
337
|
-
return { ...details, overCharacterThreshold: true };
|
|
419
|
+
// The store stamps `overCharacterThreshold` while it reads the rows, so there is nothing left
|
|
420
|
+
// to derive here.
|
|
421
|
+
return await deps.conversationHistory.getToolDebugDetails(params.sessionId, params.ref);
|
|
338
422
|
}
|
|
339
423
|
// ── sessions.pendingInteraction ───────────────────────────────────
|
|
340
424
|
// Returns the current pending ask-user or plan approval for a session, if any.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import { STORE_DIR } from '../../../core/paths.js';
|
|
4
|
+
import { readRebuildProgress } from '../../../core/rebuild-progress.js';
|
|
4
5
|
import { getThrottleState } from '../../costs/rate-limit-throttle.js';
|
|
5
6
|
import { getResumeCountsByProvider } from '../../costs/resume-registry.js';
|
|
6
7
|
import { usageService } from '../../costs/usage-service.js';
|
|
@@ -116,8 +117,26 @@ export async function handleSystemDaemonStatus(_params) {
|
|
|
116
117
|
return {
|
|
117
118
|
processes,
|
|
118
119
|
lastRestart: { at: lastRestartAt, reason: lastRestartReason },
|
|
120
|
+
rebuild: liveRebuildProgress(daemonPid, daemonAlive),
|
|
119
121
|
};
|
|
120
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* The supervisor's published pipeline record, or null.
|
|
125
|
+
*
|
|
126
|
+
* A record left `running` by a supervisor that has since died would otherwise render as a rebuild
|
|
127
|
+
* that never ends, so it is dropped unless the daemon that wrote it is the one currently alive. A
|
|
128
|
+
* terminal record is kept regardless of who wrote it: "the last rebuild did X" stays true across
|
|
129
|
+
* supervisor restarts.
|
|
130
|
+
*/
|
|
131
|
+
function liveRebuildProgress(daemonPid, daemonAlive) {
|
|
132
|
+
const progress = readRebuildProgress();
|
|
133
|
+
if (!progress)
|
|
134
|
+
return null;
|
|
135
|
+
if (progress.status !== 'running')
|
|
136
|
+
return progress;
|
|
137
|
+
const ownerAlive = daemonAlive && daemonPid !== null && progress.daemonPid === daemonPid;
|
|
138
|
+
return ownerAlive ? progress : null;
|
|
139
|
+
}
|
|
121
140
|
export async function handleSystemRateLimitStatus(_params) {
|
|
122
141
|
const waiting = getResumeCountsByProvider();
|
|
123
142
|
const providers = getThrottleState().providers.map((provider) => ({
|
|
@@ -80,7 +80,7 @@ export async function handleThreadsGet(deps, params) {
|
|
|
80
80
|
error: t.error ?? null, abortReason: t.abortReason ?? null,
|
|
81
81
|
activeAgent: t.activeAgent ?? null, activeStage: t.activeStage ?? null,
|
|
82
82
|
totalCostUsd: t.totalCostUsd ?? 0, steps, agentFlow: buildAgentFlow(t),
|
|
83
|
-
|
|
83
|
+
subtasks: buildSubtasks(deps, t),
|
|
84
84
|
children: buildChildTree(deps, t.metadata?.childThreadIds ?? [], 0, new Set([t.id])),
|
|
85
85
|
artifacts: buildArtifactRefs(t, content),
|
|
86
86
|
};
|
|
@@ -140,59 +140,6 @@ function buildAgentFlow(t) {
|
|
|
140
140
|
lastOutput: slot.lastOutput ?? null,
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
function findLaunchStep(steps, thread, startedAt) {
|
|
144
|
-
const launchedAt = Date.parse(startedAt);
|
|
145
|
-
if (!Number.isFinite(launchedAt))
|
|
146
|
-
return null;
|
|
147
|
-
const completed = steps.find((step) => {
|
|
148
|
-
const start = step.startedAt ? Date.parse(step.startedAt) : NaN;
|
|
149
|
-
const end = step.endedAt ? Date.parse(step.endedAt) : NaN;
|
|
150
|
-
return Number.isFinite(start) && Number.isFinite(end) && launchedAt >= start && launchedAt < end;
|
|
151
|
-
});
|
|
152
|
-
if (completed)
|
|
153
|
-
return completed;
|
|
154
|
-
const active = steps.find((step) => step.status === 'running');
|
|
155
|
-
if (!active)
|
|
156
|
-
return null;
|
|
157
|
-
const priorEnd = steps.reduce((latest, step) => {
|
|
158
|
-
const end = step.endedAt ? Date.parse(step.endedAt) : NaN;
|
|
159
|
-
return Number.isFinite(end) ? Math.max(latest, end) : latest;
|
|
160
|
-
}, Date.parse(thread.createdAt));
|
|
161
|
-
return launchedAt >= priorEnd ? active : null;
|
|
162
|
-
}
|
|
163
|
-
function toThreadDispatch(e, step) {
|
|
164
|
-
const startedAt = e.runtime?.startedAt || '';
|
|
165
|
-
const finishedAt = e.runtime?.endedAt || null;
|
|
166
|
-
const endMs = finishedAt ? Date.parse(finishedAt) : null;
|
|
167
|
-
return {
|
|
168
|
-
executionId: e.id,
|
|
169
|
-
status: e.status,
|
|
170
|
-
machine: e.dispatch.machine ?? null,
|
|
171
|
-
type: 'dispatch',
|
|
172
|
-
agentSlotId: step.agentSlotId,
|
|
173
|
-
stepIndex: step.stepIndex,
|
|
174
|
-
taskId: e.dispatch.taskId,
|
|
175
|
-
runName: e.dispatch.runName,
|
|
176
|
-
startedAt,
|
|
177
|
-
finishedAt,
|
|
178
|
-
durationMs: endMs ? endMs - Date.parse(startedAt) : null,
|
|
179
|
-
cost: e.metrics?.costUsd ?? null,
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
// Real cortex-runs have a runName and owning task but no caller-thread field. Launch time is the
|
|
183
|
-
// remaining provenance seam: attribute only runs launched inside one of this thread's step windows.
|
|
184
|
-
function buildDispatches(deps, thread, steps) {
|
|
185
|
-
const taskId = thread.metadata?.taskId;
|
|
186
|
-
if (!taskId)
|
|
187
|
-
return [];
|
|
188
|
-
return deps.executionRegistry.getAll()
|
|
189
|
-
.filter((e) => e.dispatch?.taskId === taskId && e.dispatch?.runName)
|
|
190
|
-
.sort((a, b) => (a.runtime?.startedAt || '').localeCompare(b.runtime?.startedAt || ''))
|
|
191
|
-
.flatMap((e) => {
|
|
192
|
-
const step = findLaunchStep(steps, thread, e.runtime?.startedAt || '');
|
|
193
|
-
return step ? [toThreadDispatch(e, step)] : [];
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
143
|
function buildSubtasks(deps, thread) {
|
|
197
144
|
const taskId = thread.metadata?.taskId;
|
|
198
145
|
if (!taskId)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Waitpoint } from '../../../store/waitpoint-repo.js';
|
|
2
|
+
import type { UiServiceDeps, WaitpointInfo, WaitpointsListParams } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Does `wp` belong to the session identified by (`sessionId`, `channel`)?
|
|
5
|
+
*
|
|
6
|
+
* The union of two clauses, each covering the other's blind spot:
|
|
7
|
+
* - `owner.sessionId` — this session's own process armed it. Survives a channel rebind, since
|
|
8
|
+
* `bindChannel` never rewrites the session record's channel.
|
|
9
|
+
* - `owner.channel` — the wake will be DELIVERED here. Survives the session being recreated
|
|
10
|
+
* (`!new`, a scheduled re-run), because delivery is channel-addressed and find-or-creates a
|
|
11
|
+
* session. This clause can surface a waitpoint armed by an earlier session on the same channel;
|
|
12
|
+
* that is honest rather than wrong — its wake really will land on the current one.
|
|
13
|
+
*
|
|
14
|
+
* Kept as one exported function so `SessionInfo.waitingOn` and `waitpoints.list` can never drift.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ownsWaitpoint(wp: Waitpoint, sessionId: string, channel: string | null): boolean;
|
|
17
|
+
/** Count the armed waitpoints each of `sessions` is waiting on. One pass over a handful of records
|
|
18
|
+
* (the repo read is an in-memory cache hit and settled records are purged after 3 days), so the
|
|
19
|
+
* nested loop is cheaper than building and reconciling two indexes. */
|
|
20
|
+
export declare function countWaitingOn(armed: Waitpoint[], sessions: Array<{
|
|
21
|
+
sessionId: string;
|
|
22
|
+
channel: string | null;
|
|
23
|
+
}>): Map<string, number>;
|
|
24
|
+
/**
|
|
25
|
+
* Redacting serialiser. Built field by field, never by spreading the record: `secretHash` must not
|
|
26
|
+
* be able to leak through a field added upstream later. `signals[].data` is dropped on purpose —
|
|
27
|
+
* it is externally written and capped at 16 KB per signal, which would bloat every list response.
|
|
28
|
+
*/
|
|
29
|
+
export declare function toWaitpointInfo(wp: Waitpoint, now: number, wakeLimit: number): WaitpointInfo;
|
|
30
|
+
export declare function handleWaitpointsList(deps: UiServiceDeps, params: WaitpointsListParams): Promise<WaitpointInfo[]>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// input: UiServiceDeps + WaitpointsListParams
|
|
2
|
+
// output: handleWaitpointsList → WaitpointInfo[]; ownsWaitpoint (the ownership rule, shared with
|
|
3
|
+
// query/sessions.ts); toWaitpointInfo (the redacting serialiser)
|
|
4
|
+
// pos: query handler for 'waitpoints.list' — the operator-facing view of the waitpoints a
|
|
5
|
+
// session is still waiting on. Deliberately NOT domain/waitpoints' `publicView`: that one
|
|
6
|
+
// is written for the agent and hides exactly the fields a human needs (delivery state, wake
|
|
7
|
+
// budget, rate-limit latch). Records reach this file only through UiServiceDeps.
|
|
8
|
+
import { getSettings } from '../../../core/settings.js';
|
|
9
|
+
const HOUR_MS = 60 * 60 * 1000;
|
|
10
|
+
/**
|
|
11
|
+
* Does `wp` belong to the session identified by (`sessionId`, `channel`)?
|
|
12
|
+
*
|
|
13
|
+
* The union of two clauses, each covering the other's blind spot:
|
|
14
|
+
* - `owner.sessionId` — this session's own process armed it. Survives a channel rebind, since
|
|
15
|
+
* `bindChannel` never rewrites the session record's channel.
|
|
16
|
+
* - `owner.channel` — the wake will be DELIVERED here. Survives the session being recreated
|
|
17
|
+
* (`!new`, a scheduled re-run), because delivery is channel-addressed and find-or-creates a
|
|
18
|
+
* session. This clause can surface a waitpoint armed by an earlier session on the same channel;
|
|
19
|
+
* that is honest rather than wrong — its wake really will land on the current one.
|
|
20
|
+
*
|
|
21
|
+
* Kept as one exported function so `SessionInfo.waitingOn` and `waitpoints.list` can never drift.
|
|
22
|
+
*/
|
|
23
|
+
export function ownsWaitpoint(wp, sessionId, channel) {
|
|
24
|
+
if (sessionId && wp.owner.sessionId === sessionId)
|
|
25
|
+
return true;
|
|
26
|
+
if (channel && wp.owner.channel === channel)
|
|
27
|
+
return true;
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
/** Count the armed waitpoints each of `sessions` is waiting on. One pass over a handful of records
|
|
31
|
+
* (the repo read is an in-memory cache hit and settled records are purged after 3 days), so the
|
|
32
|
+
* nested loop is cheaper than building and reconciling two indexes. */
|
|
33
|
+
export function countWaitingOn(armed, sessions) {
|
|
34
|
+
const out = new Map();
|
|
35
|
+
for (const s of sessions) {
|
|
36
|
+
if (armed.length === 0) {
|
|
37
|
+
out.set(s.sessionId, 0);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
let n = 0;
|
|
41
|
+
for (const wp of armed)
|
|
42
|
+
if (ownsWaitpoint(wp, s.sessionId, s.channel))
|
|
43
|
+
n += 1;
|
|
44
|
+
out.set(s.sessionId, n);
|
|
45
|
+
}
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
48
|
+
/** `quorum.need` is collapsed to a number at creation, but the stored type still permits `'all'`
|
|
49
|
+
* (a hand-edited or pre-existing waitpoints.json). Same fallback every other reader uses. */
|
|
50
|
+
function needCount(wp) {
|
|
51
|
+
return typeof wp.quorum.need === 'number' ? wp.quorum.need : wp.quorum.members.length || 1;
|
|
52
|
+
}
|
|
53
|
+
function toSignalInfo(s) {
|
|
54
|
+
return {
|
|
55
|
+
at: s.at,
|
|
56
|
+
status: s.status,
|
|
57
|
+
member: s.member ?? null,
|
|
58
|
+
message: s.message ?? null,
|
|
59
|
+
source: s.source,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Redacting serialiser. Built field by field, never by spreading the record: `secretHash` must not
|
|
64
|
+
* be able to leak through a field added upstream later. `signals[].data` is dropped on purpose —
|
|
65
|
+
* it is externally written and capped at 16 KB per signal, which would bloat every list response.
|
|
66
|
+
*/
|
|
67
|
+
export function toWaitpointInfo(wp, now, wakeLimit) {
|
|
68
|
+
const windowStart = now - HOUR_MS;
|
|
69
|
+
return {
|
|
70
|
+
id: wp.id,
|
|
71
|
+
label: wp.label,
|
|
72
|
+
intent: wp.intent,
|
|
73
|
+
state: wp.state,
|
|
74
|
+
emitFrom: wp.emitFrom.kind === 'device'
|
|
75
|
+
? { kind: 'device', device: wp.emitFrom.device }
|
|
76
|
+
: { kind: 'local' },
|
|
77
|
+
quorum: {
|
|
78
|
+
need: needCount(wp),
|
|
79
|
+
got: wp.quorum.got.length,
|
|
80
|
+
members: [...wp.quorum.members],
|
|
81
|
+
},
|
|
82
|
+
failFast: wp.failFast,
|
|
83
|
+
fires: wp.fires,
|
|
84
|
+
maxSignals: wp.maxSignals,
|
|
85
|
+
createdAt: wp.createdAt,
|
|
86
|
+
expiresAt: wp.expiresAt,
|
|
87
|
+
signals: wp.signals.map(toSignalInfo),
|
|
88
|
+
delivery: {
|
|
89
|
+
pending: wp.delivery.pending,
|
|
90
|
+
attempts: wp.delivery.attempts,
|
|
91
|
+
lastError: wp.delivery.lastError ?? null,
|
|
92
|
+
lastAt: wp.delivery.lastAt ?? null,
|
|
93
|
+
},
|
|
94
|
+
wakesLastHour: wp.wakes.filter((t) => t > windowStart).length,
|
|
95
|
+
wakeLimit,
|
|
96
|
+
rateLimited: wp.rateLimitNotified === true,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export async function handleWaitpointsList(deps, params) {
|
|
100
|
+
if (!deps.waitpointRegistry)
|
|
101
|
+
return [];
|
|
102
|
+
const sessionId = String(params.sessionId || '');
|
|
103
|
+
if (!sessionId)
|
|
104
|
+
return [];
|
|
105
|
+
// The channel half of the ownership rule has to be resolved here: SessionInfo carries no channel,
|
|
106
|
+
// so the client cannot compute this match and must not try to guess it (`web:<id>` only holds for
|
|
107
|
+
// sessions created directly — a Slack, Feishu or scheduled session has a different conduit).
|
|
108
|
+
const record = await deps.sessionStore.getById(sessionId);
|
|
109
|
+
const channel = record?.channel ?? null;
|
|
110
|
+
const armed = await deps.waitpointRegistry.listArmed();
|
|
111
|
+
const mine = armed.filter((wp) => ownsWaitpoint(wp, sessionId, channel));
|
|
112
|
+
const now = Date.now();
|
|
113
|
+
const wakeLimit = getSettings().waitpointMaxWakesPerHour;
|
|
114
|
+
// Soonest to expire first: what is about to time out is what a human needs to see.
|
|
115
|
+
mine.sort((a, b) => a.expiresAt - b.expiresAt);
|
|
116
|
+
return mine.map((wp) => toWaitpointInfo(wp, now, wakeLimit));
|
|
117
|
+
}
|
|
@@ -11,6 +11,7 @@ export declare const sessionsListInput: z.ZodObject<{
|
|
|
11
11
|
export declare const sessionsTranscriptInput: z.ZodObject<{
|
|
12
12
|
sessionId: z.ZodString;
|
|
13
13
|
compactSubagents: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
since: z.ZodOptional<z.ZodString>;
|
|
14
15
|
}, z.core.$strip>;
|
|
15
16
|
export declare const sessionsSubagentTranscriptInput: z.ZodObject<{
|
|
16
17
|
sessionId: z.ZodString;
|
|
@@ -62,6 +63,9 @@ export declare const commissionsGetInput: z.ZodObject<{
|
|
|
62
63
|
export declare const commissionsDecisionsInput: z.ZodObject<{
|
|
63
64
|
commissionId: z.ZodString;
|
|
64
65
|
}, z.core.$strip>;
|
|
66
|
+
export declare const waitpointsListInput: z.ZodObject<{
|
|
67
|
+
sessionId: z.ZodString;
|
|
68
|
+
}, z.core.$strip>;
|
|
65
69
|
export declare const executionsListInput: z.ZodObject<{
|
|
66
70
|
status: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
71
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -7,6 +7,8 @@ export const sessionsListInput = z.object({
|
|
|
7
7
|
export const sessionsTranscriptInput = z.object({
|
|
8
8
|
sessionId: z.string(),
|
|
9
9
|
compactSubagents: z.boolean().optional(),
|
|
10
|
+
/** Cursor from a previous response. Asks for the rows that changed since it, not the transcript. */
|
|
11
|
+
since: z.string().max(64).optional(),
|
|
10
12
|
});
|
|
11
13
|
export const sessionsSubagentTranscriptInput = z.object({
|
|
12
14
|
sessionId: z.string(),
|
|
@@ -51,6 +53,9 @@ export const commissionsGetInput = z.object({
|
|
|
51
53
|
export const commissionsDecisionsInput = z.object({
|
|
52
54
|
commissionId: z.string(),
|
|
53
55
|
});
|
|
56
|
+
export const waitpointsListInput = z.object({
|
|
57
|
+
sessionId: z.string().min(1),
|
|
58
|
+
});
|
|
54
59
|
export const executionsListInput = z.object({
|
|
55
60
|
status: z.array(z.string()).optional(),
|
|
56
61
|
limit: z.number().optional(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// input: tRPC core and procedure error shapes
|
|
2
2
|
// output: router, publicProcedure and createCallerFactory
|
|
3
3
|
// pos: UI router foundation with credential-error redaction
|
|
4
|
-
// >>> Once updated, update this header and parent
|
|
4
|
+
// >>> Once updated, update this header and parent AGENTS.md <<<
|
|
5
5
|
import { initTRPC } from '@trpc/server';
|
|
6
6
|
/**
|
|
7
7
|
* Keepalive for the SSE subscription that carries the whole UI's live state.
|