@maycombhq/openspec-adapter 0.0.0-stage → 2.0.0-beta.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/LICENSE +177 -0
- package/dist/adapter.d.ts +81 -0
- package/dist/adapter.js +249 -0
- package/dist/adapter.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/org-flow.d.ts +38 -0
- package/dist/org-flow.js +286 -0
- package/dist/org-flow.js.map +1 -0
- package/dist/results.d.ts +265 -0
- package/dist/results.js +125 -0
- package/dist/results.js.map +1 -0
- package/dist/stores.d.ts +112 -0
- package/dist/stores.js +249 -0
- package/dist/stores.js.map +1 -0
- package/package.json +28 -3
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results.js","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEpF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3B,CAAC,CAAC;AAEH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAA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G,CAAC,CAAC,WAAW,CAAC;IACtC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;CACnC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC;QACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE;KAC1B,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC"}
|
package/dist/stores.d.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenSpec stores (beta; ADR 0126, an addendum to ADR 0006). A store is an `openspec/` folder in
|
|
3
|
+
* its own Git repo, marked by `.openspec-store/store.yaml`; a code repo names stores it reads
|
|
4
|
+
* under `references:` in its `openspec/config.yaml`. Atticus only writes the marker (to make a
|
|
5
|
+
* metarepo a store, when asked) and adds one `references:` entry (at hand-down, when the org pack
|
|
6
|
+
* asks); it reads stores read-only. It never registers, clones, pulls or pushes a store.
|
|
7
|
+
*
|
|
8
|
+
* The format is beta and may change, so everything about it is in this one file and every read
|
|
9
|
+
* is tolerant: an unknown version or extra key is a note, never a failure.
|
|
10
|
+
*
|
|
11
|
+
* The shape of store.yaml is OpenSpec 1.14.0's (`dist/core/store/foundation.js`,
|
|
12
|
+
* `MetadataStateSchema`, a strict object): `version: 1`, `id` (kebab-case, the store's name) and
|
|
13
|
+
* an optional `remote`. Ids follow its `KEBAB_ID_REGEX` (`dist/core/id.js`). A references entry
|
|
14
|
+
* is a store id, or `{ id, remote }` (`dist/core/project-config.js`, `parseDeclarationList`).
|
|
15
|
+
*/
|
|
16
|
+
/** The marker's folder and file, relative to the store's root (the folder holding openspec/). */
|
|
17
|
+
export declare const STORE_MARKER_DIR = ".openspec-store";
|
|
18
|
+
export declare const STORE_MARKER = ".openspec-store/store.yaml";
|
|
19
|
+
/** The store.yaml version this Atticus writes and fully understands. */
|
|
20
|
+
export declare const STORE_MARKER_VERSION = 1;
|
|
21
|
+
export interface StoreMarker {
|
|
22
|
+
/** The store's name: kebab-case. */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Where teammates clone it from, when known. */
|
|
25
|
+
remote?: string;
|
|
26
|
+
}
|
|
27
|
+
/** A store id OpenSpec accepts made from a name (an org pack name): undefined when none can be. */
|
|
28
|
+
export declare function storeIdOf(name: string): string | undefined;
|
|
29
|
+
/** store.yaml's text for a marker. Throws on an id OpenSpec would refuse. */
|
|
30
|
+
export declare function storeMarkerText(m: StoreMarker): string;
|
|
31
|
+
/**
|
|
32
|
+
* Read store.yaml's text, tolerantly: the id and remote of any version, with a note when the
|
|
33
|
+
* version isn't one this Atticus knows. Never throws.
|
|
34
|
+
*/
|
|
35
|
+
export declare function parseStoreMarker(text: string): {
|
|
36
|
+
marker?: StoreMarker;
|
|
37
|
+
notes: string[];
|
|
38
|
+
};
|
|
39
|
+
/** A folder's store.yaml: `missing` when there is none. Never throws. */
|
|
40
|
+
export declare function readStoreMarker(dir: string): Promise<{
|
|
41
|
+
marker?: StoreMarker;
|
|
42
|
+
notes: string[];
|
|
43
|
+
missing: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Write store.yaml in a folder when it has none. One that is there is never replaced: `present`
|
|
47
|
+
* when it says the same id, `differs` when it names another (its marker is returned).
|
|
48
|
+
*/
|
|
49
|
+
export declare function writeStoreMarker(dir: string, m: StoreMarker): Promise<{
|
|
50
|
+
action: "created" | "present" | "differs";
|
|
51
|
+
marker?: StoreMarker;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Add a store to `references:` in an openspec/config.yaml's text, keeping its comments, order
|
|
55
|
+
* and every other key. An entry for the id that is there already (plain or with a remote) is
|
|
56
|
+
* left as it is. A file that isn't a mapping, or whose references isn't a list, is not changed.
|
|
57
|
+
*/
|
|
58
|
+
export declare function addStoreReference(text: string, ref: StoreMarker): {
|
|
59
|
+
text: string;
|
|
60
|
+
action: "added" | "present";
|
|
61
|
+
} | {
|
|
62
|
+
problem: string;
|
|
63
|
+
};
|
|
64
|
+
export interface StoreChangeEntry {
|
|
65
|
+
id: string;
|
|
66
|
+
/** The proposal's first heading. */
|
|
67
|
+
title?: string;
|
|
68
|
+
/** Ticked and all checkboxes in tasks.md. */
|
|
69
|
+
tasks?: {
|
|
70
|
+
done: number;
|
|
71
|
+
total: number;
|
|
72
|
+
};
|
|
73
|
+
dir: string;
|
|
74
|
+
}
|
|
75
|
+
export interface StoreSpecEntry {
|
|
76
|
+
id: string;
|
|
77
|
+
/** The first line of the spec's Purpose section. */
|
|
78
|
+
purpose?: string;
|
|
79
|
+
file: string;
|
|
80
|
+
}
|
|
81
|
+
/** What Atticus reads from a store: never more than names, titles, task counts and purposes. */
|
|
82
|
+
export interface StoreView {
|
|
83
|
+
/** The store's root (the folder holding openspec/ and .openspec-store/). */
|
|
84
|
+
dir: string;
|
|
85
|
+
/** From store.yaml, when it has one. */
|
|
86
|
+
id?: string;
|
|
87
|
+
remote?: string;
|
|
88
|
+
/** Open changes (not archive/), by id. */
|
|
89
|
+
changes: StoreChangeEntry[];
|
|
90
|
+
specs: StoreSpecEntry[];
|
|
91
|
+
/** What couldn't be read, or was read with a caveat. */
|
|
92
|
+
notes: string[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The first line of a spec's Purpose section: outside code fences, with a heading's closing
|
|
96
|
+
* hashes allowed (as OpenSpec reads it for its references index).
|
|
97
|
+
*/
|
|
98
|
+
export declare function purposeLine(markdown: string): string | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Read a store, read-only: its store.yaml (when there is one), its open changes and its specs.
|
|
101
|
+
* Never throws and never writes; what can't be read becomes a note.
|
|
102
|
+
*/
|
|
103
|
+
export declare function readStore(dir: string): Promise<StoreView>;
|
|
104
|
+
/**
|
|
105
|
+
* Whether an OpenSpec CLI has stores (`openspec store --help` runs). The bundled, pinned one by
|
|
106
|
+
* default. Offline: no telemetry, no update check.
|
|
107
|
+
*/
|
|
108
|
+
export declare function openspecHasStores(o?: {
|
|
109
|
+
bin?: string;
|
|
110
|
+
env?: NodeJS.ProcessEnv;
|
|
111
|
+
timeoutMs?: number;
|
|
112
|
+
}): Promise<boolean>;
|
package/dist/stores.js
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { mkdir, readdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { isMap, isScalar, isSeq, parse, parseDocument, stringify } from "yaml";
|
|
5
|
+
import { bundledOpenSpecBin, openspecEnv } from "./adapter.js";
|
|
6
|
+
/**
|
|
7
|
+
* OpenSpec stores (beta; ADR 0126, an addendum to ADR 0006). A store is an `openspec/` folder in
|
|
8
|
+
* its own Git repo, marked by `.openspec-store/store.yaml`; a code repo names stores it reads
|
|
9
|
+
* under `references:` in its `openspec/config.yaml`. Atticus only writes the marker (to make a
|
|
10
|
+
* metarepo a store, when asked) and adds one `references:` entry (at hand-down, when the org pack
|
|
11
|
+
* asks); it reads stores read-only. It never registers, clones, pulls or pushes a store.
|
|
12
|
+
*
|
|
13
|
+
* The format is beta and may change, so everything about it is in this one file and every read
|
|
14
|
+
* is tolerant: an unknown version or extra key is a note, never a failure.
|
|
15
|
+
*
|
|
16
|
+
* The shape of store.yaml is OpenSpec 1.14.0's (`dist/core/store/foundation.js`,
|
|
17
|
+
* `MetadataStateSchema`, a strict object): `version: 1`, `id` (kebab-case, the store's name) and
|
|
18
|
+
* an optional `remote`. Ids follow its `KEBAB_ID_REGEX` (`dist/core/id.js`). A references entry
|
|
19
|
+
* is a store id, or `{ id, remote }` (`dist/core/project-config.js`, `parseDeclarationList`).
|
|
20
|
+
*/
|
|
21
|
+
/** The marker's folder and file, relative to the store's root (the folder holding openspec/). */
|
|
22
|
+
export const STORE_MARKER_DIR = ".openspec-store";
|
|
23
|
+
export const STORE_MARKER = `${STORE_MARKER_DIR}/store.yaml`;
|
|
24
|
+
/** The store.yaml version this Atticus writes and fully understands. */
|
|
25
|
+
export const STORE_MARKER_VERSION = 1;
|
|
26
|
+
const KEBAB = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
27
|
+
/** A store id OpenSpec accepts made from a name (an org pack name): undefined when none can be. */
|
|
28
|
+
export function storeIdOf(name) {
|
|
29
|
+
const id = name
|
|
30
|
+
.toLowerCase()
|
|
31
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
32
|
+
.replace(/^-+|-+$/g, "");
|
|
33
|
+
return id && KEBAB.test(id) ? id : undefined;
|
|
34
|
+
}
|
|
35
|
+
/** store.yaml's text for a marker. Throws on an id OpenSpec would refuse. */
|
|
36
|
+
export function storeMarkerText(m) {
|
|
37
|
+
if (!KEBAB.test(m.id))
|
|
38
|
+
throw new Error(`"${m.id}" can't be an OpenSpec store id: it must be kebab-case (lowercase letters, numbers, single hyphens)`);
|
|
39
|
+
return stringify({
|
|
40
|
+
version: STORE_MARKER_VERSION,
|
|
41
|
+
id: m.id,
|
|
42
|
+
...(m.remote ? { remote: m.remote } : {}),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Read store.yaml's text, tolerantly: the id and remote of any version, with a note when the
|
|
47
|
+
* version isn't one this Atticus knows. Never throws.
|
|
48
|
+
*/
|
|
49
|
+
export function parseStoreMarker(text) {
|
|
50
|
+
let raw;
|
|
51
|
+
try {
|
|
52
|
+
raw = parse(text);
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
return { notes: [`store.yaml isn't YAML: ${e.message.split("\n")[0]}`] };
|
|
56
|
+
}
|
|
57
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
58
|
+
return { notes: ["store.yaml isn't a mapping"] };
|
|
59
|
+
const o = raw;
|
|
60
|
+
const notes = [];
|
|
61
|
+
if (o.version !== STORE_MARKER_VERSION)
|
|
62
|
+
notes.push(`store.yaml is version ${String(o.version ?? "(none)")}, newer than the version ${STORE_MARKER_VERSION} Atticus knows; read its id and remote only (the store format is beta)`);
|
|
63
|
+
if (typeof o.id !== "string" || !o.id)
|
|
64
|
+
return { notes: [...notes, "store.yaml has no id"] };
|
|
65
|
+
return {
|
|
66
|
+
marker: {
|
|
67
|
+
id: o.id,
|
|
68
|
+
...(typeof o.remote === "string" && o.remote ? { remote: o.remote } : {}),
|
|
69
|
+
},
|
|
70
|
+
notes,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** A folder's store.yaml: `missing` when there is none. Never throws. */
|
|
74
|
+
export async function readStoreMarker(dir) {
|
|
75
|
+
let text;
|
|
76
|
+
try {
|
|
77
|
+
text = await readFile(join(dir, STORE_MARKER_DIR, "store.yaml"), "utf8");
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return { missing: true, notes: [] };
|
|
81
|
+
}
|
|
82
|
+
return { ...parseStoreMarker(text), missing: false };
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Write store.yaml in a folder when it has none. One that is there is never replaced: `present`
|
|
86
|
+
* when it says the same id, `differs` when it names another (its marker is returned).
|
|
87
|
+
*/
|
|
88
|
+
export async function writeStoreMarker(dir, m) {
|
|
89
|
+
const text = storeMarkerText(m);
|
|
90
|
+
const have = await readStoreMarker(dir);
|
|
91
|
+
if (!have.missing)
|
|
92
|
+
return {
|
|
93
|
+
action: have.marker?.id === m.id ? "present" : "differs",
|
|
94
|
+
...(have.marker ? { marker: have.marker } : {}),
|
|
95
|
+
};
|
|
96
|
+
await mkdir(join(dir, STORE_MARKER_DIR), { recursive: true });
|
|
97
|
+
await writeFile(join(dir, STORE_MARKER_DIR, "store.yaml"), text, {
|
|
98
|
+
encoding: "utf8",
|
|
99
|
+
flag: "wx",
|
|
100
|
+
});
|
|
101
|
+
return { action: "created", marker: { id: m.id, ...(m.remote ? { remote: m.remote } : {}) } };
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Add a store to `references:` in an openspec/config.yaml's text, keeping its comments, order
|
|
105
|
+
* and every other key. An entry for the id that is there already (plain or with a remote) is
|
|
106
|
+
* left as it is. A file that isn't a mapping, or whose references isn't a list, is not changed.
|
|
107
|
+
*/
|
|
108
|
+
export function addStoreReference(text, ref) {
|
|
109
|
+
const parsed = parseDocument(text);
|
|
110
|
+
if (parsed.errors.length)
|
|
111
|
+
return {
|
|
112
|
+
problem: `openspec/config.yaml isn't YAML: ${parsed.errors[0].message.split("\n")[0]}`,
|
|
113
|
+
};
|
|
114
|
+
// An empty file is an empty mapping; the document is edited as a plain one from here.
|
|
115
|
+
const doc = parsed;
|
|
116
|
+
if (doc.contents === null || doc.contents === undefined)
|
|
117
|
+
doc.contents = doc.createNode({});
|
|
118
|
+
if (!isMap(doc.contents))
|
|
119
|
+
return { problem: "openspec/config.yaml isn't a mapping; left as it is" };
|
|
120
|
+
const entry = ref.remote ? { id: ref.id, remote: ref.remote } : ref.id;
|
|
121
|
+
const list = doc.get("references", true);
|
|
122
|
+
if (list === undefined || list === null || (isScalar(list) && list.value === null)) {
|
|
123
|
+
doc.set("references", doc.createNode([entry]));
|
|
124
|
+
return { text: doc.toString(), action: "added" };
|
|
125
|
+
}
|
|
126
|
+
if (!isSeq(list))
|
|
127
|
+
return { problem: "references: in openspec/config.yaml isn't a list; left as it is" };
|
|
128
|
+
const idOf = (item) => isScalar(item) ? item.value : isMap(item) ? item.get("id") : undefined;
|
|
129
|
+
if (list.items.some((i) => idOf(i) === ref.id))
|
|
130
|
+
return { text, action: "present" };
|
|
131
|
+
list.add(doc.createNode(entry));
|
|
132
|
+
return { text: doc.toString(), action: "added" };
|
|
133
|
+
}
|
|
134
|
+
const isDir = (p) => stat(p).then((s) => s.isDirectory(), () => false);
|
|
135
|
+
async function subdirs(dir) {
|
|
136
|
+
try {
|
|
137
|
+
return (await readdir(dir, { withFileTypes: true }))
|
|
138
|
+
.filter((d) => d.isDirectory() && !d.name.startsWith("."))
|
|
139
|
+
.map((d) => d.name)
|
|
140
|
+
.sort();
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The first line of a spec's Purpose section: outside code fences, with a heading's closing
|
|
148
|
+
* hashes allowed (as OpenSpec reads it for its references index).
|
|
149
|
+
*/
|
|
150
|
+
export function purposeLine(markdown) {
|
|
151
|
+
let fence;
|
|
152
|
+
let inPurpose = false;
|
|
153
|
+
for (const line of markdown.split(/\r?\n/)) {
|
|
154
|
+
const f = /^\s*(```|~~~)/.exec(line);
|
|
155
|
+
if (f) {
|
|
156
|
+
if (fence === undefined)
|
|
157
|
+
fence = f[1];
|
|
158
|
+
else if (f[1] === fence)
|
|
159
|
+
fence = undefined;
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (fence !== undefined)
|
|
163
|
+
continue;
|
|
164
|
+
const h = /^#{1,6}\s+(.*?)(?:\s+#+)?\s*$/.exec(line);
|
|
165
|
+
if (h) {
|
|
166
|
+
if (inPurpose)
|
|
167
|
+
return undefined;
|
|
168
|
+
inPurpose = h[1].trim().toLowerCase() === "purpose";
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if (inPurpose && line.trim())
|
|
172
|
+
return line.trim();
|
|
173
|
+
}
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Read a store, read-only: its store.yaml (when there is one), its open changes and its specs.
|
|
178
|
+
* Never throws and never writes; what can't be read becomes a note.
|
|
179
|
+
*/
|
|
180
|
+
export async function readStore(dir) {
|
|
181
|
+
const view = { dir, changes: [], specs: [], notes: [] };
|
|
182
|
+
if (!(await isDir(dir))) {
|
|
183
|
+
view.notes.push(`${dir} isn't there`);
|
|
184
|
+
return view;
|
|
185
|
+
}
|
|
186
|
+
const m = await readStoreMarker(dir);
|
|
187
|
+
if (m.missing)
|
|
188
|
+
view.notes.push(`no ${STORE_MARKER}: read as a plain OpenSpec folder`);
|
|
189
|
+
view.notes.push(...m.notes);
|
|
190
|
+
if (m.marker) {
|
|
191
|
+
view.id = m.marker.id;
|
|
192
|
+
if (m.marker.remote)
|
|
193
|
+
view.remote = m.marker.remote;
|
|
194
|
+
}
|
|
195
|
+
const os = join(dir, "openspec");
|
|
196
|
+
if (!(await isDir(os))) {
|
|
197
|
+
view.notes.push("no openspec/ folder: nothing to read");
|
|
198
|
+
return view;
|
|
199
|
+
}
|
|
200
|
+
for (const id of await subdirs(join(os, "changes"))) {
|
|
201
|
+
if (id === "archive")
|
|
202
|
+
continue;
|
|
203
|
+
const cdir = join(os, "changes", id);
|
|
204
|
+
const proposal = await readFile(join(cdir, "proposal.md"), "utf8").catch(() => "");
|
|
205
|
+
const title = /^#\s+(.+?)\s*#*\s*$/m.exec(proposal)?.[1];
|
|
206
|
+
const tasks = await readFile(join(cdir, "tasks.md"), "utf8").catch(() => undefined);
|
|
207
|
+
const boxes = tasks ? [...tasks.matchAll(/^\s*[-*]\s+\[([ xX])\]/gm)].map((x) => x[1]) : [];
|
|
208
|
+
view.changes.push({
|
|
209
|
+
id,
|
|
210
|
+
...(title ? { title } : {}),
|
|
211
|
+
...(boxes.length
|
|
212
|
+
? { tasks: { done: boxes.filter((b) => b !== " ").length, total: boxes.length } }
|
|
213
|
+
: {}),
|
|
214
|
+
dir: cdir,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
for (const id of await subdirs(join(os, "specs"))) {
|
|
218
|
+
const file = join(os, "specs", id, "spec.md");
|
|
219
|
+
const text = await readFile(file, "utf8").catch(() => undefined);
|
|
220
|
+
if (text === undefined)
|
|
221
|
+
continue;
|
|
222
|
+
const purpose = purposeLine(text);
|
|
223
|
+
view.specs.push({ id, ...(purpose ? { purpose } : {}), file });
|
|
224
|
+
}
|
|
225
|
+
return view;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Whether an OpenSpec CLI has stores (`openspec store --help` runs). The bundled, pinned one by
|
|
229
|
+
* default. Offline: no telemetry, no update check.
|
|
230
|
+
*/
|
|
231
|
+
export function openspecHasStores(o = {}) {
|
|
232
|
+
return new Promise((done) => {
|
|
233
|
+
let bin;
|
|
234
|
+
try {
|
|
235
|
+
bin = o.bin ?? bundledOpenSpecBin();
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
done(false);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
execFile(process.execPath, [bin, "store", "--help"], {
|
|
242
|
+
env: openspecEnv(o.env),
|
|
243
|
+
timeout: o.timeoutMs ?? 30_000,
|
|
244
|
+
windowsHide: true,
|
|
245
|
+
encoding: "utf8",
|
|
246
|
+
}, (err, stdout) => done(!err && /\bregister\b/.test(stdout)));
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=stores.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stores.js","sourceRoot":"","sources":["../src/stores.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAA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,IAAI,CAAC,MAAM,CAAC,CAAC,CAC3D,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maycombhq/openspec-adapter",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
|
+
"description": "Atticus's only door to OpenSpec: a wrapper over OpenSpec's stable CLI, the org-flow workflow schema, and contract tests.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@fission-ai/openspec": "1.14.0",
|
|
20
|
+
"yaml": "^2.9.1",
|
|
21
|
+
"zod": "^4.6.0"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc -p tsconfig.build.json",
|
|
28
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
29
|
+
"test": "vitest run --config ../../vitest.shared.mjs --fsModuleCachePath=node_modules/.vitest-cache --testTimeout=30000 --hookTimeout=60000"
|
|
30
|
+
}
|
|
6
31
|
}
|
package/README.md
DELETED