@intentic/sandbox-contract 1.316.0 → 1.318.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 +12 -4
- package/dist/chores/chores.js +1 -1
- package/dist/chores/chores.js.map +1 -1
- package/dist/chores/probes.js +1 -1
- package/dist/chores/probes.js.map +1 -1
- package/dist/contracts/accounts.contract.d.ts +75 -0
- package/dist/contracts/accounts.contract.d.ts.map +1 -1
- package/dist/contracts/accounts.contract.js +10 -1
- package/dist/contracts/accounts.contract.js.map +1 -1
- package/dist/contracts/agent.contract.d.ts +616 -1
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.d.ts +1134 -29
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +12 -12
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts +16 -0
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.js +10 -1
- package/dist/contracts/capabilities.contract.js.map +1 -1
- package/dist/contracts/ci.contract.d.ts +22 -4
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/device.contract.d.ts +39 -0
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/device.contract.js +2 -0
- package/dist/contracts/device.contract.js.map +1 -1
- package/dist/contracts/endpoints.contract.d.ts +23 -0
- package/dist/contracts/endpoints.contract.d.ts.map +1 -1
- package/dist/contracts/endpoints.contract.js +6 -1
- package/dist/contracts/endpoints.contract.js.map +1 -1
- package/dist/contracts/extensions.contract.d.ts +12 -0
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/needs.contract.d.ts +534 -0
- package/dist/contracts/needs.contract.d.ts.map +1 -0
- package/dist/contracts/needs.contract.js +80 -0
- package/dist/contracts/needs.contract.js.map +1 -0
- package/dist/contracts/providers.contract.d.ts +4 -0
- package/dist/contracts/providers.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +193 -2
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.d.ts +53 -0
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js +31 -2
- package/dist/contracts/secrets.contract.js.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +83 -0
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +33 -2
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.js +20 -1
- package/dist/contracts/settings.contract.js.map +1 -1
- package/dist/contracts/system.contract.d.ts +177 -356
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +13 -12
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/contracts/translator.contract.d.ts +7 -0
- package/dist/contracts/translator.contract.d.ts.map +1 -1
- package/dist/contracts/translator.contract.js.map +1 -1
- package/dist/contracts/webext.contract.d.ts +38 -0
- package/dist/contracts/webext.contract.d.ts.map +1 -1
- package/dist/contracts/webext.contract.js +3 -0
- package/dist/contracts/webext.contract.js.map +1 -1
- package/dist/contracts/workspace.contract.d.ts +1 -80
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js +0 -27
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/events/agent-events.d.ts +330 -0
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-events.js +13 -0
- package/dist/events/agent-events.js.map +1 -1
- package/dist/events/agent-words.d.ts +1 -0
- package/dist/events/agent-words.d.ts.map +1 -1
- package/dist/events/agent-words.js +3 -2
- package/dist/events/agent-words.js.map +1 -1
- package/dist/events/land-breakage.d.ts.map +1 -1
- package/dist/events/land-breakage.js.map +1 -1
- package/dist/events/need-wake.d.ts +17 -0
- package/dist/events/need-wake.d.ts.map +1 -0
- package/dist/events/need-wake.js +34 -0
- package/dist/events/need-wake.js.map +1 -0
- package/dist/events/resume.d.ts +6 -1
- package/dist/events/resume.d.ts.map +1 -1
- package/dist/events/resume.js +17 -10
- package/dist/events/resume.js.map +1 -1
- package/dist/events/sandbox-notice.d.ts +183 -0
- package/dist/events/sandbox-notice.d.ts.map +1 -0
- package/dist/events/sandbox-notice.js +56 -0
- package/dist/events/sandbox-notice.js.map +1 -0
- package/dist/events/system-events.d.ts +84 -0
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/system-events.js +2 -0
- package/dist/events/system-events.js.map +1 -1
- package/dist/events/transcript.d.ts +508 -0
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/events/transcript.js +12 -1
- package/dist/events/transcript.js.map +1 -1
- package/dist/ids/conversation-ids.d.ts +1 -3
- package/dist/ids/conversation-ids.d.ts.map +1 -1
- package/dist/ids/conversation-ids.js +1 -3
- package/dist/ids/conversation-ids.js.map +1 -1
- package/dist/ids/project-dir.d.ts +6 -0
- package/dist/ids/project-dir.d.ts.map +1 -0
- package/dist/ids/project-dir.js +43 -0
- package/dist/ids/project-dir.js.map +1 -0
- package/dist/index.d.ts +3474 -1163
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/models/agent-runtimes.d.ts.map +1 -1
- package/dist/models/agent-runtimes.js +2 -2
- package/dist/models/agent-runtimes.js.map +1 -1
- package/dist/models/model-roles.d.ts +1 -9
- package/dist/models/model-roles.d.ts.map +1 -1
- package/dist/models/model-roles.js +1 -9
- package/dist/models/model-roles.js.map +1 -1
- package/dist/policy/command-classes.d.ts.map +1 -1
- package/dist/policy/command-classes.js +52 -3
- package/dist/policy/command-classes.js.map +1 -1
- package/dist/policy/safety-policy.d.ts +7 -1
- package/dist/policy/safety-policy.d.ts.map +1 -1
- package/dist/policy/safety-policy.js +2 -0
- package/dist/policy/safety-policy.js.map +1 -1
- package/dist/policy/secret-hosts.d.ts +13 -0
- package/dist/policy/secret-hosts.d.ts.map +1 -0
- package/dist/policy/secret-hosts.js +41 -0
- package/dist/policy/secret-hosts.js.map +1 -0
- package/dist/policy/turned-away.d.ts.map +1 -1
- package/dist/policy/turned-away.js +1 -0
- package/dist/policy/turned-away.js.map +1 -1
- package/dist/protocol/raw-routes.d.ts +7 -5
- package/dist/protocol/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw-routes.js +4 -1
- package/dist/protocol/raw-routes.js.map +1 -1
- package/dist/protocol/routes.d.ts +2 -6
- package/dist/protocol/routes.d.ts.map +1 -1
- package/dist/protocol/routes.js +2 -3
- package/dist/protocol/routes.js.map +1 -1
- package/dist/protocol/stream-of.d.ts +6 -0
- package/dist/protocol/stream-of.d.ts.map +1 -0
- package/dist/protocol/stream-of.js +4 -0
- package/dist/protocol/stream-of.js.map +1 -0
- package/dist/schemas/activity.js +1 -1
- package/dist/schemas/activity.js.map +1 -1
- package/dist/schemas/agent.d.ts +19 -2
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +2 -1
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents.d.ts +119 -0
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +45 -0
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/automations.d.ts +37 -0
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/capabilities.d.ts +21 -0
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +50 -4
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/ci.d.ts +69 -9
- package/dist/schemas/ci.d.ts.map +1 -1
- package/dist/schemas/ci.js +29 -8
- package/dist/schemas/ci.js.map +1 -1
- package/dist/schemas/context-trim.d.ts +5 -1
- package/dist/schemas/context-trim.d.ts.map +1 -1
- package/dist/schemas/context-trim.js +8 -4
- package/dist/schemas/context-trim.js.map +1 -1
- package/dist/schemas/devices.d.ts +91 -0
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +23 -1
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/environment.d.ts +48 -0
- package/dist/schemas/environment.d.ts.map +1 -1
- package/dist/schemas/environment.js +15 -0
- package/dist/schemas/environment.js.map +1 -1
- package/dist/schemas/extension-updates.d.ts +24 -0
- package/dist/schemas/extension-updates.d.ts.map +1 -1
- package/dist/schemas/git/git.d.ts +13 -0
- package/dist/schemas/git/git.d.ts.map +1 -1
- package/dist/schemas/git/git.js +11 -1
- package/dist/schemas/git/git.js.map +1 -1
- package/dist/schemas/hosts.d.ts +4 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +3 -1
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/keep-warm.d.ts +4 -0
- package/dist/schemas/keep-warm.d.ts.map +1 -1
- package/dist/schemas/keep-warm.js +15 -5
- package/dist/schemas/keep-warm.js.map +1 -1
- package/dist/schemas/loopback-catch.d.ts +33 -0
- package/dist/schemas/loopback-catch.d.ts.map +1 -0
- package/dist/schemas/loopback-catch.js +20 -0
- package/dist/schemas/loopback-catch.js.map +1 -0
- package/dist/schemas/maintenance.js +1 -1
- package/dist/schemas/maintenance.js.map +1 -1
- package/dist/schemas/needs.d.ts +664 -0
- package/dist/schemas/needs.d.ts.map +1 -0
- package/dist/schemas/needs.js +203 -0
- package/dist/schemas/needs.js.map +1 -0
- package/dist/schemas/personas.d.ts.map +1 -1
- package/dist/schemas/personas.js +6 -3
- package/dist/schemas/personas.js.map +1 -1
- package/dist/schemas/providers/provider-oauth.d.ts +87 -0
- package/dist/schemas/providers/provider-oauth.d.ts.map +1 -1
- package/dist/schemas/providers/provider-oauth.js +20 -0
- package/dist/schemas/providers/provider-oauth.js.map +1 -1
- package/dist/schemas/secrets.d.ts +84 -0
- package/dist/schemas/secrets.d.ts.map +1 -1
- package/dist/schemas/secrets.js +70 -0
- package/dist/schemas/secrets.js.map +1 -1
- package/dist/schemas/settings-history.d.ts +1 -1
- package/dist/schemas/settings-history.d.ts.map +1 -1
- package/dist/schemas/settings-history.js +1 -0
- package/dist/schemas/settings-history.js.map +1 -1
- package/dist/schemas/settings.d.ts +44 -2
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +30 -4
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/state-plan.d.ts +1 -0
- package/dist/schemas/state-plan.d.ts.map +1 -1
- package/dist/schemas/state-plan.js +3 -1
- package/dist/schemas/state-plan.js.map +1 -1
- package/dist/schemas/system.d.ts +20 -0
- package/dist/schemas/system.d.ts.map +1 -1
- package/dist/schemas/system.js +7 -0
- package/dist/schemas/system.js.map +1 -1
- package/dist/schemas/terminal.d.ts +2 -3
- package/dist/schemas/terminal.d.ts.map +1 -1
- package/dist/schemas/terminal.js +12 -4
- package/dist/schemas/terminal.js.map +1 -1
- package/dist/schemas/updates.d.ts +39 -0
- package/dist/schemas/updates.d.ts.map +1 -0
- package/dist/schemas/updates.js +31 -0
- package/dist/schemas/updates.js.map +1 -0
- package/dist/schemas/webext.d.ts +3 -0
- package/dist/schemas/webext.d.ts.map +1 -1
- package/dist/schemas/webext.js +1 -0
- package/dist/schemas/webext.js.map +1 -1
- package/dist/schemas/workflows.js +3 -3
- package/dist/schemas/workflows.js.map +1 -1
- package/dist/schemas/workspace/workspace-tree.d.ts +2 -0
- package/dist/schemas/workspace/workspace-tree.d.ts.map +1 -1
- package/dist/schemas/workspace/workspace-tree.js +4 -0
- package/dist/schemas/workspace/workspace-tree.js.map +1 -1
- package/dist/state/definition.d.ts +28 -4
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/history-state.d.ts.map +1 -1
- package/dist/state/history-state.js +10 -0
- package/dist/state/history-state.js.map +1 -1
- package/dist/state/runtime-state.d.ts +0 -3
- package/dist/state/runtime-state.d.ts.map +1 -1
- package/dist/state/runtime-state.js +0 -1
- package/dist/state/runtime-state.js.map +1 -1
- package/dist/state/workspace-state.d.ts +4 -5
- package/dist/state/workspace-state.d.ts.map +1 -1
- package/dist/state/workspace-state.js +1 -6
- package/dist/state/workspace-state.js.map +1 -1
- package/dist/text/documents.d.ts +3 -0
- package/dist/text/documents.d.ts.map +1 -1
- package/dist/text/documents.js +14 -0
- package/dist/text/documents.js.map +1 -1
- package/dist/text/transcript-fold.d.ts +4 -3
- package/dist/text/transcript-fold.d.ts.map +1 -1
- package/dist/text/transcript-fold.js +140 -31
- package/dist/text/transcript-fold.js.map +1 -1
- package/dist/webext/index.d.ts +1 -0
- package/dist/webext/index.d.ts.map +1 -1
- package/dist/webext/index.js +1 -0
- package/dist/webext/index.js.map +1 -1
- package/package.json +5 -5
- package/src/chores/chores.ts +2 -2
- package/src/chores/probes.ts +1 -1
- package/src/contracts/accounts.contract.ts +12 -0
- package/src/contracts/agents.contract.ts +13 -13
- package/src/contracts/capabilities.contract.ts +14 -1
- package/src/contracts/device.contract.ts +5 -0
- package/src/contracts/endpoints.contract.ts +20 -4
- package/src/contracts/needs.contract.ts +103 -0
- package/src/contracts/secrets.contract.ts +45 -3
- package/src/contracts/settings.contract.ts +29 -0
- package/src/contracts/system.contract.ts +19 -14
- package/src/contracts/translator.contract.ts +2 -1
- package/src/contracts/webext.contract.ts +7 -1
- package/src/contracts/workspace.contract.ts +0 -37
- package/src/events/agent-events.ts +22 -1
- package/src/events/agent-words.ts +6 -2
- package/src/events/land-breakage.ts +3 -4
- package/src/events/need-wake.test.ts +55 -0
- package/src/events/need-wake.ts +71 -0
- package/src/events/resume.test.ts +13 -2
- package/src/events/resume.ts +25 -12
- package/src/events/sandbox-notice.ts +92 -0
- package/src/events/system-events.ts +7 -0
- package/src/events/transcript.ts +23 -1
- package/src/events/verify-nudge.ts +3 -3
- package/src/ids/conversation-ids.test.ts +2 -26
- package/src/ids/conversation-ids.ts +6 -12
- package/src/ids/project-dir.fixture.json +65 -0
- package/src/ids/project-dir.test.ts +60 -0
- package/src/ids/project-dir.ts +70 -0
- package/src/index.ts +18 -4
- package/src/models/agent-catalog.test.ts +7 -1
- package/src/models/agent-runtimes.ts +7 -5
- package/src/models/model-roles.ts +1 -9
- package/src/policy/command-classes.test.ts +39 -0
- package/src/policy/command-classes.ts +70 -3
- package/src/policy/safety-policy.ts +10 -0
- package/src/policy/secret-hosts.test.ts +89 -0
- package/src/policy/secret-hosts.ts +73 -0
- package/src/policy/turned-away.ts +1 -0
- package/src/protocol/raw-routes.ts +6 -3
- package/src/protocol/routes.test.ts +6 -6
- package/src/protocol/routes.ts +2 -9
- package/src/protocol/stream-of.ts +13 -0
- package/src/schemas/activity.ts +1 -1
- package/src/schemas/agent.ts +4 -1
- package/src/schemas/agents.ts +72 -5
- package/src/schemas/automations.ts +2 -2
- package/src/schemas/capabilities.ts +72 -7
- package/src/schemas/ci.ts +56 -11
- package/src/schemas/context-trim.ts +11 -6
- package/src/schemas/devices.ts +55 -2
- package/src/schemas/environment.ts +39 -0
- package/src/schemas/git/git.ts +20 -2
- package/src/schemas/hosts.ts +7 -1
- package/src/schemas/keep-warm.ts +19 -6
- package/src/schemas/loopback-catch.ts +45 -0
- package/src/schemas/maintenance.ts +1 -1
- package/src/schemas/needs.ts +301 -0
- package/src/schemas/personas.ts +8 -3
- package/src/schemas/providers/provider-oauth.ts +35 -0
- package/src/schemas/secrets.ts +93 -0
- package/src/schemas/settings-history.ts +2 -0
- package/src/schemas/settings.test.ts +19 -1
- package/src/schemas/settings.ts +66 -9
- package/src/schemas/speaker.ts +5 -5
- package/src/schemas/state-plan.ts +8 -1
- package/src/schemas/system.ts +15 -0
- package/src/schemas/terminal.ts +19 -6
- package/src/schemas/updates.ts +56 -0
- package/src/schemas/webext.ts +3 -0
- package/src/schemas/workflows.ts +5 -5
- package/src/schemas/workspace/workspace-tree.ts +7 -0
- package/src/state/fix-attempt-plan.test.ts +1 -1
- package/src/state/fix-stance.ts +1 -1
- package/src/state/history-state.ts +19 -0
- package/src/state/runtime-state.ts +0 -3
- package/src/state/workspace-state.ts +4 -6
- package/src/text/documents.test.ts +25 -1
- package/src/text/documents.ts +24 -0
- package/src/text/title.ts +1 -1
- package/src/text/transcript-fold.test.ts +218 -25
- package/src/text/transcript-fold.ts +170 -45
- package/src/webext/index.ts +1 -0
- package/dist/schemas/workspace/push-checks.d.ts +0 -222
- package/dist/schemas/workspace/push-checks.d.ts.map +0 -1
- package/dist/schemas/workspace/push-checks.js +0 -97
- package/dist/schemas/workspace/push-checks.js.map +0 -1
- package/dist/state/red-streak.d.ts +0 -7
- package/dist/state/red-streak.d.ts.map +0 -1
- package/dist/state/red-streak.js +0 -11
- package/dist/state/red-streak.js.map +0 -1
- package/src/schemas/workspace/push-checks.test.ts +0 -28
- package/src/schemas/workspace/push-checks.ts +0 -155
- package/src/state/red-streak.test.ts +0 -28
- package/src/state/red-streak.ts +0 -28
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { procedure } from "../protocol/route-meta.js";
|
|
2
|
-
import { AgentToolChildrenSchema, AgentTranscriptSchema } from "../events/transcript.js";
|
|
2
|
+
import { AgentToolChildrenSchema, AgentTranscriptSchema, SessionTranscriptSchema } from "../events/transcript.js";
|
|
3
3
|
import {
|
|
4
4
|
AgentAssignSchema,
|
|
5
5
|
AgentAutoLandSchema,
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
AgentRenameSchema,
|
|
16
16
|
AgentStopJobSchema,
|
|
17
17
|
AgentStopWatchingSchema,
|
|
18
|
+
AgentSubagentQuerySchema,
|
|
18
19
|
AgentsArchivedSchema,
|
|
19
20
|
AgentSearchQuerySchema,
|
|
20
21
|
AgentSearchResultSchema,
|
|
@@ -25,7 +26,6 @@ import {
|
|
|
25
26
|
LandResultSchema,
|
|
26
27
|
} from "../schemas/agents.js";
|
|
27
28
|
import { AgentsListSchema } from "../schemas/automations.js";
|
|
28
|
-
import { PushFixResultSchema, PushFixSchema } from "../schemas/workspace/push-checks.js";
|
|
29
29
|
import { AgentChangesSchema, AgentConflictsSchema, AgentScratchSchema, AgentHistorySchema } from "../schemas/git/git.js";
|
|
30
30
|
import { FileDiffSchema } from "../schemas/history.js";
|
|
31
31
|
import { OkSchema } from "../schemas/shared.js";
|
|
@@ -108,6 +108,17 @@ export const agentsContract = {
|
|
|
108
108
|
})
|
|
109
109
|
.input(AgentToolChildrenQuerySchema)
|
|
110
110
|
.output(AgentToolChildrenSchema),
|
|
111
|
+
subagentTranscript: procedure
|
|
112
|
+
.route({
|
|
113
|
+
method: "GET",
|
|
114
|
+
path: "/agents/{id}/subagents/{subagentId}/transcript",
|
|
115
|
+
summary: "One in-process subagent's own record",
|
|
116
|
+
description:
|
|
117
|
+
"What a subagent this conversation's runtime ran in-process said and did, as a transcript of its own: its ask, its thinking, its calls and its words. Read from the runtime's own record of the subagent where it keeps one, which it writes as the subagent works, else from the calls the delegation's card holds in this conversation's record. A subagent spawned as a conversation of its own is read through `transcript` instead.",
|
|
118
|
+
})
|
|
119
|
+
.meta({ guest: true })
|
|
120
|
+
.input(AgentSubagentQuerySchema)
|
|
121
|
+
.output(SessionTranscriptSchema),
|
|
111
122
|
// Also forgets the provider session, rewind-style, so the next fresh session reads the placed line as the agent's
|
|
112
123
|
// own.
|
|
113
124
|
place: procedure
|
|
@@ -283,17 +294,6 @@ export const agentsContract = {
|
|
|
283
294
|
})
|
|
284
295
|
.input(AgentScratchSchema)
|
|
285
296
|
.output(OkSchema),
|
|
286
|
-
// The one way an agent is put on what a push left behind: only ever on a press, never by the sandbox itself.
|
|
287
|
-
pushFix: procedure
|
|
288
|
-
.route({
|
|
289
|
-
method: "POST",
|
|
290
|
-
path: "/agents/push-fix",
|
|
291
|
-
summary: "Put an agent on what a push left behind",
|
|
292
|
-
description:
|
|
293
|
-
"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.",
|
|
294
|
-
})
|
|
295
|
-
.input(PushFixSchema)
|
|
296
|
-
.output(PushFixResultSchema),
|
|
297
297
|
land: procedure
|
|
298
298
|
.route({
|
|
299
299
|
method: "POST",
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
CapabilitySchema,
|
|
14
14
|
CapabilitySecretInputSchema,
|
|
15
15
|
CapabilityStatusSchema,
|
|
16
|
+
SshKeySchema,
|
|
16
17
|
} from "../schemas/capabilities.js";
|
|
17
18
|
import { MarketplaceRequestSchema, MarketplaceSchema } from "../schemas/marketplace.js";
|
|
18
19
|
import { RemoteRefsRequestSchema, RemoteRefsSchema } from "../schemas/git/remote-refs.js";
|
|
@@ -22,7 +23,7 @@ import { OkSchema } from "../schemas/shared.js";
|
|
|
22
23
|
const capabilityRoute = procedure.meta({ floor: "maintainer", control: "never" });
|
|
23
24
|
|
|
24
25
|
// The sandbox's unified capability manifest, spanning `list`/`add`/`remove`/`status`/`marketplace`. A VAULTED marker
|
|
25
|
-
// with nothing stored behind it is refused rather than silently written.
|
|
26
|
+
// with nothing stored behind it, or a stashed one (`sshKey`) with nothing held, is refused rather than silently written.
|
|
26
27
|
export const capabilitiesContract = {
|
|
27
28
|
list: capabilityRoute
|
|
28
29
|
.route({
|
|
@@ -56,6 +57,18 @@ export const capabilitiesContract = {
|
|
|
56
57
|
.meta({ panel: false })
|
|
57
58
|
.input(CapabilitySchema)
|
|
58
59
|
.output(CapabilityProbeSchema),
|
|
60
|
+
// The private half waits in the daemon's memory under the token; an add naming it installs the key.
|
|
61
|
+
sshKey: capabilityRoute
|
|
62
|
+
.route({
|
|
63
|
+
method: "POST",
|
|
64
|
+
path: "/capabilities/ssh-key",
|
|
65
|
+
summary: "Generate an SSH key for a connection",
|
|
66
|
+
description:
|
|
67
|
+
"Makes an ed25519 key pair inside the sandbox and answers with its public half, to authorize on the server, and a one-time token. The private half is never in the answer: it waits in the sandbox until an add sends the token where the private key goes, and lapses if none does within thirty minutes.",
|
|
68
|
+
})
|
|
69
|
+
// Mints the credential a later add installs: withheld from the panel token every panel process holds.
|
|
70
|
+
.meta({ panel: false })
|
|
71
|
+
.output(SshKeySchema),
|
|
59
72
|
remove: capabilityRoute
|
|
60
73
|
.route({
|
|
61
74
|
method: "DELETE",
|
|
@@ -4,6 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
import { DeviceAgentFlowSchema, DeviceFlowLineSchema, DeviceReportSchema, DeviceSandboxFlowSchema } from "../schemas/devices.js";
|
|
5
5
|
import { DeviceScopesSchema } from "../schemas/capabilities.js";
|
|
6
6
|
import { DeviceFactsSchema } from "../schemas/hosts.js";
|
|
7
|
+
import { LoopbackCatchEventSchema, LoopbackCatchSchema } from "../schemas/loopback-catch.js";
|
|
7
8
|
import { OkSchema } from "../schemas/shared.js";
|
|
8
9
|
|
|
9
10
|
// What a connected device can be asked, over the socket it opened; the machine is the oRPC server, the daemon the
|
|
@@ -26,4 +27,8 @@ export const deviceContract = {
|
|
|
26
27
|
runSandboxFlow: oc.input(DeviceSandboxFlowSchema).output(streamOf(DeviceFlowLineSchema)),
|
|
27
28
|
// Spawns the work detached from the socket, so restarting the agent process cannot brick a swap in progress.
|
|
28
29
|
runAgentFlow: oc.input(DeviceAgentFlowSchema).output(streamOf(DeviceFlowLineSchema)),
|
|
30
|
+
// Watches one loopback address on this machine for a sign-in's redirect (schemas/loopback-catch.ts); only the
|
|
31
|
+
// daemon arms it, never a tool, and aborting the stream is how it stops. Sent only to an agent advertising
|
|
32
|
+
// `loopback-catch`.
|
|
33
|
+
catchLoopback: oc.input(LoopbackCatchSchema).output(streamOf(LoopbackCatchEventSchema)),
|
|
29
34
|
};
|
|
@@ -34,12 +34,21 @@ export type TrialStatusResponse = z.infer<typeof TrialStatusSchema>;
|
|
|
34
34
|
export const LocalModelGpuSchema = z.enum(["granted", "unsupported", "absent"]);
|
|
35
35
|
export type LocalModelGpu = z.infer<typeof LocalModelGpuSchema>;
|
|
36
36
|
|
|
37
|
+
// Which one device a model runs at full speed on: the GPU when one reached this sandbox, else the host's RAM. One, never
|
|
38
|
+
// a sum: a model split between a card and the CPU runs at the CPU's pace.
|
|
39
|
+
export const LocalModelDeviceSchema = z.enum(["gpu", "host"]);
|
|
40
|
+
export type LocalModelDevice = z.infer<typeof LocalModelDeviceSchema>;
|
|
41
|
+
|
|
37
42
|
// One window rung priced against one model, so a surface never has to redo the arithmetic the start check will.
|
|
38
43
|
const LocalModelWindowFitSchema = z.object({
|
|
39
44
|
tokens: z.number().int().positive(),
|
|
40
45
|
// Weights + KV cache + the runtime's own floor: the same estimate the admission check refuses a start on.
|
|
41
46
|
totalBytes: z.number().int().nonnegative(),
|
|
47
|
+
// Whether it can load at all, GPU and host together: what a start is refused on.
|
|
42
48
|
fits: z.boolean(),
|
|
49
|
+
// Whether all of it fits in the free memory of the one device, so it runs at that device's pace. A rung can fit and
|
|
50
|
+
// still run mostly on the CPU. Absent from a daemon older than the distinction.
|
|
51
|
+
fullSpeed: z.boolean().optional(),
|
|
43
52
|
});
|
|
44
53
|
|
|
45
54
|
const LocalModelOptionFitSchema = z.object({
|
|
@@ -72,14 +81,21 @@ export const LocalModelFitSchema = z.object({
|
|
|
72
81
|
memoryCapped: z.boolean(),
|
|
73
82
|
gpu: LocalModelGpuSchema,
|
|
74
83
|
gpuMemoryBytes: z.number().int().nonnegative(),
|
|
75
|
-
// The
|
|
76
|
-
|
|
84
|
+
// The GPU's free memory, on the card with the most of it; zero before the grant. Absent from an older daemon.
|
|
85
|
+
gpuFreeBytes: z.number().int().nonnegative().optional(),
|
|
86
|
+
// What a start is refused on: the host and the GPU together, since llama.cpp can split a model between them. Only a
|
|
87
|
+
// model that cannot load at all is turned away here; a model that fits only this way runs mostly on the CPU.
|
|
77
88
|
budgetBytes: z.number().int().nonnegative(),
|
|
89
|
+
// What a model may take and still run at full speed: the free memory of one device (fullSpeedDevice), plus whatever
|
|
90
|
+
// this sandbox's own local model holds there now, since a start stops it first. Both offers are sized against this,
|
|
91
|
+
// never against the sum. Zero means unmeasurable. Absent from a daemon older than the distinction.
|
|
92
|
+
fullSpeedBytes: z.number().int().nonnegative().optional(),
|
|
93
|
+
fullSpeedDevice: LocalModelDeviceSchema.optional(),
|
|
78
94
|
// Whether llama-server is in this image. False means the local lane costs a rebuild before it can serve anything.
|
|
79
95
|
serverReady: z.boolean(),
|
|
80
96
|
options: z.array(LocalModelOptionFitSchema),
|
|
81
97
|
// The two the connect view offers by name. Each is a model plus the window it was priced at, ready to be added
|
|
82
|
-
// verbatim; absent where nothing on the list
|
|
98
|
+
// verbatim, and each runs at full speed; absent where nothing on the list does, which is an answer, not an error.
|
|
83
99
|
instant: z.object({ model: z.string(), context: z.string() }).optional(),
|
|
84
100
|
best: z.object({ model: z.string(), context: z.string() }).optional(),
|
|
85
101
|
prefetch: LocalModelPrefetchSchema,
|
|
@@ -114,7 +130,7 @@ export const endpointsContract = {
|
|
|
114
130
|
path: "/endpoints/local-model/fit",
|
|
115
131
|
summary: "Which local models this machine can actually run",
|
|
116
132
|
description:
|
|
117
|
-
"The memory this sandbox may use, whether a GPU reached it, and every curated model priced
|
|
133
|
+
"The memory this sandbox may use, whether a GPU reached it, and every curated model priced two ways: whether it fits on one device's free memory and so runs at full speed, and whether it can load at all. The two the connect view offers, one that downloads in a minute and the best this machine runs at full speed, come from the first; a start is refused only on the second.",
|
|
118
134
|
})
|
|
119
135
|
.output(LocalModelFitSchema),
|
|
120
136
|
// Start or stop fetching the instant model's weights before anyone has asked for them, so the first local turn does
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { procedure } from "../protocol/route-meta.js";
|
|
2
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
3
|
+
import {
|
|
4
|
+
GrantRevokeSchema,
|
|
5
|
+
NeedAnswerInputSchema,
|
|
6
|
+
NeedIdParamSchema,
|
|
7
|
+
NeedRaisedSchema,
|
|
8
|
+
NeedRaiseSchema,
|
|
9
|
+
NeedSchema,
|
|
10
|
+
NeedSecretInputSchema,
|
|
11
|
+
NeedsListSchema,
|
|
12
|
+
NeedsQuerySchema,
|
|
13
|
+
StandingGrantsSchema,
|
|
14
|
+
} from "../schemas/needs.js";
|
|
15
|
+
|
|
16
|
+
// Needs (docs/architecture/needs.md): the agent's CLIs raise and withdraw them on the agent token; a person reads and
|
|
17
|
+
// answers them from the chat, the board and the Needs you inbox. Answering is the operating tier's, like the capability
|
|
18
|
+
// and secret routes an answer ends up writing through.
|
|
19
|
+
|
|
20
|
+
const agentDoor = procedure.meta({ agent: true, control: "never" });
|
|
21
|
+
const answerRoute = procedure.meta({ floor: "maintainer", control: "never" });
|
|
22
|
+
|
|
23
|
+
export const needsContract = {
|
|
24
|
+
ask: agentDoor
|
|
25
|
+
.route({
|
|
26
|
+
method: "POST",
|
|
27
|
+
path: "/needs/ask",
|
|
28
|
+
summary: "Ask a person for something the task needs",
|
|
29
|
+
description:
|
|
30
|
+
"Raises a need in the conversation the calling shell belongs to and holds the call up to `wait` seconds for an answer. Answers `met` when it is usable now (or already was), `open` when it is still waiting, and `refused` when nothing was raised or a person declined. An open need's answer reaches the conversation by itself.",
|
|
31
|
+
})
|
|
32
|
+
// Held open while the person decides, by design.
|
|
33
|
+
.meta({ stream: true })
|
|
34
|
+
.input(NeedRaiseSchema)
|
|
35
|
+
.output(NeedRaisedSchema),
|
|
36
|
+
mine: agentDoor
|
|
37
|
+
.route({
|
|
38
|
+
method: "GET",
|
|
39
|
+
path: "/needs/mine",
|
|
40
|
+
summary: "This conversation's needs",
|
|
41
|
+
description: "Every need the calling shell's conversation raised, newest first, open or answered.",
|
|
42
|
+
})
|
|
43
|
+
.output(NeedsListSchema),
|
|
44
|
+
withdraw: agentDoor
|
|
45
|
+
.route({
|
|
46
|
+
method: "POST",
|
|
47
|
+
path: "/needs/{id}/withdraw",
|
|
48
|
+
summary: "Withdraw a need",
|
|
49
|
+
description: "Closes one of this conversation's open needs because the task no longer needs it. Its card says so.",
|
|
50
|
+
})
|
|
51
|
+
.input(NeedIdParamSchema)
|
|
52
|
+
.output(NeedSchema),
|
|
53
|
+
list: procedure
|
|
54
|
+
.route({
|
|
55
|
+
method: "GET",
|
|
56
|
+
path: "/needs",
|
|
57
|
+
summary: "What agents are waiting on people for",
|
|
58
|
+
description: "Needs across the sandbox, or one conversation's, newest first. Never a secret's value.",
|
|
59
|
+
})
|
|
60
|
+
.input(NeedsQuerySchema)
|
|
61
|
+
.output(NeedsListSchema),
|
|
62
|
+
answer: answerRoute
|
|
63
|
+
.route({
|
|
64
|
+
method: "POST",
|
|
65
|
+
path: "/needs/{id}/answer",
|
|
66
|
+
summary: "Answer a need",
|
|
67
|
+
description:
|
|
68
|
+
"Declines it, or says yes the way its card offered: accept a connection being set up, apply a change, grant for this conversation or the persona, release a gated credential, approve an environment proposal. A release is refused from anyone the gate does not name.",
|
|
69
|
+
})
|
|
70
|
+
.input(NeedAnswerInputSchema)
|
|
71
|
+
.output(NeedSchema),
|
|
72
|
+
provideSecret: answerRoute
|
|
73
|
+
.route({
|
|
74
|
+
method: "POST",
|
|
75
|
+
path: "/needs/{id}/secret",
|
|
76
|
+
summary: "Give a secret a need asked for",
|
|
77
|
+
description:
|
|
78
|
+
"Stores the value under the name the need asked for and meets it. The value goes to the sandbox's secret store and nowhere else: not the answer, not the transcript, not a log.",
|
|
79
|
+
})
|
|
80
|
+
// Puts a credential in motion: withheld from the panel token.
|
|
81
|
+
.meta({ panel: false })
|
|
82
|
+
.input(NeedSecretInputSchema)
|
|
83
|
+
.output(NeedSchema),
|
|
84
|
+
grants: answerRoute
|
|
85
|
+
.route({
|
|
86
|
+
method: "GET",
|
|
87
|
+
path: "/needs/grants",
|
|
88
|
+
summary: "The yeses still standing",
|
|
89
|
+
description:
|
|
90
|
+
"What people allowed conversations beyond their persona or area, and the gated credentials released to them, by conversation. Names only, never a value.",
|
|
91
|
+
})
|
|
92
|
+
.output(StandingGrantsSchema),
|
|
93
|
+
revokeGrant: answerRoute
|
|
94
|
+
.route({
|
|
95
|
+
method: "POST",
|
|
96
|
+
path: "/needs/grants/revoke",
|
|
97
|
+
summary: "Take a yes back",
|
|
98
|
+
description:
|
|
99
|
+
"Takes back one grant or one release. The conversation's next turn runs without it; a turn already running keeps what it mounted.",
|
|
100
|
+
})
|
|
101
|
+
.input(GrantRevokeSchema)
|
|
102
|
+
.output(OkSchema),
|
|
103
|
+
};
|
|
@@ -7,6 +7,11 @@ import {
|
|
|
7
7
|
CredentialRequestSchema,
|
|
8
8
|
SecretInventorySchema,
|
|
9
9
|
SecretKeyParamSchema,
|
|
10
|
+
SecretGeneratedSchema,
|
|
11
|
+
SecretGenerateSchema,
|
|
12
|
+
SecretHostGuardSetResultSchema,
|
|
13
|
+
SecretHostGuardSetSchema,
|
|
14
|
+
SecretHostGuardsSchema,
|
|
10
15
|
SecretKeysSchema,
|
|
11
16
|
SecretRevealSchema,
|
|
12
17
|
SecretSetSchema,
|
|
@@ -16,8 +21,8 @@ import { OkSchema } from "../schemas/shared.js";
|
|
|
16
21
|
// Credentials are the operating tier's, reads included: maintainer is the highest revokable grant, and no token's.
|
|
17
22
|
const secretRoute = procedure.meta({ floor: "maintainer", control: "never" });
|
|
18
23
|
|
|
19
|
-
// User-supplied secrets, in the gitignored desired-state/.env
|
|
20
|
-
// every store (never values) and always answers
|
|
24
|
+
// User-supplied secrets, in the gitignored desired-state/.env once DevOps is active and the sandbox's own store before
|
|
25
|
+
// it; `apply` reloads them, no restart. `inventory` aggregates every store (never values) and always answers. `reveal` alone
|
|
21
26
|
// returns a value, owner-only, POST so the key avoids the URL.
|
|
22
27
|
export const secretsContract = {
|
|
23
28
|
set: secretRoute
|
|
@@ -26,10 +31,22 @@ export const secretsContract = {
|
|
|
26
31
|
path: "/secrets",
|
|
27
32
|
summary: "Store a secret",
|
|
28
33
|
description:
|
|
29
|
-
"Writes one name and value
|
|
34
|
+
"Writes one name and value where the agent's references resolve it, without a restart: desired-state/.env once DevOps is active, the sandbox's own secret store before that.",
|
|
30
35
|
})
|
|
31
36
|
.input(SecretSetSchema)
|
|
32
37
|
.output(OkSchema),
|
|
38
|
+
generate: secretRoute
|
|
39
|
+
.route({
|
|
40
|
+
method: "POST",
|
|
41
|
+
path: "/secrets/generate",
|
|
42
|
+
summary: "Make and store a random secret",
|
|
43
|
+
description:
|
|
44
|
+
"Makes a random value and stores it under a new name, where `set` would have put it, for a secret nobody has to find or paste (a session key, a signing secret, a password the task sets up itself). Answers the name and its length, never the value. Refused for a name something here already holds.",
|
|
45
|
+
})
|
|
46
|
+
// The `secrets generate` CLI, on the agent token: it creates a value, and hands none back.
|
|
47
|
+
.meta({ agent: true })
|
|
48
|
+
.input(SecretGenerateSchema)
|
|
49
|
+
.output(SecretGeneratedSchema),
|
|
33
50
|
list: secretRoute
|
|
34
51
|
.route({
|
|
35
52
|
method: "GET",
|
|
@@ -99,6 +116,31 @@ export const secretsContract = {
|
|
|
99
116
|
})
|
|
100
117
|
.input(CredentialGuardSubjectParamSchema)
|
|
101
118
|
.output(OkSchema),
|
|
119
|
+
// The host guard, the gate's second half: kept beside the gates, off the agent-editable config for the same reason. The
|
|
120
|
+
// agent reads it so a use can aim where it may go, and may tighten it; loosening waits for the owner's click.
|
|
121
|
+
hosts: secretRoute
|
|
122
|
+
.route({
|
|
123
|
+
method: "GET",
|
|
124
|
+
path: "/secrets/hosts",
|
|
125
|
+
summary: "Which secrets are host-guarded, and where they may go",
|
|
126
|
+
description:
|
|
127
|
+
"Every secret and connected account whose host guard is set, on or off, and its hosts. With the guard on, a use aimed off the list, or anywhere a command's text does not show, asks a person first, whatever the safety judge says. Names and hosts only, never values.",
|
|
128
|
+
})
|
|
129
|
+
// The `secrets gates` and `secrets hosts` CLI's read, on the agent token.
|
|
130
|
+
.meta({ agent: true })
|
|
131
|
+
.output(SecretHostGuardsSchema),
|
|
132
|
+
setHosts: secretRoute
|
|
133
|
+
.route({
|
|
134
|
+
method: "PUT",
|
|
135
|
+
path: "/secrets/hosts/{subject}",
|
|
136
|
+
summary: "Turn a secret's host guard on or off, and set its hosts",
|
|
137
|
+
description:
|
|
138
|
+
"Replaces one secret's host guard. Anybody who may use secrets can turn it on or take hosts away; turning it off or adding a host is the owner's: from the agent it raises a card for the owner in the live conversation and waits for their answer.",
|
|
139
|
+
})
|
|
140
|
+
// The `secrets hosts` CLI's edits, on the agent token; the route itself decides what needs the owner.
|
|
141
|
+
.meta({ agent: true })
|
|
142
|
+
.input(SecretHostGuardSetSchema)
|
|
143
|
+
.output(SecretHostGuardSetResultSchema),
|
|
102
144
|
request: secretRoute
|
|
103
145
|
.route({
|
|
104
146
|
method: "POST",
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { FIELD_NOTES_FILE } from "@intentic/constants";
|
|
2
2
|
import { procedure } from "../protocol/route-meta.js";
|
|
3
3
|
import {
|
|
4
|
+
AudienceAnswerSchema,
|
|
5
|
+
AudienceStateSchema,
|
|
4
6
|
BuiltinPromptSchema,
|
|
7
|
+
MemberAudienceSchema,
|
|
5
8
|
BuiltinPromptTextSchema,
|
|
6
9
|
FieldNotesStatusSchema,
|
|
7
10
|
REPO_CHECKS_FILE,
|
|
@@ -103,6 +106,32 @@ export const settingsContract = {
|
|
|
103
106
|
})
|
|
104
107
|
.input(TimezoneOfferSchema)
|
|
105
108
|
.output(TimezoneStateSchema),
|
|
109
|
+
// A person's own preference rather than a sandbox setting: kept per member, so every device a person opens this
|
|
110
|
+
// sandbox on reads it, and nobody's answer changes another member's screen. Anyone signed in may read and give their
|
|
111
|
+
// own, a guest included, since it changes nothing but the words they are shown.
|
|
112
|
+
audience: procedure
|
|
113
|
+
.route({
|
|
114
|
+
method: "GET",
|
|
115
|
+
path: "/settings/audience",
|
|
116
|
+
summary: "Which words the editor uses for you here",
|
|
117
|
+
description:
|
|
118
|
+
"Whether your editor speaks git's own words (developer) or plain ones (maker) on this sandbox, in every browser and on every device. Absent until you have chosen here.",
|
|
119
|
+
})
|
|
120
|
+
.meta({ guest: true })
|
|
121
|
+
.output(MemberAudienceSchema),
|
|
122
|
+
// A browser handing over the answer it kept on its own must not overwrite one the person already gave on another
|
|
123
|
+
// device, which is what `offer` says; a plain answer replaces it.
|
|
124
|
+
setAudience: procedure
|
|
125
|
+
.route({
|
|
126
|
+
method: "POST",
|
|
127
|
+
path: "/settings/audience",
|
|
128
|
+
summary: "Choose which words the editor uses for you here",
|
|
129
|
+
description:
|
|
130
|
+
"Sets whether your editor speaks git's own words (developer) or plain ones (maker) on this sandbox, for every browser and device you open it on. Other members keep their own. With `offer` it is taken only while you have none kept, and the kept answer comes back unchanged.",
|
|
131
|
+
})
|
|
132
|
+
.meta({ guest: true, floor: "viewer" })
|
|
133
|
+
.input(AudienceAnswerSchema)
|
|
134
|
+
.output(AudienceStateSchema),
|
|
106
135
|
adoptRepoChecks: procedure
|
|
107
136
|
.route({
|
|
108
137
|
method: "POST",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { procedure } from "../protocol/route-meta.js";
|
|
2
2
|
import { streamOf } from "../protocol/routes.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { SessionTranscriptSchema } from "../events/transcript.js";
|
|
5
4
|
import { SystemEventSchema } from "../events/system-events.js";
|
|
6
5
|
import {
|
|
7
6
|
DeviceAgentFlowInputSchema,
|
|
@@ -15,10 +14,10 @@ import { PresenceReportSchema } from "../schemas/logs.js";
|
|
|
15
14
|
import { SandboxMetricsSchema, StorageCleanInputSchema, StorageCleanResultSchema, StorageReportSchema } from "../schemas/metrics.js";
|
|
16
15
|
import { OkSchema } from "../schemas/shared.js";
|
|
17
16
|
import { DaemonSessionSchema, InfoSchema, ManifestProblemsSchema, ManifestRepairSchema } from "../schemas/system.js";
|
|
17
|
+
import { SkipUpdateInputSchema } from "../schemas/updates.js";
|
|
18
18
|
import {
|
|
19
19
|
BrowserNameParamSchema,
|
|
20
20
|
BrowsersListSchema,
|
|
21
|
-
SubagentIdParamSchema,
|
|
22
21
|
SubagentsListSchema,
|
|
23
22
|
TerminalNameParamSchema,
|
|
24
23
|
TerminalScrollbackQuerySchema,
|
|
@@ -44,6 +43,19 @@ export const systemContract = {
|
|
|
44
43
|
})
|
|
45
44
|
.meta({ guest: true })
|
|
46
45
|
.output(InfoSchema),
|
|
46
|
+
// The owner's "not this one" for the update card; /info's `skippedVersion` reads it back.
|
|
47
|
+
skipUpdate: systemRoute
|
|
48
|
+
.route({
|
|
49
|
+
method: "POST",
|
|
50
|
+
path: "/system/update/skip",
|
|
51
|
+
summary: "Stop offering one release",
|
|
52
|
+
description:
|
|
53
|
+
"Stops offering the named release as an update, typically one this sandbox already tried and went back from. A newer release is offered as usual. Null offers the newest release again.",
|
|
54
|
+
})
|
|
55
|
+
// Which version the sandbox runs is the operator's decision, like the update itself.
|
|
56
|
+
.meta({ floor: "maintainer" })
|
|
57
|
+
.input(SkipUpdateInputSchema)
|
|
58
|
+
.output(OkSchema),
|
|
47
59
|
// Own route, not a field on /info: it goes stale on a manifest changing on disk, not on identity changing.
|
|
48
60
|
manifestProblems: systemRoute
|
|
49
61
|
.route({
|
|
@@ -214,26 +226,19 @@ export const systemContract = {
|
|
|
214
226
|
})
|
|
215
227
|
.input(BrowserNameParamSchema)
|
|
216
228
|
.output(OkSchema),
|
|
217
|
-
//
|
|
229
|
+
// In-process and spawned alike: the board draws each under the card of the conversation that started it, and a chat
|
|
230
|
+
// draws it on the card of the call that started it. Pushed through the `subagents` runtime domain, never polled. A
|
|
231
|
+
// subagent's work is read where it lives: an in-process one's on its delegation's card in its parent's record, a
|
|
232
|
+
// spawned one's in its own conversation (agents.transcript), so there is no second transcript door here.
|
|
218
233
|
subagents: systemRoute
|
|
219
234
|
.route({
|
|
220
235
|
method: "GET",
|
|
221
236
|
path: "/system/subagents",
|
|
222
237
|
summary: "Subagents the agents have started",
|
|
223
238
|
description:
|
|
224
|
-
"Every subagent
|
|
239
|
+
"Every subagent that conversations the caller can see have delegated work to, whichever tool started it, with what each one is doing: all that are still working, and the most recent that have settled.",
|
|
225
240
|
})
|
|
226
241
|
.output(SubagentsListSchema),
|
|
227
|
-
subagentTranscript: systemRoute
|
|
228
|
-
.route({
|
|
229
|
-
method: "GET",
|
|
230
|
-
path: "/system/subagents/{id}/transcript",
|
|
231
|
-
summary: "A subagent's record",
|
|
232
|
-
description:
|
|
233
|
-
"The full record of one delegated subagent, in the same shape as any other conversation. It comes live from the parent turn while it works, and from stored history once it has finished.",
|
|
234
|
-
})
|
|
235
|
-
.input(SubagentIdParamSchema)
|
|
236
|
-
.output(SessionTranscriptSchema),
|
|
237
242
|
// On the contract, not a hand-written route beside it: this payload is what every "do it out there" button is
|
|
238
243
|
// gated on, so its shape has to be fingerprinted like any other, or a daemon older than the app disagrees about
|
|
239
244
|
// it silently and the buttons just stop being drawn.
|
|
@@ -12,7 +12,8 @@ import { OkSchema } from "../schemas/shared.js";
|
|
|
12
12
|
//
|
|
13
13
|
// Two login shapes ride one pair of routes. Codex, Grok and Kimi use device authorization: the translator polls
|
|
14
14
|
// to completion in the background, so the UI polls the attempt. Google redirects the browser to a loopback
|
|
15
|
-
// URL this sandbox can't receive
|
|
15
|
+
// URL this sandbox can't receive: a device or browser of the owner's catches it where one can (`connect.catchers`),
|
|
16
|
+
// otherwise `complete` takes the landing URL pasted back; either way it reaches the translator the same way. `connect.flow` tells the
|
|
16
17
|
// card which mechanic it received without inferring it from whether an optional device code happened to exist.
|
|
17
18
|
export const translatorContract = {
|
|
18
19
|
accounts: procedure
|
|
@@ -2,6 +2,8 @@ import { oc } from "@orpc/contract";
|
|
|
2
2
|
// Named imports rather than the `z` namespace: this module is bundled into the browser extension, where the
|
|
3
3
|
// namespace keeps zod's 60 locales (~250 kB) that esbuild can otherwise drop. _devices/webext/scripts/size-budget.mjs holds the ceiling.
|
|
4
4
|
import { unknown } from "zod";
|
|
5
|
+
import { streamOf } from "../protocol/stream-of.js";
|
|
6
|
+
import { LoopbackCatchEventSchema, LoopbackCatchSchema } from "../schemas/loopback-catch.js";
|
|
5
7
|
import { OkSchema } from "../schemas/shared.js";
|
|
6
8
|
import { WebExtFactsSchema, WebExtScopesSchema } from "../schemas/webext.js";
|
|
7
9
|
|
|
@@ -9,7 +11,8 @@ import { WebExtFactsSchema, WebExtScopesSchema } from "../schemas/webext.js";
|
|
|
9
11
|
// inverted from device.contract.ts, since a browser cannot be dialled.
|
|
10
12
|
// `mcp` stays one opaque procedure so a browser can gain a tool without a matching daemon release; the payload is
|
|
11
13
|
// validated in the extension against the tool's own schema.
|
|
12
|
-
// No `runSandboxFlow` twin: every browser operation is a click or read that either happened or did not.
|
|
14
|
+
// No `runSandboxFlow` twin: every browser operation is a click or read that either happened or did not. The one stream
|
|
15
|
+
// is `catchLoopback`, the device agent's own procedure answered the same way, so the daemon drives both alike.
|
|
13
16
|
export const webextContract = {
|
|
14
17
|
// Refetched on connect and each card read, never cached: the grant list changes in the browser, not here.
|
|
15
18
|
describe: oc.output(WebExtFactsSchema),
|
|
@@ -19,4 +22,7 @@ export const webextContract = {
|
|
|
19
22
|
ping: oc.output(OkSchema),
|
|
20
23
|
// One MCP JSON-RPC message forwarded verbatim in both directions; kept opaque, not typed per tool.
|
|
21
24
|
mcp: oc.input(unknown()).output(unknown()),
|
|
25
|
+
// Watches for a tab reaching one loopback address, a sign-in's redirect (schemas/loopback-catch.ts); armed by the
|
|
26
|
+
// daemon only, and sent only to a browser whose facts list `loopback-catch`.
|
|
27
|
+
catchLoopback: oc.input(LoopbackCatchSchema).output(streamOf(LoopbackCatchEventSchema)),
|
|
22
28
|
};
|
|
@@ -16,13 +16,6 @@ import {
|
|
|
16
16
|
WorkspaceGraphSchema,
|
|
17
17
|
WorkspaceSyncSchema,
|
|
18
18
|
} from "../schemas/workspace/workspace-repos.js";
|
|
19
|
-
import {
|
|
20
|
-
PushChecksSchema,
|
|
21
|
-
PushDismissResultSchema,
|
|
22
|
-
PushDismissSchema,
|
|
23
|
-
PushRecheckResultSchema,
|
|
24
|
-
PushRecheckSchema,
|
|
25
|
-
} from "../schemas/workspace/push-checks.js";
|
|
26
19
|
import { WorkspaceSearchQuerySchema, WorkspaceSearchResultSchema } from "../schemas/workspace/workspace-search.js";
|
|
27
20
|
import { WorkspaceInstallResultSchema, WorkspaceInstallSchema, WorkspaceSetupSchema } from "../schemas/workspace/workspace-setup.js";
|
|
28
21
|
import {
|
|
@@ -283,36 +276,6 @@ export const workspaceContract = {
|
|
|
283
276
|
})
|
|
284
277
|
.input(WorkspaceInstallSchema)
|
|
285
278
|
.output(WorkspaceInstallResultSchema),
|
|
286
|
-
// What the pre-push hook found and let through waits here until measured gone or dismissed; with the two hands on it.
|
|
287
|
-
pushChecks: procedure
|
|
288
|
-
.route({
|
|
289
|
-
method: "GET",
|
|
290
|
-
path: "/workspace/push-checks",
|
|
291
|
-
summary: "What pushes left behind",
|
|
292
|
-
description:
|
|
293
|
-
"Every push the pre-push hook measured, newest first, with what each brought in, and what is still owed per project. The hook never refuses a push, so this is where its findings wait. Nothing here is ever sent to an agent by itself.",
|
|
294
|
-
})
|
|
295
|
-
.output(PushChecksSchema),
|
|
296
|
-
pushDismiss: procedure
|
|
297
|
-
.route({
|
|
298
|
-
method: "POST",
|
|
299
|
-
path: "/workspace/push-checks/dismiss",
|
|
300
|
-
summary: "Set aside what a push left behind",
|
|
301
|
-
description:
|
|
302
|
-
"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.",
|
|
303
|
-
})
|
|
304
|
-
.input(PushDismissSchema)
|
|
305
|
-
.output(PushDismissResultSchema),
|
|
306
|
-
pushRecheck: procedure
|
|
307
|
-
.route({
|
|
308
|
-
method: "POST",
|
|
309
|
-
path: "/workspace/push-checks/recheck",
|
|
310
|
-
summary: "Measure what a push left behind again",
|
|
311
|
-
description:
|
|
312
|
-
"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.",
|
|
313
|
-
})
|
|
314
|
-
.input(PushRecheckSchema)
|
|
315
|
-
.output(PushRecheckResultSchema),
|
|
316
279
|
repos: procedure
|
|
317
280
|
.route({
|
|
318
281
|
method: "GET",
|
|
@@ -5,6 +5,7 @@ import { LandConflictSchema } from "../schemas/agents.js";
|
|
|
5
5
|
import { ContextTrimSchema } from "../schemas/context-trim.js";
|
|
6
6
|
import { RateLimitInfoSchema } from "../schemas/providers/claude-gate.js";
|
|
7
7
|
import { FastModeStateSchema } from "../schemas/providers/fast-mode.js";
|
|
8
|
+
import { NeedSchema } from "../schemas/needs.js";
|
|
8
9
|
import { PromptCacheOpeningSchema, PromptFingerprintSchema } from "../schemas/keep-warm.js";
|
|
9
10
|
import { AgentReplySchema, UsageWindowSchema } from "../schemas/providers/plan-limits.js";
|
|
10
11
|
import { SubagentKindSchema, SubagentStatusSchema, SubagentVerificationSchema } from "../schemas/terminal.js";
|
|
@@ -37,13 +38,16 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
|
37
38
|
remote: z.string().optional(),
|
|
38
39
|
}),
|
|
39
40
|
// After a clean isolated turn's delta lands or not: `landed` puts it uncommitted in the main tree, `conflicts`
|
|
40
|
-
// names paths that failed, `held` means nothing happened. `deps` covers undeclared dependencies.
|
|
41
|
+
// names paths that failed, `held` means nothing happened. `deps` covers undeclared dependencies. `into` names the
|
|
42
|
+
// parent conversation a spawned child's work went into instead of the main tree, as an in-process subagent's edits
|
|
43
|
+
// go into its parent's checkout.
|
|
41
44
|
z.object({
|
|
42
45
|
kind: z.literal("landed"),
|
|
43
46
|
landed: z.boolean(),
|
|
44
47
|
conflicts: z.array(LandConflictSchema).optional(),
|
|
45
48
|
held: z.boolean().optional(),
|
|
46
49
|
deps: z.object({ missing: z.number(), started: z.array(z.string()), deferred: z.boolean() }).optional(),
|
|
50
|
+
into: z.string().optional(),
|
|
47
51
|
}),
|
|
48
52
|
// Notes the daemon prepends to the user's message before the model reads it, verbatim, one per note. Serialized
|
|
49
53
|
// from the same typed notes the wire prompt uses, so disclosure cannot drift from what the model got.
|
|
@@ -179,6 +183,17 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
|
179
183
|
z.object({ kind: z.literal("account_usage"), account: z.string().optional(), windows: z.array(UsageWindowSchema) }),
|
|
180
184
|
ContextUsageSchema.extend({ kind: z.literal("context_usage") }),
|
|
181
185
|
z.object({ kind: z.literal("compact"), trigger: z.string(), preTokens: z.number().optional(), postTokens: z.number().optional() }),
|
|
186
|
+
// An agent's own project-dependency install was let through the command gate: where it writes, and which projects
|
|
187
|
+
// it works on, so the chat says so before its output arrives. Said by every runtime the gate stands in front of.
|
|
188
|
+
z.object({
|
|
189
|
+
kind: z.literal("install"),
|
|
190
|
+
reach: z
|
|
191
|
+
.enum(["own-copy", "main-tree"])
|
|
192
|
+
.describe("Where it writes: this conversation's own copy of the tree, or the main tree every conversation reads."),
|
|
193
|
+
projects: z
|
|
194
|
+
.array(z.string())
|
|
195
|
+
.describe("The projects it works on, workspace-relative, the workspace root as an empty string; empty when none could be named."),
|
|
196
|
+
}),
|
|
182
197
|
// The four interactive cards; each parks the turn until `POST /agent/reply` resolves its `requestId`.
|
|
183
198
|
PlanRequestSchema,
|
|
184
199
|
QuestionRequestSchema,
|
|
@@ -206,6 +221,9 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
|
206
221
|
// Who released it: `released` names the approver's verified address, `refused` means someone said no. Nothing is
|
|
207
222
|
// pushed for a card nobody answered; `resolved` already says that.
|
|
208
223
|
CredentialReceiptSchema.extend({ kind: z.literal("credential_receipt"), requestId: z.string() }),
|
|
224
|
+
// Something the agent asked a person for (docs/architecture/needs.md). Parks nothing: the turn carries on, the need
|
|
225
|
+
// outlives it in the needs store, and its card draws the store's live state by `need.id`.
|
|
226
|
+
z.object({ kind: z.literal("need"), need: NeedSchema }),
|
|
209
227
|
// The named card is released and the turn resumes; emitted the moment its waiter settles, since nothing else on
|
|
210
228
|
// this stream marks a park's end. `reply` is what a rebuilt transcript freezes the card with.
|
|
211
229
|
z.object({ kind: z.literal("resolved"), requestId: z.string(), reply: AgentReplySchema.optional() }),
|
|
@@ -248,6 +266,9 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
|
248
266
|
// The model cannot hold a turn this size, refused before sending; retrying the same request never
|
|
249
267
|
// helps.
|
|
250
268
|
"context-window-too-small",
|
|
269
|
+
// The model can only write one-shot jobs (Model.helperOnly: its server says it cannot call tools, or
|
|
270
|
+
// it is the quick-jobs local model), refused before sending; the words wait for another model.
|
|
271
|
+
"model-helper-only",
|
|
251
272
|
// The session outgrew the model's context window mid-turn; resuming that session only overflows again,
|
|
252
273
|
// so the daemon re-runs the turn once in a fresh session carrying the hand-off.
|
|
253
274
|
"context-overflow",
|