orbitmap 0.3.0 → 0.4.1
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 +546 -212
- package/dist/adapters/cloud.d.ts +367 -0
- package/dist/adapters/cloud.js +582 -0
- package/dist/adapters/cloud.js.map +1 -0
- package/dist/adapters/factory.d.ts +15 -0
- package/dist/adapters/factory.js +31 -0
- package/dist/adapters/factory.js.map +1 -0
- package/dist/adapters/local/adapter.d.ts +351 -0
- package/dist/adapters/local/adapter.js +346 -0
- package/dist/adapters/local/adapter.js.map +1 -0
- package/dist/adapters/local/context.d.ts +112 -0
- package/dist/adapters/local/context.js +137 -0
- package/dist/adapters/local/context.js.map +1 -0
- package/dist/adapters/local/entities/documents.d.ts +85 -0
- package/dist/adapters/local/entities/documents.js +251 -0
- package/dist/adapters/local/entities/documents.js.map +1 -0
- package/dist/adapters/local/entities/planning.d.ts +108 -0
- package/dist/adapters/local/entities/planning.js +540 -0
- package/dist/adapters/local/entities/planning.js.map +1 -0
- package/dist/adapters/local/entities/tasks.d.ts +95 -0
- package/dist/adapters/local/entities/tasks.js +442 -0
- package/dist/adapters/local/entities/tasks.js.map +1 -0
- package/dist/adapters/local/entities/work-items.d.ts +110 -0
- package/dist/adapters/local/entities/work-items.js +623 -0
- package/dist/adapters/local/entities/work-items.js.map +1 -0
- package/dist/adapters/local/rules.d.ts +172 -0
- package/dist/adapters/local/rules.js +319 -0
- package/dist/adapters/local/rules.js.map +1 -0
- package/dist/adapters/local/shapes.d.ts +209 -0
- package/dist/adapters/local/shapes.js +558 -0
- package/dist/adapters/local/shapes.js.map +1 -0
- package/dist/adapters/local/store.d.ts +200 -0
- package/dist/adapters/local/store.js +665 -0
- package/dist/adapters/local/store.js.map +1 -0
- package/dist/adapters/local/types.d.ts +226 -0
- package/dist/adapters/local/types.js +41 -0
- package/dist/adapters/local/types.js.map +1 -0
- package/dist/adapters/types.d.ts +332 -0
- package/dist/adapters/types.js +2 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/agent-instructions.d.ts +25 -9
- package/dist/agent-instructions.js +285 -237
- package/dist/agent-instructions.js.map +1 -1
- package/dist/api-client.d.ts +8 -239
- package/dist/api-client.js +8 -403
- package/dist/api-client.js.map +1 -1
- package/dist/commands/agents.d.ts +1 -1
- package/dist/commands/agents.js +10 -10
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/areas.d.ts +3 -0
- package/dist/commands/areas.js +29 -0
- package/dist/commands/areas.js.map +1 -0
- package/dist/commands/assign.d.ts +3 -2
- package/dist/commands/assign.js +52 -15
- package/dist/commands/assign.js.map +1 -1
- package/dist/commands/context.d.ts +1 -1
- package/dist/commands/context.js +18 -12
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/create-area.d.ts +7 -0
- package/dist/commands/create-area.js +29 -0
- package/dist/commands/create-area.js.map +1 -0
- package/dist/commands/create.d.ts +3 -1
- package/dist/commands/create.js +5 -8
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dep.d.ts +2 -2
- package/dist/commands/dep.js +3 -3
- package/dist/commands/dep.js.map +1 -1
- package/dist/commands/doc-import.d.ts +1 -1
- package/dist/commands/doc-import.js +2 -2
- package/dist/commands/doc-import.js.map +1 -1
- package/dist/commands/doc-patch.d.ts +1 -1
- package/dist/commands/doc-patch.js +2 -2
- package/dist/commands/doc-patch.js.map +1 -1
- package/dist/commands/doc-share.d.ts +6 -6
- package/dist/commands/doc-share.js +13 -13
- package/dist/commands/doc-share.js.map +1 -1
- package/dist/commands/doc-update.d.ts +1 -1
- package/dist/commands/doc-update.js +2 -2
- package/dist/commands/doc-update.js.map +1 -1
- package/dist/commands/doc.d.ts +1 -1
- package/dist/commands/doc.js +5 -4
- package/dist/commands/doc.js.map +1 -1
- package/dist/commands/docs-cache.d.ts +2 -2
- package/dist/commands/docs-cache.js +3 -3
- package/dist/commands/docs-cache.js.map +1 -1
- package/dist/commands/docs.d.ts +1 -1
- package/dist/commands/docs.js +2 -2
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/get.d.ts +1 -1
- package/dist/commands/get.js +43 -3
- package/dist/commands/get.js.map +1 -1
- package/dist/commands/ideas.d.ts +4 -4
- package/dist/commands/ideas.js +6 -11
- package/dist/commands/ideas.js.map +1 -1
- package/dist/commands/init.d.ts +45 -3
- package/dist/commands/init.js +452 -104
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/intent.d.ts +41 -0
- package/dist/commands/intent.js +237 -0
- package/dist/commands/intent.js.map +1 -0
- package/dist/commands/issues.d.ts +6 -5
- package/dist/commands/issues.js +8 -12
- package/dist/commands/issues.js.map +1 -1
- package/dist/commands/log.d.ts +1 -1
- package/dist/commands/log.js +2 -2
- package/dist/commands/log.js.map +1 -1
- package/dist/commands/mission.d.ts +42 -0
- package/dist/commands/mission.js +219 -0
- package/dist/commands/mission.js.map +1 -0
- package/dist/commands/orbit.d.ts +40 -3
- package/dist/commands/orbit.js +231 -58
- package/dist/commands/orbit.js.map +1 -1
- package/dist/commands/overview.d.ts +2 -2
- package/dist/commands/overview.js +25 -28
- package/dist/commands/overview.js.map +1 -1
- package/dist/commands/setup-agent.d.ts +27 -0
- package/dist/commands/setup-agent.js +85 -30
- package/dist/commands/setup-agent.js.map +1 -1
- package/dist/commands/setup-mcp.d.ts +1 -1
- package/dist/commands/setup-mcp.js +20 -49
- package/dist/commands/setup-mcp.js.map +1 -1
- package/dist/commands/start.d.ts +1 -1
- package/dist/commands/start.js +2 -2
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts +2 -1
- package/dist/commands/status.js +3 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/subtask.d.ts +1 -1
- package/dist/commands/subtask.js +2 -2
- package/dist/commands/subtask.js.map +1 -1
- package/dist/commands/task-edit-content.d.ts +1 -1
- package/dist/commands/task-edit-content.js +2 -2
- package/dist/commands/task-edit-content.js.map +1 -1
- package/dist/commands/task.d.ts +10 -3
- package/dist/commands/task.js +19 -21
- package/dist/commands/task.js.map +1 -1
- package/dist/commands/tasks.d.ts +1 -1
- package/dist/commands/tasks.js +2 -2
- package/dist/commands/tasks.js.map +1 -1
- package/dist/commands/vibes.d.ts +4 -4
- package/dist/commands/vibes.js +5 -5
- package/dist/commands/vibes.js.map +1 -1
- package/dist/config.d.ts +69 -9
- package/dist/config.js +206 -23
- package/dist/config.js.map +1 -1
- package/dist/doc-cache.d.ts +23 -3
- package/dist/doc-cache.js +72 -12
- package/dist/doc-cache.js.map +1 -1
- package/dist/errors.d.ts +19 -2
- package/dist/errors.js +35 -0
- package/dist/errors.js.map +1 -1
- package/dist/id-resolve.d.ts +61 -0
- package/dist/id-resolve.js +87 -0
- package/dist/id-resolve.js.map +1 -0
- package/dist/index.js +477 -104
- package/dist/index.js.map +1 -1
- package/dist/mcp-config.d.ts +36 -0
- package/dist/mcp-config.js +51 -0
- package/dist/mcp-config.js.map +1 -0
- package/dist/oauth.d.ts +8 -0
- package/dist/oauth.js +54 -15
- package/dist/oauth.js.map +1 -1
- package/dist/output.js +7 -2
- package/dist/output.js.map +1 -1
- package/dist/paths.d.ts +97 -0
- package/dist/paths.js +178 -0
- package/dist/paths.js.map +1 -0
- package/dist/project-config.d.ts +75 -0
- package/dist/project-config.js +55 -0
- package/dist/project-config.js.map +1 -0
- package/dist/workspace-resolve.d.ts +158 -0
- package/dist/workspace-resolve.js +284 -0
- package/dist/workspace-resolve.js.map +1 -0
- package/package.json +53 -50
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
3
|
+
import { loadConfig } from './config.js';
|
|
4
|
+
import { OrbitMapAPIError } from './errors.js';
|
|
5
|
+
import { CONFIG_FILENAME, globalConfigReadPath, ORBITMAP_DIR } from './paths.js';
|
|
6
|
+
import { resolveProjectConfigField } from './project-config.js';
|
|
7
|
+
/** Name of the per-project OrbitMap directory (`<project>/.orbitmap`). Defined in
|
|
8
|
+
* `paths.ts` (which owns the project-config walk-up) and re-exported here, where most
|
|
9
|
+
* callers already look for it. */
|
|
10
|
+
export { ORBITMAP_DIR };
|
|
11
|
+
/** Project-local pointer at a workspace living elsewhere on disk. */
|
|
12
|
+
export const LINK_FILE = 'link.json';
|
|
13
|
+
/** Marker file that identifies a directory as a local workspace. */
|
|
14
|
+
export const WORKSPACE_FILE = 'workspace.yml';
|
|
15
|
+
/**
|
|
16
|
+
* Value of the global `--workspace <path>` flag.
|
|
17
|
+
*
|
|
18
|
+
* Commands receive their options from Commander and cannot be changed here, so the
|
|
19
|
+
* program-level flag is captured once in `src/index.ts` (preAction hook) and read back
|
|
20
|
+
* by the resolver. `undefined` means "flag not given".
|
|
21
|
+
*/
|
|
22
|
+
let workspaceFlag;
|
|
23
|
+
export function setWorkspaceFlag(value) {
|
|
24
|
+
workspaceFlag = value && value.length > 0 ? value : undefined;
|
|
25
|
+
}
|
|
26
|
+
export function getWorkspaceFlag() {
|
|
27
|
+
return workspaceFlag;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Walk up from `startDir` to the filesystem root looking for `.orbitmap/link.json`
|
|
31
|
+
* (same discovery behaviour as git). Returns the nearest one, or `undefined`.
|
|
32
|
+
*/
|
|
33
|
+
export function findLinkFile(startDir = process.cwd()) {
|
|
34
|
+
let dir = resolve(startDir);
|
|
35
|
+
for (;;) {
|
|
36
|
+
const candidate = join(dir, ORBITMAP_DIR, LINK_FILE);
|
|
37
|
+
if (existsSync(candidate)) {
|
|
38
|
+
const link = readLinkFile(candidate);
|
|
39
|
+
if (link)
|
|
40
|
+
return { file: candidate, link };
|
|
41
|
+
}
|
|
42
|
+
const parent = dirname(dir);
|
|
43
|
+
if (parent === dir)
|
|
44
|
+
return undefined;
|
|
45
|
+
dir = parent;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Walk up from `startDir` to the filesystem root looking for a directory whose
|
|
50
|
+
* `.orbitmap/` holds a `workspace.yml` — i.e. a local workspace living inside the
|
|
51
|
+
* project. Returns the absolute path of that `.orbitmap` directory, or `undefined`.
|
|
52
|
+
*
|
|
53
|
+
* Same walk-up as {@link findLinkFile} so that a workspace discovered from a nested
|
|
54
|
+
* subdirectory is both what makes the mode local and what the path ladder returns.
|
|
55
|
+
*/
|
|
56
|
+
export function findWorkspaceDir(startDir = process.cwd()) {
|
|
57
|
+
let dir = resolve(startDir);
|
|
58
|
+
for (;;) {
|
|
59
|
+
const candidate = join(dir, ORBITMAP_DIR);
|
|
60
|
+
if (existsSync(join(candidate, WORKSPACE_FILE)))
|
|
61
|
+
return candidate;
|
|
62
|
+
const parent = dirname(dir);
|
|
63
|
+
if (parent === dir)
|
|
64
|
+
return undefined;
|
|
65
|
+
dir = parent;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function readLinkFile(file) {
|
|
69
|
+
try {
|
|
70
|
+
const parsed = JSON.parse(readFileSync(file, 'utf-8'));
|
|
71
|
+
if (typeof parsed !== 'object' || parsed === null)
|
|
72
|
+
return undefined;
|
|
73
|
+
return parsed;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Mode resolution (ADR 0002, extending spec §3.3) — **per project first, global config
|
|
81
|
+
* only as a fallback**, first match wins:
|
|
82
|
+
*
|
|
83
|
+
* 1. `--workspace <path>` flag → local (explicit override, no further checks)
|
|
84
|
+
* 2. `ORBITMAP_MODE=local|cloud` → that mode, for this invocation
|
|
85
|
+
* 3. nearest `.orbitmap/config.json` **that sets `mode`** → that value **[ADR 0002]**
|
|
86
|
+
* 4. local auto-detect: nearest `.orbitmap/link.json` or `.orbitmap/workspace.yml`,
|
|
87
|
+
* walking up from cwd to the filesystem root (as git looks for `.git`) → local
|
|
88
|
+
* 5. global config `mode` (absent or unknown ⇒ `'cloud'`)
|
|
89
|
+
*
|
|
90
|
+
* Rung 3 is resolved **per field** (`resolveProjectConfigField`), not "nearest file wins":
|
|
91
|
+
* a `packages/api/.orbitmap/config.json` that only pins an `agent` does not shadow the
|
|
92
|
+
* repository root's `mode`. See ADR 0002 §2.
|
|
93
|
+
*
|
|
94
|
+
* Rung 3 exists because the whole per-project scoping mechanism (link.json,
|
|
95
|
+
* workspace.yml-based auto-detect) was originally built only for *local* mode — a cloud
|
|
96
|
+
* project had no file of its own to declare itself cloud in, so it depended entirely on
|
|
97
|
+
* rung 5 never being flipped by another project. `.orbitmap/config.json` gives cloud
|
|
98
|
+
* projects that same voice, and it outranks rung 4 on purpose: a project that explicitly
|
|
99
|
+
* declares `mode: "cloud"` must not be dragged back into local mode by a leftover
|
|
100
|
+
* `link.json`/`workspace.yml` in the same directory.
|
|
101
|
+
*
|
|
102
|
+
* Rung 4 is what keeps *un-declared* projects independent: a directory that ran
|
|
103
|
+
* `orbitmap init` → local is local from then on via its own marker file, and a directory
|
|
104
|
+
* that never did keeps resolving through its own config — one project's choice can never
|
|
105
|
+
* flip another's.
|
|
106
|
+
*/
|
|
107
|
+
export function resolveMode(options = {}) {
|
|
108
|
+
if (options.workspace ?? workspaceFlag)
|
|
109
|
+
return 'local';
|
|
110
|
+
const env = (process.env['ORBITMAP_MODE'] ?? '').trim().toLowerCase();
|
|
111
|
+
if (env === 'local' || env === 'cloud')
|
|
112
|
+
return env;
|
|
113
|
+
const cwd = resolve(options.cwd ?? process.cwd());
|
|
114
|
+
const projectMode = resolveProjectConfigField('mode', cwd)?.value;
|
|
115
|
+
if (projectMode)
|
|
116
|
+
return projectMode;
|
|
117
|
+
const link = options.link !== undefined ? options.link : findLinkFile(cwd);
|
|
118
|
+
if (link)
|
|
119
|
+
return 'local';
|
|
120
|
+
if (findWorkspaceDir(cwd))
|
|
121
|
+
return 'local';
|
|
122
|
+
return options.config?.mode === 'local' ? 'local' : 'cloud';
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Workspace directory resolution (§3.3), first match wins:
|
|
126
|
+
* 1. `--workspace <path>` flag
|
|
127
|
+
* 2. `ORBITMAP_WORKSPACE` env var
|
|
128
|
+
* 3. nearest `.orbitmap/link.json` (walking up from cwd) → its `workspace` field
|
|
129
|
+
* 4. nearest `.orbitmap/workspace.yml` (walking up from cwd) → that `.orbitmap`
|
|
130
|
+
* 5. the `.orbitmap/` directory of the nearest project config that sets `mode: "local"`,
|
|
131
|
+
* when that directory is itself a workspace **[ADR 0002]**
|
|
132
|
+
* 6. global config `workspace_path` — **must be absolute** (a relative value is ignored
|
|
133
|
+
* with a warning; see {@link OrbitMapConfig.workspace_path})
|
|
134
|
+
* 7. otherwise: `OrbitMapAPIError` with code `WORKSPACE_NOT_FOUND`
|
|
135
|
+
*
|
|
136
|
+
* Rung 5 is what makes a committed `{"mode": "local"}` usable on its own: without it, a
|
|
137
|
+
* project config that declares local mode has nowhere to point and every command fails with
|
|
138
|
+
* `WORKSPACE_NOT_FOUND`. It usually resolves to the same directory as rung 4 — the point is
|
|
139
|
+
* that it does not *depend* on the auto-detect walk finding the marker first, and that it
|
|
140
|
+
* anchors on the config file that made this project local rather than on the current
|
|
141
|
+
* directory.
|
|
142
|
+
*
|
|
143
|
+
* The returned path is absolute; its existence is not verified (except for rungs 4 and 5,
|
|
144
|
+
* which are defined by the marker file).
|
|
145
|
+
*/
|
|
146
|
+
export function resolveWorkspacePath(options = {}) {
|
|
147
|
+
const cwd = resolve(options.cwd ?? process.cwd());
|
|
148
|
+
const flag = options.workspace ?? workspaceFlag;
|
|
149
|
+
if (flag)
|
|
150
|
+
return resolve(cwd, flag);
|
|
151
|
+
const env = process.env['ORBITMAP_WORKSPACE'];
|
|
152
|
+
if (env)
|
|
153
|
+
return resolve(cwd, env);
|
|
154
|
+
const found = options.link !== undefined ? options.link : findLinkFile(cwd);
|
|
155
|
+
if (found && found.link.workspace) {
|
|
156
|
+
const linked = found.link.workspace;
|
|
157
|
+
return isAbsolute(linked) ? resolve(linked) : resolve(dirname(found.file), linked);
|
|
158
|
+
}
|
|
159
|
+
const local = findWorkspaceDir(cwd);
|
|
160
|
+
if (local)
|
|
161
|
+
return local;
|
|
162
|
+
const declaredLocal = resolveProjectConfigField('mode', cwd);
|
|
163
|
+
if (declaredLocal?.value === 'local') {
|
|
164
|
+
const configDir = dirname(declaredLocal.file);
|
|
165
|
+
if (existsSync(join(configDir, WORKSPACE_FILE)))
|
|
166
|
+
return configDir;
|
|
167
|
+
}
|
|
168
|
+
const configured = options.config?.workspace_path;
|
|
169
|
+
if (configured) {
|
|
170
|
+
if (isAbsolute(configured))
|
|
171
|
+
return resolve(configured);
|
|
172
|
+
warnRelativeWorkspacePath(configured);
|
|
173
|
+
}
|
|
174
|
+
throw OrbitMapAPIError.workspaceNotFound();
|
|
175
|
+
}
|
|
176
|
+
let warnedRelativeWorkspacePath = false;
|
|
177
|
+
/**
|
|
178
|
+
* A relative global `workspace_path` is ignored, not resolved against `process.cwd()`.
|
|
179
|
+
*
|
|
180
|
+
* Resolving it against the current directory would make one machine-wide setting mean a
|
|
181
|
+
* different workspace in every project — the same cross-project leak ADR 0002 removes from
|
|
182
|
+
* `area`, and worse here because it silently points at a directory that does not exist
|
|
183
|
+
* rather than at someone else's data.
|
|
184
|
+
*/
|
|
185
|
+
function warnRelativeWorkspacePath(configured) {
|
|
186
|
+
if (warnedRelativeWorkspacePath)
|
|
187
|
+
return;
|
|
188
|
+
warnedRelativeWorkspacePath = true;
|
|
189
|
+
console.warn(`[orbitmap] Ignoring "workspace_path": "${configured}" in the global config — it must ` +
|
|
190
|
+
'be an absolute path. A relative one would mean a different directory in every ' +
|
|
191
|
+
'project. Use --workspace or ORBITMAP_WORKSPACE for a per-invocation override.');
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Area resolution (ADR 0002, extending spec §3.3), explicit sources only:
|
|
195
|
+
* `--area` → `ORBITMAP_AREA` → `link.json.area` → nearest `.orbitmap/config.json`
|
|
196
|
+
* **that sets `area`** **[ADR 0002]** → global config `area` (deprecated).
|
|
197
|
+
*
|
|
198
|
+
* The project-config rung is per-field (`resolveProjectConfigField`): a nested config that
|
|
199
|
+
* sets only `agent` does not hide an `area` pinned by the repository root.
|
|
200
|
+
*
|
|
201
|
+
* The two remaining rungs — the workspace's own `workspace.yml` `default_area` (which
|
|
202
|
+
* sits *between* the project config and the global config) and "workspace has exactly one
|
|
203
|
+
* area → auto-select it" — require reading the workspace tree and therefore live in the
|
|
204
|
+
* local adapter (`createLocalContext`); this function stays synchronous and file-store-free
|
|
205
|
+
* so that cloud mode never touches a workspace file. The `source` lets the adapter tell an
|
|
206
|
+
* explicit request apart from the machine-wide default.
|
|
207
|
+
*/
|
|
208
|
+
export function resolveArea(options = {}) {
|
|
209
|
+
if (options.area)
|
|
210
|
+
return { area: options.area, source: 'flag' };
|
|
211
|
+
const env = process.env['ORBITMAP_AREA'];
|
|
212
|
+
if (env)
|
|
213
|
+
return { area: env, source: 'env' };
|
|
214
|
+
const cwd = resolve(options.cwd ?? process.cwd());
|
|
215
|
+
const found = options.link !== undefined ? options.link : findLinkFile(cwd);
|
|
216
|
+
if (found?.link.area)
|
|
217
|
+
return { area: found.link.area, source: 'link' };
|
|
218
|
+
const projectArea = resolveProjectConfigField('area', cwd)?.value;
|
|
219
|
+
if (projectArea)
|
|
220
|
+
return { area: projectArea, source: 'project-config' };
|
|
221
|
+
const configured = options.config?.area;
|
|
222
|
+
if (configured) {
|
|
223
|
+
warnDeprecatedGlobalArea();
|
|
224
|
+
return { area: configured, source: 'config' };
|
|
225
|
+
}
|
|
226
|
+
return {};
|
|
227
|
+
}
|
|
228
|
+
let warnedDeprecatedGlobalArea = false;
|
|
229
|
+
/**
|
|
230
|
+
* Warn — once per process — that the deprecated machine-wide `area` rung was used.
|
|
231
|
+
*
|
|
232
|
+
* Deliberately raised from the rung itself rather than from `loadConfig()`: warning on
|
|
233
|
+
* every load nagged users whose global `area` is already shadowed by `ORBITMAP_AREA`, a
|
|
234
|
+
* project config or a `link.json` — i.e. people who have already done what the warning
|
|
235
|
+
* asks — and fired in local mode, where the rung is usually irrelevant.
|
|
236
|
+
*/
|
|
237
|
+
function warnDeprecatedGlobalArea() {
|
|
238
|
+
if (warnedDeprecatedGlobalArea)
|
|
239
|
+
return;
|
|
240
|
+
warnedDeprecatedGlobalArea = true;
|
|
241
|
+
console.warn(`[orbitmap] The "area" in ${globalConfigReadPath()} is deprecated — move it to ` +
|
|
242
|
+
`${ORBITMAP_DIR}/${CONFIG_FILENAME} in the project it belongs to. Still honoured ` +
|
|
243
|
+
'this version; see docs/adr/0002-project-scoped-config.md.');
|
|
244
|
+
}
|
|
245
|
+
/** {@link resolveArea} without the rung — the historical signature. */
|
|
246
|
+
export function resolveAreaSlug(options = {}) {
|
|
247
|
+
return resolveArea(options).area;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Assert that an area was resolved. Adapters call this after their own last-resort
|
|
251
|
+
* auto-selection; `availableAreas` (when known) is surfaced in the error details.
|
|
252
|
+
*/
|
|
253
|
+
export function requireArea(area, availableAreas) {
|
|
254
|
+
if (area)
|
|
255
|
+
return area;
|
|
256
|
+
throw OrbitMapAPIError.areaContextRequired(undefined, availableAreas && availableAreas.length > 0
|
|
257
|
+
? { available_areas: availableAreas }
|
|
258
|
+
: undefined);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Full context resolution. Loads the global config when one is not injected.
|
|
262
|
+
* In cloud mode the workspace directory is not resolved (and never throws
|
|
263
|
+
* `WORKSPACE_NOT_FOUND`).
|
|
264
|
+
*/
|
|
265
|
+
export async function resolveWorkspaceContext(options = {}) {
|
|
266
|
+
const config = options.config ?? (await loadConfig());
|
|
267
|
+
const cwd = resolve(options.cwd ?? process.cwd());
|
|
268
|
+
const link = options.link !== undefined ? options.link : findLinkFile(cwd);
|
|
269
|
+
const opts = { ...options, cwd, config, link };
|
|
270
|
+
const mode = resolveMode(opts);
|
|
271
|
+
const { area, source: areaSource } = resolveArea(opts);
|
|
272
|
+
if (mode !== 'local') {
|
|
273
|
+
return { mode, area, areaSource, link, config };
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
mode,
|
|
277
|
+
workspacePath: resolveWorkspacePath(opts),
|
|
278
|
+
area,
|
|
279
|
+
areaSource,
|
|
280
|
+
link,
|
|
281
|
+
config,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=workspace-resolve.js.map
|
|
@@ -0,0 +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,WAA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I,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC3E,MAAM,IAAI,GAAmB,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAE/D,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAEvD,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAClD,CAAC;IAED,OAAO;QACL,IAAI;QACJ,aAAa,EAAE,oBAAoB,CAAC,IAAI,CAAC;QACzC,IAAI;QACJ,UAAU;QACV,IAAI;QACJ,MAAM;KACP,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "orbitmap",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Project management CLI for AI coding agents — works with Gemini CLI, GPT Codex, Claude Code, and any agent with shell access.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"orbitmap": "./dist/index.js"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"dist/",
|
|
11
|
-
"README.md",
|
|
12
|
-
"LICENSE"
|
|
13
|
-
],
|
|
14
|
-
"engines": {
|
|
15
|
-
"node": ">=18"
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsc",
|
|
19
|
-
"dev": "tsc --watch",
|
|
20
|
-
"test": "vitest run",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "orbitmap",
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "Project management CLI for AI coding agents — works with Gemini CLI, GPT Codex, Claude Code, and any agent with shell access.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"orbitmap": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=18"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"dev": "tsc --watch",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:contract": "vitest run tests/contract",
|
|
22
|
+
"verify": "npm run build && vitest run",
|
|
23
|
+
"prepare": "tsc",
|
|
24
|
+
"context": "node dist/index.js context"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/BTA-Systems/orbitmap-cli.git"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"orbitmap",
|
|
32
|
+
"cli",
|
|
33
|
+
"agent",
|
|
34
|
+
"ai",
|
|
35
|
+
"project-management",
|
|
36
|
+
"task-management",
|
|
37
|
+
"gemini",
|
|
38
|
+
"codex",
|
|
39
|
+
"claude"
|
|
40
|
+
],
|
|
41
|
+
"author": "BTA Systems",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"homepage": "https://orbitmap.ai",
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"commander": "^14.0.3",
|
|
46
|
+
"yaml": "^2.9.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^25.3.0",
|
|
50
|
+
"typescript": "^5.9.3",
|
|
51
|
+
"vitest": "^3.2.4"
|
|
52
|
+
}
|
|
53
|
+
}
|