orbitmap 0.4.4 → 0.5.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/README.md +73 -10
- package/dist/adapters/cloud.d.ts +85 -10
- package/dist/adapters/cloud.js +118 -17
- package/dist/adapters/cloud.js.map +1 -1
- package/dist/adapters/factory.js +7 -0
- package/dist/adapters/factory.js.map +1 -1
- package/dist/adapters/local/adapter.d.ts +47 -8
- package/dist/adapters/local/adapter.js +37 -17
- package/dist/adapters/local/adapter.js.map +1 -1
- package/dist/adapters/local/context.d.ts +13 -1
- package/dist/adapters/local/context.js +7 -2
- package/dist/adapters/local/context.js.map +1 -1
- package/dist/adapters/local/entities/documents.d.ts +18 -4
- package/dist/adapters/local/entities/documents.js +46 -7
- package/dist/adapters/local/entities/documents.js.map +1 -1
- package/dist/adapters/local/entities/planning.d.ts +36 -7
- package/dist/adapters/local/entities/planning.js +245 -39
- package/dist/adapters/local/entities/planning.js.map +1 -1
- package/dist/adapters/local/entities/tasks.d.ts +16 -7
- package/dist/adapters/local/entities/tasks.js +55 -42
- package/dist/adapters/local/entities/tasks.js.map +1 -1
- package/dist/adapters/local/entities/work-items.d.ts +28 -7
- package/dist/adapters/local/entities/work-items.js +111 -39
- package/dist/adapters/local/entities/work-items.js.map +1 -1
- package/dist/adapters/local/lists.d.ts +139 -0
- package/dist/adapters/local/lists.js +230 -0
- package/dist/adapters/local/lists.js.map +1 -0
- package/dist/adapters/local/rules.js +22 -0
- package/dist/adapters/local/rules.js.map +1 -1
- package/dist/adapters/local/shapes.d.ts +165 -22
- package/dist/adapters/local/shapes.js +338 -50
- package/dist/adapters/local/shapes.js.map +1 -1
- package/dist/adapters/local/types.d.ts +5 -0
- package/dist/adapters/local/types.js.map +1 -1
- package/dist/adapters/types.d.ts +72 -9
- package/dist/agent-instructions.d.ts +39 -10
- package/dist/agent-instructions.js +268 -68
- package/dist/agent-instructions.js.map +1 -1
- package/dist/commands/context.d.ts +62 -37
- package/dist/commands/context.js +105 -36
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/docs.d.ts +4 -0
- package/dist/commands/docs.js +12 -5
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/ideas.d.ts +3 -0
- package/dist/commands/ideas.js +14 -7
- package/dist/commands/ideas.js.map +1 -1
- package/dist/commands/intent.d.ts +26 -0
- package/dist/commands/intent.js +110 -7
- package/dist/commands/intent.js.map +1 -1
- package/dist/commands/issues.d.ts +4 -0
- package/dist/commands/issues.js +15 -7
- package/dist/commands/issues.js.map +1 -1
- package/dist/commands/mission.d.ts +2 -0
- package/dist/commands/mission.js +9 -5
- package/dist/commands/mission.js.map +1 -1
- package/dist/commands/setup-agent.d.ts +34 -0
- package/dist/commands/setup-agent.js +95 -4
- package/dist/commands/setup-agent.js.map +1 -1
- package/dist/commands/start.d.ts +13 -0
- package/dist/commands/start.js +125 -13
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/tasks.d.ts +23 -5
- package/dist/commands/tasks.js +46 -23
- package/dist/commands/tasks.js.map +1 -1
- package/dist/commands/vibes.d.ts +3 -0
- package/dist/commands/vibes.js +11 -5
- package/dist/commands/vibes.js.map +1 -1
- package/dist/errors.d.ts +23 -2
- package/dist/errors.js +31 -3
- package/dist/errors.js.map +1 -1
- package/dist/index.js +108 -36
- package/dist/index.js.map +1 -1
- package/dist/list-meta.d.ts +117 -0
- package/dist/list-meta.js +160 -0
- package/dist/list-meta.js.map +1 -0
- package/dist/list-options.d.ts +33 -0
- package/dist/list-options.js +70 -0
- package/dist/list-options.js.map +1 -0
- package/dist/workspace-resolve.d.ts +47 -1
- package/dist/workspace-resolve.js +74 -11
- package/dist/workspace-resolve.js.map +1 -1
- package/dist/write-target.d.ts +9 -0
- package/dist/write-target.js +11 -2
- package/dist/write-target.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,57 +1,82 @@
|
|
|
1
1
|
import { type AreaDirectoryMapping, type AreaSource, type OrbitMapMode, type WorkspaceSource } from '../workspace-resolve.js';
|
|
2
|
+
/** `missions[]` — handle tier plus the outcome TL;DR. */
|
|
3
|
+
interface ContextMission {
|
|
4
|
+
number: string;
|
|
5
|
+
name: string;
|
|
6
|
+
status: string;
|
|
7
|
+
outcome_tldr: string | null;
|
|
8
|
+
/** Present (and true) only when a content-bearing field lacks the `---` TL;DR rule. */
|
|
9
|
+
tldr_missing?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** `intents[]` — NO status filter upstream: closed intents are valid matching context. */
|
|
12
|
+
interface ContextIntent {
|
|
13
|
+
number: string;
|
|
14
|
+
name: string;
|
|
15
|
+
status: string;
|
|
16
|
+
/** Display number of the intent's mission, or null. */
|
|
17
|
+
mission: string | null;
|
|
18
|
+
/** Declared-over-derived area slugs. */
|
|
19
|
+
areas: string[];
|
|
20
|
+
outcome_tldr: string | null;
|
|
21
|
+
design_tldr: string | null;
|
|
22
|
+
plan_tldr: string | null;
|
|
23
|
+
tldr_missing?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** `workitems[]` — mission-linked, intent-less tasks AND issues, never subtasks. */
|
|
26
|
+
interface ContextWorkitem {
|
|
27
|
+
number: string;
|
|
28
|
+
title: string;
|
|
29
|
+
status: string;
|
|
30
|
+
area: string | null;
|
|
31
|
+
mission: string | null;
|
|
32
|
+
}
|
|
33
|
+
/** `areas[]` — the reachable areas, five matching fields. */
|
|
34
|
+
interface ContextAreaEntry {
|
|
35
|
+
slug: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description: string | null;
|
|
38
|
+
default_branch: string;
|
|
39
|
+
git_url: string | null;
|
|
40
|
+
}
|
|
41
|
+
/** `documents[]` — metadata only; `when_to_use` answers "when should I open this". */
|
|
42
|
+
interface ContextDocument {
|
|
43
|
+
slug: string;
|
|
44
|
+
title: string;
|
|
45
|
+
when_to_use: string | null;
|
|
46
|
+
scope: string;
|
|
47
|
+
}
|
|
2
48
|
interface ContextResponse {
|
|
3
49
|
data: {
|
|
50
|
+
/** Identity ping — always first. */
|
|
4
51
|
agent: {
|
|
5
52
|
id: string;
|
|
6
53
|
name: string;
|
|
7
54
|
slug: string;
|
|
8
55
|
};
|
|
9
|
-
area
|
|
56
|
+
/** Area branch of the response — present when an area context resolved. */
|
|
57
|
+
area?: {
|
|
10
58
|
id: string;
|
|
11
59
|
name: string;
|
|
12
60
|
slug: string;
|
|
13
61
|
description: string | null;
|
|
14
62
|
git_url: string | null;
|
|
15
63
|
default_branch: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
* workspace branch of the response — the whole point of it is that one `context` call
|
|
20
|
-
* tells the agent where it may work, so it never has to list areas to find out.
|
|
21
|
-
*/
|
|
22
|
-
areas?: Array<{
|
|
23
|
-
id: string;
|
|
24
|
-
slug: string;
|
|
25
|
-
name: string;
|
|
26
|
-
role: string;
|
|
27
|
-
}>;
|
|
28
|
-
active_mission?: {
|
|
64
|
+
};
|
|
65
|
+
/** Workspace branch — the identity block when no area (only a workspace) resolved. */
|
|
66
|
+
workspace?: {
|
|
29
67
|
id: string;
|
|
30
|
-
display_number?: string;
|
|
31
68
|
name: string;
|
|
32
|
-
status: string;
|
|
33
|
-
} | null;
|
|
34
|
-
/** Open intents of the workspace — the work that outranks any single task. */
|
|
35
|
-
open_intents?: Array<{
|
|
36
|
-
number: string;
|
|
37
|
-
name: string;
|
|
38
|
-
status: string;
|
|
39
|
-
}>;
|
|
40
|
-
tasks: Array<{
|
|
41
|
-
id: string;
|
|
42
|
-
title: string;
|
|
43
|
-
status: string;
|
|
44
|
-
priority: string;
|
|
45
|
-
task_number: string;
|
|
46
|
-
display_number: string;
|
|
47
|
-
}>;
|
|
48
|
-
documents: Array<{
|
|
49
|
-
id: string;
|
|
50
|
-
title: string;
|
|
51
69
|
slug: string;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
70
|
+
};
|
|
71
|
+
missions: ContextMission[];
|
|
72
|
+
intents: ContextIntent[];
|
|
73
|
+
workitems: ContextWorkitem[];
|
|
74
|
+
areas: ContextAreaEntry[];
|
|
75
|
+
documents: ContextDocument[];
|
|
76
|
+
/** `more`: per-handle-type deeper-fetch pointers, rendered as the closing line. */
|
|
77
|
+
meta: {
|
|
78
|
+
more: Record<string, string>;
|
|
79
|
+
};
|
|
55
80
|
};
|
|
56
81
|
}
|
|
57
82
|
/**
|
package/dist/commands/context.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `orbitmap context` — the primary context source for AI agents (intent IN-rwb5qu
|
|
2
|
+
* `orbitmap context` — the primary context source for AI agents (intent IN-rwb5qu;
|
|
3
|
+
* payload pivot IN-vnz6fs, API 10.0.0).
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Since API 10.0.0 the server/adapter `/context` envelope is MATCHING MATERIAL for
|
|
6
|
+
* session-focus derivation, not a work queue: the agent identity first, then the area
|
|
7
|
+
* (or workspace) block, missions and intents as handles + TL;DR summaries, standalone
|
|
8
|
+
* mission workitems, the reachable areas, document metadata and `meta.more` — how to
|
|
9
|
+
* fetch deeper per handle type. The old `tasks` array, `active_mission`, `open_intents`
|
|
10
|
+
* and `agent.introduction` are gone; task truth lives on the list endpoints.
|
|
11
|
+
*
|
|
12
|
+
* On top of that envelope the command reports everything the *local* resolution knows,
|
|
13
|
+
* so that an agent never has to be told any of it out of band (CLAUDE.md and friends
|
|
14
|
+
* stay static):
|
|
7
15
|
*
|
|
8
16
|
* - which workspace this invocation is scoped to, and where its identity came from,
|
|
9
17
|
* - the full directory → area map visible from the current directory,
|
|
@@ -17,6 +25,10 @@ import { LocalStore } from '../adapters/local/store.js';
|
|
|
17
25
|
import { createAdapter } from '../adapters/factory.js';
|
|
18
26
|
import { formatOutput, printError, formatTable } from '../output.js';
|
|
19
27
|
import { resolveAreaDirectoryMap, resolveWorkspaceContext, } from '../workspace-resolve.js';
|
|
28
|
+
/** Intent statuses that mean "closed" — kept, not filtered, and marked in the render. */
|
|
29
|
+
const CLOSED_INTENT_STATUSES = new Set(['done', 'cancelled']);
|
|
30
|
+
/** Mission statuses that mean "closed". */
|
|
31
|
+
const CLOSED_MISSION_STATUSES = new Set(['completed', 'cancelled']);
|
|
20
32
|
/**
|
|
21
33
|
* Read the workspace display name from a local `workspace.yml`.
|
|
22
34
|
*
|
|
@@ -74,7 +86,8 @@ export async function contextCommand(options) {
|
|
|
74
86
|
console.log(formatOutput(output, true));
|
|
75
87
|
return;
|
|
76
88
|
}
|
|
77
|
-
const { agent, area,
|
|
89
|
+
const { agent, area, missions, intents, workitems, areas, documents, meta } = response.data;
|
|
90
|
+
// Identity first — the agent block opens every session.
|
|
78
91
|
console.log(`Agent: ${agent.name} (${agent.slug})`);
|
|
79
92
|
console.log(`ID: ${agent.id}`);
|
|
80
93
|
console.log(`\nWorkspace: ${formatWorkspace(workspace)}`);
|
|
@@ -87,56 +100,112 @@ export async function contextCommand(options) {
|
|
|
87
100
|
? `${output.resolved_area} (source: ${output.area_source ?? 'unknown'})`
|
|
88
101
|
: '(none) — workspace scope; pass --area <slug> for area-scoped commands'}`);
|
|
89
102
|
console.log(`Cwd: ${output.cwd}`);
|
|
103
|
+
if (areasMap.length > 0) {
|
|
104
|
+
console.log(`\nMapped directories (${areasMap.length}):`);
|
|
105
|
+
console.log(formatTable(['Area', 'Directory', 'From'], areasMap.map((m) => [m.area, m.dir, m.from])));
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
console.log('\nMapped directories: none (no `areas` map in .orbitmap/config.json)');
|
|
109
|
+
}
|
|
90
110
|
if (area) {
|
|
91
111
|
console.log(`\nArea: ${area.name} (${area.slug})`);
|
|
92
|
-
console.log(`ID: ${area.id}`);
|
|
93
112
|
if (area.description)
|
|
94
113
|
console.log(`Desc: ${area.description}`);
|
|
95
114
|
if (area.git_url)
|
|
96
115
|
console.log(`Git: ${area.git_url}`);
|
|
97
116
|
console.log(`Branch: ${area.default_branch}`);
|
|
98
117
|
}
|
|
118
|
+
printMissions(missions ?? []);
|
|
119
|
+
printIntents(intents ?? [], missions ?? []);
|
|
120
|
+
printWorkitems(workitems ?? []);
|
|
99
121
|
// Printed even when an area did resolve: knowing the sibling areas is what stops an
|
|
100
|
-
// agent from listing them separately
|
|
122
|
+
// agent from listing them separately.
|
|
101
123
|
if (areas && areas.length > 0) {
|
|
102
|
-
console.log(`\nAreas
|
|
103
|
-
|
|
104
|
-
console.log(` ${a.slug.padEnd(24)} ${a.name} (${a.role})`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (active_mission) {
|
|
108
|
-
const number = active_mission.display_number
|
|
109
|
-
? `${active_mission.display_number} `
|
|
110
|
-
: '';
|
|
111
|
-
console.log(`\nActive mission: ${number}${active_mission.name} [${active_mission.status}]`);
|
|
124
|
+
console.log(`\nAreas (${areas.length}):`);
|
|
125
|
+
console.log(formatTable(['Slug', 'Name', 'Branch', 'Git'], areas.map((a) => [a.slug, a.name, a.default_branch, a.git_url ?? ''])));
|
|
112
126
|
}
|
|
113
|
-
if (
|
|
114
|
-
console.log(`\
|
|
115
|
-
for (const
|
|
116
|
-
console.log(` ${
|
|
127
|
+
if (documents && documents.length > 0) {
|
|
128
|
+
console.log(`\nDocuments (${documents.length}) — read with \`doc <slug>\`:`);
|
|
129
|
+
for (const doc of documents) {
|
|
130
|
+
console.log(` ${doc.slug} — ${doc.title}`);
|
|
131
|
+
if (doc.when_to_use)
|
|
132
|
+
console.log(` ${doc.when_to_use}`);
|
|
117
133
|
}
|
|
118
134
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (documents.length > 0) {
|
|
124
|
-
console.log(`\nDocuments (${documents.length}):`);
|
|
125
|
-
console.log(formatTable(['Title', 'Type', 'Shared'], documents.map((d) => [d.title, d.type, d._shared ? 'yes' : ''])));
|
|
126
|
-
}
|
|
127
|
-
if (areasMap.length > 0) {
|
|
128
|
-
console.log(`\nMapped directories (${areasMap.length}):`);
|
|
129
|
-
console.log(formatTable(['Area', 'Directory', 'From'], areasMap.map((m) => [m.area, m.dir, m.from])));
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
console.log('\nMapped directories: none (no `areas` map in .orbitmap/config.json)');
|
|
133
|
-
}
|
|
135
|
+
// The closing pointer line: how to fetch deeper, one entry per handle type.
|
|
136
|
+
const more = Object.values(meta?.more ?? {});
|
|
137
|
+
if (more.length > 0)
|
|
138
|
+
console.log(`\nMore: ${more.join(' | ')}`);
|
|
134
139
|
}
|
|
135
140
|
catch (error) {
|
|
136
141
|
printError(error, options.json);
|
|
137
142
|
process.exitCode = 1;
|
|
138
143
|
}
|
|
139
144
|
}
|
|
145
|
+
/** `[status]`, with closed statuses visibly marked. */
|
|
146
|
+
function statusTag(status, closed) {
|
|
147
|
+
return closed.has(status) ? `[${status} — closed]` : `[${status}]`;
|
|
148
|
+
}
|
|
149
|
+
/** The one TL;DR line an intent gets: outcome first, else design, else plan. */
|
|
150
|
+
function intentTldr(intent) {
|
|
151
|
+
return intent.outcome_tldr ?? intent.design_tldr ?? intent.plan_tldr;
|
|
152
|
+
}
|
|
153
|
+
function printMissions(missions) {
|
|
154
|
+
if (missions.length === 0)
|
|
155
|
+
return;
|
|
156
|
+
console.log(`\nMissions (${missions.length}):`);
|
|
157
|
+
for (const mission of missions) {
|
|
158
|
+
// The active mission is the session's likeliest frame — marked so it reads first.
|
|
159
|
+
const marker = mission.status === 'active' ? '▸' : ' ';
|
|
160
|
+
console.log(` ${marker} ${mission.number} ${mission.name} ${statusTag(mission.status, CLOSED_MISSION_STATUSES)}`);
|
|
161
|
+
if (mission.outcome_tldr)
|
|
162
|
+
console.log(` ${mission.outcome_tldr}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Intents grouped by mission (in the payload's mission order), then the rest — the
|
|
167
|
+
* backlog and everything outside the reported missions. Closed intents stay visible:
|
|
168
|
+
* "the thing we finished last week" is valid conversational context.
|
|
169
|
+
*/
|
|
170
|
+
function printIntents(intents, missions) {
|
|
171
|
+
if (intents.length === 0)
|
|
172
|
+
return;
|
|
173
|
+
console.log(`\nIntents (${intents.length}):`);
|
|
174
|
+
const printed = new Set();
|
|
175
|
+
const line = (intent, indent) => {
|
|
176
|
+
printed.add(intent);
|
|
177
|
+
const areas = intent.areas.length > 0 ? ` (${intent.areas.join(', ')})` : '';
|
|
178
|
+
console.log(`${indent}${intent.number} ${intent.name} ${statusTag(intent.status, CLOSED_INTENT_STATUSES)}${areas}`);
|
|
179
|
+
const tldr = intentTldr(intent);
|
|
180
|
+
if (tldr)
|
|
181
|
+
console.log(`${indent} ${tldr}`);
|
|
182
|
+
};
|
|
183
|
+
for (const mission of missions) {
|
|
184
|
+
const group = intents.filter((i) => i.mission === mission.number && !printed.has(i));
|
|
185
|
+
if (group.length === 0)
|
|
186
|
+
continue;
|
|
187
|
+
console.log(` ${mission.number} — ${mission.name}:`);
|
|
188
|
+
for (const intent of group)
|
|
189
|
+
line(intent, ' ');
|
|
190
|
+
}
|
|
191
|
+
const rest = intents.filter((i) => !printed.has(i));
|
|
192
|
+
if (rest.length > 0) {
|
|
193
|
+
// Only label the group when there was a grouped section above it.
|
|
194
|
+
if (rest.length < intents.length)
|
|
195
|
+
console.log(' Backlog / other:');
|
|
196
|
+
for (const intent of rest)
|
|
197
|
+
line(intent, ' ');
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function printWorkitems(workitems) {
|
|
201
|
+
if (workitems.length === 0)
|
|
202
|
+
return;
|
|
203
|
+
console.log(`\nWork items (${workitems.length}) — mission work outside any intent:`);
|
|
204
|
+
for (const item of workitems) {
|
|
205
|
+
const where = [item.area, item.mission].filter(Boolean).join(' · ');
|
|
206
|
+
console.log(` ${item.number} ${item.title} [${item.status}]${where ? ` (${where})` : ''}`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
140
209
|
function formatWorkspace(workspace) {
|
|
141
210
|
if (workspace.name && workspace.slug)
|
|
142
211
|
return `${workspace.name} (${workspace.slug})`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GAKxB,MAAM,yBAAyB,CAAC;AAsHjC,yFAAyF;AACzF,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAE9D,2CAA2C;AAC3C,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAEpE;;;;;;GAMG;AACH,KAAK,UAAU,0BAA0B,CACvC,aAAqB;IAErB,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC,aAAa,EAAE,CAAC;QACtE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,IAAI,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACpC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAGpC;IACC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACj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CAAC,CAAC;QACpE,KAAK,MAAM,MAAM,IAAI,IAAI;YAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,SAA4B;IAClD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEnC,OAAO,CAAC,GAAG,CAAC,iBAAiB,SAAS,CAAC,MAAM,sCAAsC,CAAC,CAAC;IACrF,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpE,OAAO,CAAC,GAAG,CACT,KAAK,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC/E,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,SAA2B;IAClD,IAAI,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI;QAAE,OAAO,GAAG,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,GAAG,CAAC;IACrF,OAAO,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,CAAC;AAC9D,CAAC"}
|
package/dist/commands/docs.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export declare function docsCommand(options: {
|
|
2
2
|
json: boolean;
|
|
3
|
+
/** `--area a,b`: the `area_id` list filter, applied by the adapter. */
|
|
3
4
|
area?: string;
|
|
4
5
|
type?: string;
|
|
5
6
|
search?: string;
|
|
7
|
+
limit?: string;
|
|
8
|
+
/** `--all`: follow `next_cursor` to the end. */
|
|
9
|
+
all?: boolean;
|
|
6
10
|
}): Promise<void>;
|
package/dist/commands/docs.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createAdapter } from '../adapters/factory.js';
|
|
|
2
2
|
import { formatOutput, printError, formatTable, printValidationError } from '../output.js';
|
|
3
3
|
import { DOCUMENT_TYPES } from '../enums.js';
|
|
4
4
|
import { printAreaGroups } from '../area-grouping.js';
|
|
5
|
+
import { fetchAllPages, formatEmptyLine, printListMeta, } from '../list-meta.js';
|
|
5
6
|
export async function docsCommand(options) {
|
|
6
7
|
// Same enum, same behaviour as `doc-import --type`: an unknown type used to be sent to
|
|
7
8
|
// the server, which answered with an empty list — indistinguishable from "no documents".
|
|
@@ -11,21 +12,27 @@ export async function docsCommand(options) {
|
|
|
11
12
|
}
|
|
12
13
|
try {
|
|
13
14
|
const client = await createAdapter(options.area);
|
|
14
|
-
const
|
|
15
|
+
const page = (cursor) => client.getDocuments({
|
|
15
16
|
type: options.type,
|
|
16
17
|
search: options.search,
|
|
17
|
-
|
|
18
|
+
limit: options.limit,
|
|
19
|
+
...(cursor !== undefined ? { cursor } : {}),
|
|
20
|
+
});
|
|
21
|
+
const response = options.all
|
|
22
|
+
? await fetchAllPages(page, (doc) => doc.area?.slug ?? null)
|
|
23
|
+
: await page();
|
|
18
24
|
if (options.json) {
|
|
19
25
|
console.log(formatOutput(response, true));
|
|
20
26
|
return;
|
|
21
27
|
}
|
|
22
|
-
const docs = response.data;
|
|
28
|
+
const docs = response.data ?? [];
|
|
23
29
|
if (docs.length === 0) {
|
|
24
|
-
console.log('
|
|
30
|
+
console.log(formatEmptyLine('documents', response.meta));
|
|
25
31
|
return;
|
|
26
32
|
}
|
|
27
|
-
console.log(`Documents (${
|
|
33
|
+
console.log(`Documents (${docs.length}):\n`);
|
|
28
34
|
printAreaGroups(docs, renderDocTable);
|
|
35
|
+
printListMeta(response.meta, docs.length);
|
|
29
36
|
console.log('\nSlug works for `doc <slug>`; doc-share, doc-unshare and doc-visibility need the ID.');
|
|
30
37
|
}
|
|
31
38
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAgB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAgB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EACL,aAAa,EACb,eAAe,EACf,aAAa,GAEd,MAAM,iBAAiB,CAAC;AAyBzB,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OASjC;IACC,uFAAuF;IACvF,yFAAyF;IACzF,IAAI,OAAO,CAAC,IAAI,IAAI,CAAE,cAAoC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAClF,oBAAoB,CAClB,0BAA0B,OAAO,CAAC,IAAI,aAAa,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAC9E,OAAO,CAAC,IAAI,CACb,CAAC;QACF,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEjD,MAAM,IAAI,GAAG,CAAC,MAAe,EAAE,EAAE,CAC/B,MAAM,CAAC,YAAY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H,CAAC;AAED,SAAS,cAAc,CAAC,IAAe;IACrC,OAAO,WAAW;IAChB,wFAAwF;IACxF,wFAAwF;IACxF,uFAAuF;IACvF,oDAAoD;IACpD,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,EAChF,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACd,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM;QACnC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACjB,CAAC,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;QAC9D,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QACtB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;KACtF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/commands/ideas.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export declare function ideaListCommand(options: {
|
|
2
2
|
json: boolean;
|
|
3
|
+
/** `--area a,b`: the `area_id` list filter, applied by the adapter. */
|
|
3
4
|
area?: string;
|
|
4
5
|
status?: string;
|
|
5
6
|
priority?: string;
|
|
6
7
|
limit?: string;
|
|
8
|
+
/** `--all`: follow `next_cursor` to the end. */
|
|
9
|
+
all?: boolean;
|
|
7
10
|
}): Promise<void>;
|
|
8
11
|
export declare function ideaShowCommand(idOrNumber: string, options: {
|
|
9
12
|
json: boolean;
|
package/dist/commands/ideas.js
CHANGED
|
@@ -2,29 +2,36 @@ import { createAdapter } from '../adapters/factory.js';
|
|
|
2
2
|
import { confirmWriteTarget } from '../write-target.js';
|
|
3
3
|
import { formatOutput, printError, printSuccess, formatTable, printValidationError } from '../output.js';
|
|
4
4
|
import { printAreaGroups } from '../area-grouping.js';
|
|
5
|
+
import { fetchAllPages, formatEmptyLine, printListMeta, } from '../list-meta.js';
|
|
5
6
|
const VALID_IDEA_STATUSES = ['pending', 'accepted', 'used', 'rejected'];
|
|
6
7
|
const VALID_PRIORITIES = ['critical', 'high', 'medium', 'low'];
|
|
7
8
|
// ── Commands ──
|
|
8
9
|
export async function ideaListCommand(options) {
|
|
9
10
|
try {
|
|
10
11
|
const client = await createAdapter(options.area);
|
|
11
|
-
const
|
|
12
|
+
const page = (cursor) => client.listIdeas({
|
|
12
13
|
status: options.status,
|
|
13
14
|
priority: options.priority,
|
|
14
15
|
limit: options.limit,
|
|
15
|
-
|
|
16
|
+
...(cursor !== undefined ? { cursor } : {}),
|
|
17
|
+
});
|
|
18
|
+
const response = options.all
|
|
19
|
+
? await fetchAllPages(page, (idea) => idea.area?.slug ?? null)
|
|
20
|
+
: await page();
|
|
16
21
|
if (options.json) {
|
|
17
22
|
console.log(formatOutput(response, true));
|
|
18
23
|
return;
|
|
19
24
|
}
|
|
20
|
-
const ideas = response.data;
|
|
25
|
+
const ideas = response.data ?? [];
|
|
21
26
|
if (ideas.length === 0) {
|
|
22
|
-
console.log('
|
|
27
|
+
console.log(formatEmptyLine('ideas', response.meta));
|
|
23
28
|
return;
|
|
24
29
|
}
|
|
25
|
-
console.log(`Ideas (${
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
console.log(`Ideas (${ideas.length}):\n`);
|
|
31
|
+
const grouped = printAreaGroups(ideas, renderIdeaTable);
|
|
32
|
+
printListMeta(response.meta, ideas.length);
|
|
33
|
+
if (grouped && !response.meta?.applied_filters) {
|
|
34
|
+
console.log('\nNarrow this down with --area <slug>.');
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
37
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ideas.js","sourceRoot":"","sources":["../../src/commands/ideas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzG,OAAO,EAAE,eAAe,EAAgB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ideas.js","sourceRoot":"","sources":["../../src/commands/ideas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzG,OAAO,EAAE,eAAe,EAAgB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EACL,aAAa,EACb,eAAe,EACf,aAAa,GAEd,MAAM,iBAAiB,CAAC;AAuDzB,MAAM,mBAAmB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;AACxE,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAE/D,iBAAiB;AAEjB,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OASC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,O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QACf,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -2,11 +2,31 @@ export declare function intentListCommand(options: {
|
|
|
2
2
|
json: boolean;
|
|
3
3
|
area?: string;
|
|
4
4
|
status?: string;
|
|
5
|
+
/** `--mission MS-xxxxxx`: only the intents of that mission. */
|
|
6
|
+
mission?: string;
|
|
5
7
|
limit?: string;
|
|
8
|
+
/** `--all`: follow `next_cursor` to the end. */
|
|
9
|
+
all?: boolean;
|
|
6
10
|
}): Promise<void>;
|
|
7
11
|
export declare function intentShowCommand(idOrNumber: string, options: {
|
|
8
12
|
json: boolean;
|
|
9
13
|
area?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Commander's `--no-logs` sets this to `false`; `true`/`undefined` is the default
|
|
16
|
+
* (embed the tail). `false` maps to `?logs=0` — the intent without its work-log
|
|
17
|
+
* tail, a measurably smaller payload for TL;DR-vs-body triage.
|
|
18
|
+
*/
|
|
19
|
+
logs?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Commander's `--no-bundle` sets this to `false`; `true`/`undefined` is the
|
|
22
|
+
* default (embed the context bundle). `false` maps to `?bundle=0` (API 10.1.0).
|
|
23
|
+
*/
|
|
24
|
+
bundle?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* `--slim` (API 10.1.0): fetch the freshness probe instead of the full body.
|
|
27
|
+
* Wins over `--no-logs`/`--no-bundle`, exactly as the provider resolves `slim=1`.
|
|
28
|
+
*/
|
|
29
|
+
slim?: boolean;
|
|
10
30
|
}): Promise<void>;
|
|
11
31
|
export declare function intentCreateCommand(title: string, options: {
|
|
12
32
|
json: boolean;
|
|
@@ -36,6 +56,12 @@ export declare function intentUpdateCommand(idOrNumber: string, options: {
|
|
|
36
56
|
design?: string;
|
|
37
57
|
plan?: string;
|
|
38
58
|
status?: string;
|
|
59
|
+
/**
|
|
60
|
+
* `--areas a,b` — comma-separated slugs or UUIDs, DECLARING the intent's areas
|
|
61
|
+
* (API 10.0.0 `area_ids[]`, replacing the declared set). Not to be confused with
|
|
62
|
+
* the global `--area` context flag.
|
|
63
|
+
*/
|
|
64
|
+
areas?: string;
|
|
39
65
|
log?: string[];
|
|
40
66
|
}): Promise<void>;
|
|
41
67
|
export declare function intentLinkCommand(idOrNumber: string, options: {
|