@jini-ai/agent-plugins 0.7.3-next.1 → 0.7.3-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +22 -4
  3. package/calendly/README.md +29 -0
  4. package/calendly/mcp.json +1 -1
  5. package/cloudflare/lib/assets.mjs +1 -1
  6. package/cloudflare/lib/cms-forms.mjs +1 -1
  7. package/core/persistent-state.d.ts +4 -1
  8. package/core/persistent-state.js +55 -21
  9. package/dist/admin-surfaces/callback-field-inbox.d.ts +1 -6
  10. package/dist/admin-surfaces/connections/connections.d.ts +2 -6
  11. package/dist/admin-surfaces/connections/index.d.ts +3 -2
  12. package/dist/admin-surfaces/index.d.ts +3 -1
  13. package/dist/connect/access-token-tool.d.ts +1 -1
  14. package/dist/connect/access-token-tool.js +1 -1
  15. package/dist/connect/catalog.d.ts +26 -0
  16. package/dist/connect/catalog.js +42 -0
  17. package/dist/connect/connect-tool.d.ts +2 -294
  18. package/dist/connect/connect-tool.js +2 -53
  19. package/dist/connect/contracts.d.ts +257 -0
  20. package/dist/connect/contracts.js +2 -0
  21. package/dist/connect/credential-cards.d.ts +2 -0
  22. package/dist/connect/credential-cards.js +7 -4
  23. package/dist/connect/grant-signed-in-defaults.js +1 -1
  24. package/dist/connect/host-deps.d.ts +32 -0
  25. package/dist/connect/host-deps.js +35 -0
  26. package/dist/connect/import-access-token.js +1 -1
  27. package/dist/connect/index.d.ts +7 -2
  28. package/dist/connect/index.js +5 -2
  29. package/dist/connect/installed-plugin.d.ts +28 -0
  30. package/dist/connect/installed-plugin.js +19 -0
  31. package/dist/connect/new-site-agent-plugin-tokens.d.ts +88 -0
  32. package/dist/connect/new-site-agent-plugin-tokens.js +107 -0
  33. package/dist/connect/plugin-host/index.d.ts +2 -2
  34. package/dist/connect/plugin-host/index.js +19 -10
  35. package/dist/connect/token-sign-in.d.ts +1 -14
  36. package/dist/connect/token-sign-in.js +4 -23
  37. package/dist/core/export-props.d.ts +10 -0
  38. package/dist/core/export-props.js +31 -0
  39. package/dist/core/folder-zip-error.d.ts +5 -0
  40. package/dist/core/folder-zip-error.js +8 -0
  41. package/dist/core/host-incompatible-error.d.ts +8 -0
  42. package/dist/core/host-incompatible-error.js +9 -0
  43. package/dist/core/identity-namespace.d.ts +27 -16
  44. package/dist/core/identity-namespace.js +25 -22
  45. package/dist/core/plugin-display-name.d.ts +7 -0
  46. package/dist/core/plugin-display-name.js +11 -0
  47. package/dist/core/provider-plugin-link.d.ts +7 -0
  48. package/dist/core/provider-plugin-link.js +5 -0
  49. package/dist/{connect → core}/token-map.d.ts +11 -1
  50. package/dist/{connect → core}/token-map.js +15 -0
  51. package/dist/core/token-sign-in-list.d.ts +18 -0
  52. package/dist/core/token-sign-in-list.js +23 -0
  53. package/dist/core/update-error.d.ts +8 -0
  54. package/dist/core/update-error.js +9 -0
  55. package/dist/{lifecycle → core}/update-plan.d.ts +1 -1
  56. package/dist/ffmpeg-transcode/adapter.d.ts +74 -0
  57. package/dist/ffmpeg-transcode/adapter.js +155 -0
  58. package/dist/folder-zip-node.d.ts +2 -1
  59. package/dist/folder-zip-node.js +6 -5
  60. package/dist/folder-zip.d.ts +0 -4
  61. package/dist/folder-zip.js +1 -7
  62. package/dist/index.d.ts +3 -1
  63. package/dist/lifecycle/activation.d.ts +39 -3
  64. package/dist/lifecycle/activation.js +467 -418
  65. package/dist/lifecycle/automatic-use-offer.d.ts +62 -0
  66. package/dist/lifecycle/automatic-use-offer.js +52 -0
  67. package/dist/lifecycle/automatic-use.d.ts +33 -1
  68. package/dist/lifecycle/automatic-use.js +157 -38
  69. package/dist/lifecycle/bundled-source-archive.d.ts +1 -1
  70. package/dist/lifecycle/capability-projection.d.ts +0 -1
  71. package/dist/lifecycle/capability-projection.js +92 -23
  72. package/dist/lifecycle/compatibility-metadata.d.ts +1 -0
  73. package/dist/lifecycle/compatibility-metadata.js +6 -1
  74. package/dist/lifecycle/compatibility.d.ts +1 -8
  75. package/dist/lifecycle/compatibility.js +1 -8
  76. package/dist/lifecycle/credential-card-metadata.d.ts +2 -2
  77. package/dist/lifecycle/exports.d.ts +2 -45
  78. package/dist/lifecycle/exports.js +1 -30
  79. package/dist/lifecycle/host-tools/identity.d.ts +5 -4
  80. package/dist/lifecycle/host-tools/identity.js +5 -5
  81. package/dist/lifecycle/host-tools/ports.d.ts +10 -1
  82. package/dist/lifecycle/host-tools/search-tool.d.ts +4 -2
  83. package/dist/lifecycle/host-tools/search-tool.js +19 -8
  84. package/dist/lifecycle/host-tools/skill-tool.js +1 -1
  85. package/dist/lifecycle/index.d.ts +20 -17
  86. package/dist/lifecycle/index.js +5 -4
  87. package/dist/lifecycle/install-from-url.d.ts +1 -2
  88. package/dist/lifecycle/install.d.ts +4 -34
  89. package/dist/lifecycle/install.js +3 -3
  90. package/dist/lifecycle/installed-package-index.d.ts +1 -1
  91. package/dist/lifecycle/installed-package-index.js +4 -4
  92. package/dist/lifecycle/layout.d.ts +21 -25
  93. package/dist/lifecycle/layout.js +79 -0
  94. package/dist/lifecycle/manifest.d.ts +10 -7
  95. package/dist/lifecycle/manifest.js +20 -15
  96. package/dist/lifecycle/mcp-provisioning.d.ts +1 -1
  97. package/dist/lifecycle/metadata.d.ts +6 -3
  98. package/dist/lifecycle/metadata.js +2 -1
  99. package/dist/lifecycle/package-paths.js +59 -56
  100. package/dist/lifecycle/persistent-state.d.ts +10 -1
  101. package/dist/lifecycle/persistent-state.js +4 -2
  102. package/dist/lifecycle/ports.d.ts +18 -6
  103. package/dist/lifecycle/resolve-agent-plugin-refs.d.ts +2 -14
  104. package/dist/lifecycle/retire-bundled.d.ts +1 -1
  105. package/dist/lifecycle/search-projection.d.ts +3 -1
  106. package/dist/lifecycle/search-projection.js +7 -3
  107. package/dist/lifecycle/search.d.ts +1 -0
  108. package/dist/lifecycle/seed-bundled.d.ts +86 -1
  109. package/dist/lifecycle/seed-bundled.js +48 -84
  110. package/dist/lifecycle/set-enabled.d.ts +1 -13
  111. package/dist/lifecycle/set-enabled.js +11 -7
  112. package/dist/lifecycle/trusted-plugin-files.d.ts +1 -1
  113. package/dist/lifecycle/trusted-plugin-files.js +33 -30
  114. package/dist/lifecycle/types.d.ts +13 -34
  115. package/dist/lifecycle/uninstall.d.ts +1 -33
  116. package/dist/lifecycle/update-store.d.ts +0 -7
  117. package/dist/lifecycle/update-store.js +1 -8
  118. package/dist/lifecycle/update.d.ts +1 -1
  119. package/dist/lifecycle/update.js +60 -10
  120. package/dist/lifecycle/yauzl-archive-reader.d.ts +7 -2
  121. package/dist/lifecycle/yauzl-archive-reader.js +11 -6
  122. package/dist/manifest.d.ts +4 -8
  123. package/dist/react/AgentPluginDetailsModal.d.ts +187 -0
  124. package/dist/react/AgentPluginDetailsModal.js +29 -0
  125. package/dist/react/agent-plugin-install-port.d.ts +24 -0
  126. package/dist/react/agent-plugin-install-port.js +15 -0
  127. package/dist/react/installed-skills-composer-source.d.ts +60 -0
  128. package/dist/react/installed-skills-composer-source.js +111 -0
  129. package/dist/react/use-agent-plugins.hooks.d.ts +211 -0
  130. package/dist/react/use-agent-plugins.hooks.js +128 -0
  131. package/dist/site/activation-effects.d.ts +17 -0
  132. package/dist/site/activation-effects.js +31 -0
  133. package/dist/site/admin-surfaces/capabilities.d.ts +29 -0
  134. package/dist/site/admin-surfaces/capabilities.js +30 -0
  135. package/dist/site/admin-surfaces/delivery-bindings.d.ts +81 -0
  136. package/dist/site/admin-surfaces/delivery-bindings.js +161 -0
  137. package/dist/site/admin-surfaces/forms.d.ts +28 -0
  138. package/dist/site/admin-surfaces/forms.js +29 -0
  139. package/dist/site/admin-surfaces/handlers.d.ts +61 -0
  140. package/dist/site/admin-surfaces/handlers.js +35 -0
  141. package/dist/site/admin-surfaces/public-config.d.ts +12 -0
  142. package/dist/site/admin-surfaces/public-config.js +28 -0
  143. package/dist/site/analytics-provider-registry.d.ts +87 -0
  144. package/dist/site/analytics-provider-registry.js +87 -0
  145. package/dist/site/archive-reader-abi.d.ts +35 -0
  146. package/dist/site/archive-reader-abi.js +25 -0
  147. package/dist/site/auth-schemes.d.ts +110 -0
  148. package/dist/site/auth-schemes.js +119 -0
  149. package/dist/site/automatic-agent-plugins.d.ts +200 -0
  150. package/dist/site/automatic-agent-plugins.js +277 -0
  151. package/dist/site/bundled-contribution-sources.d.ts +24 -0
  152. package/dist/site/bundled-contribution-sources.js +17 -0
  153. package/dist/site/bundled-id-upgrade.d.ts +115 -0
  154. package/dist/site/bundled-id-upgrade.js +169 -0
  155. package/dist/site/customize-tool.d.ts +39 -0
  156. package/dist/site/customize-tool.js +31 -0
  157. package/dist/site/deploy-split-activation.d.ts +28 -0
  158. package/dist/site/deploy-split-activation.js +21 -0
  159. package/dist/site/exports/diagnostics.d.ts +37 -0
  160. package/dist/site/exports/diagnostics.js +55 -0
  161. package/dist/site/exports/runtime.d.ts +54 -0
  162. package/dist/site/exports/runtime.js +196 -0
  163. package/dist/site/exports/source.d.ts +42 -0
  164. package/dist/site/exports/source.js +58 -0
  165. package/dist/site/host-plugin-guidance.d.ts +137 -0
  166. package/dist/site/host-plugin-guidance.js +223 -0
  167. package/dist/site/host-signals.d.ts +78 -0
  168. package/dist/site/host-signals.js +83 -0
  169. package/dist/site/install-tool.d.ts +69 -0
  170. package/dist/site/install-tool.js +192 -0
  171. package/dist/site/install-upload.d.ts +175 -0
  172. package/dist/site/install-upload.js +324 -0
  173. package/dist/site/memory-i18n.d.ts +5 -0
  174. package/dist/site/memory-i18n.js +176 -0
  175. package/dist/site/memory.d.ts +80 -0
  176. package/dist/site/memory.js +83 -0
  177. package/dist/site/plugin-memory.d.ts +80 -0
  178. package/dist/site/plugin-memory.js +86 -0
  179. package/dist/site/provider-plugin-link.d.ts +112 -0
  180. package/dist/site/provider-plugin-link.js +100 -0
  181. package/dist/site/retired-plugin-tool-aliases.d.ts +40 -0
  182. package/dist/site/retired-plugin-tool-aliases.js +41 -0
  183. package/dist/site/service-ports.d.ts +108 -0
  184. package/dist/site/service-ports.js +2 -0
  185. package/dist/site/set-enabled.d.ts +80 -0
  186. package/dist/site/set-enabled.js +42 -0
  187. package/dist/site/soon-lock.d.ts +83 -0
  188. package/dist/site/soon-lock.js +78 -0
  189. package/dist/site/supersession.d.ts +61 -0
  190. package/dist/site/supersession.js +122 -0
  191. package/dist/site/uninstall-tool.d.ts +136 -0
  192. package/dist/site/uninstall-tool.js +203 -0
  193. package/dist/site/update-effects.d.ts +47 -0
  194. package/dist/site/update-effects.js +49 -0
  195. package/ffmpeg-transcode/plugin.json +16 -0
  196. package/github/source-control/backup-push.mjs +66 -46
  197. package/github/source-control/commit-site.mjs +124 -67
  198. package/github/source-control/write-files.mjs +86 -53
  199. package/github-pages/targets/github-pages.mjs +294 -233
  200. package/google-workspace/form-destinations/mapping.mjs +15 -7
  201. package/google-workspace/form-destinations/sheets.mjs +4 -2
  202. package/google-workspace/plugin.json +1 -0
  203. package/kuinetic/CHANGELOG.md +4 -0
  204. package/kuinetic/plugin.json +4 -1
  205. package/kuinetic/skills/kuinetic/SKILL.md +1 -2
  206. package/package.json +297 -20
  207. package/persistent-state.d.ts +4 -1
  208. package/resend/adapters/resend.mjs +5 -2
  209. package/resend/plugin.json +1 -1
  210. package/s3-compatible/jini-deploy-targets.json +1 -1
  211. package/s3-compatible/object-stores/s3-compatible.mjs +27 -4
  212. package/s3-compatible/targets/s3-compatible.mjs +3 -3
  213. package/site-import/plugin.json +3 -3
  214. package/site-import/skills/site-import/SKILL.md +62 -54
  215. package/site-import/skills/site-import/references/content-mapping.md +26 -20
  216. package/slide-design/plugin.json +1 -1
  217. package/slide-design/skills/slide-design/SKILL.md +8 -2
  218. package/ui-ux-design/CHANGELOG.md +6 -0
  219. package/ui-ux-design/plugin.json +1 -1
  220. package/ui-ux-design/skills/gstack-design/SKILL.md +6 -6
  221. package/ui-ux-design/skills/ui-ux-design/SKILL.md +3 -2
  222. package/ui-ux-design/skills/ui-ux-design/references/chrome-mobile-test-matrix.md +14 -12
  223. package/ui-ux-design/skills/ui-ux-design/references/ui-loop.md +16 -17
  224. package/vercel/NOTES.md +2 -1
  225. package/vercel/object-stores/vercel-blob.mjs +3 -4
  226. package/vercel/targets/vercel.mjs +425 -351
  227. package/core/commerce-server.d.ts +0 -2
  228. package/core/commerce-server.mjs +0 -2
  229. package/dist/admin-surfaces/connections/ports.d.ts +0 -110
  230. package/dist/admin-surfaces/connections/ports.js +0 -2
  231. /package/dist/{lifecycle → core}/install-errors.d.ts +0 -0
  232. /package/dist/{lifecycle → core}/install-errors.js +0 -0
  233. /package/dist/{lifecycle → core}/update-plan.js +0 -0
@@ -1,7 +1,10 @@
1
- export * from './update-plan.js';
2
- export { AgentPluginUpdateError } from './update-store.js';
1
+ /** Deprecated re-export: import these from `@jini-ai/core/contracts/site/agent-plugins-lifecycle`; removed at the next major. */
2
+ export type { AgentPluginArchiveEntry, AgentPluginArchiveReaderPort, AgentPluginArchiveReaderPort as ArchiveReaderPort, InstalledAgentPluginSkill, InstalledAgentPlugin, AgentPluginLayout, AgentPluginLayoutPort, AgentPluginWorkspaceLayout, SetAgentPluginEnabledInput, SetAgentPluginEnabledResult, UninstallAgentPluginRequired, UninstallAgentPluginOptional, UninstallAgentPluginResult, AgentPluginUninstallPreview } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
3
+ export * from '../core/update-plan.js';
4
+ export { AgentPluginUpdateError } from '../core/update-error.js';
3
5
  export type { UpdateAgentPluginRequired, UpdateAgentPluginResult } from './update.js';
4
6
  export * from './compatibility.js';
7
+ export { AgentPluginHostIncompatibleError } from '../core/host-incompatible-error.js';
5
8
  export * from './automatic-use.js';
6
9
  export * from './bundled-file-policy.js';
7
10
  import { maxAgentPluginArchiveBytes } from './fetch-archive.js';
@@ -22,18 +25,18 @@ export * from './contribution-loader.js';
22
25
  export * from './provider-contribution.js';
23
26
  export { createAgentPluginActivations, ACTIVATIONS_FILENAME, ACTIVATIONS_LOCK_FILENAME, AgentPluginActivationsBusyError, AgentPluginActivationsUnreadableError } from './activation.js';
24
27
  export { BUNDLED_DIGESTS_FILENAME } from './bundled-digests.js';
25
- export { AgentPluginInstallError } from './install.js';
28
+ export { AgentPluginInstallError } from '../core/install-errors.js';
26
29
  export { PackagePathViolation } from './package-paths.js';
27
30
  export { AgentPluginNotInstalledError } from './set-enabled.js';
28
31
  export { AgentPluginNotFoundError, AgentPluginNotUninstallableError, AgentPluginChangedSincePreviewError } from './uninstall.js';
29
32
  export type { AgentPluginOrigin, AgentPluginActivationRecord, AgentPluginActivations, AgentPluginActivationVerdict, SetAgentPluginActivationRequired, SetAgentPluginActivationOptional, BundledAgentPluginEnableOutcome, DeleteAgentPluginActivationRequired } from './activation.js';
30
33
  export type { BundledAgentPluginDigests, SeededBundledAgentPluginDigest, InstalledDigestIdentity } from './bundled-digests.js';
31
34
  export type { PackedAgentPluginArchive, PackAgentPluginDirectoryOptional } from './bundled-source-archive.js';
32
- export type { AgentPluginArchiveEntry, AgentPluginArchiveReaderPort, AgentPluginArchiveReaderPort as ArchiveReaderPort, AgentPluginInstallErrorCode, InstalledAgentPluginSkill, InstalledAgentPlugin, InstallAgentPluginRequired, InstallAgentPluginOptional } from './install.js';
35
+ export type { InstallAgentPluginRequired, InstallAgentPluginOptional } from './install.js';
36
+ export type { AgentPluginInstallErrorCode } from '../core/install-errors.js';
33
37
  export type { AgentPluginIntegrity, InstallAgentPluginFromUrlRequired, InstallAgentPluginFromUrlOptional, InstalledAgentPluginFromUrl } from './install-from-url.js';
34
38
  export type { AgentPluginDeliveryMode, AgentPluginSkillRequest, ResolveAgentPluginRefsResult } from './resolve-agent-plugin-refs.js';
35
- export type { SetAgentPluginEnabledInput, SetAgentPluginEnabledResult } from './set-enabled.js';
36
- export type { UninstallAgentPluginRequired, UninstallAgentPluginOptional, UninstallAgentPluginResult, AgentPluginUninstallPreview, StagedTree } from './uninstall.js';
39
+ export type { StagedTree } from './uninstall.js';
37
40
  export type { TrustedPluginPackage, TrustedPluginPackagesQuery, TrustedPluginVerdict } from './trusted-plugin-files.js';
38
41
  export type { AgentPluginSearchSkill, AgentPluginSearchCandidate, AgentPluginSearchMatch } from './search.js';
39
42
  /** One host context owns queues and effects. Keep this object and its ports stable for its lifetime.
@@ -52,11 +55,11 @@ export declare function createAgentPluginLifecycle(required: AgentPluginLifecycl
52
55
  indexInstalledRoot: (input: {
53
56
  readonly packageRoot: string;
54
57
  readonly archiveDigest: string;
55
- }) => Promise<import("./types.js").InstalledAgentPlugin>;
58
+ }) => Promise<import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").InstalledAgentPlugin>;
56
59
  packAgentPluginDirectory: (input: {
57
60
  readonly sourceDir: string;
58
61
  }, optional?: PackAgentPluginDirectoryOptional) => Promise<import("./bundled-source-archive.js").PackedAgentPluginArchive>;
59
- createBundledSourceArchiveReader: (_input: Record<string, never>) => import("./install.js").AgentPluginArchiveReaderPort;
62
+ createBundledSourceArchiveReader: (_input: Record<string, never>) => import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").AgentPluginArchiveReaderPort;
60
63
  preferBundledAgentPluginDigests: <T extends InstalledDigestIdentity>(input: {
61
64
  readonly installed: readonly T[];
62
65
  readonly bundled: Parameters<(<T_1 extends InstalledDigestIdentity>(installed: readonly T_1[], bundled: import("./bundled-digests.js").BundledAgentPluginDigests) => readonly T_1[])>[1];
@@ -70,7 +73,7 @@ export declare function createAgentPluginLifecycle(required: AgentPluginLifecycl
70
73
  }) => Promise<string>;
71
74
  classifyAgentPluginMcpServerTrust: (input: {
72
75
  readonly server: Parameters<(server: Pick<import("./manifest.js").McpServerConfig, "type">) => "auto-admit" | "requires-confirmation">[0];
73
- }) => "auto-admit" | "requires-confirmation";
76
+ }, _optional?: Record<string, never>) => "auto-admit" | "requires-confirmation";
74
77
  readInstalledSkillMarkdown: (input: {
75
78
  readonly packageRoot: string;
76
79
  readonly skillPath: string;
@@ -90,14 +93,14 @@ export declare function createAgentPluginLifecycle(required: AgentPluginLifecycl
90
93
  resolveAgentPluginRefs: (required: Omit<Parameters<({ ports, pluginRefIds, workspaceLayout }: {
91
94
  ports: AgentPluginLifecyclePorts;
92
95
  pluginRefIds: readonly string[];
93
- workspaceLayout: Pick<import("./layout.js").AgentPluginWorkspaceLayout, "packages" | "root">;
96
+ workspaceLayout: Pick<import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").AgentPluginWorkspaceLayout, "packages" | "root">;
94
97
  }, { deliveryMode, allowInactiveGuidance, ...request }?: import("./resolve-agent-plugin-refs.js").AgentPluginSkillRequest & {
95
98
  deliveryMode?: import("./types.js").AgentPluginDeliveryMode;
96
99
  allowInactiveGuidance?: boolean;
97
100
  }) => Promise<import("./resolve-agent-plugin-refs.js").ResolveAgentPluginRefsResult>>[0], "ports">, optional?: Parameters<({ ports, pluginRefIds, workspaceLayout }: {
98
101
  ports: AgentPluginLifecyclePorts;
99
102
  pluginRefIds: readonly string[];
100
- workspaceLayout: Pick<import("./layout.js").AgentPluginWorkspaceLayout, "packages" | "root">;
103
+ workspaceLayout: Pick<import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").AgentPluginWorkspaceLayout, "packages" | "root">;
101
104
  }, { deliveryMode, allowInactiveGuidance, ...request }?: import("./resolve-agent-plugin-refs.js").AgentPluginSkillRequest & {
102
105
  deliveryMode?: import("./types.js").AgentPluginDeliveryMode;
103
106
  allowInactiveGuidance?: boolean;
@@ -114,7 +117,7 @@ export declare function createAgentPluginLifecycle(required: AgentPluginLifecycl
114
117
  }>;
115
118
  listInstalledPlugins: (input: {
116
119
  readonly workspaceRoot: string;
117
- }) => Promise<readonly import("./types.js").InstalledAgentPlugin[]>;
120
+ }) => Promise<readonly import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").InstalledAgentPlugin[]>;
118
121
  isInstalledDigestPresent: (input: {
119
122
  readonly packagesDir: string;
120
123
  readonly archiveDigest: string;
@@ -131,8 +134,8 @@ export declare function createAgentPluginLifecycle(required: AgentPluginLifecycl
131
134
  readonly filename: string;
132
135
  }) => Promise<string>;
133
136
  findTrustedPluginPackages: (input: Omit<Parameters<(query: import("./trusted-plugin-files.js").TrustedPluginPackagesQuery) => Promise<readonly import("./trusted-plugin-files.js").TrustedPluginVerdict[]>>[0], "orderByPluginId" | "onInactive">, optional?: Pick<Parameters<(query: import("./trusted-plugin-files.js").TrustedPluginPackagesQuery) => Promise<readonly import("./trusted-plugin-files.js").TrustedPluginVerdict[]>>[0], "orderByPluginId" | "onInactive">) => Promise<readonly import("./trusted-plugin-files.js").TrustedPluginVerdict[]>;
134
- previewAgentPluginUninstall: (required: import("./uninstall.js").UninstallAgentPluginRequired) => Promise<import("./uninstall.js").AgentPluginUninstallPreview>;
135
- uninstallAgentPlugin: (required: import("./uninstall.js").UninstallAgentPluginRequired, optional?: import("./uninstall.js").UninstallAgentPluginOptional) => Promise<import("./uninstall.js").UninstallAgentPluginResult>;
137
+ previewAgentPluginUninstall: (required: import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").UninstallAgentPluginRequired) => Promise<import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").AgentPluginUninstallPreview>;
138
+ uninstallAgentPlugin: (required: import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").UninstallAgentPluginRequired, optional?: import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").UninstallAgentPluginOptional) => Promise<import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").UninstallAgentPluginResult>;
136
139
  stageForRemoval: (input: {
137
140
  readonly packagesDir: string;
138
141
  readonly packageRoot: string;
@@ -218,11 +221,11 @@ export declare function createAgentPluginLifecycle(required: AgentPluginLifecycl
218
221
  readonly workspaceRoot: string;
219
222
  readonly pluginId: string;
220
223
  }) => Promise<boolean>>[1]) => Promise<boolean>;
221
- installAgentPlugin: (required: import("./install.js").InstallAgentPluginRequired, optional?: import("./install.js").InstallAgentPluginOptional) => Promise<import("./types.js").InstalledAgentPlugin>;
224
+ installAgentPlugin: (required: import("./install.js").InstallAgentPluginRequired, optional?: import("./install.js").InstallAgentPluginOptional) => Promise<import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").InstalledAgentPlugin>;
222
225
  installAgentPluginFromUrl: (required: import("./install-from-url.js").InstallAgentPluginFromUrlRequired, optional?: import("./install-from-url.js").InstallAgentPluginFromUrlOptional) => Promise<import("./install-from-url.js").InstalledAgentPluginFromUrl>;
223
- setAgentPluginEnabled: (input: import("./set-enabled.js").SetAgentPluginEnabledInput, optional?: {
226
+ setAgentPluginEnabled: (input: import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").SetAgentPluginEnabledInput, optional?: {
224
227
  readonly unlessOperatorDisabled?: boolean;
225
- }) => Promise<import("./set-enabled.js").SetAgentPluginEnabledResult>;
228
+ }) => Promise<import("@jini-ai/core/contracts/site/agent-plugins-lifecycle").SetAgentPluginEnabledResult>;
226
229
  loadPluginContributions: <D, T>(input: {
227
230
  readonly workspaceId: string;
228
231
  readonly definition: import("./contribution-loader.js").PluginContributionDefinition<D, T>;
@@ -1,7 +1,8 @@
1
- export * from './update-plan.js';
2
- export { AgentPluginUpdateError } from './update-store.js';
1
+ export * from '../core/update-plan.js';
2
+ export { AgentPluginUpdateError } from '../core/update-error.js';
3
3
  import { createUpdateModule } from './update.js';
4
4
  export * from './compatibility.js';
5
+ export { AgentPluginHostIncompatibleError } from '../core/host-incompatible-error.js';
5
6
  export * from './automatic-use.js';
6
7
  export * from './bundled-file-policy.js';
7
8
  import { createPersistentStateModule } from "./persistent-state.js";
@@ -31,7 +32,7 @@ export * from './contribution-loader.js';
31
32
  export * from './provider-contribution.js';
32
33
  export { createAgentPluginActivations, ACTIVATIONS_FILENAME, ACTIVATIONS_LOCK_FILENAME, AgentPluginActivationsBusyError, AgentPluginActivationsUnreadableError } from './activation.js';
33
34
  export { BUNDLED_DIGESTS_FILENAME } from './bundled-digests.js';
34
- export { AgentPluginInstallError } from './install.js';
35
+ export { AgentPluginInstallError } from '../core/install-errors.js';
35
36
  export { PackagePathViolation } from './package-paths.js';
36
37
  export { AgentPluginNotInstalledError } from './set-enabled.js';
37
38
  export { AgentPluginNotFoundError, AgentPluginNotUninstallableError, AgentPluginChangedSincePreviewError } from './uninstall.js';
@@ -104,7 +105,7 @@ function lifecycleInstallFacade(context, modules) {
104
105
  preferBundledAgentPluginDigests: (input) => digests.preferBundledAgentPluginDigests(input.installed, input.bundled),
105
106
  normalizePackageEntryPath: (input) => paths.normalizePackageEntryPath(input.rawEntryPath),
106
107
  assertContainedOnDisk: (input) => paths.assertContainedOnDisk(input.packageRoot, input.entryPath),
107
- classifyAgentPluginMcpServerTrust: (input) => capabilities.classifyAgentPluginMcpServerTrust(input.server),
108
+ classifyAgentPluginMcpServerTrust: (input, _optional = {}) => capabilities.classifyAgentPluginMcpServerTrust(input.server),
108
109
  readInstalledSkillMarkdown: (input) => capabilities.readInstalledSkillMarkdown(input.packageRoot, input.skillPath),
109
110
  readInstalledSkillFile: capabilities.readInstalledSkillFile,
110
111
  readInstalledMcpServerIds: (input) => capabilities.readInstalledMcpServerIds(input.packageRoot),
@@ -31,9 +31,8 @@
31
31
  * difference is entirely in whether the digest came from somewhere other than the bytes.
32
32
  */
33
33
  import { type FetchAgentPluginArchiveOptional } from "./fetch-archive.js";
34
- import { type AgentPluginArchiveReaderPort, type InstalledAgentPlugin } from "./install.js";
35
34
  import type { AgentPluginLifecyclePorts } from "./ports.js";
36
- import type { AgentPluginLayout } from "./layout.js";
35
+ import type { AgentPluginArchiveReaderPort, InstalledAgentPlugin, AgentPluginLayout } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
37
36
  /**
38
37
  * See this module's header for why this is a union rather than an optional `expectedSha256`.
39
38
  */
@@ -1,38 +1,8 @@
1
- import type { AgentPluginLayout } from "./layout.js";
2
1
  import type { AgentPluginLifecyclePorts } from "./ports.js";
3
- import type { InstalledAgentPlugin } from "./types.js";
4
- export type { InstalledAgentPlugin, InstalledAgentPluginSkill } from "./types.js";
5
- export { AgentPluginInstallError } from "./install-errors.js";
6
- export type { AgentPluginInstallErrorCode } from "./install-errors.js";
7
- /** One archive entry. A symlink is modeled as its OWN kind rather than folded into "file" — the
8
- * zip-slip research this module's header cites is explicit that the symlink-entry vector is
9
- * distinct from the lexical-traversal one, and the two need independent tests and independent
10
- * handling (see the "symlink entries are rejected outright" rule below). */
11
- export type AgentPluginArchiveEntry = {
12
- readonly kind: "file";
13
- readonly entryPath: string;
14
- /** The archive format's own claimed size. Never trusted alone — see `DECOMPRESSION_BOMB`. */
15
- readonly declaredSize?: (number) | undefined;
16
- readonly executable?: (boolean) | undefined;
17
- readonly openReadStream: (required: Record<string, never>) => AsyncIterable<Uint8Array>;
18
- } | {
19
- readonly kind: "directory";
20
- readonly entryPath: string;
21
- } | {
22
- readonly kind: "symlink" | "hardlink" | "device" | "fifo";
23
- readonly entryPath: string;
24
- readonly linkTarget?: string | undefined;
25
- };
26
- /**
27
- * `entries` must be a pure function of the archive bytes: an install iterates it twice, once to
28
- * check entry-count limits from metadata alone and once to extract.
29
- */
30
- /** `entries` is a pure function of archive bytes: metadata preflight and extraction iterate it twice. */
31
- export interface AgentPluginArchiveReaderPort {
32
- entries(required: {
33
- readonly archive: Uint8Array;
34
- }): AsyncIterable<AgentPluginArchiveEntry>;
35
- }
2
+ import type { AgentPluginLayout, InstalledAgentPlugin } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
3
+ import type { AgentPluginArchiveReaderPort } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
4
+ export { AgentPluginInstallError } from "../core/install-errors.js";
5
+ export type { AgentPluginInstallErrorCode } from "../core/install-errors.js";
36
6
  export interface InstallAgentPluginRequired {
37
7
  readonly archive: Uint8Array;
38
8
  /** Lowercase hex SHA-256 the caller expects `archive` to hash to — a real marketplace flow would
@@ -1,7 +1,7 @@
1
1
  import { resolveAgentPluginLifecycleNamespace } from '../core/identity-namespace.js';
2
2
  import { listInstalledPackageRoots } from "./installed-package-roots.js";
3
3
  import { createUninstallModule } from "./uninstall.js";
4
- import { AgentPluginInstallError } from "./install-errors.js";
4
+ import { AgentPluginInstallError } from "../core/install-errors.js";
5
5
  import { createInstalledPackageIndex } from "./installed-package-index.js";
6
6
  import { readPluginIdentity, assertPluginIdentityAvailable } from "@jini-ai/core/plugin-directory";
7
7
  /**
@@ -71,7 +71,7 @@ import { constants } from "node:fs";
71
71
  import path from "node:path";
72
72
  import { PackagePathViolation } from "./package-paths.js";
73
73
  import { createPackagePathsModule } from "./package-paths.js";
74
- export { AgentPluginInstallError } from "./install-errors.js";
74
+ export { AgentPluginInstallError } from "../core/install-errors.js";
75
75
  const LIMITS = {
76
76
  maxArchiveBytes: 32 * 1024 * 1024,
77
77
  maxEntries: 4096,
@@ -93,7 +93,7 @@ async function assertIdentityAvailable({ ports, workspaceRoot, candidate }) {
93
93
  let identity;
94
94
  try {
95
95
  raw = JSON.parse(await ports.filesystem.readFile(manifestPath, 'utf8'));
96
- identity = readPluginIdentity({ manifest: raw, name: root.localId, namespace: resolveAgentPluginLifecycleNamespace({ value: raw, extensionNamespace: ports.extensionNamespace }) });
96
+ identity = readPluginIdentity({ manifest: raw, name: root.localId, namespace: resolveAgentPluginLifecycleNamespace({ value: raw, extensionNamespace: ports.extensionNamespace }, { legacyIdentity: ports.legacyIdentity }) });
97
97
  }
98
98
  catch {
99
99
  // A damaged unrelated install must not block fresh installs or bundled seeding.
@@ -1,5 +1,5 @@
1
1
  import type { AgentPluginLifecyclePorts } from "./ports.js";
2
- import type { InstalledAgentPlugin } from "./types.js";
2
+ import type { InstalledAgentPlugin } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
3
3
  /** Indexes manifests and files with the same injected effects used by installation and resolution.
4
4
  * @complexity O(f) reads/walk work for f package files; no mutation or executable imports. */
5
5
  export declare function createInstalledPackageIndex(required: {
@@ -1,12 +1,12 @@
1
1
  import { resolveAgentPluginLifecycleNamespace } from '../core/identity-namespace.js';
2
2
  /** Read-side owner of installed package metadata; never constructs a mutation lifecycle. */
3
3
  import path from "node:path";
4
- import { AgentPluginInstallError } from "./install-errors.js";
4
+ import { AgentPluginInstallError } from "../core/install-errors.js";
5
5
  import { parseAgentPluginManifest as parseAgentPluginManifestValue } from "./manifest.js";
6
6
  /** Keep undeclared metadata absent, including for older packages. No extra manifest read. */
7
7
  function indexedMetadata({ manifest }, _optional = {}) {
8
- const { requires, hostRange, exports, renamedFrom } = manifest;
9
- return Object.fromEntries(Object.entries({ requires, hostRange, exports, renamedFrom }).filter(([, value]) => value !== undefined));
8
+ const { requires, companions, hostRange, exports, renamedFrom } = manifest;
9
+ return Object.fromEntries(Object.entries({ requires, companions, hostRange, exports, renamedFrom }).filter(([, value]) => value !== undefined));
10
10
  }
11
11
  /** Cosmetic fields are trimmed and capped rather than invalidating the package. The cap stops
12
12
  * a hostile package flooding an admin row. Malformed values fall back because these fields are
@@ -18,7 +18,7 @@ function readDisplayText(required, _optional = {}) {
18
18
  return text ? { [required.key]: text.slice(0, required.maxLength) } : {};
19
19
  }
20
20
  function createInstalledManifestReader(ports, readFile) {
21
- const parseAgentPluginManifest = (value) => parseAgentPluginManifestValue({ value }, { identityNamespace: resolveAgentPluginLifecycleNamespace({ value, extensionNamespace: ports.extensionNamespace }) });
21
+ const parseAgentPluginManifest = (value) => parseAgentPluginManifestValue({ value }, { identityNamespace: resolveAgentPluginLifecycleNamespace({ value, extensionNamespace: ports.extensionNamespace }, { legacyIdentity: ports.legacyIdentity }), legacyIdentity: ports.legacyIdentity });
22
22
  /** Reads and validates `packageRoot`'s `plugin.json`, refusing a missing, unparseable or invalid one. */
23
23
  return async function readInstalledManifest({ packageRoot }) {
24
24
  let manifestRaw;
@@ -1,30 +1,26 @@
1
- export interface AgentPluginWorkspaceLayout {
2
- readonly root: string;
3
- readonly packages: string;
4
- readonly staging: string;
5
- pluginRootDir(required: {
6
- readonly pluginId: string;
7
- }, optional?: Record<string, never>): string;
8
- pluginPackagesDir(required: {
9
- readonly pluginId: string;
10
- }, optional?: Record<string, never>): string;
11
- pluginMemoryDir(required: {
12
- readonly pluginId: string;
13
- readonly kind: 'learned' | 'notes';
14
- }, optional?: Record<string, never>): string;
15
- pluginDataDir(required: {
16
- readonly pluginId: string;
17
- }): string;
18
- }
19
- export interface AgentPluginLayoutPort {
20
- readonly root: string;
21
- forWorkspace(required: {
22
- readonly workspaceId: string;
23
- }): AgentPluginWorkspaceLayout;
24
- }
25
- export type AgentPluginLayout = AgentPluginLayoutPort;
1
+ import type { AgentPluginLayoutPort } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
26
2
  /** Explicit root only; site-root and environment resolution belong to the consumer. */
27
3
  export declare function createAgentPluginLayout(required: {
28
4
  readonly root: string;
29
5
  }, _optional?: Record<string, never>): AgentPluginLayoutPort;
6
+ import type { AgentPluginLayout } from '@jini-ai/core/contracts/headless/plugin-host';
7
+ export declare function createAgentPluginSiteLayout(required: {
8
+ siteDir: string;
9
+ rootOverride: string | undefined;
10
+ diagnostics: {
11
+ rootOverride(input: {
12
+ rootOverride: string;
13
+ }): Error;
14
+ workspaceId(input: {
15
+ workspaceId: string;
16
+ }): Error;
17
+ pluginId(input: {
18
+ pluginId: string;
19
+ }): Error;
20
+ pluginDataId(input: {
21
+ pluginId: string;
22
+ }): Error;
23
+ memoryKind(): Error;
24
+ };
25
+ }, _optional?: {}): AgentPluginLayout;
30
26
  //# sourceMappingURL=layout.d.ts.map
@@ -35,4 +35,83 @@ function assertSafeSegment(value) {
35
35
  throw new Error(`'${value}' is not a safe plugin/workspace id`);
36
36
  }
37
37
  }
38
+ /**
39
+ * @file Pure filesystem layout computation for installed Agent Plugins; callers perform I/O.
40
+ *
41
+ * The owner requires workspace isolation. A shared content-addressed package directory would
42
+ * leak another tenant's installs: public archive digests are precomputable and stat-able even
43
+ * when bytes are frozen. A per-workspace tree enforces isolation by construction rather than
44
+ * relying on every future reader to check activation records. It also avoids cross-workspace
45
+ * refcounts and prevents uninstalling one workspace's plugin from deleting another's bytes.
46
+ * Plugin archives are hostile third-party input; per-workspace extraction costs are bounded by
47
+ * the lifecycle owner's archive/expanded-byte limits. Content deduplication stays within a workspace.
48
+ * Writable PLUGIN_DATA belongs to the same workspace tree.
49
+ *
50
+ * Installed plugins are site data: they must travel with the site and survive upgrades.
51
+ */
52
+ /**
53
+ * One safe, indivisible path segment: lowercase alphanumerics in `-`/`.`-separated runs, with no
54
+ * leading, trailing, or doubled separator. Matches the Agent Plugins spec's own `name` grammar
55
+ * (§5.5), and — by construction — cannot be `.`, `..`, empty, or contain a `/`, `\`, or whitespace,
56
+ * which is the entire property this module needs before using a caller-supplied string in a
57
+ * `path.join`.
58
+ *
59
+ * Workspace IDs are safe path segments, not necessarily UUIDs: the site's real ID can be
60
+ * `workspace-local`. The check must prevent splitting or escaping a path while accepting that ID.
61
+ *
62
+ * Deliberately NOT relaxed further: `_`, uppercase (normalized before this is applied, never
63
+ * accepted raw), and any Unicode remain rejected, because each would let two distinct ids collide
64
+ * onto one directory on a case-insensitive or normalizing filesystem.
65
+ */
66
+ const SAFE_ID_SEGMENT_PATTERN = /^[a-z0-9]+(?:[-.][a-z0-9]+)*$/;
67
+ /** Bounds the segment so a caller cannot drive a pathological path length. Applied to both ids. */
68
+ const MAX_ID_SEGMENT_LENGTH = 64;
69
+ export function createAgentPluginSiteLayout(required, _optional = {}) {
70
+ const override = required.rootOverride;
71
+ if (override !== undefined && !path.isAbsolute(override)) {
72
+ throw required.diagnostics.rootOverride({ rootOverride: override });
73
+ }
74
+ const root = path.resolve(override ?? path.join(required.siteDir, "agent-plugins"));
75
+ const workspacesDir = path.join(root, "ws");
76
+ return {
77
+ root,
78
+ workspacesDir,
79
+ forWorkspace({ workspaceId }, _optional = {}) {
80
+ // Normalize BEFORE validating, not after: the pattern is deliberately lowercase-only (see its
81
+ // own doc), so validating the raw string would reject an uppercase id that the old UUID rule
82
+ // accepted — and the normalized value is the one that actually becomes the path segment, so it
83
+ // is the only value worth asserting about.
84
+ const normalizedWorkspaceId = workspaceId.toLowerCase();
85
+ if (!SAFE_ID_SEGMENT_PATTERN.test(normalizedWorkspaceId) || normalizedWorkspaceId.length > MAX_ID_SEGMENT_LENGTH) {
86
+ // Quotes the RAW input, not the normalized one, so the message names what the caller passed.
87
+ throw required.diagnostics.workspaceId({ workspaceId });
88
+ }
89
+ const workspaceRoot = path.join(workspacesDir, normalizedWorkspaceId);
90
+ const pluginRootDir = ({ pluginId }, _optional = {}) => {
91
+ if (!SAFE_ID_SEGMENT_PATTERN.test(pluginId) || pluginId.length > MAX_ID_SEGMENT_LENGTH) {
92
+ throw required.diagnostics.pluginId({ pluginId });
93
+ }
94
+ return pluginStatePaths({ workspaceRoot, pluginId }).root;
95
+ };
96
+ return {
97
+ root: workspaceRoot,
98
+ pluginRootDir,
99
+ pluginPackagesDir: ({ pluginId }, _optional = {}) => path.join(pluginRootDir({ pluginId }), "package", "sha256"),
100
+ pluginMemoryDir: ({ pluginId, kind }, _optional = {}) => {
101
+ if (kind !== "learned" && kind !== "notes")
102
+ throw required.diagnostics.memoryKind();
103
+ return path.join(pluginRootDir({ pluginId }), "memory", kind);
104
+ },
105
+ packages: path.join(workspaceRoot, "packages", "sha256"),
106
+ staging: path.join(workspaceRoot, "staging"),
107
+ pluginDataDir({ pluginId }, _optional = {}) {
108
+ if (!SAFE_ID_SEGMENT_PATTERN.test(pluginId) || pluginId.length > MAX_ID_SEGMENT_LENGTH) {
109
+ throw required.diagnostics.pluginDataId({ pluginId });
110
+ }
111
+ return path.join(pluginRootDir({ pluginId }), "data");
112
+ },
113
+ };
114
+ },
115
+ };
116
+ }
38
117
  //# sourceMappingURL=layout.js.map
@@ -1,14 +1,16 @@
1
- export { resolveAgentPluginIdentityNamespace, readAgentPluginPortableExtension, readAgentPluginCompatibilityWarnings, legacyAgentPluginMetadataWarning } from '../core/identity-namespace.js';
1
+ import { type AgentPluginIdentityReadOptions, type LegacyMcpAliases } from '../core/identity-namespace.js';
2
+ import type { AgentPluginExportMetadata, PluginManifestAuthor } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
3
+ export { type AgentPluginIdentityReadOptions, type LegacyAgentPluginIdentity, type LegacyMcpAliases, resolveAgentPluginIdentityNamespace, readAgentPluginPortableExtension, readAgentPluginCompatibilityWarnings } from '../core/identity-namespace.js';
2
4
  import { type AgentPluginMetadata } from './metadata.js';
3
5
  export * from './metadata.js';
4
6
  export * from './credential-card-metadata.js';
5
7
  export { isAgentPluginName } from '../core/plugin-name.js';
6
- import { type AgentPluginExportMetadata } from './exports.js';
7
8
  export * from './exports.js';
8
9
  export { validatePluginManifest, validateMcpManifest } from '../manifest.js';
9
10
  export type { PluginManifest, McpManifest, McpServerEntry } from '../manifest.js';
10
- import type { PluginManifestAuthor } from '../manifest.js';
11
- export type { PluginManifestAuthor } from '../manifest.js';
11
+ /** Deprecated re-export: import these from `@jini-ai/core/contracts/site/agent-plugins-lifecycle` and `-manifest`; removed at the next major. */
12
+ export type { AgentPluginExportMetadata, PluginManifestAuthor } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
13
+ export type { AgentPluginExport, AgentPluginExportConsent, AgentPluginExportExternalHosts, AgentPluginExportStaticMode } from "@jini-ai/core/contracts/site/agent-plugins-manifest";
12
14
  /** Agent Plugins 1.0.0/1.1.0 parsing, with application metadata confined to an explicit namespace. */
13
15
  export type AgentPluginServerMetadataReader = (required: {
14
16
  readonly serverId: string;
@@ -28,6 +30,7 @@ export interface AgentPluginManifest extends AgentPluginExportMetadata, AgentPlu
28
30
  readonly provides?: readonly string[] | undefined;
29
31
  /** `extensions.<ns>.requires`: advisory capability ids other active plugins should provide. */
30
32
  readonly requires?: readonly string[] | undefined;
33
+ readonly companions?: readonly string[] | undefined;
31
34
  /** `extensions.<ns>.hostRange`: semver range over AGENT_PLUGIN_CONTRACT_VERSION; a malformed value is stored as `<invalid>`. */
32
35
  readonly hostRange?: string | undefined;
33
36
  }
@@ -50,9 +53,7 @@ export type ParseAgentPluginManifestResult = {
50
53
  */
51
54
  export declare function parseAgentPluginManifest({ value }: {
52
55
  readonly value: unknown;
53
- }, optional?: {
54
- readonly identityNamespace?: string;
55
- }): ParseAgentPluginManifestResult;
56
+ }, optional?: AgentPluginIdentityReadOptions): ParseAgentPluginManifestResult;
56
57
  /**
57
58
  * The three closed transport variants `mcp.schema.json` 1.0.0/1.1.0 defines. See this file's header for
58
59
  * the verified field shape of each.
@@ -161,6 +162,8 @@ export declare function parseAgentPluginMcpConfig({ value, extensionNamespace }:
161
162
  }, optional?: {
162
163
  readonly pluginManifest?: unknown;
163
164
  readonly readServerMetadata?: AgentPluginServerMetadataReader | undefined;
165
+ readonly legacyMcpAliases?: LegacyMcpAliases | undefined;
166
+ readonly legacyIdentity?: AgentPluginIdentityReadOptions["legacyIdentity"];
164
167
  }): ParseAgentPluginMcpConfigResult;
165
168
  /** Typed extension reader: unknown namespaces have no semantics until a host supplies a reader. */
166
169
  export declare function readAgentPluginExtension<T>(required: {
@@ -37,7 +37,7 @@
37
37
  * spec-defined field — the host is the client the spec defers that decision to. This module accepts
38
38
  * portable metadata in `plugin.json`'s `extensions.jini.mcpServers[serverId]`, with an explicit
39
39
  * namespace option for custom clients. Legacy auth and sign-in defaults in MCP entries remain
40
- * readable automatically, but those cannot supply operator read trust. Custom clients can use
40
+ * readable with host-bound aliases, but those cannot supply operator read trust. Custom clients can use
41
41
  * readServerMetadata to translate their own fields before the same validators run.
42
42
  * `authMode: "oauth" | "none"` selects client auth; absent defaults to "none".
43
43
  * `defaultTools: { allow?, write?, read? }` names sign-in grants and reviewed read tools.
@@ -56,8 +56,8 @@
56
56
  * caller that reads the file and hands the parsed value here.
57
57
  */
58
58
  import { isAgentPluginName, MAX_NAME_LENGTH } from '../core/plugin-name.js';
59
- import { resolveAgentPluginIdentityNamespace, readCompatibleAgentPluginServerMetadata, hasLegacyAgentPluginServerMetadata, legacyAgentPluginMetadataWarning, readAgentPluginCompatibilityWarnings, isPortableAgentPluginNamespace } from '../core/identity-namespace.js';
60
- export { resolveAgentPluginIdentityNamespace, readAgentPluginPortableExtension, readAgentPluginCompatibilityWarnings, legacyAgentPluginMetadataWarning } from '../core/identity-namespace.js';
59
+ import { resolveAgentPluginIdentityNamespace, readCompatibleAgentPluginServerMetadata, hasLegacyAgentPluginServerMetadata, readAgentPluginCompatibilityWarnings, isPortableAgentPluginNamespace } from '../core/identity-namespace.js';
60
+ export { resolveAgentPluginIdentityNamespace, readAgentPluginPortableExtension, readAgentPluginCompatibilityWarnings } from '../core/identity-namespace.js';
61
61
  import { readAgentPluginMetadata } from './metadata.js';
62
62
  export * from './metadata.js';
63
63
  export * from './credential-card-metadata.js';
@@ -415,8 +415,8 @@ function collectMcpConfigErrors({ raw }, { pluginManifest } = {}) {
415
415
  return errors;
416
416
  }
417
417
  /** The per-server metadata `plugin.json` declares under `extensionNamespace`, or `{}` when it declares none. */
418
- function readExtensionServers({ pluginManifest, extensionNamespace }) {
419
- const manifest = parseAgentPluginManifest({ value: pluginManifest }, { identityNamespace: extensionNamespace });
418
+ function readExtensionServers({ pluginManifest, extensionNamespace }, optional = {}) {
419
+ const manifest = parseAgentPluginManifest({ value: pluginManifest }, { identityNamespace: extensionNamespace, ...optional });
420
420
  if (!manifest.ok)
421
421
  return {};
422
422
  return readAgentPluginExtension({ manifest: manifest.manifest, namespace: extensionNamespace, read: ({ value }) => isJsonObject(value.mcpServers) ? value.mcpServers : {} }) ?? {};
@@ -442,27 +442,32 @@ export function parseAgentPluginMcpConfig({ value, extensionNamespace }, optiona
442
442
  }
443
443
  /** Valid transports are independent siblings; a malformed declaration never hides their ids. */
444
444
  function parseMcpServers({ raw, extensionNamespace }, optional) {
445
- const namespace = resolveAgentPluginIdentityNamespace({ value: optional.pluginManifest }, extensionNamespace === undefined ? {} : { identityNamespace: extensionNamespace });
446
- const extensionServers = readExtensionServers({ pluginManifest: optional.pluginManifest, extensionNamespace: namespace });
445
+ const namespace = resolveAgentPluginIdentityNamespace({ value: optional.pluginManifest }, { identityNamespace: extensionNamespace, legacyIdentity: optional.legacyIdentity });
446
+ const extensionServers = readExtensionServers({ pluginManifest: optional.pluginManifest, extensionNamespace: namespace }, optional);
447
447
  const entries = Object.entries(raw.mcpServers);
448
448
  const servers = Object.create(null);
449
- const warnings = [...readAgentPluginCompatibilityWarnings({ value: optional.pluginManifest }, { identityNamespace: namespace })];
450
- const portable = isPortableAgentPluginNamespace({ namespace: extensionNamespace });
451
- const readServerMetadata = optional.readServerMetadata ?? (portable ? readCompatibleAgentPluginServerMetadata : undefined);
449
+ const warnings = [...readAgentPluginCompatibilityWarnings({ value: optional.pluginManifest }, { identityNamespace: namespace, legacyIdentity: optional.legacyIdentity })];
450
+ const portable = isPortableAgentPluginNamespace({ namespace: extensionNamespace }, optional);
451
+ const readServerMetadata = selectMcpServerMetadataReader({ portable }, optional);
452
452
  for (const [serverId, rawServer] of entries) {
453
453
  const extension = Object.hasOwn(extensionServers, serverId) ? extensionServers[serverId] : undefined;
454
- collectLegacyServerWarning({ rawServer, extension, portable, warnings });
454
+ collectLegacyServerWarning({ rawServer, extension, portable, warnings, legacyMcpAliases: optional.legacyMcpAliases });
455
455
  const parsed = parseDeclaredServer({ serverId, rawServer, extension }, { readServerMetadata });
456
456
  if (parsed)
457
457
  servers[serverId] = parsed;
458
458
  }
459
459
  return { ok: true, config: { serverIds: entries.map(([serverId]) => serverId), servers }, ...(warnings.length ? { warnings: [...new Set(warnings)] } : {}) };
460
460
  }
461
- function collectLegacyServerWarning({ rawServer, extension, portable, warnings }) {
462
- if (!portable || !isJsonObject(rawServer))
461
+ function selectMcpServerMetadataReader({ portable }, options) {
462
+ return options.readServerMetadata ?? (portable
463
+ ? required => readCompatibleAgentPluginServerMetadata(required, { legacyMcpAliases: options.legacyMcpAliases })
464
+ : undefined);
465
+ }
466
+ function collectLegacyServerWarning({ rawServer, extension, portable, warnings, legacyMcpAliases }) {
467
+ if (!portable || !isJsonObject(rawServer) || !legacyMcpAliases)
463
468
  return;
464
- if (hasLegacyAgentPluginServerMetadata({ value: isJsonObject(extension) ? extension : {}, server: rawServer }))
465
- warnings.push(legacyAgentPluginMetadataWarning);
469
+ if (hasLegacyAgentPluginServerMetadata({ value: isJsonObject(extension) ? extension : {}, server: rawServer }, { legacyMcpAliases }))
470
+ warnings.push(legacyMcpAliases.warning);
466
471
  }
467
472
  /** Typed extension reader: unknown namespaces have no semantics until a host supplies a reader. */
468
473
  export function readAgentPluginExtension(required, _optional = {}) {
@@ -1,5 +1,5 @@
1
1
  import type { AgentPluginMcpProvisioningPort } from './ports.js';
2
- import type { InstalledAgentPlugin } from './install.js';
2
+ import type { InstalledAgentPlugin } from "@jini-ai/core/contracts/site/agent-plugins-lifecycle";
3
3
  /** A host performs MCP federation. Notify only after its durable provisioning step succeeds. */
4
4
  export declare function provisionAgentPluginMcp(required: {
5
5
  readonly mcpProvisioning: AgentPluginMcpProvisioningPort;
@@ -1,3 +1,6 @@
1
+ /** Portable advisory metadata. Invalid declarations warn and contribute nothing; parsing never
2
+ * executes a plugin or turns presentation copy into an authorization decision. */
3
+ import { type AgentPluginIdentityReadOptions } from '../core/identity-namespace.js';
1
4
  export interface AgentPluginHostSignal {
2
5
  readonly env: string;
3
6
  readonly facts: {
@@ -11,6 +14,8 @@ export interface AgentPluginMetadata {
11
14
  readonly displayName?: string;
12
15
  readonly summary?: string;
13
16
  readonly vendorAliases?: readonly string[];
17
+ /** Prefix the host puts on this plugin's client-setting names (upper-case letters, digits, underscores, ending in `_`). The host's own default applies when absent. */
18
+ readonly clientNamespace?: string;
14
19
  readonly toolKeywords?: Readonly<Record<string, string>>;
15
20
  readonly hostSignals?: readonly AgentPluginHostSignal[];
16
21
  readonly deploymentAdvice?: string;
@@ -22,9 +27,7 @@ export interface AgentPluginMetadata {
22
27
  * @returns Typed advisory fields and host-visible diagnostics. @complexity O(k + s) metadata keys/signals. */
23
28
  export declare function readAgentPluginMetadata(required: {
24
29
  readonly value: unknown;
25
- }, optional?: {
26
- readonly identityNamespace?: string;
27
- }): {
30
+ }, optional?: AgentPluginIdentityReadOptions): {
28
31
  readonly metadata: AgentPluginMetadata;
29
32
  readonly warnings: readonly string[];
30
33
  };
@@ -4,6 +4,7 @@ import { readAgentPluginPortableExtension, readAgentPluginCompatibilityWarnings
4
4
  const object = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
5
5
  const text = (value) => typeof value === 'string' && value.trim().length > 0 && value.length <= 2048 && !/[\x00-\x1f\x7f]/.test(value);
6
6
  const texts = (value) => Array.isArray(value) && value.every(text);
7
+ const namespaceText = (value) => typeof value === 'string' && /^[A-Z][A-Z0-9_]*_$/.test(value);
7
8
  const textMap = (value) => object(value) && Object.values(value).every(text);
8
9
  /** Only declared boolean facts and a finite positive safe proxy-hop count can be host hints. */
9
10
  function validFacts(value) {
@@ -26,7 +27,7 @@ export function readAgentPluginMetadata(required, optional = {}) {
26
27
  const extension = readAgentPluginPortableExtension(required, optional) ?? {};
27
28
  const warnings = [...readAgentPluginCompatibilityWarnings(required, optional)];
28
29
  const metadata = {};
29
- for (const [key, check] of Object.entries({ vendorAliases: texts, card: textMap })) {
30
+ for (const [key, check] of Object.entries({ vendorAliases: texts, card: textMap, clientNamespace: namespaceText })) {
30
31
  if (extension[key] === undefined)
31
32
  continue;
32
33
  if (check(extension[key]))