@jini-ai/agent-plugins 0.6.17 → 0.6.22
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 +34 -1
- package/NOTICE +14 -0
- package/README.md +35 -14
- package/charts-echarts/plugin.json +39 -0
- package/charts-echarts/skills/charts-echarts/SKILL.md +110 -0
- package/charts-recharts/plugin.json +32 -0
- package/charts-recharts/skills/charts-recharts/SKILL.md +108 -0
- package/cloudflare/NOTES.md +16 -0
- package/cloudflare/form-destinations/cloudflare-d1.mjs +9 -0
- package/cloudflare/lib/api.mjs +96 -0
- package/cloudflare/lib/assets.mjs +65 -0
- package/cloudflare/lib/dns.mjs +32 -0
- package/cloudflare/lib/domain-inventory.mjs +61 -0
- package/cloudflare/lib/domain-status.mjs +48 -0
- package/cloudflare/lib/domains.mjs +95 -0
- package/cloudflare/lib/forms.mjs +278 -0
- package/cloudflare/lib/pages-upload.mjs +51 -0
- package/cloudflare/lib/target.mjs +165 -0
- package/cloudflare/lib/workers-upload.mjs +48 -0
- package/cloudflare/lib/zones.mjs +25 -0
- package/cloudflare/mcp.json +4 -0
- package/cloudflare/plugin.json +96 -0
- package/cloudflare/skills/cloudflare/SKILL.md +57 -0
- package/cloudflare/skills/cloudflare/references/domains.md +31 -0
- package/cloudflare/skills/cloudflare/references/pages.md +18 -0
- package/cloudflare/skills/cloudflare/references/permissions.md +29 -0
- package/cloudflare/skills/cloudflare/references/troubleshooting.md +20 -0
- package/cloudflare/skills/cloudflare/references/workers.md +42 -0
- package/cloudflare/targets/cloudflare-pages.mjs +12 -0
- package/cloudflare/targets/cloudflare-workers.mjs +17 -0
- package/cloudflare/tovu-consent.json +6 -0
- package/cloudflare/tovu-deploy-targets.json +630 -0
- package/cloudflare/tovu-form-destinations.json +12 -0
- package/cloudflare/worker/forms-receiver.mjs +285 -0
- package/composio/mcp.json +10 -0
- package/composio/plugin.json +68 -0
- package/composio/skills/composio/SKILL.md +85 -0
- package/dist/core/identity-namespace.d.ts +12 -0
- package/dist/core/identity-namespace.js +20 -0
- package/dist/folder-zip-node.js +29 -7
- package/dist/lifecycle/activation-reader.d.ts +24 -0
- package/dist/lifecycle/activation-reader.js +27 -0
- package/dist/lifecycle/automatic-use.js +14 -2
- package/dist/lifecycle/bundled-digests.js +4 -3
- package/dist/lifecycle/bundled-file-policy.d.ts +22 -0
- package/dist/lifecycle/bundled-file-policy.js +19 -0
- package/dist/lifecycle/enable-grants.d.ts +26 -0
- package/dist/lifecycle/enable-grants.js +28 -0
- package/dist/lifecycle/index.d.ts +4 -0
- package/dist/lifecycle/index.js +4 -0
- package/dist/lifecycle/install.d.ts +7 -0
- package/dist/lifecycle/install.js +45 -3
- package/dist/lifecycle/manifest.d.ts +2 -2
- package/dist/lifecycle/manifest.js +5 -3
- package/dist/lifecycle/node.js +2 -0
- package/dist/lifecycle/persistent-state.js +1 -1
- package/dist/lifecycle/ports.d.ts +8 -0
- package/dist/lifecycle/search-projection.d.ts +8 -0
- package/dist/lifecycle/search-projection.js +23 -5
- package/dist/lifecycle/search.js +7 -2
- package/dist/lifecycle/seed-bundled.js +4 -1
- package/dist/manifest.d.ts +1 -1
- package/dist/manifest.js +3 -2
- package/fly/deploy-configs/fly.mjs +115 -0
- package/fly/deploy-ops/fly.mjs +102 -0
- package/fly/mcp.json +4 -0
- package/fly/plugin.json +81 -0
- package/fly/scripts/render-deploy-workflow.mjs +150 -0
- package/fly/skills/fly/SKILL.md +43 -0
- package/fly/skills/fly/references/fly-deploy.template.yml +117 -0
- package/fly/skills/fly/references/fly.template.toml +81 -0
- package/fly/tovu-credential-schemes.json +11 -0
- package/fly/tovu-deploy-configs.json +21 -0
- package/fly/tovu-deploy-ops.json +14 -0
- package/github/deploy-ops/github-actions.mjs +164 -0
- package/github/deployments/github.mjs +415 -0
- package/github/mcp.json +4 -0
- package/github/plugin.json +105 -0
- package/github/skills/github/SKILL.md +249 -0
- package/github/skills/github/references/actions.md +224 -0
- package/github/skills/github/references/auth-and-tokens.md +140 -0
- package/github/skills/github/references/repo-files.md +135 -0
- package/github/skills/github/references/site-backup.md +159 -0
- package/github/skills/github/references/source-control.md +123 -0
- package/github/source-control/backup-push.mjs +242 -0
- package/github/source-control/commit-site.mjs +459 -0
- package/github/source-control/github.mjs +93 -0
- package/github/source-control/write-files.mjs +468 -0
- package/github/tovu-deploy-ops.json +13 -0
- package/github/tovu-source-control.json +117 -0
- package/github-pages/NOTES.md +19 -0
- package/github-pages/mcp.json +4 -0
- package/github-pages/plugin.json +48 -0
- package/github-pages/skills/github-pages/SKILL.md +44 -0
- package/github-pages/targets/github-pages.mjs +543 -0
- package/github-pages/tovu-deploy-targets.json +327 -0
- package/google-login/exports/google-g.svg +1 -0
- package/google-login/exports/sign-in-button.css +68 -0
- package/google-login/exports/sign-in-button.html +4 -0
- package/google-login/mcp.json +4 -0
- package/google-login/plugin.json +59 -0
- package/google-login/skills/google-login/SKILL.md +96 -0
- package/google-login/tovu-login-providers.json +21 -0
- package/google-workspace/README.md +132 -0
- package/google-workspace/form-destinations/README.md +87 -0
- package/google-workspace/form-destinations/dedupe.mjs +43 -0
- package/google-workspace/form-destinations/delivery-result.mjs +69 -0
- package/google-workspace/form-destinations/mapping.mjs +152 -0
- package/google-workspace/form-destinations/sheets.mjs +202 -0
- package/google-workspace/lib/auth.mjs +81 -0
- package/google-workspace/lib/drive-files.mjs +54 -0
- package/google-workspace/lib/form-destination-settings.mjs +72 -0
- package/google-workspace/lib/http.mjs +168 -0
- package/google-workspace/lib/picker-flow.mjs +171 -0
- package/google-workspace/lib/picker-selection.mjs +107 -0
- package/google-workspace/lib/product-state.mjs +93 -0
- package/google-workspace/lib/request-policy.mjs +163 -0
- package/google-workspace/lib/sheets-a1.mjs +79 -0
- package/google-workspace/lib/sheets-admin-csv.mjs +82 -0
- package/google-workspace/lib/sheets-admin-request-kinds.mjs +183 -0
- package/google-workspace/lib/sheets-client.mjs +286 -0
- package/google-workspace/lib/surface-actions.mjs +107 -0
- package/google-workspace/mcp.json +4 -0
- package/google-workspace/plugin.json +77 -0
- package/google-workspace/products.json +12 -0
- package/google-workspace/skills/google-workspace/SKILL.md +82 -0
- package/google-workspace/skills/google-workspace/references/connection.md +102 -0
- package/google-workspace/skills/google-workspace/references/form-delivery.md +50 -0
- package/google-workspace/skills/google-workspace/references/sheets.md +149 -0
- package/google-workspace/skills/google-workspace/references/troubleshooting.md +31 -0
- package/google-workspace/tools/account-info.mjs +18 -0
- package/google-workspace/tools/sheets/README.md +54 -0
- package/google-workspace/tools/sheets/copy-tab.mjs +23 -0
- package/google-workspace/tools/sheets/copy.mjs +23 -0
- package/google-workspace/tools/sheets/create.mjs +35 -0
- package/google-workspace/tools/sheets/find-replace.mjs +38 -0
- package/google-workspace/tools/sheets/find.mjs +52 -0
- package/google-workspace/tools/sheets/get-by-data-filter.mjs +23 -0
- package/google-workspace/tools/sheets/get.mjs +22 -0
- package/google-workspace/tools/sheets/values-append.mjs +27 -0
- package/google-workspace/tools/sheets/values-batch-clear.mjs +20 -0
- package/google-workspace/tools/sheets/values-batch-get.mjs +20 -0
- package/google-workspace/tools/sheets/values-batch-update.mjs +29 -0
- package/google-workspace/tools/sheets/values-by-data-filter.mjs +62 -0
- package/google-workspace/tools/sheets/values-clear.mjs +20 -0
- package/google-workspace/tools/sheets/values-get.mjs +21 -0
- package/google-workspace/tools/sheets/values-update.mjs +26 -0
- package/google-workspace/tools/sheets-admin/README.md +45 -0
- package/google-workspace/tools/sheets-admin/basic-filter.mjs +32 -0
- package/google-workspace/tools/sheets-admin/batch-update.mjs +25 -0
- package/google-workspace/tools/sheets-admin/developer-metadata.mjs +28 -0
- package/google-workspace/tools/sheets-admin/export-csv.mjs +67 -0
- package/google-workspace/tools/sheets-admin/filter-views.mjs +38 -0
- package/google-workspace/tools/sheets-admin/format.mjs +70 -0
- package/google-workspace/tools/sheets-admin/named-ranges.mjs +42 -0
- package/google-workspace/tools/sheets-admin/open-existing.mjs +34 -0
- package/google-workspace/tools/sheets-admin/protected-ranges-get.mjs +18 -0
- package/google-workspace/tools/sheets-admin/sort.mjs +18 -0
- package/google-workspace/tools/sheets-admin/tab-modify.mjs +36 -0
- package/google-workspace/tovu-admin-surfaces.json +63 -0
- package/google-workspace/tovu-agent-tools.json +1178 -0
- package/google-workspace/tovu-connections.json +35 -0
- package/google-workspace/tovu-form-destinations.json +10 -0
- package/google-workspace/ui/README.md +73 -0
- package/google-workspace/ui/connection-panel.handler.mjs +167 -0
- package/google-workspace/ui/connection-panel.html +17 -0
- package/google-workspace/ui/connection-panel.mjs +189 -0
- package/google-workspace/ui/connection-view.mjs +120 -0
- package/google-workspace/ui/destination-panel.handler.mjs +106 -0
- package/google-workspace/ui/destination-panel.html +17 -0
- package/google-workspace/ui/destination-panel.mjs +150 -0
- package/google-workspace/ui/dom.mjs +140 -0
- package/google-workspace/ui/panel.css +170 -0
- package/google-workspace/ui/picker-flow.mjs +87 -0
- package/google-workspace/ui/picker-view.mjs +44 -0
- package/google-workspace/ui/picker.handler.mjs +56 -0
- package/google-workspace/ui/picker.html +17 -0
- package/google-workspace/ui/picker.mjs +88 -0
- package/google-workspace/ui/surface-client.mjs +227 -0
- package/higgsfield-media/mcp.json +9 -0
- package/higgsfield-media/plugin.json +109 -0
- package/higgsfield-media/skills/higgsfield-media/SKILL.md +325 -0
- package/higgsfield-media/skills/higgsfield-media/references/failure-modes.md +116 -0
- package/higgsfield-media/skills/higgsfield-media/references/models-and-plan-gates.md +142 -0
- package/jev/mcp.json +4 -0
- package/jev/plugin.json +44 -0
- package/jev/skills/jev/SKILL.md +308 -0
- package/jev/skills/jev/references/cookbooks.md +197 -0
- package/jev/skills/jev/references/jaggedness.md +135 -0
- package/jev/skills/jev/references/javascript-sdk.md +146 -0
- package/jev/skills/jev/references/patterns.md +123 -0
- package/jev/skills/jev/references/primitives-reference.md +187 -0
- package/langfuse/plugin.json +22 -0
- package/meilisearch/mcp.json +4 -0
- package/meilisearch/plugin.json +54 -0
- package/meilisearch/providers/meilisearch.mjs +651 -0
- package/meilisearch/skills/meilisearch/SKILL.md +43 -0
- package/meilisearch/tovu-search-providers.json +10 -0
- package/netlify/NOTES.md +13 -0
- package/netlify/mcp.json +4 -0
- package/netlify/plugin.json +47 -0
- package/netlify/skills/netlify/SKILL.md +39 -0
- package/netlify/targets/netlify.mjs +384 -0
- package/netlify/tovu-consent.json +6 -0
- package/netlify/tovu-deploy-targets.json +163 -0
- package/opentelemetry/mcp.json +4 -0
- package/opentelemetry/plugin.json +52 -0
- package/opentelemetry/skills/opentelemetry/SKILL.md +39 -0
- package/package.json +161 -6
- package/posthog/mcp.json +4 -0
- package/posthog/plugin.json +46 -0
- package/posthog/skills/posthog/SKILL.md +36 -0
- package/railway/deploy-configs/railway.mjs +135 -0
- package/railway/deploy-ops/railway.mjs +167 -0
- package/railway/mcp.json +4 -0
- package/railway/plugin.json +45 -0
- package/railway/skills/railway/SKILL.md +66 -0
- package/railway/tovu-deploy-configs.json +16 -0
- package/railway/tovu-deploy-ops.json +11 -0
- package/render/deploy-configs/render.mjs +141 -0
- package/render/deploy-ops/render.mjs +152 -0
- package/render/mcp.json +4 -0
- package/render/plugin.json +47 -0
- package/render/skills/render/SKILL.md +63 -0
- package/render/tovu-deploy-configs.json +16 -0
- package/render/tovu-deploy-ops.json +11 -0
- package/resend/NOTES.md +52 -0
- package/resend/adapters/resend.mjs +161 -0
- package/resend/lib/domains.mjs +137 -0
- package/resend/lib/errors.mjs +25 -0
- package/resend/lib/feedback.mjs +118 -0
- package/resend/mcp.json +13 -0
- package/resend/plugin.json +192 -0
- package/resend/skills/resend/SKILL.md +107 -0
- package/resend/tovu-mail-adapters.json +22 -0
- package/s3-compatible/NOTES.md +11 -0
- package/s3-compatible/mcp.json +4 -0
- package/s3-compatible/object-stores/s3-compatible.mjs +287 -0
- package/s3-compatible/plugin.json +56 -0
- package/s3-compatible/skills/s3-compatible/SKILL.md +39 -0
- package/s3-compatible/targets/s3-compatible.mjs +1054 -0
- package/s3-compatible/tovu-deploy-targets.json +432 -0
- package/s3-compatible/tovu-object-stores.json +29 -0
- package/sentry/mcp.json +4 -0
- package/sentry/plugin.json +49 -0
- package/sentry/skills/sentry/SKILL.md +34 -0
- package/shopify/mcp.json +4 -0
- package/shopify/plugin.json +22 -0
- package/shopify/skills/shopify/SKILL.md +103 -0
- package/shopify/skills/shopify/references/catalog-sync.md +74 -0
- package/shopify/skills/shopify/references/domains.md +26 -0
- package/shopify/skills/shopify/references/live-storefront.md +34 -0
- package/shopify/skills/shopify/references/storefront-snippets.md +21 -0
- package/site-compliance/mcp.json +4 -0
- package/site-compliance/plugin.json +34 -0
- package/site-compliance/skills/site-compliance/SKILL.md +220 -0
- package/site-compliance/skills/site-compliance/references/ccpa-cpra.md +115 -0
- package/site-compliance/skills/site-compliance/references/gdpr-eu-uk.md +143 -0
- package/site-compliance/skills/site-compliance/references/wcag-2-2.md +129 -0
- package/site-import/mcp.json +4 -0
- package/site-import/plugin.json +41 -0
- package/site-import/skills/site-import/SKILL.md +232 -0
- package/site-import/skills/site-import/references/content-mapping.md +166 -0
- package/site-import/skills/site-import/references/discovery-and-classification.md +117 -0
- package/site-import/skills/site-import/references/theme-extraction.md +34 -0
- package/slide-design/com.anthropic.claude-code/hooks/hooks.json +4 -0
- package/slide-design/mcp.json +4 -0
- package/slide-design/plugin.json +26 -0
- package/slide-design/skills/slide-design/SKILL.md +103 -0
- package/slide-design/skills/slide-design/references/charts-and-exhibits.md +100 -0
- package/slide-design/skills/slide-design/references/html-deck.md +175 -0
- package/slide-design/skills/slide-design/references/layout-and-style.md +131 -0
- package/slide-design/skills/slide-design/references/review.md +93 -0
- package/slide-design/skills/slide-design/references/storyline.md +118 -0
- package/stripe/plugin.json +22 -0
- package/supabase/mcp.json +26 -0
- package/supabase/plugin.json +78 -0
- package/supabase/skills/supabase/SKILL.md +169 -0
- package/supabase/skills/supabase/references/failure-modes.md +101 -0
- package/ui-ux-design/CHANGELOG.md +28 -0
- package/ui-ux-design/LICENSE +201 -0
- package/ui-ux-design/NOTICE +14 -0
- package/ui-ux-design/README.md +62 -0
- package/ui-ux-design/com.anthropic.claude-code/hooks/hooks.json +4 -0
- package/ui-ux-design/mcp.json +4 -0
- package/ui-ux-design/plugin.json +26 -0
- package/ui-ux-design/skills/frontend-accessibility/SKILL.md +60 -0
- package/ui-ux-design/skills/gstack-design/SKILL.md +53 -0
- package/ui-ux-design/skills/gstack-design/references/consultation.md +30 -0
- package/ui-ux-design/skills/gstack-design/references/html.md +29 -0
- package/ui-ux-design/skills/gstack-design/references/review.md +28 -0
- package/ui-ux-design/skills/gstack-design/references/shotgun.md +33 -0
- package/ui-ux-design/skills/gstack-design/references/upstream-notes.md +23 -0
- package/ui-ux-design/skills/interface-design/ORIGINAL.md +16 -0
- package/ui-ux-design/skills/interface-design/SKILL.md +41 -0
- package/ui-ux-design/skills/interface-design/references/commands/audit.md +40 -0
- package/ui-ux-design/skills/interface-design/references/commands/critique.md +21 -0
- package/ui-ux-design/skills/interface-design/references/commands/extract.md +34 -0
- package/ui-ux-design/skills/interface-design/references/commands/init.md +31 -0
- package/ui-ux-design/skills/interface-design/references/commands/status.md +22 -0
- package/ui-ux-design/skills/interface-design/references/examples/system-precision.md +29 -0
- package/ui-ux-design/skills/interface-design/references/examples/system-warmth.md +29 -0
- package/ui-ux-design/skills/interface-design/references/system-template.md +57 -0
- package/ui-ux-design/skills/shadcn-ui/README.md +244 -0
- package/ui-ux-design/skills/shadcn-ui/SKILL.md +333 -0
- package/ui-ux-design/skills/shadcn-ui/examples/auth-layout.tsx +177 -0
- package/ui-ux-design/skills/shadcn-ui/examples/data-table.tsx +313 -0
- package/ui-ux-design/skills/shadcn-ui/examples/form-pattern.tsx +177 -0
- package/ui-ux-design/skills/shadcn-ui/resources/component-catalog.md +481 -0
- package/ui-ux-design/skills/shadcn-ui/resources/customization-guide.md +516 -0
- package/ui-ux-design/skills/shadcn-ui/resources/migration-guide.md +463 -0
- package/ui-ux-design/skills/shadcn-ui/resources/setup-guide.md +412 -0
- package/ui-ux-design/skills/shadcn-ui/scripts/verify-setup.sh +134 -0
- package/ui-ux-design/skills/ui-ux-design/SKILL.md +171 -0
- package/ui-ux-design/skills/ui-ux-design/references/brand-and-voice.md +78 -0
- package/ui-ux-design/skills/ui-ux-design/references/chrome-mobile-test-matrix.md +137 -0
- package/ui-ux-design/skills/ui-ux-design/references/components-and-states.md +112 -0
- package/ui-ux-design/skills/ui-ux-design/references/delight-and-motion.md +54 -0
- package/ui-ux-design/skills/ui-ux-design/references/foundations.md +145 -0
- package/ui-ux-design/skills/ui-ux-design/references/inclusive-ai-imagery.md +57 -0
- package/ui-ux-design/skills/ui-ux-design/references/kole-jain-uiux-concepts.md +104 -0
- package/ui-ux-design/skills/ui-ux-design/references/kuinetic-reference.md +184 -0
- package/ui-ux-design/skills/ui-ux-design/references/openai-frontend-skill.md +139 -0
- package/ui-ux-design/skills/ui-ux-design/references/premium-ui.md +55 -0
- package/ui-ux-design/skills/ui-ux-design/references/research-and-validation.md +88 -0
- package/ui-ux-design/skills/ui-ux-design/references/sam-crawford-premium-websites.md +103 -0
- package/ui-ux-design/skills/ui-ux-design/references/self-made-web-designer-core-skills.md +119 -0
- package/ui-ux-design/skills/ui-ux-design/references/ui-animation.md +173 -0
- package/ui-ux-design/skills/ui-ux-design/references/ui-loop.md +234 -0
- package/ui-ux-design/skills/ui-ux-design/references/visual-storytelling.md +54 -0
- package/ui-ux-design/skills/vercel-web-design-guidelines/SKILL.md +39 -0
- package/ui-ux-design/skills/web-compliance/SKILL.md +134 -0
- package/ui-ux-design/skills/web-compliance/references/audit-evidence.md +59 -0
- package/vercel/NOTES.md +23 -0
- package/vercel/mcp.json +4 -0
- package/vercel/object-stores/vercel-blob.mjs +147 -0
- package/vercel/plugin.json +47 -0
- package/vercel/skills/vercel/SKILL.md +48 -0
- package/vercel/targets/vercel.mjs +644 -0
- package/vercel/tovu-consent.json +6 -0
- package/vercel/tovu-deploy-targets.json +219 -0
- package/vercel/tovu-object-stores.json +10 -0
- package/wordpress/NOTES.md +33 -0
- package/wordpress/plugin.json +30 -0
- package/wordpress/skills/wordpress/SKILL.md +43 -0
- package/wordpress/skills/wordpress/references/free-site-redirect.md +46 -0
- package/wordpress/skills/wordpress/references/subdomain.md +66 -0
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* ships as — written by `seed-bundled.ts` on every boot, read by the surfaces that have to pick one
|
|
4
4
|
* installed package for a plugin id.
|
|
5
5
|
*
|
|
6
|
-
* Current install policy (frpid, 2026-10-09):
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Current install policy (frpid, 2026-10-09): an explicit install, update or replace prunes the
|
|
7
|
+
* plugin's superseded revisions. Bundled seeding does not (2026-11-02): it cannot tell an operator's
|
|
8
|
+
* edited or uploaded same-name copy from an old bundled one, so the rationale below applies to every
|
|
9
|
+
* reseed. This ledger selects the build's authoritative digest; it never deletes package bytes.
|
|
9
10
|
*
|
|
10
11
|
* ---------------------------------------------------------------------------
|
|
11
12
|
* The gap this closes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Exact installed-file comparison for exports; names and package digests alone prove nothing. */
|
|
2
|
+
export type BundledPluginFileDisposition = 'scan' | 'skip';
|
|
3
|
+
/** Host-owned read from the installed bundled package, never from the user's plugin tree. */
|
|
4
|
+
export type ReadBundledPluginFile = (required: {
|
|
5
|
+
pluginId: string;
|
|
6
|
+
relativePath: string;
|
|
7
|
+
}) => Promise<Uint8Array | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Compare export bytes to one installed bundled file. Identical bytes skip scanning; all files
|
|
10
|
+
* stay in the archive. Missing/unreadable/changed/custom files receive full scanning.
|
|
11
|
+
* @param required Candidate bytes and a reader restricted to the host's bundled package selection.
|
|
12
|
+
* @returns A per-file export decision; grants no execution trust and never changes content.
|
|
13
|
+
* @complexity O(path length + file bytes) time and one installed-file read; O(file bytes) memory.
|
|
14
|
+
* @example classifyBundledPluginFile({ pluginId, relativePath, bytes, readFile });
|
|
15
|
+
*/
|
|
16
|
+
export declare function classifyBundledPluginFile(required: {
|
|
17
|
+
pluginId: string;
|
|
18
|
+
relativePath: string;
|
|
19
|
+
bytes: Uint8Array;
|
|
20
|
+
readFile: ReadBundledPluginFile;
|
|
21
|
+
}, _optional?: Record<string, never>): Promise<BundledPluginFileDisposition>;
|
|
22
|
+
//# sourceMappingURL=bundled-file-policy.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compare export bytes to one installed bundled file. Identical bytes skip scanning; all files
|
|
3
|
+
* stay in the archive. Missing/unreadable/changed/custom files receive full scanning.
|
|
4
|
+
* @param required Candidate bytes and a reader restricted to the host's bundled package selection.
|
|
5
|
+
* @returns A per-file export decision; grants no execution trust and never changes content.
|
|
6
|
+
* @complexity O(path length + file bytes) time and one installed-file read; O(file bytes) memory.
|
|
7
|
+
* @example classifyBundledPluginFile({ pluginId, relativePath, bytes, readFile });
|
|
8
|
+
*/
|
|
9
|
+
export async function classifyBundledPluginFile(required, _optional = {}) {
|
|
10
|
+
const parts = required.relativePath.split('/');
|
|
11
|
+
if (/[:\\\x00]/.test(required.relativePath) || parts.some(part => part === '' || part === '.' || part === '..'))
|
|
12
|
+
return 'scan';
|
|
13
|
+
const installed = await required.readFile({ pluginId: required.pluginId, relativePath: required.relativePath }).catch(() => null);
|
|
14
|
+
const candidate = Buffer.from(required.bytes.buffer, required.bytes.byteOffset, required.bytes.byteLength);
|
|
15
|
+
if (installed === null || !candidate.equals(installed))
|
|
16
|
+
return 'scan';
|
|
17
|
+
return 'skip';
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=bundled-file-policy.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** A plugin's declared tools are the ceiling for additions, never a remote server's tool listing. */
|
|
2
|
+
export interface AgentPluginDeclaredTools {
|
|
3
|
+
readonly allow?: readonly string[] | undefined;
|
|
4
|
+
readonly write: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
export interface AgentPluginToolGrant {
|
|
7
|
+
readonly enabled: boolean;
|
|
8
|
+
readonly allow: readonly string[];
|
|
9
|
+
readonly write: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
/** Plan the existing sign-in grant or an explicit owner-approved enable without changing inputs.
|
|
12
|
+
* Sign-in preserves every edited list. Owner enable retains existing grants and adds only declared
|
|
13
|
+
* tools; the host must bind this plan to its approval card before applying it.
|
|
14
|
+
* @param required Current row grants and the installed declaration.
|
|
15
|
+
* @param options Grant occasion; sign-in is the conservative default.
|
|
16
|
+
* @returns The exact resulting grants, or null when no grant is declared or needed.
|
|
17
|
+
* @throws RangeError when a declaration grants writes outside its allowlist.
|
|
18
|
+
* @complexity O(a + w) time and space in current and declared tool names; no I/O.
|
|
19
|
+
*/
|
|
20
|
+
export declare function planAgentPluginToolGrant({ current, declared }: {
|
|
21
|
+
current: AgentPluginToolGrant;
|
|
22
|
+
declared: AgentPluginDeclaredTools;
|
|
23
|
+
}, { reason }?: {
|
|
24
|
+
reason?: 'sign-in' | 'owner-enable';
|
|
25
|
+
}): AgentPluginToolGrant | null;
|
|
26
|
+
//# sourceMappingURL=enable-grants.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Existing nonempty lists belong to the owner; sign-in must not widen either list. O(1). */
|
|
2
|
+
function hasExistingGrants({ current }, _options = {}) {
|
|
3
|
+
return current.allow.length > 0 || current.write.length > 0;
|
|
4
|
+
}
|
|
5
|
+
/** Plan the existing sign-in grant or an explicit owner-approved enable without changing inputs.
|
|
6
|
+
* Sign-in preserves every edited list. Owner enable retains existing grants and adds only declared
|
|
7
|
+
* tools; the host must bind this plan to its approval card before applying it.
|
|
8
|
+
* @param required Current row grants and the installed declaration.
|
|
9
|
+
* @param options Grant occasion; sign-in is the conservative default.
|
|
10
|
+
* @returns The exact resulting grants, or null when no grant is declared or needed.
|
|
11
|
+
* @throws RangeError when a declaration grants writes outside its allowlist.
|
|
12
|
+
* @complexity O(a + w) time and space in current and declared tool names; no I/O.
|
|
13
|
+
*/
|
|
14
|
+
export function planAgentPluginToolGrant({ current, declared }, { reason = 'sign-in' } = {}) {
|
|
15
|
+
if (!declared.allow)
|
|
16
|
+
return null;
|
|
17
|
+
const declaredAllow = new Set(declared.allow);
|
|
18
|
+
if (declared.write.some(name => !declaredAllow.has(name)))
|
|
19
|
+
throw new RangeError('Plugin write grants must be in its declared allow list');
|
|
20
|
+
if (reason === 'sign-in' && hasExistingGrants({ current }))
|
|
21
|
+
return null;
|
|
22
|
+
const allow = [...new Set([...current.allow, ...declared.allow])];
|
|
23
|
+
const write = [...new Set([...current.write, ...declared.write])];
|
|
24
|
+
if (current.enabled && JSON.stringify(current.allow) === JSON.stringify(allow) && JSON.stringify(current.write) === JSON.stringify(write))
|
|
25
|
+
return null;
|
|
26
|
+
return { enabled: true, allow, write };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=enable-grants.js.map
|
|
@@ -3,6 +3,7 @@ export { AgentPluginUpdateError } from './update-store.js';
|
|
|
3
3
|
export type { UpdateAgentPluginRequired, UpdateAgentPluginResult } from './update.js';
|
|
4
4
|
export * from './compatibility.js';
|
|
5
5
|
export * from './automatic-use.js';
|
|
6
|
+
export * from './bundled-file-policy.js';
|
|
6
7
|
import { maxAgentPluginArchiveBytes } from './fetch-archive.js';
|
|
7
8
|
import type { FetchAgentPluginArchiveOptional } from './fetch-archive.js';
|
|
8
9
|
import type { PackAgentPluginDirectoryOptional } from './bundled-source-archive.js';
|
|
@@ -227,4 +228,7 @@ export declare function createAgentPluginLifecycle(required: AgentPluginLifecycl
|
|
|
227
228
|
}, _optional?: Record<string, never>) => Promise<void>;
|
|
228
229
|
};
|
|
229
230
|
export { projectAgentPluginSearchPage, type AgentPluginDiscoveryMatch, type AgentPluginDiscoveryPage } from './search-projection.js';
|
|
231
|
+
export { agentVisiblePluginCandidate } from './search-projection.js';
|
|
232
|
+
export { createVersionedPluginActivationReader, type PluginActivationReaderPorts } from './activation-reader.js';
|
|
233
|
+
export { planAgentPluginToolGrant, type AgentPluginToolGrant, type AgentPluginDeclaredTools } from './enable-grants.js';
|
|
230
234
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lifecycle/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { AgentPluginUpdateError } from './update-store.js';
|
|
|
3
3
|
import { createUpdateModule } from './update.js';
|
|
4
4
|
export * from './compatibility.js';
|
|
5
5
|
export * from './automatic-use.js';
|
|
6
|
+
export * from './bundled-file-policy.js';
|
|
6
7
|
import { createPersistentStateModule } from "./persistent-state.js";
|
|
7
8
|
import { fetchAgentPluginArchive, maxAgentPluginArchiveBytes } from './fetch-archive.js';
|
|
8
9
|
import { createSeedBundledModule } from './seed-bundled.js';
|
|
@@ -120,4 +121,7 @@ export function createAgentPluginLifecycle(required, optional = {}) {
|
|
|
120
121
|
};
|
|
121
122
|
}
|
|
122
123
|
export { projectAgentPluginSearchPage } from './search-projection.js';
|
|
124
|
+
export { agentVisiblePluginCandidate } from './search-projection.js';
|
|
125
|
+
export { createVersionedPluginActivationReader } from './activation-reader.js';
|
|
126
|
+
export { planAgentPluginToolGrant } from './enable-grants.js';
|
|
123
127
|
//# sourceMappingURL=index.js.map
|
|
@@ -86,6 +86,13 @@ export interface InstallAgentPluginOptional {
|
|
|
86
86
|
readonly plugin: InstalledAgentPlugin;
|
|
87
87
|
readonly publish: () => Promise<InstalledAgentPlugin>;
|
|
88
88
|
}, optional: Record<string, never>) => Promise<InstalledAgentPlugin>;
|
|
89
|
+
/** Default true: an explicit install, update or replace retires this plugin's other revisions.
|
|
90
|
+
* Bundled seeding passes false. A revision's digest names the bytes it was published with, not
|
|
91
|
+
* what is on disk now, and nothing records whether a same-name copy came from an upload, an
|
|
92
|
+
* operator edit or an older build, so a boot-time seed cannot prove a copy is safe to delete.
|
|
93
|
+
* The bundled-digests ledger selects the build's digest instead (owner rule 2026-10-29: other
|
|
94
|
+
* copies are "kept unselected"). */
|
|
95
|
+
readonly pruneSupersededRevisions?: boolean;
|
|
89
96
|
}
|
|
90
97
|
/** Internal composition; one state/queue instance per injected host context. */
|
|
91
98
|
export declare function createInstallModule(ports: AgentPluginLifecyclePorts): {
|
|
@@ -65,7 +65,7 @@ import { readPluginIdentity, assertPluginIdentityAvailable } from "@jini-ai/core
|
|
|
65
65
|
import { createPersistentStateModule } from "./persistent-state.js";
|
|
66
66
|
import { createAgentPluginUpdateStore, settleAgentPluginUpdateJournal } from "./update-store.js";
|
|
67
67
|
/** Extracted from the host plugin lifecycle. Effects are supplied per host context. */
|
|
68
|
-
import { createHash } from "node:crypto";
|
|
68
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
69
69
|
import { constants } from "node:fs";
|
|
70
70
|
import path from "node:path";
|
|
71
71
|
import { PackagePathViolation } from "./package-paths.js";
|
|
@@ -223,7 +223,7 @@ function buildModule(ports) {
|
|
|
223
223
|
await persistentState.assertOwnedPath({ workspaceRoot: workspaceLayout.root, entryPath: path.relative(workspaceLayout.root, directory) });
|
|
224
224
|
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
225
225
|
}
|
|
226
|
-
if (await
|
|
226
|
+
if (await reuseOrSetAsideExisting({ packagesDir, finalRoot, extractionRoot, pluginId })) {
|
|
227
227
|
publishedPlugin = await indexInstalledRoot(finalRoot, digest);
|
|
228
228
|
return publishedPlugin;
|
|
229
229
|
}
|
|
@@ -241,7 +241,7 @@ function buildModule(ports) {
|
|
|
241
241
|
// The journal lives under the layout this install was given, the one it publishes into.
|
|
242
242
|
await settleAgentPluginUpdateJournal({ store: createAgentPluginUpdateStore({ ports: { ...ports, layout }, workspaceId, pluginId: indexed.pluginId }) });
|
|
243
243
|
const installed = await (optional.publishGuard ? optional.publishGuard({ plugin: indexed, publish: publishPackage }, {}) : publishPackage());
|
|
244
|
-
if (publishedPlugin)
|
|
244
|
+
if (publishedPlugin && optional.pruneSupersededRevisions !== false)
|
|
245
245
|
await pruneSupersededRevisions({ workspaceRoot: workspaceLayout.root, installed: publishedPlugin });
|
|
246
246
|
return installed;
|
|
247
247
|
} });
|
|
@@ -256,6 +256,48 @@ function buildModule(ports) {
|
|
|
256
256
|
await rm(transactionRoot, { recursive: true, force: true });
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Whether `finalRoot` already holds exactly the verified bytes in `extractionRoot`, so the install
|
|
261
|
+
* can deduplicate. A digest directory's NAME is only a claim: an operator with shell access can
|
|
262
|
+
* edit it in place ({@link freezeTree} is not a security boundary), and the ledger and the
|
|
263
|
+
* contribution trust gate check digest identity only — so reuse without comparing bytes would
|
|
264
|
+
* keep edited executable modules selected as shipped code. A mismatched copy is renamed aside
|
|
265
|
+
* under a non-digest name (kept for the operator, never indexed or selected) and `false` tells the
|
|
266
|
+
* caller to publish the pristine bytes in its place.
|
|
267
|
+
* @complexity O(f + b) in the file count and bytes of the two trees.
|
|
268
|
+
*/
|
|
269
|
+
async function reuseOrSetAsideExisting({ packagesDir, finalRoot, extractionRoot, pluginId }) {
|
|
270
|
+
if (!(await isRealDirectory(finalRoot)))
|
|
271
|
+
return false;
|
|
272
|
+
if (await sameTree(finalRoot, extractionRoot))
|
|
273
|
+
return true;
|
|
274
|
+
const aside = path.join(packagesDir, `.modified-${path.basename(finalRoot).slice(0, 12)}-${randomUUID()}`);
|
|
275
|
+
await createUninstallModule(ports).stageForRemoval(packagesDir, finalRoot, { quarantined: aside });
|
|
276
|
+
ports.onEvent?.({ event: 'agent-plugin-modified-revision-preserved', message: `Plugin '${pluginId}': an installed revision no longer matched its digest; it was kept at '${aside}' and the verified bytes were reinstalled.` });
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
/** Same entry names, kinds and file bytes, recursively. @complexity O(f + b). */
|
|
280
|
+
async function sameTree(left, right) {
|
|
281
|
+
const [leftEntries, rightEntries] = await Promise.all([readdir(left, { withFileTypes: true }), readdir(right, { withFileTypes: true })]);
|
|
282
|
+
if (leftEntries.length !== rightEntries.length)
|
|
283
|
+
return false;
|
|
284
|
+
const rightByName = new Map(rightEntries.map(entry => [entry.name, entry]));
|
|
285
|
+
for (const entry of leftEntries) {
|
|
286
|
+
const other = rightByName.get(entry.name);
|
|
287
|
+
if (!other || entry.isDirectory() !== other.isDirectory() || entry.isFile() !== other.isFile())
|
|
288
|
+
return false;
|
|
289
|
+
const [leftPath, rightPath] = [path.join(left, entry.name), path.join(right, entry.name)];
|
|
290
|
+
if (!(await (entry.isDirectory() ? sameTree(leftPath, rightPath) : sameFile(leftPath, rightPath))))
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
/** Size first, so a grown file is rejected without reading it. */
|
|
296
|
+
async function sameFile(left, right) {
|
|
297
|
+
if ((await stat(left)).size !== (await stat(right)).size)
|
|
298
|
+
return false;
|
|
299
|
+
return Buffer.from(await readFile(left)).equals(Buffer.from(await readFile(right)));
|
|
300
|
+
}
|
|
259
301
|
/** The `(target '...')` suffix on the symlink-rejection message, or nothing when the entry carries
|
|
260
302
|
* no `linkTarget` at all — split out purely to keep that `&&`/ternary pair out of
|
|
261
303
|
* {@link extractOneEntry}'s own branch count. */
|
|
@@ -37,7 +37,7 @@ export type ParseAgentPluginManifestResult = {
|
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* Validates an already-`JSON.parse`d `plugin.json` value against the 1.0.0/1.1.0 grammar.
|
|
40
|
-
* Hosts inject identityNamespace; the default
|
|
40
|
+
* Hosts inject identityNamespace; the default is `jini`, with a legacy-key fallback.
|
|
41
41
|
*
|
|
42
42
|
* @throws Nothing — every failure is reported via the returned `errors`, matching this codebase's
|
|
43
43
|
* own convention for expected validation outcomes (`plugin-runtime/manifest.ts`,
|
|
@@ -46,7 +46,7 @@ export type ParseAgentPluginManifestResult = {
|
|
|
46
46
|
*/
|
|
47
47
|
export declare function parseAgentPluginManifest({ value }: {
|
|
48
48
|
readonly value: unknown;
|
|
49
|
-
},
|
|
49
|
+
}, optional?: {
|
|
50
50
|
readonly identityNamespace?: string;
|
|
51
51
|
}): ParseAgentPluginManifestResult;
|
|
52
52
|
/**
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
* caller that reads the file and hands the parsed value here.
|
|
56
56
|
*/
|
|
57
57
|
import { isAgentPluginName, MAX_NAME_LENGTH } from '../core/plugin-name.js';
|
|
58
|
+
import { resolveAgentPluginIdentityNamespace } from '../core/identity-namespace.js';
|
|
58
59
|
export { isAgentPluginName } from '../core/plugin-name.js';
|
|
59
60
|
import { readAgentPluginCompatibilityMetadata } from "./compatibility-metadata.js";
|
|
60
61
|
import { parseAgentPluginExports } from './exports.js';
|
|
@@ -174,17 +175,18 @@ function collectManifestProblems({ raw, identityNamespace }, { nameError } = {})
|
|
|
174
175
|
}
|
|
175
176
|
/**
|
|
176
177
|
* Validates an already-`JSON.parse`d `plugin.json` value against the 1.0.0/1.1.0 grammar.
|
|
177
|
-
* Hosts inject identityNamespace; the default
|
|
178
|
+
* Hosts inject identityNamespace; the default is `jini`, with a legacy-key fallback.
|
|
178
179
|
*
|
|
179
180
|
* @throws Nothing — every failure is reported via the returned `errors`, matching this codebase's
|
|
180
181
|
* own convention for expected validation outcomes (`plugin-runtime/manifest.ts`,
|
|
181
182
|
* `plugin-runtime/discovery.ts`).
|
|
182
183
|
* @complexity O(k + n) time and space in the input keys and keyword entries.
|
|
183
184
|
*/
|
|
184
|
-
export function parseAgentPluginManifest({ value },
|
|
185
|
+
export function parseAgentPluginManifest({ value }, optional = {}) {
|
|
185
186
|
if (!isJsonObject(value))
|
|
186
187
|
return { ok: false, errors: ["plugin.json must be a JSON object"] };
|
|
187
188
|
const raw = value;
|
|
189
|
+
const identityNamespace = resolveAgentPluginIdentityNamespace({ value }, optional);
|
|
188
190
|
const nameResult = resolveManifestName(raw);
|
|
189
191
|
const { errors, warnings } = collectManifestProblems({ raw, identityNamespace }, { nameError: nameResult.error });
|
|
190
192
|
if (errors.length > 0)
|
|
@@ -406,7 +408,7 @@ function collectMcpConfigErrors({ raw }, { pluginManifest } = {}) {
|
|
|
406
408
|
}
|
|
407
409
|
/** The per-server metadata `plugin.json` declares under `extensionNamespace`, or `{}` when it declares none. */
|
|
408
410
|
function readExtensionServers({ pluginManifest, extensionNamespace }) {
|
|
409
|
-
const manifest = parseAgentPluginManifest({ value: pluginManifest });
|
|
411
|
+
const manifest = parseAgentPluginManifest({ value: pluginManifest }, { identityNamespace: extensionNamespace });
|
|
410
412
|
if (!manifest.ok)
|
|
411
413
|
return {};
|
|
412
414
|
return readAgentPluginExtension({ manifest: manifest.manifest, namespace: extensionNamespace, read: ({ value }) => isJsonObject(value.mcpServers) ? value.mcpServers : {} }) ?? {};
|
package/dist/lifecycle/node.js
CHANGED
|
@@ -3,6 +3,7 @@ import { randomInt, randomUUID } from 'node:crypto';
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import { performance } from 'node:perf_hooks';
|
|
5
5
|
import { setTimeout } from 'node:timers/promises';
|
|
6
|
+
import { readBootIdentity } from '@jini-ai/platform/fs/file-lock';
|
|
6
7
|
/** Granularity of the uniform [0, 1) value: crypto.randomInt's largest exclusive bound (2^48 - 1). */
|
|
7
8
|
const RANDOM_RESOLUTION = 2 ** 48 - 1;
|
|
8
9
|
/** Opt-in native effects. Layout, fetch, guard, namespace and provisioning remain host-owned. */
|
|
@@ -19,6 +20,7 @@ export function createNodeAgentPluginEffects(_required, optional = {}) {
|
|
|
19
20
|
pid: process.pid,
|
|
20
21
|
platform: process.platform,
|
|
21
22
|
hostname: () => os.hostname(),
|
|
23
|
+
bootIdentity: () => readBootIdentity({}),
|
|
22
24
|
isAlive: ({ pid }) => {
|
|
23
25
|
if (!Number.isSafeInteger(pid) || pid <= 0)
|
|
24
26
|
return false;
|
|
@@ -23,7 +23,7 @@ export function createPersistentStateModule(ports, _optional = {}) {
|
|
|
23
23
|
assertOwnedPath: (required, optional = {}) => assertPluginStatePath({ ...effects, ...required }, optional),
|
|
24
24
|
migrate: (required, optional = {}) => migratePluginLayout({ ...effects, ...required,
|
|
25
25
|
parsePluginId: ({ value }) => {
|
|
26
|
-
const parsed = parseAgentPluginManifest({ value });
|
|
26
|
+
const parsed = parseAgentPluginManifest({ value }, { identityNamespace: ports.extensionNamespace });
|
|
27
27
|
if (!parsed.ok)
|
|
28
28
|
throw new Error(parsed.errors.join('; '));
|
|
29
29
|
return parsed.manifest.name;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Clock, IdGenerator } from "@jini-ai/core/primitives";
|
|
2
|
+
import type { BootIdentity } from "@jini-ai/platform/fs/file-lock";
|
|
2
3
|
import type { AgentPluginServerMetadataReader } from './manifest.js';
|
|
3
4
|
import type { AgentPluginLayoutPort } from './layout.js';
|
|
4
5
|
import type { AgentPluginDeliveryMode, InstalledAgentPlugin } from './types.js';
|
|
@@ -24,6 +25,10 @@ export interface AgentPluginProcessPort {
|
|
|
24
25
|
isAlive(required: {
|
|
25
26
|
readonly pid: number;
|
|
26
27
|
}): boolean;
|
|
28
|
+
/** The kernel boot this process runs in, recorded in every lock it takes. Without it a lock left by
|
|
29
|
+
* a killed process is never provably this machine's once the hostname's spelling changes (macOS
|
|
30
|
+
* `name.lan`/`name.local`), and a never-ageing plugin state lock then wedges every boot. */
|
|
31
|
+
bootIdentity?(): BootIdentity | undefined;
|
|
27
32
|
}
|
|
28
33
|
/** The host implements federation in its own composition layer. No MCP dependency is required. */
|
|
29
34
|
export interface AgentPluginMcpProvisioningPort {
|
|
@@ -85,6 +90,9 @@ export interface AgentPluginLifecyclePorts {
|
|
|
85
90
|
readonly process: AgentPluginProcessPort;
|
|
86
91
|
readonly layout: AgentPluginLayoutPort;
|
|
87
92
|
readonly productName: string;
|
|
93
|
+
/** This host's own `extensions` key in plugin.json (README "Extension namespaces"). A plugin
|
|
94
|
+
* declares one entry per host it supports; the lifecycle reads only this key and never assumes
|
|
95
|
+
* a particular host's. Publisher ids are kept as declared: no alias, no rewrite between keys. */
|
|
88
96
|
readonly extensionNamespace: string;
|
|
89
97
|
/** Host boot policy may migrate every workspace before seeding the requested workspace.
|
|
90
98
|
* A failure refuses all publication; absent uses the owner's single-workspace migration. */
|
|
@@ -13,6 +13,14 @@ export interface AgentPluginDiscoveryPage {
|
|
|
13
13
|
readonly totalMatches: number;
|
|
14
14
|
readonly nextOffset: number | null;
|
|
15
15
|
}
|
|
16
|
+
/** Keep an off plugin discoverable by identity and purpose without disclosing its instructions,
|
|
17
|
+
* connection method, skills, tool names or capabilities. Admin metadata keeps its original owner.
|
|
18
|
+
* @returns The original active candidate, or a catalog-only candidate for an off plugin.
|
|
19
|
+
* @complexity O(1) bounded text work; no I/O or mutation.
|
|
20
|
+
*/
|
|
21
|
+
export declare function agentVisiblePluginCandidate({ candidate }: {
|
|
22
|
+
candidate: AgentPluginSearchCandidate;
|
|
23
|
+
}, _options?: {}): AgentPluginSearchCandidate;
|
|
16
24
|
/** Page an already ordered catalog, bounding the complete serialized result, including JSON escaping.
|
|
17
25
|
* @param required Ranked/listed candidates, a validated count window and the installed catalog size.
|
|
18
26
|
* @param options Optional byte budget (at least 1024); defaults to 8 KiB.
|
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
/** Retain a short, valid UTF-8 description; encoding work is bounded even for huge source prose. */
|
|
2
|
-
function shortDescription({ text },
|
|
3
|
-
const bytes = Buffer.from(text.slice(0,
|
|
4
|
-
if (bytes.length <=
|
|
5
|
-
return text.slice(0,
|
|
6
|
-
let end =
|
|
2
|
+
function shortDescription({ text }, { maxBytes = 240 } = {}) {
|
|
3
|
+
const bytes = Buffer.from(text.slice(0, maxBytes));
|
|
4
|
+
if (bytes.length <= maxBytes)
|
|
5
|
+
return text.slice(0, maxBytes);
|
|
6
|
+
let end = maxBytes;
|
|
7
7
|
while ((bytes[end] & 0xc0) === 0x80)
|
|
8
8
|
end--;
|
|
9
9
|
return bytes.subarray(0, end).toString('utf8');
|
|
10
10
|
}
|
|
11
|
+
/** Keep an off plugin discoverable by identity and purpose without disclosing its instructions,
|
|
12
|
+
* connection method, skills, tool names or capabilities. Admin metadata keeps its original owner.
|
|
13
|
+
* @returns The original active candidate, or a catalog-only candidate for an off plugin.
|
|
14
|
+
* @complexity O(1) bounded text work; no I/O or mutation.
|
|
15
|
+
*/
|
|
16
|
+
export function agentVisiblePluginCandidate({ candidate }, _options = {}) {
|
|
17
|
+
if (candidate.enabled)
|
|
18
|
+
return candidate;
|
|
19
|
+
const purpose = shortDescription({ text: (candidate.summary ?? candidate.description ?? '').slice(0, 1024).replace(/\s+/g, ' ').trim() }, { maxBytes: 100 });
|
|
20
|
+
const label = shortDescription({ text: (candidate.displayName ?? candidate.pluginId).slice(0, 1024).replace(/\s+/g, ' ').trim() }, { maxBytes: 80 });
|
|
21
|
+
return { pluginId: candidate.pluginId, id: candidate.id ?? candidate.pluginId, enabled: false,
|
|
22
|
+
description: `installed, off: ${label}: ${purpose} — ask to turn on`,
|
|
23
|
+
skills: [], keywords: [], provides: [], mcpServerIds: [] };
|
|
24
|
+
}
|
|
11
25
|
/** Project one candidate without copying skills, keywords, credentials or host metadata. O(1). */
|
|
12
26
|
function discoveryMatch({ candidate }, _options = {}) {
|
|
27
|
+
if (!candidate.enabled) {
|
|
28
|
+
const visible = agentVisiblePluginCandidate({ candidate });
|
|
29
|
+
return { id: visible.id ?? visible.pluginId, pluginId: visible.pluginId, enabled: false, description: visible.description ?? '' };
|
|
30
|
+
}
|
|
13
31
|
return { id: candidate.id ?? candidate.pluginId, pluginId: candidate.pluginId, enabled: candidate.enabled,
|
|
14
32
|
...(candidate.maturity ? { maturity: candidate.maturity } : {}),
|
|
15
33
|
description: shortDescription({ text: candidate.description ?? candidate.summary ?? '' }) };
|
package/dist/lifecycle/search.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** Extracted from the host plugin lifecycle. Effects are supplied per host context. */
|
|
2
|
+
import { agentVisiblePluginCandidate } from './search-projection.js';
|
|
2
3
|
/** These describe the conversation or target, not a plugin's topic. Prose-only hits remain
|
|
3
4
|
* available to explicit search without silently loading unrelated guidance. */
|
|
4
5
|
const INCIDENTAL_TERMS = new Set('a an and are as at be build can could create do for from get help i in is it make me my new of on or please the this to use want we with you your site sites page pages website websites plugin plugins tell which load just don t anything'.split(' '));
|
|
@@ -22,8 +23,11 @@ function passesDeploymentGate({ candidate, capabilities, terms }, _options = {})
|
|
|
22
23
|
* Mixed-purpose plugins can still match their other capabilities (for example source control).
|
|
23
24
|
*/
|
|
24
25
|
function automaticScore({ candidate, terms }, _options = {}) {
|
|
25
|
-
if (!candidate.enabled)
|
|
26
|
-
|
|
26
|
+
if (!candidate.enabled) {
|
|
27
|
+
const visible = agentVisiblePluginCandidate({ candidate });
|
|
28
|
+
const catalogTerms = automaticTerms(`${visible.pluginId} ${visible.description ?? ''}`);
|
|
29
|
+
return terms.reduce((score, term) => score + (catalogTerms.includes(term) ? 5 : 0), 0);
|
|
30
|
+
}
|
|
27
31
|
const capabilities = candidate.provides ?? [];
|
|
28
32
|
if (!passesDeploymentGate({ candidate, capabilities, terms }))
|
|
29
33
|
return 0;
|
|
@@ -52,6 +56,7 @@ function buildModule(ports) {
|
|
|
52
56
|
* each weight is what it is. Split out of {@link scoreCandidate} so the field/weight pairing is a
|
|
53
57
|
* plain, independently-readable list rather than interleaved with the scoring loop itself. */
|
|
54
58
|
function fieldHaystacks(candidate) {
|
|
59
|
+
candidate = agentVisiblePluginCandidate({ candidate });
|
|
55
60
|
return [
|
|
56
61
|
{ text: `${candidate.pluginId} ${candidate.id ?? ""} ${candidate.displayName ?? ""}`.toLowerCase(), weight: ID_FIELD_WEIGHT },
|
|
57
62
|
{ text: [...candidate.keywords, ...(candidate.provides ?? [])].join(" ").toLowerCase(), weight: KEYWORD_FIELD_WEIGHT },
|
|
@@ -186,13 +186,16 @@ function buildModule(ports) {
|
|
|
186
186
|
const packing = typeof optional.packing === 'function'
|
|
187
187
|
? await optional.packing({ sourceDir: args.sourceDir, dirName: args.dirName }, {}) : optional.packing;
|
|
188
188
|
const packed = await packAgentPluginDirectory(args.sourceDir, packing);
|
|
189
|
+
// No revision pruning here, not even of the digest the ledger recorded last boot: that digest
|
|
190
|
+
// names the bytes this build once published, not what is on disk now, so an operator edit
|
|
191
|
+
// under it would be deleted. Every same-name copy stays; the ledger selects this build's.
|
|
189
192
|
const installed = await installAgentPlugin({
|
|
190
193
|
archive: packed.bytes,
|
|
191
194
|
expectedSha256: packed.sha256,
|
|
192
195
|
archiveReader: packed.archiveReader ?? createBundledSourceArchiveReader(),
|
|
193
196
|
layout: args.layout,
|
|
194
197
|
workspaceId: args.workspaceId,
|
|
195
|
-
});
|
|
198
|
+
}, { pruneSupersededRevisions: false });
|
|
196
199
|
const { recorded } = await recordBundledAgentPluginIfAbsent({ workspaceRoot: args.layout.forWorkspace({ workspaceId: args.workspaceId }).root, pluginId: installed.pluginId }, { enabled: ports.seededEnabledPluginIds.has(installed.pluginId) });
|
|
197
200
|
return {
|
|
198
201
|
pluginId: installed.pluginId,
|
package/dist/manifest.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export interface McpManifest {
|
|
|
59
59
|
}
|
|
60
60
|
export declare function isMcpManifest(value: unknown): value is McpManifest;
|
|
61
61
|
/** Object-argument facade for the legacy structural validator.
|
|
62
|
-
* Hosts inject identityNamespace; the default
|
|
62
|
+
* Hosts inject identityNamespace; the default is `jini`, with a legacy-key fallback. */
|
|
63
63
|
export declare function validatePluginManifest(required: {
|
|
64
64
|
readonly value: unknown;
|
|
65
65
|
}, optional?: {
|
package/dist/manifest.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { validatePluginIdentity } from "@jini-ai/core/plugin-directory";
|
|
2
|
+
import { resolveAgentPluginIdentityNamespace } from './core/identity-namespace.js';
|
|
2
3
|
/**
|
|
3
4
|
* Types for the Agent Plugins 1.0.0 open standard (published by a Technical Steering Committee
|
|
4
5
|
* with maintainers from Amazon, Cursor, Google, Microsoft, OpenAI, and Vercel). A plugin is a
|
|
@@ -29,9 +30,9 @@ export function isMcpManifest(value) {
|
|
|
29
30
|
return typeof servers === 'object' && servers !== null && !Array.isArray(servers);
|
|
30
31
|
}
|
|
31
32
|
/** Object-argument facade for the legacy structural validator.
|
|
32
|
-
* Hosts inject identityNamespace; the default
|
|
33
|
+
* Hosts inject identityNamespace; the default is `jini`, with a legacy-key fallback. */
|
|
33
34
|
export function validatePluginManifest(required, optional = {}) {
|
|
34
|
-
return isPluginManifest(required.value) && validatePluginIdentity({ manifest: required.value, namespace: optional
|
|
35
|
+
return isPluginManifest(required.value) && validatePluginIdentity({ manifest: required.value, namespace: resolveAgentPluginIdentityNamespace(required, optional) }).errors.length === 0;
|
|
35
36
|
}
|
|
36
37
|
/** Object-argument facade for the legacy structural validator. */
|
|
37
38
|
export function validateMcpManifest(required) {
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The Fly deploy-config generator: renders `fly.toml` from the host's `DeploymentDescriptor`
|
|
3
|
+
* (`[build]`, `[env]`, `[[mounts]]`, `[http_service]` with a check on the descriptor's health path).
|
|
4
|
+
* A host's CI can import this dependency-free module directly (the workflow template's generate
|
|
5
|
+
* step); there is no checked-in `fly.toml` to read. Host-specific runtime switches arrive in
|
|
6
|
+
* `options.env` and host notes are appended by the host after render: this module defaults none.
|
|
7
|
+
*
|
|
8
|
+
* No enumerated region allow-list here, unlike the Render/Railway renderers: Fly's region catalog is
|
|
9
|
+
* large (~30 codes) and had no authoritative source to enumerate against without risking rejecting a
|
|
10
|
+
* real one. Only presence is checked.
|
|
11
|
+
*
|
|
12
|
+
* Every quoted sink (`app = "${...}"`, `source = "${...}"`, `primary_region = "${...}"`) goes through
|
|
13
|
+
* the host kit's `assertNoConfigInjection` first: `--region 'iad"\nprimary_region_evil="x'` once closed
|
|
14
|
+
* the quoted value early and emitted a real extra `primary_region_evil` key into `fly.toml` (moved
|
|
15
|
+
* here from the host's kit doc; regression pinned in `__tests__/fly.test.mjs`).
|
|
16
|
+
*
|
|
17
|
+
* Plain JS by owner decision (2026-09-29). The host passes the kit: `assertNoConfigInjection`,
|
|
18
|
+
* `validationError(message)`, `migrationsNote`.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {{ readonly name: string, readonly requirement: "boot-blocking" | "recommended" }} DeploymentSecret
|
|
23
|
+
* @typedef {{ readonly appName: string, readonly port: number, readonly dockerfilePath: string, readonly volumeMountPath: string, readonly volumeName: string, readonly healthCheckPath: string, readonly secrets: readonly DeploymentSecret[] }} DeploymentDescriptor
|
|
24
|
+
* @typedef {{ readonly region: string, readonly env?: Readonly<Record<string, string>>, readonly buildArgs?: Readonly<Record<string, string>> }} RenderDeployConfigOptions
|
|
25
|
+
* @typedef {{ readonly assertNoConfigInjection: (fieldLabel: string, value: string) => void, readonly validationError: (message: string) => Error, readonly migrationsNote: string }} DeployConfigKit
|
|
26
|
+
* @typedef {{ readonly filename: string, readonly contents: string, readonly notes: readonly string[] }} RenderedDeployConfig
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Serializes explicitly supplied non-secret variables as TOML assignments. JSON string quoting
|
|
31
|
+
* also escapes TOML basic strings, including URLs, backslashes, quotes and control characters.
|
|
32
|
+
* @param {{ values: Readonly<Record<string, string>>, secrets: readonly DeploymentSecret[], label: string }} input
|
|
33
|
+
* @param {DeployConfigKit} kit Error factory supplied by the host.
|
|
34
|
+
* @returns {string} Indented assignments, or an empty string for an empty map.
|
|
35
|
+
* @throws {Error} For invalid variable names, non-string values or declared secret names.
|
|
36
|
+
* @complexity O(n + s), where n is the total variable text and s the secret count.
|
|
37
|
+
*/
|
|
38
|
+
function renderVariables({ values, secrets, label }, kit) {
|
|
39
|
+
const secretNames = new Set(secrets.map(secret => secret.name));
|
|
40
|
+
return Object.entries(values).map(([name, value]) => {
|
|
41
|
+
if (!/^[A-Za-z_]\w*$/.test(name) || typeof value !== "string" || secretNames.has(name)) {
|
|
42
|
+
throw kit.validationError(`${label} must contain only non-secret string variables with valid names`);
|
|
43
|
+
}
|
|
44
|
+
// JSON permits a literal DEL character; TOML requires it to be escaped too.
|
|
45
|
+
return ` ${name} = ${JSON.stringify(value).replace(/\u007f/g, "\\u007f")}\n`;
|
|
46
|
+
}).join("");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Renders the descriptor and optional non-secret env/build arguments without I/O. The established
|
|
51
|
+
* three-argument generator port is retained for compatibility with every hosting plugin.
|
|
52
|
+
* @param {DeploymentDescriptor} descriptor
|
|
53
|
+
* @param {RenderDeployConfigOptions} options
|
|
54
|
+
* @param {DeployConfigKit} kit
|
|
55
|
+
* @returns {RenderedDeployConfig}
|
|
56
|
+
* @throws {Error} The host's validation error for missing/unsafe identifiers or invalid variables.
|
|
57
|
+
* @complexity O(n + s), where n is variable text and s the declared secret count.
|
|
58
|
+
*/
|
|
59
|
+
function render(descriptor, options, kit) {
|
|
60
|
+
const region = options.region.trim();
|
|
61
|
+
if (!region) {
|
|
62
|
+
throw kit.validationError("--region is required for --target fly (no default region is assumed)");
|
|
63
|
+
}
|
|
64
|
+
kit.assertNoConfigInjection("--region", region);
|
|
65
|
+
kit.assertNoConfigInjection("the derived Fly app name (fly.toml's app)", descriptor.appName);
|
|
66
|
+
kit.assertNoConfigInjection("the derived Fly volume name (fly.toml's [[mounts]].source)", descriptor.volumeName);
|
|
67
|
+
|
|
68
|
+
const buildArgs = renderVariables({ values: options.buildArgs ?? {}, secrets: descriptor.secrets, label: "buildArgs" }, kit);
|
|
69
|
+
const env = renderVariables({
|
|
70
|
+
values: { PORT: String(descriptor.port), ...options.env },
|
|
71
|
+
secrets: descriptor.secrets,
|
|
72
|
+
label: "env",
|
|
73
|
+
}, kit);
|
|
74
|
+
|
|
75
|
+
const contents = `app = "${descriptor.appName}"
|
|
76
|
+
primary_region = "${region}"
|
|
77
|
+
|
|
78
|
+
[build]
|
|
79
|
+
dockerfile = "${descriptor.dockerfilePath}"
|
|
80
|
+
|
|
81
|
+
${buildArgs ? `[build.args]\n${buildArgs}\n` : ""}[env]
|
|
82
|
+
${env.trimEnd()}
|
|
83
|
+
|
|
84
|
+
[[mounts]]
|
|
85
|
+
source = "${descriptor.volumeName}"
|
|
86
|
+
destination = "${descriptor.volumeMountPath}"
|
|
87
|
+
|
|
88
|
+
[http_service]
|
|
89
|
+
internal_port = ${descriptor.port}
|
|
90
|
+
force_https = true
|
|
91
|
+
auto_stop_machines = false
|
|
92
|
+
auto_start_machines = true
|
|
93
|
+
min_machines_running = 1
|
|
94
|
+
|
|
95
|
+
[[http_service.checks]]
|
|
96
|
+
grace_period = "60s"
|
|
97
|
+
interval = "30s"
|
|
98
|
+
method = "GET"
|
|
99
|
+
timeout = "5s"
|
|
100
|
+
path = "${descriptor.healthCheckPath}"
|
|
101
|
+
`;
|
|
102
|
+
|
|
103
|
+
const notes = [
|
|
104
|
+
`Create the volume before the first deploy — this file only MOUNTS it, it does not create it: ` +
|
|
105
|
+
`fly volumes create ${descriptor.volumeName} --region ${region} -a ${descriptor.appName}`,
|
|
106
|
+
kit.migrationsNote,
|
|
107
|
+
...descriptor.secrets.map(
|
|
108
|
+
(secret) => `Set ${secret.name} (${secret.requirement}) with: fly secrets set ${secret.name}=<value> -a ${descriptor.appName}`
|
|
109
|
+
),
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
return { filename: "fly.toml", contents, notes };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export default { render };
|