spur-board 0.17.1 → 0.18.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-Swp5TBku.mjs → client-DfvJWQFq.mjs} +1 -1
- package/dist/client.mjs +1 -1
- package/dist/{config-C1ly8wCm.mjs → config-BDEvO1UV.mjs} +2 -2
- package/dist/daemon.mjs +13 -3
- package/dist/mcp.mjs +3 -3
- package/dist/{src-vzl2nFf6.mjs → src-BQIJz8yP.mjs} +4 -4
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as SLACK_BOT_SCOPES, P as ERRORS, U as configSchema, W as requiredSecretKeys, l as roleCanUseOperation, r as SYSTEMD_SERVICE_SETTINGS, u as OPERATIONS } from "./src-
|
|
2
|
-
import { a as errorExitCode, i as CliError, n as requestOperation, o as renderCliError, r as requestTokenEnrollment, s as escapeTerminalControls } from "./client-
|
|
3
|
-
import { a as memoryVerdictCache, c as loadEnrollmentConfig, i as fileVerdictCache, l as readConfiguredPort, n as cliPackageVersion, o as configFile, s as loadClientConfig, t as checkCatalog, u as resolveDaemonAddress } from "./config-
|
|
1
|
+
import { G as SLACK_BOT_SCOPES, P as ERRORS, U as configSchema, W as requiredSecretKeys, l as roleCanUseOperation, r as SYSTEMD_SERVICE_SETTINGS, u as OPERATIONS } from "./src-BQIJz8yP.mjs";
|
|
2
|
+
import { a as errorExitCode, i as CliError, n as requestOperation, o as renderCliError, r as requestTokenEnrollment, s as escapeTerminalControls } from "./client-DfvJWQFq.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadEnrollmentConfig, i as fileVerdictCache, l as readConfiguredPort, n as cliPackageVersion, o as configFile, s as loadClientConfig, t as checkCatalog, u as resolveDaemonAddress } from "./config-BDEvO1UV.mjs";
|
|
4
4
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
5
5
|
import { chmodSync, closeSync, constants, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { homedir, hostname, userInfo } from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as errorContextSchema, I as errorEnvelopeSchema, L as successEnvelopeSchema, P as ERRORS, f as renderJsonError } from "./src-
|
|
1
|
+
import { F as errorContextSchema, I as errorEnvelopeSchema, L as successEnvelopeSchema, P as ERRORS, f as renderJsonError } from "./src-BQIJz8yP.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 { n as requestOperation, r as requestTokenEnrollment, t as fetchCatalogVersion } from "./client-
|
|
1
|
+
import { n as requestOperation, r as requestTokenEnrollment, t as fetchCatalogVersion } from "./client-DfvJWQFq.mjs";
|
|
2
2
|
export { fetchCatalogVersion, requestOperation, requestTokenEnrollment };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as DEFAULT_HTTP_PORT, U as configSchema, c as buildCatalogSnapshot, u as OPERATIONS } from "./src-
|
|
2
|
-
import { i as CliError, t as fetchCatalogVersion } from "./client-
|
|
1
|
+
import { R as DEFAULT_HTTP_PORT, U as configSchema, c as buildCatalogSnapshot, u as OPERATIONS } from "./src-BQIJz8yP.mjs";
|
|
2
|
+
import { i as CliError, t as fetchCatalogVersion } from "./client-DfvJWQFq.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 errorCodeOf, C as SESSION_STATUSES, D as ticketFactsSchema, E as sessionFactsSchema, G as SLACK_BOT_SCOPES, H as RESERVED_PROJECT, L as successEnvelopeSchema, M as parseRef$1, N as taskKeySchema, O as actorIdSchema, P as ERRORS, S as SESSION_HEALTH_STATES, T as prRefSchema, U as configSchema, V as DEFAULT_SLACK_COMMAND, W as requiredSecretKeys, _ as interactionRefSchema, a as batchSchema, b as EVENT_KINDS, c as buildCatalogSnapshot, d as renderHttpProblem, g as inboundEventSchema, h as conversationRefSchema, i as AdapterError, j as parseActorId, k as encodeActorId, l as roleCanUseOperation, m as SPACE_IDS, n as BOARD_TICK_MS, o as entityRefSchema, s as sourceCursorSchema, t as assertNever, u as OPERATIONS, v as messageRefSchema, w as prFactsSchema, x as eventPayloadSchemas, y as userIdSchema, z as DEFAULT_LINK } from "./src-
|
|
1
|
+
import { A as errorCodeOf, C as SESSION_STATUSES, D as ticketFactsSchema, E as sessionFactsSchema, G as SLACK_BOT_SCOPES, H as RESERVED_PROJECT, L as successEnvelopeSchema, M as parseRef$1, N as taskKeySchema, O as actorIdSchema, P as ERRORS, S as SESSION_HEALTH_STATES, T as prRefSchema, U as configSchema, V as DEFAULT_SLACK_COMMAND, W as requiredSecretKeys, _ as interactionRefSchema, a as batchSchema, b as EVENT_KINDS, c as buildCatalogSnapshot, d as renderHttpProblem, g as inboundEventSchema, h as conversationRefSchema, i as AdapterError, j as parseActorId, k as encodeActorId, l as roleCanUseOperation, m as SPACE_IDS, n as BOARD_TICK_MS, o as entityRefSchema, s as sourceCursorSchema, t as assertNever, u as OPERATIONS, v as messageRefSchema, w as prFactsSchema, x as eventPayloadSchemas, y as userIdSchema, z as DEFAULT_LINK } from "./src-BQIJz8yP.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import { closeSync, existsSync, fstatSync, ftruncateSync, mkdirSync, openSync, readFileSync, readdirSync, writeSync } from "node:fs";
|
|
@@ -11947,6 +11947,12 @@ async function pr(trx, config, fact, at, source) {
|
|
|
11947
11947
|
await trx.updateTable("task").set({ last_change_at: at }).where("id", "=", task.id).execute();
|
|
11948
11948
|
}
|
|
11949
11949
|
}
|
|
11950
|
+
function branchHasKey(branch, key) {
|
|
11951
|
+
const text = branch.toLowerCase();
|
|
11952
|
+
const needle = key.toLowerCase();
|
|
11953
|
+
for (let index = text.indexOf(needle); index !== -1; index = text.indexOf(needle, index + 1)) if (!/[a-z0-9]/.test(text[index - 1] ?? "") && !/[0-9]/.test(text[index + needle.length] ?? "")) return true;
|
|
11954
|
+
return false;
|
|
11955
|
+
}
|
|
11950
11956
|
async function session(trx, config, fact, at, source, ambiguousBranches) {
|
|
11951
11957
|
const old = await trx.selectFrom("session_snapshot").selectAll().where("id", "=", fact.id).executeTakeFirst();
|
|
11952
11958
|
const previous = old === void 0 ? null : parseJson(sessionFactsSchema, old.detail);
|
|
@@ -11997,7 +12003,7 @@ async function session(trx, config, fact, at, source, ambiguousBranches) {
|
|
|
11997
12003
|
const tasks = await trx.selectFrom("task").selectAll().where("membership", "!=", "archived").execute();
|
|
11998
12004
|
const branchPrs = await trx.selectFrom("link").innerJoin("pr_snapshot", (join) => join.on(sql`lower(pr_snapshot.repo) = lower(link.repo)`).onRef("pr_snapshot.number", "=", "link.number")).select(["link.task_id", "pr_snapshot.head_branch"]).where("link.entity", "=", "pr").where("pr_snapshot.head_branch", "=", fact.branch).where("link.banned", "=", 0).execute();
|
|
11999
12005
|
const matches = tasks.filter((task) => {
|
|
12000
|
-
return config.projects.find((entry) => entry.id === task.project)?.spurProjects.some((spur) => spur.name === fact.spurProject && spur.role === "worker") === true && (fact.branch
|
|
12006
|
+
return config.projects.find((entry) => entry.id === task.project)?.spurProjects.some((spur) => spur.name === fact.spurProject && spur.role === "worker") === true && (fact.branch !== null && branchHasKey(fact.branch, task.key) || branchPrs.some((pr) => pr.task_id === task.id));
|
|
12001
12007
|
});
|
|
12002
12008
|
if (matches.length === 1) {
|
|
12003
12009
|
const candidate = matches[0];
|
|
@@ -14243,10 +14249,14 @@ function normalize(issue, trackerId, repo, inFilter) {
|
|
|
14243
14249
|
};
|
|
14244
14250
|
}
|
|
14245
14251
|
function matchesFilter(issue, tracker) {
|
|
14252
|
+
if (tracker.label === void 0 && tracker.milestone === void 0) return true;
|
|
14246
14253
|
if (tracker.label !== void 0) return issue.labels.some((label) => label.name === tracker.label);
|
|
14247
14254
|
return issue.milestone?.title === tracker.milestone;
|
|
14248
14255
|
}
|
|
14249
|
-
/**
|
|
14256
|
+
/**
|
|
14257
|
+
* Lists open filter issues, or every open issue when neither label nor milestone is set, and
|
|
14258
|
+
* resolves requested tickets missing from that listing.
|
|
14259
|
+
*/
|
|
14250
14260
|
function createGithubIssuesAdapter(options) {
|
|
14251
14261
|
const transport = options.fetch ?? fetch;
|
|
14252
14262
|
const [owner, name] = options.tracker.repo.split("/");
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as ERRORS, p as renderMcpError, u as OPERATIONS } from "./src-
|
|
2
|
-
import { i as CliError, n as requestOperation } from "./client-
|
|
3
|
-
import { a as memoryVerdictCache, r as compareCatalogs, s as loadClientConfig, t as checkCatalog } from "./config-
|
|
1
|
+
import { P as ERRORS, p as renderMcpError, u as OPERATIONS } from "./src-BQIJz8yP.mjs";
|
|
2
|
+
import { i as CliError, n as requestOperation } from "./client-DfvJWQFq.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, r as compareCatalogs, s as loadClientConfig, t as checkCatalog } from "./config-BDEvO1UV.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -194,13 +194,13 @@ function linkPattern(fallback, description) {
|
|
|
194
194
|
const githubIssuesTracker = z.strictObject({
|
|
195
195
|
type: z.literal("github-issues"),
|
|
196
196
|
repo: repoSlugSchema,
|
|
197
|
-
label: nonEmpty.optional(),
|
|
198
|
-
milestone: nonEmpty.optional()
|
|
197
|
+
label: nonEmpty.describe("Only open issues with this label become tasks. Set at most one of label and milestone; with neither, every open issue of tracker.repo becomes a task.").optional(),
|
|
198
|
+
milestone: nonEmpty.describe("Only open issues in the milestone with this title become tasks. Set at most one of label and milestone; with neither, every open issue of tracker.repo becomes a task.").optional()
|
|
199
199
|
}).superRefine((tracker, ctx) => {
|
|
200
|
-
if (tracker.label
|
|
200
|
+
if (tracker.label !== void 0 && tracker.milestone !== void 0) ctx.addIssue({
|
|
201
201
|
code: "custom",
|
|
202
202
|
path: ["label"],
|
|
203
|
-
message: "Set
|
|
203
|
+
message: "Set at most one of label or milestone"
|
|
204
204
|
});
|
|
205
205
|
});
|
|
206
206
|
const spurProject = z.strictObject({
|