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.
Files changed (156) hide show
  1. package/README.md +60 -13
  2. package/dist/adapters/cloud.d.ts +53 -21
  3. package/dist/adapters/cloud.js +95 -29
  4. package/dist/adapters/cloud.js.map +1 -1
  5. package/dist/adapters/factory.d.ts +3 -0
  6. package/dist/adapters/factory.js +8 -1
  7. package/dist/adapters/factory.js.map +1 -1
  8. package/dist/adapters/local/adapter.d.ts +0 -20
  9. package/dist/adapters/local/adapter.js +0 -18
  10. package/dist/adapters/local/adapter.js.map +1 -1
  11. package/dist/adapters/local/context.d.ts +1 -1
  12. package/dist/adapters/local/context.js +10 -2
  13. package/dist/adapters/local/context.js.map +1 -1
  14. package/dist/adapters/local/entities/tasks.d.ts +9 -1
  15. package/dist/adapters/local/entities/tasks.js +47 -5
  16. package/dist/adapters/local/entities/tasks.js.map +1 -1
  17. package/dist/adapters/local/entities/work-items.d.ts +14 -30
  18. package/dist/adapters/local/entities/work-items.js +63 -47
  19. package/dist/adapters/local/entities/work-items.js.map +1 -1
  20. package/dist/adapters/local/rules.d.ts +4 -4
  21. package/dist/adapters/local/rules.js +4 -19
  22. package/dist/adapters/local/rules.js.map +1 -1
  23. package/dist/adapters/local/shapes.d.ts +27 -7
  24. package/dist/adapters/local/shapes.js +41 -5
  25. package/dist/adapters/local/shapes.js.map +1 -1
  26. package/dist/adapters/local/store.d.ts +55 -6
  27. package/dist/adapters/local/store.js +122 -8
  28. package/dist/adapters/local/store.js.map +1 -1
  29. package/dist/adapters/local/types.d.ts +9 -2
  30. package/dist/adapters/local/types.js +9 -2
  31. package/dist/adapters/local/types.js.map +1 -1
  32. package/dist/adapters/types.d.ts +7 -20
  33. package/dist/agent-instructions.d.ts +21 -8
  34. package/dist/agent-instructions.js +91 -35
  35. package/dist/agent-instructions.js.map +1 -1
  36. package/dist/area-directories.d.ts +75 -0
  37. package/dist/area-directories.js +162 -0
  38. package/dist/area-directories.js.map +1 -0
  39. package/dist/area-grouping.d.ts +55 -0
  40. package/dist/area-grouping.js +72 -0
  41. package/dist/area-grouping.js.map +1 -0
  42. package/dist/commands/areas.js +30 -2
  43. package/dist/commands/areas.js.map +1 -1
  44. package/dist/commands/assign.d.ts +1 -0
  45. package/dist/commands/assign.js +2 -0
  46. package/dist/commands/assign.js.map +1 -1
  47. package/dist/commands/context.d.ts +95 -0
  48. package/dist/commands/context.js +104 -2
  49. package/dist/commands/context.js.map +1 -1
  50. package/dist/commands/create.d.ts +1 -0
  51. package/dist/commands/create.js +19 -14
  52. package/dist/commands/create.js.map +1 -1
  53. package/dist/commands/dep.js +5 -8
  54. package/dist/commands/dep.js.map +1 -1
  55. package/dist/commands/doc-import.d.ts +1 -0
  56. package/dist/commands/doc-import.js +8 -26
  57. package/dist/commands/doc-import.js.map +1 -1
  58. package/dist/commands/doc-patch.js +16 -52
  59. package/dist/commands/doc-patch.js.map +1 -1
  60. package/dist/commands/doc-share.js +4 -0
  61. package/dist/commands/doc-share.js.map +1 -1
  62. package/dist/commands/doc-update.js +4 -8
  63. package/dist/commands/doc-update.js.map +1 -1
  64. package/dist/commands/doc.js +7 -12
  65. package/dist/commands/doc.js.map +1 -1
  66. package/dist/commands/docs-cache.js +23 -10
  67. package/dist/commands/docs-cache.js.map +1 -1
  68. package/dist/commands/docs.js +29 -10
  69. package/dist/commands/docs.js.map +1 -1
  70. package/dist/commands/get.js +4 -10
  71. package/dist/commands/get.js.map +1 -1
  72. package/dist/commands/ideas.d.ts +3 -1
  73. package/dist/commands/ideas.js +26 -49
  74. package/dist/commands/ideas.js.map +1 -1
  75. package/dist/commands/init.d.ts +24 -1
  76. package/dist/commands/init.js +0 -0
  77. package/dist/commands/init.js.map +1 -1
  78. package/dist/commands/intent.js +10 -14
  79. package/dist/commands/intent.js.map +1 -1
  80. package/dist/commands/issues.d.ts +3 -1
  81. package/dist/commands/issues.js +47 -72
  82. package/dist/commands/issues.js.map +1 -1
  83. package/dist/commands/log.d.ts +1 -0
  84. package/dist/commands/log.js +18 -17
  85. package/dist/commands/log.js.map +1 -1
  86. package/dist/commands/mission.js +3 -12
  87. package/dist/commands/mission.js.map +1 -1
  88. package/dist/commands/orbit.d.ts +7 -1
  89. package/dist/commands/orbit.js +13 -24
  90. package/dist/commands/orbit.js.map +1 -1
  91. package/dist/commands/setup-agent.d.ts +97 -4
  92. package/dist/commands/setup-agent.js +265 -38
  93. package/dist/commands/setup-agent.js.map +1 -1
  94. package/dist/commands/setup-mcp.d.ts +2 -0
  95. package/dist/commands/setup-mcp.js +17 -40
  96. package/dist/commands/setup-mcp.js.map +1 -1
  97. package/dist/commands/start.d.ts +43 -0
  98. package/dist/commands/start.js +158 -3
  99. package/dist/commands/start.js.map +1 -1
  100. package/dist/commands/status.d.ts +1 -0
  101. package/dist/commands/status.js +5 -15
  102. package/dist/commands/status.js.map +1 -1
  103. package/dist/commands/subtask.d.ts +1 -0
  104. package/dist/commands/subtask.js +9 -2
  105. package/dist/commands/subtask.js.map +1 -1
  106. package/dist/commands/task-edit-content.js +4 -8
  107. package/dist/commands/task-edit-content.js.map +1 -1
  108. package/dist/commands/task.d.ts +7 -0
  109. package/dist/commands/task.js +5 -2
  110. package/dist/commands/task.js.map +1 -1
  111. package/dist/commands/tasks.d.ts +35 -0
  112. package/dist/commands/tasks.js +45 -9
  113. package/dist/commands/tasks.js.map +1 -1
  114. package/dist/commands/vibes.d.ts +3 -1
  115. package/dist/commands/vibes.js +41 -31
  116. package/dist/commands/vibes.js.map +1 -1
  117. package/dist/config.d.ts +11 -0
  118. package/dist/config.js +14 -1
  119. package/dist/config.js.map +1 -1
  120. package/dist/doc-cache.d.ts +74 -5
  121. package/dist/doc-cache.js +106 -22
  122. package/dist/doc-cache.js.map +1 -1
  123. package/dist/enums.d.ts +26 -0
  124. package/dist/enums.js +53 -0
  125. package/dist/enums.js.map +1 -0
  126. package/dist/errors.d.ts +67 -0
  127. package/dist/errors.js +82 -0
  128. package/dist/errors.js.map +1 -1
  129. package/dist/index.js +134 -56
  130. package/dist/index.js.map +1 -1
  131. package/dist/mcp-config.d.ts +42 -1
  132. package/dist/mcp-config.js +82 -2
  133. package/dist/mcp-config.js.map +1 -1
  134. package/dist/oauth.js +10 -10
  135. package/dist/output.d.ts +12 -0
  136. package/dist/output.js +39 -1
  137. package/dist/output.js.map +1 -1
  138. package/dist/paths.d.ts +40 -0
  139. package/dist/paths.js +174 -9
  140. package/dist/paths.js.map +1 -1
  141. package/dist/project-config.d.ts +42 -1
  142. package/dist/project-config.js +51 -0
  143. package/dist/project-config.js.map +1 -1
  144. package/dist/workspace-resolve.d.ts +179 -9
  145. package/dist/workspace-resolve.js +288 -20
  146. package/dist/workspace-resolve.js.map +1 -1
  147. package/dist/write-target.d.ts +56 -0
  148. package/dist/write-target.js +170 -0
  149. package/dist/write-target.js.map +1 -0
  150. package/package.json +1 -1
  151. package/dist/commands/create-project.d.ts +0 -6
  152. package/dist/commands/create-project.js +0 -28
  153. package/dist/commands/create-project.js.map +0 -1
  154. package/dist/commands/projects.d.ts +0 -3
  155. package/dist/commands/projects.js +0 -28
  156. package/dist/commands/projects.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
- import { dirname, isAbsolute, join, resolve } from 'node:path';
2
+ import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
3
3
  import { loadConfig } from './config.js';
4
4
  import { OrbitMapAPIError } from './errors.js';
5
5
  import { CONFIG_FILENAME, globalConfigReadPath, ORBITMAP_DIR } from './paths.js';
@@ -26,6 +26,21 @@ export function setWorkspaceFlag(value) {
26
26
  export function getWorkspaceFlag() {
27
27
  return workspaceFlag;
28
28
  }
29
+ /**
30
+ * Value of the global `--workspace-id <slug-or-uuid>` flag.
31
+ *
32
+ * Deliberately a **different** flag from `--workspace <path>`, which keeps its historical
33
+ * meaning (the local workspace *directory*, and therefore local mode). `--workspace-id`
34
+ * names a workspace in the OrbitMap backend and changes nothing about the mode; the two
35
+ * never trade places. Captured program-level in `src/index.ts`, like `--workspace`.
36
+ */
37
+ let workspaceIdFlag;
38
+ export function setWorkspaceIdFlag(value) {
39
+ workspaceIdFlag = value && value.length > 0 ? value : undefined;
40
+ }
41
+ export function getWorkspaceIdFlag() {
42
+ return workspaceIdFlag;
43
+ }
29
44
  /**
30
45
  * Walk up from `startDir` to the filesystem root looking for `.orbitmap/link.json`
31
46
  * (same discovery behaviour as git). Returns the nearest one, or `undefined`.
@@ -65,12 +80,39 @@ export function findWorkspaceDir(startDir = process.cwd()) {
65
80
  dir = parent;
66
81
  }
67
82
  }
83
+ /**
84
+ * Parse and validate a raw `link.json` object — **per field**, like `parseConfig`: a
85
+ * mistyped `area` must not stop the `workspace` pointer next to it from working, and a
86
+ * single bad entry in {@link WorkspaceLink.areas} must not discard the rest of the map.
87
+ * Unknown keys are not represented here; nothing in the CLI rewrites this file wholesale.
88
+ */
89
+ export function parseWorkspaceLink(raw) {
90
+ if (typeof raw !== 'object' || raw === null || Array.isArray(raw))
91
+ return undefined;
92
+ const r = raw;
93
+ const link = {};
94
+ if (typeof r['workspace'] === 'string' && r['workspace'])
95
+ link.workspace = r['workspace'];
96
+ if (typeof r['area'] === 'string' && r['area'])
97
+ link.area = r['area'];
98
+ const rawAreas = r['areas'];
99
+ if (typeof rawAreas === 'object' && rawAreas !== null && !Array.isArray(rawAreas)) {
100
+ const areas = {};
101
+ for (const [slug, path] of Object.entries(rawAreas)) {
102
+ if (!slug.trim())
103
+ continue;
104
+ if (typeof path !== 'string' || !path)
105
+ continue;
106
+ areas[slug] = path;
107
+ }
108
+ if (Object.keys(areas).length > 0)
109
+ link.areas = areas;
110
+ }
111
+ return link;
112
+ }
68
113
  function readLinkFile(file) {
69
114
  try {
70
- const parsed = JSON.parse(readFileSync(file, 'utf-8'));
71
- if (typeof parsed !== 'object' || parsed === null)
72
- return undefined;
73
- return parsed;
115
+ return parseWorkspaceLink(JSON.parse(readFileSync(file, 'utf-8')));
74
116
  }
75
117
  catch {
76
118
  return undefined;
@@ -190,14 +232,135 @@ function warnRelativeWorkspacePath(configured) {
190
232
  'be an absolute path. A relative one would mean a different directory in every ' +
191
233
  'project. Use --workspace or ORBITMAP_WORKSPACE for a per-invocation override.');
192
234
  }
235
+ /** Case-folded on Windows, whose filesystem is case-insensitive; lexical otherwise. */
236
+ function comparablePath(path) {
237
+ const out = resolve(path);
238
+ return process.platform === 'win32' ? out.toLowerCase() : out;
239
+ }
240
+ /**
241
+ * True when `child` is `dir` itself or lives underneath it. Segment-wise (via `relative`)
242
+ * rather than a string prefix, so `/repo/app` does not swallow `/repo/app-legacy`, and
243
+ * case-folded on win32 via {@link comparablePath}, where `C:\Work\Repo` and `c:\work\repo`
244
+ * are one directory.
245
+ *
246
+ * Exported because `init` asks the same question about the same paths on the write side. It
247
+ * had grown its own weaker copy — no case-fold, and a `/^[a-zA-Z]:/` test on the *relative*
248
+ * result standing in for "different drive" — under which a root recorded as `C:\Work\Repo`
249
+ * did not contain `c:\work\repo\pkg`, so `init` silently laid down a second, competing
250
+ * `areas` map for the same workspace (TS-5c4yg9). One question, one answer.
251
+ */
252
+ export function isWithin(dir, child) {
253
+ const rel = relative(comparablePath(dir), comparablePath(child));
254
+ return rel === '' || (!rel.startsWith('..') && !isAbsolute(rel));
255
+ }
256
+ /**
257
+ * Every directory → area mapping visible from `cwd`, **deepest first** (so the first match is
258
+ * the most specific one, exactly like the nearest-file rule everywhere else).
259
+ *
260
+ * Two sources, both schema v2, pointing in opposite directions on purpose:
261
+ *
262
+ * - `OrbitMapConfig.areas` (directory → slug) from the nearest `.orbitmap/config.json` that
263
+ * **sets `areas`** (per-field walk-up, ADR 0002 §2). Its keys are relative to the parent of
264
+ * the `.orbitmap` directory holding that file — the workspace/project root — so they mean
265
+ * the same thing in every checkout, which is why that file is the committable one.
266
+ * - `WorkspaceLink.areas` (slug → directory) from the nearest `.orbitmap/link.json`, for
267
+ * areas whose code sits *outside* the tree. Absolute, or relative to the link file itself.
268
+ *
269
+ * Purely lexical: no directory is required to exist. Used both by the `cwd-map` rung of
270
+ * {@link resolveArea} and by the `AREA_CONTEXT_REQUIRED` details, so the error always lists
271
+ * exactly the directories that would have resolved an area.
272
+ */
273
+ export function resolveAreaDirectoryMap(options = {}) {
274
+ const cwd = resolve(options.cwd ?? process.cwd());
275
+ const mappings = [];
276
+ // A map declared above the workspace boundary describes another workspace's areas
277
+ // (IS-e6q7je) — it must neither resolve an area nor be offered as a way out.
278
+ const boundary = workspaceBoundary(cwd);
279
+ const configAreas = resolveProjectConfigField('areas', cwd);
280
+ if (configAreas && withinWorkspace(boundary, configAreas.file)) {
281
+ // <root>/.orbitmap/config.json → <root>; `"."` is that root.
282
+ const root = dirname(dirname(configAreas.file));
283
+ for (const [dir, area] of Object.entries(configAreas.value)) {
284
+ mappings.push({ area, dir: dir === '.' ? root : resolve(root, dir), from: 'config' });
285
+ }
286
+ }
287
+ const found = options.link !== undefined ? options.link : findLinkFile(cwd);
288
+ if (found?.link.areas && withinWorkspace(boundary, found.file)) {
289
+ const linkDir = dirname(found.file);
290
+ for (const [area, dir] of Object.entries(found.link.areas)) {
291
+ mappings.push({
292
+ area,
293
+ dir: isAbsolute(dir) ? resolve(dir) : resolve(linkDir, dir),
294
+ from: 'link',
295
+ });
296
+ }
297
+ }
298
+ // Stable sort: deeper paths first, config before link on a tie (the committed file is the
299
+ // shared truth; the machine-local one only ever *adds* out-of-tree areas).
300
+ return mappings
301
+ .map((mapping, index) => ({ mapping, index }))
302
+ .sort((a, b) => {
303
+ const depth = b.mapping.dir.length - a.mapping.dir.length;
304
+ return depth !== 0 ? depth : a.index - b.index;
305
+ })
306
+ .map((entry) => entry.mapping);
307
+ }
308
+ /**
309
+ * Root directory of the workspace this invocation belongs to, or `undefined` when no config
310
+ * file names one (IS-e6q7je).
311
+ *
312
+ * The per-field walk-up (ADR 0002 §2) resolves `workspace` and `area` **independently**, which
313
+ * is right inside one tree — a package that pins only `agent` still inherits the root's
314
+ * `area`. Across trees it is not: a directory whose own `.orbitmap/config.json` says
315
+ * `workspace: "mcp-test"` nested under a checkout whose config says `area: "orbitmap-app"`
316
+ * used to resolve to the pair (workspace `mcp-test`, area `orbitmap-app`) — an area that
317
+ * belongs to a *different* workspace, so every command 404'd with `AREA_NOT_FOUND`.
318
+ *
319
+ * The file that names the workspace is therefore the boundary: an area may only be named by
320
+ * that file or by one below it. Nothing changes for a tree where no config sets `workspace` —
321
+ * there is no boundary to cross, and the ladder runs exactly as before.
322
+ */
323
+ function workspaceBoundary(cwd) {
324
+ const declared = resolveProjectConfigField('workspace', cwd);
325
+ // <root>/.orbitmap/config.json → <root>
326
+ return declared ? dirname(dirname(declared.file)) : undefined;
327
+ }
328
+ /**
329
+ * True when a `.orbitmap/<file>` may speak for the workspace rooted at `boundary` — i.e. it
330
+ * sits at that root or below it. No boundary ⇒ every file qualifies.
331
+ */
332
+ function withinWorkspace(boundary, file) {
333
+ if (!boundary)
334
+ return true;
335
+ return isWithin(boundary, dirname(dirname(file)));
336
+ }
337
+ /** The area whose mapped directory contains `cwd`, if any. */
338
+ function resolveAreaFromCwd(options) {
339
+ const cwd = resolve(options.cwd ?? process.cwd());
340
+ return resolveAreaDirectoryMap(options).find((mapping) => isWithin(mapping.dir, cwd))?.area;
341
+ }
193
342
  /**
194
343
  * Area resolution (ADR 0002, extending spec §3.3), explicit sources only:
195
344
  * `--area` → `ORBITMAP_AREA` → `link.json.area` → nearest `.orbitmap/config.json`
196
- * **that sets `area`** **[ADR 0002]** → global config `area` (deprecated).
345
+ * **that sets `area`** **[ADR 0002]** → **cwd matched against the `areas` directory map**
346
+ * (schema v2) → global config `area` (deprecated).
197
347
  *
198
348
  * The project-config rung is per-field (`resolveProjectConfigField`): a nested config that
199
349
  * sets only `agent` does not hide an `area` pinned by the repository root.
200
350
  *
351
+ * Every file-reading rung is bounded by {@link workspaceBoundary}: the config that names the
352
+ * `workspace` is the furthest ancestor allowed to name the area, because an area named above
353
+ * it belongs to another workspace (IS-e6q7je). The machine-wide `config` rung is left alone —
354
+ * it is already deprecated and warns on use.
355
+ *
356
+ * The `cwd-map` rung is what lets one workspace cover a whole monorepo without a config file
357
+ * in every package: the workspace's `config.json` says which directory is which area, and the
358
+ * current directory picks one (deepest mapping wins — see {@link resolveAreaDirectoryMap}).
359
+ * It sits *below* the `area` field on purpose, so a per-directory marker — a
360
+ * `.orbitmap/config.json` holding nothing but `area`, which is all schema v2 needs to pin one
361
+ * directory — still overrides the map, and every pre-v2 config that pins `area` keeps
362
+ * behaving exactly as it did.
363
+ *
201
364
  * The two remaining rungs — the workspace's own `workspace.yml` `default_area` (which
202
365
  * sits *between* the project config and the global config) and "workspace has exactly one
203
366
  * area → auto-select it" — require reading the workspace tree and therefore live in the
@@ -212,14 +375,26 @@ export function resolveArea(options = {}) {
212
375
  if (env)
213
376
  return { area: env, source: 'env' };
214
377
  const cwd = resolve(options.cwd ?? process.cwd());
378
+ // Everything below reads a file, and a file above the workspace boundary names an area of
379
+ // a different workspace (IS-e6q7je). No config sets `workspace` ⇒ no boundary ⇒ unchanged.
380
+ const boundary = workspaceBoundary(cwd);
215
381
  const found = options.link !== undefined ? options.link : findLinkFile(cwd);
216
- if (found?.link.area)
382
+ if (found?.link.area && withinWorkspace(boundary, found.file)) {
217
383
  return { area: found.link.area, source: 'link' };
218
- const projectArea = resolveProjectConfigField('area', cwd)?.value;
219
- if (projectArea)
220
- return { area: projectArea, source: 'project-config' };
384
+ }
385
+ const projectArea = resolveProjectConfigField('area', cwd);
386
+ if (projectArea && withinWorkspace(boundary, projectArea.file)) {
387
+ return { area: projectArea.value, source: 'project-config' };
388
+ }
389
+ const mapped = resolveAreaFromCwd({ ...options, cwd, link: found });
390
+ if (mapped)
391
+ return { area: mapped, source: 'cwd-map' };
392
+ // The machine-wide rung is bounded too, and for the same reason: a slug written once in
393
+ // `~/.orbitmap/config.json` cannot be known to name an area of *this* workspace, and when a
394
+ // project has declared which workspace it is, taking it anyway reproduces IS-e6q7je one rung
395
+ // lower. Without a declared workspace it stays exactly as it was (deprecated, warned).
221
396
  const configured = options.config?.area;
222
- if (configured) {
397
+ if (configured && !boundary) {
223
398
  warnDeprecatedGlobalArea();
224
399
  return { area: configured, source: 'config' };
225
400
  }
@@ -249,13 +424,102 @@ export function resolveAreaSlug(options = {}) {
249
424
  /**
250
425
  * Assert that an area was resolved. Adapters call this after their own last-resort
251
426
  * auto-selection; `availableAreas` (when known) is surfaced in the error details.
427
+ *
428
+ * Missing area context is **not** a global error — most of the CLI (missions, intents, the
429
+ * workspace-level document tree) works without one, so `resolveWorkspaceContext` returns
430
+ * `scope: 'workspace'` rather than throwing. Only the operations that genuinely need an area
431
+ * come here, which is why the details carry `mapped_directories`: when an area exists but the
432
+ * current directory is not inside it, the fix is to `cd` into one of the listed directories
433
+ * (or pass `--area`), and the error is the only place that can say which ones those are.
434
+ *
435
+ * `options` scopes that lookup; omitted, it is computed from `process.cwd()` — the right
436
+ * answer for a real invocation, and what lets callers deep in the adapters (which have no
437
+ * `ResolveOptions` of their own) still produce a useful error.
252
438
  */
253
- export function requireArea(area, availableAreas) {
439
+ export function requireArea(area, availableAreas, options) {
254
440
  if (area)
255
441
  return area;
256
- throw OrbitMapAPIError.areaContextRequired(undefined, availableAreas && availableAreas.length > 0
257
- ? { available_areas: availableAreas }
258
- : undefined);
442
+ const details = {};
443
+ if (availableAreas && availableAreas.length > 0)
444
+ details['available_areas'] = availableAreas;
445
+ const mapped = resolveAreaDirectoryMap(options ?? {});
446
+ if (mapped.length > 0) {
447
+ details['mapped_directories'] = mapped.map(({ area: slug, dir }) => ({ area: slug, dir }));
448
+ }
449
+ throw OrbitMapAPIError.areaContextRequired(areaContextMessage(availableAreas, mapped), Object.keys(details).length > 0 ? details : undefined);
450
+ }
451
+ /**
452
+ * The `AREA_CONTEXT_REQUIRED` message, written around the areas of the *current* workspace
453
+ * (TS-jt6q36).
454
+ *
455
+ * "Pass --area <slug>" is only useful to someone who already knows the slugs; the two places
456
+ * that do know them are the workspace itself (`availableAreas`, handed in by the adapter)
457
+ * and the committed `areas` map in `.orbitmap/config.json` (`mapped`). Naming them turns the
458
+ * error into an instruction. Falls back to the generic wording when this invocation can see
459
+ * neither — a bare cloud client outside any project directory.
460
+ */
461
+ function areaContextMessage(availableAreas, mapped) {
462
+ const slugs = [
463
+ ...new Set([...(availableAreas ?? []), ...mapped.map((entry) => entry.area)]),
464
+ ];
465
+ if (slugs.length === 0)
466
+ return undefined;
467
+ return (`This command needs one area, but this directory maps to none. Areas of this ` +
468
+ `workspace: ${slugs.join(', ')}. ${AREA_CONTEXT_WAYS_OUT}`);
469
+ }
470
+ /** The half of the message that is true whether or not the area slugs are known. */
471
+ const AREA_CONTEXT_WAYS_OUT = 'Pick one with --area <slug>, cd into its directory (listed below when the project ' +
472
+ 'config maps them), or use a workspace-wide command — `orbitmap tasks` with no area ' +
473
+ 'lists every area, `orbitmap context` shows the whole workspace.';
474
+ /**
475
+ * The same "which areas, and how to get into one" advice, for an `AREA_CONTEXT_REQUIRED`
476
+ * that arrived **from the server** (TS-jt6q36 follow-up).
477
+ *
478
+ * The API answers with its own text ("Pass area_id parameter or set the X-Orbitmap-Area
479
+ * header. Call GET /api/agent/areas…"), which describes the HTTP contract, not the CLI a
480
+ * person is actually holding — and it used to reach the terminal verbatim, so the improved
481
+ * local wording only ever showed up in local mode. This is what the cloud adapter wraps it
482
+ * with. Unlike {@link requireArea} it never knows the workspace's full area list (that would
483
+ * cost a request), so it falls back to the ways out alone, which are always actionable.
484
+ */
485
+ export function areaContextHint(options) {
486
+ const mapped = resolveAreaDirectoryMap(options ?? {});
487
+ return {
488
+ message: areaContextMessage(undefined, mapped) ?? AREA_CONTEXT_WAYS_OUT,
489
+ mappedDirectories: mapped.map(({ area, dir }) => ({ area, dir })),
490
+ };
491
+ }
492
+ /**
493
+ * Workspace **identity** resolution (schema v2), first match wins:
494
+ * 1. `--workspace-id <slug-or-uuid>` flag
495
+ * 2. `ORBITMAP_WORKSPACE_ID` env var
496
+ * 3. nearest `.orbitmap/config.json` **that sets `workspace`** (per-field, ADR 0002 §2)
497
+ * 4. global config `workspace`
498
+ *
499
+ * Strictly separate from {@link resolveWorkspacePath}, which answers a different question —
500
+ * *which directory on this disk* — and keeps its own unchanged ladder (`--workspace` →
501
+ * `ORBITMAP_WORKSPACE` → `link.json` → `workspace.yml` → `workspace_path`). A slug is never a
502
+ * path and a path is never a slug: `--workspace <path>` still means local mode and this rung
503
+ * never touches it, `--workspace-id` never implies a mode.
504
+ *
505
+ * Undefined is a normal outcome (an un-migrated cloud project, or local mode, where the
506
+ * workspace is a directory), not an error.
507
+ */
508
+ export function resolveWorkspaceId(options = {}) {
509
+ const flag = options.workspaceId ?? workspaceIdFlag;
510
+ if (flag)
511
+ return { workspace: flag, source: 'flag' };
512
+ const env = process.env['ORBITMAP_WORKSPACE_ID'];
513
+ if (env)
514
+ return { workspace: env, source: 'env' };
515
+ const cwd = resolve(options.cwd ?? process.cwd());
516
+ const projectWorkspace = resolveProjectConfigField('workspace', cwd)?.value;
517
+ if (projectWorkspace)
518
+ return { workspace: projectWorkspace, source: 'project-config' };
519
+ const configured = options.config?.workspace;
520
+ if (configured)
521
+ return { workspace: configured, source: 'config' };
522
+ return {};
259
523
  }
260
524
  /**
261
525
  * Full context resolution. Loads the global config when one is not injected.
@@ -269,16 +533,20 @@ export async function resolveWorkspaceContext(options = {}) {
269
533
  const opts = { ...options, cwd, config, link };
270
534
  const mode = resolveMode(opts);
271
535
  const { area, source: areaSource } = resolveArea(opts);
272
- if (mode !== 'local') {
273
- return { mode, area, areaSource, link, config };
274
- }
275
- return {
536
+ const { workspace, source: workspaceSource } = resolveWorkspaceId(opts);
537
+ const scope = area ? 'area' : 'workspace';
538
+ const base = {
276
539
  mode,
277
- workspacePath: resolveWorkspacePath(opts),
540
+ workspace,
541
+ workspaceSource,
278
542
  area,
279
543
  areaSource,
544
+ scope,
280
545
  link,
281
546
  config,
282
547
  };
548
+ if (mode !== 'local')
549
+ return base;
550
+ return { ...base, workspacePath: resolveWorkspacePath(opts) };
283
551
  }
284
552
  //# sourceMappingURL=workspace-resolve.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-resolve.js","sourceRoot":"","sources":["../src/workspace-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,UAAU,EAA0C,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAIhE;;mCAEmC;AACnC,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,qEAAqE;AACrE,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC;AAiB9C;;;;;;GAMG;AACH,IAAI,aAAiC,CAAC;AAEtC,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,aAAa,GAAG,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,WAAmB,OAAO,CAAC,GAAG,EAAE;IAEhC,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE5B,SAAS,CAAC;QACR,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QACrD,IA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AS;QACT,eAAe;QACf,IAAI;QACJ,UAAU;QACV,KAAK;QACL,IAAI;QACJ,MAAM;KAC4B,CAAC;IAErC,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IAElC,OAAO,EAAE,GAAG,IAAI,EAAE,aAAa,EAAE,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;AAChE,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { type AreaSource } from './workspace-resolve.js';
2
+ /** The user declined the confirmation — nothing was written. */
3
+ export declare const WRITE_TARGET_DECLINED = "WRITE_TARGET_DECLINED";
4
+ export declare function isStrongAreaSource(source: AreaSource | undefined): boolean;
5
+ /**
6
+ * What the write does with the resolved area — the two shapes have genuinely different
7
+ * risk, so they get different wording and different gating.
8
+ *
9
+ * - `'new'` — the command **creates** an object, and the resolved area *is* the
10
+ * destination. Getting it wrong silently produces a real object in the wrong scope with
11
+ * no way back (there is no `move` command). This is the IS-vse335 failure.
12
+ * - `'existing'` — the command acts on an object named by id. The resolved area scopes the
13
+ * *lookup* (cloud mode sends it as `X-Orbitmap-Area`), so a wrong area cannot misplace
14
+ * the write: it simply fails to find the object and returns 404. The destination is
15
+ * whichever area the object already lives in, which is why the echo must not claim the
16
+ * area is where the change "lands".
17
+ */
18
+ export type WriteKind = 'new' | 'existing';
19
+ /** What {@link confirmWriteTarget} did, for tests and for callers that want to branch. */
20
+ export type WriteTargetDecision =
21
+ /** No area resolved at all — the adapter/`requireArea` owns that error. */
22
+ 'no-area'
23
+ /** Strong rung (or local mode, where the workspace may still override): echo only. */
24
+ | 'echoed'
25
+ /** Weak rung, confirmation was asked for and given. */
26
+ | 'confirmed'
27
+ /** Weak rung, could not ask (non-TTY / `--json` / `--yes` / single area): echo + warn. */
28
+ | 'warned';
29
+ export interface WriteTarget {
30
+ area?: string;
31
+ source?: AreaSource;
32
+ decision: WriteTargetDecision;
33
+ }
34
+ export interface WriteTargetOptions {
35
+ json?: boolean;
36
+ area?: string;
37
+ /** `--yes`: accept the resolved target without asking. */
38
+ yes?: boolean;
39
+ /** Resolution start directory; defaults to `process.cwd()`. Tests pass this. */
40
+ cwd?: string;
41
+ }
42
+ /**
43
+ * Resolve, announce and (when the rung is weak) confirm the area a write will land in.
44
+ *
45
+ * Call it inside the command's existing `try`, before `createAdapter`: a declined
46
+ * confirmation throws {@link OrbitMapAPIError} with code {@link WRITE_TARGET_DECLINED},
47
+ * which the command's `printError` branch already renders and exits non-zero for.
48
+ *
49
+ * Only a `'new'` write is ever interactive. An `'existing'` write cannot land in the wrong
50
+ * area — the worst a weak rung can do there is a `NOT_FOUND` — so it is announced and (on a
51
+ * weak rung) warned about, but never blocked or questioned.
52
+ *
53
+ * @param operation Short label for the write, e.g. `create task`.
54
+ * @param kind See {@link WriteKind}; defaults to `'new'`, the dangerous shape.
55
+ */
56
+ export declare function confirmWriteTarget(operation: string, options: WriteTargetOptions, kind?: WriteKind): Promise<WriteTarget>;
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Making the destination area of a WRITE visible (issue IS-vse335).
3
+ *
4
+ * The area ladder (`resolveArea`) exists to answer "which area do I read context from".
5
+ * Reads that land in the wrong area are harmless — you see the wrong list and move on.
6
+ * A *write* that lands in the wrong area creates a real object in someone else's scope,
7
+ * and there is no `move` command, so the only recovery is to recreate it. IS-vse335 is
8
+ * exactly that: an agent created a task in `demo` because the machine-wide global config
9
+ * happened to say `demo`, and nothing in the output ever named the destination.
10
+ *
11
+ * Two rules, applied by {@link confirmWriteTarget} before any write leaves the CLI:
12
+ *
13
+ * 1. **Every write echoes its target** — `area <slug> (source: …)` on **stderr**, so the
14
+ * destination is on screen for a human and in the transcript for an agent, while
15
+ * stdout (and therefore `--json`) stays byte-for-byte what it always was.
16
+ * 2. **A weak-rung write is not silent.** {@link isStrongAreaSource}: `flag`, `env`,
17
+ * `link`, `project-config` and `cwd-map` are *strong* — someone named this area, or
18
+ * the project's own committed directory map did (which is what intent IN-rwb5qu made
19
+ * trustworthy; a cwd-mapped write must stay quiet and non-interactive). Only `config`
20
+ * — the deprecated machine-wide `~/.orbitmap/config.json` `area` — is *weak*: it is a
21
+ * technical resolution default, not a declaration of where the user is working.
22
+ * On a weak rung the CLI asks for confirmation when it can (TTY, more than one area
23
+ * reachable) and otherwise prints a warning naming the destination.
24
+ *
25
+ * Both rules are qualified by {@link WriteKind}: a write that *creates* an object treats the
26
+ * resolved area as its destination, while a write aimed at an existing object by id only
27
+ * uses the area to *find* it. Only the first can misplace anything, so only the first is
28
+ * ever interactive — the second is announced with wording that says what is actually true.
29
+ *
30
+ * A scripted run is **never** blocked and never waits on input: the prompt is raised only
31
+ * when both stdin and stdout are TTYs and `--json` was not passed. `--yes` (or
32
+ * `ORBITMAP_YES=1`) satisfies it non-interactively.
33
+ */
34
+ import { createAdapter } from './adapters/factory.js';
35
+ import { OrbitMapAPIError } from './errors.js';
36
+ import { resolveWorkspaceContext } from './workspace-resolve.js';
37
+ /** The user declined the confirmation — nothing was written. */
38
+ export const WRITE_TARGET_DECLINED = 'WRITE_TARGET_DECLINED';
39
+ /**
40
+ * Rungs that mean "someone said so": an explicit flag, an explicit env var, the project's
41
+ * own `link.json`/`config.json`, or the committed directory → area map matched against the
42
+ * current directory. Everything else (i.e. the machine-wide global `area`) is weak.
43
+ */
44
+ const STRONG_AREA_SOURCES = [
45
+ 'flag',
46
+ 'env',
47
+ 'link',
48
+ 'project-config',
49
+ 'cwd-map',
50
+ ];
51
+ export function isStrongAreaSource(source) {
52
+ return source !== undefined && STRONG_AREA_SOURCES.includes(source);
53
+ }
54
+ /** Human-readable name of the rung, for the echo line. */
55
+ const SOURCE_LABEL = {
56
+ flag: '--area flag',
57
+ env: 'ORBITMAP_AREA',
58
+ link: '.orbitmap/link.json',
59
+ 'project-config': '.orbitmap/config.json',
60
+ 'cwd-map': 'directory map in .orbitmap/config.json',
61
+ config: 'global ~/.orbitmap/config.json (machine-wide default, not this project)',
62
+ };
63
+ function envFlag(name) {
64
+ const value = (process.env[name] ?? '').trim().toLowerCase();
65
+ return value === '1' || value === 'true' || value === 'yes';
66
+ }
67
+ /** True when we may raise a blocking question without stalling a pipeline. */
68
+ function isInteractive() {
69
+ return Boolean(process.stdin.isTTY && process.stdout.isTTY);
70
+ }
71
+ /**
72
+ * The echo goes to stderr on purpose (stdout is the command's contract, parsed by agents
73
+ * and by `--json` consumers). `ORBITMAP_NO_AREA_ECHO=1` silences it for callers that
74
+ * genuinely cannot tolerate the extra line.
75
+ */
76
+ function echoTarget(operation, area, source, kind) {
77
+ if (envFlag('ORBITMAP_NO_AREA_ECHO'))
78
+ return;
79
+ const label = source ? SOURCE_LABEL[source] : 'unknown';
80
+ // `creates in` vs `scoped to`: only the first is a destination. Saying "area X" about an
81
+ // id-targeted write would assert something the CLI does not know — the object's own area
82
+ // is whatever it already is, and a mismatch 404s rather than writing somewhere wrong.
83
+ const verb = kind === 'new' ? 'creates in area' : 'scoped to area';
84
+ console.error(`[orbitmap] ${operation} → ${verb} ${area} (source: ${label})`);
85
+ }
86
+ function warnWeakTarget(operation, area, kind) {
87
+ const what = kind === 'new'
88
+ ? `is writing to area "${area}"`
89
+ : `is looking the object up in area "${area}"`;
90
+ console.error(`[orbitmap] WARNING: ${operation} ${what}, which came only from ` +
91
+ 'the machine-wide ~/.orbitmap/config.json — no committed setting and no directory ' +
92
+ 'mapping chose it. Pass --area <slug> to say where this belongs, or run ' +
93
+ '`orbitmap context` to see the directory → area map.');
94
+ }
95
+ /** Minimal `y/N` question. Only ever called when {@link isInteractive} is true. */
96
+ async function askYesNo(question) {
97
+ const { createInterface } = await import('node:readline');
98
+ const rl = createInterface({ input: process.stdin, output: process.stderr });
99
+ try {
100
+ const answer = await new Promise((res) => rl.question(question, res));
101
+ return /^y(es)?$/i.test(answer.trim());
102
+ }
103
+ finally {
104
+ rl.close();
105
+ }
106
+ }
107
+ /**
108
+ * How many areas this invocation could have written to. `undefined` when it cannot be
109
+ * determined (offline, unauthenticated, local workspace unreadable) — in that case we do
110
+ * not prompt, because a confirmation we cannot justify is just noise.
111
+ */
112
+ async function countReachableAreas(explicitArea) {
113
+ try {
114
+ const client = await createAdapter(explicitArea);
115
+ const response = (await client.getAreas());
116
+ return Array.isArray(response.data) ? response.data.length : undefined;
117
+ }
118
+ catch {
119
+ return undefined;
120
+ }
121
+ }
122
+ /**
123
+ * Resolve, announce and (when the rung is weak) confirm the area a write will land in.
124
+ *
125
+ * Call it inside the command's existing `try`, before `createAdapter`: a declined
126
+ * confirmation throws {@link OrbitMapAPIError} with code {@link WRITE_TARGET_DECLINED},
127
+ * which the command's `printError` branch already renders and exits non-zero for.
128
+ *
129
+ * Only a `'new'` write is ever interactive. An `'existing'` write cannot land in the wrong
130
+ * area — the worst a weak rung can do there is a `NOT_FOUND` — so it is announced and (on a
131
+ * weak rung) warned about, but never blocked or questioned.
132
+ *
133
+ * @param operation Short label for the write, e.g. `create task`.
134
+ * @param kind See {@link WriteKind}; defaults to `'new'`, the dangerous shape.
135
+ */
136
+ export async function confirmWriteTarget(operation, options, kind = 'new') {
137
+ const context = await resolveWorkspaceContext({
138
+ area: options.area,
139
+ ...(options.cwd !== undefined ? { cwd: options.cwd } : {}),
140
+ });
141
+ const area = context.area;
142
+ const source = context.areaSource;
143
+ if (!area)
144
+ return { decision: 'no-area' };
145
+ // Local mode: the workspace's own `default_area`/single-area fallback outranks the
146
+ // global rung inside the adapter, so the ladder's `config` result is not what a write
147
+ // would actually use. Announce, never gate on a value we know may be superseded.
148
+ if (isStrongAreaSource(source) || context.mode === 'local') {
149
+ echoTarget(operation, area, source, kind);
150
+ return { area, ...(source ? { source } : {}), decision: 'echoed' };
151
+ }
152
+ const assumeYes = options.yes === true || envFlag('ORBITMAP_YES');
153
+ if (kind === 'new' && !assumeYes && !options.json && isInteractive()) {
154
+ const reachable = await countReachableAreas(options.area);
155
+ if (reachable !== undefined && reachable > 1) {
156
+ echoTarget(operation, area, source, kind);
157
+ warnWeakTarget(operation, area, kind);
158
+ const ok = await askYesNo(`[orbitmap] Write to area "${area}"? [y/N] `);
159
+ if (!ok) {
160
+ throw new OrbitMapAPIError(`Aborted: ${operation} was not confirmed for area "${area}". Re-run with ` +
161
+ '--area <slug> to name the target area explicitly.', WRITE_TARGET_DECLINED, 400, { resolved_area: area, area_source: source ?? null });
162
+ }
163
+ return { area, ...(source ? { source } : {}), decision: 'confirmed' };
164
+ }
165
+ }
166
+ echoTarget(operation, area, source, kind);
167
+ warnWeakTarget(operation, area, kind);
168
+ return { area, ...(source ? { source } : {}), decision: 'warned' };
169
+ }
170
+ //# sourceMappingURL=write-target.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-target.js","sourceRoot":"","sources":["../src/write-target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAmB,MAAM,wBAAwB,CAAC;AAElF,gEAAgE;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,mBAAmB,GAA0B;IACjD,MAAM;IACN,KAAK;IACL,MAAM;IACN,gBAAgB;IAChB,SAAS;CACV,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,MAA8B;IAC/D,OAAO,MAAM,KAAK,SAAS,IAAI,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAiBD,0DAA0D;AAC1D,MAAM,YAAY,GAA+B;IAC/C,IAAI,EAAE,aAAa;IACnB,GAAG,EAAE,eAAe;IACpB,IAAI,EAAE,qBAAqB;IAC3B,gBAAgB,EAAE,uBAAuB;IACzC,SAAS,EAAE,wCAAwC;IACnD,MAAM,EAAE,yEAAyE;CAClF,CAAC;AA4BF,SAAS,OAAO,CAAC,IAAY;IAC3B,MAAM,KAAK,GAAG,CAAC,OAAO,C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