@intentic/sandbox-contract 1.310.0 → 1.312.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -159
- package/dist/chores/chores.js +6 -6
- package/dist/chores/chores.js.map +1 -1
- package/dist/chores/fix-deps.d.ts.map +1 -1
- package/dist/chores/fix-deps.js +3 -2
- package/dist/chores/fix-deps.js.map +1 -1
- package/dist/chores/prompt.d.ts.map +1 -1
- package/dist/chores/prompt.js +3 -2
- package/dist/chores/prompt.js.map +1 -1
- package/dist/contracts/accounts.contract.d.ts +15 -0
- package/dist/contracts/accounts.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.d.ts +15 -0
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.d.ts +1228 -32
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +42 -3
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts +2 -0
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/device.contract.d.ts +2 -0
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.d.ts +2 -0
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/offload.contract.d.ts +107 -0
- package/dist/contracts/offload.contract.d.ts.map +1 -0
- package/dist/contracts/offload.contract.js +53 -0
- package/dist/contracts/offload.contract.js.map +1 -0
- package/dist/contracts/ports.contract.d.ts +5 -0
- package/dist/contracts/ports.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +111 -0
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.js +3 -1
- package/dist/contracts/runner.contract.js.map +1 -1
- package/dist/contracts/settings.contract.d.ts +16 -0
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +154 -0
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/translator.contract.d.ts +16 -0
- package/dist/contracts/translator.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.d.ts +146 -0
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js +40 -3
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/documents/conversions.d.ts +81 -0
- package/dist/documents/conversions.d.ts.map +1 -0
- package/dist/documents/conversions.js +213 -0
- package/dist/documents/conversions.js.map +1 -0
- package/dist/documents/index.d.ts +3 -0
- package/dist/documents/index.d.ts.map +1 -0
- package/dist/documents/index.js +3 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/documents/passthrough.d.ts +13 -0
- package/dist/documents/passthrough.d.ts.map +1 -0
- package/dist/documents/passthrough.js +101 -0
- package/dist/documents/passthrough.js.map +1 -0
- package/dist/events/agent-events.d.ts +20 -0
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-events.js +6 -1
- package/dist/events/agent-events.js.map +1 -1
- package/dist/events/land-breakage.d.ts +3 -0
- package/dist/events/land-breakage.d.ts.map +1 -1
- package/dist/events/land-breakage.js +3 -0
- package/dist/events/land-breakage.js.map +1 -1
- package/dist/events/land-conflict.d.ts +3 -0
- package/dist/events/land-conflict.d.ts.map +1 -0
- package/dist/events/land-conflict.js +4 -0
- package/dist/events/land-conflict.js.map +1 -0
- package/dist/events/system-events.d.ts +114 -0
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/system-events.js +3 -1
- package/dist/events/system-events.js.map +1 -1
- package/dist/events/transcript.d.ts +5 -0
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/events/transcript.js +9 -1
- package/dist/events/transcript.js.map +1 -1
- package/dist/events/verify-nudge.d.ts.map +1 -1
- package/dist/events/verify-nudge.js.map +1 -1
- package/dist/front/generated/wire.d.ts +137 -0
- package/dist/front/generated/wire.d.ts.map +1 -0
- package/dist/front/generated/wire.js +2 -0
- package/dist/front/generated/wire.js.map +1 -0
- package/dist/front/terminal-frames.d.ts +17 -0
- package/dist/front/terminal-frames.d.ts.map +1 -0
- package/dist/front/terminal-frames.js +79 -0
- package/dist/front/terminal-frames.js.map +1 -0
- package/dist/ids/conversation-ids.d.ts +2 -0
- package/dist/ids/conversation-ids.d.ts.map +1 -1
- package/dist/ids/conversation-ids.js +2 -0
- package/dist/ids/conversation-ids.js.map +1 -1
- package/dist/index.d.ts +1773 -96
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/policy/command-run.d.ts +1 -1
- package/dist/policy/command-run.d.ts.map +1 -1
- package/dist/policy/command-run.js +7 -4
- package/dist/policy/command-run.js.map +1 -1
- package/dist/protocol/container-requirements.d.ts +0 -1
- package/dist/protocol/container-requirements.d.ts.map +1 -1
- package/dist/protocol/container-requirements.js +1 -2
- package/dist/protocol/container-requirements.js.map +1 -1
- package/dist/protocol/ingress-contract.d.ts +0 -11
- package/dist/protocol/ingress-contract.d.ts.map +1 -1
- package/dist/protocol/raw-routes.d.ts +36 -4
- package/dist/protocol/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw-routes.js +18 -13
- package/dist/protocol/raw-routes.js.map +1 -1
- package/dist/protocol/route-meta.d.ts +2 -0
- package/dist/protocol/route-meta.d.ts.map +1 -1
- package/dist/protocol/route-meta.js.map +1 -1
- package/dist/protocol/runner-protocol.d.ts +34 -0
- package/dist/protocol/runner-protocol.d.ts.map +1 -1
- package/dist/protocol/runner-protocol.js +33 -0
- package/dist/protocol/runner-protocol.js.map +1 -1
- package/dist/protocol/tunnel-lanes.d.ts +10 -0
- package/dist/protocol/tunnel-lanes.d.ts.map +1 -0
- package/dist/protocol/tunnel-lanes.js +16 -0
- package/dist/protocol/tunnel-lanes.js.map +1 -0
- package/dist/schemas/activity.d.ts.map +1 -1
- package/dist/schemas/activity.js.map +1 -1
- package/dist/schemas/agents.d.ts +145 -3
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +43 -9
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/automations.d.ts +43 -0
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/capabilities.d.ts +3 -0
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +4 -0
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/devices.d.ts +34 -6
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +8 -6
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/extension-updates.d.ts +4 -0
- package/dist/schemas/extension-updates.d.ts.map +1 -1
- package/dist/schemas/git/git.d.ts +16 -0
- package/dist/schemas/git/git.d.ts.map +1 -1
- package/dist/schemas/git/git.js +1 -0
- package/dist/schemas/git/git.js.map +1 -1
- package/dist/schemas/hosts.d.ts +8 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +3 -0
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/keep-warm.d.ts +68 -0
- package/dist/schemas/keep-warm.d.ts.map +1 -0
- package/dist/schemas/keep-warm.js +74 -0
- package/dist/schemas/keep-warm.js.map +1 -0
- package/dist/schemas/metrics.d.ts +7 -0
- package/dist/schemas/metrics.d.ts.map +1 -1
- package/dist/schemas/metrics.js +1 -0
- package/dist/schemas/metrics.js.map +1 -1
- package/dist/schemas/offload.d.ts +62 -0
- package/dist/schemas/offload.d.ts.map +1 -0
- package/dist/schemas/offload.js +23 -0
- package/dist/schemas/offload.js.map +1 -0
- package/dist/schemas/personas.js +3 -3
- package/dist/schemas/personas.js.map +1 -1
- package/dist/schemas/ports.d.ts +10 -0
- package/dist/schemas/ports.d.ts.map +1 -1
- package/dist/schemas/ports.js +8 -0
- package/dist/schemas/ports.js.map +1 -1
- package/dist/schemas/providers/plan-limits.d.ts +29 -0
- package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
- package/dist/schemas/providers/plan-limits.js +7 -0
- package/dist/schemas/providers/plan-limits.js.map +1 -1
- package/dist/schemas/providers/provider-oauth.d.ts +15 -0
- package/dist/schemas/providers/provider-oauth.d.ts.map +1 -1
- package/dist/schemas/providers/provider-oauth.js +4 -0
- package/dist/schemas/providers/provider-oauth.js.map +1 -1
- package/dist/schemas/providers/usage.d.ts +6 -0
- package/dist/schemas/providers/usage.d.ts.map +1 -1
- package/dist/schemas/providers/usage.js +4 -0
- package/dist/schemas/providers/usage.js.map +1 -1
- package/dist/schemas/settings-history.d.ts +28 -0
- package/dist/schemas/settings-history.d.ts.map +1 -0
- package/dist/schemas/settings-history.js +39 -0
- package/dist/schemas/settings-history.js.map +1 -0
- package/dist/schemas/settings.d.ts +8 -0
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +33 -3
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/system.d.ts +24 -0
- package/dist/schemas/system.d.ts.map +1 -1
- package/dist/schemas/system.js +15 -0
- package/dist/schemas/system.js.map +1 -1
- package/dist/schemas/workspace/mainline.d.ts +371 -0
- package/dist/schemas/workspace/mainline.d.ts.map +1 -0
- package/dist/schemas/workspace/mainline.js +134 -0
- package/dist/schemas/workspace/mainline.js.map +1 -0
- package/dist/schemas/workspace/workspace-tree.d.ts +23 -0
- package/dist/schemas/workspace/workspace-tree.d.ts.map +1 -1
- package/dist/schemas/workspace/workspace-tree.js +34 -0
- package/dist/schemas/workspace/workspace-tree.js.map +1 -1
- package/dist/state/definition.d.ts +36 -4
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/definition.js.map +1 -1
- package/dist/state/fix-stance.d.ts.map +1 -1
- package/dist/state/fix-stance.js +1 -0
- package/dist/state/fix-stance.js.map +1 -1
- package/dist/state/history-state.d.ts.map +1 -1
- package/dist/state/history-state.js +5 -0
- package/dist/state/history-state.js.map +1 -1
- package/dist/state/runtime-state.d.ts +6 -0
- package/dist/state/runtime-state.d.ts.map +1 -1
- package/dist/state/runtime-state.js +2 -0
- package/dist/state/runtime-state.js.map +1 -1
- package/dist/state/workspace-state.d.ts +22 -1
- package/dist/state/workspace-state.d.ts.map +1 -1
- package/dist/state/workspace-state.js +27 -1
- package/dist/state/workspace-state.js.map +1 -1
- package/dist/text/transcript-fold.d.ts +3 -0
- package/dist/text/transcript-fold.d.ts.map +1 -1
- package/dist/text/transcript-fold.js +30 -8
- package/dist/text/transcript-fold.js.map +1 -1
- package/dist/time/zone.d.ts +1 -0
- package/dist/time/zone.d.ts.map +1 -1
- package/dist/time/zone.js +5 -0
- package/dist/time/zone.js.map +1 -1
- package/package.json +34 -22
- package/src/chores/chores.ts +6 -6
- package/src/chores/fix-deps.ts +3 -2
- package/src/chores/prompt.ts +3 -2
- package/src/contracts/agents.contract.ts +50 -3
- package/src/contracts/offload.contract.ts +60 -0
- package/src/contracts/runner.contract.ts +7 -1
- package/src/contracts/workspace.contract.ts +54 -2
- package/src/documents/conversions.ts +402 -0
- package/src/documents/index.ts +5 -0
- package/src/documents/passthrough.ts +139 -0
- package/src/events/agent-events.ts +9 -1
- package/src/events/land-breakage.ts +12 -0
- package/src/events/land-conflict.ts +12 -0
- package/src/events/system-events.ts +9 -3
- package/src/events/transcript.ts +14 -3
- package/src/events/verify-nudge.ts +4 -3
- package/src/front/generated/wire.ts +104 -0
- package/src/front/terminal-frames.fixture.json +55 -0
- package/src/front/terminal-frames.test.ts +63 -0
- package/src/front/terminal-frames.ts +102 -0
- package/src/ids/conversation-ids.ts +7 -0
- package/src/ids/hostnames.fixture.json +20 -0
- package/src/ids/hostnames.test.ts +20 -0
- package/src/index.ts +8 -1
- package/src/policy/command-run.test.ts +35 -0
- package/src/policy/command-run.ts +10 -5
- package/src/protocol/container-requirements.test.ts +2 -3
- package/src/protocol/container-requirements.ts +1 -7
- package/src/protocol/ingress-contract.fixture.json +77 -0
- package/src/protocol/ingress-contract.test.ts +18 -26
- package/src/protocol/ingress-contract.ts +3 -22
- package/src/protocol/raw-routes.ts +21 -14
- package/src/protocol/route-meta.ts +4 -0
- package/src/protocol/runner-protocol.ts +53 -0
- package/src/protocol/tunnel-lanes.json +136 -0
- package/src/protocol/tunnel-lanes.test.ts +30 -0
- package/src/protocol/tunnel-lanes.ts +32 -0
- package/src/schemas/activity.ts +3 -1
- package/src/schemas/agents.ts +66 -10
- package/src/schemas/capabilities.ts +6 -0
- package/src/schemas/devices.ts +16 -9
- package/src/schemas/git/git.ts +5 -0
- package/src/schemas/hosts.ts +8 -0
- package/src/schemas/keep-warm.test.ts +68 -0
- package/src/schemas/keep-warm.ts +124 -0
- package/src/schemas/metrics.ts +2 -0
- package/src/schemas/offload.ts +44 -0
- package/src/schemas/personas.ts +3 -3
- package/src/schemas/ports.ts +10 -0
- package/src/schemas/providers/plan-limits.ts +13 -0
- package/src/schemas/providers/provider-oauth.ts +6 -0
- package/src/schemas/providers/usage.ts +7 -0
- package/src/schemas/settings-history.ts +61 -0
- package/src/schemas/settings.ts +70 -19
- package/src/schemas/system.ts +17 -0
- package/src/schemas/workspace/mainline.ts +201 -0
- package/src/schemas/workspace/workspace-tree.ts +47 -0
- package/src/state/definition.ts +3 -2
- package/src/state/fix-stance.test.ts +14 -0
- package/src/state/fix-stance.ts +2 -0
- package/src/state/history-state.ts +15 -0
- package/src/state/runtime-state.ts +8 -0
- package/src/state/workspace-state.ts +35 -1
- package/src/text/transcript-fold.test.ts +53 -1
- package/src/text/transcript-fold.ts +53 -10
- package/src/time/zone.ts +7 -0
- package/src/webext/index.ts +1 -1
- package/dist/protocol/ingress-protocol.d.ts +0 -30
- package/dist/protocol/ingress-protocol.d.ts.map +0 -1
- package/dist/protocol/ingress-protocol.js +0 -285
- package/dist/protocol/ingress-protocol.js.map +0 -1
- package/dist/protocol/terminal-protocol.d.ts +0 -18
- package/dist/protocol/terminal-protocol.d.ts.map +0 -1
- package/dist/protocol/terminal-protocol.js +0 -2
- package/dist/protocol/terminal-protocol.js.map +0 -1
- package/dist/protocol/tunnel-heartbeat.d.ts +0 -19
- package/dist/protocol/tunnel-heartbeat.d.ts.map +0 -1
- package/dist/protocol/tunnel-heartbeat.js +0 -41
- package/dist/protocol/tunnel-heartbeat.js.map +0 -1
- package/src/protocol/ingress-protocol.test.ts +0 -535
- package/src/protocol/ingress-protocol.ts +0 -448
- package/src/protocol/terminal-protocol.ts +0 -13
- package/src/protocol/tunnel-heartbeat.test.ts +0 -75
- package/src/protocol/tunnel-heartbeat.ts +0 -67
package/src/chores/fix-deps.ts
CHANGED
|
@@ -13,10 +13,11 @@ export const FIX_DEPS_AUTOMATION = {
|
|
|
13
13
|
"A landed change drifted this workspace's dependencies; the daemon reinstalled them and ran the project's own checks, " +
|
|
14
14
|
"and they failed. The payload names the project (`deps.project`), the check command (`deps.command`), how it exited " +
|
|
15
15
|
"(`deps.exitCode`) and the tail of its output (`deps.logTail`); the full log is in the project's `--verify` terminal.\n\n" +
|
|
16
|
-
"Re-run
|
|
16
|
+
"Re-run only what failed to see it first-hand (the failing package's tests or typecheck, not the whole check command), then fix the ROOT CAUSE. That usually means updating call " +
|
|
17
17
|
"sites, types or tests to match what actually changed: never loosening or deleting the checks, pinning or downgrading " +
|
|
18
18
|
"dependencies just to silence them, or editing generated files. If the breakage needs a decision only the owner can " +
|
|
19
19
|
"make (an intentional breaking upgrade, a license change, a dependency that should be dropped), stop and say exactly " +
|
|
20
20
|
"that instead of guessing.\n\n" +
|
|
21
|
-
"Finish by running
|
|
21
|
+
"Finish by re-running what failed and reporting what was broken, what you changed, and whether it passes now; the " +
|
|
22
|
+
"daemon runs the whole check again once your fix lands.",
|
|
22
23
|
} as const;
|
package/src/chores/prompt.ts
CHANGED
|
@@ -26,8 +26,9 @@ export const TRIAGE_NOTE =
|
|
|
26
26
|
// Constraints for a change-making turn: every change must be explainable on its own line of the summary.
|
|
27
27
|
export const CHORE_INVARIANTS =
|
|
28
28
|
`Keep it mechanical and separately explainable: nothing lands that you could not justify on its own line of the ` +
|
|
29
|
-
`summary. Do not reformat, rename or "while I was in here" anything the finding did not name.
|
|
30
|
-
`
|
|
29
|
+
`summary. Do not reformat, rename or "while I was in here" anything the finding did not name. Before you finish, run ` +
|
|
30
|
+
`the type-check and tests of what you changed (its package, the test files that cover it), not the whole ` +
|
|
31
|
+
`repository's; if you cannot make them pass, leave the change out and say so.`;
|
|
31
32
|
|
|
32
33
|
// Constraints for a look-only turn, stated explicitly so a report chore never quietly starts editing.
|
|
33
34
|
export const REPORT_INVARIANTS =
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { procedure } from "../protocol/route-meta.js";
|
|
2
2
|
import { AgentToolChildrenSchema, AgentTranscriptSchema } from "../events/transcript.js";
|
|
3
3
|
import {
|
|
4
|
-
AgentArchiveSchema,
|
|
5
4
|
AgentAssignSchema,
|
|
6
5
|
AgentAutoLandSchema,
|
|
7
6
|
AgentBreakPolicySchema,
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
AgentPlaceSchema,
|
|
15
14
|
AgentReactSchema,
|
|
16
15
|
AgentRenameSchema,
|
|
16
|
+
AgentStopJobSchema,
|
|
17
17
|
AgentStopWatchingSchema,
|
|
18
18
|
AgentsArchivedSchema,
|
|
19
19
|
AgentSearchQuerySchema,
|
|
@@ -24,9 +24,11 @@ import {
|
|
|
24
24
|
LandResultSchema,
|
|
25
25
|
} from "../schemas/agents.js";
|
|
26
26
|
import { AgentsListSchema } from "../schemas/automations.js";
|
|
27
|
-
import {
|
|
27
|
+
import { MainlinePushFixResultSchema, MainlinePushFixSchema } from "../schemas/workspace/mainline.js";
|
|
28
|
+
import { AgentChangesSchema, AgentConflictsSchema, AgentScratchSchema, AgentHistorySchema } from "../schemas/git/git.js";
|
|
28
29
|
import { FileDiffSchema } from "../schemas/history.js";
|
|
29
30
|
import { OkSchema } from "../schemas/shared.js";
|
|
31
|
+
import { AgentKeepWarmSchema } from "../schemas/keep-warm.js";
|
|
30
32
|
import { ConversationPromptSchema } from "../schemas/system-prompt.js";
|
|
31
33
|
|
|
32
34
|
// Every registered conversation-agent (AgentSummarySchema); an unknown {id} is NOT_FOUND across this whole family.
|
|
@@ -151,6 +153,18 @@ export const agentsContract = {
|
|
|
151
153
|
.meta({ floor: "collaborator" })
|
|
152
154
|
.input(AgentBreakPolicySchema)
|
|
153
155
|
.output(AgentSummarySchema),
|
|
156
|
+
// Legal for a workspace conversation too, and only between turns in effect: a turn starting ends the hold.
|
|
157
|
+
keepWarm: procedure
|
|
158
|
+
.route({
|
|
159
|
+
method: "POST",
|
|
160
|
+
path: "/agents/{id}/keep-warm",
|
|
161
|
+
summary: "Keep this conversation's prompt cache warm while it sits idle",
|
|
162
|
+
description:
|
|
163
|
+
"Re-reads the conversation's cached context shortly before the provider would drop it, until the time asked for, so picking it back up costs a cache read instead of re-sending everything. Each refresh is a forked, unsaved request that adds nothing to the conversation. Stops by itself when the time runs out, when a turn starts, when the account nears its limit, or when the prompt the next turn would send has changed. Refused for a conversation whose cache is already cold or that this sandbox cannot replay. Null stops it.",
|
|
164
|
+
})
|
|
165
|
+
.meta({ floor: "collaborator" })
|
|
166
|
+
.input(AgentKeepWarmSchema)
|
|
167
|
+
.output(AgentSummarySchema),
|
|
154
168
|
seen: procedure
|
|
155
169
|
.route({
|
|
156
170
|
method: "POST",
|
|
@@ -173,6 +187,16 @@ export const agentsContract = {
|
|
|
173
187
|
})
|
|
174
188
|
.input(AgentStopWatchingSchema)
|
|
175
189
|
.output(AgentSummarySchema),
|
|
190
|
+
stopJob: procedure
|
|
191
|
+
.route({
|
|
192
|
+
method: "POST",
|
|
193
|
+
path: "/agents/{id}/stop-job",
|
|
194
|
+
summary: "Stop one of a conversation's background jobs",
|
|
195
|
+
description:
|
|
196
|
+
"Ends a command this conversation left running: the server it handed over, or the build it is waiting on. The watch that would have woken the conversation on its exit is disarmed first, so stopping it wakes nothing. Stopping a job that already ended is not an error.",
|
|
197
|
+
})
|
|
198
|
+
.input(AgentStopJobSchema)
|
|
199
|
+
.output(AgentSummarySchema),
|
|
176
200
|
seenAll: procedure
|
|
177
201
|
.route({
|
|
178
202
|
method: "POST",
|
|
@@ -192,6 +216,18 @@ export const agentsContract = {
|
|
|
192
216
|
})
|
|
193
217
|
.input(AgentIdSchema)
|
|
194
218
|
.output(AgentChangesSchema),
|
|
219
|
+
// For a press that needs only the verdict (asking the agent to resolve), without waiting on the review's per-file
|
|
220
|
+
// line counts, which on a branch of hundreds of files take tens of seconds.
|
|
221
|
+
conflicts: procedure
|
|
222
|
+
.route({
|
|
223
|
+
method: "GET",
|
|
224
|
+
path: "/agents/{id}/conflicts",
|
|
225
|
+
summary: "Why a conversation's last merge refused",
|
|
226
|
+
description:
|
|
227
|
+
"What still blocks the conversation's last refused merge, checked again against your workspace as it stands now. Returns the same `conflicts` the full change list carries, without the change list itself. Empty when nothing refused, or when what refused before has since stopped being in the way.",
|
|
228
|
+
})
|
|
229
|
+
.input(AgentIdSchema)
|
|
230
|
+
.output(AgentConflictsSchema),
|
|
195
231
|
// Costs a `git log` per repo: ask only once `diff` reports something absorbed. Reading a file here reuses
|
|
196
232
|
// `fileDiff`.
|
|
197
233
|
history: procedure
|
|
@@ -235,6 +271,17 @@ export const agentsContract = {
|
|
|
235
271
|
})
|
|
236
272
|
.input(AgentScratchSchema)
|
|
237
273
|
.output(OkSchema),
|
|
274
|
+
// The one way an agent is put on what a push left behind: only ever on a press, never by the sandbox itself.
|
|
275
|
+
pushFix: procedure
|
|
276
|
+
.route({
|
|
277
|
+
method: "POST",
|
|
278
|
+
path: "/agents/push-fix",
|
|
279
|
+
summary: "Put an agent on what a push left behind",
|
|
280
|
+
description:
|
|
281
|
+
"Opens an isolated conversation holding every open finding the project's push checks let through: what each check printed, the command that shows it again, and the commits that brought it. Pressed again while they stand, it continues that conversation.",
|
|
282
|
+
})
|
|
283
|
+
.input(MainlinePushFixSchema)
|
|
284
|
+
.output(MainlinePushFixResultSchema),
|
|
238
285
|
land: procedure
|
|
239
286
|
.route({
|
|
240
287
|
method: "POST",
|
|
@@ -306,7 +353,7 @@ export const agentsContract = {
|
|
|
306
353
|
"The gentle counterpart to discarding. Commits whatever the conversation still has in progress onto its own branch, releases its working copy, and keeps the entry and the record. Its scratch is not committed and goes with the copy. It leaves the live fleet and joins the archive. Refused for a conversation that is running.",
|
|
307
354
|
})
|
|
308
355
|
.meta({ floor: "collaborator", guest: true })
|
|
309
|
-
.input(
|
|
356
|
+
.input(AgentIdsSchema)
|
|
310
357
|
.output(AgentsArchivedSchema),
|
|
311
358
|
unarchive: procedure
|
|
312
359
|
.route({
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { procedure } from "../protocol/route-meta.js";
|
|
3
|
+
import { streamOf } from "../protocol/routes.js";
|
|
4
|
+
import { OffloadFrameSchema, OffloadKindSchema, OffloadRecordSchema, OffloadRunSchema, OffloadTargetSchema } from "../schemas/offload.js";
|
|
5
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
6
|
+
|
|
7
|
+
// The in-sandbox `offload-run` command drives the first three on the agent token: the Bash hook and the check after
|
|
8
|
+
// landing put it in front of a heavy line whose kind the owner sends to a runner (settings `offload`). A control token
|
|
9
|
+
// never reaches them: they run code on another machine.
|
|
10
|
+
const offloadRoute = procedure.meta({ agent: true, control: "never" });
|
|
11
|
+
|
|
12
|
+
export const offloadContract = {
|
|
13
|
+
target: offloadRoute
|
|
14
|
+
.route({
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: "/offload/runners/{runner}",
|
|
17
|
+
summary: "Whether a runner can take a heavy command",
|
|
18
|
+
description:
|
|
19
|
+
"Answers whether the runner a kind of heavy work is sent to is connected and able to run it, before anything is copied to it. When it is not, the command runs in this sandbox and says why.",
|
|
20
|
+
})
|
|
21
|
+
.input(z.object({ runner: z.string().min(1) }))
|
|
22
|
+
.output(OffloadTargetSchema),
|
|
23
|
+
run: offloadRoute
|
|
24
|
+
.route({
|
|
25
|
+
method: "POST",
|
|
26
|
+
path: "/offload/runs",
|
|
27
|
+
summary: "Run a heavy command on a runner",
|
|
28
|
+
description:
|
|
29
|
+
"Hands one command to a runner on one of your machines, together with a snapshot of the code as it stands, and streams its output back as it comes. It ends with the exit code, every file the command changed and any report it wrote.",
|
|
30
|
+
})
|
|
31
|
+
.meta({ stream: true })
|
|
32
|
+
.input(OffloadRunSchema)
|
|
33
|
+
.output(streamOf(OffloadFrameSchema)),
|
|
34
|
+
cancel: offloadRoute
|
|
35
|
+
.route({
|
|
36
|
+
method: "POST",
|
|
37
|
+
path: "/offload/runs/{runId}/cancel",
|
|
38
|
+
summary: "Stop an offloaded command",
|
|
39
|
+
description: "Stops a command running on a runner, with everything it started there.",
|
|
40
|
+
})
|
|
41
|
+
.input(z.object({ runId: z.string().min(1) }))
|
|
42
|
+
.output(OkSchema),
|
|
43
|
+
kinds: procedure
|
|
44
|
+
.route({
|
|
45
|
+
method: "GET",
|
|
46
|
+
path: "/offload/kinds",
|
|
47
|
+
summary: "Kinds of heavy work that can run elsewhere",
|
|
48
|
+
description:
|
|
49
|
+
"The kinds this sandbox sorts heavy commands into (tests, typechecks, verify…), each of which can be sent to a runner on one of your machines instead of running here.",
|
|
50
|
+
})
|
|
51
|
+
.output(z.object({ kinds: z.array(OffloadKindSchema) })),
|
|
52
|
+
runs: procedure
|
|
53
|
+
.route({
|
|
54
|
+
method: "GET",
|
|
55
|
+
path: "/offload/runs",
|
|
56
|
+
summary: "Recent offloaded commands",
|
|
57
|
+
description: "The heavy commands this sandbox sent to runners lately, newest first, with where they ran and how they ended.",
|
|
58
|
+
})
|
|
59
|
+
.output(z.object({ runs: z.array(OffloadRecordSchema) })),
|
|
60
|
+
};
|
|
@@ -2,7 +2,7 @@ import { oc } from "@orpc/contract";
|
|
|
2
2
|
import { streamOf } from "../protocol/routes.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { AgentEventSchema } from "../events/agent-events.js";
|
|
5
|
-
import { RunnerFactsSchema, RunnerSyncLineSchema, RunnerSyncSchema, RunnerTurnSchema } from "../protocol/runner-protocol.js";
|
|
5
|
+
import { RunnerCommandFrameSchema, RunnerCommandSchema, RunnerFactsSchema, RunnerSyncLineSchema, RunnerSyncSchema, RunnerTurnSchema } from "../protocol/runner-protocol.js";
|
|
6
6
|
import { EditorContextSchema } from "../schemas/agent.js";
|
|
7
7
|
import { AgentReplySchema } from "../schemas/providers/plan-limits.js";
|
|
8
8
|
import { OkSchema } from "../schemas/shared.js";
|
|
@@ -35,6 +35,12 @@ export const runnerContract = {
|
|
|
35
35
|
applyDefinition: oc.input(z.object({ toml: z.string() })).output(z.object({ settings: z.array(z.string()) })),
|
|
36
36
|
// Stop the running turn; the parent's stop button reaching through.
|
|
37
37
|
interrupt: oc.input(RunnerTurnSchema.pick({ conversationId: true })).output(OkSchema),
|
|
38
|
+
// One shell line the parent offloaded (settings `offload`), run against a snapshot of the parent's tree; its output
|
|
39
|
+
// streams back as it comes, then its exit with what it changed. An older runner lacks this procedure, which the
|
|
40
|
+
// parent reads as "can't take it" and runs the line itself.
|
|
41
|
+
runCommand: oc.input(RunnerCommandSchema).output(streamOf(RunnerCommandFrameSchema)),
|
|
42
|
+
// Stops an offloaded line and everything it started; the parent's stop reaching through.
|
|
43
|
+
cancelCommand: oc.input(RunnerCommandSchema.pick({ runId: true })).output(OkSchema),
|
|
38
44
|
// Liveness driven by the parent: keepalive and gone-detection in one.
|
|
39
45
|
ping: oc.output(OkSchema),
|
|
40
46
|
};
|
|
@@ -16,6 +16,13 @@ import {
|
|
|
16
16
|
WorkspaceGraphSchema,
|
|
17
17
|
WorkspaceSyncSchema,
|
|
18
18
|
} from "../schemas/workspace/workspace-repos.js";
|
|
19
|
+
import {
|
|
20
|
+
MainlinePushDismissResultSchema,
|
|
21
|
+
MainlinePushDismissSchema,
|
|
22
|
+
MainlinePushRecheckResultSchema,
|
|
23
|
+
MainlinePushRecheckSchema,
|
|
24
|
+
MainlineStatusSchema,
|
|
25
|
+
} from "../schemas/workspace/mainline.js";
|
|
19
26
|
import { WorkspaceSearchQuerySchema, WorkspaceSearchResultSchema } from "../schemas/workspace/workspace-search.js";
|
|
20
27
|
import { WorkspaceInstallResultSchema, WorkspaceInstallSchema, WorkspaceSetupSchema } from "../schemas/workspace/workspace-setup.js";
|
|
21
28
|
import {
|
|
@@ -25,8 +32,11 @@ import {
|
|
|
25
32
|
SidecarStatusSchema,
|
|
26
33
|
WorkspaceDerivedQuerySchema,
|
|
27
34
|
WorkspaceDerivedSchema,
|
|
35
|
+
WorkspaceDeletedSchema,
|
|
28
36
|
WorkspaceDirSchema,
|
|
29
37
|
WorkspaceExtractSchema,
|
|
38
|
+
WorkspaceRestoredSchema,
|
|
39
|
+
WorkspaceRestoreSchema,
|
|
30
40
|
WorkspaceFileQuerySchema,
|
|
31
41
|
WorkspaceFileReadQuerySchema,
|
|
32
42
|
WorkspaceFileSchema,
|
|
@@ -191,11 +201,22 @@ export const workspaceContract = {
|
|
|
191
201
|
path: "/workspace/entry",
|
|
192
202
|
summary: "Delete a file or folder",
|
|
193
203
|
description:
|
|
194
|
-
"Removes one entry and everything under it. The path travels in the body rather than the address, the same as every other write in this group.",
|
|
204
|
+
"Removes one entry and everything under it. It goes to the trash rather than being erased, and the answer carries the id that brings it back through the restore call for a day. The path travels in the body rather than the address, the same as every other write in this group.",
|
|
195
205
|
})
|
|
196
206
|
.meta({ floor: "writer" })
|
|
197
207
|
.input(WorkspaceFileQuerySchema)
|
|
198
|
-
.output(
|
|
208
|
+
.output(WorkspaceDeletedSchema),
|
|
209
|
+
restore: procedure
|
|
210
|
+
.route({
|
|
211
|
+
method: "POST",
|
|
212
|
+
path: "/workspace/restore",
|
|
213
|
+
summary: "Bring back something deleted",
|
|
214
|
+
description:
|
|
215
|
+
"Puts an entry a delete sent to the trash back where it was, recreating the folders above it. Nothing is written over: when something new holds the name, it comes back beside it and the answer says where. Trash older than a day is gone.",
|
|
216
|
+
})
|
|
217
|
+
.meta({ floor: "writer" })
|
|
218
|
+
.input(WorkspaceRestoreSchema)
|
|
219
|
+
.output(WorkspaceRestoredSchema),
|
|
199
220
|
move: procedure
|
|
200
221
|
.route({
|
|
201
222
|
method: "POST",
|
|
@@ -247,6 +268,37 @@ export const workspaceContract = {
|
|
|
247
268
|
})
|
|
248
269
|
.input(WorkspaceInstallSchema)
|
|
249
270
|
.output(WorkspaceInstallResultSchema),
|
|
271
|
+
// Nothing is checked inside a turn; this is the check that runs instead, over the main tree after work lands.
|
|
272
|
+
mainline: procedure
|
|
273
|
+
.route({
|
|
274
|
+
method: "GET",
|
|
275
|
+
path: "/workspace/mainline",
|
|
276
|
+
summary: "The checks that run after work lands",
|
|
277
|
+
description:
|
|
278
|
+
"What the main tree's own check is measuring right now, which landed work waits for the next run, what the last run in each project said, and what became of a red one: sent back to the conversation that landed it, handed to a fresh conversation, or waiting on one still working. Nothing here ever holds a land, a commit or a push.",
|
|
279
|
+
})
|
|
280
|
+
.output(MainlineStatusSchema),
|
|
281
|
+
// What a push check found and let through waits here until measured gone or dismissed; these are the two hands on it.
|
|
282
|
+
mainlinePushDismiss: procedure
|
|
283
|
+
.route({
|
|
284
|
+
method: "POST",
|
|
285
|
+
path: "/workspace/mainline/push/dismiss",
|
|
286
|
+
summary: "Set aside what a push left behind",
|
|
287
|
+
description:
|
|
288
|
+
"Marks findings a push check let through as not to be fixed, so they stop counting against the project, or opens dismissed ones again. Nothing is changed in the code.",
|
|
289
|
+
})
|
|
290
|
+
.input(MainlinePushDismissSchema)
|
|
291
|
+
.output(MainlinePushDismissResultSchema),
|
|
292
|
+
mainlinePushRecheck: procedure
|
|
293
|
+
.route({
|
|
294
|
+
method: "POST",
|
|
295
|
+
path: "/workspace/mainline/push/recheck",
|
|
296
|
+
summary: "Measure what a push left behind again",
|
|
297
|
+
description:
|
|
298
|
+
"Runs the project's own push measurement over its main tree now and resolves every open finding it no longer prints. A few seconds; nothing is pushed.",
|
|
299
|
+
})
|
|
300
|
+
.input(MainlinePushRecheckSchema)
|
|
301
|
+
.output(MainlinePushRecheckResultSchema),
|
|
250
302
|
repos: procedure
|
|
251
303
|
.route({
|
|
252
304
|
method: "GET",
|