@sayknow-cli/coding-agent 0.3.12 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/autoresearch/tools/init-experiment.d.ts +1 -1
- package/dist/types/autoresearch/tools/log-experiment.d.ts +2 -2
- package/dist/types/cli/classify-install-target.d.ts +0 -10
- package/dist/types/cli/daemon-cli.d.ts +2 -0
- package/dist/types/cli/initial-message.d.ts +1 -1
- package/dist/types/cli/malloc-env-guard.d.ts +65 -0
- package/dist/types/cli/malloc-env-guard.test.d.ts +1 -0
- package/dist/types/cli/notify-cli.d.ts +3 -1
- package/dist/types/cli/session-picker.d.ts +4 -3
- package/dist/types/cli/update-cli.d.ts +22 -3
- package/dist/types/cli.d.ts +5 -0
- package/dist/types/commands/daemon.d.ts +6 -2
- package/dist/types/commands/launch.d.ts +1 -0
- package/dist/types/commands/notify.d.ts +6 -0
- package/dist/types/commands/web-search.d.ts +1 -1
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +4 -4
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +9 -9
- package/dist/types/commit/agentic/tools/schemas.d.ts +9 -9
- package/dist/types/commit/agentic/tools/split-commit.d.ts +9 -9
- package/dist/types/commit/analysis/conventional.d.ts +1 -1
- package/dist/types/commit/analysis/summary.d.ts +1 -1
- package/dist/types/commit/changelog/generate.d.ts +3 -3
- package/dist/types/commit/changelog/index.d.ts +2 -2
- package/dist/types/commit/map-reduce/map-phase.d.ts +1 -1
- package/dist/types/commit/map-reduce/reduce-phase.d.ts +1 -1
- package/dist/types/commit/shared-llm.d.ts +9 -9
- package/dist/types/config/keybindings.d.ts +134 -129
- package/dist/types/config/model-profile-activation.d.ts +1 -0
- package/dist/types/config/model-registry.d.ts +35 -35
- package/dist/types/config/models-config-schema.d.ts +111 -111
- package/dist/types/config/settings-schema.d.ts +56 -16
- package/dist/types/config/settings.d.ts +2 -0
- package/dist/types/coordinator/contract.d.ts +1 -1
- package/dist/types/coordinator-mcp/model-preset.d.ts +45 -0
- package/dist/types/coordinator-mcp/policy.d.ts +3 -0
- package/dist/types/coordinator-mcp/server.d.ts +79 -6
- package/dist/types/coordinator-mcp/session-reaper.d.ts +53 -0
- package/dist/types/daemon/control-types.d.ts +10 -0
- package/dist/types/daemon/operator-contract.d.ts +47 -0
- package/dist/types/defaults/skc/extensions/grok-cli-vendor/src/models/catalog.d.ts +4 -0
- package/dist/types/defaults/skc/extensions/grok-cli-vendor/src/shared/errors.d.ts +12 -12
- package/dist/types/discovery/helpers.d.ts +1 -1
- package/dist/types/discovery/substitute-plugin-root.d.ts +0 -4
- package/dist/types/edit/modes/patch.d.ts +2 -2
- package/dist/types/extensibility/extensions/types.d.ts +3 -1
- package/dist/types/goals/tools/goal-tool.d.ts +6 -6
- package/dist/types/i18n/messages/en.d.ts +8 -8
- package/dist/types/internal-urls/local-protocol.d.ts +13 -9
- package/dist/types/lsp/index.d.ts +9 -9
- package/dist/types/lsp/types.d.ts +9 -9
- package/dist/types/main.d.ts +66 -2
- package/dist/types/modes/acp/acp-agent.d.ts +19 -2
- package/dist/types/modes/acp/acp-mode.d.ts +12 -0
- package/dist/types/modes/components/assistant-message.d.ts +1 -1
- package/dist/types/modes/components/custom-editor.d.ts +2 -0
- package/dist/types/modes/components/hook-selector.d.ts +5 -0
- package/dist/types/modes/components/irc-sidebar.d.ts +32 -0
- package/dist/types/modes/components/pet-selector.d.ts +11 -0
- package/dist/types/modes/components/sayknow-pet-widget.d.ts +59 -0
- package/dist/types/modes/components/session-selector.d.ts +22 -9
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/status-line/types.d.ts +1 -1
- package/dist/types/modes/components/status-line.d.ts +0 -10
- package/dist/types/modes/components/tool-execution.d.ts +1 -0
- package/dist/types/modes/components/user-message.d.ts +2 -1
- package/dist/types/modes/controllers/event-controller.d.ts +4 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +24 -2
- package/dist/types/modes/irc-observation-ledger.d.ts +22 -0
- package/dist/types/modes/print-mode.d.ts +3 -4
- package/dist/types/modes/rpc/rpc-client.d.ts +7 -1
- package/dist/types/modes/rpc/rpc-mode.d.ts +2 -1
- package/dist/types/modes/rpc/rpc-types.d.ts +17 -1
- package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +8 -0
- package/dist/types/modes/shared/agent-wire/unattended-run-controller.d.ts +5 -0
- package/dist/types/modes/shared/agent-wire/unattended-session.d.ts +45 -0
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +42 -2
- package/dist/types/modes/theme/defaults/index.d.ts +568 -568
- package/dist/types/modes/types.d.ts +28 -2
- package/dist/types/modes/utils/abort-message.d.ts +1 -1
- package/dist/types/modes/utils/context-usage.d.ts +4 -19
- package/dist/types/modes/utils/irc-message.d.ts +38 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +13 -4
- package/dist/types/notifications/config.d.ts +34 -0
- package/dist/types/notifications/daemon-paths.d.ts +7 -0
- package/dist/types/notifications/index.d.ts +27 -0
- package/dist/types/notifications/lifecycle-control-runtime.d.ts +12 -4
- package/dist/types/notifications/notification-service.d.ts +144 -0
- package/dist/types/notifications/rate-limit-pool.d.ts +27 -9
- package/dist/types/notifications/telegram-daemon-control.d.ts +6 -0
- package/dist/types/notifications/telegram-daemon.d.ts +130 -3
- package/dist/types/notifications/telegram-reference.d.ts +19 -2
- package/dist/types/notifications/topic-registry.d.ts +24 -4
- package/dist/types/registry/agent-registry.d.ts +2 -0
- package/dist/types/rlm/index.d.ts +1 -1
- package/dist/types/sdk.d.ts +2 -0
- package/dist/types/secrets/obfuscator.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +40 -3
- package/dist/types/session/cache-economics.d.ts +79 -0
- package/dist/types/session/context-estimation.d.ts +31 -0
- package/dist/types/session/provider-safety-stop.d.ts +5 -0
- package/dist/types/session/session-manager.d.ts +124 -4
- package/dist/types/session/session-storage.d.ts +155 -13
- package/dist/types/setup/credential-auto-import.d.ts +2 -2
- package/dist/types/skc-runtime/session-state-sidecar.d.ts +34 -3
- package/dist/types/skc-runtime/state-schema.d.ts +19 -19
- package/dist/types/skc-runtime/tmux-common.d.ts +6 -0
- package/dist/types/skc-runtime/tmux-owner-isolation-cli.d.ts +5 -0
- package/dist/types/skc-runtime/tmux-owner-isolation.d.ts +309 -0
- package/dist/types/skc-runtime/tmux-sessions.d.ts +49 -17
- package/dist/types/task/agents.d.ts +2 -2
- package/dist/types/task/executor.d.ts +3 -0
- package/dist/types/task/receipt.d.ts +3 -1
- package/dist/types/task/types.d.ts +35 -27
- package/dist/types/tools/ask-answer-registry.d.ts +5 -0
- package/dist/types/tools/bash.d.ts +1 -1
- package/dist/types/tools/browser/tab-supervisor.d.ts +6 -0
- package/dist/types/tools/browser.d.ts +28 -28
- package/dist/types/tools/computer.d.ts +20 -20
- package/dist/types/tools/cron.d.ts +2 -2
- package/dist/types/tools/debug.d.ts +40 -40
- package/dist/types/tools/gh.d.ts +10 -10
- package/dist/types/tools/image-gen.d.ts +2 -2
- package/dist/types/tools/index.d.ts +58 -6
- package/dist/types/tools/monitor.d.ts +6 -6
- package/dist/types/tools/skill-discovery.d.ts +4 -4
- package/dist/types/tools/subagent.d.ts +12 -12
- package/dist/types/tools/telegram-send.d.ts +7 -0
- package/dist/types/tools/todo-write.d.ts +8 -8
- package/dist/types/utils/external-editor.d.ts +2 -0
- package/dist/types/web/insane/bridge.d.ts +9 -9
- package/dist/types/web/search/index.d.ts +4 -4
- package/package.json +8 -8
- package/scripts/g004-tmux-smoke.ts +196 -36
- package/src/cli/daemon-cli.ts +19 -29
- package/src/cli/malloc-env-guard.test.ts +104 -0
- package/src/cli/malloc-env-guard.ts +149 -0
- package/src/cli/notify-cli.ts +78 -14
- package/src/cli/session-picker.ts +23 -40
- package/src/cli/update-cli.ts +56 -37
- package/src/cli.ts +51 -10
- package/src/commands/daemon.ts +19 -5
- package/src/commands/harness.ts +515 -47
- package/src/commands/launch.ts +11 -3
- package/src/commands/notify.ts +5 -1
- package/src/commands/session.ts +6 -1
- package/src/config/keybindings.ts +5 -0
- package/src/config/model-profile-activation.ts +1 -1
- package/src/config/model-profiles.ts +14 -14
- package/src/config/settings-schema.ts +41 -1
- package/src/config/settings.ts +96 -45
- package/src/coordinator/contract.ts +1 -0
- package/src/coordinator-mcp/model-preset.ts +100 -0
- package/src/coordinator-mcp/policy.ts +30 -0
- package/src/coordinator-mcp/server.ts +2958 -430
- package/src/coordinator-mcp/session-reaper.ts +129 -0
- package/src/daemon/control-types.ts +11 -0
- package/src/daemon/operator-contract.ts +121 -0
- package/src/defaults/skc/extensions/grok-cli-vendor/src/models/catalog.ts +57 -17
- package/src/defaults/skc/extensions/grok-cli-vendor/src/payload/sanitize.ts +15 -2
- package/src/defaults/skc/extensions/grok-cli-vendor/src/provider/register.ts +5 -1
- package/src/extensibility/extensions/runner.ts +1 -1
- package/src/extensibility/extensions/types.ts +3 -1
- package/src/internal-urls/docs-index.generated.ts +10 -9
- package/src/internal-urls/local-protocol.ts +29 -10
- package/src/main.ts +301 -80
- package/src/modes/acp/acp-agent.ts +730 -100
- package/src/modes/acp/acp-mode.ts +29 -2
- package/src/modes/components/assistant-message.ts +32 -3
- package/src/modes/components/bash-execution.ts +43 -13
- package/src/modes/components/custom-editor.ts +5 -0
- package/src/modes/components/footer.ts +3 -3
- package/src/modes/components/hook-selector.ts +12 -0
- package/src/modes/components/irc-sidebar.ts +206 -0
- package/src/modes/components/pet-selector.ts +55 -0
- package/src/modes/components/sayknow-pet-widget.ts +360 -0
- package/src/modes/components/session-selector.ts +222 -221
- package/src/modes/components/settings-selector.ts +10 -0
- package/src/modes/components/status-line/segments.ts +14 -7
- package/src/modes/components/status-line/types.ts +1 -1
- package/src/modes/components/status-line.ts +4 -171
- package/src/modes/components/tool-execution.ts +47 -6
- package/src/modes/components/user-message.ts +26 -9
- package/src/modes/controllers/command-controller.ts +28 -2
- package/src/modes/controllers/event-controller.ts +159 -36
- package/src/modes/controllers/extension-ui-controller.ts +37 -18
- package/src/modes/controllers/input-controller.ts +8 -2
- package/src/modes/controllers/selector-controller.ts +62 -15
- package/src/modes/interactive-mode.ts +199 -7
- package/src/modes/irc-observation-ledger.ts +127 -0
- package/src/modes/print-mode.ts +228 -92
- package/src/modes/rpc/rpc-client.ts +58 -1
- package/src/modes/rpc/rpc-mode.ts +286 -85
- package/src/modes/rpc/rpc-types.ts +15 -1
- package/src/modes/shared/agent-wire/command-dispatch.ts +33 -1
- package/src/modes/shared/agent-wire/command-validation.ts +10 -0
- package/src/modes/shared/agent-wire/deep-interview-gate.ts +45 -2
- package/src/modes/shared/agent-wire/scopes.ts +1 -0
- package/src/modes/shared/agent-wire/unattended-session.ts +288 -1
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +130 -20
- package/src/modes/types.ts +34 -2
- package/src/modes/utils/context-usage.ts +56 -92
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/modes/utils/irc-message.ts +138 -0
- package/src/modes/utils/ui-helpers.ts +216 -50
- package/src/notifications/config.ts +44 -0
- package/src/notifications/daemon-paths.ts +8 -0
- package/src/notifications/index.ts +535 -75
- package/src/notifications/lifecycle-control-runtime.ts +930 -77
- package/src/notifications/notification-service.ts +710 -0
- package/src/notifications/rate-limit-pool.ts +46 -12
- package/src/notifications/telegram-daemon-control.ts +27 -2
- package/src/notifications/telegram-daemon.ts +635 -94
- package/src/notifications/telegram-reference.ts +73 -13
- package/src/notifications/topic-registry.ts +86 -9
- package/src/prompts/system/irc-peer-roster.md +1 -0
- package/src/prompts/system/subagent-system-prompt.md +1 -0
- package/src/prompts/system/system-prompt.md +1 -0
- package/src/prompts/tools/irc.md +1 -1
- package/src/registry/agent-registry.ts +3 -0
- package/src/sdk.ts +52 -1
- package/src/secrets/obfuscator.ts +4 -2
- package/src/session/agent-session.ts +670 -217
- package/src/session/cache-economics.ts +275 -0
- package/src/session/context-estimation.ts +91 -0
- package/src/session/provider-safety-stop.ts +9 -0
- package/src/session/session-dump-format.ts +6 -0
- package/src/session/session-manager.ts +809 -39
- package/src/session/session-storage.ts +582 -38
- package/src/skc-runtime/session-state-sidecar.ts +756 -135
- package/src/skc-runtime/tmux-common.ts +26 -7
- package/src/skc-runtime/tmux-gc.ts +52 -9
- package/src/skc-runtime/tmux-owner-isolation-cli.ts +185 -0
- package/src/skc-runtime/tmux-owner-isolation.ts +2060 -0
- package/src/skc-runtime/tmux-sessions.ts +871 -68
- package/src/slash-commands/builtin-registry.ts +153 -9
- package/src/slash-commands/helpers/context-report.ts +26 -4
- package/src/task/executor.ts +12 -3
- package/src/task/index.ts +8 -0
- package/src/task/receipt.ts +7 -2
- package/src/task/types.ts +26 -0
- package/src/tools/ask-answer-registry.ts +25 -0
- package/src/tools/browser/tab-supervisor.ts +63 -6
- package/src/tools/browser.ts +8 -3
- package/src/tools/index.ts +81 -6
- package/src/tools/sqlite-reader.ts +8 -4
- package/src/tui/output-block.ts +18 -6
- package/src/utils/external-editor.ts +6 -1
|
@@ -138,6 +138,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
138
138
|
readonly type: "boolean";
|
|
139
139
|
readonly default: false;
|
|
140
140
|
};
|
|
141
|
+
readonly "notifications.telegram.topics.nameTemplate": {
|
|
142
|
+
readonly type: "string";
|
|
143
|
+
readonly default: undefined;
|
|
144
|
+
};
|
|
141
145
|
readonly "notifications.discord.botToken": {
|
|
142
146
|
readonly type: "string";
|
|
143
147
|
readonly default: undefined;
|
|
@@ -163,6 +167,11 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
163
167
|
readonly default: "lean";
|
|
164
168
|
readonly validate: (value: string) => value is "lean" | "verbose";
|
|
165
169
|
};
|
|
170
|
+
readonly "notifications.sessionScope": {
|
|
171
|
+
readonly type: "string";
|
|
172
|
+
readonly default: "all";
|
|
173
|
+
readonly validate: (value: string) => value is "primary" | "all";
|
|
174
|
+
};
|
|
166
175
|
readonly "notifications.daemon.idleTimeoutMs": {
|
|
167
176
|
readonly type: "number";
|
|
168
177
|
readonly default: 60000;
|
|
@@ -366,23 +375,23 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
366
375
|
readonly description: "English";
|
|
367
376
|
}, {
|
|
368
377
|
readonly value: "ko";
|
|
369
|
-
readonly label: "
|
|
378
|
+
readonly label: "한국어";
|
|
370
379
|
readonly description: "Korean";
|
|
371
380
|
}, {
|
|
372
381
|
readonly value: "zh";
|
|
373
|
-
readonly label: "
|
|
382
|
+
readonly label: "中文 (简体)";
|
|
374
383
|
readonly description: "Chinese (Simplified)";
|
|
375
384
|
}, {
|
|
376
385
|
readonly value: "ja";
|
|
377
|
-
readonly label: "
|
|
386
|
+
readonly label: "日本語";
|
|
378
387
|
readonly description: "Japanese";
|
|
379
388
|
}, {
|
|
380
389
|
readonly value: "es";
|
|
381
|
-
readonly label: "
|
|
390
|
+
readonly label: "Español";
|
|
382
391
|
readonly description: "Spanish";
|
|
383
392
|
}, {
|
|
384
393
|
readonly value: "fr";
|
|
385
|
-
readonly label: "
|
|
394
|
+
readonly label: "Français";
|
|
386
395
|
readonly description: "French";
|
|
387
396
|
}, {
|
|
388
397
|
readonly value: "de";
|
|
@@ -491,6 +500,25 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
491
500
|
readonly description: "Use the session name color for the editor border and status line gap";
|
|
492
501
|
};
|
|
493
502
|
};
|
|
503
|
+
readonly "pet.mode": {
|
|
504
|
+
readonly type: "enum";
|
|
505
|
+
readonly values: readonly ["off", "red", "blue"];
|
|
506
|
+
readonly default: "off";
|
|
507
|
+
readonly ui: {
|
|
508
|
+
readonly tab: "appearance";
|
|
509
|
+
readonly label: "Sayknow Pet";
|
|
510
|
+
readonly description: "16x16 real-pixel sayknow living beside the composer (sixel/kitty terminals)";
|
|
511
|
+
readonly options: readonly [{
|
|
512
|
+
readonly value: "off";
|
|
513
|
+
readonly label: "Off";
|
|
514
|
+
readonly description: "No pet";
|
|
515
|
+
}, ...{
|
|
516
|
+
value: "red" | "blue";
|
|
517
|
+
label: string;
|
|
518
|
+
description: string;
|
|
519
|
+
}[]];
|
|
520
|
+
};
|
|
521
|
+
};
|
|
494
522
|
readonly "statusLine.maxRows": {
|
|
495
523
|
readonly type: "number";
|
|
496
524
|
readonly default: 1;
|
|
@@ -679,7 +707,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
679
707
|
readonly ui: {
|
|
680
708
|
readonly tab: "tools";
|
|
681
709
|
readonly label: "Artifact head size (KB)";
|
|
682
|
-
readonly description: "Amount of head content kept inline alongside the tail when output spills to artifact (middle elision). 0 disables
|
|
710
|
+
readonly description: "Amount of head content kept inline alongside the tail when output spills to artifact (middle elision). 0 disables — keep tail only.";
|
|
683
711
|
readonly options: readonly [{
|
|
684
712
|
readonly value: "0";
|
|
685
713
|
readonly label: "0 KB";
|
|
@@ -1172,7 +1200,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1172
1200
|
readonly ui: {
|
|
1173
1201
|
readonly tab: "model";
|
|
1174
1202
|
readonly label: "Service Tier";
|
|
1175
|
-
readonly description:
|
|
1203
|
+
readonly description: "Processing priority hint (none = omit). OpenAI accepts the tier values directly; Anthropic realizes `priority` as `speed: \"fast\"` on supported Opus models. Scoped values target one family.";
|
|
1176
1204
|
readonly options: readonly [{
|
|
1177
1205
|
readonly value: "none";
|
|
1178
1206
|
readonly label: "None";
|
|
@@ -1215,7 +1243,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1215
1243
|
readonly ui: {
|
|
1216
1244
|
readonly tab: "tasks";
|
|
1217
1245
|
readonly label: "Subagent Service Tier";
|
|
1218
|
-
readonly description:
|
|
1246
|
+
readonly description: "Service tier applied to task-tool subagents only. \"inherit\" copies the main session tier; any explicit value overrides it for subagents without touching the main session.";
|
|
1219
1247
|
readonly options: readonly [{
|
|
1220
1248
|
readonly value: "inherit";
|
|
1221
1249
|
readonly label: "Inherit";
|
|
@@ -1477,7 +1505,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1477
1505
|
readonly ui: {
|
|
1478
1506
|
readonly tab: "interaction";
|
|
1479
1507
|
readonly label: "Check for Updates";
|
|
1480
|
-
readonly description: "
|
|
1508
|
+
readonly description: "At interactive startup, notify of newer versions; never install. Use `skc update` only for recognized Bun global, Windows npm, or bundled-installer binaries; source, linked, and unrecognized installs use their original method.";
|
|
1481
1509
|
};
|
|
1482
1510
|
};
|
|
1483
1511
|
readonly "starReminder.enabled": {
|
|
@@ -2012,11 +2040,11 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2012
2040
|
readonly options: readonly [{
|
|
2013
2041
|
readonly value: "global";
|
|
2014
2042
|
readonly label: "Global";
|
|
2015
|
-
readonly description: "One shared bank
|
|
2043
|
+
readonly description: "One shared bank — every project sees the same memories";
|
|
2016
2044
|
}, {
|
|
2017
2045
|
readonly value: "per-project";
|
|
2018
2046
|
readonly label: "Per project";
|
|
2019
|
-
readonly description: "Isolated bank per cwd basename
|
|
2047
|
+
readonly description: "Isolated bank per cwd basename — projects cannot see each other's memories";
|
|
2020
2048
|
}, {
|
|
2021
2049
|
readonly value: "per-project-tagged";
|
|
2022
2050
|
readonly label: "Per project (tagged)";
|
|
@@ -2116,7 +2144,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2116
2144
|
readonly ui: {
|
|
2117
2145
|
readonly tab: "memory";
|
|
2118
2146
|
readonly label: "Hindsight Mental Models";
|
|
2119
|
-
readonly description: "Read curated reflect summaries (mental models) into developer instructions at boot. Loads existing models on the bank
|
|
2147
|
+
readonly description: "Read curated reflect summaries (mental models) into developer instructions at boot. Loads existing models on the bank — does not write. Pair with hindsight.mentalModelAutoSeed to also auto-create the built-in seed set.";
|
|
2120
2148
|
readonly condition: "hindsightActive";
|
|
2121
2149
|
};
|
|
2122
2150
|
};
|
|
@@ -2154,7 +2182,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2154
2182
|
readonly ui: {
|
|
2155
2183
|
readonly tab: "context";
|
|
2156
2184
|
readonly label: "TTSR Context Mode";
|
|
2157
|
-
readonly description: "What to do with partial output when TTSR triggers. 'discard' (recommended) drops the aborted partial turn so it never accumulates in context. 'keep' retains every aborted partial turn, which grows the token footprint each time a rule fires
|
|
2185
|
+
readonly description: "What to do with partial output when TTSR triggers. 'discard' (recommended) drops the aborted partial turn so it never accumulates in context. 'keep' retains every aborted partial turn, which grows the token footprint each time a rule fires — prefer 'discard' unless you specifically need the partial output.";
|
|
2158
2186
|
};
|
|
2159
2187
|
};
|
|
2160
2188
|
readonly "ttsr.interruptMode": {
|
|
@@ -2637,6 +2665,15 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2637
2665
|
readonly description: "Enable agent-to-agent IRC messaging via the irc tool";
|
|
2638
2666
|
};
|
|
2639
2667
|
};
|
|
2668
|
+
readonly "irc.sidebar.enabled": {
|
|
2669
|
+
readonly type: "boolean";
|
|
2670
|
+
readonly default: true;
|
|
2671
|
+
readonly ui: {
|
|
2672
|
+
readonly tab: "tools";
|
|
2673
|
+
readonly label: "IRC Sidebar";
|
|
2674
|
+
readonly description: "Enable the IRC message sidebar (opens with the toggle key; starts closed)";
|
|
2675
|
+
};
|
|
2676
|
+
};
|
|
2640
2677
|
readonly "renderMermaid.enabled": {
|
|
2641
2678
|
readonly type: "boolean";
|
|
2642
2679
|
readonly default: false;
|
|
@@ -3102,7 +3139,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
3102
3139
|
readonly ui: {
|
|
3103
3140
|
readonly tab: "tasks";
|
|
3104
3141
|
readonly label: "Isolation Mode";
|
|
3105
|
-
readonly description:
|
|
3142
|
+
readonly description: "Isolation backend for subagents. \"auto\" lets the native PAL pick the best available backend (CoW-aware filesystems, then overlayfs/ProjFS, then a git worktree / recursive-copy fallback).";
|
|
3106
3143
|
readonly options: readonly [{
|
|
3107
3144
|
readonly value: "none";
|
|
3108
3145
|
readonly label: "None";
|
|
@@ -3457,7 +3494,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
3457
3494
|
}, {
|
|
3458
3495
|
readonly value: "duckduckgo";
|
|
3459
3496
|
readonly label: "DuckDuckGo";
|
|
3460
|
-
readonly description: "Keyless default
|
|
3497
|
+
readonly description: "Keyless default — no API key or OAuth required";
|
|
3461
3498
|
}, {
|
|
3462
3499
|
readonly value: "insane";
|
|
3463
3500
|
readonly label: "Insane";
|
|
@@ -3773,7 +3810,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
3773
3810
|
readonly ui: {
|
|
3774
3811
|
readonly tab: "interaction";
|
|
3775
3812
|
readonly label: "Plugin Security Risk Threshold";
|
|
3776
|
-
readonly description: "Score threshold (0
|
|
3813
|
+
readonly description: "Score threshold (0–100) above which block mode denies install. Default 60.";
|
|
3777
3814
|
};
|
|
3778
3815
|
};
|
|
3779
3816
|
readonly "telegram.enabled": {
|
|
@@ -4116,6 +4153,9 @@ export interface NotificationsSettings {
|
|
|
4116
4153
|
richDraft: {
|
|
4117
4154
|
enabled: boolean;
|
|
4118
4155
|
};
|
|
4156
|
+
topics: {
|
|
4157
|
+
nameTemplate: string | undefined;
|
|
4158
|
+
};
|
|
4119
4159
|
};
|
|
4120
4160
|
discord: {
|
|
4121
4161
|
botToken: string | undefined;
|
|
@@ -115,6 +115,8 @@ export declare class Settings {
|
|
|
115
115
|
* Set a model role (helper for modelRoles record).
|
|
116
116
|
*/
|
|
117
117
|
setModelRole(role: ModelRole | string, modelId: string): void;
|
|
118
|
+
setGlobalModelRole(role: ModelRole | string, modelId: string | undefined): void;
|
|
119
|
+
setGlobalModelRoleAndFlush(role: ModelRole | string, modelId: string | undefined): Promise<void>;
|
|
118
120
|
/**
|
|
119
121
|
* Set an agent model override while keeping any live runtime override aligned.
|
|
120
122
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const COORDINATOR_MCP_PROTOCOL_VERSION = "2024-11-05";
|
|
2
2
|
export declare const COORDINATOR_MCP_SERVER_NAME = "skc-coordinator-mcp";
|
|
3
|
-
export declare const COORDINATOR_MCP_TOOL_NAMES: readonly ["skc_coordinator_list_sessions", "skc_coordinator_read_status", "skc_coordinator_read_tail", "skc_coordinator_list_questions", "skc_coordinator_list_artifacts", "skc_coordinator_read_artifact", "skc_coordinator_read_coordination_status", "skc_coordinator_watch_events", "skc_coordinator_register_session", "skc_coordinator_start_session", "skc_coordinator_send_prompt", "skc_coordinator_submit_question_answer", "skc_coordinator_read_turn", "skc_coordinator_await_turn", "skc_coordinator_report_status", "skc_delegate_plan", "skc_delegate_execute", "skc_delegate_team"];
|
|
3
|
+
export declare const COORDINATOR_MCP_TOOL_NAMES: readonly ["skc_coordinator_list_sessions", "skc_coordinator_read_status", "skc_coordinator_read_tail", "skc_coordinator_list_questions", "skc_coordinator_list_artifacts", "skc_coordinator_read_artifact", "skc_coordinator_read_coordination_status", "skc_coordinator_watch_events", "skc_coordinator_register_session", "skc_coordinator_start_session", "skc_coordinator_stop_session", "skc_coordinator_send_prompt", "skc_coordinator_submit_question_answer", "skc_coordinator_read_turn", "skc_coordinator_await_turn", "skc_coordinator_report_status", "skc_delegate_plan", "skc_delegate_execute", "skc_delegate_team"];
|
|
4
4
|
export type CoordinatorToolName = (typeof COORDINATOR_MCP_TOOL_NAMES)[number];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ModelProfileDefinition } from "../config/model-profiles";
|
|
2
|
+
/**
|
|
3
|
+
* Loads the merged built-in + custom model-profile registry the way the `skc`
|
|
4
|
+
* CLI resolves `--mpreset`, so coordinator MCP launches select the same
|
|
5
|
+
* authoritative profile the spawned child will activate. Custom profiles live
|
|
6
|
+
* in the shared models config, which the child inherits, so both sides agree.
|
|
7
|
+
*/
|
|
8
|
+
export type CoordinatorModelProfileLoader = () => Map<string, ModelProfileDefinition> | Promise<Map<string, ModelProfileDefinition>>;
|
|
9
|
+
/**
|
|
10
|
+
* Thrown by the default loader when `models.yml` exists but is invalid or
|
|
11
|
+
* unreadable. This lets the resolver fail closed with a distinct, stable reason
|
|
12
|
+
* instead of silently collapsing a broken registry to the built-ins-only set
|
|
13
|
+
* (which would misreport a caller's valid custom profile as unknown).
|
|
14
|
+
*/
|
|
15
|
+
export declare class CoordinatorModelProfileRegistryError extends Error {
|
|
16
|
+
constructor(cause?: unknown);
|
|
17
|
+
}
|
|
18
|
+
export declare const loadCoordinatorModelProfiles: CoordinatorModelProfileLoader;
|
|
19
|
+
export type CoordinatorMpresetResolution = {
|
|
20
|
+
ok: true;
|
|
21
|
+
mpreset: string | null;
|
|
22
|
+
} | {
|
|
23
|
+
ok: false;
|
|
24
|
+
reason: "unknown_model_profile";
|
|
25
|
+
mpreset: string;
|
|
26
|
+
available_profiles: string[];
|
|
27
|
+
} | {
|
|
28
|
+
ok: false;
|
|
29
|
+
reason: "model_profile_registry_error";
|
|
30
|
+
mpreset: string;
|
|
31
|
+
available_profiles: string[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Resolve a coordinator `mpreset` argument against the merged profile registry.
|
|
35
|
+
*
|
|
36
|
+
* Only an absent (`undefined`/`null`) value is a no-op (`mpreset: null`); an
|
|
37
|
+
* explicit empty/whitespace string is a caller error and is rejected rather
|
|
38
|
+
* than silently launching at the default tier. Legacy aliases are canonicalized
|
|
39
|
+
* exactly like the CLI (e.g. `codex-standard` -> `codex-medium`) so coordinator
|
|
40
|
+
* selection stays in parity with `skc --mpreset <profile>`; the resolved value
|
|
41
|
+
* is the canonical profile name. Unknown names are rejected with the
|
|
42
|
+
* available-profile listing and never reach a spawned child command, and a
|
|
43
|
+
* broken registry fails closed with `model_profile_registry_error`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveCoordinatorMpreset(raw: unknown, loadProfiles: CoordinatorModelProfileLoader): Promise<CoordinatorMpresetResolution>;
|
|
@@ -10,6 +10,9 @@ export interface CoordinatorMcpConfig {
|
|
|
10
10
|
namespace: CoordinatorNamespace;
|
|
11
11
|
stateRoot: string;
|
|
12
12
|
sessionCommand: string | null;
|
|
13
|
+
sessionIdleTtlMs: number;
|
|
14
|
+
sessionSweepIntervalMs: number;
|
|
15
|
+
forceStopEnabled: boolean;
|
|
13
16
|
}
|
|
14
17
|
export interface CoordinatorMutationRequest {
|
|
15
18
|
allow_mutation?: boolean;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { COORDINATOR_MCP_PROTOCOL_VERSION, COORDINATOR_MCP_SERVER_NAME, COORDINATOR_MCP_TOOL_NAMES, type CoordinatorToolName } from "../coordinator/contract";
|
|
2
|
+
import { type OwnerIsolationProbe } from "../skc-runtime/tmux-owner-isolation";
|
|
3
|
+
import { type CoordinatorModelProfileLoader } from "./model-preset";
|
|
2
4
|
import { type CoordinatorMcpConfig } from "./policy";
|
|
5
|
+
import { type SessionReaper } from "./session-reaper";
|
|
3
6
|
export type { CoordinatorToolName };
|
|
4
7
|
export { COORDINATOR_MCP_PROTOCOL_VERSION, COORDINATOR_MCP_SERVER_NAME, COORDINATOR_MCP_TOOL_NAMES };
|
|
5
8
|
interface JsonRpcRequest {
|
|
@@ -22,20 +25,32 @@ interface JsonRpcResponse {
|
|
|
22
25
|
interface SessionStartInput {
|
|
23
26
|
cwd: string;
|
|
24
27
|
prompt?: string;
|
|
28
|
+
mpreset?: string | null;
|
|
25
29
|
namespace: {
|
|
26
30
|
profile: string | null;
|
|
27
31
|
repo: string | null;
|
|
28
32
|
};
|
|
29
33
|
worktree: true;
|
|
34
|
+
sessionId: string;
|
|
35
|
+
launchId: string;
|
|
36
|
+
/** Canonical, coordinator-owned immutable readiness marker path. */
|
|
37
|
+
readinessMarkerFile: string;
|
|
38
|
+
/** @deprecated Compatibility alias for injected launch providers. */
|
|
39
|
+
readinessFile: string;
|
|
30
40
|
}
|
|
41
|
+
interface CommandResult {
|
|
42
|
+
exitCode: number;
|
|
43
|
+
stdout: string;
|
|
44
|
+
stderr: string;
|
|
45
|
+
}
|
|
46
|
+
type CommandRunner = (command: string[], stdinLine?: string) => Promise<CommandResult>;
|
|
31
47
|
interface CoordinatorServices {
|
|
32
48
|
listSessions?: () => unknown[] | Promise<unknown[]>;
|
|
33
49
|
startSession?: (input: SessionStartInput) => unknown | Promise<unknown>;
|
|
34
|
-
commandRunner?:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}>;
|
|
50
|
+
commandRunner?: CommandRunner;
|
|
51
|
+
forceCloseSession?: (sessionName: string, env: NodeJS.ProcessEnv, expectedSessionId?: string, expectedStateFile?: string) => Promise<unknown>;
|
|
52
|
+
ownerIsolationProbe?: OwnerIsolationProbe;
|
|
53
|
+
resolveModelProfiles?: CoordinatorModelProfileLoader;
|
|
39
54
|
}
|
|
40
55
|
interface CoordinatorMcpServerOptions {
|
|
41
56
|
env?: NodeJS.ProcessEnv;
|
|
@@ -43,16 +58,35 @@ interface CoordinatorMcpServerOptions {
|
|
|
43
58
|
}
|
|
44
59
|
interface LegacyHandlerOptions {
|
|
45
60
|
env?: NodeJS.ProcessEnv;
|
|
46
|
-
createSession?: () => unknown;
|
|
61
|
+
createSession?: (input: SessionStartInput) => unknown;
|
|
47
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Append an authoritative `--mpreset <profile>` to the coordinator child launch
|
|
65
|
+
* command so the spawned SKC session activates the selected profile from its
|
|
66
|
+
* first turn. The profile name is validated against the merged registry before
|
|
67
|
+
* reaching here; it is still shell-quoted as defense in depth.
|
|
68
|
+
*
|
|
69
|
+
* Precedence note: this matches `skc --mpreset <profile>` semantics exactly, so
|
|
70
|
+
* an explicit model-affecting flag already present in the operator-configured
|
|
71
|
+
* `sessionCommand` (e.g. a `--model`/`--thinking` baked into the launch command)
|
|
72
|
+
* follows the same CLI precedence as a direct `skc --mpreset ... --model ...`
|
|
73
|
+
* invocation. The effective profile recorded on the session is the
|
|
74
|
+
* coordinator-resolved request, not a child-attested activation receipt; a
|
|
75
|
+
* cross-process activation receipt is a possible future enhancement and is out
|
|
76
|
+
* of scope for the per-session selection contract here.
|
|
77
|
+
*/
|
|
78
|
+
export declare function buildCoordinatorSessionCommand(sessionCommand: string, mpreset: string | null | undefined): string;
|
|
48
79
|
export declare const COORDINATOR_AWAIT_TURN_TIMEOUT_MAX_MS: number;
|
|
49
80
|
export declare const COORDINATOR_RUNTIME_PROMPT_ACK_TIMEOUT_MAX_MS: number;
|
|
81
|
+
export declare const COORDINATOR_RUNTIME_READINESS_TIMEOUT_MAX_MS: number;
|
|
50
82
|
export declare const COORDINATOR_EVENT_WATCH_TIMEOUT_MAX_MS = 30000;
|
|
51
83
|
export declare const COORDINATOR_POLL_INTERVAL_MAX_MS = 10000;
|
|
52
84
|
export declare function boundedAwaitTurnTimeoutMs(value: unknown): number;
|
|
53
85
|
export declare function boundedRuntimePromptAckTimeoutMs(value: unknown): number;
|
|
86
|
+
export declare function boundedRuntimeReadinessTimeoutMs(value: unknown): number;
|
|
54
87
|
export declare function boundedEventWatchTimeoutMs(value: unknown): number;
|
|
55
88
|
export declare function boundedPollIntervalMs(value: unknown): number;
|
|
89
|
+
export declare function coordinatorOwnerIsolationProbe(runner: CommandRunner): Promise<OwnerIsolationProbe>;
|
|
56
90
|
export declare function readCoordinatorArtifact(config: CoordinatorMcpConfig, args: {
|
|
57
91
|
path: unknown;
|
|
58
92
|
}): Promise<Record<string, unknown>>;
|
|
@@ -61,6 +95,45 @@ export declare function createCoordinatorMcpServer(options?: CoordinatorMcpServe
|
|
|
61
95
|
callTool: (name: string, args?: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
62
96
|
handleJsonRpc: (request: JsonRpcRequest) => Promise<JsonRpcResponse>;
|
|
63
97
|
handle: (request: JsonRpcRequest) => Promise<JsonRpcResponse>;
|
|
98
|
+
reapSession: (rawId: unknown, opts?: {
|
|
99
|
+
force?: boolean;
|
|
100
|
+
reason?: string;
|
|
101
|
+
}) => Promise<{
|
|
102
|
+
ok: boolean;
|
|
103
|
+
reason?: string;
|
|
104
|
+
killed: boolean;
|
|
105
|
+
active_turn_id?: string;
|
|
106
|
+
detail?: string;
|
|
107
|
+
}>;
|
|
108
|
+
sessionReaper: SessionReaper;
|
|
64
109
|
};
|
|
65
110
|
export declare function handleCoordinatorMcpRequest(request: JsonRpcRequest, options?: LegacyHandlerOptions): Promise<JsonRpcResponse>;
|
|
111
|
+
export interface PumpCoordinatorOptions {
|
|
112
|
+
/** Max concurrent in-flight *data* (non-control) handlers. Control frames (ping) bypass this. */
|
|
113
|
+
maxDataConcurrency?: number;
|
|
114
|
+
/** Max data requests queued waiting for a slot before overflow is rejected as server_busy. */
|
|
115
|
+
maxQueueDepth?: number;
|
|
116
|
+
/** Bounded wait for in-flight handlers/writes to settle after input ends. */
|
|
117
|
+
drainTimeoutMs?: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Pump a newline-delimited JSON-RPC stream with BOUNDED concurrent dispatch.
|
|
121
|
+
*
|
|
122
|
+
* A long-running tool call (e.g. skc_coordinator_await_turn, which polls for
|
|
123
|
+
* minutes) must not block the read loop from answering keepalive pings on the
|
|
124
|
+
* same stdio channel. But naive unbounded concurrency reintroduces its own
|
|
125
|
+
* hazards, so this pump enforces the safety envelope the coordinator needs:
|
|
126
|
+
*
|
|
127
|
+
* - Control frames (ping) bypass the data-concurrency cap → keepalive is always
|
|
128
|
+
* answerable even while data handlers saturate.
|
|
129
|
+
* - Data handlers are capped at `maxDataConcurrency`; excess is queued up to
|
|
130
|
+
* `maxQueueDepth`, then rejected as `server_busy` (bounded memory / fanout).
|
|
131
|
+
* - A coded local `EPIPE` terminalizes writer and dispatch together; other
|
|
132
|
+
* writer faults reject the pump without poisoning the serialized write chain.
|
|
133
|
+
* - On EOF or a closed peer the pump drains already-running handlers (bounded
|
|
134
|
+
* by `drainTimeoutMs`) and never promotes queued work.
|
|
135
|
+
* - Byte chunks are decoded with a streaming decoder so multibyte characters
|
|
136
|
+
* split across chunks are not corrupted.
|
|
137
|
+
*/
|
|
138
|
+
export declare function pumpCoordinatorMcpStream(handleJsonRpc: (request: JsonRpcRequest) => Promise<JsonRpcResponse>, input: AsyncIterable<string | Uint8Array>, writeLine: (line: string) => void | Promise<void>, options?: PumpCoordinatorOptions): Promise<void>;
|
|
66
139
|
export declare function runCoordinatorMcpStdio(options?: CoordinatorMcpServerOptions): Promise<void>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Idle reaper for coordinator-managed SKC worker sessions.
|
|
3
|
+
*
|
|
4
|
+
* Every `skc_delegate_*` call that omits `session_id` starts a fresh tmux worker
|
|
5
|
+
* session. Nothing in the coordinator ever tore those down, so completed/crashed
|
|
6
|
+
* sessions accumulated (RAM + worktrees) until something killed them by hand.
|
|
7
|
+
*
|
|
8
|
+
* This is the automatic backstop (defense-in-depth): a periodic sweep force-closes
|
|
9
|
+
* sessions that are (a) ephemeral — coordinator delegate-created, never a user's
|
|
10
|
+
* registered resident session, (b) not mid-turn, and (c) idle past a TTL.
|
|
11
|
+
*
|
|
12
|
+
* The controller is pure + fully injectable (clock / list / reap side-effects) so
|
|
13
|
+
* it is unit-testable without tmux, the filesystem, or wall-clock waits. The
|
|
14
|
+
* scheduling mirrors the proven resource-gc controller: a recursive setTimeout
|
|
15
|
+
* with a generation guard so a stop()+start() can never leak a duplicate timer.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_SESSION_IDLE_TTL_MS: number;
|
|
18
|
+
export declare const DEFAULT_SESSION_SWEEP_INTERVAL_MS: number;
|
|
19
|
+
export declare const MIN_SESSION_IDLE_TTL_MS = 60000;
|
|
20
|
+
export declare const MIN_SESSION_SWEEP_INTERVAL_MS = 30000;
|
|
21
|
+
/** Minimal projection of a coordinator session the reaper needs to decide. */
|
|
22
|
+
export interface ReapableSession {
|
|
23
|
+
sessionId: string;
|
|
24
|
+
/** True only for coordinator delegate-created sessions. User-registered resident sessions are false and never reaped. */
|
|
25
|
+
ephemeral: boolean;
|
|
26
|
+
/** Epoch ms of last observed activity (turn update / session-state write / session creation). */
|
|
27
|
+
lastActivityMs: number;
|
|
28
|
+
/** True while a turn is active — never reap mid-turn. */
|
|
29
|
+
hasActiveTurn: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface SessionReaperPolicy {
|
|
32
|
+
idleTtlMs: number;
|
|
33
|
+
sweepIntervalMs: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Pure selection: which sessions are safe to reap at `now`.
|
|
37
|
+
* A session is reapable iff ephemeral AND not mid-turn AND idle ≥ (clamped) TTL.
|
|
38
|
+
*/
|
|
39
|
+
export declare function selectReapableSessions(sessions: readonly ReapableSession[], now: number, idleTtlMs: number): ReapableSession[];
|
|
40
|
+
/** Injectable side-effects so the controller runs in tests without tmux/fs/real time. */
|
|
41
|
+
export interface SessionReaperDeps {
|
|
42
|
+
listSessions: () => Promise<ReapableSession[]>;
|
|
43
|
+
reapSession: (sessionId: string) => Promise<void>;
|
|
44
|
+
now: () => number;
|
|
45
|
+
}
|
|
46
|
+
export interface SessionReaper {
|
|
47
|
+
/** Run one sweep; returns the number of sessions successfully reaped. */
|
|
48
|
+
sweepOnce: () => Promise<number>;
|
|
49
|
+
start: () => void;
|
|
50
|
+
stop: () => void;
|
|
51
|
+
readonly running: boolean;
|
|
52
|
+
}
|
|
53
|
+
export declare function createSessionReaper(deps: SessionReaperDeps, policy: SessionReaperPolicy): SessionReaper;
|
|
@@ -40,6 +40,14 @@ export interface DaemonOperationOptions {
|
|
|
40
40
|
/** For reload: spawn a fresh owner even when none is currently running. */
|
|
41
41
|
spawnIfStopped?: boolean;
|
|
42
42
|
}
|
|
43
|
+
export interface DaemonRecovery {
|
|
44
|
+
/** Machine-readable recovery category for automation branching. */
|
|
45
|
+
reason: "ownership_mismatch";
|
|
46
|
+
/** One-line human summary of why the operation could not proceed. */
|
|
47
|
+
summary: string;
|
|
48
|
+
/** Ordered, copy-pasteable remediation steps. */
|
|
49
|
+
steps: string[];
|
|
50
|
+
}
|
|
43
51
|
export interface DaemonOperationResult {
|
|
44
52
|
kind: DaemonKind;
|
|
45
53
|
action: Exclude<DaemonAction, "list">;
|
|
@@ -48,6 +56,8 @@ export interface DaemonOperationResult {
|
|
|
48
56
|
after?: DaemonStatus;
|
|
49
57
|
warnings: string[];
|
|
50
58
|
message: string;
|
|
59
|
+
/** Present when the operation was refused with an actionable recovery path (e.g. ownership mismatch). */
|
|
60
|
+
recovery?: DaemonRecovery;
|
|
51
61
|
}
|
|
52
62
|
export interface BuiltInDaemonController {
|
|
53
63
|
readonly kind: DaemonKind;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared operator contract for the `skc daemon` command surface.
|
|
3
|
+
*
|
|
4
|
+
* One source of truth for the beginner-safe operational vocabulary so the
|
|
5
|
+
* guided human surface and the machine-readable JSON never drift:
|
|
6
|
+
* - the terse action verbs plus operator aliases (e.g. `restart` -> `reload`),
|
|
7
|
+
* - process exit codes,
|
|
8
|
+
* - concise vs. `--verbose` human rendering of statuses and results, and
|
|
9
|
+
* - actionable recovery guidance for a token/chat ownership mismatch.
|
|
10
|
+
*
|
|
11
|
+
* The full roots/debug payload lives behind `--verbose` (human) or `--json`
|
|
12
|
+
* (automation); the default human output stays a concise per-daemon result.
|
|
13
|
+
*/
|
|
14
|
+
import type { DaemonAction, DaemonOperationResult, DaemonRecovery, DaemonStatus } from "./control-types";
|
|
15
|
+
/** Canonical daemon actions accepted as the leading verb. */
|
|
16
|
+
export declare const DAEMON_CANONICAL_ACTIONS: readonly DaemonAction[];
|
|
17
|
+
/**
|
|
18
|
+
* Operator-friendly aliases resolved to a canonical action. `restart` is the
|
|
19
|
+
* routine "reload if running, otherwise start" verb; it maps onto `reload`,
|
|
20
|
+
* whose default already spawns a fresh owner when none is running.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DAEMON_ACTION_ALIASES: Readonly<Record<string, DaemonAction>>;
|
|
23
|
+
/** Every token accepted in the leading action position (canonical + aliases). */
|
|
24
|
+
export declare const DAEMON_ACTION_TOKENS: readonly string[];
|
|
25
|
+
/** Resolve a leading verb (canonical or alias) to its canonical action. */
|
|
26
|
+
export declare function resolveDaemonAction(token: string | undefined): DaemonAction | undefined;
|
|
27
|
+
/** Exit codes for `skc daemon`. Backward compatible: success 0, any failure 1. */
|
|
28
|
+
export declare const DAEMON_EXIT: {
|
|
29
|
+
readonly ok: 0;
|
|
30
|
+
readonly failure: 1;
|
|
31
|
+
};
|
|
32
|
+
/** Human-facing headline when a spawn/reload is refused by a live foreign identity. */
|
|
33
|
+
export declare const OWNERSHIP_MISMATCH_MESSAGE = "refused: a live Telegram daemon with a different bot token or chat already owns this workspace";
|
|
34
|
+
/** Structured, actionable recovery for a token/chat ownership mismatch. */
|
|
35
|
+
export declare function ownershipMismatchRecovery(): DaemonRecovery;
|
|
36
|
+
/**
|
|
37
|
+
* Render one daemon status. Concise by default (single head line + any
|
|
38
|
+
* actionable warning); `--verbose` adds runtime detail and the full roots list.
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatDaemonStatus(status: DaemonStatus, opts?: {
|
|
41
|
+
verbose?: boolean;
|
|
42
|
+
}): string;
|
|
43
|
+
/**
|
|
44
|
+
* Render one operation result. Keeps the stable `<kind> <action>: ok|failed —
|
|
45
|
+
* <message>` head line, then any warnings, then actionable recovery steps.
|
|
46
|
+
*/
|
|
47
|
+
export declare function formatDaemonResult(result: DaemonOperationResult): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Model definitions for Grok CLI's API.
|
|
3
3
|
*/
|
|
4
|
+
import { Effort } from '@sayknow-cli/ai/model-thinking';
|
|
4
5
|
export interface GrokCliModelConfig {
|
|
5
6
|
id: string;
|
|
6
7
|
name: string;
|
|
@@ -14,9 +15,12 @@ export interface GrokCliModelConfig {
|
|
|
14
15
|
};
|
|
15
16
|
contextWindow: number;
|
|
16
17
|
maxTokens: number;
|
|
18
|
+
/** Highest reasoning effort supported by this model. */
|
|
19
|
+
maxReasoningEffort?: Effort;
|
|
17
20
|
/** Models that don't support reasoning.effort get a thinkingLevelMap. */
|
|
18
21
|
thinkingLevelMap?: Record<string, string | null>;
|
|
19
22
|
}
|
|
23
|
+
export declare function getMaxReasoningEffort(modelId: string): Effort | undefined;
|
|
20
24
|
export declare function supportsReasoningEffort(modelId: string): boolean;
|
|
21
25
|
/**
|
|
22
26
|
* Resolve the active model list. If `SKC_GROK_CLI_MODELS` is set,
|
|
@@ -12,27 +12,27 @@ export declare class XaiOAuthError extends Error {
|
|
|
12
12
|
/** Well-known error codes. */
|
|
13
13
|
export declare const XaiErrorCode: {
|
|
14
14
|
/** OIDC discovery failed (network, invalid response). */
|
|
15
|
-
readonly DISCOVERY_FAILED:
|
|
15
|
+
readonly DISCOVERY_FAILED: "discovery_failed";
|
|
16
16
|
/** Discovery endpoint returned a non-xAI origin. */
|
|
17
|
-
readonly DISCOVERY_INVALID_ORIGIN:
|
|
17
|
+
readonly DISCOVERY_INVALID_ORIGIN: "discovery_invalid_origin";
|
|
18
18
|
/** Authorization was denied or errored in the browser. */
|
|
19
|
-
readonly AUTHORIZATION_FAILED:
|
|
19
|
+
readonly AUTHORIZATION_FAILED: "authorization_failed";
|
|
20
20
|
/** CSRF state mismatch between request and callback. */
|
|
21
|
-
readonly STATE_MISMATCH:
|
|
21
|
+
readonly STATE_MISMATCH: "state_mismatch";
|
|
22
22
|
/** Callback did not include an authorization code. */
|
|
23
|
-
readonly CODE_MISSING:
|
|
23
|
+
readonly CODE_MISSING: "code_missing";
|
|
24
24
|
/** Token exchange failed (network, invalid response). */
|
|
25
|
-
readonly TOKEN_EXCHANGE_FAILED:
|
|
25
|
+
readonly TOKEN_EXCHANGE_FAILED: "token_exchange_failed";
|
|
26
26
|
/** Token exchange returned an invalid payload. */
|
|
27
|
-
readonly TOKEN_EXCHANGE_INVALID:
|
|
27
|
+
readonly TOKEN_EXCHANGE_INVALID: "token_exchange_invalid";
|
|
28
28
|
/** Refresh token is missing or empty. */
|
|
29
|
-
readonly REFRESH_MISSING:
|
|
29
|
+
readonly REFRESH_MISSING: "refresh_missing";
|
|
30
30
|
/** Token refresh failed (expired, revoked). */
|
|
31
|
-
readonly REFRESH_FAILED:
|
|
31
|
+
readonly REFRESH_FAILED: "refresh_failed";
|
|
32
32
|
/** No credentials stored. */
|
|
33
|
-
readonly AUTH_MISSING:
|
|
33
|
+
readonly AUTH_MISSING: "auth_missing";
|
|
34
34
|
/** Loopback callback server could not bind. */
|
|
35
|
-
readonly CALLBACK_BIND_FAILED:
|
|
35
|
+
readonly CALLBACK_BIND_FAILED: "callback_bind_failed";
|
|
36
36
|
/** Loopback callback timed out. */
|
|
37
|
-
readonly CALLBACK_TIMEOUT:
|
|
37
|
+
readonly CALLBACK_TIMEOUT: "callback_timeout";
|
|
38
38
|
};
|
|
@@ -63,8 +63,8 @@ export declare function computePatchDiff(input: PatchInput, cwd: string, options
|
|
|
63
63
|
}>;
|
|
64
64
|
export declare const patchEditEntrySchema: z.ZodObject<{
|
|
65
65
|
op: z.ZodOptional<z.ZodEnum<{
|
|
66
|
-
create: "create";
|
|
67
66
|
delete: "delete";
|
|
67
|
+
create: "create";
|
|
68
68
|
update: "update";
|
|
69
69
|
}>>;
|
|
70
70
|
rename: z.ZodOptional<z.ZodString>;
|
|
@@ -74,8 +74,8 @@ export declare const patchEditSchema: z.ZodObject<{
|
|
|
74
74
|
path: z.ZodString;
|
|
75
75
|
edits: z.ZodArray<z.ZodObject<{
|
|
76
76
|
op: z.ZodOptional<z.ZodEnum<{
|
|
77
|
-
create: "create";
|
|
78
77
|
delete: "delete";
|
|
78
|
+
create: "create";
|
|
79
79
|
update: "update";
|
|
80
80
|
}>>;
|
|
81
81
|
rename: z.ZodOptional<z.ZodString>;
|
|
@@ -176,11 +176,13 @@ export interface ExtensionUIContext {
|
|
|
176
176
|
setToolsExpanded(expanded: boolean): void;
|
|
177
177
|
}
|
|
178
178
|
export interface ContextUsage {
|
|
179
|
-
/**
|
|
179
|
+
/** Context tokens, or null if unknown (e.g. right after compaction, before next LLM response). */
|
|
180
180
|
tokens: number | null;
|
|
181
181
|
contextWindow: number;
|
|
182
182
|
/** Context usage as percentage of context window, or null if tokens is unknown. */
|
|
183
183
|
percent: number | null;
|
|
184
|
+
/** Provenance: "provider_anchor" = anchored on provider-reported usage (+ heuristic trailing delta); "heuristic" = no provider anchor available, full estimate; "unknown" = post-compaction, no post-compaction provider response yet. */
|
|
185
|
+
source: "provider_anchor" | "heuristic" | "unknown";
|
|
184
186
|
}
|
|
185
187
|
export interface CompactOptions {
|
|
186
188
|
onComplete?: (result: CompactionResult) => void;
|