@capybara-hq/plugin-sdk 0.1.0-rc.3 → 0.1.0-rc.31

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 (127) hide show
  1. package/agent-docs/agent-templates.md +15 -3
  2. package/agent-docs/concepts.md +5 -0
  3. package/agent-docs/connector-templates.md +2 -1
  4. package/agent-docs/extension-points/channel.md +1 -1
  5. package/agent-docs/extension-points/config-source.md +1 -1
  6. package/agent-docs/extension-points/connector.md +1 -1
  7. package/agent-docs/extension-points/context.md +15 -0
  8. package/agent-docs/extension-points/counter.md +1 -1
  9. package/agent-docs/extension-points/directory.md +1 -1
  10. package/agent-docs/extension-points/file-preview.md +1 -1
  11. package/agent-docs/extension-points/identity-source.md +1 -1
  12. package/agent-docs/extension-points/model-provider.md +4 -2
  13. package/agent-docs/extension-points/object-store.md +3 -1
  14. package/agent-docs/extension-points/sandbox.md +3 -3
  15. package/agent-docs/extension-points/secret-store.md +1 -1
  16. package/agent-docs/extension-points/web-fetch.md +1 -1
  17. package/agent-docs/extension-points/web-search.md +1 -1
  18. package/agent-docs/extensions.md +29 -4
  19. package/agent-docs/plugin-format.md +43 -3
  20. package/agent-docs/setup.md +46 -0
  21. package/agent-docs/skills.md +1 -1
  22. package/agent-docs/tool-naming.md +1 -1
  23. package/dist/agent-template.d.ts +15 -6
  24. package/dist/agent-template.js +32 -13
  25. package/dist/bootstrap.d.ts +15 -1
  26. package/dist/bootstrap.js +17 -1
  27. package/dist/cards.d.ts +56 -13
  28. package/dist/cards.js +90 -20
  29. package/dist/channel.d.ts +111 -48
  30. package/dist/channel.js +10 -5
  31. package/dist/client-css.d.ts +36 -0
  32. package/dist/client-css.js +326 -0
  33. package/dist/client-section.d.ts +35 -0
  34. package/dist/client-section.js +133 -0
  35. package/dist/config-ui.d.ts +22 -0
  36. package/dist/config-ui.js +64 -4
  37. package/dist/connector-auth.d.ts +7 -2
  38. package/dist/connector-auth.js +29 -8
  39. package/dist/connector.d.ts +74 -32
  40. package/dist/context.d.ts +40 -0
  41. package/dist/context.js +2 -0
  42. package/dist/ctx.d.ts +135 -26
  43. package/dist/define-extension.d.ts +26 -12
  44. package/dist/define-extension.js +11 -4
  45. package/dist/device-protocol-v3.d.ts +117 -0
  46. package/dist/device-protocol-v3.js +409 -0
  47. package/dist/device-protocol.d.ts +330 -0
  48. package/dist/device-protocol.js +567 -0
  49. package/dist/extension-point.d.ts +2 -0
  50. package/dist/extension-point.js +5 -2
  51. package/dist/file-preview.d.ts +1 -1
  52. package/dist/git-hosts.d.ts +44 -0
  53. package/dist/git-hosts.js +81 -0
  54. package/dist/hooks.d.ts +111 -21
  55. package/dist/hooks.js +5 -0
  56. package/dist/http-access.d.ts +52 -0
  57. package/dist/http-access.js +12 -0
  58. package/dist/identity.d.ts +22 -9
  59. package/dist/index.d.ts +23 -1
  60. package/dist/index.js +24 -1
  61. package/dist/marketplace.d.ts +26 -0
  62. package/dist/marketplace.js +43 -1
  63. package/dist/model-params.d.ts +41 -22
  64. package/dist/model-params.js +28 -15
  65. package/dist/model.d.ts +180 -71
  66. package/dist/model.js +71 -19
  67. package/dist/net.d.ts +52 -0
  68. package/dist/net.js +34 -0
  69. package/dist/permissions.d.ts +42 -20
  70. package/dist/permissions.js +97 -40
  71. package/dist/plugin-manifest.d.ts +45 -5
  72. package/dist/plugin-manifest.js +169 -6
  73. package/dist/plugin-package.d.ts +82 -38
  74. package/dist/plugin-package.js +61 -29
  75. package/dist/sandbox-linux-runtime-source.d.ts +1 -0
  76. package/dist/sandbox-linux-runtime-source.js +1886 -0
  77. package/dist/sandbox-native-runtime-source.d.ts +8 -0
  78. package/dist/sandbox-native-runtime-source.js +325 -0
  79. package/dist/sandbox-operation.d.ts +248 -0
  80. package/dist/sandbox-operation.js +245 -0
  81. package/dist/sandbox-runtime-source.d.ts +19 -0
  82. package/dist/sandbox-runtime-source.js +28 -0
  83. package/dist/sandbox-write-denies.d.ts +60 -0
  84. package/dist/sandbox-write-denies.js +630 -0
  85. package/dist/sandbox.d.ts +201 -16
  86. package/dist/sandbox.js +89 -14
  87. package/dist/secret.d.ts +4 -1
  88. package/dist/secret.js +4 -1
  89. package/dist/setup-check.d.ts +115 -0
  90. package/dist/setup-check.js +142 -0
  91. package/dist/setup-guide-parse.d.ts +121 -0
  92. package/dist/setup-guide-parse.js +350 -0
  93. package/dist/setup-guide-render.d.ts +45 -0
  94. package/dist/setup-guide-render.js +351 -0
  95. package/dist/setup-guide.d.ts +94 -0
  96. package/dist/setup-guide.js +336 -0
  97. package/dist/skill-invocation.d.ts +4 -3
  98. package/dist/skill-invocation.js +5 -4
  99. package/dist/skill.d.ts +34 -21
  100. package/dist/skill.js +48 -31
  101. package/dist/storage.d.ts +52 -25
  102. package/dist/theme-assets.d.ts +39 -0
  103. package/dist/theme-assets.js +449 -0
  104. package/dist/theme-readability.d.ts +37 -0
  105. package/dist/theme-readability.js +145 -0
  106. package/dist/theme-tokens.generated.d.ts +279 -0
  107. package/dist/theme-tokens.generated.js +174 -0
  108. package/dist/theme.d.ts +152 -0
  109. package/dist/theme.js +392 -0
  110. package/dist/tool.d.ts +69 -26
  111. package/dist/tool.js +29 -9
  112. package/dist/ui-parts.d.ts +23 -0
  113. package/dist/ui-parts.js +337 -0
  114. package/dist/ui-resolve.d.ts +35 -0
  115. package/dist/ui-resolve.js +42 -0
  116. package/dist/ui-slots.d.ts +53 -0
  117. package/dist/ui-slots.js +238 -0
  118. package/dist/ui.d.ts +191 -79
  119. package/dist/ui.js +101 -27
  120. package/dist/url.d.ts +4 -1
  121. package/dist/url.js +4 -1
  122. package/package.json +7 -1
  123. package/schemas/bootstrap.v1.schema.json +6 -0
  124. package/schemas/connector-template.v1.schema.json +35 -0
  125. package/schemas/marketplace.v1.schema.json +14 -0
  126. package/schemas/plugin.v1.schema.json +115 -3
  127. package/schemas/theme.v1.schema.json +225 -0
@@ -0,0 +1,245 @@
1
+ import { SANDBOX_TAG_RE, validateAllowHost, validateSandboxPathShape, } from "./sandbox.js";
2
+ /** Accepts only the supported permission profile names. */
3
+ export function isPermissionProfile(value) {
4
+ return value === "request-approval" || value === "approve-for-me" || value === "full-access";
5
+ }
6
+ /** The provider cannot enforce the requested permission profile. */
7
+ export class SandboxPermissionUnsupportedError extends Error {
8
+ sandboxPermissionUnsupported = true;
9
+ constructor(message, opts) {
10
+ super(message, opts && "cause" in opts ? { cause: opts.cause } : undefined);
11
+ this.name = "SandboxPermissionUnsupportedError";
12
+ }
13
+ }
14
+ /** Recognizes the name and tag across SDK copies without requiring this class's identity. */
15
+ export function isSandboxPermissionUnsupportedError(e) {
16
+ return (e instanceof Error &&
17
+ e.name === "SandboxPermissionUnsupportedError" &&
18
+ e.sandboxPermissionUnsupported === true);
19
+ }
20
+ /** The requested operation is outside the permitted scope. */
21
+ export class SandboxScopeDeniedError extends Error {
22
+ sandboxScopeDenied = true;
23
+ constructor(message, opts) {
24
+ super(message, opts && "cause" in opts ? { cause: opts.cause } : undefined);
25
+ this.name = "SandboxScopeDeniedError";
26
+ }
27
+ }
28
+ /** Recognizes the name and tag across SDK copies without requiring this class's identity. */
29
+ export function isSandboxScopeDeniedError(e) {
30
+ return (e instanceof Error &&
31
+ e.name === "SandboxScopeDeniedError" &&
32
+ e.sandboxScopeDenied === true);
33
+ }
34
+ /** A scope or execution reference is malformed; validate it before performing any effects. */
35
+ export class SandboxScopeValidationError extends Error {
36
+ sandboxScopeValidation = true;
37
+ constructor(message, opts) {
38
+ super(message, opts && "cause" in opts ? { cause: opts.cause } : undefined);
39
+ this.name = "SandboxScopeValidationError";
40
+ }
41
+ }
42
+ /** Recognizes validation errors across SDK copies. */
43
+ export function isSandboxScopeValidationError(e) {
44
+ return (e instanceof Error &&
45
+ e.name === "SandboxScopeValidationError" &&
46
+ e.sandboxScopeValidation === true);
47
+ }
48
+ /** An operation was consumed but its outcome is unknown. Never automatically retry with a new ID. */
49
+ export class SandboxOperationOutcomeUnknownError extends Error {
50
+ sandboxOperationOutcomeUnknown = true;
51
+ constructor(message, opts) {
52
+ super(message, opts && "cause" in opts ? { cause: opts.cause } : undefined);
53
+ this.name = "SandboxOperationOutcomeUnknownError";
54
+ }
55
+ }
56
+ /** Recognizes unknown outcomes across SDK copies; an unknown outcome is not a gone instance. */
57
+ export function isSandboxOperationOutcomeUnknownError(e) {
58
+ return (e instanceof Error &&
59
+ e.name === "SandboxOperationOutcomeUnknownError" &&
60
+ e.sandboxOperationOutcomeUnknown === true);
61
+ }
62
+ function invalid(field, requirement) {
63
+ throw new SandboxScopeValidationError(`Invalid ${field}: ${requirement}. Supply a valid scope or reference before retrying.`);
64
+ }
65
+ function record(value, keys, field) {
66
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
67
+ return invalid(field, "expected an object");
68
+ }
69
+ const prototype = Object.getPrototypeOf(value);
70
+ if (prototype !== Object.prototype && prototype !== null)
71
+ return invalid(field, "expected a plain object");
72
+ const result = Object.create(null);
73
+ for (const key of Reflect.ownKeys(value)) {
74
+ if (typeof key !== "string" || !keys.includes(key))
75
+ return invalid(field, "unknown fields are not allowed");
76
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
77
+ if (!descriptor || !("value" in descriptor))
78
+ return invalid(field, "accessor fields are not allowed");
79
+ result[key] = descriptor.value;
80
+ }
81
+ return result;
82
+ }
83
+ function id(value, field) {
84
+ if (typeof value !== "string" || value.length === 0 || value.length > 128) {
85
+ return invalid(field, "expected a nonempty string of at most 128 characters");
86
+ }
87
+ return value;
88
+ }
89
+ function integer(value, minimum, field) {
90
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < minimum) {
91
+ return invalid(field, `expected a safe integer greater than or equal to ${minimum}`);
92
+ }
93
+ return value;
94
+ }
95
+ function tag(value) {
96
+ if (typeof value !== "string" || !SANDBOX_TAG_RE.test(value))
97
+ return invalid("tag", "expected 1–64 lowercase letters, digits or hyphens");
98
+ return value;
99
+ }
100
+ function strings(value, maximum, check, field) {
101
+ if (!Array.isArray(value) || value.length > maximum)
102
+ return invalid(field, `expected an array of at most ${maximum} entries`);
103
+ if (Reflect.ownKeys(value).length !== value.length + 1)
104
+ return invalid(field, "sparse arrays and extra fields are not allowed");
105
+ const result = [];
106
+ for (let i = 0; i < value.length; i++) {
107
+ const descriptor = Object.getOwnPropertyDescriptor(value, i);
108
+ if (!descriptor || !("value" in descriptor))
109
+ return invalid(field, "expected array data entries");
110
+ const item = descriptor.value;
111
+ if (typeof item !== "string")
112
+ return invalid(field, "expected string entries");
113
+ const errors = check(item);
114
+ if (errors.length > 0)
115
+ return invalid(field, errors.join("; "));
116
+ result.push(item);
117
+ }
118
+ return Object.freeze(result);
119
+ }
120
+ function roots(value, field) {
121
+ return strings(value, 64, validateSandboxPathShape, field);
122
+ }
123
+ function fileScope(value) {
124
+ const v = record(value, ["kind", "readRoots", "writeRoots"], "filesystem");
125
+ if (v.kind === "device") {
126
+ record(value, ["kind"], "filesystem");
127
+ return Object.freeze({ kind: "device" });
128
+ }
129
+ if (v.kind !== "scoped")
130
+ return invalid("filesystem.kind", "expected scoped or device");
131
+ return Object.freeze({
132
+ kind: "scoped",
133
+ readRoots: roots(v.readRoots, "filesystem.readRoots"),
134
+ writeRoots: roots(v.writeRoots, "filesystem.writeRoots"),
135
+ });
136
+ }
137
+ function networkScope(value) {
138
+ const v = record(value, ["kind", "hosts"], "network");
139
+ if (v.kind === "none" || v.kind === "environment") {
140
+ record(value, ["kind"], "network");
141
+ return Object.freeze({ kind: v.kind });
142
+ }
143
+ if (v.kind !== "allowlist")
144
+ return invalid("network.kind", "expected none, allowlist or environment");
145
+ return Object.freeze({
146
+ kind: "allowlist",
147
+ hosts: strings(v.hosts, 100, validateAllowHost, "network.hosts"),
148
+ });
149
+ }
150
+ function actor(value) {
151
+ const v = record(value, ["accountId", "conversationId", "runId"], "actor");
152
+ return Object.freeze({
153
+ accountId: id(v.accountId, "actor.accountId"),
154
+ conversationId: id(v.conversationId, "actor.conversationId"),
155
+ ...(Object.hasOwn(v, "runId") ? { runId: id(v.runId, "actor.runId") } : {}),
156
+ });
157
+ }
158
+ function operationRef(v) {
159
+ return {
160
+ operationId: id(v.operationId, "operationId"),
161
+ admitBeforeMs: integer(v.admitBeforeMs, 1, "admitBeforeMs"),
162
+ };
163
+ }
164
+ /** Pure structural validation and a frozen copy; no clock lookup or authority resolution. */
165
+ export function parseSandboxOperationRef(value) {
166
+ return Object.freeze(operationRef(record(value, ["operationId", "admitBeforeMs"], "operation reference")));
167
+ }
168
+ /**
169
+ * Validates a scope and returns a deeply frozen copy, throwing SandboxScopeValidationError.
170
+ * IDs and ceiling revisions are bounded to 128 characters; roots to 64 paths of at most 4096 characters;
171
+ * hosts to 100 entries passing validateAllowHost. Empty grants stay empty, including deny-all.
172
+ * Performs no I/O, authority lookup or deadline refresh. Unknown fields are rejected at every level.
173
+ */
174
+ export function parseSandboxOperationScope(value) {
175
+ const v = record(value, [
176
+ "operationId",
177
+ "admitBeforeMs",
178
+ "deviceId",
179
+ "rootConversationId",
180
+ "profileRevision",
181
+ "ceilingRevision",
182
+ "profile",
183
+ "actor",
184
+ "tag",
185
+ "filesystem",
186
+ "network",
187
+ ], "operation scope");
188
+ if (!isPermissionProfile(v.profile))
189
+ return invalid("profile", "expected request-approval, approve-for-me or full-access");
190
+ return Object.freeze({
191
+ ...operationRef(v),
192
+ deviceId: id(v.deviceId, "deviceId"),
193
+ rootConversationId: id(v.rootConversationId, "rootConversationId"),
194
+ profileRevision: integer(v.profileRevision, 0, "profileRevision"),
195
+ ceilingRevision: id(v.ceilingRevision, "ceilingRevision"),
196
+ profile: v.profile,
197
+ actor: actor(v.actor),
198
+ tag: tag(v.tag),
199
+ filesystem: fileScope(v.filesystem),
200
+ network: networkScope(v.network),
201
+ });
202
+ }
203
+ /** Validates an owner browsing grant and returns a deeply frozen copy; no conversation is required. */
204
+ export function parseSandboxBrowseScope(value) {
205
+ const v = record(value, [
206
+ "operationId",
207
+ "admitBeforeMs",
208
+ "deviceId",
209
+ "accountId",
210
+ "ceilingRevision",
211
+ "readRoots",
212
+ "tag",
213
+ ], "browse scope");
214
+ return Object.freeze({
215
+ ...operationRef(v),
216
+ deviceId: id(v.deviceId, "deviceId"),
217
+ accountId: id(v.accountId, "accountId"),
218
+ ceilingRevision: id(v.ceilingRevision, "ceilingRevision"),
219
+ readRoots: roots(v.readRoots, "readRoots"),
220
+ tag: tag(v.tag),
221
+ });
222
+ }
223
+ /** Validates trusted staging structure and returns a deeply frozen copy; does not authorize its roots. */
224
+ export function parseSandboxPreparationScope(value) {
225
+ const v = record(value, ["operationId", "deviceId", "purpose", "writeRoots", "tag"], "preparation scope");
226
+ if (v.purpose !== "skills" && v.purpose !== "attachments")
227
+ return invalid("purpose", "expected skills or attachments");
228
+ return Object.freeze({
229
+ operationId: id(v.operationId, "operationId"),
230
+ deviceId: id(v.deviceId, "deviceId"),
231
+ purpose: v.purpose,
232
+ writeRoots: roots(v.writeRoots, "writeRoots"),
233
+ tag: tag(v.tag),
234
+ });
235
+ }
236
+ /** Validates all four bounded locator fields and returns a frozen copy; does not authenticate the caller. */
237
+ export function parseSandboxExecutionRef(value) {
238
+ const v = record(value, ["executionId", "operationId", "instanceId", "instanceGeneration"], "execution reference");
239
+ return Object.freeze({
240
+ executionId: id(v.executionId, "executionId"),
241
+ operationId: id(v.operationId, "operationId"),
242
+ instanceId: id(v.instanceId, "instanceId"),
243
+ instanceGeneration: id(v.instanceGeneration, "instanceGeneration"),
244
+ });
245
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Immutable runtime bytes for trusted consumer staging (requires Python 3). Consumers verify every
3
+ * hash before use, stage the files together in a directory the operation user cannot write, and
4
+ * supply pinned, already-authorized root descriptors.
5
+ *
6
+ * - `native-files.py`: the portable native helper (descriptor-relative file access).
7
+ * - `linux-sandbox.py`: the restricted Linux launcher and syscall broker (Landlock plus a seccomp
8
+ * notification broker). It decides nothing about authority; its `probe` reports whether the
9
+ * running kernel, architecture and container policy support restricted execution, and every
10
+ * unsupported case reports unavailable. Shipping these bytes is not a provider support claim.
11
+ */
12
+ export declare const SANDBOX_RUNTIME_SOURCE: {
13
+ readonly version: number;
14
+ readonly files: readonly {
15
+ readonly name: string;
16
+ readonly source: string;
17
+ readonly sha256: string;
18
+ }[];
19
+ };
@@ -0,0 +1,28 @@
1
+ import { LINUX_SANDBOX_SOURCE } from "./sandbox-linux-runtime-source.js";
2
+ import { NATIVE_FILES_SOURCE } from "./sandbox-native-runtime-source.js";
3
+ /**
4
+ * Immutable runtime bytes for trusted consumer staging (requires Python 3). Consumers verify every
5
+ * hash before use, stage the files together in a directory the operation user cannot write, and
6
+ * supply pinned, already-authorized root descriptors.
7
+ *
8
+ * - `native-files.py`: the portable native helper (descriptor-relative file access).
9
+ * - `linux-sandbox.py`: the restricted Linux launcher and syscall broker (Landlock plus a seccomp
10
+ * notification broker). It decides nothing about authority; its `probe` reports whether the
11
+ * running kernel, architecture and container policy support restricted execution, and every
12
+ * unsupported case reports unavailable. Shipping these bytes is not a provider support claim.
13
+ */
14
+ export const SANDBOX_RUNTIME_SOURCE = Object.freeze({
15
+ version: 2,
16
+ files: Object.freeze([
17
+ Object.freeze({
18
+ name: "native-files.py",
19
+ source: NATIVE_FILES_SOURCE,
20
+ sha256: "09a78c9bb7264ad6a1fe3b1aadd4c0f489192dc47c903c7fcc42fdf405590b42",
21
+ }),
22
+ Object.freeze({
23
+ name: "linux-sandbox.py",
24
+ source: LINUX_SANDBOX_SOURCE,
25
+ sha256: "b17b714a445912508d5082598af42960df550387c4a73b379561af19b0b45c87",
26
+ }),
27
+ ]),
28
+ });
@@ -0,0 +1,60 @@
1
+ /**
2
+ * What restricted execution may never write inside a granted root: one policy for every consumer
3
+ * (the Linux launcher's broker, `native-files.py`, the device agent and, as far as its glob
4
+ * patterns can express it, the macOS runtime). It keeps a later unsandboxed tool run by the owner
5
+ * from executing what a restricted command left behind.
6
+ *
7
+ * 1. {@link SANDBOX_MANDATORY_WRITE_DENIES}: component sequences denied wherever they appear (the
8
+ * entry and everything beneath it): shell startup files, git's global files, direnv and npm
9
+ * configuration, editor and agent configuration.
10
+ * 2. Inside a `.git` directory (the first `.git` component of a path) only git's ordinary
11
+ * internals are writable, an allowlist ({@link SANDBOX_GIT_ALLOWED_DIRECTORIES},
12
+ * {@link SANDBOX_GIT_ALLOWED_FILES}, `info/exclude`). Everything else there is denied:
13
+ * `config`, `config.worktree`, `commondir`, `gitdir`, `hooks/**`, `info/attributes`, unknown
14
+ * names. The gitdirs of submodules (`modules/<name>/`, where a name may contain `/`) and
15
+ * worktrees (`worktrees/<name>/`) follow the same allowlist; a submodule path is refused when
16
+ * any reading of its name would make it a denied internal.
17
+ * 3. Outside `.git`, a file named `HEAD` is denied: with `objects/` and `refs/` it would make a
18
+ * bare-repository lookalike whose configuration git honours.
19
+ * 4. Moves ({@link isSandboxMoveDenied}): nothing leaves a protected name (`.git`, `.claude`, …)
20
+ * except within the same protected directory; a directory is not moved under a protected name
21
+ * from outside it; no non-directory becomes `.git` (a `gitdir:` pointer).
22
+ *
23
+ * 5. Inside an allowlisted subtree nothing can make a repository: no `.git`, no `HEAD` except
24
+ * where git keeps one (`logs/HEAD`, `refs/remotes/<r>/HEAD`, …), and no `objects`, `commondir`
25
+ * or `gitdir` beside such a `HEAD`.
26
+ *
27
+ * Names are compared after Unicode NFKC normalization and full case folding
28
+ * ({@link sandboxFoldName}, identical to Python's `casefold`). Known limitations: a
29
+ * restricted command cannot `git init`, add a submodule or worktree, or create a bare repository;
30
+ * continuing an operation it started (`git rebase --continue`) runs the todo list it wrote, like
31
+ * any script it wrote; files that tools execute by convention without configuration (for example
32
+ * `package.json` scripts) are not covered; a forged rebase or cherry-pick in progress is possible
33
+ * (its state directories are writable for git's own use) and continuing it runs its `exec` lines.
34
+ * The macOS worker expresses this policy as ordered Seatbelt regex rules
35
+ * (`packages/device/src/exec/mac-write-policy.ts`).
36
+ */
37
+ export declare const SANDBOX_MANDATORY_WRITE_DENIES: readonly (readonly string[])[];
38
+ /** Directories inside a gitdir whose whole subtree is writable (objects, refs, operation state). */
39
+ export declare const SANDBOX_GIT_ALLOWED_DIRECTORIES: readonly string[];
40
+ /** Entries directly in a gitdir that are writable, each also with a `.lock` suffix. */
41
+ export declare const SANDBOX_GIT_ALLOWED_FILES: readonly string[];
42
+ /**
43
+ * For consumers that can only express denies as path patterns (the macOS runtime): the gitdir
44
+ * internals that run or redirect code, denied at any depth below `.git`. Such a consumer cannot
45
+ * express the allowlist or the `HEAD` rule exactly; see the rules above.
46
+ */
47
+ export declare const SANDBOX_GIT_DENIED_INTERNALS: readonly string[];
48
+ /** Names nothing leaves, and no directory is moved under, from outside. */
49
+ export declare const SANDBOX_PROTECTED_PATH_NAMES: readonly string[];
50
+ /** NFKC, then full case folding: the same as Python's `normalize("NFKC", s).casefold()`. */
51
+ export declare function sandboxFoldName(name: string): string;
52
+ /** Whether restricted execution may never write `path` (an absolute, normalized path). */
53
+ export declare function isSandboxWriteDenied(path: string): boolean;
54
+ /** Whether a restricted rename or link of `source` to `destination` is refused (rule 4). */
55
+ export declare function isSandboxMoveDenied(source: string, destination: string, sourceIsDirectory: boolean): boolean;
56
+ /**
57
+ * The same policy for the Python consumers (`linux-sandbox.py`, `native-files.py`): defines
58
+ * `write_denied(path)` and `move_denied(source, destination, is_dir)` with identical rules.
59
+ */
60
+ export declare const SANDBOX_WRITE_POLICY_PYTHON: string;