@jini-ai/agent-plugins 0.7.3-next.2 → 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/README.md +22 -4
- package/calendly/README.md +29 -0
- package/calendly/mcp.json +1 -1
- package/cloudflare/lib/assets.mjs +1 -1
- package/cloudflare/lib/cms-forms.mjs +1 -1
- package/core/persistent-state.d.ts +4 -1
- package/core/persistent-state.js +55 -21
- package/dist/admin-surfaces/callback-field-inbox.d.ts +1 -6
- package/dist/admin-surfaces/connections/connections.d.ts +2 -6
- package/dist/admin-surfaces/connections/index.d.ts +3 -2
- package/dist/admin-surfaces/index.d.ts +3 -1
- package/dist/connect/access-token-tool.d.ts +1 -1
- package/dist/connect/access-token-tool.js +1 -1
- package/dist/connect/catalog.d.ts +26 -0
- package/dist/connect/catalog.js +42 -0
- package/dist/connect/connect-tool.d.ts +2 -294
- package/dist/connect/connect-tool.js +2 -53
- package/dist/connect/contracts.d.ts +257 -0
- package/dist/connect/contracts.js +2 -0
- package/dist/connect/credential-cards.d.ts +2 -0
- package/dist/connect/credential-cards.js +7 -4
- package/dist/connect/grant-signed-in-defaults.js +1 -1
- package/dist/connect/host-deps.d.ts +32 -0
- package/dist/connect/host-deps.js +35 -0
- package/dist/connect/import-access-token.js +1 -1
- package/dist/connect/index.d.ts +7 -2
- package/dist/connect/index.js +5 -2
- package/dist/connect/installed-plugin.d.ts +28 -0
- package/dist/connect/installed-plugin.js +19 -0
- package/dist/connect/new-site-agent-plugin-tokens.d.ts +88 -0
- package/dist/connect/new-site-agent-plugin-tokens.js +107 -0
- package/dist/connect/plugin-host/index.d.ts +1 -2
- package/dist/connect/plugin-host/index.js +18 -9
- package/dist/connect/token-sign-in.d.ts +1 -14
- package/dist/connect/token-sign-in.js +4 -23
- package/dist/core/export-props.d.ts +10 -0
- package/dist/core/export-props.js +31 -0
- package/dist/core/folder-zip-error.d.ts +5 -0
- package/dist/core/folder-zip-error.js +8 -0
- package/dist/core/host-incompatible-error.d.ts +8 -0
- package/dist/core/host-incompatible-error.js +9 -0
- package/dist/core/identity-namespace.d.ts +27 -16
- package/dist/core/identity-namespace.js +25 -22
- package/dist/core/plugin-display-name.d.ts +7 -0
- package/dist/core/plugin-display-name.js +11 -0
- package/dist/core/provider-plugin-link.d.ts +7 -0
- package/dist/core/provider-plugin-link.js +5 -0
- package/dist/{connect → core}/token-map.d.ts +11 -1
- package/dist/{connect → core}/token-map.js +15 -0
- package/dist/core/token-sign-in-list.d.ts +18 -0
- package/dist/core/token-sign-in-list.js +23 -0
- package/dist/core/update-error.d.ts +8 -0
- package/dist/core/update-error.js +9 -0
- package/dist/{lifecycle → core}/update-plan.d.ts +1 -1
- package/dist/ffmpeg-transcode/adapter.d.ts +74 -0
- package/dist/ffmpeg-transcode/adapter.js +155 -0
- package/dist/folder-zip-node.d.ts +2 -1
- package/dist/folder-zip-node.js +6 -5
- package/dist/folder-zip.d.ts +0 -4
- package/dist/folder-zip.js +1 -7
- package/dist/index.d.ts +3 -1
- package/dist/lifecycle/activation.d.ts +39 -3
- package/dist/lifecycle/activation.js +467 -418
- package/dist/lifecycle/automatic-use-offer.d.ts +62 -0
- package/dist/lifecycle/automatic-use-offer.js +52 -0
- package/dist/lifecycle/automatic-use.d.ts +33 -1
- package/dist/lifecycle/automatic-use.js +157 -38
- package/dist/lifecycle/bundled-source-archive.d.ts +1 -1
- package/dist/lifecycle/capability-projection.d.ts +0 -1
- package/dist/lifecycle/capability-projection.js +92 -23
- package/dist/lifecycle/compatibility-metadata.d.ts +1 -0
- package/dist/lifecycle/compatibility-metadata.js +6 -1
- package/dist/lifecycle/compatibility.d.ts +1 -8
- package/dist/lifecycle/compatibility.js +1 -8
- package/dist/lifecycle/credential-card-metadata.d.ts +2 -2
- package/dist/lifecycle/exports.d.ts +2 -45
- package/dist/lifecycle/exports.js +1 -30
- package/dist/lifecycle/host-tools/identity.d.ts +5 -4
- package/dist/lifecycle/host-tools/identity.js +5 -5
- package/dist/lifecycle/host-tools/ports.d.ts +10 -1
- package/dist/lifecycle/host-tools/search-tool.js +18 -8
- package/dist/lifecycle/host-tools/skill-tool.js +1 -1
- package/dist/lifecycle/index.d.ts +20 -17
- package/dist/lifecycle/index.js +5 -4
- package/dist/lifecycle/install-from-url.d.ts +1 -2
- package/dist/lifecycle/install.d.ts +4 -34
- package/dist/lifecycle/install.js +3 -3
- package/dist/lifecycle/installed-package-index.d.ts +1 -1
- package/dist/lifecycle/installed-package-index.js +4 -4
- package/dist/lifecycle/layout.d.ts +21 -25
- package/dist/lifecycle/layout.js +79 -0
- package/dist/lifecycle/manifest.d.ts +10 -7
- package/dist/lifecycle/manifest.js +20 -15
- package/dist/lifecycle/mcp-provisioning.d.ts +1 -1
- package/dist/lifecycle/metadata.d.ts +6 -3
- package/dist/lifecycle/metadata.js +2 -1
- package/dist/lifecycle/package-paths.js +59 -56
- package/dist/lifecycle/persistent-state.d.ts +10 -1
- package/dist/lifecycle/persistent-state.js +4 -2
- package/dist/lifecycle/ports.d.ts +18 -6
- package/dist/lifecycle/resolve-agent-plugin-refs.d.ts +2 -14
- package/dist/lifecycle/retire-bundled.d.ts +1 -1
- package/dist/lifecycle/search-projection.d.ts +3 -1
- package/dist/lifecycle/search-projection.js +7 -3
- package/dist/lifecycle/search.d.ts +1 -0
- package/dist/lifecycle/seed-bundled.d.ts +86 -1
- package/dist/lifecycle/seed-bundled.js +48 -84
- package/dist/lifecycle/set-enabled.d.ts +1 -13
- package/dist/lifecycle/set-enabled.js +11 -7
- package/dist/lifecycle/trusted-plugin-files.d.ts +1 -1
- package/dist/lifecycle/trusted-plugin-files.js +33 -30
- package/dist/lifecycle/types.d.ts +13 -34
- package/dist/lifecycle/uninstall.d.ts +1 -33
- package/dist/lifecycle/update-store.d.ts +0 -7
- package/dist/lifecycle/update-store.js +1 -8
- package/dist/lifecycle/update.d.ts +1 -1
- package/dist/lifecycle/update.js +60 -10
- package/dist/lifecycle/yauzl-archive-reader.d.ts +7 -2
- package/dist/lifecycle/yauzl-archive-reader.js +11 -6
- package/dist/manifest.d.ts +4 -8
- package/dist/react/AgentPluginDetailsModal.d.ts +187 -0
- package/dist/react/AgentPluginDetailsModal.js +29 -0
- package/dist/react/agent-plugin-install-port.d.ts +24 -0
- package/dist/react/agent-plugin-install-port.js +15 -0
- package/dist/react/installed-skills-composer-source.d.ts +60 -0
- package/dist/react/installed-skills-composer-source.js +111 -0
- package/dist/react/use-agent-plugins.hooks.d.ts +211 -0
- package/dist/react/use-agent-plugins.hooks.js +128 -0
- package/dist/site/activation-effects.d.ts +17 -0
- package/dist/site/activation-effects.js +31 -0
- package/dist/site/admin-surfaces/capabilities.d.ts +29 -0
- package/dist/site/admin-surfaces/capabilities.js +30 -0
- package/dist/site/admin-surfaces/delivery-bindings.d.ts +81 -0
- package/dist/site/admin-surfaces/delivery-bindings.js +161 -0
- package/dist/site/admin-surfaces/forms.d.ts +28 -0
- package/dist/site/admin-surfaces/forms.js +29 -0
- package/dist/site/admin-surfaces/handlers.d.ts +61 -0
- package/dist/site/admin-surfaces/handlers.js +35 -0
- package/dist/site/admin-surfaces/public-config.d.ts +12 -0
- package/dist/site/admin-surfaces/public-config.js +28 -0
- package/dist/site/analytics-provider-registry.d.ts +87 -0
- package/dist/site/analytics-provider-registry.js +87 -0
- package/dist/site/archive-reader-abi.d.ts +35 -0
- package/dist/site/archive-reader-abi.js +25 -0
- package/dist/site/auth-schemes.d.ts +110 -0
- package/dist/site/auth-schemes.js +119 -0
- package/dist/site/automatic-agent-plugins.d.ts +200 -0
- package/dist/site/automatic-agent-plugins.js +277 -0
- package/dist/site/bundled-contribution-sources.d.ts +24 -0
- package/dist/site/bundled-contribution-sources.js +17 -0
- package/dist/site/bundled-id-upgrade.d.ts +115 -0
- package/dist/site/bundled-id-upgrade.js +169 -0
- package/dist/site/customize-tool.d.ts +39 -0
- package/dist/site/customize-tool.js +31 -0
- package/dist/site/deploy-split-activation.d.ts +28 -0
- package/dist/site/deploy-split-activation.js +21 -0
- package/dist/site/exports/diagnostics.d.ts +37 -0
- package/dist/site/exports/diagnostics.js +55 -0
- package/dist/site/exports/runtime.d.ts +54 -0
- package/dist/site/exports/runtime.js +196 -0
- package/dist/site/exports/source.d.ts +42 -0
- package/dist/site/exports/source.js +58 -0
- package/dist/site/host-plugin-guidance.d.ts +137 -0
- package/dist/site/host-plugin-guidance.js +223 -0
- package/dist/site/host-signals.d.ts +78 -0
- package/dist/site/host-signals.js +83 -0
- package/dist/site/install-tool.d.ts +69 -0
- package/dist/site/install-tool.js +192 -0
- package/dist/site/install-upload.d.ts +175 -0
- package/dist/site/install-upload.js +324 -0
- package/dist/site/memory-i18n.d.ts +5 -0
- package/dist/site/memory-i18n.js +176 -0
- package/dist/site/memory.d.ts +80 -0
- package/dist/site/memory.js +83 -0
- package/dist/site/plugin-memory.d.ts +80 -0
- package/dist/site/plugin-memory.js +86 -0
- package/dist/site/provider-plugin-link.d.ts +112 -0
- package/dist/site/provider-plugin-link.js +100 -0
- package/dist/site/retired-plugin-tool-aliases.d.ts +40 -0
- package/dist/site/retired-plugin-tool-aliases.js +41 -0
- package/dist/site/service-ports.d.ts +108 -0
- package/dist/site/service-ports.js +2 -0
- package/dist/site/set-enabled.d.ts +80 -0
- package/dist/site/set-enabled.js +42 -0
- package/dist/site/soon-lock.d.ts +83 -0
- package/dist/site/soon-lock.js +78 -0
- package/dist/site/supersession.d.ts +61 -0
- package/dist/site/supersession.js +122 -0
- package/dist/site/uninstall-tool.d.ts +136 -0
- package/dist/site/uninstall-tool.js +203 -0
- package/dist/site/update-effects.d.ts +47 -0
- package/dist/site/update-effects.js +49 -0
- package/ffmpeg-transcode/plugin.json +16 -0
- package/github/source-control/backup-push.mjs +66 -46
- package/github/source-control/commit-site.mjs +112 -65
- package/github/source-control/write-files.mjs +86 -53
- package/github-pages/targets/github-pages.mjs +294 -233
- package/google-workspace/form-destinations/mapping.mjs +15 -7
- package/google-workspace/form-destinations/sheets.mjs +4 -2
- package/google-workspace/plugin.json +1 -0
- package/kuinetic/CHANGELOG.md +4 -0
- package/kuinetic/plugin.json +4 -1
- package/kuinetic/skills/kuinetic/SKILL.md +1 -2
- package/package.json +295 -18
- package/persistent-state.d.ts +4 -1
- package/resend/adapters/resend.mjs +5 -2
- package/resend/plugin.json +1 -1
- package/s3-compatible/jini-deploy-targets.json +1 -1
- package/s3-compatible/object-stores/s3-compatible.mjs +27 -4
- package/s3-compatible/targets/s3-compatible.mjs +3 -3
- package/site-import/plugin.json +3 -3
- package/site-import/skills/site-import/SKILL.md +62 -54
- package/site-import/skills/site-import/references/content-mapping.md +26 -20
- package/slide-design/plugin.json +1 -1
- package/slide-design/skills/slide-design/SKILL.md +8 -2
- package/ui-ux-design/CHANGELOG.md +6 -0
- package/ui-ux-design/plugin.json +1 -1
- package/ui-ux-design/skills/gstack-design/SKILL.md +6 -6
- package/ui-ux-design/skills/ui-ux-design/SKILL.md +3 -2
- package/ui-ux-design/skills/ui-ux-design/references/chrome-mobile-test-matrix.md +14 -12
- package/ui-ux-design/skills/ui-ux-design/references/ui-loop.md +16 -17
- package/vercel/NOTES.md +2 -1
- package/vercel/object-stores/vercel-blob.mjs +3 -4
- package/vercel/targets/vercel.mjs +425 -351
- package/core/commerce-server.d.ts +0 -2
- package/core/commerce-server.mjs +0 -2
- package/dist/admin-surfaces/connections/ports.d.ts +0 -110
- package/dist/admin-surfaces/connections/ports.js +0 -2
- /package/dist/{lifecycle → core}/install-errors.d.ts +0 -0
- /package/dist/{lifecycle → core}/install-errors.js +0 -0
- /package/dist/{lifecycle → core}/update-plan.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AgentPluginLayout } from "./layout.js";
|
|
2
1
|
import type { AgentPluginLifecyclePorts } from "./ports.js";
|
|
2
|
+
import type { UninstallAgentPluginRequired, UninstallAgentPluginOptional, UninstallAgentPluginResult, AgentPluginUninstallPreview } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
|
|
3
3
|
/** The plugin id has no installed package on disk for this workspace. */
|
|
4
4
|
export declare class AgentPluginNotFoundError extends Error {
|
|
5
5
|
constructor({ message }: {
|
|
@@ -20,38 +20,6 @@ export declare class AgentPluginChangedSincePreviewError extends Error {
|
|
|
20
20
|
readonly message: string;
|
|
21
21
|
}, optional?: ErrorOptions);
|
|
22
22
|
}
|
|
23
|
-
export interface UninstallAgentPluginRequired {
|
|
24
|
-
readonly layout: AgentPluginLayout;
|
|
25
|
-
readonly workspaceId: string;
|
|
26
|
-
readonly pluginId: string;
|
|
27
|
-
}
|
|
28
|
-
export interface UninstallAgentPluginOptional {
|
|
29
|
-
/** The preview a human confirmed. When given, the uninstall refuses, removing nothing, unless the digests it
|
|
30
|
-
* resolves now are exactly this preview's `archiveDigests`: a confirmation is consent to remove what was
|
|
31
|
-
* resolved for the dialog, not whatever the id names by the time the answer arrives (t91 F2.2). */
|
|
32
|
-
readonly confirmedPreview?: (AgentPluginUninstallPreview) | undefined;
|
|
33
|
-
/** Only the browser-confirmed choice may delete persistent state. Off by default. */
|
|
34
|
-
readonly deleteMemory?: boolean | undefined;
|
|
35
|
-
/** INTERNAL — `retire-bundled.ts` only, never an agent tool or HTTP route. Skips the bundled refusal
|
|
36
|
-
* (this file's header, item 2) and nothing else: that refusal exists because a bundled plugin is
|
|
37
|
-
* re-seeded on every boot, which stops being true once the host no longer ships its source
|
|
38
|
-
* (`RETIRED_BUNDLED_AGENT_PLUGINS`). The malformed-entry refusal still applies. */
|
|
39
|
-
readonly retiredBundled?: (boolean) | undefined;
|
|
40
|
-
}
|
|
41
|
-
export interface UninstallAgentPluginResult {
|
|
42
|
-
readonly pluginId: string;
|
|
43
|
-
/** Every installed archive digest removed for this plugin id — normally exactly one. All matching
|
|
44
|
-
* digests are removed: uninstall's job is to make the plugin genuinely gone, so unlike the tool
|
|
45
|
-
* loader, which must pick ONE to serve, there is no "which one" question here. */
|
|
46
|
-
readonly removedDigests: readonly string[];
|
|
47
|
-
}
|
|
48
|
-
/** What an uninstall of one plugin would remove, in a form safe to show a human: no host path. */
|
|
49
|
-
export interface AgentPluginUninstallPreview {
|
|
50
|
-
readonly pluginId: string;
|
|
51
|
-
/** Distinct manifest versions across the matching digests; empty when none declares one. */
|
|
52
|
-
readonly versions: readonly string[];
|
|
53
|
-
readonly archiveDigests: readonly string[];
|
|
54
|
-
}
|
|
55
23
|
/** A reversible staged package and its original permissions; shared by uninstall and replacement. */
|
|
56
24
|
/** One package root renamed aside, and what restoring it takes: the path it must go back to, and the
|
|
57
25
|
* mode it carried before staging unfroze its root directory. */
|
|
@@ -17,13 +17,6 @@ export interface AgentPluginUpdateJournal {
|
|
|
17
17
|
readonly startedAt: string;
|
|
18
18
|
readonly result?: 'updated' | 'rolled-back';
|
|
19
19
|
}
|
|
20
|
-
export declare class AgentPluginUpdateError extends Error {
|
|
21
|
-
readonly code: string;
|
|
22
|
-
constructor(required: {
|
|
23
|
-
code: string;
|
|
24
|
-
message: string;
|
|
25
|
-
}, optional?: ErrorOptions);
|
|
26
|
-
}
|
|
27
20
|
/** Durable per-plugin journal, audit history and frozen rollback area, all under the plugin's own
|
|
28
21
|
* state root (never under `package/sha256`, so a rollback copy is never a live digest). Files use
|
|
29
22
|
* the existing platform atomic writer. Settings snapshots are private (0600) and never returned to
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
+
import { AgentPluginUpdateError } from "../core/update-error.js";
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
import { createPersistentStateModule } from './persistent-state.js';
|
|
3
|
-
export class AgentPluginUpdateError extends Error {
|
|
4
|
-
code;
|
|
5
|
-
constructor(required, optional = {}) {
|
|
6
|
-
super(required.message, optional);
|
|
7
|
-
this.code = required.code;
|
|
8
|
-
this.name = 'AgentPluginUpdateError';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
4
|
const DIGEST_PATTERN = /^[a-f0-9]{64}$/;
|
|
12
5
|
const TRANSACTION_PATTERN = /^[a-zA-Z0-9-]{1,100}$/;
|
|
13
6
|
const JOURNAL_STATES = ['pending', 'published', 'committed'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InstallAgentPluginOptional, type InstallAgentPluginRequired } from './install.js';
|
|
2
2
|
import type { AgentPluginLifecyclePorts } from './ports.js';
|
|
3
|
-
import type { InstalledAgentPlugin } from
|
|
3
|
+
import type { InstalledAgentPlugin } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
|
|
4
4
|
export interface UpdateAgentPluginRequired extends InstallAgentPluginRequired {
|
|
5
5
|
readonly pluginId: string;
|
|
6
6
|
/** The digest the operator previewed; any other live revision refuses with PLUGIN_CHANGED. */
|
package/dist/lifecycle/update.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { createInstallModule } from './install.js';
|
|
3
3
|
import { createUninstallModule } from './uninstall.js';
|
|
4
|
-
import { createActivationModule } from './activation.js';
|
|
4
|
+
import { AgentPluginActivationsBusyError, createActivationModule } from './activation.js';
|
|
5
|
+
import { FileLockTimeoutError, FileLockLostError } from "@jini-ai/core/contracts/runtime";
|
|
5
6
|
import { createResolveAgentPluginRefsModule } from './resolve-agent-plugin-refs.js';
|
|
6
7
|
import { createPersistentStateModule } from './persistent-state.js';
|
|
7
8
|
import { createInstalledPackageIndex } from './installed-package-index.js';
|
|
8
9
|
import { provisionAgentPluginMcp } from './mcp-provisioning.js';
|
|
9
|
-
import { planAgentPluginUpdate } from '
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { planAgentPluginUpdate } from '../core/update-plan.js';
|
|
11
|
+
import { describeAgentPluginCompatibility, agentPluginDependentWarnings } from './compatibility.js';
|
|
12
|
+
import { AgentPluginHostIncompatibleError } from '../core/host-incompatible-error.js';
|
|
13
|
+
import { createAgentPluginUpdateStore, isMissing, settleAgentPluginUpdateJournal } from './update-store.js';
|
|
14
|
+
import { AgentPluginUpdateError } from '../core/update-error.js';
|
|
12
15
|
const PLAN_REFUSALS = {
|
|
13
16
|
'downgrade-refused': { code: 'PLUGIN_DOWNGRADE_REFUSED', message: 'Plugin downgrades are refused.' },
|
|
14
17
|
'id-mismatch': { code: 'PLUGIN_ID_MISMATCH', message: 'Choose a candidate for this plugin.' },
|
|
@@ -204,37 +207,81 @@ async function restoreOldBytes({ scope, store, journal, oldRoot }) {
|
|
|
204
207
|
await scope.ports.filesystem.chmod(oldRoot, 0o555);
|
|
205
208
|
}
|
|
206
209
|
/** @returns false when the old revision's MCP roster could not be re-provisioned; the bytes are
|
|
207
|
-
* already back, so the caller degrades to "restored but off" instead of wedging the journal.
|
|
210
|
+
* already back, so the caller degrades to "restored but off" instead of wedging the journal.
|
|
211
|
+
* @throws a lock wait ({@link isLockWait}) unchanged: it says nothing about the roster, so it must
|
|
212
|
+
* reach the retry path with the journal kept, never be turned into "restored but off". */
|
|
208
213
|
async function reprovisionOld({ scope, workspaceId, journal, oldRoot }) {
|
|
209
214
|
try {
|
|
210
215
|
const installed = await scope.index.indexInstalledRoot({ packageRoot: oldRoot, archiveDigest: journal.fromDigest });
|
|
211
216
|
await provisionAgentPluginMcp({ mcpProvisioning: scope.ports.mcpProvisioning, workspaceId, installed });
|
|
212
217
|
return true;
|
|
213
218
|
}
|
|
214
|
-
catch {
|
|
219
|
+
catch (error) {
|
|
220
|
+
if (isLockWait({ error }))
|
|
221
|
+
throw error;
|
|
215
222
|
return false;
|
|
216
223
|
}
|
|
217
224
|
}
|
|
225
|
+
/** How long background recovery waits before each new attempt after a lock wait at boot. */
|
|
226
|
+
const RECOVERY_RETRY_DELAYS_MS = [5_000, 30_000, 120_000, 600_000];
|
|
227
|
+
/** A wait on another process's lock (the plugin's own lock or the activations lock). It says nothing
|
|
228
|
+
* about whether the plugin is healthy, so it must never be treated as an unrecovered update. */
|
|
229
|
+
function isLockWait({ error }, _optional = {}) {
|
|
230
|
+
return error instanceof FileLockTimeoutError || error instanceof FileLockLostError || error instanceof AgentPluginActivationsBusyError;
|
|
231
|
+
}
|
|
218
232
|
/** Boot only, before serving runs: recover incomplete switches, file committed audits, then
|
|
219
233
|
* collect retained rollback bytes. One plugin's failure does not stop the others; the first
|
|
220
|
-
* failure is rethrown afterwards.
|
|
234
|
+
* failure is rethrown afterwards. A plugin whose lock could not be taken in time is never switched
|
|
235
|
+
* off for it: boot goes on and recovery retries in the background (named log lines).
|
|
236
|
+
* Bundled plugins have no update journal and get no decisions.
|
|
221
237
|
* @complexity O(p + f) workspace entries and retained rollback files.
|
|
222
238
|
*/
|
|
223
239
|
async function reconcileAgentPluginUpdates({ scope, workspaceId }) {
|
|
224
|
-
const workspaceRoot = scope.ports.layout.forWorkspace({ workspaceId }).root;
|
|
225
240
|
const failures = [];
|
|
241
|
+
const waiting = [];
|
|
226
242
|
for (const pluginId of await listPluginStateIds({ scope, workspaceId })) {
|
|
227
243
|
try {
|
|
228
|
-
await
|
|
244
|
+
await reconcileUnderLock({ scope, workspaceId, pluginId });
|
|
229
245
|
}
|
|
230
246
|
catch (error) {
|
|
247
|
+
if (isLockWait({ error })) {
|
|
248
|
+
waiting.push(pluginId);
|
|
249
|
+
scope.ports.onEvent?.({ event: 'agent-plugin-update-recovery-waiting', pluginId, message: `Plugin '${pluginId}': another process is holding its lock, so finishing an interrupted update is waiting. The plugin keeps its current on/off setting and recovery will retry in the background.` });
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
231
252
|
failures.push(error);
|
|
232
253
|
scope.ports.onEvent?.({ event: 'agent-plugin-update-recovery-failed', message: `Plugin '${pluginId}': an interrupted update could not be recovered (${errorCode({ error })}); it is kept off until a later boot recovers it.` });
|
|
233
254
|
}
|
|
234
255
|
}
|
|
256
|
+
for (const pluginId of waiting)
|
|
257
|
+
void retryRecoveryInBackground({ scope, workspaceId, pluginId }).catch(() => undefined);
|
|
235
258
|
if (failures.length)
|
|
236
259
|
throw failures[0];
|
|
237
260
|
}
|
|
261
|
+
async function reconcileUnderLock({ scope, workspaceId, pluginId }) {
|
|
262
|
+
const workspaceRoot = scope.ports.layout.forWorkspace({ workspaceId }).root;
|
|
263
|
+
await scope.persistent.withPluginLock({ workspaceRoot, pluginId, run: () => reconcilePlugin({ scope, workspaceId, pluginId }) });
|
|
264
|
+
}
|
|
265
|
+
/** Retries a recovery that waited on a lock, a few times with growing pauses. Never disables the
|
|
266
|
+
* plugin; a failure that is not a lock wait is logged and ends the retries (the journal stays for
|
|
267
|
+
* the next boot). @complexity O(r) attempts, each one a full recovery of one plugin. */
|
|
268
|
+
async function retryRecoveryInBackground({ scope, workspaceId, pluginId }) {
|
|
269
|
+
for (const delayMs of RECOVERY_RETRY_DELAYS_MS) {
|
|
270
|
+
await (scope.ports.clock.sleepInBackground ?? scope.ports.clock.sleep)({ ms: delayMs });
|
|
271
|
+
try {
|
|
272
|
+
await reconcileUnderLock({ scope, workspaceId, pluginId });
|
|
273
|
+
scope.ports.onEvent?.({ event: 'agent-plugin-update-recovery-resumed', pluginId, message: `Plugin '${pluginId}': the lock was released and the interrupted update has now been recovered.` });
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
if (isLockWait({ error }))
|
|
278
|
+
continue;
|
|
279
|
+
scope.ports.onEvent?.({ event: 'agent-plugin-update-recovery-failed', pluginId, message: `Plugin '${pluginId}': an interrupted update could not be recovered on retry (${errorCode({ error })}); it is kept off until a later boot recovers it.` });
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
scope.ports.onEvent?.({ event: 'agent-plugin-update-recovery-gave-up', pluginId, message: `Plugin '${pluginId}': its lock stayed busy through every background retry. It keeps its current on/off setting and recovery will try again at the next boot.` });
|
|
284
|
+
}
|
|
238
285
|
/** Workspace entries that can be plugin state roots. Reserved names (staging, packages, memory,
|
|
239
286
|
* data) and invalid ids are rejected by the layout itself and are skipped, never locked. */
|
|
240
287
|
async function listPluginStateIds({ scope, workspaceId }) {
|
|
@@ -272,11 +319,14 @@ async function reconcilePlugin({ scope, workspaceId, pluginId }) {
|
|
|
272
319
|
for (const rollbackRoot of await store.listRollbackRoots({}))
|
|
273
320
|
await scope.removal.removeFrozenPackageTree(rollbackRoot);
|
|
274
321
|
}
|
|
275
|
-
/** Unrecovered = off: an unreadable journal or a failed restore switches the plugin off (best
|
|
322
|
+
/** Unrecovered = off (except a lock wait, see below): an unreadable journal or a failed restore switches the plugin off (best
|
|
276
323
|
* effort; the journal stays, so the next boot retries) and rethrows. A failure only filing a
|
|
277
324
|
* committed audit or collecting rollback bytes never reaches here. Bundled plugins never get a
|
|
278
325
|
* journal from this module and are never touched. */
|
|
279
326
|
async function switchOffUnrecovered({ scope, workspaceId, pluginId, error }) {
|
|
327
|
+
// A busy lock proves nothing about the plugin: leave it as it is; the caller retries in the background.
|
|
328
|
+
if (isLockWait({ error }))
|
|
329
|
+
throw error;
|
|
280
330
|
const workspaceRoot = scope.ports.layout.forWorkspace({ workspaceId }).root;
|
|
281
331
|
try {
|
|
282
332
|
if (!await scope.activation.isAgentPluginRecordedAsBundled(workspaceRoot, pluginId)) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AgentPluginArchiveReaderPort } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
|
|
1
2
|
/**
|
|
2
3
|
* @file The real `AgentPluginArchiveReaderPort` adapter, backed by `yauzl`.
|
|
3
4
|
*
|
|
@@ -54,8 +55,12 @@ export interface YauzlPort {
|
|
|
54
55
|
validateEntrySizes: boolean;
|
|
55
56
|
}): Promise<YauzlZipFile>;
|
|
56
57
|
}
|
|
57
|
-
import type { AgentPluginArchiveReaderPort } from "./install.js";
|
|
58
58
|
export declare function createYauzlAgentPluginArchiveReader({ yauzl }: {
|
|
59
59
|
readonly yauzl: YauzlPort;
|
|
60
|
-
},
|
|
60
|
+
}, { rejectSpecialUnixEntry }?: {
|
|
61
|
+
rejectSpecialUnixEntry?: (required: {
|
|
62
|
+
entry: YauzlEntry;
|
|
63
|
+
kind: "symlink" | "fifo" | "device";
|
|
64
|
+
}) => void;
|
|
65
|
+
}): AgentPluginArchiveReaderPort;
|
|
61
66
|
//# sourceMappingURL=yauzl-archive-reader.d.ts.map
|
|
@@ -14,7 +14,7 @@ const UNIX_HOST_SYSTEM = 3;
|
|
|
14
14
|
* Any bit in the standard rwx-for-owner/group/other executable mask.
|
|
15
15
|
*/
|
|
16
16
|
const EXECUTABLE_MODE_MASK = 0o111;
|
|
17
|
-
export function createYauzlAgentPluginArchiveReader({ yauzl },
|
|
17
|
+
export function createYauzlAgentPluginArchiveReader({ yauzl }, { rejectSpecialUnixEntry } = {}) {
|
|
18
18
|
return {
|
|
19
19
|
async *entries({ archive }) {
|
|
20
20
|
/**
|
|
@@ -28,7 +28,7 @@ export function createYauzlAgentPluginArchiveReader({ yauzl }, _optional = {}) {
|
|
|
28
28
|
});
|
|
29
29
|
try {
|
|
30
30
|
for await (const entry of zipfile.eachEntry())
|
|
31
|
-
yield archiveEntryFor(zipfile, entry);
|
|
31
|
+
yield archiveEntryFor(zipfile, entry, { rejectSpecialUnixEntry });
|
|
32
32
|
}
|
|
33
33
|
finally {
|
|
34
34
|
zipfile.close();
|
|
@@ -47,17 +47,22 @@ function readUnixMode(entry) {
|
|
|
47
47
|
return null;
|
|
48
48
|
return (entry.externalFileAttributes >>> 16) & 0xffff;
|
|
49
49
|
}
|
|
50
|
-
function archiveEntryFor(zipfile, entry) {
|
|
50
|
+
function archiveEntryFor(zipfile, entry, { rejectSpecialUnixEntry }) {
|
|
51
51
|
/**
|
|
52
52
|
* The entry's content (the link target text) is deliberately never read — see this
|
|
53
53
|
* module's header. `install.ts` rejects every symlink entry unconditionally.
|
|
54
54
|
*/
|
|
55
55
|
const unixMode = readUnixMode(entry);
|
|
56
56
|
const fileType = unixMode === null ? 0 : unixMode & S_IFMT;
|
|
57
|
-
if (fileType === S_IFLNK)
|
|
57
|
+
if (fileType === S_IFLNK) {
|
|
58
|
+
rejectSpecialUnixEntry?.({ entry, kind: "symlink" });
|
|
58
59
|
return { kind: "symlink", entryPath: entry.fileName };
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
}
|
|
61
|
+
if (![0, S_IFREG, S_IFDIR].includes(fileType)) {
|
|
62
|
+
const kind = fileType === S_IFIFO ? "fifo" : "device";
|
|
63
|
+
rejectSpecialUnixEntry?.({ entry, kind });
|
|
64
|
+
return { kind, entryPath: entry.fileName };
|
|
65
|
+
}
|
|
61
66
|
// File mode defines links even when a hostile filename masquerades as a directory.
|
|
62
67
|
if (entry.fileName.endsWith("/"))
|
|
63
68
|
return { kind: "directory", entryPath: entry.fileName };
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type AgentPluginIdentityReadOptions } from './core/identity-namespace.js';
|
|
2
|
+
import type { PluginManifestAuthor } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
|
|
1
3
|
/**
|
|
2
4
|
* Types for the Agent Plugins 1.0.0 open standard (published by a Technical Steering Committee
|
|
3
5
|
* with maintainers from Amazon, Cursor, Google, Microsoft, OpenAI, and Vercel). A plugin is a
|
|
@@ -15,11 +17,6 @@ export declare const AGENT_PLUGINS_MCP_SCHEMA_URL = "https://agent-plugins.org/s
|
|
|
15
17
|
export declare const PLUGIN_MANIFEST_FILENAME = "plugin.json";
|
|
16
18
|
export declare const PLUGIN_SKILLS_DIRNAME = "skills";
|
|
17
19
|
export declare const PLUGIN_MCP_MANIFEST_FILENAME = "mcp.json";
|
|
18
|
-
export interface PluginManifestAuthor {
|
|
19
|
-
readonly name?: string;
|
|
20
|
-
readonly email?: string;
|
|
21
|
-
readonly url?: string;
|
|
22
|
-
}
|
|
23
20
|
export type { PluginIdentityExtension } from "@jini-ai/core/plugin-directory";
|
|
24
21
|
export interface PluginManifest {
|
|
25
22
|
readonly $schema?: string;
|
|
@@ -70,11 +67,10 @@ export declare function isMcpManifest(required: {
|
|
|
70
67
|
* Hosts inject identityNamespace; the default is `jini`, with a legacy-key fallback. */
|
|
71
68
|
export declare function validatePluginManifest(required: {
|
|
72
69
|
readonly value: unknown;
|
|
73
|
-
}, optional?:
|
|
74
|
-
readonly identityNamespace?: string;
|
|
75
|
-
}): boolean;
|
|
70
|
+
}, optional?: AgentPluginIdentityReadOptions): boolean;
|
|
76
71
|
/** Object-argument facade for the legacy structural validator. */
|
|
77
72
|
export declare function validateMcpManifest(required: {
|
|
78
73
|
readonly value: unknown;
|
|
79
74
|
}, _optional?: Record<string, never>): boolean;
|
|
75
|
+
export type { AgentPluginIdentityReadOptions, LegacyAgentPluginIdentity } from "./core/identity-namespace.js";
|
|
80
76
|
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode, RefObject } from "react";
|
|
2
|
+
import type { Translate } from "@jini-ai/core/text";
|
|
3
|
+
import type { AdminSurfaceBootstrap, AdminSurfaceActionOutcome } from "@jini-ai/core/contracts/site/agent-plugins-admin-surfaces";
|
|
4
|
+
import type { InspectedAgentPlugin } from "./use-agent-plugins.hooks.js";
|
|
5
|
+
type AgentPluginSurfaceSummary = NonNullable<InspectedAgentPlugin["surfaces"]>[number];
|
|
6
|
+
interface AgentPluginSurfacesPort {
|
|
7
|
+
list(required: {
|
|
8
|
+
readonly pluginId: string;
|
|
9
|
+
}, optional?: Record<string, never>): Promise<{
|
|
10
|
+
readonly surfaces: readonly AgentPluginSurfaceSummary[];
|
|
11
|
+
}>;
|
|
12
|
+
bootstrap(required: {
|
|
13
|
+
readonly pluginId: string;
|
|
14
|
+
readonly surfaceId: string;
|
|
15
|
+
}, optional?: Record<string, never>): Promise<AdminSurfaceBootstrap>;
|
|
16
|
+
action(required: {
|
|
17
|
+
readonly pluginId: string;
|
|
18
|
+
readonly surfaceId: string;
|
|
19
|
+
readonly action: string;
|
|
20
|
+
readonly payload: unknown;
|
|
21
|
+
}, optional?: Record<string, never>): Promise<AdminSurfaceActionOutcome & {
|
|
22
|
+
readonly hostSignIns?: readonly {
|
|
23
|
+
readonly authorizationUrl: string;
|
|
24
|
+
readonly expiresAt: string;
|
|
25
|
+
}[];
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
export interface AgentPluginDetailsModalProps {
|
|
29
|
+
readonly useAgentPluginMemoryHook: (required: {
|
|
30
|
+
pluginId: string;
|
|
31
|
+
}, optional?: Record<string, never>) => {
|
|
32
|
+
t: Translate;
|
|
33
|
+
listing: {
|
|
34
|
+
pluginId: string;
|
|
35
|
+
learned: {
|
|
36
|
+
relativePath: string;
|
|
37
|
+
text: string;
|
|
38
|
+
}[];
|
|
39
|
+
notes: {
|
|
40
|
+
relativePath: string;
|
|
41
|
+
text: string;
|
|
42
|
+
}[];
|
|
43
|
+
limits: {
|
|
44
|
+
learned: number;
|
|
45
|
+
notes: number;
|
|
46
|
+
files: number;
|
|
47
|
+
};
|
|
48
|
+
} | null;
|
|
49
|
+
entryPath: string;
|
|
50
|
+
text: string;
|
|
51
|
+
renamePath: (required: {
|
|
52
|
+
entryPath: string;
|
|
53
|
+
}, optional?: {}) => void;
|
|
54
|
+
openNote: (required: {
|
|
55
|
+
entryPath: string;
|
|
56
|
+
}, optional?: {}) => void;
|
|
57
|
+
setText: (required: {
|
|
58
|
+
text: string;
|
|
59
|
+
}, optional?: {}) => void;
|
|
60
|
+
save: () => Promise<void>;
|
|
61
|
+
saving: boolean;
|
|
62
|
+
status: string | null;
|
|
63
|
+
editorDisabled: boolean;
|
|
64
|
+
pathInputId: string;
|
|
65
|
+
notesInputId: string;
|
|
66
|
+
noteFilesHeadingId: string;
|
|
67
|
+
learnedHeadingId: string;
|
|
68
|
+
notesEmptyMessage: string | null;
|
|
69
|
+
learnedEmptyMessage: string | null;
|
|
70
|
+
};
|
|
71
|
+
readonly useAgentPluginDetailsViewHook: (required: {
|
|
72
|
+
displayName: string;
|
|
73
|
+
t: Translate;
|
|
74
|
+
memoryT: Translate;
|
|
75
|
+
}, optional?: {}) => {
|
|
76
|
+
onView: (viewId: string) => void;
|
|
77
|
+
title: string;
|
|
78
|
+
};
|
|
79
|
+
readonly useAgentPluginSurfacesHook: (required: {
|
|
80
|
+
readonly pluginId: string;
|
|
81
|
+
readonly port: AgentPluginSurfacesPort;
|
|
82
|
+
}, optional?: Record<string, never>) => readonly AgentPluginSurfaceSummary[];
|
|
83
|
+
readonly useHostAdminSurfaceFrame: (required: {
|
|
84
|
+
readonly pluginId: string;
|
|
85
|
+
readonly surface: AgentPluginSurfaceSummary;
|
|
86
|
+
readonly port: AgentPluginSurfacesPort;
|
|
87
|
+
}, optional?: Record<string, never>) => {
|
|
88
|
+
readonly attributes: {
|
|
89
|
+
readonly src: string;
|
|
90
|
+
readonly title: string;
|
|
91
|
+
readonly sandbox: string;
|
|
92
|
+
readonly referrerPolicy: "no-referrer";
|
|
93
|
+
};
|
|
94
|
+
readonly frameRef: RefObject<HTMLIFrameElement | null>;
|
|
95
|
+
readonly status: "open" | "navigated" | "failed";
|
|
96
|
+
readonly onLoad: () => void;
|
|
97
|
+
readonly height: number | null;
|
|
98
|
+
readonly signIns: readonly {
|
|
99
|
+
readonly authorizationUrl: string;
|
|
100
|
+
readonly expiresAt: string;
|
|
101
|
+
}[];
|
|
102
|
+
readonly onSignInOpened: (link: {
|
|
103
|
+
readonly authorizationUrl: string;
|
|
104
|
+
readonly expiresAt: string;
|
|
105
|
+
}) => void;
|
|
106
|
+
};
|
|
107
|
+
readonly plugin: InspectedAgentPlugin;
|
|
108
|
+
/** `AgentPlugins`' bound translator — the modal's title copy. */
|
|
109
|
+
readonly t: Translate;
|
|
110
|
+
readonly onClose: () => void;
|
|
111
|
+
/** Injectable seam for the listing. Defaults to the real {@link useWiredAgentPluginDetailsModal};
|
|
112
|
+
* a test can pass a fake to exercise the modal's rendering with a fixed file list/selection. */
|
|
113
|
+
readonly useDetails: (required: {
|
|
114
|
+
pluginId: string;
|
|
115
|
+
}, optional?: Record<string, never>) => {
|
|
116
|
+
files: readonly {
|
|
117
|
+
readonly relativePath: string;
|
|
118
|
+
readonly content: string | null;
|
|
119
|
+
readonly unavailableReason?: string | null;
|
|
120
|
+
}[];
|
|
121
|
+
selectedFile: {
|
|
122
|
+
readonly relativePath: string;
|
|
123
|
+
readonly content: string | null;
|
|
124
|
+
readonly unavailableReason?: string | null;
|
|
125
|
+
} | null;
|
|
126
|
+
selectFile: (relativePath: string) => void;
|
|
127
|
+
status?: {
|
|
128
|
+
readonly text: string;
|
|
129
|
+
readonly role: "status" | "alert";
|
|
130
|
+
} | null;
|
|
131
|
+
listNotice?: string | null;
|
|
132
|
+
};
|
|
133
|
+
/** Plugin-owned admin surfaces (2026-10-20); a test passes a typed fake. */
|
|
134
|
+
readonly surfacesPort: AgentPluginSurfacesPort;
|
|
135
|
+
readonly kit: {
|
|
136
|
+
AgentPluginMemoryPanel: ComponentType<{
|
|
137
|
+
controller: ReturnType<AgentPluginDetailsModalProps["useAgentPluginMemoryHook"]>;
|
|
138
|
+
}>;
|
|
139
|
+
AgentPluginMaturity: ComponentType<{
|
|
140
|
+
maturity: InspectedAgentPlugin["maturity"];
|
|
141
|
+
t: Translate;
|
|
142
|
+
}>;
|
|
143
|
+
AgentPluginSurfaceFrame: ComponentType<{
|
|
144
|
+
pluginId: string;
|
|
145
|
+
surface: AgentPluginSurfaceSummary;
|
|
146
|
+
port: AgentPluginSurfacesPort;
|
|
147
|
+
t: Translate;
|
|
148
|
+
useAdminSurfaceFrame: AgentPluginDetailsModalProps["useHostAdminSurfaceFrame"];
|
|
149
|
+
}>;
|
|
150
|
+
PackageFilesModal: ComponentType<{
|
|
151
|
+
title: string;
|
|
152
|
+
headerExtras: ReactNode;
|
|
153
|
+
onView: (viewId: string) => void;
|
|
154
|
+
initialViewId: string | undefined;
|
|
155
|
+
files: ReturnType<AgentPluginDetailsModalProps["useDetails"]>["files"];
|
|
156
|
+
selectedFile: ReturnType<AgentPluginDetailsModalProps["useDetails"]>["selectedFile"];
|
|
157
|
+
onSelectFile: (relativePath: string) => void;
|
|
158
|
+
status: {
|
|
159
|
+
readonly text: string;
|
|
160
|
+
readonly role: "status" | "alert";
|
|
161
|
+
} | null;
|
|
162
|
+
listNotice: string | null;
|
|
163
|
+
handlePrefix: string;
|
|
164
|
+
t: Translate;
|
|
165
|
+
additionalViews: readonly {
|
|
166
|
+
id: string;
|
|
167
|
+
label: string;
|
|
168
|
+
custom: ReactNode;
|
|
169
|
+
}[];
|
|
170
|
+
onClose: () => void;
|
|
171
|
+
}>;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Inspection of one installed Agent Plugin's package files and editable project memory.
|
|
176
|
+
*
|
|
177
|
+
* Renders through the shared `PackageFilesModal` (2026-09-13), the same component the Plugins
|
|
178
|
+
* screen's viewer uses. Since 2026-09-13 its content comes from `AGENT_PLUGIN_FILES` — the server
|
|
179
|
+
* resolves the id against installed packages and reads inside that package root only, never
|
|
180
|
+
* following a symlink — rather than a compile-time catalog that missed plugins nobody had listed.
|
|
181
|
+
*
|
|
182
|
+
* Since 2026-10-20 each admin surface the plugin contributes (for example its "Manage connection"
|
|
183
|
+
* screen) is one more view after Memory, titled by the plugin and rendered sandboxed.
|
|
184
|
+
*/
|
|
185
|
+
export declare function AgentPluginDetailsModal({ plugin, t, onClose, useDetails, useAgentPluginMemoryHook, useAgentPluginDetailsViewHook, useAgentPluginSurfacesHook, surfacesPort, useHostAdminSurfaceFrame, kit: { AgentPluginMemoryPanel, AgentPluginMaturity, PackageFilesModal, AgentPluginSurfaceFrame } }: AgentPluginDetailsModalProps, _optional?: {}): import("react").JSX.Element;
|
|
186
|
+
export {};
|
|
187
|
+
//# sourceMappingURL=AgentPluginDetailsModal.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Inspection of one installed Agent Plugin's package files and editable project memory.
|
|
4
|
+
*
|
|
5
|
+
* Renders through the shared `PackageFilesModal` (2026-09-13), the same component the Plugins
|
|
6
|
+
* screen's viewer uses. Since 2026-09-13 its content comes from `AGENT_PLUGIN_FILES` — the server
|
|
7
|
+
* resolves the id against installed packages and reads inside that package root only, never
|
|
8
|
+
* following a symlink — rather than a compile-time catalog that missed plugins nobody had listed.
|
|
9
|
+
*
|
|
10
|
+
* Since 2026-10-20 each admin surface the plugin contributes (for example its "Manage connection"
|
|
11
|
+
* screen) is one more view after Memory, titled by the plugin and rendered sandboxed.
|
|
12
|
+
*/
|
|
13
|
+
export function AgentPluginDetailsModal({ plugin, t, onClose, useDetails, useAgentPluginMemoryHook, useAgentPluginDetailsViewHook, useAgentPluginSurfacesHook, surfacesPort, useHostAdminSurfaceFrame, kit: { AgentPluginMemoryPanel, AgentPluginMaturity, PackageFilesModal, AgentPluginSurfaceFrame } }, _optional = {}) {
|
|
14
|
+
const memory = useAgentPluginMemoryHook({ pluginId: plugin.id });
|
|
15
|
+
const view = useAgentPluginDetailsViewHook({ displayName: plugin.displayName, t, memoryT: memory.t });
|
|
16
|
+
const { files, selectedFile, selectFile, status = null, listNotice = null } = useDetails({ pluginId: plugin.id });
|
|
17
|
+
const listed = useAgentPluginSurfacesHook({ pluginId: plugin.id, port: surfacesPort });
|
|
18
|
+
// Opened from "Manage": the row already listed the screens, so the first render has their tabs
|
|
19
|
+
// (the shell picks its starting view once, at mount).
|
|
20
|
+
const surfaces = listed.length > 0 ? listed : plugin.surfaces ?? [];
|
|
21
|
+
const firstSurface = plugin.surfaces?.[0];
|
|
22
|
+
const surfaceViews = surfaces.map((surface) => ({
|
|
23
|
+
id: `plugin-surface-${surface.id}`,
|
|
24
|
+
label: surface.title,
|
|
25
|
+
custom: _jsx(AgentPluginSurfaceFrame, { pluginId: plugin.id, surface: surface, port: surfacesPort, t: t, useAdminSurfaceFrame: useHostAdminSurfaceFrame }, surface.id),
|
|
26
|
+
}));
|
|
27
|
+
return (_jsx(PackageFilesModal, { title: view.title, headerExtras: _jsx(AgentPluginMaturity, { maturity: plugin.maturity, t: t }), onView: view.onView, initialViewId: firstSurface ? `plugin-surface-${firstSurface.id}` : undefined, files: files, selectedFile: selectedFile, onSelectFile: selectFile, status: status, listNotice: listNotice, handlePrefix: "agent-plugin-file", t: t, additionalViews: [{ id: "plugin-memory", label: memory.t("Memory"), custom: _jsx(AgentPluginMemoryPanel, { controller: memory }) }, ...surfaceViews], onClose: onClose }));
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=AgentPluginDetailsModal.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** The live upload, through the shared authenticated request seam (session expiry, API prefix). */
|
|
2
|
+
export declare function createAgentPluginInstallPort<Result>({ request, workspaceId, digest: digestBytes }: {
|
|
3
|
+
request: <T>(required: {
|
|
4
|
+
path: string;
|
|
5
|
+
method: string;
|
|
6
|
+
body: Blob;
|
|
7
|
+
}) => Promise<T>;
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
digest: (algorithm: "SHA-256", data: ArrayBuffer) => Promise<ArrayBuffer>;
|
|
10
|
+
}, _optional?: Record<string, never>): {
|
|
11
|
+
installZip: ({ file, sha256, replace, update }: {
|
|
12
|
+
file: File;
|
|
13
|
+
sha256: string;
|
|
14
|
+
replace?: boolean;
|
|
15
|
+
update?: {
|
|
16
|
+
pluginId: string;
|
|
17
|
+
expectedOldDigest: string;
|
|
18
|
+
};
|
|
19
|
+
}, _optional?: Record<string, never>) => Promise<Result>;
|
|
20
|
+
sha256: ({ file }: {
|
|
21
|
+
file: File;
|
|
22
|
+
}, _optional?: Record<string, never>) => Promise<string>;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=agent-plugin-install-port.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The live upload, through the shared authenticated request seam (session expiry, API prefix). */
|
|
2
|
+
export function createAgentPluginInstallPort({ request, workspaceId, digest: digestBytes }, _optional = {}) {
|
|
3
|
+
return {
|
|
4
|
+
installZip: ({ file, sha256, replace = false, update }, _optional = {}) => request({
|
|
5
|
+
path: `/workspaces/${workspaceId}/agent-plugins/${update ? encodeURIComponent(update.pluginId) + "/update/zip" : "install/zip"}?${new URLSearchParams({ expectedSha256: sha256, replace: String(replace), ...(update ? { expectedOldDigest: update.expectedOldDigest } : {}) })}`,
|
|
6
|
+
method: "POST",
|
|
7
|
+
body: file.slice(0, file.size, "application/zip"),
|
|
8
|
+
}),
|
|
9
|
+
sha256: async ({ file }, _optional = {}) => {
|
|
10
|
+
const digest = await digestBytes("SHA-256", await file.arrayBuffer());
|
|
11
|
+
return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=agent-plugin-install-port.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
interface ComposerCapability {
|
|
2
|
+
readonly groupId: string;
|
|
3
|
+
readonly groupLabel: string;
|
|
4
|
+
readonly item: {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
kind: string;
|
|
9
|
+
keywords: readonly string[];
|
|
10
|
+
insertText: string;
|
|
11
|
+
};
|
|
12
|
+
readonly resolve: (required: {
|
|
13
|
+
argument: string | null | undefined;
|
|
14
|
+
}, optional?: Record<string, never>) => {
|
|
15
|
+
readonly kind: "installed-skill";
|
|
16
|
+
readonly toolId: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
interface ComposerCapabilitySource {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
list(): Promise<readonly ComposerCapability[]>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Builds a {@link ComposerCapabilitySource} backed by the installed-Skills route.
|
|
25
|
+
*
|
|
26
|
+
* Degrades to an empty list on ANY failure — non-2xx, network error, or a body that isn't the
|
|
27
|
+
* expected `{skills: [...]}` shape — rather than throwing. Load-bearing, not defensive polish
|
|
28
|
+
* (INV-001): `projectComposerCapabilities` awaits every source's `list()` through one
|
|
29
|
+
* `Promise.all`, so a single REJECTING source takes the WHOLE projection down with it, including
|
|
30
|
+
* the bundled catalog's always-available `/search` and `/mcp` rows. A workspace with zero
|
|
31
|
+
* installed skills, an unauthorized session, or a route that 500s on a duplicate-frontmatter-name
|
|
32
|
+
* conflict must cost this one capability — never the rest of the composer.
|
|
33
|
+
*
|
|
34
|
+
* @param _input - No required inputs; defaults preserve the existing no-argument callers.
|
|
35
|
+
* @param options.request - Authenticated request port, replaceable for direct failure-path tests.
|
|
36
|
+
* @returns A source whose list uses its cache; reload conditionally revalidates. Force supersedes
|
|
37
|
+
* pending work but still sends the validator. Failures resolve to the last good list (else empty); aborts are silent.
|
|
38
|
+
* @example createInstalledSkillsComposerCapabilitySource().list();
|
|
39
|
+
* @complexity Cached reads O(1); revalidation O(n) time/space for n installed skills, one request.
|
|
40
|
+
*/
|
|
41
|
+
export declare function createInstalledSkillsComposerCapabilitySource({ request, path, isNotModified, reportFailure }: {
|
|
42
|
+
request: <T>(required: {
|
|
43
|
+
path: string;
|
|
44
|
+
method: string;
|
|
45
|
+
}, optional: {
|
|
46
|
+
headers: Record<string, string>;
|
|
47
|
+
onOk: (required: {
|
|
48
|
+
response: Pick<Response, "headers">;
|
|
49
|
+
}, optional?: Record<string, never>) => void;
|
|
50
|
+
}) => Promise<T>;
|
|
51
|
+
path: string;
|
|
52
|
+
isNotModified: (error: unknown) => boolean;
|
|
53
|
+
reportFailure: (message: string, error: unknown) => void;
|
|
54
|
+
}, _optional?: Record<string, never>): ComposerCapabilitySource & {
|
|
55
|
+
reload: (_input?: Record<string, never>, options?: {
|
|
56
|
+
force?: boolean;
|
|
57
|
+
}) => Promise<readonly ComposerCapability[]>;
|
|
58
|
+
};
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=installed-skills-composer-source.d.ts.map
|