spur-board 0.102.0 → 0.102.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.
@@ -289,18 +289,18 @@ function plainHttpAllowed(url) {
289
289
  return host === "localhost" || host === "[::1]" || LOOPBACK_IPV4.test(host);
290
290
  }
291
291
  /** Check raw syntax before URL normalization can hide a slash, whitespace or backslash. */
292
- function validOrigin(value, port) {
292
+ function validOrigin(value, port, allowHttp = false) {
293
293
  const resolved = port === void 0 ? value : value.replaceAll("{port}", String(port));
294
294
  if (!/^https?:\/\/[^/\\\s?#@{}]+$/i.test(resolved)) return false;
295
295
  try {
296
296
  const url = new URL(resolved);
297
- return url.username === "" && url.password === "" && plainHttpAllowed(url);
297
+ return url.username === "" && url.password === "" && (allowHttp || plainHttpAllowed(url));
298
298
  } catch {
299
299
  return false;
300
300
  }
301
301
  }
302
302
  const originError = "Expected a bare HTTP/HTTPS origin; HTTP requires loopback, with no path, trailing slash, query, fragment, credentials or invalid placeholders";
303
- const concreteOrigin = z.string().refine((value) => validOrigin(value), { error: originError });
303
+ const concreteOrigin = z.string().refine((value) => validOrigin(value, void 0, true), { error: "Expected a bare HTTP/HTTPS origin with no path, trailing slash, query, fragment, credentials or placeholders" });
304
304
  const jiraTracker = z.strictObject({
305
305
  type: z.literal("jira").describe("jira: tasks come from the Jira issues jql returns, read with JIRA_EMAIL and JIRA_API_TOKEN from secrets.env."),
306
306
  baseUrl: z.url({ protocol: /^https?$/ }).refine((value) => {
@@ -697,7 +697,7 @@ const configObject = z.strictObject({
697
697
  web: z.strictObject({
698
698
  port: z.int().min(0).max(65535).optional().describe("Optional web listener port (0 assigns a free port); omitted means off. Set together with publicOrigin. Must differ from http.port, including when both are 0."),
699
699
  publicOrigin: z.string().optional().describe("Bare public HTTP/HTTPS origin for the web API; HTTP requires loopback. Set together with port. Every {port} is replaced with the listener port, including in hostnames. No trailing slash. The resolved origin must remain valid and HTTP loopback-only after actual-port substitution; the resolver returns no origin for an invalid actual port or resulting origin."),
700
- spurUiOrigin: concreteOrigin.optional().describe("Optional concrete bare origin for the Spur UI, independently of the web API. HTTP requires loopback; no placeholders or trailing slash. Omitted means no configured UI origin.")
700
+ spurUiOrigin: concreteOrigin.optional().describe("Optional concrete bare origin for the Spur UI, independently of the web API. HTTP works on any host without voice; no placeholders or trailing slash. Unset or unreachable UI only warns in doctor and never blocks updates.")
701
701
  }).prefault({}),
702
702
  stand: z.strictObject({ portRange: z.strictObject({
703
703
  min: z.int().min(1024).max(65535).default(DEFAULT_STAND_PORT_RANGE.min).describe("Inclusive first stand port; defaults to 4780 when a range is supplied."),
@@ -2854,7 +2854,7 @@ const configViewSchema = z.strictObject({
2854
2854
  })).describe("Effective projects visible to this caller."),
2855
2855
  web: z.strictObject({
2856
2856
  publicOrigin: z.url({ protocol: /^https?$/ }).nullable().describe("Origin the board web listener answers on; null when the listener is off or not bound yet."),
2857
- spurUiOrigin: z.url({ protocol: /^https?$/ }).nullable().describe("Origin of the Spur web UI clients link sessions to; null when not configured.")
2857
+ spurUiOrigin: z.url({ protocol: /^https?$/ }).nullable().describe("Origin of the Spur web UI clients link sessions to; HTTP works on any host without voice. Null when not configured; UI reachability only warns in doctor and never blocks updates.")
2858
2858
  }).describe("Web origins of the board listener and the Spur UI.")
2859
2859
  }).describe("Allowlisted effective configuration without credentials or adapter settings.");
2860
2860
  // ../contracts/src/ops/inbox-schemas.ts
@@ -1,4 +1,4 @@
1
- import { Q as ERRORS, c as tokenRequestStatusSchema, et as errorContextSchema, g as renderJsonError, o as tokenRequestResultSchema, rt as successEnvelopeSchema, tt as errorEnvelopeSchema } from "./chunk-DVsBSvp4.mjs";
1
+ import { Q as ERRORS, c as tokenRequestStatusSchema, et as errorContextSchema, g as renderJsonError, o as tokenRequestResultSchema, rt as successEnvelopeSchema, tt as errorEnvelopeSchema } from "./chunk-CDl7SYVt.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
@@ -1,5 +1,5 @@
1
- import { d as buildCatalogSnapshot, ft as configSchema, mt as plainHttpAllowed, p as OPERATIONS } from "./chunk-DVsBSvp4.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-Cif9JnJO.mjs";
1
+ import { d as buildCatalogSnapshot, ft as configSchema, mt as plainHttpAllowed, p as OPERATIONS } from "./chunk-CDl7SYVt.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-DVUopqja.mjs";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { closeSync, constants, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
5
5
  import { homedir } from "node:os";
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { Q as ERRORS, a as requestHashOf, bt as SLACK_BOT_SCOPES, ct as DEFAULT_STAND_PORT_RANGE, f as roleCanUseOperation, ft as configSchema, gt as resolveWebOrigin, ht as requiredSecretKeys, p as OPERATIONS, q as actorIdSchema, r as remoteDoctorReportSchema, rt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS } from "./chunk-DVsBSvp4.mjs";
1
+ import { Q as ERRORS, a as requestHashOf, bt as SLACK_BOT_SCOPES, ct as DEFAULT_STAND_PORT_RANGE, f as roleCanUseOperation, ft as configSchema, gt as resolveWebOrigin, ht as requiredSecretKeys, p as OPERATIONS, q as actorIdSchema, r as remoteDoctorReportSchema, rt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS } from "./chunk-CDl7SYVt.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-Bzb7aI8R.mjs";
3
- import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-Cif9JnJO.mjs";
4
- import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, f as tokenInFolder, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./chunk-B5Gn1_58.mjs";
3
+ import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-DVUopqja.mjs";
4
+ import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, f as tokenInFolder, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./chunk-JXDenEem.mjs";
5
5
  import { createHash, randomBytes, randomUUID } from "node:crypto";
6
6
  import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
7
7
  import { homedir, hostname, userInfo } from "node:os";
@@ -539,7 +539,7 @@ async function runDoctor(options = {}) {
539
539
  ]).exitCode === 0, "Start or restart the user service and inspect its journal."));
540
540
  checks.push(result("flock", ports.run("flock", ["--version"]).exitCode === 0, "Install flock from util-linux."));
541
541
  const currentBoard = ports.run("board", ["--version"]);
542
- checks.push(result("path.current", currentBoard.exitCode === 0, "Install board into the current PATH."));
542
+ checks.push(currentBoard.exitCode === 0 ? result("path.current", true, "") : warning("path.current", "Install board into the current PATH."));
543
543
  const processes = ports.sessions();
544
544
  const ended = await endedSessions(processes.map((session) => session.id), config.adapters.spur.baseUrl, ports);
545
545
  const sessions = processes.filter((session) => !ended.has(session.id));
@@ -548,7 +548,7 @@ async function runDoctor(options = {}) {
548
548
  HOME: home,
549
549
  PATH: live.path
550
550
  });
551
- checks.push(live === void 0 ? warning("path.spur", "Start a Spur session, then rerun board doctor.") : result("path.spur", spurBoard?.exitCode === 0, "Install board into the live Spur session PATH."));
551
+ checks.push(live === void 0 ? warning("path.spur", "Start a Spur session, then rerun board doctor.") : spurBoard?.exitCode === 0 ? result("path.spur", true, "") : warning("path.spur", "Install board into the live Spur session PATH."));
552
552
  const configured = new Set(config.projects.flatMap((project) => project.spurProjects.map((spur) => spur.name)));
553
553
  const codexSessions = sessions.filter((session) => session.codexHome && session.project && configured.has(session.project));
554
554
  const projectPaths = configured.size === 0 ? null : await spurProjectPaths(config.adapters.spur.baseUrl, ports);
@@ -578,7 +578,7 @@ async function runDoctor(options = {}) {
578
578
  }
579
579
  }
580
580
  const unknown = [...states].filter(([, state]) => state === "unknown").map(([name]) => name);
581
- checks.push(configured.size === 0 ? result("skills.codex_visibility", true, codexVisibilityFix) : projectPaths === null ? warning("skills.codex_visibility", "Start Spur or correct adapters.spur.baseUrl in config.yaml, then rerun board doctor to check the Codex skill install.") : [...states.values()].includes("broken") ? result("skills.codex_visibility", false, codexVisibilityFix) : missing.length > 0 || unknown.length > 0 ? warning("skills.codex_visibility", [...missing.length > 0 ? [`Correct spurProjects or projects[].spurProjects in config.yaml or register these projects in Spur${listing(safeIds(missing))}.`] : [], ...unknown.length > 0 ? [`Check that projects.<id>.symlinks in each project's spur.yaml lists .agents/skills/spur-board${listing(safeIds(unknown))}.`] : []].join(" ")) : result("skills.codex_visibility", true, codexVisibilityFix));
581
+ checks.push(configured.size === 0 ? result("skills.codex_visibility", true, codexVisibilityFix) : projectPaths === null ? warning("skills.codex_visibility", "Start Spur or correct adapters.spur.baseUrl in config.yaml, then rerun board doctor to check the Codex skill install.") : [...states.values()].includes("broken") ? warning("skills.codex_visibility", codexVisibilityFix) : missing.length > 0 || unknown.length > 0 ? warning("skills.codex_visibility", [...missing.length > 0 ? [`Correct spurProjects or projects[].spurProjects in config.yaml or register these projects in Spur${listing(safeIds(missing))}.`] : [], ...unknown.length > 0 ? [`Check that projects.<id>.symlinks in each project's spur.yaml lists .agents/skills/spur-board${listing(safeIds(unknown))}.`] : []].join(" ")) : result("skills.codex_visibility", true, codexVisibilityFix));
582
582
  const oldSessions = codexSessions.filter((session) => session.project !== void 0 && states.get(session.project) === "ok" && !(session.cwd !== void 0 && ports.exists(join(session.cwd, ".agents", "skills", "spur-board", "SKILL.md")) || session.codexHome !== void 0 && ports.exists(join(session.codexHome, "skills", "spur-board", "SKILL.md"))));
583
583
  checks.push(oldSessions.length > 0 ? warning("sessions.codex_skill", `Start new Spur sessions to replace Codex sessions created before the skill link${listing(safeIds([...new Set(oldSessions.map((session) => session.id))]))}; Spur links .agents/skills/spur-board only into new worktrees.`) : result("sessions.codex_skill", true, "Start new Spur sessions."));
584
584
  const version = ports.productVersion();
@@ -628,10 +628,9 @@ async function runDoctor(options = {}) {
628
628
  const availableVersions = [
629
629
  ...currentBoard.exitCode === 0 ? [currentBoard.stdout.trim()] : [],
630
630
  ...spurBoard?.exitCode === 0 ? [spurBoard.stdout.trim()] : [],
631
- ...remote === null ? [] : [remote.version],
632
631
  ...stamps.flatMap((entry) => entry === null ? [] : [entry.version])
633
632
  ];
634
- checks.push(result("versions", availableVersions.every((available) => available === version), "Install matching CLI and skills versions, then restart the daemon."));
633
+ checks.push(remote !== null && remote.version !== version ? result("versions", false, "Install matching CLI and skills versions, then restart the daemon.") : availableVersions.every((available) => available === version) ? result("versions", true, "") : warning("versions", "Install matching CLI and skills versions, then restart the daemon."));
635
634
  return checks;
636
635
  }
637
636
  function renderDoctor(checks, json) {
package/dist/client.mjs CHANGED
@@ -1 +1 @@
1
- export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-Cif9JnJO.mjs";
1
+ export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-DVUopqja.mjs";
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as err, A as prSourceId, B as prFactsSchema, C as userIdSchema, D as AdapterError, E as eventPayloadSchemas, F as REVIEW_STATES, G as JIRA_PROJECT_KEY, H as ringMarker, I as SESSION_HEALTH_STATES, J as encodeActorId, K as REF_NUMBER, L as SESSION_STATUSES, M as sourceCursorSchema, N as trackerSourceId, O as batchSchema, P as PR_STATES, Q as ERRORS, R as isExternalAuthor, S as messageRefSchema, St as VIAS, T as GATE_REASONS, U as sessionFactsSchema, V as prRefSchema, W as ticketFactsSchema, X as parseActorId, Y as errorCodeOf, Z as parseRef$1, _t as COLUMN_IDS, a as requestHashOf, at as DEFAULT_LINK, b as inboundEventSchema, bt as SLACK_BOT_SCOPES, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, dt as configBindings, f as roleCanUseOperation, ft as configSchema, gt as resolveWebOrigin, h as renderHttpProblem, ht as requiredSecretKeys, i as TOKEN_REQUEST_LIMITS, j as sessionTransitionSchema, k as entityRefSchema, l as BOARD_TICK_MS, lt as RESERVED_PROJECT, m as turnHandedSchema, mt as plainHttpAllowed, n as doctorReportSchema, nt as ok, o as tokenRequestResultSchema, p as OPERATIONS, pt as defaultAddressee, q as actorIdSchema, rt as successEnvelopeSchema, s as tokenRequestSchema, st as DEFAULT_SLACK_COMMAND, t as assertNever, ut as boardWideSpurProject, v as SPACE_IDS, vt as DISPATCHER_MODES, w as EVENT_KINDS, x as interactionRefSchema, xt as TASK_HOLDS, y as conversationRefSchema, yt as ITEM_KINDS, z as parseRingMarker } from "./chunk-DVsBSvp4.mjs";
1
+ import { $ as err, A as prSourceId, B as prFactsSchema, C as userIdSchema, D as AdapterError, E as eventPayloadSchemas, F as REVIEW_STATES, G as JIRA_PROJECT_KEY, H as ringMarker, I as SESSION_HEALTH_STATES, J as encodeActorId, K as REF_NUMBER, L as SESSION_STATUSES, M as sourceCursorSchema, N as trackerSourceId, O as batchSchema, P as PR_STATES, Q as ERRORS, R as isExternalAuthor, S as messageRefSchema, St as VIAS, T as GATE_REASONS, U as sessionFactsSchema, V as prRefSchema, W as ticketFactsSchema, X as parseActorId, Y as errorCodeOf, Z as parseRef$1, _t as COLUMN_IDS, a as requestHashOf, at as DEFAULT_LINK, b as inboundEventSchema, bt as SLACK_BOT_SCOPES, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, dt as configBindings, f as roleCanUseOperation, ft as configSchema, gt as resolveWebOrigin, h as renderHttpProblem, ht as requiredSecretKeys, i as TOKEN_REQUEST_LIMITS, j as sessionTransitionSchema, k as entityRefSchema, l as BOARD_TICK_MS, lt as RESERVED_PROJECT, m as turnHandedSchema, mt as plainHttpAllowed, n as doctorReportSchema, nt as ok, o as tokenRequestResultSchema, p as OPERATIONS, pt as defaultAddressee, q as actorIdSchema, rt as successEnvelopeSchema, s as tokenRequestSchema, st as DEFAULT_SLACK_COMMAND, t as assertNever, ut as boardWideSpurProject, v as SPACE_IDS, vt as DISPATCHER_MODES, w as EVENT_KINDS, x as interactionRefSchema, xt as TASK_HOLDS, y as conversationRefSchema, yt as ITEM_KINDS, z as parseRingMarker } from "./chunk-CDl7SYVt.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-Bzb7aI8R.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -25601,13 +25601,28 @@ async function spurUiCheck(ctx, fetcher, deadlineMs) {
25601
25601
  signal: controller.signal
25602
25602
  }), timeout])).body?.cancel().catch(() => void 0);
25603
25603
  } catch (err) {
25604
+ const code = z.object({ cause: z.object({ code: z.enum([
25605
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
25606
+ "SELF_SIGNED_CERT_IN_CHAIN",
25607
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
25608
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
25609
+ "CERT_HAS_EXPIRED",
25610
+ "ECONNREFUSED",
25611
+ "ENOTFOUND",
25612
+ "EAI_AGAIN",
25613
+ "ENETUNREACH",
25614
+ "EHOSTUNREACH",
25615
+ "ETIMEDOUT",
25616
+ "UND_ERR_CONNECT_TIMEOUT",
25617
+ "ERR_TLS_CERT_ALTNAME_INVALID"
25618
+ ]) }) }).safeParse(err);
25604
25619
  const name = timedOut ? "TimeoutError" : (err instanceof Error || err instanceof DOMException) && [
25605
25620
  "Error",
25606
25621
  "TypeError",
25607
25622
  "AbortError",
25608
25623
  "TimeoutError"
25609
25624
  ].includes(err.name) ? err.name : "Error";
25610
- throw new Error(name);
25625
+ throw new Error(timedOut ? name : code.success ? code.data.cause.code : name);
25611
25626
  }
25612
25627
  });
25613
25628
  return {
@@ -25617,7 +25632,13 @@ async function spurUiCheck(ctx, fetcher, deadlineMs) {
25617
25632
  fix: null
25618
25633
  };
25619
25634
  } catch (err) {
25620
- return check(id, false, `web.spurUiOrigin is unreachable (${err instanceof Error ? err.message : "Error"}). Start the Spur UI, fix proxy/TLS or correct web.spurUiOrigin in config.yaml; restart the daemon after config changes and rerun board doctor.`);
25635
+ const name = err instanceof Error ? err.message : "Error";
25636
+ return warning(id, `Spur UI unreachable (${name}). ${name === "CERT_HAS_EXPIRED" ? "Renew the Spur UI certificate." : [
25637
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
25638
+ "SELF_SIGNED_CERT_IN_CHAIN",
25639
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
25640
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY"
25641
+ ].includes(name) ? "Set NODE_EXTRA_CA_CERTS to your CA root in the service environment, trust the CA system-wide, or use HTTP without voice." : name === "ERR_TLS_CERT_ALTNAME_INVALID" ? "Correct the Spur UI certificate hostname or web.spurUiOrigin." : "Start the Spur UI or correct web.spurUiOrigin in config.yaml."} Restart the daemon after changes; rerun board doctor.`);
25621
25642
  } finally {
25622
25643
  clearTimeout(timer);
25623
25644
  }
@@ -25646,7 +25667,7 @@ async function runDaemonDoctor(ctx, productVersion, fetcher = fetch, { deadlineM
25646
25667
  const { config, secrets } = ctx;
25647
25668
  const checks = [];
25648
25669
  const spurUi = spurUiCheck(ctx, fetcher, deadlineMs);
25649
- if (config.web.port !== void 0) checks.push(check("web.listening", webListening?.() === true, "Free the configured web port and restart the daemon."));
25670
+ if (config.web.port !== void 0) checks.push(webListening?.() === true ? check("web.listening", true, "") : warning("web.listening", "Free the configured web port and restart the daemon."));
25650
25671
  const jiraTrackers = config.projects.flatMap((project) => project.tracker.type === "jira" ? [project.tracker] : []);
25651
25672
  const slackConfigured = Boolean(config.slack.channels.feed || config.slack.channels.orchestrators);
25652
25673
  const linkSamples = sampleLinks(ctx, fetcher, deadlineMs, secrets["GITHUB_TOKEN"]);
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { Q as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-DVsBSvp4.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-Cif9JnJO.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-B5Gn1_58.mjs";
1
+ import { Q as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-CDl7SYVt.mjs";
2
+ import { o as CliError, r as requestOperation } from "./chunk-DVUopqja.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-JXDenEem.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";