orbitmap 0.4.2 → 0.4.3
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 +60 -13
- package/dist/adapters/cloud.d.ts +53 -21
- package/dist/adapters/cloud.js +95 -29
- package/dist/adapters/cloud.js.map +1 -1
- package/dist/adapters/factory.d.ts +3 -0
- package/dist/adapters/factory.js +8 -1
- package/dist/adapters/factory.js.map +1 -1
- package/dist/adapters/local/adapter.d.ts +0 -20
- package/dist/adapters/local/adapter.js +0 -18
- package/dist/adapters/local/adapter.js.map +1 -1
- package/dist/adapters/local/context.d.ts +1 -1
- package/dist/adapters/local/context.js +10 -2
- package/dist/adapters/local/context.js.map +1 -1
- package/dist/adapters/local/entities/tasks.d.ts +9 -1
- package/dist/adapters/local/entities/tasks.js +47 -5
- package/dist/adapters/local/entities/tasks.js.map +1 -1
- package/dist/adapters/local/entities/work-items.d.ts +14 -30
- package/dist/adapters/local/entities/work-items.js +63 -47
- package/dist/adapters/local/entities/work-items.js.map +1 -1
- package/dist/adapters/local/rules.d.ts +4 -4
- package/dist/adapters/local/rules.js +4 -19
- package/dist/adapters/local/rules.js.map +1 -1
- package/dist/adapters/local/shapes.d.ts +27 -7
- package/dist/adapters/local/shapes.js +41 -5
- package/dist/adapters/local/shapes.js.map +1 -1
- package/dist/adapters/local/store.d.ts +55 -6
- package/dist/adapters/local/store.js +122 -8
- package/dist/adapters/local/store.js.map +1 -1
- package/dist/adapters/local/types.d.ts +9 -2
- package/dist/adapters/local/types.js +9 -2
- package/dist/adapters/local/types.js.map +1 -1
- package/dist/adapters/types.d.ts +7 -20
- package/dist/agent-instructions.d.ts +21 -8
- package/dist/agent-instructions.js +91 -35
- package/dist/agent-instructions.js.map +1 -1
- package/dist/area-directories.d.ts +75 -0
- package/dist/area-directories.js +162 -0
- package/dist/area-directories.js.map +1 -0
- package/dist/area-grouping.d.ts +55 -0
- package/dist/area-grouping.js +72 -0
- package/dist/area-grouping.js.map +1 -0
- package/dist/commands/areas.js +30 -2
- package/dist/commands/areas.js.map +1 -1
- package/dist/commands/assign.d.ts +1 -0
- package/dist/commands/assign.js +2 -0
- package/dist/commands/assign.js.map +1 -1
- package/dist/commands/context.d.ts +95 -0
- package/dist/commands/context.js +104 -2
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/create.d.ts +1 -0
- package/dist/commands/create.js +19 -14
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dep.js +5 -8
- package/dist/commands/dep.js.map +1 -1
- package/dist/commands/doc-import.d.ts +1 -0
- package/dist/commands/doc-import.js +8 -26
- package/dist/commands/doc-import.js.map +1 -1
- package/dist/commands/doc-patch.js +16 -52
- package/dist/commands/doc-patch.js.map +1 -1
- package/dist/commands/doc-share.js +4 -0
- package/dist/commands/doc-share.js.map +1 -1
- package/dist/commands/doc-update.js +4 -8
- package/dist/commands/doc-update.js.map +1 -1
- package/dist/commands/doc.js +7 -12
- package/dist/commands/doc.js.map +1 -1
- package/dist/commands/docs-cache.js +23 -10
- package/dist/commands/docs-cache.js.map +1 -1
- package/dist/commands/docs.js +29 -10
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/get.js +4 -10
- package/dist/commands/get.js.map +1 -1
- package/dist/commands/ideas.d.ts +3 -1
- package/dist/commands/ideas.js +26 -49
- package/dist/commands/ideas.js.map +1 -1
- package/dist/commands/init.d.ts +24 -1
- package/dist/commands/init.js +0 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/intent.js +10 -14
- package/dist/commands/intent.js.map +1 -1
- package/dist/commands/issues.d.ts +3 -1
- package/dist/commands/issues.js +47 -72
- package/dist/commands/issues.js.map +1 -1
- package/dist/commands/log.d.ts +1 -0
- package/dist/commands/log.js +18 -17
- package/dist/commands/log.js.map +1 -1
- package/dist/commands/mission.js +3 -12
- package/dist/commands/mission.js.map +1 -1
- package/dist/commands/orbit.d.ts +7 -1
- package/dist/commands/orbit.js +13 -24
- package/dist/commands/orbit.js.map +1 -1
- package/dist/commands/setup-agent.d.ts +97 -4
- package/dist/commands/setup-agent.js +265 -38
- package/dist/commands/setup-agent.js.map +1 -1
- package/dist/commands/setup-mcp.d.ts +2 -0
- package/dist/commands/setup-mcp.js +17 -40
- package/dist/commands/setup-mcp.js.map +1 -1
- package/dist/commands/start.d.ts +43 -0
- package/dist/commands/start.js +158 -3
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.js +5 -15
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/subtask.d.ts +1 -0
- package/dist/commands/subtask.js +9 -2
- package/dist/commands/subtask.js.map +1 -1
- package/dist/commands/task-edit-content.js +4 -8
- package/dist/commands/task-edit-content.js.map +1 -1
- package/dist/commands/task.d.ts +7 -0
- package/dist/commands/task.js +5 -2
- package/dist/commands/task.js.map +1 -1
- package/dist/commands/tasks.d.ts +35 -0
- package/dist/commands/tasks.js +45 -9
- package/dist/commands/tasks.js.map +1 -1
- package/dist/commands/vibes.d.ts +3 -1
- package/dist/commands/vibes.js +41 -31
- package/dist/commands/vibes.js.map +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.js +14 -1
- package/dist/config.js.map +1 -1
- package/dist/doc-cache.d.ts +74 -5
- package/dist/doc-cache.js +106 -22
- package/dist/doc-cache.js.map +1 -1
- package/dist/enums.d.ts +26 -0
- package/dist/enums.js +53 -0
- package/dist/enums.js.map +1 -0
- package/dist/errors.d.ts +67 -0
- package/dist/errors.js +82 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.js +134 -56
- package/dist/index.js.map +1 -1
- package/dist/mcp-config.d.ts +42 -1
- package/dist/mcp-config.js +82 -2
- package/dist/mcp-config.js.map +1 -1
- package/dist/oauth.js +10 -10
- package/dist/output.d.ts +12 -0
- package/dist/output.js +39 -1
- package/dist/output.js.map +1 -1
- package/dist/paths.d.ts +40 -0
- package/dist/paths.js +174 -9
- package/dist/paths.js.map +1 -1
- package/dist/project-config.d.ts +42 -1
- package/dist/project-config.js +51 -0
- package/dist/project-config.js.map +1 -1
- package/dist/workspace-resolve.d.ts +179 -9
- package/dist/workspace-resolve.js +288 -20
- package/dist/workspace-resolve.js.map +1 -1
- package/dist/write-target.d.ts +56 -0
- package/dist/write-target.js +170 -0
- package/dist/write-target.js.map +1 -0
- package/package.json +1 -1
- package/dist/commands/create-project.d.ts +0 -6
- package/dist/commands/create-project.js +0 -28
- package/dist/commands/create-project.js.map +0 -1
- package/dist/commands/projects.d.ts +0 -3
- package/dist/commands/projects.js +0 -28
- package/dist/commands/projects.js.map +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grouping list rows by area, for the workspace-scoped listings (TS-adanc8).
|
|
3
|
+
*
|
|
4
|
+
* `orbitmap tasks` solved this first: in workspace scope a flat table of rows from several
|
|
5
|
+
* areas is unreadable and, worse, unactionable — nothing tells you which `--area` a row
|
|
6
|
+
* needs. It grouped them under an `── Name (slug) ──` heading. Issues, ideas, vibes and
|
|
7
|
+
* documents have the same problem and now share this implementation instead of growing four
|
|
8
|
+
* more copies of the fold.
|
|
9
|
+
*
|
|
10
|
+
* **Degrades on purpose.** The `area` block only reaches the issue/idea payloads with
|
|
11
|
+
* TS-95h9rj (web-app); until then those rows carry no area at all. Rather than print an
|
|
12
|
+
* empty column or a UUID heading nobody can use, {@link groupByArea} reports
|
|
13
|
+
* `grouped: false` when NO row names an area, and callers render exactly the flat table they
|
|
14
|
+
* rendered before. The moment the field appears the grouping lights up with no CLI change.
|
|
15
|
+
*
|
|
16
|
+
* A row with an `area` and a row without it can coexist (an area-less issue is legal — the
|
|
17
|
+
* column is nullable since s2e5t1), so "some rows have it" still groups, with the area-less
|
|
18
|
+
* rows collected under one `(no area)` heading.
|
|
19
|
+
*/
|
|
20
|
+
/** The `area` block a workspace-scoped row carries: the same three fields everywhere. */
|
|
21
|
+
export interface RowArea {
|
|
22
|
+
id?: string | null;
|
|
23
|
+
slug?: string | null;
|
|
24
|
+
name?: string | null;
|
|
25
|
+
}
|
|
26
|
+
/** The only thing {@link groupByArea} needs of a row. */
|
|
27
|
+
export interface AreaScopedRow {
|
|
28
|
+
area?: RowArea | null;
|
|
29
|
+
}
|
|
30
|
+
export interface AreaGroup<T> {
|
|
31
|
+
/** Heading text: `Name (slug)`, or `(no area)` for the area-less bucket. */
|
|
32
|
+
label: string;
|
|
33
|
+
slug: string | null;
|
|
34
|
+
rows: T[];
|
|
35
|
+
}
|
|
36
|
+
export interface AreaGrouping<T> {
|
|
37
|
+
/**
|
|
38
|
+
* `false` when not one row named an area — the payload predates TS-95h9rj, or the listing
|
|
39
|
+
* is area-scoped and every row trivially belongs to the requested area. Callers must fall
|
|
40
|
+
* back to a flat table; `groups` then holds a single unlabelled group with every row.
|
|
41
|
+
*/
|
|
42
|
+
grouped: boolean;
|
|
43
|
+
groups: Array<AreaGroup<T>>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Fold rows into one group per area, in ARRIVAL order — the server already orders by area,
|
|
47
|
+
* so this preserves whatever ordering it applied inside an area rather than imposing one.
|
|
48
|
+
*/
|
|
49
|
+
export declare function groupByArea<T extends AreaScopedRow>(rows: T[]): AreaGrouping<T>;
|
|
50
|
+
/**
|
|
51
|
+
* Render a grouped listing: one table per area under a heading, or the plain table when the
|
|
52
|
+
* rows carry no area. `renderTable` stays the caller's business — every list has its own
|
|
53
|
+
* columns — so this owns only the headings and the spacing between them.
|
|
54
|
+
*/
|
|
55
|
+
export declare function printAreaGroups<T extends AreaScopedRow>(rows: T[], renderTable: (rows: T[]) => string, log?: (line: string) => void): boolean;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grouping list rows by area, for the workspace-scoped listings (TS-adanc8).
|
|
3
|
+
*
|
|
4
|
+
* `orbitmap tasks` solved this first: in workspace scope a flat table of rows from several
|
|
5
|
+
* areas is unreadable and, worse, unactionable — nothing tells you which `--area` a row
|
|
6
|
+
* needs. It grouped them under an `── Name (slug) ──` heading. Issues, ideas, vibes and
|
|
7
|
+
* documents have the same problem and now share this implementation instead of growing four
|
|
8
|
+
* more copies of the fold.
|
|
9
|
+
*
|
|
10
|
+
* **Degrades on purpose.** The `area` block only reaches the issue/idea payloads with
|
|
11
|
+
* TS-95h9rj (web-app); until then those rows carry no area at all. Rather than print an
|
|
12
|
+
* empty column or a UUID heading nobody can use, {@link groupByArea} reports
|
|
13
|
+
* `grouped: false` when NO row names an area, and callers render exactly the flat table they
|
|
14
|
+
* rendered before. The moment the field appears the grouping lights up with no CLI change.
|
|
15
|
+
*
|
|
16
|
+
* A row with an `area` and a row without it can coexist (an area-less issue is legal — the
|
|
17
|
+
* column is nullable since s2e5t1), so "some rows have it" still groups, with the area-less
|
|
18
|
+
* rows collected under one `(no area)` heading.
|
|
19
|
+
*/
|
|
20
|
+
/** True when the block carries something a human can read, not just an id. */
|
|
21
|
+
function isNamed(area) {
|
|
22
|
+
return Boolean(area && (area.slug || area.name));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fold rows into one group per area, in ARRIVAL order — the server already orders by area,
|
|
26
|
+
* so this preserves whatever ordering it applied inside an area rather than imposing one.
|
|
27
|
+
*/
|
|
28
|
+
export function groupByArea(rows) {
|
|
29
|
+
// An id-only `area` block is not enough: a heading reading `── 019fba02-… ──` is noise,
|
|
30
|
+
// and it is exactly what an unfinished provider-side rollout would produce.
|
|
31
|
+
if (!rows.some((row) => isNamed(row.area))) {
|
|
32
|
+
return { grouped: false, groups: [{ label: '', slug: null, rows: [...rows] }] };
|
|
33
|
+
}
|
|
34
|
+
const groups = [];
|
|
35
|
+
const byKey = new Map();
|
|
36
|
+
for (const row of rows) {
|
|
37
|
+
const area = isNamed(row.area) ? row.area : null;
|
|
38
|
+
const key = area?.slug ?? area?.id ?? '';
|
|
39
|
+
let group = byKey.get(key);
|
|
40
|
+
if (!group) {
|
|
41
|
+
group = {
|
|
42
|
+
label: area ? (area.slug ? `${area.name ?? area.slug} (${area.slug})` : `${area.name}`) : '(no area)',
|
|
43
|
+
slug: area?.slug ?? null,
|
|
44
|
+
rows: [],
|
|
45
|
+
};
|
|
46
|
+
byKey.set(key, group);
|
|
47
|
+
groups.push(group);
|
|
48
|
+
}
|
|
49
|
+
group.rows.push(row);
|
|
50
|
+
}
|
|
51
|
+
return { grouped: true, groups };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Render a grouped listing: one table per area under a heading, or the plain table when the
|
|
55
|
+
* rows carry no area. `renderTable` stays the caller's business — every list has its own
|
|
56
|
+
* columns — so this owns only the headings and the spacing between them.
|
|
57
|
+
*/
|
|
58
|
+
export function printAreaGroups(rows, renderTable, log = console.log) {
|
|
59
|
+
const { grouped, groups } = groupByArea(rows);
|
|
60
|
+
if (!grouped) {
|
|
61
|
+
log(renderTable(rows));
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
groups.forEach((group, index) => {
|
|
65
|
+
if (index > 0)
|
|
66
|
+
log('');
|
|
67
|
+
log(`── ${group.label} (${group.rows.length}) ──`);
|
|
68
|
+
log(renderTable(group.rows));
|
|
69
|
+
});
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=area-grouping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area-grouping.js","sourceRoot":"","sources":["../src/area-grouping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA+BH,8EAA8E;AAC9E,SAAS,OAAO,CAAC,IAAgC;IAC/C,OAAO,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAA0B,IAAS;IAC5D,wFAAwF;IACxF,4EAA4E;IAC5E,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,C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,IAAI,EAAE,MAAM,EAAE,CAAC;AACnC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAS,EACT,WAAkC,EAClC,MAA8B,OAAO,CAAC,GAAG;IAEzC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAE9C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC9B,IAAI,KAAK,GAAG,CAAC;YAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACvB,GAAG,CAAC,MAAM,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC;QACnD,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/commands/areas.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `orbitmap areas` — the areas this agent can reach.
|
|
3
|
+
*
|
|
4
|
+
* The last column used to be headed "Current" with a bare `*`, which reads as user state
|
|
5
|
+
* ("this is where I am working"). It is not: it is whichever area the resolution ladder
|
|
6
|
+
* happens to produce from the current directory, i.e. a technical default for fetching
|
|
7
|
+
* context (issue IS-vse335). It is now headed **"Resolves to"** and annotated with the
|
|
8
|
+
* rung that produced it, so the difference between "my project's config says so" and
|
|
9
|
+
* "a machine-wide leftover says so" is visible at a glance.
|
|
10
|
+
*/
|
|
1
11
|
import { createAdapter } from '../adapters/factory.js';
|
|
2
12
|
import { formatOutput, printError, formatTable } from '../output.js';
|
|
13
|
+
import { loadConfig } from '../config.js';
|
|
14
|
+
import { resolveArea } from '../workspace-resolve.js';
|
|
15
|
+
import { isStrongAreaSource } from '../write-target.js';
|
|
3
16
|
export async function areasCommand(options) {
|
|
4
17
|
try {
|
|
5
18
|
const client = await createAdapter();
|
|
@@ -13,17 +26,32 @@ export async function areasCommand(options) {
|
|
|
13
26
|
console.log('No areas found.');
|
|
14
27
|
return;
|
|
15
28
|
}
|
|
16
|
-
|
|
29
|
+
// `_current` is the server's answer to "which area did this request carry"; the rung
|
|
30
|
+
// is purely local, so it is resolved here rather than read off the response. The global
|
|
31
|
+
// config must be passed in explicitly — it is the (weak) rung this column exists to expose.
|
|
32
|
+
const source = resolveArea({ config: await loadConfig() }).source;
|
|
33
|
+
console.log(formatTable(['Name', 'Slug', 'Workspace', 'Role', 'Resolves to'], areas.map((a) => [
|
|
17
34
|
a.name,
|
|
18
35
|
a.slug,
|
|
19
36
|
a.workspace?.name ?? '',
|
|
20
37
|
a.role,
|
|
21
|
-
a._current ?
|
|
38
|
+
a._current ? `* ${sourceNote(source)}` : '',
|
|
22
39
|
])));
|
|
40
|
+
console.log('\n"Resolves to *" is where commands run from this directory land by default — a ' +
|
|
41
|
+
'resolution default, not a choice you made. Pass --area <slug> to target another ' +
|
|
42
|
+
'area; `orbitmap context` shows the directory → area map.');
|
|
23
43
|
}
|
|
24
44
|
catch (error) {
|
|
25
45
|
printError(error, options.json);
|
|
26
46
|
process.exitCode = 1;
|
|
27
47
|
}
|
|
28
48
|
}
|
|
49
|
+
/** Short parenthetical naming the rung, flagged when it is the weak machine-wide one. */
|
|
50
|
+
function sourceNote(source) {
|
|
51
|
+
if (!source)
|
|
52
|
+
return '';
|
|
53
|
+
return isStrongAreaSource(source)
|
|
54
|
+
? `(from ${source})`
|
|
55
|
+
: `(from ${source} — machine-wide default, not this project)`;
|
|
56
|
+
}
|
|
29
57
|
//# sourceMappingURL=areas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"areas.js","sourceRoot":"","sources":["../../src/commands/areas.ts"],"names":[],"mapp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AW,EAAE,MAAM,EAAE,aAAa,CAAC,EACpD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACf,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,SAAS,EAAE,IAAI,IAAI,EAAE;YACvB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;SAC5C,CAAC,CACH,CACF,CAAC;QACF,OAAO,CAAC,GAAG,CACT,kFAAkF;YAChF,kFAAkF;YAClF,0DAA0D,CAC7D,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,yFAAyF;AACzF,SAAS,UAAU,CAAC,MAA8B;IAChD,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,kBAAkB,CAAC,MAAM,CAAC;QAC/B,CAAC,CAAC,SAAS,MAAM,GAAG;QACpB,CAAC,CAAC,SAAS,MAAM,4CAA4C,CAAC;AAClE,CAAC"}
|
package/dist/commands/assign.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createAdapter } from '../adapters/factory.js';
|
|
2
|
+
import { confirmWriteTarget } from '../write-target.js';
|
|
2
3
|
import { objectPrefix } from '../id-resolve.js';
|
|
3
4
|
import { formatOutput, printError, printSuccess } from '../output.js';
|
|
4
5
|
const VALID_OBJECT_TYPES = ['task', 'issue', 'idea', 'intent'];
|
|
@@ -43,6 +44,7 @@ export async function assignCommand(objectId, agentId, options) {
|
|
|
43
44
|
process.exitCode = 1;
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
47
|
+
await confirmWriteTarget('assign', options);
|
|
46
48
|
const client = await createAdapter(options.area);
|
|
47
49
|
let assignment;
|
|
48
50
|
if (options.userId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assign.js","sourceRoot":"","sources":["../../src/commands/assign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEtE,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAGxE,4FAA4F;AAC5F,6FAA6F;AAC7F,6EAA6E;AAC7E,MAAM,eAAe,GAAqC;IACxD,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,QAAQ;CACb,CAAC;AAsBF,SAAS,UAAU,CAAC,QAAgB,EAAE,QAAiB;IACrD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,kBAAkB,CAAC,QAAQ,CAAC,QAA4B,CAAC;YAC9D,CAAC,CAAE,QAA6B;YAChC,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IACD,2FAA2F;IAC3F,6EAA6E;IAC7E,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACtC,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,eAAe,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAgB,EAChB,OAA2B,EAC3B,
|
|
1
|
+
{"version":3,"file":"assign.js","sourceRoot":"","sources":["../../src/commands/assign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE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AI,UAAU,KAAK,MAAM,EAAE,CAAC;YAC1B,MAAM,CAAC,GAAI,QAA+B,CAAC,IAAI,CAAC;YAChD,MAAM,GAAG,GAAG,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC;YACzE,YAAY,CAAC,oBAAoB,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAI,QAA+B,CAAC,IAAI,CAAC;YAChD,MAAM,GAAG,GAAG,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,iBAAiB,IAAI,EAAE,CAAC;YAC5D,YAAY,CACV,GAAG,UAAU,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,gBAAgB,GAAG,GAAG,EACvF,KAAK,CACN,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,99 @@
|
|
|
1
|
+
import { type AreaDirectoryMapping, type AreaSource, type OrbitMapMode, type WorkspaceSource } from '../workspace-resolve.js';
|
|
2
|
+
interface ContextResponse {
|
|
3
|
+
data: {
|
|
4
|
+
agent: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
};
|
|
9
|
+
area: {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
slug: string;
|
|
13
|
+
description: string | null;
|
|
14
|
+
git_url: string | null;
|
|
15
|
+
default_branch: string;
|
|
16
|
+
} | null;
|
|
17
|
+
/**
|
|
18
|
+
* The areas of the resolved workspace this agent can work in. Present only on the
|
|
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?: {
|
|
29
|
+
id: string;
|
|
30
|
+
display_number?: string;
|
|
31
|
+
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
|
+
slug: string;
|
|
52
|
+
type: string;
|
|
53
|
+
_shared: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The workspace this invocation is scoped to.
|
|
59
|
+
*
|
|
60
|
+
* Always emitted as an object, with nullable members rather than a null block: a consumer
|
|
61
|
+
* can read `workspace.slug` unconditionally.
|
|
62
|
+
*/
|
|
63
|
+
export interface ContextWorkspace {
|
|
64
|
+
/** Slug or uuid, whichever identified the workspace; never a path. */
|
|
65
|
+
slug: string | null;
|
|
66
|
+
/** Display name — only known when it can be read from a local `workspace.yml`. */
|
|
67
|
+
name: string | null;
|
|
68
|
+
/** Which rung of the workspace-identity ladder produced {@link ContextWorkspace.slug}. */
|
|
69
|
+
source: WorkspaceSource | null;
|
|
70
|
+
/** Absolute workspace directory; local mode only. */
|
|
71
|
+
path: string | null;
|
|
72
|
+
}
|
|
73
|
+
/** The `--json` payload: the adapter envelope plus the resolved local context. */
|
|
74
|
+
export interface ContextOutput extends ContextResponse {
|
|
75
|
+
workspace: ContextWorkspace;
|
|
76
|
+
/** Every directory → area mapping visible from `cwd`, deepest first. */
|
|
77
|
+
areas_map: AreaDirectoryMapping[];
|
|
78
|
+
/**
|
|
79
|
+
* The area commands actually target from this directory, or `null` (workspace scope).
|
|
80
|
+
*
|
|
81
|
+
* This is the *effective* area, not the raw ladder result: in local mode the workspace's
|
|
82
|
+
* own `default_area` (and the single-area fallback) outrank a leftover machine-wide
|
|
83
|
+
* `area`, so the ladder alone would name an area no command would use.
|
|
84
|
+
*/
|
|
85
|
+
resolved_area: string | null;
|
|
86
|
+
/**
|
|
87
|
+
* Rung of the area ladder that produced {@link ContextOutput.resolved_area}, or
|
|
88
|
+
* `'workspace-default'` when the local workspace overrode the ladder.
|
|
89
|
+
*/
|
|
90
|
+
area_source: AreaSource | 'workspace-default' | null;
|
|
91
|
+
mode: OrbitMapMode;
|
|
92
|
+
/** Directory the resolution ran from — what `resolved_area` is relative to. */
|
|
93
|
+
cwd: string;
|
|
94
|
+
}
|
|
1
95
|
export declare function contextCommand(options: {
|
|
2
96
|
json: boolean;
|
|
3
97
|
area?: string;
|
|
4
98
|
}): Promise<void>;
|
|
99
|
+
export {};
|
package/dist/commands/context.js
CHANGED
|
@@ -1,16 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `orbitmap context` — the primary context source for AI agents (intent IN-rwb5qu).
|
|
3
|
+
*
|
|
4
|
+
* On top of the server/adapter `/context` envelope (agent, area, active mission, tasks,
|
|
5
|
+
* documents) the command reports everything the *local* resolution knows, so that an agent
|
|
6
|
+
* never has to be told any of it out of band (CLAUDE.md and friends stay static):
|
|
7
|
+
*
|
|
8
|
+
* - which workspace this invocation is scoped to, and where its identity came from,
|
|
9
|
+
* - the full directory → area map visible from the current directory,
|
|
10
|
+
* - which area the current directory resolves to, and through which rung of the ladder.
|
|
11
|
+
*
|
|
12
|
+
* The `--json` field names `workspace`, `areas_map`, `resolved_area` and `area_source` are a
|
|
13
|
+
* contract: agents parse them, so they are additive and must stay stable. The historical
|
|
14
|
+
* `data` envelope is passed through untouched.
|
|
15
|
+
*/
|
|
16
|
+
import { LocalStore } from '../adapters/local/store.js';
|
|
1
17
|
import { createAdapter } from '../adapters/factory.js';
|
|
2
18
|
import { formatOutput, printError, formatTable } from '../output.js';
|
|
19
|
+
import { resolveAreaDirectoryMap, resolveWorkspaceContext, } from '../workspace-resolve.js';
|
|
20
|
+
/**
|
|
21
|
+
* Read the workspace display name from a local `workspace.yml`.
|
|
22
|
+
*
|
|
23
|
+
* Best effort: a missing or malformed file simply leaves the name unknown, because
|
|
24
|
+
* `orbitmap context` is exactly the command someone runs to find out why their setup is
|
|
25
|
+
* broken — it must not be the one that refuses to answer.
|
|
26
|
+
*/
|
|
27
|
+
async function readLocalWorkspaceIdentity(workspacePath) {
|
|
28
|
+
try {
|
|
29
|
+
const workspace = await new LocalStore(workspacePath).readWorkspace();
|
|
30
|
+
return { slug: workspace.slug || null, name: workspace.name || null };
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return { slug: null, name: null };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
3
36
|
export async function contextCommand(options) {
|
|
4
37
|
try {
|
|
5
38
|
const client = await createAdapter(options.area);
|
|
6
39
|
const response = (await client.getContext(options.area));
|
|
40
|
+
// Same ladder the adapter itself ran (pure file/env resolution, no network), re-read
|
|
41
|
+
// here so the command can report *why* it resolved the way it did.
|
|
42
|
+
const resolved = await resolveWorkspaceContext({ area: options.area });
|
|
43
|
+
const areasMap = resolveAreaDirectoryMap({
|
|
44
|
+
area: options.area,
|
|
45
|
+
config: resolved.config,
|
|
46
|
+
link: resolved.link,
|
|
47
|
+
});
|
|
48
|
+
const local = resolved.workspacePath
|
|
49
|
+
? await readLocalWorkspaceIdentity(resolved.workspacePath)
|
|
50
|
+
: { slug: null, name: null };
|
|
51
|
+
const workspace = {
|
|
52
|
+
slug: resolved.workspace ?? local.slug,
|
|
53
|
+
name: local.name,
|
|
54
|
+
source: resolved.workspaceSource ?? null,
|
|
55
|
+
path: resolved.workspacePath ?? null,
|
|
56
|
+
};
|
|
57
|
+
// The adapter is the ground truth for which area a command lands in: local mode lets
|
|
58
|
+
// `workspace.yml`'s `default_area` outrank a global-config area, so reporting the bare
|
|
59
|
+
// ladder result here would tell an agent it is in an area nothing else ever uses.
|
|
60
|
+
const effectiveArea = response.data.area?.slug ?? resolved.area ?? null;
|
|
61
|
+
const areaSource = effectiveArea === (resolved.area ?? null)
|
|
62
|
+
? (resolved.areaSource ?? null)
|
|
63
|
+
: 'workspace-default';
|
|
64
|
+
const output = {
|
|
65
|
+
...response,
|
|
66
|
+
workspace,
|
|
67
|
+
areas_map: areasMap,
|
|
68
|
+
resolved_area: effectiveArea,
|
|
69
|
+
area_source: areaSource,
|
|
70
|
+
mode: resolved.mode,
|
|
71
|
+
cwd: process.cwd(),
|
|
72
|
+
};
|
|
7
73
|
if (options.json) {
|
|
8
|
-
console.log(formatOutput(
|
|
74
|
+
console.log(formatOutput(output, true));
|
|
9
75
|
return;
|
|
10
76
|
}
|
|
11
|
-
const { agent, area, active_mission, tasks, documents } = response.data;
|
|
77
|
+
const { agent, area, areas, active_mission, open_intents, tasks, documents } = response.data;
|
|
12
78
|
console.log(`Agent: ${agent.name} (${agent.slug})`);
|
|
13
79
|
console.log(`ID: ${agent.id}`);
|
|
80
|
+
console.log(`\nWorkspace: ${formatWorkspace(workspace)}`);
|
|
81
|
+
if (workspace.source)
|
|
82
|
+
console.log(`Source: ${workspace.source}`);
|
|
83
|
+
if (workspace.path)
|
|
84
|
+
console.log(`Path: ${workspace.path}`);
|
|
85
|
+
console.log(`Mode: ${output.mode}`);
|
|
86
|
+
console.log(`\nResolved area: ${output.resolved_area
|
|
87
|
+
? `${output.resolved_area} (source: ${output.area_source ?? 'unknown'})`
|
|
88
|
+
: '(none) — workspace scope; pass --area <slug> for area-scoped commands'}`);
|
|
89
|
+
console.log(`Cwd: ${output.cwd}`);
|
|
14
90
|
if (area) {
|
|
15
91
|
console.log(`\nArea: ${area.name} (${area.slug})`);
|
|
16
92
|
console.log(`ID: ${area.id}`);
|
|
@@ -20,12 +96,26 @@ export async function contextCommand(options) {
|
|
|
20
96
|
console.log(`Git: ${area.git_url}`);
|
|
21
97
|
console.log(`Branch: ${area.default_branch}`);
|
|
22
98
|
}
|
|
99
|
+
// Printed even when an area did resolve: knowing the sibling areas is what stops an
|
|
100
|
+
// agent from listing them separately, which is the behaviour this whole pivot removes.
|
|
101
|
+
if (areas && areas.length > 0) {
|
|
102
|
+
console.log(`\nAreas in this workspace (${areas.length}):`);
|
|
103
|
+
for (const a of areas) {
|
|
104
|
+
console.log(` ${a.slug.padEnd(24)} ${a.name} (${a.role})`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
23
107
|
if (active_mission) {
|
|
24
108
|
const number = active_mission.display_number
|
|
25
109
|
? `${active_mission.display_number} `
|
|
26
110
|
: '';
|
|
27
111
|
console.log(`\nActive mission: ${number}${active_mission.name} [${active_mission.status}]`);
|
|
28
112
|
}
|
|
113
|
+
if (open_intents && open_intents.length > 0) {
|
|
114
|
+
console.log(`\nOpen intents (${open_intents.length}):`);
|
|
115
|
+
for (const intent of open_intents) {
|
|
116
|
+
console.log(` ${intent.number.padEnd(12)} ${intent.name} [${intent.status}]`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
29
119
|
if (tasks.length > 0) {
|
|
30
120
|
console.log(`\nActive tasks (${tasks.length}):`);
|
|
31
121
|
console.log(formatTable(['#', 'Title', 'Status', 'Priority'], tasks.map((t) => [t.display_number ?? t.task_number, t.title, t.status, t.priority])));
|
|
@@ -34,10 +124,22 @@ export async function contextCommand(options) {
|
|
|
34
124
|
console.log(`\nDocuments (${documents.length}):`);
|
|
35
125
|
console.log(formatTable(['Title', 'Type', 'Shared'], documents.map((d) => [d.title, d.type, d._shared ? 'yes' : ''])));
|
|
36
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
|
+
}
|
|
37
134
|
}
|
|
38
135
|
catch (error) {
|
|
39
136
|
printError(error, options.json);
|
|
40
137
|
process.exitCode = 1;
|
|
41
138
|
}
|
|
42
139
|
}
|
|
140
|
+
function formatWorkspace(workspace) {
|
|
141
|
+
if (workspace.name && workspace.slug)
|
|
142
|
+
return `${workspace.name} (${workspace.slug})`;
|
|
143
|
+
return workspace.name ?? workspace.slug ?? '(not resolved)';
|
|
144
|
+
}
|
|
43
145
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;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;AAqFjC;;;;;;GAMG;AACH,KAAK,UAAU,0BAA0B,CACvC,aAAqB;IAErB,IAAI,CAAC;QACH,MAAM,SAAS,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ands/create.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { createAdapter } from '../adapters/factory.js';
|
|
2
|
-
import {
|
|
2
|
+
import { confirmWriteTarget } from '../write-target.js';
|
|
3
3
|
import { formatOutput, printError, printSuccess } from '../output.js';
|
|
4
4
|
export async function createCommand(title, options) {
|
|
5
5
|
try {
|
|
6
|
+
await confirmWriteTarget('create task', options);
|
|
6
7
|
const client = await createAdapter(options.area);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
sourceIssueId = options.fromIssue;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
8
|
+
// Every object reference below — the issue, the intent, the orbit, the agent — travels
|
|
9
|
+
// VERBATIM. `POST /tasks` validates `source_issue_id`, `intent_id`, `orbit_id` and
|
|
10
|
+
// `agent_id` with `App\Rules\EntityRef` (shape only) and resolves the uuid / display
|
|
11
|
+
// number / bare code / slug server-side (TS-av6332), answering 404 ISSUE_NOT_FOUND,
|
|
12
|
+
// INTENT_NOT_FOUND, ORBIT_NOT_FOUND or AGENT_NOT_FOUND when the reference is unknown.
|
|
13
|
+
// Resolving any of them here would duplicate server logic and cost an extra round trip —
|
|
14
|
+
// which is exactly what `--from-issue` used to pay for a `GET /issues/{id_or_number}`.
|
|
17
15
|
const response = (await client.createTask({
|
|
18
16
|
title,
|
|
19
17
|
description: options.desc,
|
|
@@ -23,7 +21,7 @@ export async function createCommand(title, options) {
|
|
|
23
21
|
agent_id: options.agentId,
|
|
24
22
|
branch_name: options.branch,
|
|
25
23
|
agent_instructions: options.instructions,
|
|
26
|
-
source_issue_id:
|
|
24
|
+
source_issue_id: options.fromIssue,
|
|
27
25
|
intent_id: options.intent,
|
|
28
26
|
orbit_id: options.orbit,
|
|
29
27
|
}));
|
|
@@ -33,8 +31,15 @@ export async function createCommand(title, options) {
|
|
|
33
31
|
}
|
|
34
32
|
const d = response.data;
|
|
35
33
|
let msg = `Task created: ${d.title} [${d.display_number ?? d.task_number}] (${d.status}, ${d.priority})`;
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
// Whether the link happened is the server's answer, not an inference from the flag: when
|
|
35
|
+
// `--from-issue` names an issue outside the target area the task is still created (201)
|
|
36
|
+
// with `source_issue_linked: false` and a warning. Reporting "Linked to issue …" off the
|
|
37
|
+
// flag alone would claim a link that does not exist.
|
|
38
|
+
if (d.source_issue_linked) {
|
|
39
|
+
msg += `\nLinked to issue ${d.source_issue_number ?? options.fromIssue} (now investigating)`;
|
|
40
|
+
}
|
|
41
|
+
if (d.source_issue_warning) {
|
|
42
|
+
msg += `\nWarning: ${d.source_issue_warning}`;
|
|
38
43
|
}
|
|
39
44
|
if (d._warnings?.length) {
|
|
40
45
|
for (const w of d._warnings) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.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,MAAM,cAAc,CAAC;AAoBtE,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAa,EACb,OAcC;IAED,IAAI,CAAC;QACH,MAAM,kBAAkB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEjD,uFAAuF;QACvF,mFAAmF;QACnF,qFAAqF;QACrF,oFAAoF;QACpF,sFAAsF;QACtF,yFAAyF;QACzF,uFAAuF;QACvF,MAA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EAAE,CAAC;gBAC5B,GAAG,IAAI,cAAc,CAAC,EAAE,CAAC;YAC3B,CAAC;QACH,CAAC;QACD,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
package/dist/commands/dep.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { createAdapter } from '../adapters/factory.js';
|
|
2
|
-
import {
|
|
2
|
+
import { confirmWriteTarget } from '../write-target.js';
|
|
3
|
+
import { formatOutput, printError, printSuccess, printValidationError } from '../output.js';
|
|
3
4
|
const VALID_DEP_TYPES = ['depends_on', 'related'];
|
|
4
5
|
// ── Commands ──
|
|
5
6
|
export async function depAddCommand(taskId, targetTaskId, options) {
|
|
6
7
|
const depType = options.type ?? 'depends_on';
|
|
7
8
|
if (!VALID_DEP_TYPES.includes(depType)) {
|
|
8
9
|
const msg = `Invalid dependency type "${depType}". Valid: ${VALID_DEP_TYPES.join(', ')}`;
|
|
9
|
-
|
|
10
|
-
console.error(JSON.stringify({ error: { message: msg } }));
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
console.error(`Error: ${msg}`);
|
|
14
|
-
}
|
|
15
|
-
process.exitCode = 1;
|
|
10
|
+
printValidationError(msg, options.json);
|
|
16
11
|
return;
|
|
17
12
|
}
|
|
18
13
|
try {
|
|
14
|
+
await confirmWriteTarget('add task dependency', options, 'existing');
|
|
19
15
|
const client = await createAdapter(options.area);
|
|
20
16
|
const response = (await client.addTaskDependency(taskId, {
|
|
21
17
|
target_task_id: targetTaskId,
|
|
@@ -35,6 +31,7 @@ export async function depAddCommand(taskId, targetTaskId, options) {
|
|
|
35
31
|
}
|
|
36
32
|
export async function depRemoveCommand(taskId, targetTaskId, options) {
|
|
37
33
|
try {
|
|
34
|
+
await confirmWriteTarget('remove task dependency', options, 'existing');
|
|
38
35
|
const client = await createAdapter(options.area);
|
|
39
36
|
const response = await client.removeTaskDependency(taskId, targetTaskId, options.type);
|
|
40
37
|
if (options.json) {
|
package/dist/commands/dep.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dep.js","sourceRoot":"","sources":["../../src/commands/dep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"dep.js","sourceRoot":"","sources":["../../src/commands/dep.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,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAuB5F,MAAM,eAAe,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAElD,iBAAiB;AAEjB,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,YAAoB,EACpB,OAKC;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,YAAY,CAAC;IAE7C,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,MAAM,GAAG,GAAG,4BAA4B,OAAO,aAAa,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACzF,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACxC,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,MAAM,kBAAkB,CAAC,qBAAqB,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,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