@jini-ai/agent-plugins 0.7.2 → 0.7.3-next.2
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 +4 -4
- package/NOTICE +2 -0
- package/README.md +11 -15
- package/calendly/plugin.json +3 -3
- package/cloudflare/lib/forms.mjs +9 -10
- package/cloudflare/lib/target.mjs +1 -1
- package/cloudflare/plugin.json +3 -3
- package/cloudflare/worker/forms-receiver.mjs +9 -9
- package/composio/plugin.json +3 -3
- package/core/persistent-state.js +227 -163
- package/dist/admin-surfaces/connections/connections.d.ts +11 -6
- package/dist/admin-surfaces/connections/connections.js +102 -85
- package/dist/admin-surfaces/node.d.ts +27 -0
- package/dist/admin-surfaces/node.js +32 -0
- package/dist/admin-surfaces/plugin-state.js +21 -18
- package/dist/admin-surfaces/surface-client.d.ts +4 -0
- package/dist/admin-surfaces/surface-client.js +124 -117
- package/dist/admin-surfaces/surface-handlers.js +21 -17
- package/dist/admin-surfaces/theme.d.ts +5 -1
- package/dist/admin-surfaces/theme.js +3 -3
- package/dist/connect/access-token-tool.d.ts +3 -1
- package/dist/connect/access-token-tool.js +3 -2
- package/dist/connect/apply-connect-defaults.js +2 -2
- package/dist/connect/apply-tool-renames.js +9 -8
- package/dist/connect/connect-tool.d.ts +2 -0
- package/dist/connect/connect-tool.js +3 -2
- package/dist/connect/credential-cards.js +3 -2
- package/dist/connect/credential-save-tool.d.ts +14 -11
- package/dist/connect/credential-save-tool.js +128 -121
- package/dist/connect/enable-access.d.ts +2 -2
- package/dist/connect/enable-access.js +6 -6
- package/dist/connect/executable/register.js +40 -34
- package/dist/connect/federate-mcp.d.ts +21 -11
- package/dist/connect/federate-mcp.js +28 -21
- package/dist/connect/grant-signed-in-defaults.js +3 -3
- package/dist/connect/import-access-token.js +2 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +1 -0
- package/dist/connect/plugin-credential-card.js +2 -1
- package/dist/connect/plugin-host/index.d.ts +10 -5
- package/dist/connect/plugin-host/index.js +113 -100
- package/dist/connect/ports.d.ts +1 -1
- package/dist/connect/row-update.d.ts +22 -0
- package/dist/connect/row-update.js +18 -0
- package/dist/connect/switch-on-saved-token.d.ts +4 -2
- package/dist/connect/switch-on-saved-token.js +1 -1
- package/dist/connect/token-map.d.ts +44 -0
- package/dist/connect/token-map.js +49 -0
- package/dist/core/identity-namespace.js +5 -0
- package/dist/folder-zip.d.ts +3 -1
- package/dist/folder-zip.js +2 -2
- package/dist/lifecycle/activation.d.ts +4 -4
- package/dist/lifecycle/activation.js +4 -5
- package/dist/lifecycle/automatic-use.js +236 -210
- package/dist/lifecycle/bundled-digests.d.ts +75 -12
- package/dist/lifecycle/bundled-digests.js +213 -212
- package/dist/lifecycle/bundled-source-archive.d.ts +1 -1
- package/dist/lifecycle/bundled-source-archive.js +263 -264
- package/dist/lifecycle/capability-projection.d.ts +1 -1
- package/dist/lifecycle/capability-projection.js +1 -1
- package/dist/lifecycle/credential-card-metadata.d.ts +1 -1
- package/dist/lifecycle/credential-card-metadata.js +27 -3
- package/dist/lifecycle/exports.js +9 -4
- package/dist/lifecycle/fetch-archive.d.ts +1 -1
- package/dist/lifecycle/fetch-archive.js +1 -1
- package/dist/lifecycle/host-tools/identity.js +3 -2
- package/dist/lifecycle/host-tools/ports.d.ts +2 -0
- package/dist/lifecycle/host-tools/search-tool.d.ts +4 -2
- package/dist/lifecycle/host-tools/search-tool.js +9 -8
- package/dist/lifecycle/host-tools/skill-tool.d.ts +18 -2
- package/dist/lifecycle/host-tools/skill-tool.js +16 -8
- package/dist/lifecycle/index.d.ts +118 -110
- package/dist/lifecycle/index.js +45 -12
- package/dist/lifecycle/install-errors.d.ts +1 -1
- package/dist/lifecycle/install-from-url.d.ts +1 -1
- package/dist/lifecycle/install-from-url.js +1 -1
- package/dist/lifecycle/install.d.ts +7 -2
- package/dist/lifecycle/install.js +414 -396
- package/dist/lifecycle/installed-package-index.js +45 -42
- package/dist/lifecycle/layout.d.ts +1 -1
- package/dist/lifecycle/layout.js +1 -1
- package/dist/lifecycle/mail/catalog.d.ts +8 -32
- package/dist/lifecycle/mail/catalog.js +25 -20
- package/dist/lifecycle/mail/contribution.d.ts +2 -2
- package/dist/lifecycle/mail/contribution.js +34 -34
- package/dist/lifecycle/mail/selection.js +6 -2
- package/dist/lifecycle/manifest.d.ts +3 -3
- package/dist/lifecycle/manifest.js +4 -4
- package/dist/lifecycle/mcp-provisioning.d.ts +3 -3
- package/dist/lifecycle/mcp-provisioning.js +3 -3
- package/dist/lifecycle/package-paths.d.ts +1 -1
- package/dist/lifecycle/package-paths.js +1 -1
- package/dist/lifecycle/persistent-state.js +1 -2
- package/dist/lifecycle/ports.d.ts +5 -1
- package/dist/lifecycle/resolve-agent-plugin-refs.d.ts +30 -8
- package/dist/lifecycle/resolve-agent-plugin-refs.js +227 -228
- package/dist/lifecycle/retire-bundled.d.ts +1 -52
- package/dist/lifecycle/retire-bundled.js +134 -84
- package/dist/lifecycle/search.d.ts +2 -1
- package/dist/lifecycle/search.js +1 -1
- package/dist/lifecycle/seed-bundled.d.ts +1 -1
- package/dist/lifecycle/seed-bundled.js +154 -155
- package/dist/lifecycle/set-enabled.d.ts +1 -1
- package/dist/lifecycle/set-enabled.js +1 -1
- package/dist/lifecycle/skill-file-reader.js +53 -50
- package/dist/lifecycle/tools/projection.d.ts +4 -7
- package/dist/lifecycle/tools/projection.js +109 -108
- package/dist/lifecycle/trusted-plugin-files.d.ts +2 -2
- package/dist/lifecycle/trusted-plugin-files.js +1 -1
- package/dist/lifecycle/uninstall.d.ts +1 -1
- package/dist/lifecycle/uninstall.js +237 -241
- package/dist/lifecycle/update-store.js +20 -17
- package/dist/lifecycle/update.js +287 -281
- package/dist/lifecycle/yauzl-archive-reader.d.ts +2 -2
- package/dist/lifecycle/yauzl-archive-reader.js +8 -2
- package/dist/manifest.d.ts +11 -3
- package/dist/manifest.js +9 -9
- package/fly/jini-credential-schemes.json +11 -0
- package/fly/plugin.json +3 -4
- package/github/plugin.json +3 -3
- package/github/source-control/backup-push.mjs +11 -11
- package/github/source-control/commit-site.mjs +23 -13
- package/github/source-control/github.mjs +12 -6
- package/github/source-control/write-files.mjs +27 -28
- package/github-pages/{tovu-deploy-targets.json → jini-deploy-targets.json} +22 -22
- package/github-pages/plugin.json +3 -3
- package/github-pages/targets/github-pages.mjs +3 -3
- package/google-login/plugin.json +3 -3
- package/google-workspace/README.md +14 -14
- package/google-workspace/form-destinations/README.md +3 -3
- package/google-workspace/form-destinations/dedupe.mjs +1 -1
- package/google-workspace/form-destinations/mapping.mjs +8 -9
- package/google-workspace/form-destinations/sheets.mjs +1 -1
- package/google-workspace/{tovu-admin-surfaces.json → jini-admin-surfaces.json} +2 -2
- package/google-workspace/{tovu-agent-tools.json → jini-agent-tools.json} +28 -28
- package/google-workspace/{tovu-connections.json → jini-connections.json} +2 -2
- package/google-workspace/lib/auth.mjs +2 -2
- package/google-workspace/lib/form-destination-settings.mjs +1 -1
- package/google-workspace/lib/picker-flow.mjs +2 -2
- package/google-workspace/lib/request-policy.mjs +1 -1
- package/google-workspace/lib/surface-actions.mjs +1 -1
- package/google-workspace/plugin.json +3 -3
- package/google-workspace/tools/sheets/README.md +3 -3
- package/google-workspace/tools/sheets-admin/README.md +3 -3
- package/google-workspace/ui/README.md +4 -4
- package/google-workspace/ui/connection-panel.mjs +51 -51
- package/google-workspace/ui/destination-panel.mjs +34 -34
- package/google-workspace/ui/dom.mjs +15 -16
- package/google-workspace/ui/picker-flow.mjs +2 -2
- package/google-workspace/ui/picker.mjs +19 -19
- package/google-workspace/ui/surface-client.mjs +96 -69
- package/higgsfield-media/plugin.json +3 -3
- package/jev/plugin.json +3 -3
- package/kuinetic/CHANGELOG.md +12 -0
- package/kuinetic/mcp.json +4 -0
- package/kuinetic/plugin.json +27 -0
- package/kuinetic/skills/kuinetic/SKILL.md +120 -0
- package/kuinetic/skills/kuinetic/references/effects-by-family.md +32 -0
- package/kuinetic/skills/kuinetic/references/opt-in-tiers.md +12 -0
- package/kuinetic/skills/kuinetic/references/reserved-keys.md +36 -0
- package/meilisearch/plugin.json +5 -5
- package/netlify/plugin.json +3 -3
- package/netlify/targets/netlify.mjs +14 -4
- package/opentelemetry/plugin.json +3 -3
- package/package.json +27 -22
- package/posthog/plugin.json +3 -3
- package/railway/plugin.json +3 -3
- package/render/plugin.json +3 -3
- package/resend/NOTES.md +2 -2
- package/resend/adapters/resend.mjs +1 -1
- package/resend/{tovu-mail-adapters.json → jini-mail-adapters.json} +1 -1
- package/resend/lib/domains.mjs +8 -8
- package/resend/plugin.json +3 -3
- package/s3-compatible/{tovu-deploy-targets.json → jini-deploy-targets.json} +68 -68
- package/s3-compatible/jini-object-stores.json +29 -0
- package/s3-compatible/object-stores/s3-compatible.mjs +19 -13
- package/s3-compatible/plugin.json +3 -3
- package/s3-compatible/targets/s3-compatible.mjs +25 -25
- package/sentry/plugin.json +3 -3
- package/shadcn-ui/CHANGELOG.md +7 -0
- package/shadcn-ui/LICENSE +201 -0
- package/shadcn-ui/NOTICE +10 -0
- package/shadcn-ui/mcp.json +4 -0
- package/shadcn-ui/plugin.json +26 -0
- package/shopify/plugin.json +3 -3
- package/site-compliance/plugin.json +3 -3
- package/site-import/plugin.json +3 -3
- package/supabase/mcp.json +1 -4
- package/supabase/plugin.json +3 -3
- package/ui-ux-design/CHANGELOG.md +13 -0
- package/ui-ux-design/NOTICE +2 -0
- package/ui-ux-design/README.md +17 -7
- package/ui-ux-design/plugin.json +6 -3
- package/ui-ux-design/skills/ui-ux-design/SKILL.md +38 -152
- package/ui-ux-design/skills/ui-ux-design/references/full-workflow.md +156 -0
- package/ui-ux-design/skills/ui-ux-design/references/ui-animation.md +4 -4
- package/vercel/NOTES.md +1 -1
- package/vercel/object-stores/vercel-blob.mjs +12 -2
- package/vercel/plugin.json +3 -3
- package/vercel/targets/vercel.mjs +3 -3
- package/wordpress/plugin.json +3 -3
- package/dist/lifecycle/node.d.ts +0 -11
- package/dist/lifecycle/node.js +0 -38
- package/fly/tovu-credential-schemes.json +0 -11
- package/github/deployments/github.mjs +0 -415
- package/s3-compatible/tovu-object-stores.json +0 -29
- package/ui-ux-design/skills/ui-ux-design/references/kuinetic-reference.md +0 -184
- /package/cloudflare/{tovu-consent.json → jini-consent.json} +0 -0
- /package/cloudflare/{tovu-deploy-targets.json → jini-deploy-targets.json} +0 -0
- /package/cloudflare/{tovu-form-destinations.json → jini-form-destinations.json} +0 -0
- /package/fly/{tovu-deploy-configs.json → jini-deploy-configs.json} +0 -0
- /package/fly/{tovu-deploy-ops.json → jini-deploy-ops.json} +0 -0
- /package/github/{tovu-deploy-ops.json → jini-deploy-ops.json} +0 -0
- /package/github/{tovu-source-control.json → jini-source-control.json} +0 -0
- /package/google-login/{tovu-login-providers.json → jini-login-providers.json} +0 -0
- /package/google-workspace/{tovu-form-destinations.json → jini-form-destinations.json} +0 -0
- /package/meilisearch/{tovu-search-providers.json → jini-search-providers.json} +0 -0
- /package/netlify/{tovu-consent.json → jini-consent.json} +0 -0
- /package/netlify/{tovu-deploy-targets.json → jini-deploy-targets.json} +0 -0
- /package/railway/{tovu-deploy-configs.json → jini-deploy-configs.json} +0 -0
- /package/railway/{tovu-deploy-ops.json → jini-deploy-ops.json} +0 -0
- /package/render/{tovu-deploy-configs.json → jini-deploy-configs.json} +0 -0
- /package/render/{tovu-deploy-ops.json → jini-deploy-ops.json} +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/README.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/SKILL.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/examples/auth-layout.tsx +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/examples/data-table.tsx +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/examples/form-pattern.tsx +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/resources/component-catalog.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/resources/customization-guide.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/resources/migration-guide.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/resources/setup-guide.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/scripts/verify-setup.sh +0 -0
- /package/vercel/{tovu-consent.json → jini-consent.json} +0 -0
- /package/vercel/{tovu-deploy-targets.json → jini-deploy-targets.json} +0 -0
- /package/vercel/{tovu-object-stores.json → jini-object-stores.json} +0 -0
package/core/persistent-state.js
CHANGED
|
@@ -33,67 +33,83 @@ export async function withPluginStateLock({ filesystem: fs, contain, workspaceRo
|
|
|
33
33
|
const lockPath = await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: `staging/.plugin-state-${pluginId}.lock` });
|
|
34
34
|
return withLock({ lockPath, run });
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes.subarray(0, size));
|
|
65
|
-
if (text.includes('\0')) throw new Error('Memory must be UTF-8 text');
|
|
66
|
-
return text;
|
|
67
|
-
} finally { await handle.close(); }
|
|
68
|
-
}
|
|
69
|
-
async function list({ kind }, _optional = {}) {
|
|
36
|
+
function checkKind(kind) { if (kind !== 'learned' && kind !== 'notes') throw new Error('Invalid memory kind'); }
|
|
37
|
+
|
|
38
|
+
async function readText(fs, filename, cap) {
|
|
39
|
+
// A bounded read protects against a concurrent file growing after stat. Invalid UTF-8 is refused.
|
|
40
|
+
const handle = await fs.open(filename, 'r');
|
|
41
|
+
try {
|
|
42
|
+
if (!(await handle.stat()).isFile()) throw new Error('Memory must contain regular UTF-8 files');
|
|
43
|
+
const bytes = Buffer.alloc(cap + 1);
|
|
44
|
+
let size = 0;
|
|
45
|
+
while (size < bytes.length) {
|
|
46
|
+
const result = await handle.read(bytes, size, bytes.length - size, size);
|
|
47
|
+
if (result.bytesRead === 0) break;
|
|
48
|
+
size += result.bytesRead;
|
|
49
|
+
}
|
|
50
|
+
if (size > cap) throw new Error('Memory byte cap exceeded');
|
|
51
|
+
const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes.subarray(0, size));
|
|
52
|
+
if (text.includes('\0')) throw new Error('Memory must be UTF-8 text');
|
|
53
|
+
return text;
|
|
54
|
+
} finally { await handle.close(); }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function readMemoryDirectory(fs, { base, prefix }) {
|
|
58
|
+
try { return await fs.readdir(path.join(base, prefix), { withFileTypes: true }); }
|
|
59
|
+
catch (error) { if (code(error) === 'ENOENT' && prefix === '') return undefined; throw error; }
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function createMemoryLister({ fs, contain, limits }, root) {
|
|
63
|
+
return async function list({ kind }, _optional = {}) {
|
|
70
64
|
const base = await root(kind).catch(error => { if (code(error) === 'ENOENT') return undefined; throw error; });
|
|
71
65
|
if (!base) return [];
|
|
72
66
|
const files = [];
|
|
73
67
|
let total = 0, entriesSeen = 0;
|
|
74
68
|
async function walk(prefix) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
catch (error) { if (code(error) === 'ENOENT' && prefix === '') return; throw error; }
|
|
69
|
+
const entries = await readMemoryDirectory(fs, { base, prefix });
|
|
70
|
+
if (!entries) return;
|
|
78
71
|
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
79
72
|
if (++entriesSeen > limits.files * 4) throw new Error('Memory entry cap exceeded');
|
|
80
73
|
const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
81
74
|
const filename = await contain({ root: base, entryPath: relativePath });
|
|
82
|
-
|
|
83
|
-
else if (entry.isFile()) {
|
|
84
|
-
if (files.length >= limits.files) throw new Error('Memory file cap exceeded');
|
|
85
|
-
const text = await readText(filename, limits[kind] - total);
|
|
86
|
-
total += Buffer.byteLength(text, 'utf8');
|
|
87
|
-
files.push({ relativePath, text });
|
|
88
|
-
} else throw new Error('Memory symlinks and special files are refused');
|
|
75
|
+
await visit(entry, { relativePath, filename });
|
|
89
76
|
}
|
|
90
77
|
}
|
|
78
|
+
async function visit(entry, { relativePath, filename }) {
|
|
79
|
+
if (entry.isDirectory()) await walk(relativePath);
|
|
80
|
+
else if (entry.isFile()) {
|
|
81
|
+
await appendFile(filename, relativePath);
|
|
82
|
+
} else throw new Error('Memory symlinks and special files are refused');
|
|
83
|
+
}
|
|
84
|
+
async function appendFile(filename, relativePath) {
|
|
85
|
+
if (files.length >= limits.files) throw new Error('Memory file cap exceeded');
|
|
86
|
+
const text = await readText(fs, filename, limits[kind] - total);
|
|
87
|
+
total += Buffer.byteLength(text, 'utf8');
|
|
88
|
+
files.push({ relativePath, text });
|
|
89
|
+
}
|
|
91
90
|
await walk('');
|
|
92
91
|
return files;
|
|
93
92
|
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Each instance is bound to one plugin. No read/write method accepts an id or arbitrary root. */
|
|
96
|
+
export function createPluginMemory({ filesystem: fs, contain, workspaceRoot, pluginId, withLock }, optional = {}) {
|
|
97
|
+
const paths = pluginStatePaths({ workspaceRoot, pluginId });
|
|
98
|
+
const limits = { ...DEFAULT_PLUGIN_MEMORY_LIMITS, ...optional.limits };
|
|
99
|
+
for (const kind of ['learned', 'notes', 'files']) {
|
|
100
|
+
if (!Number.isSafeInteger(limits[kind]) || limits[kind] <= 0 || limits[kind] > DEFAULT_PLUGIN_MEMORY_LIMITS[kind]) throw new Error('Memory caps must be positive and cannot exceed host ceilings');
|
|
101
|
+
}
|
|
102
|
+
async function root(kind, create = false) {
|
|
103
|
+
checkKind(kind);
|
|
104
|
+
if (create) await fs.mkdir(workspaceRoot, { recursive: true, mode: 0o700 });
|
|
105
|
+
await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, paths[kind]) });
|
|
106
|
+
if (create) await fs.mkdir(paths[kind], { recursive: true, mode: 0o700 });
|
|
107
|
+
return paths[kind];
|
|
108
|
+
}
|
|
109
|
+
const list = createMemoryLister({ fs, contain, limits }, root);
|
|
94
110
|
async function read({ kind, entryPath }, _optional = {}) {
|
|
95
111
|
const base = await root(kind);
|
|
96
|
-
return readText(await contain({ root: base, entryPath }), limits[kind]);
|
|
112
|
+
return readText(fs, await contain({ root: base, entryPath }), limits[kind]);
|
|
97
113
|
}
|
|
98
114
|
async function write({ kind, entryPath, text }, _optional = {}) {
|
|
99
115
|
checkKind(kind);
|
|
@@ -125,6 +141,163 @@ export function createPluginMemory({ filesystem: fs, contain, workspaceRoot, plu
|
|
|
125
141
|
write: ({ entryPath, text }, optional = {}) => write({ kind: 'learned', entryPath, text }, optional) } };
|
|
126
142
|
}
|
|
127
143
|
|
|
144
|
+
function createMigrationEntryReader(fs) {
|
|
145
|
+
return async function entries(directory) {
|
|
146
|
+
try { return await fs.readdir(directory, { withFileTypes: true }); }
|
|
147
|
+
catch (error) { if (code(error) === 'ENOENT') return []; throw error; }
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function createMigrationRenamer(fs) {
|
|
152
|
+
return async function renameEntry({ source, destination, frozen }, _optional = {}) {
|
|
153
|
+
await fs.mkdir(path.dirname(destination), { recursive: true, mode: 0o700 });
|
|
154
|
+
const mode = frozen ? (await fs.stat(source)).mode & 0o777 : undefined;
|
|
155
|
+
if (frozen) await fs.chmod(source, mode | 0o700);
|
|
156
|
+
try { await fs.rename(source, destination); }
|
|
157
|
+
catch (error) { if (frozen) await fs.chmod(source, mode).catch(() => undefined); throw error; }
|
|
158
|
+
if (frozen) await fs.chmod(destination, mode);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function createLegacyQuarantine({ fs, contain, workspaceRoot, emit }, renameEntry) {
|
|
163
|
+
let quarantineRoot;
|
|
164
|
+
return async function quarantine({ source, reason, frozen = false }, _optional = {}) {
|
|
165
|
+
// Validate ancestors, then rename the entry itself: even an unsafe symlink is preserved,
|
|
166
|
+
// never followed into another plugin or outside the workspace.
|
|
167
|
+
await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, path.dirname(source)) });
|
|
168
|
+
if (!quarantineRoot) {
|
|
169
|
+
const base = await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: 'staging/legacy-quarantine' });
|
|
170
|
+
await fs.mkdir(base, { recursive: true, mode: 0o700 });
|
|
171
|
+
const candidate = path.join(base, `${new Date().toISOString().replaceAll(':', '-')}-${randomUUID()}`);
|
|
172
|
+
// Exclusive creation prevents a retry or another boot from overwriting saved bytes.
|
|
173
|
+
await fs.mkdir(candidate, { mode: 0o700 });
|
|
174
|
+
quarantineRoot = candidate;
|
|
175
|
+
}
|
|
176
|
+
const destinationParent = await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot,
|
|
177
|
+
entryPath: path.relative(workspaceRoot, path.join(quarantineRoot, path.relative(workspaceRoot, path.dirname(source)))) });
|
|
178
|
+
// Keep the native directory-entry name verbatim, even if it is not a valid portable package
|
|
179
|
+
// path (e.g. a literal backslash on POSIX). The fresh quarantine tree has no existing leaf.
|
|
180
|
+
const destination = path.join(destinationParent, path.basename(source));
|
|
181
|
+
await renameEntry({ source, destination, frozen });
|
|
182
|
+
emit('migration-quarantined', `${source} -> ${destination}: ${reason}`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function createLegacyMigrationOperations({ fs, contain, workspaceRoot, emit }, progress) {
|
|
187
|
+
const entries = createMigrationEntryReader(fs);
|
|
188
|
+
const renameEntry = createMigrationRenamer(fs);
|
|
189
|
+
const quarantine = createLegacyQuarantine({ fs, contain, workspaceRoot, emit }, renameEntry);
|
|
190
|
+
async function move(source, destination, frozen = false) {
|
|
191
|
+
await contain({ root: workspaceRoot, entryPath: path.relative(workspaceRoot, source) });
|
|
192
|
+
await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, destination) });
|
|
193
|
+
let exists = false;
|
|
194
|
+
try { await fs.stat(destination); exists = true; }
|
|
195
|
+
catch (error) { if (code(error) !== 'ENOENT') throw error; }
|
|
196
|
+
if (exists) {
|
|
197
|
+
// The Layout B copy wins. This runs under the plugin lock, so no in-flight move is discarded.
|
|
198
|
+
await quarantine({ source, frozen, reason: 'Migration destination already exists; Layout B copy kept' });
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
await renameEntry({ source, destination, frozen });
|
|
202
|
+
progress.moved++;
|
|
203
|
+
emit('migration-moved', `${source} -> ${destination}`);
|
|
204
|
+
}
|
|
205
|
+
return { entries, quarantine, move };
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function createLegacyPackageMigrator({ fs, contain, workspaceRoot, parsePluginId, withLock }, { quarantine, move }) {
|
|
209
|
+
return async function migratePackage(source, entry) {
|
|
210
|
+
if (!DIGEST.test(entry.name) || !entry.isDirectory()) {
|
|
211
|
+
await quarantine({ source, frozen: entry.isDirectory(), reason: 'Unrecognized legacy package entry' });
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
let pluginId, paths;
|
|
215
|
+
try {
|
|
216
|
+
await contain({ root: workspaceRoot, entryPath: `packages/sha256/${entry.name}` });
|
|
217
|
+
const manifestPath = await contain({ root: source, entryPath: 'plugin.json' });
|
|
218
|
+
pluginId = parsePluginId({ value: JSON.parse(await fs.readFile(manifestPath, 'utf8')) });
|
|
219
|
+
paths = pluginStatePaths({ workspaceRoot, pluginId });
|
|
220
|
+
} catch (error) {
|
|
221
|
+
// Missing/invalid manifests are refused entries; filesystem failures remain resumable.
|
|
222
|
+
if (code(error) && !['ENOENT', 'EISDIR'].includes(code(error))) throw error;
|
|
223
|
+
await quarantine({ source, frozen: true, reason: String(error) });
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
await withPluginStateLock({ filesystem: fs, contain, workspaceRoot, pluginId, withLock, run: () => move(source, path.join(paths.packages, entry.name), true) });
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
async function migrateLegacyPackages({ fs, contain, workspaceRoot, parsePluginId, withLock, emit, oldPackages }, { entries, quarantine, move }, progress) {
|
|
231
|
+
const migratePackage = createLegacyPackageMigrator({ fs, contain, workspaceRoot, parsePluginId, withLock }, { quarantine, move });
|
|
232
|
+
for (const entry of await entries(oldPackages)) {
|
|
233
|
+
const source = path.join(oldPackages, entry.name);
|
|
234
|
+
try {
|
|
235
|
+
await migratePackage(source, entry);
|
|
236
|
+
} catch (error) { progress.complete = false; emit('migration-failed', `${entry.name}: ${String(error)}`); }
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function createLegacyStateMigrator({ fs, contain, workspaceRoot, withLock }, { quarantine, move }) {
|
|
241
|
+
return async function migrateState(source, bucket, entry) {
|
|
242
|
+
if (!entry.isDirectory()) {
|
|
243
|
+
await quarantine({ source, reason: 'Legacy state is not a directory' });
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
let paths;
|
|
247
|
+
try { paths = pluginStatePaths({ workspaceRoot, pluginId: entry.name }); }
|
|
248
|
+
catch (error) { await quarantine({ source, reason: String(error) }); return; }
|
|
249
|
+
await withPluginStateLock({ filesystem: fs, contain, workspaceRoot, pluginId: entry.name, withLock, run: () => move(source, bucket === 'data' ? paths.data : path.join(paths.root, 'memory')) });
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
async function migrateLegacyStateBuckets({ fs, contain, workspaceRoot, withLock, emit }, { entries, quarantine, move }, progress) {
|
|
254
|
+
const migrateState = createLegacyStateMigrator({ fs, contain, workspaceRoot, withLock }, { quarantine, move });
|
|
255
|
+
// Layout A memory and PLUGIN_DATA may exist without an installed package; migrate them too.
|
|
256
|
+
for (const bucket of ['memory', 'data']) {
|
|
257
|
+
for (const entry of await entries(path.join(workspaceRoot, bucket))) {
|
|
258
|
+
const source = path.join(workspaceRoot, bucket, entry.name);
|
|
259
|
+
try {
|
|
260
|
+
await migrateState(source, bucket, entry);
|
|
261
|
+
} catch (error) { progress.complete = false; emit('migration-failed', `${bucket}/${entry.name}: ${String(error)}`); }
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
async function prepareMigratedPluginRoots({ fs, contain, workspaceRoot, withLock, emit }, { entries }, progress) {
|
|
267
|
+
for (const folder of await entries(workspaceRoot)) {
|
|
268
|
+
if (!folder.isDirectory() || !SAFE_ID.test(folder.name) || ['staging', 'packages', 'memory', 'data'].includes(folder.name)) continue;
|
|
269
|
+
try {
|
|
270
|
+
await withPluginStateLock({ filesystem: fs, contain, workspaceRoot, pluginId: folder.name, withLock, run: async () => {
|
|
271
|
+
const paths = pluginStatePaths({ workspaceRoot, pluginId: folder.name });
|
|
272
|
+
await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, paths.packages) });
|
|
273
|
+
const digests = (await entries(paths.packages)).filter(digest => digest.isDirectory() && DIGEST.test(digest.name));
|
|
274
|
+
for (const digest of digests) {
|
|
275
|
+
const packageRoot = await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, path.join(paths.packages, digest.name)) });
|
|
276
|
+
// Legacy install froze every package; a crash after rename can leave only its root writable.
|
|
277
|
+
await fs.chmod(packageRoot, 0o555);
|
|
278
|
+
}
|
|
279
|
+
// Wait until legacy memory/data moves have finished before creating destinations for them.
|
|
280
|
+
if (progress.complete && digests.length) for (const directory of [paths.learned, paths.notes, paths.data]) {
|
|
281
|
+
await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, directory) });
|
|
282
|
+
await fs.mkdir(directory, { recursive: true, mode: 0o700 });
|
|
283
|
+
}
|
|
284
|
+
} });
|
|
285
|
+
} catch (error) { progress.complete = false; emit('migration-failed', `${folder.name}: ${String(error)}`); }
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
async function finishPluginLayoutMigration({ fs, workspaceRoot, marker, emit }, oldPackages) {
|
|
290
|
+
for (const directory of [oldPackages, path.dirname(oldPackages), path.join(workspaceRoot, 'memory'), path.join(workspaceRoot, 'data')]) {
|
|
291
|
+
try { await fs.rmdir(directory); } catch (error) { if (!['ENOENT', 'ENOTEMPTY', 'EEXIST'].includes(code(error))) throw error; }
|
|
292
|
+
}
|
|
293
|
+
const temporary = `${marker}.${randomUUID()}.tmp`;
|
|
294
|
+
const handle = await fs.open(temporary, 'wx', 0o600);
|
|
295
|
+
try { await handle.writeFile(JSON.stringify({ layoutVersion: 2 }), 'utf8'); await handle.sync(); }
|
|
296
|
+
finally { await handle.close(); }
|
|
297
|
+
try { await fs.rename(temporary, marker); } finally { await fs.rm(temporary, { force: true }); }
|
|
298
|
+
emit('migration-complete', workspaceRoot);
|
|
299
|
+
}
|
|
300
|
+
|
|
128
301
|
/** Interrupted moves are resumable; refused legacy entries are kept in quarantine and reported. */
|
|
129
302
|
export async function migratePluginLayout({ filesystem: fs, contain, workspaceRoot, parsePluginId, withLock, onEvent }, _optional = {}) {
|
|
130
303
|
await fs.mkdir(workspaceRoot, { recursive: true, mode: 0o700 });
|
|
@@ -136,125 +309,16 @@ export async function migratePluginLayout({ filesystem: fs, contain, workspaceRo
|
|
|
136
309
|
await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.basename(marker) });
|
|
137
310
|
try { if (JSON.parse(await fs.readFile(marker, 'utf8')).layoutVersion === 2) return { complete: true, moved: 0 }; }
|
|
138
311
|
catch (error) { if (code(error) !== 'ENOENT') emit('migration-marker-invalid', String(error)); }
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
try { return await fs.readdir(directory, { withFileTypes: true }); }
|
|
143
|
-
catch (error) { if (code(error) === 'ENOENT') return []; throw error; }
|
|
144
|
-
}
|
|
145
|
-
async function renameEntry({ source, destination, frozen }, _optional = {}) {
|
|
146
|
-
await fs.mkdir(path.dirname(destination), { recursive: true, mode: 0o700 });
|
|
147
|
-
const mode = frozen ? (await fs.stat(source)).mode & 0o777 : undefined;
|
|
148
|
-
if (frozen) await fs.chmod(source, mode | 0o700);
|
|
149
|
-
try { await fs.rename(source, destination); }
|
|
150
|
-
catch (error) { if (frozen) await fs.chmod(source, mode).catch(() => undefined); throw error; }
|
|
151
|
-
if (frozen) await fs.chmod(destination, mode);
|
|
152
|
-
}
|
|
153
|
-
async function quarantine({ source, reason, frozen = false }, _optional = {}) {
|
|
154
|
-
// Validate ancestors, then rename the entry itself: even an unsafe symlink is preserved,
|
|
155
|
-
// never followed into another plugin or outside the workspace.
|
|
156
|
-
await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, path.dirname(source)) });
|
|
157
|
-
if (!quarantineRoot) {
|
|
158
|
-
const base = await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: 'staging/legacy-quarantine' });
|
|
159
|
-
await fs.mkdir(base, { recursive: true, mode: 0o700 });
|
|
160
|
-
const candidate = path.join(base, `${new Date().toISOString().replaceAll(':', '-')}-${randomUUID()}`);
|
|
161
|
-
// Exclusive creation prevents a retry or another boot from overwriting saved bytes.
|
|
162
|
-
await fs.mkdir(candidate, { mode: 0o700 });
|
|
163
|
-
quarantineRoot = candidate;
|
|
164
|
-
}
|
|
165
|
-
const destinationParent = await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot,
|
|
166
|
-
entryPath: path.relative(workspaceRoot, path.join(quarantineRoot, path.relative(workspaceRoot, path.dirname(source)))) });
|
|
167
|
-
// Keep the native directory-entry name verbatim, even if it is not a valid portable package
|
|
168
|
-
// path (e.g. a literal backslash on POSIX). The fresh quarantine tree has no existing leaf.
|
|
169
|
-
const destination = path.join(destinationParent, path.basename(source));
|
|
170
|
-
await renameEntry({ source, destination, frozen });
|
|
171
|
-
emit('migration-quarantined', `${source} -> ${destination}: ${reason}`);
|
|
172
|
-
}
|
|
173
|
-
async function move(source, destination, frozen = false) {
|
|
174
|
-
await contain({ root: workspaceRoot, entryPath: path.relative(workspaceRoot, source) });
|
|
175
|
-
await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, destination) });
|
|
176
|
-
let exists = false;
|
|
177
|
-
try { await fs.stat(destination); exists = true; }
|
|
178
|
-
catch (error) { if (code(error) !== 'ENOENT') throw error; }
|
|
179
|
-
if (exists) {
|
|
180
|
-
// The Layout B copy wins. This runs under the plugin lock, so no in-flight move is discarded.
|
|
181
|
-
await quarantine({ source, frozen, reason: 'Migration destination already exists; Layout B copy kept' });
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
await renameEntry({ source, destination, frozen });
|
|
185
|
-
moved++;
|
|
186
|
-
emit('migration-moved', `${source} -> ${destination}`);
|
|
187
|
-
}
|
|
312
|
+
const progress = { complete: true, moved: 0 };
|
|
313
|
+
const context = { fs, contain, workspaceRoot, parsePluginId, withLock, emit };
|
|
314
|
+
const operations = createLegacyMigrationOperations(context, progress);
|
|
188
315
|
const oldPackages = path.join(workspaceRoot, 'packages', 'sha256');
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
continue;
|
|
195
|
-
}
|
|
196
|
-
let pluginId, paths;
|
|
197
|
-
try {
|
|
198
|
-
await contain({ root: workspaceRoot, entryPath: `packages/sha256/${entry.name}` });
|
|
199
|
-
const manifestPath = await contain({ root: source, entryPath: 'plugin.json' });
|
|
200
|
-
pluginId = parsePluginId({ value: JSON.parse(await fs.readFile(manifestPath, 'utf8')) });
|
|
201
|
-
paths = pluginStatePaths({ workspaceRoot, pluginId });
|
|
202
|
-
} catch (error) {
|
|
203
|
-
// Missing/invalid manifests are refused entries; filesystem failures remain resumable.
|
|
204
|
-
if (code(error) && !['ENOENT', 'EISDIR'].includes(code(error))) throw error;
|
|
205
|
-
await quarantine({ source, frozen: true, reason: String(error) });
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
await withPluginStateLock({ filesystem: fs, contain, workspaceRoot, pluginId, withLock, run: () => move(source, path.join(paths.packages, entry.name), true) });
|
|
209
|
-
} catch (error) { complete = false; emit('migration-failed', `${entry.name}: ${String(error)}`); }
|
|
210
|
-
}
|
|
211
|
-
// Layout A memory and PLUGIN_DATA may exist without an installed package; migrate them too.
|
|
212
|
-
for (const bucket of ['memory', 'data']) {
|
|
213
|
-
for (const entry of await entries(path.join(workspaceRoot, bucket))) {
|
|
214
|
-
const source = path.join(workspaceRoot, bucket, entry.name);
|
|
215
|
-
try {
|
|
216
|
-
if (!entry.isDirectory()) {
|
|
217
|
-
await quarantine({ source, reason: 'Legacy state is not a directory' });
|
|
218
|
-
continue;
|
|
219
|
-
}
|
|
220
|
-
let paths;
|
|
221
|
-
try { paths = pluginStatePaths({ workspaceRoot, pluginId: entry.name }); }
|
|
222
|
-
catch (error) { await quarantine({ source, reason: String(error) }); continue; }
|
|
223
|
-
await withPluginStateLock({ filesystem: fs, contain, workspaceRoot, pluginId: entry.name, withLock, run: () => move(source, bucket === 'data' ? paths.data : path.join(paths.root, 'memory')) });
|
|
224
|
-
} catch (error) { complete = false; emit('migration-failed', `${bucket}/${entry.name}: ${String(error)}`); }
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
for (const folder of await entries(workspaceRoot)) {
|
|
228
|
-
if (!folder.isDirectory() || !SAFE_ID.test(folder.name) || ['staging', 'packages', 'memory', 'data'].includes(folder.name)) continue;
|
|
229
|
-
try {
|
|
230
|
-
await withPluginStateLock({ filesystem: fs, contain, workspaceRoot, pluginId: folder.name, withLock, run: async () => {
|
|
231
|
-
const paths = pluginStatePaths({ workspaceRoot, pluginId: folder.name });
|
|
232
|
-
await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, paths.packages) });
|
|
233
|
-
const digests = (await entries(paths.packages)).filter(digest => digest.isDirectory() && DIGEST.test(digest.name));
|
|
234
|
-
for (const digest of digests) {
|
|
235
|
-
const packageRoot = await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, path.join(paths.packages, digest.name)) });
|
|
236
|
-
// Legacy install froze every package; a crash after rename can leave only its root writable.
|
|
237
|
-
await fs.chmod(packageRoot, 0o555);
|
|
238
|
-
}
|
|
239
|
-
// Wait until legacy memory/data moves have finished before creating destinations for them.
|
|
240
|
-
if (complete && digests.length) for (const directory of [paths.learned, paths.notes, paths.data]) {
|
|
241
|
-
await assertPluginStatePath({ filesystem: fs, contain, workspaceRoot, entryPath: path.relative(workspaceRoot, directory) });
|
|
242
|
-
await fs.mkdir(directory, { recursive: true, mode: 0o700 });
|
|
243
|
-
}
|
|
244
|
-
} });
|
|
245
|
-
} catch (error) { complete = false; emit('migration-failed', `${folder.name}: ${String(error)}`); }
|
|
246
|
-
}
|
|
247
|
-
if (complete) {
|
|
248
|
-
for (const directory of [oldPackages, path.dirname(oldPackages), path.join(workspaceRoot, 'memory'), path.join(workspaceRoot, 'data')]) {
|
|
249
|
-
try { await fs.rmdir(directory); } catch (error) { if (!['ENOENT', 'ENOTEMPTY', 'EEXIST'].includes(code(error))) throw error; }
|
|
250
|
-
}
|
|
251
|
-
const temporary = `${marker}.${randomUUID()}.tmp`;
|
|
252
|
-
const handle = await fs.open(temporary, 'wx', 0o600);
|
|
253
|
-
try { await handle.writeFile(JSON.stringify({ layoutVersion: 2 }), 'utf8'); await handle.sync(); }
|
|
254
|
-
finally { await handle.close(); }
|
|
255
|
-
try { await fs.rename(temporary, marker); } finally { await fs.rm(temporary, { force: true }); }
|
|
256
|
-
emit('migration-complete', workspaceRoot);
|
|
316
|
+
await migrateLegacyPackages({ ...context, oldPackages }, operations, progress);
|
|
317
|
+
await migrateLegacyStateBuckets(context, operations, progress);
|
|
318
|
+
await prepareMigratedPluginRoots(context, operations, progress);
|
|
319
|
+
if (progress.complete) {
|
|
320
|
+
await finishPluginLayoutMigration({ fs, workspaceRoot, marker, emit }, oldPackages);
|
|
257
321
|
}
|
|
258
|
-
return { complete, moved };
|
|
322
|
+
return { complete: progress.complete, moved: progress.moved };
|
|
259
323
|
} });
|
|
260
324
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AdminSurfaceAuthorizationStart, type AdminSurfaceConnections } from '../surface-capabilities.js';
|
|
2
2
|
import type { AdminSurfaceConnectionsHost, AdminSurfaceDeclaredConnection } from './ports.js';
|
|
3
|
+
import { type Logger } from '@jini-ai/core/primitives';
|
|
3
4
|
/**
|
|
4
5
|
* @file The host's `connections` port for plugin admin-surface handlers (Jini's `AdminSurfaceConnections`):
|
|
5
6
|
* account actions a signed-in admin takes on a plugin's own settings screen, over the same
|
|
@@ -20,16 +21,20 @@ export interface IssuedSignIn extends AdminSurfaceAuthorizationStart {
|
|
|
20
21
|
}
|
|
21
22
|
export interface AdminSurfaceConnectionsDeps<Connection extends AdminSurfaceDeclaredConnection> {
|
|
22
23
|
readonly host: AdminSurfaceConnectionsHost<Connection>;
|
|
24
|
+
readonly report?: Pick<Logger, 'warn'>;
|
|
23
25
|
readonly onSignInIssued?: (issued: IssuedSignIn) => void;
|
|
24
26
|
}
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
* @complexity Each call: one contribution load plus one record read or one service call.
|
|
28
|
-
*/
|
|
29
|
-
export declare function createAdminSurfaceConnections<Connection extends AdminSurfaceDeclaredConnection>(required: AdminSurfaceConnectionsDeps<Connection> & {
|
|
27
|
+
/** One plugin's call scope: the host plus the plugin, workspace, optional admin and the route's hooks. */
|
|
28
|
+
type ConnectionsScope<Connection extends AdminSurfaceDeclaredConnection> = AdminSurfaceConnectionsDeps<Connection> & {
|
|
30
29
|
readonly pluginId: string;
|
|
31
30
|
readonly workspaceId: string;
|
|
32
31
|
readonly principalId?: string | undefined;
|
|
33
32
|
readonly signal?: AbortSignal | undefined;
|
|
34
|
-
}
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Builds the per-call connections port for one plugin, workspace and (for account actions) admin.
|
|
36
|
+
* @complexity Each call: one contribution load plus one record read or one service call.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createAdminSurfaceConnections<Connection extends AdminSurfaceDeclaredConnection>(required: ConnectionsScope<Connection>, _optional?: Record<string, never>): AdminSurfaceConnections;
|
|
39
|
+
export {};
|
|
35
40
|
//# sourceMappingURL=connections.d.ts.map
|