agent-issues 0.0.119 → 0.0.126

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.
Files changed (172) hide show
  1. package/dist/build-info.json +3 -0
  2. package/dist/cli.js +97746 -26
  3. package/kanban/dist/assets/index-CIAg6qj5.css +1 -0
  4. package/kanban/dist/assets/index-DaYQjJS7.js +920 -0
  5. package/kanban/dist/index.html +13 -0
  6. package/package.json +12 -11
  7. package/site/dist/assets/index-D6NM1iDo.js +4533 -0
  8. package/site/dist/index.html +1 -1
  9. package/skills/agent-issues-operating-contract.md +1 -1
  10. package/skills/{ai-wayfinder → ai-pioneer}/SKILL.md +9 -9
  11. package/skills/recipes/README.md +2 -2
  12. package/skills/recipes/{wayfinder-map.md → pioneer-map.md} +2 -2
  13. package/skills/recipes/{wayfinder-ticket.md → pioneer-ticket.md} +2 -2
  14. package/dist/agent-installer.d.ts +0 -49
  15. package/dist/agent-installer.js +0 -171
  16. package/dist/agent-installer.js.map +0 -1
  17. package/dist/auth-session.d.ts +0 -40
  18. package/dist/auth-session.js +0 -107
  19. package/dist/auth-session.js.map +0 -1
  20. package/dist/body-backfill.d.ts +0 -26
  21. package/dist/body-backfill.js +0 -219
  22. package/dist/body-backfill.js.map +0 -1
  23. package/dist/build-mode.d.ts +0 -1
  24. package/dist/build-mode.js +0 -1
  25. package/dist/build-mode.js.map +0 -1
  26. package/dist/cli/commands/auth.d.ts +0 -61
  27. package/dist/cli/commands/auth.js +0 -134
  28. package/dist/cli/commands/auth.js.map +0 -1
  29. package/dist/cli/commands/backfill.d.ts +0 -8
  30. package/dist/cli/commands/backfill.js +0 -36
  31. package/dist/cli/commands/backfill.js.map +0 -1
  32. package/dist/cli/commands/comments.d.ts +0 -34
  33. package/dist/cli/commands/comments.js +0 -124
  34. package/dist/cli/commands/comments.js.map +0 -1
  35. package/dist/cli/commands/context.d.ts +0 -13
  36. package/dist/cli/commands/context.js +0 -156
  37. package/dist/cli/commands/context.js.map +0 -1
  38. package/dist/cli/commands/entities.d.ts +0 -91
  39. package/dist/cli/commands/entities.js +0 -420
  40. package/dist/cli/commands/entities.js.map +0 -1
  41. package/dist/cli/commands/export.d.ts +0 -20
  42. package/dist/cli/commands/export.js +0 -98
  43. package/dist/cli/commands/export.js.map +0 -1
  44. package/dist/cli/commands/fallback.d.ts +0 -6
  45. package/dist/cli/commands/fallback.js +0 -10
  46. package/dist/cli/commands/fallback.js.map +0 -1
  47. package/dist/cli/commands/handoff.d.ts +0 -1
  48. package/dist/cli/commands/handoff.js +0 -2
  49. package/dist/cli/commands/handoff.js.map +0 -1
  50. package/dist/cli/commands/installers.d.ts +0 -37
  51. package/dist/cli/commands/installers.js +0 -78
  52. package/dist/cli/commands/installers.js.map +0 -1
  53. package/dist/cli/commands/kanban.d.ts +0 -8
  54. package/dist/cli/commands/kanban.js +0 -83
  55. package/dist/cli/commands/kanban.js.map +0 -1
  56. package/dist/cli/commands/meta.d.ts +0 -14
  57. package/dist/cli/commands/meta.js +0 -33
  58. package/dist/cli/commands/meta.js.map +0 -1
  59. package/dist/cli/commands/plan-entries.d.ts +0 -30
  60. package/dist/cli/commands/plan-entries.js +0 -94
  61. package/dist/cli/commands/plan-entries.js.map +0 -1
  62. package/dist/cli/commands/site.d.ts +0 -29
  63. package/dist/cli/commands/site.js +0 -89
  64. package/dist/cli/commands/site.js.map +0 -1
  65. package/dist/cli/commands/sql.d.ts +0 -6
  66. package/dist/cli/commands/sql.js +0 -21
  67. package/dist/cli/commands/sql.js.map +0 -1
  68. package/dist/cli/commands/synchronize.d.ts +0 -12
  69. package/dist/cli/commands/synchronize.js +0 -31
  70. package/dist/cli/commands/synchronize.js.map +0 -1
  71. package/dist/cli/commands/tenants.d.ts +0 -29
  72. package/dist/cli/commands/tenants.js +0 -101
  73. package/dist/cli/commands/tenants.js.map +0 -1
  74. package/dist/cli/index.d.ts +0 -4
  75. package/dist/cli/index.js +0 -120
  76. package/dist/cli/index.js.map +0 -1
  77. package/dist/cli/renderers.d.ts +0 -250
  78. package/dist/cli/renderers.js +0 -286
  79. package/dist/cli/renderers.js.map +0 -1
  80. package/dist/cli/shared.d.ts +0 -97
  81. package/dist/cli/shared.js +0 -192
  82. package/dist/cli/shared.js.map +0 -1
  83. package/dist/cli.d.ts +0 -11
  84. package/dist/cli.js.map +0 -1
  85. package/dist/context-cli.d.ts +0 -16
  86. package/dist/context-cli.js +0 -131
  87. package/dist/context-cli.js.map +0 -1
  88. package/dist/daemon/daemon-lifecycle.d.ts +0 -1
  89. package/dist/daemon/daemon-lifecycle.js +0 -2
  90. package/dist/daemon/daemon-lifecycle.js.map +0 -1
  91. package/dist/daemon/daemon-main.d.ts +0 -14
  92. package/dist/daemon/daemon-main.js +0 -30
  93. package/dist/daemon/daemon-main.js.map +0 -1
  94. package/dist/daemon/local-daemon-store.d.ts +0 -21
  95. package/dist/daemon/local-daemon-store.js +0 -31
  96. package/dist/daemon/local-daemon-store.js.map +0 -1
  97. package/dist/entity-projection.d.ts +0 -141
  98. package/dist/entity-projection.js +0 -147
  99. package/dist/entity-projection.js.map +0 -1
  100. package/dist/entra-device-login.d.ts +0 -12
  101. package/dist/entra-device-login.js +0 -40
  102. package/dist/entra-device-login.js.map +0 -1
  103. package/dist/export-files.d.ts +0 -24
  104. package/dist/export-files.js +0 -230
  105. package/dist/export-files.js.map +0 -1
  106. package/dist/export-markdown.d.ts +0 -24
  107. package/dist/export-markdown.js +0 -343
  108. package/dist/export-markdown.js.map +0 -1
  109. package/dist/help.d.ts +0 -112
  110. package/dist/help.js +0 -1430
  111. package/dist/help.js.map +0 -1
  112. package/dist/kanban/assets.d.ts +0 -3
  113. package/dist/kanban/assets.js +0 -37
  114. package/dist/kanban/assets.js.map +0 -1
  115. package/dist/kanban/index.d.ts +0 -1
  116. package/dist/kanban/index.js +0 -2
  117. package/dist/kanban/index.js.map +0 -1
  118. package/dist/kanban/server.d.ts +0 -28
  119. package/dist/kanban/server.js +0 -118
  120. package/dist/kanban/server.js.map +0 -1
  121. package/dist/mcp-installer.d.ts +0 -32
  122. package/dist/mcp-installer.js +0 -118
  123. package/dist/mcp-installer.js.map +0 -1
  124. package/dist/mcp-server/index.d.ts +0 -11
  125. package/dist/mcp-server/index.js +0 -504
  126. package/dist/mcp-server/index.js.map +0 -1
  127. package/dist/mcp-server/index.test.d.ts +0 -1
  128. package/dist/mcp-server/index.test.js +0 -746
  129. package/dist/mcp-server/index.test.js.map +0 -1
  130. package/dist/mcp-server/mcp-tool-audit.d.ts +0 -6
  131. package/dist/mcp-server/mcp-tool-audit.js +0 -47
  132. package/dist/mcp-server/mcp-tool-audit.js.map +0 -1
  133. package/dist/mcp-server/stdio.d.ts +0 -2
  134. package/dist/mcp-server/stdio.js +0 -7
  135. package/dist/mcp-server/stdio.js.map +0 -1
  136. package/dist/mcp.d.ts +0 -2
  137. package/dist/mcp.js +0 -19
  138. package/dist/mcp.js.map +0 -1
  139. package/dist/open-storage-driver.d.ts +0 -53
  140. package/dist/open-storage-driver.js +0 -71
  141. package/dist/open-storage-driver.js.map +0 -1
  142. package/dist/open-synchronize-stores.d.ts +0 -24
  143. package/dist/open-synchronize-stores.js +0 -34
  144. package/dist/open-synchronize-stores.js.map +0 -1
  145. package/dist/project-identity.d.ts +0 -23
  146. package/dist/project-identity.js +0 -121
  147. package/dist/project-identity.js.map +0 -1
  148. package/dist/runtime-access-boundary.d.ts +0 -7
  149. package/dist/runtime-access-boundary.js +0 -182
  150. package/dist/runtime-access-boundary.js.map +0 -1
  151. package/dist/service-discovery.d.ts +0 -10
  152. package/dist/service-discovery.js +0 -64
  153. package/dist/service-discovery.js.map +0 -1
  154. package/dist/site/assets.d.ts +0 -4
  155. package/dist/site/assets.js +0 -46
  156. package/dist/site/assets.js.map +0 -1
  157. package/dist/site/cloud-events-relay.d.ts +0 -18
  158. package/dist/site/cloud-events-relay.js +0 -78
  159. package/dist/site/cloud-events-relay.js.map +0 -1
  160. package/dist/site/index.d.ts +0 -1
  161. package/dist/site/index.js +0 -2
  162. package/dist/site/index.js.map +0 -1
  163. package/dist/site/server.d.ts +0 -42
  164. package/dist/site/server.js +0 -320
  165. package/dist/site/server.js.map +0 -1
  166. package/dist/skill-installer.d.ts +0 -35
  167. package/dist/skill-installer.js +0 -174
  168. package/dist/skill-installer.js.map +0 -1
  169. package/dist/vitest-setup.d.ts +0 -1
  170. package/dist/vitest-setup.js +0 -7
  171. package/dist/vitest-setup.js.map +0 -1
  172. package/site/dist/assets/index-DSR4mIml.js +0 -4396
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>agent-issues viewer</title>
7
7
  <style>#app { min-height: 100vh; }</style>
8
- <script type="module" crossorigin src="/assets/index-DSR4mIml.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-D6NM1iDo.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-DKEVC0aQ.css">
10
10
  </head>
11
11
  <body>
@@ -173,7 +173,7 @@ These operations have no MCP equivalent. Use the CLI: `install-mcp`, `list-mcp`,
173
173
 
174
174
  Before you create or replace authored body content, identify the record type and read its matching recipe in [`recipes`](./recipes/README.md).
175
175
 
176
- - When the catalog has a recipe for the record type, use that recipe for the body. This applies to context summaries, context terms, entities, handoffs, issue comments, and Wayfinder records.
176
+ - When the catalog has a recipe for the record type, use that recipe for the body. This applies to context summaries, context terms, entities, handoffs, issue comments, and Pioneer records.
177
177
  - Do this before the **Entity Create And Edit** recipe, **Context Write** recipe, **Plan Entry Write** recipe, **Issue Comment Write** recipe, or **Handoff Write** recipe creates or replaces a body.
178
178
  - Tracker actions that do not create or replace a body do not need a recipe.
179
179
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: ai-wayfinder
2
+ name: ai-pioneer
3
3
  description: Plan a huge chunk of work — more than one agent session can hold — as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.
4
4
  disable-model-invocation: true
5
5
  ---
@@ -7,13 +7,13 @@ disable-model-invocation: true
7
7
  Follow the shared [language standard](../agent-issues-language.md).
8
8
  Follow the shared [skill operating contract](../agent-issues-operating-contract.md).
9
9
 
10
- A loose idea has arrived — too big for one agent session, and wrapped in fog: the way from here to the **destination** isn't visible yet. Wayfinding is about finding that way, not charging at the destination. This skill charts the way as a **shared map** in `agent-issues`, then works its **decision tickets** — questions whose resolution is a decision, not slices of a build to execute — one at a time until the route is clear.
10
+ A loose idea has arrived — too big for one agent session, and wrapped in fog: the way from here to the **destination** isn't visible yet. Pioneering is about finding that way, not charging at the destination. This skill charts the way as a **shared map** in `agent-issues`, then works its **decision tickets** — questions whose resolution is a decision, not slices of a build to execute — one at a time until the route is clear.
11
11
 
12
12
  The destination varies per effort, and naming it is the first act of charting — it shapes every ticket. It might be a spec to hand off and iterate on, a decision to lock before planning starts, or a change made in place like a data-structure migration. The map is domain-agnostic — engineering work, course content, whatever fits the shape.
13
13
 
14
14
  ## Plan, don't do
15
15
 
16
- Wayfinder is **planning** by default: each ticket resolves a decision, and the map is done when the way is clear — nothing left to decide before someone goes and does the thing. The pull to just do the work is usually the signal you've reached the edge of the map and it's time to hand off. An effort can override this in its **Notes** — carrying execution into the map itself — but absent that, produce decisions, not deliverables.
16
+ Pioneer is **planning** by default: each ticket resolves a decision, and the map is done when the way is clear — nothing left to decide before someone goes and does the thing. The pull to just do the work is usually the signal you've reached the edge of the map and it's time to hand off. An effort can override this in its **Notes** — carrying execution into the map itself — but absent that, produce decisions, not deliverables.
17
17
 
18
18
  ## Refer by title
19
19
 
@@ -25,17 +25,17 @@ The map is a single `agent-issues` issue under the active initiative — the can
25
25
 
26
26
  The map is an **index**, not a store. It lists the decisions made and points at the tickets that hold their detail; a decision lives in exactly one place — its ticket — so the map never restates it, only gists it and links.
27
27
 
28
- Use `agent-issues` as the source of truth. Run the **Entity Create And Edit** recipe to create the map as a `wayfinder-map` issue under the initiative and each ticket as a `wayfinder-ticket` child of the map. Run the **Entity Relations** recipe to add dependencies after creation with `blocks` relations.
28
+ Use `agent-issues` as the source of truth. Run the **Entity Create And Edit** recipe to create the map as a `pioneer-map` issue under the initiative and each ticket as a `pioneer-ticket` child of the map. Run the **Entity Relations** recipe to add dependencies after creation with `blocks` relations.
29
29
 
30
30
  ### The map body
31
31
 
32
32
  The whole map at low resolution, loaded once per session. Open tickets are **not** listed — run the **Entity List** recipe for child issues under the map when needed.
33
- Use the [Wayfinder Map recipe](../recipes/wayfinder-map.md). It preserves the current map format.
33
+ Use the [Pioneer Map recipe](../recipes/pioneer-map.md). It preserves the current map format.
34
34
 
35
35
  ### Tickets
36
36
 
37
37
  Each ticket is a **child issue** of the map. Its body contains one question, sized to one 100K token agent session:
38
- Use the [Wayfinder Ticket recipe](../recipes/wayfinder-ticket.md). It preserves the current ticket format.
38
+ Use the [Pioneer Ticket recipe](../recipes/pioneer-ticket.md). It preserves the current ticket format.
39
39
 
40
40
  The `## Ticket type` value is one of `research`, `prototype`, `grilling`, or `task`; see Ticket Types below.
41
41
 
@@ -49,7 +49,7 @@ Run the **Entity Create And Edit** recipe to record the answer in `## Resolution
49
49
 
50
50
  For a grilling ticket, give `ai-plan` the complete ticket reference. It runs the **Entity Create And Edit** recipe to create an initiative-owned Plan for a new effort, or resumes only an explicit Plan reference. Every Plan entry from that session uses the **Plan Entry Write** recipe to link back to the ticket reference.
51
51
 
52
- The Plan is the canonical detailed resolution. When the ticket is done, retain its Question and status, and use a concise Resolution link to the Plan. Do not copy the detailed reasoning into the ticket. A Plan does not inform a Wayfinder map.
52
+ The Plan is the canonical detailed resolution. When the ticket is done, retain its Question and status, and use a concise Resolution link to the Plan. Do not copy the detailed reasoning into the ticket. A Plan does not inform a Pioneer map.
53
53
 
54
54
  ## Ticket Types
55
55
 
@@ -92,8 +92,8 @@ User invokes with a loose idea.
92
92
  1. **Resolve the tracked scope.** Run the **Entity Read** recipe and the **Context Read** recipe to find the active initiative and read its context. For a new feature, run the **Entity Create And Edit** recipe to create a new initiative by default. Do not create a map outside an initiative.
93
93
  2. **Name the destination.** Run `ai-plan` with `ai-domain-modeling` active to pin down what this map is finding its way to — the spec, decision, or change. The destination fixes the scope, so settle it first.
94
94
  3. **Map the frontier.** Grill again, **breadth-first** this time: fan out across the whole space rather than deep on any one thread, surface the open decisions and the first steps that are possible now. **If this finds no fog** — the way to the destination is already clear and small enough for one session — do not create a map. Ask the user how to proceed.
95
- 4. **Create the map** as a `wayfinder-map` child issue of the initiative: Destination and Notes filled in, Decisions-so-far empty, and the fog recorded in **Not yet specified**.
96
- 5. **Create the tickets you can specify now** as `wayfinder-ticket` child issues of the map. Then wire `blocks` relations in a second pass, because issues need references before they can link to each other. This separates the frontier from blocked tickets. Keep everything you cannot yet specify in **Not yet specified**.
95
+ 4. **Create the map** as a `pioneer-map` child issue of the initiative: Destination and Notes filled in, Decisions-so-far empty, and the fog recorded in **Not yet specified**.
96
+ 5. **Create the tickets you can specify now** as `pioneer-ticket` child issues of the map. Then wire `blocks` relations in a second pass, because issues need references before they can link to each other. This separates the frontier from blocked tickets. Keep everything you cannot yet specify in **Not yet specified**.
97
97
  6. **Start research subagents.** For each new `research` ticket, start a read-only research subagent. It returns its findings to the current agent, which records the resolution and updates the ticket. Do not create a branch unless the research needs a prototype or another tracked artifact.
98
98
  7. Stop — charting is one session's work; it does not resolve a HITL ticket.
99
99
 
@@ -25,5 +25,5 @@ Use the recipe for the record that you create or edit.
25
25
  - [ADR](./adr.md)
26
26
  - [Handoff](./handoff.md)
27
27
  - [Issue Comment](./issue-comment.md)
28
- - [Wayfinder Map](./wayfinder-map.md)
29
- - [Wayfinder Ticket](./wayfinder-ticket.md)
28
+ - [Pioneer Map](./pioneer-map.md)
29
+ - [Pioneer Ticket](./pioneer-ticket.md)
@@ -1,6 +1,6 @@
1
- # Wayfinder Map Recipe
1
+ # Pioneer Map Recipe
2
2
 
3
- Use this recipe for the canonical Wayfinder issue under an initiative. It is an index for the route to a destination and has child decision tickets.
3
+ Use this recipe for the canonical Pioneer issue under an initiative. It is an index for the route to a destination and has child decision tickets.
4
4
 
5
5
  ```markdown
6
6
  ## Destination
@@ -1,6 +1,6 @@
1
- # Wayfinder Ticket Recipe
1
+ # Pioneer Ticket Recipe
2
2
 
3
- Use this recipe for a child issue of a Wayfinder map. A ticket resolves one decision or investigation.
3
+ Use this recipe for a child issue of a Pioneer map. A ticket resolves one decision or investigation.
4
4
 
5
5
  ```markdown
6
6
  ## Ticket type
@@ -1,49 +0,0 @@
1
- type AgentHost = "claude" | "copilot" | "vscode";
2
- type AgentInstallRecord = {
3
- installedName: string;
4
- agentFile: string;
5
- };
6
- type AgentInstallation = AgentInstallRecord & {
7
- host: AgentHost;
8
- targetDir: string;
9
- };
10
- export type InstallAgentResult = {
11
- targetDir: string;
12
- installed: AgentInstallRecord & {
13
- status: "installed" | "updated" | "skipped";
14
- };
15
- additionalInstalled: Array<AgentInstallation & {
16
- status: "installed" | "updated" | "skipped";
17
- }>;
18
- };
19
- export type UninstallAgentResult = {
20
- targetDir: string;
21
- removed: AgentInstallRecord & {
22
- status: "removed" | "missing";
23
- };
24
- additionalRemoved: Array<AgentInstallation & {
25
- status: "removed" | "missing";
26
- }>;
27
- };
28
- export type ListAgentResult = {
29
- targetDir: string;
30
- agent: AgentInstallRecord & {
31
- status: "installed" | "partial" | "missing";
32
- };
33
- additionalAgents: Array<AgentInstallation & {
34
- status: "installed" | "partial" | "missing";
35
- }>;
36
- };
37
- export declare function getDefaultAgentInstallDir(): string;
38
- export declare function getDefaultAgentInstallDirs(): Record<AgentHost, string>;
39
- export declare function installAgent(input: {
40
- targetDir?: string;
41
- force?: boolean;
42
- }): InstallAgentResult;
43
- export declare function uninstallAgent(input: {
44
- targetDir?: string;
45
- }): UninstallAgentResult;
46
- export declare function listAgent(input: {
47
- targetDir?: string;
48
- }): ListAgentResult;
49
- export {};
@@ -1,171 +0,0 @@
1
- import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
2
- import { homedir } from "node:os";
3
- import path from "node:path";
4
- import { fileURLToPath } from "node:url";
5
- const AGENT_FILE_NAME = "agent-issues.agent.md";
6
- const CLAUDE_AGENT_FILE_NAME = "agent-issues.md";
7
- const LEGACY_HOOK_FILE_NAME = "agent-issues-enforcer.mjs";
8
- const LANGUAGE_FILE_NAME = "agent-issues-language.md";
9
- const RECIPES_DIRECTORY_NAME = "recipes";
10
- const AGENT_FILES_MANIFEST = ".agent-issues-agent-files.json";
11
- const INSTALLED_AGENT_NAME = "agent-issues";
12
- function getVsCodeUserDir() {
13
- if (process.platform === "win32") {
14
- const appData = process.env.APPDATA ?? path.join(homedir(), "AppData", "Roaming");
15
- return path.join(appData, "Code", "User");
16
- }
17
- if (process.platform === "darwin")
18
- return path.join(homedir(), "Library", "Application Support", "Code", "User");
19
- const configHome = process.env.XDG_CONFIG_HOME ?? path.join(homedir(), ".config");
20
- return path.join(configHome, "Code", "User");
21
- }
22
- export function getDefaultAgentInstallDir() {
23
- return getDefaultAgentInstallDirs().vscode;
24
- }
25
- export function getDefaultAgentInstallDirs() {
26
- return {
27
- claude: path.join(homedir(), ".claude", "agents"),
28
- copilot: path.join(homedir(), ".copilot", "agents"),
29
- vscode: path.join(getVsCodeUserDir(), "prompts")
30
- };
31
- }
32
- export function installAgent(input) {
33
- const sourceRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", ".github");
34
- const [primaryTarget, ...additionalTargets] = getAgentTargets(input.targetDir);
35
- const installed = installAgentAtTarget(primaryTarget, sourceRoot, Boolean(input.force));
36
- const additionalInstalled = additionalTargets.map((target) => ({
37
- ...installAgentAtTarget(target, sourceRoot, Boolean(input.force)),
38
- host: target.host,
39
- targetDir: target.targetDir
40
- }));
41
- return {
42
- targetDir: primaryTarget.targetDir,
43
- installed,
44
- additionalInstalled
45
- };
46
- }
47
- export function uninstallAgent(input) {
48
- const [primaryTarget, ...additionalTargets] = getAgentTargets(input.targetDir);
49
- const removed = uninstallAgentAtTarget(primaryTarget);
50
- const additionalRemoved = additionalTargets.map((target) => ({
51
- ...uninstallAgentAtTarget(target),
52
- host: target.host,
53
- targetDir: target.targetDir
54
- }));
55
- return {
56
- targetDir: primaryTarget.targetDir,
57
- removed,
58
- additionalRemoved
59
- };
60
- }
61
- export function listAgent(input) {
62
- const [primaryTarget, ...additionalTargets] = getAgentTargets(input.targetDir);
63
- const agent = listAgentAtTarget(primaryTarget);
64
- const additionalAgents = additionalTargets.map((target) => ({
65
- ...listAgentAtTarget(target),
66
- host: target.host,
67
- targetDir: target.targetDir
68
- }));
69
- return {
70
- targetDir: primaryTarget.targetDir,
71
- agent,
72
- additionalAgents
73
- };
74
- }
75
- function getAgentTargets(targetDir) {
76
- if (targetDir) {
77
- return [{ host: "vscode", targetDir: path.resolve(targetDir), agentFileName: AGENT_FILE_NAME }];
78
- }
79
- const targetDirs = getDefaultAgentInstallDirs();
80
- return [
81
- { host: "vscode", targetDir: targetDirs.vscode, agentFileName: AGENT_FILE_NAME },
82
- { host: "copilot", targetDir: targetDirs.copilot, agentFileName: AGENT_FILE_NAME },
83
- { host: "claude", targetDir: targetDirs.claude, agentFileName: CLAUDE_AGENT_FILE_NAME }
84
- ];
85
- }
86
- function installAgentAtTarget(target, sourceRoot, force) {
87
- const sourceAgentFile = path.join(sourceRoot, "agents", target.host === "claude" ? "agent-issues.claude.md" : AGENT_FILE_NAME);
88
- const sourceLanguageFile = path.join(sourceRoot, "..", "skills", LANGUAGE_FILE_NAME);
89
- const sourceRecipesDirectory = path.join(sourceRoot, "..", "skills", RECIPES_DIRECTORY_NAME);
90
- const destinationAgentFile = path.join(target.targetDir, target.agentFileName);
91
- const legacyHookFile = path.join(target.targetDir, LEGACY_HOOK_FILE_NAME);
92
- const destinationLanguageFile = path.join(target.targetDir, LANGUAGE_FILE_NAME);
93
- const destinationRecipesDirectory = path.join(target.targetDir, RECIPES_DIRECTORY_NAME);
94
- const existed = existsSync(destinationAgentFile);
95
- if (!existsSync(sourceAgentFile) || !existsSync(sourceLanguageFile) || !existsSync(sourceRecipesDirectory)) {
96
- throw new Error(`Packaged agent assets not found under ${sourceRoot}`);
97
- }
98
- mkdirSync(target.targetDir, { recursive: true });
99
- if (existed && !force) {
100
- return {
101
- installedName: INSTALLED_AGENT_NAME,
102
- agentFile: destinationAgentFile,
103
- status: "skipped"
104
- };
105
- }
106
- cpSync(sourceAgentFile, destinationAgentFile);
107
- rmSync(legacyHookFile, { force: true });
108
- cpSync(sourceLanguageFile, destinationLanguageFile);
109
- if (force || !existsSync(destinationRecipesDirectory)) {
110
- if (existsSync(destinationRecipesDirectory)) {
111
- rmSync(destinationRecipesDirectory, { force: true, recursive: true });
112
- }
113
- cpSync(sourceRecipesDirectory, destinationRecipesDirectory, { recursive: true });
114
- writeOwnedRecipeCatalog(target.targetDir);
115
- }
116
- return {
117
- installedName: INSTALLED_AGENT_NAME,
118
- agentFile: destinationAgentFile,
119
- status: existed ? "updated" : "installed"
120
- };
121
- }
122
- function uninstallAgentAtTarget(target) {
123
- const destinationAgentFile = path.join(target.targetDir, target.agentFileName);
124
- const legacyHookFile = path.join(target.targetDir, LEGACY_HOOK_FILE_NAME);
125
- const destinationLanguageFile = path.join(target.targetDir, LANGUAGE_FILE_NAME);
126
- const destinationRecipesDirectory = path.join(target.targetDir, RECIPES_DIRECTORY_NAME);
127
- const existed = existsSync(destinationAgentFile);
128
- for (const destinationFile of [destinationAgentFile, legacyHookFile, destinationLanguageFile]) {
129
- if (existsSync(destinationFile)) {
130
- rmSync(destinationFile, { force: true });
131
- }
132
- }
133
- if (hasOwnedRecipeCatalog(target.targetDir) && existsSync(destinationRecipesDirectory)) {
134
- rmSync(destinationRecipesDirectory, { force: true, recursive: true });
135
- }
136
- rmSync(path.join(target.targetDir, AGENT_FILES_MANIFEST), { force: true });
137
- return {
138
- installedName: INSTALLED_AGENT_NAME,
139
- agentFile: destinationAgentFile,
140
- status: existed ? "removed" : "missing"
141
- };
142
- }
143
- function listAgentAtTarget(target) {
144
- const destinationAgentFile = path.join(target.targetDir, target.agentFileName);
145
- const destinationRecipesDirectory = path.join(target.targetDir, RECIPES_DIRECTORY_NAME);
146
- const agentExists = existsSync(destinationAgentFile);
147
- const recipesExist = existsSync(destinationRecipesDirectory);
148
- const ownsRecipeCatalog = hasOwnedRecipeCatalog(target.targetDir);
149
- return {
150
- installedName: INSTALLED_AGENT_NAME,
151
- agentFile: destinationAgentFile,
152
- status: agentExists && recipesExist && ownsRecipeCatalog ? "installed" : agentExists || recipesExist ? "partial" : "missing"
153
- };
154
- }
155
- function hasOwnedRecipeCatalog(targetDir) {
156
- const manifestPath = path.join(targetDir, AGENT_FILES_MANIFEST);
157
- if (!existsSync(manifestPath)) {
158
- return false;
159
- }
160
- try {
161
- const parsed = JSON.parse(readFileSync(manifestPath, "utf8"));
162
- return parsed.recipeCatalog === true;
163
- }
164
- catch {
165
- return false;
166
- }
167
- }
168
- function writeOwnedRecipeCatalog(targetDir) {
169
- writeFileSync(path.join(targetDir, AGENT_FILES_MANIFEST), `${JSON.stringify({ recipeCatalog: true }, null, "\t")}\n`);
170
- }
171
- //# sourceMappingURL=agent-installer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-installer.js","sourceRoot":"","sources":["../src/agent-installer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAChD,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AACjD,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAC1D,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AACtD,MAAM,sBAAsB,GAAG,SAAS,CAAC;AACzC,MAAM,oBAAoB,GAAG,gCAAgC,CAAC;AAC9D,MAAM,oBAAoB,GAAG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;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,SAAiB;IAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IAChE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAgC,CAAC;QAC7F,OAAO,MAAM,CAAC,aAAa,KAAK,IAAI,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAiB;IACjD,aAAa,CACZ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAC1C,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAC1D,CAAC;AACH,CAAC"}
@@ -1,40 +0,0 @@
1
- import { type OsCredentialStoreOptions } from "@agent-issues/core";
2
- export type LocalSavedLogin = {
3
- name: "local";
4
- kind: "local";
5
- };
6
- export type RemoteSavedLogin = {
7
- name: string;
8
- kind: "remote";
9
- serviceUrl: string;
10
- tenantId: string;
11
- userId: string;
12
- displayName?: string;
13
- accessToken: string;
14
- expiresAt: string;
15
- };
16
- export type SavedLogin = LocalSavedLogin | RemoteSavedLogin;
17
- export type SavedLoginView = LocalSavedLogin | Omit<RemoteSavedLogin, "accessToken">;
18
- /** Strips remote credentials so callers can safely display or log a saved login. */
19
- export declare function toSavedLoginView(login: LocalSavedLogin): LocalSavedLogin;
20
- export declare function toSavedLoginView(login: RemoteSavedLogin): Omit<RemoteSavedLogin, "accessToken">;
21
- export declare function toSavedLoginView(login: SavedLogin): SavedLoginView;
22
- export type SavedLoginStoreOptions = OsCredentialStoreOptions & {
23
- /**
24
- * Overrides the directory checked for legacy plaintext routing files to
25
- * remove during upgrade. Production defaults to
26
- * `resolveAgentIssuesHomeDirectory()` (`~/.agent-issues`); tests inject a
27
- * temp directory so no real user state is touched.
28
- */
29
- homeDirectory?: string;
30
- };
31
- /** Returns every saved login in switching order, beginning with local. */
32
- export declare function listSavedLogins(_options?: SavedLoginStoreOptions): Promise<SavedLogin[]>;
33
- /** Returns the one globally active saved login. */
34
- export declare function getActiveSavedLogin(options?: SavedLoginStoreOptions): Promise<SavedLogin>;
35
- /** Creates or refreshes a named remote login and makes it active. */
36
- export declare function saveSavedLogin(login: RemoteSavedLogin, options?: SavedLoginStoreOptions): Promise<void>;
37
- /** Persists the globally active name when it identifies an existing saved login. */
38
- export declare function setActiveSavedLogin(name: string, options?: SavedLoginStoreOptions): Promise<void>;
39
- /** Removes a remote saved login, falling back to local when it was active. */
40
- export declare function removeSavedLogin(name: string, options?: SavedLoginStoreOptions): Promise<void>;
@@ -1,107 +0,0 @@
1
- import { rmSync } from "node:fs";
2
- import path from "node:path";
3
- import { getCredential, resolveAgentIssuesHomeDirectory, setCredential } from "@agent-issues/core";
4
- const LOCAL_SAVED_LOGIN = { name: "local", kind: "local" };
5
- export function toSavedLoginView(login) {
6
- if (login.kind === "local")
7
- return login;
8
- const { accessToken: _accessToken, ...view } = login;
9
- return view;
10
- }
11
- const SERVICE = "agent-issues-auth";
12
- const ACCOUNT = "sessions";
13
- const LEGACY_AUTH_SESSION_FILENAME = "auth.json";
14
- const LEGACY_CLOUD_BINDINGS_FILENAME = "cloud-bindings.json";
15
- const SAVED_LOGIN_CREDENTIAL_VERSION = 1;
16
- function resolveLegacyFilePath(filename, options) {
17
- const homeDirectory = options?.homeDirectory ?? resolveAgentIssuesHomeDirectory();
18
- return path.join(homeDirectory, filename);
19
- }
20
- function createLocalSavedLoginCredential() {
21
- return { version: SAVED_LOGIN_CREDENTIAL_VERSION, activeName: LOCAL_SAVED_LOGIN.name, remoteLogins: [] };
22
- }
23
- function parseSavedLoginCredential(raw) {
24
- try {
25
- const parsed = JSON.parse(raw);
26
- if (typeof parsed !== "object" || parsed === null)
27
- return undefined;
28
- const { version, activeName, remoteLogins } = parsed;
29
- if (version !== SAVED_LOGIN_CREDENTIAL_VERSION || typeof activeName !== "string" || !Array.isArray(remoteLogins)) {
30
- return undefined;
31
- }
32
- return {
33
- version,
34
- activeName,
35
- remoteLogins
36
- };
37
- }
38
- catch {
39
- return undefined;
40
- }
41
- }
42
- async function readSavedLoginCredential(options) {
43
- rmSync(resolveLegacyFilePath(LEGACY_AUTH_SESSION_FILENAME, options), { force: true });
44
- rmSync(resolveLegacyFilePath(LEGACY_CLOUD_BINDINGS_FILENAME, options), { force: true });
45
- const stored = await getCredential(SERVICE, ACCOUNT, options);
46
- if (stored !== undefined) {
47
- const current = parseSavedLoginCredential(stored);
48
- if (current)
49
- return current;
50
- }
51
- const migrated = createLocalSavedLoginCredential();
52
- await setCredential(SERVICE, ACCOUNT, JSON.stringify(migrated), options);
53
- return migrated;
54
- }
55
- async function writeSavedLoginCredential(file, options) {
56
- await setCredential(SERVICE, ACCOUNT, JSON.stringify(file), options);
57
- }
58
- /** Returns every saved login in switching order, beginning with local. */
59
- export async function listSavedLogins(_options) {
60
- return [LOCAL_SAVED_LOGIN, ...(await readSavedLoginCredential(_options)).remoteLogins];
61
- }
62
- /** Returns the one globally active saved login. */
63
- export async function getActiveSavedLogin(options) {
64
- const file = await readSavedLoginCredential(options);
65
- return file.remoteLogins.find(({ name }) => name === file.activeName) ?? LOCAL_SAVED_LOGIN;
66
- }
67
- /** Creates or refreshes a named remote login and makes it active. */
68
- export async function saveSavedLogin(login, options) {
69
- if (login.name === LOCAL_SAVED_LOGIN.name) {
70
- throw new Error('Saved-login name "local" is reserved.');
71
- }
72
- const file = await readSavedLoginCredential(options);
73
- const existingIndex = file.remoteLogins.findIndex(({ name }) => name === login.name);
74
- if (existingIndex === -1) {
75
- file.remoteLogins.push(login);
76
- }
77
- else {
78
- file.remoteLogins[existingIndex] = login;
79
- }
80
- file.activeName = login.name;
81
- await writeSavedLoginCredential(file, options);
82
- }
83
- /** Persists the globally active name when it identifies an existing saved login. */
84
- export async function setActiveSavedLogin(name, options) {
85
- const file = await readSavedLoginCredential(options);
86
- if (name !== LOCAL_SAVED_LOGIN.name && !file.remoteLogins.some((login) => login.name === name)) {
87
- throw new Error(`No saved login named "${name}".`);
88
- }
89
- file.activeName = name;
90
- await writeSavedLoginCredential(file, options);
91
- }
92
- /** Removes a remote saved login, falling back to local when it was active. */
93
- export async function removeSavedLogin(name, options) {
94
- if (name === LOCAL_SAVED_LOGIN.name) {
95
- throw new Error('The local saved login cannot be removed.');
96
- }
97
- const file = await readSavedLoginCredential(options);
98
- if (!file.remoteLogins.some((login) => login.name === name)) {
99
- throw new Error(`No saved login named "${name}".`);
100
- }
101
- file.remoteLogins = file.remoteLogins.filter((login) => login.name !== name);
102
- if (file.activeName === name) {
103
- file.activeName = LOCAL_SAVED_LOGIN.name;
104
- }
105
- await writeSavedLoginCredential(file, options);
106
- }
107
- //# sourceMappingURL=auth-session.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-session.js","sourceRoot":"","sources":["../src/auth-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,+BAA+B,EAAE,aAAa,EAAiC,MAAM,oBAAoB,CAAC;AAsBlI,MAAM,iBAAiB,GAAoB,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAM5E,MAAM,UAAU,gBAAgB,CAAC,KAAiB;IACjD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IACzC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACrD,OAAO,IAAI,C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AA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAY,EAAE,OAAgC;IACpF,IAAI,IAAI,KAAK,iBAAiB,CAAC,IAAI,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,wBAAwB,CAAC,OAAO,CAAC,CAAC;IACrD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QAC7D,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,IAAI,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAC7E,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC;IAC1C,CAAC;IACD,MAAM,yBAAyB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"}
@@ -1,26 +0,0 @@
1
- import type { StorageDriver } from "@agent-issues/core";
2
- export declare const BACKFILLABLE_BODY_KINDS: readonly ["project", "epic", "version", "initiative", "issue", "prd", "userStory", "adr"];
3
- export type BackfillableBodyKind = (typeof BACKFILLABLE_BODY_KINDS)[number];
4
- export type BackfillBodiesKindResult = {
5
- kind: BackfillableBodyKind;
6
- considered: number;
7
- updated: number;
8
- skipped: number;
9
- };
10
- export type BackfillBodiesResult = {
11
- tenantId: string;
12
- dryRun: boolean;
13
- force: boolean;
14
- kinds: BackfillableBodyKind[];
15
- considered: number;
16
- updated: number;
17
- skipped: number;
18
- byKind: BackfillBodiesKindResult[];
19
- };
20
- export declare function isBackfillableBodyKind(value: string): value is BackfillableBodyKind;
21
- export declare function parseBackfillableBodyKinds(values: string[]): BackfillableBodyKind[];
22
- export declare function backfillBodies(store: StorageDriver, input?: {
23
- dryRun?: boolean;
24
- force?: boolean;
25
- kinds?: BackfillableBodyKind[];
26
- }): Promise<BackfillBodiesResult>;