@sayknow-cli/coding-agent 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/append-only-mode.d.ts +31 -0
- package/dist/types/capability/rule.d.ts +8 -0
- package/dist/types/cli/completion-cli.d.ts +41 -0
- package/dist/types/cli/config-cli.d.ts +1 -0
- package/dist/types/cli/fixture-report.d.ts +20 -0
- package/dist/types/cli/fixture-report.test.d.ts +1 -0
- package/dist/types/cli/nofile-limit.d.ts +11 -0
- package/dist/types/cli/notify-cli.d.ts +7 -0
- package/dist/types/cli/update-cli.d.ts +22 -0
- package/dist/types/cli.d.ts +124 -1
- package/dist/types/commands/completion.d.ts +29 -0
- package/dist/types/commands/config.d.ts +3 -0
- package/dist/types/commands/deep-interview.d.ts +3 -0
- package/dist/types/config/file-lock.d.ts +7 -6
- package/dist/types/config/keybindings.d.ts +2 -2
- package/dist/types/config/model-profile-activation.d.ts +6 -0
- package/dist/types/config/model-profiles.d.ts +1 -0
- package/dist/types/config/settings-schema.d.ts +119 -1
- package/dist/types/config/settings.d.ts +8 -0
- package/dist/types/discovery/index.d.ts +1 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/export/ttsr.d.ts +14 -3
- package/dist/types/extensibility/extensions/runner.d.ts +2 -1
- package/dist/types/extensibility/extensions/types.d.ts +8 -0
- package/dist/types/goals/runtime.d.ts +1 -0
- package/dist/types/hooks/native-skill-hook.d.ts +12 -0
- package/dist/types/main.d.ts +4 -1
- package/dist/types/modes/components/assistant-message.d.ts +5 -1
- package/dist/types/modes/components/model-selector.d.ts +4 -0
- package/dist/types/modes/components/queued-message-selector.d.ts +12 -0
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/status-line.d.ts +9 -0
- package/dist/types/modes/components/thinking-selector.d.ts +2 -2
- package/dist/types/modes/controllers/command-controller.d.ts +1 -0
- package/dist/types/modes/controllers/event-controller.d.ts +5 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -3
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +4 -0
- package/dist/types/modes/print-mode.d.ts +13 -1
- package/dist/types/modes/prompt-action-autocomplete.d.ts +1 -1
- package/dist/types/modes/rpc/rpc-mode.d.ts +1 -3
- package/dist/types/modes/rpc/rpc-socket-security.d.ts +3 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +14 -0
- package/dist/types/modes/shared/agent-wire/event-contract.d.ts +19 -0
- package/dist/types/modes/shared/agent-wire/event-envelope.d.ts +23 -1
- package/dist/types/modes/types.d.ts +3 -0
- package/dist/types/modes/utils/injected-user-submission.d.ts +52 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +1 -0
- package/dist/types/notifications/config-commands.d.ts +9 -0
- package/dist/types/notifications/config.d.ts +30 -1
- package/dist/types/notifications/daemon-paths.d.ts +1 -0
- package/dist/types/notifications/index.d.ts +8 -3
- package/dist/types/notifications/lifecycle-commands.d.ts +12 -3
- package/dist/types/notifications/lifecycle-control-runtime.d.ts +2 -1
- package/dist/types/notifications/reply-sent-store.d.ts +53 -0
- package/dist/types/notifications/rich-draft.d.ts +68 -0
- package/dist/types/notifications/rich-render.d.ts +90 -0
- package/dist/types/notifications/telegram-daemon.d.ts +45 -3
- package/dist/types/notifications/telegram-reference.d.ts +7 -5
- package/dist/types/notifications/threaded-render.d.ts +14 -0
- package/dist/types/runtime-api-key.d.ts +7 -0
- package/dist/types/sdk.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +61 -6
- package/dist/types/session/agent-storage.d.ts +1 -0
- package/dist/types/session/file-mention-pruning.d.ts +8 -0
- package/dist/types/session/messages.d.ts +4 -0
- package/dist/types/session/session-manager.d.ts +17 -1
- package/dist/types/skc-runtime/deep-interview-ambiguity.d.ts +39 -0
- package/dist/types/skc-runtime/deep-interview-recorder.d.ts +10 -1
- package/dist/types/skc-runtime/deep-interview-state.d.ts +17 -2
- package/dist/types/skc-runtime/session-state-sidecar.d.ts +7 -0
- package/dist/types/skc-runtime/state-writer.d.ts +3 -0
- package/dist/types/skc-runtime/tmux-common.d.ts +1 -0
- package/dist/types/skc-runtime/ultragoal-receipt-freshness.d.ts +42 -0
- package/dist/types/skc-runtime/ultragoal-runtime.d.ts +120 -13
- package/dist/types/skill-state/active-state.d.ts +18 -1
- package/dist/types/system-prompt.d.ts +18 -2
- package/dist/types/task/executor.d.ts +3 -0
- package/dist/types/task/fork-context-budget.d.ts +7 -0
- package/dist/types/task/token-log.d.ts +30 -0
- package/dist/types/task/token-log.test.d.ts +1 -0
- package/dist/types/tools/bisect.d.ts +81 -0
- package/dist/types/tools/computer.d.ts +2 -2
- package/dist/types/tools/index.d.ts +1 -0
- package/dist/types/tools/search.d.ts +2 -2
- package/dist/types/tools/ultragoal-ask-guard.d.ts +9 -2
- package/dist/types/utils/file-mentions.d.ts +14 -0
- package/dist/types/utils/git.d.ts +32 -0
- package/dist/types/utils/pasted-image-path.d.ts +30 -0
- package/dist/types/web/scrapers/youtube.d.ts +8 -0
- package/dist/types/workflow/workflow-intent-diff.d.ts +8 -2
- package/dist/types/workflow/workflow-intent-report-consumer.d.ts +50 -0
- package/dist/types/workflow/workflow-intent-report-schema.d.ts +2 -0
- package/dist/types/workflow/workflow-intent-report.d.ts +48 -0
- package/package.json +8 -8
- package/src/append-only-mode.ts +58 -0
- package/src/autoresearch/prompt.md +1 -1
- package/src/autoresearch/tools/log-experiment.ts +1 -1
- package/src/capability/rule.ts +9 -0
- package/src/cli/completion-cli.ts +234 -0
- package/src/cli/config-cli.ts +61 -9
- package/src/cli/fast-help.ts +1 -0
- package/src/cli/fixture-report.test.ts +230 -0
- package/src/cli/fixture-report.ts +171 -0
- package/src/cli/nofile-limit.ts +48 -0
- package/src/cli/notify-cli.ts +103 -17
- package/src/cli/telegram-cli.ts +1 -1
- package/src/cli/update-cli.ts +148 -33
- package/src/cli.ts +29 -1
- package/src/commands/completion.ts +84 -0
- package/src/commands/config.ts +2 -0
- package/src/commands/contribution-prep.ts +1 -1
- package/src/commands/deep-interview.ts +2 -1
- package/src/config/file-lock.ts +73 -34
- package/src/config/keybindings.ts +3 -3
- package/src/config/model-profile-activation.ts +65 -0
- package/src/config/model-profiles.ts +31 -2
- package/src/config/settings-schema.ts +76 -1
- package/src/config/settings.ts +22 -0
- package/src/defaults/skc/skills/team/SKILL.md +17 -14
- package/src/defaults/skc/skills/ultragoal/SKILL.md +59 -4
- package/src/defaults/skc/skills/ultragoal/pipeline-validation-contracts.md +30 -0
- package/src/defaults/skc-defaults.ts +9 -0
- package/src/discovery/helpers.ts +10 -0
- package/src/discovery/index.ts +1 -0
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +60 -2
- package/src/export/ttsr.ts +96 -18
- package/src/extensibility/extensions/runner.ts +183 -219
- package/src/extensibility/extensions/types.ts +9 -0
- package/src/extensibility/skc-plugins/runtime-adapters.ts +156 -44
- package/src/goals/runtime.ts +10 -2
- package/src/hindsight/backend.ts +1 -3
- package/src/hooks/native-skill-hook.ts +124 -4
- package/src/internal-urls/docs-index.generated.ts +17 -8
- package/src/lsp/client.ts +1 -0
- package/src/main.ts +95 -43
- package/src/memories/index.ts +12 -1
- package/src/modes/components/assistant-message.ts +241 -82
- package/src/modes/components/custom-editor.ts +1 -0
- package/src/modes/components/footer.ts +7 -2
- package/src/modes/components/model-selector.ts +54 -11
- package/src/modes/components/queued-message-selector.ts +92 -0
- package/src/modes/components/settings-selector.ts +4 -0
- package/src/modes/components/status-line.ts +167 -54
- package/src/modes/components/thinking-selector.ts +10 -8
- package/src/modes/components/tool-execution.ts +44 -19
- package/src/modes/components/welcome.ts +181 -44
- package/src/modes/controllers/command-controller.ts +40 -4
- package/src/modes/controllers/event-controller.ts +77 -49
- package/src/modes/controllers/extension-ui-controller.ts +12 -11
- package/src/modes/controllers/input-controller.ts +192 -35
- package/src/modes/controllers/selector-controller.ts +168 -24
- package/src/modes/interactive-mode.ts +56 -16
- package/src/modes/print-mode.ts +43 -4
- package/src/modes/prompt-action-autocomplete.ts +21 -20
- package/src/modes/rpc/rpc-mode.ts +32 -12
- package/src/modes/rpc/rpc-socket-security.ts +13 -1
- package/src/modes/rpc/rpc-types.ts +9 -0
- package/src/modes/shared/agent-wire/command-validation.ts +4 -0
- package/src/modes/shared/agent-wire/event-contract.ts +22 -0
- package/src/modes/shared/agent-wire/event-envelope.ts +82 -0
- package/src/modes/shared/agent-wire/scopes.ts +1 -0
- package/src/modes/types.ts +3 -0
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/modes/utils/injected-user-submission.ts +94 -0
- package/src/modes/utils/ui-helpers.ts +20 -7
- package/src/notifications/config-commands.ts +20 -0
- package/src/notifications/config.ts +52 -5
- package/src/notifications/daemon-paths.ts +2 -0
- package/src/notifications/index.ts +144 -18
- package/src/notifications/lifecycle-commands.ts +74 -23
- package/src/notifications/lifecycle-control-runtime.ts +8 -3
- package/src/notifications/lifecycle-orchestrator.ts +19 -6
- package/src/notifications/reply-sent-store.ts +134 -0
- package/src/notifications/rich-draft.ts +107 -0
- package/src/notifications/rich-render.ts +142 -0
- package/src/notifications/telegram-daemon-control.ts +5 -3
- package/src/notifications/telegram-daemon.ts +606 -98
- package/src/notifications/telegram-reference.ts +17 -16
- package/src/notifications/threaded-render.ts +45 -2
- package/src/prompts/agents/architect.md +19 -10
- package/src/prompts/agents/critic.md +16 -18
- package/src/prompts/agents/executor.md +14 -11
- package/src/prompts/agents/planner.md +18 -13
- package/src/prompts/ci-green-request.md +3 -8
- package/src/prompts/goals/goal-continuation.md +0 -5
- package/src/prompts/goals/goal-mode-active.md +0 -5
- package/src/prompts/system/agent-creation-architect.md +2 -2
- package/src/prompts/system/plan-mode-active.md +1 -1
- package/src/prompts/system/plan-mode-subagent.md +3 -3
- package/src/prompts/system/project-prompt.md +0 -13
- package/src/prompts/system/subagent-system-prompt.md +3 -2
- package/src/prompts/system/system-prompt.md +29 -17
- package/src/prompts/system/volatile-project-context.md +10 -0
- package/src/prompts/system/web-search.md +4 -7
- package/src/prompts/tools/apply-patch.md +6 -0
- package/src/prompts/tools/ast-edit.md +1 -0
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/bisect.md +22 -0
- package/src/prompts/tools/browser.md +1 -1
- package/src/prompts/tools/computer.md +2 -2
- package/src/prompts/tools/cron.md +0 -2
- package/src/prompts/tools/eval.md +2 -2
- package/src/prompts/tools/find.md +1 -1
- package/src/prompts/tools/github.md +6 -6
- package/src/prompts/tools/goal.md +1 -3
- package/src/prompts/tools/image-gen.md +12 -5
- package/src/prompts/tools/irc.md +5 -4
- package/src/prompts/tools/job.md +2 -2
- package/src/prompts/tools/lsp.md +1 -1
- package/src/prompts/tools/monitor.md +2 -2
- package/src/prompts/tools/patch.md +2 -2
- package/src/prompts/tools/replace.md +2 -21
- package/src/prompts/tools/rewind.md +1 -1
- package/src/prompts/tools/search-tool-bm25.md +6 -11
- package/src/prompts/tools/search.md +1 -1
- package/src/prompts/tools/skill.md +3 -2
- package/src/prompts/tools/ssh.md +2 -1
- package/src/prompts/tools/subagent.md +2 -2
- package/src/prompts/tools/task.md +4 -5
- package/src/prompts/tools/todo-write.md +1 -1
- package/src/prompts/tools/vim.md +1 -0
- package/src/prompts/tools/web-search.md +2 -0
- package/src/prompts/tools/write.md +8 -2
- package/src/runtime-api-key.ts +16 -0
- package/src/sdk.ts +88 -36
- package/src/session/agent-session.ts +1013 -141
- package/src/session/agent-storage.ts +4 -0
- package/src/session/file-mention-pruning.ts +64 -0
- package/src/session/messages.ts +4 -0
- package/src/session/session-manager.ts +103 -4
- package/src/skc-runtime/deep-interview-ambiguity.ts +206 -0
- package/src/skc-runtime/deep-interview-recorder.ts +62 -8
- package/src/skc-runtime/deep-interview-state.ts +44 -2
- package/src/skc-runtime/session-state-sidecar.ts +263 -20
- package/src/skc-runtime/state-runtime.ts +12 -2
- package/src/skc-runtime/state-writer.ts +15 -0
- package/src/skc-runtime/tmux-common.ts +1 -0
- package/src/skc-runtime/ultragoal-guard.ts +55 -66
- package/src/skc-runtime/ultragoal-receipt-freshness.ts +315 -0
- package/src/skc-runtime/ultragoal-runtime.ts +1672 -159
- package/src/skc-runtime/workflow-manifest.generated.json +113 -2
- package/src/skc-runtime/workflow-manifest.ts +74 -1
- package/src/skill-state/active-state.ts +141 -5
- package/src/skill-state/deep-interview-mutation-guard.ts +67 -3
- package/src/slash-commands/builtin-registry.ts +296 -72
- package/src/system-prompt.ts +57 -16
- package/src/task/executor.ts +132 -24
- package/src/task/fork-context-advisory.ts +2 -7
- package/src/task/fork-context-budget.ts +9 -0
- package/src/task/index.ts +13 -6
- package/src/task/output-manager.ts +20 -8
- package/src/task/receipt.ts +26 -7
- package/src/task/token-log.test.ts +188 -0
- package/src/task/token-log.ts +179 -0
- package/src/tools/bisect.ts +367 -0
- package/src/tools/computer.ts +246 -43
- package/src/tools/index.ts +3 -0
- package/src/tools/output-meta.ts +116 -4
- package/src/tools/search.ts +8 -2
- package/src/tools/skill.ts +15 -0
- package/src/tools/telegram-send.ts +6 -0
- package/src/tools/ultragoal-ask-guard.ts +39 -5
- package/src/utils/file-mentions.ts +39 -7
- package/src/utils/git.ts +73 -0
- package/src/utils/pasted-image-path.ts +170 -0
- package/src/web/scrapers/youtube.ts +24 -12
- package/src/workflow/workflow-intent-diff.ts +29 -6
- package/src/workflow/workflow-intent-report-consumer.ts +221 -0
- package/src/workflow/workflow-intent-report-schema.ts +129 -0
- package/src/workflow/workflow-intent-report.ts +135 -0
|
@@ -11,9 +11,16 @@ export interface TtsrMatchContext {
|
|
|
11
11
|
/** Stable key to isolate buffering (for example a tool call ID). */
|
|
12
12
|
streamKey?: string;
|
|
13
13
|
}
|
|
14
|
+
/** Tracks when a rule was last injected (for repeat gating). */
|
|
15
|
+
export interface TtsrInjectionRecord {
|
|
16
|
+
name: string;
|
|
17
|
+
lastInjectedAt: number;
|
|
18
|
+
repeatMode?: "once" | "after-gap";
|
|
19
|
+
repeatGap?: number;
|
|
20
|
+
}
|
|
14
21
|
export declare class TtsrManager {
|
|
15
22
|
#private;
|
|
16
|
-
constructor(settings?: TtsrSettings);
|
|
23
|
+
constructor(settings?: Partial<TtsrSettings>);
|
|
17
24
|
/** Add a TTSR rule to be monitored. */
|
|
18
25
|
addRule(rule: Rule): boolean;
|
|
19
26
|
/**
|
|
@@ -29,8 +36,10 @@ export declare class TtsrManager {
|
|
|
29
36
|
markInjectedByNames(ruleNames: string[]): void;
|
|
30
37
|
/** Get names of all injected rules (for persistence). */
|
|
31
38
|
getInjectedRuleNames(): string[];
|
|
32
|
-
/**
|
|
33
|
-
|
|
39
|
+
/** Get full injected rule records (for persistence). */
|
|
40
|
+
getInjectedRecords(): TtsrInjectionRecord[];
|
|
41
|
+
/** Restore injected state from legacy rule names or persisted records. */
|
|
42
|
+
restoreInjected(records: string[] | TtsrInjectionRecord[]): void;
|
|
34
43
|
/** Reset stream buffers (called on new turn). */
|
|
35
44
|
resetBuffer(): void;
|
|
36
45
|
/** Check if any TTSR rules are registered. */
|
|
@@ -39,6 +48,8 @@ export declare class TtsrManager {
|
|
|
39
48
|
incrementMessageCount(): void;
|
|
40
49
|
/** Get current message count. */
|
|
41
50
|
getMessageCount(): number;
|
|
51
|
+
/** Restore message counter after session resume. */
|
|
52
|
+
restoreMessageCount(messageCount: number): void;
|
|
42
53
|
/** Get settings. */
|
|
43
54
|
getSettings(): Required<TtsrSettings>;
|
|
44
55
|
}
|
|
@@ -61,7 +61,8 @@ export declare class ExtensionRunner {
|
|
|
61
61
|
private readonly cwd;
|
|
62
62
|
private readonly sessionManager;
|
|
63
63
|
private readonly modelRegistry;
|
|
64
|
-
|
|
64
|
+
private readonly sessionMetadata?;
|
|
65
|
+
constructor(extensions: Extension[], runtime: ExtensionRuntime, cwd: string, sessionManager: SessionManager, modelRegistry: ModelRegistry, sessionMetadata?: ExtensionContext["sessionMetadata"]);
|
|
65
66
|
initialize(actions: ExtensionActions, contextActions: ExtensionContextActions, commandContextActions?: ExtensionCommandContextActions, uiContext?: ExtensionUIContext): void;
|
|
66
67
|
/**
|
|
67
68
|
* Forward a `credential_disabled` event from `AuthStorage` to extension handlers.
|
|
@@ -186,6 +186,12 @@ export interface CompactOptions {
|
|
|
186
186
|
onComplete?: (result: CompactionResult) => void;
|
|
187
187
|
onError?: (error: Error) => void;
|
|
188
188
|
}
|
|
189
|
+
export interface ExtensionSessionMetadata {
|
|
190
|
+
kind: "main" | "sub";
|
|
191
|
+
taskDepth: number;
|
|
192
|
+
parentTaskPrefix?: string;
|
|
193
|
+
currentAgentType?: string;
|
|
194
|
+
}
|
|
189
195
|
/**
|
|
190
196
|
* Context passed to extension event handlers.
|
|
191
197
|
*/
|
|
@@ -202,6 +208,8 @@ export interface ExtensionContext {
|
|
|
202
208
|
cwd: string;
|
|
203
209
|
/** Session manager (read-only) */
|
|
204
210
|
sessionManager: ReadonlySessionManager;
|
|
211
|
+
/** Session classification supplied by the SDK for extension policy decisions. */
|
|
212
|
+
sessionMetadata?: ExtensionSessionMetadata;
|
|
205
213
|
/** Model registry for API key resolution */
|
|
206
214
|
modelRegistry: ModelRegistry;
|
|
207
215
|
/** Current model (may be undefined) */
|
|
@@ -35,6 +35,7 @@ export declare class GoalRuntime {
|
|
|
35
35
|
#private;
|
|
36
36
|
constructor(host: GoalRuntimeHost);
|
|
37
37
|
get snapshot(): GoalRuntimeSnapshot;
|
|
38
|
+
shouldTrackTurnBaseline(): boolean;
|
|
38
39
|
onTurnStart(turnId: string, baselineUsage: GoalTokenUsage): void;
|
|
39
40
|
onToolCompleted(toolName: string): Promise<void>;
|
|
40
41
|
onGoalToolCompleted(): Promise<void>;
|
|
@@ -11,6 +11,18 @@ interface SkcNativeHookDispatchOptions {
|
|
|
11
11
|
effectiveSkillConfig?: EffectiveSkillConfigInput;
|
|
12
12
|
configPaths?: string[];
|
|
13
13
|
}
|
|
14
|
+
export declare function clearSkcNativeSkillHookCachesForTesting(): void;
|
|
15
|
+
export declare function getSkcNativeSkillHookCacheStatsForTesting(): {
|
|
16
|
+
effectiveSkillConfigResolutions: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function resolveSkcNativeSkillConfigForTesting(input: {
|
|
19
|
+
cwd: string;
|
|
20
|
+
configPaths?: string[];
|
|
21
|
+
sessionId?: string;
|
|
22
|
+
threadId?: string;
|
|
23
|
+
stateDir?: string;
|
|
24
|
+
}): Promise<EffectiveSkillConfigInput>;
|
|
14
25
|
export declare function dispatchSkcNativeSkillHook(payload: HookPayload, options?: SkcNativeHookDispatchOptions): Promise<SkcNativeHookDispatchResult>;
|
|
26
|
+
export declare function runSkcNativeSkillHookInProcess(payload: HookPayload): Promise<string>;
|
|
15
27
|
export declare function runSkcNativeSkillHookCli(): Promise<void>;
|
|
16
28
|
export {};
|
package/dist/types/main.d.ts
CHANGED
|
@@ -18,6 +18,9 @@ export interface InteractiveModeNotify {
|
|
|
18
18
|
message: string;
|
|
19
19
|
}
|
|
20
20
|
export declare function submitInteractiveInput(mode: Pick<InteractiveMode, "markPendingSubmissionStarted" | "finishPendingSubmission" | "showError" | "checkShutdownRequested">, session: Pick<AgentSession, "prompt" | "promptCustomMessage">, input: SubmittedUserInput): Promise<void>;
|
|
21
|
+
type CreateSessionForMain = (options: CreateAgentSessionOptions, context?: {
|
|
22
|
+
skipPostCreateModelRefresh?: boolean;
|
|
23
|
+
}) => Promise<CreateAgentSessionResult>;
|
|
21
24
|
type AcpSessionFactory = (cwd: string) => Promise<AgentSession>;
|
|
22
25
|
export interface AcpSessionFactoryOptions {
|
|
23
26
|
baseOptions: CreateAgentSessionOptions;
|
|
@@ -27,7 +30,7 @@ export interface AcpSessionFactoryOptions {
|
|
|
27
30
|
modelRegistry: ModelRegistry;
|
|
28
31
|
parsedArgs: Pick<Args, "apiKey" | "default" | "model" | "mpreset" | "thinking">;
|
|
29
32
|
rawArgs: string[];
|
|
30
|
-
createSession:
|
|
33
|
+
createSession: CreateSessionForMain;
|
|
31
34
|
}
|
|
32
35
|
export declare function applyStartupModelProfiles(args: {
|
|
33
36
|
session: AgentSession;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { AssistantMessage, ImageContent, Usage } from "@sayknow-cli/ai";
|
|
2
2
|
import { Container } from "@sayknow-cli/tui";
|
|
3
|
+
interface AssistantMessageUpdateOptions {
|
|
4
|
+
streaming?: boolean;
|
|
5
|
+
}
|
|
3
6
|
/**
|
|
4
7
|
* Component that renders a complete assistant message
|
|
5
8
|
*/
|
|
@@ -12,5 +15,6 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
12
15
|
setHideThinkingBlock(hide: boolean): void;
|
|
13
16
|
setToolResultImages(toolCallId: string, images: ImageContent[]): void;
|
|
14
17
|
setUsageInfo(usage: Usage): void;
|
|
15
|
-
updateContent(message: AssistantMessage): void;
|
|
18
|
+
updateContent(message: AssistantMessage, options?: AssistantMessageUpdateOptions): void;
|
|
16
19
|
}
|
|
20
|
+
export {};
|
|
@@ -10,6 +10,7 @@ export type ModelSelectorSelection = {
|
|
|
10
10
|
kind: "assignment";
|
|
11
11
|
model: Model;
|
|
12
12
|
role: SkcModelAssignmentTargetId | null;
|
|
13
|
+
roles?: readonly SkcModelAssignmentTargetId[];
|
|
13
14
|
thinkingLevel?: ThinkingLevel;
|
|
14
15
|
selector?: string;
|
|
15
16
|
} | {
|
|
@@ -52,5 +53,8 @@ export declare class ModelSelectorComponent extends Container {
|
|
|
52
53
|
handleInput(keyData: string): void;
|
|
53
54
|
getSearchInput(): Input;
|
|
54
55
|
__testSelectProfile(profileName: string, setDefault: boolean): Promise<void>;
|
|
56
|
+
__testSelectAssignment(selection: Omit<Extract<ModelSelectorSelection, {
|
|
57
|
+
kind: "assignment";
|
|
58
|
+
}>, "kind">): Promise<void>;
|
|
55
59
|
}
|
|
56
60
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Container, SelectList } from "@sayknow-cli/tui";
|
|
2
|
+
import type { QueuedMessageEditEntry } from "../../session/agent-session";
|
|
3
|
+
type QueuedMessageMoveDirection = "up" | "down";
|
|
4
|
+
export type { QueuedMessageMoveDirection };
|
|
5
|
+
export declare class QueuedMessageSelectorComponent extends Container {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(entries: QueuedMessageEditEntry[], onSelect: (entry: QueuedMessageEditEntry) => void, onDelete: (entry: QueuedMessageEditEntry, selectedIndex: number) => void, onMove: (entry: QueuedMessageEditEntry, selectedIndex: number, direction: QueuedMessageMoveDirection) => void, onCancel: () => void, options?: {
|
|
8
|
+
selectedIndex?: number;
|
|
9
|
+
});
|
|
10
|
+
handleInput(keyData: string): void;
|
|
11
|
+
getSelectList(): SelectList;
|
|
12
|
+
}
|
|
@@ -16,6 +16,8 @@ export interface SettingsRuntimeContext {
|
|
|
16
16
|
thinkingLevel: ThinkingLevel | undefined;
|
|
17
17
|
/** Available themes */
|
|
18
18
|
availableThemes: string[];
|
|
19
|
+
/** Available model profile names (from the model registry) */
|
|
20
|
+
availableModelProfiles: string[];
|
|
19
21
|
/** Working directory for plugins tab */
|
|
20
22
|
cwd: string;
|
|
21
23
|
}
|
|
@@ -90,5 +90,14 @@ export declare class StatusLineComponent implements Component {
|
|
|
90
90
|
* everything fits on one row.
|
|
91
91
|
*/
|
|
92
92
|
getPreviewContent(width: number): string;
|
|
93
|
+
getCacheStatsForTest(): {
|
|
94
|
+
rowHits: number;
|
|
95
|
+
rowMisses: number;
|
|
96
|
+
};
|
|
97
|
+
invalidateBranchForTest(): void;
|
|
98
|
+
setCachedPrForTest(pr: {
|
|
99
|
+
number: number;
|
|
100
|
+
url: string;
|
|
101
|
+
} | null): void;
|
|
93
102
|
render(width: number): string[];
|
|
94
103
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ThinkingLevel as ThinkingLevelValue } from "@sayknow-cli/agent-core";
|
|
2
2
|
import { Container, SelectList } from "@sayknow-cli/tui";
|
|
3
3
|
/**
|
|
4
4
|
* Component that renders a thinking level selector with borders
|
|
5
5
|
*/
|
|
6
6
|
export declare class ThinkingSelectorComponent extends Container {
|
|
7
7
|
#private;
|
|
8
|
-
constructor(currentLevel:
|
|
8
|
+
constructor(currentLevel: ThinkingLevelValue | undefined, availableLevels: ThinkingLevelValue[], onSelect: (level: ThinkingLevelValue) => void, onCancel: () => void);
|
|
9
9
|
getSelectList(): SelectList;
|
|
10
10
|
}
|
|
@@ -23,6 +23,7 @@ export declare class CommandController {
|
|
|
23
23
|
handleContextCommand(): void;
|
|
24
24
|
handleMemoryCommand(text: string): Promise<void>;
|
|
25
25
|
handleClearCommand(): Promise<void>;
|
|
26
|
+
handleContextClearCommand(): Promise<void>;
|
|
26
27
|
handleDropCommand(): Promise<void>;
|
|
27
28
|
handleForkCommand(): Promise<void>;
|
|
28
29
|
handleMoveCommand(targetPath: string): Promise<void>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { InteractiveModeContext } from "../../modes/types";
|
|
2
2
|
import type { AgentSessionEvent } from "../../session/agent-session";
|
|
3
|
+
/** Test-only performance counters for advisory baseline tests. */
|
|
4
|
+
export declare const __eventControllerPerfCounters: {
|
|
5
|
+
messageUpdateContentVisits: number;
|
|
6
|
+
reset(): void;
|
|
7
|
+
};
|
|
3
8
|
export declare class EventController {
|
|
4
9
|
#private;
|
|
5
10
|
private ctx;
|
|
@@ -14,9 +14,7 @@ export declare class InputController {
|
|
|
14
14
|
handleFollowUp(): Promise<void>;
|
|
15
15
|
/** Send editor text explicitly as a queued next-turn message. */
|
|
16
16
|
handleQueueSubmit(): Promise<void>;
|
|
17
|
-
restoreLatestQueuedMessageToEditor(
|
|
18
|
-
currentText?: string;
|
|
19
|
-
}): number;
|
|
17
|
+
restoreLatestQueuedMessageToEditor(): number;
|
|
20
18
|
restoreQueuedMessagesToEditor(options?: {
|
|
21
19
|
abort?: boolean;
|
|
22
20
|
currentText?: string;
|
|
@@ -26,6 +26,7 @@ export declare class SelectorController {
|
|
|
26
26
|
showProviderOnboarding(): void;
|
|
27
27
|
showCustomModelPresetWizard(snapshot: ModelProfileConfig): void;
|
|
28
28
|
showCustomProviderWizard(): void;
|
|
29
|
+
showEffortSelector(): void;
|
|
29
30
|
showSettingsSelector(): void;
|
|
30
31
|
showThemeSelector(): void;
|
|
31
32
|
showHistorySearch(): void;
|
|
@@ -27,6 +27,7 @@ import { type WelcomeLogoMode } from "./components/welcome";
|
|
|
27
27
|
import { OAuthManualInputManager } from "./oauth-manual-input";
|
|
28
28
|
import type { Theme } from "./theme/theme";
|
|
29
29
|
import type { CompactionQueuedMessage, InteractiveModeContext, SubmittedUserInput, TodoItem, TodoPhase } from "./types";
|
|
30
|
+
export declare const DEFAULT_COMPOSER_PLACEHOLDER: string;
|
|
30
31
|
export type WelcomeBannerSettingMode = "auto" | "unicode" | "square" | "ascii";
|
|
31
32
|
export declare function resolveWelcomeLogoMode(mode: WelcomeBannerSettingMode, env?: Record<string, string | undefined>, platform?: NodeJS.Platform): WelcomeLogoMode;
|
|
32
33
|
/** Options for creating an InteractiveMode instance (for future API use) */
|
|
@@ -95,6 +96,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
95
96
|
onInputCallback?: (input: SubmittedUserInput) => void;
|
|
96
97
|
optimisticUserMessageSignature: string | undefined;
|
|
97
98
|
locallySubmittedUserSignatures: Set<string>;
|
|
99
|
+
optimisticInjectedSignatures: Map<string, number>;
|
|
98
100
|
lastSigintTime: number;
|
|
99
101
|
lastEscapeTime: number;
|
|
100
102
|
lastComposerClearEscapeTime: number;
|
|
@@ -189,6 +191,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
189
191
|
handleToolsCommand(): void;
|
|
190
192
|
handleContextCommand(): void;
|
|
191
193
|
handleClearCommand(): Promise<void>;
|
|
194
|
+
handleContextClearCommand(): Promise<void>;
|
|
192
195
|
handleDropCommand(): Promise<void>;
|
|
193
196
|
handleForkCommand(): Promise<void>;
|
|
194
197
|
handleMoveCommand(targetPath: string): Promise<void>;
|
|
@@ -216,6 +219,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
216
219
|
showModelSelector(options?: {
|
|
217
220
|
temporaryOnly?: boolean;
|
|
218
221
|
}): void;
|
|
222
|
+
showEffortSelector(): void;
|
|
219
223
|
showProviderOnboarding(): void;
|
|
220
224
|
showPluginSelector(mode?: "install" | "uninstall"): void;
|
|
221
225
|
showUserMessageSelector(): void;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* - `skc -p "prompt"` - text output
|
|
6
6
|
* - `skc --mode json "prompt"` - JSON event stream
|
|
7
7
|
*/
|
|
8
|
-
import type
|
|
8
|
+
import { type ImageContent } from "@sayknow-cli/ai";
|
|
9
9
|
import type { AgentSession } from "../session/agent-session";
|
|
10
10
|
/**
|
|
11
11
|
* Options for print mode.
|
|
@@ -26,6 +26,18 @@ export interface PrintModeOptions {
|
|
|
26
26
|
*/
|
|
27
27
|
suppressProcessExit?: boolean;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Exit code used when a non-interactive **text-mode** run (`skc -p`) terminates
|
|
31
|
+
* because the model context window is exhausted and automatic compaction could
|
|
32
|
+
* not bring the request under the limit. Distinct from the generic failure code
|
|
33
|
+
* (1) so text-mode callers can detect context exhaustion specifically instead of
|
|
34
|
+
* parsing the raw provider error string.
|
|
35
|
+
*
|
|
36
|
+
* Scope: text-mode final-response path only. JSON mode (`--mode json`) streams
|
|
37
|
+
* events from the subscription and does not run this terminal-error branch, so
|
|
38
|
+
* it is intentionally NOT covered by this exit code.
|
|
39
|
+
*/
|
|
40
|
+
export declare const CONTEXT_OVERFLOW_EXIT_CODE = 2;
|
|
29
41
|
/**
|
|
30
42
|
* Run in print (single-shot) mode.
|
|
31
43
|
* Sends prompts to the agent and outputs the result.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AutocompleteItem, type AutocompleteProvider, type SlashCommand } from "@sayknow-cli/tui";
|
|
2
2
|
import type { KeybindingsManager } from "../config/keybindings";
|
|
3
3
|
interface PromptActionDefinition {
|
|
4
4
|
id: string;
|
|
@@ -64,9 +64,7 @@ export declare function isFastLaneRpcCommand(type: RpcCommand["type"]): boolean;
|
|
|
64
64
|
export declare function createRpcCommandScheduler(run: (command: RpcCommand) => Promise<void>, track: (task: Promise<void>) => void): {
|
|
65
65
|
dispatch: (command: RpcCommand) => void;
|
|
66
66
|
};
|
|
67
|
-
export
|
|
68
|
-
constructor(socketPath: string);
|
|
69
|
-
}
|
|
67
|
+
export { RpcListenRefusedError } from "./rpc-socket-security";
|
|
70
68
|
/**
|
|
71
69
|
* Probe whether a unix-domain socket path has a live server accepting
|
|
72
70
|
* connections. Returns `true` when a connection succeeds (a previous owner is
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare class RpcSocketSecurityError extends Error {
|
|
2
2
|
constructor(message: string);
|
|
3
3
|
}
|
|
4
|
+
export declare class RpcListenRefusedError extends Error {
|
|
5
|
+
constructor(socketPath: string);
|
|
6
|
+
}
|
|
4
7
|
export declare function prepareRpcSocketPath(socketPath: string): Promise<void>;
|
|
5
8
|
export declare function assertSafeClientSocket(socketPath: string): Promise<void>;
|
|
6
9
|
export declare function verifyRpcSocketAfterListen(socketPath: string): Promise<void>;
|
|
@@ -12,6 +12,7 @@ import type { ContextUsage } from "../../extensibility/extensions/types";
|
|
|
12
12
|
import type { SessionStats } from "../../session/agent-session";
|
|
13
13
|
import type { TodoPhase } from "../../tools/todo-write";
|
|
14
14
|
export type RpcGetStateInclude = "tools" | "dumpTools" | "systemPrompt";
|
|
15
|
+
export type RpcCapability = "compact_message_update";
|
|
15
16
|
export type RpcCommand = {
|
|
16
17
|
id?: string;
|
|
17
18
|
type: "prompt";
|
|
@@ -59,6 +60,10 @@ export type RpcCommand = {
|
|
|
59
60
|
} | {
|
|
60
61
|
id?: string;
|
|
61
62
|
type: "get_pending_workflow_gates";
|
|
63
|
+
} | {
|
|
64
|
+
id?: string;
|
|
65
|
+
type: "set_capabilities";
|
|
66
|
+
capabilities: RpcCapability[];
|
|
62
67
|
} | {
|
|
63
68
|
id?: string;
|
|
64
69
|
type: "set_model";
|
|
@@ -258,6 +263,15 @@ export type RpcResponse = {
|
|
|
258
263
|
data: {
|
|
259
264
|
gates: RpcWorkflowGate[];
|
|
260
265
|
};
|
|
266
|
+
} | {
|
|
267
|
+
id?: string;
|
|
268
|
+
type: "response";
|
|
269
|
+
command: "set_capabilities";
|
|
270
|
+
success: true;
|
|
271
|
+
data: {
|
|
272
|
+
acceptedCapabilities: RpcCapability[];
|
|
273
|
+
unsupported: string[];
|
|
274
|
+
};
|
|
261
275
|
} | {
|
|
262
276
|
id?: string;
|
|
263
277
|
type: "response";
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* an `AgentSessionEvent` variant fails typecheck until it is registered, and so
|
|
14
14
|
* conformance tests can assert fixture coverage equals the registry exactly.
|
|
15
15
|
*/
|
|
16
|
+
import type { AssistantMessageEvent } from "@sayknow-cli/ai";
|
|
16
17
|
import type { AgentSessionEvent } from "../../../session/agent-session";
|
|
17
18
|
/** Wire protocol version. Bump on breaking envelope/semantic changes. */
|
|
18
19
|
export declare const AGENT_WIRE_PROTOCOL_VERSION: 2;
|
|
@@ -29,6 +30,23 @@ export interface AgentWireEventPayload {
|
|
|
29
30
|
event_type: AgentWireEventType;
|
|
30
31
|
event: AgentSessionEvent;
|
|
31
32
|
}
|
|
33
|
+
export type AgentWireCompactAssistantMessageEvent = AssistantMessageEvent extends infer TEvent ? TEvent extends {
|
|
34
|
+
type: string;
|
|
35
|
+
} ? Omit<TEvent, "partial" | "message" | "error"> : never : never;
|
|
36
|
+
export interface AgentWireCompactMessageUpdatePayload {
|
|
37
|
+
event_type: "message_update";
|
|
38
|
+
/** Compact RPC opt-in payload: delta-only update plus minimal routing metadata. */
|
|
39
|
+
compact: true;
|
|
40
|
+
message_id: string | null;
|
|
41
|
+
content_index: number | null;
|
|
42
|
+
assistantMessageEvent: AgentWireCompactAssistantMessageEvent;
|
|
43
|
+
/** Full message checkpoint, snapshotted synchronously when this frame is enqueued. */
|
|
44
|
+
checkpoint_message?: Extract<AgentSessionEvent, {
|
|
45
|
+
type: "message_update";
|
|
46
|
+
}>["message"];
|
|
47
|
+
checkpoint_reason?: "periodic";
|
|
48
|
+
}
|
|
49
|
+
export type AgentWireEventFramePayload = AgentWireEventPayload | AgentWireCompactMessageUpdatePayload;
|
|
32
50
|
/**
|
|
33
51
|
* Bounded observed-signal vocabulary surfaced to owner control planes. Mirrors
|
|
34
52
|
* the Harness `ObservedSignal` set; the Harness type aliases this in a later
|
|
@@ -82,3 +100,4 @@ export interface AgentWireFrameEnvelope<TType extends AgentWireFrameType = Agent
|
|
|
82
100
|
}
|
|
83
101
|
/** An `AgentSessionEvent` serialized into a versioned wire frame. */
|
|
84
102
|
export type AgentWireEventFrame = AgentWireFrameEnvelope<"event", AgentWireEventPayload>;
|
|
103
|
+
export type AgentWireCompactEventFrame = AgentWireFrameEnvelope<"event", AgentWireEventFramePayload>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AgentSessionEvent } from "../../../session/agent-session";
|
|
2
|
-
import { type AgentWireEventFrame, type AgentWireEventPayload, type AgentWireEventType, type AgentWireFrameEnvelope, type AgentWireFrameType } from "./event-contract";
|
|
2
|
+
import { type AgentWireCompactAssistantMessageEvent, type AgentWireCompactEventFrame, type AgentWireEventFrame, type AgentWireEventPayload, type AgentWireEventType, type AgentWireFrameEnvelope, type AgentWireFrameType } from "./event-contract";
|
|
3
|
+
export declare const AGENT_WIRE_COMPACT_MESSAGE_UPDATE_CHECKPOINT_INTERVAL = 32;
|
|
3
4
|
/**
|
|
4
5
|
* Resolve the stable wire event-type for an `AgentSessionEvent`.
|
|
5
6
|
*
|
|
@@ -27,6 +28,27 @@ export type BridgeFrameSequencer = AgentWireFrameSequencer;
|
|
|
27
28
|
export declare function toAgentWireEventFrame(event: AgentSessionEvent, sequencer: AgentWireFrameSequencer): AgentWireEventFrame;
|
|
28
29
|
/** Build the rich event payload (renderer-facing) for an `AgentSessionEvent`. */
|
|
29
30
|
export declare function toAgentWireEventPayload(event: AgentSessionEvent): AgentWireEventPayload;
|
|
31
|
+
export declare function sanitizeAssistantMessageEventForCompact(assistantMessageEvent: Extract<AgentSessionEvent, {
|
|
32
|
+
type: "message_update";
|
|
33
|
+
}>["assistantMessageEvent"]): AgentWireCompactAssistantMessageEvent;
|
|
34
|
+
export interface AgentWireCompactMessageUpdateOptions {
|
|
35
|
+
checkpointInterval?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Stateful compact event serializer for opt-in RPC clients.
|
|
39
|
+
*
|
|
40
|
+
* Only `message_update` changes shape: it carries the immutable provider delta
|
|
41
|
+
* plus message/content identifiers, with periodic full-message checkpoints that
|
|
42
|
+
* are cloned synchronously before the caller returns to the event loop. All other
|
|
43
|
+
* event variants remain canonical full event frames so legacy bridge/RPC behavior
|
|
44
|
+
* and terminal `message_end` reconstruction are unchanged.
|
|
45
|
+
*/
|
|
46
|
+
export declare class AgentWireCompactEventEncoder {
|
|
47
|
+
#private;
|
|
48
|
+
constructor(sequencer: AgentWireFrameSequencer, options?: AgentWireCompactMessageUpdateOptions);
|
|
49
|
+
frame(event: AgentSessionEvent): AgentWireCompactEventFrame;
|
|
50
|
+
}
|
|
51
|
+
export declare function toAgentWireCompactEventFrame(event: AgentSessionEvent, encoder: AgentWireCompactEventEncoder): AgentWireCompactEventFrame;
|
|
30
52
|
/** Back-compat alias for {@link toAgentWireEventFrame}. */
|
|
31
53
|
export declare const toBridgeEventFrame: typeof toAgentWireEventFrame;
|
|
32
54
|
/**
|
|
@@ -100,6 +100,7 @@ export interface InteractiveModeContext {
|
|
|
100
100
|
onInputCallback?: (input: SubmittedUserInput) => void;
|
|
101
101
|
optimisticUserMessageSignature: string | undefined;
|
|
102
102
|
locallySubmittedUserSignatures: Set<string>;
|
|
103
|
+
optimisticInjectedSignatures: Map<string, number>;
|
|
103
104
|
lastSigintTime: number;
|
|
104
105
|
lastEscapeTime: number;
|
|
105
106
|
lastComposerClearEscapeTime: number;
|
|
@@ -198,6 +199,7 @@ export interface InteractiveModeContext {
|
|
|
198
199
|
handleDumpCommand(): void;
|
|
199
200
|
handleDebugTranscriptCommand(): Promise<void>;
|
|
200
201
|
handleClearCommand(): Promise<void>;
|
|
202
|
+
handleContextClearCommand(): Promise<void>;
|
|
201
203
|
handleDropCommand(): Promise<void>;
|
|
202
204
|
handleForkCommand(): Promise<void>;
|
|
203
205
|
handleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;
|
|
@@ -222,6 +224,7 @@ export interface InteractiveModeContext {
|
|
|
222
224
|
showModelSelector(options?: {
|
|
223
225
|
temporaryOnly?: boolean;
|
|
224
226
|
}): void;
|
|
227
|
+
showEffortSelector(): void;
|
|
225
228
|
showProviderOnboarding(): void;
|
|
226
229
|
showPluginSelector(mode?: "install" | "uninstall"): void;
|
|
227
230
|
showUserMessageSelector(): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ImageContent, TextContent } from "@sayknow-cli/ai";
|
|
2
|
+
import type { InteractiveModeContext } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Normalize the content passed to an extension `sendUserMessage` call into a
|
|
5
|
+
* plain text string plus its image attachments. Mirrors the normalization in
|
|
6
|
+
* `AgentSession.sendUserMessage` (text parts joined with "\n") so the resulting
|
|
7
|
+
* text matches the eventual user `message_start` payload.
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeInjectedUserContent(content: string | (TextContent | ImageContent)[]): {
|
|
10
|
+
text: string;
|
|
11
|
+
images: ImageContent[];
|
|
12
|
+
imageCount: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Record a remotely/programmatically injected user message (e.g. Telegram
|
|
16
|
+
* inbound routed through the extension API) into the interactive TUI, so it is
|
|
17
|
+
* captured in prompt history and shown immediately instead of only appearing
|
|
18
|
+
* once the eventual `message_start` event lands.
|
|
19
|
+
*
|
|
20
|
+
* Local TUI submissions never reach this path (they go through
|
|
21
|
+
* `session.prompt(...)` / `startPendingSubmission`), so this cannot double-add
|
|
22
|
+
* local prompt history.
|
|
23
|
+
*
|
|
24
|
+
* - Always adds the injected text to editor prompt history.
|
|
25
|
+
* - Idle injections optimistically render the user message and record a pending
|
|
26
|
+
* injected optimistic signature (a counting Map, so multiple idle injections
|
|
27
|
+
* before the first `message_start` do not clobber each other); the later user
|
|
28
|
+
* `message_start` consumes one count and skips both the duplicate chat add and
|
|
29
|
+
* the defensive editor clear (so a locally typed draft is preserved).
|
|
30
|
+
* - Busy/queued injections refresh the pending-message display, which the
|
|
31
|
+
* caller has already populated by invoking `session.sendUserMessage(...)`
|
|
32
|
+
* before this helper.
|
|
33
|
+
*
|
|
34
|
+
* This helper never clears the editor text.
|
|
35
|
+
*/
|
|
36
|
+
export declare function applyInjectedUserSubmission(ctx: InteractiveModeContext, input: {
|
|
37
|
+
content: string | (TextContent | ImageContent)[];
|
|
38
|
+
queued: boolean;
|
|
39
|
+
}): void;
|
|
40
|
+
/**
|
|
41
|
+
* Record one pending optimistic render for an injected user message.
|
|
42
|
+
*
|
|
43
|
+
* Injected sends are fire-and-forget and multiple idle injections can be
|
|
44
|
+
* rendered before the first `message_start` arrives, so a counting Map (not a
|
|
45
|
+
* single slot) tracks how many optimistic renders are outstanding per signature.
|
|
46
|
+
*/
|
|
47
|
+
export declare function incrementInjectedOptimisticSignature(ctx: InteractiveModeContext, signature: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* Consume one pending injected optimistic render for `signature`. Decrements the
|
|
50
|
+
* count (deleting the key at zero) and returns whether one was outstanding.
|
|
51
|
+
*/
|
|
52
|
+
export declare function consumeInjectedOptimisticSignature(ctx: InteractiveModeContext, signature: string): boolean;
|
|
@@ -6,6 +6,7 @@ import type { SessionContext } from "../../session/session-manager";
|
|
|
6
6
|
interface RenderInitialMessagesOptions {
|
|
7
7
|
preserveExistingChat?: boolean;
|
|
8
8
|
}
|
|
9
|
+
export declare function argsWithPartialJson(args: unknown, partialJson: unknown): unknown;
|
|
9
10
|
export declare class UiHelpers {
|
|
10
11
|
#private;
|
|
11
12
|
private ctx;
|
|
@@ -24,3 +24,12 @@ export interface ConfigCommandChange {
|
|
|
24
24
|
* can fall through to treating it as a free-text injection).
|
|
25
25
|
*/
|
|
26
26
|
export declare function parseInThreadConfigCommand(text: string): ConfigCommandChange | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Parse a `/rich on|off` toggle. Returns `true`/`false` for a recognised
|
|
29
|
+
* on/off argument, or `undefined` otherwise (not a `/rich` command, or `/rich`
|
|
30
|
+
* with a missing/invalid argument). This is intentionally SEPARATE from
|
|
31
|
+
* `parseInThreadConfigCommand`: `/verbose`/`/redact` are producer/session config
|
|
32
|
+
* forwarded over the WS, whereas rich is Telegram-daemon delivery policy handled
|
|
33
|
+
* daemon-locally, so it never becomes a `config_command` frame or a user turn.
|
|
34
|
+
*/
|
|
35
|
+
export declare function parseRichToggleCommand(text: string): boolean | undefined;
|
|
@@ -14,15 +14,43 @@ export interface NotificationConfig {
|
|
|
14
14
|
redact: boolean;
|
|
15
15
|
verbosity: "lean" | "verbose";
|
|
16
16
|
idleTimeoutMs: number;
|
|
17
|
+
rich: {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
};
|
|
20
|
+
richDraft: {
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
};
|
|
17
23
|
}
|
|
18
24
|
/** Read typed config from Settings. */
|
|
19
25
|
export declare function getNotificationConfig(settings: Settings): NotificationConfig;
|
|
26
|
+
export declare function hasNonBlankValue(value: string | undefined): boolean;
|
|
27
|
+
/** Is Telegram configured with usable non-blank boundary credentials? */
|
|
28
|
+
export declare function isTelegramConfigured(cfg: NotificationConfig): cfg is NotificationConfig & {
|
|
29
|
+
botToken: string;
|
|
30
|
+
chatId: string;
|
|
31
|
+
};
|
|
20
32
|
/** Is global config sufficient for auto-on (enabled + at least one configured adapter)? */
|
|
21
33
|
export declare function isGloballyConfigured(cfg: NotificationConfig): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Per-run opt-out for completion notifications, honored before settings lookups.
|
|
36
|
+
*
|
|
37
|
+
* `SKC_NOTIFY=off` (also `0` / `false`, case-insensitive) suppresses the
|
|
38
|
+
* completion notification surface for this process only. `config.yml` is
|
|
39
|
+
* untouched and child processes inherit the env var, which lets non-interactive
|
|
40
|
+
* fleet runs (`skc -p --no-session`) stay silent even when a user-level/global
|
|
41
|
+
* completion notification configuration is enabled.
|
|
42
|
+
*/
|
|
43
|
+
export declare function completionNotifyDisabledByEnv(env: NodeJS.ProcessEnv): boolean;
|
|
22
44
|
/** Resolve whether the notifications extension should be registered at SDK startup. */
|
|
23
45
|
export declare function shouldRegisterNotificationsExtension(input: {
|
|
24
46
|
env: NodeJS.ProcessEnv;
|
|
25
47
|
cfg?: NotificationConfig;
|
|
48
|
+
/** Task recursion depth; helper/subagent sessions must not spawn remote surfaces. */
|
|
49
|
+
taskDepth?: number;
|
|
50
|
+
/** Parent subagent id/prefix; present for helper/subagent sessions even when depth is omitted. */
|
|
51
|
+
parentTaskPrefix?: string;
|
|
52
|
+
/** Role-agent type/name; present for task sessions even if depth metadata is lost. */
|
|
53
|
+
currentAgentType?: string;
|
|
26
54
|
}): boolean;
|
|
27
55
|
/**
|
|
28
56
|
* Resolve whether THIS session should run notifications.
|
|
@@ -61,7 +89,8 @@ export interface RedactableAction {
|
|
|
61
89
|
* When redact is false, return the action unchanged.
|
|
62
90
|
*
|
|
63
91
|
* Redaction still applies to streamed content frames (turn_stream, context_update,
|
|
64
|
-
* image_attachment) which are suppressed at their emit sites, not here.
|
|
92
|
+
* image_attachment) which are suppressed at their emit sites, not here. Explicit
|
|
93
|
+
* `telegram_send` file attachments are rejected before the file is read or forwarded.
|
|
65
94
|
*/
|
|
66
95
|
export declare function buildRedactedAction(action: RedactableAction, opts: {
|
|
67
96
|
redact: boolean;
|