spur-board 0.39.0 → 0.40.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/cli.mjs +3 -3
- package/dist/{client-CfA-Snt_.mjs → client-xhD478pB.mjs} +1 -1
- package/dist/client.mjs +1 -1
- package/dist/{config-035Sq4n3.mjs → config-BrVK6VAI.mjs} +2 -2
- package/dist/daemon.mjs +40 -11
- package/dist/mcp.mjs +3 -3
- package/dist/{src-X9r7Gx21.mjs → src-BI3t7Lzd.mjs} +20 -3
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as ERRORS, J as
|
|
2
|
-
import { a as CliError, c as escapeTerminalControls, i as requestTokenEnrollment, n as fetchTokenStatus, o as errorExitCode, r as requestOperation, s as renderCliError } from "./client-
|
|
3
|
-
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 "./config-
|
|
1
|
+
import { F as ERRORS, J as requiredSecretKeys, K as configSchema, Y as SLACK_BOT_SCOPES, l as roleCanUseOperation, r as SYSTEMD_SERVICE_SETTINGS, u as OPERATIONS } from "./src-BI3t7Lzd.mjs";
|
|
2
|
+
import { a as CliError, c as escapeTerminalControls, i as requestTokenEnrollment, n as fetchTokenStatus, o as errorExitCode, r as requestOperation, s as renderCliError } from "./client-xhD478pB.mjs";
|
|
3
|
+
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 "./config-BrVK6VAI.mjs";
|
|
4
4
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
5
5
|
import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
6
6
|
import { homedir, hostname, userInfo } from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as successEnvelopeSchema, F as ERRORS, L as errorContextSchema, R as errorEnvelopeSchema, p as renderJsonError } from "./src-
|
|
1
|
+
import { B as successEnvelopeSchema, F as ERRORS, L as errorContextSchema, R as errorEnvelopeSchema, p as renderJsonError } from "./src-BI3t7Lzd.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { request } from "node:http";
|
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as requestTokenEnrollment, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./client-
|
|
1
|
+
import { i as requestTokenEnrollment, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./client-xhD478pB.mjs";
|
|
2
2
|
export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestTokenEnrollment };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { K as configSchema, c as buildCatalogSnapshot, u as OPERATIONS } from "./src-
|
|
2
|
-
import { a as CliError, t as fetchCatalogVersion } from "./client-
|
|
1
|
+
import { K as configSchema, c as buildCatalogSnapshot, u as OPERATIONS } from "./src-BI3t7Lzd.mjs";
|
|
2
|
+
import { a as CliError, t as fetchCatalogVersion } from "./client-xhD478pB.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/daemon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as encodeActorId, B as successEnvelopeSchema, C as SESSION_HEALTH_STATES, D as sessionFactsSchema, E as prRefSchema, F as ERRORS, G as RESERVED_PROJECT, H as DEFAULT_LINK, I as err, J as
|
|
1
|
+
import { A as encodeActorId, B as successEnvelopeSchema, C as SESSION_HEALTH_STATES, D as sessionFactsSchema, E as prRefSchema, F as ERRORS, G as RESERVED_PROJECT, H as DEFAULT_LINK, I as err, J as requiredSecretKeys, K as configSchema, M as parseActorId, N as parseRef$1, O as ticketFactsSchema, P as taskKeySchema, S as eventPayloadSchemas, T as prFactsSchema, W as DEFAULT_SLACK_COMMAND, Y as SLACK_BOT_SCOPES, _ as inboundEventSchema, a as batchSchema, b as userIdSchema, c as buildCatalogSnapshot, d as turnHandedSchema, f as renderHttpProblem, g as conversationRefSchema, h as SPACE_IDS, i as AdapterError, j as errorCodeOf, k as actorIdSchema, l as roleCanUseOperation, n as BOARD_TICK_MS, o as entityRefSchema, q as plainHttpAllowed, s as sourceCursorSchema, t as assertNever, u as OPERATIONS, v as interactionRefSchema, w as SESSION_STATUSES, x as EVENT_KINDS, y as messageRefSchema, z as ok } from "./src-BI3t7Lzd.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import { closeSync, existsSync, fstatSync, fsyncSync, ftruncateSync, linkSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeSync } from "node:fs";
|
|
@@ -11912,6 +11912,7 @@ const UNLINKED_WINDOW_MS = 10080 * 60 * 1e3;
|
|
|
11912
11912
|
function interval(config, source) {
|
|
11913
11913
|
if (source === "spur") return config.adapters.spur.intervalMs;
|
|
11914
11914
|
if (source.startsWith("jira:")) return config.adapters.jira.intervalMs;
|
|
11915
|
+
if (source.startsWith("github-issues:")) return config.adapters.githubIssues.intervalMs;
|
|
11915
11916
|
return config.adapters.github.intervalMs;
|
|
11916
11917
|
}
|
|
11917
11918
|
/** Reads the board's latest facts, items and source availability. */
|
|
@@ -14618,7 +14619,7 @@ function loadConfig(paths) {
|
|
|
14618
14619
|
//#region ../daemon/src/logger.ts
|
|
14619
14620
|
const REDACTED = "[Redacted]";
|
|
14620
14621
|
const MIN_SECRET_LENGTH = 8;
|
|
14621
|
-
const CREDENTIAL_KEY = /^(?:proxy-)?authorization$|^(?:set-)?cookie$|token$/i;
|
|
14622
|
+
const CREDENTIAL_KEY = /^(?:proxy-)?authorization$|^(?:set-)?cookie$|token$|password$|secret$|api[-_]?key$/i;
|
|
14622
14623
|
/** A copy of `value` with every credential key's value replaced, at any depth. */
|
|
14623
14624
|
function censorKeys(value) {
|
|
14624
14625
|
if (Array.isArray(value)) return value.map(censorKeys);
|
|
@@ -15960,6 +15961,22 @@ function matchesFilter(issue, tracker) {
|
|
|
15960
15961
|
if (tracker.label !== void 0) return issue.labels.some((label) => label.name === tracker.label);
|
|
15961
15962
|
return issue.milestone?.title === tracker.milestone;
|
|
15962
15963
|
}
|
|
15964
|
+
/** The REST `core` budget from GitHub's rate-limit headers; undefined when either is invalid. */
|
|
15965
|
+
function restBudget(headers) {
|
|
15966
|
+
const remaining = headers.get("x-ratelimit-remaining");
|
|
15967
|
+
const reset = headers.get("x-ratelimit-reset");
|
|
15968
|
+
if (remaining === null || reset === null) return void 0;
|
|
15969
|
+
if (!/^\d+$/.test(remaining) || !/^\d+$/.test(reset)) return void 0;
|
|
15970
|
+
const count = Number(remaining);
|
|
15971
|
+
const resetAt = /* @__PURE__ */ new Date(Number(reset) * 1e3);
|
|
15972
|
+
if (!Number.isSafeInteger(count) || Number.isNaN(resetAt.getTime())) return void 0;
|
|
15973
|
+
const iso = resetAt.toISOString();
|
|
15974
|
+
if (!/^\d{4}-/.test(iso)) return void 0;
|
|
15975
|
+
return {
|
|
15976
|
+
remaining: count,
|
|
15977
|
+
resetAt: iso
|
|
15978
|
+
};
|
|
15979
|
+
}
|
|
15963
15980
|
/**
|
|
15964
15981
|
* Lists open filter issues, or every open issue when neither label nor milestone is set, and
|
|
15965
15982
|
* resolves requested tickets missing from that listing.
|
|
@@ -15984,6 +16001,7 @@ function createGithubIssuesAdapter(options) {
|
|
|
15984
16001
|
} catch {
|
|
15985
16002
|
throw new AdapterError("transient", "GitHub issue request failed");
|
|
15986
16003
|
}
|
|
16004
|
+
budget = restBudget(response.headers) ?? budget;
|
|
15987
16005
|
if (!response.ok) {
|
|
15988
16006
|
const failure = classifyHttpFailure({
|
|
15989
16007
|
status: response.status,
|
|
@@ -16006,6 +16024,9 @@ function createGithubIssuesAdapter(options) {
|
|
|
16006
16024
|
});
|
|
16007
16025
|
}
|
|
16008
16026
|
let repositoryId;
|
|
16027
|
+
/** The budget of the current poll's last response that carried one. */
|
|
16028
|
+
let budget;
|
|
16029
|
+
const lastBudget = () => budget;
|
|
16009
16030
|
/** Rejects a next link outside this repository before any request goes to it. */
|
|
16010
16031
|
async function checkNext(next, signal) {
|
|
16011
16032
|
let pageUrl;
|
|
@@ -16077,6 +16098,7 @@ function createGithubIssuesAdapter(options) {
|
|
|
16077
16098
|
id: options.id,
|
|
16078
16099
|
intervalMs: options.intervalMs,
|
|
16079
16100
|
async poll(ctx) {
|
|
16101
|
+
budget = void 0;
|
|
16080
16102
|
const observedAt = new Date(options.now()).toISOString();
|
|
16081
16103
|
const milestone = await milestoneNumber(ctx.signal);
|
|
16082
16104
|
const filter = new URL(`${root}/issues`);
|
|
@@ -16141,6 +16163,7 @@ function createGithubIssuesAdapter(options) {
|
|
|
16141
16163
|
});
|
|
16142
16164
|
}
|
|
16143
16165
|
if (ctx.signal.aborted) throw new AdapterError("transient", "GitHub issue poll aborted");
|
|
16166
|
+
const reported = lastBudget();
|
|
16144
16167
|
return {
|
|
16145
16168
|
source: options.id,
|
|
16146
16169
|
observedAt,
|
|
@@ -16149,7 +16172,8 @@ function createGithubIssuesAdapter(options) {
|
|
|
16149
16172
|
kind: "ticket",
|
|
16150
16173
|
facts: item
|
|
16151
16174
|
})),
|
|
16152
|
-
entities
|
|
16175
|
+
entities,
|
|
16176
|
+
...reported === void 0 ? {} : { budget: reported }
|
|
16153
16177
|
};
|
|
16154
16178
|
}
|
|
16155
16179
|
};
|
|
@@ -17291,14 +17315,18 @@ function startAdapters(config, core, options) {
|
|
|
17291
17315
|
}) : blindSource(id, config.adapters.jira.intervalMs, "Jira credential is missing") });
|
|
17292
17316
|
} else {
|
|
17293
17317
|
const id = `github-issues:${project.id}:${project.tracker.repo.toLowerCase()}`;
|
|
17294
|
-
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17318
|
+
const intervalMs = config.adapters.githubIssues.intervalMs;
|
|
17319
|
+
entries.push({
|
|
17320
|
+
adapter: githubToken ? createGithubIssuesAdapter({
|
|
17321
|
+
id,
|
|
17322
|
+
tracker: project.tracker,
|
|
17323
|
+
token: githubToken,
|
|
17324
|
+
now: options.now,
|
|
17325
|
+
intervalMs,
|
|
17326
|
+
...options.fetch === void 0 ? {} : { fetch: options.fetch }
|
|
17327
|
+
}) : blindSource(id, intervalMs, "GitHub credential is missing"),
|
|
17328
|
+
reserveRemaining: config.github.reserveRemaining
|
|
17329
|
+
});
|
|
17302
17330
|
}
|
|
17303
17331
|
if (githubToken) entries.push(...githubSources(config, {
|
|
17304
17332
|
token: githubToken,
|
|
@@ -19063,6 +19091,7 @@ function slackSettings(config, secrets) {
|
|
|
19063
19091
|
throw new ConfigError("SLACK_API_URL must be an HTTP(S) URL");
|
|
19064
19092
|
}
|
|
19065
19093
|
if (url.protocol !== "http:" && url.protocol !== "https:") throw new ConfigError("SLACK_API_URL must be an HTTP(S) URL");
|
|
19094
|
+
if (!plainHttpAllowed(url)) throw new ConfigError("SLACK_API_URL must use https:; http: is allowed only on a loopback host (localhost, 127.0.0.0/8, ::1) because it receives the Slack bot token");
|
|
19066
19095
|
}
|
|
19067
19096
|
return {
|
|
19068
19097
|
token,
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as ERRORS, m as renderMcpError, u as OPERATIONS } from "./src-
|
|
2
|
-
import { a as CliError, r as requestOperation } from "./client-
|
|
3
|
-
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-
|
|
1
|
+
import { F as ERRORS, m as renderMcpError, u as OPERATIONS } from "./src-BI3t7Lzd.mjs";
|
|
2
|
+
import { a as CliError, r as requestOperation } from "./client-xhD478pB.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-BrVK6VAI.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -161,9 +161,25 @@ function rejectDuplicates(items, key, label, ctx) {
|
|
|
161
161
|
seen.add(value);
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
+
const LOOPBACK_IPV4 = /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
|
|
165
|
+
/**
|
|
166
|
+
* False for an `http:` URL whose host is not loopback: such a URL would carry credentials in
|
|
167
|
+
* clear text. Loopback is `localhost`, 127.0.0.0/8 or `[::1]` after WHATWG normalization; no DNS.
|
|
168
|
+
*/
|
|
169
|
+
function plainHttpAllowed(url) {
|
|
170
|
+
if (url.protocol !== "http:") return true;
|
|
171
|
+
const host = url.hostname;
|
|
172
|
+
return host === "localhost" || host === "[::1]" || LOOPBACK_IPV4.test(host);
|
|
173
|
+
}
|
|
164
174
|
const jiraTracker = z.strictObject({
|
|
165
175
|
type: z.literal("jira"),
|
|
166
|
-
baseUrl: z.url({ protocol: /^https?$/ })
|
|
176
|
+
baseUrl: z.url({ protocol: /^https?$/ }).refine((value) => {
|
|
177
|
+
try {
|
|
178
|
+
return plainHttpAllowed(new URL(value));
|
|
179
|
+
} catch {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
}, { error: "Use https: for the Jira URL; http: is allowed only on a loopback host (localhost, 127.0.0.0/8, ::1) because it receives your Jira credentials" }).describe("Jira site URL. https:, or http: only on a loopback host."),
|
|
167
183
|
jql: nonEmpty,
|
|
168
184
|
doneStatuses: z.array(nonEmpty).min(1),
|
|
169
185
|
readyStatuses: z.array(nonEmpty).min(1),
|
|
@@ -404,6 +420,7 @@ const configSchema = z.strictObject({
|
|
|
404
420
|
adapters: z.strictObject({
|
|
405
421
|
spur: spurAdapterSection,
|
|
406
422
|
github: adapterSection(6e4),
|
|
423
|
+
githubIssues: adapterSection(12e4),
|
|
407
424
|
jira: adapterSection(12e4)
|
|
408
425
|
}).prefault({}),
|
|
409
426
|
sources: z.strictObject({
|
|
@@ -458,7 +475,7 @@ const SECRET_ENV_KEYS = [
|
|
|
458
475
|
{
|
|
459
476
|
name: "SLACK_API_URL",
|
|
460
477
|
requiredWhen: "optional",
|
|
461
|
-
purpose: "Override the Slack API URL for local testing."
|
|
478
|
+
purpose: "Override the Slack API URL for local testing. https:, or http: only on a loopback host."
|
|
462
479
|
}
|
|
463
480
|
];
|
|
464
481
|
function requiredSecretKeys(config) {
|
|
@@ -3200,4 +3217,4 @@ function assertNever(value) {
|
|
|
3200
3217
|
throw new Error(`Unexpected value: ${JSON.stringify(value)}`);
|
|
3201
3218
|
}
|
|
3202
3219
|
//#endregion
|
|
3203
|
-
export { encodeActorId as A, successEnvelopeSchema as B, SESSION_HEALTH_STATES as C, sessionFactsSchema as D, prRefSchema as E, ERRORS as F, RESERVED_PROJECT as G, DEFAULT_LINK as H, err as I,
|
|
3220
|
+
export { encodeActorId as A, successEnvelopeSchema as B, SESSION_HEALTH_STATES as C, sessionFactsSchema as D, prRefSchema as E, ERRORS as F, RESERVED_PROJECT as G, DEFAULT_LINK as H, err as I, requiredSecretKeys as J, configSchema as K, errorContextSchema as L, parseActorId as M, parseRef as N, ticketFactsSchema as O, taskKeySchema as P, errorEnvelopeSchema as R, eventPayloadSchemas as S, prFactsSchema as T, DEFAULT_SLACK_APP_NAME as U, DEFAULT_HTTP_PORT as V, DEFAULT_SLACK_COMMAND as W, SLACK_BOT_SCOPES as Y, inboundEventSchema as _, batchSchema as a, userIdSchema as b, buildCatalogSnapshot as c, turnHandedSchema as d, renderHttpProblem as f, conversationRefSchema as g, SPACE_IDS as h, AdapterError as i, errorCodeOf as j, actorIdSchema as k, roleCanUseOperation as l, renderMcpError as m, BOARD_TICK_MS as n, entityRefSchema as o, renderJsonError as p, plainHttpAllowed as q, SYSTEMD_SERVICE_SETTINGS as r, sourceCursorSchema as s, assertNever as t, OPERATIONS as u, interactionRefSchema as v, SESSION_STATUSES as w, EVENT_KINDS as x, messageRefSchema as y, ok as z };
|