toolroll 0.9.92 → 0.9.94
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/CHANGELOG.md +87 -0
- package/dist/activity-line.d.ts +7 -4
- package/dist/activity-line.js +9 -7
- package/dist/agent-fence.d.ts +4 -0
- package/dist/agent-fence.js +4 -1
- package/dist/approval-authority.d.ts +7 -1
- package/dist/approval-authority.js +11 -2
- package/dist/approval-password.d.ts +31 -0
- package/dist/approval-password.js +26 -0
- package/dist/assignment-status.d.ts +1 -1
- package/dist/assignment-ui.js +3 -3
- package/dist/assignment.js +16 -3
- package/dist/boot-identity.d.ts +2 -1
- package/dist/boot-identity.js +6 -4
- package/dist/bounded-spawn.d.ts +57 -0
- package/dist/bounded-spawn.js +220 -0
- package/dist/browser/terminal.js +42 -42
- package/dist/browser/workspace.css +2 -2
- package/dist/browser/workspace.js +26 -26
- package/dist/browser-crew.js +2 -2
- package/dist/browser-shell.d.ts +1 -1
- package/dist/browser-shell.js +2 -2
- package/dist/browser-workspace.d.ts +48 -7
- package/dist/browser-workspace.js +3 -3
- package/dist/builder-restart.d.ts +21 -0
- package/dist/builder-restart.js +50 -0
- package/dist/builder.d.ts +4 -0
- package/dist/builder.js +73 -25
- package/dist/chat-acceptance.js +1 -1
- package/dist/chat-actions.d.ts +12 -2
- package/dist/chat-actions.js +25 -2
- package/dist/chat-channel.js +11 -0
- package/dist/chat-decide.d.ts +7 -2
- package/dist/chat-decide.js +37 -9
- package/dist/chat-quiet.js +3 -3
- package/dist/chat-voice.d.ts +1 -1
- package/dist/chat-voice.js +2 -2
- package/dist/check-facts.d.ts +126 -0
- package/dist/check-facts.js +318 -0
- package/dist/check-failure.d.ts +22 -3
- package/dist/check-failure.js +57 -13
- package/dist/check-levels-ui.d.ts +4 -0
- package/dist/check-levels-ui.js +10 -1
- package/dist/check-load.d.ts +85 -0
- package/dist/check-load.js +147 -0
- package/dist/check-only-standing.d.ts +36 -0
- package/dist/check-only-standing.js +39 -0
- package/dist/check-only.d.ts +15 -0
- package/dist/check-only.js +99 -0
- package/dist/check-report.d.ts +7 -0
- package/dist/check-report.js +4 -3
- package/dist/check-stamp.d.ts +46 -0
- package/dist/check-stamp.js +93 -0
- package/dist/checkout-cleanup.d.ts +36 -5
- package/dist/checkout-cleanup.js +166 -14
- package/dist/cli-help.d.ts +4 -1
- package/dist/cli-help.js +47 -30
- package/dist/cli.js +16 -1
- package/dist/code-extract.d.ts +44 -0
- package/dist/code-extract.js +88 -0
- package/dist/code-map-acts.d.ts +24 -0
- package/dist/code-map-acts.js +53 -0
- package/dist/code-map-admission.d.ts +52 -0
- package/dist/code-map-admission.js +295 -0
- package/dist/code-map-build.d.ts +63 -0
- package/dist/code-map-build.js +415 -0
- package/dist/code-map-cli.d.ts +153 -0
- package/dist/code-map-cli.js +103 -0
- package/dist/code-map-main.d.ts +1 -0
- package/dist/code-map-main.js +48 -0
- package/dist/code-map-read.d.ts +106 -0
- package/dist/code-map-read.js +171 -0
- package/dist/code-map-report.d.ts +37 -0
- package/dist/code-map-report.js +95 -0
- package/dist/code-map-shape.d.ts +172 -0
- package/dist/code-map-shape.js +327 -0
- package/dist/code-map-store.d.ts +136 -0
- package/dist/code-map-store.js +233 -0
- package/dist/coding-provider.d.ts +2 -0
- package/dist/coding-provider.js +3 -2
- package/dist/coding-update.js +3 -2
- package/dist/coding-workspace.js +4 -4
- package/dist/console-chrome.js +2 -2
- package/dist/containment.d.ts +5 -0
- package/dist/containment.js +14 -1
- package/dist/contracts/chat-actions.d.ts +9 -0
- package/dist/contracts/chat-actions.js +2 -0
- package/dist/contracts/cli.d.ts +52 -0
- package/dist/contracts/cli.js +4 -0
- package/dist/contracts/console-api.d.ts +12 -5
- package/dist/contracts/console-api.js +12 -5
- package/dist/contracts/gateway-tools.d.ts +17 -0
- package/dist/contracts/gateway-tools.js +3 -1
- package/dist/contracts/lead-tools.d.ts +61 -0
- package/dist/contracts/lead-tools.js +10 -1
- package/dist/contracts/project-knowledge.d.ts +38 -5
- package/dist/contracts/project-knowledge.js +11 -5
- package/dist/contracts/project-memory.d.ts +3 -1
- package/dist/contracts/project-memory.js +3 -2
- package/dist/contracts/release-check.d.ts +25 -1
- package/dist/contracts/release-check.js +19 -0
- package/dist/contracts/storage.d.ts +14 -0
- package/dist/contracts/storage.js +3 -1
- package/dist/contracts/store-json.d.ts +2 -0
- package/dist/contracts/youiyoux-request.d.ts +1 -1
- package/dist/contracts/youiyoux-request.js +1 -1
- package/dist/desktop-access.js +6 -2
- package/dist/desktop-update.d.ts +2 -2
- package/dist/desktop-update.js +13 -9
- package/dist/dispatch.js +18 -15
- package/dist/dispose.js +8 -2
- package/dist/easy-start.js +2 -3
- package/dist/eval-hooks.d.ts +55 -0
- package/dist/eval-hooks.js +227 -4
- package/dist/evals.js +2 -1
- package/dist/fast-start.d.ts +136 -0
- package/dist/fast-start.js +431 -0
- package/dist/fast-terms.d.ts +9 -0
- package/dist/fast-terms.js +23 -0
- package/dist/fenced-check-coverage.d.ts +62 -0
- package/dist/fenced-check-coverage.js +54 -0
- package/dist/first-run.js +1 -1
- package/dist/flaky-ci.d.ts +31 -0
- package/dist/flaky-ci.js +149 -0
- package/dist/flaky-cli.d.ts +60 -0
- package/dist/flaky-cli.js +60 -0
- package/dist/flaky.d.ts +83 -0
- package/dist/flaky.js +264 -0
- package/dist/flow-card-task.js +3 -0
- package/dist/flow-triggers.d.ts +1 -1
- package/dist/flow-triggers.js +1 -1
- package/dist/github-import.d.ts +62 -0
- package/dist/github-import.js +146 -0
- package/dist/guides.js +15 -10
- package/dist/invoke.d.ts +5 -1
- package/dist/invoke.js +49 -14
- package/dist/job-object-helper.ps1 +10 -3
- package/dist/keymap.d.ts +41 -0
- package/dist/keymap.js +51 -0
- package/dist/knowledge-cli.js +1 -1
- package/dist/knowledge-ui.d.ts +21 -4
- package/dist/knowledge-ui.js +75 -7
- package/dist/laptop-background.d.ts +16 -0
- package/dist/laptop-background.js +108 -2
- package/dist/lead-context.js +1 -1
- package/dist/lead-contract.d.ts +1 -1
- package/dist/lead-contract.js +2 -2
- package/dist/lead-progress.js +3 -0
- package/dist/lead-status.d.ts +2 -0
- package/dist/lead-status.js +6 -2
- package/dist/lead-tools.js +51 -2
- package/dist/lead.js +1 -1
- package/dist/lesson-notes.d.ts +81 -0
- package/dist/lesson-notes.js +336 -0
- package/dist/limits-ui.js +1 -1
- package/dist/local-owner.d.ts +1 -1
- package/dist/local-owner.js +11 -0
- package/dist/machine-check.d.ts +16 -0
- package/dist/machine-check.js +26 -0
- package/dist/machine-identity.d.ts +75 -0
- package/dist/machine-identity.js +170 -0
- package/dist/mcp-core.js +11 -1
- package/dist/memory-cli.d.ts +300 -1
- package/dist/memory-cli.js +62 -9
- package/dist/memory-pass.d.ts +16 -0
- package/dist/memory-pass.js +67 -3
- package/dist/memory-tidy.d.ts +181 -0
- package/dist/memory-tidy.js +523 -0
- package/dist/memory-use.d.ts +35 -0
- package/dist/memory-use.js +109 -0
- package/dist/merge-checklist.d.ts +55 -0
- package/dist/merge-checklist.js +182 -0
- package/dist/needs-you.d.ts +32 -13
- package/dist/needs-you.js +108 -49
- package/dist/nightly-github.d.ts +2 -0
- package/dist/nightly-github.js +4 -4
- package/dist/operate-remote-arguments.js +6 -1
- package/dist/operate-remote.js +3 -1
- package/dist/operate.d.ts +6 -1
- package/dist/operate.js +540 -70
- package/dist/phase-routing.js +2 -2
- package/dist/plain-schema.d.ts +23 -0
- package/dist/plain-schema.js +94 -0
- package/dist/plain-words.d.ts +20 -0
- package/dist/plain-words.js +66 -0
- package/dist/planner.js +2 -1
- package/dist/process-liveness.d.ts +2 -0
- package/dist/process-liveness.js +61 -17
- package/dist/project-delete-ui.d.ts +7 -2
- package/dist/project-delete-ui.js +12 -1
- package/dist/project-delete.js +13 -2
- package/dist/project-knowledge.d.ts +18 -11
- package/dist/project-knowledge.js +39 -9
- package/dist/project-learning.d.ts +2 -1
- package/dist/project-learning.js +15 -45
- package/dist/project-memory.d.ts +5 -0
- package/dist/project-memory.js +22 -2
- package/dist/proof.js +30 -5
- package/dist/provider-auth.js +1 -1
- package/dist/publish.js +9 -1
- package/dist/pull-request-flow.js +5 -0
- package/dist/push.d.ts +26 -3
- package/dist/push.js +55 -15
- package/dist/release-adapters.d.ts +9 -0
- package/dist/release-adapters.js +87 -1
- package/dist/release-approval.d.ts +191 -0
- package/dist/release-approval.js +382 -0
- package/dist/release-auto.js +26 -17
- package/dist/release-card.d.ts +74 -6
- package/dist/release-card.js +179 -23
- package/dist/release-carry.d.ts +7 -2
- package/dist/release-carry.js +39 -9
- package/dist/release-cli.d.ts +4 -0
- package/dist/release-cli.js +38 -23
- package/dist/release-coverage.js +1 -1
- package/dist/release-next.d.ts +48 -0
- package/dist/release-next.js +161 -0
- package/dist/release.d.ts +50 -1
- package/dist/release.js +118 -11
- package/dist/remote-destination.d.ts +36 -0
- package/dist/remote-destination.js +217 -0
- package/dist/remote-main.d.ts +48 -0
- package/dist/remote-main.js +84 -5
- package/dist/repository-context.d.ts +3 -2
- package/dist/repository-context.js +112 -70
- package/dist/restart-certification.d.ts +1 -0
- package/dist/restart-certification.js +8 -6
- package/dist/result-acts.d.ts +29 -21
- package/dist/result-acts.js +36 -25
- package/dist/result-follow-ups.d.ts +2 -2
- package/dist/result-follow-ups.js +18 -4
- package/dist/result-review.d.ts +1 -1
- package/dist/route-change-check.d.ts +4 -0
- package/dist/route-change-check.js +13 -0
- package/dist/route-change.d.ts +22 -0
- package/dist/route-change.js +89 -0
- package/dist/route-hooks.js +3 -2
- package/dist/route-results.d.ts +6 -1
- package/dist/route-results.js +14 -5
- package/dist/run-closeout.d.ts +1 -1
- package/dist/run-closeout.js +7 -5
- package/dist/runner-process.js +3 -2
- package/dist/runner.js +2 -1
- package/dist/scope.d.ts +6 -1
- package/dist/scope.js +22 -9
- package/dist/serve.d.ts +1 -1
- package/dist/serve.js +24 -18
- package/dist/server/chat.js +14 -12
- package/dist/server/chrome.d.ts +1 -1
- package/dist/server/chrome.js +26 -35
- package/dist/server/console.css +23 -0
- package/dist/server/guards.js +4 -0
- package/dist/server/home.d.ts +6 -0
- package/dist/server/home.js +21 -13
- package/dist/server/http.js +1 -1
- package/dist/server/kit.js +1 -1
- package/dist/server/merge-ready-view.d.ts +10 -0
- package/dist/server/merge-ready-view.js +30 -0
- package/dist/server/pages-assets.d.ts +1 -0
- package/dist/server/pages-assets.js +8 -5
- package/dist/server/pages.js +103 -82
- package/dist/server/render-chat.js +2 -2
- package/dist/server/render-code-map.d.ts +30 -0
- package/dist/server/render-code-map.js +137 -0
- package/dist/server/render-flaky.d.ts +20 -0
- package/dist/server/render-flaky.js +59 -0
- package/dist/server/render-history.js +1 -1
- package/dist/server/render-new-task.d.ts +26 -1
- package/dist/server/render-new-task.js +30 -5
- package/dist/server/render-pages.d.ts +1 -175
- package/dist/server/render-pages.js +38 -313
- package/dist/server/render-projects.d.ts +2 -1
- package/dist/server/render-projects.js +9 -7
- package/dist/server/render-release.d.ts +19 -0
- package/dist/server/render-release.js +84 -0
- package/dist/server/render-results.d.ts +2 -2
- package/dist/server/render-results.js +71 -73
- package/dist/server/render-tasks.d.ts +13 -2
- package/dist/server/render-tasks.js +156 -139
- package/dist/server/retired-routes.d.ts +17 -0
- package/dist/server/retired-routes.js +53 -0
- package/dist/server/route-table.d.ts +4 -1
- package/dist/server/route-table.js +52 -13
- package/dist/server/settings.js +129 -22
- package/dist/server/task-views.js +61 -26
- package/dist/server/tasks.d.ts +17 -6
- package/dist/server/tasks.js +273 -338
- package/dist/server/welcome.js +1 -1
- package/dist/settings-groups-ui.js +1 -1
- package/dist/setup-guide.d.ts +2 -2
- package/dist/stop-proof.d.ts +67 -0
- package/dist/stop-proof.js +295 -0
- package/dist/storage-sweep-process.js +1 -1
- package/dist/storage-sweep.d.ts +5 -3
- package/dist/storage-sweep.js +30 -9
- package/dist/storage-ui.js +28 -17
- package/dist/storage.d.ts +27 -2
- package/dist/storage.js +39 -2
- package/dist/store.d.ts +148 -34
- package/dist/store.js +626 -177
- package/dist/surface.js +46 -5
- package/dist/sweep-quarantine.d.ts +1 -0
- package/dist/sweep-quarantine.js +6 -4
- package/dist/tamper-scan.d.ts +4 -0
- package/dist/tamper-scan.js +90 -0
- package/dist/task-aliases.d.ts +5 -0
- package/dist/task-aliases.js +9 -0
- package/dist/task-control.js +4 -1
- package/dist/task-outcome-cli.d.ts +2 -0
- package/dist/task-outcome-cli.js +36 -17
- package/dist/task-sizing.d.ts +5 -0
- package/dist/task-sizing.js +2 -0
- package/dist/task-source.d.ts +7 -0
- package/dist/task-source.js +14 -0
- package/dist/task-status.d.ts +9 -0
- package/dist/task-status.js +40 -49
- package/dist/teardown-git.d.ts +16 -0
- package/dist/teardown-git.js +63 -5
- package/dist/telegram-progress.js +5 -3
- package/dist/telegram-status.js +6 -4
- package/dist/test-infra.d.ts +8 -0
- package/dist/test-infra.js +18 -0
- package/dist/tidy.js +1 -1
- package/dist/toolroll-update-ui.js +2 -2
- package/dist/toolroll-update.js +18 -5
- package/dist/tui-contract.d.ts +24 -0
- package/dist/tui-source.js +67 -8
- package/dist/tui.js +51 -51
- package/dist/vanished-retry.d.ts +30 -0
- package/dist/vanished-retry.js +174 -0
- package/dist/work-index.d.ts +2 -0
- package/dist/work-index.js +82 -70
- package/dist/work-summary.d.ts +2 -2
- package/dist/work-summary.js +2 -0
- package/dist/workspace-ui.d.ts +4 -2
- package/dist/workspace-ui.js +28 -22
- package/dist/worktree.d.ts +12 -3
- package/dist/worktree.js +68 -13
- package/package.json +1 -1
- package/dist/server/render-next.d.ts +0 -63
- package/dist/server/render-next.js +0 -109
|
@@ -49,6 +49,19 @@ export declare const GATEWAY_TOOL_INPUTS: {
|
|
|
49
49
|
search: "search";
|
|
50
50
|
}>>;
|
|
51
51
|
}, z.core.$strict>;
|
|
52
|
+
readonly get_code_map: z.ZodObject<{
|
|
53
|
+
repo: z.ZodString;
|
|
54
|
+
version: z.ZodOptional<z.ZodInt>;
|
|
55
|
+
view: z.ZodEnum<{
|
|
56
|
+
area: "area";
|
|
57
|
+
file: "file";
|
|
58
|
+
overview: "overview";
|
|
59
|
+
search: "search";
|
|
60
|
+
}>;
|
|
61
|
+
id: z.ZodOptional<z.ZodString>;
|
|
62
|
+
query: z.ZodOptional<z.ZodString>;
|
|
63
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strict>;
|
|
52
65
|
readonly get_assignment: z.ZodObject<{
|
|
53
66
|
ref: z.ZodString;
|
|
54
67
|
}, z.core.$strict>;
|
|
@@ -157,6 +170,10 @@ export declare const GATEWAY_TOOL_OUTPUTS: {
|
|
|
157
170
|
asOf: z.ZodString;
|
|
158
171
|
excerpts: z.ZodArray<z.ZodUnknown>;
|
|
159
172
|
}, z.core.$loose>;
|
|
173
|
+
readonly get_code_map: z.ZodObject<{
|
|
174
|
+
v: z.ZodLiteral<1>;
|
|
175
|
+
ok: z.ZodBoolean;
|
|
176
|
+
}, z.core.$loose>;
|
|
160
177
|
readonly get_assignment: z.ZodObject<{
|
|
161
178
|
version: z.ZodLiteral<1>;
|
|
162
179
|
rootId: z.ZodString;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
import { TEXT_LIMITS } from "../text-limits.js";
|
|
13
13
|
import { envelopeSchema } from "./cli.js";
|
|
14
|
-
import { catchUpOutput, decisionOutput, decisionsOutput, LISTED_TASK_STATES, queueColumnsOutput, recapOutput, repositoryContextOutput, scopeText, touches } from "./lead-tools.js";
|
|
14
|
+
import { catchUpOutput, CODE_MAP_VIEWS, codeMapOutput, decisionOutput, decisionsOutput, LISTED_TASK_STATES, queueColumnsOutput, recapOutput, repositoryContextOutput, scopeText, touches } from "./lead-tools.js";
|
|
15
15
|
const text = (key) => z.string().max(TEXT_LIMITS[key]);
|
|
16
16
|
const ref = z.string().min(1).max(TEXT_LIMITS.taskRef);
|
|
17
17
|
const projectPath = text("projectPath").min(1);
|
|
@@ -30,6 +30,7 @@ export const ASSIGNMENT_INPUTS = {
|
|
|
30
30
|
};
|
|
31
31
|
export const GATEWAY_TOOL_INPUTS = {
|
|
32
32
|
get_project_context: z.strictObject({ repo: projectPath, query: text("contextQuery").min(1), mode: z.enum(["search", "impact"]).optional() }),
|
|
33
|
+
get_code_map: z.strictObject({ repo: projectPath, version: z.int().min(1).optional(), view: z.enum(CODE_MAP_VIEWS), id: text("projectPath").optional(), query: text("contextQuery").optional(), cursor: z.string().max(40).optional() }),
|
|
33
34
|
get_assignment: ASSIGNMENT_INPUTS.show,
|
|
34
35
|
list_assignment_updates: ASSIGNMENT_INPUTS.updates,
|
|
35
36
|
claim_assignment: ASSIGNMENT_INPUTS.claim,
|
|
@@ -68,6 +69,7 @@ const proposed = z.looseObject({ proposal: int, kind: z.enum(["next", "reserve",
|
|
|
68
69
|
const assignmentOutput = z.looseObject({ version: z.literal(1), rootId: str, activeTaskId: str, title: str, state: str, detail: str, attention: z.array(str) });
|
|
69
70
|
export const GATEWAY_TOOL_OUTPUTS = {
|
|
70
71
|
get_project_context: repositoryContextOutput,
|
|
72
|
+
get_code_map: codeMapOutput,
|
|
71
73
|
get_assignment: assignmentOutput,
|
|
72
74
|
list_assignment_updates: z.looseObject({ events: list, nextCursor: int, hasMore: z.boolean() }),
|
|
73
75
|
claim_assignment: assignmentOutput,
|
|
@@ -30,6 +30,7 @@ export declare const acceptance: z.ZodArray<z.ZodObject<{
|
|
|
30
30
|
screenshot: "screenshot";
|
|
31
31
|
}>>;
|
|
32
32
|
}, z.core.$strict>>;
|
|
33
|
+
export declare const CODE_MAP_VIEWS: readonly ["overview", "area", "file", "search"];
|
|
33
34
|
/** Task states a list filters by. */
|
|
34
35
|
export declare const LISTED_TASK_STATES: readonly ["queued", "running", "done", "failed", "cancelled"];
|
|
35
36
|
export declare const LEAD_TOOL_INPUTS: {
|
|
@@ -48,6 +49,22 @@ export declare const LEAD_TOOL_INPUTS: {
|
|
|
48
49
|
search: "search";
|
|
49
50
|
}>>;
|
|
50
51
|
}, z.core.$strict>;
|
|
52
|
+
readonly get_code_map: z.ZodObject<{
|
|
53
|
+
repo: z.ZodString;
|
|
54
|
+
version: z.ZodOptional<z.ZodInt>;
|
|
55
|
+
view: z.ZodEnum<{
|
|
56
|
+
area: "area";
|
|
57
|
+
file: "file";
|
|
58
|
+
overview: "overview";
|
|
59
|
+
search: "search";
|
|
60
|
+
}>;
|
|
61
|
+
id: z.ZodOptional<z.ZodString>;
|
|
62
|
+
query: z.ZodOptional<z.ZodString>;
|
|
63
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
readonly refresh_code_map: z.ZodObject<{
|
|
66
|
+
repo: z.ZodString;
|
|
67
|
+
}, z.core.$strict>;
|
|
51
68
|
readonly get_action_status: z.ZodObject<{
|
|
52
69
|
proposal: z.ZodInt;
|
|
53
70
|
}, z.core.$strict>;
|
|
@@ -74,6 +91,7 @@ export declare const LEAD_TOOL_INPUTS: {
|
|
|
74
91
|
url: z.ZodOptional<z.ZodString>;
|
|
75
92
|
secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
76
93
|
about: z.ZodOptional<z.ZodString>;
|
|
94
|
+
on: z.ZodOptional<z.ZodBoolean>;
|
|
77
95
|
}, z.core.$strict>;
|
|
78
96
|
readonly propose_task_action: z.ZodObject<{
|
|
79
97
|
task: z.ZodString;
|
|
@@ -537,6 +555,10 @@ export declare const LEAD_TOOL_INPUTS: {
|
|
|
537
555
|
reference: z.ZodOptional<z.ZodString>;
|
|
538
556
|
decision: z.ZodOptional<z.ZodInt>;
|
|
539
557
|
}, z.core.$strict>;
|
|
558
|
+
readonly get_flaky_tests: z.ZodObject<{
|
|
559
|
+
repo: z.ZodString;
|
|
560
|
+
row: z.ZodOptional<z.ZodString>;
|
|
561
|
+
}, z.core.$strict>;
|
|
540
562
|
readonly get_task_conversation: z.ZodObject<{
|
|
541
563
|
task: z.ZodString;
|
|
542
564
|
limit: z.ZodOptional<z.ZodInt>;
|
|
@@ -785,6 +807,22 @@ export declare const LEAD_TOOL_READ_INPUTS: {
|
|
|
785
807
|
search: "search";
|
|
786
808
|
}>>;
|
|
787
809
|
}, z.core.$strict>;
|
|
810
|
+
readonly get_code_map: z.ZodObject<{
|
|
811
|
+
repo: z.ZodString;
|
|
812
|
+
version: z.ZodOptional<z.ZodInt>;
|
|
813
|
+
view: z.ZodEnum<{
|
|
814
|
+
area: "area";
|
|
815
|
+
file: "file";
|
|
816
|
+
overview: "overview";
|
|
817
|
+
search: "search";
|
|
818
|
+
}>;
|
|
819
|
+
id: z.ZodOptional<z.ZodString>;
|
|
820
|
+
query: z.ZodOptional<z.ZodString>;
|
|
821
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
822
|
+
}, z.core.$strict>;
|
|
823
|
+
readonly refresh_code_map: z.ZodObject<{
|
|
824
|
+
repo: z.ZodString;
|
|
825
|
+
}, z.core.$strict>;
|
|
788
826
|
readonly get_action_status: z.ZodObject<{
|
|
789
827
|
proposal: z.ZodInt;
|
|
790
828
|
}, z.core.$strict>;
|
|
@@ -811,6 +849,7 @@ export declare const LEAD_TOOL_READ_INPUTS: {
|
|
|
811
849
|
url: z.ZodOptional<z.ZodString>;
|
|
812
850
|
secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
813
851
|
about: z.ZodOptional<z.ZodString>;
|
|
852
|
+
on: z.ZodOptional<z.ZodBoolean>;
|
|
814
853
|
}, z.core.$strict>;
|
|
815
854
|
readonly propose_task_action: z.ZodObject<{
|
|
816
855
|
task: z.ZodString;
|
|
@@ -1267,6 +1306,10 @@ export declare const LEAD_TOOL_READ_INPUTS: {
|
|
|
1267
1306
|
reference: z.ZodOptional<z.ZodString>;
|
|
1268
1307
|
decision: z.ZodOptional<z.ZodInt>;
|
|
1269
1308
|
}, z.core.$strict>;
|
|
1309
|
+
readonly get_flaky_tests: z.ZodObject<{
|
|
1310
|
+
repo: z.ZodString;
|
|
1311
|
+
row: z.ZodOptional<z.ZodString>;
|
|
1312
|
+
}, z.core.$strict>;
|
|
1270
1313
|
readonly commit_to: z.ZodObject<{
|
|
1271
1314
|
what: z.ZodString;
|
|
1272
1315
|
when: z.ZodEnum<{
|
|
@@ -1503,6 +1546,11 @@ export declare const LEAD_TOOL_READ_INPUTS: {
|
|
|
1503
1546
|
export type LeadToolInput<N extends LeadToolName> = z.infer<(typeof LEAD_TOOL_READ_INPUTS)[N]>;
|
|
1504
1547
|
/** How a tool's call names a key it doesn't know: propose_flow suggests the flow vocabulary's own words. */
|
|
1505
1548
|
export declare const LEAD_TOOL_OPTIONS: Partial<Record<LeadToolName, ContractOptions>>;
|
|
1549
|
+
/** One bounded answer from the shared code map reader (code-map-read.ts `MapAnswer`). */
|
|
1550
|
+
export declare const codeMapOutput: z.ZodObject<{
|
|
1551
|
+
v: z.ZodLiteral<1>;
|
|
1552
|
+
ok: z.ZodBoolean;
|
|
1553
|
+
}, z.core.$loose>;
|
|
1506
1554
|
/** A repository-context read (repository-context.ts `RepositoryContext`). */
|
|
1507
1555
|
export declare const repositoryContextOutput: z.ZodObject<{
|
|
1508
1556
|
version: z.ZodLiteral<1>;
|
|
@@ -1609,6 +1657,16 @@ export declare const LEAD_TOOL_OUTPUTS: {
|
|
|
1609
1657
|
asOf: z.ZodString;
|
|
1610
1658
|
excerpts: z.ZodArray<z.ZodUnknown>;
|
|
1611
1659
|
}, z.core.$loose>;
|
|
1660
|
+
readonly get_code_map: z.ZodObject<{
|
|
1661
|
+
v: z.ZodLiteral<1>;
|
|
1662
|
+
ok: z.ZodBoolean;
|
|
1663
|
+
}, z.core.$loose>;
|
|
1664
|
+
readonly refresh_code_map: z.ZodObject<{
|
|
1665
|
+
request: z.ZodEnum<{
|
|
1666
|
+
"already-queued": "already-queued";
|
|
1667
|
+
queued: "queued";
|
|
1668
|
+
}>;
|
|
1669
|
+
}, z.core.$loose>;
|
|
1612
1670
|
readonly get_action_status: z.ZodObject<{
|
|
1613
1671
|
proposal: z.ZodNumber;
|
|
1614
1672
|
operation: z.ZodString;
|
|
@@ -1824,6 +1882,9 @@ export declare const LEAD_TOOL_OUTPUTS: {
|
|
|
1824
1882
|
readonly get_project_knowledge: z.ZodObject<{
|
|
1825
1883
|
revision: z.ZodNumber;
|
|
1826
1884
|
}, z.core.$loose>;
|
|
1885
|
+
readonly get_flaky_tests: z.ZodObject<{
|
|
1886
|
+
notice: z.ZodString;
|
|
1887
|
+
}, z.core.$loose>;
|
|
1827
1888
|
readonly get_task_conversation: z.ZodObject<{
|
|
1828
1889
|
task: z.ZodString;
|
|
1829
1890
|
messages: z.ZodArray<z.ZodObject<{
|
|
@@ -46,6 +46,7 @@ export const touches = z.array(text("taskTouch")).max(50);
|
|
|
46
46
|
export const acceptance = z.array(acceptanceCriterionSchema).min(1).max(ACCEPTANCE_LIMITS.criteria);
|
|
47
47
|
/** A note the operator's own words fill (revise feedback, steering, a flow card's note). */
|
|
48
48
|
const note = z.string().max(LIMITS.note, { error: issue => overBy(LIMITS.note, issue.input) }).describe(`At most ${LIMITS.note} characters; longer is refused with its length, not cut.`);
|
|
49
|
+
export const CODE_MAP_VIEWS = ["overview", "area", "file", "search"];
|
|
49
50
|
/** Task states a list filters by. */
|
|
50
51
|
export const LISTED_TASK_STATES = ["queued", "running", "done", "failed", "cancelled"];
|
|
51
52
|
/** The shared actions the lead proposes with propose_action; flows and subagents have their own tools. */
|
|
@@ -54,6 +55,8 @@ export const LEAD_TOOL_INPUTS = {
|
|
|
54
55
|
get_brief: z.strictObject({ repo: repoId.optional() }),
|
|
55
56
|
get_project_activity: z.strictObject({ repo: repoId, offset: offset.optional() }),
|
|
56
57
|
get_project_context: z.strictObject({ repo: repoId, query: text("contextQuery").min(1), mode: z.enum(["search", "impact"]).optional() }),
|
|
58
|
+
get_code_map: z.strictObject({ repo: repoId, version: id.optional(), view: z.enum(CODE_MAP_VIEWS), id: text("projectPath").optional(), query: text("contextQuery").optional(), cursor: z.string().max(40).optional() }),
|
|
59
|
+
refresh_code_map: z.strictObject({ repo: repoId }),
|
|
57
60
|
get_action_status: z.strictObject({ proposal: id }),
|
|
58
61
|
get_actions: z.strictObject({}),
|
|
59
62
|
propose_action: z.strictObject({
|
|
@@ -61,7 +64,7 @@ export const LEAD_TOOL_INPUTS = {
|
|
|
61
64
|
sample: text("actionSample").optional(), content: text("actionContent").optional(), instructions: text("flowInstructions").optional(),
|
|
62
65
|
title: text("actionTitle").optional(), id: z.string().optional(), run: id.optional(), note: note.optional(), catalog: text("actionName").optional(),
|
|
63
66
|
name: text("actionName").optional(), command: text("actionCommand").optional(), args: z.array(text("actionCommand")).max(40).optional(),
|
|
64
|
-
url: text("actionUrl").optional(), secrets: z.array(text("actionSecret")).max(12).optional(), about: text("actionAbout").optional(),
|
|
67
|
+
url: text("actionUrl").optional(), secrets: z.array(text("actionSecret")).max(12).optional(), about: text("actionAbout").optional(), on: z.boolean().optional(),
|
|
65
68
|
}),
|
|
66
69
|
propose_task_action: z.strictObject({ task: taskRef, operation: enumOf(Object.keys(CHAT_TASK_ACTIONS)), dependency: taskRef.optional(), run: id.optional() }),
|
|
67
70
|
get_controls: z.strictObject({}),
|
|
@@ -100,6 +103,7 @@ export const LEAD_TOOL_INPUTS = {
|
|
|
100
103
|
get_flow_insights: z.strictObject({ repo: repoId.optional(), flow: id.optional(), days: z.int().min(1).max(90).optional(), card: id.optional(), entry: id.optional() }),
|
|
101
104
|
get_skills: z.strictObject({ repo: repoId, version: z.string().regex(/^[a-f0-9]{20}$/).optional(), offset: offset.optional() }),
|
|
102
105
|
get_project_knowledge: z.strictObject({ repo: repoId, reference: text("knowledgeReference").optional(), decision: id.optional() }),
|
|
106
|
+
get_flaky_tests: z.strictObject({ repo: repoId, row: text("knowledgeReference").optional() }),
|
|
103
107
|
get_task_conversation: z.strictObject({ task: taskRef, limit: z.int().min(1).max(30).optional() }),
|
|
104
108
|
commit_to: z.strictObject({
|
|
105
109
|
what: text("promise").min(3), when: z.enum(["task", "run", "check", "time"]), task: taskRef.optional(), run: id.optional(),
|
|
@@ -185,6 +189,8 @@ const rows = (shape) => z.array(z.looseObject(shape));
|
|
|
185
189
|
const cardDrafted = z.looseObject({ proposal: int, label: str, awaiting: str, executed: z.literal(false) });
|
|
186
190
|
/** A proposal row drafted by one of the queue, hold, scope and answer tools. */
|
|
187
191
|
const proposed = (kind, shape = {}) => z.looseObject({ proposal: int, kind: z.literal(kind), awaiting: str, ...shape });
|
|
192
|
+
/** One bounded answer from the shared code map reader (code-map-read.ts `MapAnswer`). */
|
|
193
|
+
export const codeMapOutput = z.looseObject({ v: z.literal(1), ok: z.boolean() });
|
|
188
194
|
/** A repository-context read (repository-context.ts `RepositoryContext`). */
|
|
189
195
|
export const repositoryContextOutput = z.looseObject({ version: z.literal(1), readOnly: z.boolean(), query: str, mode: z.enum(["search", "impact"]), asOf: str, excerpts: list });
|
|
190
196
|
/** The local catch-up (assignment-brief.ts `AssignmentCatchUp`). */
|
|
@@ -201,6 +207,8 @@ export const LEAD_TOOL_OUTPUTS = {
|
|
|
201
207
|
get_brief: catchUpOutput,
|
|
202
208
|
get_project_activity: z.looseObject({ asOf: str, since: str, days: int, limit: int, truncated: z.boolean(), ready: z.object({ count: int, oldestFinishedAgeMs: nullable(int), dated: int }), completed: z.looseObject({ count: int }), families: list, familiesTotal: int, familiesOffset: int, nextOffset: nullable(int), incompleteHistory: int }),
|
|
203
209
|
get_project_context: repositoryContextOutput,
|
|
210
|
+
get_code_map: codeMapOutput,
|
|
211
|
+
refresh_code_map: z.looseObject({ request: z.enum(["queued", "already-queued"]) }),
|
|
204
212
|
get_action_status: z.looseObject({ proposal: int, operation: str, state: str, outcome: z.unknown(), finishedAt: nullable(str) }),
|
|
205
213
|
get_actions: z.looseObject({ actions: rows({ operation: str, label: str, secureReview: z.boolean(), inputs: z.array(str) }), notice: str }),
|
|
206
214
|
propose_action: cardDrafted,
|
|
@@ -241,6 +249,7 @@ export const LEAD_TOOL_OUTPUTS = {
|
|
|
241
249
|
z.looseObject({ skills: list, nextOffset: nullable(int) }),
|
|
242
250
|
]),
|
|
243
251
|
get_project_knowledge: z.looseObject({ revision: int }),
|
|
252
|
+
get_flaky_tests: z.looseObject({ notice: z.string() }),
|
|
244
253
|
get_task_conversation: z.looseObject({ task: str, messages: rows({ from: z.enum(["operator", "lead"]), text: str, at: str }), notice: nullable(str) }),
|
|
245
254
|
commit_to: z.looseObject({ commitment: int, condition: str, expires: str, report: str }),
|
|
246
255
|
release_commitment: z.looseObject({ commitment: int, state: z.literal("cancelled") }),
|
|
@@ -68,10 +68,12 @@ export declare const knowledgeOmissionSchema: z.ZodObject<{
|
|
|
68
68
|
title: z.ZodString;
|
|
69
69
|
reason: z.ZodString;
|
|
70
70
|
}, z.core.$strict>;
|
|
71
|
-
|
|
71
|
+
/** Version 2 (docs/plans/learning-loops.md, "Versioned snapshots"): a selection says when it was frozen, and its decision
|
|
72
|
+
* lines their revision. Version 1 stays readable exactly as it was frozen, its fields as they are. */
|
|
73
|
+
export declare const KNOWLEDGE_SELECTION_VERSION = 2;
|
|
72
74
|
/** The selection a run is given, as it is frozen. The keys are in the order a selection has always been written. */
|
|
73
75
|
export declare const knowledgeSelectionSchema: z.ZodObject<{
|
|
74
|
-
version: z.ZodLiteral<
|
|
76
|
+
version: z.ZodLiteral<2>;
|
|
75
77
|
revision: z.ZodInt;
|
|
76
78
|
instructions: z.ZodString;
|
|
77
79
|
references: z.ZodArray<z.ZodObject<{
|
|
@@ -91,11 +93,39 @@ export declare const knowledgeSelectionSchema: z.ZodObject<{
|
|
|
91
93
|
id: z.ZodInt;
|
|
92
94
|
claim: z.ZodString;
|
|
93
95
|
decidedAt: z.ZodString;
|
|
96
|
+
revision: z.ZodOptional<z.ZodInt>;
|
|
94
97
|
}, z.core.$strict>>>;
|
|
95
98
|
repository: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
99
|
+
capturedAt: z.ZodString;
|
|
96
100
|
}, z.core.$strict>;
|
|
97
|
-
/** A frozen selection as it is read back. */
|
|
101
|
+
/** A frozen selection as it is read back: the version it was frozen under. */
|
|
98
102
|
export declare const savedKnowledgeSelectionSchema: z.ZodObject<{
|
|
103
|
+
version: z.ZodLiteral<2>;
|
|
104
|
+
revision: z.ZodInt;
|
|
105
|
+
instructions: z.ZodString;
|
|
106
|
+
references: z.ZodArray<z.ZodObject<{
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
title: z.ZodString;
|
|
109
|
+
content: z.ZodString;
|
|
110
|
+
path: z.ZodNullable<z.ZodString>;
|
|
111
|
+
sourceSha: z.ZodNullable<z.ZodString>;
|
|
112
|
+
sourceRevision: z.ZodNullable<z.ZodString>;
|
|
113
|
+
}, z.core.$strict>>;
|
|
114
|
+
omitted: z.ZodArray<z.ZodObject<{
|
|
115
|
+
title: z.ZodString;
|
|
116
|
+
reason: z.ZodString;
|
|
117
|
+
}, z.core.$strict>>;
|
|
118
|
+
inheritedFrom: z.ZodNullable<z.ZodInt>;
|
|
119
|
+
decisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
120
|
+
id: z.ZodInt;
|
|
121
|
+
claim: z.ZodString;
|
|
122
|
+
decidedAt: z.ZodString;
|
|
123
|
+
revision: z.ZodOptional<z.ZodInt>;
|
|
124
|
+
}, z.core.$strict>>>;
|
|
125
|
+
repository: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
126
|
+
capturedAt: z.ZodString;
|
|
127
|
+
}, z.core.$strict>;
|
|
128
|
+
export declare const savedKnowledgeSelectionV1Schema: z.ZodObject<{
|
|
99
129
|
version: z.ZodLiteral<1>;
|
|
100
130
|
revision: z.ZodInt;
|
|
101
131
|
instructions: z.ZodString;
|
|
@@ -116,11 +146,14 @@ export declare const savedKnowledgeSelectionSchema: z.ZodObject<{
|
|
|
116
146
|
id: z.ZodInt;
|
|
117
147
|
claim: z.ZodString;
|
|
118
148
|
decidedAt: z.ZodString;
|
|
149
|
+
revision: z.ZodOptional<z.ZodInt>;
|
|
119
150
|
}, z.core.$strict>>>;
|
|
120
151
|
repository: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
121
152
|
}, z.core.$strict>;
|
|
122
|
-
export type KnowledgeSelection = Omit<z.infer<typeof knowledgeSelectionSchema>, "repository"> & {
|
|
153
|
+
export type KnowledgeSelection = Omit<z.infer<typeof knowledgeSelectionSchema>, "repository" | "version" | "capturedAt"> & {
|
|
154
|
+
version: 1 | 2;
|
|
155
|
+
capturedAt?: string;
|
|
123
156
|
repository?: RepositoryContext;
|
|
124
157
|
};
|
|
125
|
-
/** Read a frozen selection: version 1
|
|
158
|
+
/** Read a frozen selection: version 1 and 2 each as themselves, a newer one refused plainly. */
|
|
126
159
|
export declare function readKnowledgeSelection(input: unknown): ContractResult<KnowledgeSelection>;
|
|
@@ -82,12 +82,18 @@ const selectionShape = (text) => ({
|
|
|
82
82
|
/** Source excerpts from the crew's checkout (repository-context.ts owns their shape); absent when not captured. */
|
|
83
83
|
repository: z.looseObject({}).optional(),
|
|
84
84
|
});
|
|
85
|
-
|
|
85
|
+
/** Version 2 (docs/plans/learning-loops.md, "Versioned snapshots"): a selection says when it was frozen, and its decision
|
|
86
|
+
* lines their revision. Version 1 stays readable exactly as it was frozen, its fields as they are. */
|
|
87
|
+
export const KNOWLEDGE_SELECTION_VERSION = 2;
|
|
86
88
|
/** The selection a run is given, as it is frozen. The keys are in the order a selection has always been written. */
|
|
87
|
-
export const knowledgeSelectionSchema = versioned(KNOWLEDGE_SELECTION_VERSION, selectionShape(written));
|
|
88
|
-
/** A frozen selection as it is read back. */
|
|
89
|
-
export const savedKnowledgeSelectionSchema = versioned(KNOWLEDGE_SELECTION_VERSION, selectionShape(saved));
|
|
90
|
-
|
|
89
|
+
export const knowledgeSelectionSchema = versioned(KNOWLEDGE_SELECTION_VERSION, { ...selectionShape(written), capturedAt: z.string() });
|
|
90
|
+
/** A frozen selection as it is read back: the version it was frozen under. */
|
|
91
|
+
export const savedKnowledgeSelectionSchema = versioned(KNOWLEDGE_SELECTION_VERSION, { ...selectionShape(saved), capturedAt: z.string() });
|
|
92
|
+
export const savedKnowledgeSelectionV1Schema = versioned(1, selectionShape(saved));
|
|
93
|
+
/** Read a frozen selection: version 1 and 2 each as themselves, a newer one refused plainly. */
|
|
91
94
|
export function readKnowledgeSelection(input) {
|
|
95
|
+
const version = input !== null && typeof input === "object" ? input.version : undefined;
|
|
96
|
+
if (version === 1)
|
|
97
|
+
return readVersioned(savedKnowledgeSelectionV1Schema, input);
|
|
92
98
|
return readVersioned(savedKnowledgeSelectionSchema, input);
|
|
93
99
|
}
|
|
@@ -75,11 +75,13 @@ export declare const decisionDraftSchema: z.ZodObject<{
|
|
|
75
75
|
supersedes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
76
76
|
}, z.core.$strict>;
|
|
77
77
|
export type DecisionDraft = z.infer<typeof decisionDraftSchema>;
|
|
78
|
-
/** One decision in a brief: its id, the choice and when
|
|
78
|
+
/** One decision in a brief: its id, the choice and when (the revision on snapshots from version 2 on); the why loads on
|
|
79
|
+
* demand by id. */
|
|
79
80
|
export declare const decisionLineSchema: z.ZodObject<{
|
|
80
81
|
id: z.ZodInt;
|
|
81
82
|
claim: z.ZodString;
|
|
82
83
|
decidedAt: z.ZodString;
|
|
84
|
+
revision: z.ZodOptional<z.ZodInt>;
|
|
83
85
|
}, z.core.$strict>;
|
|
84
86
|
export type DecisionLine = z.infer<typeof decisionLineSchema>;
|
|
85
87
|
export declare const DECISION_CHANGE_VERSION = 1;
|
|
@@ -38,8 +38,9 @@ export const decisionDraftSchema = z.strictObject({
|
|
|
38
38
|
sourceRef: z.string().nullable().optional(),
|
|
39
39
|
supersedes: z.int().nullable().optional(),
|
|
40
40
|
});
|
|
41
|
-
/** One decision in a brief: its id, the choice and when
|
|
42
|
-
|
|
41
|
+
/** One decision in a brief: its id, the choice and when (the revision on snapshots from version 2 on); the why loads on
|
|
42
|
+
* demand by id. */
|
|
43
|
+
export const decisionLineSchema = z.strictObject({ id: z.int(), claim: z.string(), decidedAt: z.string(), revision: z.int().min(1).optional() });
|
|
43
44
|
export const DECISION_CHANGE_VERSION = 1;
|
|
44
45
|
/**
|
|
45
46
|
* One entry of a decision's history (`decision_change.payload`): the record when it was made, or the reason its status
|
|
@@ -233,7 +233,9 @@ export declare const obligationSnapshotSchema: z.ZodObject<{
|
|
|
233
233
|
}, z.core.$strict>>;
|
|
234
234
|
}, z.core.$strict>;
|
|
235
235
|
export type ObligationSnapshot = z.infer<typeof obligationSnapshotSchema>;
|
|
236
|
-
/** What the plane writes on the check's stdin before closing it.
|
|
236
|
+
/** What the plane writes on the check's stdin before closing it. `learn` (docs/plans/learning-loops.md) is advisory and
|
|
237
|
+
* apart from everything else: exact case identities the check is asked to say it ran, on their own line
|
|
238
|
+
* (LEARN_PREFIX), never in the report and never part of what the check owes. */
|
|
237
239
|
export type CheckHandshake = {
|
|
238
240
|
nonce: string;
|
|
239
241
|
mode: "full" | "targeted";
|
|
@@ -241,7 +243,29 @@ export type CheckHandshake = {
|
|
|
241
243
|
watch: string[];
|
|
242
244
|
owed?: CheckPart[];
|
|
243
245
|
ciSubstitute?: boolean;
|
|
246
|
+
learn?: string[];
|
|
244
247
|
};
|
|
248
|
+
/** The advisory learning line a check prints before its report: `TOOLROLL-LEARN <json>`, at most 64 KiB, holding only
|
|
249
|
+
* the requested identities that ran. Never part of the report: buildReport, reportLine and fullCheckProblem don't read
|
|
250
|
+
* it, and a missing, malformed or oversized one loses learning evidence only. */
|
|
251
|
+
export declare const LEARN_PREFIX = "TOOLROLL-LEARN ";
|
|
252
|
+
export declare const LEARN_MAX_BYTES: number;
|
|
253
|
+
export declare const LEARN_MAX_IDENTITIES = 200;
|
|
254
|
+
export declare const isExactCase: (identity: unknown) => identity is string;
|
|
255
|
+
/** What the plane asks a check to report for learning: exact cases only, first seen first, at most 200. */
|
|
256
|
+
export declare function learnRequest(identities: readonly unknown[]): string[];
|
|
257
|
+
export declare const learnLineSchema: z.ZodObject<{
|
|
258
|
+
nonce: z.ZodString;
|
|
259
|
+
results: z.ZodArray<z.ZodObject<{
|
|
260
|
+
identity: z.ZodString;
|
|
261
|
+
state: z.ZodEnum<{
|
|
262
|
+
failed: "failed";
|
|
263
|
+
passed: "passed";
|
|
264
|
+
skipped: "skipped";
|
|
265
|
+
}>;
|
|
266
|
+
}, z.core.$strict>>;
|
|
267
|
+
}, z.core.$strict>;
|
|
268
|
+
export type LearnLine = z.infer<typeof learnLineSchema>;
|
|
245
269
|
/** A unit test: its file and full name. */
|
|
246
270
|
export declare const unitIdentity: (file: string, testName: string) => string;
|
|
247
271
|
/** A unit file. */
|
|
@@ -146,6 +146,25 @@ export const obligationSnapshotSchema = versioned(1, {
|
|
|
146
146
|
base: z.int().min(1),
|
|
147
147
|
earlier: z.array(z.strictObject({ run: z.int().min(1), reportDigest: z.string().max(64).nullable(), failed: z.array(z.string().min(1).max(2600)).max(5000) })).max(200),
|
|
148
148
|
});
|
|
149
|
+
// ------------------------------------------------------------------ advisory learning lines (docs/plans/learning-loops.md)
|
|
150
|
+
/** The advisory learning line a check prints before its report: `TOOLROLL-LEARN <json>`, at most 64 KiB, holding only
|
|
151
|
+
* the requested identities that ran. Never part of the report: buildReport, reportLine and fullCheckProblem don't read
|
|
152
|
+
* it, and a missing, malformed or oversized one loses learning evidence only. */
|
|
153
|
+
export const LEARN_PREFIX = "TOOLROLL-LEARN ";
|
|
154
|
+
export const LEARN_MAX_BYTES = 64 * 1024;
|
|
155
|
+
export const LEARN_MAX_IDENTITIES = 200;
|
|
156
|
+
/** An exact case: a unit test (`unit:<file>::<name>`) or a journey (`journey:<script>:<kind>:<group>::<name>`), never a
|
|
157
|
+
* file, group, part or version; one line, no control characters, at most 2600 characters. */
|
|
158
|
+
const EXACT_CASE = /^(?:unit:[^\u0000-\u001f\\:][^\u0000-\u001f\\]*?::[^\u0000-\u001f]+|journey:(?:app|flows):(?:scripted|real):[A-Za-z0-9._/-]{1,200}::[^\u0000-\u001f]+)$/;
|
|
159
|
+
export const isExactCase = (identity) => typeof identity === "string" && identity.length <= 2600 && EXACT_CASE.test(identity);
|
|
160
|
+
/** What the plane asks a check to report for learning: exact cases only, first seen first, at most 200. */
|
|
161
|
+
export function learnRequest(identities) {
|
|
162
|
+
return [...new Set(identities.filter(isExactCase))].slice(0, LEARN_MAX_IDENTITIES);
|
|
163
|
+
}
|
|
164
|
+
export const learnLineSchema = z.strictObject({
|
|
165
|
+
nonce: hex64,
|
|
166
|
+
results: z.array(z.strictObject({ identity: z.string().min(1).max(2600), state: z.enum(["passed", "failed", "skipped"]) })).max(LEARN_MAX_IDENTITIES),
|
|
167
|
+
});
|
|
149
168
|
// ------------------------------------------------------------------ identities
|
|
150
169
|
/** A unit test: its file and full name. */
|
|
151
170
|
export const unitIdentity = (file, testName) => `unit:${file}::${testName}`;
|
|
@@ -11,6 +11,13 @@ export declare const checkoutCleanupSchema: z.ZodEnum<{
|
|
|
11
11
|
finished: "finished";
|
|
12
12
|
never: "never";
|
|
13
13
|
}>;
|
|
14
|
+
/** How long a task stays idle before its clean folder goes (v151, checkout-cleanup.ts). A saved row's NULL is the default. */
|
|
15
|
+
export declare const checkoutIdleSchema: z.ZodEnum<{
|
|
16
|
+
"14d": "14d";
|
|
17
|
+
"30d": "30d";
|
|
18
|
+
"7d": "7d";
|
|
19
|
+
never: "never";
|
|
20
|
+
}>;
|
|
14
21
|
/** A saved `checkout_cleanup_setting` row (at most one; none means the default), unknown columns ignored. */
|
|
15
22
|
export declare const checkoutCleanupRowSchema: z.ZodObject<{
|
|
16
23
|
cleanup: z.ZodEnum<{
|
|
@@ -19,5 +26,12 @@ export declare const checkoutCleanupRowSchema: z.ZodObject<{
|
|
|
19
26
|
finished: "finished";
|
|
20
27
|
never: "never";
|
|
21
28
|
}>;
|
|
29
|
+
idle: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
30
|
+
"14d": "14d";
|
|
31
|
+
"30d": "30d";
|
|
32
|
+
"7d": "7d";
|
|
33
|
+
never: "never";
|
|
34
|
+
}>>>;
|
|
22
35
|
}, z.core.$strip>;
|
|
23
36
|
export type CheckoutCleanup = z.infer<typeof checkoutCleanupSchema>;
|
|
37
|
+
export type CheckoutIdle = z.infer<typeof checkoutIdleSchema>;
|
|
@@ -6,5 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
export const checkoutCleanupSchema = z.enum(["finished", "2d", "7d", "never"]);
|
|
9
|
+
/** How long a task stays idle before its clean folder goes (v151, checkout-cleanup.ts). A saved row's NULL is the default. */
|
|
10
|
+
export const checkoutIdleSchema = z.enum(["7d", "14d", "30d", "never"]);
|
|
9
11
|
/** A saved `checkout_cleanup_setting` row (at most one; none means the default), unknown columns ignored. */
|
|
10
|
-
export const checkoutCleanupRowSchema = z.object({ cleanup: checkoutCleanupSchema });
|
|
12
|
+
export const checkoutCleanupRowSchema = z.object({ cleanup: checkoutCleanupSchema, idle: checkoutIdleSchema.nullable().optional() });
|
|
@@ -166,6 +166,8 @@ declare const STORE_COLUMN_VALUES: {
|
|
|
166
166
|
readonly "lead_proposal.payload_json": z.ZodUnion<readonly [z.ZodObject<{
|
|
167
167
|
version: z.ZodLiteral<1>;
|
|
168
168
|
operation: z.ZodEnum<{
|
|
169
|
+
code_map_holdout_end: "code_map_holdout_end";
|
|
170
|
+
code_map_switch: "code_map_switch";
|
|
169
171
|
decision_record: "decision_record";
|
|
170
172
|
decision_retire: "decision_retire";
|
|
171
173
|
flow_browser: "flow_browser";
|
|
@@ -15,7 +15,7 @@ export declare const YOUIYOUX_FILED_VIA = "youiyoux";
|
|
|
15
15
|
* Approve all and each one's own Approve and Open. */
|
|
16
16
|
export declare const YOUIYOUX_CARD_KIND = "youiyoux-requests";
|
|
17
17
|
/** Where a person sees and approves everything waiting on them in the console (flow-triggers.ts NEEDS_YOU_HREF). */
|
|
18
|
-
export declare const YOUIYOUX_HOME_PATH = "/
|
|
18
|
+
export declare const YOUIYOUX_HOME_PATH = "/tasks?view=needs-you";
|
|
19
19
|
export declare const YOUIYOUX_EVIDENCE: readonly ["screenshot", "check", "changed-path", "manual-review"];
|
|
20
20
|
/** What an options request offers its agent: the one file to write (`.youi/proposals/<proposal>.json`), the props an
|
|
21
21
|
* option may set (enum values from `values`), and whether it may give the component new text. */
|
|
@@ -15,7 +15,7 @@ export const YOUIYOUX_FILED_VIA = "youiyoux";
|
|
|
15
15
|
* Approve all and each one's own Approve and Open. */
|
|
16
16
|
export const YOUIYOUX_CARD_KIND = "youiyoux-requests";
|
|
17
17
|
/** Where a person sees and approves everything waiting on them in the console (flow-triggers.ts NEEDS_YOU_HREF). */
|
|
18
|
-
export const YOUIYOUX_HOME_PATH = "/
|
|
18
|
+
export const YOUIYOUX_HOME_PATH = "/tasks?view=needs-you";
|
|
19
19
|
const text = (max) => z.string().min(1).max(max);
|
|
20
20
|
const who = z.object({ kind: z.enum(["person", "agent"]), name: text(100) });
|
|
21
21
|
// The published schema's date-time: an ISO timestamp with a zone.
|
package/dist/desktop-access.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { mkdtempSync, readFileSync, writeFileSync, unlinkSync, rmdirSync, opendirSync, realpathSync } from "node:fs";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { execFileSync } from "node:child_process";
|
|
6
5
|
import { run } from "./exec.js";
|
|
6
|
+
import { checkoutGitSync, checkoutTop } from "./teardown-git.js";
|
|
7
7
|
export function accessFailure(repo, code) {
|
|
8
8
|
if (code === "EROFS")
|
|
9
9
|
return { repo, state: "permission-needed", message: "This project is on a read-only drive. Choose a writable copy; Privacy Settings cannot make a read-only drive writable." };
|
|
@@ -23,7 +23,11 @@ export function probeDesktopProject(repo) {
|
|
|
23
23
|
const directory = opendirSync(repo);
|
|
24
24
|
directory.readSync();
|
|
25
25
|
directory.closeSync();
|
|
26
|
-
|
|
26
|
+
// The project's own repository, read through a frozen view: a build's include naming a FIFO can't hang the probe.
|
|
27
|
+
const top = checkoutTop(repo, 4000);
|
|
28
|
+
if (top === null)
|
|
29
|
+
throw Error("Not a readable Git checkout");
|
|
30
|
+
const common = checkoutGitSync(top, ["rev-parse", "--path-format=absolute", "--git-common-dir"], { timeoutMs: 4000, binding: { repo: top } }).trim();
|
|
27
31
|
scratch = mkdtempSync(join(realpathSync(common), "standing-orders-access-"));
|
|
28
32
|
const file = join(scratch, "check");
|
|
29
33
|
writeFileSync(file, "Toolroll access check\n", { flag: "wx", mode: 0o600 });
|
package/dist/desktop-update.d.ts
CHANGED
|
@@ -74,8 +74,8 @@ export declare function desktopUpdateWaitingOf(databaseFile: string, inTheWay: (
|
|
|
74
74
|
/** The same settling reconcile the background worker runs: a finished run's leftover record of a process that never
|
|
75
75
|
* started settles once the run's process groups are proven gone. A record nothing can prove either way stays. */
|
|
76
76
|
export declare function settleLeftoverRecords(db: DatabaseSync, now: Date): number;
|
|
77
|
-
/** Store.stopQuiescenceProblem's reasons, said for a person: no internal terms
|
|
78
|
-
*
|
|
77
|
+
/** Store.stopQuiescenceProblem's reasons, said for a person: no internal terms. Nobody vouches that a run stopped:
|
|
78
|
+
* Toolroll proves it itself (stop-proof.ts), and `toolroll run settle` only has it look again now. */
|
|
79
79
|
export declare function plainLingering(fallbackRun: number, problem: string): LingeringRun;
|
|
80
80
|
export declare function previewDesktopUpdate(stateDir: string, installed: string, candidate: string, label: string, hooks?: UpdateHooks): Promise<{
|
|
81
81
|
old: DesktopBundle;
|
package/dist/desktop-update.js
CHANGED
|
@@ -193,11 +193,11 @@ export function lingeringWork(db) {
|
|
|
193
193
|
const lingering = lingeringRun(db);
|
|
194
194
|
return lingering && lingeringWords(lingering);
|
|
195
195
|
}
|
|
196
|
-
export const lingeringWords = (l) => l.action ? `${l.on}.
|
|
196
|
+
export const lingeringWords = (l) => l.action ? `${l.on}. To have Toolroll check again, run: ${l.action}` : `${l.on}.`;
|
|
197
197
|
/** What an update says when it stops waiting on `l`: what is in the way, the command, and that new work resumed. */
|
|
198
198
|
export const stoppedWaitingWords = (l) => `Stopped waiting after 2 minutes. ${l.on}. ${clearWords(l)} New work resumed; nothing was changed.`;
|
|
199
199
|
/** The next step once an update has stopped on `l`. */
|
|
200
|
-
export const clearWords = (l) => l.action ? `
|
|
200
|
+
export const clearWords = (l) => l.action ? `To have Toolroll check again, run ${l.action}, then update again.` : "Update again once it has stopped.";
|
|
201
201
|
export function updateWaitingWords(o) {
|
|
202
202
|
const { app, version, stopped, lingering: l } = o;
|
|
203
203
|
const update = `${app ? "App update" : "Update"} to ${version}`;
|
|
@@ -206,7 +206,7 @@ export function updateWaitingWords(o) {
|
|
|
206
206
|
const words = `${update} is waiting for ${on}. New work is paused.`;
|
|
207
207
|
return { app, version, stopped: false, run: null, on, action: null, words, short: words };
|
|
208
208
|
}
|
|
209
|
-
const next = l.action ? `
|
|
209
|
+
const next = l.action ? ` To have Toolroll check again, run ${l.action}${stopped ? ", then update again" : ""}.` : stopped ? " Update again once it has stopped." : "";
|
|
210
210
|
return { app, version, stopped, run: l.run, on: l.on, action: l.action,
|
|
211
211
|
words: `${update} ${stopped ? "stopped waiting" : "is waiting"}: ${l.on}.${next}`,
|
|
212
212
|
short: `${update} ${stopped ? `stopped: run #${l.run} is in the way` : `is waiting on run #${l.run}`}.${next}` };
|
|
@@ -284,18 +284,22 @@ export function desktopUpdateWaitingOf(databaseFile, inTheWay, stateDirs = [dirn
|
|
|
284
284
|
export function settleLeftoverRecords(db, now) {
|
|
285
285
|
return new Store(db).settleUnspawnedWitnesses(now);
|
|
286
286
|
}
|
|
287
|
-
/** Store.stopQuiescenceProblem's reasons, said for a person: no internal terms
|
|
288
|
-
*
|
|
287
|
+
/** Store.stopQuiescenceProblem's reasons, said for a person: no internal terms. Nobody vouches that a run stopped:
|
|
288
|
+
* Toolroll proves it itself (stop-proof.ts), and `toolroll run settle` only has it look again now. */
|
|
289
289
|
export function plainLingering(fallbackRun, problem) {
|
|
290
290
|
const run = Number(/run #(\d+)/.exec(problem)?.[1] ?? fallbackRun);
|
|
291
|
-
const settle = `toolroll run settle ${run}
|
|
291
|
+
const settle = `toolroll run settle ${run}`;
|
|
292
292
|
const pid = /process (\d+)/.exec(problem)?.[1];
|
|
293
293
|
if (/incomplete spawn witness|before its process witness was recorded/.test(problem))
|
|
294
|
-
return { run, on: `Run #${run} finished,
|
|
295
|
-
if (/belongs to another host|another host/.test(problem))
|
|
294
|
+
return { run, on: `Run #${run} finished, and Toolroll is making sure none of its processes is still running`, action: settle };
|
|
295
|
+
if (/belongs to another host|another host|another computer/.test(problem))
|
|
296
296
|
return { run, on: `Run #${run} finished on another computer, and Toolroll can only confirm its processes ended there`, action: `${settle} (on that computer)` };
|
|
297
|
+
if (/can't be proven stopped: .* is using its folder/.test(problem))
|
|
298
|
+
return { run, on: `Run #${run} finished, but something Toolroll didn't start is using its folder`, action: settle };
|
|
299
|
+
if (/can't be checked on this computer/.test(problem))
|
|
300
|
+
return { run, on: `Run #${run} finished, but Toolroll can't check this computer's processes`, action: settle };
|
|
297
301
|
if (/incomplete native containment custody|cannot be proven empty/.test(problem))
|
|
298
|
-
return { run, on: `Run #${run} finished, but Toolroll can't confirm its sandbox is empty`, action:
|
|
302
|
+
return { run, on: `Run #${run} finished, but Toolroll can't confirm its sandbox is empty`, action: null };
|
|
299
303
|
if (/still has members/.test(problem))
|
|
300
304
|
return { run, on: `Run #${run} finished, but processes are still running in its sandbox`, action: null };
|
|
301
305
|
if (/workspace is still held/.test(problem))
|