@jini-ai/agent-plugins 0.7.1 → 0.7.3-next.1
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 +9 -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.js +8 -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 +3 -3
- 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 +25 -20
- 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
|
@@ -62,251 +62,250 @@ import { createActivationModule } from "./activation.js";
|
|
|
62
62
|
import { createBundledDigestsModule } from "./bundled-digests.js";
|
|
63
63
|
import { createInstalledPackageIndex } from "./installed-package-index.js";
|
|
64
64
|
import { createCapabilityProjectionModule } from "./capability-projection.js";
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (refusal !== undefined)
|
|
117
|
-
return { ok: false, reason: refusal };
|
|
118
|
-
const resolved = await resolveOnePluginRef({ pluginRefId, packagesDir: workspaceLayout.root, deliveryMode, bundledDigests }, request);
|
|
119
|
-
if (!resolved.ok)
|
|
120
|
-
return resolved;
|
|
121
|
-
const note = inactiveRead ? `Agent Plugin '${pluginRefId}' is installed, off. Read-only guidance follows; its tools are unavailable until enabled through the existing approval flow.\n\n` : '';
|
|
122
|
-
sections.push(note + resolved.section);
|
|
123
|
-
}
|
|
124
|
-
return { ok: true, promptPrefix: sections.join("\n\n") };
|
|
125
|
-
}
|
|
126
|
-
/** The run-start refusal for one ref's activation verdict, or `undefined` when it may be injected.
|
|
127
|
-
* @complexity O(1). */
|
|
128
|
-
// A distinct reason from "not installed", because the operator's remedy is different: the bytes
|
|
129
|
-
// ARE here and the fix is to enable the plugin, not to install it. Telling them to install
|
|
130
|
-
// something already present is the kind of wrong-but-plausible error message that costs an
|
|
131
|
-
// afternoon.
|
|
132
|
-
function activationRefusal(pluginRefId, verdict, { allowInactiveGuidance = false } = {}) {
|
|
133
|
-
if (verdict.verdict === "active")
|
|
134
|
-
return undefined;
|
|
135
|
-
if (allowInactiveGuidance && verdict.verdict === 'inactive')
|
|
136
|
-
return undefined;
|
|
137
|
-
if (verdict.verdict === "undetermined") {
|
|
138
|
-
// Native activation-read diagnostics can name the host path; the model needs only the remedy.
|
|
139
|
-
return (`Agent Plugin '${pluginRefId}' was not loaded: this workspace's activation record could not be read, so whether ` +
|
|
140
|
-
`it is enabled cannot be confirmed. Nothing was injected; repair activations.json and start the run again.`);
|
|
141
|
-
}
|
|
142
|
-
return (`Agent Plugin '${pluginRefId}' is installed in this workspace but is not enabled — it ships with ${ports.productName} and ` +
|
|
143
|
-
"stays inactive until an operator turns it on. Enable it before pinning it to a run.");
|
|
65
|
+
/** Reads the delivery mode for this process. An unset or unrecognised value is `inject` — an A/B
|
|
66
|
+
* affordance must never be able to change production behaviour by typo. */
|
|
67
|
+
function resolveAgentPluginDeliveryMode(ports) { return ports.deliveryMode; }
|
|
68
|
+
/** Legacy internal positional adapter; all admission and file resolution live in the object boundary. */
|
|
69
|
+
async function resolveAgentPluginRefs({ ports, pluginRefIds, workspaceLayout }, { deliveryMode = resolveAgentPluginDeliveryMode(ports) } = {}) {
|
|
70
|
+
return resolveAgentPluginSelection({ ports, pluginRefIds, workspaceLayout }, { deliveryMode });
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Resolves every pinned `pluginRefId` into real on-disk text and joins the results into one
|
|
74
|
+
* prompt-prefix block, in the order the refs were pinned.
|
|
75
|
+
*
|
|
76
|
+
* @param pluginRefIds - This run's pinned Agent Plugin ids (`run-start-context.ts`'s decoded
|
|
77
|
+
* `pluginRefIds` — already filtered to non-empty strings by that point). An empty array resolves
|
|
78
|
+
* to an empty prefix with no filesystem access at all — the common case (no plugin pinned).
|
|
79
|
+
* @param workspaceLayout - This run's own workspace's Agent Plugin layout
|
|
80
|
+
* (`resolveAgentPluginLayout().forWorkspace(workspaceId)`), never a shared/instance-level one —
|
|
81
|
+
* see `layout.ts`'s own tenant-isolation header for why a workspace's installed packages must
|
|
82
|
+
* never be resolved against another workspace's tree.
|
|
83
|
+
* @param options - Delivery mode, declared skill/file selection, and explicit read-only off-plugin discovery.
|
|
84
|
+
* Reads stay bounded to the skill folder; off-plugin discovery grants no tool execution.
|
|
85
|
+
* @returns `{ ok: true, promptPrefix }` once every ref resolves, or the FIRST `{ ok: false, reason }`
|
|
86
|
+
* encountered — a run pinning two refs where the second is ambiguous still fails clearly, rather
|
|
87
|
+
* than partially augmenting the prompt with only the first ref's content.
|
|
88
|
+
* @complexity O(r * d) where r is `pluginRefIds.length` and d is the number of installed digests in
|
|
89
|
+
* this workspace — each ref independently re-scans the (typically small) digest list, since a
|
|
90
|
+
* different ref may resolve to a different digest.
|
|
91
|
+
*/
|
|
92
|
+
// Read ONCE for the whole call, not per ref: it is one small file, and every ref resolves against
|
|
93
|
+
// the same workspace's ledger. See `bundled-digests.ts` for why this can only ever RESOLVE an
|
|
94
|
+
// ambiguity below, never create one.
|
|
95
|
+
// See activation.ts for the shared activation rule. One small file read per pinned ref; the
|
|
96
|
+
// fail-CLOSED `createActivationModule(ports).resolveAgentPluginActivation` (the same reader the per-call tool gate uses)
|
|
97
|
+
// refuses on a corrupt/unreadable file instead of reading it as "nothing recorded". Run pinning
|
|
98
|
+
// still requires activation; explicit read-only discovery can inspect an off plugin's guidance
|
|
99
|
+
// without granting its tools. An unreadable activation record never becomes consent.
|
|
100
|
+
async function resolveAgentPluginSelection({ ports, pluginRefIds, workspaceLayout }, { deliveryMode = resolveAgentPluginDeliveryMode(ports), allowInactiveGuidance = false, ...request } = {}) {
|
|
101
|
+
if (pluginRefIds.length === 0)
|
|
102
|
+
return { ok: true, promptPrefix: "" };
|
|
103
|
+
const bundledDigests = await createBundledDigestsModule(ports).readBundledAgentPluginDigests(workspaceLayout.root);
|
|
104
|
+
const sections = [];
|
|
105
|
+
for (const pluginRefId of pluginRefIds) {
|
|
106
|
+
const activation = await createActivationModule(ports).resolveAgentPluginActivation(workspaceLayout.root, pluginRefId);
|
|
107
|
+
const inactiveRead = allowInactiveGuidance && activation.verdict === 'inactive';
|
|
108
|
+
const refusal = activationRefusal({ ports, pluginRefId, verdict: activation }, { allowInactiveGuidance });
|
|
109
|
+
if (refusal !== undefined)
|
|
110
|
+
return { ok: false, reason: refusal };
|
|
111
|
+
const resolved = await resolveOnePluginRef({ ports, pluginRefId, packagesDir: workspaceLayout.root, deliveryMode, bundledDigests }, { request });
|
|
112
|
+
if (!resolved.ok)
|
|
113
|
+
return resolved;
|
|
114
|
+
const note = inactiveRead ? `Agent Plugin '${pluginRefId}' is installed, off. Read-only guidance follows; its tools are unavailable until enabled through the existing approval flow.\n\n` : '';
|
|
115
|
+
sections.push(note + resolved.section);
|
|
144
116
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const plugin = await indexInstalledRoot({ packageRoot: root.packageRoot, archiveDigest: root.archiveDigest });
|
|
163
|
-
if (plugin.pluginId === root.localId)
|
|
164
|
-
installed.push(plugin);
|
|
165
|
-
}
|
|
166
|
-
catch {
|
|
167
|
-
// One corrupt package never hides another plugin. Memory-only folders are not installs.
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return installed;
|
|
117
|
+
return { ok: true, promptPrefix: sections.join("\n\n") };
|
|
118
|
+
}
|
|
119
|
+
/** The run-start refusal for one ref's activation verdict, or `undefined` when it may be injected.
|
|
120
|
+
* @complexity O(1). */
|
|
121
|
+
// A distinct reason from "not installed", because the operator's remedy is different: the bytes
|
|
122
|
+
// ARE here and the fix is to enable the plugin, not to install it. Telling them to install
|
|
123
|
+
// something already present is the kind of wrong-but-plausible error message that costs an
|
|
124
|
+
// afternoon.
|
|
125
|
+
function activationRefusal({ ports, pluginRefId, verdict }, { allowInactiveGuidance = false } = {}) {
|
|
126
|
+
if (verdict.verdict === "active")
|
|
127
|
+
return undefined;
|
|
128
|
+
if (allowInactiveGuidance && verdict.verdict === 'inactive')
|
|
129
|
+
return undefined;
|
|
130
|
+
if (verdict.verdict === "undetermined") {
|
|
131
|
+
// Native activation-read diagnostics can name the host path; the model needs only the remedy.
|
|
132
|
+
return (`Agent Plugin '${pluginRefId}' was not loaded: this workspace's activation record could not be read, so whether ` +
|
|
133
|
+
`it is enabled cannot be confirmed. Nothing was injected; repair activations.json and start the run again.`);
|
|
171
134
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
* cannot establish positively is `false`, because its one caller uses it to authorize.
|
|
192
|
-
* @complexity One `stat`.
|
|
193
|
-
*/
|
|
194
|
-
async function isInstalledDigestPresent(packagesDir, archiveDigest) {
|
|
195
|
-
if (!INSTALLED_PLUGIN_DIGEST_PATTERN.test(archiveDigest))
|
|
196
|
-
return false;
|
|
135
|
+
return (`Agent Plugin '${pluginRefId}' is installed in this workspace but is not enabled — it ships with ${ports.productName} and ` +
|
|
136
|
+
"stays inactive until an operator turns it on. Enable it before pinning it to a run.");
|
|
137
|
+
}
|
|
138
|
+
/** Every installed digest's `InstalledAgentPlugin`, indexed once per call to
|
|
139
|
+
* {@link resolveAgentPluginRefs} — one `readdir` plus one `createInstalledPackageIndex({ ports }).indexInstalledRoot` walk per digest.
|
|
140
|
+
* Digest directory names that do not match the expected 64-hex-character shape are skipped rather
|
|
141
|
+
* than passed to `createInstalledPackageIndex({ ports }).indexInstalledRoot` — `packages/sha256/` is not asserted empty of anything else
|
|
142
|
+
* a future tool might place there, and a non-digest entry is not this function's to interpret.
|
|
143
|
+
*
|
|
144
|
+
* Exported for a second caller outside this module: `tool-registrations.ts`'s
|
|
145
|
+
* `loadInstalledAgentPluginToolSources` needs the SAME per-digest walk (every installed digest,
|
|
146
|
+
* whichever skills each one carries) to build one `agent_plugin_<pluginId>` tool per installed
|
|
147
|
+
* plugin — the exact shape this function already builds, just consumed differently than
|
|
148
|
+
* `resolveOnePluginRef`'s own "resolve one pinned ref" use below. Reusing this rather than
|
|
149
|
+
* re-walking `packages/sha256/*` a second, less-validated way keeps the digest-directory-name check
|
|
150
|
+
* and the per-digest failure isolation in exactly one place. */
|
|
151
|
+
async function listInstalledPlugins({ ports, workspaceRoot }) {
|
|
152
|
+
const installed = [];
|
|
153
|
+
for (const root of await listInstalledPackageRoots({ ports, workspaceRoot })) {
|
|
197
154
|
try {
|
|
198
|
-
|
|
155
|
+
const plugin = await createInstalledPackageIndex({ ports }).indexInstalledRoot({ packageRoot: root.packageRoot, archiveDigest: root.archiveDigest });
|
|
156
|
+
if (plugin.pluginId === root.localId)
|
|
157
|
+
installed.push(plugin);
|
|
199
158
|
}
|
|
200
159
|
catch {
|
|
201
|
-
|
|
160
|
+
// One corrupt package never hides another plugin. Memory-only folders are not installs.
|
|
202
161
|
}
|
|
203
162
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
if (shippedDigest !== undefined && shippedDigest !== plugin.archiveDigest) {
|
|
234
|
-
return { ok: false, code: 'untrusted', reason: `Agent Plugin '${pluginRefId}' was not loaded: only plugins shipped with ${ports.productName} may add agent guidance under a bundled id (installed digest ${plugin.archiveDigest.slice(0, 12)} is not the one this build shipped)` };
|
|
235
|
-
}
|
|
236
|
-
if (deliveryMode === "pointer" && request.skill === undefined && request.file === undefined)
|
|
237
|
-
return buildPointerSection(pluginRefId, plugin);
|
|
238
|
-
return buildInjectedSection({ pluginRefId, packagesDir, plugin }, request);
|
|
163
|
+
return installed;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Whether one installed archive digest still has its package directory under `packagesDir` — the
|
|
167
|
+
* cheap, per-call "is this still installed" signal `tool-registrations.ts`'s tool gate needs.
|
|
168
|
+
*
|
|
169
|
+
* Lives here, beside {@link listInstalledPlugins}, because it must agree with that walk about two
|
|
170
|
+
* things a second implementation would eventually get wrong: that an installed package root IS
|
|
171
|
+
* `<packagesDir>/<digest>` and nothing else, and that a directory name is only a digest when it
|
|
172
|
+
* matches the 64-hex shape. It deliberately does NOT re-index the package (`createInstalledPackageIndex({ ports }).indexInstalledRoot`
|
|
173
|
+
* reads and validates a manifest, which is far too much per tool call): directory presence is
|
|
174
|
+
* exactly what `uninstall.ts` removes, and it removes it by `rename` BEFORE it touches the
|
|
175
|
+
* activation record, so the gate observes a removal at least as early as it observes the record's
|
|
176
|
+
* deletion, never later.
|
|
177
|
+
*
|
|
178
|
+
* Follows symlinks (plain `ports.filesystem.stat`, not `lstat`) on purpose — `listInstalledPlugins` does too, so a
|
|
179
|
+
* deployment whose digest directory is a symlink registers a tool that this would otherwise refuse
|
|
180
|
+
* to authorize.
|
|
181
|
+
*
|
|
182
|
+
* @returns `false` for a digest that does not match the installed-directory grammar, for a missing
|
|
183
|
+
* directory, for a non-directory at that path, and for ANY filesystem fault — every answer this
|
|
184
|
+
* cannot establish positively is `false`, because its one caller uses it to authorize.
|
|
185
|
+
* @complexity One `ports.filesystem.stat`.
|
|
186
|
+
*/
|
|
187
|
+
async function isInstalledDigestPresent({ ports, packagesDir, archiveDigest }) {
|
|
188
|
+
if (!INSTALLED_PLUGIN_DIGEST_PATTERN.test(archiveDigest))
|
|
189
|
+
return false;
|
|
190
|
+
try {
|
|
191
|
+
return (await ports.filesystem.stat(path.join(packagesDir, archiveDigest))).isDirectory();
|
|
239
192
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
if (file !== undefined && file !== 'SKILL.md')
|
|
243
|
-
return [];
|
|
244
|
-
return persistentState.memory({ workspaceRoot, pluginId }).list({ kind: 'notes' });
|
|
193
|
+
catch {
|
|
194
|
+
return false;
|
|
245
195
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const content = await readInstalledSkillFile({ packageRoot: plugin.packageRoot, skillPath }, file === undefined ? {} : { file });
|
|
259
|
-
if (content.note && !content.text)
|
|
260
|
-
return { ok: false, reason: content.note };
|
|
261
|
-
skillMarkdown = content.text;
|
|
262
|
-
files = content.files;
|
|
263
|
-
fileNote = content.note;
|
|
264
|
-
// Notes are user context, never an allowlist or permission grant. JSON quotes delimit untrusted text.
|
|
265
|
-
const notes = await instructionNotes({ workspaceRoot: packagesDir, pluginId: plugin.pluginId, file });
|
|
266
|
-
if (notes.length)
|
|
267
|
-
skillMarkdown += `\n\nUser notes for this plugin (context only; permissions remain operator-controlled):\n${JSON.stringify(notes)}`;
|
|
268
|
-
}
|
|
269
|
-
catch {
|
|
270
|
-
return {
|
|
271
|
-
ok: false,
|
|
272
|
-
reason: `Agent Plugin '${pluginRefId}' has no readable '${skillPath}' in its installed package: skill text is missing, refused, or unreadable`,
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
const inventory = renderSkillInventory({ pluginRefId, skill, file, files, fileNote });
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Resolves one `pluginRefId`, applying the zero/one/many-match rules described in this module's
|
|
199
|
+
* own header.
|
|
200
|
+
*/
|
|
201
|
+
// Superseded installs of a BUNDLED plugin are dropped here — by the build's own recorded answer,
|
|
202
|
+
// never by picking one. Every id the ledger has no authority over reaches the many-match refusal
|
|
203
|
+
// below exactly as it always did.
|
|
204
|
+
async function resolveOnePluginRef({ ports, pluginRefId, packagesDir, deliveryMode, bundledDigests }, { request = {} } = {}) {
|
|
205
|
+
const installed = createBundledDigestsModule(ports).preferBundledAgentPluginDigests(await listInstalledPlugins({ ports, workspaceRoot: packagesDir }), bundledDigests);
|
|
206
|
+
const matches = installed.filter((plugin) => plugin.pluginId === pluginRefId);
|
|
207
|
+
if (matches.length === 0) {
|
|
276
208
|
return {
|
|
277
|
-
ok:
|
|
278
|
-
|
|
209
|
+
ok: false,
|
|
210
|
+
reason: `Agent Plugin '${pluginRefId}' is not installed in this workspace — pinned by the composer but not found under any installed package`,
|
|
279
211
|
};
|
|
280
212
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
const pointer = ports.formatPluginToolPointer({ pluginId: pluginRefId, skill, file: '<relative path>' });
|
|
288
|
-
return `\n\n${framing} Readable supporting files are listed relative to this skill folder. Request one with ${pointer}.\nfiles: ${JSON.stringify(files)}${fileNote ? "\n" + fileNote : ""}`;
|
|
213
|
+
if (matches.length > 1) {
|
|
214
|
+
const digests = matches.map((plugin) => plugin.archiveDigest).sort();
|
|
215
|
+
return {
|
|
216
|
+
ok: false,
|
|
217
|
+
reason: `Agent Plugin '${pluginRefId}' matches ${matches.length} installed packages (digests: ${digests.join(", ")}) — refusing to guess which one to use`,
|
|
218
|
+
};
|
|
289
219
|
}
|
|
290
|
-
|
|
291
|
-
//
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
//
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
ok: false,
|
|
299
|
-
reason: `Agent Plugin '${pluginRefId}' has no readable 'skills/${pluginRefId}/SKILL.md' in its installed package: no such skill folder`,
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
const body = ports.formatPluginToolPointer({ pluginId: pluginRefId });
|
|
303
|
-
return { ok: true, section: `<<AGENT_PLUGIN pluginId="${pluginRefId}">>\n${body}\n<</AGENT_PLUGIN>>` };
|
|
220
|
+
const plugin = matches[0];
|
|
221
|
+
// Activation is checked by the caller. A lone copy under an id the bundled ledger records must be
|
|
222
|
+
// the digest this build shipped; an operator install (no ledger entry) was digest-verified when
|
|
223
|
+
// installed and its skills may guide once enabled (install-upload's trust warning). Inline, not
|
|
224
|
+
// trusted-plugin-files' verdict: that module lists installs through this one (import cycle).
|
|
225
|
+
const shippedDigest = bundledDigests.get(pluginRefId);
|
|
226
|
+
if (shippedDigest !== undefined && shippedDigest !== plugin.archiveDigest) {
|
|
227
|
+
return { ok: false, code: 'untrusted', reason: `Agent Plugin '${pluginRefId}' was not loaded: only plugins shipped with ${ports.productName} may add agent guidance under a bundled id (installed digest ${plugin.archiveDigest.slice(0, 12)} is not the one this build shipped)` };
|
|
304
228
|
}
|
|
305
|
-
|
|
229
|
+
if (deliveryMode === "pointer" && request.skill === undefined && request.file === undefined)
|
|
230
|
+
return buildPointerSection({ ports, pluginRefId, plugin });
|
|
231
|
+
return buildInjectedSection(ports, { pluginRefId, packagesDir, plugin }, request);
|
|
232
|
+
}
|
|
233
|
+
/** Reference reads omit user notes; an explicit SKILL.md read remains identical to the default. */
|
|
234
|
+
async function instructionNotes({ ports, workspaceRoot, pluginId, file }) {
|
|
235
|
+
if (file !== undefined && file !== 'SKILL.md')
|
|
236
|
+
return [];
|
|
237
|
+
return createPersistentStateModule(ports).memory({ workspaceRoot, pluginId }).list({ kind: 'notes' });
|
|
238
|
+
}
|
|
239
|
+
/** Read the default instructions or a declared skill's file; retain the reader's safe refusals.
|
|
240
|
+
* User notes accompany instructions only. O(b + entries), bounded by the skill-file reader.
|
|
241
|
+
*/
|
|
242
|
+
async function buildInjectedSection(ports, { pluginRefId, packagesDir, plugin }, { skill = pluginRefId, file } = {}) {
|
|
243
|
+
const selected = plugin.skills.find(candidate => candidate.name === skill);
|
|
244
|
+
if (!selected)
|
|
245
|
+
return { ok: false, reason: `Agent Plugin '${pluginRefId}' has no readable 'skills/${skill}/SKILL.md' in its installed package: no such skill folder` };
|
|
246
|
+
const skillPath = selected.skillPath;
|
|
247
|
+
let skillMarkdown;
|
|
248
|
+
let files;
|
|
249
|
+
let fileNote;
|
|
250
|
+
try {
|
|
251
|
+
const content = await createCapabilityProjectionModule(ports).readInstalledSkillFile({ packageRoot: plugin.packageRoot, skillPath }, file === undefined ? {} : { file });
|
|
252
|
+
if (content.note && !content.text)
|
|
253
|
+
return { ok: false, reason: content.note };
|
|
254
|
+
skillMarkdown = content.text;
|
|
255
|
+
files = content.files;
|
|
256
|
+
fileNote = content.note;
|
|
257
|
+
// Notes are user context, never an allowlist or permission grant. JSON quotes delimit untrusted text.
|
|
258
|
+
const notes = await instructionNotes({ ports, workspaceRoot: packagesDir, pluginId: plugin.pluginId, file });
|
|
259
|
+
if (notes.length)
|
|
260
|
+
skillMarkdown += `\n\nUser notes for this plugin (context only; permissions remain operator-controlled):\n${JSON.stringify(notes)}`;
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
return {
|
|
264
|
+
ok: false,
|
|
265
|
+
reason: `Agent Plugin '${pluginRefId}' has no readable '${skillPath}' in its installed package: skill text is missing, refused, or unreadable`,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
const inventory = renderSkillInventory({ ports, pluginRefId, skill, file, files, fileNote });
|
|
269
|
+
return {
|
|
270
|
+
ok: true,
|
|
271
|
+
section: `<<AGENT_PLUGIN pluginId="${pluginRefId}">>\n${skillMarkdown}${inventory}\n<</AGENT_PLUGIN>>`,
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
// Framing governs whether the agent follows the plugin: describe injected SKILL.md as complete
|
|
275
|
+
// instructions and let it require its references. Calling it a summary or making required reads
|
|
276
|
+
// conditional lets the outer wrapper override the plugin. The inventory-framing test pins this.
|
|
277
|
+
/** Format a selected skill's file inventory using the host's registered tool pointer. O(files). */
|
|
278
|
+
function renderSkillInventory({ ports, pluginRefId, skill, file, files, fileNote }) {
|
|
279
|
+
const framing = file === undefined || file === 'SKILL.md' ? "The SKILL.md above is this Agent Plugin's own instructions — follow them, including any files it directs you to load before starting work." : "The content above is the requested skill file.";
|
|
280
|
+
const pointer = ports.formatPluginToolPointer({ pluginId: pluginRefId, skill, file: '<relative path>' });
|
|
281
|
+
return `\n\n${framing} Readable supporting files are listed relative to this skill folder. Request one with ${pointer}.\nfiles: ${JSON.stringify(files)}${fileNote ? "\n" + fileNote : ""}`;
|
|
282
|
+
}
|
|
283
|
+
// Parity with `inject`'s own failure: a pinned ref whose eponymous skill is missing must fail
|
|
284
|
+
// loudly in BOTH modes. Without this check `pointer` would happily emit a well-formed instruction
|
|
285
|
+
// whose no-argument default resolves to some OTHER (alphabetically-first) skill instead of the one
|
|
286
|
+
// the pin actually named, and the run would look like the agent disobeyed rather than like the pin
|
|
287
|
+
// being wrong.
|
|
288
|
+
function buildPointerSection({ ports, pluginRefId, plugin }) {
|
|
289
|
+
if (!plugin.skills.some((skill) => skill.name === pluginRefId)) {
|
|
290
|
+
return {
|
|
291
|
+
ok: false,
|
|
292
|
+
reason: `Agent Plugin '${pluginRefId}' has no readable 'skills/${pluginRefId}/SKILL.md' in its installed package: no such skill folder`,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
const body = ports.formatPluginToolPointer({ pluginId: pluginRefId });
|
|
296
|
+
return { ok: true, section: `<<AGENT_PLUGIN pluginId="${pluginRefId}">>\n${body}\n<</AGENT_PLUGIN>>` };
|
|
297
|
+
}
|
|
298
|
+
function buildModule(ports) {
|
|
299
|
+
return {
|
|
300
|
+
resolveAgentPluginRefs: (pluginRefIds, workspaceLayout, deliveryMode) => resolveAgentPluginRefs({ ports, pluginRefIds, workspaceLayout }, deliveryMode === undefined ? {} : { deliveryMode }),
|
|
301
|
+
resolveAgentPluginSelection: (required, optional = {}) => resolveAgentPluginSelection({ ports, ...required }, optional),
|
|
302
|
+
listInstalledPlugins: (workspaceRoot) => listInstalledPlugins({ ports, workspaceRoot }),
|
|
303
|
+
isInstalledDigestPresent: (packagesDir, archiveDigest) => isInstalledDigestPresent({ ports, packagesDir, archiveDigest }),
|
|
304
|
+
};
|
|
306
305
|
}
|
|
307
306
|
const instances = new WeakMap();
|
|
308
307
|
/** Internal composition; one state/queue instance per injected host context. */
|
|
309
|
-
export function createResolveAgentPluginRefsModule(ports) {
|
|
308
|
+
export function createResolveAgentPluginRefsModule(ports, _optional = {}) {
|
|
310
309
|
let instance = instances.get(ports);
|
|
311
310
|
if (!instance) {
|
|
312
311
|
instance = buildModule(ports);
|
|
@@ -1,54 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file `retireBundledAgentPlugins()` — removes bundled Agent Plugins the host no longer ships from a
|
|
3
|
-
* workspace, and moves their users onto the plugin that absorbed them. Runs on every boot from
|
|
4
|
-
* `seed-bundled.ts`, after seeding, and is a no-op once a workspace has been migrated.
|
|
5
|
-
*
|
|
6
|
-
* ---------------------------------------------------------------------------
|
|
7
|
-
* Why a retirement step exists
|
|
8
|
-
* ---------------------------------------------------------------------------
|
|
9
|
-
* Deleting `content/agent-plugins/<id>/` stops the seeder installing a plugin, but it removes nothing
|
|
10
|
-
* a workspace already has: the installed package stays under `packages/sha256/`, its activation
|
|
11
|
-
* record stays in `activations.json`, and its digest stays in `bundled-digests.json`. An ENABLED
|
|
12
|
-
* leftover keeps its skill in every prompt, now duplicating (and slowly contradicting) the successor
|
|
13
|
-
* that carries the same content. And the operator cannot remove it: `uninstall.ts` refuses a
|
|
14
|
-
* bundled plugin because it would be re-seeded, which is exactly what stops being true here. Owner
|
|
15
|
-
* rule: the user never fixes anything by hand, so the boot does it.
|
|
16
|
-
*
|
|
17
|
-
* ---------------------------------------------------------------------------
|
|
18
|
-
* What happens per retired id (idempotent)
|
|
19
|
-
* ---------------------------------------------------------------------------
|
|
20
|
-
* 1. Nothing installed and no activation record: nothing to do (the second boot after a migration).
|
|
21
|
-
* A leftover ledger entry is still dropped.
|
|
22
|
-
* 1a. Otherwise EVERY successor must be usable first: installed at the digest `bundled-digests.json`
|
|
23
|
-
* records for it (the build's own seed — the same trust `trusted-plugin-files.ts` demands before
|
|
24
|
-
* core takes a contribution from it), whether it seeded this boot or on an earlier one. If any
|
|
25
|
-
* is not, the retired plugin is KEPT and the outcome is `failed` with the reason; the next boot
|
|
26
|
-
* retries. Without this a successor whose seed failed (a broken `plugin.json`, a full disk) left
|
|
27
|
-
* the retired plugin removed and only an activation record for the successor — a switch with no
|
|
28
|
-
* code behind it (R6, 2026-10-12). A plugin split into several (`deploy` -> `fly`, `render`, ...)
|
|
29
|
-
* is kept until all of them are usable: one working successor must not cost the others' capability.
|
|
30
|
-
* 2. The retired plugin was ENABLED (explicitly, or by the "absent means active" default while its
|
|
31
|
-
* package is installed): the successor is switched on — unless an operator explicitly turned the
|
|
32
|
-
* successor off, which is left exactly as it is and reported in the outcome. No silent override.
|
|
33
|
-
* 3. The retired plugin's package(s) and activation record are removed through `uninstall.ts`
|
|
34
|
-
* (`retiredBundled: true` skips only its bundled refusal). A record with no package left is
|
|
35
|
-
* deleted directly.
|
|
36
|
-
* 4. The retired id is dropped from `bundled-digests.json`.
|
|
37
|
-
*
|
|
38
|
-
* A malformed or unreadable activation record for the retired id stops that id's retirement with a
|
|
39
|
-
* `failed` outcome and changes nothing: whether the operator had it enabled cannot be established,
|
|
40
|
-
* so neither enabling the successor nor deleting the record is safe. The next boot retries.
|
|
41
|
-
*
|
|
42
|
-
* Out of scope on purpose: nothing a retired plugin could own survives it. Agent Plugins have no
|
|
43
|
-
* per-plugin settings store (a workspace's `data/<pluginId>` directory has no production writer),
|
|
44
|
-
* and custom credentials (a saved `fly.io` token, say) belong to the workspace, not to a plugin.
|
|
45
|
-
*
|
|
46
|
-
* Architectural role:
|
|
47
|
-
* Composition over `activation.ts`, `uninstall.ts`, and `bundled-digests.ts`. Never throws: every
|
|
48
|
-
* failure is captured per id, exactly like `seed-bundled.ts`'s own outcomes, so one stuck retirement
|
|
49
|
-
* cannot stop a workspace from booting.
|
|
50
|
-
*/
|
|
51
|
-
/** Extracted from the host plugin lifecycle. Effects are supplied per host context. */
|
|
52
1
|
import type { BundledAgentPluginEnableOutcome } from "./activation.js";
|
|
53
2
|
import type { AgentPluginLayout } from "./layout.js";
|
|
54
3
|
import type { AgentPluginLifecyclePorts } from "./ports.js";
|
|
@@ -93,7 +42,7 @@ export interface RetireBundledAgentPluginsOptional {
|
|
|
93
42
|
readonly now?: ((required: Record<string, never>) => Date) | undefined;
|
|
94
43
|
}
|
|
95
44
|
/** Internal composition; one state/queue instance per injected host context. */
|
|
96
|
-
export declare function createRetireBundledModule(ports: AgentPluginLifecyclePorts): {
|
|
45
|
+
export declare function createRetireBundledModule(ports: AgentPluginLifecyclePorts, _optional?: Record<string, never>): {
|
|
97
46
|
retireBundledAgentPlugins: (required: RetireBundledAgentPluginsRequired, optional?: RetireBundledAgentPluginsOptional) => Promise<readonly RetiredAgentPluginOutcome[]>;
|
|
98
47
|
};
|
|
99
48
|
export {};
|