@crouter/api 0.3.386 → 0.3.388
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/__tests__/integration/client.test.js +97 -0
- package/dist/api/client.d.ts +7 -0
- package/dist/api/client.js +40 -21
- package/dist/core/asset-root.d.ts +7 -0
- package/dist/core/asset-root.js +18 -0
- package/dist/core/canvas/boot-id.d.ts +6 -0
- package/dist/core/canvas/boot-id.js +26 -0
- package/dist/core/canvas/paths.d.ts +72 -0
- package/dist/core/canvas/paths.js +163 -0
- package/dist/core/canvas/pid.d.ts +391 -0
- package/dist/core/canvas/pid.js +948 -0
- package/dist/core/command-plugins/bundle.d.ts +149 -0
- package/dist/core/command-plugins/bundle.js +588 -0
- package/dist/core/command-plugins/endpoint.d.ts +24 -0
- package/dist/core/command-plugins/endpoint.js +51 -0
- package/dist/core/config.d.ts +233 -0
- package/dist/core/config.js +1120 -0
- package/dist/core/env-name.d.ts +6 -0
- package/dist/core/env-name.js +9 -0
- package/dist/core/errors.d.ts +38 -0
- package/dist/core/errors.js +90 -0
- package/dist/core/events/emit.d.ts +6 -0
- package/dist/core/events/emit.js +42 -0
- package/dist/core/events/envelope.d.ts +2 -0
- package/dist/core/events/envelope.js +84 -0
- package/dist/core/events/errors.d.ts +4 -0
- package/dist/core/events/errors.js +69 -0
- package/dist/core/events/operation-id.d.ts +4 -0
- package/dist/core/events/operation-id.js +24 -0
- package/dist/core/events/serialize.d.ts +4 -0
- package/dist/core/events/serialize.js +199 -0
- package/dist/core/events/source.d.ts +16 -0
- package/dist/core/events/source.js +31 -0
- package/dist/core/events/types.d.ts +68 -0
- package/dist/core/events/types.js +11 -0
- package/dist/core/exclusive-lock.d.ts +34 -0
- package/dist/core/exclusive-lock.js +197 -0
- package/dist/core/fs-utils.d.ts +44 -0
- package/dist/core/fs-utils.js +208 -0
- package/dist/core/help.d.ts +309 -0
- package/dist/core/help.js +406 -0
- package/dist/core/human/page-catalog.d.ts +57 -0
- package/dist/core/human/page-catalog.js +172 -0
- package/dist/core/installed-plugins.d.ts +2 -0
- package/dist/core/installed-plugins.js +79 -0
- package/dist/core/io.d.ts +122 -0
- package/dist/core/io.js +373 -0
- package/dist/core/keybindings/attach-control.d.ts +49 -0
- package/dist/core/keybindings/attach-control.js +42 -0
- package/dist/core/keybindings/catalog.d.ts +18 -0
- package/dist/core/keybindings/catalog.js +257 -0
- package/dist/core/keybindings/types.d.ts +42 -0
- package/dist/core/keybindings/types.js +1 -0
- package/dist/core/layout.d.ts +26 -0
- package/dist/core/layout.js +94 -0
- package/dist/core/locked-file.d.ts +27 -0
- package/dist/core/locked-file.js +118 -0
- package/dist/core/log.d.ts +9 -0
- package/dist/core/log.js +89 -0
- package/dist/core/manifest.d.ts +5 -0
- package/dist/core/manifest.js +15 -0
- package/dist/core/plugin-env.d.ts +8 -0
- package/dist/core/plugin-env.js +31 -0
- package/dist/core/plugin-extensions.d.ts +29 -0
- package/dist/core/plugin-extensions.js +191 -0
- package/dist/core/plugin-swap-lock.d.ts +9 -0
- package/dist/core/plugin-swap-lock.js +31 -0
- package/dist/core/preview-result-path.d.ts +4 -0
- package/dist/core/preview-result-path.js +26 -0
- package/dist/core/profiles/env-store.d.ts +22 -0
- package/dist/core/profiles/env-store.js +163 -0
- package/dist/core/profiles/fuzzy-match.d.ts +19 -0
- package/dist/core/profiles/fuzzy-match.js +92 -0
- package/dist/core/profiles/manifest.d.ts +120 -0
- package/dist/core/profiles/manifest.js +529 -0
- package/dist/core/rate-limit-scope.d.ts +25 -0
- package/dist/core/rate-limit-scope.js +64 -0
- package/dist/core/render.d.ts +12 -0
- package/dist/core/render.js +138 -0
- package/dist/core/resolver.d.ts +14 -0
- package/dist/core/resolver.js +111 -0
- package/dist/core/runtime/branded-host.d.ts +25 -0
- package/dist/core/runtime/branded-host.js +264 -0
- package/dist/core/runtime/broker/daemon-ops.d.ts +65 -0
- package/dist/core/runtime/broker/daemon-ops.js +177 -0
- package/dist/core/runtime/broker/signal-stream.d.ts +30 -0
- package/dist/core/runtime/broker/signal-stream.js +149 -0
- package/dist/core/scope.d.ts +32 -0
- package/dist/core/scope.js +184 -0
- package/dist/core/scoped-state/db.d.ts +17 -0
- package/dist/core/scoped-state/db.js +247 -0
- package/dist/core/scoped-state/migrate.d.ts +8 -0
- package/dist/core/scoped-state/migrate.js +187 -0
- package/dist/core/scoped-state/paths.d.ts +9 -0
- package/dist/core/scoped-state/paths.js +27 -0
- package/dist/core/scoped-state/profiles.d.ts +27 -0
- package/dist/core/scoped-state/profiles.js +93 -0
- package/dist/core/scoped-state/providers.d.ts +24 -0
- package/dist/core/scoped-state/providers.js +19 -0
- package/dist/core/scoped-state/schema.d.ts +6 -0
- package/dist/core/scoped-state/schema.js +43 -0
- package/dist/core/scoped-state/settings.d.ts +28 -0
- package/dist/core/scoped-state/settings.js +83 -0
- package/dist/core/spaces/open-beneath.d.ts +71 -0
- package/dist/core/spaces/open-beneath.js +581 -0
- package/dist/core/sqlite-statements.d.ts +4 -0
- package/dist/core/sqlite-statements.js +17 -0
- package/dist/core/subscription-state.d.ts +121 -0
- package/dist/core/subscription-state.js +287 -0
- package/dist/core/user-settings.d.ts +377 -0
- package/dist/core/user-settings.js +458 -0
- package/dist/daemon/broker-signals/bus.d.ts +30 -0
- package/dist/daemon/broker-signals/bus.js +87 -0
- package/dist/daemon/manage.d.ts +176 -0
- package/dist/daemon/manage.js +664 -0
- package/dist/daemon/pidfile.d.ts +8 -0
- package/dist/daemon/pidfile.js +37 -0
- package/dist/daemon/startup-policy.d.ts +1 -0
- package/dist/daemon/startup-policy.js +1 -0
- package/dist/native/linux.d.ts +29 -0
- package/dist/native/linux.js +20 -0
- package/dist/shared/env.d.ts +116 -0
- package/dist/shared/env.js +271 -0
- package/dist/shared/inbox-entry-body.d.ts +22 -0
- package/dist/shared/inbox-entry-body.js +116 -0
- package/dist/shared/working-activity.d.ts +9 -0
- package/dist/shared/working-activity.js +27 -0
- package/dist/types.d.ts +562 -0
- package/dist/types.js +186 -0
- package/package.json +1 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { type ValidatedCommandManifest } from '../../api/command-manifest/manifest.js';
|
|
2
|
+
import type { KindConfig, MemoryExtensionDeclarations, PageComponentRegistration, PluginBundle, PluginManifest, Scope } from '../../types.js';
|
|
3
|
+
/** Who may call a capability provider's tool group (contract 3). */
|
|
4
|
+
export type ProviderGroupWho = 'own' | 'user' | 'allowlist' | 'any';
|
|
5
|
+
/** One tool group a capability provider declares in `bundle.json`. */
|
|
6
|
+
export interface ProviderGroupDeclaration {
|
|
7
|
+
group: string;
|
|
8
|
+
consent_line: string;
|
|
9
|
+
/** Price per unit, or null/absent when the group is unpriced. */
|
|
10
|
+
rate?: number | null;
|
|
11
|
+
who: ProviderGroupWho;
|
|
12
|
+
/** The app principals the group admits: `[]` unless `who` is `allowlist`
|
|
13
|
+
* (where it may also be empty). */
|
|
14
|
+
allowlist: string[];
|
|
15
|
+
}
|
|
16
|
+
/** The `provider` block of a capability-provider bundle emitted by the directory. */
|
|
17
|
+
export interface ProviderBlock {
|
|
18
|
+
id: string;
|
|
19
|
+
major: number;
|
|
20
|
+
groups: ProviderGroupDeclaration[];
|
|
21
|
+
}
|
|
22
|
+
export interface BundleIssue {
|
|
23
|
+
code: string;
|
|
24
|
+
path?: string;
|
|
25
|
+
message: string;
|
|
26
|
+
received: string;
|
|
27
|
+
expected: string;
|
|
28
|
+
next: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ValidatedBundle {
|
|
31
|
+
bundleVersion: 1;
|
|
32
|
+
/** The plugin's integer major: `bundle.json` `version`, else `commands.json`
|
|
33
|
+
* `version`; absent when neither declares one (treated as 1 locally). */
|
|
34
|
+
version?: number;
|
|
35
|
+
/** The transport `bundle.json` declares, when it declares one (a bundle the
|
|
36
|
+
* directory emits for a capability provider always does). */
|
|
37
|
+
transport?: {
|
|
38
|
+
kind: 'http';
|
|
39
|
+
endpoint: string;
|
|
40
|
+
authEnv?: string;
|
|
41
|
+
};
|
|
42
|
+
/** The capability-provider block: present only on a provider bundle. */
|
|
43
|
+
provider?: ProviderBlock;
|
|
44
|
+
/** Kind-registry contributions declared in `bundle.json` (optional). The
|
|
45
|
+
* installer copies this validated block into the synthesized plugin
|
|
46
|
+
* manifest, where `readMergedLaunchConfig` layers it — see
|
|
47
|
+
* `PluginManifest.kinds`. */
|
|
48
|
+
kinds?: Record<string, Partial<KindConfig>>;
|
|
49
|
+
/** Page-component contributions declared in `bundle.json` (optional). The
|
|
50
|
+
* installer copies this validated block into the synthesized plugin
|
|
51
|
+
* manifest, where `resolvePageComponents` reads it — see
|
|
52
|
+
* `PluginManifest.page_components`. */
|
|
53
|
+
page_components?: PageComponentRegistration[];
|
|
54
|
+
/** Plugin-owned memory metadata declarations copied into the synthesized
|
|
55
|
+
* installed manifest alongside the archive's memory documents. */
|
|
56
|
+
memory_extensions?: MemoryExtensionDeclarations;
|
|
57
|
+
commands: ValidatedCommandManifest;
|
|
58
|
+
commandsBytes: Uint8Array;
|
|
59
|
+
directories: ReadonlyArray<{
|
|
60
|
+
path: string;
|
|
61
|
+
}>;
|
|
62
|
+
memory: ReadonlyArray<{
|
|
63
|
+
path: string;
|
|
64
|
+
bytes: Uint8Array;
|
|
65
|
+
}>;
|
|
66
|
+
hooks?: {
|
|
67
|
+
manifest: Uint8Array;
|
|
68
|
+
files: ReadonlyArray<{
|
|
69
|
+
path: string;
|
|
70
|
+
bytes: Uint8Array;
|
|
71
|
+
}>;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface PluginBundleValidation {
|
|
75
|
+
bundle?: ValidatedBundle;
|
|
76
|
+
issues: BundleIssue[];
|
|
77
|
+
}
|
|
78
|
+
/** Validate a Core-served plugin directory archive entirely in memory. */
|
|
79
|
+
export declare function validatePluginBundle(archive: Uint8Array, options: {
|
|
80
|
+
reservedCoreNames: ReadonlySet<string>;
|
|
81
|
+
coreCommandPaths?: ReadonlySet<string>;
|
|
82
|
+
extensibleCoreBranches?: ReadonlySet<string>;
|
|
83
|
+
}): Promise<PluginBundleValidation>;
|
|
84
|
+
/** An archive install's invocation transport. */
|
|
85
|
+
export type BundleInvocationTransport = {
|
|
86
|
+
kind: 'http';
|
|
87
|
+
endpoint: string;
|
|
88
|
+
authEnv?: string;
|
|
89
|
+
};
|
|
90
|
+
/** The hash recorded as a bundle package's `version`: the exact archive bytes
|
|
91
|
+
* unpacked at its root. Same bytes, same version — which is what lets a
|
|
92
|
+
* re-sent archive be recognized as the generation already installed. */
|
|
93
|
+
export declare function bundleVersion(raw: Uint8Array): string;
|
|
94
|
+
/** Whether `version` is the generation already unpacked at `root`. Both halves
|
|
95
|
+
* matter: the recorded version says the config agrees, and `commands.json`
|
|
96
|
+
* says the tree that config describes is actually on disk. A swap that died
|
|
97
|
+
* between the rename and the config write leaves the second false, and that is
|
|
98
|
+
* exactly the case a no-op must not claim. */
|
|
99
|
+
export declare function isInstalledGeneration(name: string, scope: Scope, root: string, version: string): boolean;
|
|
100
|
+
/** The ledger for a check that reached a served archive. `swapped` says whether
|
|
101
|
+
* that archive replaced the package on disk; the validator and the check time
|
|
102
|
+
* are recorded either way, because both describe the bytes now at the root. */
|
|
103
|
+
export declare function recordCheckedGeneration(scope: Scope, name: string, etag: string | undefined, options: {
|
|
104
|
+
swapped: boolean;
|
|
105
|
+
}): void;
|
|
106
|
+
export interface InstallBundleArchiveOptions<M> {
|
|
107
|
+
scope: Scope;
|
|
108
|
+
/** The scope root whose `tmp/` holds staging, `.prev` and the swap lock. */
|
|
109
|
+
scopeRootPath: string;
|
|
110
|
+
/** Where the package lives once swapped in: `<plugins>/<name>`. */
|
|
111
|
+
root: string;
|
|
112
|
+
/** The archive source recorded on the manifest. */
|
|
113
|
+
bundle: PluginBundle;
|
|
114
|
+
/** Invocation transport for an ordinary archive. A provider bundle's own
|
|
115
|
+
* `bundle.json` transport (the provider endpoint) replaces it: the archive
|
|
116
|
+
* comes from the directory, but calls go to the provider. */
|
|
117
|
+
transport: BundleInvocationTransport;
|
|
118
|
+
/** The server's validator for `raw`, recorded once the swap lands. */
|
|
119
|
+
etag: string | undefined;
|
|
120
|
+
enable: boolean;
|
|
121
|
+
/** `bundleVersion(raw)` when the caller already computed it. */
|
|
122
|
+
version?: string;
|
|
123
|
+
validation: {
|
|
124
|
+
reservedCoreNames: ReadonlySet<string>;
|
|
125
|
+
coreCommandPaths?: ReadonlySet<string>;
|
|
126
|
+
extensibleCoreBranches?: ReadonlySet<string>;
|
|
127
|
+
};
|
|
128
|
+
/** Full candidate validation of the staged tree; throws to refuse it. */
|
|
129
|
+
validateStaged: (staging: string, manifest: PluginManifest) => Promise<M>;
|
|
130
|
+
/** Builds the error an invalid archive throws. */
|
|
131
|
+
invalid: (summary: string, issues: readonly BundleIssue[]) => Error;
|
|
132
|
+
/** Checked against the validated archive before anything is written; a
|
|
133
|
+
* returned message refuses the archive (a provider bundle naming another id). */
|
|
134
|
+
accept?: (bundle: ValidatedBundle) => string | undefined;
|
|
135
|
+
}
|
|
136
|
+
export interface InstalledBundleArchive<M> {
|
|
137
|
+
manifest: PluginManifest;
|
|
138
|
+
validated: ValidatedBundle;
|
|
139
|
+
version: string;
|
|
140
|
+
root: string;
|
|
141
|
+
staged: M;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Validate `raw`, stage it beside the package root, swap it in, then record
|
|
145
|
+
* the config version and the state validator — in that order, never the
|
|
146
|
+
* reverse. A failure before the swap leaves the previous package untouched.
|
|
147
|
+
* The caller holds the plugin's swap lock (`bundleSwapLockPath`).
|
|
148
|
+
*/
|
|
149
|
+
export declare function installBundleArchive<M>(name: string, raw: Uint8Array, options: InstallBundleArchiveOptions<M>): Promise<InstalledBundleArchive<M>>;
|