@capybara-hq/kernel 0.1.0-rc.54 → 0.1.0-rc.55

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.
Files changed (154) hide show
  1. package/dist/admin/admin.schemas.d.ts +11 -1
  2. package/dist/catalog/catalog.module.js +1 -1
  3. package/dist/catalog/marketplaces.service.d.ts +1 -1
  4. package/dist/catalog/requests.service.d.ts +5 -5
  5. package/dist/catalog/requests.service.js +9 -9
  6. package/dist/channels/cards.d.ts +4 -3
  7. package/dist/channels/cards.js +25 -16
  8. package/dist/channels/phrases.d.ts +15 -4
  9. package/dist/channels/phrases.js +15 -1
  10. package/dist/config/load.d.ts +26 -7
  11. package/dist/config/load.js +60 -9
  12. package/dist/config/permission-migration.d.ts +17 -9
  13. package/dist/config/permission-migration.js +60 -9
  14. package/dist/config/schema.d.ts +11 -1
  15. package/dist/config/schema.js +37 -11
  16. package/dist/conversations/events.d.ts +247 -5
  17. package/dist/conversations/events.js +127 -16
  18. package/dist/conversations/permission-profiles.controller.d.ts +12 -2
  19. package/dist/conversations/permission-profiles.service.d.ts +12 -2
  20. package/dist/conversations/permission-profiles.service.js +11 -4
  21. package/dist/db/kernel-schema.d.ts +8 -2
  22. package/dist/devices/device-projects.service.d.ts +1 -1
  23. package/dist/devices/device-projects.service.js +6 -6
  24. package/dist/devices/devices.controller.d.ts +10 -8
  25. package/dist/devices/devices.controller.js +14 -18
  26. package/dist/devices/devices.schemas.d.ts +5 -5
  27. package/dist/devices/devices.schemas.js +5 -5
  28. package/dist/devices/devices.service.d.ts +188 -175
  29. package/dist/devices/devices.service.js +284 -292
  30. package/dist/devices/dto.d.ts +43 -23
  31. package/dist/devices/dto.js +45 -49
  32. package/dist/devices/project-rules.d.ts +0 -10
  33. package/dist/devices/project-rules.js +0 -5
  34. package/dist/errors.d.ts +24 -19
  35. package/dist/errors.js +24 -19
  36. package/dist/evals/reconstruct.d.ts +12 -3
  37. package/dist/evals/reconstruct.js +10 -6
  38. package/dist/evals/recorded-permission-context.d.ts +6 -4
  39. package/dist/evals/recorded-permission-context.js +15 -9
  40. package/dist/evals/run-replay.d.ts +6 -1
  41. package/dist/evals/run-replay.js +7 -2
  42. package/dist/evals/worker.js +3 -1
  43. package/dist/identity/settings.d.ts +45 -18
  44. package/dist/identity/settings.js +151 -51
  45. package/dist/infra/config/kernel-config.service.d.ts +1 -1
  46. package/dist/infra/config/kernel-config.service.js +17 -5
  47. package/dist/local-devices/device-auth.controller.d.ts +1 -1
  48. package/dist/local-devices/device-auth.controller.js +1 -1
  49. package/dist/local-devices/device-auth.d.ts +4 -4
  50. package/dist/local-devices/device-auth.js +1 -1
  51. package/dist/local-devices/device-policy.service.d.ts +18 -9
  52. package/dist/local-devices/device-policy.service.js +21 -61
  53. package/dist/local-devices/device-routes.d.ts +3 -1
  54. package/dist/local-devices/device-routes.js +15 -4
  55. package/dist/local-devices/instance-bindings.js +5 -2
  56. package/dist/local-devices/local-device-gateway.d.ts +2 -2
  57. package/dist/local-devices/local-device-gateway.js +3 -3
  58. package/dist/local-devices/local-device-provider.d.ts +4 -4
  59. package/dist/local-devices/local-device-provider.js +23 -9
  60. package/dist/local-devices/local-devices.module.d.ts +1 -1
  61. package/dist/local-devices/local-devices.module.js +1 -1
  62. package/dist/local-devices/machines.d.ts +40 -16
  63. package/dist/local-devices/machines.js +89 -61
  64. package/dist/local-devices/owner-report.d.ts +16 -14
  65. package/dist/local-devices/owner-report.js +24 -30
  66. package/dist/local-devices/owner-reports.js +26 -8
  67. package/dist/local-devices/policy-summary.d.ts +25 -44
  68. package/dist/local-devices/policy-summary.js +26 -71
  69. package/dist/local-devices/relay.d.ts +6 -6
  70. package/dist/local-devices/relay.js +10 -8
  71. package/dist/net/public-address.d.ts +1 -1
  72. package/dist/net/public-address.js +5 -2
  73. package/dist/orgs/device-network-setting.d.ts +82 -0
  74. package/dist/orgs/device-network-setting.js +142 -0
  75. package/dist/orgs/settings.service.d.ts +103 -66
  76. package/dist/orgs/settings.service.js +201 -137
  77. package/dist/overrides.d.ts +5 -1
  78. package/dist/overrides.js +2 -0
  79. package/dist/platform/exclusions.js +1 -1
  80. package/dist/platform/operation.js +1 -1
  81. package/dist/platform/ops/admin.ops.js +20 -11
  82. package/dist/platform/ops/devices.ops.js +70 -5
  83. package/dist/platform/ops/org-settings.ops.js +10 -6
  84. package/dist/platform/ops/orgs.ops.js +2 -1
  85. package/dist/runtime/context/permission-profile.d.ts +17 -8
  86. package/dist/runtime/context/permission-profile.js +126 -45
  87. package/dist/runtime/permission-context.service.d.ts +1 -1
  88. package/dist/runtime/permission-context.service.js +5 -3
  89. package/dist/runtime/project/knowledge.d.ts +5 -4
  90. package/dist/runtime/project/knowledge.js +2 -1
  91. package/dist/runtime/project/knowledge.service.js +16 -13
  92. package/dist/sandbox/cloud-permission-snapshot.js +22 -3
  93. package/dist/sandbox/device-sandbox-settings.d.ts +230 -0
  94. package/dist/sandbox/device-sandbox-settings.js +470 -0
  95. package/dist/sandbox/device-sandbox.d.ts +187 -0
  96. package/dist/sandbox/device-sandbox.js +236 -0
  97. package/dist/sandbox/held-operations.js +15 -7
  98. package/dist/sandbox/modes.d.ts +49 -24
  99. package/dist/sandbox/modes.js +27 -19
  100. package/dist/sandbox/operation-authority-types.d.ts +6 -5
  101. package/dist/sandbox/operation-authority-types.js +7 -8
  102. package/dist/sandbox/operation-authority.d.ts +23 -9
  103. package/dist/sandbox/operation-authority.js +179 -97
  104. package/dist/sandbox/permission-auto-grants.d.ts +42 -0
  105. package/dist/sandbox/permission-auto-grants.js +145 -0
  106. package/dist/sandbox/permission-call-grants.d.ts +12 -4
  107. package/dist/sandbox/permission-call-grants.js +84 -35
  108. package/dist/sandbox/permission-call-grants.module.js +10 -3
  109. package/dist/sandbox/permission-call-types.d.ts +39 -5
  110. package/dist/sandbox/permission-ceiling-writes.d.ts +29 -3
  111. package/dist/sandbox/permission-ceiling-writes.js +38 -4
  112. package/dist/sandbox/permission-config-publication.d.ts +44 -2
  113. package/dist/sandbox/permission-config-publication.js +230 -59
  114. package/dist/sandbox/permission-context-types.d.ts +2 -2
  115. package/dist/sandbox/permission-facts.d.ts +144 -15
  116. package/dist/sandbox/permission-facts.js +258 -70
  117. package/dist/sandbox/permission-runtime-reports.d.ts +5 -4
  118. package/dist/sandbox/permission-runtime-reports.js +19 -29
  119. package/dist/sandbox/review/classifier.d.ts +8 -0
  120. package/dist/sandbox/review/classifier.js +10 -0
  121. package/dist/sandbox/review/permission-candidate.d.ts +69 -5
  122. package/dist/sandbox/review/permission-candidate.js +153 -30
  123. package/dist/sandbox/review/review.service.d.ts +19 -3
  124. package/dist/sandbox/review/review.service.js +59 -11
  125. package/dist/sandbox/review/rules.js +23 -3
  126. package/dist/sandbox/sandbox.service.d.ts +29 -11
  127. package/dist/sandbox/sandbox.service.js +51 -26
  128. package/dist/skills/invoke.js +3 -2
  129. package/dist/tools/approvals.service.d.ts +26 -116
  130. package/dist/tools/approvals.service.js +42 -346
  131. package/dist/tools/builtins/sandbox/bash.d.ts +16 -3
  132. package/dist/tools/builtins/sandbox/bash.js +80 -28
  133. package/dist/tools/builtins/sandbox/common.d.ts +39 -14
  134. package/dist/tools/builtins/sandbox/common.js +47 -24
  135. package/dist/tools/builtins/sandbox/deliver.js +7 -4
  136. package/dist/tools/builtins/skill-load.d.ts +2 -2
  137. package/dist/tools/builtins/skill-load.js +4 -3
  138. package/dist/tools/device-op-resolver.d.ts +4 -10
  139. package/dist/tools/device-op-resolver.js +8 -19
  140. package/dist/tools/network-asks.d.ts +52 -15
  141. package/dist/tools/network-asks.js +55 -25
  142. package/dist/tools/pipeline.d.ts +26 -14
  143. package/dist/tools/pipeline.js +144 -61
  144. package/dist/tools/registry.d.ts +6 -0
  145. package/dist/tools/tools.module.js +1 -1
  146. package/package.json +4 -4
  147. package/src/migrations/0165_device_network_columns.sql +50 -0
  148. package/src/migrations/0166_permission_grant_full_access.sql +17 -0
  149. package/src/migrations/0167_device_network_backfill.sql +32 -0
  150. package/src/migrations/0168_binding_installed_connection.sql +6 -0
  151. package/dist/orgs/cloud-network-setting.d.ts +0 -33
  152. package/dist/orgs/cloud-network-setting.js +0 -47
  153. package/dist/sandbox/platform-full-access.d.ts +0 -110
  154. package/dist/sandbox/platform-full-access.js +0 -198
@@ -271,10 +271,20 @@ export declare const KernelConfigSchema: z.ZodObject<{
271
271
  }, z.core.$strict>>;
272
272
  }, z.core.$strict>>;
273
273
  devices: z.ZodPrefault<z.ZodObject<{
274
- fullAccess: z.ZodOptional<z.ZodEnum<{
274
+ outsideSandbox: z.ZodOptional<z.ZodEnum<{
275
275
  allowed: "allowed";
276
276
  off: "off";
277
277
  }>>;
278
+ network: z.ZodPrefault<z.ZodObject<{
279
+ default: z.ZodOptional<z.ZodEnum<{
280
+ allowlist: "allowlist";
281
+ open: "open";
282
+ }>>;
283
+ ceiling: z.ZodOptional<z.ZodEnum<{
284
+ allowlist: "allowlist";
285
+ open: "open";
286
+ }>>;
287
+ }, z.core.$strict>>;
278
288
  maxPersonal: z.ZodDefault<z.ZodNumber>;
279
289
  local: z.ZodPrefault<z.ZodObject<{
280
290
  reconnectGraceSeconds: z.ZodDefault<z.ZodNumber>;
@@ -1579,7 +1579,7 @@ export const KernelConfigSchema = z.strictObject({
1579
1579
  egress: z
1580
1580
  .enum(["none", "allowlist"], {
1581
1581
  error: (iss) => iss.input === "open"
1582
- ? 'sandbox.limits.egress does not take "open": the open public network is set by devices.fullAccess and an organization\'s cloudNetwork; use "allowlist" or "none"'
1582
+ ? 'sandbox.limits.egress does not take "open": the open public network is set by devices.network and an organization\'s deviceNetwork; use "allowlist" or "none"'
1583
1583
  : undefined,
1584
1584
  })
1585
1585
  .default("allowlist")
@@ -1603,7 +1603,7 @@ export const KernelConfigSchema = z.strictObject({
1603
1603
  .enum(["extend", "within"])
1604
1604
  .default("extend")
1605
1605
  .meta(meta({
1606
- description: "Whether organizations may go beyond allowHosts in sandbox mode: extend (the default: an organization may use the open cloud network and add hosts, and its admins approve network requests) or within (allowHosts is the ceiling: an organization's cloud network in sandbox mode is the allowlist, and it may only keep or drop hosts the list covers; only a super admin adds others). Auto mode is not limited by it: devices.fullAccess governs Full permission's open network, so set devices.fullAccess off as well for a hard ceiling",
1606
+ description: "Whether organizations may go beyond allowHosts: extend (the default: an organization may add hosts of its own, and its admins approve network requests) or within (allowHosts is the ceiling: an organization's list may only keep or drop hosts the list covers; only a super admin adds others). It limits the hosts of the allowlist only: devices.network.ceiling decides whether devices may use the open network, so set it to allowlist as well for a hard ceiling",
1607
1607
  })),
1608
1608
  })
1609
1609
  .prefault({}),
@@ -1612,21 +1612,47 @@ export const KernelConfigSchema = z.strictObject({
1612
1612
  devices: z
1613
1613
  .strictObject({
1614
1614
  /**
1615
- * The platform's Full permission switch (permission runtime cutover B1): whether a device's
1616
- * owner ceiling may allow Full permission. Also a deployment setting the super admin changes
1617
- * in the admin console (`devicesFullAccess`); the startup config wins over it, so this field
1618
- * is optional with no schema default (the default `allowed` is applied by
1619
- * `readDevicesFullAccess`: a schema default would be indistinguishable from a value the config
1620
- * source set). The old key `devices.autoMode` (`CAPYBARA_DEVICES__AUTO_MODE`) is refused with
1621
- * the conversion message (`config/load.ts`).
1615
+ * The platform's outside-sandbox ceiling (approval-only profiles design, "Settings model"):
1616
+ * whether any device may be granted a per-call escalation outside its sandbox. Also a
1617
+ * deployment setting the super admin changes in the admin console (`devicesOutsideSandbox`);
1618
+ * the startup config wins over it, so this field is optional with no schema default (the
1619
+ * default `allowed` is applied by `readDeviceSandboxSettings`: a schema default would be
1620
+ * indistinguishable from a value the config source set). The old keys `devices.fullAccess`
1621
+ * and `devices.autoMode` are refused with the conversion message (`config/load.ts`).
1622
1622
  */
1623
- fullAccess: z
1623
+ outsideSandbox: z
1624
1624
  .enum(["allowed", "off"])
1625
1625
  .optional()
1626
1626
  .meta(meta({
1627
1627
  hot: true,
1628
- description: "Whether devices may run with Full permission (default allowed): a device whose owner allows Full may then run a conversation with Full permission; a cloud device on Full reaches the open public network (private and internal addresses blocked) unless sandbox.limits.egress is none. When off, devices run restricted: local devices on their allowlist, cloud devices on their organization's cloud network (cloudNetwork). An organization may turn it off and follow the platform. Set here, it is read-only in the admin console. Replaces devices.autoMode (CAPYBARA_DEVICES__AUTO_MODE), which is refused: rename it (the same values), or convert a config file with capybara config migrate-permissions",
1628
+ description: "Whether a device may be granted running a call outside its sandbox (default allowed): a person, the review model or Full access then approves such an escalation per call, within the organization's and the device owner's settings; off refuses every escalation, and devices only run in their sandbox. An organization may turn it off and follow the platform. Set here, it is read-only in the admin console. Replaces devices.fullAccess (CAPYBARA_DEVICES__FULL_ACCESS) and devices.autoMode, which are refused: rename them (the same values; off also needs devices.network.ceiling: allowlist to keep devices on the allowlist), or convert a config file with capybara config migrate-permissions",
1629
1629
  })),
1630
+ /**
1631
+ * The platform's device sandbox network (approval-only profiles design, "Settings model"):
1632
+ * the default mode and the widest mode an org or device may choose, `open` (the public
1633
+ * internet; private, loopback and metadata addresses closed) or `allowlist`. Optional with
1634
+ * no schema default, like `outsideSandbox`: the admin console's choice applies when unset
1635
+ * (`devicesNetwork`), else `open`. A default above the ceiling of the same source is refused
1636
+ * (`config/load.ts`); across sources the reader clamps the default to the ceiling.
1637
+ */
1638
+ network: z
1639
+ .strictObject({
1640
+ default: z
1641
+ .enum(["open", "allowlist"])
1642
+ .optional()
1643
+ .meta(meta({
1644
+ hot: true,
1645
+ description: "The sandbox network a device gets when neither its organization nor its owner chooses one (default open): open is the public internet, with private, loopback, link-local and cloud metadata addresses closed; allowlist is only the hosts of sandbox.limits.allowHosts and the organization's list. Never wider than devices.network.ceiling. Set here, it is read-only in the admin console",
1646
+ })),
1647
+ ceiling: z
1648
+ .enum(["open", "allowlist"])
1649
+ .optional()
1650
+ .meta(meta({
1651
+ hot: true,
1652
+ description: "The widest sandbox network an organization or a device may choose (default open). Set it to allowlist for egress control: every device then reaches only the hosts of sandbox.limits.allowHosts and its organization's list. Set here, it is read-only in the admin console",
1653
+ })),
1654
+ })
1655
+ .prefault({}),
1630
1656
  maxPersonal: z
1631
1657
  .number()
1632
1658
  .int()
@@ -9,9 +9,49 @@ export declare function permissionCodePointCompare(a: string, b: string): number
9
9
  */
10
10
  export declare const ACTOR_DEVICE_ACCESS_REASON = "This run's actor cannot use the selected device";
11
11
  export declare const ACTOR_NOT_DEVICE_OWNER_REASON = "The selected device belongs to the conversation's owner, and this run's account is not its owner, so this run continues without the device";
12
- /** Complete recorded facts, never a grant or a requested-but-unverified scope. */
13
- export declare const PermissionContextV1Schema: z.ZodObject<{
14
- version: z.ZodLiteral<1>;
12
+ /**
13
+ * The `sandbox` block of permission context version 2 (approval-only profiles design, "Replay and
14
+ * permission context"): the device sandbox, the same under every profile.
15
+ */
16
+ export declare const PermissionContextSandboxSchema: z.ZodObject<{
17
+ boundary: z.ZodEnum<{
18
+ instance: "instance";
19
+ operation: "operation";
20
+ }>;
21
+ location: z.ZodEnum<{
22
+ cloud: "cloud";
23
+ local: "local";
24
+ }>;
25
+ workingRoot: z.ZodString;
26
+ network: z.ZodObject<{
27
+ kind: z.ZodEnum<{
28
+ allowlist: "allowlist";
29
+ none: "none";
30
+ "open-public": "open-public";
31
+ }>;
32
+ hostsCount: z.ZodNumber;
33
+ }, z.core.$strict>;
34
+ outsideSandbox: z.ZodBoolean;
35
+ outerNetwork: z.ZodDiscriminatedUnion<[z.ZodObject<{
36
+ kind: z.ZodLiteral<"host-environment">;
37
+ }, z.core.$strict>, z.ZodObject<{
38
+ kind: z.ZodLiteral<"none">;
39
+ }, z.core.$strict>, z.ZodObject<{
40
+ kind: z.ZodLiteral<"open-public">;
41
+ }, z.core.$strict>, z.ZodObject<{
42
+ kind: z.ZodLiteral<"allowlist">;
43
+ hosts: z.ZodArray<z.ZodString>;
44
+ }, z.core.$strict>], "kind">;
45
+ perCallHosts: z.ZodOptional<z.ZodBoolean>;
46
+ }, z.core.$strict>;
47
+ export type PermissionContextSandbox = z.infer<typeof PermissionContextSandboxSchema>;
48
+ /**
49
+ * Complete recorded facts, never a grant or a requested-but-unverified scope. Version 2
50
+ * (approval-only profiles design) adds the device `sandbox` block, the same under every profile:
51
+ * a profile only chooses who approves a crossing, so Full access records a scoped sandbox too.
52
+ */
53
+ export declare const PermissionContextV2Schema: z.ZodObject<{
54
+ version: z.ZodLiteral<2>;
15
55
  rootConversationId: z.ZodString;
16
56
  profileRevision: z.ZodNullable<z.ZodNumber>;
17
57
  selectedProfile: z.ZodNullable<z.ZodCustom<PermissionProfile, PermissionProfile>>;
@@ -60,6 +100,8 @@ export declare const PermissionContextV1Schema: z.ZodObject<{
60
100
  }, z.core.$strict>, z.ZodObject<{
61
101
  kind: z.ZodLiteral<"allowlist">;
62
102
  hosts: z.ZodArray<z.ZodString>;
103
+ }, z.core.$strict>, z.ZodObject<{
104
+ kind: z.ZodLiteral<"open-public">;
63
105
  }, z.core.$strict>], "kind">;
64
106
  outerNetwork: z.ZodDiscriminatedUnion<[z.ZodObject<{
65
107
  kind: z.ZodLiteral<"host-environment">;
@@ -72,8 +114,142 @@ export declare const PermissionContextV1Schema: z.ZodObject<{
72
114
  hosts: z.ZodArray<z.ZodString>;
73
115
  }, z.core.$strict>], "kind">;
74
116
  }, z.core.$strict>>;
117
+ sandbox: z.ZodNullable<z.ZodObject<{
118
+ boundary: z.ZodEnum<{
119
+ instance: "instance";
120
+ operation: "operation";
121
+ }>;
122
+ location: z.ZodEnum<{
123
+ cloud: "cloud";
124
+ local: "local";
125
+ }>;
126
+ workingRoot: z.ZodString;
127
+ network: z.ZodObject<{
128
+ kind: z.ZodEnum<{
129
+ allowlist: "allowlist";
130
+ none: "none";
131
+ "open-public": "open-public";
132
+ }>;
133
+ hostsCount: z.ZodNumber;
134
+ }, z.core.$strict>;
135
+ outsideSandbox: z.ZodBoolean;
136
+ outerNetwork: z.ZodDiscriminatedUnion<[z.ZodObject<{
137
+ kind: z.ZodLiteral<"host-environment">;
138
+ }, z.core.$strict>, z.ZodObject<{
139
+ kind: z.ZodLiteral<"none">;
140
+ }, z.core.$strict>, z.ZodObject<{
141
+ kind: z.ZodLiteral<"open-public">;
142
+ }, z.core.$strict>, z.ZodObject<{
143
+ kind: z.ZodLiteral<"allowlist">;
144
+ hosts: z.ZodArray<z.ZodString>;
145
+ }, z.core.$strict>], "kind">;
146
+ perCallHosts: z.ZodOptional<z.ZodBoolean>;
147
+ }, z.core.$strict>>;
75
148
  }, z.core.$strict>;
76
- export type PermissionContextV1 = z.infer<typeof PermissionContextV1Schema>;
149
+ export type PermissionContextV2 = z.infer<typeof PermissionContextV2Schema>;
150
+ /**
151
+ * Reads a recorded payload as version 2. Stored v1 rows exist on deployments and the log is never
152
+ * rewritten: a v1 payload (`version: 1`, never a `sandbox` key) reads as v2 with `sandbox: null`,
153
+ * which v2 accepts under exactly v1's rules. Anything else is left for the v2 schema to judge.
154
+ */
155
+ export declare function upconvertPermissionContext(payload: unknown): unknown;
156
+ /** A recorded `permission_context` payload as every reader parses it (v1 up-converted). */
157
+ export declare const RecordedPermissionContextSchema: z.ZodPreprocess<z.ZodObject<{
158
+ version: z.ZodLiteral<2>;
159
+ rootConversationId: z.ZodString;
160
+ profileRevision: z.ZodNullable<z.ZodNumber>;
161
+ selectedProfile: z.ZodNullable<z.ZodCustom<PermissionProfile, PermissionProfile>>;
162
+ effectiveProfile: z.ZodNullable<z.ZodCustom<PermissionProfile, PermissionProfile>>;
163
+ execution: z.ZodEnum<{
164
+ interactive: "interactive";
165
+ scheduled: "scheduled";
166
+ }>;
167
+ inherited: z.ZodBoolean;
168
+ deviceId: z.ZodNullable<z.ZodString>;
169
+ scopeRevision: z.ZodNullable<z.ZodString>;
170
+ authorityRevision: z.ZodNullable<z.ZodString>;
171
+ availability: z.ZodDiscriminatedUnion<[z.ZodObject<{
172
+ state: z.ZodLiteral<"supported">;
173
+ }, z.core.$strict>, z.ZodObject<{
174
+ state: z.ZodEnum<{
175
+ unprobed: "unprobed";
176
+ unsupported: "unsupported";
177
+ }>;
178
+ reason: z.ZodString;
179
+ }, z.core.$strict>, z.ZodObject<{
180
+ state: z.ZodLiteral<"unavailable">;
181
+ cause: z.ZodEnum<{
182
+ "actor-device-access": "actor-device-access";
183
+ "no-device": "no-device";
184
+ }>;
185
+ reason: z.ZodString;
186
+ }, z.core.$strict>], "state">;
187
+ scope: z.ZodNullable<z.ZodObject<{
188
+ location: z.ZodEnum<{
189
+ cloud: "cloud";
190
+ local: "local";
191
+ }>;
192
+ workingRoot: z.ZodString;
193
+ filesystem: z.ZodDiscriminatedUnion<[z.ZodObject<{
194
+ kind: z.ZodLiteral<"device">;
195
+ }, z.core.$strict>, z.ZodObject<{
196
+ kind: z.ZodLiteral<"scoped">;
197
+ readDirectories: z.ZodArray<z.ZodString>;
198
+ writeDirectories: z.ZodArray<z.ZodString>;
199
+ }, z.core.$strict>], "kind">;
200
+ network: z.ZodDiscriminatedUnion<[z.ZodObject<{
201
+ kind: z.ZodLiteral<"none">;
202
+ }, z.core.$strict>, z.ZodObject<{
203
+ kind: z.ZodLiteral<"environment">;
204
+ }, z.core.$strict>, z.ZodObject<{
205
+ kind: z.ZodLiteral<"allowlist">;
206
+ hosts: z.ZodArray<z.ZodString>;
207
+ }, z.core.$strict>, z.ZodObject<{
208
+ kind: z.ZodLiteral<"open-public">;
209
+ }, z.core.$strict>], "kind">;
210
+ outerNetwork: z.ZodDiscriminatedUnion<[z.ZodObject<{
211
+ kind: z.ZodLiteral<"host-environment">;
212
+ }, z.core.$strict>, z.ZodObject<{
213
+ kind: z.ZodLiteral<"none">;
214
+ }, z.core.$strict>, z.ZodObject<{
215
+ kind: z.ZodLiteral<"open-public">;
216
+ }, z.core.$strict>, z.ZodObject<{
217
+ kind: z.ZodLiteral<"allowlist">;
218
+ hosts: z.ZodArray<z.ZodString>;
219
+ }, z.core.$strict>], "kind">;
220
+ }, z.core.$strict>>;
221
+ sandbox: z.ZodNullable<z.ZodObject<{
222
+ boundary: z.ZodEnum<{
223
+ instance: "instance";
224
+ operation: "operation";
225
+ }>;
226
+ location: z.ZodEnum<{
227
+ cloud: "cloud";
228
+ local: "local";
229
+ }>;
230
+ workingRoot: z.ZodString;
231
+ network: z.ZodObject<{
232
+ kind: z.ZodEnum<{
233
+ allowlist: "allowlist";
234
+ none: "none";
235
+ "open-public": "open-public";
236
+ }>;
237
+ hostsCount: z.ZodNumber;
238
+ }, z.core.$strict>;
239
+ outsideSandbox: z.ZodBoolean;
240
+ outerNetwork: z.ZodDiscriminatedUnion<[z.ZodObject<{
241
+ kind: z.ZodLiteral<"host-environment">;
242
+ }, z.core.$strict>, z.ZodObject<{
243
+ kind: z.ZodLiteral<"none">;
244
+ }, z.core.$strict>, z.ZodObject<{
245
+ kind: z.ZodLiteral<"open-public">;
246
+ }, z.core.$strict>, z.ZodObject<{
247
+ kind: z.ZodLiteral<"allowlist">;
248
+ hosts: z.ZodArray<z.ZodString>;
249
+ }, z.core.$strict>], "kind">;
250
+ perCallHosts: z.ZodOptional<z.ZodBoolean>;
251
+ }, z.core.$strict>>;
252
+ }, z.core.$strict>, unknown>;
77
253
  export declare const ManagedDevicePathsV1Schema: z.ZodObject<{
78
254
  permissionContextVersion: z.ZodLiteral<1>;
79
255
  deviceId: z.ZodString;
@@ -89,6 +265,7 @@ export declare const PermissionContextMetaV1Schema: z.ZodObject<{
89
265
  version: z.ZodLiteral<1>;
90
266
  contextSeq: z.ZodNullable<z.ZodNumber>;
91
267
  hash: z.ZodString;
268
+ sandbox: z.ZodOptional<z.ZodString>;
92
269
  }, z.core.$strict>;
93
270
  export type PermissionContextMetaV1 = z.infer<typeof PermissionContextMetaV1Schema>;
94
271
  /** The most hosts one network ask (and one `network_blocked` event) lists. */
@@ -188,6 +365,12 @@ export declare const ReviewRecordSchema: z.ZodObject<{
188
365
  }>>;
189
366
  commandHash: z.ZodOptional<z.ZodString>;
190
367
  sandbox: z.ZodOptional<z.ZodLiteral<"escalated">>;
368
+ crossing: z.ZodOptional<z.ZodEnum<{
369
+ directory: "directory";
370
+ host: "host";
371
+ "outside-sandbox": "outside-sandbox";
372
+ sensitive: "sensitive";
373
+ }>>;
191
374
  }, z.core.$strict>;
192
375
  /** The display-only `approval_requested.command` facts of a `command` ask (auto mode spec §5.4). */
193
376
  export declare const CommandAskSchema: z.ZodObject<{
@@ -206,8 +389,14 @@ export declare const CommandAskSchema: z.ZodObject<{
206
389
  workingRoot: z.ZodOptional<z.ZodString>;
207
390
  kind: z.ZodEnum<{
208
391
  command: "command";
392
+ read: "read";
209
393
  write: "write";
210
394
  }>;
395
+ profile: z.ZodOptional<z.ZodEnum<{
396
+ "approve-for-me": "approve-for-me";
397
+ "full-access": "full-access";
398
+ "request-approval": "request-approval";
399
+ }>>;
211
400
  command: z.ZodString;
212
401
  path: z.ZodOptional<z.ZodString>;
213
402
  rule: z.ZodNullable<z.ZodString>;
@@ -455,7 +644,7 @@ export declare const PluginContextSchema: z.ZodObject<{
455
644
  export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
456
645
  type: z.ZodLiteral<"permission_context">;
457
646
  payload: z.ZodObject<{
458
- version: z.ZodLiteral<1>;
647
+ version: z.ZodLiteral<2>;
459
648
  rootConversationId: z.ZodString;
460
649
  profileRevision: z.ZodNullable<z.ZodNumber>;
461
650
  selectedProfile: z.ZodNullable<z.ZodCustom<PermissionProfile, PermissionProfile>>;
@@ -504,7 +693,39 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
504
693
  }, z.core.$strict>, z.ZodObject<{
505
694
  kind: z.ZodLiteral<"allowlist">;
506
695
  hosts: z.ZodArray<z.ZodString>;
696
+ }, z.core.$strict>, z.ZodObject<{
697
+ kind: z.ZodLiteral<"open-public">;
698
+ }, z.core.$strict>], "kind">;
699
+ outerNetwork: z.ZodDiscriminatedUnion<[z.ZodObject<{
700
+ kind: z.ZodLiteral<"host-environment">;
701
+ }, z.core.$strict>, z.ZodObject<{
702
+ kind: z.ZodLiteral<"none">;
703
+ }, z.core.$strict>, z.ZodObject<{
704
+ kind: z.ZodLiteral<"open-public">;
705
+ }, z.core.$strict>, z.ZodObject<{
706
+ kind: z.ZodLiteral<"allowlist">;
707
+ hosts: z.ZodArray<z.ZodString>;
507
708
  }, z.core.$strict>], "kind">;
709
+ }, z.core.$strict>>;
710
+ sandbox: z.ZodNullable<z.ZodObject<{
711
+ boundary: z.ZodEnum<{
712
+ instance: "instance";
713
+ operation: "operation";
714
+ }>;
715
+ location: z.ZodEnum<{
716
+ cloud: "cloud";
717
+ local: "local";
718
+ }>;
719
+ workingRoot: z.ZodString;
720
+ network: z.ZodObject<{
721
+ kind: z.ZodEnum<{
722
+ allowlist: "allowlist";
723
+ none: "none";
724
+ "open-public": "open-public";
725
+ }>;
726
+ hostsCount: z.ZodNumber;
727
+ }, z.core.$strict>;
728
+ outsideSandbox: z.ZodBoolean;
508
729
  outerNetwork: z.ZodDiscriminatedUnion<[z.ZodObject<{
509
730
  kind: z.ZodLiteral<"host-environment">;
510
731
  }, z.core.$strict>, z.ZodObject<{
@@ -515,6 +736,7 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
515
736
  kind: z.ZodLiteral<"allowlist">;
516
737
  hosts: z.ZodArray<z.ZodString>;
517
738
  }, z.core.$strict>], "kind">;
739
+ perCallHosts: z.ZodOptional<z.ZodBoolean>;
518
740
  }, z.core.$strict>>;
519
741
  }, z.core.$strict>;
520
742
  }, z.core.$strip>, z.ZodObject<{
@@ -564,9 +786,16 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
564
786
  }>;
565
787
  reason: z.ZodString;
566
788
  decisionSource: z.ZodEnum<{
789
+ "full-access": "full-access";
567
790
  "review-model": "review-model";
568
791
  rule: "rule";
569
792
  }>;
793
+ crossing: z.ZodOptional<z.ZodEnum<{
794
+ directory: "directory";
795
+ host: "host";
796
+ "outside-sandbox": "outside-sandbox";
797
+ }>>;
798
+ sensitive: z.ZodOptional<z.ZodArray<z.ZodString>>;
570
799
  }, z.core.$strip>;
571
800
  }, z.core.$strip>, z.ZodObject<{
572
801
  type: z.ZodLiteral<"permission_profile_changed">;
@@ -798,6 +1027,7 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
798
1027
  version: z.ZodLiteral<1>;
799
1028
  contextSeq: z.ZodNullable<z.ZodNumber>;
800
1029
  hash: z.ZodString;
1030
+ sandbox: z.ZodOptional<z.ZodString>;
801
1031
  }, z.core.$strict>>;
802
1032
  reminderSeqs: z.ZodArray<z.ZodNumber>;
803
1033
  maxOutputTokens: z.ZodNumber;
@@ -1133,6 +1363,12 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
1133
1363
  }>>;
1134
1364
  commandHash: z.ZodOptional<z.ZodString>;
1135
1365
  sandbox: z.ZodOptional<z.ZodLiteral<"escalated">>;
1366
+ crossing: z.ZodOptional<z.ZodEnum<{
1367
+ directory: "directory";
1368
+ host: "host";
1369
+ "outside-sandbox": "outside-sandbox";
1370
+ sensitive: "sensitive";
1371
+ }>>;
1136
1372
  }, z.core.$strict>>;
1137
1373
  loadedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1138
1374
  display: z.ZodOptional<z.ZodObject<{
@@ -1256,8 +1492,14 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
1256
1492
  workingRoot: z.ZodOptional<z.ZodString>;
1257
1493
  kind: z.ZodEnum<{
1258
1494
  command: "command";
1495
+ read: "read";
1259
1496
  write: "write";
1260
1497
  }>;
1498
+ profile: z.ZodOptional<z.ZodEnum<{
1499
+ "approve-for-me": "approve-for-me";
1500
+ "full-access": "full-access";
1501
+ "request-approval": "request-approval";
1502
+ }>>;
1261
1503
  command: z.ZodString;
1262
1504
  path: z.ZodOptional<z.ZodString>;
1263
1505
  rule: z.ZodNullable<z.ZodString>;