@capybara-hq/kernel 0.1.0-rc.41 → 0.1.0-rc.42
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/bootstrap.json +3 -3
- package/dist/admin/admin.schemas.d.ts +6 -0
- package/dist/admin/org-network.service.d.ts +3 -1
- package/dist/admin/org-network.service.js +10 -2
- package/dist/app.d.ts +4 -0
- package/dist/app.js +2 -0
- package/dist/background/finish.d.ts +9 -1
- package/dist/background/finish.js +57 -4
- package/dist/background/launch.d.ts +23 -0
- package/dist/background/launch.js +55 -1
- package/dist/background/managed-output.d.ts +110 -0
- package/dist/background/managed-output.js +219 -0
- package/dist/background/managed.d.ts +52 -0
- package/dist/background/managed.js +128 -0
- package/dist/background/poll.job.d.ts +35 -1
- package/dist/background/poll.job.js +174 -9
- package/dist/background/render.js +1 -0
- package/dist/background/retire-legacy-tasks.job.d.ts +57 -0
- package/dist/background/retire-legacy-tasks.job.js +149 -0
- package/dist/background/session.d.ts +15 -5
- package/dist/background/session.js +22 -6
- package/dist/background/stop.d.ts +35 -5
- package/dist/background/stop.js +94 -8
- package/dist/background/store.d.ts +110 -3
- package/dist/background/store.js +205 -3
- package/dist/background/tasks.service.d.ts +18 -1
- package/dist/background/tasks.service.js +99 -9
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/channels/cards.js +1 -1
- package/dist/channels/inbound.js +2 -0
- package/dist/channels/phrases.d.ts +4 -0
- package/dist/channels/phrases.js +4 -0
- package/dist/config/load.d.ts +18 -0
- package/dist/config/load.js +39 -1
- package/dist/config/permission-migration.d.ts +26 -0
- package/dist/config/permission-migration.js +64 -0
- package/dist/config/schema.d.ts +1 -1
- package/dist/config/schema.js +11 -10
- package/dist/conversations/conversations.controller.d.ts +1 -1
- package/dist/conversations/conversations.controller.js +1 -1
- package/dist/conversations/conversations.module.js +12 -0
- package/dist/conversations/conversations.service.d.ts +11 -2
- package/dist/conversations/conversations.service.js +97 -27
- package/dist/conversations/event-log.d.ts +1 -1
- package/dist/conversations/event-log.js +10 -2
- package/dist/conversations/events.d.ts +304 -4
- package/dist/conversations/events.js +279 -29
- package/dist/conversations/permission-profile-store.d.ts +50 -0
- package/dist/conversations/permission-profile-store.js +67 -0
- package/dist/conversations/permission-profile-store.module.d.ts +2 -0
- package/dist/conversations/permission-profile-store.module.js +19 -0
- package/dist/conversations/permission-profiles.controller.d.ts +84 -0
- package/dist/conversations/permission-profiles.controller.js +105 -0
- package/dist/conversations/permission-profiles.schemas.d.ts +31 -0
- package/dist/conversations/permission-profiles.schemas.js +23 -0
- package/dist/conversations/permission-profiles.service.d.ts +56 -0
- package/dist/conversations/permission-profiles.service.js +179 -0
- package/dist/db/kernel-schema.d.ts +238 -3
- package/dist/devices/access.js +1 -1
- package/dist/devices/access.module.d.ts +2 -0
- package/dist/devices/access.module.js +19 -0
- package/dist/devices/conversation-devices.d.ts +8 -29
- package/dist/devices/conversation-devices.js +37 -73
- package/dist/devices/device-projects.service.d.ts +26 -28
- package/dist/devices/device-projects.service.js +123 -127
- package/dist/devices/devices.controller.js +3 -1
- package/dist/devices/devices.module.js +11 -9
- package/dist/devices/devices.service.d.ts +116 -8
- package/dist/devices/devices.service.js +252 -20
- package/dist/devices/dto.d.ts +16 -0
- package/dist/devices/dto.js +34 -6
- package/dist/devices/errors.d.ts +8 -0
- package/dist/devices/errors.js +10 -0
- package/dist/devices/project-rules.d.ts +44 -0
- package/dist/devices/project-rules.js +27 -0
- package/dist/devices/working-root.d.ts +6 -0
- package/dist/devices/working-root.js +12 -1
- package/dist/errors.d.ts +31 -0
- package/dist/errors.js +31 -0
- package/dist/evals/reconstruct.d.ts +19 -2
- package/dist/evals/reconstruct.js +40 -2
- package/dist/evals/recorded-permission-context.d.ts +77 -0
- package/dist/evals/recorded-permission-context.js +151 -0
- package/dist/evals/recorded-tools.d.ts +10 -1
- package/dist/evals/recorded-tools.js +27 -3
- package/dist/evals/run-replay.d.ts +8 -2
- package/dist/evals/run-replay.js +18 -2
- package/dist/evals/trajectory.d.ts +1 -1
- package/dist/evals/worker.d.ts +10 -1
- package/dist/evals/worker.js +23 -14
- package/dist/http/api.module.js +2 -0
- package/dist/identity/accounts.d.ts +14 -1
- package/dist/identity/accounts.js +61 -5
- package/dist/identity/identity.module.js +2 -0
- package/dist/identity/settings.d.ts +28 -12
- package/dist/identity/settings.js +89 -33
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/dist/infra/cli/kernel-cli.module.d.ts +2 -2
- package/dist/infra/cli/kernel-cli.module.js +5 -2
- package/dist/infra/cli/permission-cutover.d.ts +59 -0
- package/dist/infra/cli/permission-cutover.js +107 -0
- package/dist/infra/config/kernel-config.service.d.ts +2 -2
- package/dist/infra/config/kernel-config.service.js +31 -11
- package/dist/infra/database/startup-activation-transaction.d.ts +36 -0
- package/dist/infra/database/startup-activation-transaction.js +242 -0
- package/dist/infra/database/transaction-host.d.ts +47 -0
- package/dist/infra/database/transaction-host.js +119 -0
- package/dist/infra/database/xact-lock.d.ts +1 -0
- package/dist/infra/database/xact-lock.js +6 -0
- package/dist/infra/outbox/registry.d.ts +39 -0
- package/dist/infra/outbox/registry.js +18 -0
- package/dist/kernel.module.js +2 -0
- package/dist/lifecycle/kernel-lifecycle.d.ts +3 -1
- package/dist/lifecycle/kernel-lifecycle.js +55 -28
- package/dist/local-devices/device-auth.js +1 -1
- package/dist/local-devices/device-policy.service.d.ts +35 -5
- package/dist/local-devices/device-policy.service.js +188 -13
- package/dist/local-devices/instance-bindings.d.ts +82 -0
- package/dist/local-devices/instance-bindings.js +304 -0
- package/dist/local-devices/keys.d.ts +5 -0
- package/dist/local-devices/keys.js +5 -0
- package/dist/local-devices/local-device-gateway.d.ts +19 -4
- package/dist/local-devices/local-device-gateway.js +185 -17
- package/dist/local-devices/local-device-provider.d.ts +42 -7
- package/dist/local-devices/local-device-provider.js +185 -10
- package/dist/local-devices/local-devices.module.d.ts +17 -2
- package/dist/local-devices/local-devices.module.js +49 -8
- package/dist/local-devices/machines.d.ts +35 -12
- package/dist/local-devices/machines.js +203 -8
- package/dist/local-devices/network-grants.js +3 -3
- package/dist/local-devices/network-grants.module.d.ts +2 -0
- package/dist/local-devices/network-grants.module.js +14 -0
- package/dist/local-devices/owner-report.d.ts +79 -0
- package/dist/local-devices/owner-report.js +155 -0
- package/dist/local-devices/owner-reports.d.ts +48 -0
- package/dist/local-devices/owner-reports.js +190 -0
- package/dist/local-devices/policy-summary.d.ts +24 -1
- package/dist/local-devices/policy-summary.js +48 -0
- package/dist/local-devices/relay.d.ts +82 -6
- package/dist/local-devices/relay.js +187 -16
- package/dist/local-devices/targets.d.ts +16 -1
- package/dist/local-devices/targets.js +35 -2
- package/dist/orgs/cloud-network-setting.d.ts +33 -0
- package/dist/orgs/cloud-network-setting.js +47 -0
- package/dist/orgs/offboarding.d.ts +3 -1
- package/dist/orgs/offboarding.js +8 -2
- package/dist/orgs/org-lock.d.ts +10 -4
- package/dist/orgs/org-lock.js +10 -4
- package/dist/orgs/orgs.service.d.ts +3 -1
- package/dist/orgs/orgs.service.js +8 -2
- package/dist/orgs/settings.controller.d.ts +4 -1
- package/dist/orgs/settings.controller.js +3 -3
- package/dist/orgs/settings.service.d.ts +48 -56
- package/dist/orgs/settings.service.js +144 -101
- package/dist/overrides.d.ts +6 -1
- package/dist/overrides.js +2 -0
- package/dist/platform/exclusions.js +20 -0
- package/dist/platform/ops/admin.ops.js +14 -11
- package/dist/platform/ops/agent-skills.ops.js +2 -0
- package/dist/platform/ops/devices.ops.js +10 -2
- package/dist/platform/ops/org-settings.ops.js +6 -6
- package/dist/platform/ops/orgs.ops.js +1 -0
- package/dist/roles/worker.module.js +4 -0
- package/dist/runtime/context/build.d.ts +3 -1
- package/dist/runtime/context/build.js +19 -3
- package/dist/runtime/context/compaction.js +5 -0
- package/dist/runtime/context/device-paths.d.ts +9 -2
- package/dist/runtime/context/device-paths.js +20 -0
- package/dist/runtime/context/permission-profile.d.ts +46 -0
- package/dist/runtime/context/permission-profile.js +194 -0
- package/dist/runtime/maintenance.d.ts +7 -1
- package/dist/runtime/maintenance.js +43 -15
- package/dist/runtime/model-call.d.ts +32 -0
- package/dist/runtime/model-call.js +67 -0
- package/dist/runtime/permission-context-errors.d.ts +39 -0
- package/dist/runtime/permission-context-errors.js +67 -0
- package/dist/runtime/permission-context.service.d.ts +60 -0
- package/dist/runtime/permission-context.service.js +286 -0
- package/dist/runtime/project/knowledge.d.ts +7 -2
- package/dist/runtime/project/knowledge.js +5 -2
- package/dist/runtime/project/knowledge.service.d.ts +17 -2
- package/dist/runtime/project/knowledge.service.js +76 -12
- package/dist/runtime/run-execution.d.ts +4 -1
- package/dist/runtime/run-execution.js +14 -5
- package/dist/runtime/run-steps.d.ts +11 -3
- package/dist/runtime/run-steps.js +27 -4
- package/dist/runtime/runtime.module.js +11 -0
- package/dist/sandbox/attachments-path.d.ts +15 -0
- package/dist/sandbox/attachments-path.js +15 -0
- package/dist/sandbox/cloud-permission-snapshot.d.ts +159 -0
- package/dist/sandbox/cloud-permission-snapshot.js +407 -0
- package/dist/sandbox/cloud-permission-snapshot.module.d.ts +8 -0
- package/dist/sandbox/cloud-permission-snapshot.module.js +34 -0
- package/dist/sandbox/held-operations.d.ts +39 -0
- package/dist/sandbox/held-operations.js +119 -0
- package/dist/sandbox/jobs.d.ts +14 -3
- package/dist/sandbox/jobs.js +20 -2
- package/dist/sandbox/kernel-read.d.ts +55 -0
- package/dist/sandbox/kernel-read.js +57 -0
- package/dist/sandbox/legacy-retirement.d.ts +336 -0
- package/dist/sandbox/legacy-retirement.js +1063 -0
- package/dist/sandbox/legacy-retirement.module.d.ts +8 -0
- package/dist/sandbox/legacy-retirement.module.js +25 -0
- package/dist/sandbox/managed-device-context.d.ts +94 -0
- package/dist/sandbox/managed-device-context.js +308 -0
- package/dist/sandbox/managed-device-context.module.d.ts +6 -0
- package/dist/sandbox/managed-device-context.module.js +33 -0
- package/dist/sandbox/modes.d.ts +56 -8
- package/dist/sandbox/modes.js +92 -8
- package/dist/sandbox/operation-authority-types.d.ts +8 -0
- package/dist/sandbox/operation-authority-types.js +32 -0
- package/dist/sandbox/operation-authority.d.ts +145 -0
- package/dist/sandbox/operation-authority.js +783 -0
- package/dist/sandbox/operation-authority.module.d.ts +2 -0
- package/dist/sandbox/operation-authority.module.js +29 -0
- package/dist/sandbox/operation-intents.d.ts +206 -0
- package/dist/sandbox/operation-intents.js +1252 -0
- package/dist/sandbox/operation-intents.module.d.ts +2 -0
- package/dist/sandbox/operation-intents.module.js +21 -0
- package/dist/sandbox/operation-payloads.d.ts +33 -0
- package/dist/sandbox/operation-payloads.js +332 -0
- package/dist/sandbox/operation-reconcile.job.d.ts +49 -0
- package/dist/sandbox/operation-reconcile.job.js +247 -0
- package/dist/sandbox/permission-authority-epochs.d.ts +18 -0
- package/dist/sandbox/permission-authority-epochs.js +83 -0
- package/dist/sandbox/permission-authority-lock.d.ts +38 -0
- package/dist/sandbox/permission-authority-lock.js +147 -0
- package/dist/sandbox/permission-authority.module.d.ts +9 -0
- package/dist/sandbox/permission-authority.module.js +55 -0
- package/dist/sandbox/permission-availability.d.ts +18 -0
- package/dist/sandbox/permission-availability.js +19 -0
- package/dist/sandbox/permission-call-grants.d.ts +34 -0
- package/dist/sandbox/permission-call-grants.js +349 -0
- package/dist/sandbox/permission-call-grants.module.d.ts +2 -0
- package/dist/sandbox/permission-call-grants.module.js +21 -0
- package/dist/sandbox/permission-call-types.d.ts +82 -0
- package/dist/sandbox/permission-call-types.js +1 -0
- package/dist/sandbox/permission-ceiling-writes.d.ts +47 -0
- package/dist/sandbox/permission-ceiling-writes.js +223 -0
- package/dist/sandbox/permission-config-publication.d.ts +76 -0
- package/dist/sandbox/permission-config-publication.js +339 -0
- package/dist/sandbox/permission-context-types.d.ts +64 -0
- package/dist/sandbox/permission-context-types.js +24 -0
- package/dist/sandbox/permission-facts.d.ts +206 -0
- package/dist/sandbox/permission-facts.js +627 -0
- package/dist/sandbox/permission-facts.module.d.ts +2 -0
- package/dist/sandbox/permission-facts.module.js +20 -0
- package/dist/sandbox/permission-instance-writes.d.ts +90 -0
- package/dist/sandbox/permission-instance-writes.js +305 -0
- package/dist/sandbox/permission-runtime-reports.d.ts +83 -0
- package/dist/sandbox/permission-runtime-reports.js +354 -0
- package/dist/sandbox/permission-transitions.d.ts +31 -0
- package/dist/sandbox/permission-transitions.js +155 -0
- package/dist/sandbox/platform-full-access.d.ts +128 -0
- package/dist/sandbox/platform-full-access.js +210 -0
- package/dist/sandbox/providers.d.ts +22 -0
- package/dist/sandbox/providers.js +10 -2
- package/dist/sandbox/providers.module.d.ts +2 -0
- package/dist/sandbox/providers.module.js +19 -0
- package/dist/sandbox/request-not-sent.d.ts +13 -0
- package/dist/sandbox/request-not-sent.js +13 -0
- package/dist/sandbox/review/classifier.d.ts +2 -0
- package/dist/sandbox/review/classifier.js +8 -0
- package/dist/sandbox/review/permission-candidate.d.ts +12 -0
- package/dist/sandbox/review/permission-candidate.js +129 -0
- package/dist/sandbox/review/review.service.d.ts +4 -1
- package/dist/sandbox/review/review.service.js +19 -5
- package/dist/sandbox/sandbox-file-reader.d.ts +18 -1
- package/dist/sandbox/sandbox-file-reader.js +51 -7
- package/dist/sandbox/sandbox.module.js +26 -6
- package/dist/sandbox/sandbox.service.d.ts +230 -34
- package/dist/sandbox/sandbox.service.js +1368 -199
- package/dist/sandbox/unreachable.js +17 -3
- package/dist/sandbox/use-context.d.ts +17 -0
- package/dist/sandbox/use-context.js +1 -0
- package/dist/skills/invoke.d.ts +27 -4
- package/dist/skills/invoke.js +72 -7
- package/dist/tools/approvals.controller.d.ts +1 -0
- package/dist/tools/approvals.schemas.d.ts +1 -0
- package/dist/tools/approvals.schemas.js +3 -1
- package/dist/tools/approvals.service.d.ts +23 -10
- package/dist/tools/approvals.service.js +104 -26
- package/dist/tools/builtins/builtin-tools.d.ts +16 -2
- package/dist/tools/builtins/builtin-tools.js +38 -10
- package/dist/tools/builtins/sandbox/bash.d.ts +25 -1
- package/dist/tools/builtins/sandbox/bash.js +201 -5
- package/dist/tools/builtins/sandbox/common.d.ts +92 -20
- package/dist/tools/builtins/sandbox/common.js +201 -17
- package/dist/tools/builtins/sandbox/deliver.js +2 -2
- package/dist/tools/builtins/sandbox/edit.js +2 -2
- package/dist/tools/builtins/sandbox/fetch-attachment.js +11 -4
- package/dist/tools/builtins/sandbox/glob.js +2 -2
- package/dist/tools/builtins/sandbox/grep.js +2 -2
- package/dist/tools/builtins/sandbox/read.js +2 -2
- package/dist/tools/builtins/sandbox/task-list.js +7 -1
- package/dist/tools/builtins/sandbox/task-output.d.ts +1 -1
- package/dist/tools/builtins/sandbox/task-output.js +172 -0
- package/dist/tools/builtins/sandbox/task-stop.js +25 -3
- package/dist/tools/builtins/sandbox/write.js +2 -2
- package/dist/tools/builtins/skill-load.js +9 -6
- package/dist/tools/device-op-resolver.d.ts +1 -1
- package/dist/tools/device-op-resolver.js +13 -3
- package/dist/tools/permission-approval-jobs.d.ts +18 -0
- package/dist/tools/permission-approval-jobs.js +92 -0
- package/dist/tools/pipeline.d.ts +17 -2
- package/dist/tools/pipeline.js +300 -19
- package/dist/tools/registry.d.ts +9 -0
- package/dist/tools/tools.module.js +12 -0
- package/package.json +4 -3
- package/src/migrations/0146_permission_authority_epochs.sql +6 -0
- package/src/migrations/0147_conversation_permission_profiles.sql +4 -0
- package/src/migrations/0148_first_message_request_hash.sql +2 -0
- package/src/migrations/0149_sandbox_operation_intents.sql +66 -0
- package/src/migrations/0150_permission_call_grants_and_approvals.sql +36 -0
- package/src/migrations/0151_starting_execution_grants.sql +8 -0
- package/src/migrations/0152_background_launch_identity.sql +66 -0
- package/src/migrations/0153_background_cancel_requester.sql +13 -0
- package/src/migrations/0154_cloud_owner_ceiling.sql +14 -0
- package/src/migrations/0155_device_instance_generations.sql +30 -0
- package/src/migrations/0156_device_owner_report.sql +7 -0
- package/src/migrations/0157_legacy_retirement.sql +116 -0
- package/src/migrations/0158_legacy_freeze_enumerated.sql +5 -0
- package/src/migrations/0159_retirement_exact_cancel.sql +9 -0
- package/dist/sandbox/platform-auto-mode.d.ts +0 -63
- package/dist/sandbox/platform-auto-mode.js +0 -63
|
@@ -1,5 +1,89 @@
|
|
|
1
|
-
import { type ContentBlock, type MediaSource } from "@capybara-hq/plugin-sdk";
|
|
1
|
+
import { type ContentBlock, type MediaSource, type PermissionProfile } from "@capybara-hq/plugin-sdk";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
/** Code-point ordering is independent of the host locale and UTF-16 surrogate ordering. */
|
|
4
|
+
export declare function permissionCodePointCompare(a: string, b: string): number;
|
|
5
|
+
/** Complete recorded facts, never a grant or a requested-but-unverified scope. */
|
|
6
|
+
export declare const PermissionContextV1Schema: z.ZodObject<{
|
|
7
|
+
version: z.ZodLiteral<1>;
|
|
8
|
+
rootConversationId: z.ZodString;
|
|
9
|
+
profileRevision: z.ZodNullable<z.ZodNumber>;
|
|
10
|
+
selectedProfile: z.ZodNullable<z.ZodCustom<PermissionProfile, PermissionProfile>>;
|
|
11
|
+
effectiveProfile: z.ZodNullable<z.ZodCustom<PermissionProfile, PermissionProfile>>;
|
|
12
|
+
execution: z.ZodEnum<{
|
|
13
|
+
interactive: "interactive";
|
|
14
|
+
scheduled: "scheduled";
|
|
15
|
+
}>;
|
|
16
|
+
inherited: z.ZodBoolean;
|
|
17
|
+
deviceId: z.ZodNullable<z.ZodString>;
|
|
18
|
+
scopeRevision: z.ZodNullable<z.ZodString>;
|
|
19
|
+
authorityRevision: z.ZodNullable<z.ZodString>;
|
|
20
|
+
availability: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
+
state: z.ZodLiteral<"supported">;
|
|
22
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
23
|
+
state: z.ZodEnum<{
|
|
24
|
+
unprobed: "unprobed";
|
|
25
|
+
unsupported: "unsupported";
|
|
26
|
+
}>;
|
|
27
|
+
reason: z.ZodString;
|
|
28
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
29
|
+
state: z.ZodLiteral<"unavailable">;
|
|
30
|
+
cause: z.ZodEnum<{
|
|
31
|
+
"actor-device-access": "actor-device-access";
|
|
32
|
+
"no-device": "no-device";
|
|
33
|
+
}>;
|
|
34
|
+
reason: z.ZodString;
|
|
35
|
+
}, z.core.$strict>], "state">;
|
|
36
|
+
scope: z.ZodNullable<z.ZodObject<{
|
|
37
|
+
location: z.ZodEnum<{
|
|
38
|
+
cloud: "cloud";
|
|
39
|
+
local: "local";
|
|
40
|
+
}>;
|
|
41
|
+
workingRoot: z.ZodString;
|
|
42
|
+
filesystem: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
43
|
+
kind: z.ZodLiteral<"device">;
|
|
44
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
45
|
+
kind: z.ZodLiteral<"scoped">;
|
|
46
|
+
readDirectories: z.ZodArray<z.ZodString>;
|
|
47
|
+
writeDirectories: z.ZodArray<z.ZodString>;
|
|
48
|
+
}, z.core.$strict>], "kind">;
|
|
49
|
+
network: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
50
|
+
kind: z.ZodLiteral<"none">;
|
|
51
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
52
|
+
kind: z.ZodLiteral<"environment">;
|
|
53
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
54
|
+
kind: z.ZodLiteral<"allowlist">;
|
|
55
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
56
|
+
}, z.core.$strict>], "kind">;
|
|
57
|
+
outerNetwork: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
58
|
+
kind: z.ZodLiteral<"host-environment">;
|
|
59
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
60
|
+
kind: z.ZodLiteral<"none">;
|
|
61
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
62
|
+
kind: z.ZodLiteral<"open-public">;
|
|
63
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
64
|
+
kind: z.ZodLiteral<"allowlist">;
|
|
65
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
66
|
+
}, z.core.$strict>], "kind">;
|
|
67
|
+
}, z.core.$strict>>;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
export type PermissionContextV1 = z.infer<typeof PermissionContextV1Schema>;
|
|
70
|
+
export declare const ManagedDevicePathsV1Schema: z.ZodObject<{
|
|
71
|
+
permissionContextVersion: z.ZodLiteral<1>;
|
|
72
|
+
deviceId: z.ZodString;
|
|
73
|
+
roots: z.ZodObject<{
|
|
74
|
+
workspace: z.ZodString;
|
|
75
|
+
skills: z.ZodString;
|
|
76
|
+
tmp: z.ZodString;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
workingRoot: z.ZodString;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
export type ManagedDevicePathsV1 = z.infer<typeof ManagedDevicePathsV1Schema>;
|
|
81
|
+
export declare const PermissionContextMetaV1Schema: z.ZodObject<{
|
|
82
|
+
version: z.ZodLiteral<1>;
|
|
83
|
+
contextSeq: z.ZodNullable<z.ZodNumber>;
|
|
84
|
+
hash: z.ZodString;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
export type PermissionContextMetaV1 = z.infer<typeof PermissionContextMetaV1Schema>;
|
|
3
87
|
/** The most hosts one network ask (and one `network_blocked` event) lists. */
|
|
4
88
|
export declare const NETWORK_ASK_MAX_HOSTS = 20;
|
|
5
89
|
/** The longest host name a network ask or `network_blocked` event carries. */
|
|
@@ -29,7 +113,47 @@ export declare const COMMAND_ASK_MAX_CHARS: number;
|
|
|
29
113
|
* `commandHash` is the SHA-256 of the command text the approval holds in full, so an audit can
|
|
30
114
|
* match a record to what ran.
|
|
31
115
|
*/
|
|
32
|
-
declare const
|
|
116
|
+
export declare const PermissionExpansionSchema: z.ZodObject<{
|
|
117
|
+
readDirectories: z.ZodArray<z.ZodString>;
|
|
118
|
+
writeDirectories: z.ZodArray<z.ZodString>;
|
|
119
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
export declare const PermissionCallBindingSchema: z.ZodObject<{
|
|
122
|
+
orgId: z.ZodString;
|
|
123
|
+
rootConversationId: z.ZodString;
|
|
124
|
+
conversationId: z.ZodString;
|
|
125
|
+
deviceId: z.ZodString;
|
|
126
|
+
accountId: z.ZodString;
|
|
127
|
+
runId: z.ZodString;
|
|
128
|
+
callId: z.ZodString;
|
|
129
|
+
toolKey: z.ZodString;
|
|
130
|
+
specHash: z.ZodString;
|
|
131
|
+
callInputHash: z.ZodString;
|
|
132
|
+
resolvedInputHash: z.ZodString;
|
|
133
|
+
profile: z.ZodEnum<{
|
|
134
|
+
"approve-for-me": "approve-for-me";
|
|
135
|
+
"full-access": "full-access";
|
|
136
|
+
"request-approval": "request-approval";
|
|
137
|
+
}>;
|
|
138
|
+
profileRevision: z.ZodNumber;
|
|
139
|
+
scopeRevision: z.ZodString;
|
|
140
|
+
authorityRevision: z.ZodString;
|
|
141
|
+
}, z.core.$strict>;
|
|
142
|
+
export declare const ReviewRecordSchema: z.ZodObject<{
|
|
143
|
+
profile: z.ZodOptional<z.ZodEnum<{
|
|
144
|
+
"approve-for-me": "approve-for-me";
|
|
145
|
+
"full-access": "full-access";
|
|
146
|
+
"request-approval": "request-approval";
|
|
147
|
+
}>>;
|
|
148
|
+
profileRevision: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
scopeRevision: z.ZodOptional<z.ZodString>;
|
|
150
|
+
decisionSource: z.ZodOptional<z.ZodEnum<{
|
|
151
|
+
"full-access": "full-access";
|
|
152
|
+
human: "human";
|
|
153
|
+
"review-model": "review-model";
|
|
154
|
+
scope: "scope";
|
|
155
|
+
"task-grant": "task-grant";
|
|
156
|
+
}>>;
|
|
33
157
|
decision: z.ZodEnum<{
|
|
34
158
|
allow: "allow";
|
|
35
159
|
deny: "deny";
|
|
@@ -49,6 +173,13 @@ declare const ReviewRecordSchema: z.ZodObject<{
|
|
|
49
173
|
}, z.core.$strict>;
|
|
50
174
|
/** The display-only `approval_requested.command` facts of a `command` ask (auto mode spec §5.4). */
|
|
51
175
|
export declare const CommandAskSchema: z.ZodObject<{
|
|
176
|
+
permissionScope: z.ZodOptional<z.ZodObject<{
|
|
177
|
+
readDirectories: z.ZodArray<z.ZodString>;
|
|
178
|
+
writeDirectories: z.ZodArray<z.ZodString>;
|
|
179
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
180
|
+
}, z.core.$strict>>;
|
|
181
|
+
targetPath: z.ZodOptional<z.ZodString>;
|
|
182
|
+
candidateHash: z.ZodOptional<z.ZodString>;
|
|
52
183
|
kind: z.ZodEnum<{
|
|
53
184
|
command: "command";
|
|
54
185
|
write: "write";
|
|
@@ -298,6 +429,133 @@ export declare const PluginContextSchema: z.ZodObject<{
|
|
|
298
429
|
* 读出时按写入时的形状原样返回。
|
|
299
430
|
*/
|
|
300
431
|
export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
432
|
+
type: z.ZodLiteral<"permission_context">;
|
|
433
|
+
payload: z.ZodObject<{
|
|
434
|
+
version: z.ZodLiteral<1>;
|
|
435
|
+
rootConversationId: z.ZodString;
|
|
436
|
+
profileRevision: z.ZodNullable<z.ZodNumber>;
|
|
437
|
+
selectedProfile: z.ZodNullable<z.ZodCustom<PermissionProfile, PermissionProfile>>;
|
|
438
|
+
effectiveProfile: z.ZodNullable<z.ZodCustom<PermissionProfile, PermissionProfile>>;
|
|
439
|
+
execution: z.ZodEnum<{
|
|
440
|
+
interactive: "interactive";
|
|
441
|
+
scheduled: "scheduled";
|
|
442
|
+
}>;
|
|
443
|
+
inherited: z.ZodBoolean;
|
|
444
|
+
deviceId: z.ZodNullable<z.ZodString>;
|
|
445
|
+
scopeRevision: z.ZodNullable<z.ZodString>;
|
|
446
|
+
authorityRevision: z.ZodNullable<z.ZodString>;
|
|
447
|
+
availability: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
448
|
+
state: z.ZodLiteral<"supported">;
|
|
449
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
450
|
+
state: z.ZodEnum<{
|
|
451
|
+
unprobed: "unprobed";
|
|
452
|
+
unsupported: "unsupported";
|
|
453
|
+
}>;
|
|
454
|
+
reason: z.ZodString;
|
|
455
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
456
|
+
state: z.ZodLiteral<"unavailable">;
|
|
457
|
+
cause: z.ZodEnum<{
|
|
458
|
+
"actor-device-access": "actor-device-access";
|
|
459
|
+
"no-device": "no-device";
|
|
460
|
+
}>;
|
|
461
|
+
reason: z.ZodString;
|
|
462
|
+
}, z.core.$strict>], "state">;
|
|
463
|
+
scope: z.ZodNullable<z.ZodObject<{
|
|
464
|
+
location: z.ZodEnum<{
|
|
465
|
+
cloud: "cloud";
|
|
466
|
+
local: "local";
|
|
467
|
+
}>;
|
|
468
|
+
workingRoot: z.ZodString;
|
|
469
|
+
filesystem: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
470
|
+
kind: z.ZodLiteral<"device">;
|
|
471
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
472
|
+
kind: z.ZodLiteral<"scoped">;
|
|
473
|
+
readDirectories: z.ZodArray<z.ZodString>;
|
|
474
|
+
writeDirectories: z.ZodArray<z.ZodString>;
|
|
475
|
+
}, z.core.$strict>], "kind">;
|
|
476
|
+
network: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
477
|
+
kind: z.ZodLiteral<"none">;
|
|
478
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
479
|
+
kind: z.ZodLiteral<"environment">;
|
|
480
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
481
|
+
kind: z.ZodLiteral<"allowlist">;
|
|
482
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
483
|
+
}, z.core.$strict>], "kind">;
|
|
484
|
+
outerNetwork: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
485
|
+
kind: z.ZodLiteral<"host-environment">;
|
|
486
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
487
|
+
kind: z.ZodLiteral<"none">;
|
|
488
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
489
|
+
kind: z.ZodLiteral<"open-public">;
|
|
490
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
491
|
+
kind: z.ZodLiteral<"allowlist">;
|
|
492
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
493
|
+
}, z.core.$strict>], "kind">;
|
|
494
|
+
}, z.core.$strict>>;
|
|
495
|
+
}, z.core.$strict>;
|
|
496
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
497
|
+
type: z.ZodLiteral<"permission_reviewed">;
|
|
498
|
+
payload: z.ZodObject<{
|
|
499
|
+
binding: z.ZodObject<{
|
|
500
|
+
orgId: z.ZodString;
|
|
501
|
+
rootConversationId: z.ZodString;
|
|
502
|
+
conversationId: z.ZodString;
|
|
503
|
+
deviceId: z.ZodString;
|
|
504
|
+
accountId: z.ZodString;
|
|
505
|
+
runId: z.ZodString;
|
|
506
|
+
callId: z.ZodString;
|
|
507
|
+
toolKey: z.ZodString;
|
|
508
|
+
specHash: z.ZodString;
|
|
509
|
+
callInputHash: z.ZodString;
|
|
510
|
+
resolvedInputHash: z.ZodString;
|
|
511
|
+
profile: z.ZodEnum<{
|
|
512
|
+
"approve-for-me": "approve-for-me";
|
|
513
|
+
"full-access": "full-access";
|
|
514
|
+
"request-approval": "request-approval";
|
|
515
|
+
}>;
|
|
516
|
+
profileRevision: z.ZodNumber;
|
|
517
|
+
scopeRevision: z.ZodString;
|
|
518
|
+
authorityRevision: z.ZodString;
|
|
519
|
+
}, z.core.$strict>;
|
|
520
|
+
permissionScope: z.ZodObject<{
|
|
521
|
+
readDirectories: z.ZodArray<z.ZodString>;
|
|
522
|
+
writeDirectories: z.ZodArray<z.ZodString>;
|
|
523
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
524
|
+
}, z.core.$strict>;
|
|
525
|
+
targetPath: z.ZodOptional<z.ZodString>;
|
|
526
|
+
scopeKind: z.ZodLiteral<"directories-and-hosts">;
|
|
527
|
+
candidateHash: z.ZodString;
|
|
528
|
+
outcome: z.ZodEnum<{
|
|
529
|
+
allow: "allow";
|
|
530
|
+
ask: "ask";
|
|
531
|
+
deny: "deny";
|
|
532
|
+
}>;
|
|
533
|
+
reason: z.ZodString;
|
|
534
|
+
decisionSource: z.ZodLiteral<"review-model">;
|
|
535
|
+
}, z.core.$strip>;
|
|
536
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
537
|
+
type: z.ZodLiteral<"permission_profile_changed">;
|
|
538
|
+
payload: z.ZodObject<{
|
|
539
|
+
oldProfile: z.ZodEnum<{
|
|
540
|
+
"approve-for-me": "approve-for-me";
|
|
541
|
+
"full-access": "full-access";
|
|
542
|
+
"request-approval": "request-approval";
|
|
543
|
+
}>;
|
|
544
|
+
newProfile: z.ZodEnum<{
|
|
545
|
+
"approve-for-me": "approve-for-me";
|
|
546
|
+
"full-access": "full-access";
|
|
547
|
+
"request-approval": "request-approval";
|
|
548
|
+
}>;
|
|
549
|
+
actorAccountId: z.ZodNullable<z.ZodString>;
|
|
550
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
551
|
+
"authority-changed": "authority-changed";
|
|
552
|
+
user: "user";
|
|
553
|
+
}>>;
|
|
554
|
+
deviceId: z.ZodNullable<z.ZodString>;
|
|
555
|
+
scopeRevision: z.ZodNullable<z.ZodString>;
|
|
556
|
+
revision: z.ZodNumber;
|
|
557
|
+
}, z.core.$strip>;
|
|
558
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
301
559
|
type: z.ZodLiteral<"user_message">;
|
|
302
560
|
payload: z.ZodObject<{
|
|
303
561
|
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -501,6 +759,11 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
501
759
|
toSeq: z.ZodNumber;
|
|
502
760
|
summarySeq: z.ZodNullable<z.ZodNumber>;
|
|
503
761
|
systemHash: z.ZodString;
|
|
762
|
+
permissionContext: z.ZodOptional<z.ZodObject<{
|
|
763
|
+
version: z.ZodLiteral<1>;
|
|
764
|
+
contextSeq: z.ZodNullable<z.ZodNumber>;
|
|
765
|
+
hash: z.ZodString;
|
|
766
|
+
}, z.core.$strict>>;
|
|
504
767
|
reminderSeqs: z.ZodArray<z.ZodNumber>;
|
|
505
768
|
maxOutputTokens: z.ZodNumber;
|
|
506
769
|
params: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
@@ -697,7 +960,17 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
697
960
|
}, z.core.$strip>;
|
|
698
961
|
}, z.core.$strip>, z.ZodObject<{
|
|
699
962
|
type: z.ZodLiteral<"device_paths">;
|
|
700
|
-
payload: z.ZodObject<{
|
|
963
|
+
payload: z.ZodUnion<readonly [z.ZodObject<{
|
|
964
|
+
permissionContextVersion: z.ZodLiteral<1>;
|
|
965
|
+
deviceId: z.ZodString;
|
|
966
|
+
roots: z.ZodObject<{
|
|
967
|
+
workspace: z.ZodString;
|
|
968
|
+
skills: z.ZodString;
|
|
969
|
+
tmp: z.ZodString;
|
|
970
|
+
}, z.core.$strict>;
|
|
971
|
+
workingRoot: z.ZodString;
|
|
972
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
973
|
+
permissionContextVersion: z.ZodOptional<z.ZodNever>;
|
|
701
974
|
roots: z.ZodObject<{
|
|
702
975
|
workspace: z.ZodString;
|
|
703
976
|
skills: z.ZodString;
|
|
@@ -739,7 +1012,7 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
739
1012
|
sandbox: "sandbox";
|
|
740
1013
|
}>>;
|
|
741
1014
|
local: z.ZodOptional<z.ZodBoolean>;
|
|
742
|
-
}, z.core.$strip>;
|
|
1015
|
+
}, z.core.$strip>]>;
|
|
743
1016
|
}, z.core.$strip>, z.ZodObject<{
|
|
744
1017
|
type: z.ZodLiteral<"project_root">;
|
|
745
1018
|
payload: z.ZodObject<{
|
|
@@ -771,6 +1044,10 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
771
1044
|
callId: z.ZodString;
|
|
772
1045
|
toolKey: z.ZodString;
|
|
773
1046
|
specHash: z.ZodString;
|
|
1047
|
+
permissionInput: z.ZodOptional<z.ZodObject<{
|
|
1048
|
+
callInputHash: z.ZodString;
|
|
1049
|
+
resolvedInputHash: z.ZodString;
|
|
1050
|
+
}, z.core.$strip>>;
|
|
774
1051
|
}, z.core.$strip>;
|
|
775
1052
|
}, z.core.$strip>, z.ZodObject<{
|
|
776
1053
|
type: z.ZodLiteral<"tool_result">;
|
|
@@ -783,6 +1060,20 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
783
1060
|
outputId: z.ZodOptional<z.ZodString>;
|
|
784
1061
|
contentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
785
1062
|
review: z.ZodOptional<z.ZodObject<{
|
|
1063
|
+
profile: z.ZodOptional<z.ZodEnum<{
|
|
1064
|
+
"approve-for-me": "approve-for-me";
|
|
1065
|
+
"full-access": "full-access";
|
|
1066
|
+
"request-approval": "request-approval";
|
|
1067
|
+
}>>;
|
|
1068
|
+
profileRevision: z.ZodOptional<z.ZodNumber>;
|
|
1069
|
+
scopeRevision: z.ZodOptional<z.ZodString>;
|
|
1070
|
+
decisionSource: z.ZodOptional<z.ZodEnum<{
|
|
1071
|
+
"full-access": "full-access";
|
|
1072
|
+
human: "human";
|
|
1073
|
+
"review-model": "review-model";
|
|
1074
|
+
scope: "scope";
|
|
1075
|
+
"task-grant": "task-grant";
|
|
1076
|
+
}>>;
|
|
786
1077
|
decision: z.ZodEnum<{
|
|
787
1078
|
allow: "allow";
|
|
788
1079
|
deny: "deny";
|
|
@@ -901,6 +1192,13 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
901
1192
|
refs: z.ZodArray<z.ZodString>;
|
|
902
1193
|
}, z.core.$strip>>;
|
|
903
1194
|
command: z.ZodOptional<z.ZodObject<{
|
|
1195
|
+
permissionScope: z.ZodOptional<z.ZodObject<{
|
|
1196
|
+
readDirectories: z.ZodArray<z.ZodString>;
|
|
1197
|
+
writeDirectories: z.ZodArray<z.ZodString>;
|
|
1198
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
1199
|
+
}, z.core.$strict>>;
|
|
1200
|
+
targetPath: z.ZodOptional<z.ZodString>;
|
|
1201
|
+
candidateHash: z.ZodOptional<z.ZodString>;
|
|
904
1202
|
kind: z.ZodEnum<{
|
|
905
1203
|
command: "command";
|
|
906
1204
|
write: "write";
|
|
@@ -926,7 +1224,9 @@ export declare const ConversationEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
926
1224
|
denied: "denied";
|
|
927
1225
|
expired: "expired";
|
|
928
1226
|
skipped: "skipped";
|
|
1227
|
+
superseded: "superseded";
|
|
929
1228
|
}>;
|
|
1229
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
930
1230
|
scope: z.ZodOptional<z.ZodEnum<{
|
|
931
1231
|
always: "always";
|
|
932
1232
|
once: "once";
|