@chosengeneration/light-code 0.123.0 → 0.125.1

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/cli.cjs CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/cli.cjs
3
- size: 49298699 bytes
4
- sha256: 2ff9488310b849a2b53ff2c54b589ca0239a6845faa04c2d19b2541cce204358
3
+ size: 49333133 bytes
4
+ sha256: 6e3db9287a87b670774d6f2aee3d52230f80d13e5ad08650787c803c9d0728be
package/dist/server.cjs CHANGED
@@ -24349,6 +24349,24 @@ function describeProxyEnvironment(env2 = process.env) {
24349
24349
  }
24350
24350
  return parts.length > 0 ? parts.join(", ") : void 0;
24351
24351
  }
24352
+ function splitProxyLogin(raw, label = "proxy") {
24353
+ let url2;
24354
+ try {
24355
+ url2 = new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(raw.trim()) ? raw.trim() : `http://${raw.trim()}`);
24356
+ } catch {
24357
+ throw new Error(`The ${label} "${raw}" is not an address. Write it like http://user:password@proxy.corp:8080.`);
24358
+ }
24359
+ if (url2.protocol !== "http:" && url2.protocol !== "https:") {
24360
+ throw new Error(`The ${label} must be an http:// or https:// address, not ${url2.protocol}`);
24361
+ }
24362
+ const user = decodeURIComponent(url2.username);
24363
+ const password = decodeURIComponent(url2.password);
24364
+ return {
24365
+ url: `${url2.protocol}//${url2.username.length > 0 ? `${url2.username}@` : ""}${url2.host}`,
24366
+ ...user.length > 0 ? { user } : {},
24367
+ ...password.length > 0 ? { password } : {}
24368
+ };
24369
+ }
24352
24370
 
24353
24371
  // ../../packages/core/dist/platform/tls.js
24354
24372
  var import_node_fs = __toESM(require("node:fs"), 1);
@@ -24428,13 +24446,18 @@ var FetchHttpClient = class {
24428
24446
  * on the outer hop would present a client certificate to the proxy and none to the gateway —
24429
24447
  * a handshake failure pointing at neither.
24430
24448
  */
24431
- proxyFor(target, tls2) {
24432
- if (this.options.useEnvProxy !== true)
24449
+ proxyFor(target, tls2, explicit) {
24450
+ const env2 = explicit !== void 0 ? {
24451
+ ...explicit.http !== void 0 ? { HTTP_PROXY: explicit.http } : {},
24452
+ ...explicit.https !== void 0 ? { HTTPS_PROXY: explicit.https } : {},
24453
+ ...explicit.noProxy !== void 0 ? { NO_PROXY: explicit.noProxy } : {}
24454
+ } : this.options.useEnvProxy === true ? this.options.env ?? process.env : void 0;
24455
+ if (env2 === void 0)
24433
24456
  return void 0;
24434
- const choice = proxyForUrl(target, this.options.env ?? process.env);
24457
+ const choice = proxyForUrl(target, env2);
24435
24458
  if (choice === void 0)
24436
24459
  return void 0;
24437
- const key = `${choice.uri}|${tls2 === void 0 ? "none" : tlsKey(tls2)}`;
24460
+ const key = `${choice.uri}|${choice.token === void 0 ? "" : (0, import_node_crypto.createHash)("sha256").update(choice.token).digest("hex")}|${tls2 === void 0 ? "none" : tlsKey(tls2)}`;
24438
24461
  const existing = this.proxyAgents.get(key);
24439
24462
  if (existing !== void 0)
24440
24463
  return existing;
@@ -24482,7 +24505,7 @@ var FetchHttpClient = class {
24482
24505
  target = new URL(url2.replace(/^ws/i, "http"));
24483
24506
  } catch {
24484
24507
  }
24485
- const proxy = target === void 0 ? void 0 : this.proxyFor(target, options.tls);
24508
+ const proxy = target === void 0 ? void 0 : this.proxyFor(target, options.tls, options.proxy);
24486
24509
  const dispatcher = proxy ?? this.agentFor(options.tls ?? {});
24487
24510
  const socket = new import_undici.WebSocket(url2, { dispatcher, ...options.headers !== void 0 ? { headers: options.headers } : {} });
24488
24511
  const messages = [];
@@ -24540,7 +24563,7 @@ var FetchHttpClient = class {
24540
24563
  target = new URL(url2);
24541
24564
  } catch {
24542
24565
  }
24543
- const proxy = target === void 0 ? void 0 : this.proxyFor(target, options.tls);
24566
+ const proxy = target === void 0 ? void 0 : this.proxyFor(target, options.tls, options.proxy);
24544
24567
  if (proxy !== void 0)
24545
24568
  init.dispatcher = proxy;
24546
24569
  else if (options.tls !== void 0)
@@ -40432,6 +40455,14 @@ var configSchema = external_exports.object({
40432
40455
  project: projectConfigSchema,
40433
40456
  /** User-scope only: a workspace able to add a trusted root could enable interception. */
40434
40457
  tls: globalTlsSchema,
40458
+ /**
40459
+ * The proxy `http_request` goes through (Settings → Network). URLs with any username kept and the
40460
+ * password removed: the password lives in secret storage (`proxy:http:password`,
40461
+ * `proxy:https:password`) and is put back only when a request is made (§15). `http` is for http://
40462
+ * targets and `https` for https:// ones - the *target's* scheme, as HTTP_PROXY/HTTPS_PROXY mean it.
40463
+ * User-scope only (invariant 5): a repository able to set it could read the traffic.
40464
+ */
40465
+ proxy: external_exports.object({ http: external_exports.string(), https: external_exports.string(), noProxy: external_exports.string() }).partial(),
40435
40466
  expert: expertConfigSchema,
40436
40467
  agents: agentsConfigSchema,
40437
40468
  /**
@@ -41256,6 +41287,9 @@ var USER_SCOPE_ONLY_KEYS = [
41256
41287
  // Names where inference goes, exactly as the other two do.
41257
41288
  "programmingProfileId",
41258
41289
  "certDir",
41290
+ // Where http_request traffic goes. A repository able to set it could route your API calls - and their
41291
+ // credentials - through a proxy of its choosing.
41292
+ "proxy",
41259
41293
  // Reads the user's mail and their open workbooks. A repository must never switch it on.
41260
41294
  "office",
41261
41295
  // Names language-server programs to run when a file is edited.
@@ -46641,8 +46675,8 @@ var OpenSearchClient = class {
46641
46675
  if (options.owner !== void 0)
46642
46676
  clauses.push({ term: { owner: options.owner } });
46643
46677
  if (options.project !== void 0) {
46644
- const named = { terms: { project: [...options.project.names] } };
46645
- clauses.push(options.project.includeUnlabelled ? { bool: { should: [named, { bool: { must_not: [{ exists: { field: "project" } }] } }], minimum_should_match: 1 } } : named);
46678
+ const named2 = { terms: { project: [...options.project.names] } };
46679
+ clauses.push(options.project.includeUnlabelled ? { bool: { should: [named2, { bool: { must_not: [{ exists: { field: "project" } }] } }], minimum_should_match: 1 } } : named2);
46646
46680
  }
46647
46681
  const body = {
46648
46682
  /*
@@ -47571,11 +47605,11 @@ function qdrantFilter(options) {
47571
47605
  if (options.owner !== void 0)
47572
47606
  must.push({ key: "owner", match: { value: options.owner } });
47573
47607
  if (options.project !== void 0) {
47574
- const named = { key: "project", match: { any: [...options.project.names] } };
47608
+ const named2 = { key: "project", match: { any: [...options.project.names] } };
47575
47609
  if (options.project.includeUnlabelled)
47576
- should.push(named, { is_empty: { key: "project" } });
47610
+ should.push(named2, { is_empty: { key: "project" } });
47577
47611
  else
47578
- must.push(named);
47612
+ must.push(named2);
47579
47613
  }
47580
47614
  if (must.length === 0 && should.length === 0)
47581
47615
  return void 0;
@@ -49606,9 +49640,9 @@ var CSS_NAMES = {
49606
49640
  };
49607
49641
  function parseColour(raw) {
49608
49642
  const value = raw.trim().toLowerCase();
49609
- const named = CSS_NAMES[value];
49610
- if (named !== void 0)
49611
- return named;
49643
+ const named2 = CSS_NAMES[value];
49644
+ if (named2 !== void 0)
49645
+ return named2;
49612
49646
  const hex3 = /^#([0-9a-f]{3}|[0-9a-f]{6})$/.exec(value);
49613
49647
  if (hex3 !== null) {
49614
49648
  const digits = hex3[1];
@@ -52125,7 +52159,7 @@ function scheduleAppliesHere(schedule, workspaceRoot) {
52125
52159
  return normalise2(schedule.workspaceRoot) === normalise2(workspaceRoot);
52126
52160
  }
52127
52161
  function filterToolsForSchedule(all, schedule) {
52128
- const named = new Set(schedule.allowedTools);
52162
+ const named2 = new Set(schedule.allowedTools);
52129
52163
  const always = new Set(ALWAYS_AVAILABLE_TO_SCHEDULES);
52130
52164
  const never2 = new Set(NEVER_AVAILABLE_TO_SCHEDULES);
52131
52165
  return all.filter((tool) => {
@@ -52135,7 +52169,7 @@ function filterToolsForSchedule(all, schedule) {
52135
52169
  return false;
52136
52170
  if (always.has(tool.name))
52137
52171
  return true;
52138
- return named.has(tool.name);
52172
+ return named2.has(tool.name);
52139
52173
  });
52140
52174
  }
52141
52175
  function registryForSchedule(all, schedule) {
@@ -60092,9 +60126,9 @@ var SHARE_SECTIONS = [
60092
60126
  },
60093
60127
  {
60094
60128
  id: "network",
60095
- label: "TLS and certificates",
60096
- description: "The CA, client certificate and certificate folder. Paths, never key material.",
60097
- keys: ["tls", "certDir"],
60129
+ label: "TLS, certificates and proxy",
60130
+ description: "The CA, client certificate, certificate folder and the http_request proxy. Paths and addresses, never key material or proxy passwords.",
60131
+ keys: ["tls", "certDir", "proxy"],
60098
60132
  machineSpecific: true
60099
60133
  },
60100
60134
  {
@@ -65272,8 +65306,8 @@ var shown = (value) => {
65272
65306
  return text === void 0 ? "undefined" : text.length > 300 ? `${text.slice(0, 300)}...` : text;
65273
65307
  };
65274
65308
  function createPythonLibraryTool(options) {
65275
- const named = (params) => params.folders !== void 0 && params.folders.length > 0;
65276
- const foldersFor = (params) => named(params) ? params.folders ?? [] : options.savedFolders?.() ?? [];
65309
+ const named2 = (params) => params.folders !== void 0 && params.folders.length > 0;
65310
+ const foldersFor = (params) => named2(params) ? params.folders ?? [] : options.savedFolders?.() ?? [];
65277
65311
  return {
65278
65312
  name: "python_library",
65279
65313
  group: "command",
@@ -65284,7 +65318,7 @@ function createPythonLibraryTool(options) {
65284
65318
  const lines = [
65285
65319
  params.action === "call" ? `RUN ${params.module}.${params.function ?? "?"} ${params.calls !== void 0 ? `${String(params.calls.length)} times, in parallel worker processes` : "once"}` : `${params.action === "list" ? "List" : "Describe"} ${params.module}${params.function !== void 0 ? `.${params.function}` : ""} (importing it runs its start-up code)`,
65286
65320
  `Python: ${"problem" in launch ? `(none found: ${launch.problem})` : launch.interpreter}`,
65287
- `Folders: ${foldersFor(params).length > 0 ? `${foldersFor(params).join("; ")}${named(params) ? "" : " (saved in Settings \u2192 Python)"}` : "(none - the library must be installed in that Python)"}`
65321
+ `Folders: ${foldersFor(params).length > 0 ? `${foldersFor(params).join("; ")}${named2(params) ? "" : " (saved in Settings \u2192 Python)"}` : "(none - the library must be installed in that Python)"}`
65288
65322
  ];
65289
65323
  if (params.action === "call") {
65290
65324
  const calls = params.calls ?? [{ args: params.args, kwargs: params.kwargs }];
@@ -65386,6 +65420,72 @@ Results in call order:
65386
65420
  ${body}`;
65387
65421
  }
65388
65422
 
65423
+ // ../../packages/core/dist/tools/offload.js
65424
+ var named = (...names) => (name) => names.includes(name);
65425
+ var OFFLOAD_FAMILIES = [
65426
+ { label: "Excel", about: "open, read, trace, recalculate, write and save workbooks; read, check, write and run VBA", matches: (n) => n.startsWith("excel_") },
65427
+ {
65428
+ label: "Outlook and mail",
65429
+ about: "search and read mail, draft messages, open a message; the indexed mailbox and its patterns",
65430
+ matches: (n) => n.startsWith("outlook_") || n.startsWith("mail_") || n === "open_email" || n === "search_mail"
65431
+ },
65432
+ { label: "Confluence", about: "search, read and write pages, with attachments and diagrams", matches: (n) => n.startsWith("confluence_") },
65433
+ { label: "Jira", about: "search, read, create and update issues; project fields", matches: (n) => n.startsWith("jira_") },
65434
+ { label: "Bitbucket", about: "pull requests, files at a branch, comments, merge and tag", matches: (n) => n.startsWith("bitbucket_") },
65435
+ { label: "Jenkins", about: "jobs, builds, logs, queue, start, stop and replay a Jenkinsfile", matches: (n) => n.startsWith("jenkins_") },
65436
+ { label: "AutoSys", about: "job status, definitions, logs, dependencies, events and JIL", matches: (n) => n.startsWith("autosys_") },
65437
+ { label: "JupyterHub", about: "run code and inspect libraries on the hub, sync files, browse it", matches: (n) => n.startsWith("hub_") },
65438
+ { label: "S3 buckets", about: "list, read, download and upload files", matches: (n) => n.startsWith("s3_") },
65439
+ { label: "APIs and messaging", about: "call a REST API; open or send a Teams message", matches: named("http_request", "teams_open_chat") },
65440
+ {
65441
+ label: "Data and files",
65442
+ about: "SQL, grouping and pivots over CSV/Excel/clipboard; SQLite; filter a table; copy, move and zip files",
65443
+ matches: named("dataframe", "query_sqlite", "query_table", "transfer_files", "archive_files")
65444
+ },
65445
+ {
65446
+ label: "Python",
65447
+ about: "call a Python library many times in parallel; create, update, delete tools; install packages",
65448
+ matches: named("python_library", "create_python_tool", "update_python_tool", "delete_python_tool", "install_python_packages")
65449
+ },
65450
+ {
65451
+ label: "Search indexes and collectors",
65452
+ about: "query an OpenSearch index directly, collected data, colleagues\u2019 skills; data collectors",
65453
+ matches: named("search_opensearch", "search_data", "search_team_skills", "create_collector_tool", "check_collector")
65454
+ },
65455
+ {
65456
+ label: "Skills and schedules",
65457
+ about: "copy a skill\u2019s template file, delete a skill, schedule a prompt, export the configuration",
65458
+ matches: named("use_skill_file", "delete_skill", "schedule_prompt", "light_code_export_config")
65459
+ }
65460
+ ];
65461
+ function offloadFamilyOf(name) {
65462
+ return OFFLOAD_FAMILIES.find((family) => family.matches(name));
65463
+ }
65464
+ function isOffloadable(name) {
65465
+ return offloadFamilyOf(name) !== void 0;
65466
+ }
65467
+ function offloadedCatalogue(hidden, otherHidden = 0) {
65468
+ const names = hidden.map((tool) => typeof tool === "string" ? tool : tool.name);
65469
+ const lines = [];
65470
+ for (const family of OFFLOAD_FAMILIES) {
65471
+ const members = names.filter((name) => family.matches(name)).sort();
65472
+ if (members.length > 0)
65473
+ lines.push(`- **${family.label}** (${family.about}): ${members.join(", ")}`);
65474
+ }
65475
+ if (lines.length === 0 && otherHidden === 0)
65476
+ return void 0;
65477
+ return [
65478
+ "## More tools you have (documented in the search index)",
65479
+ "These tools are available to you but their full instructions are kept in the documentation index, not in",
65480
+ "this prompt. **Before using any of them - and before planning a multi-step job in one of these areas -",
65481
+ 'call `search_docs` describing what you need to do** (for example "create a Jira issue with an attachment").',
65482
+ "It returns the relevant steps and each tool\u2019s exact parameters. Then call the tool with",
65483
+ "`call_tool(name, arguments)`. Never guess parameters for a tool you have not looked up.",
65484
+ ...lines,
65485
+ ...otherHidden > 0 ? [`- **Also**: ${String(otherHidden)} more tool(s) from MCP servers and your own Python tools, found the same way with \`search_docs\`.`] : []
65486
+ ].join("\n");
65487
+ }
65488
+
65389
65489
  // ../../packages/core/dist/tools/http.js
65390
65490
  var schema3 = external_exports.object({
65391
65491
  method: external_exports.enum(["GET", "POST"]).default("GET"),
@@ -65409,6 +65509,17 @@ var schema3 = external_exports.object({
65409
65509
  maxWaitSec: external_exports.number().min(1).max(1800).optional().describe("How long to keep polling a 202 (default 120)."),
65410
65510
  timeoutSec: external_exports.number().min(1).max(600).optional().describe("Per request (default 60).")
65411
65511
  });
65512
+ function proxyFor(target, proxy) {
65513
+ if (proxy === void 0)
65514
+ return void 0;
65515
+ const chosen = target.protocol === "https:" ? proxy.https : proxy.http;
65516
+ if (chosen === void 0 || bypassesProxy(target, proxy.noProxy) || /^(localhost|127\.|\[?::1\]?$)/i.test(target.hostname))
65517
+ return void 0;
65518
+ const url2 = new URL(chosen);
65519
+ const user = decodeURIComponent(url2.username);
65520
+ const password = decodeURIComponent(url2.password);
65521
+ return { url: `${url2.protocol}//${url2.host}`, ...user.length > 0 ? { user } : {}, ...password.length > 0 ? { password } : {} };
65522
+ }
65412
65523
  var SECRET_REFERENCE = /\$\{secret:([^}]+)\}/g;
65413
65524
  function hostsIn(text) {
65414
65525
  const hosts = /* @__PURE__ */ new Set();
@@ -65553,6 +65664,8 @@ function createHttpTool(options) {
65553
65664
  ];
65554
65665
  if (params.tls !== void 0)
65555
65666
  lines.push(`Certificates: ${Object.entries(params.tls).filter(([k]) => k !== "passphraseSecret").map(([k, v]) => `${k}=${String(v)}`).join(", ")}`);
65667
+ const via = url2 !== void 0 ? proxyFor(url2, await options.proxy?.()) : void 0;
65668
+ lines.push(`Proxy: ${via === void 0 ? "none (direct)" : `${via.user !== void 0 ? `${via.user}@` : ""}${via.url.replace(/^https?:\/\//, "")}${via.password !== void 0 ? " (password stored)" : ""}`}`);
65556
65669
  if (params.retry202 !== false)
65557
65670
  lines.push(`On 202 Accepted: keep polling for up to ${String(params.maxWaitSec ?? 120)}s.`);
65558
65671
  if (body !== void 0)
@@ -65598,10 +65711,21 @@ async function send(options, params, context) {
65598
65711
  throw new Error("With negotiate, a client certificate must be a .pfx (pfxFile), and server trust comes from the Windows certificate store - a separate CA file cannot be applied there.");
65599
65712
  }
65600
65713
  const tls2 = authType === "negotiate" ? void 0 : await options.tls(params.tls ?? {});
65714
+ const proxy = await options.proxy?.();
65601
65715
  const once = async (method2, target, sendBody2) => {
65602
65716
  if (authType === "negotiate") {
65603
65717
  const passphrase = params.tls?.passphraseSecret !== void 0 ? await options.secret(params.tls.passphraseSecret) : void 0;
65604
- return options.negotiate({ method: method2, url: target.toString(), headers, body: sendBody2, timeoutSec: params.timeoutSec ?? 60, pfxFile: params.tls?.pfxFile, passphrase }, context.signal);
65718
+ const via = proxyFor(target, proxy);
65719
+ return options.negotiate({
65720
+ method: method2,
65721
+ url: target.toString(),
65722
+ headers,
65723
+ body: sendBody2,
65724
+ timeoutSec: params.timeoutSec ?? 60,
65725
+ pfxFile: params.tls?.pfxFile,
65726
+ passphrase,
65727
+ ...via !== void 0 ? { proxy: via.url, proxyUser: via.user, proxyPassword: via.password } : {}
65728
+ }, context.signal);
65605
65729
  }
65606
65730
  const request = async () => {
65607
65731
  const extra = strategy !== void 0 ? await strategy.resolveHeaders() : {};
@@ -65615,7 +65739,8 @@ async function send(options, params, context) {
65615
65739
  headers: { ...headers, ...extra },
65616
65740
  ...sendBody2 !== void 0 ? { body: sendBody2 } : {},
65617
65741
  signal: controller.signal,
65618
- ...(strategyTls ?? tls2) !== void 0 ? { tls: strategyTls ?? tls2 } : {}
65742
+ ...(strategyTls ?? tls2) !== void 0 ? { tls: strategyTls ?? tls2 } : {},
65743
+ ...proxy !== void 0 ? { proxy } : {}
65619
65744
  });
65620
65745
  return { status: response3.status, headers: response3.headers, body: await readAll(response3) };
65621
65746
  } catch (error51) {
@@ -65674,6 +65799,13 @@ var NEGOTIATE_SCRIPT = [
65674
65799
  "$handler = New-Object System.Net.Http.HttpClientHandler",
65675
65800
  "$handler.UseDefaultCredentials = $true",
65676
65801
  "$handler.PreAuthenticate = $true",
65802
+ // Settings -> Network's proxy when one is set, with its login; otherwise Windows' own proxy settings.
65803
+ "if ($req.proxy) {",
65804
+ " $proxy = New-Object System.Net.WebProxy([string]$req.proxy)",
65805
+ " if ($req.proxyUser) { $proxy.Credentials = New-Object System.Net.NetworkCredential([string]$req.proxyUser, [string]$req.proxyPassword) } else { $proxy.UseDefaultCredentials = $true }",
65806
+ " $handler.Proxy = $proxy",
65807
+ " $handler.UseProxy = $true",
65808
+ "}",
65677
65809
  "if ($req.pfxFile) {",
65678
65810
  " $flags = [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::UserKeySet",
65679
65811
  " $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($req.pfxFile, [string]$req.passphrase, $flags)",
@@ -72027,8 +72159,8 @@ function renderValue2(value) {
72027
72159
  return parts.length > 0 ? parts.join(", ") : void 0;
72028
72160
  }
72029
72161
  if (typeof value === "object") {
72030
- const named = value;
72031
- const label = named?.displayName ?? named?.name ?? named?.value ?? named?.key;
72162
+ const named2 = value;
72163
+ const label = named2?.displayName ?? named2?.name ?? named2?.value ?? named2?.key;
72032
72164
  if (typeof label === "string")
72033
72165
  return label;
72034
72166
  const json2 = JSON.stringify(value);
@@ -76054,7 +76186,8 @@ ${preview.text}` } : {}
76054
76186
  }
76055
76187
  return createAuthStrategy(profile.auth, buildAuthContext(config2, profile));
76056
76188
  },
76057
- ...process.platform === "win32" ? { negotiate: negotiateRequest } : {}
76189
+ ...process.platform === "win32" ? { negotiate: negotiateRequest } : {},
76190
+ proxy: () => httpToolProxy()
76058
76191
  });
76059
76192
  function currentToolRegistry(expert, search, codebase, docs, dispatcher = false, hideSkills = false, teamSkills, mailSemantic, datasetSemanticForTools) {
76060
76193
  const combined = new ToolRegistry();
@@ -76337,6 +76470,11 @@ ${preview.text}` } : {}
76337
76470
  combined.register(createBitbucketMergePullRequestTool(bitbucketOptions));
76338
76471
  }
76339
76472
  combined.register(createExportConfigTool({ loadConfig: async () => (await configManager.load()).config }), { dispatchOnly: dispatcher });
76473
+ if (dispatcher && docs !== void 0) {
76474
+ for (const tool of combined.list())
76475
+ if (isOffloadable(tool.name))
76476
+ combined.register(tool, { dispatchOnly: true });
76477
+ }
76340
76478
  const hasHiddenTools = dispatcher && combined.dispatchOnlyList().length > 0;
76341
76479
  const hasHiddenSkills = hideSkills && skills.length > 0;
76342
76480
  if (hasHiddenTools) {
@@ -76461,8 +76599,8 @@ ${preview.text}` } : {}
76461
76599
  try {
76462
76600
  const { config: config2 } = await configManager.load();
76463
76601
  const refs = (config2.profiles ?? []).flatMap((profile) => SECRET_REFS_PER_PROFILE.map((refFor) => refFor(profile.id)));
76464
- const named = (config2.profiles ?? []).map((profile) => profile.auth.type === "apiKey" ? profile.auth.apiKeyRef : void 0).filter((ref) => ref !== void 0);
76465
- const values = await Promise.all([.../* @__PURE__ */ new Set([...refs, ...named])].map((ref) => resolveSecretRef(ref, { secrets })));
76602
+ const named2 = (config2.profiles ?? []).map((profile) => profile.auth.type === "apiKey" ? profile.auth.apiKeyRef : void 0).filter((ref) => ref !== void 0);
76603
+ const values = await Promise.all([.../* @__PURE__ */ new Set([...refs, ...named2])].map((ref) => resolveSecretRef(ref, { secrets })));
76466
76604
  cachedSecretValues = values.filter((value) => value !== void 0 && value.length > 0);
76467
76605
  return [...cachedSecretValues];
76468
76606
  } catch (error51) {
@@ -76679,6 +76817,15 @@ ${preview.text}` } : {}
76679
76817
  parts.push(hubGuidance(hub));
76680
76818
  if (services.fastFs !== void 0)
76681
76819
  parts.push(fastFsGuidance(fastFsOps));
76820
+ if (schedule === void 0 && dispatcherEnabled(config2.retrieval) && search !== void 0 && embedder !== void 0 && docsIndex !== void 0) {
76821
+ const everything = currentToolRegistry(void 0, void 0, void 0, void 0, true);
76822
+ const offloaded = everything.list().filter((tool) => isOffloadable(tool.name));
76823
+ const otherHidden = everything.dispatchOnlyList().filter((tool) => !isOffloadable(tool.name)).length;
76824
+ const catalogue = offloadedCatalogue(offloaded, otherHidden);
76825
+ if (catalogue !== void 0)
76826
+ parts.push(catalogue);
76827
+ scheduleDocsReindex("keeping the tool documentation current");
76828
+ }
76682
76829
  const others = services.siblings ?? [];
76683
76830
  if (others.length > 0) {
76684
76831
  parts.push([
@@ -79536,7 +79683,10 @@ ${redact(shown2, cachedSecretValues)}` }
79536
79683
  try {
79537
79684
  options.report?.("Reading the catalogue");
79538
79685
  const registry2 = currentToolRegistry(void 0, void 0, void 0, void 0, true);
79539
- const all = buildDocCorpus({ dispatchOnlyTools: registry2.dispatchOnlyList(), skills });
79686
+ const all = buildDocCorpus({
79687
+ dispatchOnlyTools: registry2.list().filter((tool) => registry2.isDispatchOnly(tool.name) || isOffloadable(tool.name)),
79688
+ skills
79689
+ });
79540
79690
  const wanted = options.kind;
79541
79691
  const entries = wanted === void 0 ? all : all.filter((entry) => entry.kind === wanted);
79542
79692
  const fingerprint = (0, import_node_crypto12.createHash)("sha256").update(`${wanted ?? "all"}:${embedder.model}:${String(embedder.dimensions)}`).update(entries.map((entry) => `${entry.id}\0${entry.text}`).join("")).digest("hex");
@@ -80627,7 +80777,7 @@ ${redact(shown2, cachedSecretValues)}` }
80627
80777
  }
80628
80778
  }
80629
80779
  const GLOBAL_PASSPHRASE_REF = "tls:global:passphrase";
80630
- async function postNetwork() {
80780
+ async function postNetwork(proxyError) {
80631
80781
  const { config: config2 } = await configManager.load();
80632
80782
  const tls2 = { ...config2.tls ?? {} };
80633
80783
  delete tls2.passphraseRef;
@@ -80639,10 +80789,75 @@ ${redact(shown2, cachedSecretValues)}` }
80639
80789
  // The store, not config, decides this: the two can diverge, and only one of them
80640
80790
  // actually holds the passphrase.
80641
80791
  hasPassphrase: await secrets.get(GLOBAL_PASSPHRASE_REF) !== void 0,
80642
- ...workspaceRoot !== void 0 ? { workspaceRoot } : {}
80792
+ ...workspaceRoot !== void 0 ? { workspaceRoot } : {},
80793
+ proxy: {
80794
+ ...config2.proxy?.http !== void 0 ? { http: config2.proxy.http } : {},
80795
+ ...config2.proxy?.https !== void 0 ? { https: config2.proxy.https } : {},
80796
+ ...config2.proxy?.noProxy !== void 0 ? { noProxy: config2.proxy.noProxy } : {},
80797
+ // Booleans only: a proxy password never crosses the bridge (invariant 7).
80798
+ httpHasPassword: await secrets.get(proxyPasswordRef("http")) !== void 0,
80799
+ httpsHasPassword: await secrets.get(proxyPasswordRef("https")) !== void 0
80800
+ },
80801
+ ...proxyError !== void 0 ? { proxyError } : {}
80643
80802
  }
80644
80803
  });
80645
80804
  }
80805
+ function proxyPasswordRef(kind) {
80806
+ return `proxy:${kind}:password`;
80807
+ }
80808
+ async function handleSaveProxy(input) {
80809
+ try {
80810
+ const { config: config2 } = await configManager.load();
80811
+ const next = {};
80812
+ for (const kind of ["http", "https"]) {
80813
+ const raw = input[kind].trim();
80814
+ const ref = proxyPasswordRef(kind);
80815
+ if (raw.length === 0) {
80816
+ await secrets.delete(ref);
80817
+ continue;
80818
+ }
80819
+ const split = splitProxyLogin(raw, `${kind.toUpperCase()} proxy`);
80820
+ const previousUser = (() => {
80821
+ try {
80822
+ const before = config2.proxy?.[kind];
80823
+ return before === void 0 ? void 0 : splitProxyLogin(before).user;
80824
+ } catch {
80825
+ return void 0;
80826
+ }
80827
+ })();
80828
+ if (split.password !== void 0)
80829
+ await secrets.set(ref, split.password);
80830
+ else if (split.user === void 0 || split.user !== previousUser)
80831
+ await secrets.delete(ref);
80832
+ next[kind] = split.url;
80833
+ }
80834
+ if (input.noProxy.trim().length > 0)
80835
+ next.noProxy = input.noProxy.trim();
80836
+ await configManager.save("user", { proxy: Object.keys(next).length > 0 ? next : void 0 });
80837
+ await postNetwork();
80838
+ } catch (error51) {
80839
+ await postNetwork(error51 instanceof Error ? error51.message : String(error51));
80840
+ }
80841
+ }
80842
+ async function httpToolProxy() {
80843
+ const proxy = (await configManager.load()).config.proxy;
80844
+ if (proxy === void 0 || proxy.http === void 0 && proxy.https === void 0)
80845
+ return void 0;
80846
+ const withPassword = async (kind) => {
80847
+ const value = proxy[kind];
80848
+ if (value === void 0)
80849
+ return void 0;
80850
+ const password = await secrets.get(proxyPasswordRef(kind));
80851
+ if (password === void 0)
80852
+ return value;
80853
+ const url2 = new URL(value);
80854
+ url2.password = encodeURIComponent(password);
80855
+ return url2.toString().replace(/\/$/, "");
80856
+ };
80857
+ const http = await withPassword("http");
80858
+ const https = await withPassword("https");
80859
+ return { ...http !== void 0 ? { http } : {}, ...https !== void 0 ? { https } : {}, ...proxy.noProxy !== void 0 ? { noProxy: proxy.noProxy } : {} };
80860
+ }
80646
80861
  function postLsp() {
80647
80862
  post({
80648
80863
  type: "lsp",
@@ -81425,21 +81640,21 @@ ${redact(shown2, cachedSecretValues)}` }
81425
81640
  return void 0;
81426
81641
  };
81427
81642
  try {
81428
- const named = venvDir.trim();
81429
- if (named.length > 0) {
81430
- const found2 = await search(named);
81643
+ const named2 = venvDir.trim();
81644
+ if (named2.length > 0) {
81645
+ const found2 = await search(named2);
81431
81646
  if (found2 !== void 0) {
81432
81647
  post({
81433
81648
  type: "pythonEnvProbe",
81434
81649
  interpreter: found2,
81435
- venvDir: named,
81650
+ venvDir: named2,
81436
81651
  detail: `Found ${found2}`
81437
81652
  });
81438
81653
  return;
81439
81654
  }
81440
81655
  post({
81441
81656
  type: "pythonEnvProbe",
81442
- detail: `No Python interpreter under "${named}". Check the path, or set the interpreter directly below.`
81657
+ detail: `No Python interpreter under "${named2}". Check the path, or set the interpreter directly below.`
81443
81658
  });
81444
81659
  return;
81445
81660
  }
@@ -81999,6 +82214,8 @@ ${redact(shown2, cachedSecretValues)}` }
81999
82214
  })());
82000
82215
  } else if (message4.type === "saveNetwork") {
82001
82216
  reportFailure("handleSaveNetwork", handleSaveNetwork(message4.settings));
82217
+ } else if (message4.type === "saveProxy") {
82218
+ reportFailure("handleSaveProxy", handleSaveProxy(message4));
82002
82219
  } else if (message4.type === "requestExpert") {
82003
82220
  reportFailure("postExpert", postExpert());
82004
82221
  } else if (message4.type === "setPlan") {
@@ -83079,7 +83296,9 @@ function createShowDiagramTool() {
83079
83296
  return {
83080
83297
  name: "show_diagram",
83081
83298
  group: "always",
83082
- 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.',
83299
+ // Short on purpose: advertised in every request, and the field descriptions carry the details
83300
+ // (tones, icons, text size, legend, direction). It was ~1,600 tokens with the schema.
83301
+ description: 'Draw a technical diagram: a flow, an architecture, a sequence of steps, a state machine. Give `nodes` (`id`, `label`) and `edges` between ids; layout is automatic, never give coordinates. Shapes: `round` start/end, `diamond` decision, `cylinder` store, box for a step. Put conditions on edges (`label: "on timeout"`), `style: "dashed"` for conditional or async. Keep to the boxes that matter - forty is a wall, and the limit refuses rather than truncates.',
83083
83302
  parametersSchema: diagramSpecSchema,
83084
83303
  async execute(params) {
83085
83304
  const layout = layoutDiagram(params);
@@ -83919,9 +84138,9 @@ Light Code is a minimal agentic coding assistant: a chat panel, a small set of t
83919
84138
  approval gate in front of everything that acts. It ships with **no default endpoints** \u2014 a fresh
83920
84139
  install contacts nothing until a provider is configured.
83921
84140
 
83922
- **Settings** is the gear icon in the chat header. It has these tabs: Providers, Approvals, MCP,
83923
- Search, Agents, Schedules, Python, Tools, Outlook, Custom data, Skills, Network, Review,
83924
- Variables, Appearance.
84141
+ **Settings** is the gear icon in the chat header. It has these tabs: Providers, Project, Approvals,
84142
+ MCP, Search, Agents, Schedules, Python, Tools, DevOps, Outlook, Custom data, Skills, Network and
84143
+ Appearance - plus Review and Variables on a shared server (\`light-code --server\`) only.
83925
84144
 
83926
84145
  **Everything the panel writes goes into one JSON file**, and that file can be hand-edited \u2014 the UI
83927
84146
  and the loader share one schema, so a bad hand-edit and a bad save fail identically.
@@ -84345,7 +84564,12 @@ configured per workspace when credentials may not.
84345
84564
  "rag",
84346
84565
  "codebase",
84347
84566
  "team",
84348
- "dispatcher"
84567
+ "dispatcher",
84568
+ "tool definitions",
84569
+ "context window",
84570
+ "prompt size",
84571
+ "not listed",
84572
+ "offload"
84349
84573
  ],
84350
84574
  body: `
84351
84575
  **Settings \u2192 Search.** Opt-in and **off by default**, and it is the largest egress in the product:
@@ -84383,6 +84607,21 @@ them with \`search_docs\` \u2014 so the prompt does not grow with the size of yo
84383
84607
  is a prompt-size control and **not** a security control: a hidden tool is still callable. Use
84384
84608
  modes and the approval gate to withhold a capability.
84385
84609
 
84610
+ **With a search index, the built-in integrations move there too.** When the dispatcher is on and a
84611
+ documentation index is configured (a vector store and an embedding model), the Excel, Outlook,
84612
+ Confluence, Jira, Bitbucket, Jenkins, AutoSys, JupyterHub, S3, API, data and Python tools leave the
84613
+ prompt: their full instructions live in the index, and the prompt keeps a short list naming every one
84614
+ of them, telling the assistant to call \`search_docs\` before using one or planning a job in that area.
84615
+ With everything switched on that is roughly 38,000 tokens of tool definitions down to about 11,000 on
84616
+ every request. **Without an index nothing changes** - every tool stays listed in full, because finding
84617
+ a tool by name alone is not reliable enough to hide it. The file, edit, command and Rust file tools are
84618
+ always listed, because nearly every conversation uses them.
84619
+
84620
+ **Switching over is automatic.** The message after you configure an index already uses the lighter
84621
+ prompt, and the tool documentation is indexed in the background within seconds - so that first message
84622
+ finds tools by name, and later ones by meaning. Switching on another integration later (Jira, Excel, ...)
84623
+ is picked up the same way. Nothing to press; the Search tab's Index button forces a full rebuild.
84624
+
84386
84625
  **If a switch here breaks nothing when it fails, that is deliberate.** With the backend down,
84387
84626
  \`search_docs\` falls back to matching names, the search tools are simply not offered, and chat,
84388
84627
  editing, commands and MCP never touch it.
@@ -84850,7 +85089,7 @@ the codebase also copies the old index across by itself if it finds one.
84850
85089
  },
84851
85090
  {
84852
85091
  id: "http-api",
84853
- title: "Calling REST APIs",
85092
+ title: "Calling REST APIs, and their proxy",
84854
85093
  keywords: [
84855
85094
  "http",
84856
85095
  "rest",
@@ -84871,7 +85110,13 @@ the codebase also copies the old index across by itself if it finds one.
84871
85110
  "poll",
84872
85111
  "client certificate",
84873
85112
  "ca certificate",
84874
- "curl"
85113
+ "curl",
85114
+ "proxy",
85115
+ "http proxy",
85116
+ "https proxy",
85117
+ "proxy password",
85118
+ "proxy username",
85119
+ "no proxy"
84875
85120
  ],
84876
85121
  body: `
84877
85122
  \`http_request\` calls a REST API with GET or POST - give it the API's documentation and it can try the API.
@@ -84891,6 +85136,13 @@ certificate always apply; a request may add a CA file, a client cert + key, or a
84891
85136
 
84892
85137
  **202 Accepted** is polled - the Location it names, or the same request - waiting Retry-After or a growing
84893
85138
  interval, for up to two minutes by default (ask for longer). Headers work on every request.
85139
+
85140
+ **Proxy** (Settings \u2192 Network \u2192 Proxy for API calls): an HTTP proxy (for http:// APIs) and an HTTPS proxy
85141
+ (for https:// APIs) - usually the same one - and hosts to reach directly. Write the login into the address,
85142
+ \`http://user:password@proxy.corp:8080\`: the password is moved into secret storage and the box keeps only
85143
+ the user name; leave the password out when saving again to keep it. Used by \`http_request\` only, on both
85144
+ transports - with negotiate, when no proxy is set, Windows' own proxy settings apply. A proxy never applies
85145
+ to localhost or 127.0.0.1. A refused address is reported on the panel.
84894
85146
  `
84895
85147
  },
84896
85148
  {
@@ -84969,6 +85221,60 @@ N/A, null, -, #N/A, ...) count as empty; thousands separators and "(1,234.50)" n
84969
85221
  ragged rows, odd bytes, duplicate or blank headers and Excel error cells are tolerated. A column with stray
84970
85222
  values stays text and the answer says which values, so a total is never quietly wrong. A pivot cell with no
84971
85223
  data is empty, not 0. Needs Fire Code's helper (Fire Code, or VS Code with Fire Code installed).
85224
+ `
85225
+ },
85226
+ {
85227
+ id: "rust-tools",
85228
+ title: "The fast Rust tools, and where they are available",
85229
+ keywords: [
85230
+ "rust",
85231
+ "rust tools",
85232
+ "fast tools",
85233
+ "fire code tools",
85234
+ "fire-fs",
85235
+ "helper",
85236
+ "what tools",
85237
+ "which tools",
85238
+ "available tools",
85239
+ "big file",
85240
+ "huge log",
85241
+ "find files",
85242
+ "read many files",
85243
+ "query table",
85244
+ "sqlite",
85245
+ "dataframe",
85246
+ "python library",
85247
+ "copy files",
85248
+ "move files",
85249
+ "zip",
85250
+ "vs code rust",
85251
+ "tools in vs code"
85252
+ ],
85253
+ body: `
85254
+ Fire Code ships a Rust helper (\`fire-fs.exe\`) that runs file and data work on every CPU core. Its tools:
85255
+
85256
+ - \`find_files\` - find files by name, type, size or date across drives and shares; summarise a folder; find
85257
+ duplicate files by content.
85258
+ - \`read_many_files\` - up to 50 files (or line windows) in one call.
85259
+ - \`big_file\` - a file of any size, logs especially: inspect (lines, columns), read a window, tail, or search
85260
+ with a regular expression and context lines.
85261
+ - \`query_table\` - filter, group and total one CSV or Excel sheet.
85262
+ - \`dataframe\` - SQL over CSV, Excel and the clipboard: joins, grouping, window functions, pivot; forgiving
85263
+ with messy data (see the dataframe topic).
85264
+ - \`query_sqlite\` - read a SQLite database without creating it or locking it.
85265
+ - \`python_library\` - call a Python library's functions many times in parallel processes (pricing DLLs).
85266
+ - \`transfer_files\` / \`archive_files\` - copy or move, and zip/unzip, showing the plan before anything changes.
85267
+
85268
+ **Where they are available**
85269
+ - **Fire Code**: always.
85270
+ - **VS Code (and \`light-code\` run on its own)**: when Fire Code is installed on the same machine. The
85271
+ extension finds Fire Code's helper by itself - nothing to configure - and offers the tools that helper
85272
+ has (an older Fire Code offers fewer). Reload the VS Code window after installing or updating Fire Code.
85273
+ - **Not**: without Fire Code installed, on a shared server (\`--server\`), or on a platform other than
85274
+ Windows. There the built-in tools (read_file, search_files, list_files) do the work.
85275
+
85276
+ To see whether they are on right now, look at the tool list in Settings \u2192 Tools, or ask "which tools do
85277
+ you have?" - the assistant answers from the tools it was actually given.
84972
85278
  `
84973
85279
  },
84974
85280
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chosengeneration/light-code",
3
- "version": "0.123.0",
3
+ "version": "0.125.1",
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",