@cortex-agent/server 2026.10.15 → 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 +76 -50
- package/defaults/board/board.css +140 -62
- package/defaults/board/scaffold.html +36 -13
- package/defaults/config/environments/creative.json +0 -1
- package/defaults/config/environments/main.json +1 -2
- 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 +6 -13
- package/dist/agent-adapter/claude/session-options.js +2 -13
- package/dist/agent-adapter/claude/spawn-args.d.ts +4 -21
- package/dist/agent-adapter/claude/spawn-args.js +17 -24
- 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/adapter.d.ts +0 -1
- package/dist/agent-adapter/pi/adapter.js +5 -13
- 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/providers-config.d.ts +2 -2
- package/dist/agent-adapter/pi/providers-config.js +1 -1
- package/dist/agent-adapter/pi/quota-sink.d.ts +3 -3
- package/dist/agent-adapter/pi/quota-sink.js +3 -3
- package/dist/agent-adapter/pi/runtime.js +6 -1
- package/dist/agent-adapter/pi/session-options.d.ts +9 -13
- package/dist/agent-adapter/pi/session-options.js +12 -25
- package/dist/agent-adapter/run-events.d.ts +11 -10
- package/dist/agent-adapter/run-events.js +2 -0
- package/dist/agent-adapter/types.d.ts +5 -4
- package/dist/client-bundle/manifest.json +2 -2
- package/dist/core/codex-quota.d.ts +1 -1
- package/dist/core/codex-quota.js +1 -1
- package/dist/core/gateway-generator.d.ts +9 -11
- package/dist/core/gateway-generator.js +31 -58
- package/dist/core/locales/en.d.ts +51 -77
- package/dist/core/locales/slices/commands.d.ts +26 -31
- package/dist/core/locales/slices/commands.js +54 -64
- package/dist/core/locales/slices/init.d.ts +8 -19
- package/dist/core/locales/slices/init.js +17 -53
- package/dist/core/locales/slices/interactions.d.ts +3 -3
- package/dist/core/locales/slices/interactions.js +6 -6
- package/dist/core/locales/slices/notices.d.ts +1 -3
- package/dist/core/locales/slices/notices.js +2 -6
- package/dist/core/locales/slices/scheduling.d.ts +9 -9
- package/dist/core/locales/slices/scheduling.js +18 -18
- package/dist/core/locales/slices/status.d.ts +0 -4
- package/dist/core/locales/slices/status.js +0 -8
- package/dist/core/locales/slices/tui.d.ts +0 -1
- package/dist/core/locales/slices/tui.js +0 -2
- package/dist/core/locales/slices/uimsg.d.ts +4 -7
- package/dist/core/locales/slices/uimsg.js +9 -15
- package/dist/core/models-generator.d.ts +29 -0
- package/dist/core/models-generator.js +82 -0
- package/dist/core/paths.d.ts +1 -1
- package/dist/core/paths.js +1 -1
- package/dist/core/settings-spec.d.ts +25 -0
- package/dist/core/settings-spec.js +34 -0
- package/dist/core/status-format.d.ts +3 -2
- package/dist/core/status-format.js +2 -2
- package/dist/core/types/environment-types.d.ts +0 -2
- package/dist/domain/agents/agent-state.d.ts +11 -56
- package/dist/domain/agents/agent-state.js +48 -115
- package/dist/domain/agents/agent-switch.d.ts +2 -24
- package/dist/domain/agents/agent-switch.js +9 -72
- package/dist/domain/agents/config.d.ts +11 -61
- package/dist/domain/agents/config.js +47 -154
- package/dist/domain/agents/engine-selection.d.ts +21 -0
- package/dist/domain/agents/engine-selection.js +37 -0
- package/dist/domain/agents/environments/registry.js +2 -1
- package/dist/domain/agents/environments/resolve.js +0 -1
- package/dist/domain/agents/environments/schema.d.ts +0 -1
- package/dist/domain/agents/environments/schema.js +0 -1
- package/dist/domain/agents/index.d.ts +2 -1
- package/dist/domain/agents/index.js +3 -7
- package/dist/domain/agents/model-selection.d.ts +18 -70
- package/dist/domain/agents/model-selection.js +100 -150
- package/dist/domain/agents/models.d.ts +12 -0
- package/dist/domain/agents/models.js +94 -0
- 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.d.ts +5 -5
- package/dist/domain/agents/subagent/runner.js +12 -35
- package/dist/domain/auth/auth-status.d.ts +4 -4
- package/dist/domain/auth/auth-status.js +17 -28
- package/dist/domain/auth/gateway-sync.d.ts +6 -26
- package/dist/domain/auth/gateway-sync.js +31 -75
- package/dist/domain/benchmark/identity.d.ts +3 -5
- package/dist/domain/benchmark/identity.js +0 -1
- package/dist/domain/benchmark/production-attempt-identity.d.ts +6 -5
- package/dist/domain/benchmark/production-attempt-identity.js +32 -35
- package/dist/domain/benchmark/session-evidence.d.ts +2 -1
- package/dist/domain/benchmark/session-evidence.js +8 -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/context.d.ts +5 -6
- package/dist/domain/mcp/tools/context.js +17 -3
- package/dist/domain/mcp/tools/subagent.js +1 -1
- package/dist/domain/mcp/tools/ui-file.js +1 -1
- package/dist/domain/pi-providers/custom-provider-model.d.ts +1 -1
- package/dist/domain/pi-providers/custom-provider-model.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/attempt.d.ts +3 -3
- package/dist/domain/runs/attempt.js +2 -3
- package/dist/domain/runs/builders.d.ts +4 -4
- package/dist/domain/runs/builders.js +4 -5
- package/dist/domain/runs/compact.d.ts +4 -17
- package/dist/domain/runs/compact.js +14 -56
- package/dist/domain/runs/config-resolver.d.ts +15 -83
- package/dist/domain/runs/config-resolver.js +24 -150
- package/dist/domain/runs/engine-spec.d.ts +8 -8
- package/dist/domain/runs/engine-spec.js +15 -31
- package/dist/domain/runs/events.d.ts +1 -1
- package/dist/domain/runs/fallback.d.ts +6 -38
- package/dist/domain/runs/fallback.js +10 -72
- package/dist/domain/runs/notices.d.ts +1 -11
- package/dist/domain/runs/notices.js +3 -30
- package/dist/domain/runs/request.d.ts +4 -3
- package/dist/domain/runs/retryable-errors.d.ts +0 -13
- package/dist/domain/runs/retryable-errors.js +0 -17
- package/dist/domain/runs/run.d.ts +12 -42
- package/dist/domain/runs/run.js +40 -147
- package/dist/domain/runs/service.d.ts +1 -1
- package/dist/domain/runs/service.js +8 -3
- package/dist/domain/runs/spec-loader.d.ts +1 -1
- package/dist/domain/runs/spend.d.ts +1 -1
- package/dist/domain/runs/spend.js +1 -1
- package/dist/domain/scheduling/jobs/scheduled-task.d.ts +3 -2
- package/dist/domain/scheduling/jobs/scheduled-task.js +25 -19
- package/dist/domain/scheduling/schedule-ops.d.ts +0 -1
- package/dist/domain/scheduling/schedule-ops.js +2 -5
- package/dist/domain/scheduling/schedule-selection.d.ts +3 -0
- package/dist/domain/scheduling/schedule-selection.js +16 -0
- package/dist/domain/scheduling/schedule-spec.d.ts +6 -5
- package/dist/domain/scheduling/schedule-spec.js +6 -6
- package/dist/domain/scheduling/scheduler.d.ts +3 -1
- package/dist/domain/scheduling/scheduler.js +22 -21
- package/dist/domain/sessions/session-hooks.d.ts +5 -4
- package/dist/domain/sessions/session-hooks.js +15 -33
- package/dist/domain/sessions/session-lifecycle.d.ts +19 -51
- package/dist/domain/sessions/session-lifecycle.js +34 -96
- package/dist/domain/system/doctor.d.ts +3 -3
- package/dist/domain/system/doctor.js +22 -26
- 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 +2 -2
- package/dist/domain/ui-service/app-router.d.ts +49 -71
- package/dist/domain/ui-service/app-router.js +9 -13
- package/dist/domain/ui-service/assistant-snapshots.js +2 -0
- package/dist/domain/ui-service/contract.parity.d.ts +19 -0
- package/dist/domain/ui-service/contract.parity.js +1 -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 +52 -115
- package/dist/domain/ui-service/input-schemas.js +38 -84
- package/dist/domain/ui-service/mutate/auth.d.ts +1 -1
- package/dist/domain/ui-service/mutate/auth.js +3 -2
- package/dist/domain/ui-service/mutate/config.d.ts +0 -8
- package/dist/domain/ui-service/mutate/config.js +0 -22
- package/dist/domain/ui-service/mutate/models.d.ts +13 -0
- package/dist/domain/ui-service/mutate/models.js +137 -0
- 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.d.ts +2 -2
- package/dist/domain/ui-service/mutate/sessions.js +29 -126
- package/dist/domain/ui-service/query/config.js +22 -42
- package/dist/domain/ui-service/query/models.js +2 -2
- package/dist/domain/ui-service/query/schedules.js +1 -1
- package/dist/domain/ui-service/query/sessions.js +7 -13
- package/dist/domain/ui-service/types.d.ts +51 -177
- package/dist/domain/ui-service/ui-service.d.ts +23 -49
- package/dist/domain/ui-service/ui-service.js +8 -6
- package/dist/entry/app.js +42 -19
- 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 +37 -6
- package/dist/entry/cli.js +16 -14
- package/dist/entry/daemon.js +2 -0
- package/dist/entry/init-auth.js +1 -1
- package/dist/entry/init.d.ts +7 -8
- package/dist/entry/init.js +89 -249
- package/dist/entry/path-cli.d.ts +4 -0
- package/dist/entry/path-cli.js +65 -0
- package/dist/entry/schedule-cli.js +13 -6
- package/dist/entry/shutdown.d.ts +1 -1
- package/dist/entry/shutdown.js +8 -1
- package/dist/entry/start-ui-http.js +8 -0
- package/dist/entry/ui-service-wiring.js +8 -10
- package/dist/events/event-types.d.ts +3 -2
- package/dist/orchestration/agent-runner.d.ts +2 -2
- package/dist/orchestration/agent-runner.js +10 -9
- package/dist/orchestration/benchmark-session-webhook.js +13 -1
- 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 +6 -10
- package/dist/orchestration/conversation-request.js +5 -23
- package/dist/orchestration/delta-coalescer.d.ts +4 -2
- package/dist/orchestration/delta-coalescer.js +5 -5
- package/dist/orchestration/edit-retry.js +9 -11
- 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/interactions/interaction-handlers.js +6 -6
- package/dist/orchestration/mid-turn-inject.d.ts +2 -1
- package/dist/orchestration/mid-turn-inject.js +1 -1
- package/dist/orchestration/pending-injection-recovery.d.ts +2 -1
- package/dist/orchestration/pending-injection-recovery.js +1 -1
- package/dist/orchestration/routing/commands/index.js +4 -4
- package/dist/orchestration/routing/commands/mode.d.ts +5 -44
- package/dist/orchestration/routing/commands/mode.js +98 -272
- package/dist/orchestration/routing/commands/schedule.js +29 -18
- package/dist/orchestration/routing/commands/session.js +9 -9
- package/dist/orchestration/routing/commands/status.js +1 -1
- package/dist/orchestration/routing/commands/usage-format.js +3 -0
- package/dist/orchestration/routing/webhook.js +4 -0
- package/dist/orchestration/session-compact.d.ts +0 -1
- 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/status-helpers.d.ts +0 -4
- package/dist/orchestration/status-helpers.js +0 -18
- package/dist/orchestration/subagent-webhook.js +9 -34
- package/dist/orchestration/team-webhook.d.ts +8 -9
- package/dist/orchestration/team-webhook.js +16 -42
- package/dist/orchestration/transcript-sink.d.ts +6 -0
- package/dist/orchestration/transcript-sink.js +21 -2
- package/dist/orchestration/turn/terminal.js +7 -7
- package/dist/orchestration/turn/turn-prep.d.ts +0 -8
- package/dist/orchestration/turn/turn-prep.js +0 -51
- package/dist/orchestration/turn/turn-tracking.d.ts +2 -2
- package/dist/orchestration/turn/turn-tracking.js +8 -5
- package/dist/orchestration/turn/turn.d.ts +0 -2
- package/dist/orchestration/turn/turn.js +13 -15
- 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/conversation-ledger-repo.d.ts +6 -6
- package/dist/store/conversation-ledger-repo.js +4 -4
- package/dist/store/models-repo.d.ts +18 -0
- package/dist/store/models-repo.js +74 -0
- package/dist/store/pending-injection-repo.d.ts +2 -1
- package/dist/store/pending-injection-repo.js +3 -1
- package/dist/store/retire-profiles-migration.d.ts +28 -0
- package/dist/store/retire-profiles-migration.js +335 -0
- package/dist/store/schedule-repo.d.ts +2 -1
- package/dist/store/session-registry-import.js +3 -2
- package/dist/store/session-registry-journal.d.ts +10 -13
- package/dist/store/session-registry-journal.js +48 -25
- package/dist/store/session-registry-repo.d.ts +4 -4
- package/dist/store/session-registry-repo.js +4 -5
- package/dist/store/version-migrations.d.ts +2 -3
- package/dist/store/version-migrations.js +19 -3
- package/dist/tui/slash-commands.js +2 -2
- package/dist/tui/turn-status.js +1 -1
- package/package.json +6 -4
- 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-CndZZ1IQ.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/dist/core/profile-generator.d.ts +0 -79
- package/dist/core/profile-generator.js +0 -215
- package/dist/domain/agents/profile-manager.d.ts +0 -103
- package/dist/domain/agents/profile-manager.js +0 -286
- package/dist/domain/agents/profile-switch.d.ts +0 -49
- package/dist/domain/agents/profile-switch.js +0 -62
- package/dist/domain/ui-service/mutate/profiles.d.ts +0 -36
- package/dist/domain/ui-service/mutate/profiles.js +0 -151
- package/dist/store/profile-repo.d.ts +0 -20
- package/dist/store/profile-repo.js +0 -97
- package/web/dist/assets/index-B76ueW3q.js +0 -494
- package/web/dist/assets/index-C8O0yxg8.css +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { platformSettingsInput } from '../../core/platform-settings-spec.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import type { EngineSelection, ModelRef } from '../agents/engine-selection.js';
|
|
3
4
|
export { sessionsSetStarredInput, sessionsRenameInput } from './session-metadata-schemas.js';
|
|
4
5
|
import { sessionsListInput, sessionsTranscriptInput, sessionsSubagentTranscriptInput, sessionsDebugDetailsInput, sessionsPendingInteractionInput, schedulesListInput, boardsListInput, boardsGetInput, boardsDecisionsInput, boardsStyleInput, executionsListInput, executionsGetInput, waitpointsListInput, memoryTreeInput, memoryFileInput, approvalsListInput, issuesListInput, notesListInput } from './query-input-schemas.js';
|
|
5
6
|
export { sessionsListInput, sessionsTranscriptInput, sessionsSubagentTranscriptInput, sessionsDebugDetailsInput, sessionsPendingInteractionInput, schedulesListInput, boardsListInput, boardsGetInput, boardsDecisionsInput, boardsStyleInput, executionsListInput, executionsGetInput, waitpointsListInput, memoryTreeInput, memoryFileInput, approvalsListInput, issuesListInput, notesListInput, };
|
|
@@ -102,16 +103,8 @@ export declare const authRemoveCustomProviderInput: z.ZodObject<{
|
|
|
102
103
|
export declare const projectsCreateInput: z.ZodObject<{
|
|
103
104
|
name: z.ZodString;
|
|
104
105
|
}, z.core.$strip>;
|
|
105
|
-
/** Per-session browser opt-in. `device` names where Chrome runs; 'server' is the only value until
|
|
106
|
-
* the cortex-client reverse channel exists. Absent → the session gets no browser tools. */
|
|
107
|
-
export declare const sessionBrowserInput: z.ZodObject<{
|
|
108
|
-
device: z.ZodString;
|
|
109
|
-
}, z.core.$strip>;
|
|
110
106
|
export declare const sessionsCreateInput: z.ZodObject<{
|
|
111
107
|
projectId: z.ZodOptional<z.ZodString>;
|
|
112
|
-
browser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
113
|
-
device: z.ZodString;
|
|
114
|
-
}, z.core.$strip>>>;
|
|
115
108
|
}, z.core.$strip>;
|
|
116
109
|
export declare const sessionsSendInput: z.ZodObject<{
|
|
117
110
|
sessionId: z.ZodString;
|
|
@@ -141,24 +134,15 @@ export declare const sessionsMarkReadInput: z.ZodObject<{
|
|
|
141
134
|
export declare const sessionsMarkManyReadInput: z.ZodObject<{
|
|
142
135
|
sessionIds: z.ZodArray<z.ZodString>;
|
|
143
136
|
}, z.core.$strip>;
|
|
144
|
-
export declare const sessionsSetProfileInput: z.ZodObject<{
|
|
145
|
-
sessionId: z.ZodString;
|
|
146
|
-
profileName: z.ZodString;
|
|
147
|
-
}, z.core.$strip>;
|
|
148
137
|
export declare const sessionsSetAgentInput: z.ZodObject<{
|
|
149
138
|
sessionId: z.ZodString;
|
|
150
139
|
agentName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
151
140
|
}, z.core.$strip>;
|
|
141
|
+
export declare const engineSelectionInput: z.ZodType<EngineSelection, EngineSelection>;
|
|
152
142
|
export declare const sessionsSetSelectionInput: z.ZodObject<{
|
|
153
143
|
sessionId: z.ZodString;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
model: z.ZodOptional<z.ZodString>;
|
|
157
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
158
|
-
thinking: z.ZodOptional<z.ZodString>;
|
|
159
|
-
mode: z.ZodOptional<z.ZodString>;
|
|
160
|
-
}, z.core.$strip>>;
|
|
161
|
-
}, z.core.$strip>;
|
|
144
|
+
selection: z.ZodType<EngineSelection, EngineSelection, z.core.$ZodTypeInternals<EngineSelection, EngineSelection>>;
|
|
145
|
+
}, z.core.$strict>;
|
|
162
146
|
export declare const sessionsAnswerQuestionInput: z.ZodObject<{
|
|
163
147
|
requestId: z.ZodString;
|
|
164
148
|
answers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
@@ -178,6 +162,12 @@ export declare const sessionsRespondDecisionInput: z.ZodObject<{
|
|
|
178
162
|
}>;
|
|
179
163
|
message: z.ZodOptional<z.ZodString>;
|
|
180
164
|
}, z.core.$strip>;
|
|
165
|
+
/** Message identity keys an immutable snapshot of this media source. */
|
|
166
|
+
export declare const sessionsResolveMediaInput: z.ZodObject<{
|
|
167
|
+
sessionId: z.ZodString;
|
|
168
|
+
ts: z.ZodString;
|
|
169
|
+
src: z.ZodString;
|
|
170
|
+
}, z.core.$strip>;
|
|
181
171
|
/** Args for `sessions.cancelResume`: decline the auto-resume promised when a rate limit
|
|
182
172
|
* interrupted this session's turn. */
|
|
183
173
|
export declare const sessionsCancelResumeInput: z.ZodObject<{
|
|
@@ -194,17 +184,8 @@ export declare const sessionsRewindInput: z.ZodObject<{
|
|
|
194
184
|
}, z.core.$strip>;
|
|
195
185
|
export declare const sessionsCreateAndSendInput: z.ZodObject<{
|
|
196
186
|
projectId: z.ZodString;
|
|
197
|
-
profileName: z.ZodOptional<z.ZodString>;
|
|
198
187
|
agentName: z.ZodOptional<z.ZodString>;
|
|
199
|
-
selection: z.ZodOptional<z.
|
|
200
|
-
model: z.ZodOptional<z.ZodString>;
|
|
201
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
202
|
-
thinking: z.ZodOptional<z.ZodString>;
|
|
203
|
-
mode: z.ZodOptional<z.ZodString>;
|
|
204
|
-
}, z.core.$strip>>;
|
|
205
|
-
browser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
206
|
-
device: z.ZodString;
|
|
207
|
-
}, z.core.$strip>>>;
|
|
188
|
+
selection: z.ZodOptional<z.ZodType<EngineSelection, EngineSelection, z.core.$ZodTypeInternals<EngineSelection, EngineSelection>>>;
|
|
208
189
|
text: z.ZodString;
|
|
209
190
|
draftUploadId: z.ZodOptional<z.ZodString>;
|
|
210
191
|
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -237,7 +218,7 @@ export declare const scheduleAddInput: z.ZodObject<{
|
|
|
237
218
|
}>;
|
|
238
219
|
message: z.ZodString;
|
|
239
220
|
projectId: z.ZodOptional<z.ZodString>;
|
|
240
|
-
|
|
221
|
+
selection: z.ZodOptional<z.ZodType<EngineSelection, EngineSelection, z.core.$ZodTypeInternals<EngineSelection, EngineSelection>>>;
|
|
241
222
|
intervalMs: z.ZodOptional<z.ZodNumber>;
|
|
242
223
|
time: z.ZodOptional<z.ZodString>;
|
|
243
224
|
dayOfWeek: z.ZodOptional<z.ZodNumber>;
|
|
@@ -247,7 +228,7 @@ export declare const scheduleUpdateInput: z.ZodObject<{
|
|
|
247
228
|
scheduleId: z.ZodString;
|
|
248
229
|
message: z.ZodOptional<z.ZodString>;
|
|
249
230
|
projectId: z.ZodOptional<z.ZodString>;
|
|
250
|
-
|
|
231
|
+
selection: z.ZodOptional<z.ZodType<EngineSelection, EngineSelection, z.core.$ZodTypeInternals<EngineSelection, EngineSelection>>>;
|
|
251
232
|
intervalMs: z.ZodOptional<z.ZodNumber>;
|
|
252
233
|
time: z.ZodOptional<z.ZodString>;
|
|
253
234
|
dayOfWeek: z.ZodOptional<z.ZodNumber>;
|
|
@@ -259,11 +240,6 @@ export declare const configSetInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
259
240
|
daily_usd: z.ZodNumber;
|
|
260
241
|
monthly_usd: z.ZodNumber;
|
|
261
242
|
}, z.core.$strip>>>;
|
|
262
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
263
|
-
section: z.ZodLiteral<"profiles">;
|
|
264
|
-
value: z.ZodObject<{
|
|
265
|
-
defaultProfile: z.ZodString;
|
|
266
|
-
}, z.core.$strip>;
|
|
267
243
|
}, z.core.$strip>, z.ZodObject<{
|
|
268
244
|
section: z.ZodLiteral<"settings">;
|
|
269
245
|
value: z.ZodObject<{
|
|
@@ -337,33 +313,23 @@ export declare const hooksTestInput: z.ZodObject<{
|
|
|
337
313
|
id: z.ZodString;
|
|
338
314
|
payload: z.ZodString;
|
|
339
315
|
}, z.core.$strip>;
|
|
340
|
-
export declare const
|
|
341
|
-
|
|
342
|
-
backend: z.
|
|
316
|
+
export declare const modelRefInput: z.ZodType<ModelRef, ModelRef>;
|
|
317
|
+
export declare const modelsFavoriteInput: z.ZodObject<{
|
|
318
|
+
backend: z.ZodEnum<{
|
|
343
319
|
claude: "claude";
|
|
344
320
|
pi: "pi";
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
348
|
-
thinking: z.ZodOptional<z.ZodString>;
|
|
349
|
-
extraOption: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
350
|
-
name: z.ZodString;
|
|
351
|
-
}, z.core.$strip>;
|
|
352
|
-
export declare const profilesUpdateInput: z.ZodObject<{
|
|
321
|
+
}>;
|
|
322
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
353
323
|
model: z.ZodString;
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}, z.core.$strip>;
|
|
364
|
-
export declare const profilesRemoveInput: z.ZodObject<{
|
|
365
|
-
name: z.ZodString;
|
|
366
|
-
}, z.core.$strip>;
|
|
324
|
+
}, z.core.$strict>;
|
|
325
|
+
type ModelsSetThinkingInput = {
|
|
326
|
+
ref: ModelRef;
|
|
327
|
+
thinking: string | null;
|
|
328
|
+
};
|
|
329
|
+
export declare const modelsSetThinkingInput: z.ZodType<ModelsSetThinkingInput, ModelsSetThinkingInput>;
|
|
330
|
+
export declare const modelsSetDefaultInput: z.ZodObject<{
|
|
331
|
+
selection: z.ZodType<EngineSelection, EngineSelection, z.core.$ZodTypeInternals<EngineSelection, EngineSelection>>;
|
|
332
|
+
}, z.core.$strict>;
|
|
367
333
|
export declare const pluginsAssignInput: z.ZodObject<{
|
|
368
334
|
target: z.ZodObject<{
|
|
369
335
|
kind: z.ZodLiteral<"agent">;
|
|
@@ -636,9 +602,6 @@ export declare const mutateInputSchemas: {
|
|
|
636
602
|
}, z.core.$strip>;
|
|
637
603
|
'sessions.create': z.ZodObject<{
|
|
638
604
|
projectId: z.ZodOptional<z.ZodString>;
|
|
639
|
-
browser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
640
|
-
device: z.ZodString;
|
|
641
|
-
}, z.core.$strip>>>;
|
|
642
605
|
}, z.core.$strip>;
|
|
643
606
|
'sessions.send': z.ZodObject<{
|
|
644
607
|
sessionId: z.ZodString;
|
|
@@ -662,37 +625,18 @@ export declare const mutateInputSchemas: {
|
|
|
662
625
|
'sessions.compact': z.ZodObject<{
|
|
663
626
|
sessionId: z.ZodString;
|
|
664
627
|
}, z.core.$strip>;
|
|
665
|
-
'sessions.setProfile': z.ZodObject<{
|
|
666
|
-
sessionId: z.ZodString;
|
|
667
|
-
profileName: z.ZodString;
|
|
668
|
-
}, z.core.$strip>;
|
|
669
628
|
'sessions.setAgent': z.ZodObject<{
|
|
670
629
|
sessionId: z.ZodString;
|
|
671
630
|
agentName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
672
631
|
}, z.core.$strip>;
|
|
673
632
|
'sessions.setSelection': z.ZodObject<{
|
|
674
633
|
sessionId: z.ZodString;
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
model: z.ZodOptional<z.ZodString>;
|
|
678
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
679
|
-
thinking: z.ZodOptional<z.ZodString>;
|
|
680
|
-
mode: z.ZodOptional<z.ZodString>;
|
|
681
|
-
}, z.core.$strip>>;
|
|
682
|
-
}, z.core.$strip>;
|
|
634
|
+
selection: z.ZodType<EngineSelection, EngineSelection, z.core.$ZodTypeInternals<EngineSelection, EngineSelection>>;
|
|
635
|
+
}, z.core.$strict>;
|
|
683
636
|
'sessions.createAndSend': z.ZodObject<{
|
|
684
637
|
projectId: z.ZodString;
|
|
685
|
-
profileName: z.ZodOptional<z.ZodString>;
|
|
686
638
|
agentName: z.ZodOptional<z.ZodString>;
|
|
687
|
-
selection: z.ZodOptional<z.
|
|
688
|
-
model: z.ZodOptional<z.ZodString>;
|
|
689
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
690
|
-
thinking: z.ZodOptional<z.ZodString>;
|
|
691
|
-
mode: z.ZodOptional<z.ZodString>;
|
|
692
|
-
}, z.core.$strip>>;
|
|
693
|
-
browser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
694
|
-
device: z.ZodString;
|
|
695
|
-
}, z.core.$strip>>>;
|
|
639
|
+
selection: z.ZodOptional<z.ZodType<EngineSelection, EngineSelection, z.core.$ZodTypeInternals<EngineSelection, EngineSelection>>>;
|
|
696
640
|
text: z.ZodString;
|
|
697
641
|
draftUploadId: z.ZodOptional<z.ZodString>;
|
|
698
642
|
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -748,6 +692,11 @@ export declare const mutateInputSchemas: {
|
|
|
748
692
|
turnIndex: z.ZodNumber;
|
|
749
693
|
text: z.ZodString;
|
|
750
694
|
}, z.core.$strip>;
|
|
695
|
+
'sessions.resolveMedia': z.ZodObject<{
|
|
696
|
+
sessionId: z.ZodString;
|
|
697
|
+
ts: z.ZodString;
|
|
698
|
+
src: z.ZodString;
|
|
699
|
+
}, z.core.$strip>;
|
|
751
700
|
'executions.cancel': z.ZodObject<{
|
|
752
701
|
executionId: z.ZodString;
|
|
753
702
|
}, z.core.$strip>;
|
|
@@ -772,7 +721,7 @@ export declare const mutateInputSchemas: {
|
|
|
772
721
|
}>;
|
|
773
722
|
message: z.ZodString;
|
|
774
723
|
projectId: z.ZodOptional<z.ZodString>;
|
|
775
|
-
|
|
724
|
+
selection: z.ZodOptional<z.ZodType<EngineSelection, EngineSelection, z.core.$ZodTypeInternals<EngineSelection, EngineSelection>>>;
|
|
776
725
|
intervalMs: z.ZodOptional<z.ZodNumber>;
|
|
777
726
|
time: z.ZodOptional<z.ZodString>;
|
|
778
727
|
dayOfWeek: z.ZodOptional<z.ZodNumber>;
|
|
@@ -782,7 +731,7 @@ export declare const mutateInputSchemas: {
|
|
|
782
731
|
scheduleId: z.ZodString;
|
|
783
732
|
message: z.ZodOptional<z.ZodString>;
|
|
784
733
|
projectId: z.ZodOptional<z.ZodString>;
|
|
785
|
-
|
|
734
|
+
selection: z.ZodOptional<z.ZodType<EngineSelection, EngineSelection, z.core.$ZodTypeInternals<EngineSelection, EngineSelection>>>;
|
|
786
735
|
intervalMs: z.ZodOptional<z.ZodNumber>;
|
|
787
736
|
time: z.ZodOptional<z.ZodString>;
|
|
788
737
|
dayOfWeek: z.ZodOptional<z.ZodNumber>;
|
|
@@ -841,11 +790,6 @@ export declare const mutateInputSchemas: {
|
|
|
841
790
|
daily_usd: z.ZodNumber;
|
|
842
791
|
monthly_usd: z.ZodNumber;
|
|
843
792
|
}, z.core.$strip>>>;
|
|
844
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
845
|
-
section: z.ZodLiteral<"profiles">;
|
|
846
|
-
value: z.ZodObject<{
|
|
847
|
-
defaultProfile: z.ZodString;
|
|
848
|
-
}, z.core.$strip>;
|
|
849
793
|
}, z.core.$strip>, z.ZodObject<{
|
|
850
794
|
section: z.ZodLiteral<"settings">;
|
|
851
795
|
value: z.ZodObject<{
|
|
@@ -1003,33 +947,26 @@ export declare const mutateInputSchemas: {
|
|
|
1003
947
|
id: z.ZodString;
|
|
1004
948
|
payload: z.ZodString;
|
|
1005
949
|
}, z.core.$strip>;
|
|
1006
|
-
'
|
|
1007
|
-
|
|
1008
|
-
backend: z.ZodOptional<z.ZodEnum<{
|
|
950
|
+
'models.favorites.add': z.ZodObject<{
|
|
951
|
+
backend: z.ZodEnum<{
|
|
1009
952
|
claude: "claude";
|
|
1010
953
|
pi: "pi";
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
1014
|
-
thinking: z.ZodOptional<z.ZodString>;
|
|
1015
|
-
extraOption: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1016
|
-
name: z.ZodString;
|
|
1017
|
-
}, z.core.$strip>;
|
|
1018
|
-
'profiles.update': z.ZodObject<{
|
|
954
|
+
}>;
|
|
955
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1019
956
|
model: z.ZodString;
|
|
1020
|
-
|
|
957
|
+
}, z.core.$strict>;
|
|
958
|
+
'models.favorites.remove': z.ZodObject<{
|
|
959
|
+
backend: z.ZodEnum<{
|
|
1021
960
|
claude: "claude";
|
|
1022
961
|
pi: "pi";
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
}, z.core.$
|
|
1030
|
-
'
|
|
1031
|
-
name: z.ZodString;
|
|
1032
|
-
}, z.core.$strip>;
|
|
962
|
+
}>;
|
|
963
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
964
|
+
model: z.ZodString;
|
|
965
|
+
}, z.core.$strict>;
|
|
966
|
+
'models.setDefault': z.ZodObject<{
|
|
967
|
+
selection: z.ZodType<EngineSelection, EngineSelection, z.core.$ZodTypeInternals<EngineSelection, EngineSelection>>;
|
|
968
|
+
}, z.core.$strict>;
|
|
969
|
+
'models.setThinking': z.ZodType<ModelsSetThinkingInput, ModelsSetThinkingInput, z.core.$ZodTypeInternals<ModelsSetThinkingInput, ModelsSetThinkingInput>>;
|
|
1033
970
|
'plugins.assign': z.ZodObject<{
|
|
1034
971
|
target: z.ZodObject<{
|
|
1035
972
|
kind: z.ZodLiteral<"agent">;
|
|
@@ -29,9 +29,7 @@ export const usageSharingSetInput = z.object({
|
|
|
29
29
|
org: z.string().trim().optional(),
|
|
30
30
|
email: z.string().trim().optional(),
|
|
31
31
|
});
|
|
32
|
-
// models.catalog —
|
|
33
|
-
// union of every source that knows about an endpoint, so it never narrows what profiles.json
|
|
34
|
-
// accepts: the editor keeps a free-text escape for anything the host cannot enumerate.
|
|
32
|
+
// models.catalog — discover selectable models and gateway routes.
|
|
35
33
|
export const modelsCatalogInput = z.object({});
|
|
36
34
|
export const machinesListInput = z.object({});
|
|
37
35
|
export const machineDetailInput = z.object({
|
|
@@ -66,7 +64,7 @@ export const authRespondPromptInput = z.object({
|
|
|
66
64
|
export const authCancelFlowInput = z.object({
|
|
67
65
|
flowId: z.string().min(1),
|
|
68
66
|
});
|
|
69
|
-
// auth.syncGateway — re-derive gateway
|
|
67
|
+
// auth.syncGateway — re-derive gateway routes and favorites from reachable backends.
|
|
70
68
|
// Credentials alone do not make a model usable: the routing map is generated by scanning local
|
|
71
69
|
// backend state, so a login performed outside `cortex init` needs this to become effective.
|
|
72
70
|
export const authSyncGatewayInput = z.object({
|
|
@@ -109,16 +107,9 @@ export const authRemoveCustomProviderInput = z.object({
|
|
|
109
107
|
export const projectsCreateInput = z.object({
|
|
110
108
|
name: z.string(),
|
|
111
109
|
});
|
|
112
|
-
/** Per-session browser opt-in. `device` names where Chrome runs; 'server' is the only value until
|
|
113
|
-
* the cortex-client reverse channel exists. Absent → the session gets no browser tools. */
|
|
114
|
-
export const sessionBrowserInput = z.object({
|
|
115
|
-
device: z.string(),
|
|
116
|
-
});
|
|
117
110
|
export const sessionsCreateInput = z.object({
|
|
118
111
|
/** Project the new session belongs to. Omitted → the default project (handler fallback). */
|
|
119
112
|
projectId: z.string().optional(),
|
|
120
|
-
/** Opt in to browser control for this session. Omitted → no browser tools are loaded. */
|
|
121
|
-
browser: sessionBrowserInput.nullish(),
|
|
122
113
|
});
|
|
123
114
|
export const sessionsSendInput = z.object({
|
|
124
115
|
sessionId: z.string(),
|
|
@@ -145,11 +136,6 @@ export const sessionsMarkReadInput = z.object({
|
|
|
145
136
|
export const sessionsMarkManyReadInput = z.object({
|
|
146
137
|
sessionIds: z.array(z.string()).min(1).max(500),
|
|
147
138
|
});
|
|
148
|
-
export const sessionsSetProfileInput = z.object({
|
|
149
|
-
sessionId: z.string(),
|
|
150
|
-
/** The profile to switch the session to. Must exist in profiles.json. */
|
|
151
|
-
profileName: z.string().min(1),
|
|
152
|
-
});
|
|
153
139
|
// sessions.setAgent — which agent template (execution environment) the session runs as. "Follow the
|
|
154
140
|
// global default again" is sayable two ways, `null` and absent, because the browser client cannot
|
|
155
141
|
// say the first one: this project compiles without strictNullChecks, so the `| null` of an INFERRED
|
|
@@ -161,25 +147,20 @@ export const sessionsSetAgentInput = z.object({
|
|
|
161
147
|
* hands the session back to the global default agent. */
|
|
162
148
|
agentName: z.string().min(1).nullable().optional(),
|
|
163
149
|
});
|
|
164
|
-
/**
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
model: z.string().min(1)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
// gate only: WHICH levels a backend accepts, whether it has a provider at all, and whether a live
|
|
175
|
-
// conversation may change backend stay with the domain rule (domain/agents/model-selection.ts),
|
|
176
|
-
// which every surface goes through.
|
|
150
|
+
/** Complete engine choice. Backend-specific thinking and route validation belong to the domain. */
|
|
151
|
+
const engineSelectionShape = z.object({
|
|
152
|
+
backend: z.enum(['claude', 'pi']),
|
|
153
|
+
provider: z.string().min(1).nullable(),
|
|
154
|
+
model: z.string().min(1),
|
|
155
|
+
thinking: z.string().min(1).nullable(),
|
|
156
|
+
mode: z.string().min(1),
|
|
157
|
+
}).strict();
|
|
158
|
+
// Preserve required nullable fields in declarations even with strictNullChecks disabled.
|
|
159
|
+
export const engineSelectionInput = engineSelectionShape;
|
|
177
160
|
export const sessionsSetSelectionInput = z.object({
|
|
178
161
|
sessionId: z.string(),
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
selection: sessionSelectionInput.optional(),
|
|
182
|
-
});
|
|
162
|
+
selection: engineSelectionInput,
|
|
163
|
+
}).strict();
|
|
183
164
|
export const sessionsAnswerQuestionInput = z.object({
|
|
184
165
|
requestId: z.string().min(1),
|
|
185
166
|
answers: z.record(z.string(), z.string()),
|
|
@@ -198,6 +179,12 @@ export const sessionsRespondDecisionInput = z.object({
|
|
|
198
179
|
/** Required for explain/revise; ignored for approve. */
|
|
199
180
|
message: z.string().optional(),
|
|
200
181
|
});
|
|
182
|
+
/** Message identity keys an immutable snapshot of this media source. */
|
|
183
|
+
export const sessionsResolveMediaInput = z.object({
|
|
184
|
+
sessionId: z.string().regex(/^[\w-]+$/),
|
|
185
|
+
ts: z.string().min(1),
|
|
186
|
+
src: z.string().min(1),
|
|
187
|
+
});
|
|
201
188
|
/** Args for `sessions.cancelResume`: decline the auto-resume promised when a rate limit
|
|
202
189
|
* interrupted this session's turn. */
|
|
203
190
|
export const sessionsCancelResumeInput = z.object({
|
|
@@ -217,20 +204,11 @@ export const sessionsRewindInput = z.object({
|
|
|
217
204
|
export const sessionsCreateAndSendInput = z.object({
|
|
218
205
|
/** Project the new session belongs to. */
|
|
219
206
|
projectId: z.string(),
|
|
220
|
-
/** The profile to create the session with. Omitted → system default. */
|
|
221
|
-
profileName: z.string().optional(),
|
|
222
207
|
/** The agent template — the environment — the new session runs as. Omitted → whatever the
|
|
223
208
|
* global default agent is. Applied at creation, so the first turn already runs in it. */
|
|
224
209
|
agentName: z.string().min(1).optional(),
|
|
225
|
-
/**
|
|
226
|
-
|
|
227
|
-
* "nothing overridden" is a statement ("run the profile as declared"), not silence, and is
|
|
228
|
-
* remembered as the engine the next new conversation opens on. Applied at creation so the first
|
|
229
|
-
* turn already runs what the user picked (there is no session to `setSelection` on before this
|
|
230
|
-
* call). */
|
|
231
|
-
selection: sessionSelectionInput.optional(),
|
|
232
|
-
/** Opt in to browser control for this session. Omitted → no browser tools are loaded. */
|
|
233
|
-
browser: sessionBrowserInput.nullish(),
|
|
210
|
+
/** Complete engine choice applied before the first turn. Omitted → system default. */
|
|
211
|
+
selection: engineSelectionInput.optional(),
|
|
234
212
|
/** First user message text. */
|
|
235
213
|
text: z.string(),
|
|
236
214
|
/** Temporary upload directory id (draft mode). Attachments were uploaded under this id
|
|
@@ -261,7 +239,7 @@ export const scheduleAddInput = z
|
|
|
261
239
|
type: z.enum(['interval', 'daily', 'weekly', 'once']),
|
|
262
240
|
message: z.string().min(1),
|
|
263
241
|
projectId: z.string().optional(),
|
|
264
|
-
|
|
242
|
+
selection: engineSelectionInput.optional(),
|
|
265
243
|
intervalMs: z.number().int().positive().optional(),
|
|
266
244
|
time: z.string().regex(/^\d{2}:\d{2}$/).optional(),
|
|
267
245
|
dayOfWeek: z.number().int().min(0).max(6).optional(),
|
|
@@ -287,7 +265,7 @@ export const scheduleUpdateInput = z.object({
|
|
|
287
265
|
scheduleId: z.string(),
|
|
288
266
|
message: z.string().min(1).optional(),
|
|
289
267
|
projectId: z.string().optional(),
|
|
290
|
-
|
|
268
|
+
selection: engineSelectionInput.optional(),
|
|
291
269
|
intervalMs: z.number().int().positive().optional(),
|
|
292
270
|
time: z.string().regex(/^\d{2}:\d{2}$/).optional(),
|
|
293
271
|
dayOfWeek: z.number().int().min(0).max(6).optional(),
|
|
@@ -329,7 +307,7 @@ function rejectUndefinedSettings(value, ctx) {
|
|
|
329
307
|
const settingsValueInput = z.object(settingsShape).partial().strict()
|
|
330
308
|
.superRefine(rejectUndefinedSettings);
|
|
331
309
|
// config.set: a discriminated union of the safely-writable sections. `budget` numbers must be
|
|
332
|
-
// finite and positive; `
|
|
310
|
+
// finite and positive; `settings` accepts only finite,
|
|
333
311
|
// spec-typed partial overrides. Any section or settings key outside this union is rejected.
|
|
334
312
|
//
|
|
335
313
|
// `budget` targets the global limits by default, or one project's override when `project` is given.
|
|
@@ -355,12 +333,6 @@ export const configSetInput = z.discriminatedUnion('section', [
|
|
|
355
333
|
});
|
|
356
334
|
}
|
|
357
335
|
}),
|
|
358
|
-
z.object({
|
|
359
|
-
section: z.literal('profiles'),
|
|
360
|
-
value: z.object({
|
|
361
|
-
defaultProfile: z.string().min(1),
|
|
362
|
-
}),
|
|
363
|
-
}),
|
|
364
336
|
z.object({
|
|
365
337
|
section: z.literal('settings'),
|
|
366
338
|
value: settingsValueInput,
|
|
@@ -435,34 +407,15 @@ export const hooksTestInput = z.object({
|
|
|
435
407
|
id: z.string().min(1),
|
|
436
408
|
payload: z.string(),
|
|
437
409
|
});
|
|
438
|
-
// ──
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
// `extraEnv` and `fallback[]` are absent by construction: extraEnv values are secret-bearing (the
|
|
444
|
-
// read DTO returns keys only) and fallback is a nested chain with no editor. Both round-trip
|
|
445
|
-
// untouched through an update.
|
|
446
|
-
const profileSafeName = z.string().regex(/^[a-zA-Z0-9_-]+$/, 'may contain only letters, digits, - and _');
|
|
447
|
-
const profileDraftShape = {
|
|
410
|
+
// ── models.* ──────────────────────────────────────────────────────
|
|
411
|
+
export const modelRefInput = engineSelectionShape.pick({ backend: true, provider: true, model: true });
|
|
412
|
+
export const modelsFavoriteInput = z.object({
|
|
413
|
+
backend: z.enum(['claude', 'pi']),
|
|
414
|
+
provider: z.string().min(1).nullable().optional(),
|
|
448
415
|
model: z.string().min(1),
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
thinking: z.string().min(1).optional(),
|
|
453
|
-
extraOption: z.record(z.string().startsWith('--'), z.string()).optional(),
|
|
454
|
-
};
|
|
455
|
-
export const profilesCreateInput = z.object({
|
|
456
|
-
name: profileSafeName.min(1),
|
|
457
|
-
...profileDraftShape,
|
|
458
|
-
});
|
|
459
|
-
export const profilesUpdateInput = z.object({
|
|
460
|
-
name: profileSafeName.min(1),
|
|
461
|
-
...profileDraftShape,
|
|
462
|
-
});
|
|
463
|
-
export const profilesRemoveInput = z.object({
|
|
464
|
-
name: profileSafeName.min(1),
|
|
465
|
-
});
|
|
416
|
+
}).strict();
|
|
417
|
+
export const modelsSetThinkingInput = z.object({ ref: modelRefInput, thinking: z.string().nullable() }).strict();
|
|
418
|
+
export const modelsSetDefaultInput = z.object({ selection: engineSelectionInput }).strict();
|
|
466
419
|
const componentByteLength = (value) => new TextEncoder().encode(value).byteLength <= 255;
|
|
467
420
|
const isSafeComponent = (value) => value !== '.' && value !== '..'
|
|
468
421
|
&& !value.includes('/') && !value.includes('\\') && !value.includes('\0');
|
|
@@ -675,7 +628,6 @@ export const mutateInputSchemas = {
|
|
|
675
628
|
'sessions.send': sessionsSendInput,
|
|
676
629
|
'sessions.cancel': sessionsCancelInput,
|
|
677
630
|
'sessions.compact': sessionsCompactInput,
|
|
678
|
-
'sessions.setProfile': sessionsSetProfileInput,
|
|
679
631
|
'sessions.setAgent': sessionsSetAgentInput,
|
|
680
632
|
'sessions.setSelection': sessionsSetSelectionInput,
|
|
681
633
|
'sessions.createAndSend': sessionsCreateAndSendInput,
|
|
@@ -688,6 +640,7 @@ export const mutateInputSchemas = {
|
|
|
688
640
|
'sessions.respondDecision': sessionsRespondDecisionInput,
|
|
689
641
|
'sessions.cancelResume': sessionsCancelResumeInput,
|
|
690
642
|
'sessions.rewind': sessionsRewindInput,
|
|
643
|
+
'sessions.resolveMedia': sessionsResolveMediaInput,
|
|
691
644
|
'executions.cancel': executionsCancelInput,
|
|
692
645
|
'waitpoints.cancel': waitpointsCancelInput,
|
|
693
646
|
'schedules.pause': scheduleActionInput,
|
|
@@ -721,9 +674,10 @@ export const mutateInputSchemas = {
|
|
|
721
674
|
'hooks.setEnabled': hooksSetEnabledInput,
|
|
722
675
|
'hooks.remove': hooksRemoveInput,
|
|
723
676
|
'hooks.test': hooksTestInput,
|
|
724
|
-
'
|
|
725
|
-
'
|
|
726
|
-
'
|
|
677
|
+
'models.favorites.add': modelsFavoriteInput,
|
|
678
|
+
'models.favorites.remove': modelsFavoriteInput,
|
|
679
|
+
'models.setDefault': modelsSetDefaultInput,
|
|
680
|
+
'models.setThinking': modelsSetThinkingInput,
|
|
727
681
|
'plugins.assign': pluginsAssignInput,
|
|
728
682
|
'plugins.skillWrite': pluginsSkillWriteInput,
|
|
729
683
|
'plugins.skillCreate': pluginsSkillCreateInput,
|
|
@@ -5,7 +5,7 @@ export declare function handleAuthRespondPrompt(deps: UiServiceDeps, args: Mutat
|
|
|
5
5
|
export declare function handleAuthCancelFlow(deps: UiServiceDeps, args: MutateArgs<'auth.cancelFlow'>): Promise<Result<LoginFlowState>>;
|
|
6
6
|
export declare function handleAuthLogout(deps: UiServiceDeps, args: MutateArgs<'auth.logout'>): Promise<Result<AuthLogoutReturn>>;
|
|
7
7
|
/**
|
|
8
|
-
* Re-derive gateway
|
|
8
|
+
* Re-derive gateway routes and favorites from the backends this machine can reach.
|
|
9
9
|
*
|
|
10
10
|
* Runs automatically after a login (see the `onLoginSuccess` wiring in entry/app.ts); this is the
|
|
11
11
|
* manual entry point for the cases that misses — a credential that predates the automatic sync, or
|
|
@@ -80,7 +80,7 @@ export async function handleAuthLogout(deps, args) {
|
|
|
80
80
|
return { ok: false, code: result.error.code, message: result.error.message };
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
* Re-derive gateway
|
|
83
|
+
* Re-derive gateway routes and favorites from the backends this machine can reach.
|
|
84
84
|
*
|
|
85
85
|
* Runs automatically after a login (see the `onLoginSuccess` wiring in entry/app.ts); this is the
|
|
86
86
|
* manual entry point for the cases that misses — a credential that predates the automatic sync, or
|
|
@@ -95,7 +95,8 @@ export async function handleAuthSyncGateway(deps, args) {
|
|
|
95
95
|
data: {
|
|
96
96
|
configured: result.configured,
|
|
97
97
|
endpoints: result.endpoints,
|
|
98
|
-
|
|
98
|
+
defaultSet: result.defaultSet,
|
|
99
|
+
favorites: result.favorites,
|
|
99
100
|
...(result.reason ? { reason: result.reason } : {}),
|
|
100
101
|
},
|
|
101
102
|
};
|
|
@@ -14,13 +14,5 @@ import type { UiServiceDeps, Result, ConfigSetReturn, ConfigSetProviderRateLimit
|
|
|
14
14
|
* where typos are likely, validates against projectStore before calling into the domain.
|
|
15
15
|
*/
|
|
16
16
|
export declare function writeBudget(configDir: string, value?: BudgetValue | null, project?: string | null): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Re-point profiles.json `defaultProfile`, PRESERVING every other field. Pure over its dir
|
|
19
|
-
* argument. The target MUST already exist in the file's `profiles` map — the write can only SELECT
|
|
20
|
-
* an existing profile, never invent one (a non-existent default would break agent startup). A
|
|
21
|
-
* missing / malformed profiles.json or an unknown profile throws with `code: 'invalid-args'` so the
|
|
22
|
-
* handler maps it to BAD_REQUEST rather than an internal error.
|
|
23
|
-
*/
|
|
24
|
-
export declare function writeDefaultProfile(configDir: string, defaultProfile: string): Promise<void>;
|
|
25
17
|
export declare function handleConfigSet(deps: UiServiceDeps, args: MutateArgs<'config.set'>): Promise<Result<ConfigSetReturn>>;
|
|
26
18
|
export declare function handleConfigSetProviderRateLimitPolicy(_deps: UiServiceDeps, args: MutateArgs<'config.setProviderRateLimitPolicy'>): Promise<Result<ConfigSetProviderRateLimitPolicyReturn>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { t } from '../../../core/i18n.js';
|
|
2
1
|
import path from 'node:path';
|
|
3
2
|
import fs from 'node:fs/promises';
|
|
4
3
|
import { CONFIG_DIR } from '../../../core/paths.js';
|
|
@@ -7,7 +6,6 @@ import { setProviderRateLimitPolicy, updateSettings } from '../../../core/settin
|
|
|
7
6
|
import { applyLang } from '../../system/preferences.js';
|
|
8
7
|
import { costRepo } from '../../../store/cost-repo.js';
|
|
9
8
|
import { configSetInput, configSetProviderRateLimitPolicyInput, } from '../input-schemas.js';
|
|
10
|
-
import { readProfilesFile, writeProfilesFile } from './profiles.js';
|
|
11
9
|
/**
|
|
12
10
|
* Validate and atomically write budget.json into `configDir`. Pure over its dir argument
|
|
13
11
|
* (hermetically testable against a temp dir). Re-validates through the same zod schema the router
|
|
@@ -56,22 +54,6 @@ export async function writeBudget(configDir, value, project) {
|
|
|
56
54
|
// beats a file whose keys depend on which surface last wrote it.
|
|
57
55
|
await atomicWrite(file, JSON.stringify(next, null, 2) + '\n');
|
|
58
56
|
}
|
|
59
|
-
/**
|
|
60
|
-
* Re-point profiles.json `defaultProfile`, PRESERVING every other field. Pure over its dir
|
|
61
|
-
* argument. The target MUST already exist in the file's `profiles` map — the write can only SELECT
|
|
62
|
-
* an existing profile, never invent one (a non-existent default would break agent startup). A
|
|
63
|
-
* missing / malformed profiles.json or an unknown profile throws with `code: 'invalid-args'` so the
|
|
64
|
-
* handler maps it to BAD_REQUEST rather than an internal error.
|
|
65
|
-
*/
|
|
66
|
-
export async function writeDefaultProfile(configDir, defaultProfile) {
|
|
67
|
-
const raw = await readProfilesFile(configDir);
|
|
68
|
-
if (!Object.prototype.hasOwnProperty.call(raw.profiles, defaultProfile)) {
|
|
69
|
-
throw Object.assign(new Error(t('ui.profile.notFound', { name: defaultProfile })), {
|
|
70
|
-
code: 'invalid-args',
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
await writeProfilesFile(configDir, { ...raw, defaultProfile });
|
|
74
|
-
}
|
|
75
57
|
export async function handleConfigSet(deps, args) {
|
|
76
58
|
// Validate first (invalid-args → BAD_REQUEST), so a genuine write/IO failure below is not
|
|
77
59
|
// misreported as bad input. Covers the section guard and each section's constraints in one pass.
|
|
@@ -87,10 +69,6 @@ export async function handleConfigSet(deps, args) {
|
|
|
87
69
|
costRepo.invalidateBudget();
|
|
88
70
|
return { ok: true, data: { written: true, section: 'budget' } };
|
|
89
71
|
}
|
|
90
|
-
if (parsed.data.section === 'profiles') {
|
|
91
|
-
await writeDefaultProfile(CONFIG_DIR, parsed.data.value.defaultProfile);
|
|
92
|
-
return { ok: true, data: { written: true, section: 'profiles' } };
|
|
93
|
-
}
|
|
94
72
|
if (parsed.data.section === 'preferences') {
|
|
95
73
|
// One knob, two effects: preferences.json is rewritten AND the live locale switches, so the
|
|
96
74
|
// very next server-side t() (a compaction notice, a command reply) speaks the new language.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { readGatewayYaml } from '../../../core/gateway-generator.js';
|
|
2
|
+
import { type EngineSelection, type ModelRef } from '../../agents/engine-selection.js';
|
|
3
|
+
import type { UiServiceDeps, Result, ModelsMutationReturn, MutateArgs } from '../types.js';
|
|
4
|
+
type GatewayReader = () => ReturnType<typeof readGatewayYaml>;
|
|
5
|
+
export declare function addFavorite(configDir: string, args: MutateArgs<'models.favorites.add'>): Promise<boolean>;
|
|
6
|
+
export declare function removeFavorite(configDir: string, args: MutateArgs<'models.favorites.remove'>): Promise<boolean>;
|
|
7
|
+
export declare function setDefaultModel(configDir: string, args: MutateArgs<'models.setDefault'>, readGateway?: GatewayReader): Promise<boolean>;
|
|
8
|
+
export declare function setModelThinking(configDir: string, args: MutateArgs<'models.setThinking'>, resolveSelection?: (ref: ModelRef) => EngineSelection): Promise<boolean>;
|
|
9
|
+
export declare function handleModelsFavoriteAdd(_deps: UiServiceDeps, args: MutateArgs<'models.favorites.add'>): Promise<Result<ModelsMutationReturn>>;
|
|
10
|
+
export declare function handleModelsFavoriteRemove(_deps: UiServiceDeps, args: MutateArgs<'models.favorites.remove'>): Promise<Result<ModelsMutationReturn>>;
|
|
11
|
+
export declare function handleModelsSetDefault(_deps: UiServiceDeps, args: MutateArgs<'models.setDefault'>): Promise<Result<ModelsMutationReturn>>;
|
|
12
|
+
export declare function handleModelsSetThinking(_deps: UiServiceDeps, args: MutateArgs<'models.setThinking'>): Promise<Result<ModelsMutationReturn>>;
|
|
13
|
+
export {};
|