@codyswann/lisa 8.1.1 → 8.2.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/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.json +138 -11
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/scripts/queue-contract-resolution.mjs +583 -0
- package/plugins/lisa/.codex-plugin/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-agy/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-agy/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-agy/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-agy/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-agy/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-agy/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa-agy/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa-agy/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa-agy/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-agy/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-agy/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-agy/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-agy/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-copilot/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa-copilot/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-copilot/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-copilot/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-copilot/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-copilot/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-cursor/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa-cursor/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-cursor/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-cursor/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-cursor/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-cursor/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-devin/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-devin/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-devin/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-devin/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-devin/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-devin/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/lisa-devin/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/lisa-devin/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/lisa-devin/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-devin/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-devin/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-devin/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-devin/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/scripts/ready-queue-order.mjs +99 -25
- package/plugins/src/base/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/src/base/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/src/base/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/src/base/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/src/base/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/src/base/scripts/stale-blocker-summary.mjs +222 -0
- package/plugins/src/base/scripts/stale-blocker-sweep.mjs +394 -0
- package/plugins/src/base/scripts/stale-blocker-verify.mjs +193 -0
- package/plugins/src/base/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/src/base/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/src/base/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/src/base/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/src/base/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/src/base/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/src/base/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Shared queue-contract resolution helpers for queue-facing Lisa operator
|
|
4
|
+
* surfaces. These helpers intentionally mirror the same config-resolution
|
|
5
|
+
* defaults that `intake`, `repair-intake`, and future queue-status runtime
|
|
6
|
+
* adapters need, so repo/source/tracker detection does not drift.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const GITHUB_REMOTE_PATTERNS = [
|
|
10
|
+
/github\.com[:/](?<owner>[^/]+)\/(?<repo>[^/.]+?)(?:\.git)?$/,
|
|
11
|
+
/^git@github\.com:(?<owner>[^/]+)\/(?<repo>[^/.]+?)(?:\.git)?$/,
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const DEFAULT_GITHUB_BUILD_DONE = {
|
|
15
|
+
dev: "status:on-dev",
|
|
16
|
+
staging: "status:on-stg",
|
|
17
|
+
production: "status:done",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const DEFAULT_JIRA_BUILD_DONE = {
|
|
21
|
+
dev: "On Dev",
|
|
22
|
+
staging: "On Stg",
|
|
23
|
+
production: "Done",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Linear shares JIRA's env rung NAMES but is a separate constant on purpose:
|
|
27
|
+
// the two vocabularies are independently configurable and a shared object would
|
|
28
|
+
// silently couple them.
|
|
29
|
+
const DEFAULT_LINEAR_BUILD_DONE = {
|
|
30
|
+
dev: "On Dev",
|
|
31
|
+
staging: "On Stg",
|
|
32
|
+
production: "Done",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// The state names a stock Linear team creates brand-new Issues into. `ready`
|
|
36
|
+
// must name a lane a human moves an Issue INTO, so it may never be one of
|
|
37
|
+
// these: the claimable lane would stop meaning "a human flipped this to
|
|
38
|
+
// build-ready" and start meaning "nobody has touched this", and build-intake
|
|
39
|
+
// would dispatch work nobody approved.
|
|
40
|
+
//
|
|
41
|
+
// This list is a STATIC backstop for the stock names, which is the case that
|
|
42
|
+
// actually bit us. It cannot see a team that renamed its default — only the
|
|
43
|
+
// live `Team.defaultIssueState` can, which is why `/lisa:validate-tracker-mapping`
|
|
44
|
+
// carries the authoritative arm (`INVERTED`) and this one carries the arm that
|
|
45
|
+
// needs no network and therefore always runs.
|
|
46
|
+
const LINEAR_STOCK_DEFAULT_CREATED_STATES = [
|
|
47
|
+
"todo",
|
|
48
|
+
"to do",
|
|
49
|
+
"backlog",
|
|
50
|
+
"triage",
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const DEFAULT_GITHUB_LINEAR_PRD_ROLES = {
|
|
54
|
+
draft: "prd-draft",
|
|
55
|
+
ready: "prd-ready",
|
|
56
|
+
in_review: "prd-in-review",
|
|
57
|
+
blocked: "prd-blocked",
|
|
58
|
+
ticketed: "prd-ticketed",
|
|
59
|
+
shipped: "prd-shipped",
|
|
60
|
+
verified: "prd-verified",
|
|
61
|
+
sentinel: "prd-intake-feedback",
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const DEFAULT_NOTION_PRD_ROLES = {
|
|
65
|
+
draft: "Draft",
|
|
66
|
+
ready: "Ready",
|
|
67
|
+
in_review: "In Review",
|
|
68
|
+
blocked: "Blocked",
|
|
69
|
+
ticketed: "Ticketed",
|
|
70
|
+
shipped: "Shipped",
|
|
71
|
+
verified: "Verified",
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const DEFAULT_CONFLUENCE_PARENT_ROLES = {
|
|
75
|
+
draft: null,
|
|
76
|
+
ready: null,
|
|
77
|
+
in_review: null,
|
|
78
|
+
blocked: null,
|
|
79
|
+
ticketed: null,
|
|
80
|
+
shipped: null,
|
|
81
|
+
verified: null,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Resolve the current repo short name per config-resolution's repo-scoping
|
|
86
|
+
* ladder: explicit `.repo`, then `github.repo`, then the origin remote basename.
|
|
87
|
+
*
|
|
88
|
+
* @param {{
|
|
89
|
+
* readonly config?: Record<string, any>
|
|
90
|
+
* readonly gitRemoteUrl?: string
|
|
91
|
+
* }} input
|
|
92
|
+
* @returns {string | null}
|
|
93
|
+
*/
|
|
94
|
+
export function resolveCurrentRepo(input = {}) {
|
|
95
|
+
const config = input.config ?? {};
|
|
96
|
+
|
|
97
|
+
if (typeof config.repo === "string" && config.repo.trim().length > 0) {
|
|
98
|
+
return config.repo.trim();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const githubRef = resolveGithubRepoRef(config, input.gitRemoteUrl);
|
|
102
|
+
if (githubRef?.repo) {
|
|
103
|
+
return githubRef.repo;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return resolveRepoNameFromRemote(input.gitRemoteUrl);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Resolve the repo's configured build tracker.
|
|
111
|
+
*
|
|
112
|
+
* @param {Record<string, any>} config
|
|
113
|
+
* @returns {string}
|
|
114
|
+
*/
|
|
115
|
+
export function resolveBuildTracker(config = {}) {
|
|
116
|
+
if (typeof config.tracker === "string" && config.tracker.trim().length > 0) {
|
|
117
|
+
return config.tracker.trim();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
throw new Error(
|
|
121
|
+
"Unable to resolve the build tracker from config. tracker must be github, linear, or jira."
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Resolve the repo's configured PRD source. Self-hosted GitHub falls back to
|
|
127
|
+
* `github` when `tracker=github` and a GitHub repo identity is configured.
|
|
128
|
+
*
|
|
129
|
+
* @param {Record<string, any>} config
|
|
130
|
+
* @returns {string}
|
|
131
|
+
*/
|
|
132
|
+
export function resolvePrdSource(config = {}) {
|
|
133
|
+
if (typeof config.source === "string" && config.source.trim().length > 0) {
|
|
134
|
+
return config.source.trim();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (
|
|
138
|
+
config.tracker === "github" &&
|
|
139
|
+
config.github?.org &&
|
|
140
|
+
config.github?.repo
|
|
141
|
+
) {
|
|
142
|
+
return "github";
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
throw new Error(
|
|
146
|
+
"Unable to resolve the PRD source from config. Set source explicitly or use tracker=github self-host with github.org/github.repo."
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Resolve the PRD queue argument shape Lisa batch skills expect.
|
|
152
|
+
*
|
|
153
|
+
* @param {Record<string, any>} config
|
|
154
|
+
* @param {string} [source]
|
|
155
|
+
* @returns {string}
|
|
156
|
+
*/
|
|
157
|
+
export function resolvePrdQueueArgument(
|
|
158
|
+
config = {},
|
|
159
|
+
source = resolvePrdSource(config)
|
|
160
|
+
) {
|
|
161
|
+
switch (source) {
|
|
162
|
+
case "github":
|
|
163
|
+
requireGithubRepo(config);
|
|
164
|
+
return "github intake_mode=prd";
|
|
165
|
+
case "linear":
|
|
166
|
+
requireLinearWorkspace(config);
|
|
167
|
+
return "linear";
|
|
168
|
+
case "notion": {
|
|
169
|
+
const databaseId = config.notion?.prdDatabaseId;
|
|
170
|
+
if (!databaseId) {
|
|
171
|
+
throw new Error(
|
|
172
|
+
"Unable to resolve the PRD queue: notion.prdDatabaseId is required when source=notion."
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
return databaseId;
|
|
176
|
+
}
|
|
177
|
+
case "confluence": {
|
|
178
|
+
const parentPageId = config.confluence?.parentPageId;
|
|
179
|
+
const spaceKey = config.confluence?.spaceKey;
|
|
180
|
+
if (!parentPageId && !spaceKey) {
|
|
181
|
+
throw new Error(
|
|
182
|
+
"Unable to resolve the PRD queue: confluence.parentPageId or confluence.spaceKey is required when source=confluence."
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
return parentPageId ?? spaceKey;
|
|
186
|
+
}
|
|
187
|
+
default:
|
|
188
|
+
throw new Error(
|
|
189
|
+
`Unable to resolve the PRD queue from config. source=${String(source)} is not a supported Lisa PRD source.`
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Resolve the build queue argument shape Lisa batch skills expect.
|
|
196
|
+
*
|
|
197
|
+
* @param {Record<string, any>} config
|
|
198
|
+
* @param {string} [tracker]
|
|
199
|
+
* @returns {string}
|
|
200
|
+
*/
|
|
201
|
+
export function resolveBuildQueueArgument(
|
|
202
|
+
config = {},
|
|
203
|
+
tracker = resolveBuildTracker(config),
|
|
204
|
+
options = {}
|
|
205
|
+
) {
|
|
206
|
+
switch (tracker) {
|
|
207
|
+
case "github": {
|
|
208
|
+
const queue = resolveGithubQueueRepoRef(config, options);
|
|
209
|
+
if (options.explicitQueue || config.github?.queueRepo) {
|
|
210
|
+
return `${queue.owner}/${queue.repo} intake_mode=build`;
|
|
211
|
+
}
|
|
212
|
+
return "github intake_mode=build";
|
|
213
|
+
}
|
|
214
|
+
case "linear":
|
|
215
|
+
requireLinearWorkspace(config);
|
|
216
|
+
return "linear";
|
|
217
|
+
case "jira": {
|
|
218
|
+
const project = config.jira?.project;
|
|
219
|
+
if (!project) {
|
|
220
|
+
throw new Error(
|
|
221
|
+
"Unable to resolve the build queue: jira.project is required when tracker=jira."
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
return project;
|
|
225
|
+
}
|
|
226
|
+
default:
|
|
227
|
+
throw new Error(
|
|
228
|
+
"Unable to resolve the build queue from config. tracker must be github, linear, or jira."
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Resolve the PRD lifecycle roles for the configured source vendor.
|
|
235
|
+
*
|
|
236
|
+
* @param {Record<string, any>} config
|
|
237
|
+
* @param {string} [source]
|
|
238
|
+
* @returns {Record<string, any>}
|
|
239
|
+
*/
|
|
240
|
+
export function resolvePrdLifecycleRoles(
|
|
241
|
+
config = {},
|
|
242
|
+
source = resolvePrdSource(config)
|
|
243
|
+
) {
|
|
244
|
+
switch (source) {
|
|
245
|
+
case "github":
|
|
246
|
+
return {
|
|
247
|
+
vendor: "github",
|
|
248
|
+
kind: "labels",
|
|
249
|
+
roles: resolveObjectRoles(
|
|
250
|
+
config.github?.labels?.prd,
|
|
251
|
+
DEFAULT_GITHUB_LINEAR_PRD_ROLES,
|
|
252
|
+
{ allowNull: false }
|
|
253
|
+
),
|
|
254
|
+
};
|
|
255
|
+
case "linear":
|
|
256
|
+
return {
|
|
257
|
+
vendor: "linear",
|
|
258
|
+
kind: "labels",
|
|
259
|
+
roles: resolveObjectRoles(
|
|
260
|
+
config.linear?.labels?.prd,
|
|
261
|
+
DEFAULT_GITHUB_LINEAR_PRD_ROLES,
|
|
262
|
+
{ allowNull: false }
|
|
263
|
+
),
|
|
264
|
+
};
|
|
265
|
+
case "notion":
|
|
266
|
+
return {
|
|
267
|
+
vendor: "notion",
|
|
268
|
+
kind: "status",
|
|
269
|
+
statusProperty: config.notion?.statusProperty || "Status",
|
|
270
|
+
roles: resolveObjectRoles(
|
|
271
|
+
config.notion?.values,
|
|
272
|
+
DEFAULT_NOTION_PRD_ROLES,
|
|
273
|
+
{ allowNull: false }
|
|
274
|
+
),
|
|
275
|
+
};
|
|
276
|
+
case "confluence":
|
|
277
|
+
return {
|
|
278
|
+
vendor: "confluence",
|
|
279
|
+
kind: "parent-pages",
|
|
280
|
+
roles: resolveObjectRoles(
|
|
281
|
+
config.confluence?.parents,
|
|
282
|
+
DEFAULT_CONFLUENCE_PARENT_ROLES,
|
|
283
|
+
{ allowNull: true }
|
|
284
|
+
),
|
|
285
|
+
};
|
|
286
|
+
default:
|
|
287
|
+
throw new Error(
|
|
288
|
+
`Unable to resolve PRD lifecycle roles. source=${String(source)} is not a supported Lisa PRD source.`
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Reject a Linear `ready` override that names a state a stock team creates
|
|
295
|
+
* brand-new Issues into.
|
|
296
|
+
*
|
|
297
|
+
* Failing loudly is the safe direction. An operator staring at a hard error has
|
|
298
|
+
* a broken queue; an operator with a silently inverted gate has agents shipping
|
|
299
|
+
* work no human approved, which is the failure mode that produced this guard.
|
|
300
|
+
*
|
|
301
|
+
* @param {string} configured The resolved `linear.workflow.ready` name.
|
|
302
|
+
* @returns {string} The same name, once it is proven not to be a default lane.
|
|
303
|
+
* @throws {Error} When the name is a stock default created state.
|
|
304
|
+
*/
|
|
305
|
+
function assertLinearReadyIsNotDefaultState(configured) {
|
|
306
|
+
const normalized = configured.trim().toLowerCase();
|
|
307
|
+
|
|
308
|
+
if (!LINEAR_STOCK_DEFAULT_CREATED_STATES.includes(normalized)) {
|
|
309
|
+
return configured;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
throw new Error(
|
|
313
|
+
`linear.workflow.ready is set to "${configured.trim()}", which is where Linear puts a ` +
|
|
314
|
+
"brand-new Issue. That inverts the build-ready gate: the claimable lane would mean " +
|
|
315
|
+
'"nobody has touched this" instead of "a human marked this ready", so intake would ' +
|
|
316
|
+
"claim untouched backlog items. Point linear.workflow.ready at a dedicated state a " +
|
|
317
|
+
"human moves Issues into (the default is `Ready`), then re-run /lisa:setup:linear to " +
|
|
318
|
+
"create it if the team does not have one."
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Resolve the build lifecycle roles for the configured tracker vendor.
|
|
324
|
+
*
|
|
325
|
+
* @param {Record<string, any>} config
|
|
326
|
+
* @param {string} [tracker]
|
|
327
|
+
* @returns {Record<string, any>}
|
|
328
|
+
*/
|
|
329
|
+
export function resolveBuildLifecycleRoles(
|
|
330
|
+
config = {},
|
|
331
|
+
tracker = resolveBuildTracker(config)
|
|
332
|
+
) {
|
|
333
|
+
switch (tracker) {
|
|
334
|
+
case "github":
|
|
335
|
+
return {
|
|
336
|
+
vendor: "github",
|
|
337
|
+
kind: "labels",
|
|
338
|
+
roles: {
|
|
339
|
+
ready: config.github?.labels?.build?.ready || "status:ready",
|
|
340
|
+
claimed:
|
|
341
|
+
config.github?.labels?.build?.claimed || "status:in-progress",
|
|
342
|
+
blocked: config.github?.labels?.build?.blocked || "status:blocked",
|
|
343
|
+
done:
|
|
344
|
+
config.github?.labels?.build?.done ||
|
|
345
|
+
structuredClone(DEFAULT_GITHUB_BUILD_DONE),
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
case "linear":
|
|
349
|
+
// Linear resolves BUILD roles to native workflow states, like JIRA — not
|
|
350
|
+
// to labels like GitHub, which has no workflow-state field to use. The
|
|
351
|
+
// `kind` matters to callers: it tells them whether a transition is a
|
|
352
|
+
// state move or a label swap.
|
|
353
|
+
return {
|
|
354
|
+
vendor: "linear",
|
|
355
|
+
kind: "workflow",
|
|
356
|
+
roles: {
|
|
357
|
+
ready: assertLinearReadyIsNotDefaultState(
|
|
358
|
+
config.linear?.workflow?.ready || "Ready"
|
|
359
|
+
),
|
|
360
|
+
claimed: config.linear?.workflow?.claimed || "In Progress",
|
|
361
|
+
review: config.linear?.workflow?.review || "In Review",
|
|
362
|
+
blocked: config.linear?.workflow?.blocked || "Blocked",
|
|
363
|
+
done:
|
|
364
|
+
config.linear?.workflow?.done ||
|
|
365
|
+
structuredClone(DEFAULT_LINEAR_BUILD_DONE),
|
|
366
|
+
},
|
|
367
|
+
};
|
|
368
|
+
case "jira":
|
|
369
|
+
return {
|
|
370
|
+
vendor: "jira",
|
|
371
|
+
kind: "workflow",
|
|
372
|
+
roles: {
|
|
373
|
+
ready: config.jira?.workflow?.ready || "Ready",
|
|
374
|
+
claimed: config.jira?.workflow?.claimed || "In Progress",
|
|
375
|
+
review: config.jira?.workflow?.review || "Code Review",
|
|
376
|
+
blocked: config.jira?.workflow?.blocked || "Blocked",
|
|
377
|
+
done:
|
|
378
|
+
config.jira?.workflow?.done ||
|
|
379
|
+
structuredClone(DEFAULT_JIRA_BUILD_DONE),
|
|
380
|
+
},
|
|
381
|
+
};
|
|
382
|
+
default:
|
|
383
|
+
throw new Error(
|
|
384
|
+
`Unable to resolve build lifecycle roles. tracker=${String(tracker)} is not a supported Lisa build tracker.`
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Resolve the repo-scoped queue contract queue-status should report against.
|
|
391
|
+
*
|
|
392
|
+
* @param {{
|
|
393
|
+
* readonly config?: Record<string, any>
|
|
394
|
+
* readonly gitRemoteUrl?: string
|
|
395
|
+
* }} input
|
|
396
|
+
* @returns {{
|
|
397
|
+
* readonly currentRepo: string | null
|
|
398
|
+
* readonly source: string
|
|
399
|
+
* readonly tracker: string
|
|
400
|
+
* readonly prdQueue: { readonly argument: string } & Record<string, any>
|
|
401
|
+
* readonly buildQueue: { readonly argument: string } & Record<string, any>
|
|
402
|
+
* }}
|
|
403
|
+
*/
|
|
404
|
+
export function resolveQueueContract(input = {}) {
|
|
405
|
+
const config = input.config ?? {};
|
|
406
|
+
const source = resolvePrdSource(config);
|
|
407
|
+
const tracker = resolveBuildTracker(config);
|
|
408
|
+
|
|
409
|
+
const githubIdentity = resolveGithubRepoRef(config, input.gitRemoteUrl);
|
|
410
|
+
const githubQueue =
|
|
411
|
+
tracker === "github"
|
|
412
|
+
? resolveGithubQueueRepoRef(config, {
|
|
413
|
+
gitRemoteUrl: input.gitRemoteUrl,
|
|
414
|
+
})
|
|
415
|
+
: null;
|
|
416
|
+
|
|
417
|
+
return {
|
|
418
|
+
currentRepo: resolveCurrentRepo(input),
|
|
419
|
+
source,
|
|
420
|
+
tracker,
|
|
421
|
+
prdQueue: {
|
|
422
|
+
argument: resolvePrdQueueArgument(config, source),
|
|
423
|
+
...resolvePrdLifecycleRoles(config, source),
|
|
424
|
+
},
|
|
425
|
+
buildQueue: {
|
|
426
|
+
argument: resolveBuildQueueArgument(config, tracker, {
|
|
427
|
+
gitRemoteUrl: input.gitRemoteUrl,
|
|
428
|
+
}),
|
|
429
|
+
...(tracker === "github"
|
|
430
|
+
? {
|
|
431
|
+
identityRepo: `${githubIdentity.owner}/${githubIdentity.repo}`,
|
|
432
|
+
queueRepo: `${githubQueue.owner}/${githubQueue.repo}`,
|
|
433
|
+
}
|
|
434
|
+
: {}),
|
|
435
|
+
...resolveBuildLifecycleRoles(config, tracker),
|
|
436
|
+
},
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* @param {Record<string, any> | undefined} values
|
|
442
|
+
* @param {Record<string, any>} defaults
|
|
443
|
+
* @param {{ readonly allowNull?: boolean }} [options]
|
|
444
|
+
* @returns {Record<string, any>}
|
|
445
|
+
*/
|
|
446
|
+
function resolveObjectRoles(values, defaults, options = {}) {
|
|
447
|
+
const resolved = { ...defaults };
|
|
448
|
+
|
|
449
|
+
for (const [key, value] of Object.entries(values ?? {})) {
|
|
450
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
451
|
+
resolved[key] = value;
|
|
452
|
+
continue;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (options.allowNull === true && value === null) {
|
|
456
|
+
resolved[key] = value;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
return resolved;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @param {Record<string, any>} config
|
|
465
|
+
* @param {string | undefined} gitRemoteUrl
|
|
466
|
+
* @returns {{ readonly owner: string, readonly repo: string } | null}
|
|
467
|
+
*/
|
|
468
|
+
export function resolveGithubRepoRef(config = {}, gitRemoteUrl) {
|
|
469
|
+
const owner = config.github?.org;
|
|
470
|
+
const repo = config.github?.repo;
|
|
471
|
+
|
|
472
|
+
if (owner && repo) {
|
|
473
|
+
return { owner, repo };
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (!gitRemoteUrl) {
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
for (const pattern of GITHUB_REMOTE_PATTERNS) {
|
|
481
|
+
const match = gitRemoteUrl.match(pattern);
|
|
482
|
+
if (match?.groups?.owner && match.groups.repo) {
|
|
483
|
+
return {
|
|
484
|
+
owner: match.groups.owner,
|
|
485
|
+
repo: match.groups.repo,
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
return null;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Resolve the GitHub queue without changing the repository identity used
|
|
495
|
+
* for automation names and `repo:<name>` claim scoping. An explicit invocation
|
|
496
|
+
* target wins, followed by `github.queueRepo`, then the identity repo.
|
|
497
|
+
*
|
|
498
|
+
* `github.queueRepo` may be a short repo name (normalized to the identity
|
|
499
|
+
* owner) or an `owner/repo` reference. Cross-owner queues therefore remain
|
|
500
|
+
* explicit while the common same-organization umbrella layout stays concise.
|
|
501
|
+
*
|
|
502
|
+
* @param {Record<string, any>} config
|
|
503
|
+
* @param {{ readonly explicitQueue?: string, readonly gitRemoteUrl?: string }} [options]
|
|
504
|
+
* @returns {{ readonly owner: string, readonly repo: string }}
|
|
505
|
+
*/
|
|
506
|
+
export function resolveGithubQueueRepoRef(config = {}, options = {}) {
|
|
507
|
+
const identity = resolveGithubRepoRef(config, options.gitRemoteUrl);
|
|
508
|
+
if (!identity) {
|
|
509
|
+
throw new Error(
|
|
510
|
+
"Unable to resolve the GitHub repository identity: github.org/github.repo or a GitHub origin remote is required."
|
|
511
|
+
);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
const configured = options.explicitQueue ?? config.github?.queueRepo;
|
|
515
|
+
if (configured === undefined || configured === null || configured === "") {
|
|
516
|
+
return identity;
|
|
517
|
+
}
|
|
518
|
+
if (typeof configured !== "string") {
|
|
519
|
+
throw new Error(
|
|
520
|
+
"Unable to resolve the GitHub queue: github.queueRepo must be a repo name or owner/repo."
|
|
521
|
+
);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const value = configured
|
|
525
|
+
.trim()
|
|
526
|
+
.replace(/^https:\/\/github\.com\//i, "")
|
|
527
|
+
.replace(/\.git$/i, "");
|
|
528
|
+
const parts = value.split("/").filter(Boolean);
|
|
529
|
+
if (parts.length === 1) {
|
|
530
|
+
return { owner: identity.owner, repo: parts[0] };
|
|
531
|
+
}
|
|
532
|
+
if (parts.length === 2) {
|
|
533
|
+
return { owner: parts[0], repo: parts[1] };
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
throw new Error(
|
|
537
|
+
"Unable to resolve the GitHub queue: github.queueRepo must be a repo name or owner/repo."
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* @param {string | undefined} gitRemoteUrl
|
|
543
|
+
* @returns {string | null}
|
|
544
|
+
*/
|
|
545
|
+
function resolveRepoNameFromRemote(gitRemoteUrl) {
|
|
546
|
+
if (!gitRemoteUrl || typeof gitRemoteUrl !== "string") {
|
|
547
|
+
return null;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
const trimmed = gitRemoteUrl.trim();
|
|
551
|
+
if (!trimmed) {
|
|
552
|
+
return null;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
const basename = trimmed.split(/[/:]/).pop();
|
|
556
|
+
if (!basename) {
|
|
557
|
+
return null;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
return basename.replace(/\.git$/i, "") || null;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* @param {Record<string, any>} config
|
|
565
|
+
*/
|
|
566
|
+
function requireGithubRepo(config) {
|
|
567
|
+
if (!config.github?.org || !config.github?.repo) {
|
|
568
|
+
throw new Error(
|
|
569
|
+
"Unable to resolve the GitHub queue: github.org and github.repo are required."
|
|
570
|
+
);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* @param {Record<string, any>} config
|
|
576
|
+
*/
|
|
577
|
+
function requireLinearWorkspace(config) {
|
|
578
|
+
if (!config.linear?.workspace) {
|
|
579
|
+
throw new Error(
|
|
580
|
+
"Unable to resolve the Linear queue: linear.workspace is required."
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
}
|