@chosengeneration/light-code 0.146.0 → 0.147.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.cjs CHANGED
@@ -79288,6 +79288,7 @@ ${preview.text}` } : {}
79288
79288
  nativeGuide: ui.openWalkthrough !== void 0,
79289
79289
  exportsSource: services.sourceArchive !== void 0,
79290
79290
  picksFiles: ui.pickContextFiles !== void 0,
79291
+ savesFiles: ui.savesFiles === true,
79291
79292
  /*
79292
79293
  * Whether this host has a theme of its own to follow.
79293
79294
  *
@@ -85374,6 +85375,31 @@ ${redact(shown2, cachedSecretValues)}` }
85374
85375
  fail(error51 instanceof Error ? error51.message : String(error51));
85375
85376
  }
85376
85377
  }
85378
+ const SAVE_FILE_LIMIT = 20 * 1024 * 1024;
85379
+ async function handleSaveFile(requestId, name, base643) {
85380
+ const answer = (result) => post({ type: "fileSaved", requestId, ...result });
85381
+ const bytes = Buffer.from(base643, "base64");
85382
+ if (bytes.length === 0 || bytes.length > SAVE_FILE_LIMIT) {
85383
+ answer({ error: bytes.length === 0 ? "There was nothing to save." : "That file is too large to save from here." });
85384
+ return;
85385
+ }
85386
+ const safeName = [...import_node_path50.default.basename(name)].map((c2) => c2.charCodeAt(0) < 32 || '<>:"/\\|?*'.includes(c2) ? "-" : c2).join("") || "file";
85387
+ const extension = import_node_path50.default.extname(safeName).slice(1);
85388
+ try {
85389
+ const target = await ui.showSaveDialog({
85390
+ defaultName: workspaceRoot !== void 0 ? import_node_path50.default.join(workspaceRoot, safeName) : safeName,
85391
+ ...extension.length > 0 ? { extensions: [extension] } : {}
85392
+ });
85393
+ if (target === void 0) {
85394
+ answer({});
85395
+ return;
85396
+ }
85397
+ await import_promises27.default.writeFile(target, bytes);
85398
+ answer({ path: target });
85399
+ } catch (error51) {
85400
+ answer({ error: `Could not save it: ${error51 instanceof Error ? error51.message : String(error51)}` });
85401
+ }
85402
+ }
85377
85403
  async function handleExportSource() {
85378
85404
  const archive = services.sourceArchive;
85379
85405
  if (archive === void 0)
@@ -86199,6 +86225,8 @@ ${redact(shown2, cachedSecretValues)}` }
86199
86225
  reportFailure("handleDuplicateMcpServer", handleDuplicateMcpServer(message4.name));
86200
86226
  } else if (message4.type === "deleteMcpServer") {
86201
86227
  reportFailure("handleDeleteMcpServer", handleDeleteMcpServer(message4.name));
86228
+ } else if (message4.type === "saveFile") {
86229
+ reportFailure("handleSaveFile", handleSaveFile(message4.requestId, message4.name, message4.base64));
86202
86230
  } else if (message4.type === "browseForPath") {
86203
86231
  reportFailure("handleBrowseForPath", handleBrowseForPath(message4.purpose, message4.kind, message4.extensions));
86204
86232
  } else if (message4.type === "probePythonEnv") {
@@ -90444,6 +90472,33 @@ sent; keep them short, they are paid for on every request.
90444
90472
  **Standing instructions** are a skill with \`always: true\` (Settings \u2192 Skills \u2192 Standing
90445
90473
  instructions). They can live in the repository or a shared bucket, so they can apply to many
90446
90474
  codebases and a whole team. Fire Code's dialog has a button that opens them too.
90475
+ `
90476
+ },
90477
+ {
90478
+ id: "diagrams",
90479
+ title: "Diagrams in the chat: SVG and PNG",
90480
+ keywords: [
90481
+ "diagram",
90482
+ "flowchart",
90483
+ "flow chart",
90484
+ "architecture diagram",
90485
+ "draw",
90486
+ "save svg",
90487
+ "save png",
90488
+ "save diagram",
90489
+ "export diagram",
90490
+ "download diagram",
90491
+ "diagram as image",
90492
+ "show_diagram"
90493
+ ],
90494
+ body: `
90495
+ Ask for a diagram ("draw the request flow", "show the architecture") and the assistant draws one in the
90496
+ chat with \`show_diagram\`. It follows your theme and accent.
90497
+
90498
+ Under each diagram: **Copy SVG** copies the markup to paste into a document or editor; **Save SVG** and
90499
+ **Save PNG** open a Save dialog - VS Code's own, or a Windows one in Fire Code starting in Downloads - and
90500
+ say where the file went. A PNG is drawn at twice the size so it stays sharp in a slide. In a plain browser
90501
+ the file downloads instead. If a save fails, the reason is shown under the buttons.
90447
90502
  `
90448
90503
  },
90449
90504
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chosengeneration/light-code",
3
- "version": "0.146.0",
3
+ "version": "0.147.0",
4
4
  "description": "A minimal agentic coding assistant, served to your browser from a local Node server",
5
5
  "license": "MIT",
6
6
  "type": "module",