@jini-ai/plugins 0.7.3-next.1 → 0.7.3-next.3
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/CHANGELOG.md +6 -0
- package/README.md +53 -0
- package/dist/host/activation-polling.d.ts +67 -0
- package/dist/host/activation-polling.js +113 -0
- package/dist/host/activation.d.ts +2 -30
- package/dist/host/capability-tools.d.ts +1 -0
- package/dist/host/capability-tools.js +4 -4
- package/dist/host/contributions.d.ts +2 -9
- package/dist/host/hook-refusals.d.ts +49 -0
- package/dist/host/hook-refusals.js +65 -0
- package/dist/host/index.d.ts +3 -1
- package/dist/host/index.js +1 -0
- package/dist/host/manifest.js +2 -2
- package/dist/host/node/browser-provider-assets.d.ts +2 -1
- package/dist/host/node/browser-provider-assets.js +2 -2
- package/dist/host/node/discovery.js +5 -5
- package/dist/host/node/install.d.ts +6 -1
- package/dist/host/node/install.js +22 -20
- package/dist/host/node/integrity-command.d.ts +2 -1
- package/dist/host/node/integrity-command.js +3 -3
- package/dist/host/node/loader.d.ts +3 -2
- package/dist/host/node/loader.js +6 -6
- package/dist/host/node/module-snapshot.d.ts +4 -3
- package/dist/host/node/module-snapshot.js +5 -5
- package/dist/host/node/package-files.d.ts +2 -1
- package/dist/host/node/package-files.js +6 -6
- package/dist/host/node/runtime-activation.d.ts +35 -0
- package/dist/host/node/runtime-activation.js +188 -0
- package/dist/host/node/runtime-boot.d.ts +16 -0
- package/dist/host/node/runtime-boot.js +153 -0
- package/dist/host/node/runtime-conflicts.d.ts +38 -0
- package/dist/host/node/runtime-conflicts.js +42 -0
- package/dist/host/node/runtime-contracts.d.ts +5 -3
- package/dist/host/node/runtime-core.js +65 -465
- package/dist/host/node/runtime-load-target.d.ts +14 -0
- package/dist/host/node/runtime-load-target.js +15 -0
- package/dist/host/node/runtime-reload.d.ts +12 -0
- package/dist/host/node/runtime-reload.js +107 -0
- package/dist/host/node/runtime-state.d.ts +52 -0
- package/dist/host/node/runtime-state.js +50 -0
- package/dist/host/node/source-drafts.d.ts +1 -1
- package/dist/host/node/source-drafts.js +17 -15
- package/dist/host/plugin-claims.d.ts +2 -9
- package/dist/host/plugin-format.d.ts +5 -5
- package/dist/host/plugin-format.js +9 -10
- package/dist/host/ports.d.ts +4 -28
- package/dist/host/tools/install.js +1 -1
- package/dist/host/uninstall.d.ts +2 -2
- package/dist/host/worker/import-policy.d.ts +49 -0
- package/dist/host/worker/import-policy.js +86 -0
- package/dist/host/worker/import-seam.js +21 -2
- package/dist/host/worker/index.d.ts +1 -0
- package/dist/host/worker/index.js +1 -0
- package/dist/host/worker/protocol.d.ts +4 -0
- package/dist/host/worker/run-call.js +2 -1
- package/dist/host/worker/start.d.ts +18 -1
- package/dist/host/worker/start.js +27 -6
- package/dist/react/PluginProviderSettingsDialog.d.ts +144 -0
- package/dist/react/PluginProviderSettingsDialog.js +54 -0
- package/dist/react/plugin-install-port.d.ts +29 -0
- package/dist/react/plugin-install-port.js +15 -0
- package/dist/runtime/agent-tools.d.ts +174 -0
- package/dist/runtime/agent-tools.js +121 -0
- package/dist/runtime/built-ins/word-count/count-words.d.ts +21 -0
- package/dist/runtime/built-ins/word-count/count-words.js +48 -0
- package/dist/runtime/built-ins/word-count/plugin.d.ts +6 -0
- package/dist/runtime/built-ins/word-count/plugin.js +12 -0
- package/dist/runtime/capability-card.d.ts +22 -0
- package/dist/runtime/capability-card.js +30 -0
- package/dist/runtime/enable-confirmation-ui.d.ts +28 -0
- package/dist/runtime/enable-confirmation-ui.js +54 -0
- package/dist/runtime/install-consent.d.ts +12 -0
- package/dist/runtime/install-consent.js +27 -0
- package/dist/runtime/install-source.d.ts +26 -0
- package/dist/runtime/install-source.js +61 -0
- package/dist/runtime/install-tool-catalog.d.ts +9 -0
- package/dist/runtime/install-tool-catalog.js +25 -0
- package/dist/runtime/lower-tool-access.d.ts +17 -0
- package/dist/runtime/lower-tool-access.js +14 -0
- package/dist/runtime/plugin-export.d.ts +13 -0
- package/dist/runtime/plugin-export.js +14 -0
- package/dist/runtime/plugin-host-copy.d.ts +17 -0
- package/dist/runtime/plugin-host-copy.js +7 -0
- package/dist/runtime/plugin-tool-ids.d.ts +18 -0
- package/dist/runtime/plugin-tool-ids.js +4 -0
- package/dist/runtime/plugin-tool-messages.d.ts +97 -0
- package/dist/runtime/plugin-tool-messages.js +90 -0
- package/dist/runtime/sdk-resolver.d.ts +60 -0
- package/dist/runtime/sdk-resolver.js +97 -0
- package/dist/runtime/service-ports.d.ts +43 -0
- package/dist/runtime/service-ports.js +3 -0
- package/dist/runtime/source-tool-catalog.d.ts +7 -0
- package/dist/runtime/source-tool-catalog.js +33 -0
- package/dist/runtime/uninstall-confirmation-ui.d.ts +31 -0
- package/dist/runtime/uninstall-confirmation-ui.js +38 -0
- package/dist/runtime/widget-partials.d.ts +22 -0
- package/dist/runtime/widget-partials.js +13 -0
- package/dist/site/lipay/manifest.d.ts +10 -0
- package/dist/site/lipay/manifest.js +96 -0
- package/dist/site/store/manifest.d.ts +10 -0
- package/dist/site/store/manifest.js +37 -0
- package/package.json +158 -8
- package/dist/host/provider-config-source.d.ts +0 -47
- package/dist/host/provider-config-source.js +0 -2
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Boot and provider-admission phases of the plugin runtime core (G08 split): first-boot
|
|
3
|
+
* defaults, the boot conflict pass, per-plugin re-attach and bounded provider loading. Every failure
|
|
4
|
+
* here is logged and isolated per plugin; nothing throws out of boot.
|
|
5
|
+
*/
|
|
6
|
+
import { describeErrorForLog, redactSecrets } from "@jini-ai/core";
|
|
7
|
+
import { observed } from "@jini-ai/core/errors/idioms";
|
|
8
|
+
import { createConsoleLogger } from "@jini-ai/core/primitives";
|
|
9
|
+
import { initializeBundledPlugins } from "../bundled-initialization.js";
|
|
10
|
+
import { quarantinePlugin } from "../quarantine.js";
|
|
11
|
+
import { describeBootConflictQuarantine } from "../plugin-claims.js";
|
|
12
|
+
import { assertPluginInstallIdle } from "./install.js";
|
|
13
|
+
import { PluginLoadError } from "./loader.js";
|
|
14
|
+
import { declaresProviders } from "./runtime-load-target.js";
|
|
15
|
+
import { attachPlugin, onPluginDisabled, onPluginEnabled } from "./runtime-activation.js";
|
|
16
|
+
import { discoverActivePlugins, discoverPlugins, listPluginConflicts } from "./runtime-conflicts.js";
|
|
17
|
+
/** Boot-time conflict pass (2026-10-04): the newer plugin of every conflicting pair is turned off
|
|
18
|
+
* through the same durable quarantine record hook failures use, with the clash as its reason, so
|
|
19
|
+
* it shows on the admin row and stays off on the next boot instead of racing the older one. */
|
|
20
|
+
async function quarantineConflictingAtBoot({ state, conflicts, enabledIds }, _options = {}) {
|
|
21
|
+
const quarantined = new Set();
|
|
22
|
+
for (const [pluginId, pluginConflicts] of conflicts) {
|
|
23
|
+
if (!enabledIds.has(pluginId))
|
|
24
|
+
continue;
|
|
25
|
+
const reason = describeBootConflictQuarantine({ conflicts: pluginConflicts });
|
|
26
|
+
await quarantinePlugin({ deps: state.quarantineDeps, input: { pluginId, workspaceId: state.required.workspaceId, consecutiveFailures: 0, reason } });
|
|
27
|
+
onPluginDisabled({ state, pluginId });
|
|
28
|
+
createConsoleLogger({ prefix: '' }).warn({ message: `[plugin-runtime] '${pluginId}' quarantined at boot: ${reason}` });
|
|
29
|
+
quarantined.add(pluginId);
|
|
30
|
+
}
|
|
31
|
+
return quarantined;
|
|
32
|
+
}
|
|
33
|
+
async function initializeBootDefaults({ state }, _options = {}) {
|
|
34
|
+
const { optional, required } = state;
|
|
35
|
+
// Serialize first-boot defaults with boot attachment. Existing disabled/quarantined rows win.
|
|
36
|
+
const initialized = await initializeBundledPlugins({
|
|
37
|
+
deps: { clock: required.clock, repo: required.activationRepo, discovery: optional.bundledEnabledIds?.length ? await discoverPlugins({ state }).catch((error) => {
|
|
38
|
+
console.warn("[plugin-runtime] bundled discovery failed; chart providers remain unavailable", describeErrorForLog({ err: error }));
|
|
39
|
+
return [];
|
|
40
|
+
}) : [], onEnabled: (pluginId) => onPluginEnabled({ state, pluginId }) },
|
|
41
|
+
input: { workspaceId: required.workspaceId, pluginIds: optional.bundledEnabledIds ?? [] },
|
|
42
|
+
});
|
|
43
|
+
for (const failure of initialized.failed)
|
|
44
|
+
console.warn(redactSecrets({ input: `[plugin-runtime] bundled initialization failed for '${failure.pluginId}'` }, { redactPii: false }), describeErrorForLog({ err: failure.error }));
|
|
45
|
+
return initialized;
|
|
46
|
+
}
|
|
47
|
+
/** Discovery + conflict quarantine for the enabled set. Returns null (after turning every enabled plugin
|
|
48
|
+
* off) when the pass could not finish. */
|
|
49
|
+
async function runBootConflictPass({ state, enabledHere }, _options = {}) {
|
|
50
|
+
try {
|
|
51
|
+
const discovery = await discoverActivePlugins({ state });
|
|
52
|
+
const quarantined = await quarantineConflictingAtBoot({
|
|
53
|
+
state,
|
|
54
|
+
conflicts: await listPluginConflicts({ state, discovery }),
|
|
55
|
+
enabledIds: new Set(enabledHere.map((record) => record.pluginId)),
|
|
56
|
+
});
|
|
57
|
+
return { discovery, quarantined };
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
// Fail closed: without a finished conflict pass there is no telling which of two clashing
|
|
61
|
+
// plugins should run, so none is attached this boot (each would previously have failed its
|
|
62
|
+
// own discovery read here anyway). Logged, not thrown — same isolation as a per-plugin failure.
|
|
63
|
+
createConsoleLogger({ prefix: '' }).warn({ message: '[plugin-runtime] boot conflict check failed, no plugin attached' }, { error });
|
|
64
|
+
for (const record of enabledHere)
|
|
65
|
+
onPluginDisabled({ state, pluginId: record.pluginId });
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export async function attachEnabledPluginsAtBoot({ state }, _options = {}) {
|
|
70
|
+
await state.snapshots?.ready;
|
|
71
|
+
const initialized = await initializeBootDefaults({ state }, {});
|
|
72
|
+
const records = await state.required.activationRepo.listAll();
|
|
73
|
+
const enabledHere = records.filter((record) => record.workspaceId === state.required.workspaceId && record.enabled);
|
|
74
|
+
if (enabledHere.length === 0)
|
|
75
|
+
return;
|
|
76
|
+
const pass = await runBootConflictPass({ state, enabledHere });
|
|
77
|
+
if (pass === null)
|
|
78
|
+
return;
|
|
79
|
+
for (const record of enabledHere) {
|
|
80
|
+
// The initializer already attached it.
|
|
81
|
+
if (pass.quarantined.has(record.pluginId) || initialized.enabled.includes(record.pluginId))
|
|
82
|
+
continue;
|
|
83
|
+
await reattachBootPlugin({ state, pluginId: record.pluginId, discovery: pass.discovery });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
async function reattachBootPlugin({ state, pluginId, discovery }, _options = {}) {
|
|
87
|
+
const { installDir } = state;
|
|
88
|
+
try {
|
|
89
|
+
if (installDir !== undefined)
|
|
90
|
+
await assertPluginInstallIdle({ installDir });
|
|
91
|
+
const discovered = discovery.find((candidate) => candidate.id === pluginId);
|
|
92
|
+
if (!discovered)
|
|
93
|
+
throw new PluginLoadError(pluginId, "PLUGIN_EXPORT_INVALID");
|
|
94
|
+
// A tier-1 plugin has no code to re-attach; its declared types were stored at enable.
|
|
95
|
+
// Provider plugins were already loaded by `loadProviderPlugins`, ahead of application work.
|
|
96
|
+
if (discovered.manifest?.tier === "tier-1" || declaresProviders({ manifest: discovered.manifest }))
|
|
97
|
+
return;
|
|
98
|
+
await attachPlugin({ state, pluginId, record: discovered });
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
createConsoleLogger({ prefix: '' }).warn({ message: `[plugin-runtime] boot re-attach failed for '${pluginId}'` }, { error });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/** Import + setup of one selected provider plugin, bounded: boot never waits on a stalled plugin. On the
|
|
105
|
+
* deadline the caller revokes the selection (`onPluginDisabled`), so a late setup cannot publish. */
|
|
106
|
+
async function attachProviderWithin({ state, record, timeoutMs }, _options = {}) {
|
|
107
|
+
let timer;
|
|
108
|
+
const deadline = new Promise((_, reject) => {
|
|
109
|
+
timer = setTimeout(() => reject(new Error(`provider plugin load timed out after ${timeoutMs} ms`)), timeoutMs);
|
|
110
|
+
});
|
|
111
|
+
const attached = attachPlugin({ state, pluginId: record.id, record });
|
|
112
|
+
// Observed even after the deadline wins, so a late failure is never an unhandled rejection.
|
|
113
|
+
observed({ promise: attached });
|
|
114
|
+
try {
|
|
115
|
+
await Promise.race([attached, deadline]);
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
clearTimeout(timer);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** Ids of the plugins whose activation row is enabled in THIS workspace. */
|
|
122
|
+
async function enabledPluginIds({ state }, _options = {}) {
|
|
123
|
+
return new Set((await state.required.activationRepo.listAll())
|
|
124
|
+
.filter((row) => row.workspaceId === state.required.workspaceId && row.enabled).map((row) => row.pluginId));
|
|
125
|
+
}
|
|
126
|
+
export async function listProviderPlugins({ state }, _options = {}) {
|
|
127
|
+
const enabled = await enabledPluginIds({ state });
|
|
128
|
+
return (await discoverActivePlugins({ state }))
|
|
129
|
+
.filter((record) => enabled.has(record.id) && declaresProviders({ manifest: record.manifest }))
|
|
130
|
+
.map((record) => ({ pluginId: record.id, providers: record.manifest.contributes.providers }));
|
|
131
|
+
}
|
|
132
|
+
export async function loadProviderPlugins({ state, pluginIds }, options = {}) {
|
|
133
|
+
const wanted = new Set(pluginIds);
|
|
134
|
+
if (wanted.size === 0)
|
|
135
|
+
return [];
|
|
136
|
+
const enabled = await enabledPluginIds({ state });
|
|
137
|
+
const loaded = [];
|
|
138
|
+
for (const record of await discoverActivePlugins({ state })) {
|
|
139
|
+
if (!wanted.has(record.id) || !enabled.has(record.id) || !declaresProviders({ manifest: record.manifest }))
|
|
140
|
+
continue;
|
|
141
|
+
state.selectedProviders.add(record.id);
|
|
142
|
+
try {
|
|
143
|
+
await attachProviderWithin({ state, record, timeoutMs: options.timeoutMs ?? 10_000 });
|
|
144
|
+
loaded.push(record.id);
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
onPluginDisabled({ state, pluginId: record.id });
|
|
148
|
+
console.warn(`[plugin-runtime] provider plugin '${record.id}' failed to load; its contract stays on the noop: ${describeErrorForLog({ err: error })}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return loaded;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=runtime-boot.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Discovery and conflict-gate phase of the plugin runtime core (G08 split): which plugins exist
|
|
3
|
+
* for this workspace and what each would clash with. Reads the shared {@link RuntimeState}; writes none.
|
|
4
|
+
*/
|
|
5
|
+
import { type PluginConflict } from "../plugin-claims.js";
|
|
6
|
+
import type { PluginDiscoveryRecord } from "../discovery-types.js";
|
|
7
|
+
import type { PluginManifest } from "../manifest-types.js";
|
|
8
|
+
import type { RuntimeState } from "./runtime-state.js";
|
|
9
|
+
export declare function discoverPlugins<E, O>({ state }: {
|
|
10
|
+
state: RuntimeState<E, O>;
|
|
11
|
+
}, _options?: {}): Promise<readonly PluginDiscoveryRecord[]>;
|
|
12
|
+
/** Retained versions make the activation row's existing active pointer meaningful at boot
|
|
13
|
+
* and reload. A newly installed version is not running until controlled reload advances it. */
|
|
14
|
+
export declare function discoverActivePlugins<E, O>({ state }: {
|
|
15
|
+
state: RuntimeState<E, O>;
|
|
16
|
+
}, _options?: {}): Promise<readonly PluginDiscoveryRecord[]>;
|
|
17
|
+
export declare function listPluginConflicts<E, O>({ state, discovery }: {
|
|
18
|
+
state: RuntimeState<E, O>;
|
|
19
|
+
discovery?: readonly PluginDiscoveryRecord[];
|
|
20
|
+
}, optional?: {
|
|
21
|
+
candidateId?: string;
|
|
22
|
+
}): Promise<ReadonlyMap<string, readonly PluginConflict[]>>;
|
|
23
|
+
/** Install preview (2026-10-04): what the staged package would clash with if turned on in THIS
|
|
24
|
+
* workspace now. A synthetic valid record stands in for it and REPLACES an installed version of the
|
|
25
|
+
* same id, so an upgrade is judged by its new manifest only. */
|
|
26
|
+
export declare function installPreviewConflicts<E, O>({ state, manifest }: {
|
|
27
|
+
state: RuntimeState<E, O>;
|
|
28
|
+
manifest: PluginManifest;
|
|
29
|
+
}, _options?: {}): Promise<readonly PluginConflict[]>;
|
|
30
|
+
/** Enable-time conflict gate (2026-10-04): runs before `loadPlugin()`, so a plugin that would
|
|
31
|
+
* take a name core or an enabled plugin holds never has its code imported. The candidate is
|
|
32
|
+
* ordered after every enabled plugin — it is the newer one by definition. */
|
|
33
|
+
export declare function assertNoConflicts<E, O>({ state, pluginId, discovery }: {
|
|
34
|
+
state: RuntimeState<E, O>;
|
|
35
|
+
pluginId: string;
|
|
36
|
+
discovery: readonly PluginDiscoveryRecord[];
|
|
37
|
+
}, _options?: {}): Promise<void>;
|
|
38
|
+
//# sourceMappingURL=runtime-conflicts.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Discovery and conflict-gate phase of the plugin runtime core (G08 split): which plugins exist
|
|
3
|
+
* for this workspace and what each would clash with. Reads the shared {@link RuntimeState}; writes none.
|
|
4
|
+
*/
|
|
5
|
+
import { PluginConflictError, resolvePluginConflicts } from "../plugin-claims.js";
|
|
6
|
+
import { discoverPlugins as discoverPluginRuntimePlugins } from "./discovery.js";
|
|
7
|
+
// Reachability fix (previously always omitted `installDir`, so a plugin placed on disk was
|
|
8
|
+
// never scanned no matter how the composition root itself was configured — see this function's
|
|
9
|
+
// required-params doc).
|
|
10
|
+
export function discoverPlugins({ state }, _options = {}) {
|
|
11
|
+
const { installDir } = state;
|
|
12
|
+
return discoverPluginRuntimePlugins({ ...state.runtimeBinding, builtIns: state.required.sources, ...(installDir === undefined ? {} : { installDir }) });
|
|
13
|
+
}
|
|
14
|
+
/** Retained versions make the activation row's existing active pointer meaningful at boot
|
|
15
|
+
* and reload. A newly installed version is not running until controlled reload advances it. */
|
|
16
|
+
export async function discoverActivePlugins({ state }, _options = {}) {
|
|
17
|
+
const { installDir } = state;
|
|
18
|
+
const rows = await state.required.activationRepo.listAll();
|
|
19
|
+
const versions = new Map(rows.filter(row => row.workspaceId === state.required.workspaceId && row.enabled).map(row => [row.pluginId, row.version]));
|
|
20
|
+
return discoverPluginRuntimePlugins({ ...state.runtimeBinding, builtIns: state.required.sources, ...(installDir === undefined ? {} : { installDir }) }, { versions });
|
|
21
|
+
}
|
|
22
|
+
export async function listPluginConflicts({ state, discovery }, optional = {}) {
|
|
23
|
+
const [records, activations] = await Promise.all([discovery ?? discoverPlugins({ state }), state.required.activationRepo.listAll()]);
|
|
24
|
+
return resolvePluginConflicts({ ...state.runtimeBinding, workspaceId: state.required.workspaceId, discovery: records, activations, coreClaims: state.coreClaims }, optional);
|
|
25
|
+
}
|
|
26
|
+
/** Install preview (2026-10-04): what the staged package would clash with if turned on in THIS
|
|
27
|
+
* workspace now. A synthetic valid record stands in for it and REPLACES an installed version of the
|
|
28
|
+
* same id, so an upgrade is judged by its new manifest only. */
|
|
29
|
+
export async function installPreviewConflicts({ state, manifest }, _options = {}) {
|
|
30
|
+
const staged = { id: manifest.id, name: manifest.name, version: manifest.version, source: "site", tier: manifest.tier, status: "valid", errors: [], manifest };
|
|
31
|
+
const discovery = [...(await discoverPlugins({ state })).filter((record) => record.id !== manifest.id), staged];
|
|
32
|
+
return (await listPluginConflicts({ state, discovery }, { candidateId: manifest.id })).get(manifest.id) ?? [];
|
|
33
|
+
}
|
|
34
|
+
/** Enable-time conflict gate (2026-10-04): runs before `loadPlugin()`, so a plugin that would
|
|
35
|
+
* take a name core or an enabled plugin holds never has its code imported. The candidate is
|
|
36
|
+
* ordered after every enabled plugin — it is the newer one by definition. */
|
|
37
|
+
export async function assertNoConflicts({ state, pluginId, discovery }, _options = {}) {
|
|
38
|
+
const conflicts = (await listPluginConflicts({ state, discovery }, { candidateId: pluginId })).get(pluginId);
|
|
39
|
+
if (conflicts)
|
|
40
|
+
throw new PluginConflictError({ pluginId, conflicts });
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=runtime-conflicts.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PluginManifestReadOptions } from "../plugin-format.js";
|
|
1
2
|
import type { PluginLookupPort } from "@jini-ai/core/plugin-directory";
|
|
2
3
|
import type { Clock as ClockPort } from "@jini-ai/core/primitives";
|
|
3
4
|
import type { FileLockPort } from "@jini-ai/core/contracts/runtime";
|
|
@@ -116,17 +117,18 @@ export interface PluginRuntimeCoreBindings {
|
|
|
116
117
|
* identity namespace, install-disabled wording, tier policy, archive reader, digest format and the
|
|
117
118
|
* per-load invocation binding factory). The archive reader is always host-supplied (no fallback).
|
|
118
119
|
*/
|
|
119
|
-
export interface PluginRuntimeHostBinding {
|
|
120
|
+
export interface PluginRuntimeHostBinding extends PluginManifestReadOptions {
|
|
120
121
|
readonly capabilityVocabulary: readonly string[];
|
|
121
122
|
readonly declarativeContentTypes: DeclarativeContentTypesPort;
|
|
122
123
|
readonly coreOwnerName: string;
|
|
123
124
|
readonly identityNamespace: string;
|
|
125
|
+
readonly legacyIdentityNamespace?: string;
|
|
124
126
|
readonly localInstallDisabledMessage: string;
|
|
125
127
|
readonly tierPolicy: PluginTierPolicy;
|
|
126
128
|
readonly archiveReader: ArchiveReaderPort;
|
|
127
129
|
readonly verifyDigest: VerifyDigestPort;
|
|
128
130
|
readonly createInvocationCoreDeps: RunTier2CallRequired["createInvocationCoreDeps"];
|
|
129
|
-
/** Serializes plugin source edits with seal snapshots; Node hosts pass `
|
|
131
|
+
/** Serializes plugin source edits with seal snapshots; Node hosts pass `createFileLockPort({ withFileLock })` of `@jini-ai/node-adapters/fs`. */
|
|
130
132
|
readonly fileLock: FileLockPort;
|
|
131
133
|
}
|
|
132
134
|
/** Only the tracker member the runtime calls. @agent-note The host supplies the event vocabulary
|
|
@@ -208,7 +210,7 @@ export interface PluginRuntimeCoreRequired<TEvent = unknown, TOptions = unknown>
|
|
|
208
210
|
readonly createModuleImporter: (required: {
|
|
209
211
|
manifest: PluginManifest;
|
|
210
212
|
source: "built-in" | "site";
|
|
211
|
-
}, optional?: {
|
|
213
|
+
}, optional?: PluginManifestReadOptions & {
|
|
212
214
|
importModule?: (entryPath: string) => Promise<unknown>;
|
|
213
215
|
snapshots?: NonNullable<ReturnType<typeof createPluginModuleSnapshotLifecycle>>;
|
|
214
216
|
}) => PluginModuleImportPort;
|