@sayknow-cli/coding-agent 0.3.0 → 0.3.2
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/bin/skc.js +4 -0
- package/dist/types/cli/mcp-cli.d.ts +25 -0
- package/dist/types/cli/notify-cli.d.ts +2 -0
- package/dist/types/cli/plugin-cli.d.ts +2 -0
- package/dist/types/cli.d.ts +6 -0
- package/dist/types/commands/mcp.d.ts +70 -0
- package/dist/types/commands/plugin.d.ts +6 -0
- package/dist/types/commands/session.d.ts +6 -0
- package/dist/types/config/keybindings.d.ts +2 -2
- package/dist/types/config/model-profile-activation.d.ts +8 -1
- package/dist/types/config/settings-schema.d.ts +39 -2
- package/dist/types/deep-interview/plaintext-gate-guard.d.ts +11 -0
- package/dist/types/defaults/skc-defaults.d.ts +2 -13
- package/dist/types/extensibility/shared-events.d.ts +1 -0
- package/dist/types/extensibility/skc-plugins/compiler.d.ts +19 -0
- package/dist/types/extensibility/skc-plugins/constrained-hooks.d.ts +29 -0
- package/dist/types/extensibility/skc-plugins/index.d.ts +9 -0
- package/dist/types/extensibility/skc-plugins/injection.d.ts +9 -0
- package/dist/types/extensibility/skc-plugins/installer.d.ts +13 -0
- package/dist/types/extensibility/skc-plugins/mcp-policy.d.ts +26 -0
- package/dist/types/extensibility/skc-plugins/observability.d.ts +27 -0
- package/dist/types/extensibility/skc-plugins/prompt-appendix.d.ts +16 -0
- package/dist/types/extensibility/skc-plugins/registry.d.ts +32 -0
- package/dist/types/extensibility/skc-plugins/runtime-adapters.d.ts +64 -0
- package/dist/types/extensibility/skc-plugins/session-validation.d.ts +42 -0
- package/dist/types/extensibility/skc-plugins/types.d.ts +158 -2
- package/dist/types/extensibility/skc-plugins/validation.d.ts +8 -1
- package/dist/types/lsp/types.d.ts +2 -0
- package/dist/types/main.d.ts +2 -0
- package/dist/types/modes/components/custom-editor.d.ts +1 -1
- package/dist/types/modes/components/model-selector.d.ts +8 -0
- package/dist/types/modes/components/status-line/git-utils.d.ts +6 -0
- package/dist/types/modes/theme/defaults/index.d.ts +99 -0
- package/dist/types/notifications/attachment-registry.d.ts +17 -0
- package/dist/types/notifications/chat-adapters.d.ts +9 -0
- package/dist/types/notifications/config.d.ts +9 -1
- package/dist/types/notifications/engine.d.ts +59 -0
- package/dist/types/notifications/html-format.d.ts +11 -0
- package/dist/types/notifications/index.d.ts +149 -1
- package/dist/types/notifications/lifecycle-commands.d.ts +60 -0
- package/dist/types/notifications/lifecycle-control-runtime.d.ts +98 -0
- package/dist/types/notifications/lifecycle-orchestrator.d.ts +144 -0
- package/dist/types/notifications/managed-daemon.d.ts +48 -0
- package/dist/types/notifications/operator-runtime.d.ts +52 -0
- package/dist/types/notifications/rate-limit-pool.d.ts +2 -0
- package/dist/types/notifications/recent-activity.d.ts +35 -0
- package/dist/types/notifications/telegram-daemon.d.ts +133 -16
- package/dist/types/notifications/telegram-reference.d.ts +3 -1
- package/dist/types/notifications/threaded-inbound.d.ts +19 -0
- package/dist/types/notifications/threaded-render.d.ts +6 -1
- package/dist/types/notifications/topic-registry.d.ts +12 -9
- package/dist/types/runtime-mcp/types.d.ts +7 -0
- package/dist/types/sdk.d.ts +2 -0
- package/dist/types/session/agent-session.d.ts +16 -4
- package/dist/types/session/blob-store.d.ts +25 -0
- package/dist/types/session/session-manager.d.ts +57 -0
- package/dist/types/skc-runtime/launch-tmux.d.ts +1 -0
- package/dist/types/skc-runtime/psmux-detect.d.ts +78 -0
- package/dist/types/skc-runtime/ralplan-runtime.d.ts +1 -1
- package/dist/types/skc-runtime/team-runtime.d.ts +2 -0
- package/dist/types/skc-runtime/tmux-common.d.ts +30 -2
- package/dist/types/skc-runtime/tmux-sessions.d.ts +18 -0
- package/dist/types/slash-commands/helpers/fast-status-report.d.ts +6 -0
- package/dist/types/system-prompt.d.ts +2 -0
- package/dist/types/task/executor.d.ts +9 -1
- package/dist/types/tools/composer-bash-policy.d.ts +14 -0
- package/dist/types/tools/fetch.d.ts +23 -0
- package/dist/types/tools/index.d.ts +4 -1
- package/dist/types/tools/telegram-send.d.ts +32 -0
- package/dist/types/utils/changelog.d.ts +1 -0
- package/dist/types/web/insane/bridge.d.ts +103 -0
- package/dist/types/web/insane/url-guard.d.ts +25 -0
- package/dist/types/web/scrapers/types.d.ts +5 -0
- package/dist/types/web/scrapers/utils.d.ts +7 -1
- package/dist/types/web/search/provider.d.ts +18 -1
- package/dist/types/web/search/providers/insane.d.ts +53 -0
- package/dist/types/web/search/providers/text-citations.d.ts +23 -0
- package/dist/types/web/search/types.d.ts +12 -4
- package/package.json +14 -10
- package/scripts/g004-tmux-smoke.ts +100 -0
- package/scripts/g005-daemon-smoke.ts +180 -0
- package/scripts/g011-daemon-path-smoke.ts +153 -0
- package/scripts/verify-insane-vendor.ts +132 -0
- package/src/cli/args.ts +1 -1
- package/src/cli/fast-help.ts +30 -2
- package/src/cli/mcp-cli.ts +272 -0
- package/src/cli/notify-cli.ts +152 -5
- package/src/cli/plugin-cli.ts +66 -3
- package/src/cli.ts +30 -12
- package/src/commands/mcp.ts +117 -0
- package/src/commands/plugin.ts +4 -0
- package/src/commands/session.ts +18 -0
- package/src/commands/team.ts +1 -1
- package/src/config/keybindings.ts +2 -2
- package/src/config/model-profile-activation.ts +55 -7
- package/src/config/settings-schema.ts +30 -1
- package/src/deep-interview/plaintext-gate-guard.ts +94 -0
- package/src/defaults/skc/extensions/grok-cli-vendor/biome.json +1 -1
- package/src/defaults/skc/skills/deep-interview/SKILL.md +7 -6
- package/src/defaults/skc/skills/ralplan/SKILL.md +11 -4
- package/src/defaults/skc/skills/team/SKILL.md +5 -3
- package/src/defaults/skc/skills/ultragoal/SKILL.md +41 -13
- package/src/defaults/skc-defaults.ts +2 -27
- package/src/export/html/index.ts +2 -2
- package/src/extensibility/extensions/runner.ts +1 -0
- package/src/extensibility/shared-events.ts +1 -0
- package/src/extensibility/skc-plugins/compiler.ts +351 -0
- package/src/extensibility/skc-plugins/constrained-hooks.ts +170 -0
- package/src/extensibility/skc-plugins/index.ts +9 -0
- package/src/extensibility/skc-plugins/injection.ts +109 -0
- package/src/extensibility/skc-plugins/installer.ts +434 -0
- package/src/extensibility/skc-plugins/loader.ts +3 -1
- package/src/extensibility/skc-plugins/mcp-policy.ts +239 -0
- package/src/extensibility/skc-plugins/observability.ts +84 -0
- package/src/extensibility/skc-plugins/paths.ts +1 -1
- package/src/extensibility/skc-plugins/prompt-appendix.ts +109 -0
- package/src/extensibility/skc-plugins/registry.ts +180 -0
- package/src/extensibility/skc-plugins/runtime-adapters.ts +234 -0
- package/src/extensibility/skc-plugins/schema.ts +250 -20
- package/src/extensibility/skc-plugins/session-validation.ts +147 -0
- package/src/extensibility/skc-plugins/types.ts +199 -3
- package/src/extensibility/skc-plugins/validation.ts +80 -0
- package/src/extensibility/skills.ts +15 -0
- package/src/hooks/skill-state.ts +57 -0
- package/src/internal-urls/docs-index.generated.ts +17 -13
- package/src/lsp/config.ts +16 -3
- package/src/lsp/defaults.json +7 -0
- package/src/lsp/types.ts +2 -0
- package/src/main.ts +14 -3
- package/src/modes/bridge/bridge-mode.ts +11 -0
- package/src/modes/components/assistant-message.ts +49 -1
- package/src/modes/components/custom-editor.ts +2 -0
- package/src/modes/components/footer.ts +2 -3
- package/src/modes/components/hook-editor.ts +1 -1
- package/src/modes/components/hook-selector.ts +67 -43
- package/src/modes/components/model-selector.ts +56 -11
- package/src/modes/components/status-line/git-utils.ts +25 -0
- package/src/modes/components/status-line.ts +10 -11
- package/src/modes/components/welcome.ts +2 -3
- package/src/modes/controllers/event-controller.ts +15 -0
- package/src/modes/controllers/extension-ui-controller.ts +0 -27
- package/src/modes/controllers/selector-controller.ts +53 -11
- package/src/modes/interactive-mode.ts +50 -3
- package/src/modes/shared/agent-wire/scopes.ts +1 -1
- package/src/modes/theme/defaults/gruvbox-dark.json +99 -0
- package/src/modes/theme/defaults/index.ts +2 -0
- package/src/modes/utils/context-usage.ts +2 -2
- package/src/modes/utils/hotkeys-markdown.ts +1 -1
- package/src/notifications/attachment-registry.ts +23 -0
- package/src/notifications/chat-adapters.ts +147 -0
- package/src/notifications/config.ts +23 -2
- package/src/notifications/engine.ts +100 -0
- package/src/notifications/html-format.ts +38 -0
- package/src/notifications/index.ts +417 -45
- package/src/notifications/lifecycle-commands.ts +238 -0
- package/src/notifications/lifecycle-control-runtime.ts +405 -0
- package/src/notifications/lifecycle-orchestrator.ts +358 -0
- package/src/notifications/managed-daemon.ts +163 -0
- package/src/notifications/operator-runtime.ts +171 -0
- package/src/notifications/rate-limit-pool.ts +19 -0
- package/src/notifications/recent-activity.ts +132 -0
- package/src/notifications/telegram-daemon.ts +984 -242
- package/src/notifications/telegram-reference.ts +25 -7
- package/src/notifications/threaded-inbound.ts +60 -4
- package/src/notifications/threaded-render.ts +20 -2
- package/src/notifications/topic-registry.ts +23 -9
- package/src/prompts/agents/executor.md +2 -2
- package/src/runtime-mcp/transports/stdio.ts +38 -4
- package/src/runtime-mcp/types.ts +7 -0
- package/src/sdk.ts +157 -10
- package/src/session/agent-session.ts +248 -125
- package/src/session/blob-store.ts +196 -8
- package/src/session/session-manager.ts +762 -12
- package/src/skc-runtime/launch-tmux.ts +85 -22
- package/src/skc-runtime/ledger-event-renderer.ts +1 -0
- package/src/skc-runtime/psmux-detect.ts +239 -0
- package/src/skc-runtime/ralplan-runtime.ts +2 -2
- package/src/skc-runtime/team-runtime.ts +56 -23
- package/src/skc-runtime/tmux-common.ts +88 -4
- package/src/skc-runtime/tmux-sessions.ts +111 -9
- package/src/skc-runtime/ultragoal-guard.ts +25 -8
- package/src/skc-runtime/ultragoal-runtime.ts +75 -15
- package/src/skc-runtime/workflow-manifest.generated.json +29 -0
- package/src/skc-runtime/workflow-manifest.ts +7 -2
- package/src/slash-commands/builtin-registry.ts +23 -3
- package/src/slash-commands/helpers/fast-status-report.ts +13 -3
- package/src/slash-commands/helpers/parse.ts +2 -1
- package/src/system-prompt.ts +9 -0
- package/src/task/executor.ts +31 -7
- package/src/task/index.ts +2 -0
- package/src/tools/ask.ts +5 -1
- package/src/tools/bash.ts +9 -0
- package/src/tools/composer-bash-policy.ts +96 -0
- package/src/tools/fetch.ts +94 -1
- package/src/tools/index.ts +6 -1
- package/src/tools/telegram-send.ts +137 -0
- package/src/utils/changelog.ts +8 -0
- package/src/web/insane/bridge.ts +350 -0
- package/src/web/insane/url-guard.ts +159 -0
- package/src/web/scrapers/types.ts +143 -45
- package/src/web/scrapers/utils.ts +70 -19
- package/src/web/search/provider.ts +77 -18
- package/src/web/search/providers/anthropic.ts +70 -3
- package/src/web/search/providers/codex.ts +1 -119
- package/src/web/search/providers/gemini.ts +99 -0
- package/src/web/search/providers/insane.ts +551 -0
- package/src/web/search/providers/openai-compatible.ts +66 -32
- package/src/web/search/providers/text-citations.ts +111 -0
- package/src/web/search/types.ts +13 -2
- package/vendor/insane-search/LICENSE +21 -0
- package/vendor/insane-search/MANIFEST.json +24 -0
- package/vendor/insane-search/engine/__init__.py +23 -0
- package/vendor/insane-search/engine/__main__.py +128 -0
- package/vendor/insane-search/engine/bias_check.py +183 -0
- package/vendor/insane-search/engine/executor.py +254 -0
- package/vendor/insane-search/engine/fetch_chain.py +725 -0
- package/vendor/insane-search/engine/learning.py +175 -0
- package/vendor/insane-search/engine/phase0.py +214 -0
- package/vendor/insane-search/engine/safety.py +91 -0
- package/vendor/insane-search/engine/templates/package.json +11 -0
- package/vendor/insane-search/engine/templates/playwright_mobile_chrome.js +188 -0
- package/vendor/insane-search/engine/templates/playwright_real_chrome.js +243 -0
- package/vendor/insane-search/engine/tests/test_hardening.py +57 -0
- package/vendor/insane-search/engine/tests/test_smoke.py +152 -0
- package/vendor/insane-search/engine/tests/test_u1.py +200 -0
- package/vendor/insane-search/engine/tests/test_u4.py +131 -0
- package/vendor/insane-search/engine/tests/test_u5.py +163 -0
- package/vendor/insane-search/engine/tests/test_u7.py +124 -0
- package/vendor/insane-search/engine/transport.py +211 -0
- package/vendor/insane-search/engine/url_transforms.py +98 -0
- package/vendor/insane-search/engine/validators.py +331 -0
- package/vendor/insane-search/engine/waf_detector.py +214 -0
- package/vendor/insane-search/engine/waf_profiles.yaml +162 -0
|
@@ -90,10 +90,12 @@ export interface RouteInboundContext {
|
|
|
90
90
|
}
|
|
91
91
|
/** Route a Telegram update to a session/action without I/O. Fail closed under ambiguity. */
|
|
92
92
|
export declare function routeInboundUpdate(update: unknown, ctx: RouteInboundContext): RouteDecision;
|
|
93
|
-
/** Read `{url, token}` from an endpoint discovery file. */
|
|
93
|
+
/** Read `{url, token, pid?, stale?}` from an endpoint discovery file. */
|
|
94
94
|
export declare function readEndpoint(path: string): {
|
|
95
95
|
url: string;
|
|
96
96
|
token: string;
|
|
97
|
+
pid?: number;
|
|
98
|
+
stale?: boolean;
|
|
97
99
|
};
|
|
98
100
|
/** Options for {@link runTelegramReferenceClient}. */
|
|
99
101
|
export interface TelegramReferenceOptions {
|
|
@@ -20,12 +20,30 @@ export interface InboundUpdate {
|
|
|
20
20
|
message?: {
|
|
21
21
|
message_id?: unknown;
|
|
22
22
|
text?: unknown;
|
|
23
|
+
caption?: unknown;
|
|
24
|
+
photo?: unknown;
|
|
25
|
+
document?: unknown;
|
|
26
|
+
video?: unknown;
|
|
27
|
+
audio?: unknown;
|
|
28
|
+
voice?: unknown;
|
|
29
|
+
animation?: unknown;
|
|
23
30
|
chat?: {
|
|
24
31
|
id?: unknown;
|
|
25
32
|
};
|
|
26
33
|
message_thread_id?: unknown;
|
|
27
34
|
};
|
|
28
35
|
}
|
|
36
|
+
/** A downloadable media attachment referenced by an inbound message. */
|
|
37
|
+
export interface InboundAttachment {
|
|
38
|
+
/** Telegram file_id to resolve via getFile. */
|
|
39
|
+
fileId: string;
|
|
40
|
+
/** Source media kind; "photo" is always an image. */
|
|
41
|
+
kind: "photo" | "document" | "video" | "audio" | "voice" | "animation";
|
|
42
|
+
/** MIME type when Telegram provides one. */
|
|
43
|
+
mime?: string;
|
|
44
|
+
/** Original file name when provided. */
|
|
45
|
+
fileName?: string;
|
|
46
|
+
}
|
|
29
47
|
/** Context for {@link decideThreadedInbound}. All lookups are injected. */
|
|
30
48
|
export interface ThreadedInboundCtx {
|
|
31
49
|
/** The single paired chat id (string-compared). */
|
|
@@ -43,6 +61,7 @@ export type ThreadedInboundDecision = {
|
|
|
43
61
|
updateId: number;
|
|
44
62
|
threadId: string;
|
|
45
63
|
messageId?: number;
|
|
64
|
+
attachment?: InboundAttachment;
|
|
46
65
|
} | {
|
|
47
66
|
kind: "duplicate";
|
|
48
67
|
updateId: number;
|
|
@@ -11,15 +11,19 @@
|
|
|
11
11
|
import type { RateLimitLane } from "./rate-limit-pool";
|
|
12
12
|
/** A Telegram send derived from a threaded frame (topic id is applied by the daemon). */
|
|
13
13
|
export interface ThreadedSend {
|
|
14
|
-
method: "sendMessage" | "sendPhoto";
|
|
14
|
+
method: "sendMessage" | "sendPhoto" | "sendDocument";
|
|
15
15
|
/** Rate-limit lane for prioritisation/fairness. */
|
|
16
16
|
lane: RateLimitLane;
|
|
17
17
|
/** Message text (sendMessage) or photo caption (sendPhoto). */
|
|
18
18
|
text?: string;
|
|
19
19
|
/** Base64 image bytes for sendPhoto. */
|
|
20
20
|
photoBase64?: string;
|
|
21
|
+
/** Base64 file bytes for sendDocument. */
|
|
22
|
+
documentBase64?: string;
|
|
21
23
|
/** Image MIME type for sendPhoto. */
|
|
22
24
|
mime?: string;
|
|
25
|
+
/** Suggested document filename. */
|
|
26
|
+
fileName?: string;
|
|
23
27
|
/** Coalesce key for live edits (same key collapses to the latest). */
|
|
24
28
|
coalesceKey?: string;
|
|
25
29
|
/** True for the one-time identity header (the daemon pins it once). */
|
|
@@ -45,6 +49,7 @@ interface ThreadedFrame {
|
|
|
45
49
|
data?: unknown;
|
|
46
50
|
mime?: unknown;
|
|
47
51
|
caption?: unknown;
|
|
52
|
+
name?: unknown;
|
|
48
53
|
verbosity?: unknown;
|
|
49
54
|
redact?: unknown;
|
|
50
55
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Per-session forum-topic registry for the threaded session surface.
|
|
3
3
|
*
|
|
4
|
-
* Each SKC session owns
|
|
5
|
-
* DM. The topic is created
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Each SKC session owns one active Telegram forum topic in the paired private
|
|
5
|
+
* DM. The topic is created via `createForumTopic`, reused while the session
|
|
6
|
+
* remains active, and removed from the registry when the daemon deletes it on
|
|
7
|
+
* shutdown. The registry also tracks whether the one-time identity header has
|
|
8
|
+
* already been pinned, so it is sent exactly once per active topic, even across
|
|
9
9
|
* reconnects.
|
|
10
10
|
*
|
|
11
11
|
* State is a plain serialisable map persisted beside the daemon state files;
|
|
@@ -45,14 +45,15 @@ export declare class TopicRegistry {
|
|
|
45
45
|
load(state: TopicRegistryState): void;
|
|
46
46
|
/** Resolve the owning session for a topic id (for fail-closed inbound routing). */
|
|
47
47
|
sessionForTopic(topicId: string): string | undefined;
|
|
48
|
+
/** All session ids with a persisted topic record. */
|
|
49
|
+
sessionIds(): string[];
|
|
48
50
|
/** The existing topic record for a session, if any. */
|
|
49
51
|
get(sessionId: string): TopicRecord | undefined;
|
|
50
52
|
/**
|
|
51
|
-
* Return the existing topic for `sessionId`, or create one via
|
|
52
|
-
* (called only on first use).
|
|
53
|
-
* returned without invoking `create`.
|
|
53
|
+
* Return the existing active topic for `sessionId`, or create one via
|
|
54
|
+
* `create` (called only on first use).
|
|
54
55
|
*/
|
|
55
|
-
getOrCreateTopic(sessionId: string, create: () => Promise<string>, now?: () => number): Promise<TopicRecord>;
|
|
56
|
+
getOrCreateTopic(sessionId: string, create: () => Promise<string>, now?: () => number, name?: string): Promise<TopicRecord>;
|
|
56
57
|
/** Mark the identity header as sent for a session. Idempotent. */
|
|
57
58
|
markIdentitySent(sessionId: string): void;
|
|
58
59
|
/** Whether the identity header still needs sending for this session. */
|
|
@@ -62,6 +63,8 @@ export declare class TopicRegistry {
|
|
|
62
63
|
* caller should `editForumTopic`), `false` when already current or unknown.
|
|
63
64
|
*/
|
|
64
65
|
applyName(sessionId: string, name: string): boolean;
|
|
66
|
+
/** Remove a session topic record after Telegram deletes the topic. */
|
|
67
|
+
delete(sessionId: string): boolean;
|
|
65
68
|
/** Serialise for atomic persistence beside the daemon state. */
|
|
66
69
|
serialize(): TopicRegistryState;
|
|
67
70
|
}
|
|
@@ -64,6 +64,13 @@ export interface MCPStdioServerConfig extends MCPServerConfigBase {
|
|
|
64
64
|
command: string;
|
|
65
65
|
args?: string[];
|
|
66
66
|
env?: Record<string, string>;
|
|
67
|
+
/**
|
|
68
|
+
* When true, the child process is NOT given the host environment. Only a
|
|
69
|
+
* minimal OS allowlist (PATH/HOME/temp/locale) plus any explicit `env` keys
|
|
70
|
+
* are passed. Used for third-party plugin-bundle MCP servers so they cannot
|
|
71
|
+
* read host secrets from the inherited environment.
|
|
72
|
+
*/
|
|
73
|
+
noInheritEnv?: boolean;
|
|
67
74
|
cwd?: string;
|
|
68
75
|
}
|
|
69
76
|
/** HTTP server configuration (Streamable HTTP transport) */
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import "./discovery";
|
|
|
10
10
|
import type { CustomCommandsLoadResult } from "./extensibility/custom-commands";
|
|
11
11
|
import type { CustomTool } from "./extensibility/custom-tools/types";
|
|
12
12
|
import { type ExtensionFactory, type ExtensionUIContext, type LoadExtensionsResult, type ToolDefinition } from "./extensibility/extensions";
|
|
13
|
+
import { type ConstrainedPluginHook } from "./extensibility/skc-plugins/constrained-hooks";
|
|
13
14
|
import { type Skill, type SkillWarning } from "./extensibility/skills";
|
|
14
15
|
import type { FileSlashCommand } from "./extensibility/slash-commands";
|
|
15
16
|
import type { HindsightSessionState } from "./hindsight/state";
|
|
@@ -240,4 +241,5 @@ export interface BuildSystemPromptOptions {
|
|
|
240
241
|
* as separate entries so providers can cache prompt prefixes without concatenating blocks.
|
|
241
242
|
*/
|
|
242
243
|
export declare function buildSystemPrompt(options?: BuildSystemPromptOptions): Promise<BuildSystemPromptResult>;
|
|
244
|
+
export declare function createPluginHooksExtension(hooks: ConstrainedPluginHook[]): ExtensionFactory;
|
|
243
245
|
export declare function createAgentSession(options?: CreateAgentSessionOptions): Promise<CreateAgentSessionResult>;
|
|
@@ -69,6 +69,7 @@ import type { WorkflowGateEmitter } from "../modes/shared/agent-wire/unattended-
|
|
|
69
69
|
import type { PlanModeState } from "../plan-mode/state";
|
|
70
70
|
import { type AgentRegistry } from "../registry/agent-registry";
|
|
71
71
|
import { type DiscoverableMCPSearchIndex, type DiscoverableMCPTool } from "../runtime-mcp/discoverable-tool-metadata";
|
|
72
|
+
import { MCPManager } from "../runtime-mcp/manager";
|
|
72
73
|
import { type SecretObfuscator } from "../secrets/obfuscator";
|
|
73
74
|
import { type DiscoverableTool, type DiscoverableToolSearchIndex } from "../tool-discovery/tool-index";
|
|
74
75
|
import type { AskAnswerSource, ToolSession } from "../tools";
|
|
@@ -77,10 +78,11 @@ import { type TodoItem, type TodoPhase } from "../tools/todo-write";
|
|
|
77
78
|
import type { ClientBridge } from "./client-bridge";
|
|
78
79
|
import { type ContributionPrepOptions, type ContributionPrepResult } from "./contribution-prep";
|
|
79
80
|
import { type CustomMessage } from "./messages";
|
|
80
|
-
import type { BranchSummaryEntry, NewSessionOptions, SessionContext, SessionManager } from "./session-manager";
|
|
81
|
+
import type { BranchSummaryEntry, CompactionEntry, NewSessionOptions, SessionContext, SessionManager } from "./session-manager";
|
|
81
82
|
import { ToolChoiceQueue } from "./tool-choice-queue";
|
|
82
83
|
import { YieldQueue } from "./yield-queue";
|
|
83
84
|
/** Session-specific events that extend the core AgentEvent */
|
|
85
|
+
export type AutoCompactionContinuationSkipReason = "auto_continue_disabled_non_resumable_tail";
|
|
84
86
|
export type AgentSessionEvent = AgentEvent | {
|
|
85
87
|
type: "auto_compaction_start";
|
|
86
88
|
reason: "threshold" | "overflow" | "idle";
|
|
@@ -94,6 +96,7 @@ export type AgentSessionEvent = AgentEvent | {
|
|
|
94
96
|
errorMessage?: string;
|
|
95
97
|
/** True when compaction was skipped for a benign reason (no model, no candidates, nothing to compact). */
|
|
96
98
|
skipped?: boolean;
|
|
99
|
+
continuationSkipReason?: AutoCompactionContinuationSkipReason;
|
|
97
100
|
} | {
|
|
98
101
|
type: "auto_retry_start";
|
|
99
102
|
attempt: number;
|
|
@@ -231,6 +234,13 @@ export interface AgentSessionConfig {
|
|
|
231
234
|
* **MUST NOT** dispose it on their own teardown.
|
|
232
235
|
*/
|
|
233
236
|
ownedAsyncJobManager?: AsyncJobManager;
|
|
237
|
+
/**
|
|
238
|
+
* MCPManager whose lifecycle this session owns (top-level sessions that
|
|
239
|
+
* connected plugin-bundle MCP servers). Only the owned manager is
|
|
240
|
+
* disconnected on dispose; subagents and callers that merely observe the
|
|
241
|
+
* process-global manager **MUST NOT** dispose it on their own teardown.
|
|
242
|
+
*/
|
|
243
|
+
ownedMcpManager?: MCPManager;
|
|
234
244
|
/** Optional fork-context seed used to initialize a child session before its first prompt. */
|
|
235
245
|
forkContextSeed?: ForkContextSeed;
|
|
236
246
|
/** Optional provider state override. Fork-context children should omit this by default. */
|
|
@@ -674,6 +684,7 @@ export declare class AgentSession {
|
|
|
674
684
|
get skillWarnings(): readonly SkillWarning[];
|
|
675
685
|
getTodoPhases(): TodoPhase[];
|
|
676
686
|
setTodoPhases(phases: TodoPhase[]): void;
|
|
687
|
+
applyCompactionPostAppendForTests(compactionEntryId: string, firstKeptEntryId: string, fromExtension?: boolean): Promise<CompactionEntry | undefined>;
|
|
677
688
|
/**
|
|
678
689
|
* Abort current operation and wait for agent to become idle.
|
|
679
690
|
*/
|
|
@@ -805,9 +816,10 @@ export declare class AgentSession {
|
|
|
805
816
|
isFastForSubagentProvider(provider?: string): boolean;
|
|
806
817
|
/**
|
|
807
818
|
* True when the configured `serviceTier` resolves to `"priority"` for the
|
|
808
|
-
* *currently selected model's provider
|
|
809
|
-
* that
|
|
810
|
-
*
|
|
819
|
+
* *currently selected model's provider* AND fast mode was not auto-disabled
|
|
820
|
+
* for that provider this session. This is the current-model EFFECTIVE
|
|
821
|
+
* predicate (what the next request actually does); use {@link isFastForProvider}
|
|
822
|
+
* for pure configured intent (e.g. subagent/`modelRoles` display rows).
|
|
811
823
|
*/
|
|
812
824
|
isFastModeActive(): boolean;
|
|
813
825
|
setServiceTier(serviceTier: ServiceTier | undefined): void;
|
|
@@ -3,6 +3,14 @@ export interface BlobPutResult {
|
|
|
3
3
|
path: string;
|
|
4
4
|
get ref(): string;
|
|
5
5
|
}
|
|
6
|
+
export interface CheckedBlobPutResult extends BlobPutResult {
|
|
7
|
+
bytes: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class BlobCorruptError extends Error {
|
|
10
|
+
readonly hash: string;
|
|
11
|
+
readonly path: string;
|
|
12
|
+
constructor(hash: string, path: string);
|
|
13
|
+
}
|
|
6
14
|
/**
|
|
7
15
|
* Content-addressed blob store for externalizing large binary data (images) from session JSONL files.
|
|
8
16
|
*
|
|
@@ -24,10 +32,22 @@ export declare class BlobStore {
|
|
|
24
32
|
* Returns once the bytes are in the kernel page cache.
|
|
25
33
|
*/
|
|
26
34
|
putSync(data: Buffer): BlobPutResult;
|
|
35
|
+
/**
|
|
36
|
+
* Durably install binary data as an immutable content-addressed blob.
|
|
37
|
+
*
|
|
38
|
+
* Callers that persist references to this blob must mutate canonical session entries only
|
|
39
|
+
* after this method returns successfully. A corrupt pre-existing target is reported with
|
|
40
|
+
* {@link BlobCorruptError}; it is never silently overwritten or trusted.
|
|
41
|
+
*/
|
|
42
|
+
putImmutableSync(data: Buffer): CheckedBlobPutResult;
|
|
27
43
|
/** Read blob by hash, returns Buffer or null if not found. */
|
|
28
44
|
get(hash: string): Promise<Buffer | null>;
|
|
29
45
|
/** Synchronously read blob by hash, returns Buffer or null if not found. */
|
|
30
46
|
getSync(hash: string): Buffer | null;
|
|
47
|
+
/** Read blob by hash and verify its content hash; returns null if not found. */
|
|
48
|
+
getChecked(hash: string): Promise<Buffer | null>;
|
|
49
|
+
/** Synchronously read blob by hash and verify its content hash; returns null if not found. */
|
|
50
|
+
getCheckedSync(hash: string): Buffer | null;
|
|
31
51
|
/** Check if a blob exists. */
|
|
32
52
|
has(hash: string): Promise<boolean>;
|
|
33
53
|
}
|
|
@@ -35,7 +55,9 @@ export declare class EphemeralBlobStore extends BlobStore {
|
|
|
35
55
|
#private;
|
|
36
56
|
constructor(dir: string);
|
|
37
57
|
putSync(data: Buffer): BlobPutResult;
|
|
58
|
+
putImmutableSync(data: Buffer): CheckedBlobPutResult;
|
|
38
59
|
getSync(hash: string): Buffer | null;
|
|
60
|
+
getCheckedSync(hash: string): Buffer | null;
|
|
39
61
|
clear(): void;
|
|
40
62
|
dispose(): void;
|
|
41
63
|
}
|
|
@@ -44,8 +66,11 @@ export declare class MemoryBlobStore extends BlobStore {
|
|
|
44
66
|
constructor();
|
|
45
67
|
put(data: Buffer): Promise<BlobPutResult>;
|
|
46
68
|
putSync(data: Buffer): BlobPutResult;
|
|
69
|
+
putImmutableSync(data: Buffer): CheckedBlobPutResult;
|
|
47
70
|
get(hash: string): Promise<Buffer | null>;
|
|
48
71
|
getSync(hash: string): Buffer | null;
|
|
72
|
+
getChecked(hash: string): Promise<Buffer | null>;
|
|
73
|
+
getCheckedSync(hash: string): Buffer | null;
|
|
49
74
|
has(hash: string): Promise<boolean>;
|
|
50
75
|
}
|
|
51
76
|
export declare class ResidentBlobMissingError extends Error {
|
|
@@ -26,9 +26,51 @@ export interface SessionEntryBase {
|
|
|
26
26
|
parentId: string | null;
|
|
27
27
|
timestamp: string;
|
|
28
28
|
}
|
|
29
|
+
export interface ColdSpillRef {
|
|
30
|
+
kind: "cold_spill";
|
|
31
|
+
ref: string;
|
|
32
|
+
encoding: "utf8" | "json";
|
|
33
|
+
originalChars: number;
|
|
34
|
+
sha256: string;
|
|
35
|
+
bytes: number;
|
|
36
|
+
}
|
|
37
|
+
export interface EvictedContentMarker {
|
|
38
|
+
evictedAt: number;
|
|
39
|
+
reason: "compacted_history";
|
|
40
|
+
compactionEntryId: string;
|
|
41
|
+
firstKeptEntryId: string;
|
|
42
|
+
payloads: Record<string, ColdSpillRef>;
|
|
43
|
+
}
|
|
44
|
+
export interface EvictCompactedContentResult {
|
|
45
|
+
evictedEntries: number;
|
|
46
|
+
hotCharsRemoved: number;
|
|
47
|
+
coldBlobBytes: number;
|
|
48
|
+
payloadRefs: number;
|
|
49
|
+
alreadyEvictedEntries: number;
|
|
50
|
+
coldSpillWriteCount: number;
|
|
51
|
+
coldSpillReadCount: number;
|
|
52
|
+
residentTextReadCount: number;
|
|
53
|
+
residentImageReadCount: number;
|
|
54
|
+
}
|
|
55
|
+
export interface SessionManagerObservabilityStats {
|
|
56
|
+
coldSpillWriteCount: number;
|
|
57
|
+
coldSpillReadCount: number;
|
|
58
|
+
residentTextReadCount: number;
|
|
59
|
+
residentImageReadCount: number;
|
|
60
|
+
publicMaterializerCallCount: number;
|
|
61
|
+
getEntryMaterializerCallCount: number;
|
|
62
|
+
getBranchMaterializerCallCount: number;
|
|
63
|
+
getEntriesMaterializerCallCount: number;
|
|
64
|
+
materializedEntriesCachePopulateCount: number;
|
|
65
|
+
pathOnlyContextBuildCount: number;
|
|
66
|
+
}
|
|
29
67
|
export interface SessionMessageEntry extends SessionEntryBase {
|
|
30
68
|
type: "message";
|
|
31
69
|
message: AgentMessage;
|
|
70
|
+
/** Cold-spill marker: when present, heavy message content was moved to durable
|
|
71
|
+
* content-addressed blobs after compaction. The marker is entry-level session
|
|
72
|
+
* metadata (not a message field) so strict message types stay intact. */
|
|
73
|
+
evictedContent?: EvictedContentMarker;
|
|
32
74
|
}
|
|
33
75
|
export interface ThinkingLevelChangeEntry extends SessionEntryBase {
|
|
34
76
|
type: "thinking_level_change";
|
|
@@ -148,6 +190,8 @@ export interface CustomMessageEntry<T = unknown> extends SessionEntryBase {
|
|
|
148
190
|
display: boolean;
|
|
149
191
|
/** Who initiated this message for billing/attribution semantics. */
|
|
150
192
|
attribution?: MessageAttribution;
|
|
193
|
+
/** Cold-spill marker for custom-message content evicted after compaction. */
|
|
194
|
+
evictedContent?: EvictedContentMarker;
|
|
151
195
|
}
|
|
152
196
|
/** Session entry - has id/parentId for tree structure (returned by "read" methods in SessionManager) */
|
|
153
197
|
export type SessionEntry = SessionMessageEntry | ThinkingLevelChangeEntry | ModelChangeEntry | ServiceTierChangeEntry | CompactionEntry | BranchSummaryEntry | CustomEntry | CustomMessageEntry | LabelEntry | TtsrInjectionEntry | MCPToolSelectionEntry | SessionInitEntry | ModeChangeEntry;
|
|
@@ -480,6 +524,19 @@ export declare class SessionManager {
|
|
|
480
524
|
* Returns undefined if no model change has been recorded.
|
|
481
525
|
*/
|
|
482
526
|
getLastModelChangeRole(): string | undefined;
|
|
527
|
+
evictCompactedContent(firstKeptEntryId: string, compactionEntryId: string): EvictCompactedContentResult;
|
|
528
|
+
getObservabilityStatsForTests(): SessionManagerObservabilityStats;
|
|
529
|
+
hotRetainedMessageCharsForTests(): number;
|
|
530
|
+
getCanonicalEntryForTests(id: string): SessionEntry | undefined;
|
|
531
|
+
getEntryForFidelity(id: string): SessionEntry | undefined;
|
|
532
|
+
getBranchForFidelity(fromId?: string): SessionEntry[];
|
|
533
|
+
/**
|
|
534
|
+
* Walk the active branch without materializing resident blobs or rehydrating
|
|
535
|
+
* cold-spill payloads. Intended for metadata-only scans such as todo-phase
|
|
536
|
+
* sync; callers must not mutate returned entries.
|
|
537
|
+
*/
|
|
538
|
+
getActivePathEntriesCanonical(fromId?: string): SessionEntry[];
|
|
539
|
+
getEntriesForExport(): SessionEntry[];
|
|
483
540
|
getEntry(id: string): SessionEntry | undefined;
|
|
484
541
|
/**
|
|
485
542
|
* Get all direct children of an entry.
|
|
@@ -4,6 +4,7 @@ export { buildSkcTmuxProfileCommands, SKC_DEFAULT_TMUX_SESSION, SKC_TMUX_COMMAND
|
|
|
4
4
|
export declare const SKC_TMUX_LAUNCHED_ENV = "SKC_TMUX_LAUNCHED";
|
|
5
5
|
export declare const SKC_LAUNCH_POLICY_ENV = "SKC_LAUNCH_POLICY";
|
|
6
6
|
export declare const SKC_TMUX_WINDOW_LABEL_MAX_WIDTH = 48;
|
|
7
|
+
export declare const SKC_PSMUX_PROFILE_FORCE_ENV = "SKC_PSMUX_PROFILE_FORCE";
|
|
7
8
|
interface TtyState {
|
|
8
9
|
stdin: boolean;
|
|
9
10
|
stdout: boolean;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windows psmux detection and tmux-binary resolution.
|
|
3
|
+
*
|
|
4
|
+
* Recent psmux releases (see docs/compatibility.md in the psmux repo) close
|
|
5
|
+
* the round-trip gap for set-option / show-options user options and the
|
|
6
|
+
* set-window-option profile values skc emits, which is what unblocks the
|
|
7
|
+
* native Windows skc --tmux path. This module detects that capability so skc
|
|
8
|
+
* can pick psmux when tmux is missing on Windows, and so callers can decide
|
|
9
|
+
* whether to treat a given tmux binary as psmux (affecting e.g. the untagged
|
|
10
|
+
* diagnostic wording and namespace handling).
|
|
11
|
+
*
|
|
12
|
+
* The probe is intentionally lightweight: it runs a single tmux -V (or
|
|
13
|
+
* --version) once per process and caches the verdict. Cache invalidation
|
|
14
|
+
* knobs:
|
|
15
|
+
* - force: true re-probes on every call (used by tests).
|
|
16
|
+
* - SKC_PSMUX_FORCE_DETECT=1 re-probes each call.
|
|
17
|
+
* - SKC_PSMUX_DETECTION=off skips probing entirely.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SKC_PSMUX_COMMAND_ENV = "SKC_PSMUX_COMMAND";
|
|
20
|
+
export declare const SKC_PSMUX_DETECTION_ENV = "SKC_PSMUX_DETECTION";
|
|
21
|
+
export declare const SKC_PSMUX_FORCE_DETECT_ENV = "SKC_PSMUX_FORCE_DETECT";
|
|
22
|
+
/** Names that psmux installs as the canonical executable / alias. */
|
|
23
|
+
export declare const PSMUX_BINARY_NAMES: readonly ["psmux", "pmux", "tmux"];
|
|
24
|
+
export type PsmuxSpawnRunner = (command: string, args: string[]) => {
|
|
25
|
+
exitCode: number | null;
|
|
26
|
+
stdout?: string;
|
|
27
|
+
stderr?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Resolves a tmux-class binary name (e.g. "psmux", "tmux") to an absolute
|
|
31
|
+
* filesystem path or returns null when the binary cannot be located. The
|
|
32
|
+
* default implementation uses `Bun.which`; production callers leave it
|
|
33
|
+
* alone and unit tests inject a stub via `__setBinaryResolverForTests`
|
|
34
|
+
* so the version-banner probe can be exercised hermetically.
|
|
35
|
+
*/
|
|
36
|
+
export type BinaryResolver = (candidate: string) => string | null;
|
|
37
|
+
/** @internal Test-only seam; production code never calls this. */
|
|
38
|
+
export declare function __setBinaryResolverForTests(resolver: BinaryResolver | null): void;
|
|
39
|
+
export declare function envDisabled(value: string | undefined): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Decide whether command resolves to a psmux binary by probing its version
|
|
42
|
+
* output. The result is cached per process unless force is set or
|
|
43
|
+
* SKC_PSMUX_FORCE_DETECT=1.
|
|
44
|
+
*/
|
|
45
|
+
export declare function detectPsmux(command: string, options?: {
|
|
46
|
+
force?: boolean;
|
|
47
|
+
env?: NodeJS.ProcessEnv;
|
|
48
|
+
runner?: PsmuxSpawnRunner;
|
|
49
|
+
}): boolean;
|
|
50
|
+
export interface ResolveSkcTmuxBinaryOptions {
|
|
51
|
+
platform?: NodeJS.Platform;
|
|
52
|
+
env?: NodeJS.ProcessEnv;
|
|
53
|
+
runner?: PsmuxSpawnRunner;
|
|
54
|
+
}
|
|
55
|
+
export interface ResolvedTmuxBinary {
|
|
56
|
+
command: string;
|
|
57
|
+
isPsmux: boolean;
|
|
58
|
+
viaExplicitOverride: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Resolve the tmux command SKC should invoke. Honors the existing
|
|
62
|
+
* SKC_TMUX_COMMAND / SKC_TEAM_TMUX_COMMAND overrides; on Windows when no
|
|
63
|
+
* override is set, psmux (installed as psmux, pmux, or tmux) is picked
|
|
64
|
+
* automatically so the default skc --tmux flow lands on a real multiplexer.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveSkcTmuxBinary(options?: ResolveSkcTmuxBinaryOptions): ResolvedTmuxBinary;
|
|
67
|
+
/** Test-only helper: drop the in-process detection cache. */
|
|
68
|
+
export declare function clearPsmuxDetectionCache(): void;
|
|
69
|
+
export interface PsmuxProbe {
|
|
70
|
+
command: string;
|
|
71
|
+
versionOutput: string;
|
|
72
|
+
isPsmux: boolean;
|
|
73
|
+
}
|
|
74
|
+
export declare function probePsmux(command: string, options?: {
|
|
75
|
+
env?: NodeJS.ProcessEnv;
|
|
76
|
+
runner?: PsmuxSpawnRunner;
|
|
77
|
+
force?: boolean;
|
|
78
|
+
}): PsmuxProbe;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* 2. **Artifact write**: `skc ralplan --write --stage <type> --stage_n <N> --artifact
|
|
14
14
|
* <path-or-string> [--run-id <id>] [--session-id <id>] [--json]` persists Planner / Architect
|
|
15
|
-
* / Critic / revision / ADR / final markdown under `.skc/plans/ralplan/<run-id>/`, maintains
|
|
15
|
+
* / Critic / revision / post-interview / ADR / final markdown under `.skc/plans/ralplan/<run-id>/`, maintains
|
|
16
16
|
* an `index.jsonl` audit log, copies `final` stages to `pending-approval.md`, and advances
|
|
17
17
|
* the HUD chip to reflect the latest persisted stage.
|
|
18
18
|
*/
|
|
@@ -281,6 +281,8 @@ export declare function persistSkcTeamModeStateSummary(snapshot: SkcTeamSnapshot
|
|
|
281
281
|
export declare function recoverSkcTeamStaleClaims(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<SkcTeamLivenessRecoveryResult>;
|
|
282
282
|
type SkcTeamTaskMetadataInput = Partial<Pick<SkcTeamTask, "owner" | "lane" | "required_role" | "allowed_roles" | "depends_on" | "blocked_by">>;
|
|
283
283
|
export declare function resolveSkcWorkerCommand(cwd?: string, env?: NodeJS.ProcessEnv): string;
|
|
284
|
+
/** @internal Exported for unit tests. */
|
|
285
|
+
export declare function buildWorkerCommand(config: SkcTeamConfig, worker: SkcTeamWorker, platform?: NodeJS.Platform): string;
|
|
284
286
|
export type SkcWorkerCheckpointClassification = {
|
|
285
287
|
kind: "clean";
|
|
286
288
|
files: string[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ResolvedTmuxBinary } from "./psmux-detect";
|
|
1
2
|
export declare const SKC_DEFAULT_TMUX_SESSION = "sayknow_cli";
|
|
2
3
|
export declare const SKC_TMUX_SESSION_PREFIX = "sayknow_cli_";
|
|
3
4
|
export declare const SKC_TMUX_COMMAND_ENV = "SKC_TMUX_COMMAND";
|
|
@@ -11,6 +12,7 @@ export declare const SKC_TMUX_PROJECT_OPTION = "@skc-project";
|
|
|
11
12
|
export declare const SKC_TMUX_SESSION_ID_OPTION = "@skc-session-id";
|
|
12
13
|
export declare const SKC_TMUX_SESSION_STATE_FILE_OPTION = "@skc-session-state-file";
|
|
13
14
|
export declare const SKC_TMUX_VERSION_OPTION = "@skc-version";
|
|
15
|
+
export declare const SKC_PSMUX_PROFILE_FORCE_ENV = "SKC_PSMUX_PROFILE_FORCE";
|
|
14
16
|
export interface SkcTmuxProfileCommand {
|
|
15
17
|
description: string;
|
|
16
18
|
args: string[];
|
|
@@ -23,7 +25,26 @@ export interface TmuxCommandResult {
|
|
|
23
25
|
}
|
|
24
26
|
export type TmuxCommandRunner = (args: string[]) => TmuxCommandResult;
|
|
25
27
|
export declare function envDisabled(value: string | undefined): boolean;
|
|
26
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Resolve the tmux (or tmux-compatible multiplexer) command SKC should invoke.
|
|
30
|
+
*
|
|
31
|
+
* This is the shared entry point used by every SKC code path that needs to talk
|
|
32
|
+
* to a multiplexer: `skc --tmux` planning, `skc session ...`, `skc team ...`,
|
|
33
|
+
* the lifecycle controller, and the harness resident owner. Routing all of
|
|
34
|
+
* them through the same resolver means a single `SKC_TMUX_COMMAND` override or
|
|
35
|
+
* a single Windows psmux / pmux detection wins for the whole process — the
|
|
36
|
+
* failure mode where `skc --tmux` creates a psmux-backed session and then
|
|
37
|
+
* `skc session status` fails because it queries literal `tmux` is closed off.
|
|
38
|
+
*
|
|
39
|
+
* Explicit `SKC_TMUX_COMMAND` / `SKC_TEAM_TMUX_COMMAND` overrides are honored on
|
|
40
|
+
* every platform. On native Windows without an override the resolver walks
|
|
41
|
+
* `psmux`, then `pmux`, then `tmux` and uses the first binary present on PATH.
|
|
42
|
+
* On POSIX the resolver returns `tmux` (the historical default) and only
|
|
43
|
+
* falls through to the platform-aware walker if the caller opts in.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveSkcTmuxCommand(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): string;
|
|
46
|
+
export type { PsmuxProbe, ResolvedTmuxBinary, ResolveSkcTmuxBinaryOptions } from "./psmux-detect";
|
|
47
|
+
export { clearPsmuxDetectionCache, detectPsmux, probePsmux, resolveSkcTmuxBinary } from "./psmux-detect";
|
|
27
48
|
/**
|
|
28
49
|
* Build the exact-session target for tmux *option* commands
|
|
29
50
|
* (`show-options` / `set-option`) and `display-message -t`.
|
|
@@ -34,7 +55,11 @@ export declare function resolveSkcTmuxCommand(env?: NodeJS.ProcessEnv): string;
|
|
|
34
55
|
* keeps the exact-session match while giving tmux the window-qualified target
|
|
35
56
|
* those commands require. See sayknow-cli#580.
|
|
36
57
|
*/
|
|
37
|
-
export declare function buildSkcTmuxExactOptionTarget(sessionName: string
|
|
58
|
+
export declare function buildSkcTmuxExactOptionTarget(sessionName: string, opts?: {
|
|
59
|
+
env?: NodeJS.ProcessEnv;
|
|
60
|
+
platform?: NodeJS.Platform;
|
|
61
|
+
binary?: ResolvedTmuxBinary;
|
|
62
|
+
}): string;
|
|
38
63
|
export declare const SKC_TMUX_UNTAGGED_REASON = "skc_tmux_session_untagged";
|
|
39
64
|
export declare function buildSkcTmuxUntaggedSessionHint(tmuxCommand: string): string;
|
|
40
65
|
export declare function buildSkcTmuxUntaggedSessionError(sessionName: string, tmuxCommand: string): string;
|
|
@@ -60,5 +85,8 @@ export declare function buildSkcTmuxProfileCommands(target: string, env?: NodeJS
|
|
|
60
85
|
sessionId?: string | null;
|
|
61
86
|
sessionStateFile?: string | null;
|
|
62
87
|
version?: string | null;
|
|
88
|
+
}, opts?: {
|
|
89
|
+
platform?: NodeJS.Platform;
|
|
90
|
+
tmuxCommand?: string;
|
|
63
91
|
}): SkcTmuxProfileCommand[];
|
|
64
92
|
export declare function normalizeTmuxCreatedAt(raw: string): string;
|
|
@@ -41,4 +41,22 @@ export declare function createSkcTmuxSession(env?: NodeJS.ProcessEnv): SkcTmuxSe
|
|
|
41
41
|
/** @internal */
|
|
42
42
|
export declare function readTmuxSessionTagsForGc(sessionName: string, env?: NodeJS.ProcessEnv): SkcTmuxSessionTagsForGc;
|
|
43
43
|
export declare function removeSkcTmuxSession(sessionName: string, env?: NodeJS.ProcessEnv): SkcTmuxSessionStatus;
|
|
44
|
+
/**
|
|
45
|
+
* Force-close a SKC-managed tmux session, even if a live pane is attached.
|
|
46
|
+
*
|
|
47
|
+
* This is the lifecycle-control counterpart to {@link removeSkcTmuxSession}: it
|
|
48
|
+
* intentionally does NOT refuse live/attached panes (hard-kill is the contract),
|
|
49
|
+
* but it keeps every safety check so it can only ever kill a genuinely
|
|
50
|
+
* SKC-managed session:
|
|
51
|
+
* - re-reads the exact tmux profile immediately before kill (never a non-SKC
|
|
52
|
+
* session, even one that collides by name);
|
|
53
|
+
* - when `expectedSessionId` is given, requires the `@skc-session-id` tag match;
|
|
54
|
+
* - when `expectedStateFile` is given, requires the `@skc-session-state-file`
|
|
55
|
+
* tag match.
|
|
56
|
+
*
|
|
57
|
+
* Returns the prior status (for audit). Throws a tagged error otherwise:
|
|
58
|
+
* `skc_tmux_session_not_found`, `skc_tmux_session_not_managed`,
|
|
59
|
+
* `skc_tmux_session_id_mismatch`, or `skc_tmux_session_state_file_mismatch`.
|
|
60
|
+
*/
|
|
61
|
+
export declare function forceCloseSkcTmuxSession(sessionName: string, env?: NodeJS.ProcessEnv, expectedSessionId?: string, expectedStateFile?: string): SkcTmuxSessionStatus;
|
|
44
62
|
export declare function attachSkcTmuxSession(sessionName: string, env?: NodeJS.ProcessEnv): never;
|
|
@@ -37,6 +37,12 @@ export interface FastStatusSessionLike {
|
|
|
37
37
|
readonly model?: Model;
|
|
38
38
|
/** Fast predicate against the main session tier (current model + `modelRoles`). */
|
|
39
39
|
isFastForProvider(provider?: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Current-model EFFECTIVE fast state (intent minus any provider auto-disable).
|
|
42
|
+
* Used for the current-model row so it matches what the next request does.
|
|
43
|
+
* Optional so lightweight fakes can omit it; falls back to `isFastForProvider`.
|
|
44
|
+
*/
|
|
45
|
+
isFastModeActive?(): boolean;
|
|
40
46
|
/** Fast predicate against the effective subagent tier (`task.agentModelOverrides` roles). */
|
|
41
47
|
isFastForSubagentProvider(provider?: string): boolean;
|
|
42
48
|
resolveRoleModelWithThinking(role: string): {
|
|
@@ -47,6 +47,8 @@ export interface BuildSystemPromptOptions {
|
|
|
47
47
|
toolNames?: string[];
|
|
48
48
|
/** Text to append to system prompt. */
|
|
49
49
|
appendSystemPrompt?: string;
|
|
50
|
+
/** Rendered SKC plugin system-appendix blocks (lower-authority, appended last). */
|
|
51
|
+
pluginAppendices?: string;
|
|
50
52
|
/** Repeat full tool descriptions in system prompt. Default: false */
|
|
51
53
|
repeatToolDescriptions?: boolean;
|
|
52
54
|
/** Skills settings for discovery. */
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Runs each subagent on the main thread and forwards AgentEvents for progress tracking.
|
|
5
5
|
*/
|
|
6
6
|
import type { AgentTelemetryConfig, ThinkingLevel } from "@sayknow-cli/agent-core";
|
|
7
|
+
import type { ServiceTier } from "@sayknow-cli/ai";
|
|
7
8
|
import { ModelRegistry } from "../config/model-registry";
|
|
8
9
|
import type { PromptTemplate } from "../config/prompt-templates";
|
|
9
10
|
import { Settings } from "../config/settings";
|
|
@@ -58,6 +59,13 @@ export interface ExecutorOptions {
|
|
|
58
59
|
authStorage?: AuthStorage;
|
|
59
60
|
modelRegistry?: ModelRegistry;
|
|
60
61
|
settings?: Settings;
|
|
62
|
+
/**
|
|
63
|
+
* Live service-tier intent of the parent session (`AgentSession.serviceTier`),
|
|
64
|
+
* used as the inherited tier when `task.serviceTier === "inherit"`. Passing the
|
|
65
|
+
* live value (not the stale settings snapshot) lets a runtime `/fast on` reach
|
|
66
|
+
* subagents, and a main-model fast-mode auto-disable does not clobber it.
|
|
67
|
+
*/
|
|
68
|
+
inheritedServiceTier?: ServiceTier;
|
|
61
69
|
/** Override local:// protocol options so subagent shares parent's local:// root */
|
|
62
70
|
localProtocolOptions?: LocalProtocolOptions;
|
|
63
71
|
/**
|
|
@@ -105,7 +113,7 @@ interface FinalizeSubprocessOutputResult {
|
|
|
105
113
|
export declare const SUBAGENT_WARNING_NULL_YIELD = "SYSTEM WARNING: Subagent called yield with null data.";
|
|
106
114
|
export declare const SUBAGENT_WARNING_MISSING_YIELD = "SYSTEM WARNING: Subagent exited without calling yield tool after 3 reminders.";
|
|
107
115
|
export declare function finalizeSubprocessOutput(args: FinalizeSubprocessOutputArgs): FinalizeSubprocessOutputResult;
|
|
108
|
-
export declare function createSubagentSettings(baseSettings: Settings): Settings;
|
|
116
|
+
export declare function createSubagentSettings(baseSettings: Settings, inheritedServiceTier?: ServiceTier): Settings;
|
|
109
117
|
/**
|
|
110
118
|
* Run a single agent in-process.
|
|
111
119
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const COMPOSER_BASH_POLICY_ERROR = "Composer bash policy blocked repository file I/O. Use find, search, read, and edit tools for file discovery, file inspection, and file mutation.";
|
|
2
|
+
type ComposerBashPolicyResult = {
|
|
3
|
+
allowed: true;
|
|
4
|
+
} | {
|
|
5
|
+
allowed: false;
|
|
6
|
+
reason: string;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function isComposerBashPolicyModel(modelId: string | undefined): boolean;
|
|
10
|
+
export declare function checkComposerBashPolicy(input: {
|
|
11
|
+
modelId?: string;
|
|
12
|
+
commands: readonly string[];
|
|
13
|
+
}): ComposerBashPolicyResult;
|
|
14
|
+
export {};
|