@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
@@ -0,0 +1,324 @@
1
+ import { toObjectArgArchiveReader, toZeroArgArchiveReader } from './archive-reader-abi.js';
2
+ export { toObjectArgArchiveReader, toZeroArgArchiveReader } from './archive-reader-abi.js';
3
+ import { planAgentPluginUpdate } from "../core/update-plan.js";
4
+ import { AgentPluginUpdateError } from "../core/update-error.js";
5
+ /**
6
+ * @file `installUploadedAgentPlugin()` — the admin "Add a plugin" upload: one operator-supplied
7
+ * `.zip` of an agent-plugins.org package, installed for one workspace and left switched OFF.
8
+ *
9
+ * No second install path. Extraction, containment, size caps, the digest check and publication are
10
+ * all `installAgentPlugin()`'s (`install.ts`), exactly as the bundled seed uses it; this module only
11
+ * adds what an upload needs that a bundled source never does:
12
+ *
13
+ * - A real ZIP reader: Jini's published yauzl adapter, the same one `plugin-runtime/install-archive.ts`
14
+ * uses for site-plugin uploads, adapted to `install.ts`'s own reader port.
15
+ * - One wrapping folder is accepted. Zipping a folder (macOS "Compress", a GitHub download) puts
16
+ * every file under `<folder>/`, plus `__MACOSX/` noise; `install.ts` wants `plugin.json` at the
17
+ * root. When the root has no `plugin.json` but exactly one top-level folder does, that folder is
18
+ * the package and everything outside it is dropped. Every path is still re-checked by `install.ts`.
19
+ * - Replacing a disabled operator-installed plugin is explicit. Old digests are staged aside and
20
+ * restored on publication failure; memory stays in place. The per-plugin lock prevents ambiguous
21
+ * id races. Identical bytes are a harmless no-op instead.
22
+ * - It stays off. An absent activation record reads as ACTIVE (operator installs predate the
23
+ * record), so the disabled `operator-installed` record is written BEFORE the package is
24
+ * published, the same order the bundled seed uses. A failed install leaves only that inert record.
25
+ *
26
+ * Nothing in an uploaded package runs: skills are markdown, and code seams only trust bundled
27
+ * digests (`trusted-plugin-files.ts`).
28
+ */
29
+ import path from "node:path";
30
+ import { AgentPluginInstallError } from "../core/install-errors.js";
31
+ const MANIFEST = "plugin.json";
32
+ const MAX_MANIFEST_BYTES = 1024 * 1024;
33
+ const MAX_PREPASS_ENTRIES = 4096;
34
+ /** Archiver metadata a wrapping-folder zip may carry beside the folder. Never part of a package. */
35
+ const IGNORED_TOP_LEVEL = new Set(["__MACOSX"]);
36
+ /** Upload-only refusals; every other refusal is `install.ts`'s own `AgentPluginInstallError`. */
37
+ export class AgentPluginUploadError extends Error {
38
+ code;
39
+ constructor({ code, message }, options = {}) {
40
+ super(message, options);
41
+ this.name = "AgentPluginUploadError";
42
+ this.code = code;
43
+ }
44
+ }
45
+ /** `reader`, minus every entry outside `prefix` and with `prefix` stripped from the rest.
46
+ * @complexity O(1) per entry. */
47
+ function withinPrefix({ reader, prefix }, _optional = {}) {
48
+ if (!prefix)
49
+ return reader;
50
+ return {
51
+ async *entries({ archive }) {
52
+ for await (const entry of reader.entries({ archive })) {
53
+ const name = entry.entryPath.replaceAll("\\", "/");
54
+ if (name.startsWith(prefix)) {
55
+ const inner = name.slice(prefix.length);
56
+ if (inner)
57
+ yield entry.kind === "file" ? { ...entry, entryPath: inner, openReadStream: required => entry.openReadStream(required) } : { ...entry, entryPath: inner };
58
+ }
59
+ }
60
+ },
61
+ };
62
+ }
63
+ async function readBounded(stream) {
64
+ const chunks = [];
65
+ let length = 0;
66
+ for await (const chunk of stream) {
67
+ length += chunk.byteLength;
68
+ if (length > MAX_MANIFEST_BYTES)
69
+ throw new AgentPluginInstallError({ code: "MANIFEST_INVALID", message: "plugin.json is larger than 1 MiB" });
70
+ chunks.push(Buffer.from(chunk));
71
+ }
72
+ return Buffer.concat(chunks, length);
73
+ }
74
+ /**
75
+ * Finds the package root (`""` or one wrapping `<folder>/`) and its plugin id, by reading only
76
+ * entry names and the candidate `plugin.json` files.
77
+ * @complexity O(e) in entry count, capped at {@link MAX_PREPASS_ENTRIES}.
78
+ */
79
+ async function locatePackage(reader, archive, parseManifest) {
80
+ const { manifests, topLevel } = await scanPackageManifests({ reader, archive });
81
+ const folders = [...topLevel].filter((name) => name.endsWith("/"));
82
+ const enclosingFolder = topLevel.size === 1 && folders.length === 1 ? folders[0] : null;
83
+ if (enclosingFolder === undefined)
84
+ throw new AgentPluginInstallError({ code: "MANIFEST_MISSING", message: "the archive has no enclosing plugin folder" });
85
+ const prefix = manifests.has(MANIFEST) ? "" : enclosingFolder;
86
+ const raw = prefix === null ? undefined : manifests.get(prefix + MANIFEST);
87
+ if (prefix === null || raw === undefined) {
88
+ throw new AgentPluginInstallError({ code: "MANIFEST_MISSING", message: "the archive does not contain a plugin.json at its root or inside one top-level folder" });
89
+ }
90
+ let value;
91
+ try {
92
+ value = JSON.parse(raw.toString("utf8"));
93
+ }
94
+ catch (error) {
95
+ throw new AgentPluginInstallError({ code: "MANIFEST_INVALID", message: "plugin.json is not valid JSON" }, { cause: error });
96
+ }
97
+ const parsed = parseManifest({ value });
98
+ if (!parsed.ok)
99
+ throw new AgentPluginInstallError({ code: "MANIFEST_INVALID", message: `plugin.json failed validation: ${parsed.errors.join("; ")}` });
100
+ return { prefix, pluginId: parsed.manifest.name };
101
+ }
102
+ export async function installUploadedAgentPlugin(required, optional) {
103
+ const { archive, expectedSha256, workspaceId, actor } = required;
104
+ const { installAgentPlugin, stageForRemoval, restoreStagedTrees, setAgentPluginActivation } = optional.lifecycle;
105
+ const { assertOwnedPluginPath, contain: containAgentPluginStatePath } = optional;
106
+ const layout = optional.layout;
107
+ const reader = optional.archiveReader;
108
+ const digest = validateUploadedBytes({ archive, expectedSha256, maxAgentPluginInstallArchiveBytes: optional.maxAgentPluginInstallArchiveBytes, sha256: optional.sha256 });
109
+ const { prefix, pluginId } = await locatePackage(reader, archive, optional.parseManifest);
110
+ if (required.update) {
111
+ return updateUploadedAgentPlugin({ ...required, update: required.update, expectedSha256: digest, archiveReader: withinPrefix({ reader, prefix }), candidateId: pluginId }, optional);
112
+ }
113
+ const workspaceLayout = layout.forWorkspace({ workspaceId });
114
+ let alreadyInstalled = false;
115
+ let upgradeFrom = [];
116
+ const plugin = await installAgentPlugin({ archive, expectedSha256: digest,
117
+ archiveReader: withinPrefix({ reader, prefix }), layout, workspaceId }, {
118
+ // The lock belongs to installAgentPlugin. Doing an id check outside it lets two uploads
119
+ // both pass and publish ambiguous digests. Keep check, disabled activation, and swap together.
120
+ publishGuard: async ({ plugin: indexed, publish }) => {
121
+ const run = () => publishUploadedAgentPlugin({ workspaceLayout, pluginId, digest, required, optional, indexed, publish, actor, stageForRemoval, restoreStagedTrees, setAgentPluginActivation, assertOwnedPluginPath, containAgentPluginStatePath,
122
+ markAlreadyInstalled: () => { alreadyInstalled = true; }, setUpgradeFrom: versions => { upgradeFrom = versions; } });
123
+ if (!optional.pluginHost)
124
+ return run();
125
+ const identity = await optional.readInstallIdentity({ plugin: indexed });
126
+ return optional.pluginHost.withInstallIdentity({ candidate: { id: identity.id, localId: pluginId, family: "agent-plugin" }, run });
127
+ },
128
+ });
129
+ return { plugin, alreadyInstalled, ...(upgradeFrom.length > 0 ? { upgradeFrom } : {}) };
130
+ }
131
+ /**
132
+ * The explicit update: the candidate must carry the plugin id being updated, and the host must have
133
+ * bound the settings-snapshot owner. Both are checked before the lifecycle owner opens its
134
+ * transaction, so a refusal here changes nothing. The owner then re-checks the id, the installed
135
+ * digest, bundled provenance and downgrades under the plugin lock.
136
+ * @throws {AgentPluginUpdateError} PLUGIN_ID_MISMATCH, and every refusal of the lifecycle owner.
137
+ * @throws {Error} A host that did not bind `snapshotSettings` (a wiring fault, not the caller's).
138
+ * @complexity O(e + b), as the install it delegates to.
139
+ */
140
+ async function updateUploadedAgentPlugin(required, optional) {
141
+ if (required.candidateId !== required.update.pluginId)
142
+ throw new AgentPluginUpdateError({ code: "PLUGIN_ID_MISMATCH", message: "This package is a different plugin. Choose a package for the plugin you are updating." });
143
+ const snapshotSettings = optional.snapshotSettings;
144
+ if (!snapshotSettings)
145
+ throw new Error("Agent Plugin update is unavailable: the host did not bind the plugin settings snapshot owner.");
146
+ const pluginHost = optional.pluginHost;
147
+ const lifecycle = optional.createLifecycle({ layout: optional.layout }, {
148
+ ...(optional.mcpProvisioning ? { mcpProvisioning: optional.mcpProvisioning } : {}),
149
+ ...(pluginHost ? { identityAdmission: ({ id, localId, run }) => pluginHost.withInstallIdentity({ candidate: { id, localId, family: "agent-plugin" }, run }) } : {}),
150
+ });
151
+ return lifecycle.updateAgentPlugin({ archive: required.archive, expectedSha256: required.expectedSha256, archiveReader: required.archiveReader,
152
+ layout: optional.layout, workspaceId: required.workspaceId, actor: required.actor, ...required.update, snapshotSettings });
153
+ }
154
+ /** Same id is the upgrade identity; different bytes alone are not evidence of a different plugin.
155
+ * Bundled provenance and active/undetermined records are checked strictly before a replacement.
156
+ * Downgrades are refused here, the path preview and install share, so preview never offers a
157
+ * replacement that install would then refuse. */
158
+ async function checkExisting(required, _optional = {}) {
159
+ const { listInstalledPlugins } = required.lifecycle;
160
+ const existing = (await listInstalledPlugins({ workspaceRoot: required.workspaceRoot })).filter(plugin => plugin.pluginId === required.pluginId);
161
+ if (!existing.some(plugin => plugin.archiveDigest === required.digest) && existing.length > 0)
162
+ await assertReplaceable(required);
163
+ for (const previous of existing) {
164
+ if (planAgentPluginUpdate({ installed: previous, candidate: required.candidate }).action === "downgrade-refused")
165
+ throw new AgentPluginUpdateError({ code: "PLUGIN_DOWNGRADE_REFUSED", message: "Plugin downgrades are refused." });
166
+ }
167
+ return existing;
168
+ }
169
+ /** A different package under an installed id replaces it only when asked, never a bundled plugin,
170
+ * and only while the installed one is switched off. */
171
+ async function assertReplaceable(required, _optional = {}) {
172
+ const { isAgentPluginRecordedAsBundled, resolveAgentPluginActivation } = required.lifecycle;
173
+ if (!required.replace)
174
+ throw new AgentPluginUploadError({ code: "PLUGIN_ID_TAKEN", message: "This plugin ID is already installed. Choose Replace existing version to upgrade it." });
175
+ if (await isAgentPluginRecordedAsBundled({ workspaceRoot: required.workspaceRoot, pluginId: required.pluginId }))
176
+ throw new AgentPluginUploadError({ code: "PLUGIN_BUNDLED", message: "A bundled plugin owns this ID and cannot be replaced by an uploaded plugin." });
177
+ if ((await resolveAgentPluginActivation({ workspaceRoot: required.workspaceRoot, pluginId: required.pluginId })).verdict !== "inactive")
178
+ throw new AgentPluginUploadError({ code: "PLUGIN_ENABLED", message: "Switch off the installed plugin before replacing its version." });
179
+ }
180
+ /** Every uploaded package carries this, install and update alike; only install adds that it stays OFF,
181
+ * since an update keeps the installed plugin's on/off state. */
182
+ export const UPLOADED_AGENT_PLUGIN_TRUST_WARNING = "Trust: local / unverified publisher. Uploaded Agent Plugin code is not trusted to run. Skills can guide the assistant.";
183
+ /** Extracts through the real install validator in staging; preview never publishes code or memory.
184
+ * Host paths from that ephemeral extraction are deliberately absent from this projection. */
185
+ export async function previewUploadedAgentPlugin(required, optional) {
186
+ validateUploadedBytes({ ...required, maxAgentPluginInstallArchiveBytes: optional.maxAgentPluginInstallArchiveBytes, sha256: optional.sha256 });
187
+ const reader = optional.archiveReader;
188
+ const layout = optional.layout;
189
+ const { installAgentPlugin } = optional.lifecycle;
190
+ const { prefix, pluginId } = await locatePackage(reader, required.archive, optional.parseManifest);
191
+ const plugin = await installAgentPlugin({ archive: required.archive, expectedSha256: required.expectedSha256,
192
+ archiveReader: withinPrefix({ reader, prefix }), layout, workspaceId: required.workspaceId }, { previewOnly: true });
193
+ const existing = await checkExisting({ workspaceRoot: layout.forWorkspace({ workspaceId: required.workspaceId }).root, pluginId, digest: plugin.archiveDigest, replace: required.replace === true, candidate: plugin, lifecycle: optional.lifecycle });
194
+ const upgradeFrom = existing.filter(entry => entry.archiveDigest !== plugin.archiveDigest).flatMap(entry => entry.version ? [entry.version] : []);
195
+ return { pluginId, ...(plugin.version ? { version: plugin.version } : {}), digest: plugin.archiveDigest,
196
+ skills: plugin.skills.map(skill => skill.name), ...(upgradeFrom.length > 0 ? { upgradeFrom } : {}),
197
+ warning: `${UPLOADED_AGENT_PLUGIN_TRUST_WARNING} It stays OFF until you enable it.`,
198
+ };
199
+ }
200
+ /** Both preview and install check the upload cap/digest before a reader opens any stream.
201
+ * installAgentPlugin repeats these checks at the extraction boundary. */
202
+ function validateUploadedBytes(required, _optional = {}) {
203
+ if (required.archive.byteLength > required.maxAgentPluginInstallArchiveBytes()) {
204
+ throw new AgentPluginInstallError({ code: "ARCHIVE_TOO_LARGE", message: "archive exceeds the 32 MiB upload cap" });
205
+ }
206
+ const digest = required.sha256(required.archive);
207
+ if (!/^[a-f0-9]{64}$/i.test(required.expectedSha256) || digest !== required.expectedSha256.toLowerCase()) {
208
+ throw new AgentPluginInstallError({ code: "DIGEST_MISMATCH", message: "the uploaded bytes do not match the file that was chosen" });
209
+ }
210
+ return digest;
211
+ }
212
+ async function scanPackageManifests({ reader, archive }, _optional = {}) {
213
+ const manifests = new Map();
214
+ const topLevel = new Set();
215
+ let count = 0;
216
+ try {
217
+ for await (const entry of reader.entries({ archive })) {
218
+ count++;
219
+ if (count > MAX_PREPASS_ENTRIES)
220
+ throw new AgentPluginInstallError({ code: "TOO_MANY_ENTRIES", message: `archive exceeds the ${MAX_PREPASS_ENTRIES}-entry cap` });
221
+ await indexPackageManifest({ entry, manifests, topLevel });
222
+ }
223
+ }
224
+ catch (error) {
225
+ if (error instanceof AgentPluginInstallError)
226
+ throw error;
227
+ throw new AgentPluginUploadError({ code: "ARCHIVE_UNREADABLE", message: "the file is not a readable .zip archive" }, { cause: error });
228
+ }
229
+ return { manifests, topLevel };
230
+ }
231
+ async function indexPackageManifest({ entry, manifests, topLevel }, _optional = {}) {
232
+ const name = entry.entryPath.replaceAll("\\", "/").replace(/^\.\//, "");
233
+ const [head] = name.split("/");
234
+ if (head && !IGNORED_TOP_LEVEL.has(head))
235
+ topLevel.add(name.includes("/") ? `${head}/` : head);
236
+ if (entry.kind === "file" && /^(?:[^/]+\/)?plugin\.json$/.test(name))
237
+ manifests.set(name, await readBounded(entry.openReadStream({})));
238
+ }
239
+ async function removeFailedPublication({ packagesDir, digest, staged, lstat, removeFrozenPackageTree, path: paths }, _optional = {}) {
240
+ const destination = paths.join(packagesDir, digest);
241
+ // publish can fail while freezing its new tree. Remove that tree before restoring the old
242
+ // one, so a failed upgrade never leaves two resolvable versions under the same id.
243
+ if (staged.length > 0) {
244
+ try {
245
+ if ((await lstat(destination)).isDirectory())
246
+ await removeFrozenPackageTree({ root: destination });
247
+ }
248
+ catch (cleanupError) {
249
+ if (cleanupError.code !== "ENOENT")
250
+ throw cleanupError;
251
+ }
252
+ }
253
+ }
254
+ async function retireReplacedPackages({ staged, pluginId, removeFrozenPackageTree, warnCleanup }, _optional = {}) {
255
+ // Publication is settled. Cleanup must never delete the new version then try to restore
256
+ // an old tree whose cleanup already succeeded. Quarantine names are excluded from discovery.
257
+ for (const tree of staged) {
258
+ try {
259
+ await removeFrozenPackageTree({ root: tree.quarantined });
260
+ }
261
+ catch (error) {
262
+ warnCleanup({ pluginId, error });
263
+ }
264
+ }
265
+ }
266
+ async function publishUploadedAgentPlugin({ workspaceLayout, pluginId, digest, required, optional, indexed, publish, actor, stageForRemoval, restoreStagedTrees, setAgentPluginActivation, assertOwnedPluginPath, containAgentPluginStatePath, markAlreadyInstalled, setUpgradeFrom }, _optional = {}) {
267
+ const existing = await checkExisting({ workspaceRoot: workspaceLayout.root, pluginId, digest, replace: required.replace === true, candidate: indexed, lifecycle: optional.lifecycle });
268
+ const same = existing.find(entry => entry.archiveDigest === digest);
269
+ if (same) {
270
+ markAlreadyInstalled();
271
+ return same;
272
+ }
273
+ setUpgradeFrom(existing.flatMap(entry => entry.version ? [entry.version] : []));
274
+ const staged = [];
275
+ const packagesDir = workspaceLayout.pluginPackagesDir({ pluginId });
276
+ await assertOwnedPluginPath({ contain: containAgentPluginStatePath, workspaceRoot: workspaceLayout.root, entryPath: (optional.path ?? path).relative(workspaceLayout.root, packagesDir) });
277
+ let installed;
278
+ try {
279
+ for (const previous of existing)
280
+ staged.push(await stageForRemoval({ packagesDir, packageRoot: previous.packageRoot }));
281
+ // Write OFF before publication: a missing activation record otherwise means active.
282
+ // Replacement already proved this record OFF; preserve it exactly on success or rollback.
283
+ if (existing.length === 0)
284
+ await setAgentPluginActivation({ workspaceRoot: workspaceLayout.root, pluginId, enabled: false, actor }, { origin: "operator-installed" });
285
+ installed = await publish();
286
+ }
287
+ catch (error) {
288
+ await removeFailedPublication({ packagesDir, digest, staged, lstat: optional.lstat, removeFrozenPackageTree: optional.lifecycle.removeFrozenPackageTree, path: optional.path ?? path });
289
+ throw await restoreStagedTrees({ staged, cause: error });
290
+ }
291
+ await retireReplacedPackages({ staged, pluginId, removeFrozenPackageTree: optional.lifecycle.removeFrozenPackageTree, warnCleanup: optional.warnCleanup });
292
+ return installed;
293
+ }
294
+ export function createAgentPluginUpload(required, _optional = {}) {
295
+ function install(input, optional = {}) { return installUploadedAgentPlugin(input, { ...required, ...optional }); }
296
+ return {
297
+ installUploadedAgentPlugin: install,
298
+ previewUploadedAgentPlugin: (input, optional = {}) => previewUploadedAgentPlugin(input, { ...required, ...optional }),
299
+ };
300
+ }
301
+ export function bindAgentPluginUpload(required, _optional = {}) {
302
+ // Install and preview share one adapter: both hand the engine the object-arg archive reader.
303
+ const lifecycles = {
304
+ lifecycle: { ...required.lifecycle, installAgentPlugin: (input, optional) => required.lifecycle.installAgentPlugin({ ...input, archiveReader: toZeroArgArchiveReader({ reader: input.archiveReader }) }, optional) },
305
+ createLifecycle: (input, optional) => {
306
+ const lifecycle = required.createLifecycle(input, optional);
307
+ return { updateAgentPlugin: input => lifecycle.updateAgentPlugin({ ...input, archiveReader: toZeroArgArchiveReader({ reader: input.archiveReader }) }) };
308
+ },
309
+ };
310
+ function install(input, optional) {
311
+ return installUploadedAgentPlugin(input, {
312
+ ...required, ...optional, archiveReader: optional.archiveReader ? toObjectArgArchiveReader({ reader: optional.archiveReader }) : required.archiveReader(),
313
+ ...lifecycles,
314
+ });
315
+ }
316
+ return {
317
+ installUploadedAgentPlugin: install,
318
+ previewUploadedAgentPlugin: (input, optional) => previewUploadedAgentPlugin(input, {
319
+ ...required, ...optional, archiveReader: optional.archiveReader ? toObjectArgArchiveReader({ reader: optional.archiveReader }) : required.archiveReader(),
320
+ ...lifecycles,
321
+ }),
322
+ };
323
+ }
324
+ //# sourceMappingURL=install-upload.js.map
@@ -0,0 +1,5 @@
1
+ export declare function memoryText({ key, locale }: {
2
+ key: string;
3
+ locale?: string;
4
+ }, _optional?: {}): string;
5
+ //# sourceMappingURL=memory-i18n.d.ts.map
@@ -0,0 +1,176 @@
1
+ const dictionary = {
2
+ "es": {
3
+ "Save note": "Guardar nota",
4
+ "Uninstall · keep memory": "Desinstalar · conservar memoria",
5
+ "Uninstall and delete memory": "Desinstalar y eliminar memoria",
6
+ "Save plugin note?": "¿Guardar nota del plugin?",
7
+ "File": "Archivo",
8
+ "Note": "Nota"
9
+ },
10
+ "id": {
11
+ "Save note": "Simpan catatan",
12
+ "Uninstall · keep memory": "Copot · simpan memori",
13
+ "Uninstall and delete memory": "Copot dan hapus memori",
14
+ "Save plugin note?": "Simpan catatan plugin?",
15
+ "File": "Berkas",
16
+ "Note": "Catatan"
17
+ },
18
+ "de": {
19
+ "Save note": "Notiz speichern",
20
+ "Uninstall · keep memory": "Deinstallieren · Speicher behalten",
21
+ "Uninstall and delete memory": "Deinstallieren und Speicher löschen",
22
+ "Save plugin note?": "Plugin-Notiz speichern?",
23
+ "File": "Datei",
24
+ "Note": "Notiz"
25
+ },
26
+ "zh-CN": {
27
+ "Save note": "保存笔记",
28
+ "Uninstall · keep memory": "卸载 · 保留记忆",
29
+ "Uninstall and delete memory": "卸载并删除记忆",
30
+ "Save plugin note?": "保存插件笔记?",
31
+ "File": "文件",
32
+ "Note": "笔记"
33
+ },
34
+ "zh-TW": {
35
+ "Save note": "儲存筆記",
36
+ "Uninstall · keep memory": "解除安裝 · 保留記憶",
37
+ "Uninstall and delete memory": "解除安裝並刪除記憶",
38
+ "Save plugin note?": "儲存外掛筆記?",
39
+ "File": "檔案",
40
+ "Note": "筆記"
41
+ },
42
+ "pt-BR": {
43
+ "Save note": "Salvar nota",
44
+ "Uninstall · keep memory": "Desinstalar · manter memória",
45
+ "Uninstall and delete memory": "Desinstalar e excluir memória",
46
+ "Save plugin note?": "Salvar nota do plugin?",
47
+ "File": "Arquivo",
48
+ "Note": "Nota"
49
+ },
50
+ "ru": {
51
+ "Save note": "Сохранить заметку",
52
+ "Uninstall · keep memory": "Удалить · сохранить память",
53
+ "Uninstall and delete memory": "Удалить плагин и память",
54
+ "Save plugin note?": "Сохранить заметку плагина?",
55
+ "File": "Файл",
56
+ "Note": "Заметка"
57
+ },
58
+ "fa": {
59
+ "Save note": "ذخیره یادداشت",
60
+ "Uninstall · keep memory": "حذف · حفظ حافظه",
61
+ "Uninstall and delete memory": "حذف افزونه و حافظه",
62
+ "Save plugin note?": "یادداشت افزونه ذخیره شود؟",
63
+ "File": "فایل",
64
+ "Note": "یادداشت"
65
+ },
66
+ "ar": {
67
+ "Save note": "حفظ الملاحظة",
68
+ "Uninstall · keep memory": "إزالة · الاحتفاظ بالذاكرة",
69
+ "Uninstall and delete memory": "إزالة الإضافة والذاكرة",
70
+ "Save plugin note?": "حفظ ملاحظة الإضافة؟",
71
+ "File": "ملف",
72
+ "Note": "ملاحظة"
73
+ },
74
+ "ja": {
75
+ "Save note": "メモを保存",
76
+ "Uninstall · keep memory": "アンインストール · メモリを保持",
77
+ "Uninstall and delete memory": "アンインストールしてメモリを削除",
78
+ "Save plugin note?": "プラグインのメモを保存しますか?",
79
+ "File": "ファイル",
80
+ "Note": "メモ"
81
+ },
82
+ "ko": {
83
+ "Save note": "메모 저장",
84
+ "Uninstall · keep memory": "제거 · 메모리 유지",
85
+ "Uninstall and delete memory": "제거 및 메모리 삭제",
86
+ "Save plugin note?": "플러그인 메모를 저장할까요?",
87
+ "File": "파일",
88
+ "Note": "메모"
89
+ },
90
+ "pl": {
91
+ "Save note": "Zapisz notatkę",
92
+ "Uninstall · keep memory": "Odinstaluj · zachowaj pamięć",
93
+ "Uninstall and delete memory": "Odinstaluj i usuń pamięć",
94
+ "Save plugin note?": "Zapisać notatkę wtyczki?",
95
+ "File": "Plik",
96
+ "Note": "Notatka"
97
+ },
98
+ "hu": {
99
+ "Save note": "Jegyzet mentése",
100
+ "Uninstall · keep memory": "Eltávolítás · memória megtartása",
101
+ "Uninstall and delete memory": "Eltávolítás és memória törlése",
102
+ "Save plugin note?": "Bővítményjegyzet mentése?",
103
+ "File": "Fájl",
104
+ "Note": "Jegyzet"
105
+ },
106
+ "fr": {
107
+ "Save note": "Enregistrer la note",
108
+ "Uninstall · keep memory": "Désinstaller · conserver la mémoire",
109
+ "Uninstall and delete memory": "Désinstaller et supprimer la mémoire",
110
+ "Save plugin note?": "Enregistrer une note du plugin ?",
111
+ "File": "Fichier",
112
+ "Note": "Note"
113
+ },
114
+ "uk": {
115
+ "Save note": "Зберегти нотатку",
116
+ "Uninstall · keep memory": "Видалити · зберегти пам’ять",
117
+ "Uninstall and delete memory": "Видалити плагін і пам’ять",
118
+ "Save plugin note?": "Зберегти нотатку плагіна?",
119
+ "File": "Файл",
120
+ "Note": "Нотатка"
121
+ },
122
+ "tr": {
123
+ "Save note": "Notu kaydet",
124
+ "Uninstall · keep memory": "Kaldır · belleği koru",
125
+ "Uninstall and delete memory": "Kaldır ve belleği sil",
126
+ "Save plugin note?": "Eklenti notu kaydedilsin mi?",
127
+ "File": "Dosya",
128
+ "Note": "Not"
129
+ },
130
+ "th": {
131
+ "Save note": "บันทึกโน้ต",
132
+ "Uninstall · keep memory": "ถอนการติดตั้ง · เก็บหน่วยความจำ",
133
+ "Uninstall and delete memory": "ถอนการติดตั้งและลบหน่วยความจำ",
134
+ "Save plugin note?": "บันทึกโน้ตของปลั๊กอินหรือไม่",
135
+ "File": "ไฟล์",
136
+ "Note": "บันทึก"
137
+ },
138
+ "it": {
139
+ "Save note": "Salva nota",
140
+ "Uninstall · keep memory": "Disinstalla · conserva memoria",
141
+ "Uninstall and delete memory": "Disinstalla ed elimina memoria",
142
+ "Save plugin note?": "Salvare la nota del plugin?",
143
+ "File": "File",
144
+ "Note": "Nota"
145
+ },
146
+ "hi": {
147
+ "Save note": "नोट सहेजें",
148
+ "Uninstall · keep memory": "हटाएँ · मेमोरी रखें",
149
+ "Uninstall and delete memory": "हटाएँ और मेमोरी मिटाएँ",
150
+ "Save plugin note?": "प्लगइन नोट सहेजें?",
151
+ "File": "फ़ाइल",
152
+ "Note": "नोट"
153
+ },
154
+ "ur": {
155
+ "Save note": "نوٹ محفوظ کریں",
156
+ "Uninstall · keep memory": "ہٹائیں · میموری رکھیں",
157
+ "Uninstall and delete memory": "ہٹائیں اور میموری حذف کریں",
158
+ "Save plugin note?": "پلگ ان نوٹ محفوظ کریں؟",
159
+ "File": "فائل",
160
+ "Note": "نوٹ"
161
+ },
162
+ "bn": {
163
+ "Save note": "নোট সংরক্ষণ",
164
+ "Uninstall · keep memory": "আনইনস্টল · মেমরি রাখুন",
165
+ "Uninstall and delete memory": "আনইনস্টল ও মেমরি মুছুন",
166
+ "Save plugin note?": "প্লাগইনের নোট সংরক্ষণ করবেন?",
167
+ "File": "ফাইল",
168
+ "Note": "নোট"
169
+ }
170
+ };
171
+ export function memoryText({ key, locale = "en" }, _optional = {}) {
172
+ // Own keys only: an inherited name ("toString", "constructor") is not a translation.
173
+ const table = Object.hasOwn(dictionary, locale) ? dictionary[locale] : undefined;
174
+ return table !== undefined && Object.hasOwn(table, key) ? table[key] ?? key : key;
175
+ }
176
+ //# sourceMappingURL=memory-i18n.js.map
@@ -0,0 +1,80 @@
1
+ import { migratePluginLayout, type PluginStateEffects, type WorkspaceMigrationOwnership } from "@jini-ai/agent-plugins/persistent-state";
2
+ import type { parseAgentPluginManifest } from "../lifecycle/manifest.js";
3
+ import type { AgentPluginLayout } from "@jini-ai/core/contracts/headless/plugin-host";
4
+ export declare function appendPluginNotes(required: PluginStateEffects & {
5
+ workspaceRoot: string;
6
+ pluginId: string;
7
+ guidance: string;
8
+ }, _optional?: {}): Promise<string>;
9
+ declare function discoverSiteWorkspaceIds(required: {
10
+ layout: AgentPluginLayout;
11
+ workspaceId: string;
12
+ filesystem: PluginStateEffects['filesystem'];
13
+ migrateAgentPluginLayout(input: {
14
+ workspaceId: string;
15
+ }, optional?: {
16
+ ownership?: WorkspaceMigrationOwnership;
17
+ }): ReturnType<typeof migratePluginLayout>;
18
+ warnInvalidWorkspace(input: {
19
+ name: string;
20
+ error: unknown;
21
+ }): void;
22
+ warnMigration(input: {
23
+ workspaceId: string;
24
+ error: unknown;
25
+ }): void;
26
+ }, _optional?: {}): Promise<Set<string>>;
27
+ /** The web boot owns the site tree, including workspaces the current request is not serving.
28
+ * With `ownership` (the active workspace's lock is already held) only the active workspace migrates,
29
+ * under that lock: its siblings ran first through {@link migrateSiblingAgentPluginLayouts}, because
30
+ * holding one workspace's lock while acquiring another's could deadlock two boots. */
31
+ export declare function migrateSiteAgentPluginLayouts(required: Parameters<typeof discoverSiteWorkspaceIds>[0], optional?: {
32
+ ownership?: WorkspaceMigrationOwnership;
33
+ }): Promise<{
34
+ complete: boolean;
35
+ moved: number;
36
+ }>;
37
+ /** Migrates every other site workspace, one lock at a time and with no lock held across them. A
38
+ * sibling's fault is logged and never blocks the active workspace's seed. */
39
+ export declare function migrateSiblingAgentPluginLayouts(required: Parameters<typeof discoverSiteWorkspaceIds>[0], _optional?: {}): Promise<void>;
40
+ export declare function createPluginMemoryBindings(required: Pick<PluginStateEffects, 'filesystem' | 'withLock'> & {
41
+ parseManifest: typeof parseAgentPluginManifest;
42
+ onEvent: NonNullable<Parameters<typeof migratePluginLayout>[0]['onEvent']>;
43
+ warnInvalidWorkspace: Parameters<typeof discoverSiteWorkspaceIds>[0]['warnInvalidWorkspace'];
44
+ warnMigration: Parameters<typeof discoverSiteWorkspaceIds>[0]['warnMigration'];
45
+ }, _optional?: {}): {
46
+ pluginMemory: (input: Pick<PluginStateEffects, "contain"> & {
47
+ workspaceId: string;
48
+ pluginId: string;
49
+ layout: AgentPluginLayout;
50
+ }, _optional?: {}) => import("@jini-ai/agent-plugins/persistent-state").PluginMemory;
51
+ migrateAgentPluginLayout: (input: Pick<PluginStateEffects, "contain"> & {
52
+ layout: AgentPluginLayout;
53
+ workspaceId: string;
54
+ }, optional?: {
55
+ ownership?: WorkspaceMigrationOwnership;
56
+ }) => Promise<{
57
+ complete: boolean;
58
+ moved: number;
59
+ }>;
60
+ appendPluginNotes: (input: Pick<PluginStateEffects, "contain"> & {
61
+ workspaceRoot: string;
62
+ pluginId: string;
63
+ guidance: string;
64
+ }, _optional?: {}) => Promise<string>;
65
+ migrateSiteAgentPluginLayouts: (input: Pick<PluginStateEffects, "contain"> & {
66
+ layout: AgentPluginLayout;
67
+ workspaceId: string;
68
+ }, optional?: {
69
+ ownership?: WorkspaceMigrationOwnership;
70
+ }) => Promise<{
71
+ complete: boolean;
72
+ moved: number;
73
+ }>;
74
+ migrateSiblingAgentPluginLayouts: (input: Pick<PluginStateEffects, "contain"> & {
75
+ layout: AgentPluginLayout;
76
+ workspaceId: string;
77
+ }, _optional?: {}) => Promise<void>;
78
+ };
79
+ export {};
80
+ //# sourceMappingURL=memory.d.ts.map