agent-issues 0.0.121 → 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 (166) 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-Cx-fLU3e.js → index-D6NM1iDo.js} +181 -144
  8. package/site/dist/index.html +1 -1
  9. package/dist/agent-installer.d.ts +0 -49
  10. package/dist/agent-installer.js +0 -171
  11. package/dist/agent-installer.js.map +0 -1
  12. package/dist/auth-session.d.ts +0 -40
  13. package/dist/auth-session.js +0 -107
  14. package/dist/auth-session.js.map +0 -1
  15. package/dist/body-backfill.d.ts +0 -26
  16. package/dist/body-backfill.js +0 -219
  17. package/dist/body-backfill.js.map +0 -1
  18. package/dist/build-mode.d.ts +0 -1
  19. package/dist/build-mode.js +0 -1
  20. package/dist/build-mode.js.map +0 -1
  21. package/dist/cli/commands/auth.d.ts +0 -61
  22. package/dist/cli/commands/auth.js +0 -134
  23. package/dist/cli/commands/auth.js.map +0 -1
  24. package/dist/cli/commands/backfill.d.ts +0 -8
  25. package/dist/cli/commands/backfill.js +0 -36
  26. package/dist/cli/commands/backfill.js.map +0 -1
  27. package/dist/cli/commands/comments.d.ts +0 -34
  28. package/dist/cli/commands/comments.js +0 -124
  29. package/dist/cli/commands/comments.js.map +0 -1
  30. package/dist/cli/commands/context.d.ts +0 -13
  31. package/dist/cli/commands/context.js +0 -156
  32. package/dist/cli/commands/context.js.map +0 -1
  33. package/dist/cli/commands/entities.d.ts +0 -91
  34. package/dist/cli/commands/entities.js +0 -420
  35. package/dist/cli/commands/entities.js.map +0 -1
  36. package/dist/cli/commands/export.d.ts +0 -20
  37. package/dist/cli/commands/export.js +0 -98
  38. package/dist/cli/commands/export.js.map +0 -1
  39. package/dist/cli/commands/fallback.d.ts +0 -6
  40. package/dist/cli/commands/fallback.js +0 -10
  41. package/dist/cli/commands/fallback.js.map +0 -1
  42. package/dist/cli/commands/handoff.d.ts +0 -1
  43. package/dist/cli/commands/handoff.js +0 -2
  44. package/dist/cli/commands/handoff.js.map +0 -1
  45. package/dist/cli/commands/installers.d.ts +0 -37
  46. package/dist/cli/commands/installers.js +0 -78
  47. package/dist/cli/commands/installers.js.map +0 -1
  48. package/dist/cli/commands/kanban.d.ts +0 -8
  49. package/dist/cli/commands/kanban.js +0 -83
  50. package/dist/cli/commands/kanban.js.map +0 -1
  51. package/dist/cli/commands/meta.d.ts +0 -14
  52. package/dist/cli/commands/meta.js +0 -33
  53. package/dist/cli/commands/meta.js.map +0 -1
  54. package/dist/cli/commands/plan-entries.d.ts +0 -30
  55. package/dist/cli/commands/plan-entries.js +0 -94
  56. package/dist/cli/commands/plan-entries.js.map +0 -1
  57. package/dist/cli/commands/site.d.ts +0 -29
  58. package/dist/cli/commands/site.js +0 -89
  59. package/dist/cli/commands/site.js.map +0 -1
  60. package/dist/cli/commands/sql.d.ts +0 -6
  61. package/dist/cli/commands/sql.js +0 -21
  62. package/dist/cli/commands/sql.js.map +0 -1
  63. package/dist/cli/commands/synchronize.d.ts +0 -12
  64. package/dist/cli/commands/synchronize.js +0 -31
  65. package/dist/cli/commands/synchronize.js.map +0 -1
  66. package/dist/cli/commands/tenants.d.ts +0 -29
  67. package/dist/cli/commands/tenants.js +0 -101
  68. package/dist/cli/commands/tenants.js.map +0 -1
  69. package/dist/cli/index.d.ts +0 -4
  70. package/dist/cli/index.js +0 -120
  71. package/dist/cli/index.js.map +0 -1
  72. package/dist/cli/renderers.d.ts +0 -250
  73. package/dist/cli/renderers.js +0 -286
  74. package/dist/cli/renderers.js.map +0 -1
  75. package/dist/cli/shared.d.ts +0 -97
  76. package/dist/cli/shared.js +0 -192
  77. package/dist/cli/shared.js.map +0 -1
  78. package/dist/cli.d.ts +0 -11
  79. package/dist/cli.js.map +0 -1
  80. package/dist/context-cli.d.ts +0 -16
  81. package/dist/context-cli.js +0 -131
  82. package/dist/context-cli.js.map +0 -1
  83. package/dist/daemon/daemon-lifecycle.d.ts +0 -1
  84. package/dist/daemon/daemon-lifecycle.js +0 -2
  85. package/dist/daemon/daemon-lifecycle.js.map +0 -1
  86. package/dist/daemon/daemon-main.d.ts +0 -14
  87. package/dist/daemon/daemon-main.js +0 -30
  88. package/dist/daemon/daemon-main.js.map +0 -1
  89. package/dist/daemon/local-daemon-store.d.ts +0 -21
  90. package/dist/daemon/local-daemon-store.js +0 -31
  91. package/dist/daemon/local-daemon-store.js.map +0 -1
  92. package/dist/entity-projection.d.ts +0 -141
  93. package/dist/entity-projection.js +0 -147
  94. package/dist/entity-projection.js.map +0 -1
  95. package/dist/entra-device-login.d.ts +0 -12
  96. package/dist/entra-device-login.js +0 -40
  97. package/dist/entra-device-login.js.map +0 -1
  98. package/dist/export-files.d.ts +0 -24
  99. package/dist/export-files.js +0 -230
  100. package/dist/export-files.js.map +0 -1
  101. package/dist/export-markdown.d.ts +0 -24
  102. package/dist/export-markdown.js +0 -343
  103. package/dist/export-markdown.js.map +0 -1
  104. package/dist/help.d.ts +0 -112
  105. package/dist/help.js +0 -1430
  106. package/dist/help.js.map +0 -1
  107. package/dist/kanban/assets.d.ts +0 -3
  108. package/dist/kanban/assets.js +0 -37
  109. package/dist/kanban/assets.js.map +0 -1
  110. package/dist/kanban/index.d.ts +0 -1
  111. package/dist/kanban/index.js +0 -2
  112. package/dist/kanban/index.js.map +0 -1
  113. package/dist/kanban/server.d.ts +0 -28
  114. package/dist/kanban/server.js +0 -118
  115. package/dist/kanban/server.js.map +0 -1
  116. package/dist/mcp-installer.d.ts +0 -32
  117. package/dist/mcp-installer.js +0 -118
  118. package/dist/mcp-installer.js.map +0 -1
  119. package/dist/mcp-server/index.d.ts +0 -11
  120. package/dist/mcp-server/index.js +0 -504
  121. package/dist/mcp-server/index.js.map +0 -1
  122. package/dist/mcp-server/index.test.d.ts +0 -1
  123. package/dist/mcp-server/index.test.js +0 -746
  124. package/dist/mcp-server/index.test.js.map +0 -1
  125. package/dist/mcp-server/mcp-tool-audit.d.ts +0 -6
  126. package/dist/mcp-server/mcp-tool-audit.js +0 -47
  127. package/dist/mcp-server/mcp-tool-audit.js.map +0 -1
  128. package/dist/mcp-server/stdio.d.ts +0 -2
  129. package/dist/mcp-server/stdio.js +0 -7
  130. package/dist/mcp-server/stdio.js.map +0 -1
  131. package/dist/mcp.d.ts +0 -2
  132. package/dist/mcp.js +0 -19
  133. package/dist/mcp.js.map +0 -1
  134. package/dist/open-storage-driver.d.ts +0 -55
  135. package/dist/open-storage-driver.js +0 -73
  136. package/dist/open-storage-driver.js.map +0 -1
  137. package/dist/open-synchronize-stores.d.ts +0 -24
  138. package/dist/open-synchronize-stores.js +0 -34
  139. package/dist/open-synchronize-stores.js.map +0 -1
  140. package/dist/project-identity.d.ts +0 -23
  141. package/dist/project-identity.js +0 -121
  142. package/dist/project-identity.js.map +0 -1
  143. package/dist/runtime-access-boundary.d.ts +0 -7
  144. package/dist/runtime-access-boundary.js +0 -182
  145. package/dist/runtime-access-boundary.js.map +0 -1
  146. package/dist/service-discovery.d.ts +0 -10
  147. package/dist/service-discovery.js +0 -64
  148. package/dist/service-discovery.js.map +0 -1
  149. package/dist/site/assets.d.ts +0 -4
  150. package/dist/site/assets.js +0 -46
  151. package/dist/site/assets.js.map +0 -1
  152. package/dist/site/cloud-events-relay.d.ts +0 -16
  153. package/dist/site/cloud-events-relay.js +0 -78
  154. package/dist/site/cloud-events-relay.js.map +0 -1
  155. package/dist/site/index.d.ts +0 -1
  156. package/dist/site/index.js +0 -2
  157. package/dist/site/index.js.map +0 -1
  158. package/dist/site/server.d.ts +0 -42
  159. package/dist/site/server.js +0 -632
  160. package/dist/site/server.js.map +0 -1
  161. package/dist/skill-installer.d.ts +0 -35
  162. package/dist/skill-installer.js +0 -180
  163. package/dist/skill-installer.js.map +0 -1
  164. package/dist/vitest-setup.d.ts +0 -1
  165. package/dist/vitest-setup.js +0 -7
  166. package/dist/vitest-setup.js.map +0 -1
@@ -1,250 +0,0 @@
1
- import type { installAgent, listAgent, uninstallAgent } from "../agent-installer.js";
2
- import type { BackfillBodiesResult, BackfillableBodyKind } from "../body-backfill.js";
3
- import type { SynchronizeSummary } from "@agent-issues/core";
4
- import type { listTenants } from "@agent-issues/api-local";
5
- import type { installMcp, listMcp, uninstallMcp } from "../mcp-installer.js";
6
- import type { SavedLoginView } from "../auth-session.js";
7
- import type { startLiveSite } from "../site/index.js";
8
- import type { installSkills, listSkills, uninstallSkills } from "../skill-installer.js";
9
- export declare function renderEntityList(kind: string, entities: Array<{
10
- id: string;
11
- reference: string;
12
- status: string;
13
- title: string;
14
- }>, openBlockers?: Record<string, string[]>, parentGroups?: Array<{
15
- parent: {
16
- reference: string;
17
- status: string;
18
- title: string;
19
- };
20
- entities: Array<{
21
- id: string;
22
- reference: string;
23
- status: string;
24
- title: string;
25
- }>;
26
- }>): string;
27
- export declare function renderOptionalEntityList(label: string, entities: Array<{
28
- id: string;
29
- reference: string;
30
- kind: string;
31
- status: string;
32
- title: string;
33
- }>): string;
34
- export declare function renderEntityDetails(details: {
35
- entity: {
36
- id: string;
37
- reference: string;
38
- kind: string;
39
- status: string;
40
- title: string;
41
- type?: string | null;
42
- };
43
- incoming: Array<{
44
- relationType: string;
45
- entity: {
46
- id: string;
47
- reference: string;
48
- kind: string;
49
- status: string;
50
- };
51
- }>;
52
- outgoing: Array<{
53
- relationType: string;
54
- entity: {
55
- id: string;
56
- reference: string;
57
- kind: string;
58
- status: string;
59
- };
60
- }>;
61
- planEntries?: Array<{
62
- reference: string;
63
- role: string;
64
- body?: string;
65
- }>;
66
- }): string;
67
- export declare function renderPlanDetails(details: Parameters<typeof renderEntityDetails>[0] & {
68
- current: Array<{
69
- title: string;
70
- entries: Array<{
71
- id: string;
72
- reference: string;
73
- body?: string;
74
- referencedEntityIds: string[];
75
- supersededEntryIds: string[];
76
- }>;
77
- }>;
78
- history: Array<{
79
- id: string;
80
- reference: string;
81
- body?: string;
82
- referencedEntityIds: string[];
83
- supersededEntryIds: string[];
84
- tombstone: boolean;
85
- }>;
86
- }): string;
87
- export declare function renderInitiativeBundle(bundle: {
88
- initiative: {
89
- id: string;
90
- reference: string;
91
- status: string;
92
- title: string;
93
- };
94
- prds: Array<{
95
- id: string;
96
- reference: string;
97
- status: string;
98
- }>;
99
- userStories: Array<{
100
- id: string;
101
- reference: string;
102
- status: string;
103
- }>;
104
- adrs: Array<{
105
- id: string;
106
- reference: string;
107
- status: string;
108
- }>;
109
- issues: Array<{
110
- id: string;
111
- reference: string;
112
- status: string;
113
- }>;
114
- fixLinks: Array<{
115
- issue: {
116
- id: string;
117
- reference: string;
118
- };
119
- userStory: {
120
- id: string;
121
- reference: string;
122
- };
123
- }>;
124
- subIssueLinks: Array<{
125
- parent: {
126
- id: string;
127
- reference: string;
128
- };
129
- issue: {
130
- id: string;
131
- reference: string;
132
- };
133
- }>;
134
- blockerLinks: Array<{
135
- source: {
136
- id: string;
137
- reference: string;
138
- };
139
- target: {
140
- id: string;
141
- reference: string;
142
- };
143
- }>;
144
- constrainsLinks: Array<{
145
- adr: {
146
- id: string;
147
- reference: string;
148
- };
149
- issue: {
150
- id: string;
151
- reference: string;
152
- };
153
- }>;
154
- }): string;
155
- export declare function renderInstallSkills(result: ReturnType<typeof installSkills>): string;
156
- export declare function renderInstallAgent(result: ReturnType<typeof installAgent>): string;
157
- export declare function renderListSkills(result: ReturnType<typeof listSkills>): string;
158
- export declare function renderListAgent(result: ReturnType<typeof listAgent>): string;
159
- export declare function renderUninstallSkills(result: ReturnType<typeof uninstallSkills>): string;
160
- export declare function renderUninstallAgent(result: ReturnType<typeof uninstallAgent>): string;
161
- export declare function renderInstallMcp(result: ReturnType<typeof installMcp>): string;
162
- export declare function renderListMcp(result: ReturnType<typeof listMcp>): string;
163
- export declare function renderUninstallMcp(result: ReturnType<typeof uninstallMcp>): string;
164
- export declare function renderCurrentTenant(result: {
165
- command: "current-tenant";
166
- dbPath: string;
167
- tenantId: string;
168
- workspaceRoot: string;
169
- }): string;
170
- export declare function renderProjectIdentity(result: {
171
- command: "project-identity";
172
- identity: string;
173
- source: string;
174
- }): string;
175
- export declare function renderTenantList(result: {
176
- command: "list-tenants";
177
- currentTenantId: string;
178
- dbPath: string;
179
- tenants: ReturnType<typeof listTenants>;
180
- }): string;
181
- export declare function renderDeleteTenant(result: {
182
- command: "delete-tenant";
183
- dbPath: string;
184
- tenantId: string;
185
- displayName: string;
186
- removed: boolean;
187
- counts: {
188
- entities: number;
189
- relations: number;
190
- contexts: number;
191
- contextTerms: number;
192
- historyEntries: number;
193
- };
194
- counters: number;
195
- }): string;
196
- export declare function renderRenameTenant(result: {
197
- command: "rename-tenant";
198
- dbPath: string;
199
- previousTenantId: string;
200
- previousDisplayName: string;
201
- newTenantId: string;
202
- newDisplayName: string;
203
- renamed: boolean;
204
- counts: {
205
- entities: number;
206
- relations: number;
207
- contexts: number;
208
- contextTerms: number;
209
- historyEntries: number;
210
- };
211
- counters: number;
212
- }): string;
213
- export declare function renderLiveSite(result: Awaited<ReturnType<typeof startLiveSite>>["info"]): string;
214
- export declare function renderStartedLiveSite(result: {
215
- port: number;
216
- started: boolean;
217
- url: string;
218
- }): string;
219
- export declare function renderStopLiveSite(result: {
220
- host: string;
221
- port: number;
222
- url: string;
223
- reachable: boolean;
224
- stopped: boolean;
225
- }): string;
226
- export declare function renderBackfillBodies(result: {
227
- command: "backfill-bodies";
228
- dbPath: string;
229
- dryRun: boolean;
230
- force: boolean;
231
- kinds: BackfillableBodyKind[];
232
- scope: "current-tenant" | "all-tenants";
233
- tenants: BackfillBodiesResult[];
234
- }): string;
235
- export declare function renderAuthLogin(session: Extract<SavedLoginView, {
236
- kind: "remote";
237
- }>): string;
238
- export declare function renderAuthList(logins: Array<{
239
- login: SavedLoginView;
240
- active: boolean;
241
- }>): string;
242
- export declare function renderAuthLogout(name: string): string;
243
- export declare function renderAuthStatus(login: SavedLoginView): string;
244
- export declare function renderAuthSwitch(login: SavedLoginView): string;
245
- export declare function renderSynchronize(result: {
246
- command: "synchronize";
247
- cloudApiUrl: string;
248
- tenantId: string;
249
- summary: SynchronizeSummary;
250
- }): string;
@@ -1,286 +0,0 @@
1
- export function renderEntityList(kind, entities, openBlockers, parentGroups) {
2
- if (parentGroups) {
3
- return parentGroups.map((group) => [
4
- `${group.parent.reference} ${group.parent.status} ${group.parent.title}`,
5
- renderEntityList(kind, group.entities, openBlockers)
6
- ].join("\n")).join("\n\n");
7
- }
8
- if (entities.length === 0) {
9
- return `No ${kind} entities found.`;
10
- }
11
- return entities
12
- .map((entity) => {
13
- const blockers = openBlockers?.[entity.reference];
14
- const blockedSuffix = blockers?.length ? ` (blocked by ${blockers.join(", ")})` : "";
15
- return `${entity.reference} ${entity.status} ${entity.title}${blockedSuffix}`;
16
- })
17
- .join("\n");
18
- }
19
- export function renderOptionalEntityList(label, entities) {
20
- if (entities.length === 0) {
21
- return `No ${label} entities found.`;
22
- }
23
- return entities.map((entity) => `${entity.reference} ${entity.kind} ${entity.status} ${entity.title}`).join("\n");
24
- }
25
- export function renderEntityDetails(details) {
26
- const incoming = details.incoming.length
27
- ? details.incoming.map((link) => `${link.entity.reference} ${link.entity.kind} --${link.relationType}--> ${details.entity.reference}`).join("\n")
28
- : "none";
29
- const outgoing = details.outgoing.length
30
- ? details.outgoing.map((link) => `${details.entity.reference} --${link.relationType}--> ${link.entity.reference} ${link.entity.kind}`).join("\n")
31
- : "none";
32
- const relatedPlanEntries = details.planEntries ?? [];
33
- const planEntryText = relatedPlanEntries.length
34
- ? relatedPlanEntries.map((entry) => `${entry.reference} ${entry.role}${entry.body === undefined ? "" : ` ${entry.body}`}`).join("\n")
35
- : "none";
36
- return [
37
- `${details.entity.reference} ${details.entity.kind}${details.entity.type === null || details.entity.type === undefined ? "" : ` ${details.entity.type}`} ${details.entity.status} ${details.entity.title}`,
38
- "Incoming:",
39
- incoming,
40
- "Outgoing:",
41
- outgoing,
42
- "Related Plan entries:",
43
- planEntryText
44
- ].join("\n");
45
- }
46
- export function renderPlanDetails(details) {
47
- const referencesById = new Map(details.history.map((entry) => [entry.id, entry.reference]));
48
- const renderEntry = (entry) => {
49
- const references = entry.referencedEntityIds.length === 0 ? "" : ` references ${entry.referencedEntityIds.join(", ")}`;
50
- const supersession = entry.supersededEntryIds.length === 0 ? "" : ` supersedes ${entry.supersededEntryIds.map((id) => referencesById.get(id) ?? id).join(", ")}`;
51
- return `${entry.reference}${entry.body === undefined ? "" : ` ${entry.body}`}${references}${supersession}`;
52
- };
53
- const current = details.current
54
- .map((group) => `${group.title}: ${group.entries.length === 0 ? "none" : group.entries.map(renderEntry).join("; ")}`)
55
- .join("\n");
56
- const history = details.history.length === 0
57
- ? "none"
58
- : details.history.map((entry) => `${renderEntry(entry)}${entry.tombstone ? " tombstoned" : ""}`).join("\n");
59
- return [renderEntityDetails(details), "Current Plan:", current, "History:", history].join("\n");
60
- }
61
- export function renderInitiativeBundle(bundle) {
62
- return [
63
- `${bundle.initiative.reference} ${bundle.initiative.status} ${bundle.initiative.title}`,
64
- `PRDs: ${renderCompactList(bundle.prds)}`,
65
- `User Stories: ${renderCompactList(bundle.userStories)}`,
66
- `ADRs: ${renderCompactList(bundle.adrs)}`,
67
- `Issues: ${renderCompactList(bundle.issues)}`,
68
- `Fixes: ${bundle.fixLinks.length ? bundle.fixLinks.map((link) => `${link.issue.reference} -> ${link.userStory.reference}`).join(", ") : "none"}`,
69
- `Sub-issues: ${bundle.subIssueLinks.length ? bundle.subIssueLinks.map((link) => `${link.parent.reference} -> ${link.issue.reference}`).join(", ") : "none"}`,
70
- `Blockers: ${bundle.blockerLinks.length ? bundle.blockerLinks.map((link) => `${link.source.reference} -> ${link.target.reference}`).join(", ") : "none"}`,
71
- `Constrains: ${bundle.constrainsLinks.length ? bundle.constrainsLinks.map((link) => `${link.adr.reference} -> ${link.issue.reference}`).join(", ") : "none"}`
72
- ].join("\n");
73
- }
74
- export function renderInstallSkills(result) {
75
- const lines = [`Installed skills to ${result.targetDir}`];
76
- for (const item of result.installed) {
77
- lines.push(`${item.installedName} ${item.status} ${item.destinationDir}`);
78
- }
79
- return lines.join("\n");
80
- }
81
- export function renderInstallAgent(result) {
82
- return [
83
- `Installed agent to ${result.targetDir}`,
84
- `${result.installed.installedName} ${result.installed.status} ${result.installed.agentFile}`,
85
- ...result.additionalInstalled.map((item) => `${item.host} ${item.installedName} ${item.status} ${item.agentFile}`)
86
- ].join("\n");
87
- }
88
- export function renderListSkills(result) {
89
- const lines = [`Packaged skills in ${result.targetDir}`];
90
- for (const item of result.skills) {
91
- lines.push(`${item.installedName} ${item.status} ${item.destinationDir}`);
92
- }
93
- return lines.join("\n");
94
- }
95
- export function renderListAgent(result) {
96
- return [
97
- `Packaged agent in ${result.targetDir}`,
98
- `${result.agent.installedName} ${result.agent.status} ${result.agent.agentFile}`,
99
- ...result.additionalAgents.map((item) => `${item.host} ${item.installedName} ${item.status} ${item.agentFile}`)
100
- ].join("\n");
101
- }
102
- export function renderUninstallSkills(result) {
103
- const lines = [`Removed skills from ${result.targetDir}`];
104
- for (const item of result.removed) {
105
- lines.push(`${item.installedName} ${item.status} ${item.destinationDir}`);
106
- }
107
- return lines.join("\n");
108
- }
109
- export function renderUninstallAgent(result) {
110
- return [
111
- `Removed agent from ${result.targetDir}`,
112
- `${result.removed.installedName} ${result.removed.status} ${result.removed.agentFile}`,
113
- ...result.additionalRemoved.map((item) => `${item.host} ${item.installedName} ${item.status} ${item.agentFile}`)
114
- ].join("\n");
115
- }
116
- export function renderInstallMcp(result) {
117
- return `MCP server ${result.server.name} ${result.server.status} in ${result.targetFile}`;
118
- }
119
- export function renderListMcp(result) {
120
- return `MCP server ${result.server.name} ${result.server.status} in ${result.targetFile}`;
121
- }
122
- export function renderUninstallMcp(result) {
123
- return `MCP server ${result.server.name} ${result.server.status} in ${result.targetFile}`;
124
- }
125
- export function renderCurrentTenant(result) {
126
- return [
127
- `Current tenant: ${result.tenantId}`,
128
- `Workspace root: ${result.workspaceRoot}`,
129
- `Database: ${result.dbPath}`
130
- ].join("\n");
131
- }
132
- export function renderProjectIdentity(result) {
133
- return [`Project identity: ${result.identity}`, `Source: ${result.source}`].join("\n");
134
- }
135
- export function renderTenantList(result) {
136
- const lines = [`Tenants in ${result.dbPath}`];
137
- if (result.tenants.length === 0) {
138
- lines.push("none");
139
- return lines.join("\n");
140
- }
141
- for (const tenant of result.tenants) {
142
- const marker = tenant.id === result.currentTenantId ? "*" : "-";
143
- lines.push(`${marker} ${tenant.id} (${tenant.displayName}) entities=${tenant.counts.entities} relations=${tenant.counts.relations} contexts=${tenant.counts.contexts} terms=${tenant.counts.contextTerms} history=${tenant.counts.historyEntries}`);
144
- }
145
- return lines.join("\n");
146
- }
147
- export function renderDeleteTenant(result) {
148
- if (!result.removed) {
149
- return `Tenant not found: ${result.tenantId}`;
150
- }
151
- return [
152
- `Deleted tenant ${result.tenantId} (${result.displayName})`,
153
- `Database: ${result.dbPath}`,
154
- `Removed rows: entities=${result.counts.entities} relations=${result.counts.relations} contexts=${result.counts.contexts} terms=${result.counts.contextTerms} history=${result.counts.historyEntries} counters=${result.counters}`
155
- ].join("\n");
156
- }
157
- export function renderRenameTenant(result) {
158
- if (!result.renamed) {
159
- return `Tenant not found: ${result.previousTenantId}`;
160
- }
161
- return [
162
- `Renamed tenant ${result.previousTenantId} (${result.previousDisplayName}) to ${result.newTenantId} (${result.newDisplayName})`,
163
- `Database: ${result.dbPath}`,
164
- `Moved rows: entities=${result.counts.entities} relations=${result.counts.relations} contexts=${result.counts.contexts} terms=${result.counts.contextTerms} history=${result.counts.historyEntries} counters=${result.counters}`
165
- ].join("\n");
166
- }
167
- export function renderLiveSite(result) {
168
- return [
169
- `Serving live site at ${result.url}`,
170
- `Database: ${result.dbPath}`,
171
- `Port: ${result.port}`,
172
- "Keep this process running to continue listening for database changes."
173
- ].join("\n");
174
- }
175
- export function renderStartedLiveSite(result) {
176
- return `Started live site at ${result.url}`;
177
- }
178
- export function renderStopLiveSite(result) {
179
- if (!result.stopped) {
180
- if (result.reachable) {
181
- return `A server is listening at ${result.url}, but it does not expose the agent-issues stop endpoint.`;
182
- }
183
- return `No live site was running at ${result.url}`;
184
- }
185
- return `Stopped live site at ${result.url}`;
186
- }
187
- export function renderBackfillBodies(result) {
188
- const lines = [
189
- `${result.dryRun ? "Previewed" : "Backfilled"} bodies in ${result.scope === "all-tenants" ? "all tenants" : "the current tenant"}`,
190
- `Database: ${result.dbPath}`,
191
- `Kinds: ${result.kinds.join(", ")}`,
192
- `Dry run: ${result.dryRun ? "yes" : "no"}`,
193
- `Force overwrite: ${result.force ? "yes" : "no"}`
194
- ];
195
- if (result.tenants.length === 0) {
196
- lines.push("No tenants were present in the selected database.");
197
- return lines.join("\n");
198
- }
199
- for (const tenant of result.tenants) {
200
- lines.push("", `Tenant ${tenant.tenantId}`, ` considered=${tenant.considered} updated=${tenant.updated} skipped=${tenant.skipped}`);
201
- for (const kind of tenant.byKind) {
202
- lines.push(` ${kind.kind}: considered=${kind.considered} updated=${kind.updated} skipped=${kind.skipped}`);
203
- }
204
- }
205
- return lines.join("\n");
206
- }
207
- function renderCompactList(entities) {
208
- if (entities.length === 0) {
209
- return "none";
210
- }
211
- return entities.map((entity) => `${entity.reference}:${entity.status}`).join(", ");
212
- }
213
- function renderEntityLine(entity) {
214
- return `${entity.id} ${entity.kind} ${entity.status} ${entity.title}`;
215
- }
216
- function indentBlock(text) {
217
- return text
218
- .split("\n")
219
- .map((line) => ` ${line}`)
220
- .join("\n");
221
- }
222
- export function renderAuthLogin(session) {
223
- return [
224
- `Logged in as ${session.displayName ?? session.userId} (tenant ${session.tenantId})`,
225
- `Session expires: ${session.expiresAt}`
226
- ].join("\n");
227
- }
228
- export function renderAuthList(logins) {
229
- return logins
230
- .map(({ login, active }) => {
231
- const destination = login.kind === "local" ? "local" : `remote ${login.serviceUrl}`;
232
- return `${active ? "*" : "-"} ${login.name} (${destination})`;
233
- })
234
- .join("\n");
235
- }
236
- export function renderAuthLogout(name) {
237
- return `Removed saved login ${name}.`;
238
- }
239
- export function renderAuthStatus(login) {
240
- if (login.kind === "local") {
241
- return ["Active saved login: local", "Destination: local"].join("\n");
242
- }
243
- return [
244
- `Active saved login: ${login.name}`,
245
- "Destination: remote",
246
- `Remote URL: ${login.serviceUrl}`,
247
- `Identity: ${login.displayName ?? login.userId} (tenant ${login.tenantId})`,
248
- `Session expires: ${login.expiresAt}`
249
- ].join("\n");
250
- }
251
- export function renderAuthSwitch(login) {
252
- return `Switched to saved login ${login.name}.`;
253
- }
254
- export function renderSynchronize(result) {
255
- const { summary } = result;
256
- const appliedTotal = summary.entriesAppliedToLocal + summary.entriesAppliedToCloud;
257
- const createdTotal = summary.entitiesCreatedLocal.length + summary.entitiesCreatedCloud.length;
258
- const updatedTotal = summary.entitiesUpdatedLocal.length + summary.entitiesUpdatedCloud.length;
259
- const relationsTotal = summary.relationsAppliedToLocal + summary.relationsAppliedToCloud;
260
- const contextsTotal = summary.contextsAppliedToLocal +
261
- summary.contextsAppliedToCloud +
262
- summary.contextTermsAppliedToLocal +
263
- summary.contextTermsAppliedToCloud;
264
- if (appliedTotal === 0 &&
265
- createdTotal === 0 &&
266
- updatedTotal === 0 &&
267
- relationsTotal === 0 &&
268
- contextsTotal === 0 &&
269
- summary.concurrentEditConflicts === 0) {
270
- return `Already in sync with ${result.cloudApiUrl} (tenant ${result.tenantId}).`;
271
- }
272
- const lines = [
273
- `Synchronized with ${result.cloudApiUrl} (tenant ${result.tenantId}).`,
274
- `History entries applied: ${summary.entriesAppliedToLocal} to local, ${summary.entriesAppliedToCloud} to cloud`,
275
- `Entities created: ${summary.entitiesCreatedLocal.length} local, ${summary.entitiesCreatedCloud.length} cloud`,
276
- `Entities updated: ${summary.entitiesUpdatedLocal.length} local, ${summary.entitiesUpdatedCloud.length} cloud`,
277
- `Relations applied: ${summary.relationsAppliedToLocal} to local, ${summary.relationsAppliedToCloud} to cloud`,
278
- `Contexts applied: ${summary.contextsAppliedToLocal} to local, ${summary.contextsAppliedToCloud} to cloud`,
279
- `Context terms applied: ${summary.contextTermsAppliedToLocal} to local, ${summary.contextTermsAppliedToCloud} to cloud`
280
- ];
281
- if (summary.concurrentEditConflicts > 0) {
282
- lines.push(`Concurrent-edit conflicts resolved by last-writer-wins: ${summary.concurrentEditConflicts}`);
283
- }
284
- return lines.join("\n");
285
- }
286
- //# sourceMappingURL=renderers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderers.js","sourceRoot":"","sources":["../../src/cli/renderers.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,gBAAgB,CAC/B,IAAY,EACZ,QAAiF,EACjF,YAAuC,EACvC,YAGE;IAEF,IAAI,YAAY,EAAE,CAAC;QAClB,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;YAClC,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE;YACxE,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC;SACpD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,MAAM,IAAI,kBAAkB,CAAC;IACrC,CAAC;IAED,OAAO,QAAQ;SACb,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACf,MAAM,QAAQ,GAAG,YAAY,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,gBAAgB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;Q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0BAA0B,WAAW;KACvH,CAAC;IAEF,IAAI,OAAO,CAAC,uBAAuB,GAAG,CAAC,EAAE,CAAC;QACzC,KAAK,CAAC,IAAI,CAAC,2DAA2D,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC"}
@@ -1,97 +0,0 @@
1
- import type { Writable } from "node:stream";
2
- import { Command, type BaseContext } from "clipanion";
3
- import type { StorageDriver } from "@agent-issues/core";
4
- import { type ContextDirectoryView, type DatabaseLocationOptions } from "@agent-issues/api-local";
5
- import type { SavedLoginStoreOptions } from "../auth-session.js";
6
- export type AgentIssuesContext = BaseContext & {
7
- cwd: string;
8
- authLoginDependencies?: {
9
- deviceCodeLogin?: (options: {
10
- tenantId: string;
11
- clientId: string;
12
- onDeviceCode: (message: string) => void;
13
- }) => Promise<{
14
- tenantId: string;
15
- userId: string;
16
- displayName?: string;
17
- accessToken: string;
18
- expiresAt: string;
19
- }>;
20
- fetch?: typeof globalThis.fetch;
21
- interactive?: boolean;
22
- prompt?: (question: string) => Promise<string>;
23
- };
24
- /**
25
- * Overrides how `auth-session.ts` reaches the native OS credential store
26
- * (ISS185, ADR46). Production never sets this - the real OS tool is used.
27
- * Tests inject an in-memory fake here (via `runCli`'s context argument)
28
- * so `auth login`/`logout`/`status`/`switch` never shell out to the
29
- * developer's or CI machine's real credential store.
30
- */
31
- credentialStoreOptions?: SavedLoginStoreOptions;
32
- };
33
- export type EntityView = "compact" | "full";
34
- export declare const CONTEXT_SUBCOMMANDS: Set<string>;
35
- export declare abstract class BaseCommand extends Command<AgentIssuesContext> {
36
- asJson: boolean;
37
- prettyJson: boolean;
38
- protected print(payload: object, text: string): void;
39
- /**
40
- * The `withStore`/`openStorageDriver` options every command needs: the
41
- * invoking cwd (for database-path resolution) and this invocation's
42
- * `credentialStoreOptions` override (ISS185) so auth-session lookups in
43
- * cloud mode go through whatever the test injected via `runCli`'s
44
- * context instead of always defaulting to the real OS credential store.
45
- */
46
- protected withStoreOptions(extra?: DatabaseLocationOptions): DatabaseLocationOptions & {
47
- credentialStoreOptions?: SavedLoginStoreOptions;
48
- };
49
- }
50
- export declare abstract class TenantCommand extends BaseCommand {
51
- dbPath: string | undefined;
52
- }
53
- export declare abstract class MutableTenantCommand extends TenantCommand {
54
- force: boolean;
55
- }
56
- export declare abstract class BodyTenantCommand extends TenantCommand {
57
- bodyFile: string | undefined;
58
- protected resolveBody(): Promise<string | undefined>;
59
- }
60
- export declare abstract class TargetCommand extends BaseCommand {
61
- force: boolean;
62
- target: string | undefined;
63
- }
64
- /**
65
- * Opens the storage-driver seam for one command invocation and closes it
66
- * afterwards, replacing the repeated `ensureDatabase` + try/finally pattern
67
- * every command used before the seam existed (ADR11, ADR13). Delegates to
68
- * `openStorageDriver` (ADR18) to pick `SqliteStore` or `HttpStore` per the
69
- * resolved backend, so commands never branch on backend themselves. Hands
70
- * the resolved `dbPath` back too, since a few commands echo it in their
71
- * output (the cloud API URL in cloud mode, per `OpenStorageDriverResult`).
72
- *
73
- * Passes this install's build-content-hash so local mode's daemon routing
74
- * (ISS190, ADR44/45) can detect a stale already-running daemon; surfaces
75
- * `daemonFallbackWarning` on stderr so a failed daemon spawn is visible
76
- * without ever failing the command itself.
77
- */
78
- export declare function withStore<T>(dbPath: string | undefined, options: (DatabaseLocationOptions & {
79
- credentialStoreOptions?: SavedLoginStoreOptions;
80
- }) | undefined, fn: (store: StorageDriver, dbPath: string) => Promise<T>): Promise<T>;
81
- export declare function parseContextView(value: string | undefined): ContextDirectoryView;
82
- export declare function parseEntityView(value: string | undefined): EntityView;
83
- export declare function parseCsvOption(value: string | undefined): string[];
84
- export declare function parsePositiveIntegerOption(value: string | undefined, optionName: string): number | undefined;
85
- export declare function parsePortOption(value: string | undefined): number | undefined;
86
- export declare function stringifyJson(value: unknown, pretty: boolean): string;
87
- export declare function printOutput(output: Writable, asJson: boolean, prettyJson: boolean, payload: object, text: string): void;
88
- export declare function requirePositional(positionals: string[], index: number, usage: string): string;
89
- export declare function requireOption(value: string | undefined, message: string): string;
90
- /**
91
- * Reads a large-markdown option's value from a file (or from stdin when the
92
- * value is `-`). Every command that accepts a large authored-markdown field
93
- * (entity, context summary, term definition) uses the same `--body-file`
94
- * flag - never an inline flag value - since inline multiline markdown breaks
95
- * shell quoting and lands in shell history and process listings.
96
- */
97
- export declare function resolveMarkdownFileOption(filePath: string | undefined, flagName: string, stdin?: AsyncIterable<string | Uint8Array>): Promise<string | undefined>;