@intentic/sandbox-contract 1.423.0 → 1.425.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/dist/contracts/access-profiles.contract.d.ts +7 -3
- package/dist/contracts/access-profiles.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.d.ts +51 -10
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.js +1 -1
- package/dist/contracts/agent.contract.js.map +1 -1
- package/dist/contracts/agents.contract.d.ts +13 -5
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +1 -1
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/approvals.contract.d.ts +1 -1
- package/dist/contracts/needs.contract.d.ts +41 -26
- package/dist/contracts/needs.contract.d.ts.map +1 -1
- package/dist/contracts/needs.contract.js +2 -2
- package/dist/contracts/needs.contract.js.map +1 -1
- package/dist/contracts/org.contract.d.ts +3 -0
- package/dist/contracts/org.contract.d.ts.map +1 -1
- package/dist/contracts/{personas.contract.d.ts → roles.contract.d.ts} +3 -39
- package/dist/contracts/roles.contract.d.ts.map +1 -0
- package/dist/contracts/roles.contract.js +78 -0
- package/dist/contracts/roles.contract.js.map +1 -0
- package/dist/contracts/runner.contract.d.ts +276 -252
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/seal.contract.d.ts +1 -25
- package/dist/contracts/seal.contract.d.ts.map +1 -1
- package/dist/contracts/seal.contract.js +3 -14
- package/dist/contracts/seal.contract.js.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +5 -1
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +2 -2
- package/dist/contracts/skills.contract.d.ts +3 -3
- package/dist/contracts/skills.contract.js +1 -1
- package/dist/contracts/skills.contract.js.map +1 -1
- package/dist/contracts/system.contract.d.ts +11 -16
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/events/agent-events.d.ts +20 -4
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-transcript.d.ts +5 -1
- package/dist/events/agent-transcript.d.ts.map +1 -1
- package/dist/events/system-events.d.ts +7 -7
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/system-events.js +3 -3
- package/dist/events/system-events.js.map +1 -1
- package/dist/events/transcript.d.ts +25 -5
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/models/model-roles.d.ts +1 -1
- package/dist/models/model-roles.d.ts.map +1 -1
- package/dist/models/model-roles.js +1 -1
- package/dist/models/model-roles.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 -1
- package/dist/policy/org-locks.js.map +1 -1
- package/dist/policy/role-capability.d.ts +7 -0
- package/dist/policy/role-capability.d.ts.map +1 -0
- package/dist/policy/role-capability.js +3 -0
- package/dist/policy/role-capability.js.map +1 -0
- package/dist/policy/role-home.d.ts +9 -0
- package/dist/policy/role-home.d.ts.map +1 -0
- package/dist/policy/role-home.js +7 -0
- package/dist/policy/role-home.js.map +1 -0
- package/dist/protocol/member-reach.d.ts +4 -4
- package/dist/protocol/member-reach.js +3 -3
- package/dist/protocol/raw/raw-json-routes.d.ts +29 -23
- package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
- package/dist/protocol/route-meta.d.ts +4 -4
- package/dist/schemas/access-profiles.d.ts +10 -4
- package/dist/schemas/access-profiles.d.ts.map +1 -1
- package/dist/schemas/access-profiles.js +9 -4
- package/dist/schemas/access-profiles.js.map +1 -1
- package/dist/schemas/agent.js +3 -3
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents.js +2 -2
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/approvals.d.ts +3 -3
- package/dist/schemas/approvals.js +3 -3
- package/dist/schemas/approvals.js.map +1 -1
- package/dist/schemas/automations.js +6 -6
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/chat-route.d.ts +7 -2
- package/dist/schemas/chat-route.d.ts.map +1 -1
- package/dist/schemas/chat-route.js +11 -6
- package/dist/schemas/chat-route.js.map +1 -1
- package/dist/schemas/context-trim.js +1 -1
- package/dist/schemas/context-trim.js.map +1 -1
- package/dist/schemas/diagnostics.d.ts +3 -3
- package/dist/schemas/git/git.js +1 -1
- package/dist/schemas/git/git.js.map +1 -1
- package/dist/schemas/links.d.ts +1 -1
- package/dist/schemas/links.js +4 -4
- package/dist/schemas/links.js.map +1 -1
- package/dist/schemas/loops.js +1 -1
- package/dist/schemas/loops.js.map +1 -1
- package/dist/schemas/members.d.ts +162 -20
- package/dist/schemas/members.d.ts.map +1 -1
- package/dist/schemas/members.js +19 -16
- package/dist/schemas/members.js.map +1 -1
- package/dist/schemas/needs.d.ts +37 -42
- package/dist/schemas/needs.d.ts.map +1 -1
- package/dist/schemas/needs.js +18 -16
- package/dist/schemas/needs.js.map +1 -1
- package/dist/schemas/organisation.d.ts +10 -0
- package/dist/schemas/organisation.d.ts.map +1 -1
- package/dist/schemas/organisation.js.map +1 -1
- package/dist/schemas/{personas.d.ts → roles.d.ts} +37 -72
- package/dist/schemas/roles.d.ts.map +1 -0
- package/dist/schemas/{personas.js → roles.js} +45 -67
- package/dist/schemas/roles.js.map +1 -0
- package/dist/schemas/seal.d.ts +2 -21
- package/dist/schemas/seal.d.ts.map +1 -1
- package/dist/schemas/seal.js +1 -16
- package/dist/schemas/seal.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 +2 -1
- package/dist/schemas/settings-history.js.map +1 -1
- package/dist/schemas/settings.d.ts +11 -11
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +3 -3
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/shared.d.ts +6 -5
- package/dist/schemas/shared.d.ts.map +1 -1
- package/dist/schemas/shared.js +14 -5
- package/dist/schemas/shared.js.map +1 -1
- package/dist/schemas/system-prompt.d.ts +12 -12
- package/dist/schemas/system-prompt.d.ts.map +1 -1
- package/dist/schemas/system-prompt.js +1 -1
- package/dist/schemas/system-prompt.js.map +1 -1
- package/dist/schemas/terminal.d.ts +18 -0
- package/dist/schemas/terminal.d.ts.map +1 -1
- package/dist/schemas/terminal.js +16 -1
- package/dist/schemas/terminal.js.map +1 -1
- package/dist/schemas/tool-ceiling.d.ts +4 -2
- package/dist/schemas/tool-ceiling.d.ts.map +1 -1
- package/dist/schemas/tool-ceiling.js +29 -3
- package/dist/schemas/tool-ceiling.js.map +1 -1
- package/dist/schemas/workflows.js +1 -1
- package/dist/schemas/workflows.js.map +1 -1
- package/dist/state/definition.d.ts +4 -4
- package/dist/state/workspace-state.d.ts +4 -4
- package/dist/state/workspace-state.d.ts.map +1 -1
- package/dist/state/workspace-state.js +2 -2
- package/dist/state/workspace-state.js.map +1 -1
- package/package.json +5 -5
- package/src/contracts/agent.contract.ts +2 -2
- package/src/contracts/agents.contract.ts +1 -1
- package/src/contracts/automations.contract.ts +1 -1
- package/src/contracts/logs.contract.ts +1 -1
- package/src/contracts/needs.contract.ts +2 -2
- package/src/contracts/roles.contract.ts +108 -0
- package/src/contracts/seal.contract.ts +3 -18
- package/src/contracts/skills.contract.ts +2 -2
- package/src/events/system-events.ts +5 -4
- package/src/index.ts +3 -3
- package/src/models/agent-runtimes.ts +8 -8
- package/src/models/model-roles.ts +3 -3
- package/src/policy/control-scopes.ts +1 -1
- package/src/policy/fence-paths.ts +2 -2
- package/src/policy/org-locks.ts +2 -1
- package/src/policy/role-capability.ts +29 -0
- package/src/policy/role-home.ts +29 -0
- package/src/policy/tests/fence-paths.test.ts +1 -1
- package/src/policy/tests/role-home.test.ts +40 -0
- package/src/protocol/member-reach.test.ts +17 -17
- package/src/protocol/member-reach.ts +7 -7
- package/src/protocol/route-meta.ts +6 -6
- package/src/schemas/access-profiles.ts +20 -9
- package/src/schemas/agent.ts +4 -4
- package/src/schemas/agents.ts +2 -2
- package/src/schemas/approvals.ts +3 -3
- package/src/schemas/automations.ts +14 -14
- package/src/schemas/capabilities.ts +1 -1
- package/src/schemas/chat-route.ts +18 -9
- package/src/schemas/context-trim.ts +1 -1
- package/src/schemas/diagnostics.ts +1 -1
- package/src/schemas/git/git.ts +1 -1
- package/src/schemas/internal.ts +1 -1
- package/src/schemas/links.ts +7 -7
- package/src/schemas/loops.ts +1 -1
- package/src/schemas/members.test.ts +31 -31
- package/src/schemas/members.ts +37 -29
- package/src/schemas/needs.ts +35 -22
- package/src/schemas/organisation.ts +2 -0
- package/src/schemas/{personas.ts → roles.ts} +83 -113
- package/src/schemas/seal.ts +5 -30
- package/src/schemas/settings-history.ts +3 -1
- package/src/schemas/settings.ts +10 -6
- package/src/schemas/shared.ts +24 -10
- package/src/schemas/state-plan.test.ts +3 -3
- package/src/schemas/system-prompt.ts +2 -1
- package/src/schemas/terminal.ts +18 -1
- package/src/schemas/tool-ceiling.test.ts +14 -8
- package/src/schemas/tool-ceiling.ts +42 -11
- package/src/schemas/workflows.ts +1 -1
- package/src/state/auth-state.ts +1 -1
- package/src/state/definition.ts +1 -1
- package/src/state/workspace-state.test.ts +5 -5
- package/src/state/workspace-state.ts +11 -11
- package/dist/contracts/personas.contract.d.ts.map +0 -1
- package/dist/contracts/personas.contract.js +0 -78
- package/dist/contracts/personas.contract.js.map +0 -1
- package/dist/policy/persona-capability.d.ts +0 -14
- package/dist/policy/persona-capability.d.ts.map +0 -1
- package/dist/policy/persona-capability.js +0 -24
- package/dist/policy/persona-capability.js.map +0 -1
- package/dist/policy/persona-home.d.ts +0 -10
- package/dist/policy/persona-home.d.ts.map +0 -1
- package/dist/policy/persona-home.js +0 -11
- package/dist/policy/persona-home.js.map +0 -1
- package/dist/schemas/personas.d.ts.map +0 -1
- package/dist/schemas/personas.js.map +0 -1
- package/dist/schemas/seal-proof.d.ts +0 -20
- package/dist/schemas/seal-proof.d.ts.map +0 -1
- package/dist/schemas/seal-proof.js +0 -8
- package/dist/schemas/seal-proof.js.map +0 -1
- package/src/contracts/personas.contract.ts +0 -106
- package/src/policy/persona-capability.ts +0 -64
- package/src/policy/persona-home.ts +0 -39
- package/src/policy/tests/persona-home.test.ts +0 -51
- package/src/schemas/seal-proof.ts +0 -12
|
@@ -13,7 +13,7 @@ export interface ControlScopeReach {
|
|
|
13
13
|
readonly note: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
// Derived in the daemon from the same
|
|
16
|
+
// Derived in the daemon from the same tier floors a member holds (read=viewer, drive=collaborator).
|
|
17
17
|
export const CONTROL_SCOPE_REACH: readonly ControlScopeReach[] = [
|
|
18
18
|
{
|
|
19
19
|
scope: "editor",
|
|
@@ -39,7 +39,7 @@ export const pathInsideFolder = (folder: string, path: string): boolean => {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
// "Change the sandbox" as paths: the daemon's own configuration, and the outbox the internet reads. One list, read by
|
|
42
|
-
// the
|
|
42
|
+
// the role hook that judges a turn's writes and by the area schema that decides what a grant may name.
|
|
43
43
|
export const SANDBOX_PATHS: readonly string[] = [STATE_DIR, PUBLIC_DIR];
|
|
44
44
|
|
|
45
45
|
// Whether a path is one of those folders or sits inside one, by segment: `publications` is not `public`.
|
|
@@ -82,7 +82,7 @@ export const fenceCovers = (outer: Fence, inner: Fence): boolean => {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
* The tighter of two fences: what a turn may touch when a
|
|
85
|
+
* The tighter of two fences: what a turn may touch when a role's folders meet the member's own. Undefined on both
|
|
86
86
|
* sides is the whole workspace; either side alone narrows to itself.
|
|
87
87
|
*/
|
|
88
88
|
export const fenceIntersection = (left: Fence, right: Fence): Fence => {
|
package/src/policy/org-locks.ts
CHANGED
|
@@ -93,7 +93,8 @@ export const ORG_SECTION_ROUTES = {
|
|
|
93
93
|
],
|
|
94
94
|
},
|
|
95
95
|
areas: { changes: ["areas.save", "areas.remove"] },
|
|
96
|
-
|
|
96
|
+
// The Roles section, under the id it had as Personas (organisation.ts ORG_SECTIONS).
|
|
97
|
+
personas: { changes: ["roles.save", "roles.remove", "roles.savePrompt", "roles.saveSkill", "roles.removeSkill"] },
|
|
97
98
|
updates: { changes: ["system.autoUpdate", "system.skipUpdate"] },
|
|
98
99
|
} as const satisfies Readonly<Record<OrgSection, SectionRoutes>>;
|
|
99
100
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// WHETHER A ROLE LETS A TURN ACT THROUGH ONE CONNECTED CAPABILITY. Pure and shared, because the daemon mounts a turn's
|
|
2
|
+
// tools on this answer (roles/roles.ts `turnRole`) and the Sandbox ▸ Map view draws who reaches what from it,
|
|
3
|
+
// and two implementations would disagree at exactly the boundary that matters.
|
|
4
|
+
// A card decides one thing about reach: which signed-in accounts it speaks through. Every other limit on a conversation
|
|
5
|
+
// wearing it (connectors, devices, servers, shelves, folders) is an access profile that lists the card
|
|
6
|
+
// (schemas/access-profiles.ts `roles`), held in the principal chain like a person's or a service's.
|
|
7
|
+
|
|
8
|
+
// The two fields of a connection the rule reads; structural, so neither side has to hand over its own record type.
|
|
9
|
+
export interface CapabilityRef {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly kind: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The kinds that are someone signed in: a site account, the identity whose browser holds every account born of it, and
|
|
16
|
+
* the owner's own browser (its extension), which holds every session they have. The last one was missing until
|
|
17
|
+
* 2026-10-25, and it fell through to "passes untouched": an X-only role's unattended run reached the owner's Brave,
|
|
18
|
+
* and an unpinned wake that lost every sandbox account kept it.
|
|
19
|
+
*/
|
|
20
|
+
export const isSignedInAccount = (kind: string): boolean => kind === "browser" || kind === "identity" || kind === "webext";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Whether a role speaking through these accounts (its `capabilities`) may act through a capability. Granting an
|
|
24
|
+
* account (`reddit-work`) grants its hands; granting the identity itself grants the someone. The owner's own browser is
|
|
25
|
+
* named the same way: a role reaches it only when its list says so. Every other kind passes here and is decided by
|
|
26
|
+
* access.
|
|
27
|
+
*/
|
|
28
|
+
export const roleAllowsCapability = (capability: CapabilityRef, accounts: readonly string[]): boolean =>
|
|
29
|
+
!isSignedInAccount(capability.kind) || accounts.includes(capability.id);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Fence, fenceCovers } from "./fence-paths.js";
|
|
2
|
+
|
|
3
|
+
// Where a role card LIVES, and therefore who may act through it. A card is not granted per person any more: a
|
|
4
|
+
// person holds areas, an area is folders, and a card whose home those folders cover is one that person may wear.
|
|
5
|
+
// Pure and shared, because the daemon refuses on this answer and the Access tab draws the consequence from it, and
|
|
6
|
+
// two implementations would disagree at exactly the boundary that matters.
|
|
7
|
+
|
|
8
|
+
// The field a card names a place with; structural rather than the Role type, so this stays free of the schema
|
|
9
|
+
// layer that imports it.
|
|
10
|
+
export interface RolePlace {
|
|
11
|
+
readonly workspace?: { readonly startIn?: string | undefined } | undefined;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The card's home as a fence: the folder it opens in, else undefined, the workspace root, which only somebody holding
|
|
16
|
+
* the whole workspace covers. Where a conversation OPENS is the one place the card certainly works. (Until 2026-11-18 a
|
|
17
|
+
* card with no `startIn` was homed in its own folder list; those folders are a profile's areas now, and the step that
|
|
18
|
+
* moved them gave a card with a single folder that folder as its `startIn`.)
|
|
19
|
+
*/
|
|
20
|
+
export const roleHome = (card: RolePlace): Fence => {
|
|
21
|
+
const startIn = card.workspace?.startIn;
|
|
22
|
+
return startIn !== undefined && startIn !== "" ? [startIn] : undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Whether a person fenced to these folders may act through this card. An unfenced holder reaches every card; a fenced
|
|
27
|
+
* one reaches those homed inside its folders, and never a card that lives at the workspace root.
|
|
28
|
+
*/
|
|
29
|
+
export const fenceHoldsRole = (fence: Fence, card: RolePlace): boolean => fenceCovers(fence, roleHome(card));
|
|
@@ -96,7 +96,7 @@ describe("fenceIntersection", () => {
|
|
|
96
96
|
expect(fenceIntersection(undefined, undefined)).toBeUndefined();
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
// The narrower of the pair survives, whichever side it came from, so a
|
|
99
|
+
// The narrower of the pair survives, whichever side it came from, so a role asking for more than its starter
|
|
100
100
|
// holds gets the starter's answer.
|
|
101
101
|
test("the tighter folder is what survives, from whichever side", () => {
|
|
102
102
|
expect(fenceIntersection(["apps"], ["apps/web"])).toEqual(["apps/web"]);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { fenceHoldsRole, roleHome } from "../role-home.js";
|
|
2
|
+
|
|
3
|
+
// Where a card lives, and therefore who may wear it. This is the whole of the rule the Access tab draws and the
|
|
4
|
+
// daemon refuses on, so both shapes a card can name a place in are each pinned here.
|
|
5
|
+
|
|
6
|
+
describe("roleHome", () => {
|
|
7
|
+
test("the folder it opens in is its home", () => {
|
|
8
|
+
expect(roleHome({ workspace: { startIn: "support" } })).toEqual(["support"]);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test("naming no place at all is the workspace root, which is not a folder any fence can hold", () => {
|
|
12
|
+
expect(roleHome({})).toBeUndefined();
|
|
13
|
+
expect(roleHome({ workspace: {} })).toBeUndefined();
|
|
14
|
+
expect(roleHome({ workspace: { startIn: "" } })).toBeUndefined();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe("fenceHoldsRole", () => {
|
|
19
|
+
const support = { workspace: { startIn: "support/inbox" } };
|
|
20
|
+
const finance = { workspace: { startIn: "finance" } };
|
|
21
|
+
|
|
22
|
+
test("an unfenced holder wears every card, root-homed ones included", () => {
|
|
23
|
+
expect(fenceHoldsRole(undefined, support)).toBe(true);
|
|
24
|
+
expect(fenceHoldsRole(undefined, {})).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test("a fenced holder wears the cards homed inside its folders and no others", () => {
|
|
28
|
+
expect(fenceHoldsRole(["support"], support)).toBe(true);
|
|
29
|
+
expect(fenceHoldsRole(["support"], finance)).toBe(false);
|
|
30
|
+
// By segment, not by string prefix: `support2` is not inside `support`.
|
|
31
|
+
expect(fenceHoldsRole(["support"], { workspace: { startIn: "support2" } })).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// The one card no fence can reach, whatever it names: everything is inside the root, so holding it would be
|
|
35
|
+
// holding the workspace.
|
|
36
|
+
test("a card homed at the root is the owner's alone", () => {
|
|
37
|
+
expect(fenceHoldsRole(["support"], {})).toBe(false);
|
|
38
|
+
expect(fenceHoldsRole([], {})).toBe(false);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -94,7 +94,7 @@ describe("routeFloor", () => {
|
|
|
94
94
|
});
|
|
95
95
|
|
|
96
96
|
describe("memberRefusal for a person given part of the sandbox", () => {
|
|
97
|
-
const collaborator = {
|
|
97
|
+
const collaborator = { tier: "collaborator" as const, agents: "run" as const };
|
|
98
98
|
|
|
99
99
|
test("People & access opens the roster, its requests, areas, profiles and the preview guard, and nothing else", () => {
|
|
100
100
|
const people = { ...collaborator, manages: ["people" as const] };
|
|
@@ -139,7 +139,7 @@ describe("memberRefusal for a person given part of the sandbox", () => {
|
|
|
139
139
|
});
|
|
140
140
|
|
|
141
141
|
test("Full access reaches what the owner ran alone before, short of the owner's own door", () => {
|
|
142
|
-
const maintainer = {
|
|
142
|
+
const maintainer = { tier: "maintainer" as const };
|
|
143
143
|
expect(memberRefusal(maintainer, "GET", "/members")).toBeUndefined();
|
|
144
144
|
expect(memberRefusal(maintainer, "POST", "/privacy/reveal")).toBeUndefined();
|
|
145
145
|
expect(memberRefusal(maintainer, "POST", "/settings/agent-domain")).toBeUndefined();
|
|
@@ -196,33 +196,33 @@ describe("guestReach", () => {
|
|
|
196
196
|
|
|
197
197
|
describe("memberRefusal", () => {
|
|
198
198
|
test("a tier below the floor is refused with the floor named; a guest off its list with its own sentence", () => {
|
|
199
|
-
expect(memberRefusal({
|
|
200
|
-
expect(memberRefusal({
|
|
201
|
-
expect(memberRefusal({
|
|
202
|
-
expect(memberRefusal({
|
|
199
|
+
expect(memberRefusal({ tier: "viewer" }, "POST", "/agent")).toEqual({ error: "collaborator access required", floor: "collaborator", reason: "floor" });
|
|
200
|
+
expect(memberRefusal({ tier: "collaborator" }, "POST", "/agent")).toBeUndefined();
|
|
201
|
+
expect(memberRefusal({ tier: "guest", areas: ["support"] }, "POST", "/agent")).toBeUndefined();
|
|
202
|
+
expect(memberRefusal({ tier: "guest", areas: ["support"] }, "POST", "/workspace/move")).toEqual({
|
|
203
203
|
error: "not open to a guest member",
|
|
204
204
|
floor: "viewer",
|
|
205
205
|
reason: "guest",
|
|
206
206
|
});
|
|
207
207
|
// A guest never clears a floor by rank: the list is the whole of its admission.
|
|
208
|
-
expect(memberRefusal({
|
|
208
|
+
expect(memberRefusal({ tier: "guest", areas: ["support"] }, "GET", "/no/such/route")).toEqual({
|
|
209
209
|
error: "not open to a guest member",
|
|
210
210
|
floor: "viewer",
|
|
211
211
|
reason: "guest",
|
|
212
212
|
});
|
|
213
|
-
expect(memberRefusal({
|
|
213
|
+
expect(memberRefusal({ tier: "viewer" }, "GET", "/no/such/route")).toBeUndefined();
|
|
214
214
|
});
|
|
215
215
|
|
|
216
216
|
test("a writer clears the file routes and nothing that ships or operates", () => {
|
|
217
|
-
expect(memberRefusal({
|
|
218
|
-
expect(memberRefusal({
|
|
219
|
-
expect(memberRefusal({
|
|
220
|
-
expect(memberRefusal({
|
|
217
|
+
expect(memberRefusal({ tier: "writer", areas: ["support"] }, "POST", "/workspace/move")).toBeUndefined();
|
|
218
|
+
expect(memberRefusal({ tier: "writer", areas: ["support"] }, "POST", "/workspace/upload", "support/note.md")).toBeUndefined();
|
|
219
|
+
expect(memberRefusal({ tier: "collaborator" }, "POST", "/workspace/move")).toEqual({ error: "writer access required", floor: "writer", reason: "floor" });
|
|
220
|
+
expect(memberRefusal({ tier: "writer", areas: ["support"] }, "POST", "/agents/abc/land")).toEqual({
|
|
221
221
|
error: "maintainer access required",
|
|
222
222
|
floor: "maintainer",
|
|
223
223
|
reason: "floor",
|
|
224
224
|
});
|
|
225
|
-
expect(memberRefusal({
|
|
225
|
+
expect(memberRefusal({ tier: "writer", areas: ["support"] }, "GET", "/secrets")).toEqual({
|
|
226
226
|
error: "maintainer access required",
|
|
227
227
|
floor: "maintainer",
|
|
228
228
|
reason: "floor",
|
|
@@ -234,19 +234,19 @@ describe("memberRefusal", () => {
|
|
|
234
234
|
// which clears the collaborator floor by rank, and is kept off it by their own answer.
|
|
235
235
|
describe("memberRefusal for a person with agents off", () => {
|
|
236
236
|
test("refuses every agent door and keeps the file doors open", () => {
|
|
237
|
-
const editor = {
|
|
237
|
+
const editor = { tier: "writer" as const, agents: "off" as const };
|
|
238
238
|
expect(memberRefusal(editor, "POST", "/agent")).toEqual({ error: "running agents is not on for you here", floor: "collaborator", reason: "agents-off" });
|
|
239
239
|
expect(memberRefusal(editor, "POST", "/agents/abc/request-land")).toMatchObject({ floor: "collaborator" });
|
|
240
240
|
expect(memberRefusal(editor, "POST", "/workspace/dir")).toBeUndefined();
|
|
241
241
|
expect(memberRefusal(editor, "GET", "/workspace/tree")).toBeUndefined();
|
|
242
|
-
expect(memberRefusal({
|
|
242
|
+
expect(memberRefusal({ tier: "writer", agents: "run" }, "POST", "/agent")).toBeUndefined();
|
|
243
243
|
});
|
|
244
244
|
});
|
|
245
245
|
|
|
246
246
|
// A home-only member is a guest whose one conversation is its home (conversations/home/home-conversation.ts): the guest
|
|
247
247
|
// list, and the land press when its home lands by itself, which the route then admits on that home alone.
|
|
248
248
|
describe("a home-only member", () => {
|
|
249
|
-
const homeOnly = {
|
|
249
|
+
const homeOnly = { tier: "guest", agents: "home" } as const;
|
|
250
250
|
|
|
251
251
|
test("reaches what a guest reaches, and the land press only when its work lands by itself", () => {
|
|
252
252
|
expect(memberRefusal(homeOnly, "POST", "/agent")).toBeUndefined();
|
|
@@ -268,7 +268,7 @@ describe("a home-only member", () => {
|
|
|
268
268
|
});
|
|
269
269
|
|
|
270
270
|
test("a chatting guest granted nothing of the kind does not reach the land press", () => {
|
|
271
|
-
expect(memberRefusal({
|
|
271
|
+
expect(memberRefusal({ tier: "guest", agents: "chat", lands: true }, "POST", "/agents/abc/land")).toEqual({
|
|
272
272
|
error: "not open to a guest member",
|
|
273
273
|
floor: "viewer",
|
|
274
274
|
reason: "guest",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { AgentAccess, ManageRight } from "../schemas/members.js";
|
|
2
|
-
import { type
|
|
2
|
+
import { type MemberTier, tierAtLeast } from "../schemas/shared.js";
|
|
3
3
|
import { defaultFloor } from "./route-meta.js";
|
|
4
4
|
import { isAttachmentPath } from "../state/workspace-state.js";
|
|
5
5
|
import { sandboxRouteFor } from "../index.js";
|
|
6
6
|
|
|
7
7
|
// Role floors: the minimum trust tier each route demands, read from the route's own RouteMeta (route-meta.ts). One
|
|
8
|
-
// function for both sides: the daemon's bearer middleware refuses with it right after the caller's
|
|
8
|
+
// function for both sides: the daemon's bearer middleware refuses with it right after the caller's tier resolves, and
|
|
9
9
|
// the editor asks it before sending, so a request the daemon would refuse is never sent and the two cannot disagree.
|
|
10
10
|
// A floor, not the whole answer: operating routes still keep their own in-route gates (members.ts `holdsRight`,
|
|
11
11
|
// `peopleChangeRefusal`). A route that runs one part of the sandbox names it (`right`), and a person given that part
|
|
@@ -22,7 +22,7 @@ export type MemberRefusalReason = "floor" | "agents-off" | "guest";
|
|
|
22
22
|
// The body of that refusal, as the daemon sends it and as the editor predicts it before sending.
|
|
23
23
|
export interface MemberRefusal {
|
|
24
24
|
readonly error: string;
|
|
25
|
-
readonly floor:
|
|
25
|
+
readonly floor: MemberTier;
|
|
26
26
|
readonly reason: MemberRefusalReason;
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -31,7 +31,7 @@ export interface MemberRefusal {
|
|
|
31
31
|
// the bytes land.
|
|
32
32
|
export const memberRefusal = (
|
|
33
33
|
caller: {
|
|
34
|
-
readonly
|
|
34
|
+
readonly tier: MemberTier;
|
|
35
35
|
readonly areas?: readonly string[] | undefined;
|
|
36
36
|
readonly agents?: AgentAccess | undefined;
|
|
37
37
|
readonly lands?: true | undefined;
|
|
@@ -41,13 +41,13 @@ export const memberRefusal = (
|
|
|
41
41
|
path: string,
|
|
42
42
|
target?: string,
|
|
43
43
|
): MemberRefusal | undefined => {
|
|
44
|
-
if (caller.
|
|
44
|
+
if (caller.tier === "guest") {
|
|
45
45
|
return guestReach(method, path, target) || homeReach(caller, method, path)
|
|
46
46
|
? undefined
|
|
47
47
|
: { error: "not open to a guest member", floor: "viewer", reason: "guest" };
|
|
48
48
|
}
|
|
49
49
|
const floor = routeFloor(method, path, target);
|
|
50
|
-
if (!
|
|
50
|
+
if (!tierAtLeast(caller.tier, floor) && !givenRight(caller, method, path)) {
|
|
51
51
|
return { error: `${floor} access required`, floor, reason: "floor" };
|
|
52
52
|
}
|
|
53
53
|
// The collaborator floor is driving agents. A person who edits files by hand without running agents holds the
|
|
@@ -77,7 +77,7 @@ const homeReach = (caller: { readonly agents?: AgentAccess | undefined; readonly
|
|
|
77
77
|
export const homeLandReach = (method: string, path: string): boolean => sandboxRouteFor(method, path)?.meta.home === "land";
|
|
78
78
|
|
|
79
79
|
// `target` is the workspace path a byte-write addresses (upload's `?path=`); absent for every other route.
|
|
80
|
-
export const routeFloor = (method: string, path: string, target?: string):
|
|
80
|
+
export const routeFloor = (method: string, path: string, target?: string): MemberTier => {
|
|
81
81
|
const meta = sandboxRouteFor(method, path)?.meta;
|
|
82
82
|
if (meta?.attachmentFloor !== undefined && attachment(target)) {
|
|
83
83
|
return meta.attachmentFloor;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import type { ManageRight } from "../schemas/members.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { MemberTier } from "../schemas/shared.js";
|
|
4
4
|
|
|
5
5
|
// Every route's policy, declared beside it: how a request authenticates, which member tier and which machine
|
|
6
6
|
// credentials reach it, and how the daemon's outer middleware treats it. Each field has a default, so most routes
|
|
7
|
-
// declare nothing; the daemon's bearer, boot, timer,
|
|
7
|
+
// declare nothing; the daemon's bearer, boot, timer, tier-floor and grant decisions all derive from this.
|
|
8
8
|
|
|
9
9
|
// How far a control token reaches a route beyond what its floor alone gives the `read`/`drive` rungs.
|
|
10
10
|
// `never`: no rung; `editor`: the editor slice too; `read`: the read rung and the editor slice, though no GET (watching
|
|
@@ -20,8 +20,8 @@ export interface RouteMeta {
|
|
|
20
20
|
readonly beforeBoot?: true;
|
|
21
21
|
// Held open by design, so the request timer leaves it out.
|
|
22
22
|
readonly stream?: true;
|
|
23
|
-
// The lowest member
|
|
24
|
-
readonly floor?:
|
|
23
|
+
// The lowest member tier that may call it. Absent: viewer for a read (GET, HEAD), maintainer for anything else.
|
|
24
|
+
readonly floor?: MemberTier;
|
|
25
25
|
// The part of the sandbox it runs (members.ts `ManageRightSchema`): a person below the floor who was given that part
|
|
26
26
|
// reaches it too. The handler holds anything finer (members.ts `peopleChangeRefusal`).
|
|
27
27
|
readonly right?: ManageRight;
|
|
@@ -31,7 +31,7 @@ export interface RouteMeta {
|
|
|
31
31
|
// (`landsHere`): `land` is the press on their own home conversation, the one conversation the handler then admits.
|
|
32
32
|
readonly home?: "land";
|
|
33
33
|
// The floor an upload aimed inside ATTACHMENTS_DIR gets instead, one a guest may also make.
|
|
34
|
-
readonly attachmentFloor?:
|
|
34
|
+
readonly attachmentFloor?: MemberTier;
|
|
35
35
|
// A passkey-registration door: a proof with no passkey yet may pass the require-passkey policy.
|
|
36
36
|
readonly enrolment?: true;
|
|
37
37
|
// The agent token, which the CLIs on the agent's PATH carry, reaches it.
|
|
@@ -50,7 +50,7 @@ export interface RouteMeta {
|
|
|
50
50
|
|
|
51
51
|
// The floor a route gets when it declares none: a read (GET, HEAD) floors at viewer, anything else (`ALL` included) at
|
|
52
52
|
// maintainer, so a route nobody classified can under-serve, never over-grant.
|
|
53
|
-
export const defaultFloor = (method: string):
|
|
53
|
+
export const defaultFloor = (method: string): MemberTier => (method === "GET" || method === "HEAD" ? "viewer" : "maintainer");
|
|
54
54
|
|
|
55
55
|
// The fields that say how a request travels, not who may send it; every other RouteMeta field decides reach.
|
|
56
56
|
type TransportField = "lane" | "netd";
|
|
@@ -9,16 +9,19 @@ import {
|
|
|
9
9
|
EditScopeSchema,
|
|
10
10
|
type MemberAccess,
|
|
11
11
|
} from "./members.js";
|
|
12
|
-
import {
|
|
12
|
+
import { GrantedTierSchema, withLegacyTier } from "./shared.js";
|
|
13
13
|
import { ToolCeilingSchema } from "./tool-ceiling.js";
|
|
14
14
|
|
|
15
|
-
// AN ACCESS PROFILE:
|
|
16
|
-
// kind of
|
|
17
|
-
//
|
|
18
|
-
// widening what
|
|
15
|
+
// AN ACCESS PROFILE: every limit there is, named and reusable (docs/architecture/access.md). One shape serves every
|
|
16
|
+
// kind of holder: a person holds one instead of answers of their own, a service (schemas/services.ts) holds one to
|
|
17
|
+
// narrow what it does for its steward, and a role card is held to every profile whose `roles` lists it. So an intern,
|
|
18
|
+
// the marketing bot and the Reviewer card can be pointed at the same thing, and widening what all three may spend is one
|
|
19
|
+
// edit. The card-to-profile link lives here, off the workspace, rather than on the card in the tracked roles.json:
|
|
20
|
+
// a conversation that could edit the file bounding it would be held to nothing.
|
|
19
21
|
// Every answer means what the same field on a roster row means (schemas/members.ts), absent included: absent areas is
|
|
20
22
|
// the whole workspace, absent credentials every one, absent AI accounts every one, absent tools no limit. `agents`,
|
|
21
|
-
// `edit`, `lands` and `assistants` are a person's answers and mean nothing for a service, which
|
|
23
|
+
// `edit`, `lands` and `assistants` are a person's answers and mean nothing for a service or a card, which drive no
|
|
24
|
+
// editor.
|
|
22
25
|
// A profile cannot make a maintainer: that tier holds the owner's operating authority and is granted to a person,
|
|
23
26
|
// never through something shared.
|
|
24
27
|
export const AccessProfileSchema = z.object({
|
|
@@ -46,12 +49,20 @@ export const AccessProfileSchema = z.object({
|
|
|
46
49
|
.max(500)
|
|
47
50
|
.optional()
|
|
48
51
|
.describe("The AI accounts its holders' turns may run on, `provider:account` or a provider alone. Absent means every one."),
|
|
49
|
-
tools: ToolCeilingSchema.optional().describe("The most its holders' turns' tools may be
|
|
52
|
+
tools: ToolCeilingSchema.optional().describe("The most its holders' turns' tools may be. Absent means no limit."),
|
|
50
53
|
assistants: z
|
|
51
54
|
.array(entryId)
|
|
52
55
|
.max(50)
|
|
53
56
|
.optional()
|
|
54
57
|
.describe("For a guest who chats: which assistants working in their areas they may talk to. Absent means every one that works there."),
|
|
58
|
+
// Added 2026-11-18, optional: the limits a card held on itself (its shelves, connector lists and folders) moved here.
|
|
59
|
+
roles: z
|
|
60
|
+
.array(entryId)
|
|
61
|
+
.max(100)
|
|
62
|
+
.optional()
|
|
63
|
+
.describe(
|
|
64
|
+
"The role cards held to it: a conversation wearing one reaches no more than this profile allows, whoever it acts for. A card listed by several profiles is held to all of them. Absent holds no card.",
|
|
65
|
+
),
|
|
55
66
|
});
|
|
56
67
|
export type AccessProfile = z.infer<typeof AccessProfileSchema>;
|
|
57
68
|
|
|
@@ -76,11 +87,11 @@ export const AccessProfileIdParamSchema = z.object({ id: entryId.describe("Which
|
|
|
76
87
|
// bring the platform's copy of their tier along (the daemon only enforces its own).
|
|
77
88
|
export const AccessProfileHolderSchema = z.object({
|
|
78
89
|
email: z.string().describe("Who holds it, lowercased."),
|
|
79
|
-
|
|
90
|
+
tier: GrantedTierSchema.exclude(["maintainer"]).describe("The tier the profile makes for them now."),
|
|
80
91
|
});
|
|
81
92
|
export const AccessProfileSavedSchema = z.object({
|
|
82
93
|
ok: z.literal(true),
|
|
83
|
-
holders: z.array(AccessProfileHolderSchema).describe("The people whose rows were rewritten, with the tier each now holds."),
|
|
94
|
+
holders: z.array(withLegacyTier(AccessProfileHolderSchema)).describe("The people whose rows were rewritten, with the tier each now holds."),
|
|
84
95
|
});
|
|
85
96
|
export type AccessProfileSaved = z.infer<typeof AccessProfileSavedSchema>;
|
|
86
97
|
|
package/src/schemas/agent.ts
CHANGED
|
@@ -149,7 +149,7 @@ const AgentTurnFieldsSchema = z.object({
|
|
|
149
149
|
),
|
|
150
150
|
// Distinct from `account` (who pays): whose name the turn posts as; absent means something different for each
|
|
151
151
|
// mode.
|
|
152
|
-
actsAs: entryId.optional().describe("Which
|
|
152
|
+
actsAs: entryId.optional().describe("Which role the turn speaks as out in the world. Not the same as which account pays for it."),
|
|
153
153
|
sessionId: z.string().optional().describe("Resume this provider session instead of starting a fresh one."),
|
|
154
154
|
// Stable id surviving provider/account/harness switches; keys the registry entry, the turn run, and the
|
|
155
155
|
// worktree when isolated.
|
|
@@ -164,13 +164,13 @@ const AgentTurnFieldsSchema = z.object({
|
|
|
164
164
|
.describe(
|
|
165
165
|
"Work in this conversation's own private copy of the repos rather than the shared tree, so several agents can work at once. Needs a conversation id.",
|
|
166
166
|
),
|
|
167
|
-
// Decided like `isolated`: the first turn's choice, latched. A
|
|
167
|
+
// Decided like `isolated`: the first turn's choice, latched. A role's own start folder wins over it.
|
|
168
168
|
startIn: z
|
|
169
169
|
.string()
|
|
170
170
|
.max(200)
|
|
171
171
|
.optional()
|
|
172
172
|
.describe(
|
|
173
|
-
"Which folder the conversation opens in, relative to the workspace root; the project it belongs to. Decided on the first turn. A
|
|
173
|
+
"Which folder the conversation opens in, relative to the workspace root; the project it belongs to. Decided on the first turn. A role that names its own start folder wins.",
|
|
174
174
|
),
|
|
175
175
|
// Decided like `isolated`: the request's choice on the first turn, the registry's after. `runner` implies
|
|
176
176
|
// isolation; absent means local.
|
|
@@ -220,7 +220,7 @@ const AgentTurnFieldsSchema = z.object({
|
|
|
220
220
|
.boolean()
|
|
221
221
|
.optional()
|
|
222
222
|
.describe(
|
|
223
|
-
"Nobody is watching this turn: a schedule, a queue or another agent started it and no chat is open on it. A card that needs a person is refused rather than raised, plan mode and the terminal hand-off are withheld, and the sandbox's signed-in accounts stay out of it unless a
|
|
223
|
+
"Nobody is watching this turn: a schedule, a queue or another agent started it and no chat is open on it. A card that needs a person is refused rather than raised, plan mode and the terminal hand-off are withheld, and the sandbox's signed-in accounts stay out of it unless a role carries them.",
|
|
224
224
|
),
|
|
225
225
|
// Outside content caused this turn, naming the source; distinct from `unattended` (whether anyone is watching).
|
|
226
226
|
outsideWake: z
|
package/src/schemas/agents.ts
CHANGED
|
@@ -333,12 +333,12 @@ export const AgentSummarySchema = z.object({
|
|
|
333
333
|
runner: z.string().optional().describe("The runner this conversation runs on. Absent means this sandbox."),
|
|
334
334
|
// Both latched at the first turn, so a board scoped to one project can say which conversations are its own.
|
|
335
335
|
startIn: z.string().optional().describe("Which folder it opened in, relative to the workspace root. Absent means the root."),
|
|
336
|
-
actsAs: z.string().optional().describe("Which
|
|
336
|
+
actsAs: z.string().optional().describe("Which role its first turn acted as. Absent for an ordinary chat."),
|
|
337
337
|
lastActsAs: z
|
|
338
338
|
.string()
|
|
339
339
|
.optional()
|
|
340
340
|
.describe(
|
|
341
|
-
"Which
|
|
341
|
+
"Which role its last turn acted as: each turn runs as the role it names, so this is who the conversation speaks as now, and what a view groups it under. Absent for an ordinary chat.",
|
|
342
342
|
),
|
|
343
343
|
// Per-conversation, so opening it restores its own choices rather than another tab's; `fast` here is what was asked
|
|
344
344
|
// for, not what was served.
|
package/src/schemas/approvals.ts
CHANGED
|
@@ -201,11 +201,11 @@ export const HookModuleSchema = z.object({
|
|
|
201
201
|
export type HookModule = z.infer<typeof HookModuleSchema>;
|
|
202
202
|
|
|
203
203
|
export const HookPluginSchema = z.object({
|
|
204
|
-
name: z.string().describe("The plugin, as the sandbox lists it: the connection, extension or
|
|
204
|
+
name: z.string().describe("The plugin, as the sandbox lists it: the connection, extension or role that brought it, or the name settings enable it under."),
|
|
205
205
|
from: z
|
|
206
|
-
.enum(["plugin", "extension", "
|
|
206
|
+
.enum(["plugin", "extension", "role", "skills", "settings"])
|
|
207
207
|
.describe(
|
|
208
|
-
"What brought it into the turn: a plugin connection, an extension, a
|
|
208
|
+
"What brought it into the turn: a plugin connection, an extension, a role's kit, a plugin folder among Claude Code's skills, or Claude Code's own settings enabling it.",
|
|
209
209
|
),
|
|
210
210
|
source: z
|
|
211
211
|
.enum(["user", "project"])
|
|
@@ -296,7 +296,7 @@ export const WebchatPendingSchema = z.object({
|
|
|
296
296
|
export type WebchatPending = z.infer<typeof WebchatPendingSchema>;
|
|
297
297
|
// Who may talk to a listener automation, and as whom. Matched on the ids a provider vouches for (a Discord user id, a
|
|
298
298
|
// Slack member id, a WhatsApp number, an e-mail address) or the groups it reports (Discord role ids), never on a display
|
|
299
|
-
// name, which the sender chooses. A rule's `actsAs` means exactly what the automation's does: absent is no
|
|
299
|
+
// name, which the sender chooses. A rule's `actsAs` means exactly what the automation's does: absent is no role,
|
|
300
300
|
// the full toolbox reaching no account, which is the whole agent an owner talks to themselves.
|
|
301
301
|
export const SenderRuleSchema = z
|
|
302
302
|
.object({
|
|
@@ -307,7 +307,7 @@ export const SenderRuleSchema = z
|
|
|
307
307
|
.max(50)
|
|
308
308
|
.optional()
|
|
309
309
|
.describe("Group ids the service reports on a sender, a Discord role. Only for a source whose messages carry them."),
|
|
310
|
-
actsAs: entryId.optional().describe("Which
|
|
310
|
+
actsAs: entryId.optional().describe("Which role their wakes speak as. Absent is no role: the full toolbox, reaching no account."),
|
|
311
311
|
// The service (schemas/services.ts) their wakes act as, in place of the automation's own: a narrower one for
|
|
312
312
|
// strangers, a wider one for people the owner trusts. Never more than that service's steward may.
|
|
313
313
|
runAs: entryId
|
|
@@ -375,8 +375,8 @@ export const AutomationSchema = z.object({
|
|
|
375
375
|
issues: IssuesConfigSchema.optional().describe(
|
|
376
376
|
"Settings for the bug reporter, for an automation that takes crash reports from your own sites and apps.",
|
|
377
377
|
),
|
|
378
|
-
// Narrows this job's toolbox further than its
|
|
379
|
-
// restore, a shelf the
|
|
378
|
+
// Narrows this job's toolbox further than its role allows; the composer enforces that it can only remove, never
|
|
379
|
+
// restore, a shelf the role switched off.
|
|
380
380
|
allowedTools: z
|
|
381
381
|
.array(z.string().min(1))
|
|
382
382
|
.optional()
|
|
@@ -403,18 +403,18 @@ export const AutomationSchema = z.object({
|
|
|
403
403
|
account: z.string().optional().describe("Which account pays for it."),
|
|
404
404
|
// Absent means the wake reaches no logged-in account at all, the strictest default here, since nobody is at the
|
|
405
405
|
// composer when it fires. Posture only: what the wake may reach is `runAs`'s (docs/architecture/access.md).
|
|
406
|
-
actsAs: entryId.optional().describe("Which
|
|
406
|
+
actsAs: entryId.optional().describe("Which role it speaks as. An unwatched turn naming none reaches no signed-in account at all."),
|
|
407
407
|
// Who its wakes act for (schemas/services.ts): that service's steward, held to the service's access profile. Absent
|
|
408
|
-
// keeps what a wake always did: it acts for the sandbox's owner with no profile, its
|
|
408
|
+
// keeps what a wake always did: it acts for the sandbox's owner with no profile, its role the only narrowing.
|
|
409
409
|
runAs: entryId
|
|
410
410
|
.optional()
|
|
411
411
|
.describe(
|
|
412
|
-
"Which service it acts as: whose authority its wakes use, held to that service's access profile. Absent means the sandbox's owner, limited only by its
|
|
412
|
+
"Which service it acts as: whose authority its wakes use, held to that service's access profile. Absent means the sandbox's owner, limited only by its role.",
|
|
413
413
|
),
|
|
414
414
|
// Listener triggers on a source that identifies senders only (TriggerSource.sender); refused elsewhere at upsert.
|
|
415
415
|
// Absent means everyone the filters admit, wearing `actsAs`.
|
|
416
416
|
senders: SendersSchema.optional().describe(
|
|
417
|
-
"Who may talk to it, and as whom: rules by sender id or group, each naming the
|
|
417
|
+
"Who may talk to it, and as whom: rules by sender id or group, each naming the role those people get, plus what everyone else gets. Absent admits everyone the trigger's filters do.",
|
|
418
418
|
),
|
|
419
419
|
// Held in the approvals queue rather than run; only a person releases it.
|
|
420
420
|
requireApproval: z.boolean().optional().describe("Hold every fire for a person instead of running it. Only a person can release one of those."),
|
|
@@ -427,7 +427,7 @@ export const AutomationSchema = z.object({
|
|
|
427
427
|
.boolean()
|
|
428
428
|
.optional()
|
|
429
429
|
.describe("This automation is a maintenance job, which is what files it under chores rather than among ordinary automations."),
|
|
430
|
-
// Pure filing, like `chore`: the daemon never reads it. Absent, the panel files it by its
|
|
430
|
+
// Pure filing, like `chore`: the daemon never reads it. Absent, the panel files it by its role instead, so a set
|
|
431
431
|
// of jobs one role runs reads as one shelf without anybody naming it.
|
|
432
432
|
group: z
|
|
433
433
|
.string()
|
|
@@ -435,7 +435,7 @@ export const AutomationSchema = z.object({
|
|
|
435
435
|
.max(40)
|
|
436
436
|
.optional()
|
|
437
437
|
.describe(
|
|
438
|
-
"Which shelf of the Automations panel it is filed on, like 'Marketing' or 'Releases'. Automations naming the same group are listed together. Absent files it under its
|
|
438
|
+
"Which shelf of the Automations panel it is filed on, like 'Marketing' or 'Releases'. Automations naming the same group are listed together. Absent files it under its role, or with the code chores.",
|
|
439
439
|
),
|
|
440
440
|
enabled: z.boolean().describe("Whether it fires at all."),
|
|
441
441
|
// Stamped by the sandbox on its first save (automation-save.ts), whatever a request sends: who its notices are for.
|
|
@@ -476,12 +476,12 @@ export const AutomationApprovalSchema = z.object({
|
|
|
476
476
|
),
|
|
477
477
|
sessionId: z.string().optional().describe("The provider session that thread last ran on."),
|
|
478
478
|
// The thread-sessions key the message arrived on, so the approved run settles the same thread; not derivable from
|
|
479
|
-
// `origin`, since a thread is also keyed by the
|
|
479
|
+
// `origin`, since a thread is also keyed by the role the sender's lane resolved to.
|
|
480
480
|
thread: z.string().optional().describe("Which inbound thread this belongs to, so the approved run continues that thread's memory rather than a fresh one."),
|
|
481
|
-
// The
|
|
481
|
+
// The role the fire resolved to (a sender rule's, or the automation's), snapshotted at hold time and worn by the
|
|
482
482
|
// approved run; also what a project-scoped board files the wake under.
|
|
483
|
-
actsAs: entryId.optional().describe("Which
|
|
484
|
-
// The service the fire resolved to (a sender rule's, or the automation's), snapshotted beside the
|
|
483
|
+
actsAs: entryId.optional().describe("Which role the approved run speaks as, decided when it was held."),
|
|
484
|
+
// The service the fire resolved to (a sender rule's, or the automation's), snapshotted beside the role.
|
|
485
485
|
runAs: entryId.optional().describe("Which service the approved run acts as, decided when it was held."),
|
|
486
486
|
createdAt: z.number().describe("When it started waiting, in milliseconds."),
|
|
487
487
|
// When the daemon may run this itself, for a `holdForSeconds` hold; absent for a `requireApproval` hold, which only
|
|
@@ -146,7 +146,7 @@ export const BrowserConfigSchema = z
|
|
|
146
146
|
})
|
|
147
147
|
.catchall(z.string());
|
|
148
148
|
// One email identity the sandbox acts as online: one persisted Chromium profile, signed in once by the owner, that
|
|
149
|
-
// every browser account naming it in `identity` shares. A capability, not a
|
|
149
|
+
// every browser account naming it in `identity` shares. A capability, not a role, since it holds live secrets (email
|
|
150
150
|
// password, profile identity) that must never be committed to git. `mailbox` feeds the code-reading tool;
|
|
151
151
|
// `openAccounts` is the explicit, off-by-default consent to sign up unattended.
|
|
152
152
|
export const IdentityConfigSchema = z.object({
|