@larkup/marketplace 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @larkup/marketplace
2
2
 
3
+ ## 0.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 5ba20af: Make the local crawler work without Docker, make Marketplace installs opt-in and removable, and bound RAG retrieval tool loops and context growth.
8
+
9
+ ## 0.1.8
10
+
11
+ ### Patch Changes
12
+
13
+ - 592c637: Fix standalone startup and Docker runtime compatibility, make bundled marketplace tools ready immediately, and improve ingestion, chat retrieval, media preview, and analytics feedback.
14
+
3
15
  ## 0.1.7
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@larkup/marketplace",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,6 +14,16 @@ import { getToolById, invalidateRegistryCache } from './tool-registry';
14
14
 
15
15
  const execAsync = promisify(execCb);
16
16
 
17
+ // npm mutates a shared node_modules tree. Serializing those mutations prevents
18
+ // double-clicks or concurrent API requests from colliding during npm's rename
19
+ // phase (the source of the ENOTEMPTY failures seen in installed applications).
20
+ let packageMutationChain: Promise<unknown> = Promise.resolve();
21
+ function serializePackageMutation<T>(fn: () => Promise<T>): Promise<T> {
22
+ const run = packageMutationChain.then(fn, fn);
23
+ packageMutationChain = run.catch(() => {});
24
+ return run;
25
+ }
26
+
17
27
  /**
18
28
  * Tool installer — manages installing / uninstalling marketplace tools.
19
29
  *
@@ -95,28 +105,11 @@ async function writeManifest(manifest: InstalledToolsManifest) {
95
105
 
96
106
  export async function getInstalledTools(): Promise<InstalledTool[]> {
97
107
  const manifest = await readManifest();
98
- const tools = [...manifest.tools];
99
- const bundledIds = (process.env.LARKUP_BUNDLED_TOOLS ?? '')
100
- .split(',')
101
- .map((id) => id.trim())
102
- .filter(Boolean);
103
-
104
- for (const toolId of bundledIds) {
105
- if (tools.some((tool) => tool.id === toolId)) continue;
106
- const descriptor = await getToolById(toolId);
107
- if (!descriptor) continue;
108
- tools.push({
109
- id: toolId,
110
- version: descriptor.version,
111
- installedAt: 'bundled',
112
- packageName: descriptor.packageName,
113
- resolvedPath: descriptor.packageName,
114
- source: 'local',
115
- config: buildDefaultConfig(descriptor),
116
- });
117
- }
118
-
119
- return tools;
108
+ // A package being bundled with the application only makes it *available* to
109
+ // install. It must not silently enable an optional capability or make the
110
+ // Marketplace claim it was installed. The manifest is the single source of
111
+ // truth, which also makes uninstall immediately reflect in the UI.
112
+ return [...manifest.tools];
120
113
  }
121
114
 
122
115
  export async function isToolInstalled(toolId: string): Promise<boolean> {
@@ -233,6 +226,17 @@ async function execInstall(
233
226
  version: string,
234
227
  target: DeploymentTarget,
235
228
  onProgress?: (message: string) => void,
229
+ ): Promise<{ resolvedPath: string; version: string }> {
230
+ return serializePackageMutation(() =>
231
+ execInstallUnlocked(packageName, version, target, onProgress),
232
+ );
233
+ }
234
+
235
+ async function execInstallUnlocked(
236
+ packageName: string,
237
+ version: string,
238
+ target: DeploymentTarget,
239
+ onProgress?: (message: string) => void,
236
240
  ): Promise<{ resolvedPath: string; version: string }> {
237
241
  const toolsDir = getToolsDir();
238
242