@chosengeneration/light-code 0.62.0 → 0.67.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.
@@ -1,19 +1,19 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Light Code</title>
7
- <link rel="stylesheet" href="/client.css" />
8
- </head>
9
- <body>
10
- <!--
11
- The theme variables the UI styles against are supplied by VS Code in the extension.
12
- In a browser there is no host to supply them, so client.css defines the same names.
13
- That keeps packages/ui identical across both hosts rather than branching on it.
14
- -->
15
- <div id="status" role="status"></div>
16
- <div id="root"></div>
17
- <script src="/client.js"></script>
18
- </body>
19
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Light Code</title>
7
+ <link rel="stylesheet" href="client.css" />
8
+ </head>
9
+ <body>
10
+ <!--
11
+ The theme variables the UI styles against are supplied by VS Code in the extension.
12
+ In a browser there is no host to supply them, so client.css defines the same names.
13
+ That keeps packages/ui identical across both hosts rather than branching on it.
14
+ -->
15
+ <div id="status" role="status"></div>
16
+ <div id="root"></div>
17
+ <script src="client.js"></script>
18
+ </body>
19
+ </html>
package/dist/server.js CHANGED
@@ -40047,6 +40047,7 @@ function dispatcherEnabled(retrieval) {
40047
40047
  function skillRetrievalEnabled(retrieval) {
40048
40048
  return dispatcherEnabled(retrieval) && retrieval?.skills !== false;
40049
40049
  }
40050
+ var aliasNameSchema = external_exports.string().regex(/^[a-z0-9][a-z0-9._-]{0,48}$/, "Start with a letter or digit, then lowercase letters, digits, dot, dash or underscore");
40050
40051
  var embedderConfigSchema = external_exports.object({
40051
40052
  profileId: external_exports.string().min(1),
40052
40053
  model: external_exports.string().min(1),
@@ -40098,7 +40099,28 @@ var embedderConfigSchema = external_exports.object({
40098
40099
  * keeping their code indexes to themselves — skills are prose somebody wrote on purpose,
40099
40100
  * source is not.
40100
40101
  */
40101
- skillsAlias: external_exports.string().regex(/^[a-z0-9][a-z0-9._-]{0,48}$/, "Start with a letter or digit, then lowercase letters, digits, dot, dash or underscore")
40102
+ skillsAlias: external_exports.string().regex(/^[a-z0-9][a-z0-9._-]{0,48}$/, "Start with a letter or digit, then lowercase letters, digits, dot, dash or underscore"),
40103
+ /**
40104
+ * Further names the codebase index answers to, beyond `indexAlias`.
40105
+ *
40106
+ * An index may carry several, and that is what makes *levels* of sharing possible rather than
40107
+ * a single pool: the same index can be reachable as `my-squad`, as `platform-team` and as
40108
+ * `everyone`, and searching one of those reaches exactly the people who attached it. With one
40109
+ * name there is one circle, and you are either in it or out of it.
40110
+ *
40111
+ * Order is meaningful — the first is the default, and is what `scope: "team"` resolves to.
40112
+ * Read through `rag/aliases.ts` together with the singular key, never directly, so the two
40113
+ * spellings cannot drift.
40114
+ */
40115
+ indexAliases: external_exports.array(aliasNameSchema).max(8).optional(),
40116
+ /**
40117
+ * The same for skills.
40118
+ *
40119
+ * Kept separate from the codebase list rather than derived from it, for the reason
40120
+ * `skillsAlias` already records: pooling your source and pooling what you have *taught* the
40121
+ * assistant are different decisions, and a team routinely wants one without the other.
40122
+ */
40123
+ skillsAliases: external_exports.array(aliasNameSchema).max(8).optional()
40102
40124
  }).partial();
40103
40125
  var globalTlsSchema = tlsSettingsSchema;
40104
40126
  var identityConfigSchema = external_exports.object({
@@ -46819,11 +46841,48 @@ Filters: ${JSON.stringify(params.filters)}` : ""}`
46819
46841
 
46820
46842
  // ../../packages/core/dist/tools/searchCodebase.js
46821
46843
  import path9 from "node:path";
46844
+
46845
+ // ../../packages/core/dist/rag/aliases.js
46846
+ function codebaseAliases(config2) {
46847
+ return merge2(config2?.embedder?.indexAlias, config2?.embedder?.indexAliases);
46848
+ }
46849
+ function skillAliases(config2) {
46850
+ return merge2(config2?.embedder?.skillsAlias, config2?.embedder?.skillsAliases);
46851
+ }
46852
+ function aliasForScope(scope, aliases) {
46853
+ const wanted = scope.trim().toLowerCase();
46854
+ if (wanted.length === 0 || wanted === "mine")
46855
+ return void 0;
46856
+ if (wanted === "team")
46857
+ return aliases[0];
46858
+ return aliases.find((alias) => alias.toLowerCase() === wanted);
46859
+ }
46860
+ function merge2(single, many) {
46861
+ const out = [];
46862
+ for (const value of [single, ...many ?? []]) {
46863
+ const trimmed = value?.trim();
46864
+ if (trimmed === void 0 || trimmed.length === 0)
46865
+ continue;
46866
+ if (!out.some((existing) => existing.toLowerCase() === trimmed.toLowerCase()))
46867
+ out.push(trimmed);
46868
+ }
46869
+ return out;
46870
+ }
46871
+
46872
+ // ../../packages/core/dist/tools/searchCodebase.js
46822
46873
  var paramsSchema6 = external_exports.object({
46823
46874
  query: external_exports.string().min(1).describe('What you are looking for, described in plain words \u2014 e.g. "where the retry backoff is calculated".'),
46824
46875
  size: external_exports.number().int().min(1).max(25).optional().describe("How many results to return. Default 8."),
46825
46876
  pathPrefix: external_exports.string().optional().describe('Restrict to a subtree, e.g. "packages/core/src". Omit to search everything indexed.'),
46826
- scope: external_exports.enum(["mine", "team"]).optional().describe(`Whose code to search. "mine" (default) is this workspace only. "team" also searches colleagues' indexed projects \u2014 use it for "how did anyone solve X", never for questions about the code in front of you. Team results are NOT on this machine and cannot be opened or edited.`)
46877
+ /*
46878
+ * A free string rather than an enum, because the scopes are whatever the user configured.
46879
+ *
46880
+ * An index may carry several aliases — a squad, a department, everyone — and each is a level of
46881
+ * sharing. The *description* names the ones that exist here, which is §12's carve-out: it varies
46882
+ * with a setting rather than with the turn, so the tool block stays byte-stable for a session
46883
+ * exactly as `ask_expert`'s does.
46884
+ */
46885
+ scope: external_exports.string().optional().describe('Whose code to search. "mine" (default) is this workspace only. Anything else names a shared scope \u2014 use it for "how did anyone solve X", never for questions about the code in front of you. Shared results are NOT on this machine and cannot be opened or edited.')
46827
46886
  });
46828
46887
  var DEFAULT_SIZE = 8;
46829
46888
  var REMOTE_GUIDANCE = [
@@ -46867,10 +46926,12 @@ function createSearchCodebaseTool(options) {
46867
46926
  const startedAt = Date.now();
46868
46927
  try {
46869
46928
  const size = params.size ?? DEFAULT_SIZE;
46870
- const wantsTeam = params.scope === "team";
46871
- const teamUnavailable = wantsTeam && options.teamAlias === void 0;
46872
- const searchingTeam = wantsTeam && options.teamAlias !== void 0;
46873
- const collection = searchingTeam ? options.teamAlias : options.index;
46929
+ const requested = params.scope?.trim() ?? "mine";
46930
+ const wantsTeam = requested.length > 0 && requested.toLowerCase() !== "mine";
46931
+ const alias = aliasForScope(requested, options.teamAliases ?? []);
46932
+ const teamUnavailable = wantsTeam && alias === void 0;
46933
+ const searchingTeam = wantsTeam && alias !== void 0;
46934
+ const collection = searchingTeam ? alias : options.index;
46874
46935
  const vector = await options.embedder.embed(params.query);
46875
46936
  const hits = await options.searcher.searchByVector(collection, vector, {
46876
46937
  size,
@@ -46916,7 +46977,12 @@ ${hit.text}`;
46916
46977
  "These are approximate. Read the files before relying on them, and use search_files if you know the exact term.",
46917
46978
  ...teamUnavailable ? [
46918
46979
  "",
46919
- "Team scope was asked for but no shared index is configured, so only this workspace was searched. Do not conclude from this that no colleague has solved it \u2014 their work was not looked at."
46980
+ /*
46981
+ * Which it was matters: nothing configured is a different thing to fix from a
46982
+ * scope that was misspelled, and naming the ones that exist turns a dead end
46983
+ * into a retry the model can get right.
46984
+ */
46985
+ (options.teamAliases ?? []).length === 0 ? "A shared scope was asked for but none is configured, so only this workspace was searched. Do not conclude from this that no colleague has solved it \u2014 their work was not looked at." : `There is no shared scope called "${requested}". The ones configured here are: ${(options.teamAliases ?? []).join(", ")}. Only this workspace was searched, so do not conclude that no colleague has solved it.`
46920
46986
  ] : [],
46921
46987
  ...anyRemote ? ["", ...REMOTE_GUIDANCE] : [],
46922
46988
  "",
@@ -47024,8 +47090,10 @@ ${hit.text}`;
47024
47090
  }
47025
47091
  async function indexTeamSkills(options) {
47026
47092
  await options.writer.ensureCollection(options.collection, options.embedder.dimensions, options.signal);
47027
- if (options.alias !== void 0 && options.writer.ensureAlias !== void 0) {
47028
- await options.writer.ensureAlias(options.collection, options.alias, options.signal);
47093
+ if (options.writer.ensureAlias !== void 0) {
47094
+ for (const alias of options.aliases ?? []) {
47095
+ await options.writer.ensureAlias(options.collection, alias, options.signal);
47096
+ }
47029
47097
  }
47030
47098
  if (options.skills.length === 0)
47031
47099
  return 0;
@@ -50176,7 +50244,8 @@ async function indexWorkspace(options) {
50176
50244
  };
50177
50245
  await writer.ensureCollection(index, embedder.dimensions, signal);
50178
50246
  if (options.alias !== void 0 && writer.ensureAlias !== void 0) {
50179
- await writer.ensureAlias(index, options.alias, signal);
50247
+ for (const alias of options.alias)
50248
+ await writer.ensureAlias(index, alias, signal);
50180
50249
  }
50181
50250
  const signature = chunkSignatureFor(options.chunkOptions);
50182
50251
  const stale = options.manifest.model !== embedder.model || options.manifest.dimensions !== embedder.dimensions || options.manifest.chunkSignature !== signature;
@@ -62562,7 +62631,7 @@ ${preview.text}` } : {}
62562
62631
  ...activePlan !== void 0 && activePlan.trim().length > 0 ? { plan: activePlan } : {},
62563
62632
  // Only when a pool actually exists: telling the model about a tool it has not been given
62564
62633
  // is how it comes to report that it looked somewhere it could not reach.
62565
- teamSkillsAvailable: config2.embedder?.skillsAlias !== void 0,
62634
+ teamSkillsAvailable: skillAliases(config2).length > 0,
62566
62635
  /*
62567
62636
  * Read from config rather than from the registry, because the prompt is built before the
62568
62637
  * registry is. Only the *off* case is claimed: "on but uv is missing" leaves the model
@@ -62699,7 +62768,7 @@ ${direction}` : attachMentions(text, mentions);
62699
62768
  * to look and every hit can say whose it is. Both absent on a solo install,
62700
62769
  * where team scope is simply unavailable and says so.
62701
62770
  */
62702
- ...config2.embedder?.indexAlias !== void 0 ? { teamAlias: config2.embedder.indexAlias } : {},
62771
+ ...codebaseAliases(config2).length > 0 ? { teamAliases: codebaseAliases(config2) } : {},
62703
62772
  ...indexOwner(config2) !== void 0 ? { owner: indexOwner(config2) } : {}
62704
62773
  } : void 0,
62705
62774
  /*
@@ -62715,10 +62784,11 @@ ${direction}` : attachMentions(text, mentions);
62715
62784
  * The team's shared skills. Needs an alias, a connection and an embedder — without
62716
62785
  * all three there is nothing to search, and the tool is simply not offered.
62717
62786
  */
62718
- config2.embedder?.skillsAlias !== void 0 && search !== void 0 && embedder !== void 0 ? {
62787
+ skillAliases(config2).length > 0 && search !== void 0 && embedder !== void 0 ? {
62719
62788
  searcher: search.searcher,
62720
62789
  embedder,
62721
- collection: config2.embedder.skillsAlias,
62790
+ // The first is the default circle, exactly as it is for the codebase index.
62791
+ collection: skillAliases(config2)[0],
62722
62792
  ...indexOwner(config2) !== void 0 ? { owner: indexOwner(config2) } : {}
62723
62793
  } : void 0,
62724
62794
  /*
@@ -63692,8 +63762,8 @@ ${direction}` : attachMentions(text, mentions);
63692
63762
  }
63693
63763
  async function handleAttachTeamAlias() {
63694
63764
  const config2 = await loadSettings();
63695
- const alias = config2.embedder?.indexAlias;
63696
- if (alias === void 0) {
63765
+ const aliases = codebaseAliases(config2);
63766
+ if (aliases.length === 0) {
63697
63767
  post({
63698
63768
  type: "teamAliasAttached",
63699
63769
  error: "Set a team index alias in Settings \u2192 Search first \u2014 there is nothing to attach to."
@@ -63718,7 +63788,8 @@ ${direction}` : attachMentions(text, mentions);
63718
63788
  });
63719
63789
  return;
63720
63790
  }
63721
- await writer.ensureAlias(index, alias);
63791
+ for (const alias of aliases)
63792
+ await writer.ensureAlias(index, alias);
63722
63793
  let attributed = 0;
63723
63794
  const owner = indexOwner(config2);
63724
63795
  if (owner !== void 0 && writer.attributeUnowned !== void 0) {
@@ -63728,7 +63799,7 @@ ${direction}` : attachMentions(text, mentions);
63728
63799
  ...project !== void 0 ? { project } : {}
63729
63800
  });
63730
63801
  }
63731
- post({ type: "teamAliasAttached", alias, index, attributed });
63802
+ post({ type: "teamAliasAttached", alias: aliases.join(", "), index, attributed });
63732
63803
  } catch (error51) {
63733
63804
  post({
63734
63805
  type: "teamAliasAttached",
@@ -64403,7 +64474,7 @@ ${direction}` : attachMentions(text, mentions);
64403
64474
  writer: createVectorIndexWriter(httpClient, search.store, await vectorStoreConnectionFor(search.store, search.id)),
64404
64475
  embedder,
64405
64476
  collection,
64406
- ...config2.embedder?.skillsAlias !== void 0 ? { alias: config2.embedder.skillsAlias } : {},
64477
+ aliases: skillAliases(config2),
64407
64478
  skills: withBodies,
64408
64479
  signal,
64409
64480
  onProgress: (done, total) => reportIndexing("teamSkills", "Embedding and sending", { done, total }),
@@ -64910,7 +64981,7 @@ ${direction}` : attachMentions(text, mentions);
64910
64981
  const manifestFile = manifestPath(index, search.id);
64911
64982
  const owner = indexOwner(config2);
64912
64983
  const project = indexProject();
64913
- const alias = config2.embedder?.indexAlias;
64984
+ const aliases = codebaseAliases(config2);
64914
64985
  try {
64915
64986
  const manifest = await loadIndexManifest(manifestFile, embedder);
64916
64987
  const isIgnored = await ignoredFilesPredicate();
@@ -64937,7 +65008,7 @@ ${direction}` : attachMentions(text, mentions);
64937
65008
  */
64938
65009
  ...owner !== void 0 ? { owner } : {},
64939
65010
  ...project !== void 0 ? { project } : {},
64940
- ...alias !== void 0 ? { alias } : {},
65011
+ alias: aliases,
64941
65012
  onProgress: (progress) => post({ type: "indexProgress", progress }),
64942
65013
  signal: indexingAbort.signal
64943
65014
  });
@@ -67088,6 +67159,7 @@ var NODE_ICONS = [
67088
67159
  "warning",
67089
67160
  "gear"
67090
67161
  ];
67162
+ var TEXT_SIZES = ["small", "normal", "large", "xlarge"];
67091
67163
  var NODE_SHAPES = ["box", "round", "diamond", "cylinder"];
67092
67164
  var diagramNodeSchema = external_exports.object({
67093
67165
  id: external_exports.string().min(1).max(64).describe("A short identifier, referenced by edges. Not shown."),
@@ -67096,7 +67168,10 @@ var diagramNodeSchema = external_exports.object({
67096
67168
  /** Shown under the label, smaller. For the qualifier that would otherwise bloat the label. */
67097
67169
  note: external_exports.string().max(120).optional().describe("A second, smaller line under the label."),
67098
67170
  tone: external_exports.enum(NODE_TONES).optional().describe("What the box means, as a colour: success for a good outcome, danger for a failure, warning for a risk, info for an external system, accent for the thing being explained, muted for context. Resolved against the theme, so it stays legible in light and dark."),
67099
- icon: external_exports.enum(NODE_ICONS).optional().describe("A small glyph in the corner of the box: service, database, user, file, cloud, lock, clock, queue, code, mail, check, cross, warning, gear.")
67171
+ icon: external_exports.enum(NODE_ICONS).optional().describe("A small glyph in the corner of the box: service, database, user, file, cloud, lock, clock, queue, code, mail, check, cross, warning, gear."),
67172
+ emphasis: external_exports.enum(["bold"]).optional().describe("Bold the label, for the one or two boxes the diagram is really about."),
67173
+ font: external_exports.enum(["mono"]).optional().describe("Set the label in a monospaced face. For a label that *is* an identifier \u2014 a path, a function, a table, an endpoint \u2014 where proportional text reads as prose."),
67174
+ textSize: external_exports.enum(TEXT_SIZES).optional().describe("How large this box's text is: small, normal, large or xlarge. Use it when the user asks for a particular box to be bigger, or to make the one thing the diagram is about stand out. The box grows with the text, so nothing is cut off.")
67100
67175
  });
67101
67176
  var diagramEdgeSchema = external_exports.object({
67102
67177
  from: external_exports.string().min(1).describe("The id of the node the arrow leaves."),
@@ -67113,6 +67188,7 @@ var diagramLegendSchema = external_exports.object({
67113
67188
  var DIAGRAM_MAX_LEGEND = 8;
67114
67189
  var diagramSpecSchema = external_exports.object({
67115
67190
  title: external_exports.string().max(120).optional(),
67191
+ textSize: external_exports.enum(TEXT_SIZES).optional().describe("The size for every box that does not set its own. Use it when the user says the diagram is too small or too large to read comfortably."),
67116
67192
  legend: external_exports.array(diagramLegendSchema).max(DIAGRAM_MAX_LEGEND).optional().describe("A key under the diagram. Give an entry only where the meaning is not obvious from the label \u2014 a colour that stands for something, a shape used in a particular way. Explain the diagram, not the palette."),
67117
67193
  direction: external_exports.enum(["down", "right"]).optional().describe("Which way the flow runs. down is the default and suits most flows."),
67118
67194
  nodes: external_exports.array(diagramNodeSchema).min(1).max(DIAGRAM_MAX_NODES),
@@ -67348,10 +67424,21 @@ function createShowChartTool() {
67348
67424
 
67349
67425
  // ../../packages/core/dist/diagrams/layout.js
67350
67426
  var NODE_HEIGHT = 52;
67351
- var NOTE_EXTRA = 14;
67352
67427
  var MIN_WIDTH = 96;
67353
- var MAX_WIDTH = 260;
67354
- var CHAR_WIDTH = 7.4;
67428
+ var MAX_WIDTH = 280;
67429
+ var FACE_WIDTH = { regular: 7.6, bold: 8.2, mono: 8, monoBold: 8 };
67430
+ var SIZE_SCALE = {
67431
+ small: 0.85,
67432
+ normal: 1,
67433
+ large: 1.25,
67434
+ xlarge: 1.55
67435
+ };
67436
+ var NOTE_CHAR_WIDTH = 6.4;
67437
+ var LINE_HEIGHT = 17;
67438
+ var NOTE_LINE_HEIGHT = 14;
67439
+ var LABEL_FONT_SIZE = 13;
67440
+ var NOTE_FONT_SIZE = 11;
67441
+ var PADDING_Y = 15;
67355
67442
  var PADDING_X = 28;
67356
67443
  var GAP_WITHIN_RANK = 28;
67357
67444
  var GAP_BETWEEN_RANKS = 64;
@@ -67363,9 +67450,51 @@ var SWATCH_GAP = 7;
67363
67450
  var LEGEND_ITEM_GAP = 22;
67364
67451
  var LEGEND_ROW_HEIGHT = 24;
67365
67452
  var LEGEND_TOP_GAP = 18;
67366
- function widthFor(label, note) {
67367
- const longest = Math.max(label.length, note?.length ?? 0);
67368
- return Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, Math.round(longest * CHAR_WIDTH) + PADDING_X * 2));
67453
+ function wrapText(text, perLine) {
67454
+ const limit = Math.max(4, perLine);
67455
+ const lines = [];
67456
+ let current = "";
67457
+ for (const word of text.split(/\s+/).filter((part) => part.length > 0)) {
67458
+ if (current.length === 0) {
67459
+ current = word;
67460
+ } else if (current.length + 1 + word.length <= limit) {
67461
+ current = `${current} ${word}`;
67462
+ } else {
67463
+ lines.push(current);
67464
+ current = word;
67465
+ }
67466
+ while (current.length > limit) {
67467
+ lines.push(current.slice(0, limit));
67468
+ current = current.slice(limit);
67469
+ }
67470
+ }
67471
+ if (current.length > 0)
67472
+ lines.push(current);
67473
+ return lines.length > 0 ? lines : [""];
67474
+ }
67475
+ function boxFor(label, note, face = "regular", size = "normal") {
67476
+ const scale = SIZE_SCALE[size];
67477
+ const charWidth = FACE_WIDTH[face] * scale;
67478
+ const noteCharWidth = NOTE_CHAR_WIDTH * scale;
67479
+ const lineHeight = LINE_HEIGHT * scale;
67480
+ const noteLineHeight = NOTE_LINE_HEIGHT * scale;
67481
+ const ideal = Math.max(Math.round(label.length * charWidth), note === void 0 ? 0 : Math.round(note.length * noteCharWidth));
67482
+ const maxWidth = MAX_WIDTH * scale;
67483
+ const width = Math.min(maxWidth, Math.max(MIN_WIDTH, ideal + PADDING_X * 2));
67484
+ const usable = width - PADDING_X * 2;
67485
+ const lines = wrapText(label, Math.floor(usable / charWidth));
67486
+ const noteLines = note === void 0 ? [] : wrapText(note, Math.floor(usable / noteCharWidth));
67487
+ const textHeight = lines.length * lineHeight + noteLines.length * noteLineHeight;
67488
+ return {
67489
+ width,
67490
+ height: Math.max(NODE_HEIGHT * scale, textHeight + PADDING_Y * 2),
67491
+ lines,
67492
+ noteLines,
67493
+ fontSize: LABEL_FONT_SIZE * scale,
67494
+ noteFontSize: NOTE_FONT_SIZE * scale,
67495
+ lineHeight,
67496
+ noteLineHeight
67497
+ };
67369
67498
  }
67370
67499
  function backEdges(spec) {
67371
67500
  const outgoing = /* @__PURE__ */ new Map();
@@ -67458,10 +67587,10 @@ function layoutDiagram(spec) {
67458
67587
  const byId = new Map(spec.nodes.map((node) => [node.id, node]));
67459
67588
  const sizes = /* @__PURE__ */ new Map();
67460
67589
  for (const node of spec.nodes) {
67461
- sizes.set(node.id, {
67462
- width: widthFor(node.label, node.note),
67463
- height: NODE_HEIGHT + (node.note === void 0 ? 0 : NOTE_EXTRA)
67464
- });
67590
+ const bold = node.emphasis === "bold";
67591
+ const mono = node.font === "mono";
67592
+ const face = mono ? bold ? "monoBold" : "mono" : bold ? "bold" : "regular";
67593
+ sizes.set(node.id, boxFor(node.label, node.note, face, node.textSize ?? spec.textSize ?? "normal"));
67465
67594
  }
67466
67595
  const rankExtent = rows.map((row) => Math.max(...row.map((id) => sizes.get(id)?.height ?? NODE_HEIGHT)));
67467
67596
  const rowWidths = rows.map((row) => row.reduce((total, id) => total + (sizes.get(id)?.width ?? MIN_WIDTH), 0) + GAP_WITHIN_RANK * Math.max(0, row.length - 1));
@@ -67478,8 +67607,14 @@ function layoutDiagram(spec) {
67478
67607
  continue;
67479
67608
  placed.push({
67480
67609
  id,
67481
- label: node.label,
67482
- note: node.note,
67610
+ lines: size2.lines,
67611
+ noteLines: size2.noteLines,
67612
+ bold: node.emphasis === "bold",
67613
+ mono: node.font === "mono",
67614
+ fontSize: size2.fontSize,
67615
+ noteFontSize: size2.noteFontSize,
67616
+ lineHeight: size2.lineHeight,
67617
+ noteLineHeight: size2.noteLineHeight,
67483
67618
  shape: node.shape ?? "box",
67484
67619
  // A start or an end is accented unless the model said otherwise: the entry and exit of a
67485
67620
  // flow are what a reader looks for first.
@@ -67587,7 +67722,7 @@ function createShowDiagramTool() {
67587
67722
  return {
67588
67723
  name: "show_diagram",
67589
67724
  group: "always",
67590
- description: 'Draw a technical diagram for the user: a flow chart, an architecture sketch, a sequence of steps, a state machine. Give `nodes` (each with an `id` and a `label`) and `edges` between those ids \u2014 the layout is worked out for you, so do not attempt coordinates. Use it when a structure is easier seen than described: how a request travels, what calls what, where a decision branches, what happens on failure. Shapes carry the usual meanings \u2014 `round` for a start or end, `diamond` for a decision, `cylinder` for a store, and the default box for a step. Put the condition on the edge (`label: "yes"`, `label: "on timeout"`) rather than inventing a node for it, and use `style: "dashed"` for anything conditional, asynchronous or secondary. `direction: "right"` suits a pipeline; the default runs downwards and suits most flows. Loops are fine \u2014 an edge pointing back is drawn round the outside. Keep it to the boxes that earn their place: a diagram of forty is a wall, not an explanation, and the limit is a refusal rather than a truncation.',
67725
+ description: 'Draw a technical diagram for the user: a flow chart, an architecture sketch, a sequence of steps, a state machine. Give `nodes` (each with an `id` and a `label`) and `edges` between those ids \u2014 the layout is worked out for you, so do not attempt coordinates. Use it when a structure is easier seen than described: how a request travels, what calls what, where a decision branches, what happens on failure. Shapes carry the usual meanings \u2014 `round` for a start or end, `diamond` for a decision, `cylinder` for a store, and the default box for a step. Put the condition on the edge (`label: "yes"`, `label: "on timeout"`) rather than inventing a node for it, and use `style: "dashed"` for anything conditional, asynchronous or secondary. Tone colours a box by meaning \u2014 success, danger, warning, info, accent, muted \u2014 and `icon` puts a glyph in its corner. `emphasis: "bold"` for the box the diagram is really about, `font: "mono"` where the label *is* an identifier (a path, a function, a table). `textSize` is small, normal, large or xlarge, on a node for one box or on the diagram for all of them \u2014 use it when the user asks for bigger or smaller text, which they may well do; the box grows with the text so nothing is cut off. A `legend` explains what a colour or a shape stands for *in this diagram*, which is worth giving whenever the meaning is not obvious from the labels. `direction: "right"` suits a pipeline; the default runs downwards and suits most flows. Loops are fine \u2014 an edge pointing back is drawn round the outside. Keep it to the boxes that earn their place: a diagram of forty is a wall, not an explanation, and the limit is a refusal rather than a truncation.',
67591
67726
  parametersSchema: diagramSpecSchema,
67592
67727
  async execute(params) {
67593
67728
  const layout = layoutDiagram(params);
@@ -68776,7 +68911,11 @@ function reachableHosts(bindAddress, port, extra = []) {
68776
68911
  }
68777
68912
  }
68778
68913
  }
68779
- for (const name of extra) add(name);
68914
+ for (const name of extra) {
68915
+ add(name);
68916
+ const trimmed = name.trim().toLowerCase();
68917
+ if (trimmed.length > 0) names.add(trimmed);
68918
+ }
68780
68919
  return [...names];
68781
68920
  }
68782
68921
  function reachableOrigins(hosts, extra = []) {
package/package.json CHANGED
@@ -1,65 +1,65 @@
1
- {
2
- "name": "@chosengeneration/light-code",
3
- "version": "0.62.0",
4
- "description": "A minimal agentic coding assistant, served to your browser from a local Node server",
5
- "license": "MIT",
6
- "type": "module",
7
- "bin": {
8
- "light-code": "dist/cli.js"
9
- },
10
- "files": [
11
- "dist/**/*.js",
12
- "dist/**/*.html",
13
- "dist/**/*.css",
14
- "dist/**/*.svg",
15
- "README.md",
16
- "LICENSE"
17
- ],
18
- "scripts": {
19
- "build": "node ../../scripts/generate-operator-guide.mjs && node esbuild.mjs",
20
- "typecheck": "tsc -b tsconfig.json",
21
- "start": "node ./dist/cli.js",
22
- "generate:guide": "node ../../scripts/generate-operator-guide.mjs"
23
- },
24
- "devDependencies": {
25
- "@light-code/core": "workspace:*",
26
- "@light-code/ui": "workspace:*",
27
- "@modelcontextprotocol/sdk": "^1.30.0",
28
- "@types/react": "^19.2.18",
29
- "@types/react-dom": "^19.2.4",
30
- "env-paths": "^3.0.0",
31
- "esbuild": "^0.27.2",
32
- "react": "^19.2.8",
33
- "react-dom": "^19.2.8",
34
- "undici": "^5.29.0",
35
- "zod": "^4.4.3"
36
- },
37
- "keywords": [
38
- "ai",
39
- "agent",
40
- "coding-assistant",
41
- "llm",
42
- "mcp",
43
- "openai",
44
- "anthropic",
45
- "cli"
46
- ],
47
- "homepage": "https://github.com/chosengenerationdev/light-code#readme",
48
- "repository": {
49
- "type": "git",
50
- "url": "git+https://github.com/chosengenerationdev/light-code.git",
51
- "directory": "apps/host"
52
- },
53
- "bugs": {
54
- "url": "https://github.com/chosengenerationdev/light-code/issues"
55
- },
56
- "engines": {
57
- "node": ">=17.0.0"
58
- },
59
- "publishConfig": {
60
- "access": "public"
61
- },
62
- "optionalDependencies": {
63
- "@vscode/ripgrep": "^1.18.0"
64
- }
65
- }
1
+ {
2
+ "name": "@chosengeneration/light-code",
3
+ "version": "0.67.0",
4
+ "description": "A minimal agentic coding assistant, served to your browser from a local Node server",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "light-code": "dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist/**/*.js",
12
+ "dist/**/*.html",
13
+ "dist/**/*.css",
14
+ "dist/**/*.svg",
15
+ "README.md",
16
+ "LICENSE"
17
+ ],
18
+ "scripts": {
19
+ "build": "node ../../scripts/generate-operator-guide.mjs && node esbuild.mjs",
20
+ "typecheck": "tsc -b tsconfig.json",
21
+ "start": "node ./dist/cli.js",
22
+ "generate:guide": "node ../../scripts/generate-operator-guide.mjs"
23
+ },
24
+ "devDependencies": {
25
+ "@light-code/core": "workspace:*",
26
+ "@light-code/ui": "workspace:*",
27
+ "@modelcontextprotocol/sdk": "^1.30.0",
28
+ "@types/react": "^19.2.18",
29
+ "@types/react-dom": "^19.2.4",
30
+ "env-paths": "^3.0.0",
31
+ "esbuild": "^0.27.2",
32
+ "react": "^19.2.8",
33
+ "react-dom": "^19.2.8",
34
+ "undici": "^5.29.0",
35
+ "zod": "^4.4.3"
36
+ },
37
+ "keywords": [
38
+ "ai",
39
+ "agent",
40
+ "coding-assistant",
41
+ "llm",
42
+ "mcp",
43
+ "openai",
44
+ "anthropic",
45
+ "cli"
46
+ ],
47
+ "homepage": "https://github.com/chosengenerationdev/light-code#readme",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/chosengenerationdev/light-code.git",
51
+ "directory": "apps/host"
52
+ },
53
+ "bugs": {
54
+ "url": "https://github.com/chosengenerationdev/light-code/issues"
55
+ },
56
+ "engines": {
57
+ "node": ">=17.0.0"
58
+ },
59
+ "publishConfig": {
60
+ "access": "public"
61
+ },
62
+ "optionalDependencies": {
63
+ "@vscode/ripgrep": "^1.18.0"
64
+ }
65
+ }