orbitmap 0.2.0 → 0.4.0-next.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.
Files changed (158) hide show
  1. package/README.md +443 -200
  2. package/dist/adapters/cloud.d.ts +334 -0
  3. package/dist/adapters/cloud.js +520 -0
  4. package/dist/adapters/cloud.js.map +1 -0
  5. package/dist/adapters/factory.d.ts +11 -0
  6. package/dist/adapters/factory.js +27 -0
  7. package/dist/adapters/factory.js.map +1 -0
  8. package/dist/adapters/local/adapter.d.ts +351 -0
  9. package/dist/adapters/local/adapter.js +346 -0
  10. package/dist/adapters/local/adapter.js.map +1 -0
  11. package/dist/adapters/local/context.d.ts +111 -0
  12. package/dist/adapters/local/context.js +136 -0
  13. package/dist/adapters/local/context.js.map +1 -0
  14. package/dist/adapters/local/entities/documents.d.ts +85 -0
  15. package/dist/adapters/local/entities/documents.js +251 -0
  16. package/dist/adapters/local/entities/documents.js.map +1 -0
  17. package/dist/adapters/local/entities/planning.d.ts +108 -0
  18. package/dist/adapters/local/entities/planning.js +540 -0
  19. package/dist/adapters/local/entities/planning.js.map +1 -0
  20. package/dist/adapters/local/entities/tasks.d.ts +95 -0
  21. package/dist/adapters/local/entities/tasks.js +442 -0
  22. package/dist/adapters/local/entities/tasks.js.map +1 -0
  23. package/dist/adapters/local/entities/work-items.d.ts +110 -0
  24. package/dist/adapters/local/entities/work-items.js +623 -0
  25. package/dist/adapters/local/entities/work-items.js.map +1 -0
  26. package/dist/adapters/local/rules.d.ts +172 -0
  27. package/dist/adapters/local/rules.js +319 -0
  28. package/dist/adapters/local/rules.js.map +1 -0
  29. package/dist/adapters/local/shapes.d.ts +209 -0
  30. package/dist/adapters/local/shapes.js +558 -0
  31. package/dist/adapters/local/shapes.js.map +1 -0
  32. package/dist/adapters/local/store.d.ts +200 -0
  33. package/dist/adapters/local/store.js +665 -0
  34. package/dist/adapters/local/store.js.map +1 -0
  35. package/dist/adapters/local/types.d.ts +226 -0
  36. package/dist/adapters/local/types.js +41 -0
  37. package/dist/adapters/local/types.js.map +1 -0
  38. package/dist/adapters/types.d.ts +332 -0
  39. package/dist/adapters/types.js +2 -0
  40. package/dist/adapters/types.js.map +1 -0
  41. package/dist/agent-instructions.d.ts +32 -0
  42. package/dist/agent-instructions.js +334 -0
  43. package/dist/agent-instructions.js.map +1 -0
  44. package/dist/api-client.d.ts +8 -239
  45. package/dist/api-client.js +8 -403
  46. package/dist/api-client.js.map +1 -1
  47. package/dist/commands/agents.d.ts +1 -1
  48. package/dist/commands/agents.js +10 -10
  49. package/dist/commands/agents.js.map +1 -1
  50. package/dist/commands/areas.d.ts +3 -0
  51. package/dist/commands/areas.js +29 -0
  52. package/dist/commands/areas.js.map +1 -0
  53. package/dist/commands/assign.d.ts +3 -2
  54. package/dist/commands/assign.js +47 -15
  55. package/dist/commands/assign.js.map +1 -1
  56. package/dist/commands/context.d.ts +1 -1
  57. package/dist/commands/context.js +18 -12
  58. package/dist/commands/context.js.map +1 -1
  59. package/dist/commands/create-area.d.ts +7 -0
  60. package/dist/commands/create-area.js +29 -0
  61. package/dist/commands/create-area.js.map +1 -0
  62. package/dist/commands/create.d.ts +3 -1
  63. package/dist/commands/create.js +4 -2
  64. package/dist/commands/create.js.map +1 -1
  65. package/dist/commands/dep.d.ts +2 -2
  66. package/dist/commands/dep.js +3 -3
  67. package/dist/commands/dep.js.map +1 -1
  68. package/dist/commands/doc-import.d.ts +1 -1
  69. package/dist/commands/doc-import.js +2 -2
  70. package/dist/commands/doc-import.js.map +1 -1
  71. package/dist/commands/doc-patch.d.ts +1 -1
  72. package/dist/commands/doc-patch.js +2 -2
  73. package/dist/commands/doc-patch.js.map +1 -1
  74. package/dist/commands/doc-share.d.ts +6 -6
  75. package/dist/commands/doc-share.js +13 -13
  76. package/dist/commands/doc-share.js.map +1 -1
  77. package/dist/commands/doc-update.d.ts +1 -1
  78. package/dist/commands/doc-update.js +2 -2
  79. package/dist/commands/doc-update.js.map +1 -1
  80. package/dist/commands/doc.d.ts +1 -1
  81. package/dist/commands/doc.js +5 -4
  82. package/dist/commands/doc.js.map +1 -1
  83. package/dist/commands/docs-cache.d.ts +2 -2
  84. package/dist/commands/docs-cache.js +3 -3
  85. package/dist/commands/docs-cache.js.map +1 -1
  86. package/dist/commands/docs.d.ts +1 -1
  87. package/dist/commands/docs.js +2 -2
  88. package/dist/commands/docs.js.map +1 -1
  89. package/dist/commands/get.d.ts +1 -1
  90. package/dist/commands/get.js +43 -3
  91. package/dist/commands/get.js.map +1 -1
  92. package/dist/commands/ideas.d.ts +4 -4
  93. package/dist/commands/ideas.js +5 -5
  94. package/dist/commands/ideas.js.map +1 -1
  95. package/dist/commands/init.d.ts +17 -3
  96. package/dist/commands/init.js +262 -30
  97. package/dist/commands/init.js.map +1 -1
  98. package/dist/commands/intent.d.ts +41 -0
  99. package/dist/commands/intent.js +237 -0
  100. package/dist/commands/intent.js.map +1 -0
  101. package/dist/commands/issues.d.ts +6 -5
  102. package/dist/commands/issues.js +7 -6
  103. package/dist/commands/issues.js.map +1 -1
  104. package/dist/commands/log.d.ts +1 -1
  105. package/dist/commands/log.js +2 -2
  106. package/dist/commands/log.js.map +1 -1
  107. package/dist/commands/mission.d.ts +42 -0
  108. package/dist/commands/mission.js +219 -0
  109. package/dist/commands/mission.js.map +1 -0
  110. package/dist/commands/orbit.d.ts +40 -3
  111. package/dist/commands/orbit.js +231 -58
  112. package/dist/commands/orbit.js.map +1 -1
  113. package/dist/commands/overview.d.ts +2 -2
  114. package/dist/commands/overview.js +25 -28
  115. package/dist/commands/overview.js.map +1 -1
  116. package/dist/commands/setup-agent.d.ts +11 -0
  117. package/dist/commands/setup-agent.js +96 -79
  118. package/dist/commands/setup-agent.js.map +1 -1
  119. package/dist/commands/setup-mcp.d.ts +1 -1
  120. package/dist/commands/setup-mcp.js +9 -9
  121. package/dist/commands/setup-mcp.js.map +1 -1
  122. package/dist/commands/start.d.ts +1 -1
  123. package/dist/commands/start.js +2 -2
  124. package/dist/commands/start.js.map +1 -1
  125. package/dist/commands/status.d.ts +2 -1
  126. package/dist/commands/status.js +3 -3
  127. package/dist/commands/status.js.map +1 -1
  128. package/dist/commands/subtask.d.ts +1 -1
  129. package/dist/commands/subtask.js +2 -2
  130. package/dist/commands/subtask.js.map +1 -1
  131. package/dist/commands/task-edit-content.d.ts +1 -1
  132. package/dist/commands/task-edit-content.js +2 -2
  133. package/dist/commands/task-edit-content.js.map +1 -1
  134. package/dist/commands/task.d.ts +10 -3
  135. package/dist/commands/task.js +16 -8
  136. package/dist/commands/task.js.map +1 -1
  137. package/dist/commands/tasks.d.ts +1 -1
  138. package/dist/commands/tasks.js +2 -2
  139. package/dist/commands/tasks.js.map +1 -1
  140. package/dist/commands/vibes.d.ts +4 -4
  141. package/dist/commands/vibes.js +5 -5
  142. package/dist/commands/vibes.js.map +1 -1
  143. package/dist/config.d.ts +10 -2
  144. package/dist/config.js +13 -4
  145. package/dist/config.js.map +1 -1
  146. package/dist/doc-cache.d.ts +2 -2
  147. package/dist/doc-cache.js.map +1 -1
  148. package/dist/errors.d.ts +19 -2
  149. package/dist/errors.js +35 -0
  150. package/dist/errors.js.map +1 -1
  151. package/dist/index.js +453 -94
  152. package/dist/index.js.map +1 -1
  153. package/dist/output.js +7 -2
  154. package/dist/output.js.map +1 -1
  155. package/dist/workspace-resolve.d.ts +126 -0
  156. package/dist/workspace-resolve.js +203 -0
  157. package/dist/workspace-resolve.js.map +1 -0
  158. package/package.json +53 -50
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { Command } from 'commander';
3
3
  import { initCommand } from './commands/init.js';
4
4
  import { contextCommand } from './commands/context.js';
5
- import { projectsCommand } from './commands/projects.js';
5
+ import { areasCommand } from './commands/areas.js';
6
6
  import { membersCommand } from './commands/agents.js';
7
7
  import { overviewCommand } from './commands/overview.js';
8
8
  import { tasksCommand } from './commands/tasks.js';
@@ -28,27 +28,53 @@ import { logoutCommand } from './commands/logout.js';
28
28
  import { issueRegisterCommand, issueListCommand, issueShowCommand, issueResolveCommand, issueStatusCommand, } from './commands/issues.js';
29
29
  import { vibeLogCommand, vibeListCommand, vibeShowCommand, vibeUpdateCommand, } from './commands/vibes.js';
30
30
  import { ideaListCommand, ideaShowCommand, ideaAddCommand, ideaStatusCommand, } from './commands/ideas.js';
31
- import { orbitItemsCommand, orbitAttachCommand, orbitDetachCommand, } from './commands/orbit.js';
31
+ import { orbitListCommand, orbitShowCommand, orbitCreateCommand, orbitUpdateCommand, orbitItemsCommand, orbitAttachCommand, orbitDetachCommand, orbitAreaLinkCommand, orbitAreaUnlinkCommand, orbitDepAddCommand, } from './commands/orbit.js';
32
+ import { intentListCommand, intentShowCommand, intentCreateCommand, intentUpdateCommand, intentLinkCommand, intentUnlinkCommand, intentOrbitCommand, } from './commands/intent.js';
33
+ import { missionListCommand, missionShowCommand, missionCreateCommand, missionUpdateCommand, missionStatusCommand, missionLinkCommand, missionUnlinkCommand, } from './commands/mission.js';
32
34
  import { depAddCommand, depRemoveCommand } from './commands/dep.js';
33
35
  import { getCommand } from './commands/get.js';
34
- import { createProjectCommand } from './commands/create-project.js';
36
+ import { createAreaCommand } from './commands/create-area.js';
37
+ import { setWorkspaceFlag } from './workspace-resolve.js';
35
38
  const program = new Command();
36
39
  program
37
40
  .name('orbitmap')
38
41
  .description('CLI tool for OrbitMap Agent API')
39
- .version('0.1.0')
42
+ .version('0.3.0')
40
43
  .option('--json', 'Output in JSON format', false)
41
- .option('--project <id>', 'Project ID or slug to use');
44
+ .option('--area <id>', 'Area ID or slug to use')
45
+ .option('--workspace <path>', 'Local workspace directory to use (local mode)');
46
+ // The workspace flag is program-level and consumed by the resolver, not by the
47
+ // command modules, so capture it once before any action runs.
48
+ program.hook('preAction', (thisCommand) => {
49
+ setWorkspaceFlag(thisCommand.opts()['workspace']);
50
+ });
42
51
  program
43
52
  .command('init')
44
- .description('Configure API credentials and generate MCP config')
53
+ .description('Set up OrbitMap (cloud account or local files) and install the agent skills')
45
54
  .option('--key <api-key>', 'Agent API key (enables non-interactive mode)')
46
55
  .option('--token <api-key>', 'Alias for --key')
47
- .option('--project <id>', 'Default project ID')
56
+ .option('--area <id>', 'Default area ID (cloud) or first area name (local)')
48
57
  .option('--profile <profile>', 'MCP profile: full, lite, manager (default: full)')
49
58
  .option('--advanced', 'Show advanced options (e.g. custom API URL)')
50
- .action(async (opts) => {
51
- await initCommand({ advanced: opts.advanced, key: opts.key, token: opts.token, project: opts.project, profile: opts.profile });
59
+ .option('--local', 'Set up local-files mode without the interactive question')
60
+ .option('--workspace <path>', 'Local workspace directory (default: ./.orbitmap)')
61
+ .option('--workspace-name <name>', 'Local workspace name (default: current directory name)')
62
+ .option('--no-skills', 'Skip installing the OrbitMap agent skills')
63
+ .action(async (opts, command) => {
64
+ // `--workspace` also exists as a program-level flag, and Commander binds it there;
65
+ // `optsWithGlobals()` picks it up whichever position it was given in.
66
+ const all = command.optsWithGlobals();
67
+ await initCommand({
68
+ advanced: opts.advanced,
69
+ key: opts.key,
70
+ token: opts.token,
71
+ area: opts.area ?? all['area'],
72
+ profile: opts.profile,
73
+ local: opts.local,
74
+ workspace: opts.workspace ?? all['workspace'],
75
+ workspaceName: opts.workspaceName,
76
+ skills: opts.skills,
77
+ });
52
78
  });
53
79
  program
54
80
  .command('login')
@@ -65,45 +91,47 @@ program
65
91
  });
66
92
  program
67
93
  .command('context')
68
- .description('Show agent identity and current project info')
94
+ .description('Show agent identity and current area info')
69
95
  .action(async (_opts, cmd) => {
70
96
  const globalOpts = cmd.optsWithGlobals();
71
- await contextCommand({ json: globalOpts.json, project: globalOpts.project });
97
+ await contextCommand({ json: globalOpts.json, area: globalOpts.area });
72
98
  });
73
99
  program
74
- .command('projects')
75
- .description('List all projects assigned to this agent')
100
+ .command('areas')
101
+ .description('List all areas assigned to this agent')
76
102
  .action(async (_opts, cmd) => {
77
103
  const globalOpts = cmd.optsWithGlobals();
78
- await projectsCommand({ json: globalOpts.json });
104
+ await areasCommand({ json: globalOpts.json });
79
105
  });
80
106
  program
81
- .command('create-project <name>')
82
- .description('Create a new project')
83
- .option('--desc <description>', 'Project description')
84
- .option('--slug <slug>', 'Project slug (auto-generated from name if omitted)')
107
+ .command('create-area <name>')
108
+ .description('Create a new area')
109
+ .option('--desc <description>', 'Area description')
110
+ .option('--slug <slug>', 'Area slug (auto-generated from name if omitted)')
111
+ .option('--workspace-id <uuid>', 'Workspace to create the area in')
85
112
  .action(async (name, opts, cmd) => {
86
113
  const globalOpts = cmd.optsWithGlobals();
87
- await createProjectCommand(name, {
114
+ await createAreaCommand(name, {
88
115
  json: globalOpts.json,
89
- project: globalOpts.project,
116
+ area: globalOpts.area,
90
117
  desc: opts.desc,
91
118
  slug: opts.slug,
119
+ workspaceId: opts.workspaceId,
92
120
  });
93
121
  });
94
122
  program
95
- .command('members <project-id>')
96
- .description('List all members (agents and users) in a project')
97
- .action(async (projectId, _opts, cmd) => {
123
+ .command('members <area-id>')
124
+ .description('List all members (agents and users) in an area')
125
+ .action(async (areaId, _opts, cmd) => {
98
126
  const globalOpts = cmd.optsWithGlobals();
99
- await membersCommand(projectId, { json: globalOpts.json });
127
+ await membersCommand(areaId, { json: globalOpts.json });
100
128
  });
101
129
  program
102
- .command('overview [project-id]')
103
- .description('Show project overview with task statistics')
104
- .action(async (projectId, _opts, cmd) => {
130
+ .command('overview [area-id]')
131
+ .description('Show area overview with task statistics')
132
+ .action(async (areaId, _opts, cmd) => {
105
133
  const globalOpts = cmd.optsWithGlobals();
106
- await overviewCommand(projectId, { json: globalOpts.json, project: globalOpts.project });
134
+ await overviewCommand(areaId, { json: globalOpts.json, area: globalOpts.area });
107
135
  });
108
136
  program
109
137
  .command('tasks')
@@ -115,7 +143,7 @@ program
115
143
  const globalOpts = cmd.optsWithGlobals();
116
144
  await tasksCommand({
117
145
  json: globalOpts.json,
118
- project: globalOpts.project,
146
+ area: globalOpts.area,
119
147
  status: opts.status,
120
148
  priority: opts.priority,
121
149
  orbit: opts.orbit,
@@ -123,17 +151,17 @@ program
123
151
  });
124
152
  program
125
153
  .command('get <prefixed-id>')
126
- .description('Show any object by prefixed ID (TS-xxx, IS-xxx, ID-xxx, VB-xxx)')
154
+ .description('Show any object by prefixed ID (TS-xxx, IS-xxx, ID-xxx, VB-xxx, IN-xxx, MS-xxx)')
127
155
  .action(async (prefixedId, _opts, cmd) => {
128
156
  const globalOpts = cmd.optsWithGlobals();
129
- await getCommand(prefixedId, { json: globalOpts.json, project: globalOpts.project });
157
+ await getCommand(prefixedId, { json: globalOpts.json, area: globalOpts.area });
130
158
  });
131
159
  program
132
160
  .command('task <id>')
133
161
  .description('Show full task details (UUID or task number)')
134
162
  .action(async (id, _opts, cmd) => {
135
163
  const globalOpts = cmd.optsWithGlobals();
136
- await taskCommand(id, { json: globalOpts.json, project: globalOpts.project });
164
+ await taskCommand(id, { json: globalOpts.json, area: globalOpts.area });
137
165
  });
138
166
  program
139
167
  .command('task-edit-content <task-id>')
@@ -145,7 +173,7 @@ program
145
173
  const globalOpts = cmd.optsWithGlobals();
146
174
  await taskEditContentCommand(taskId, {
147
175
  json: globalOpts.json,
148
- project: globalOpts.project,
176
+ area: globalOpts.area,
149
177
  title: opts.title,
150
178
  description: opts.description,
151
179
  agentInstructions: opts.agentInstructions,
@@ -156,18 +184,20 @@ program
156
184
  .description('Start working on a task (auto-pick if no ID given)')
157
185
  .action(async (taskId, _opts, cmd) => {
158
186
  const globalOpts = cmd.optsWithGlobals();
159
- await startCommand(taskId, { json: globalOpts.json, project: globalOpts.project });
187
+ await startCommand(taskId, { json: globalOpts.json, area: globalOpts.area });
160
188
  });
161
189
  program
162
190
  .command('status <task-id> <status>')
163
191
  .description('Update task status (backlog, todo, in_progress, in_review, review_changes, done, blocked)')
164
192
  .option('--delivery <status>', 'Delivery status: on_branch, merged, released')
193
+ .option('--force', 'Allow done even with unfinished subtasks')
165
194
  .action(async (taskId, status, opts, cmd) => {
166
195
  const globalOpts = cmd.optsWithGlobals();
167
196
  await statusCommand(taskId, status, {
168
197
  json: globalOpts.json,
169
- project: globalOpts.project,
198
+ area: globalOpts.area,
170
199
  delivery: opts.delivery,
200
+ force: opts.force,
171
201
  });
172
202
  });
173
203
  program
@@ -181,11 +211,13 @@ program
181
211
  .option('--branch <name>', 'Git branch name')
182
212
  .option('--instructions <text>', 'Agent instructions')
183
213
  .option('--from-issue <id-or-number>', 'Link task to an existing issue (UUID, number, or IS-prefixed)')
214
+ .option('--intent <id>', 'Link task to an intent')
215
+ .option('--orbit <id>', 'Attach task to an orbit (omit to inherit the intent orbit)')
184
216
  .action(async (title, opts, cmd) => {
185
217
  const globalOpts = cmd.optsWithGlobals();
186
218
  await createCommand(title, {
187
219
  json: globalOpts.json,
188
- project: globalOpts.project,
220
+ area: globalOpts.area,
189
221
  desc: opts.desc,
190
222
  priority: opts.priority,
191
223
  status: opts.status,
@@ -194,6 +226,8 @@ program
194
226
  branch: opts.branch,
195
227
  instructions: opts.instructions,
196
228
  fromIssue: opts.fromIssue,
229
+ intent: opts.intent,
230
+ orbit: opts.orbit,
197
231
  });
198
232
  });
199
233
  program
@@ -206,22 +240,24 @@ program
206
240
  const globalOpts = cmd.optsWithGlobals();
207
241
  await subtaskCommand(parentId, title, {
208
242
  json: globalOpts.json,
209
- project: globalOpts.project,
243
+ area: globalOpts.area,
210
244
  desc: opts.desc,
211
245
  priority: opts.priority,
212
246
  effort: opts.effort,
213
247
  });
214
248
  });
215
249
  program
216
- .command('assign <task-id> [agent-id]')
217
- .description('Assign a task to an agent or user')
250
+ .command('assign <id> [agent-id]')
251
+ .description('Assign a task, issue, idea, or intent to an agent or user')
218
252
  .option('--user-id <id>', 'Assign to a user (by user ID) instead of an agent')
219
- .action(async (taskId, agentId, opts, cmd) => {
253
+ .option('--type <type>', 'Object type: task, issue, idea, intent (auto-detected from prefixed IDs; default task)')
254
+ .action(async (objectId, agentId, opts, cmd) => {
220
255
  const globalOpts = cmd.optsWithGlobals();
221
- await assignCommand(taskId, agentId, {
256
+ await assignCommand(objectId, agentId, {
222
257
  json: globalOpts.json,
223
- project: globalOpts.project,
258
+ area: globalOpts.area,
224
259
  userId: opts.userId,
260
+ type: opts.type,
225
261
  });
226
262
  });
227
263
  program
@@ -233,21 +269,21 @@ program
233
269
  const globalOpts = cmd.optsWithGlobals();
234
270
  await logCommand(taskId, message, {
235
271
  json: globalOpts.json,
236
- project: globalOpts.project,
272
+ area: globalOpts.area,
237
273
  type: opts.type,
238
274
  meta: opts.meta,
239
275
  });
240
276
  });
241
277
  const docs = program
242
278
  .command('docs')
243
- .description('List project documents (with sections count and context)')
279
+ .description('List area documents (with sections count and context)')
244
280
  .option('--type <type>', 'Filter by type (spec, architecture, api, guide, decision, changelog, other)')
245
281
  .option('--search <query>', 'Search by title')
246
282
  .action(async (opts, cmd) => {
247
283
  const globalOpts = cmd.optsWithGlobals();
248
284
  await docsCommand({
249
285
  json: globalOpts.json,
250
- project: globalOpts.project,
286
+ area: globalOpts.area,
251
287
  type: opts.type,
252
288
  search: opts.search,
253
289
  });
@@ -257,7 +293,7 @@ docs
257
293
  .description('Download document(s) to local cache (.orbitmap/docs/)')
258
294
  .action(async (slug, _opts, cmd) => {
259
295
  const globalOpts = cmd.optsWithGlobals();
260
- await docsPullCommand(slug, { json: globalOpts.json, project: globalOpts.project });
296
+ await docsPullCommand(slug, { json: globalOpts.json, area: globalOpts.area });
261
297
  });
262
298
  docs
263
299
  .command('list-cache')
@@ -271,7 +307,7 @@ docs
271
307
  .description('Remove stale cached documents (>7 days, not in available docs)')
272
308
  .action(async (_opts, cmd) => {
273
309
  const globalOpts = cmd.optsWithGlobals();
274
- await docsCleanCommand({ json: globalOpts.json, project: globalOpts.project });
310
+ await docsCleanCommand({ json: globalOpts.json, area: globalOpts.area });
275
311
  });
276
312
  program
277
313
  .command('doc <id-or-slug>')
@@ -282,24 +318,24 @@ program
282
318
  const globalOpts = cmd.optsWithGlobals();
283
319
  await docCommand(idOrSlug, {
284
320
  json: globalOpts.json,
285
- project: globalOpts.project,
321
+ area: globalOpts.area,
286
322
  full: opts.full,
287
323
  section: opts.section,
288
324
  });
289
325
  });
290
326
  program
291
327
  .command('doc-import <title>')
292
- .description('Import a markdown file as a document (project or workspace level)')
328
+ .description('Import a markdown file as a document (area or workspace level)')
293
329
  .requiredOption('--type <type>', 'Document type: spec, architecture, api, guide, decision, changelog, other')
294
330
  .requiredOption('--file <path>', 'Path to markdown file')
295
331
  .option('--source-path <path>', 'Original source path for reference')
296
332
  .option('--context <text>', 'Short description of when this document is relevant')
297
- .option('--workspace-id <uuid>', 'Create as workspace-level document (cross-project knowledge)')
333
+ .option('--workspace-id <uuid>', 'Create as workspace-level document (cross-area knowledge)')
298
334
  .action(async (title, opts, cmd) => {
299
335
  const globalOpts = cmd.optsWithGlobals();
300
336
  await docImportCommand(title, {
301
337
  json: globalOpts.json,
302
- project: globalOpts.project,
338
+ area: globalOpts.area,
303
339
  type: opts.type,
304
340
  file: opts.file,
305
341
  sourcePath: opts.sourcePath,
@@ -316,7 +352,7 @@ program
316
352
  const globalOpts = cmd.optsWithGlobals();
317
353
  await docUpdateCommand(idOrSlug, {
318
354
  json: globalOpts.json,
319
- project: globalOpts.project,
355
+ area: globalOpts.area,
320
356
  file: opts.file,
321
357
  changelog: opts.changelog,
322
358
  });
@@ -337,7 +373,7 @@ program
337
373
  const globalOpts = cmd.optsWithGlobals();
338
374
  await docPatchCommand(idOrSlug, {
339
375
  json: globalOpts.json,
340
- project: globalOpts.project,
376
+ area: globalOpts.area,
341
377
  operations: opts.operations,
342
378
  baseVersion: opts.baseVersion,
343
379
  changelog: opts.changelog,
@@ -350,36 +386,36 @@ program
350
386
  });
351
387
  });
352
388
  program
353
- .command('doc-share <document-id> <project-id>')
354
- .description('Share a document with another project')
389
+ .command('doc-share <document-id> <area-id>')
390
+ .description('Share a document with another area')
355
391
  .option('--agents <ids>', 'Comma-separated agent IDs to restrict visibility')
356
- .action(async (documentId, projectId, opts, cmd) => {
392
+ .action(async (documentId, areaId, opts, cmd) => {
357
393
  const globalOpts = cmd.optsWithGlobals();
358
- await docShareCommand(documentId, projectId, {
394
+ await docShareCommand(documentId, areaId, {
359
395
  json: globalOpts.json,
360
- project: globalOpts.project,
396
+ area: globalOpts.area,
361
397
  agents: opts.agents,
362
398
  });
363
399
  });
364
400
  program
365
- .command('doc-unshare <document-id> <project-id>')
366
- .description('Remove document sharing from a project')
367
- .action(async (documentId, projectId, _opts, cmd) => {
401
+ .command('doc-unshare <document-id> <area-id>')
402
+ .description('Remove document sharing from an area')
403
+ .action(async (documentId, areaId, _opts, cmd) => {
368
404
  const globalOpts = cmd.optsWithGlobals();
369
- await docUnshareCommand(documentId, projectId, {
405
+ await docUnshareCommand(documentId, areaId, {
370
406
  json: globalOpts.json,
371
- project: globalOpts.project,
407
+ area: globalOpts.area,
372
408
  });
373
409
  });
374
410
  program
375
- .command('doc-visibility <document-id> <target-project-id>')
411
+ .command('doc-visibility <document-id> <target-area-id>')
376
412
  .description('Update document visibility (restrict to specific agents or allow all)')
377
413
  .option('--agents <ids>', 'Comma-separated agent IDs to restrict visibility (omit to allow all)')
378
- .action(async (documentId, targetProjectId, opts, cmd) => {
414
+ .action(async (documentId, targetAreaId, opts, cmd) => {
379
415
  const globalOpts = cmd.optsWithGlobals();
380
- await docVisibilityCommand(documentId, targetProjectId, {
416
+ await docVisibilityCommand(documentId, targetAreaId, {
381
417
  json: globalOpts.json,
382
- project: globalOpts.project,
418
+ area: globalOpts.area,
383
419
  agents: opts.agents,
384
420
  });
385
421
  });
@@ -395,14 +431,14 @@ program
395
431
  .description('Install OrbitMap MCP entry into .mcp.json in the current directory (no API calls)')
396
432
  .option('--token <api-key>', 'Agent API key (Bearer auth)')
397
433
  .option('--oauth', 'Use OAuth (no Authorization header; auth happens on first MCP use)')
398
- .option('--project <slug>', 'Project slug or UUID (required for --token, optional for --oauth)')
434
+ .option('--area <slug>', 'Area slug or UUID (required for --token, optional for --oauth)')
399
435
  .option('--profile <profile>', 'MCP profile: full, lite, manager (default: full)')
400
436
  .action(async (opts, cmd) => {
401
437
  const globalOpts = cmd.optsWithGlobals();
402
438
  await setupMcpCommand({
403
439
  token: opts.token,
404
440
  oauth: opts.oauth,
405
- project: opts.project || globalOpts.project,
441
+ area: opts.area || globalOpts.area,
406
442
  profile: opts.profile,
407
443
  });
408
444
  });
@@ -417,7 +453,7 @@ program
417
453
  const globalOpts = cmd.optsWithGlobals();
418
454
  await issueListCommand({
419
455
  json: globalOpts.json,
420
- project: globalOpts.project,
456
+ area: globalOpts.area,
421
457
  status: opts.status,
422
458
  severity: opts.severity,
423
459
  limit: opts.limit,
@@ -433,7 +469,7 @@ program
433
469
  const globalOpts = cmd.optsWithGlobals();
434
470
  await vibeListCommand({
435
471
  json: globalOpts.json,
436
- project: globalOpts.project,
472
+ area: globalOpts.area,
437
473
  type: opts.type,
438
474
  since: opts.since,
439
475
  limit: opts.limit,
@@ -449,12 +485,40 @@ program
449
485
  const globalOpts = cmd.optsWithGlobals();
450
486
  await ideaListCommand({
451
487
  json: globalOpts.json,
452
- project: globalOpts.project,
488
+ area: globalOpts.area,
453
489
  status: opts.status,
454
490
  priority: opts.priority,
455
491
  limit: opts.limit,
456
492
  });
457
493
  });
494
+ program
495
+ .command('intents')
496
+ .description('List intents (shortcut for intent list)')
497
+ .option('--status <statuses>', 'Filter by status (comma-separated; default new,design,plan,build)')
498
+ .option('--limit <n>', 'Limit results')
499
+ .action(async (opts, cmd) => {
500
+ const globalOpts = cmd.optsWithGlobals();
501
+ await intentListCommand({
502
+ json: globalOpts.json,
503
+ area: globalOpts.area,
504
+ status: opts.status,
505
+ limit: opts.limit,
506
+ });
507
+ });
508
+ program
509
+ .command('missions')
510
+ .description('List missions (shortcut for mission list)')
511
+ .option('--status <statuses>', 'Filter by status (comma-separated; default new,active)')
512
+ .option('--limit <n>', 'Limit results')
513
+ .action(async (opts, cmd) => {
514
+ const globalOpts = cmd.optsWithGlobals();
515
+ await missionListCommand({
516
+ json: globalOpts.json,
517
+ area: globalOpts.area,
518
+ status: opts.status,
519
+ limit: opts.limit,
520
+ });
521
+ });
458
522
  // ── Issue commands ──
459
523
  const issue = program
460
524
  .command('issue')
@@ -466,15 +530,17 @@ issue
466
530
  .requiredOption('--description <text>', 'Issue description')
467
531
  .option('--severity <level>', 'Severity: critical, high, medium, low')
468
532
  .option('--related-task <id>', 'Related task UUID')
533
+ .option('--intent <id>', 'Link issue to an intent')
469
534
  .action(async (opts, cmd) => {
470
535
  const globalOpts = cmd.optsWithGlobals();
471
536
  await issueRegisterCommand({
472
537
  json: globalOpts.json,
473
- project: globalOpts.project,
538
+ area: globalOpts.area,
474
539
  title: opts.title,
475
540
  description: opts.description,
476
541
  severity: opts.severity,
477
542
  relatedTask: opts.relatedTask,
543
+ intent: opts.intent,
478
544
  });
479
545
  });
480
546
  issue
@@ -487,7 +553,7 @@ issue
487
553
  const globalOpts = cmd.optsWithGlobals();
488
554
  await issueListCommand({
489
555
  json: globalOpts.json,
490
- project: globalOpts.project,
556
+ area: globalOpts.area,
491
557
  status: opts.status,
492
558
  severity: opts.severity,
493
559
  limit: opts.limit,
@@ -500,7 +566,7 @@ issue
500
566
  const globalOpts = cmd.optsWithGlobals();
501
567
  await issueShowCommand(idOrNumber, {
502
568
  json: globalOpts.json,
503
- project: globalOpts.project,
569
+ area: globalOpts.area,
504
570
  });
505
571
  });
506
572
  issue
@@ -513,7 +579,7 @@ issue
513
579
  const globalOpts = cmd.optsWithGlobals();
514
580
  await issueResolveCommand(idOrNumber, {
515
581
  json: globalOpts.json,
516
- project: globalOpts.project,
582
+ area: globalOpts.area,
517
583
  status: opts.status,
518
584
  resolution: opts.resolution,
519
585
  resolvedTask: opts.resolvedTask,
@@ -528,7 +594,7 @@ issue
528
594
  const globalOpts = cmd.optsWithGlobals();
529
595
  await issueStatusCommand(idOrNumber, status, {
530
596
  json: globalOpts.json,
531
- project: globalOpts.project,
597
+ area: globalOpts.area,
532
598
  resolution: opts.resolution,
533
599
  resolvedTask: opts.resolvedTask,
534
600
  });
@@ -548,7 +614,7 @@ vibe
548
614
  const globalOpts = cmd.optsWithGlobals();
549
615
  await vibeLogCommand({
550
616
  json: globalOpts.json,
551
- project: globalOpts.project,
617
+ area: globalOpts.area,
552
618
  content: opts.content,
553
619
  type: opts.type,
554
620
  title: opts.title,
@@ -565,7 +631,7 @@ vibe
565
631
  const globalOpts = cmd.optsWithGlobals();
566
632
  await vibeListCommand({
567
633
  json: globalOpts.json,
568
- project: globalOpts.project,
634
+ area: globalOpts.area,
569
635
  type: opts.type,
570
636
  since: opts.since,
571
637
  limit: opts.limit,
@@ -578,7 +644,7 @@ vibe
578
644
  const globalOpts = cmd.optsWithGlobals();
579
645
  await vibeShowCommand(id, {
580
646
  json: globalOpts.json,
581
- project: globalOpts.project,
647
+ area: globalOpts.area,
582
648
  });
583
649
  });
584
650
  vibe
@@ -592,7 +658,7 @@ vibe
592
658
  const globalOpts = cmd.optsWithGlobals();
593
659
  await vibeUpdateCommand(id, {
594
660
  json: globalOpts.json,
595
- project: globalOpts.project,
661
+ area: globalOpts.area,
596
662
  type: opts.type,
597
663
  title: opts.title,
598
664
  content: opts.content,
@@ -613,7 +679,7 @@ idea
613
679
  const globalOpts = cmd.optsWithGlobals();
614
680
  await ideaListCommand({
615
681
  json: globalOpts.json,
616
- project: globalOpts.project,
682
+ area: globalOpts.area,
617
683
  status: opts.status,
618
684
  priority: opts.priority,
619
685
  limit: opts.limit,
@@ -626,7 +692,7 @@ idea
626
692
  const globalOpts = cmd.optsWithGlobals();
627
693
  await ideaShowCommand(idOrNumber, {
628
694
  json: globalOpts.json,
629
- project: globalOpts.project,
695
+ area: globalOpts.area,
630
696
  });
631
697
  });
632
698
  idea
@@ -639,7 +705,7 @@ idea
639
705
  const globalOpts = cmd.optsWithGlobals();
640
706
  await ideaAddCommand({
641
707
  json: globalOpts.json,
642
- project: globalOpts.project,
708
+ area: globalOpts.area,
643
709
  content: opts.content,
644
710
  title: opts.title,
645
711
  priority: opts.priority,
@@ -653,37 +719,93 @@ idea
653
719
  const globalOpts = cmd.optsWithGlobals();
654
720
  await ideaStatusCommand(idOrNumber, {
655
721
  json: globalOpts.json,
656
- project: globalOpts.project,
722
+ area: globalOpts.area,
657
723
  status: opts.status,
658
724
  });
659
725
  });
660
726
  // ── Orbit commands ──
661
727
  const orbit = program
662
728
  .command('orbit')
663
- .description('Manage orbit items');
729
+ .description('Manage orbits and orbit items');
730
+ orbit
731
+ .command('list')
732
+ .description('List orbits (workspace-scoped from the area context)')
733
+ .option('--workspace <id>', 'Filter by workspace UUID')
734
+ .action(async (opts, cmd) => {
735
+ const globalOpts = cmd.optsWithGlobals();
736
+ await orbitListCommand({
737
+ json: globalOpts.json,
738
+ area: globalOpts.area,
739
+ workspace: opts.workspace,
740
+ });
741
+ });
742
+ orbit
743
+ .command('show <orbit-id-or-slug>')
744
+ .description('Show orbit details (areas, task counts, resources)')
745
+ .action(async (orbitIdOrSlug, _opts, cmd) => {
746
+ const globalOpts = cmd.optsWithGlobals();
747
+ await orbitShowCommand(orbitIdOrSlug, {
748
+ json: globalOpts.json,
749
+ area: globalOpts.area,
750
+ });
751
+ });
752
+ orbit
753
+ .command('create <name>')
754
+ .description('Create a new orbit (no delete exists — archive via orbit update)')
755
+ .option('--desc <description>', 'Orbit description')
756
+ .option('--color <hex>', 'Color (#rgb or #rrggbb, e.g. #5B8DEF)')
757
+ .option('--areas <ids>', 'Comma-separated area UUIDs to link')
758
+ .action(async (name, opts, cmd) => {
759
+ const globalOpts = cmd.optsWithGlobals();
760
+ await orbitCreateCommand(name, {
761
+ json: globalOpts.json,
762
+ area: globalOpts.area,
763
+ desc: opts.desc,
764
+ color: opts.color,
765
+ areas: opts.areas,
766
+ });
767
+ });
768
+ orbit
769
+ .command('update <orbit-id-or-slug>')
770
+ .description('Update an orbit (name, description, status, color)')
771
+ .option('--name <name>', 'New name')
772
+ .option('--desc <description>', 'New description')
773
+ .option('--status <status>', 'Status: active, completed, archived')
774
+ .option('--color <hex>', 'Color (#rgb or #rrggbb)')
775
+ .action(async (orbitIdOrSlug, opts, cmd) => {
776
+ const globalOpts = cmd.optsWithGlobals();
777
+ await orbitUpdateCommand(orbitIdOrSlug, {
778
+ json: globalOpts.json,
779
+ area: globalOpts.area,
780
+ name: opts.name,
781
+ desc: opts.desc,
782
+ status: opts.status,
783
+ color: opts.color,
784
+ });
785
+ });
664
786
  orbit
665
787
  .command('items <orbit-id-or-slug>')
666
788
  .description('List all items in an orbit')
667
- .option('--type <type>', 'Filter by type: task, issue, vibe, document')
789
+ .option('--type <type>', 'Filter by type: task, issue, vibe, idea, document')
668
790
  .action(async (orbitIdOrSlug, opts, cmd) => {
669
791
  const globalOpts = cmd.optsWithGlobals();
670
792
  await orbitItemsCommand(orbitIdOrSlug, {
671
793
  json: globalOpts.json,
672
- project: globalOpts.project,
794
+ area: globalOpts.area,
673
795
  type: opts.type,
674
796
  });
675
797
  });
676
798
  orbit
677
799
  .command('attach <orbit-id-or-slug>')
678
800
  .description('Attach an object to an orbit')
679
- .requiredOption('--type <type>', 'Object type: task, issue, vibe, document')
801
+ .requiredOption('--type <type>', 'Object type: task, issue, vibe, idea, document')
680
802
  .requiredOption('--id <uuid>', 'Object UUID')
681
803
  .option('--note <text>', 'Optional note for the attachment')
682
804
  .action(async (orbitIdOrSlug, opts, cmd) => {
683
805
  const globalOpts = cmd.optsWithGlobals();
684
806
  await orbitAttachCommand(orbitIdOrSlug, {
685
807
  json: globalOpts.json,
686
- project: globalOpts.project,
808
+ area: globalOpts.area,
687
809
  type: opts.type,
688
810
  id: opts.id,
689
811
  note: opts.note,
@@ -692,13 +814,250 @@ orbit
692
814
  orbit
693
815
  .command('detach <orbit-id-or-slug>')
694
816
  .description('Detach an object from an orbit')
695
- .requiredOption('--type <type>', 'Object type: task, issue, vibe, document')
817
+ .requiredOption('--type <type>', 'Object type: task, issue, vibe, idea, document')
696
818
  .requiredOption('--id <uuid>', 'Object UUID')
697
819
  .action(async (orbitIdOrSlug, opts, cmd) => {
698
820
  const globalOpts = cmd.optsWithGlobals();
699
821
  await orbitDetachCommand(orbitIdOrSlug, {
700
822
  json: globalOpts.json,
701
- project: globalOpts.project,
823
+ area: globalOpts.area,
824
+ type: opts.type,
825
+ id: opts.id,
826
+ });
827
+ });
828
+ const orbitArea = orbit
829
+ .command('area')
830
+ .description('Manage orbit-area links');
831
+ orbitArea
832
+ .command('link <orbit-id-or-slug> <area-id>')
833
+ .description('Link an area to an orbit')
834
+ .action(async (orbitIdOrSlug, areaId, _opts, cmd) => {
835
+ const globalOpts = cmd.optsWithGlobals();
836
+ await orbitAreaLinkCommand(orbitIdOrSlug, areaId, {
837
+ json: globalOpts.json,
838
+ area: globalOpts.area,
839
+ });
840
+ });
841
+ orbitArea
842
+ .command('unlink <orbit-id-or-slug> <area-id>')
843
+ .description('Unlink an area from an orbit')
844
+ .action(async (orbitIdOrSlug, areaId, _opts, cmd) => {
845
+ const globalOpts = cmd.optsWithGlobals();
846
+ await orbitAreaUnlinkCommand(orbitIdOrSlug, areaId, {
847
+ json: globalOpts.json,
848
+ area: globalOpts.area,
849
+ });
850
+ });
851
+ orbit
852
+ .command('dep <orbit-id-or-slug> <target-orbit-id>')
853
+ .description('Add an orbit-to-orbit dependency (no remove exists in the API)')
854
+ .option('--note <text>', 'Optional note for the dependency')
855
+ .action(async (orbitIdOrSlug, targetOrbitId, opts, cmd) => {
856
+ const globalOpts = cmd.optsWithGlobals();
857
+ await orbitDepAddCommand(orbitIdOrSlug, targetOrbitId, {
858
+ json: globalOpts.json,
859
+ area: globalOpts.area,
860
+ note: opts.note,
861
+ });
862
+ });
863
+ // ── Intent commands ──
864
+ const intent = program
865
+ .command('intent')
866
+ .description('Manage intents (workspace-level desired outcomes)');
867
+ intent
868
+ .command('list')
869
+ .description('List intents')
870
+ .option('--status <statuses>', 'Filter by status (comma-separated; default new,design,plan,build)')
871
+ .option('--limit <n>', 'Limit results')
872
+ .action(async (opts, cmd) => {
873
+ const globalOpts = cmd.optsWithGlobals();
874
+ await intentListCommand({
875
+ json: globalOpts.json,
876
+ area: globalOpts.area,
877
+ status: opts.status,
878
+ limit: opts.limit,
879
+ });
880
+ });
881
+ intent
882
+ .command('show <id-or-number>')
883
+ .description('Show full intent details (UUID or IN-prefixed number)')
884
+ .action(async (idOrNumber, _opts, cmd) => {
885
+ const globalOpts = cmd.optsWithGlobals();
886
+ await intentShowCommand(idOrNumber, {
887
+ json: globalOpts.json,
888
+ area: globalOpts.area,
889
+ });
890
+ });
891
+ intent
892
+ .command('create <title>')
893
+ .description('Create a new intent')
894
+ .option('--outcome <text>', 'Desired outcome')
895
+ .option('--status <status>', 'Initial status: new, design, plan, build, done, cancelled (default new)')
896
+ .option('--orbit <id>', 'Attach the intent to an orbit after creation')
897
+ .action(async (title, opts, cmd) => {
898
+ const globalOpts = cmd.optsWithGlobals();
899
+ await intentCreateCommand(title, {
900
+ json: globalOpts.json,
901
+ area: globalOpts.area,
902
+ outcome: opts.outcome,
903
+ status: opts.status,
904
+ orbit: opts.orbit,
905
+ });
906
+ });
907
+ intent
908
+ .command('update <id-or-number>')
909
+ .description('Update an intent (title, outcome, status)')
910
+ .option('--title <title>', 'New title')
911
+ .option('--outcome <text>', 'New outcome')
912
+ .option('--status <status>', 'Status: new, design, plan, build, done, cancelled')
913
+ .action(async (idOrNumber, opts, cmd) => {
914
+ const globalOpts = cmd.optsWithGlobals();
915
+ await intentUpdateCommand(idOrNumber, {
916
+ json: globalOpts.json,
917
+ area: globalOpts.area,
918
+ title: opts.title,
919
+ outcome: opts.outcome,
920
+ status: opts.status,
921
+ });
922
+ });
923
+ intent
924
+ .command('link <id-or-number>')
925
+ .description('Link a task or issue to an intent')
926
+ .requiredOption('--type <type>', 'Object type: task, issue')
927
+ .requiredOption('--id <uuid>', 'Object UUID')
928
+ .action(async (idOrNumber, opts, cmd) => {
929
+ const globalOpts = cmd.optsWithGlobals();
930
+ await intentLinkCommand(idOrNumber, {
931
+ json: globalOpts.json,
932
+ area: globalOpts.area,
933
+ type: opts.type,
934
+ id: opts.id,
935
+ });
936
+ });
937
+ intent
938
+ .command('unlink <id-or-number>')
939
+ .description('Unlink a task or issue from an intent')
940
+ .requiredOption('--type <type>', 'Object type: task, issue')
941
+ .requiredOption('--id <uuid>', 'Object UUID')
942
+ .action(async (idOrNumber, opts, cmd) => {
943
+ const globalOpts = cmd.optsWithGlobals();
944
+ await intentUnlinkCommand(idOrNumber, {
945
+ json: globalOpts.json,
946
+ area: globalOpts.area,
947
+ type: opts.type,
948
+ id: opts.id,
949
+ });
950
+ });
951
+ intent
952
+ .command('orbit <id-or-number> [orbit-id]')
953
+ .description('Set or clear the orbit of an intent')
954
+ .option('--clear', 'Clear the orbit instead of setting one')
955
+ .action(async (idOrNumber, orbitId, opts, cmd) => {
956
+ const globalOpts = cmd.optsWithGlobals();
957
+ await intentOrbitCommand(idOrNumber, orbitId, {
958
+ json: globalOpts.json,
959
+ area: globalOpts.area,
960
+ clear: opts.clear,
961
+ });
962
+ });
963
+ // ── Mission commands ──
964
+ const mission = program
965
+ .command('mission')
966
+ .description('Manage missions (time-boxed workspace focus)');
967
+ mission
968
+ .command('list')
969
+ .description('List missions')
970
+ .option('--status <statuses>', 'Filter by status (comma-separated; default new,active)')
971
+ .option('--limit <n>', 'Limit results')
972
+ .action(async (opts, cmd) => {
973
+ const globalOpts = cmd.optsWithGlobals();
974
+ await missionListCommand({
975
+ json: globalOpts.json,
976
+ area: globalOpts.area,
977
+ status: opts.status,
978
+ limit: opts.limit,
979
+ });
980
+ });
981
+ mission
982
+ .command('show <id-or-number>')
983
+ .description('Show full mission details (UUID or MS-prefixed number)')
984
+ .action(async (idOrNumber, _opts, cmd) => {
985
+ const globalOpts = cmd.optsWithGlobals();
986
+ await missionShowCommand(idOrNumber, {
987
+ json: globalOpts.json,
988
+ area: globalOpts.area,
989
+ });
990
+ });
991
+ mission
992
+ .command('create <title>')
993
+ .description('Create a new mission (always starts as "new")')
994
+ .option('--desc <description>', 'Mission description')
995
+ .option('--outcome <text>', 'Desired outcome (max 500 chars)')
996
+ .option('--end-date <date>', 'Target end date (YYYY-MM-DD)')
997
+ .action(async (title, opts, cmd) => {
998
+ const globalOpts = cmd.optsWithGlobals();
999
+ await missionCreateCommand(title, {
1000
+ json: globalOpts.json,
1001
+ area: globalOpts.area,
1002
+ desc: opts.desc,
1003
+ outcome: opts.outcome,
1004
+ endDate: opts.endDate,
1005
+ });
1006
+ });
1007
+ mission
1008
+ .command('update <id-or-number>')
1009
+ .description('Update a mission (title, description, outcome, end date)')
1010
+ .option('--title <title>', 'New title')
1011
+ .option('--desc <description>', 'New description')
1012
+ .option('--outcome <text>', 'New outcome')
1013
+ .option('--end-date <date>', 'New end date (YYYY-MM-DD)')
1014
+ .action(async (idOrNumber, opts, cmd) => {
1015
+ const globalOpts = cmd.optsWithGlobals();
1016
+ await missionUpdateCommand(idOrNumber, {
1017
+ json: globalOpts.json,
1018
+ area: globalOpts.area,
1019
+ title: opts.title,
1020
+ desc: opts.desc,
1021
+ outcome: opts.outcome,
1022
+ endDate: opts.endDate,
1023
+ });
1024
+ });
1025
+ mission
1026
+ .command('status <id-or-number> <status>')
1027
+ .description('Set mission lifecycle status (active, completed, cancelled; only one mission can be active)')
1028
+ .option('--move-to <mission-id>', 'Mission to move unfinished work to when completing/cancelling')
1029
+ .action(async (idOrNumber, status, opts, cmd) => {
1030
+ const globalOpts = cmd.optsWithGlobals();
1031
+ await missionStatusCommand(idOrNumber, status, {
1032
+ json: globalOpts.json,
1033
+ area: globalOpts.area,
1034
+ moveTo: opts.moveTo,
1035
+ });
1036
+ });
1037
+ mission
1038
+ .command('link <id-or-number>')
1039
+ .description('Link a task, issue, idea, or intent to a mission (clears intent_id on tasks/issues)')
1040
+ .requiredOption('--type <type>', 'Object type: task, issue, idea, intent')
1041
+ .requiredOption('--id <uuid>', 'Object UUID')
1042
+ .action(async (idOrNumber, opts, cmd) => {
1043
+ const globalOpts = cmd.optsWithGlobals();
1044
+ await missionLinkCommand(idOrNumber, {
1045
+ json: globalOpts.json,
1046
+ area: globalOpts.area,
1047
+ type: opts.type,
1048
+ id: opts.id,
1049
+ });
1050
+ });
1051
+ mission
1052
+ .command('unlink <id-or-number>')
1053
+ .description('Unlink a directly-linked item from a mission')
1054
+ .requiredOption('--type <type>', 'Object type: task, issue, idea, intent')
1055
+ .requiredOption('--id <uuid>', 'Object UUID')
1056
+ .action(async (idOrNumber, opts, cmd) => {
1057
+ const globalOpts = cmd.optsWithGlobals();
1058
+ await missionUnlinkCommand(idOrNumber, {
1059
+ json: globalOpts.json,
1060
+ area: globalOpts.area,
702
1061
  type: opts.type,
703
1062
  id: opts.id,
704
1063
  });
@@ -716,7 +1075,7 @@ dep
716
1075
  const globalOpts = cmd.optsWithGlobals();
717
1076
  await depAddCommand(taskId, targetTaskId, {
718
1077
  json: globalOpts.json,
719
- project: globalOpts.project,
1078
+ area: globalOpts.area,
720
1079
  type: opts.type,
721
1080
  note: opts.note,
722
1081
  });
@@ -729,7 +1088,7 @@ dep
729
1088
  const globalOpts = cmd.optsWithGlobals();
730
1089
  await depRemoveCommand(taskId, targetTaskId, {
731
1090
  json: globalOpts.json,
732
- project: globalOpts.project,
1091
+ area: globalOpts.area,
733
1092
  type: opts.type,
734
1093
  });
735
1094
  });