spur-board 0.75.0 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CvY4Vfxu.mjs → chunk-BEExLWBt.mjs} +10 -1
- package/dist/{chunk-bhSEp4Rg.mjs → chunk-BSs9OrJD.mjs} +1 -1
- package/dist/{chunk-BwY4L2UH.mjs → chunk-CFvX6Mf9.mjs} +2 -2
- package/dist/cli.mjs +3 -3
- package/dist/client.mjs +1 -1
- package/dist/daemon.mjs +278 -63
- package/dist/mcp.mjs +3 -3
- package/package.json +1 -1
- package/skills/setup/SKILL.md +6 -5
- package/skills/setup/references/web.md +27 -0
- package/skills/spur-board/references/how-board-works.md +16 -0
|
@@ -664,7 +664,7 @@ const configObject = z.strictObject({
|
|
|
664
664
|
}).prefault({}),
|
|
665
665
|
http: z.strictObject({ port: z.int().min(0).max(65535).default(DEFAULT_HTTP_PORT).describe("Local HTTP API port (0 assigns a free port). The default 4777 is above 4310-4399, a margin kept for Spur's server port 4310 and the ports from 4311 upward that its MCP port takes, and avoids Spur's ports 5555 and 8730-8799 and the Linux ephemeral range 32768-60999.") }).prefault({}),
|
|
666
666
|
web: z.strictObject({
|
|
667
|
-
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.
|
|
667
|
+
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."),
|
|
668
668
|
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."),
|
|
669
669
|
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.")
|
|
670
670
|
}).prefault({}),
|
|
@@ -2484,6 +2484,7 @@ function defineOperation(spec) {
|
|
|
2484
2484
|
])].sort((a, b) => order.indexOf(a) - order.indexOf(b));
|
|
2485
2485
|
return {
|
|
2486
2486
|
...spec,
|
|
2487
|
+
web: spec.web ?? null,
|
|
2487
2488
|
preconditions: spec.preconditions ?? null,
|
|
2488
2489
|
errors,
|
|
2489
2490
|
cli: {
|
|
@@ -3084,6 +3085,7 @@ const tokenName = z.string().min(1).describe("Unique name of the operator token.
|
|
|
3084
3085
|
const OPERATIONS = [
|
|
3085
3086
|
defineOperation({
|
|
3086
3087
|
id: "status.get",
|
|
3088
|
+
web: true,
|
|
3087
3089
|
kind: "query",
|
|
3088
3090
|
description: "List items, freshness and tasks with turns, PR summaries and navigation; detail adds full facts.",
|
|
3089
3091
|
mcp: {
|
|
@@ -3223,6 +3225,7 @@ const OPERATIONS = [
|
|
|
3223
3225
|
}),
|
|
3224
3226
|
defineOperation({
|
|
3225
3227
|
id: "task.get",
|
|
3228
|
+
web: true,
|
|
3226
3229
|
kind: "query",
|
|
3227
3230
|
description: "Show a task; refresh reads GitHub PRs.",
|
|
3228
3231
|
mcp: {
|
|
@@ -3363,6 +3366,7 @@ const OPERATIONS = [
|
|
|
3363
3366
|
}),
|
|
3364
3367
|
defineOperation({
|
|
3365
3368
|
id: "task.history",
|
|
3369
|
+
web: true,
|
|
3366
3370
|
kind: "query",
|
|
3367
3371
|
description: "List what happened to a task, oldest first.",
|
|
3368
3372
|
mcp: {
|
|
@@ -3464,6 +3468,7 @@ const OPERATIONS = [
|
|
|
3464
3468
|
}),
|
|
3465
3469
|
defineOperation({
|
|
3466
3470
|
id: "inbox.get",
|
|
3471
|
+
web: true,
|
|
3467
3472
|
kind: "query",
|
|
3468
3473
|
description: "List the comments, blocks and turns addressed to the caller and not yet handled.",
|
|
3469
3474
|
mcp: {
|
|
@@ -3903,6 +3908,7 @@ const OPERATIONS = [
|
|
|
3903
3908
|
}),
|
|
3904
3909
|
defineOperation({
|
|
3905
3910
|
id: "comment.add",
|
|
3911
|
+
web: true,
|
|
3906
3912
|
kind: "mutation",
|
|
3907
3913
|
description: "Comment on a task.",
|
|
3908
3914
|
mcp: {
|
|
@@ -4064,6 +4070,7 @@ const OPERATIONS = [
|
|
|
4064
4070
|
}),
|
|
4065
4071
|
defineOperation({
|
|
4066
4072
|
id: "block.answer",
|
|
4073
|
+
web: true,
|
|
4067
4074
|
kind: "mutation",
|
|
4068
4075
|
description: "Answer a question; the block closes unless it is an operator conversation.",
|
|
4069
4076
|
mcp: {
|
|
@@ -4467,6 +4474,7 @@ const OPERATIONS = [
|
|
|
4467
4474
|
}),
|
|
4468
4475
|
defineOperation({
|
|
4469
4476
|
id: "config.get",
|
|
4477
|
+
web: true,
|
|
4470
4478
|
kind: "query",
|
|
4471
4479
|
description: "Show effective project columns, executors and Spur bindings.",
|
|
4472
4480
|
mcp: {
|
|
@@ -4556,6 +4564,7 @@ function catalogSnapshotBody(operations) {
|
|
|
4556
4564
|
cli: op.cli,
|
|
4557
4565
|
mcp: op.mcp,
|
|
4558
4566
|
slack: op.slack,
|
|
4567
|
+
web: op.web,
|
|
4559
4568
|
examples: op.examples,
|
|
4560
4569
|
input: z.toJSONSchema(op.input, { io: "input" }),
|
|
4561
4570
|
output: z.toJSONSchema(op.output, { io: "output" })
|
|
@@ -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-
|
|
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-BEExLWBt.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-
|
|
2
|
-
import { o as CliError, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { d as buildCatalogSnapshot, ft as configSchema, mt as plainHttpAllowed, p as OPERATIONS } from "./chunk-BEExLWBt.mjs";
|
|
2
|
+
import { o as CliError, t as fetchCatalogVersion } from "./chunk-BSs9OrJD.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, 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, yt as SLACK_BOT_SCOPES } from "./chunk-
|
|
1
|
+
import { Q as ERRORS, a as requestHashOf, 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, yt as SLACK_BOT_SCOPES } from "./chunk-BEExLWBt.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-DAMwWWmT.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-
|
|
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-
|
|
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-BSs9OrJD.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-CFvX6Mf9.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";
|
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-BSs9OrJD.mjs";
|
|
2
2
|
export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestSkillReload, requestTokenEnrollment };
|
package/dist/daemon.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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, 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 TASK_HOLDS, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, dt as configBindings, f as roleCanUseOperation, ft as configSchema, 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 VIAS, y as conversationRefSchema, yt as SLACK_BOT_SCOPES, z as parseRingMarker } from "./chunk-
|
|
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, 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 TASK_HOLDS, 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 VIAS, y as conversationRefSchema, yt as SLACK_BOT_SCOPES, z as parseRingMarker } from "./chunk-BEExLWBt.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-DAMwWWmT.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import { chmodSync, closeSync, existsSync, fchmodSync, fstatSync, fsyncSync, ftruncateSync, linkSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeSync } from "node:fs";
|
|
6
6
|
import { homedir, hostname } from "node:os";
|
|
7
|
-
import path, { basename, dirname, isAbsolute, join, normalize, resolve } from "node:path";
|
|
7
|
+
import path, { basename, dirname, extname, isAbsolute, join, normalize, resolve } from "node:path";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import YAML from "yaml";
|
|
10
10
|
import { spawn, spawnSync } from "node:child_process";
|
|
11
11
|
import { parseEnv } from "node:util";
|
|
12
|
-
import { lstat } from "node:fs/promises";
|
|
12
|
+
import { lstat, readFile, readdir } from "node:fs/promises";
|
|
13
13
|
import Database from "better-sqlite3";
|
|
14
14
|
import { Kysely, SqliteDialect, sql } from "kysely";
|
|
15
15
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -11082,6 +11082,68 @@ function tokenAttentionLine(attention, unusedAfterDays) {
|
|
|
11082
11082
|
return `${head}: ${String(total)} not named`;
|
|
11083
11083
|
}
|
|
11084
11084
|
//#endregion
|
|
11085
|
+
//#region ../core/src/api/ops-route.ts
|
|
11086
|
+
function inputBody(body) {
|
|
11087
|
+
if (body === null || typeof body !== "object" || Array.isArray(body)) throw new CommandError("usage", "Send a JSON object with input and optional key.");
|
|
11088
|
+
const record = body;
|
|
11089
|
+
if (!Object.hasOwn(record, "input") || Object.keys(record).some((name) => name !== "input" && name !== "key") || record["key"] !== void 0 && typeof record["key"] !== "string") throw new CommandError("usage", "Send a JSON object with input and optional key.");
|
|
11090
|
+
return {
|
|
11091
|
+
input: record["input"],
|
|
11092
|
+
key: record["key"]
|
|
11093
|
+
};
|
|
11094
|
+
}
|
|
11095
|
+
function installOperationErrors(app, options) {
|
|
11096
|
+
const handler = (error, request, reply) => {
|
|
11097
|
+
let code = "unexpected";
|
|
11098
|
+
let hint;
|
|
11099
|
+
if (error instanceof CommandError) {
|
|
11100
|
+
code = error.code;
|
|
11101
|
+
hint = error.hint;
|
|
11102
|
+
} else if (error instanceof Error && "statusCode" in error) {
|
|
11103
|
+
if (error.statusCode === 400 || error.statusCode === 413) code = "usage";
|
|
11104
|
+
if (error.statusCode === 413) hint = "Send a smaller JSON body.";
|
|
11105
|
+
}
|
|
11106
|
+
if (code === "unexpected") options.logError?.({
|
|
11107
|
+
requestId: request.id,
|
|
11108
|
+
err: error
|
|
11109
|
+
});
|
|
11110
|
+
const problem = renderHttpProblem({
|
|
11111
|
+
code,
|
|
11112
|
+
requestId: request.id
|
|
11113
|
+
});
|
|
11114
|
+
reply.code(problem.status).type("application/problem+json").send(hint === void 0 ? problem.body : {
|
|
11115
|
+
...problem.body,
|
|
11116
|
+
hint
|
|
11117
|
+
});
|
|
11118
|
+
};
|
|
11119
|
+
app.setErrorHandler(handler);
|
|
11120
|
+
return handler;
|
|
11121
|
+
}
|
|
11122
|
+
function createOpsRoute(app, options, callers = /* @__PURE__ */ new WeakMap()) {
|
|
11123
|
+
const notReady = () => options.stopping?.() === true ? new CommandError("stopping", "Wait until the daemon is running again.") : new CommandError("starting", "Wait until the daemon is ready.");
|
|
11124
|
+
app.post("/v1/ops/:id", { onRequest: async (request) => {
|
|
11125
|
+
if (!options.ready()) throw notReady();
|
|
11126
|
+
callers.set(request, await options.identify(request));
|
|
11127
|
+
} }, async (request, reply) => {
|
|
11128
|
+
const caller = callers.get(request);
|
|
11129
|
+
if (caller === void 0) throw new Error("Operation identity was not resolved.");
|
|
11130
|
+
const operation = OPERATIONS.find((entry) => entry.id === request.params.id);
|
|
11131
|
+
if (operation === void 0) throw new CommandError("version_mismatch", "This daemon does not know the operation. Run `board service restart` to update the daemon, then retry.");
|
|
11132
|
+
if (options.allow?.(operation) === false) throw new CommandError("forbidden", "This operation is not available on the web.");
|
|
11133
|
+
const body = inputBody(request.body);
|
|
11134
|
+
const parsed = operation.input.safeParse(body.input);
|
|
11135
|
+
if (!parsed.success) throw new CommandError(errorCodeOf(parsed.error), "Fix the operation input.");
|
|
11136
|
+
const dispatch = () => dispatchOperation(options, operation.id, parsed.data, caller.actor, body.key);
|
|
11137
|
+
const result = await (options.runOperation === void 0 ? dispatch() : options.runOperation(operation.id, parsed.data, dispatch));
|
|
11138
|
+
await options.afterOperation?.(reply.raw);
|
|
11139
|
+
return reply.send(successEnvelopeSchema.parse({
|
|
11140
|
+
ok: true,
|
|
11141
|
+
requestId: request.id,
|
|
11142
|
+
value: result
|
|
11143
|
+
}));
|
|
11144
|
+
});
|
|
11145
|
+
}
|
|
11146
|
+
//#endregion
|
|
11085
11147
|
//#region ../core/src/api/identity.ts
|
|
11086
11148
|
function sessionActor(project, session, config) {
|
|
11087
11149
|
const actor = actorIdSchema.safeParse(`agent:${project}/${session}`);
|
|
@@ -11140,15 +11202,6 @@ const skillReloadsSchema = z.strictObject({
|
|
|
11140
11202
|
function header(value) {
|
|
11141
11203
|
return Array.isArray(value) ? void 0 : value;
|
|
11142
11204
|
}
|
|
11143
|
-
function inputBody(body) {
|
|
11144
|
-
if (body === null || typeof body !== "object" || Array.isArray(body)) throw new CommandError("usage", "Send a JSON object with input and optional key.");
|
|
11145
|
-
const record = body;
|
|
11146
|
-
if (!Object.hasOwn(record, "input") || Object.keys(record).some((name) => name !== "input" && name !== "key") || record["key"] !== void 0 && typeof record["key"] !== "string") throw new CommandError("usage", "Send a JSON object with input and optional key.");
|
|
11147
|
-
return {
|
|
11148
|
-
input: record["input"],
|
|
11149
|
-
key: record["key"]
|
|
11150
|
-
};
|
|
11151
|
-
}
|
|
11152
11205
|
/** Construct the local HTTP transport; the caller owns listen and close. */
|
|
11153
11206
|
async function createApiServer(options) {
|
|
11154
11207
|
const app = Fastify({
|
|
@@ -11186,29 +11239,7 @@ async function createApiServer(options) {
|
|
|
11186
11239
|
});
|
|
11187
11240
|
done();
|
|
11188
11241
|
});
|
|
11189
|
-
app
|
|
11190
|
-
let code = "unexpected";
|
|
11191
|
-
let hint;
|
|
11192
|
-
if (error instanceof CommandError) {
|
|
11193
|
-
code = error.code;
|
|
11194
|
-
hint = error.hint;
|
|
11195
|
-
} else if (error instanceof Error && "statusCode" in error) {
|
|
11196
|
-
if (error.statusCode === 400 || error.statusCode === 413) code = "usage";
|
|
11197
|
-
if (error.statusCode === 413) hint = "Send a smaller JSON body.";
|
|
11198
|
-
}
|
|
11199
|
-
if (code === "unexpected") options.logError?.({
|
|
11200
|
-
requestId: request.id,
|
|
11201
|
-
err: error
|
|
11202
|
-
});
|
|
11203
|
-
const problem = renderHttpProblem({
|
|
11204
|
-
code,
|
|
11205
|
-
requestId: request.id
|
|
11206
|
-
});
|
|
11207
|
-
reply.code(problem.status).type("application/problem+json").send(hint === void 0 ? problem.body : {
|
|
11208
|
-
...problem.body,
|
|
11209
|
-
hint
|
|
11210
|
-
});
|
|
11211
|
-
});
|
|
11242
|
+
installOperationErrors(app, options);
|
|
11212
11243
|
app.setNotFoundHandler(() => {
|
|
11213
11244
|
throw new CommandError("not_found", "This API route is not available.");
|
|
11214
11245
|
});
|
|
@@ -11293,31 +11324,17 @@ async function createApiServer(options) {
|
|
|
11293
11324
|
}
|
|
11294
11325
|
}));
|
|
11295
11326
|
});
|
|
11296
|
-
app
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
const operation = OPERATIONS.find((entry) => entry.id === request.params.id);
|
|
11308
|
-
if (operation === void 0) throw new CommandError("version_mismatch", "This daemon does not know the operation. Run `board service restart` to update the daemon, then retry.");
|
|
11309
|
-
const body = inputBody(request.body);
|
|
11310
|
-
const parsed = operation.input.safeParse(body.input);
|
|
11311
|
-
if (!parsed.success) throw new CommandError(errorCodeOf(parsed.error), "Fix the operation input.");
|
|
11312
|
-
const dispatch = () => dispatchOperation(options, operation.id, parsed.data, caller.actor, body.key);
|
|
11313
|
-
const result = await (options.runOperation === void 0 ? dispatch() : options.runOperation(operation.id, parsed.data, dispatch));
|
|
11314
|
-
await options.afterOperation?.(reply.raw);
|
|
11315
|
-
return reply.send(successEnvelopeSchema.parse({
|
|
11316
|
-
ok: true,
|
|
11317
|
-
requestId: request.id,
|
|
11318
|
-
value: result
|
|
11319
|
-
}));
|
|
11320
|
-
});
|
|
11327
|
+
createOpsRoute(app, {
|
|
11328
|
+
...options,
|
|
11329
|
+
identify: async (request) => {
|
|
11330
|
+
const sessionHeader = request.headers["x-board-session"];
|
|
11331
|
+
if (Array.isArray(sessionHeader)) throw new CommandError("forbidden", "Use one session identity header.");
|
|
11332
|
+
return identifyCaller(options, {
|
|
11333
|
+
session: sessionHeader,
|
|
11334
|
+
authorization: header(request.headers.authorization)
|
|
11335
|
+
});
|
|
11336
|
+
}
|
|
11337
|
+
}, callers);
|
|
11321
11338
|
return app;
|
|
11322
11339
|
}
|
|
11323
11340
|
/** The only supported listener for the local API. */
|
|
@@ -19313,6 +19330,132 @@ function createInbound(input) {
|
|
|
19313
19330
|
};
|
|
19314
19331
|
}
|
|
19315
19332
|
//#endregion
|
|
19333
|
+
//#region ../core/src/api/web-server.ts
|
|
19334
|
+
const mime = {
|
|
19335
|
+
".html": "text/html; charset=utf-8",
|
|
19336
|
+
".js": "text/javascript; charset=utf-8",
|
|
19337
|
+
".css": "text/css; charset=utf-8",
|
|
19338
|
+
".json": "application/json",
|
|
19339
|
+
".svg": "image/svg+xml",
|
|
19340
|
+
".png": "image/png",
|
|
19341
|
+
".ico": "image/x-icon",
|
|
19342
|
+
".woff2": "font/woff2",
|
|
19343
|
+
".webp": "image/webp"
|
|
19344
|
+
};
|
|
19345
|
+
async function loadFiles(root) {
|
|
19346
|
+
const files = /* @__PURE__ */ new Map();
|
|
19347
|
+
async function walk(dir, prefix) {
|
|
19348
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
19349
|
+
const path = typeof dir === "string" ? join(dir, entry.name) : new URL(entry.name + (entry.isDirectory() ? "/" : ""), dir);
|
|
19350
|
+
const key = `${prefix}/${entry.name}`;
|
|
19351
|
+
if (entry.isDirectory()) await walk(path, key);
|
|
19352
|
+
else if (entry.isFile()) files.set(key, await readFile(path));
|
|
19353
|
+
}
|
|
19354
|
+
}
|
|
19355
|
+
try {
|
|
19356
|
+
await walk(root, "");
|
|
19357
|
+
} catch (err) {
|
|
19358
|
+
if (!(err instanceof Error && "code" in err && (err.code === "ENOENT" || err.code === "ENOTDIR"))) throw err;
|
|
19359
|
+
files.clear();
|
|
19360
|
+
}
|
|
19361
|
+
return files;
|
|
19362
|
+
}
|
|
19363
|
+
/** Independent browser transport; the caller owns listening and shutdown. */
|
|
19364
|
+
async function createWebServer(options) {
|
|
19365
|
+
const files = await loadFiles(options.webRoot);
|
|
19366
|
+
const app = Fastify({
|
|
19367
|
+
logger: false,
|
|
19368
|
+
genReqId: () => randomUUID(),
|
|
19369
|
+
trustProxy: false,
|
|
19370
|
+
frameworkErrors(error, request, reply) {
|
|
19371
|
+
secure(reply);
|
|
19372
|
+
reply.raw.once("finish", () => {
|
|
19373
|
+
audit(request, reply);
|
|
19374
|
+
});
|
|
19375
|
+
try {
|
|
19376
|
+
guard(request, reply);
|
|
19377
|
+
} catch (err) {
|
|
19378
|
+
errorHandler(err, request, reply);
|
|
19379
|
+
return;
|
|
19380
|
+
}
|
|
19381
|
+
errorHandler(error.code === "FST_ERR_MAX_PARAM_LENGTH" ? new CommandError("usage", "Use a shorter web path.") : error, request, reply);
|
|
19382
|
+
}
|
|
19383
|
+
});
|
|
19384
|
+
const errorHandler = installOperationErrors(app, options);
|
|
19385
|
+
function guard(request, reply) {
|
|
19386
|
+
reply.header("x-request-id", request.id);
|
|
19387
|
+
const address = app.server.address();
|
|
19388
|
+
const origin = resolveWebOrigin(options.config.web, address !== null && typeof address === "object" ? address.port : void 0);
|
|
19389
|
+
if (origin === void 0 || request.headers.host !== new URL(origin).host) throw new CommandError("forbidden", "Use the configured web host.");
|
|
19390
|
+
if (request.headers["sec-fetch-site"] === "cross-site") throw new CommandError("forbidden", "Cross-site requests are not accepted.");
|
|
19391
|
+
if (request.method !== "GET" && request.method !== "HEAD" && request.headers.origin !== origin) throw new CommandError("forbidden", "Use the configured web origin.");
|
|
19392
|
+
if (request.method === "POST" && request.headers["content-type"]?.split(";", 1)[0]?.trim().toLowerCase() !== "application/json") throw new CommandError("forbidden", "Use application/json.");
|
|
19393
|
+
const rawPath = request.raw.url?.split("?", 1)[0] ?? "";
|
|
19394
|
+
let decoded;
|
|
19395
|
+
try {
|
|
19396
|
+
decoded = decodeURIComponent(rawPath);
|
|
19397
|
+
} catch {
|
|
19398
|
+
throw new CommandError("not_found", "Invalid web path.");
|
|
19399
|
+
}
|
|
19400
|
+
if (decoded.split(/[\\/]/).some((part) => part === ".." || part === ".")) throw new CommandError("not_found", "Invalid web path.");
|
|
19401
|
+
}
|
|
19402
|
+
function secure(reply) {
|
|
19403
|
+
reply.header("content-security-policy", "default-src 'self'; frame-ancestors 'none'");
|
|
19404
|
+
reply.header("x-frame-options", "DENY");
|
|
19405
|
+
reply.header("x-content-type-options", "nosniff");
|
|
19406
|
+
reply.header("referrer-policy", "no-referrer");
|
|
19407
|
+
}
|
|
19408
|
+
function audit(request, reply) {
|
|
19409
|
+
const forwardedFor = request.headers["x-forwarded-for"];
|
|
19410
|
+
const userAgent = request.headers["user-agent"];
|
|
19411
|
+
options.logRequest({
|
|
19412
|
+
requestId: request.id,
|
|
19413
|
+
method: request.method,
|
|
19414
|
+
path: request.url.split("?", 1)[0] ?? "/",
|
|
19415
|
+
status: reply.statusCode,
|
|
19416
|
+
via: "web",
|
|
19417
|
+
...typeof forwardedFor === "string" ? { forwardedFor } : {},
|
|
19418
|
+
...userAgent === void 0 ? {} : { userAgent }
|
|
19419
|
+
});
|
|
19420
|
+
}
|
|
19421
|
+
app.addHook("onRequest", async (request, reply) => {
|
|
19422
|
+
guard(request, reply);
|
|
19423
|
+
});
|
|
19424
|
+
app.addHook("onSend", async (_request, reply) => {
|
|
19425
|
+
secure(reply);
|
|
19426
|
+
});
|
|
19427
|
+
app.addHook("onResponse", (request, reply, done) => {
|
|
19428
|
+
audit(request, reply);
|
|
19429
|
+
done();
|
|
19430
|
+
});
|
|
19431
|
+
createOpsRoute(app, {
|
|
19432
|
+
...options,
|
|
19433
|
+
identify: () => Promise.resolve({ actor: "operator" }),
|
|
19434
|
+
allow: (operation) => operation.web !== null,
|
|
19435
|
+
runOperation: (id, input, run) => withVia("web", () => options.runOperation === void 0 ? run() : options.runOperation(id, input, run))
|
|
19436
|
+
});
|
|
19437
|
+
app.get("/v1/health", async () => {
|
|
19438
|
+
if (!options.ready()) throw new CommandError(options.stopping?.() === true ? "stopping" : "starting", "Wait until the daemon is ready.");
|
|
19439
|
+
if (options.firstPollDone === void 0) throw new CommandError("not_found", "Health is unavailable.");
|
|
19440
|
+
return { firstPollDone: await options.firstPollDone() };
|
|
19441
|
+
});
|
|
19442
|
+
app.setNotFoundHandler(async (request, reply) => {
|
|
19443
|
+
const path = request.url.split("?", 1)[0] ?? "/";
|
|
19444
|
+
if (request.method !== "GET" && request.method !== "HEAD" || path === "/v1" || path.startsWith("/v1/")) throw new CommandError("not_found", "This web route is not available.");
|
|
19445
|
+
const key = path === "/" ? "/index.html" : path;
|
|
19446
|
+
const file = key === "/index.html" || path.startsWith("/assets/") ? files.get(key) : void 0;
|
|
19447
|
+
const fallback = extname(path) === "" ? files.get("/index.html") : void 0;
|
|
19448
|
+
if (file === void 0 && fallback === void 0) {
|
|
19449
|
+
if (!files.has("/index.html")) return reply.code(503).type("text/html").send("UI is not built: run `pnpm --filter @spur-board/web build`");
|
|
19450
|
+
throw new CommandError("not_found", "This web asset is not available.");
|
|
19451
|
+
}
|
|
19452
|
+
const index = key === "/index.html" || file === void 0;
|
|
19453
|
+
reply.header("cache-control", index ? "no-cache" : /[.-][a-z0-9_-]{8,}\.[^.]+$/i.test(key) ? "public, max-age=31536000, immutable" : "no-cache");
|
|
19454
|
+
return reply.type(index ? "text/html; charset=utf-8" : mime[extname(key)] ?? "application/octet-stream").send(request.method === "HEAD" ? void 0 : file ?? fallback);
|
|
19455
|
+
});
|
|
19456
|
+
return app;
|
|
19457
|
+
}
|
|
19458
|
+
//#endregion
|
|
19316
19459
|
//#region ../daemon/src/config.ts
|
|
19317
19460
|
/** A config or secrets file the daemon cannot use. The message is meant for the operator. */
|
|
19318
19461
|
var ConfigError = class extends Error {
|
|
@@ -24553,9 +24696,10 @@ async function slackBody(response, wire) {
|
|
|
24553
24696
|
}
|
|
24554
24697
|
}
|
|
24555
24698
|
/** Bounded daemon-side checks; no response body or exception text leaves this module. */
|
|
24556
|
-
async function runDaemonDoctor(ctx, productVersion, fetcher = fetch, { deadlineMs = DEADLINE_MS } = {}) {
|
|
24699
|
+
async function runDaemonDoctor(ctx, productVersion, fetcher = fetch, { deadlineMs = DEADLINE_MS, webListening } = {}) {
|
|
24557
24700
|
const { config, secrets } = ctx;
|
|
24558
24701
|
const checks = [];
|
|
24702
|
+
if (config.web.port !== void 0) checks.push(check("web.listening", webListening?.() === true, "Free the configured web port and restart the daemon."));
|
|
24559
24703
|
const jiraTrackers = config.projects.flatMap((project) => project.tracker.type === "jira" ? [project.tracker] : []);
|
|
24560
24704
|
const slackConfigured = Boolean(config.slack.channels.feed || config.slack.channels.orchestrators);
|
|
24561
24705
|
const linkSamples = sampleLinks(ctx, fetcher, deadlineMs, secrets["GITHUB_TOKEN"]);
|
|
@@ -24676,7 +24820,7 @@ function createHttpModule(ctx, options = {}) {
|
|
|
24676
24820
|
registry: options.registry ?? {},
|
|
24677
24821
|
...options.afterOperation === void 0 ? {} : { afterOperation: options.afterOperation },
|
|
24678
24822
|
...options.runOperation === void 0 ? {} : { runOperation: options.runOperation },
|
|
24679
|
-
doctor: options.doctor ?? (() => runDaemonDoctor(ctx, options.productVersion ?? "unknown", options.fetcher)),
|
|
24823
|
+
doctor: options.doctor ?? (() => runDaemonDoctor(ctx, options.productVersion ?? "unknown", options.fetcher, { webListening: options.webListening })),
|
|
24680
24824
|
...options.firstPollDone === void 0 ? {} : { firstPollDone: options.firstPollDone },
|
|
24681
24825
|
...options.productVersion === void 0 ? {} : { productVersion: options.productVersion },
|
|
24682
24826
|
logRequest: ({ requestId, method, url, status, tokenName }) => {
|
|
@@ -24714,6 +24858,62 @@ function createHttpModule(ctx, options = {}) {
|
|
|
24714
24858
|
}
|
|
24715
24859
|
};
|
|
24716
24860
|
}
|
|
24861
|
+
/** Optional browser listener: a bind failure must not take down the agent API. */
|
|
24862
|
+
function createWebModule(ctx, options) {
|
|
24863
|
+
let app;
|
|
24864
|
+
return {
|
|
24865
|
+
listening: () => app !== void 0,
|
|
24866
|
+
async start(signal) {
|
|
24867
|
+
const aborted = () => signal.aborted;
|
|
24868
|
+
if (aborted()) return;
|
|
24869
|
+
let server;
|
|
24870
|
+
try {
|
|
24871
|
+
server = await createWebServer({
|
|
24872
|
+
store: ctx.store,
|
|
24873
|
+
config: ctx.config,
|
|
24874
|
+
clock: ctx.clock,
|
|
24875
|
+
registry: options.registry,
|
|
24876
|
+
ready: () => ctx.state() === "ready",
|
|
24877
|
+
stopping: () => ctx.state() === "stopping",
|
|
24878
|
+
...options.runOperation === void 0 ? {} : { runOperation: options.runOperation },
|
|
24879
|
+
...options.afterOperation === void 0 ? {} : { afterOperation: options.afterOperation },
|
|
24880
|
+
...options.firstPollDone === void 0 ? {} : { firstPollDone: options.firstPollDone },
|
|
24881
|
+
webRoot: options.webRoot ?? new URL("./web/", import.meta.url),
|
|
24882
|
+
logRequest: (entry) => {
|
|
24883
|
+
ctx.log.info(entry, "web request");
|
|
24884
|
+
},
|
|
24885
|
+
logError: ({ requestId, err }) => {
|
|
24886
|
+
ctx.log.error({
|
|
24887
|
+
requestId,
|
|
24888
|
+
err
|
|
24889
|
+
}, "web request failed");
|
|
24890
|
+
}
|
|
24891
|
+
});
|
|
24892
|
+
if (aborted()) return;
|
|
24893
|
+
const address = await server.listen({
|
|
24894
|
+
host: "127.0.0.1",
|
|
24895
|
+
port: ctx.config.web.port ?? 0
|
|
24896
|
+
});
|
|
24897
|
+
if (aborted()) return;
|
|
24898
|
+
options.onListening?.(address);
|
|
24899
|
+
app = server;
|
|
24900
|
+
ctx.log.info({ port: Number(new URL(address).port) }, "web listening");
|
|
24901
|
+
} catch (err) {
|
|
24902
|
+
ctx.log.error({
|
|
24903
|
+
err,
|
|
24904
|
+
port: ctx.config.web.port
|
|
24905
|
+
}, "web listener failed");
|
|
24906
|
+
} finally {
|
|
24907
|
+
if (server !== void 0 && app !== server) await server.close();
|
|
24908
|
+
}
|
|
24909
|
+
},
|
|
24910
|
+
async stop() {
|
|
24911
|
+
const server = app;
|
|
24912
|
+
app = void 0;
|
|
24913
|
+
await server?.close();
|
|
24914
|
+
}
|
|
24915
|
+
};
|
|
24916
|
+
}
|
|
24717
24917
|
//#endregion
|
|
24718
24918
|
//#region ../daemon/src/inbound-module.ts
|
|
24719
24919
|
const RECOVERY_MS = 5 * 6e4;
|
|
@@ -25063,12 +25263,27 @@ function createDaemonModules(ctxFor, ports = {}) {
|
|
|
25063
25263
|
stopStage: "outbox",
|
|
25064
25264
|
module: outbox
|
|
25065
25265
|
});
|
|
25266
|
+
const runOperation = (id, input, run) => id === "item.retry" && inbound !== void 0 && isItemInput(input) ? inbound.retrying(input.item, run) : run();
|
|
25267
|
+
const web = board.config.web.port === void 0 ? void 0 : createWebModule(ctxFor("web"), {
|
|
25268
|
+
registry,
|
|
25269
|
+
runOperation,
|
|
25270
|
+
firstPollDone: () => firstPollDone(board.store.db, board.config, core.completeSince),
|
|
25271
|
+
...ports.afterOperation === void 0 ? {} : { afterOperation: ports.afterOperation },
|
|
25272
|
+
...ports.webRoot === void 0 ? {} : { webRoot: ports.webRoot },
|
|
25273
|
+
...ports.onWebListening === void 0 ? {} : { onListening: ports.onWebListening }
|
|
25274
|
+
});
|
|
25275
|
+
if (web !== void 0) entries.push({
|
|
25276
|
+
name: "web",
|
|
25277
|
+
stopStage: "final",
|
|
25278
|
+
module: web
|
|
25279
|
+
});
|
|
25066
25280
|
entries.push({
|
|
25067
25281
|
name: "http",
|
|
25068
25282
|
stopStage: "final",
|
|
25069
25283
|
module: createHttpModule(ctxFor("http"), {
|
|
25070
25284
|
registry,
|
|
25071
|
-
runOperation
|
|
25285
|
+
runOperation,
|
|
25286
|
+
webListening: () => web?.listening() === true,
|
|
25072
25287
|
firstPollDone: () => firstPollDone(board.store.db, board.config, core.completeSince),
|
|
25073
25288
|
...ports.productVersion === void 0 ? {} : { productVersion: ports.productVersion },
|
|
25074
25289
|
...ports.sessionFetcher === void 0 ? {} : { fetcher: ports.sessionFetcher },
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Q as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-
|
|
2
|
-
import { o as CliError, r as requestOperation } from "./chunk-
|
|
3
|
-
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-
|
|
1
|
+
import { Q as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-BEExLWBt.mjs";
|
|
2
|
+
import { o as CliError, r as requestOperation } from "./chunk-BSs9OrJD.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-CFvX6Mf9.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
package/package.json
CHANGED
package/skills/setup/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: Install, configure, check, and update spur-board with an operator.
|
|
|
5
5
|
|
|
6
6
|
# Set up spur-board
|
|
7
7
|
|
|
8
|
-
Ask one question at a time
|
|
8
|
+
Ask one question at a time when inspection cannot answer it. Check before writing. Ask before changing package, config, secret, service, token, skill-folder, or project-checkout state, or enabling lingering. Never show secret values or put them in chat, logs, or shell history. A same-version rerun changes nothing and repeats no answered question. Never uninstall the service or revoke a token without an explicit operator request.
|
|
9
9
|
|
|
10
10
|
## 1. Inspect
|
|
11
11
|
|
|
@@ -17,20 +17,21 @@ Ask one question at a time, only when current state cannot answer it. Check befo
|
|
|
17
17
|
## 2. Install the package
|
|
18
18
|
|
|
19
19
|
- Check whether the required package version and `board` binary are visible on the live session PATH. If current, skip installation.
|
|
20
|
-
- Otherwise choose a user npm prefix
|
|
20
|
+
- Otherwise choose a user npm prefix with `bin` on that PATH, often `$HOME/.local`; use the live session's Node and npm for `npm i -g --prefix <prefix> spur-board`. Verify `board --version` with the session PATH.
|
|
21
21
|
|
|
22
22
|
## 3. Complete missing configuration
|
|
23
23
|
|
|
24
|
-
- Discover repositories, Spur projects, and GitHub logins where possible.
|
|
24
|
+
- Discover repositories, Spur projects, and GitHub logins where possible. Ask and write only unset values: Jira filter and statuses if used, repositories, project names and roles, the GitHub login agents open PRs under per project (PR discovery filters by it; not always the operator's), and the operator's Slack user ID. Preserve settled and unrelated fields; validate against the shipped config schema.
|
|
25
25
|
- If Slack roles are unset, follow [Slack setup](references/slack.md). List channels visible to the bot and ask which serve orchestrators and feed; store their IDs. The bot sees only private channels it joined.
|
|
26
26
|
- Check required secret names and permissions. Follow [secret files](references/secrets.md) for private entry and any existing `slack.env` migration. Write `config.yaml` and a regular mode `0600` `secrets.env` only when needed.
|
|
27
27
|
- For a `github-issues` project, follow [worker links](references/worker-links.md).
|
|
28
|
-
-
|
|
28
|
+
- For browser access, follow [web setup](references/web.md); check `web.listening`.
|
|
29
|
+
- After config edits, run `board doctor --offline` and apply its config fixes. Offline checks do not prove service or integration readiness.
|
|
29
30
|
|
|
30
31
|
## 4. Start service and grant access
|
|
31
32
|
|
|
32
33
|
- Check `board service status`; if absent, run `board service install`. Ask before enabling user lingering, which keeps the service running after logout.
|
|
33
|
-
- If operator access is unset, ask whether
|
|
34
|
+
- If operator access is unset, ask whether to use a Spur project marked `operator`, without a token, or an outside-Spur session rooted in a chosen folder inside its git worktree if any, never above it. If no valid token exists, run `board token create --name <name> --into <folder>`, then have the operator approve the Slack prompt with its `requestHash`. Check existing agent registration before registering `board mcp`.
|
|
34
35
|
- Check installed skill stamps and content. If absent or older, ask before writing skill folders, run `board skills install`, then verify both Claude Code and Codex copies.
|
|
35
36
|
- For a Spur project used by Codex, check `.agents/skills/spur-board/SKILL.md` in a fresh session. If missing, ask before touching the project's main checkout. In that checkout, link the path to the installed product skill, for example `ln -s "$HOME/.codex/skills/spur-board" .agents/skills/spur-board`. Add `/.agents/skills/spur-board` to the Git exclude file resolved by `git rev-parse --git-path info/exclude`. Add `.agents/skills/spur-board` to that project's `symlinks` in `spur.yaml` and reload Spur config. Start a new session and verify the injected SKILL.md resolves.
|
|
36
37
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Optional browser access
|
|
2
|
+
|
|
3
|
+
Web is off by default. Enable it only on a private network limited to the operator's devices.
|
|
4
|
+
Anyone reaching the port can run web-bound reads and the two writes, `comment.add` and
|
|
5
|
+
`block.answer`, as operator without a token. Browser Host/Origin checks do not authenticate
|
|
6
|
+
network members or local OS users.
|
|
7
|
+
|
|
8
|
+
Set `web.port` and `web.publicOrigin` together in config.yaml:
|
|
9
|
+
|
|
10
|
+
```yaml
|
|
11
|
+
web:
|
|
12
|
+
port: 7777
|
|
13
|
+
publicOrigin: https://{port}.local.example
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The listener binds `127.0.0.1`. Configure a reverse proxy to preserve the original Host and
|
|
17
|
+
use the exact resolved public origin. Every `{port}` is replaced with the actual listener port.
|
|
18
|
+
After restarting the daemon, run `board doctor --json`: `web` checks the configuration and
|
|
19
|
+
`web.listening` checks whether the listener bound. A busy port leaves the agent API running;
|
|
20
|
+
free it or choose another web port and restart.
|
|
21
|
+
|
|
22
|
+
A missing UI build returns 503 with
|
|
23
|
+
``UI is not built: run `pnpm --filter @spur-board/web build` ``.
|
|
24
|
+
Run that build when the UI package is available. Health and catalog operations remain usable.
|
|
25
|
+
The listener does not supply the SPA. Request logs record the web channel and untrusted
|
|
26
|
+
forwarded client metadata and user agent. Journal events and history retain `via: web` beside
|
|
27
|
+
the operator actor.
|
|
@@ -31,3 +31,19 @@ URLs (also before observation), and effective session IDs. Banned links are excl
|
|
|
31
31
|
session navigation. This replaces the former detail-only association array; use `board task PROJ-123`
|
|
32
32
|
for the detailed association list. `board status --detail` adds full ticket, PR and session facts.
|
|
33
33
|
The catalog version changes with these contracts; restart the daemon and live MCP sessions together.
|
|
34
|
+
|
|
35
|
+
## Browser access
|
|
36
|
+
|
|
37
|
+
With `web.port` and `web.publicOrigin` configured, a second loopback listener serves browser
|
|
38
|
+
assets, health and catalog operations whose `web` binding is enabled. It uses the same registry,
|
|
39
|
+
authorization, idempotency and operation hooks as the agent API, with the operator caller.
|
|
40
|
+
Effective project configuration is available through `config.get`.
|
|
41
|
+
Only `comment.add` and `block.answer` are enabled writes. Token and skill routes stay on the
|
|
42
|
+
agent API. The web listener is off by default and a failed bind does not stop the agent API.
|
|
43
|
+
|
|
44
|
+
A private-network proxy must preserve Host. Exact Origin, Host, JSON and fetch-metadata checks
|
|
45
|
+
reject foreign browser pages; anyone with network or local access can still act as operator.
|
|
46
|
+
Logs include the web channel and untrusted forwarded client/user-agent metadata. Web writes
|
|
47
|
+
persist `via: web` in the journal; history returns `actor: operator` with `via: web`, allowing
|
|
48
|
+
clients to show `operator (web)`.
|
|
49
|
+
Missing UI assets return a 503 build hint while health and operations remain available.
|