@jini-ai/agent-plugins 0.6.23 → 0.7.0
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 +47 -0
- package/README.md +13 -0
- package/calendly/exports/booking-calendar.css +7 -0
- package/calendly/exports/booking-calendar.html +5 -0
- package/calendly/mcp.json +10 -0
- package/calendly/plugin.json +47 -0
- package/calendly/skills/calendly/SKILL.md +27 -0
- package/charts-echarts/plugin.json +2 -2
- package/charts-recharts/plugin.json +2 -2
- package/cloudflare/lib/cms-forms.mjs +57 -0
- package/cloudflare/lib/forms.mjs +78 -18
- package/cloudflare/lib/target.mjs +17 -4
- package/cloudflare/plugin.json +2 -2
- package/cloudflare/skills/cloudflare/SKILL.md +4 -4
- package/cloudflare/skills/cloudflare/references/workers.md +4 -4
- package/cloudflare/worker/forms-receiver.mjs +81 -41
- package/cloudflare/worker/portable-validation.mjs +220 -0
- package/commerce/plugin.json +17 -0
- package/commerce/skills/commerce/SKILL.md +23 -0
- package/composio/mcp.json +1 -1
- package/composio/plugin.json +2 -2
- package/composio/skills/composio/SKILL.md +4 -4
- package/core/commerce-server.d.ts +2 -0
- package/core/commerce-server.mjs +2 -0
- package/dist/admin-surfaces/connections/connections.d.ts +35 -0
- package/dist/admin-surfaces/connections/connections.js +135 -0
- package/dist/admin-surfaces/connections/index.d.ts +3 -0
- package/dist/admin-surfaces/connections/index.js +2 -0
- package/dist/admin-surfaces/connections/ports.d.ts +110 -0
- package/dist/admin-surfaces/connections/ports.js +2 -0
- package/dist/admin-surfaces/index.d.ts +2 -0
- package/dist/admin-surfaces/index.js +1 -0
- package/dist/admin-surfaces/plugin-state-persistence.d.ts +27 -0
- package/dist/admin-surfaces/plugin-state-persistence.js +2 -0
- package/dist/admin-surfaces/plugin-state.d.ts +51 -0
- package/dist/admin-surfaces/plugin-state.js +106 -0
- package/dist/connect/access-token-tool.d.ts +240 -0
- package/dist/connect/access-token-tool.js +213 -0
- package/dist/connect/apply-connect-defaults.d.ts +91 -0
- package/dist/connect/apply-connect-defaults.js +113 -0
- package/dist/connect/apply-tool-renames.d.ts +72 -0
- package/dist/connect/apply-tool-renames.js +105 -0
- package/dist/connect/connect-card-ui.d.ts +143 -0
- package/dist/connect/connect-card-ui.js +106 -0
- package/dist/connect/connect-destination.d.ts +35 -0
- package/dist/connect/connect-destination.js +45 -0
- package/dist/connect/connect-sign-in-wait.d.ts +31 -0
- package/dist/connect/connect-sign-in-wait.js +21 -0
- package/dist/connect/connect-tool.d.ts +314 -0
- package/dist/connect/connect-tool.js +431 -0
- package/dist/connect/connection-status.d.ts +33 -0
- package/dist/connect/connection-status.js +63 -0
- package/dist/connect/credential-cards.d.ts +15 -0
- package/dist/connect/credential-cards.js +49 -0
- package/dist/connect/credential-save-tool.d.ts +45 -0
- package/dist/connect/credential-save-tool.js +156 -0
- package/dist/connect/enable-access.d.ts +67 -0
- package/dist/connect/enable-access.js +74 -0
- package/dist/connect/executable/approval.d.ts +58 -0
- package/dist/connect/executable/approval.js +40 -0
- package/dist/connect/executable/host-capabilities.d.ts +76 -0
- package/dist/connect/executable/host-capabilities.js +100 -0
- package/dist/connect/executable/index.d.ts +10 -0
- package/dist/connect/executable/index.js +9 -0
- package/dist/connect/executable/ports.d.ts +189 -0
- package/dist/connect/executable/ports.js +2 -0
- package/dist/connect/executable/register.d.ts +21 -0
- package/dist/connect/executable/register.js +125 -0
- package/dist/connect/federate-mcp.d.ts +190 -0
- package/dist/connect/federate-mcp.js +440 -0
- package/dist/connect/grant-signed-in-defaults.d.ts +96 -0
- package/dist/connect/grant-signed-in-defaults.js +100 -0
- package/dist/connect/import-access-token.d.ts +114 -0
- package/dist/connect/import-access-token.js +103 -0
- package/dist/connect/index.d.ts +19 -0
- package/dist/connect/index.js +19 -0
- package/dist/connect/plugin-credential-card.d.ts +46 -0
- package/dist/connect/plugin-credential-card.js +63 -0
- package/dist/connect/plugin-host/index.d.ts +203 -0
- package/dist/connect/plugin-host/index.js +153 -0
- package/dist/connect/ports.d.ts +74 -0
- package/dist/connect/ports.js +2 -0
- package/dist/connect/switch-on-saved-token.d.ts +48 -0
- package/dist/connect/switch-on-saved-token.js +20 -0
- package/dist/connect/token-sign-in.d.ts +51 -0
- package/dist/connect/token-sign-in.js +43 -0
- package/dist/core/identity-namespace.d.ts +39 -0
- package/dist/core/identity-namespace.js +61 -3
- package/dist/folder-zip-node.js +3 -1
- package/dist/lifecycle/automatic-use.d.ts +12 -7
- package/dist/lifecycle/automatic-use.js +37 -28
- package/dist/lifecycle/capability-projection.js +5 -1
- package/dist/lifecycle/contribution-loader.d.ts +2 -7
- package/dist/lifecycle/contribution-types.d.ts +8 -0
- package/dist/lifecycle/contribution-types.js +2 -0
- package/dist/lifecycle/credential-card-metadata.d.ts +23 -0
- package/dist/lifecycle/credential-card-metadata.js +184 -0
- package/dist/lifecycle/exports.d.ts +11 -0
- package/dist/lifecycle/exports.js +64 -3
- package/dist/lifecycle/host-tools/identity.d.ts +38 -0
- package/dist/lifecycle/host-tools/identity.js +58 -0
- package/dist/lifecycle/host-tools/index.d.ts +20 -0
- package/dist/lifecycle/host-tools/index.js +20 -0
- package/dist/lifecycle/host-tools/memory-tools.d.ts +22 -0
- package/dist/lifecycle/host-tools/memory-tools.js +63 -0
- package/dist/lifecycle/host-tools/ports.d.ts +121 -0
- package/dist/lifecycle/host-tools/ports.js +2 -0
- package/dist/lifecycle/host-tools/provider-status-tool.d.ts +88 -0
- package/dist/lifecycle/host-tools/provider-status-tool.js +45 -0
- package/dist/lifecycle/host-tools/search-tool.d.ts +74 -0
- package/dist/lifecycle/host-tools/search-tool.js +282 -0
- package/dist/lifecycle/host-tools/skill-tool.d.ts +219 -0
- package/dist/lifecycle/host-tools/skill-tool.js +482 -0
- package/dist/lifecycle/host-tools/write-note-tool.d.ts +22 -0
- package/dist/lifecycle/host-tools/write-note-tool.js +47 -0
- package/dist/lifecycle/index.d.ts +2 -1
- package/dist/lifecycle/install.js +2 -1
- package/dist/lifecycle/installed-package-index.js +5 -8
- package/dist/lifecycle/mail/adapter-descriptors.d.ts +78 -0
- package/dist/lifecycle/mail/adapter-descriptors.js +155 -0
- package/dist/lifecycle/mail/catalog.d.ts +116 -0
- package/dist/lifecycle/mail/catalog.js +72 -0
- package/dist/lifecycle/mail/configuration.d.ts +25 -0
- package/dist/lifecycle/mail/configuration.js +62 -0
- package/dist/lifecycle/mail/contribution.d.ts +89 -0
- package/dist/lifecycle/mail/contribution.js +115 -0
- package/dist/lifecycle/mail/host-mailer.d.ts +24 -0
- package/dist/lifecycle/mail/host-mailer.js +10 -0
- package/dist/lifecycle/mail/index.d.ts +16 -0
- package/dist/lifecycle/mail/index.js +16 -0
- package/dist/lifecycle/mail/selection.d.ts +40 -0
- package/dist/lifecycle/mail/selection.js +86 -0
- package/dist/lifecycle/manifest.d.ts +7 -2
- package/dist/lifecycle/manifest.js +32 -9
- package/dist/lifecycle/metadata.d.ts +31 -0
- package/dist/lifecycle/metadata.js +80 -0
- package/dist/lifecycle/persistent-state.js +2 -1
- package/dist/lifecycle/ports.d.ts +2 -0
- package/dist/lifecycle/resolve-agent-plugin-refs.d.ts +2 -1
- package/dist/lifecycle/resolve-agent-plugin-refs.js +14 -8
- package/dist/lifecycle/search-projection.d.ts +3 -4
- package/dist/lifecycle/search-projection.js +5 -7
- package/dist/lifecycle/search.js +3 -2
- package/fly/plugin.json +5 -5
- package/fly/skills/fly/SKILL.md +1 -1
- package/formspree/plugin.json +7 -0
- package/formspree/skills/formspree/SKILL.md +11 -0
- package/github/plugin.json +2 -2
- package/github/skills/github/SKILL.md +28 -28
- package/github/skills/github/references/actions.md +8 -8
- package/github/skills/github/references/auth-and-tokens.md +7 -7
- package/github/skills/github/references/repo-files.md +5 -5
- package/github/skills/github/references/site-backup.md +16 -16
- package/github/skills/github/references/source-control.md +17 -17
- package/github-pages/plugin.json +2 -2
- package/github-pages/skills/github-pages/SKILL.md +3 -3
- package/google-forms/plugin.json +7 -0
- package/google-forms/skills/google-forms/SKILL.md +15 -0
- package/google-login/plugin.json +3 -3
- package/google-login/skills/google-login/SKILL.md +17 -60
- package/google-workspace/plugin.json +6 -6
- package/google-workspace/skills/google-workspace/references/connection.md +1 -1
- package/google-workspace/skills/google-workspace/references/form-delivery.md +4 -4
- package/google-workspace/tovu-admin-surfaces.json +5 -5
- package/higgsfield-media/plugin.json +5 -5
- package/higgsfield-media/skills/higgsfield-media/SKILL.md +31 -33
- package/higgsfield-media/skills/higgsfield-media/references/failure-modes.md +7 -7
- package/higgsfield-media/skills/higgsfield-media/references/models-and-plan-gates.md +3 -3
- package/jev/plugin.json +2 -2
- package/langfuse/plugin.json +2 -2
- package/meilisearch/plugin.json +2 -2
- package/meilisearch/skills/meilisearch/SKILL.md +1 -1
- package/netlify/plugin.json +2 -2
- package/netlify/skills/netlify/SKILL.md +3 -3
- package/opentelemetry/plugin.json +2 -2
- package/opentelemetry/skills/opentelemetry/SKILL.md +7 -7
- package/package.json +92 -14
- package/posthog/plugin.json +2 -2
- package/posthog/skills/posthog/SKILL.md +7 -7
- package/railway/plugin.json +3 -3
- package/railway/skills/railway/SKILL.md +10 -11
- package/render/plugin.json +3 -3
- package/render/skills/render/SKILL.md +7 -8
- package/resend/NOTES.md +2 -2
- package/resend/mcp.json +1 -1
- package/resend/plugin.json +5 -5
- package/resend/skills/resend/SKILL.md +13 -13
- package/s3-compatible/plugin.json +2 -2
- package/s3-compatible/skills/s3-compatible/SKILL.md +4 -4
- package/sentry/plugin.json +2 -2
- package/sentry/skills/sentry/SKILL.md +7 -7
- package/shopify/plugin.json +2 -2
- package/site-compliance/plugin.json +2 -2
- package/site-compliance/skills/site-compliance/SKILL.md +3 -3
- package/site-compliance/skills/site-compliance/references/gdpr-eu-uk.md +1 -1
- package/site-import/plugin.json +2 -2
- package/slide-design/plugin.json +2 -2
- package/software-engineering/LICENSE +201 -0
- package/software-engineering/NOTICE +9 -0
- package/software-engineering/README.md +89 -0
- package/software-engineering/plugin.json +24 -0
- package/software-engineering/skills/software-engineering/SKILL.md +33 -0
- package/software-engineering/skills/software-engineering/references/debugging.md +54 -0
- package/software-engineering/skills/software-engineering/references/implementation.md +27 -0
- package/software-engineering/skills/software-engineering/references/planning.md +27 -0
- package/software-engineering/skills/software-engineering/references/prototyping.md +14 -0
- package/software-engineering/skills/software-engineering/references/security.md +47 -0
- package/software-engineering/skills/software-engineering/references/verification.md +53 -0
- package/stripe/plugin.json +2 -2
- package/supabase/mcp.json +4 -4
- package/supabase/plugin.json +3 -3
- package/supabase/skills/supabase/SKILL.md +8 -8
- package/supabase/skills/supabase/references/failure-modes.md +5 -5
- package/ui-ux-design/plugin.json +2 -2
- package/vercel/plugin.json +2 -2
- package/vercel/skills/vercel/SKILL.md +3 -3
- package/wordpress/plugin.json +2 -2
- package/wordpress/skills/wordpress/SKILL.md +3 -3
- package/wordpress/skills/wordpress/references/free-site-redirect.md +2 -2
- package/wordpress/skills/wordpress/references/subdomain.md +5 -5
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Host adapter for the shared identity owner. The legacy lifecycle already indexes packageRoot;
|
|
2
|
+
* rereading its manifest keeps new metadata available before compiled lifecycle code is rebuilt. */
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { readPluginIdentity } from '@jini-ai/core/plugin-directory';
|
|
6
|
+
import { readAgentPluginPortableExtension } from '../../core/identity-namespace.js';
|
|
7
|
+
/** Read the selected portable extension; unknown values warn without rejecting a usable plugin.
|
|
8
|
+
* @returns A supported maturity or undefined. @complexity O(1).
|
|
9
|
+
*/
|
|
10
|
+
export function readPluginMaturity({ manifest }, options = {}) {
|
|
11
|
+
// The portable reader preserves old installed copies when the new namespace is absent.
|
|
12
|
+
const maturity = readAgentPluginPortableExtension({ value: manifest })?.maturity;
|
|
13
|
+
if (maturity === undefined)
|
|
14
|
+
return undefined;
|
|
15
|
+
if (maturity === 'untested' || maturity === 'soon')
|
|
16
|
+
return maturity;
|
|
17
|
+
(options.warn ?? console.warn)('[agent-plugins] Unknown extensions.jini.maturity ignored; expected "untested" or "soon".');
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
/** Provider plugin ids follow the same grammar as a credential card's `saveTarget`. */
|
|
21
|
+
const PROVIDER_PLUGIN_ID = /^[a-z0-9][a-z0-9._-]{0,99}$/;
|
|
22
|
+
/** `extensions.jini.providerPlugin`: the provider plugin this agent plugin is the assistant face of
|
|
23
|
+
* (owner 2026-10-25: one vendor, one plugin). The provider plugin's switch turns both faces on and
|
|
24
|
+
* off (`provider-plugin-link.ts`), and the agent plugin owns that provider's settings card.
|
|
25
|
+
* Unknown shapes warn and read as no link, so a typo never links to a wrong plugin.
|
|
26
|
+
* @complexity O(1). */
|
|
27
|
+
export function readProviderPluginLink({ manifest }, options = {}) {
|
|
28
|
+
const link = readAgentPluginPortableExtension({ value: manifest })?.providerPlugin;
|
|
29
|
+
if (link === undefined)
|
|
30
|
+
return undefined;
|
|
31
|
+
if (typeof link === 'string' && PROVIDER_PLUGIN_ID.test(link))
|
|
32
|
+
return link;
|
|
33
|
+
(options.warn ?? console.warn)('[agent-plugins] Invalid extensions.jini.providerPlugin ignored; expected a plugin id.');
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
/** Shared instruction for every host guidance surface, so disclosure precedes credentials/actions. */
|
|
37
|
+
export const UNTESTED_PLUGIN_GUIDANCE = "Before saving keys or acting with this plugin, tell the user this integration hasn't been tested end to end yet. It may not work.";
|
|
38
|
+
/** Reads metadata only from a lifecycle-validated package root; never imports executable code.
|
|
39
|
+
* @param optional.readText file reader port (defaults to UTF-8 `fs.readFile`).
|
|
40
|
+
* @throws Invalid or unreadable publisher metadata.
|
|
41
|
+
* @complexity One manifest read plus O(k + p) keyword/capability validation.
|
|
42
|
+
*/
|
|
43
|
+
export async function readInstalledAgentPluginIdentity({ plugin }, optional = {}) {
|
|
44
|
+
const readText = optional.readText ?? ((filePath) => readFile(filePath, 'utf8'));
|
|
45
|
+
let manifest;
|
|
46
|
+
try {
|
|
47
|
+
manifest = JSON.parse(await readText(path.join(plugin.packageRoot, 'plugin.json')));
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
throw new Error('The installed plugin identity manifest could not be read.');
|
|
51
|
+
}
|
|
52
|
+
const extension = readAgentPluginPortableExtension({ value: manifest });
|
|
53
|
+
const identity = readPluginIdentity({ manifest: { ...manifest, extensions: { jini: extension } }, name: plugin.pluginId, namespace: 'jini' });
|
|
54
|
+
const maturity = readPluginMaturity({ manifest });
|
|
55
|
+
const providerPlugin = readProviderPluginLink({ manifest });
|
|
56
|
+
return { ...identity, ...(maturity ? { maturity } : {}), ...(providerPlugin ? { providerPlugin } : {}) };
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Public surface of `@jini-ai/agent-plugins/lifecycle/host-tools`: the host-facing Agent Plugin
|
|
3
|
+
* tools that stay inside one domain (the skill tool, plugin search, plugin memory tools, write-note
|
|
4
|
+
* and provider status). Anything that crosses domains or shows a card stays with the host, which
|
|
5
|
+
* wires it through each domain's own contract.
|
|
6
|
+
*
|
|
7
|
+
* Each tool reaches the host through ports (`ports.ts`), never an import of a same-layer package.
|
|
8
|
+
*
|
|
9
|
+
* @agent-note A host that imports this entry must install the optional peer `semver`. Plugin search
|
|
10
|
+
* (`search-tool.ts`) loads `../compatibility.js`, which imports it by value, so without it this
|
|
11
|
+
* import fails with ERR_MODULE_NOT_FOUND for `semver`.
|
|
12
|
+
*/
|
|
13
|
+
export * from './ports.js';
|
|
14
|
+
export { readPluginMaturity, readProviderPluginLink, readInstalledAgentPluginIdentity, UNTESTED_PLUGIN_GUIDANCE, type PluginMaturity } from './identity.js';
|
|
15
|
+
export { loadInstalledAgentPluginToolSources, agentPluginToolDerivedRisk, createAgentPluginToolGate, buildAgentPluginToolRegistrations, registerInstalledAgentPluginTools, type AgentPluginSkillDetail, type AgentPluginToolSource, type AgentPluginToolIdentity, type AgentPluginToolGate, } from './skill-tool.js';
|
|
16
|
+
export { agentPluginSearchToolCatalog, agentPluginSearchDerivedRisk, loadAgentPluginSearchCandidates, buildAgentPluginSearchRegistrations, type AgentPluginSearchToolDeps as AgentPluginSearchToolInput, type IdentifiedAgentPluginSearchCandidate, } from './search-tool.js';
|
|
17
|
+
export { buildPluginMemoryRegistrations } from './memory-tools.js';
|
|
18
|
+
export { WRITE_PLUGIN_NOTE, pluginNoteToolCatalog, pluginNoteRisk, pluginNoteHandler } from './write-note-tool.js';
|
|
19
|
+
export { createProviderStatusTools, PROVIDER_STATUS_TOOL_ID, type ProviderStatusMessages, type ProviderStatusRow, type ProviderStatusPorts, type ProviderSettingFieldProjection } from './provider-status-tool.js';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Public surface of `@jini-ai/agent-plugins/lifecycle/host-tools`: the host-facing Agent Plugin
|
|
3
|
+
* tools that stay inside one domain (the skill tool, plugin search, plugin memory tools, write-note
|
|
4
|
+
* and provider status). Anything that crosses domains or shows a card stays with the host, which
|
|
5
|
+
* wires it through each domain's own contract.
|
|
6
|
+
*
|
|
7
|
+
* Each tool reaches the host through ports (`ports.ts`), never an import of a same-layer package.
|
|
8
|
+
*
|
|
9
|
+
* @agent-note A host that imports this entry must install the optional peer `semver`. Plugin search
|
|
10
|
+
* (`search-tool.ts`) loads `../compatibility.js`, which imports it by value, so without it this
|
|
11
|
+
* import fails with ERR_MODULE_NOT_FOUND for `semver`.
|
|
12
|
+
*/
|
|
13
|
+
export * from './ports.js';
|
|
14
|
+
export { readPluginMaturity, readProviderPluginLink, readInstalledAgentPluginIdentity, UNTESTED_PLUGIN_GUIDANCE } from './identity.js';
|
|
15
|
+
export { loadInstalledAgentPluginToolSources, agentPluginToolDerivedRisk, createAgentPluginToolGate, buildAgentPluginToolRegistrations, registerInstalledAgentPluginTools, } from './skill-tool.js';
|
|
16
|
+
export { agentPluginSearchToolCatalog, agentPluginSearchDerivedRisk, loadAgentPluginSearchCandidates, buildAgentPluginSearchRegistrations, } from './search-tool.js';
|
|
17
|
+
export { buildPluginMemoryRegistrations } from './memory-tools.js';
|
|
18
|
+
export { WRITE_PLUGIN_NOTE, pluginNoteToolCatalog, pluginNoteRisk, pluginNoteHandler } from './write-note-tool.js';
|
|
19
|
+
export { createProviderStatusTools, PROVIDER_STATUS_TOOL_ID } from './provider-status-tool.js';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ToolRegistration } from "@jini-ai/core";
|
|
2
|
+
import type { AgentPluginHostToolPorts, ApplyHostToolApprovalPolicy } from "./ports.js";
|
|
3
|
+
interface Identity {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly pluginId: string;
|
|
6
|
+
readonly archiveDigest: string;
|
|
7
|
+
}
|
|
8
|
+
/** Every capability closes over its owning plugin. Caller-controlled ids/kinds are rejected. */
|
|
9
|
+
export declare function buildPluginMemoryRegistrations(required: {
|
|
10
|
+
withExtensionApprovalPolicy: ApplyHostToolApprovalPolicy;
|
|
11
|
+
sources: readonly Identity[];
|
|
12
|
+
workspaceId: string;
|
|
13
|
+
ports: Pick<AgentPluginHostToolPorts, "memory" | "permissions" | "metadata">;
|
|
14
|
+
gate: {
|
|
15
|
+
isCallable(plugin: {
|
|
16
|
+
pluginId: string;
|
|
17
|
+
archiveDigest: string;
|
|
18
|
+
}): Promise<boolean>;
|
|
19
|
+
};
|
|
20
|
+
}, _optional?: {}): ToolRegistration[];
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=memory-tools.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { buildDomainRegistrations, indexCatalogById, requireInputRecord, requireString } from "@jini-ai/core";
|
|
2
|
+
/** List this plugin's learned entries, or read one; only an absent file becomes exists:false.
|
|
3
|
+
* Containment, permission and other filesystem errors still propagate from the storage owner.
|
|
4
|
+
* @complexity One bounded Jini list or one file read; storage owns byte/file caps.
|
|
5
|
+
*/
|
|
6
|
+
async function readMemory({ memory, pluginId, input }, _options = {}) {
|
|
7
|
+
if (input.entryPath === undefined)
|
|
8
|
+
return { pluginId, entries: await memory.list({ kind: "learned" }) };
|
|
9
|
+
const entryPath = requireString({ input, key: "entryPath" });
|
|
10
|
+
try {
|
|
11
|
+
return { pluginId, entryPath, text: await memory.learned.read({ entryPath }) };
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT")
|
|
15
|
+
return { pluginId, entryPath, exists: false };
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Every capability closes over its owning plugin. Caller-controlled ids/kinds are rejected. */
|
|
20
|
+
export function buildPluginMemoryRegistrations(required, _optional = {}) {
|
|
21
|
+
const { withExtensionApprovalPolicy } = required;
|
|
22
|
+
const catalog = [];
|
|
23
|
+
const handlers = {};
|
|
24
|
+
const risk = new Map();
|
|
25
|
+
const owners = new Map();
|
|
26
|
+
const approvalFamilies = new Map();
|
|
27
|
+
for (const source of required.sources) {
|
|
28
|
+
for (const operation of ["read", "write"]) {
|
|
29
|
+
const id = `${source.id}__memory_${operation}`;
|
|
30
|
+
const sideEffects = operation === "read" ? "none" : "mutates-durable-state";
|
|
31
|
+
catalog.push(memoryToolDefinition({ id, source, operation, sideEffects, permission: required.ports.permissions.use }));
|
|
32
|
+
owners.set(id, source);
|
|
33
|
+
risk.set(id, sideEffects);
|
|
34
|
+
approvalFamilies.set(id, operation === "read" ? 'plugin-memory-read' : 'plugin-memory-write');
|
|
35
|
+
handlers[id] = async (ctx) => {
|
|
36
|
+
const input = requireInputRecord({ input: ctx.input });
|
|
37
|
+
const allowed = operation === "read" ? ["entryPath"] : ["entryPath", "text"];
|
|
38
|
+
if (Object.keys(input).some(key => !allowed.includes(key)))
|
|
39
|
+
throw new Error("Memory tool accepts no plugin id, kind, or other fields");
|
|
40
|
+
const memory = required.ports.memory.pluginMemory({ workspaceId: required.workspaceId, pluginId: source.pluginId });
|
|
41
|
+
if (operation === "read")
|
|
42
|
+
return readMemory({ memory, pluginId: source.pluginId, input });
|
|
43
|
+
return memory.learned.write({ entryPath: requireString({ input, key: "entryPath" }), text: requireString({ input, key: "text" }) });
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return buildDomainRegistrations({ ...(required.ports.metadata ? { metadata: required.ports.metadata } : {}), domain: "agent-plugin-memory", catalogModule: "lifecycle/host-tools/memory-tools.ts",
|
|
48
|
+
catalog: indexCatalogById({ catalog }), handlers, derivedRisk: risk,
|
|
49
|
+
}).map(registration => {
|
|
50
|
+
const owner = owners.get(registration.descriptor.id);
|
|
51
|
+
const policy = registration.policy;
|
|
52
|
+
return withExtensionApprovalPolicy({ registration: { ...registration, policy: { authorize: async (ctx) => (await required.gate.isCallable(owner)) ? policy.authorize(ctx) : "deny" } },
|
|
53
|
+
family: approvalFamilies.get(registration.descriptor.id) });
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function memoryToolDefinition({ id, source, operation, sideEffects, permission }, _optional = {}) {
|
|
57
|
+
return { name: id, description: `${operation === "read" ? "Read" : "Refresh"} ${source.pluginId}'s learned account knowledge. UTF-8 text only. Never credentials or permissions.${operation === "read" ? " Omit entryPath to list learned entries. A missing entry returns exists:false." : ""}`,
|
|
58
|
+
sideEffects, authorization: { permission },
|
|
59
|
+
inputSchema: { type: "object", additionalProperties: false, required: operation === "read" ? [] : ["entryPath", "text"],
|
|
60
|
+
properties: { entryPath: { type: "string" }, ...(operation === "write" ? { text: { type: "string" } } : {}) } },
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=memory-tools.js.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The ports the host-tools take. Each is structural, so a host binds its own lifecycle,
|
|
3
|
+
* activation effects, memory store, permission check and text without these tools importing a
|
|
4
|
+
* same-layer package or a host file. The lifecycle and activation ports are the same-named functions
|
|
5
|
+
* `createAgentPluginLifecycle` returns, with object arguments, so a host built on that owner passes it
|
|
6
|
+
* as is. Activation writes stay with the host's one shared queue; these tools only read.
|
|
7
|
+
*/
|
|
8
|
+
import type { ToolMetadataById, ToolRegistration } from '@jini-ai/core';
|
|
9
|
+
import type { createAgentPluginLifecycle } from '../index.js';
|
|
10
|
+
import type { AgentPluginWorkspaceLayout } from '../layout.js';
|
|
11
|
+
import type { PluginMemory } from '../../../core/persistent-state.js';
|
|
12
|
+
type AgentPluginLifecycle = ReturnType<typeof createAgentPluginLifecycle>;
|
|
13
|
+
/** Installed-package reads, ranking and entry-path checks. */
|
|
14
|
+
export type HostToolsLifecyclePort = Pick<AgentPluginLifecycle, 'listInstalledPlugins' | 'readBundledAgentPluginDigests' | 'preferBundledAgentPluginDigests' | 'isInstalledDigestPresent' | 'readInstalledSkillMarkdown' | 'readInstalledSkillFile' | 'readInstalledMcpServerIds' | 'rankInstalledAgentPlugins' | 'normalizePackageEntryPath'>;
|
|
15
|
+
/** Activation reads; the host's activation owner keeps every write on its one queue. */
|
|
16
|
+
export type HostToolsActivationsPort = Pick<AgentPluginLifecycle, 'filterActiveAgentPlugins' | 'isAgentPluginActive' | 'readAgentPluginActivations' | 'resolveAgentPluginActivation'>;
|
|
17
|
+
/** The workspace directories these tools read; never exposed in tool output. */
|
|
18
|
+
export interface HostToolsLayoutPort {
|
|
19
|
+
forWorkspace(required: {
|
|
20
|
+
readonly workspaceId: string;
|
|
21
|
+
}): Pick<AgentPluginWorkspaceLayout, 'root' | 'pluginPackagesDir'>;
|
|
22
|
+
}
|
|
23
|
+
/** Plugin memory: one plugin's store, and its user notes folded into guidance. */
|
|
24
|
+
export interface HostToolsMemoryPort {
|
|
25
|
+
pluginMemory(required: {
|
|
26
|
+
readonly workspaceId: string;
|
|
27
|
+
readonly pluginId: string;
|
|
28
|
+
}): PluginMemory;
|
|
29
|
+
appendNotes(required: {
|
|
30
|
+
readonly workspaceId: string;
|
|
31
|
+
readonly pluginId: string;
|
|
32
|
+
readonly guidance: string;
|
|
33
|
+
}): Promise<string>;
|
|
34
|
+
}
|
|
35
|
+
/** Permission names are host input: `use` reads guidance and memory, `enable` writes a note. */
|
|
36
|
+
export interface HostToolPermissions {
|
|
37
|
+
readonly use: string;
|
|
38
|
+
readonly enable: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The host's own tools the search tool's description points to, each written as the model should
|
|
42
|
+
* call it. An absent one drops only its own sentence.
|
|
43
|
+
* @agent-note Host tool names never live in Jini text; a host passes them here, word for word.
|
|
44
|
+
*/
|
|
45
|
+
export interface HostSearchToolNames {
|
|
46
|
+
/** Where the full plugin inventory is read: "For the full plugin inventory, use <inventory>." */
|
|
47
|
+
readonly inventory?: string;
|
|
48
|
+
/** The call that changes a plugin's enabled status: "<setEnabled> changes enabled status." */
|
|
49
|
+
readonly setEnabled?: string;
|
|
50
|
+
/** The call that loads one plugin's guidance: "Once you have the right id, call <loadGuidance> for…" */
|
|
51
|
+
readonly loadGuidance?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Host text. `pluginToolNavigation` ends each plugin tool's description when set; `searchHostTools`
|
|
55
|
+
* names the host tools in the search tool's description.
|
|
56
|
+
*/
|
|
57
|
+
export interface HostToolMessages {
|
|
58
|
+
readonly pluginToolNavigation?: string;
|
|
59
|
+
readonly searchHostTools?: HostSearchToolNames;
|
|
60
|
+
}
|
|
61
|
+
/** Every host-tools entry point takes this one bag. */
|
|
62
|
+
export interface AgentPluginHostToolPorts {
|
|
63
|
+
readonly lifecycle: HostToolsLifecyclePort;
|
|
64
|
+
readonly activations: HostToolsActivationsPort;
|
|
65
|
+
readonly layout: HostToolsLayoutPort;
|
|
66
|
+
readonly memory: HostToolsMemoryPort;
|
|
67
|
+
readonly permissions: HostToolPermissions;
|
|
68
|
+
/** One `key: value` reader over a markdown document's frontmatter block. */
|
|
69
|
+
readonly readFrontmatterField: (required: {
|
|
70
|
+
readonly markdown: string;
|
|
71
|
+
readonly key: string;
|
|
72
|
+
}) => string | undefined;
|
|
73
|
+
/** Host tool vocabulary and reviewed action policy, passed to `buildDomainRegistrations`. */
|
|
74
|
+
readonly metadata?: ToolMetadataById;
|
|
75
|
+
readonly messages?: HostToolMessages;
|
|
76
|
+
}
|
|
77
|
+
/** The approval families these tools register under. */
|
|
78
|
+
export type HostToolApprovalFamily = 'installed-guidance' | 'plugin-memory-read' | 'plugin-memory-write';
|
|
79
|
+
/** Wraps one registration in the host's approval policy for its family. */
|
|
80
|
+
export type ApplyHostToolApprovalPolicy = (required: {
|
|
81
|
+
registration: ToolRegistration;
|
|
82
|
+
family: HostToolApprovalFamily;
|
|
83
|
+
}, optional?: Record<string, never>) => ToolRegistration;
|
|
84
|
+
/** Throws unless the principal holds `permission` in the workspace. */
|
|
85
|
+
export type RequireHostToolPermission = (required: {
|
|
86
|
+
workspaceId: string;
|
|
87
|
+
principalId: string;
|
|
88
|
+
permission: string;
|
|
89
|
+
}, optional: {
|
|
90
|
+
entityType: string;
|
|
91
|
+
entityId: string;
|
|
92
|
+
}) => Promise<void>;
|
|
93
|
+
/** The retained host contributor transport these tools are given; they emit nothing through it. */
|
|
94
|
+
export interface HostToolSurfaces {
|
|
95
|
+
readonly surfaceExchanges: object;
|
|
96
|
+
}
|
|
97
|
+
/** A plugin tool's answer, as the host overlay receives it. */
|
|
98
|
+
export interface PluginToolGuidance {
|
|
99
|
+
readonly pluginId: string;
|
|
100
|
+
readonly guidance: string;
|
|
101
|
+
readonly files?: readonly string[];
|
|
102
|
+
readonly note?: string;
|
|
103
|
+
}
|
|
104
|
+
/** The host's per-plugin overlay: its guidance first, and its own `host/` files. */
|
|
105
|
+
export interface HostGuidancePort {
|
|
106
|
+
isFileRequest(required: {
|
|
107
|
+
readonly file: string;
|
|
108
|
+
}): boolean;
|
|
109
|
+
deliver(required: {
|
|
110
|
+
result: PluginToolGuidance;
|
|
111
|
+
file?: string;
|
|
112
|
+
}, optional: {
|
|
113
|
+
notice?: string;
|
|
114
|
+
}): Promise<{
|
|
115
|
+
guidance: string;
|
|
116
|
+
files: string[];
|
|
117
|
+
note?: string;
|
|
118
|
+
}>;
|
|
119
|
+
}
|
|
120
|
+
export {};
|
|
121
|
+
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `provider_status` (2026-10-25): a read-only, vendor-neutral answer to "is my analytics /
|
|
3
|
+
* error tracking / tracing provider set up?" for every provider plugin (a plugin whose manifest
|
|
4
|
+
* declares provider settings). Presence only: configured or not, which required fields are missing,
|
|
5
|
+
* where it is saved, whether the plugin is on, its quarantine reason if the host quarantined it.
|
|
6
|
+
* Never a setting value: hosts and endpoints can carry private tenant URLs, and secrets never leave
|
|
7
|
+
* the server. Agent plugins (content/agent-plugins/<vendor>/) name the vendor; this tool names none.
|
|
8
|
+
*/
|
|
9
|
+
import { type AgentToolDefinition, type DerivedRiskByToolId, type ToolExecutionContext, type ToolRegistration } from "@jini-ai/core";
|
|
10
|
+
import type { ToolMetadataById } from '@jini-ai/core';
|
|
11
|
+
export declare const PROVIDER_STATUS_TOOL_ID = "provider_status";
|
|
12
|
+
/** @agent-note This projection contains manifest display metadata only. The host must never put saved setting values in it. */
|
|
13
|
+
export interface ProviderSettingFieldProjection {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly label: string;
|
|
16
|
+
readonly secret?: boolean;
|
|
17
|
+
readonly required?: boolean;
|
|
18
|
+
readonly requiredUnless?: {
|
|
19
|
+
readonly field: string;
|
|
20
|
+
readonly equals: string;
|
|
21
|
+
readonly orPresent?: string;
|
|
22
|
+
readonly headerNames?: readonly string[];
|
|
23
|
+
};
|
|
24
|
+
readonly requiredWhen?: {
|
|
25
|
+
readonly field: string;
|
|
26
|
+
readonly in: readonly string[];
|
|
27
|
+
};
|
|
28
|
+
readonly hint?: string;
|
|
29
|
+
readonly default?: string;
|
|
30
|
+
readonly options?: readonly {
|
|
31
|
+
readonly value: string;
|
|
32
|
+
readonly label: string;
|
|
33
|
+
}[];
|
|
34
|
+
readonly allowCustom?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** One provider plugin's status row; the composition root fills it from discovery, activation and the settings store. */
|
|
37
|
+
export interface ProviderStatusRow {
|
|
38
|
+
readonly pluginId: string;
|
|
39
|
+
/** Manifest declarations only; never saved values. */
|
|
40
|
+
readonly fields?: readonly ProviderSettingFieldProjection[];
|
|
41
|
+
readonly settingsCard?: {
|
|
42
|
+
readonly tool: string;
|
|
43
|
+
readonly input: {
|
|
44
|
+
readonly kind: "provider-settings";
|
|
45
|
+
readonly target: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
readonly enabled: boolean;
|
|
49
|
+
readonly configured: boolean;
|
|
50
|
+
readonly missing: readonly string[];
|
|
51
|
+
readonly store: "project" | "site";
|
|
52
|
+
readonly appliesAt: "now" | "restart" | "failed";
|
|
53
|
+
readonly keyId?: string;
|
|
54
|
+
readonly usedByThisSite: boolean;
|
|
55
|
+
readonly usedBy: readonly string[];
|
|
56
|
+
readonly unreadable?: true;
|
|
57
|
+
readonly quarantine?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ProviderStatusPorts {
|
|
60
|
+
/** Every discovered plugin that declares provider settings; presence only. */
|
|
61
|
+
readonly list: (required: Record<string, never>) => Promise<readonly ProviderStatusRow[]>;
|
|
62
|
+
readonly authorize: (ctx: ToolExecutionContext) => Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
/** @agent-note Product vocabulary and navigation belong to the host, including descriptions and refusal text. */
|
|
65
|
+
export interface ProviderStatusMessages {
|
|
66
|
+
readonly description: string;
|
|
67
|
+
readonly pluginIdDescription: string;
|
|
68
|
+
readonly unknownPlugin: (required: {
|
|
69
|
+
pluginId: unknown;
|
|
70
|
+
}) => string;
|
|
71
|
+
readonly unexpectedInput: string;
|
|
72
|
+
}
|
|
73
|
+
/** @agent-note The host supplies the permission name, reviewed metadata and an authorization port from the same host instance. */
|
|
74
|
+
export declare function createProviderStatusTools({ metadata: toolMetadata, authorization, messages, catalogModule }: {
|
|
75
|
+
metadata: ToolMetadataById;
|
|
76
|
+
authorization: {
|
|
77
|
+
permission: string;
|
|
78
|
+
};
|
|
79
|
+
messages: ProviderStatusMessages;
|
|
80
|
+
catalogModule: string;
|
|
81
|
+
}, _optional?: Record<string, never>): {
|
|
82
|
+
providerStatusAgentToolCatalog: AgentToolDefinition[];
|
|
83
|
+
providerStatusDerivedRisk: DerivedRiskByToolId;
|
|
84
|
+
buildProviderStatusRegistrations: ({ ports }: {
|
|
85
|
+
ports: ProviderStatusPorts;
|
|
86
|
+
}, _optional?: {}) => ToolRegistration[];
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=provider-status-tool.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `provider_status` (2026-10-25): a read-only, vendor-neutral answer to "is my analytics /
|
|
3
|
+
* error tracking / tracing provider set up?" for every provider plugin (a plugin whose manifest
|
|
4
|
+
* declares provider settings). Presence only: configured or not, which required fields are missing,
|
|
5
|
+
* where it is saved, whether the plugin is on, its quarantine reason if the host quarantined it.
|
|
6
|
+
* Never a setting value: hosts and endpoints can carry private tenant URLs, and secrets never leave
|
|
7
|
+
* the server. Agent plugins (content/agent-plugins/<vendor>/) name the vendor; this tool names none.
|
|
8
|
+
*/
|
|
9
|
+
import { buildDomainRegistrations, indexCatalogById, requireInputRecord, ToolInputError } from "@jini-ai/core";
|
|
10
|
+
export const PROVIDER_STATUS_TOOL_ID = "provider_status";
|
|
11
|
+
/** @agent-note The host supplies the permission name, reviewed metadata and an authorization port from the same host instance. */
|
|
12
|
+
export function createProviderStatusTools({ metadata: toolMetadata, authorization, messages, catalogModule }, _optional = {}) {
|
|
13
|
+
const providerStatusAgentToolCatalog = [{
|
|
14
|
+
name: PROVIDER_STATUS_TOOL_ID,
|
|
15
|
+
description: messages.description,
|
|
16
|
+
sideEffects: "none",
|
|
17
|
+
authorization: { permission: authorization.permission },
|
|
18
|
+
inputSchema: { type: "object", additionalProperties: false, properties: { pluginId: { type: "string", minLength: 1, description: messages.pluginIdDescription } } },
|
|
19
|
+
}];
|
|
20
|
+
const providerStatusDerivedRisk = new Map([[PROVIDER_STATUS_TOOL_ID, "none"]]);
|
|
21
|
+
/** Optional pluginId filter; an unknown id is refused so the model never reads "not configured" for a typo. */
|
|
22
|
+
function selectRows({ rows, pluginId }) {
|
|
23
|
+
if (pluginId === undefined)
|
|
24
|
+
return { providers: rows };
|
|
25
|
+
const row = rows.find((candidate) => candidate.pluginId === pluginId);
|
|
26
|
+
if (!row)
|
|
27
|
+
throw new ToolInputError({ message: messages.unknownPlugin({ pluginId }) });
|
|
28
|
+
return { providers: [row] };
|
|
29
|
+
}
|
|
30
|
+
/** @complexity O(p) provider plugins; one settings read each in the port. */
|
|
31
|
+
function buildProviderStatusRegistrations({ ports }, _optional = {}) {
|
|
32
|
+
return buildDomainRegistrations({ metadata: toolMetadata, domain: "provider-status",
|
|
33
|
+
catalogModule, catalog: indexCatalogById({ catalog: providerStatusAgentToolCatalog }), derivedRisk: providerStatusDerivedRisk,
|
|
34
|
+
handlers: { [PROVIDER_STATUS_TOOL_ID]: async (ctx) => {
|
|
35
|
+
const input = ctx.input === undefined ? {} : requireInputRecord({ input: ctx.input });
|
|
36
|
+
if (Object.keys(input).some((key) => key !== "pluginId"))
|
|
37
|
+
throw new ToolInputError({ message: messages.unexpectedInput });
|
|
38
|
+
await ports.authorize(ctx);
|
|
39
|
+
return selectRows({ rows: await ports.list({}), pluginId: input.pluginId });
|
|
40
|
+
} },
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return { providerStatusAgentToolCatalog, providerStatusDerivedRisk, buildProviderStatusRegistrations };
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=provider-status-tool.js.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type AgentToolSideEffect, type ToolRegistration, type AgentToolDefinition } from "@jini-ai/core";
|
|
2
|
+
import type { AgentPluginSearchCandidate } from "../search.js";
|
|
3
|
+
import { type PluginMaturity } from "./identity.js";
|
|
4
|
+
import type { AgentPluginHostToolPorts, HostToolMessages } from "./ports.js";
|
|
5
|
+
/** The narrow slice of the route-deps bag this tool's handler reads — only a workspace id, since
|
|
6
|
+
* everything else it needs (`listInstalledPlugins`, `readAgentPluginActivations`) is resolved from
|
|
7
|
+
* that id alone via `layout.ts`. Declared structurally, mirroring `PluginsToolDeps`'s own shape, so
|
|
8
|
+
* `assistant/tool-registrations.ts` can fold this into `AssistantToolRegistryDeps` without this
|
|
9
|
+
* domain importing that file's god type back. */
|
|
10
|
+
export interface AgentPluginSearchToolDeps {
|
|
11
|
+
readonly workspaceId: string;
|
|
12
|
+
readonly ports: AgentPluginHostToolPorts;
|
|
13
|
+
}
|
|
14
|
+
/** This tool's one-entry catalog, exported (not inlined into {@link buildAgentPluginSearchRegistrations})
|
|
15
|
+
* so `assistant/__tests__/tool-registrations.contracts.test.ts`'s `CATALOGS_BY_DOMAIN` — which
|
|
16
|
+
* cross-checks every wired domain's published schema/risk/actor-class contract against this SAME
|
|
17
|
+
* source of truth — can import it the same way it imports every sibling domain's `<domain>AgentToolCatalog`. */
|
|
18
|
+
export declare function agentPluginSearchToolCatalog(required: {
|
|
19
|
+
readonly permission: string;
|
|
20
|
+
}, optional?: {
|
|
21
|
+
readonly messages?: HostToolMessages | undefined;
|
|
22
|
+
}): AgentToolDefinition[];
|
|
23
|
+
/**
|
|
24
|
+
* Resolves every installed plugin in one workspace into a search-ready {@link AgentPluginSearchCandidate}.
|
|
25
|
+
*
|
|
26
|
+
* UNLIKE {@link loadInstalledAgentPluginToolSources} (the dynamic per-plugin tool loader above), this
|
|
27
|
+
* INCLUDES disabled plugins. Search exists so the assistant can find — and then a human can decide
|
|
28
|
+
* whether to turn on — an installed-but-inactive plugin; filtering those out here would make a
|
|
29
|
+
* disabled plugin permanently undiscoverable through the one tool that could report it exists.
|
|
30
|
+
*
|
|
31
|
+
* UNLIKE that same loader's {@link assertSingleDigestPerPlugin}, a plugin id installed under more than
|
|
32
|
+
* one digest is NOT fatal here: this silently keeps the first-encountered digest for that id rather
|
|
33
|
+
* than throwing, so every OTHER, unambiguous plugin in the workspace stays discoverable. The ambiguity
|
|
34
|
+
* itself is still a loud, operator-actionable error the moment anything tries to actually USE the
|
|
35
|
+
* plugin (`resolveOnePluginRef`/the dynamic-tool loader both refuse outright) — duplicating that
|
|
36
|
+
* refusal in a read-only search tool would only make discovery unavailable too, for no safety benefit.
|
|
37
|
+
*
|
|
38
|
+
* @complexity O(p * s) in installed-plugin count times average skills-per-plugin — the same shape
|
|
39
|
+
* {@link loadInstalledAgentPluginToolSources} already accepts for this identical catalog, plus one
|
|
40
|
+
* `mcp.json` read per plugin.
|
|
41
|
+
*
|
|
42
|
+
* Also consumed by the admin installed-plugin listing:
|
|
43
|
+
* `server/inbound/admin-http/routes/agent-plugins/list.ts` — the admin UI's read of the SAME
|
|
44
|
+
* installed-plugin state this tool searches — reuses this loader rather than re-deriving it, so
|
|
45
|
+
* "what plugins are installed" has one source of truth with two consumers (a tool and the admin
|
|
46
|
+
* page), matching this file's own `listInstalledPlugins` precedent above.
|
|
47
|
+
*/
|
|
48
|
+
/** A search candidate whose identity was read from the installed `plugin.json`: `readPluginIdentity`
|
|
49
|
+
* always yields an `id` and a `provides` list, so this loader's callers never need a fallback for
|
|
50
|
+
* either (the shared `AgentPluginSearchCandidate` type leaves both optional for other producers). */
|
|
51
|
+
export type IdentifiedAgentPluginSearchCandidate = AgentPluginSearchCandidate & {
|
|
52
|
+
readonly id: string;
|
|
53
|
+
readonly provides: readonly string[];
|
|
54
|
+
readonly maturity?: PluginMaturity;
|
|
55
|
+
readonly providerPlugin?: string;
|
|
56
|
+
};
|
|
57
|
+
export declare function loadAgentPluginSearchCandidates(ctx: AgentPluginSearchToolDeps, _optional?: {}): Promise<readonly IdentifiedAgentPluginSearchCandidate[]>;
|
|
58
|
+
/** This tool's own risk classification: a pure read of already-installed, already-validated local
|
|
59
|
+
* content, same as every other read-only tool this domain and its siblings (`plugins_list`,
|
|
60
|
+
* `search_components`) already declare `"none"` for. */
|
|
61
|
+
export declare const agentPluginSearchDerivedRisk: ReadonlyMap<string, AgentToolSideEffect>;
|
|
62
|
+
/**
|
|
63
|
+
* Builds the `search_agent_plugin_local` registration — pure catalog/schema construction plus one
|
|
64
|
+
* handler closure; the actual disk read happens only when the handler is invoked, matching
|
|
65
|
+
* `plugins_list`'s identical "read fresh on every call" shape.
|
|
66
|
+
*
|
|
67
|
+
* @param routeDeps Workspace and the host-tool ports.
|
|
68
|
+
* @returns One registration; its handler validates input and returns a page without host paths.
|
|
69
|
+
* @example buildAgentPluginSearchRegistrations({ workspaceId, ports });
|
|
70
|
+
* @complexity O(1) to build; see {@link loadAgentPluginSearchCandidates} and
|
|
71
|
+
* {@link selectAgentPluginSearchCandidates} for the handler's per-call cost.
|
|
72
|
+
*/
|
|
73
|
+
export declare function buildAgentPluginSearchRegistrations(routeDeps: AgentPluginSearchToolDeps, _optional?: Record<string, never>): ToolRegistration[];
|
|
74
|
+
//# sourceMappingURL=search-tool.d.ts.map
|