@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.
Files changed (238) hide show
  1. package/README.md +76 -0
  2. package/dist/types/capability/mcp.d.ts +2 -0
  3. package/dist/types/cli/local-provider-smoke.d.ts +59 -0
  4. package/dist/types/cli/notify-cli.d.ts +1 -1
  5. package/dist/types/cli/telegram-cli.d.ts +13 -0
  6. package/dist/types/cli/update-cli.d.ts +24 -1
  7. package/dist/types/commands/local-provider.d.ts +34 -0
  8. package/dist/types/commands/telegram.d.ts +22 -0
  9. package/dist/types/config/keybindings.d.ts +12 -6
  10. package/dist/types/config/model-registry.d.ts +5 -0
  11. package/dist/types/config/models-config-schema.d.ts +5 -0
  12. package/dist/types/config/settings-schema.d.ts +284 -4
  13. package/dist/types/config/settings.d.ts +7 -0
  14. package/dist/types/config/telegram-autostart.d.ts +14 -0
  15. package/dist/types/config/telegram-env-bridge.d.ts +18 -0
  16. package/dist/types/coordinator-mcp/server.d.ts +8 -0
  17. package/dist/types/defaults/skc-defaults.d.ts +7 -0
  18. package/dist/types/discovery/cursor.d.ts +4 -1
  19. package/dist/types/discovery/index.d.ts +0 -1
  20. package/dist/types/discovery/windsurf.d.ts +3 -1
  21. package/dist/types/extensibility/extensions/types.d.ts +11 -0
  22. package/dist/types/i18n/messages/en.d.ts +1 -0
  23. package/dist/types/modes/components/custom-editor.d.ts +6 -1
  24. package/dist/types/modes/components/custom-model-preset-wizard.d.ts +1 -1
  25. package/dist/types/modes/components/hook-selector.d.ts +5 -0
  26. package/dist/types/modes/components/model-selector.d.ts +2 -0
  27. package/dist/types/modes/components/settings-selector.d.ts +5 -1
  28. package/dist/types/modes/components/skill-message.d.ts +1 -0
  29. package/dist/types/modes/components/status-line/types.d.ts +5 -7
  30. package/dist/types/modes/components/status-line.d.ts +15 -3
  31. package/dist/types/modes/components/two-column-body.d.ts +9 -0
  32. package/dist/types/modes/components/welcome.d.ts +9 -1
  33. package/dist/types/modes/controllers/command-controller.d.ts +1 -0
  34. package/dist/types/modes/controllers/input-controller.d.ts +6 -1
  35. package/dist/types/modes/controllers/selector-controller.d.ts +10 -1
  36. package/dist/types/modes/interactive-mode.d.ts +2 -0
  37. package/dist/types/modes/prompt-action-autocomplete.d.ts +3 -0
  38. package/dist/types/modes/rpc/rpc-types.d.ts +1 -0
  39. package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +41 -7
  40. package/dist/types/modes/slash-command-visibility.d.ts +1 -0
  41. package/dist/types/modes/theme/theme.d.ts +1 -1
  42. package/dist/types/modes/tmux-scroll.d.ts +18 -0
  43. package/dist/types/modes/types.d.ts +5 -1
  44. package/dist/types/modes/utils/terminal-bell.d.ts +3 -0
  45. package/dist/types/notifications/daemon-paths.d.ts +9 -0
  46. package/dist/types/notifications/html-format.d.ts +2 -0
  47. package/dist/types/notifications/recent-activity.d.ts +5 -1
  48. package/dist/types/notifications/telegram-daemon-cli.d.ts +21 -4
  49. package/dist/types/notifications/telegram-daemon-control.d.ts +8 -0
  50. package/dist/types/notifications/telegram-daemon.d.ts +4 -10
  51. package/dist/types/notifications/telegram-reference.d.ts +4 -0
  52. package/dist/types/notifications/threaded-render.d.ts +1 -0
  53. package/dist/types/runtime-mcp/config-writer.d.ts +9 -0
  54. package/dist/types/runtime-mcp/config.d.ts +2 -0
  55. package/dist/types/runtime-mcp/loader.d.ts +2 -0
  56. package/dist/types/runtime-mcp/manager.d.ts +2 -0
  57. package/dist/types/runtime-mcp/types.d.ts +6 -0
  58. package/dist/types/sdk.d.ts +1 -1
  59. package/dist/types/skc-runtime/launch-tmux.d.ts +2 -2
  60. package/dist/types/skc-runtime/ralplan-runtime.d.ts +3 -2
  61. package/dist/types/skc-runtime/restricted-role-agent-bash.d.ts +1 -0
  62. package/dist/types/skc-runtime/session-state-sidecar.d.ts +5 -0
  63. package/dist/types/skc-runtime/state-writer.d.ts +1 -0
  64. package/dist/types/skc-runtime/team-runtime.d.ts +1 -1
  65. package/dist/types/skc-runtime/tmux-common.d.ts +12 -0
  66. package/dist/types/skc-runtime/ultragoal-guard.d.ts +7 -1
  67. package/dist/types/skc-runtime/ultragoal-runtime.d.ts +0 -4
  68. package/dist/types/slash-commands/types.d.ts +2 -0
  69. package/dist/types/system-prompt.d.ts +7 -0
  70. package/dist/types/tools/skill.d.ts +1 -1
  71. package/dist/types/utils/cmux-workspace.d.ts +52 -0
  72. package/dist/types/web/search/index.d.ts +4 -2
  73. package/dist/types/web/search/provider.d.ts +14 -0
  74. package/dist/types/web/search/providers/utils.d.ts +42 -13
  75. package/dist/types/web/search/render.d.ts +1 -0
  76. package/dist/types/workflow/workflow-intent-diff.d.ts +19 -0
  77. package/package.json +8 -8
  78. package/scripts/build-binary.ts +3 -0
  79. package/scripts/verify-insane-vendor.ts +0 -5
  80. package/src/capability/mcp.ts +2 -0
  81. package/src/cli/local-provider-smoke.ts +632 -0
  82. package/src/cli/notify-cli.ts +4 -2
  83. package/src/cli/telegram-cli.ts +156 -0
  84. package/src/cli/update-cli.ts +179 -13
  85. package/src/cli/web-search-cli.ts +5 -7
  86. package/src/cli.ts +20 -1
  87. package/src/commands/launch.ts +47 -2
  88. package/src/commands/local-provider.ts +62 -0
  89. package/src/commands/notify.ts +1 -1
  90. package/src/commands/ralplan.ts +1 -0
  91. package/src/commands/telegram.ts +47 -0
  92. package/src/config/keybindings.ts +15 -6
  93. package/src/config/mcp-schema.json +4 -0
  94. package/src/config/model-registry.ts +55 -1
  95. package/src/config/models-config-schema.ts +9 -0
  96. package/src/config/settings-schema.ts +256 -4
  97. package/src/config/settings.ts +11 -0
  98. package/src/config/telegram-autostart.ts +107 -0
  99. package/src/config/telegram-env-bridge.ts +92 -0
  100. package/src/coordinator-mcp/server.ts +276 -34
  101. package/src/defaults/skc/skills/ralplan/SKILL.md +29 -20
  102. package/src/defaults/skc/skills/ultragoal/SKILL.md +37 -112
  103. package/src/defaults/skc-defaults.ts +16 -0
  104. package/src/discovery/builtin.ts +12 -0
  105. package/src/discovery/cursor.ts +5 -84
  106. package/src/discovery/gemini.ts +3 -89
  107. package/src/discovery/index.ts +4 -1
  108. package/src/discovery/mcp-json.ts +11 -0
  109. package/src/discovery/opencode.ts +5 -122
  110. package/src/discovery/windsurf.ts +4 -82
  111. package/src/edit/read-file.ts +9 -1
  112. package/src/extensibility/extensions/runner.ts +2 -1
  113. package/src/extensibility/extensions/types.ts +11 -0
  114. package/src/extensibility/skills.ts +30 -2
  115. package/src/hooks/skill-state.ts +33 -73
  116. package/src/i18n/messages/de.ts +1 -0
  117. package/src/i18n/messages/en.ts +1 -0
  118. package/src/i18n/messages/es.ts +1 -0
  119. package/src/i18n/messages/fr.ts +1 -0
  120. package/src/i18n/messages/ja.settings.ts +28 -0
  121. package/src/i18n/messages/ja.ts +1 -0
  122. package/src/i18n/messages/ko.settings.ts +28 -0
  123. package/src/i18n/messages/ko.ts +1 -0
  124. package/src/i18n/messages/zh.settings.ts +28 -0
  125. package/src/i18n/messages/zh.ts +1 -0
  126. package/src/internal-urls/docs-index.generated.ts +12 -7
  127. package/src/main.ts +5 -2
  128. package/src/migrate/executor.ts +23 -6
  129. package/src/modes/acp/acp-agent.ts +7 -6
  130. package/src/modes/components/agent-dashboard.ts +3 -35
  131. package/src/modes/components/custom-editor.ts +26 -0
  132. package/src/modes/components/custom-model-preset-wizard.ts +30 -189
  133. package/src/modes/components/extensions/extension-dashboard.ts +2 -48
  134. package/src/modes/components/hook-selector.ts +21 -3
  135. package/src/modes/components/model-selector.ts +246 -11
  136. package/src/modes/components/session-observer-overlay.ts +3 -3
  137. package/src/modes/components/session-selector.ts +19 -9
  138. package/src/modes/components/settings-selector.ts +551 -11
  139. package/src/modes/components/skill-message.ts +18 -10
  140. package/src/modes/components/status-line/presets.ts +11 -0
  141. package/src/modes/components/status-line/segments.ts +16 -19
  142. package/src/modes/components/status-line/types.ts +6 -2
  143. package/src/modes/components/status-line.ts +281 -117
  144. package/src/modes/components/tree-selector.ts +28 -8
  145. package/src/modes/components/two-column-body.ts +36 -0
  146. package/src/modes/components/welcome.ts +165 -30
  147. package/src/modes/controllers/command-controller.ts +26 -2
  148. package/src/modes/controllers/event-controller.ts +102 -4
  149. package/src/modes/controllers/extension-ui-controller.ts +21 -2
  150. package/src/modes/controllers/input-controller.ts +214 -47
  151. package/src/modes/controllers/selector-controller.ts +35 -33
  152. package/src/modes/interactive-mode.ts +36 -30
  153. package/src/modes/prompt-action-autocomplete.ts +48 -8
  154. package/src/modes/rpc/rpc-types.ts +1 -0
  155. package/src/modes/shared/agent-wire/deep-interview-gate.ts +72 -15
  156. package/src/modes/shared/agent-wire/workflow-gate-schema.ts +20 -0
  157. package/src/modes/slash-command-visibility.ts +9 -0
  158. package/src/modes/theme/theme.ts +5 -1
  159. package/src/modes/tmux-scroll.ts +92 -0
  160. package/src/modes/types.ts +8 -1
  161. package/src/modes/utils/hotkeys-markdown.ts +5 -2
  162. package/src/modes/utils/terminal-bell.ts +48 -0
  163. package/src/modes/utils/ui-helpers.ts +76 -3
  164. package/src/notifications/daemon-paths.ts +22 -0
  165. package/src/notifications/html-format.ts +75 -1
  166. package/src/notifications/index.ts +32 -2
  167. package/src/notifications/lifecycle-control-runtime.ts +12 -3
  168. package/src/notifications/recent-activity.ts +32 -8
  169. package/src/notifications/telegram-daemon-cli.ts +125 -13
  170. package/src/notifications/telegram-daemon-control.ts +9 -0
  171. package/src/notifications/telegram-daemon.ts +88 -46
  172. package/src/notifications/telegram-reference.ts +36 -14
  173. package/src/notifications/threaded-render.ts +14 -6
  174. package/src/prompts/agents/architect.md +7 -4
  175. package/src/prompts/agents/critic.md +15 -6
  176. package/src/prompts/agents/planner.md +8 -3
  177. package/src/prompts/system/system-prompt.md +20 -2
  178. package/src/prompts/tools/bash.md +1 -1
  179. package/src/runtime-mcp/config-writer.ts +28 -0
  180. package/src/runtime-mcp/config.ts +7 -0
  181. package/src/runtime-mcp/loader.ts +3 -0
  182. package/src/runtime-mcp/manager.ts +3 -0
  183. package/src/runtime-mcp/types.ts +6 -0
  184. package/src/sdk.ts +10 -11
  185. package/src/session/agent-session.ts +103 -13
  186. package/src/session/session-manager.ts +58 -18
  187. package/src/skc-runtime/launch-tmux.ts +34 -8
  188. package/src/skc-runtime/launch-worktree.ts +16 -2
  189. package/src/skc-runtime/ralplan-runtime.ts +22 -6
  190. package/src/skc-runtime/restricted-role-agent-bash.ts +1 -0
  191. package/src/skc-runtime/session-state-sidecar.ts +167 -24
  192. package/src/skc-runtime/state-runtime.ts +8 -5
  193. package/src/skc-runtime/state-writer.ts +5 -5
  194. package/src/skc-runtime/team-runtime.ts +21 -6
  195. package/src/skc-runtime/tmux-common.ts +16 -0
  196. package/src/skc-runtime/tmux-sessions.ts +13 -9
  197. package/src/skc-runtime/ultragoal-guard.ts +150 -24
  198. package/src/skc-runtime/ultragoal-runtime.ts +16 -124
  199. package/src/skc-runtime/workflow-manifest.generated.json +0 -8
  200. package/src/skc-runtime/workflow-manifest.ts +0 -1
  201. package/src/slash-commands/builtin-registry.ts +136 -23
  202. package/src/slash-commands/types.ts +2 -0
  203. package/src/system-prompt.ts +8 -0
  204. package/src/task/executor.ts +5 -0
  205. package/src/tools/ast-grep.ts +10 -7
  206. package/src/tools/bash.ts +39 -14
  207. package/src/tools/index.ts +8 -1
  208. package/src/tools/skill.ts +1 -1
  209. package/src/utils/cmux-workspace.ts +233 -0
  210. package/src/utils/title-generator.ts +2 -0
  211. package/src/web/kagi.ts +1 -1
  212. package/src/web/parallel.ts +2 -2
  213. package/src/web/search/index.ts +137 -52
  214. package/src/web/search/provider.ts +80 -0
  215. package/src/web/search/providers/anthropic.ts +1 -1
  216. package/src/web/search/providers/brave.ts +1 -1
  217. package/src/web/search/providers/codex.ts +1 -1
  218. package/src/web/search/providers/duckduckgo.ts +1 -1
  219. package/src/web/search/providers/exa.ts +1 -1
  220. package/src/web/search/providers/gemini.ts +7 -3
  221. package/src/web/search/providers/jina.ts +1 -1
  222. package/src/web/search/providers/kimi.ts +6 -1
  223. package/src/web/search/providers/openai-compatible.ts +1 -1
  224. package/src/web/search/providers/parallel.ts +1 -1
  225. package/src/web/search/providers/perplexity.ts +2 -2
  226. package/src/web/search/providers/searxng.ts +1 -1
  227. package/src/web/search/providers/synthetic.ts +1 -1
  228. package/src/web/search/providers/tavily.ts +1 -1
  229. package/src/web/search/providers/utils.ts +67 -17
  230. package/src/web/search/providers/xai.ts +1 -1
  231. package/src/web/search/providers/zai.ts +1 -1
  232. package/src/web/search/render.ts +3 -0
  233. package/src/workflow/workflow-intent-diff.ts +199 -0
  234. package/vendor/insane-search/MANIFEST.json +1 -3
  235. package/vendor/insane-search/engine/tests/test_u1.py +0 -28
  236. package/vendor/insane-search/engine/transport.py +2 -3
  237. package/vendor/insane-search/engine/validators.py +0 -14
  238. 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 {};
@@ -67,6 +67,7 @@ export type GuardedWriteResult = {
67
67
  path: string;
68
68
  written: true;
69
69
  revision: number;
70
+ stamped: unknown;
70
71
  } | {
71
72
  path: string;
72
73
  written: false;
@@ -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 isUltragoalAskBlocked(cwd: string): Promise<UltragoalAskBlockDiagnostic>;
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 = "discoverable";
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
- * Default hard ceiling for a single web-search round-trip. 300s tolerates
19
- * legitimate slow LLM-mediated responses (anthropic web_search_20250305,
20
- * perplexity, gemini, OpenAI code backend) while still guaranteeing the session unfreezes
21
- * if Bun's `AbortSignal` fails to propagate on Windows.
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 reset the timeout to {@link SEARCH_HARD_TIMEOUT_MS}.
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 within `ms` even when the
38
- * runtime fails to propagate cancellation to the underlying transport.
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 ms - Hard timeout in milliseconds. Defaults to the configured value.
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, ms?: number): AbortSignal;
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.5",
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.5",
56
- "@sayknow-cli/agent-core": "0.3.5",
57
- "@sayknow-cli/ai": "0.3.5",
58
- "@sayknow-cli/natives": "0.3.5",
59
- "@sayknow-cli/tui": "0.3.5",
60
- "@sayknow-cli/utils": "0.3.5",
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",
@@ -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);
@@ -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) */