@capybara-hq/plugin-sdk 0.1.0-rc.26 → 0.1.0-rc.28
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/agent-docs/extension-points/model-provider.md +1 -1
- package/dist/cards.d.ts +17 -8
- package/dist/cards.js +21 -10
- package/dist/channel.d.ts +91 -47
- package/dist/channel.js +10 -5
- package/dist/connector-auth.d.ts +5 -2
- package/dist/connector-auth.js +14 -8
- package/dist/connector.d.ts +67 -32
- package/dist/ctx.d.ts +41 -23
- package/dist/define-extension.d.ts +21 -11
- package/dist/define-extension.js +10 -4
- package/dist/device-protocol.d.ts +2 -1
- package/dist/extension-point.js +1 -1
- package/dist/identity.d.ts +22 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/model-params.d.ts +41 -22
- package/dist/model-params.js +28 -15
- package/dist/model.d.ts +96 -64
- package/dist/model.js +25 -14
- package/dist/permissions.d.ts +6 -6
- package/dist/permissions.js +8 -32
- package/dist/plugin-package.d.ts +79 -38
- package/dist/plugin-package.js +57 -29
- package/dist/sandbox-linux-runtime-source.d.ts +15 -0
- package/dist/sandbox-linux-runtime-source.js +1421 -0
- package/dist/sandbox-runtime-source.d.ts +9 -3
- package/dist/sandbox-runtime-source.js +16 -4
- package/dist/sandbox.d.ts +4 -1
- package/dist/sandbox.js +7 -3
- package/dist/secret.d.ts +4 -1
- package/dist/secret.js +4 -1
- package/dist/setup-guide.d.ts +1 -1
- package/dist/setup-guide.js +1 -1
- package/dist/skill.d.ts +27 -17
- package/dist/skill.js +39 -25
- package/dist/storage.d.ts +45 -25
- package/dist/tool.d.ts +51 -23
- package/dist/tool.js +21 -9
- package/dist/ui-resolve.d.ts +2 -7
- package/dist/ui-resolve.js +7 -19
- package/dist/ui-slots.d.ts +1 -3
- package/dist/ui-slots.js +0 -9
- package/dist/ui.d.ts +63 -49
- package/dist/ui.js +36 -22
- package/dist/url.d.ts +4 -1
- package/dist/url.js +4 -1
- package/package.json +1 -1
package/dist/plugin-package.d.ts
CHANGED
|
@@ -11,17 +11,29 @@ import type { PluginManifest } from "./plugin-manifest.js";
|
|
|
11
11
|
* entry is single-file ESM with third-party dependencies bundled; only {@link HOST_PROVIDED_PACKAGES}
|
|
12
12
|
* come from the host.
|
|
13
13
|
*/
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Packages provided by the host (peerDependencies, linked to the host's copy on install); every
|
|
16
|
+
* other third-party dependency must be bundled into the entry.
|
|
17
|
+
*/
|
|
15
18
|
export declare const HOST_PROVIDED_PACKAGES: readonly ["@capybara-hq/plugin-sdk", "zod"];
|
|
16
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Scripts npm runs automatically on install: a plugin package must never have any (installs run no
|
|
21
|
+
* scripts, so having them would mislead).
|
|
22
|
+
*/
|
|
17
23
|
export declare const FORBIDDEN_INSTALL_SCRIPTS: readonly ["preinstall", "install", "postinstall", "prepare"];
|
|
18
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* A config field in the static manifest (a dotted path; an empty string when the root is itself the
|
|
26
|
+
* leaf).
|
|
27
|
+
*/
|
|
19
28
|
export interface StaticConfigField {
|
|
20
29
|
path: string;
|
|
21
30
|
secret: boolean;
|
|
22
31
|
hot: boolean;
|
|
23
32
|
}
|
|
24
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* The static part of the plugin manifest (JSON-serializable; excludes setup, zod schemas and
|
|
35
|
+
* migration paths).
|
|
36
|
+
*/
|
|
25
37
|
export interface StaticExtensionManifest {
|
|
26
38
|
name: string;
|
|
27
39
|
version: string;
|
|
@@ -36,27 +48,38 @@ export interface StaticExtensionManifest {
|
|
|
36
48
|
org: StaticConfigField[];
|
|
37
49
|
};
|
|
38
50
|
}
|
|
39
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* An import in the entry module: `name` is the specifier (an empty string for a dynamic import that
|
|
53
|
+
* is not a literal).
|
|
54
|
+
*/
|
|
40
55
|
export interface EntryImport {
|
|
41
56
|
name: string;
|
|
42
57
|
dynamic: boolean;
|
|
43
58
|
literal: boolean;
|
|
44
59
|
}
|
|
45
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* npm package name rule (simplified): may carry a scope, lowercase, ≤ 214 characters (the length is
|
|
62
|
+
* checked separately).
|
|
63
|
+
*/
|
|
46
64
|
export declare const NPM_PACKAGE_NAME_RE: RegExp;
|
|
47
65
|
/**
|
|
48
|
-
*
|
|
66
|
+
* Whether a path relative to the package is safe: non-empty, not starting with `/`, no `\`, control
|
|
67
|
+
* characters or drive letters, no empty segments, `.` or `..` segments, ≤ 1024 characters.
|
|
49
68
|
*/
|
|
50
69
|
export declare function isSafePackagePath(p: string): boolean;
|
|
51
70
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
71
|
+
* Checks the entry module's imports (C11): static and literal dynamic imports may only be `node:*`,
|
|
72
|
+
* {@link HOST_PROVIDED_PACKAGES} (subpaths included)
|
|
73
|
+
* and in-package relative paths (`./`, `../`; whether they escape the package is judged by the
|
|
74
|
+
* caller from the file location); non-literal dynamic imports are always rejected.
|
|
75
|
+
* Returns the list of problems (empty means valid).
|
|
55
76
|
*/
|
|
56
77
|
export declare function checkEntryImports(specifiers: EntryImport[]): string[];
|
|
57
78
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
79
|
+
* The static part of the real manifest: written into `capybara.manifest` when packing, and compared
|
|
80
|
+
* with the in-package one at load time (`manifest_mismatch`).
|
|
81
|
+
* The result survives a JSON round trip (undefined fields removed); config fields are sorted by
|
|
82
|
+
* path.
|
|
60
83
|
*/
|
|
61
84
|
export declare function staticManifestOf(m: ExtensionManifest): StaticExtensionManifest;
|
|
62
85
|
/**
|
|
@@ -79,64 +102,82 @@ export declare function validatePluginPackageJsonFor(pkg: unknown, manifest: Plu
|
|
|
79
102
|
*/
|
|
80
103
|
export declare function hostSdkProblem(sdk: string, hostSdkVersion: string): string | undefined;
|
|
81
104
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
105
|
+
* Connector template (C30): connector plugin reference + `Connector.kind` + endpoint preset +
|
|
106
|
+
* endpoint paths an org may change + auth preset (no credentials) +
|
|
107
|
+
* default ownership + default policy per tool + icon. When installing, an org may only fill in
|
|
108
|
+
* credentials, the client id / secret and the fields in `editableEndpoint`.
|
|
84
109
|
*/
|
|
85
110
|
export interface ConnectorTemplateSpec {
|
|
86
|
-
/**
|
|
111
|
+
/** Connector plugin name (e.g. `connector-mcp`). */
|
|
87
112
|
plugin: string;
|
|
88
|
-
/**
|
|
113
|
+
/** Semver range of the connector plugin, optional. */
|
|
89
114
|
pluginVersion?: string;
|
|
90
|
-
/** `Connector.kind
|
|
115
|
+
/** `Connector.kind` (e.g. `"mcp"`). */
|
|
91
116
|
connector: string;
|
|
92
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Endpoint preset; on import the kernel validates it against that connector's `endpointSchema`.
|
|
119
|
+
*/
|
|
93
120
|
endpoint: Record<string, unknown>;
|
|
94
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Dotted paths an org may change when installing (e.g. `"url"`); everything else follows the
|
|
123
|
+
* template. The paths must exist in the connector's endpoint schema.
|
|
124
|
+
*/
|
|
95
125
|
editableEndpoint?: string[];
|
|
96
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* The same shape as the auth method of the connector install API ({@link ConnectorAuthSchema}),
|
|
128
|
+
* carrying no credentials.
|
|
129
|
+
*/
|
|
97
130
|
auth: Record<string, unknown>;
|
|
98
|
-
/**
|
|
131
|
+
/** Defaults to `auth.ownership`; if given it must agree. */
|
|
99
132
|
ownership?: "org" | "personal";
|
|
100
|
-
/**
|
|
133
|
+
/** Tool name -> default policy (recorded as `policy_source 'template'` after install). */
|
|
101
134
|
defaultToolPolicies?: Record<string, "allow" | "ask" | "deny">;
|
|
102
135
|
/** Git hosts this connector's credential serves in sandboxes ({@link GitSource}). */
|
|
103
136
|
git?: GitSource;
|
|
104
|
-
/**
|
|
137
|
+
/** In-package path, svg / png, ≤ {@link CONNECTOR_TEMPLATE_LIMITS}`.iconBytes`. */
|
|
105
138
|
icon?: string;
|
|
106
139
|
}
|
|
107
|
-
/**
|
|
140
|
+
/** Bilingual display name. */
|
|
108
141
|
export interface LocalizedName {
|
|
109
142
|
zh: string;
|
|
110
143
|
en: string;
|
|
111
144
|
}
|
|
112
|
-
/**
|
|
145
|
+
/** Limits of connector templates and catalog segments. */
|
|
113
146
|
export declare const CONNECTOR_TEMPLATE_LIMITS: {
|
|
114
|
-
/**
|
|
147
|
+
/** Upper bound on icon bytes. */
|
|
115
148
|
readonly iconBytes: number;
|
|
116
|
-
/**
|
|
149
|
+
/** Upper bound on the characters of the endpoint preset after JSON serialization. */
|
|
117
150
|
readonly endpointChars: number;
|
|
118
|
-
/** `editableEndpoint`
|
|
151
|
+
/** Upper bound on the number of `editableEndpoint` entries. */
|
|
119
152
|
readonly editablePaths: 50;
|
|
120
|
-
/** `defaultToolPolicies`
|
|
153
|
+
/** Upper bound on the number of `defaultToolPolicies` entries. */
|
|
121
154
|
readonly toolPolicies: 1000;
|
|
122
|
-
/** publisher
|
|
155
|
+
/** Upper bound on the characters of publisher. */
|
|
123
156
|
readonly publisherChars: 100;
|
|
124
|
-
/** description
|
|
157
|
+
/** Upper bound on the characters of description. */
|
|
125
158
|
readonly descriptionChars: 1024;
|
|
126
|
-
/** displayName
|
|
159
|
+
/** Upper bound on the characters of displayName per language. */
|
|
127
160
|
readonly displayNameChars: 100;
|
|
128
161
|
};
|
|
129
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* Catalog entry name (the same rule as manifest entry names): starts with a lowercase letter or
|
|
164
|
+
* digit, then lowercase letters, digits and hyphens, ≤ 64.
|
|
165
|
+
*/
|
|
130
166
|
export declare const CATALOG_ITEM_NAME_RE: RegExp;
|
|
131
167
|
/** An exact semver version (a regex JSON Schema can use). */
|
|
132
168
|
export declare const SEMVER_VERSION_RE: RegExp;
|
|
133
169
|
/** The sha512 SRI of an npm package tgz: `sha512-<86 base64 chars>==`. */
|
|
134
170
|
export declare const SHA512_INTEGRITY_RE: RegExp;
|
|
135
171
|
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
172
|
+
* Validates the static part of a connector template ({@link ConnectorTemplateSpec}) and returns the
|
|
173
|
+
* list of problems (empty means valid; paths are relative to the template root, values are not
|
|
174
|
+
* echoed):
|
|
175
|
+
* fields complete, no unknown fields; `auth` conforms to {@link ConnectorAuthSchema} (strict: extra
|
|
176
|
+
* fields such as `token` are rejected);
|
|
177
|
+
* no credential-style key at any level of the endpoint preset; `editableEndpoint` is a list of
|
|
178
|
+
* distinct dotted paths; `ownership` agrees with `auth.ownership`;
|
|
179
|
+
* default policies may only be allow / ask / deny; icon is an in-package .svg / .png path.
|
|
180
|
+
* Whether the endpoint conforms to the connector's `endpointSchema` and whether `editableEndpoint`
|
|
181
|
+
* exists in it is checked by the kernel on import against the loaded connector.
|
|
141
182
|
*/
|
|
142
183
|
export declare function validateConnectorTemplate(t: unknown): string[];
|
package/dist/plugin-package.js
CHANGED
|
@@ -11,16 +11,24 @@ import { validateGitSource } from "./git-hosts.js";
|
|
|
11
11
|
* entry is single-file ESM with third-party dependencies bundled; only {@link HOST_PROVIDED_PACKAGES}
|
|
12
12
|
* come from the host.
|
|
13
13
|
*/
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Packages provided by the host (peerDependencies, linked to the host's copy on install); every
|
|
16
|
+
* other third-party dependency must be bundled into the entry.
|
|
17
|
+
*/
|
|
15
18
|
export const HOST_PROVIDED_PACKAGES = ["@capybara-hq/plugin-sdk", "zod"];
|
|
16
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Scripts npm runs automatically on install: a plugin package must never have any (installs run no
|
|
21
|
+
* scripts, so having them would mislead).
|
|
22
|
+
*/
|
|
17
23
|
export const FORBIDDEN_INSTALL_SCRIPTS = [
|
|
18
24
|
"preinstall",
|
|
19
25
|
"install",
|
|
20
26
|
"postinstall",
|
|
21
27
|
"prepare",
|
|
22
28
|
];
|
|
23
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Dependency fields that must not appear: third-party dependencies must be bundled into the entry.
|
|
31
|
+
*/
|
|
24
32
|
const FORBIDDEN_DEP_FIELDS = [
|
|
25
33
|
"dependencies",
|
|
26
34
|
"optionalDependencies",
|
|
@@ -28,16 +36,20 @@ const FORBIDDEN_DEP_FIELDS = [
|
|
|
28
36
|
"bundledDependencies",
|
|
29
37
|
];
|
|
30
38
|
const isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
31
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* npm package name rule (simplified): may carry a scope, lowercase, ≤ 214 characters (the length is
|
|
41
|
+
* checked separately).
|
|
42
|
+
*/
|
|
32
43
|
export const NPM_PACKAGE_NAME_RE = /^(?:@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*$/;
|
|
33
44
|
const NPM_NAME_RE = NPM_PACKAGE_NAME_RE;
|
|
34
45
|
/**
|
|
35
|
-
*
|
|
46
|
+
* Whether a path relative to the package is safe: non-empty, not starting with `/`, no `\`, control
|
|
47
|
+
* characters or drive letters, no empty segments, `.` or `..` segments, ≤ 1024 characters.
|
|
36
48
|
*/
|
|
37
49
|
export function isSafePackagePath(p) {
|
|
38
50
|
if (typeof p !== "string" || p === "" || p.length > 1024)
|
|
39
51
|
return false;
|
|
40
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex:
|
|
52
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: control characters are exactly what must be rejected
|
|
41
53
|
if (p.startsWith("/") || p.includes("\\") || /[\u0000-\u001f\u007f]/.test(p))
|
|
42
54
|
return false;
|
|
43
55
|
if (/^[A-Za-z]:/.test(p))
|
|
@@ -46,9 +58,11 @@ export function isSafePackagePath(p) {
|
|
|
46
58
|
}
|
|
47
59
|
const isHostPackage = (name) => HOST_PROVIDED_PACKAGES.some((h) => name === h || name.startsWith(`${h}/`));
|
|
48
60
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
61
|
+
* Checks the entry module's imports (C11): static and literal dynamic imports may only be `node:*`,
|
|
62
|
+
* {@link HOST_PROVIDED_PACKAGES} (subpaths included)
|
|
63
|
+
* and in-package relative paths (`./`, `../`; whether they escape the package is judged by the
|
|
64
|
+
* caller from the file location); non-literal dynamic imports are always rejected.
|
|
65
|
+
* Returns the list of problems (empty means valid).
|
|
52
66
|
*/
|
|
53
67
|
export function checkEntryImports(specifiers) {
|
|
54
68
|
const out = [];
|
|
@@ -72,7 +86,10 @@ export function checkEntryImports(specifiers) {
|
|
|
72
86
|
const WRAPPERS = new Set(["default", "prefault", "optional", "nullable", "readonly", "catch"]);
|
|
73
87
|
const defOf = (s) => s._zod.def;
|
|
74
88
|
const metaOf = (s) => s.meta();
|
|
75
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* The same traversal as the kernel's `configFields`: objects are expanded recursively, wrappers
|
|
91
|
+
* such as default / optional are stripped, and a secret on an object is inherited downward.
|
|
92
|
+
*/
|
|
76
93
|
function configFieldsOf(schema, prefix = "", inheritedSecret = false) {
|
|
77
94
|
if (!schema)
|
|
78
95
|
return [];
|
|
@@ -92,8 +109,10 @@ function configFieldsOf(schema, prefix = "", inheritedSecret = false) {
|
|
|
92
109
|
const byPath = (a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0;
|
|
93
110
|
const jsonClone = (v) => JSON.parse(JSON.stringify(v));
|
|
94
111
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
112
|
+
* The static part of the real manifest: written into `capybara.manifest` when packing, and compared
|
|
113
|
+
* with the in-package one at load time (`manifest_mismatch`).
|
|
114
|
+
* The result survives a JSON round trip (undefined fields removed); config fields are sorted by
|
|
115
|
+
* path.
|
|
97
116
|
*/
|
|
98
117
|
export function staticManifestOf(m) {
|
|
99
118
|
const out = {
|
|
@@ -254,24 +273,27 @@ export function hostSdkProblem(sdk, hostSdkVersion) {
|
|
|
254
273
|
return undefined;
|
|
255
274
|
return `extension.manifest.sdk "${sdk}" is not satisfied by the host SDK version ${hostSdkVersion}`;
|
|
256
275
|
}
|
|
257
|
-
/**
|
|
276
|
+
/** Limits of connector templates and catalog segments. */
|
|
258
277
|
export const CONNECTOR_TEMPLATE_LIMITS = {
|
|
259
|
-
/**
|
|
278
|
+
/** Upper bound on icon bytes. */
|
|
260
279
|
iconBytes: 64 * 1024,
|
|
261
|
-
/**
|
|
280
|
+
/** Upper bound on the characters of the endpoint preset after JSON serialization. */
|
|
262
281
|
endpointChars: 16 * 1024,
|
|
263
|
-
/** `editableEndpoint`
|
|
282
|
+
/** Upper bound on the number of `editableEndpoint` entries. */
|
|
264
283
|
editablePaths: 50,
|
|
265
|
-
/** `defaultToolPolicies`
|
|
284
|
+
/** Upper bound on the number of `defaultToolPolicies` entries. */
|
|
266
285
|
toolPolicies: 1000,
|
|
267
|
-
/** publisher
|
|
286
|
+
/** Upper bound on the characters of publisher. */
|
|
268
287
|
publisherChars: 100,
|
|
269
|
-
/** description
|
|
288
|
+
/** Upper bound on the characters of description. */
|
|
270
289
|
descriptionChars: 1024,
|
|
271
|
-
/** displayName
|
|
290
|
+
/** Upper bound on the characters of displayName per language. */
|
|
272
291
|
displayNameChars: 100,
|
|
273
292
|
};
|
|
274
|
-
/**
|
|
293
|
+
/**
|
|
294
|
+
* Catalog entry name (the same rule as manifest entry names): starts with a lowercase letter or
|
|
295
|
+
* digit, then lowercase letters, digits and hyphens, ≤ 64.
|
|
296
|
+
*/
|
|
275
297
|
export const CATALOG_ITEM_NAME_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
276
298
|
/** An exact semver version (a regex JSON Schema can use). */
|
|
277
299
|
export const SEMVER_VERSION_RE = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;
|
|
@@ -280,8 +302,9 @@ export const SHA512_INTEGRITY_RE = /^sha512-[A-Za-z0-9+/]{86}==$/;
|
|
|
280
302
|
const PATH_SEG_RE = /^[A-Za-z0-9_-]{1,100}$/;
|
|
281
303
|
const PROTO_KEYS = new Set(["__proto__", "prototype", "constructor"]);
|
|
282
304
|
/**
|
|
283
|
-
*
|
|
284
|
-
*
|
|
305
|
+
* Credential-style field names (compared lowercased with `-` and `_` removed): templates are seen
|
|
306
|
+
* by every org, so endpoint presets containing these keys are always rejected.
|
|
307
|
+
* Header names such as `authorization` / `cookie` are listed too (credentials in endpoint headers).
|
|
285
308
|
*/
|
|
286
309
|
const CREDENTIAL_KEYS = new Set([
|
|
287
310
|
"token",
|
|
@@ -306,7 +329,7 @@ const CREDENTIAL_KEYS = new Set([
|
|
|
306
329
|
"sessiontoken",
|
|
307
330
|
]);
|
|
308
331
|
const normKey = (k) => k.toLowerCase().replace(/[-_]/g, "");
|
|
309
|
-
/**
|
|
332
|
+
/** Recursively finds credential-style keys (reports only paths, never echoes values). */
|
|
310
333
|
function credentialKeyPaths(v, at, out, depth = 0) {
|
|
311
334
|
if (depth > 20)
|
|
312
335
|
return;
|
|
@@ -338,11 +361,16 @@ const TEMPLATE_KEYS = new Set([
|
|
|
338
361
|
"icon",
|
|
339
362
|
]);
|
|
340
363
|
/**
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
364
|
+
* Validates the static part of a connector template ({@link ConnectorTemplateSpec}) and returns the
|
|
365
|
+
* list of problems (empty means valid; paths are relative to the template root, values are not
|
|
366
|
+
* echoed):
|
|
367
|
+
* fields complete, no unknown fields; `auth` conforms to {@link ConnectorAuthSchema} (strict: extra
|
|
368
|
+
* fields such as `token` are rejected);
|
|
369
|
+
* no credential-style key at any level of the endpoint preset; `editableEndpoint` is a list of
|
|
370
|
+
* distinct dotted paths; `ownership` agrees with `auth.ownership`;
|
|
371
|
+
* default policies may only be allow / ask / deny; icon is an in-package .svg / .png path.
|
|
372
|
+
* Whether the endpoint conforms to the connector's `endpointSchema` and whether `editableEndpoint`
|
|
373
|
+
* exists in it is checked by the kernel on import against the loaded connector.
|
|
346
374
|
*/
|
|
347
375
|
export function validateConnectorTemplate(t) {
|
|
348
376
|
if (!isObj(t))
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Private Python 3 restricted Linux launcher and syscall broker (`linux-sandbox.py`), staged
|
|
3
|
+
* beside `native-files.py` by a trusted consumer that verifies both digests.
|
|
4
|
+
*
|
|
5
|
+
* Transport: `python3 -I linux-sandbox.py probe` prints the capability report. Otherwise one JSON
|
|
6
|
+
* request on stdin: `{mode: "exec" | "native", roots: {read, write: [{path, fd, dev, ino}]},
|
|
7
|
+
* network: {kind: "none" | "environment"} | {kind: "endpoints", endpoints: [{address, port}]},
|
|
8
|
+
* reportFd, cwd?, env?, argv (exec), timeoutMs? (exec), native (native-files request)}`.
|
|
9
|
+
* Root descriptors are pinned once by the consumer and inherited; the launcher verifies their
|
|
10
|
+
* identity and never reopens a root pathname. Landlock rules, broker metadata checks and the
|
|
11
|
+
* native helper all use those same descriptors. JSON events (`launch`, `exit`, `refused`) go to
|
|
12
|
+
* reportFd, which the restricted child cannot write. SIGTERM cancels the whole owned tree.
|
|
13
|
+
* Full access never uses this launcher: it has no restricted filters.
|
|
14
|
+
*/
|
|
15
|
+
export declare const LINUX_SANDBOX_SOURCE: string;
|