@intentic/sandbox-contract 1.431.0 → 1.432.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 +10 -3
- package/dist/briefs/agent-ask.d.ts +10 -0
- package/dist/briefs/agent-ask.d.ts.map +1 -0
- package/dist/briefs/agent-ask.js +2 -0
- package/dist/briefs/agent-ask.js.map +1 -0
- package/dist/{chores/extension-update.d.ts → briefs/extension-update-brief.d.ts} +1 -1
- package/dist/briefs/extension-update-brief.d.ts.map +1 -0
- package/dist/{chores/extension-update.js → briefs/extension-update-brief.js} +2 -2
- package/dist/briefs/extension-update-brief.js.map +1 -0
- package/dist/chores/digest.d.ts.map +1 -1
- package/dist/chores/digest.js.map +1 -1
- package/dist/chores/index.d.ts +2 -2
- package/dist/chores/index.d.ts.map +1 -1
- package/dist/chores/index.js +1 -1
- package/dist/chores/index.js.map +1 -1
- package/dist/chores/prompt.d.ts +1 -9
- package/dist/chores/prompt.d.ts.map +1 -1
- package/dist/chores/prompt.js +1 -1
- package/dist/chores/prompt.js.map +1 -1
- package/dist/chores/stack.d.ts.map +1 -1
- package/dist/chores/stack.js.map +1 -1
- package/dist/chores/verdict.d.ts.map +1 -1
- package/dist/chores/verdict.js.map +1 -1
- package/dist/chores/workspace-scope.d.ts +1 -3
- package/dist/chores/workspace-scope.d.ts.map +1 -1
- package/dist/chores/workspace-scope.js +1 -3
- package/dist/chores/workspace-scope.js.map +1 -1
- package/dist/contracts/agent.contract.d.ts +869 -12
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.d.ts +291 -4
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/automations.contract.d.ts +59 -8
- package/dist/contracts/automations.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts +37 -0
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.js +21 -0
- package/dist/contracts/capabilities.contract.js.map +1 -1
- package/dist/contracts/ci.contract.d.ts +222 -95
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/ci.contract.js +87 -26
- package/dist/contracts/ci.contract.js.map +1 -1
- package/dist/contracts/device-stacks.contract.d.ts +129 -0
- package/dist/contracts/device-stacks.contract.d.ts.map +1 -0
- package/dist/contracts/device-stacks.contract.js +66 -0
- package/dist/contracts/device-stacks.contract.js.map +1 -0
- package/dist/contracts/device.contract.d.ts +47 -0
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.d.ts +603 -0
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.js +10 -1
- package/dist/contracts/extensions.contract.js.map +1 -1
- package/dist/contracts/needs.contract.d.ts +689 -18
- package/dist/contracts/needs.contract.d.ts.map +1 -1
- package/dist/contracts/offload.contract.d.ts +21 -0
- package/dist/contracts/offload.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +501 -8
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/seal.contract.d.ts +15 -0
- package/dist/contracts/seal.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.d.ts +15 -0
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js +21 -1
- package/dist/contracts/secrets.contract.js.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +111 -2
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +57 -42
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.js +18 -0
- package/dist/contracts/settings.contract.js.map +1 -1
- package/dist/contracts/stack-grants.contract.d.ts +418 -0
- package/dist/contracts/stack-grants.contract.d.ts.map +1 -0
- package/dist/contracts/stack-grants.contract.js +46 -0
- package/dist/contracts/stack-grants.contract.js.map +1 -0
- package/dist/contracts/system.contract.d.ts +188 -69
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +12 -42
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/contracts/workspace.contract.d.ts +0 -55
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js +0 -19
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/events/agent-events.d.ts +421 -8
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-transcript.d.ts +111 -2
- package/dist/events/agent-transcript.d.ts.map +1 -1
- package/dist/events/agent-words.d.ts.map +1 -1
- package/dist/events/agent-words.js +2 -1
- package/dist/events/agent-words.js.map +1 -1
- package/dist/events/child-news.d.ts +32 -0
- package/dist/events/child-news.d.ts.map +1 -0
- package/dist/events/child-news.js +171 -0
- package/dist/events/child-news.js.map +1 -0
- package/dist/events/prompt-origins.d.ts +42 -0
- package/dist/events/prompt-origins.d.ts.map +1 -1
- package/dist/events/prompt-origins.js +28 -0
- package/dist/events/prompt-origins.js.map +1 -1
- package/dist/events/requests.d.ts +14 -0
- package/dist/events/requests.d.ts.map +1 -1
- package/dist/events/requests.js +12 -0
- package/dist/events/requests.js.map +1 -1
- package/dist/events/system-events.d.ts +12 -0
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/transcript.d.ts +559 -10
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/events/transcript.js +2 -1
- package/dist/events/transcript.js.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/models/model-roles.d.ts +91 -37
- package/dist/models/model-roles.d.ts.map +1 -1
- package/dist/models/model-roles.js +106 -35
- package/dist/models/model-roles.js.map +1 -1
- package/dist/models/model-setups.d.ts +10 -8
- package/dist/models/model-setups.d.ts.map +1 -1
- package/dist/models/model-setups.js +15 -15
- package/dist/models/model-setups.js.map +1 -1
- package/dist/policy/approvals-execution.d.ts +5 -2
- package/dist/policy/approvals-execution.d.ts.map +1 -1
- package/dist/policy/approvals-execution.js +3 -4
- package/dist/policy/approvals-execution.js.map +1 -1
- package/dist/policy/batch-runs.d.ts +1 -1
- package/dist/policy/batch-runs.d.ts.map +1 -1
- package/dist/policy/batch-runs.js +2 -1
- package/dist/policy/batch-runs.js.map +1 -1
- package/dist/policy/message-limits.d.ts.map +1 -1
- package/dist/policy/message-limits.js.map +1 -1
- package/dist/policy/org-locks.d.ts +1 -1
- package/dist/policy/org-locks.d.ts.map +1 -1
- package/dist/policy/org-locks.js +1 -0
- package/dist/policy/org-locks.js.map +1 -1
- package/dist/policy/shell/workspace-root-exclude.d.ts +4 -0
- package/dist/policy/shell/workspace-root-exclude.d.ts.map +1 -0
- package/dist/policy/shell/workspace-root-exclude.js +4 -0
- package/dist/policy/shell/workspace-root-exclude.js.map +1 -0
- package/dist/protocol/doors/listener-protocol.d.ts +7 -0
- package/dist/protocol/doors/listener-protocol.d.ts.map +1 -1
- package/dist/protocol/doors/listener-protocol.js +1 -0
- package/dist/protocol/doors/listener-protocol.js.map +1 -1
- package/dist/protocol/doors/webext-links.d.ts.map +1 -1
- package/dist/protocol/doors/webext-links.js.map +1 -1
- package/dist/protocol/raw/extension-protocol.d.ts +518 -0
- package/dist/protocol/raw/extension-protocol.d.ts.map +1 -1
- package/dist/protocol/raw/extension-protocol.js +276 -0
- package/dist/protocol/raw/extension-protocol.js.map +1 -1
- package/dist/protocol/raw/raw-json-routes.d.ts +60 -0
- package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.d.ts +81 -1
- package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.js +16 -1
- package/dist/protocol/raw/raw-routes.js.map +1 -1
- package/dist/schemas/activity.d.ts.map +1 -1
- package/dist/schemas/activity.js.map +1 -1
- package/dist/schemas/agent.d.ts +4 -0
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +4 -2
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents-list.d.ts +6 -0
- package/dist/schemas/agents-list.d.ts.map +1 -1
- package/dist/schemas/agents.d.ts +12 -0
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/automations.d.ts +87 -27
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js +15 -33
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/ci-deployments.d.ts +30 -0
- package/dist/schemas/ci-deployments.d.ts.map +1 -0
- package/dist/schemas/ci-deployments.js +18 -0
- package/dist/schemas/ci-deployments.js.map +1 -0
- package/dist/schemas/ci.d.ts +348 -21
- package/dist/schemas/ci.d.ts.map +1 -1
- package/dist/schemas/ci.js +110 -19
- package/dist/schemas/ci.js.map +1 -1
- package/dist/schemas/command-run.d.ts +29 -0
- package/dist/schemas/command-run.d.ts.map +1 -0
- package/dist/schemas/command-run.js +20 -0
- package/dist/schemas/command-run.js.map +1 -0
- package/dist/schemas/data-protection.d.ts +15 -2
- package/dist/schemas/data-protection.d.ts.map +1 -1
- package/dist/schemas/data-protection.js +15 -23
- package/dist/schemas/data-protection.js.map +1 -1
- package/dist/schemas/device-stacks.d.ts +131 -0
- package/dist/schemas/device-stacks.d.ts.map +1 -1
- package/dist/schemas/device-stacks.js +81 -0
- package/dist/schemas/device-stacks.js.map +1 -1
- package/dist/schemas/devices.d.ts +73 -0
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +6 -2
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/extension-updates.d.ts +1184 -0
- package/dist/schemas/extension-updates.d.ts.map +1 -1
- package/dist/schemas/extension-updates.js +18 -4
- package/dist/schemas/extension-updates.js.map +1 -1
- package/dist/schemas/host-power.d.ts +22 -0
- package/dist/schemas/host-power.d.ts.map +1 -1
- package/dist/schemas/host-power.js +55 -0
- package/dist/schemas/host-power.js.map +1 -1
- package/dist/schemas/hosts.d.ts +226 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +24 -0
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/issues.d.ts +35 -249
- package/dist/schemas/issues.d.ts.map +1 -1
- package/dist/schemas/issues.js +9 -43
- package/dist/schemas/issues.js.map +1 -1
- package/dist/schemas/maintenance.d.ts.map +1 -1
- package/dist/schemas/maintenance.js.map +1 -1
- package/dist/schemas/metrics.d.ts +25 -0
- package/dist/schemas/metrics.d.ts.map +1 -1
- package/dist/schemas/metrics.js +18 -0
- package/dist/schemas/metrics.js.map +1 -1
- package/dist/schemas/need-kinds.d.ts +19 -0
- package/dist/schemas/need-kinds.d.ts.map +1 -0
- package/dist/schemas/need-kinds.js +7 -0
- package/dist/schemas/need-kinds.js.map +1 -0
- package/dist/schemas/needs.d.ts +523 -30
- package/dist/schemas/needs.d.ts.map +1 -1
- package/dist/schemas/needs.js +36 -6
- package/dist/schemas/needs.js.map +1 -1
- package/dist/schemas/offload.d.ts +52 -0
- package/dist/schemas/offload.d.ts.map +1 -1
- package/dist/schemas/offload.js +12 -0
- package/dist/schemas/offload.js.map +1 -1
- package/dist/schemas/outward-action.d.ts +39 -0
- package/dist/schemas/outward-action.d.ts.map +1 -0
- package/dist/schemas/outward-action.js +40 -0
- package/dist/schemas/outward-action.js.map +1 -0
- package/dist/schemas/providers/plan-limits.d.ts +1 -0
- package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
- package/dist/schemas/providers/plan-limits.js +1 -0
- package/dist/schemas/providers/plan-limits.js.map +1 -1
- package/dist/schemas/secrets.d.ts +17 -0
- package/dist/schemas/secrets.d.ts.map +1 -1
- package/dist/schemas/secrets.js +12 -5
- 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 +5 -4
- package/dist/schemas/settings-history.js.map +1 -1
- package/dist/schemas/settings-savings.d.ts +58 -0
- package/dist/schemas/settings-savings.d.ts.map +1 -1
- package/dist/schemas/settings-savings.js +22 -0
- package/dist/schemas/settings-savings.js.map +1 -1
- package/dist/schemas/settings.d.ts +2 -42
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +5 -6
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/stack-grants.d.ts +60 -0
- package/dist/schemas/stack-grants.d.ts.map +1 -0
- package/dist/schemas/stack-grants.js +33 -0
- package/dist/schemas/stack-grants.js.map +1 -0
- package/dist/schemas/watch-sources.d.ts +72 -0
- package/dist/schemas/watch-sources.d.ts.map +1 -0
- package/dist/schemas/watch-sources.js +88 -0
- package/dist/schemas/watch-sources.js.map +1 -0
- package/dist/schemas/workspace/workspace-search.d.ts.map +1 -1
- package/dist/schemas/workspace/workspace-search.js +1 -1
- package/dist/schemas/workspace/workspace-search.js.map +1 -1
- package/dist/schemas/wsl-memory.d.ts +76 -0
- package/dist/schemas/wsl-memory.d.ts.map +1 -0
- package/dist/schemas/wsl-memory.js +36 -0
- package/dist/schemas/wsl-memory.js.map +1 -0
- package/dist/state/auth-state.d.ts.map +1 -1
- package/dist/state/auth-state.js +2 -0
- package/dist/state/auth-state.js.map +1 -1
- package/dist/state/definition.d.ts +4 -8
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/workspace-state.d.ts +8 -3
- package/dist/state/workspace-state.d.ts.map +1 -1
- package/dist/state/workspace-state.js +8 -3
- package/dist/state/workspace-state.js.map +1 -1
- package/package.json +5 -5
- package/src/briefs/agent-ask.ts +23 -0
- package/src/{chores/extension-update.ts → briefs/extension-update-brief.ts} +3 -2
- package/src/chores/digest.ts +1 -0
- package/src/chores/index.ts +13 -2
- package/src/chores/prompt.ts +3 -18
- package/src/chores/stack.ts +1 -0
- package/src/chores/verdict.ts +1 -0
- package/src/chores/workspace-scope.ts +3 -8
- package/src/contracts/capabilities.contract.ts +24 -0
- package/src/contracts/ci.contract.ts +119 -37
- package/src/contracts/device-stacks.contract.ts +97 -0
- package/src/contracts/extensions.contract.ts +11 -0
- package/src/contracts/secrets.contract.ts +27 -0
- package/src/contracts/settings.contract.ts +24 -0
- package/src/contracts/stack-grants.contract.ts +51 -0
- package/src/contracts/system.contract.ts +16 -59
- package/src/contracts/workspace.contract.ts +0 -22
- package/src/events/agent-words.ts +3 -1
- package/src/events/child-news.test.ts +91 -0
- package/src/events/child-news.ts +269 -0
- package/src/events/prompt-origins.ts +35 -0
- package/src/events/requests.ts +18 -0
- package/src/events/transcript.ts +10 -1
- package/src/index.ts +3 -6
- package/src/models/model-roles.test.ts +61 -4
- package/src/models/model-roles.ts +153 -49
- package/src/models/model-setups.ts +49 -26
- package/src/policy/approvals-execution.ts +11 -6
- package/src/policy/batch-runs.ts +2 -2
- package/src/policy/message-limits.ts +8 -4
- package/src/policy/org-locks.ts +1 -0
- package/src/policy/shell/workspace-root-exclude.ts +11 -0
- package/src/protocol/doors/listener-protocol.ts +14 -0
- package/src/protocol/doors/webext-links.ts +3 -1
- package/src/protocol/raw/extension-protocol.ts +469 -2
- package/src/protocol/raw/raw-routes.ts +45 -4
- package/src/schemas/activity.ts +2 -1
- package/src/schemas/agent.test.ts +3 -0
- package/src/schemas/agent.ts +10 -4
- package/src/schemas/automations.ts +25 -41
- package/src/schemas/ci-deployments.ts +26 -0
- package/src/schemas/ci.ts +185 -45
- package/src/schemas/command-run.ts +44 -0
- package/src/schemas/data-protection.ts +28 -34
- package/src/schemas/device-stacks.ts +162 -3
- package/src/schemas/devices.ts +13 -2
- package/src/schemas/extension-updates.ts +27 -7
- package/src/schemas/host-power.test.ts +53 -0
- package/src/schemas/host-power.ts +96 -2
- package/src/schemas/hosts.test.ts +32 -0
- package/src/schemas/hosts.ts +62 -0
- package/src/schemas/issues.ts +29 -86
- package/src/schemas/maintenance.ts +4 -3
- package/src/schemas/metrics.ts +35 -0
- package/src/schemas/need-kinds.ts +13 -0
- package/src/schemas/needs.ts +57 -16
- package/src/schemas/offload.ts +31 -0
- package/src/schemas/outward-action.ts +47 -0
- package/src/schemas/providers/plan-limits.ts +1 -0
- package/src/schemas/secrets.ts +23 -5
- package/src/schemas/settings-history.ts +10 -5
- package/src/schemas/settings-savings.ts +29 -0
- package/src/schemas/settings.test.ts +23 -23
- package/src/schemas/settings.ts +10 -12
- package/src/schemas/stack-grants.ts +59 -0
- package/src/schemas/version-seam.test.ts +4 -1
- package/src/schemas/watch-sources.ts +127 -0
- package/src/schemas/workspace/workspace-search.ts +5 -2
- package/src/schemas/wsl-memory.ts +59 -0
- package/src/state/auth-state.ts +7 -0
- package/src/state/workspace-state.ts +18 -18
- package/src/text/embed.ts +2 -2
- package/dist/chores/extension-update.d.ts.map +0 -1
- package/dist/chores/extension-update.js.map +0 -1
- package/dist/contracts/chores.contract.d.ts +0 -213
- package/dist/contracts/chores.contract.d.ts.map +0 -1
- package/dist/contracts/chores.contract.js +0 -32
- package/dist/contracts/chores.contract.js.map +0 -1
- package/dist/contracts/issues.contract.d.ts +0 -106
- package/dist/contracts/issues.contract.d.ts.map +0 -1
- package/dist/contracts/issues.contract.js +0 -50
- package/dist/contracts/issues.contract.js.map +0 -1
- package/src/chores/chores.test.ts +0 -24
- package/src/chores/digest.test.ts +0 -27
- package/src/chores/probes.integration.test.ts +0 -494
- package/src/chores/stack.test.ts +0 -140
- package/src/chores/verdict.test.ts +0 -761
- package/src/contracts/chores.contract.ts +0 -39
- package/src/contracts/issues.contract.ts +0 -53
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { MODEL_ROLE_ID, MODEL_ROLE_ID_MAX, type ModelRoleContribution } from "@intentic/extension-manifest";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
|
|
3
4
|
// Every job that picks a model, one row per job; the unit is the role, not a difficulty tier. A job runs on the setup it
|
|
4
5
|
// was put on (model-setups.ts), an ordered fallback ladder it shares with every other job put there; a job on none, or
|
|
5
|
-
// on an empty one, is off (helper) or falls back to the caller's own chat model (run).
|
|
6
|
-
//
|
|
6
|
+
// on an empty one, is off (helper) or falls back to the caller's own chat model (run). This table holds the sandbox's
|
|
7
|
+
// own jobs; an extension declares the jobs it starts runs for (`contributes.modelRoles`), and the daemon serves both
|
|
8
|
+
// (`GET /settings/model-roles`), which the settings page and every reader that resolves a job by id read.
|
|
9
|
+
// (2026-11-26) Until then this table also listed six extensions' jobs, so a job could not come and go with its extension.
|
|
7
10
|
|
|
8
11
|
export const ModelRoleKindSchema = z.enum(["helper", "run"]);
|
|
9
12
|
export type ModelRoleKind = z.infer<typeof ModelRoleKindSchema>;
|
|
@@ -13,9 +16,8 @@ export type ModelRoleKind = z.infer<typeof ModelRoleKindSchema>;
|
|
|
13
16
|
export const PRESET_SETUPS = ["low", "medium", "high"] as const;
|
|
14
17
|
export type PresetSetup = (typeof PRESET_SETUPS)[number];
|
|
15
18
|
|
|
16
|
-
// `id` is a bare string
|
|
17
|
-
|
|
18
|
-
interface ModelRoleRow {
|
|
19
|
+
// One job, the sandbox's own or an extension's. `id` is a bare string: an extension's job is named by its declaration.
|
|
20
|
+
export interface ModelRoleSpec {
|
|
19
21
|
readonly id: string;
|
|
20
22
|
// The owner's own words for the job; never a difficulty tier.
|
|
21
23
|
readonly label: string;
|
|
@@ -29,8 +31,9 @@ interface ModelRoleRow {
|
|
|
29
31
|
readonly setup: PresetSetup;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
// Ids are wire-stable (`AgentTurn.runRole`); order is the settings page's: one-shot helpers first, then whole sessions
|
|
33
|
-
|
|
34
|
+
// Ids are wire-stable (`AgentTurn.job`, `runRole`); order is the settings page's: one-shot helpers first, then whole sessions,
|
|
35
|
+
// then the enabled extensions' jobs.
|
|
36
|
+
export const CORE_MODEL_ROLES = [
|
|
34
37
|
{
|
|
35
38
|
id: "commit-message",
|
|
36
39
|
label: "Commit messages",
|
|
@@ -105,6 +108,102 @@ export const MODEL_ROLES = [
|
|
|
105
108
|
icon: "server",
|
|
106
109
|
setup: "low",
|
|
107
110
|
},
|
|
111
|
+
{
|
|
112
|
+
// Started by a person's press on a failure the app cannot settle by itself (agentFix.ts in the editor): a sync that
|
|
113
|
+
// conflicts, a push the remote refuses, a commit a hook refuses, a dev server that crashed, a build that failed.
|
|
114
|
+
id: "workflow-fix",
|
|
115
|
+
label: "Workflow fixes",
|
|
116
|
+
blurb: "The agent started by Fix with agent on a failed sync, push, commit, run or build.",
|
|
117
|
+
kind: "run",
|
|
118
|
+
icon: "wrench",
|
|
119
|
+
setup: "high",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: "approval-queue",
|
|
123
|
+
label: "Approvals queue",
|
|
124
|
+
blurb: "The turn that publishes or acts on what you approved.",
|
|
125
|
+
kind: "run",
|
|
126
|
+
icon: "check-circle",
|
|
127
|
+
setup: "medium",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "extension-review",
|
|
131
|
+
label: "Extension update reviews",
|
|
132
|
+
blurb: "The agent that reads an extension update before it is applied.",
|
|
133
|
+
kind: "run",
|
|
134
|
+
icon: "box",
|
|
135
|
+
setup: "medium",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: "loop-iteration",
|
|
139
|
+
label: "Loop iterations",
|
|
140
|
+
blurb: "Each round of a loop working towards its goal.",
|
|
141
|
+
kind: "run",
|
|
142
|
+
icon: "repeat",
|
|
143
|
+
setup: "high",
|
|
144
|
+
},
|
|
145
|
+
] as const satisfies readonly ModelRoleSpec[];
|
|
146
|
+
|
|
147
|
+
// One of the sandbox's own jobs.
|
|
148
|
+
export type CoreModelRole = (typeof CORE_MODEL_ROLES)[number]["id"];
|
|
149
|
+
// Any job's id, the sandbox's own or one an extension declares: what `AgentTurn.job` and the keys of `roleSetups` hold.
|
|
150
|
+
export type ModelRole = string;
|
|
151
|
+
|
|
152
|
+
const CORE_IDS = new Set<string>(CORE_MODEL_ROLES.map((role) => role.id));
|
|
153
|
+
export const isCoreModelRole = (id: string): id is CoreModelRole => CORE_IDS.has(id);
|
|
154
|
+
|
|
155
|
+
/** One of the sandbox's own jobs by id, or undefined for an extension's (or nobody's). */
|
|
156
|
+
export const coreModelRole = (id: string): ModelRoleSpec | undefined => CORE_MODEL_ROLES.find((role) => role.id === id);
|
|
157
|
+
|
|
158
|
+
// A string, not the table's enum (2026-11-26): an extension's job is named by its declaration, which the contract cannot
|
|
159
|
+
// list. A run naming a job nobody declares opens on the caller's own model, as a run naming none does.
|
|
160
|
+
export const ModelRoleSchema = z
|
|
161
|
+
.string()
|
|
162
|
+
.max(MODEL_ROLE_ID_MAX)
|
|
163
|
+
.regex(MODEL_ROLE_ID, "a job's id is lowercase words joined by dashes")
|
|
164
|
+
.describe("A job's id: one of the sandbox's own (`commit-message`, `loop-iteration`) or one an enabled extension declares (`pipeline-fix`).");
|
|
165
|
+
|
|
166
|
+
// One job as the daemon serves it to the settings page (`GET /settings/model-roles`): the sandbox's own and every
|
|
167
|
+
// installed extension's, an extension's switched off kept in the list so a page placing jobs keeps its stored choice.
|
|
168
|
+
export const ModelRoleEntrySchema = z.object({
|
|
169
|
+
id: ModelRoleSchema,
|
|
170
|
+
label: z.string().min(1).describe("What the settings page calls the job."),
|
|
171
|
+
blurb: z.string().min(1).describe("One sentence on what starts it, beyond the label."),
|
|
172
|
+
kind: ModelRoleKindSchema.describe("`helper`: a one-shot call the sandbox makes. `run`: a whole session."),
|
|
173
|
+
icon: z.string().min(1).describe("A name from the host's icon set."),
|
|
174
|
+
setup: z.enum(PRESET_SETUPS).describe("The preset it runs on until it is placed, and where it goes when placed again."),
|
|
175
|
+
extension: z.string().min(1).optional().describe("The extension that declares it (`publisher.name`); absent on the sandbox's own jobs."),
|
|
176
|
+
enabled: z.boolean().describe("False while the extension that declares it is switched off: its job is not shown, and the owner's choice for it is kept."),
|
|
177
|
+
});
|
|
178
|
+
export type ModelRoleEntry = z.infer<typeof ModelRoleEntrySchema>;
|
|
179
|
+
|
|
180
|
+
export const ModelRolesSchema = z.object({
|
|
181
|
+
roles: z.array(ModelRoleEntrySchema).describe("The sandbox's own jobs, then each installed extension's, in the settings page's order."),
|
|
182
|
+
});
|
|
183
|
+
export type ModelRoles = z.infer<typeof ModelRolesSchema>;
|
|
184
|
+
|
|
185
|
+
/** A job an extension declares, as it is served: always a whole session, suggested `medium` unless it says otherwise. */
|
|
186
|
+
export const contributedModelRole = (declared: ModelRoleContribution, extension: string, enabled: boolean): ModelRoleEntry => ({
|
|
187
|
+
id: declared.id,
|
|
188
|
+
label: declared.label,
|
|
189
|
+
blurb: declared.explanation,
|
|
190
|
+
kind: "run",
|
|
191
|
+
icon: declared.icon ?? "wrench",
|
|
192
|
+
setup: declared.setup ?? "medium",
|
|
193
|
+
extension,
|
|
194
|
+
enabled,
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
/** The sandbox's own jobs as served. */
|
|
198
|
+
export const coreModelRoleEntries = (): ModelRoleEntry[] => CORE_MODEL_ROLES.map((role) => ({ ...role, enabled: true }));
|
|
199
|
+
|
|
200
|
+
// (2026-11-26) The six jobs this table held for extensions until they declared them in their manifests
|
|
201
|
+
// (`contributes.modelRoles`), as the table had them, by the extension that now declares each. Frozen, and read only where
|
|
202
|
+
// the past is: a daemon older than extension API 2.52.0 serves no job list and knows these as its own, so the settings
|
|
203
|
+
// page shows them from here (docs/architecture/app-plane.md, older daemons); and the 2026-10-12 settings conversion
|
|
204
|
+
// placed jobs in the table's order of that day (settings-history.ts). `refactor-run` belongs to nobody: nothing has
|
|
205
|
+
// started it since the Health tab went (2026-11-18), and it stays only so a stored choice naming it still reads.
|
|
206
|
+
export const EXTENSION_ROLES_BEFORE_CONTRIBUTIONS = [
|
|
108
207
|
{
|
|
109
208
|
id: "pipeline-fix",
|
|
110
209
|
label: "Pipeline fixes",
|
|
@@ -112,6 +211,7 @@ export const MODEL_ROLES = [
|
|
|
112
211
|
kind: "run",
|
|
113
212
|
icon: "wave-pulse",
|
|
114
213
|
setup: "high",
|
|
214
|
+
extension: "intentic.pipelines",
|
|
115
215
|
},
|
|
116
216
|
{
|
|
117
217
|
id: "deployment-fix",
|
|
@@ -120,16 +220,7 @@ export const MODEL_ROLES = [
|
|
|
120
220
|
kind: "run",
|
|
121
221
|
icon: "server",
|
|
122
222
|
setup: "high",
|
|
123
|
-
|
|
124
|
-
{
|
|
125
|
-
// Started by a person's press on a failure the app cannot settle by itself (agentFix.ts in the editor): a sync that
|
|
126
|
-
// conflicts, a push the remote refuses, a commit a hook refuses, a dev server that crashed, a build that failed.
|
|
127
|
-
id: "workflow-fix",
|
|
128
|
-
label: "Workflow fixes",
|
|
129
|
-
blurb: "The agent started by Fix with agent on a failed sync, push, commit, run or build.",
|
|
130
|
-
kind: "run",
|
|
131
|
-
icon: "wrench",
|
|
132
|
-
setup: "high",
|
|
223
|
+
extension: "intentic.deployments",
|
|
133
224
|
},
|
|
134
225
|
{
|
|
135
226
|
id: "maintenance-chore",
|
|
@@ -138,16 +229,16 @@ export const MODEL_ROLES = [
|
|
|
138
229
|
kind: "run",
|
|
139
230
|
icon: "wrench",
|
|
140
231
|
setup: "medium",
|
|
232
|
+
extension: "intentic.maintenance",
|
|
141
233
|
},
|
|
142
234
|
{
|
|
143
235
|
id: "refactor-run",
|
|
144
236
|
label: "Refactors",
|
|
145
|
-
// Started from the Health tab, removed with iq (2026-11-18). The id stays: every saved roleSetups names it, and a
|
|
146
|
-
// newer editor reads an older daemon's settings with this enum.
|
|
147
237
|
blurb: "Kept so settings saved before the Health tab was removed still read; nothing starts a refactor run now.",
|
|
148
238
|
kind: "run",
|
|
149
239
|
icon: "hammer",
|
|
150
240
|
setup: "high",
|
|
241
|
+
extension: undefined,
|
|
151
242
|
},
|
|
152
243
|
{
|
|
153
244
|
id: "documentation-run",
|
|
@@ -156,6 +247,7 @@ export const MODEL_ROLES = [
|
|
|
156
247
|
kind: "run",
|
|
157
248
|
icon: "book",
|
|
158
249
|
setup: "medium",
|
|
250
|
+
extension: "intentic.documentation",
|
|
159
251
|
},
|
|
160
252
|
{
|
|
161
253
|
id: "acceptance-run",
|
|
@@ -164,37 +256,49 @@ export const MODEL_ROLES = [
|
|
|
164
256
|
kind: "run",
|
|
165
257
|
icon: "list-check",
|
|
166
258
|
setup: "high",
|
|
259
|
+
extension: "intentic.acceptance",
|
|
167
260
|
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
] as const satisfies readonly ModelRoleRow[];
|
|
261
|
+
] as const satisfies readonly (ModelRoleSpec & { readonly extension: string | undefined })[];
|
|
262
|
+
|
|
263
|
+
// The order the table held every job in until 2026-11-26, the six above among the sandbox's own.
|
|
264
|
+
const ORDER_BEFORE_CONTRIBUTIONS = [
|
|
265
|
+
"commit-message",
|
|
266
|
+
"session-title",
|
|
267
|
+
"safety-judge",
|
|
268
|
+
"loop-verdict",
|
|
269
|
+
"handoff-summary",
|
|
270
|
+
"spoken-reply",
|
|
271
|
+
"model-router",
|
|
272
|
+
"subagent-sizing",
|
|
273
|
+
"pipeline-fix",
|
|
274
|
+
"deployment-fix",
|
|
275
|
+
"workflow-fix",
|
|
276
|
+
"maintenance-chore",
|
|
277
|
+
"refactor-run",
|
|
278
|
+
"documentation-run",
|
|
279
|
+
"acceptance-run",
|
|
280
|
+
"approval-queue",
|
|
281
|
+
"extension-review",
|
|
282
|
+
"loop-iteration",
|
|
283
|
+
] as const;
|
|
193
284
|
|
|
194
|
-
|
|
195
|
-
|
|
285
|
+
// The ids `AgentTurn.runRole` takes: every job the table held until 2026-11-26, frozen. A schema a door's far end reads in
|
|
286
|
+
// the field may only grow (_tools/checks/lib/release-doors.mjs), so this enum stays as it was beside the open `job` that
|
|
287
|
+
// names an extension's job; every daemon reads `runRole`, and one from before ignores `job`.
|
|
288
|
+
export const RunRoleSchema = z.enum(ORDER_BEFORE_CONTRIBUTIONS);
|
|
289
|
+
export type RunRole = z.infer<typeof RunRoleSchema>;
|
|
196
290
|
|
|
197
|
-
|
|
291
|
+
/** How a turn names its job: `runRole` for one every daemon knows, `job` for one only a newer daemon does. */
|
|
292
|
+
export const jobFields = (role: ModelRole): { readonly runRole: RunRole } | { readonly job: ModelRole } => {
|
|
293
|
+
const known = RunRoleSchema.safeParse(role);
|
|
294
|
+
return known.success ? { runRole: known.data } : { job: role };
|
|
295
|
+
};
|
|
198
296
|
|
|
199
|
-
|
|
200
|
-
export const
|
|
297
|
+
/** Every job the table held until 2026-11-26, in its order then: what a daemon from before served, and what the 2026-10-12 conversion placed. */
|
|
298
|
+
export const ROLES_BEFORE_CONTRIBUTIONS: readonly ModelRoleSpec[] = ORDER_BEFORE_CONTRIBUTIONS.map((id) => {
|
|
299
|
+
const spec = coreModelRole(id) ?? EXTENSION_ROLES_BEFORE_CONTRIBUTIONS.find((role) => role.id === id);
|
|
300
|
+
if (spec === undefined) {
|
|
301
|
+
throw new Error(`model-roles: "${id}" is in neither table`);
|
|
302
|
+
}
|
|
303
|
+
return spec;
|
|
304
|
+
});
|
|
@@ -3,13 +3,13 @@ import { type ModelPin, ModelPinSchema } from "../schemas/agent.js";
|
|
|
3
3
|
import { isEndpointProvider } from "./agent-catalog.js";
|
|
4
4
|
import { compareModelIds, modelRungOf } from "./model-order.js";
|
|
5
5
|
import type { ModelSource } from "./model-pins.js";
|
|
6
|
-
import {
|
|
6
|
+
import { coreModelRole, type ModelRole, type ModelRoleSpec, PRESET_SETUPS, type PresetSetup, ROLES_BEFORE_CONTRIBUTIONS } from "./model-roles.js";
|
|
7
7
|
|
|
8
8
|
// A setup is a named, ordered list of models that any number of jobs run on: edited once, used by every job put there.
|
|
9
9
|
// Every sandbox has three, Low, Medium and High, worked out from the accounts it has connected until the owner edits
|
|
10
|
-
// one; the owner adds any others.
|
|
11
|
-
// Saved assignments stay as written: a job left out runs on nothing. Every reader
|
|
12
|
-
// daemon and browser alike, so the settings page shows what will run.
|
|
10
|
+
// one; the owner adds any others. Until a job is placed, every job runs on its suggested preset (model-roles.ts `setup`,
|
|
11
|
+
// or its extension's declaration). Saved assignments stay as written: a job left out runs on nothing. Every reader
|
|
12
|
+
// resolves a job through here, daemon and browser alike, so the settings page shows what will run.
|
|
13
13
|
|
|
14
14
|
export const MODEL_SETUP_ID = /^[a-z0-9][a-z0-9-]{0,39}$/;
|
|
15
15
|
|
|
@@ -28,24 +28,32 @@ export type ModelSetup = z.infer<typeof ModelSetupSchema>;
|
|
|
28
28
|
|
|
29
29
|
export const isPresetSetup = (id: string): id is PresetSetup => PRESET_SETUPS.some((preset) => preset === id);
|
|
30
30
|
|
|
31
|
-
// The settings a job's models are read from; a slice, so a caller holding only these two can resolve.
|
|
31
|
+
// The settings a job's models are read from; a slice, so a caller holding only these two can resolve. `roleSetups` absent
|
|
32
|
+
// is a sandbox that never placed its jobs: each runs on its suggested preset. (2026-11-26) Until then the schema wrote
|
|
33
|
+
// the suggestions down at the first save of any setting, so an extension installed later found its jobs on none.
|
|
32
34
|
export interface SetupSettings {
|
|
33
35
|
readonly modelSetups: readonly ModelSetup[];
|
|
34
|
-
readonly roleSetups
|
|
36
|
+
readonly roleSetups?: Readonly<Partial<Record<ModelRole, string>>> | undefined;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
// What a job is suggested, which resolution reads when the sandbox never placed its jobs: the sandbox's own job's from its
|
|
40
|
+
// table by id; an extension's from its declaration, which a caller holding the job list passes (`suggested`). An id
|
|
41
|
+
// nobody declares is suggested nothing, so such a sandbox runs it on none.
|
|
42
|
+
const coreSuggestion = (role: ModelRole): PresetSetup | undefined => coreModelRole(role)?.setup;
|
|
38
43
|
|
|
39
|
-
/** The preset suggested for
|
|
40
|
-
export const suggestedSetup = (role: ModelRole): PresetSetup =>
|
|
44
|
+
/** The preset suggested for one of the sandbox's own jobs when it is placed; an extension's says its own (`setup`). */
|
|
45
|
+
export const suggestedSetup = (role: ModelRole): PresetSetup => coreSuggestion(role) ?? `medium`;
|
|
41
46
|
|
|
42
47
|
// First entry wins: a hand-edited file holding one id twice means the earlier, as everywhere else a list is read.
|
|
43
48
|
export const storedSetup = (settings: Pick<SetupSettings, "modelSetups">, id: string): ModelSetup | undefined =>
|
|
44
49
|
settings.modelSetups.find((setup) => setup.id === id);
|
|
45
50
|
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The setup a job runs on, or undefined while it is on none (left out of a saved map, placed on a setup that is gone, or
|
|
53
|
+
* never placed and suggested nothing).
|
|
54
|
+
*/
|
|
55
|
+
export const roleSetupId = (settings: SetupSettings, role: ModelRole, suggested: PresetSetup | undefined = coreSuggestion(role)): string | undefined => {
|
|
56
|
+
const assigned = settings.roleSetups === undefined ? suggested : settings.roleSetups[role];
|
|
49
57
|
return assigned !== undefined && (isPresetSetup(assigned) || storedSetup(settings, assigned) !== undefined) ? assigned : undefined;
|
|
50
58
|
};
|
|
51
59
|
|
|
@@ -66,7 +74,8 @@ export const setupLadder = (settings: Pick<SetupSettings, "modelSetups">, id: st
|
|
|
66
74
|
return isPresetSetup(id) ? { kind: `preset`, preset: id } : NO_MODELS;
|
|
67
75
|
};
|
|
68
76
|
|
|
69
|
-
export const roleLadder = (settings: SetupSettings, role: ModelRole
|
|
77
|
+
export const roleLadder = (settings: SetupSettings, role: ModelRole, suggested: PresetSetup | undefined = coreSuggestion(role)): SetupLadder =>
|
|
78
|
+
setupLadder(settings, roleSetupId(settings, role, suggested));
|
|
70
79
|
|
|
71
80
|
/** True only for a ladder that can never name a model, whatever is connected: a written list left empty. */
|
|
72
81
|
export const ladderIsEmpty = (ladder: SetupLadder): boolean => ladder.kind === `pins` && ladder.pins.length === 0;
|
|
@@ -116,37 +125,51 @@ export const ladderPins = (ladder: SetupLadder, sources: readonly ModelSource[])
|
|
|
116
125
|
ladder.kind === `pins` ? ladder.pins : presetPins(ladder.preset, sources);
|
|
117
126
|
|
|
118
127
|
/** The models a job runs on, in try order, before readiness filters them (model-pins.ts `readyChain`). */
|
|
119
|
-
export const rolePins = (
|
|
120
|
-
|
|
128
|
+
export const rolePins = (
|
|
129
|
+
settings: SetupSettings,
|
|
130
|
+
role: ModelRole,
|
|
131
|
+
sources: readonly ModelSource[],
|
|
132
|
+
suggested: PresetSetup | undefined = coreSuggestion(role),
|
|
133
|
+
): readonly ModelPin[] => ladderPins(roleLadder(settings, role, suggested), sources);
|
|
134
|
+
|
|
135
|
+
// Setups made from per-job lists: every job that held a list is placed, so the map holds a setup for each it names.
|
|
136
|
+
export interface RoleListSetups {
|
|
137
|
+
readonly modelSetups: ModelSetup[];
|
|
138
|
+
readonly roleSetups: Record<ModelRole, string>;
|
|
139
|
+
}
|
|
121
140
|
|
|
122
141
|
/**
|
|
123
142
|
* Setups for a set of per-job lists, the shape settings had before setups (2026-10-12): jobs holding the same list share
|
|
124
143
|
* one setup, a list most of whose jobs are suggested one preset becomes that preset while it is free, and the rest are
|
|
125
144
|
* new setups. A job with no list, or an empty one, ran on nothing and is left on none. Exported for the settings
|
|
126
|
-
* history and for tests that want a job on exact models.
|
|
145
|
+
* history and for tests that want a job on exact models. `roles` is the jobs it reads, in order: by default every job the
|
|
146
|
+
* table held until 2026-11-26, the conversion's own.
|
|
127
147
|
*/
|
|
128
|
-
export const setupsFromRoleLists = (
|
|
148
|
+
export const setupsFromRoleLists = (
|
|
149
|
+
lists: Partial<Record<ModelRole, readonly ModelPin[]>>,
|
|
150
|
+
roles: readonly Pick<ModelRoleSpec, "id" | "setup">[] = ROLES_BEFORE_CONTRIBUTIONS,
|
|
151
|
+
): RoleListSetups => {
|
|
129
152
|
const modelSetups: ModelSetup[] = [];
|
|
130
|
-
const roleSetups:
|
|
131
|
-
const groups = new Map<string,
|
|
132
|
-
for (const role of
|
|
133
|
-
const list = lists[role];
|
|
153
|
+
const roleSetups: Record<ModelRole, string> = {};
|
|
154
|
+
const groups = new Map<string, Pick<ModelRoleSpec, "id" | "setup">[]>();
|
|
155
|
+
for (const role of roles) {
|
|
156
|
+
const list = lists[role.id];
|
|
134
157
|
if (list !== undefined && list.length > 0) {
|
|
135
158
|
const key = JSON.stringify(list);
|
|
136
159
|
groups.set(key, [...(groups.get(key) ?? []), role]);
|
|
137
160
|
}
|
|
138
161
|
}
|
|
139
162
|
let made = 0;
|
|
140
|
-
for (const
|
|
141
|
-
const pins = lists[
|
|
163
|
+
for (const group of groups.values()) {
|
|
164
|
+
const pins = lists[group[0]!.id] ?? [];
|
|
142
165
|
// The preset most of these jobs are suggested; a tie goes to the first job's, the table's own order.
|
|
143
|
-
const votes =
|
|
166
|
+
const votes = group.map((role) => role.setup);
|
|
144
167
|
const preset = votes.toSorted((a, b) => votes.filter((vote) => vote === b).length - votes.filter((vote) => vote === a).length)[0]!;
|
|
145
168
|
const free = storedSetup({ modelSetups }, preset) === undefined;
|
|
146
169
|
const id = free ? preset : `setup-${++made}`;
|
|
147
170
|
modelSetups.push(free ? { id, pins: [...pins] } : { id, name: `Setup ${made}`, pins: [...pins] });
|
|
148
|
-
for (const role of
|
|
149
|
-
roleSetups[role] = id;
|
|
171
|
+
for (const role of group) {
|
|
172
|
+
roleSetups[role.id] = id;
|
|
150
173
|
}
|
|
151
174
|
}
|
|
152
175
|
return { modelSetups, roleSetups };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
// A held item is dated this far out (an ordinary scheduledAt), to catch a mis-click before it's public.
|
|
2
2
|
export const APPROVAL_HOLD_MS = 60_000;
|
|
3
3
|
|
|
4
|
-
// Platforms reachable by a stored API credential alone; the rest need a turn to drive the logged-in browser.
|
|
5
|
-
export const DIRECT_PUBLISH_PLATFORMS: ReadonlySet<string> = new Set(["discord"]);
|
|
6
|
-
|
|
7
4
|
// The workspace-relative directory both prompts below name, spelled once.
|
|
8
5
|
const APPROVALS_DIR = ".intentic/config/approvals";
|
|
9
6
|
|
|
@@ -16,9 +13,17 @@ const WRITE_BACK = [
|
|
|
16
13
|
`owner can act on, then move to the next one instead of retrying in a loop.`,
|
|
17
14
|
];
|
|
18
15
|
|
|
16
|
+
// What a platform's own extension says a publishing turn should know about posting there (a card's `channel.posting`,
|
|
17
|
+
// 2026-11-26): the Reddit rule that a comment's permalink nests the reply under that comment lived here until then.
|
|
18
|
+
export interface PostingNote {
|
|
19
|
+
// The platform as its card names it ("Reddit").
|
|
20
|
+
readonly platform: string;
|
|
21
|
+
readonly note: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
// Names the files directly rather than saying "go look": the daemon already decided what's due, and a re-deriving turn
|
|
20
25
|
// could disagree. Writes the outcome back into the same file, since that's where the queue reads it.
|
|
21
|
-
export const publishTurnPrompt = (posts: readonly { readonly id: string; readonly platform: string }[]): string =>
|
|
26
|
+
export const publishTurnPrompt = (posts: readonly { readonly id: string; readonly platform: string }[], notes: readonly PostingNote[] = []): string =>
|
|
22
27
|
[
|
|
23
28
|
`Publish these approved posts, which are due now. They live in ${APPROVALS_DIR}/, one JSON file each:`,
|
|
24
29
|
``,
|
|
@@ -29,10 +34,10 @@ export const publishTurnPrompt = (posts: readonly { readonly id: string; readonl
|
|
|
29
34
|
` ${WRITE_BACK[1]}`,
|
|
30
35
|
`2. Post exactly its "content": with its "title", "target" and "media", using that platform's skill.`,
|
|
31
36
|
` A "target" that is a URL means this post is a REPLY to whatever is at it: open that exact URL and`,
|
|
32
|
-
` reply where it lands
|
|
33
|
-
` nest under that comment rather than becoming a new top-level comment on the thread.`,
|
|
37
|
+
` reply where it lands, under the one comment it names if it names one.`,
|
|
34
38
|
`3. ${WRITE_BACK[2]} ${WRITE_BACK[3]}`,
|
|
35
39
|
` ${WRITE_BACK[4]}`,
|
|
40
|
+
...(notes.length === 0 ? [] : [``, `What each platform's own extension adds:`, ...notes.map(({ platform, note }) => `- ${platform}: ${note}`)]),
|
|
36
41
|
``,
|
|
37
42
|
`Never rewrite the content: the owner approved these exact words. Never touch a file not listed above.`,
|
|
38
43
|
].join(`\n`);
|
package/src/policy/batch-runs.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { STATE_DIR } from "@intentic/constants";
|
|
2
|
-
import type
|
|
2
|
+
import { jobFields, type ModelRole } from "../models/model-roles.js";
|
|
3
3
|
|
|
4
4
|
// One batch run engine for every surface that fans an isolated agent turn out over items and reads results off disk.
|
|
5
5
|
// Backed by files, not a pack's own store, with derived conversation ids that join the fleet via a GET /agents filter,
|
|
@@ -102,7 +102,7 @@ export const batchTurnBody = (params: {
|
|
|
102
102
|
conversationId: params.conversationId,
|
|
103
103
|
isolated: true,
|
|
104
104
|
unattended: true,
|
|
105
|
-
|
|
105
|
+
...jobFields(params.role),
|
|
106
106
|
...(params.pick === undefined ? {} : runPickFields(params.pick)),
|
|
107
107
|
...params.extra,
|
|
108
108
|
});
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
1
|
+
// FROZEN (2026-11-26, extension API 2.54.0): a platform's one-message limit is what the card naming it declares
|
|
2
|
+
// (`channel.messageLimit` in its extension's manifest), which the gateways, the approvals inbox and a publishing backend
|
|
3
|
+
// read. Nothing in the repository reads this table except the approvals inbox facing a daemon from before 2.54.0, whose
|
|
4
|
+
// cards declare none. It stays because the extension wire records this subpath (@intentic/extension-api/wire), and
|
|
5
|
+
// leaves at extension API 3.0.0 as a pure delete; never add a platform here.
|
|
6
|
+
//
|
|
7
|
+
// The longest one message may be on each platform, as that daemon knew it. Measured in JavaScript string length (UTF-16
|
|
8
|
+
// code units), which never undercounts a platform that counts characters. A platform absent here has no known cap.
|
|
5
9
|
export const MESSAGE_LIMITS = {
|
|
6
10
|
bluesky: 300,
|
|
7
11
|
discord: 2_000,
|
package/src/policy/org-locks.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// The name of the folder a command run at the workspace root should step over, handed to it in its environment: every
|
|
2
|
+
// automation guard gets the reference shelf's (automations/watch/watch-condition.ts), and the maintenance extension's
|
|
3
|
+
// probes get it at the workspace root only, since inside one repository a `refs/` directory is ordinary project content.
|
|
4
|
+
// In the `chores` subpath until 2026-11-26, which re-exports it until extension API 3.0.0.
|
|
5
|
+
export const WORKSPACE_ROOT_EXCLUDE_ENV = `INTENTIC_WORKSPACE_ROOT_EXCLUDE`;
|
|
6
|
+
|
|
7
|
+
// Unquoted parameter expansion is intentional: when the variable is absent it contributes zero arguments;
|
|
8
|
+
// when present, each expression expands to one whitespace-free CLI argument. The daemon supplies the value
|
|
9
|
+
// from @intentic/workspace-ignore, never from user input.
|
|
10
|
+
export const WORKSPACE_ROOT_RG_EXCLUDE_ARG = `\${${WORKSPACE_ROOT_EXCLUDE_ENV}:+--glob=!/\${${WORKSPACE_ROOT_EXCLUDE_ENV}}/**}`;
|
|
11
|
+
export const WORKSPACE_ROOT_JSCPD_EXCLUDE_ARG = `\${${WORKSPACE_ROOT_EXCLUDE_ENV}:+--ignore=\${${WORKSPACE_ROOT_EXCLUDE_ENV}}/**}`;
|
|
@@ -61,6 +61,10 @@ export const ListenerMessageSchema = z.object({
|
|
|
61
61
|
// Prior channel messages fetched when tagged; top-level so it reaches the model but skips the activity feed.
|
|
62
62
|
history: z.array(ListenerHistoryEntrySchema).optional(),
|
|
63
63
|
timestamp: z.string(),
|
|
64
|
+
// (2026-11-26) Only the automation with this id hears it (still held to its own filters, sender rules and the
|
|
65
|
+
// owner's floor): a source with one automation per door (an intake) names the one the message came through, so
|
|
66
|
+
// another listening to everything is not woken too. Absent, every automation whose filters admit it.
|
|
67
|
+
automationId: z.string().min(1).optional(),
|
|
64
68
|
// Provider-specific fields, for example:
|
|
65
69
|
// - discord message: guildId, attachments
|
|
66
70
|
// - slack message: threadTs, teamId, attachments
|
|
@@ -78,6 +82,13 @@ export interface ListenerTurnOpened {
|
|
|
78
82
|
readonly link?: string;
|
|
79
83
|
}
|
|
80
84
|
|
|
85
|
+
// A wake held for a person: which one, the conversation it will run in, and where a person opens that in the app.
|
|
86
|
+
export interface ListenerHeldWake {
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly conversationId?: string;
|
|
89
|
+
readonly link?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
81
92
|
// One piece of the agent's work as a status line shows it: what kind of work, on what, and how it went. Never the
|
|
82
93
|
// call's output. `delegate` is a subagent the turn started, its target the task it was given.
|
|
83
94
|
export interface ListenerStep {
|
|
@@ -111,6 +122,9 @@ export interface ListenerDispatchFrame {
|
|
|
111
122
|
readonly plan?: readonly ListenerPlanItem[];
|
|
112
123
|
// The wake waits for a person's approval before anything runs; the sentence to say where the message came from.
|
|
113
124
|
readonly held?: string;
|
|
125
|
+
// (2026-11-26) Beside `held`: the held wake's id, and the conversation it runs in once a person lets it, so the
|
|
126
|
+
// sender can link it now (a later message on its thread continues that conversation too).
|
|
127
|
+
readonly heldWake?: ListenerHeldWake;
|
|
114
128
|
// The wake waits for other turns of this automation to finish first; the sentence to say why.
|
|
115
129
|
readonly queued?: string;
|
|
116
130
|
// The message went into the turn already running in its thread instead of starting one; that turn answers it.
|
|
@@ -45,7 +45,9 @@ export const WEBEXT_MEDIA_SOURCE_HEADER = "x-intentic-source";
|
|
|
45
45
|
export const WEBEXT_UPLOAD_TOOL = "upload_file";
|
|
46
46
|
|
|
47
47
|
// The ChatGPT kit's send, whose `files` (sandbox paths) are ticketed the same way, one ticket per file, into its
|
|
48
|
-
// `tickets` in the same order.
|
|
48
|
+
// `tickets` in the same order. (2026-11-26) The kit is the chatgpt extension's now (_extensions/chatgpt); this stays
|
|
49
|
+
// because the browser extension runs the kit as tools of its own and refuses a file without its ticket, at every
|
|
50
|
+
// version in the field, whether the agent or that extension's `browser` half calls it.
|
|
49
51
|
export const WEBEXT_CHATGPT_SEND_TOOL = "chatgpt_send";
|
|
50
52
|
|
|
51
53
|
// How long a file ticket waits to be collected; the extension collects it before it asks the person anything.
|