@sayknow-cli/coding-agent 0.3.7 → 0.3.8
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 +105 -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/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/interactive-mode.d.ts +2 -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-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 +1 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +1 -0
- package/dist/types/notifications/config.d.ts +14 -1
- package/dist/types/notifications/daemon-paths.d.ts +1 -0
- package/dist/types/notifications/index.d.ts +6 -3
- package/dist/types/notifications/lifecycle-commands.d.ts +11 -3
- package/dist/types/notifications/telegram-daemon.d.ts +23 -3
- package/dist/types/notifications/telegram-reference.d.ts +0 -5
- package/dist/types/notifications/threaded-render.d.ts +6 -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/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/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 +92 -8
- package/src/cli/telegram-cli.ts +1 -1
- package/src/cli/update-cli.ts +85 -9
- 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 +2 -2
- package/src/config/model-profile-activation.ts +65 -0
- package/src/config/model-profiles.ts +31 -2
- package/src/config/settings-schema.ts +68 -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 +14 -5
- 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/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/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 +66 -47
- package/src/modes/controllers/extension-ui-controller.ts +4 -10
- package/src/modes/controllers/input-controller.ts +180 -18
- package/src/modes/controllers/selector-controller.ts +127 -24
- package/src/modes/interactive-mode.ts +51 -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 +29 -3
- 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 +1 -0
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/modes/utils/ui-helpers.ts +20 -7
- package/src/notifications/config.ts +25 -5
- package/src/notifications/daemon-paths.ts +2 -0
- package/src/notifications/index.ts +117 -14
- package/src/notifications/lifecycle-commands.ts +37 -7
- package/src/notifications/lifecycle-orchestrator.ts +19 -6
- package/src/notifications/telegram-daemon-control.ts +5 -3
- package/src/notifications/telegram-daemon.ts +302 -51
- package/src/notifications/telegram-reference.ts +0 -16
- package/src/notifications/threaded-render.ts +17 -1
- 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 +1 -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 +52 -28
- package/src/session/agent-session.ts +1011 -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/ultragoal-guard.ts +55 -66
- package/src/skc-runtime/ultragoal-receipt-freshness.ts +315 -0
- package/src/skc-runtime/ultragoal-runtime.ts +1663 -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 +218 -71
- 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/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
|
@@ -17,9 +17,12 @@ export interface LoadContextFilesOptions {
|
|
|
17
17
|
cwd?: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Load all
|
|
20
|
+
* Load all context files using the capability API.
|
|
21
21
|
* Returns {path, content, depth} entries for all discovered context files.
|
|
22
|
-
*
|
|
22
|
+
* Native user-global files (`~/.skc/agent/AGENTS.md`) come first, then project
|
|
23
|
+
* files sorted by depth (descending) so files closer to cwd appear last/more
|
|
24
|
+
* prominent. User-home files from foreign providers (`~/.claude/CLAUDE.md`,
|
|
25
|
+
* `~/.codex/AGENTS.md`, …) stay excluded — only skc's own user config applies.
|
|
23
26
|
*/
|
|
24
27
|
export declare function loadProjectContextFiles(options?: LoadContextFilesOptions): Promise<Array<{
|
|
25
28
|
path: string;
|
|
@@ -91,12 +94,25 @@ export interface BuildSystemPromptOptions {
|
|
|
91
94
|
secretsEnabled?: boolean;
|
|
92
95
|
/** Pre-loaded workspace tree (skips discovery if provided). May be a Promise to allow early kick-off. */
|
|
93
96
|
workspaceTree?: WorkspaceTree | Promise<WorkspaceTree>;
|
|
97
|
+
/**
|
|
98
|
+
* Render a trimmed role-agent base prompt for subagent sessions: omits the
|
|
99
|
+
* workflow-surface/routing/self-awareness (`<skc-runtime>`) and `<soul>` blocks
|
|
100
|
+
* that only apply to the top-level interactive/print agent. Tool safety, repo
|
|
101
|
+
* safety, and the completion contract are retained. Default: false.
|
|
102
|
+
*/
|
|
103
|
+
subagent?: boolean;
|
|
94
104
|
}
|
|
95
105
|
/** Result of building provider-facing system prompt messages. */
|
|
96
106
|
export interface BuildSystemPromptResult {
|
|
97
107
|
/** Ordered system prompt blocks. Providers should preserve entries as distinct messages/blocks. */
|
|
98
108
|
systemPrompt: string[];
|
|
99
109
|
}
|
|
110
|
+
export interface BuildVolatileProjectContextOptions {
|
|
111
|
+
cwd?: string;
|
|
112
|
+
date?: string;
|
|
113
|
+
workspaceTree?: WorkspaceTree;
|
|
114
|
+
}
|
|
115
|
+
export declare function buildVolatileProjectContext(options?: BuildVolatileProjectContextOptions): string;
|
|
100
116
|
/** Build the system prompt with tools, guidelines, and context */
|
|
101
117
|
export declare function buildSystemPrompt(options?: BuildSystemPromptOptions): Promise<BuildSystemPromptResult>;
|
|
102
118
|
export {};
|
|
@@ -51,6 +51,8 @@ export interface ExecutorOptions {
|
|
|
51
51
|
artifactsDir?: string;
|
|
52
52
|
/** Path to parent conversation context file */
|
|
53
53
|
contextFile?: string;
|
|
54
|
+
/** Whether the parent runtime actually exposes IRC coordination. */
|
|
55
|
+
ircAvailable?: boolean;
|
|
54
56
|
eventBus?: EventBus;
|
|
55
57
|
contextFiles?: ContextFileEntry[];
|
|
56
58
|
skills?: Skill[];
|
|
@@ -112,6 +114,7 @@ interface FinalizeSubprocessOutputResult {
|
|
|
112
114
|
}
|
|
113
115
|
export declare const SUBAGENT_WARNING_NULL_YIELD = "SYSTEM WARNING: Subagent called yield with null data.";
|
|
114
116
|
export declare const SUBAGENT_WARNING_MISSING_YIELD = "SYSTEM WARNING: Subagent exited without calling yield tool after 3 reminders.";
|
|
117
|
+
export declare const SUBAGENT_WARNING_PLACEHOLDER_YIELD = "SYSTEM WARNING: Subagent yield data contains a placeholder instead of the actual result.";
|
|
115
118
|
export declare function finalizeSubprocessOutput(args: FinalizeSubprocessOutputArgs): FinalizeSubprocessOutputResult;
|
|
116
119
|
export declare function createSubagentSettings(baseSettings: Settings, inheritedServiceTier?: ServiceTier): Settings;
|
|
117
120
|
/**
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ChatUsageSnapshot, CostEstimate } from "@sayknow-cli/agent-core";
|
|
2
|
+
import type { TaskTokenLog, TaskTokenMetrics } from "./types";
|
|
3
|
+
export interface TaskTokenLogChatBuckets {
|
|
4
|
+
readonly inputTokens: number;
|
|
5
|
+
readonly outputTokens: number;
|
|
6
|
+
readonly cachedInputTokens: number;
|
|
7
|
+
readonly cacheWriteTokens: number;
|
|
8
|
+
readonly costUsd?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface TaskTokenLogSessionManager {
|
|
11
|
+
getSessionId(): string;
|
|
12
|
+
}
|
|
13
|
+
export interface TaskTokenLogContext {
|
|
14
|
+
readonly subagentId: string;
|
|
15
|
+
readonly agent?: string;
|
|
16
|
+
readonly turn: number;
|
|
17
|
+
readonly at: string;
|
|
18
|
+
readonly model?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function taskTokenLogFromChat(chat: TaskTokenLogChatBuckets, ctx: TaskTokenLogContext): TaskTokenLog;
|
|
21
|
+
export declare function taskTokenLogFromUsage(usage: ChatUsageSnapshot, ctx: TaskTokenLogContext & {
|
|
22
|
+
readonly cost?: CostEstimate;
|
|
23
|
+
}): TaskTokenLog;
|
|
24
|
+
export declare function resolveTaskTokenLogDir(cwd: string, sessionManager: TaskTokenLogSessionManager | undefined, envSessionId?: string | undefined): Promise<string | undefined>;
|
|
25
|
+
export declare function persistTaskTokenLog(entry: TaskTokenLog, opts: {
|
|
26
|
+
dir: string;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
export declare function readTaskTokenLogs(dir: string): Promise<TaskTokenLog[]>;
|
|
29
|
+
export declare function computeTaskTokenMetrics(logs: readonly TaskTokenLog[]): TaskTokenMetrics;
|
|
30
|
+
export declare function computeCacheHitRate(input: number, cacheRead: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@sayknow-cli/agent-core";
|
|
2
|
+
import * as z from "zod/v4";
|
|
3
|
+
import type { ToolSession } from ".";
|
|
4
|
+
import type { OutputMeta } from "./output-meta";
|
|
5
|
+
declare const bisectSchema: z.ZodObject<{
|
|
6
|
+
good: z.ZodString;
|
|
7
|
+
bad: z.ZodDefault<z.ZodString>;
|
|
8
|
+
run: z.ZodString;
|
|
9
|
+
invert: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
maxSteps: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
stepTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
type BisectParams = z.infer<typeof bisectSchema>;
|
|
14
|
+
export type BisectVerdict = "good" | "bad" | "skip";
|
|
15
|
+
export interface BisectStep {
|
|
16
|
+
rev: string;
|
|
17
|
+
verdict: BisectVerdict;
|
|
18
|
+
}
|
|
19
|
+
export interface BisectMarkResult {
|
|
20
|
+
exitCode: number;
|
|
21
|
+
output: string;
|
|
22
|
+
}
|
|
23
|
+
export interface BisectControllerDeps {
|
|
24
|
+
maxSteps: number;
|
|
25
|
+
/** SHA of the revision git currently has checked out. */
|
|
26
|
+
currentRev: () => Promise<string>;
|
|
27
|
+
/** Evaluate the predicate at the checked-out revision. */
|
|
28
|
+
evaluate: (rev: string) => Promise<BisectVerdict>;
|
|
29
|
+
/** Apply the verdict via `git bisect good|bad|skip` and return the raw result. */
|
|
30
|
+
mark: (verdict: BisectVerdict) => Promise<BisectMarkResult>;
|
|
31
|
+
}
|
|
32
|
+
export interface BisectOutcome {
|
|
33
|
+
culprit: string | null;
|
|
34
|
+
steps: BisectStep[];
|
|
35
|
+
concluded: boolean;
|
|
36
|
+
reason?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface BisectToolDetails {
|
|
39
|
+
meta?: OutputMeta;
|
|
40
|
+
culprit: string | null;
|
|
41
|
+
invert: boolean;
|
|
42
|
+
concluded: boolean;
|
|
43
|
+
steps: BisectStep[];
|
|
44
|
+
author?: string;
|
|
45
|
+
date?: string;
|
|
46
|
+
subject?: string;
|
|
47
|
+
reason?: string;
|
|
48
|
+
}
|
|
49
|
+
/** Parse the culprit SHA from `git bisect good|bad` output, or null when not yet converged. */
|
|
50
|
+
export declare function parseFirstBadCommit(output: string): string | null;
|
|
51
|
+
/**
|
|
52
|
+
* Map a predicate exit code to a bisect verdict. `invert` swaps the good/bad
|
|
53
|
+
* mapping (to hunt for a fixing commit) but never reinterprets a skip.
|
|
54
|
+
*/
|
|
55
|
+
export declare function classifyExit(exitCode: number, invert: boolean): BisectVerdict;
|
|
56
|
+
/**
|
|
57
|
+
* Drive the bisect loop. Pure orchestration — every git/predicate effect is
|
|
58
|
+
* injected — so it can be exercised deterministically without a real repo.
|
|
59
|
+
*/
|
|
60
|
+
export declare function runBisectController(deps: BisectControllerDeps, signal?: AbortSignal): Promise<BisectOutcome>;
|
|
61
|
+
export declare class BisectTool implements AgentTool<typeof bisectSchema, BisectToolDetails> {
|
|
62
|
+
private readonly session;
|
|
63
|
+
readonly name = "bisect";
|
|
64
|
+
readonly label = "Bisect";
|
|
65
|
+
readonly summary = "Find the commit that introduced a regression by driving git bisect with a shell predicate";
|
|
66
|
+
readonly description: string;
|
|
67
|
+
readonly parameters: z.ZodObject<{
|
|
68
|
+
good: z.ZodString;
|
|
69
|
+
bad: z.ZodDefault<z.ZodString>;
|
|
70
|
+
run: z.ZodString;
|
|
71
|
+
invert: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
maxSteps: z.ZodDefault<z.ZodNumber>;
|
|
73
|
+
stepTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
readonly strict = true;
|
|
76
|
+
readonly loadMode = "discoverable";
|
|
77
|
+
readonly intent: (args: Partial<BisectParams>) => string;
|
|
78
|
+
constructor(session: ToolSession);
|
|
79
|
+
execute(_toolCallId: string, params: BisectParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<BisectToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<BisectToolDetails>>;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
@@ -238,7 +238,7 @@ export interface ComputerScreenshotDetails {
|
|
|
238
238
|
scaleY?: number;
|
|
239
239
|
originX?: number;
|
|
240
240
|
originY?: number;
|
|
241
|
-
displayEpoch?:
|
|
241
|
+
displayEpoch?: number;
|
|
242
242
|
captureId?: string;
|
|
243
243
|
pngBytes?: number;
|
|
244
244
|
path?: string;
|
|
@@ -281,7 +281,7 @@ type NativeScreenshot = {
|
|
|
281
281
|
scaleY?: number;
|
|
282
282
|
originX?: number;
|
|
283
283
|
originY?: number;
|
|
284
|
-
displayEpoch?:
|
|
284
|
+
displayEpoch?: number;
|
|
285
285
|
captureId?: string;
|
|
286
286
|
};
|
|
287
287
|
export type ComputerControllerFactory = () => NativeController;
|
|
@@ -8,7 +8,7 @@ import type { ToolSession } from ".";
|
|
|
8
8
|
import { type OutputMeta } from "./output-meta";
|
|
9
9
|
declare const searchSchema: z.ZodObject<{
|
|
10
10
|
pattern: z.ZodString;
|
|
11
|
-
paths: z.ZodArray<z.ZodString
|
|
11
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
12
12
|
i: z.ZodOptional<z.ZodBoolean>;
|
|
13
13
|
gitignore: z.ZodOptional<z.ZodBoolean>;
|
|
14
14
|
skip: z.ZodOptional<z.ZodNumber>;
|
|
@@ -61,7 +61,7 @@ export declare class SearchTool implements AgentTool<typeof searchSchema, Search
|
|
|
61
61
|
readonly description: string;
|
|
62
62
|
readonly parameters: z.ZodObject<{
|
|
63
63
|
pattern: z.ZodString;
|
|
64
|
-
paths: z.ZodArray<z.ZodString
|
|
64
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
65
|
i: z.ZodOptional<z.ZodBoolean>;
|
|
66
66
|
gitignore: z.ZodOptional<z.ZodBoolean>;
|
|
67
67
|
skip: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { AgentTool } from "@sayknow-cli/agent-core";
|
|
2
2
|
import { type UltragoalAskBlockDiagnostic } from "../skc-runtime/ultragoal-guard";
|
|
3
|
+
export interface UltragoalAskGuardContext {
|
|
4
|
+
activeSkillState?: {
|
|
5
|
+
skill?: string;
|
|
6
|
+
session_id?: string;
|
|
7
|
+
} | null;
|
|
8
|
+
sessionId?: string | null;
|
|
9
|
+
}
|
|
3
10
|
export declare function formatUltragoalAskBlockMessage(diagnostic: UltragoalAskBlockDiagnostic): string;
|
|
4
|
-
export declare function assertUltragoalAskAllowed(cwd: string): Promise<void>;
|
|
5
|
-
export declare function guardToolForUltragoalAsk<T extends AgentTool>(tool: T, getCwd: () => string): T;
|
|
11
|
+
export declare function assertUltragoalAskAllowed(cwd: string, context?: UltragoalAskGuardContext): Promise<void>;
|
|
12
|
+
export declare function guardToolForUltragoalAsk<T extends AgentTool>(tool: T, getCwd: () => string, getContext?: () => UltragoalAskGuardContext): T;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { AgentMessage } from "@sayknow-cli/agent-core";
|
|
2
|
+
/**
|
|
3
|
+
* Default inline cap for auto-read file mentions, deliberately below the
|
|
4
|
+
* read-tool cap (`DEFAULT_MAX_BYTES`, 50KB) so an incidental `@path` mention
|
|
5
|
+
* injects a smaller snippet than an explicit `read`. Overridable per call.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_FILE_MENTION_INLINE_BYTES: number;
|
|
2
8
|
/** Extract all @filepath mentions from text */
|
|
3
9
|
export declare function extractFileMentions(text: string): string[];
|
|
4
10
|
/**
|
|
@@ -8,4 +14,12 @@ export declare function extractFileMentions(text: string): string[];
|
|
|
8
14
|
export declare function generateFileMentionMessages(filePaths: string[], cwd: string, options?: {
|
|
9
15
|
autoResizeImages?: boolean;
|
|
10
16
|
useHashLines?: boolean;
|
|
17
|
+
/** Inline byte cap for auto-read text. Default: DEFAULT_FILE_MENTION_INLINE_BYTES. */
|
|
18
|
+
maxInlineBytes?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Resolved paths already shown (read or mentioned) recently in the
|
|
21
|
+
* conversation. A mention of one of these emits a compact duplicate note
|
|
22
|
+
* instead of re-injecting the full body.
|
|
23
|
+
*/
|
|
24
|
+
recentlyShownPaths?: ReadonlySet<string>;
|
|
11
25
|
}): Promise<AgentMessage[]>;
|
|
@@ -307,6 +307,38 @@ export declare function clean(cwd: string, options?: {
|
|
|
307
307
|
paths?: readonly string[];
|
|
308
308
|
signal?: AbortSignal;
|
|
309
309
|
}): Promise<void>;
|
|
310
|
+
export interface BisectCommitInfo {
|
|
311
|
+
sha: string;
|
|
312
|
+
author: string;
|
|
313
|
+
date: string;
|
|
314
|
+
subject: string;
|
|
315
|
+
stat: string;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Thin wrappers over `git bisect`. The marking commands (`good`/`bad`/`skip`)
|
|
319
|
+
* return the raw {@link GitCommandResult} without throwing so callers can both
|
|
320
|
+
* detect a genuine failure (non-zero exit) and scan the output for the
|
|
321
|
+
* "<sha> is the first bad commit" conclusion. `reset` is best-effort and never
|
|
322
|
+
* throws so it is safe to call from a `finally` block to restore the worktree.
|
|
323
|
+
*/
|
|
324
|
+
export declare const bisect: {
|
|
325
|
+
/** Begin a bisect session (does not seed good/bad endpoints). */
|
|
326
|
+
start(cwd: string, signal?: AbortSignal): Promise<void>;
|
|
327
|
+
/** Mark a revision (or current HEAD when omitted) good. Returns raw output. */
|
|
328
|
+
good(cwd: string, ref?: string, signal?: AbortSignal): Promise<GitCommandResult>;
|
|
329
|
+
/** Mark a revision (or current HEAD when omitted) bad. Returns raw output. */
|
|
330
|
+
bad(cwd: string, ref?: string, signal?: AbortSignal): Promise<GitCommandResult>;
|
|
331
|
+
/** Skip the current (untestable) revision. Returns raw output. */
|
|
332
|
+
skip(cwd: string, signal?: AbortSignal): Promise<GitCommandResult>;
|
|
333
|
+
/** Read the replayable bisect log for the current session. */
|
|
334
|
+
log(cwd: string, signal?: AbortSignal): Promise<string>;
|
|
335
|
+
/** End the bisect session, restoring the original HEAD. Never throws. */
|
|
336
|
+
reset(cwd: string, signal?: AbortSignal): Promise<void>;
|
|
337
|
+
/** True when `ancestor` is a first-parent-or-merge ancestor of `descendant`. */
|
|
338
|
+
isAncestor(cwd: string, ancestor: string, descendant: string, signal?: AbortSignal): Promise<boolean>;
|
|
339
|
+
/** Resolve author/date/subject and a diffstat for a commit (for the receipt). */
|
|
340
|
+
describe(cwd: string, sha: string, signal?: AbortSignal): Promise<BisectCommitInfo>;
|
|
341
|
+
};
|
|
310
342
|
export declare const ls: {
|
|
311
343
|
/** List files tracked or untracked by git. */
|
|
312
344
|
files(cwd: string, options?: {
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { SpecialHandler } from "./types";
|
|
2
|
+
export interface YouTubeUrl {
|
|
3
|
+
videoId: string;
|
|
4
|
+
playlistId?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Parse YouTube URL into components
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseYouTubeUrl(url: string): YouTubeUrl | null;
|
|
2
10
|
/**
|
|
3
11
|
* Handle YouTube URLs - fetch metadata and transcript
|
|
4
12
|
*/
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { type WorkflowClaimsLedger, type WorkflowConsensusReport } from "./workflow-intent-report";
|
|
1
2
|
export declare const WORKFLOW_INTENT_DIFF_CUSTOM_TYPE = "workflow-intent-diff";
|
|
2
|
-
export
|
|
3
|
+
export declare const WORKFLOW_INTENT_ROUTES: readonly ["direct", "deep-interview", "ralplan", "ultragoal", "team"];
|
|
4
|
+
export declare const WORKFLOW_ESCALATION_ROUTES: readonly ["deep-interview", "ralplan", "ultragoal", "team"];
|
|
5
|
+
export type WorkflowIntentRoute = (typeof WORKFLOW_INTENT_ROUTES)[number];
|
|
6
|
+
export type WorkflowEscalationRoute = (typeof WORKFLOW_ESCALATION_ROUTES)[number];
|
|
3
7
|
export type DirectTrackingMode = "custom-entry-only" | "not-direct";
|
|
4
8
|
export type RootCausePhaseStatus = "active" | "inactive";
|
|
5
9
|
export interface WorkflowIntentDiff {
|
|
@@ -7,13 +11,15 @@ export interface WorkflowIntentDiff {
|
|
|
7
11
|
readonly route: WorkflowIntentRoute;
|
|
8
12
|
readonly reason: string;
|
|
9
13
|
readonly directTracking: DirectTrackingMode;
|
|
10
|
-
readonly recommendedSkill?:
|
|
14
|
+
readonly recommendedSkill?: WorkflowEscalationRoute;
|
|
11
15
|
readonly recommendedInvocation?: string;
|
|
12
16
|
readonly triggers: readonly string[];
|
|
13
17
|
readonly rootCausePhase: {
|
|
14
18
|
readonly status: RootCausePhaseStatus;
|
|
15
19
|
readonly triggers: readonly string[];
|
|
16
20
|
};
|
|
21
|
+
readonly claimsLedger: WorkflowClaimsLedger;
|
|
22
|
+
readonly consensusReport: WorkflowConsensusReport;
|
|
17
23
|
readonly promptPreview: string;
|
|
18
24
|
}
|
|
19
25
|
export declare function buildWorkflowIntentDiff(text: string): WorkflowIntentDiff | null;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { SessionEntry } from "../session/session-manager";
|
|
2
|
+
import { type WorkflowIntentDiff, type WorkflowIntentRoute } from "./workflow-intent-diff";
|
|
3
|
+
import type { WorkflowSignalObserver } from "./workflow-intent-report";
|
|
4
|
+
export type WorkflowConsumerConfidence = "none" | "low" | "medium" | "high";
|
|
5
|
+
export interface WorkflowRouteCounts {
|
|
6
|
+
readonly direct: number;
|
|
7
|
+
readonly "deep-interview": number;
|
|
8
|
+
readonly ralplan: number;
|
|
9
|
+
readonly ultragoal: number;
|
|
10
|
+
readonly team: number;
|
|
11
|
+
}
|
|
12
|
+
export interface WorkflowIntentReportEntry {
|
|
13
|
+
readonly entryId: string;
|
|
14
|
+
readonly timestamp: string;
|
|
15
|
+
readonly intent: WorkflowIntentDiff;
|
|
16
|
+
}
|
|
17
|
+
export interface WorkflowIntentReportTotals {
|
|
18
|
+
readonly total: number;
|
|
19
|
+
readonly byRoute: WorkflowRouteCounts;
|
|
20
|
+
readonly escalationRequired: number;
|
|
21
|
+
readonly rootCauseActive: number;
|
|
22
|
+
}
|
|
23
|
+
export interface WorkflowIntentReportCollection {
|
|
24
|
+
readonly entries: readonly WorkflowIntentReportEntry[];
|
|
25
|
+
readonly latest: WorkflowIntentReportEntry | undefined;
|
|
26
|
+
readonly totals: WorkflowIntentReportTotals;
|
|
27
|
+
}
|
|
28
|
+
export interface WorkflowObserverSignalSummary {
|
|
29
|
+
readonly observer: WorkflowSignalObserver;
|
|
30
|
+
readonly conclusion: string;
|
|
31
|
+
readonly count: number;
|
|
32
|
+
}
|
|
33
|
+
export interface WorkflowConsensusSummary {
|
|
34
|
+
readonly total: number;
|
|
35
|
+
readonly dominantRoute: WorkflowIntentRoute | undefined;
|
|
36
|
+
readonly confidence: WorkflowConsumerConfidence;
|
|
37
|
+
readonly escalationGate: {
|
|
38
|
+
readonly required: boolean;
|
|
39
|
+
readonly count: number;
|
|
40
|
+
readonly latestReason: string | undefined;
|
|
41
|
+
};
|
|
42
|
+
readonly rootCausePhase: {
|
|
43
|
+
readonly active: boolean;
|
|
44
|
+
readonly count: number;
|
|
45
|
+
readonly triggers: readonly string[];
|
|
46
|
+
};
|
|
47
|
+
readonly observerSignals: readonly WorkflowObserverSignalSummary[];
|
|
48
|
+
}
|
|
49
|
+
export declare function collectWorkflowIntentReports(entries: readonly SessionEntry[]): WorkflowIntentReportCollection;
|
|
50
|
+
export declare function summarizeWorkflowConsensus(intents: readonly WorkflowIntentDiff[]): WorkflowConsensusSummary;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { RootCausePhaseStatus, WorkflowIntentRoute } from "./workflow-intent-diff";
|
|
2
|
+
export type WorkflowConfidence = "high";
|
|
3
|
+
export type WorkflowClaimStatus = "confirmed";
|
|
4
|
+
export type WorkflowEscalationGateStatus = "required" | "not-required";
|
|
5
|
+
export type WorkflowSignalObserver = "intent-router" | "root-cause-schema" | "escalation-gate";
|
|
6
|
+
export interface WorkflowClaim {
|
|
7
|
+
readonly id: "workflow-route" | "root-cause-phase" | "escalation-gate";
|
|
8
|
+
readonly statement: string;
|
|
9
|
+
readonly status: WorkflowClaimStatus;
|
|
10
|
+
readonly confidence: WorkflowConfidence;
|
|
11
|
+
readonly evidence: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export interface WorkflowClaimsLedger {
|
|
14
|
+
readonly version: 1;
|
|
15
|
+
readonly claims: readonly WorkflowClaim[];
|
|
16
|
+
}
|
|
17
|
+
export interface WorkflowObserverSignal {
|
|
18
|
+
readonly observer: WorkflowSignalObserver;
|
|
19
|
+
readonly conclusion: string;
|
|
20
|
+
readonly evidence: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
export interface WorkflowConsensusReport {
|
|
23
|
+
readonly version: 1;
|
|
24
|
+
readonly route: WorkflowIntentRoute;
|
|
25
|
+
readonly confidence: WorkflowConfidence;
|
|
26
|
+
readonly summary: string;
|
|
27
|
+
readonly observerSignals: readonly WorkflowObserverSignal[];
|
|
28
|
+
readonly escalationGate: {
|
|
29
|
+
readonly status: WorkflowEscalationGateStatus;
|
|
30
|
+
readonly reason: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface WorkflowIntentReport {
|
|
34
|
+
readonly claimsLedger: WorkflowClaimsLedger;
|
|
35
|
+
readonly consensusReport: WorkflowConsensusReport;
|
|
36
|
+
}
|
|
37
|
+
export interface WorkflowIntentReportInput {
|
|
38
|
+
readonly route: WorkflowIntentRoute;
|
|
39
|
+
readonly reason: string;
|
|
40
|
+
readonly direct: boolean;
|
|
41
|
+
readonly recommendedInvocation?: string;
|
|
42
|
+
readonly triggers: readonly string[];
|
|
43
|
+
readonly rootCausePhase: {
|
|
44
|
+
readonly status: RootCausePhaseStatus;
|
|
45
|
+
readonly triggers: readonly string[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export declare function buildWorkflowIntentReport(input: WorkflowIntentReportInput): WorkflowIntentReport;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@sayknow-cli/coding-agent",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.8",
|
|
5
5
|
"description": "Sayknow-CLI CLI with read, bash, edit, write tools and session management",
|
|
6
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://sayknow-cli.com",
|
|
7
7
|
"author": "jaybeyond",
|
|
8
8
|
"contributors": [
|
|
9
9
|
"Mario Zechner"
|
|
@@ -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.8",
|
|
56
|
+
"@sayknow-cli/agent-core": "0.3.8",
|
|
57
|
+
"@sayknow-cli/ai": "0.3.8",
|
|
58
|
+
"@sayknow-cli/natives": "0.3.8",
|
|
59
|
+
"@sayknow-cli/tui": "0.3.8",
|
|
60
|
+
"@sayknow-cli/utils": "0.3.8",
|
|
61
61
|
"@puppeteer/browsers": "^2.13.0",
|
|
62
62
|
"@types/turndown": "5.0.6",
|
|
63
63
|
"@xterm/headless": "^6.0.0",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for append-only context-mode resolution and manager
|
|
3
|
+
* construction. Both the initial session build (`sdk.ts`) and the runtime
|
|
4
|
+
* model/setting-change path (`agent-session.ts`), plus the status UI, resolve
|
|
5
|
+
* through here so the auto allowlist and prefix-reset diagnostics never drift.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { AppendOnlyContextManager } from "@sayknow-cli/agent-core";
|
|
9
|
+
import { logger } from "@sayknow-cli/utils";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Providers for which append-only context auto-enables. Exact provider-string
|
|
13
|
+
* match only: `anthropic` reached via a gateway/aggregator provider string
|
|
14
|
+
* (e.g. `openrouter`, a custom gateway) does NOT match and stays opt-in via
|
|
15
|
+
* `provider.appendOnlyContext: "on"`, because those transports can rewrite or
|
|
16
|
+
* renormalize the request in ways that have not been validated for append-only
|
|
17
|
+
* prefix stability.
|
|
18
|
+
*/
|
|
19
|
+
export function providerSupportsAppendOnlyAuto(provider: string): boolean {
|
|
20
|
+
return provider === "deepseek" || provider === "anthropic";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Resolve whether to enable append-only context mode based on the setting and provider.
|
|
25
|
+
*
|
|
26
|
+
* - `"on"` → always enable
|
|
27
|
+
* - `"off"` → never enable
|
|
28
|
+
* - `"auto"` → enable for providers with strong prompt-prefix caching that this
|
|
29
|
+
* harness has validated (see {@link providerSupportsAppendOnlyAuto})
|
|
30
|
+
*/
|
|
31
|
+
export function resolveAppendOnlyMode(setting: "auto" | "on" | "off" | undefined, provider: string): boolean {
|
|
32
|
+
switch (setting ?? "auto") {
|
|
33
|
+
case "on":
|
|
34
|
+
return true;
|
|
35
|
+
case "off":
|
|
36
|
+
return false;
|
|
37
|
+
default:
|
|
38
|
+
return providerSupportsAppendOnlyAuto(provider);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Construct an {@link AppendOnlyContextManager} wired to emit per-session
|
|
44
|
+
* stable-prefix reset diagnostics. Use this at every creation site so the
|
|
45
|
+
* telemetry is uniform.
|
|
46
|
+
*/
|
|
47
|
+
export function createAppendOnlyContextManager(provider: string | undefined): AppendOnlyContextManager {
|
|
48
|
+
return new AppendOnlyContextManager({
|
|
49
|
+
onPrefixChange: info =>
|
|
50
|
+
logger.debug("append-only stable prefix changed (cache prefix reset)", {
|
|
51
|
+
provider,
|
|
52
|
+
from: info.from,
|
|
53
|
+
to: info.to,
|
|
54
|
+
version: info.version,
|
|
55
|
+
reason: info.from === "<unbuilt>" ? "initial-build" : "prefix-mutation",
|
|
56
|
+
}),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
@@ -22,7 +22,7 @@ You are running an autonomous experiment loop. Keep iterating until the user int
|
|
|
22
22
|
### Available tools
|
|
23
23
|
- `init_experiment` — open or reconfigure the session. Pass `new_segment: true` to start a fresh baseline within the current session.
|
|
24
24
|
- `run_experiment` — run the benchmark (`bash autoresearch.sh`). Output is captured automatically and `METRIC name=value` / `ASI key=value` lines printed by the harness are parsed back to you. The command is fixed; if you need a different workload, edit `autoresearch.sh` and bump segment via `init_experiment new_segment: true`.
|
|
25
|
-
- `log_experiment` — record the result. On `keep`,
|
|
25
|
+
- `log_experiment` — record the result. On `keep`, changes are committed only on a dedicated `autoresearch/*` branch; otherwise the tool warns and leaves files in the worktree. On `discard`/`crash`/`checks_failed`, the worktree is reverted. Pass `flag_runs` to mark earlier runs as suspect; flagged runs are excluded from baseline and best-metric math.
|
|
26
26
|
- `update_notes` — replace the durable session playbook (`body`) or append to the ideas backlog (`append_idea`). The notes are injected into your system prompt every iteration.
|
|
27
27
|
|
|
28
28
|
### Operating protocol
|
|
@@ -62,7 +62,7 @@ export function createLogExperimentTool(
|
|
|
62
62
|
name: "log_experiment",
|
|
63
63
|
label: "Log Experiment",
|
|
64
64
|
description:
|
|
65
|
-
"Log the result of the latest run_experiment. Records the metric, optional ASI metadata, modified paths, and scope deviations. On `keep`, modified files are committed
|
|
65
|
+
"Log the result of the latest run_experiment. Records the metric, optional ASI metadata, modified paths, and scope deviations. On `keep`, modified files are committed only on a dedicated `autoresearch/*` branch; otherwise the tool warns and leaves them in the worktree. On `discard`/`crash`/`checks_failed`, the worktree is reverted. Pass `flag_runs` to mark earlier runs as suspect; flagged runs are excluded from baseline and best-metric math.",
|
|
66
66
|
parameters: logExperimentSchema,
|
|
67
67
|
defaultInactive: true,
|
|
68
68
|
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
package/src/capability/rule.ts
CHANGED
|
@@ -22,6 +22,11 @@ export interface RuleFrontmatter {
|
|
|
22
22
|
scope?: string | string[];
|
|
23
23
|
/** Per-rule TTSR interrupt mode override. */
|
|
24
24
|
interruptMode?: "never" | "prose-only" | "tool-only" | "always";
|
|
25
|
+
/** Per-rule TTSR repeat mode override. */
|
|
26
|
+
repeatMode?: "once" | "after-gap";
|
|
27
|
+
/** Per-rule TTSR repeat gap override. */
|
|
28
|
+
repeatGap?: number;
|
|
29
|
+
|
|
25
30
|
[key: string]: unknown;
|
|
26
31
|
}
|
|
27
32
|
|
|
@@ -47,6 +52,10 @@ export interface Rule {
|
|
|
47
52
|
scope?: string[];
|
|
48
53
|
/** Per-rule TTSR interrupt mode override (falls back to global ttsr.interruptMode). */
|
|
49
54
|
interruptMode?: "never" | "prose-only" | "tool-only" | "always";
|
|
55
|
+
/** Per-rule TTSR repeat mode override (falls back to global ttsr.repeatMode). */
|
|
56
|
+
repeatMode?: "once" | "after-gap";
|
|
57
|
+
/** Per-rule TTSR repeat gap override (falls back to global ttsr.repeatGap). */
|
|
58
|
+
repeatGap?: number;
|
|
50
59
|
/** Source metadata */
|
|
51
60
|
_source: SourceMeta;
|
|
52
61
|
}
|