@sayknow-cli/coding-agent 0.3.5 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -0
- package/dist/types/capability/mcp.d.ts +2 -0
- package/dist/types/cli/local-provider-smoke.d.ts +59 -0
- package/dist/types/cli/notify-cli.d.ts +1 -1
- package/dist/types/cli/telegram-cli.d.ts +13 -0
- package/dist/types/cli/update-cli.d.ts +24 -1
- package/dist/types/commands/local-provider.d.ts +34 -0
- package/dist/types/commands/telegram.d.ts +22 -0
- package/dist/types/config/keybindings.d.ts +12 -6
- package/dist/types/config/model-registry.d.ts +5 -0
- package/dist/types/config/models-config-schema.d.ts +5 -0
- package/dist/types/config/settings-schema.d.ts +284 -4
- package/dist/types/config/settings.d.ts +7 -0
- package/dist/types/config/telegram-autostart.d.ts +14 -0
- package/dist/types/config/telegram-env-bridge.d.ts +18 -0
- package/dist/types/coordinator-mcp/server.d.ts +8 -0
- package/dist/types/defaults/skc-defaults.d.ts +7 -0
- package/dist/types/discovery/cursor.d.ts +4 -1
- package/dist/types/discovery/index.d.ts +0 -1
- package/dist/types/discovery/windsurf.d.ts +3 -1
- package/dist/types/extensibility/extensions/types.d.ts +11 -0
- package/dist/types/i18n/messages/en.d.ts +1 -0
- package/dist/types/modes/components/custom-editor.d.ts +6 -1
- package/dist/types/modes/components/custom-model-preset-wizard.d.ts +1 -1
- package/dist/types/modes/components/hook-selector.d.ts +5 -0
- package/dist/types/modes/components/model-selector.d.ts +2 -0
- package/dist/types/modes/components/settings-selector.d.ts +5 -1
- package/dist/types/modes/components/skill-message.d.ts +1 -0
- package/dist/types/modes/components/status-line/types.d.ts +5 -7
- package/dist/types/modes/components/status-line.d.ts +15 -3
- package/dist/types/modes/components/two-column-body.d.ts +9 -0
- package/dist/types/modes/components/welcome.d.ts +9 -1
- package/dist/types/modes/controllers/command-controller.d.ts +1 -0
- package/dist/types/modes/controllers/input-controller.d.ts +6 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +10 -1
- package/dist/types/modes/interactive-mode.d.ts +2 -0
- package/dist/types/modes/prompt-action-autocomplete.d.ts +3 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +1 -0
- package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +41 -7
- package/dist/types/modes/slash-command-visibility.d.ts +1 -0
- package/dist/types/modes/theme/theme.d.ts +1 -1
- package/dist/types/modes/tmux-scroll.d.ts +18 -0
- package/dist/types/modes/types.d.ts +5 -1
- package/dist/types/modes/utils/terminal-bell.d.ts +3 -0
- package/dist/types/notifications/daemon-paths.d.ts +9 -0
- package/dist/types/notifications/html-format.d.ts +2 -0
- package/dist/types/notifications/recent-activity.d.ts +5 -1
- package/dist/types/notifications/telegram-daemon-cli.d.ts +21 -4
- package/dist/types/notifications/telegram-daemon-control.d.ts +8 -0
- package/dist/types/notifications/telegram-daemon.d.ts +4 -10
- package/dist/types/notifications/telegram-reference.d.ts +4 -0
- package/dist/types/notifications/threaded-render.d.ts +1 -0
- package/dist/types/runtime-mcp/config-writer.d.ts +9 -0
- package/dist/types/runtime-mcp/config.d.ts +2 -0
- package/dist/types/runtime-mcp/loader.d.ts +2 -0
- package/dist/types/runtime-mcp/manager.d.ts +2 -0
- package/dist/types/runtime-mcp/types.d.ts +6 -0
- package/dist/types/sdk.d.ts +1 -1
- package/dist/types/skc-runtime/launch-tmux.d.ts +2 -2
- package/dist/types/skc-runtime/ralplan-runtime.d.ts +3 -2
- package/dist/types/skc-runtime/restricted-role-agent-bash.d.ts +1 -0
- package/dist/types/skc-runtime/session-state-sidecar.d.ts +5 -0
- package/dist/types/skc-runtime/state-writer.d.ts +1 -0
- package/dist/types/skc-runtime/team-runtime.d.ts +1 -1
- package/dist/types/skc-runtime/tmux-common.d.ts +12 -0
- package/dist/types/skc-runtime/ultragoal-guard.d.ts +7 -1
- package/dist/types/skc-runtime/ultragoal-runtime.d.ts +0 -4
- package/dist/types/slash-commands/types.d.ts +2 -0
- package/dist/types/system-prompt.d.ts +7 -0
- package/dist/types/tools/skill.d.ts +1 -1
- package/dist/types/utils/cmux-workspace.d.ts +52 -0
- package/dist/types/web/search/index.d.ts +4 -2
- package/dist/types/web/search/provider.d.ts +14 -0
- package/dist/types/web/search/providers/utils.d.ts +42 -13
- package/dist/types/web/search/render.d.ts +1 -0
- package/dist/types/workflow/workflow-intent-diff.d.ts +19 -0
- package/package.json +8 -8
- package/scripts/build-binary.ts +3 -0
- package/scripts/verify-insane-vendor.ts +0 -5
- package/src/capability/mcp.ts +2 -0
- package/src/cli/local-provider-smoke.ts +632 -0
- package/src/cli/notify-cli.ts +4 -2
- package/src/cli/telegram-cli.ts +156 -0
- package/src/cli/update-cli.ts +179 -13
- package/src/cli/web-search-cli.ts +5 -7
- package/src/cli.ts +20 -1
- package/src/commands/launch.ts +47 -2
- package/src/commands/local-provider.ts +62 -0
- package/src/commands/notify.ts +1 -1
- package/src/commands/ralplan.ts +1 -0
- package/src/commands/telegram.ts +47 -0
- package/src/config/keybindings.ts +15 -6
- package/src/config/mcp-schema.json +4 -0
- package/src/config/model-registry.ts +55 -1
- package/src/config/models-config-schema.ts +9 -0
- package/src/config/settings-schema.ts +256 -4
- package/src/config/settings.ts +11 -0
- package/src/config/telegram-autostart.ts +107 -0
- package/src/config/telegram-env-bridge.ts +92 -0
- package/src/coordinator-mcp/server.ts +276 -34
- package/src/defaults/skc/skills/ralplan/SKILL.md +29 -20
- package/src/defaults/skc/skills/ultragoal/SKILL.md +37 -112
- package/src/defaults/skc-defaults.ts +16 -0
- package/src/discovery/builtin.ts +12 -0
- package/src/discovery/cursor.ts +5 -84
- package/src/discovery/gemini.ts +3 -89
- package/src/discovery/index.ts +4 -1
- package/src/discovery/mcp-json.ts +11 -0
- package/src/discovery/opencode.ts +5 -122
- package/src/discovery/windsurf.ts +4 -82
- package/src/edit/read-file.ts +9 -1
- package/src/extensibility/extensions/runner.ts +2 -1
- package/src/extensibility/extensions/types.ts +11 -0
- package/src/extensibility/skills.ts +30 -2
- package/src/hooks/skill-state.ts +33 -73
- package/src/i18n/messages/de.ts +1 -0
- package/src/i18n/messages/en.ts +1 -0
- package/src/i18n/messages/es.ts +1 -0
- package/src/i18n/messages/fr.ts +1 -0
- package/src/i18n/messages/ja.settings.ts +28 -0
- package/src/i18n/messages/ja.ts +1 -0
- package/src/i18n/messages/ko.settings.ts +28 -0
- package/src/i18n/messages/ko.ts +1 -0
- package/src/i18n/messages/zh.settings.ts +28 -0
- package/src/i18n/messages/zh.ts +1 -0
- package/src/internal-urls/docs-index.generated.ts +12 -7
- package/src/main.ts +5 -2
- package/src/migrate/executor.ts +23 -6
- package/src/modes/acp/acp-agent.ts +7 -6
- package/src/modes/components/agent-dashboard.ts +3 -35
- package/src/modes/components/custom-editor.ts +26 -0
- package/src/modes/components/custom-model-preset-wizard.ts +30 -189
- package/src/modes/components/extensions/extension-dashboard.ts +2 -48
- package/src/modes/components/hook-selector.ts +21 -3
- package/src/modes/components/model-selector.ts +246 -11
- package/src/modes/components/session-observer-overlay.ts +3 -3
- package/src/modes/components/session-selector.ts +19 -9
- package/src/modes/components/settings-selector.ts +551 -11
- package/src/modes/components/skill-message.ts +18 -10
- package/src/modes/components/status-line/presets.ts +11 -0
- package/src/modes/components/status-line/segments.ts +16 -19
- package/src/modes/components/status-line/types.ts +6 -2
- package/src/modes/components/status-line.ts +281 -117
- package/src/modes/components/tree-selector.ts +28 -8
- package/src/modes/components/two-column-body.ts +36 -0
- package/src/modes/components/welcome.ts +165 -30
- package/src/modes/controllers/command-controller.ts +26 -2
- package/src/modes/controllers/event-controller.ts +102 -4
- package/src/modes/controllers/extension-ui-controller.ts +21 -2
- package/src/modes/controllers/input-controller.ts +214 -47
- package/src/modes/controllers/selector-controller.ts +35 -33
- package/src/modes/interactive-mode.ts +36 -30
- package/src/modes/prompt-action-autocomplete.ts +48 -8
- package/src/modes/rpc/rpc-types.ts +1 -0
- package/src/modes/shared/agent-wire/deep-interview-gate.ts +72 -15
- package/src/modes/shared/agent-wire/workflow-gate-schema.ts +20 -0
- package/src/modes/slash-command-visibility.ts +9 -0
- package/src/modes/theme/theme.ts +5 -1
- package/src/modes/tmux-scroll.ts +92 -0
- package/src/modes/types.ts +8 -1
- package/src/modes/utils/hotkeys-markdown.ts +5 -2
- package/src/modes/utils/terminal-bell.ts +48 -0
- package/src/modes/utils/ui-helpers.ts +76 -3
- package/src/notifications/daemon-paths.ts +22 -0
- package/src/notifications/html-format.ts +75 -1
- package/src/notifications/index.ts +32 -2
- package/src/notifications/lifecycle-control-runtime.ts +12 -3
- package/src/notifications/recent-activity.ts +32 -8
- package/src/notifications/telegram-daemon-cli.ts +125 -13
- package/src/notifications/telegram-daemon-control.ts +9 -0
- package/src/notifications/telegram-daemon.ts +88 -46
- package/src/notifications/telegram-reference.ts +36 -14
- package/src/notifications/threaded-render.ts +14 -6
- package/src/prompts/agents/architect.md +7 -4
- package/src/prompts/agents/critic.md +15 -6
- package/src/prompts/agents/planner.md +8 -3
- package/src/prompts/system/system-prompt.md +20 -2
- package/src/prompts/tools/bash.md +1 -1
- package/src/runtime-mcp/config-writer.ts +28 -0
- package/src/runtime-mcp/config.ts +7 -0
- package/src/runtime-mcp/loader.ts +3 -0
- package/src/runtime-mcp/manager.ts +3 -0
- package/src/runtime-mcp/types.ts +6 -0
- package/src/sdk.ts +10 -11
- package/src/session/agent-session.ts +103 -13
- package/src/session/session-manager.ts +58 -18
- package/src/skc-runtime/launch-tmux.ts +34 -8
- package/src/skc-runtime/launch-worktree.ts +16 -2
- package/src/skc-runtime/ralplan-runtime.ts +22 -6
- package/src/skc-runtime/restricted-role-agent-bash.ts +1 -0
- package/src/skc-runtime/session-state-sidecar.ts +167 -24
- package/src/skc-runtime/state-runtime.ts +8 -5
- package/src/skc-runtime/state-writer.ts +5 -5
- package/src/skc-runtime/team-runtime.ts +21 -6
- package/src/skc-runtime/tmux-common.ts +16 -0
- package/src/skc-runtime/tmux-sessions.ts +13 -9
- package/src/skc-runtime/ultragoal-guard.ts +150 -24
- package/src/skc-runtime/ultragoal-runtime.ts +16 -124
- package/src/skc-runtime/workflow-manifest.generated.json +0 -8
- package/src/skc-runtime/workflow-manifest.ts +0 -1
- package/src/slash-commands/builtin-registry.ts +136 -23
- package/src/slash-commands/types.ts +2 -0
- package/src/system-prompt.ts +8 -0
- package/src/task/executor.ts +5 -0
- package/src/tools/ast-grep.ts +10 -7
- package/src/tools/bash.ts +39 -14
- package/src/tools/index.ts +8 -1
- package/src/tools/skill.ts +1 -1
- package/src/utils/cmux-workspace.ts +233 -0
- package/src/utils/title-generator.ts +2 -0
- package/src/web/kagi.ts +1 -1
- package/src/web/parallel.ts +2 -2
- package/src/web/search/index.ts +137 -52
- package/src/web/search/provider.ts +80 -0
- package/src/web/search/providers/anthropic.ts +1 -1
- package/src/web/search/providers/brave.ts +1 -1
- package/src/web/search/providers/codex.ts +1 -1
- package/src/web/search/providers/duckduckgo.ts +1 -1
- package/src/web/search/providers/exa.ts +1 -1
- package/src/web/search/providers/gemini.ts +7 -3
- package/src/web/search/providers/jina.ts +1 -1
- package/src/web/search/providers/kimi.ts +6 -1
- package/src/web/search/providers/openai-compatible.ts +1 -1
- package/src/web/search/providers/parallel.ts +1 -1
- package/src/web/search/providers/perplexity.ts +2 -2
- package/src/web/search/providers/searxng.ts +1 -1
- package/src/web/search/providers/synthetic.ts +1 -1
- package/src/web/search/providers/tavily.ts +1 -1
- package/src/web/search/providers/utils.ts +67 -17
- package/src/web/search/providers/xai.ts +1 -1
- package/src/web/search/providers/zai.ts +1 -1
- package/src/web/search/render.ts +3 -0
- package/src/workflow/workflow-intent-diff.ts +199 -0
- package/vendor/insane-search/MANIFEST.json +1 -3
- package/vendor/insane-search/engine/tests/test_u1.py +0 -28
- package/vendor/insane-search/engine/transport.py +2 -3
- package/vendor/insane-search/engine/validators.py +0 -14
- package/src/defaults/skc/rules/ponytail.md +0 -68
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { postmortem } from "@sayknow-cli/utils";
|
|
1
2
|
export declare const SKC_COORDINATOR_SESSION_STATE_FILE_ENV = "SKC_COORDINATOR_SESSION_STATE_FILE";
|
|
2
3
|
export declare const SKC_COORDINATOR_SESSION_ID_ENV = "SKC_COORDINATOR_SESSION_ID";
|
|
4
|
+
export declare const SKC_COORDINATOR_SESSION_BRANCH_ENV = "SKC_COORDINATOR_SESSION_BRANCH";
|
|
3
5
|
export type RuntimeState = "ready_for_input" | "running" | "needs_user_input" | "completed" | "errored";
|
|
4
6
|
interface RuntimeStateEvent {
|
|
5
7
|
type: string;
|
|
@@ -9,6 +11,7 @@ interface RuntimeStateContext {
|
|
|
9
11
|
sessionId: string;
|
|
10
12
|
cwd: string;
|
|
11
13
|
sessionFile?: string | null;
|
|
14
|
+
branch?: string | null;
|
|
12
15
|
}
|
|
13
16
|
export type TerminalRuntimeStateStatus = {
|
|
14
17
|
terminal: true;
|
|
@@ -24,4 +27,6 @@ export declare function readTerminalRuntimeStateMarker(input: {
|
|
|
24
27
|
sessionFile?: string | null;
|
|
25
28
|
}): Promise<TerminalRuntimeStateStatus>;
|
|
26
29
|
export declare function persistCoordinatorRuntimeStateFromEvent(event: RuntimeStateEvent, context: RuntimeStateContext): Promise<void>;
|
|
30
|
+
export declare function persistCoordinatorRuntimeStateFromPostmortem(reason: postmortem.Reason, context: RuntimeStateContext): void;
|
|
31
|
+
export declare function registerCoordinatorRuntimeStateFinalizer(context: RuntimeStateContext): () => void;
|
|
27
32
|
export {};
|
|
@@ -280,7 +280,7 @@ export declare function pruneTeamWorkerGcRecord(record: GcRecord, probe: GcPidPr
|
|
|
280
280
|
export declare function persistSkcTeamModeStateSummary(snapshot: SkcTeamSnapshot, cwd?: string): Promise<void>;
|
|
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
|
-
export declare function resolveSkcWorkerCommand(cwd?: string, env?: NodeJS.ProcessEnv): string;
|
|
283
|
+
export declare function resolveSkcWorkerCommand(cwd?: string, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, argv?: string[], execPath?: string): string;
|
|
284
284
|
/** @internal Exported for unit tests. */
|
|
285
285
|
export declare function buildWorkerCommand(config: SkcTeamConfig, worker: SkcTeamWorker, platform?: NodeJS.Platform): string;
|
|
286
286
|
export type SkcWorkerCheckpointClassification = {
|
|
@@ -60,6 +60,18 @@ export declare function buildSkcTmuxExactOptionTarget(sessionName: string, opts?
|
|
|
60
60
|
platform?: NodeJS.Platform;
|
|
61
61
|
binary?: ResolvedTmuxBinary;
|
|
62
62
|
}): string;
|
|
63
|
+
/**
|
|
64
|
+
* Build the exact-session target for tmux *session-scoped* commands such as
|
|
65
|
+
* `attach-session` and `kill-session`. Native tmux accepts `=NAME` for an
|
|
66
|
+
* exact session match, but Windows psmux 3.3.x rejects that target form for
|
|
67
|
+
* session commands even though the bare `NAME` resolves. Keep native tmux on
|
|
68
|
+
* exact targets and intentionally use the bare session name for psmux.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildSkcTmuxExactSessionTarget(sessionName: string, opts?: {
|
|
71
|
+
env?: NodeJS.ProcessEnv;
|
|
72
|
+
platform?: NodeJS.Platform;
|
|
73
|
+
binary?: ResolvedTmuxBinary;
|
|
74
|
+
}): string;
|
|
63
75
|
export declare const SKC_TMUX_UNTAGGED_REASON = "skc_tmux_session_untagged";
|
|
64
76
|
export declare function buildSkcTmuxUntaggedSessionHint(tmuxCommand: string): string;
|
|
65
77
|
export declare function buildSkcTmuxUntaggedSessionError(sessionName: string, tmuxCommand: string): string;
|
|
@@ -29,7 +29,13 @@ export declare function readUltragoalVerificationState(input: {
|
|
|
29
29
|
currentGoal?: CurrentGoalLike | null;
|
|
30
30
|
sessionId?: string | null;
|
|
31
31
|
}): Promise<UltragoalGuardDiagnostic>;
|
|
32
|
-
export declare function
|
|
32
|
+
export declare function verifyUltragoalDurableCompletionState(input: {
|
|
33
|
+
cwd: string;
|
|
34
|
+
sessionId?: string | null;
|
|
35
|
+
}): Promise<UltragoalGuardDiagnostic>;
|
|
36
|
+
export declare function isUltragoalAskBlocked(cwd: string, options?: {
|
|
37
|
+
sessionId?: string | null;
|
|
38
|
+
}): Promise<UltragoalAskBlockDiagnostic>;
|
|
33
39
|
/**
|
|
34
40
|
* Escalating per-attempt refusal text. Deliberately avoids every
|
|
35
41
|
* `isUltragoalBypassPrompt` trigger: no `update_goal(`, no "skip/weaken verification",
|
|
@@ -36,7 +36,6 @@ export interface UltragoalCompletionVerification {
|
|
|
36
36
|
skcGoalMode: UltragoalSkcGoalMode;
|
|
37
37
|
skcObjective: string;
|
|
38
38
|
qualityGateHash: string;
|
|
39
|
-
skcGoalSnapshotHash: string;
|
|
40
39
|
planGeneration: string;
|
|
41
40
|
basis: {
|
|
42
41
|
planHashBeforeCheckpoint: string;
|
|
@@ -237,7 +236,6 @@ export declare function checkpointUltragoalGoal(input: {
|
|
|
237
236
|
goalId: string;
|
|
238
237
|
status: UltragoalGoalStatus;
|
|
239
238
|
evidence: string;
|
|
240
|
-
skcGoalJson?: string;
|
|
241
239
|
qualityGateJson?: string;
|
|
242
240
|
}): Promise<UltragoalPlan>;
|
|
243
241
|
export interface UltragoalCheckpointContinuation {
|
|
@@ -253,7 +251,6 @@ export declare function checkpointAndContinueUltragoalGoal(input: {
|
|
|
253
251
|
goalId: string;
|
|
254
252
|
status: UltragoalGoalStatus;
|
|
255
253
|
evidence: string;
|
|
256
|
-
skcGoalJson?: string;
|
|
257
254
|
qualityGateJson?: string;
|
|
258
255
|
advanceNext?: boolean;
|
|
259
256
|
retryFailed?: boolean;
|
|
@@ -271,7 +268,6 @@ export declare function recordUltragoalReviewBlockers(input: {
|
|
|
271
268
|
title: string;
|
|
272
269
|
objective: string;
|
|
273
270
|
evidence: string;
|
|
274
|
-
skcGoalJson?: string;
|
|
275
271
|
}): Promise<UltragoalPlan>;
|
|
276
272
|
export type UltragoalBlockerClassification = "human_blocked" | "resolvable";
|
|
277
273
|
/**
|
|
@@ -17,6 +17,8 @@ export interface BuiltinSlashCommand {
|
|
|
17
17
|
subcommands?: SubcommandDef[];
|
|
18
18
|
/** Static inline hint when command takes a simple argument (no subcommands). */
|
|
19
19
|
inlineHint?: string;
|
|
20
|
+
/** Higher values sort earlier in TUI slash-command autocomplete. */
|
|
21
|
+
priority?: number;
|
|
20
22
|
}
|
|
21
23
|
/** Parsed slash-command text after stripping the leading "/". */
|
|
22
24
|
export interface ParsedSlashCommand {
|
|
@@ -76,6 +76,13 @@ export interface BuildSystemPromptOptions {
|
|
|
76
76
|
mcpDiscoveryMode?: boolean;
|
|
77
77
|
/** Discoverable MCP server summaries to advertise when discovery mode is active. */
|
|
78
78
|
mcpDiscoveryServerSummaries?: string[];
|
|
79
|
+
/** Whether built-in tool discovery ("all" mode) is active; enables the tool-discovery prompt block. */
|
|
80
|
+
toolDiscoveryActive?: boolean;
|
|
81
|
+
/** Hidden discoverable tools to advertise (name + one-line summary) when tool discovery is active. */
|
|
82
|
+
discoverableTools?: Array<{
|
|
83
|
+
name: string;
|
|
84
|
+
summary: string;
|
|
85
|
+
}>;
|
|
79
86
|
/** Encourage the agent to delegate via tasks unless changes are trivial. */
|
|
80
87
|
eagerTasks?: boolean;
|
|
81
88
|
/** Rules with alwaysApply=true — their full content is injected into the prompt. */
|
|
@@ -33,7 +33,7 @@ export declare class SkillTool implements AgentTool<typeof skillSchema, SkillToo
|
|
|
33
33
|
readonly name = "skill";
|
|
34
34
|
readonly label = "Skill";
|
|
35
35
|
readonly summary = "Chain into another available skill in the current turn";
|
|
36
|
-
readonly loadMode = "
|
|
36
|
+
readonly loadMode = "essential";
|
|
37
37
|
readonly description: string;
|
|
38
38
|
readonly parameters: z.ZodObject<{
|
|
39
39
|
name: z.ZodString;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface CmuxWorkspaceRenameCommand {
|
|
2
|
+
command: string;
|
|
3
|
+
args: string[];
|
|
4
|
+
}
|
|
5
|
+
/** Current ownership state of a cmux workspace, read back from `cmux workspace list`. */
|
|
6
|
+
export interface CmuxWorkspaceOwnership {
|
|
7
|
+
/** cmux marks a workspace `has_custom_title` once an explicit title is set (by the user or by SKC). */
|
|
8
|
+
hasCustomTitle: boolean;
|
|
9
|
+
/** The workspace's current display title. */
|
|
10
|
+
title: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CmuxWorkspaceRenameProcess {
|
|
13
|
+
exited: Promise<number>;
|
|
14
|
+
kill(): void;
|
|
15
|
+
unref(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface CmuxWorkspaceTitleSyncOptions {
|
|
18
|
+
env?: NodeJS.ProcessEnv;
|
|
19
|
+
isTty?: boolean;
|
|
20
|
+
which?: (command: string) => string | null;
|
|
21
|
+
spawn?: (command: string[], options: {
|
|
22
|
+
env: NodeJS.ProcessEnv;
|
|
23
|
+
stdin: "ignore";
|
|
24
|
+
stdout: "ignore";
|
|
25
|
+
stderr: "ignore";
|
|
26
|
+
}) => CmuxWorkspaceRenameProcess;
|
|
27
|
+
/** Reads the current ownership state of `workspaceId`. Injectable for tests. */
|
|
28
|
+
readOwnership?: (cmuxCommand: string, workspaceId: string, env: NodeJS.ProcessEnv) => Promise<CmuxWorkspaceOwnership | null>;
|
|
29
|
+
}
|
|
30
|
+
export declare function sanitizeCmuxWorkspaceTitle(title: string | undefined): string | undefined;
|
|
31
|
+
export declare function formatCmuxWorkspaceTitle(title: string | undefined): string | undefined;
|
|
32
|
+
export declare function buildCmuxWorkspaceRenameCommand(sessionName: string | undefined, env?: NodeJS.ProcessEnv): CmuxWorkspaceRenameCommand | null;
|
|
33
|
+
/** Parse `cmux workspace list --json --id-format both` output and return the
|
|
34
|
+
* ownership state of the workspace matching `workspaceId` (by UUID `id` or `ref`). */
|
|
35
|
+
export declare function parseCmuxWorkspaceOwnership(jsonText: string, workspaceId: string): CmuxWorkspaceOwnership | null;
|
|
36
|
+
/** Only rename when SKC owns the name:
|
|
37
|
+
* - unknown ownership (read failed) → skip (fail safe, never clobber)
|
|
38
|
+
* - already the desired title → skip (no-op)
|
|
39
|
+
* - workspace still on its default title → rename
|
|
40
|
+
* - any custom title (user- or peer-set) → skip
|
|
41
|
+
* This makes SKC name a fresh workspace once and then leave it alone, so it
|
|
42
|
+
* never overwrites a user-pinned name and multiple sessions sharing one
|
|
43
|
+
* CMUX_WORKSPACE_ID do not thrash the workspace title. */
|
|
44
|
+
export declare function shouldRenameCmuxWorkspace(ownership: CmuxWorkspaceOwnership | null, desiredTitle: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Best-effort sync of the containing cmux workspace title to the current SKC
|
|
47
|
+
* session name. Ownership-guarded: SKC reads the current workspace title and
|
|
48
|
+
* only renames a workspace that still has its default title, so it never
|
|
49
|
+
* overwrites a name the user pinned or a name a peer session (sharing the same
|
|
50
|
+
* CMUX_WORKSPACE_ID) set. Opt out with SKC_NO_CMUX_RENAME.
|
|
51
|
+
*/
|
|
52
|
+
export declare function syncCmuxWorkspaceTitle(sessionName: string | undefined, options?: CmuxWorkspaceTitleSyncOptions): Promise<void>;
|
|
@@ -44,6 +44,8 @@ export type SearchToolParams = z.infer<typeof webSearchSchema>;
|
|
|
44
44
|
export interface SearchQueryParams extends SearchToolParams {
|
|
45
45
|
provider?: SearchProviderId | "auto";
|
|
46
46
|
}
|
|
47
|
+
/** Override the hedge delay (tests). Non-finite/non-positive resets to default. */
|
|
48
|
+
export declare function setDdgHedgeDelayMs(ms: number | undefined): void;
|
|
47
49
|
/**
|
|
48
50
|
* Execute a web search query for CLI/testing workflows.
|
|
49
51
|
*
|
|
@@ -110,7 +112,7 @@ export declare class WebSearchTool implements AgentTool<typeof webSearchSchema,
|
|
|
110
112
|
/** Web search tool as CustomTool (for TUI rendering support) */
|
|
111
113
|
export declare const webSearchCustomTool: CustomTool<typeof webSearchSchema, SearchRenderDetails>;
|
|
112
114
|
export declare function getSearchTools(): CustomTool<any, any>[];
|
|
113
|
-
export { getSearchProvider, setPreferredSearchProvider, setSearchFallbackProviders } from "./provider";
|
|
114
|
-
export { setSearchHardTimeoutMs } from "./providers/utils";
|
|
115
|
+
export { getConfiguredSearchProviderPreference, getSearchProvider, setPreferredSearchProvider, setSearchFallbackProviders, } from "./provider";
|
|
116
|
+
export { applyConfiguredSearchTimeout, setSearchHardTimeoutMs } from "./providers/utils";
|
|
115
117
|
export type { SearchProviderId as SearchProvider, SearchResponse } from "./types";
|
|
116
118
|
export { isConfigurableSearchProviderId, isSearchProviderPreference } from "./types";
|
|
@@ -6,8 +6,22 @@ export { SearchProvider } from "./providers/base";
|
|
|
6
6
|
export declare function getSearchProviderLabel(id: SearchProviderId): string;
|
|
7
7
|
export declare function getSearchProvider(id: SearchProviderId): Promise<SearchProvider>;
|
|
8
8
|
export declare const SEARCH_PROVIDER_ORDER: SearchProviderId[];
|
|
9
|
+
/** Drop every cached resolved chain (settings changed, tests). */
|
|
10
|
+
export declare function clearResolvedChainCache(): void;
|
|
9
11
|
export declare function setPreferredSearchProvider(provider: SearchProviderId | "auto"): void;
|
|
10
12
|
export declare function setSearchFallbackProviders(ids: readonly string[]): void;
|
|
13
|
+
/**
|
|
14
|
+
* Fire-and-forget warm-up: resolve the provider chain once so the provider
|
|
15
|
+
* modules are imported and the chain cache is primed before the first
|
|
16
|
+
* user-visible search. Errors are intentionally swallowed — prewarming must
|
|
17
|
+
* never surface a failure the real search path would handle itself.
|
|
18
|
+
*/
|
|
19
|
+
export declare function prewarmSearchProviders(options: ResolveProviderChainOptions): void;
|
|
20
|
+
export interface SearchProviderPreferenceSource {
|
|
21
|
+
get(path: "providers.webSearch" | "web_search.provider"): SearchProviderId | "auto";
|
|
22
|
+
has(path: "providers.webSearch" | "web_search.provider"): boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function getConfiguredSearchProviderPreference(settings: SearchProviderPreferenceSource): SearchProviderId | "auto";
|
|
11
25
|
export interface ResolveProviderChainOptions {
|
|
12
26
|
authStorage: AuthStorage;
|
|
13
27
|
sessionId?: string;
|
|
@@ -15,27 +15,53 @@ import { SearchProviderError, type SearchProviderId, type SearchSource } from ".
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function findCredential(storage: AgentStorage | null | undefined, envKey: string | null | undefined, ...storageProviders: string[]): string | null;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Pure search APIs (brave, exa, jina, tavily, searxng, synthetic, zai)
|
|
24
|
-
* settle far faster in practice; reusing the same ceiling keeps the wiring
|
|
25
|
-
* uniform without compromising correctness.
|
|
18
|
+
* Legacy hard ceiling for a single web-search round-trip, retained as the
|
|
19
|
+
* fallback for call sites that do not declare a timeout class. 300s tolerates
|
|
20
|
+
* pathological cases while still guaranteeing the session unfreezes if Bun's
|
|
21
|
+
* `AbortSignal` fails to propagate on Windows.
|
|
26
22
|
*/
|
|
27
23
|
export declare const SEARCH_HARD_TIMEOUT_MS = 300000;
|
|
24
|
+
/**
|
|
25
|
+
* Hard ceiling for pure search APIs (brave, exa, jina, tavily, kagi,
|
|
26
|
+
* parallel, searxng, synthetic, zai, duckduckgo). These settle in ~1-3s in
|
|
27
|
+
* practice; a hung TCP/TLS connection should fall through to the next
|
|
28
|
+
* provider in seconds, not minutes. Kimi is the exception: it declares an
|
|
29
|
+
* explicit ceiling aligned with its upstream 30s request budget.
|
|
30
|
+
*/
|
|
31
|
+
export declare const SEARCH_API_TIMEOUT_MS = 15000;
|
|
32
|
+
/**
|
|
33
|
+
* Hard ceiling for LLM-mediated search providers (anthropic, codex, gemini,
|
|
34
|
+
* perplexity, xai, openai-compatible). These legitimately take tens of
|
|
35
|
+
* seconds because a model performs the search and synthesizes an answer.
|
|
36
|
+
*/
|
|
37
|
+
export declare const SEARCH_LLM_TIMEOUT_MS = 120000;
|
|
38
|
+
/** Timeout class a provider declares for its outbound round-trips. */
|
|
39
|
+
export type SearchTimeoutClass = "api" | "llm";
|
|
28
40
|
/**
|
|
29
41
|
* Override the hard timeout applied to every web-search round-trip.
|
|
30
42
|
*
|
|
31
43
|
* @param ms - Hard timeout in milliseconds. Non-finite or non-positive
|
|
32
|
-
* values
|
|
44
|
+
* values clear the override so per-class defaults apply.
|
|
33
45
|
*/
|
|
34
46
|
export declare function setSearchHardTimeoutMs(ms: number | undefined): void;
|
|
47
|
+
/** Structural settings source for {@link applyConfiguredSearchTimeout}. */
|
|
48
|
+
export interface SearchTimeoutSettingSource {
|
|
49
|
+
get(path: "web_search.timeout"): unknown;
|
|
50
|
+
has(path: "web_search.timeout"): boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Install the `web_search.timeout` override from settings — but only when the
|
|
54
|
+
* user explicitly configured it. The settings schema ships a default value
|
|
55
|
+
* (300), and consuming that default via `get()` alone would reinstall a
|
|
56
|
+
* uniform 300s ceiling on every session, silently disabling the per-class
|
|
57
|
+
* timeout defaults. `has()` distinguishes loaded/overridden settings from
|
|
58
|
+
* schema defaults; unset clears any previous override so class defaults apply.
|
|
59
|
+
*/
|
|
60
|
+
export declare function applyConfiguredSearchTimeout(settings: SearchTimeoutSettingSource): void;
|
|
35
61
|
/**
|
|
36
62
|
* Compose a caller-supplied {@link AbortSignal} with a hard timeout so an
|
|
37
|
-
* outbound `fetch()` is guaranteed to settle
|
|
38
|
-
*
|
|
63
|
+
* outbound `fetch()` is guaranteed to settle even when the runtime fails to
|
|
64
|
+
* propagate cancellation to the underlying transport.
|
|
39
65
|
*
|
|
40
66
|
* Bun's WinHTTP backend on Windows is known to ignore `AbortSignal` once a
|
|
41
67
|
* TCP/TLS connection stalls (oven-sh/bun#15275, oven-sh/bun#18536); without
|
|
@@ -43,9 +69,12 @@ export declare function setSearchHardTimeoutMs(ms: number | undefined): void;
|
|
|
43
69
|
* because the user's Esc is never delivered to the native layer.
|
|
44
70
|
*
|
|
45
71
|
* @param signal - Caller cancellation signal, if any.
|
|
46
|
-
* @param
|
|
72
|
+
* @param msOrClass - Explicit timeout in milliseconds, or a
|
|
73
|
+
* {@link SearchTimeoutClass} resolved to its class default. Omitted falls
|
|
74
|
+
* back to the legacy {@link SEARCH_HARD_TIMEOUT_MS} ceiling. A user-set
|
|
75
|
+
* `web_search.timeout` overrides class defaults (but not explicit ms).
|
|
47
76
|
*/
|
|
48
|
-
export declare function withHardTimeout(signal: AbortSignal | undefined,
|
|
77
|
+
export declare function withHardTimeout(signal: AbortSignal | undefined, msOrClass?: number | SearchTimeoutClass): AbortSignal;
|
|
49
78
|
/**
|
|
50
79
|
* Map a provider's raw source list to the unified SearchSource shape,
|
|
51
80
|
* clamped to the requested result count and annotated with ageSeconds.
|
|
@@ -10,6 +10,7 @@ import type { SearchResponse } from "./types";
|
|
|
10
10
|
export interface SearchRenderDetails {
|
|
11
11
|
response: SearchResponse;
|
|
12
12
|
error?: string;
|
|
13
|
+
warning?: string;
|
|
13
14
|
}
|
|
14
15
|
/** Render web search result with tree-based layout */
|
|
15
16
|
export declare function renderSearchResult(result: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const WORKFLOW_INTENT_DIFF_CUSTOM_TYPE = "workflow-intent-diff";
|
|
2
|
+
export type WorkflowIntentRoute = "direct" | "deep-interview" | "ralplan" | "ultragoal" | "team";
|
|
3
|
+
export type DirectTrackingMode = "custom-entry-only" | "not-direct";
|
|
4
|
+
export type RootCausePhaseStatus = "active" | "inactive";
|
|
5
|
+
export interface WorkflowIntentDiff {
|
|
6
|
+
readonly version: 1;
|
|
7
|
+
readonly route: WorkflowIntentRoute;
|
|
8
|
+
readonly reason: string;
|
|
9
|
+
readonly directTracking: DirectTrackingMode;
|
|
10
|
+
readonly recommendedSkill?: Exclude<WorkflowIntentRoute, "direct">;
|
|
11
|
+
readonly recommendedInvocation?: string;
|
|
12
|
+
readonly triggers: readonly string[];
|
|
13
|
+
readonly rootCausePhase: {
|
|
14
|
+
readonly status: RootCausePhaseStatus;
|
|
15
|
+
readonly triggers: readonly string[];
|
|
16
|
+
};
|
|
17
|
+
readonly promptPreview: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function buildWorkflowIntentDiff(text: string): WorkflowIntentDiff | null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@sayknow-cli/coding-agent",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.7",
|
|
5
5
|
"description": "Sayknow-CLI CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://github.com/jaybeyond/Sayknow_CLI",
|
|
7
7
|
"author": "jaybeyond",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"check": "biome check . && bun run check:types",
|
|
36
36
|
"check:types": "tsgo -p tsconfig.json --noEmit",
|
|
37
37
|
"lint": "biome lint .",
|
|
38
|
-
"test": "bun test",
|
|
38
|
+
"test": "bun test --isolate",
|
|
39
39
|
"bench:context": "bun run bench/context-optimization.bench.ts",
|
|
40
40
|
"generate-schemas": "bun ../../scripts/generate-json-schemas.ts",
|
|
41
41
|
"check:schemas": "bun ../../scripts/generate-json-schemas.ts --check",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"@agentclientprotocol/sdk": "0.21.0",
|
|
53
53
|
"@babel/parser": "^7.29.3",
|
|
54
54
|
"@mozilla/readability": "^0.6.0",
|
|
55
|
-
"@sayknow-cli/stats": "0.3.
|
|
56
|
-
"@sayknow-cli/agent-core": "0.3.
|
|
57
|
-
"@sayknow-cli/ai": "0.3.
|
|
58
|
-
"@sayknow-cli/natives": "0.3.
|
|
59
|
-
"@sayknow-cli/tui": "0.3.
|
|
60
|
-
"@sayknow-cli/utils": "0.3.
|
|
55
|
+
"@sayknow-cli/stats": "0.3.7",
|
|
56
|
+
"@sayknow-cli/agent-core": "0.3.7",
|
|
57
|
+
"@sayknow-cli/ai": "0.3.7",
|
|
58
|
+
"@sayknow-cli/natives": "0.3.7",
|
|
59
|
+
"@sayknow-cli/tui": "0.3.7",
|
|
60
|
+
"@sayknow-cli/utils": "0.3.7",
|
|
61
61
|
"@puppeteer/browsers": "^2.13.0",
|
|
62
62
|
"@types/turndown": "5.0.6",
|
|
63
63
|
"@xterm/headless": "^6.0.0",
|
package/scripts/build-binary.ts
CHANGED
|
@@ -69,6 +69,9 @@ async function main(): Promise<void> {
|
|
|
69
69
|
// Hidden notify daemon CLI (loaded via dynamic import from notify-cli); list it
|
|
70
70
|
// explicitly so Bun standalone keeps `skc notify daemon-internal` usable.
|
|
71
71
|
"./src/notifications/telegram-daemon-cli.ts",
|
|
72
|
+
// Hidden Telegram Remote gateway entrypoint. `skc telegram start` self-spawns
|
|
73
|
+
// `skc telegram __gateway`, which dynamic-imports this bundled entry.
|
|
74
|
+
"../telegram-remote/src/index.ts",
|
|
72
75
|
"--outfile",
|
|
73
76
|
"dist/skc",
|
|
74
77
|
],
|
|
@@ -28,11 +28,6 @@ function fail(msg: string): void {
|
|
|
28
28
|
function walk(dir: string): string[] {
|
|
29
29
|
const out: string[] = [];
|
|
30
30
|
for (const entry of readdirSync(dir)) {
|
|
31
|
-
// node_modules holds locally-installed Phase 3 runtime deps (gitignored,
|
|
32
|
-
// never vendored and never packed by npm). Vendor checks apply only to
|
|
33
|
-
// vendored upstream source; third-party package files legitimately carry
|
|
34
|
-
// paths like ".../references/" that would otherwise false-positive.
|
|
35
|
-
if (entry === "node_modules") continue;
|
|
36
31
|
const full = join(dir, entry);
|
|
37
32
|
if (statSync(full).isDirectory()) out.push(...walk(full));
|
|
38
33
|
else out.push(full);
|
package/src/capability/mcp.ts
CHANGED
|
@@ -15,6 +15,8 @@ export interface MCPServer {
|
|
|
15
15
|
name: string;
|
|
16
16
|
/** Whether this server is enabled (default: true) */
|
|
17
17
|
enabled?: boolean;
|
|
18
|
+
/** Whether to connect automatically at session startup (default: true) */
|
|
19
|
+
autoload?: boolean;
|
|
18
20
|
/** Connection timeout in milliseconds */
|
|
19
21
|
timeout?: number;
|
|
20
22
|
/** Command to run (for stdio transport) */
|