@agent-ix/quoin 0.5.4 → 0.6.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.
- package/.codex-plugin/plugin.json +18 -1
- package/README.md +44 -4
- package/bin/quoin.js +11 -5
- package/dist/base-B_MXqS0S.js +137 -0
- package/dist/base.d.ts +23 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/cli.d.ts +17 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +20 -2
- package/dist/commands/catalog/index.d.ts +2 -0
- package/dist/commands/catalog/index.d.ts.map +1 -0
- package/dist/commands/catalog/index.js +2 -0
- package/dist/commands/catalog/list.d.ts +11 -0
- package/dist/commands/catalog/list.d.ts.map +1 -0
- package/dist/commands/catalog/list.js +22 -0
- package/dist/commands/catalog/show.d.ts +13 -0
- package/dist/commands/catalog/show.d.ts.map +1 -0
- package/dist/commands/catalog/show.js +25 -0
- package/dist/commands/catalog/validate.d.ts +10 -0
- package/dist/commands/catalog/validate.d.ts.map +1 -0
- package/dist/commands/catalog/validate.js +27 -0
- package/dist/commands/config/doctor.d.ts +7 -0
- package/dist/commands/config/doctor.d.ts.map +1 -0
- package/dist/commands/config/doctor.js +15 -0
- package/dist/commands/config/edit.d.ts +7 -0
- package/dist/commands/config/edit.d.ts.map +1 -0
- package/dist/commands/config/edit.js +13 -0
- package/dist/commands/config/get.d.ts +11 -0
- package/dist/commands/config/get.d.ts.map +1 -0
- package/dist/commands/config/get.js +20 -0
- package/dist/commands/config/index.d.ts +2 -0
- package/dist/commands/config/index.d.ts.map +1 -0
- package/dist/commands/config/index.js +2 -0
- package/dist/commands/config/set.d.ts +12 -0
- package/dist/commands/config/set.d.ts.map +1 -0
- package/dist/commands/config/set.js +26 -0
- package/dist/commands/matrix.d.ts +14 -0
- package/dist/commands/matrix.d.ts.map +1 -0
- package/dist/commands/matrix.js +15 -0
- package/dist/commands/module/ensure-defaults.d.ts +8 -0
- package/dist/commands/module/ensure-defaults.d.ts.map +1 -0
- package/dist/commands/module/ensure-defaults.js +17 -0
- package/dist/commands/module/index.d.ts +2 -0
- package/dist/commands/module/index.d.ts.map +1 -0
- package/dist/commands/module/index.js +2 -0
- package/dist/commands/module/install.d.ts +11 -0
- package/dist/commands/module/install.d.ts.map +1 -0
- package/dist/commands/module/install.js +22 -0
- package/dist/commands/module/list.d.ts +8 -0
- package/dist/commands/module/list.d.ts.map +1 -0
- package/dist/commands/module/list.js +13 -0
- package/dist/commands/module/remove.d.ts +10 -0
- package/dist/commands/module/remove.d.ts.map +1 -0
- package/dist/commands/module/remove.js +16 -0
- package/dist/commands/plugin/deprecation.d.ts +10 -0
- package/dist/commands/plugin/deprecation.d.ts.map +1 -0
- package/dist/commands/plugin/ensure-defaults.d.ts +8 -0
- package/dist/commands/plugin/ensure-defaults.d.ts.map +1 -0
- package/dist/commands/plugin/ensure-defaults.js +12 -0
- package/dist/commands/plugin/index.d.ts +2 -0
- package/dist/commands/plugin/index.d.ts.map +1 -0
- package/dist/commands/plugin/index.js +2 -0
- package/dist/commands/plugin/install.d.ts +8 -0
- package/dist/commands/plugin/install.d.ts.map +1 -0
- package/dist/commands/plugin/install.js +12 -0
- package/dist/commands/plugin/list.d.ts +8 -0
- package/dist/commands/plugin/list.d.ts.map +1 -0
- package/dist/commands/plugin/list.js +12 -0
- package/dist/commands/plugin/remove.d.ts +8 -0
- package/dist/commands/plugin/remove.d.ts.map +1 -0
- package/dist/commands/plugin/remove.js +12 -0
- package/dist/commands/review.d.ts +14 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +15 -0
- package/dist/commands/to-plan.d.ts +14 -0
- package/dist/commands/to-plan.d.ts.map +1 -0
- package/dist/commands/to-plan.js +15 -0
- package/dist/commands/update.d.ts +13 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +34 -0
- package/dist/commands/write.d.ts +16 -0
- package/dist/commands/write.d.ts.map +1 -0
- package/dist/commands/write.js +33 -0
- package/dist/config-schema-Dp-vlxuR.js +13 -0
- package/dist/config-schema.d.ts +52 -0
- package/dist/config-schema.d.ts.map +1 -0
- package/dist/deprecation-fRxUHoxv.js +4 -0
- package/dist/flow-command-DTPkcpHy.js +88 -0
- package/dist/flow-command.d.ts +25 -0
- package/dist/flow-command.d.ts.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -2
- package/dist/modules-BcFs6dmB.js +22 -0
- package/dist/org.d.ts +61 -0
- package/dist/org.d.ts.map +1 -0
- package/dist/plugins-ica0OxAT.js +77 -0
- package/dist/version-BF9oqMYd.js +17 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/write-CLwhJDM2.js +156 -0
- package/dist/write.d.ts +7 -1
- package/dist/write.d.ts.map +1 -1
- package/package.json +34 -3
- package/skills/spec-to-plan/SKILL.md +5 -2
- package/skills/spec-to-plan/references/step-1-analysis.md +10 -0
- package/skills/spec-to-plan/references/step-2-test-plan.md +4 -0
- package/skills/spec-to-plan/references/step-3-execution-plan.md +36 -23
- package/skills/specify/SKILL.md +5 -0
- package/skills/specify/assets/app-spec-template.md +1 -1
- package/skills/specify/assets/spec-template.md +1 -1
- package/dist/cli-Dk-aYzJo.js +0 -461
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: master-requirements
|
|
3
3
|
name: <component-name> # Required: repo/component name
|
|
4
|
-
org: <your-org> # Required: owning
|
|
4
|
+
org: <your-org> # Required: owning org — use the `Org:` quoin write reports
|
|
5
5
|
component_type: fastapi-service # Canonical type (fastapi-service, react-lib, etc.)
|
|
6
6
|
tags: # Optional capabilities
|
|
7
7
|
- postgres
|
package/dist/cli-Dk-aYzJo.js
DELETED
|
@@ -1,461 +0,0 @@
|
|
|
1
|
-
import { existsSync as e, readFileSync as t, readdirSync as n, rmSync as r, statSync as i } from "node:fs";
|
|
2
|
-
import { basename as a, dirname as o, join as s, resolve as c } from "node:path";
|
|
3
|
-
import { fileURLToPath as l } from "node:url";
|
|
4
|
-
import { configureRuntimeContext as u, maybeOfferUpdate as d, runSelfUpdate as f } from "@agent-ix/ix-cli-core";
|
|
5
|
-
import { homedir as p } from "node:os";
|
|
6
|
-
import { parse as m } from "yaml";
|
|
7
|
-
import { installEntry as ee, readRegistry as h, reconcile as te, validateMarketplaceManifest as g, writeRegistry as ne } from "@agent-ix/ts-plugin-kit";
|
|
8
|
-
import { spawn as re } from "node:child_process";
|
|
9
|
-
//#region src/catalog.ts
|
|
10
|
-
function _() {
|
|
11
|
-
return process.env.IX_HOME && process.env.IX_HOME.length > 0 ? process.env.IX_HOME : s(p(), ".ix");
|
|
12
|
-
}
|
|
13
|
-
function v(e = _()) {
|
|
14
|
-
return s(e, "filament", "modules");
|
|
15
|
-
}
|
|
16
|
-
function y(t = _()) {
|
|
17
|
-
let r = [], i = process.env.QUOIN_MODULE_PATHS;
|
|
18
|
-
i && r.push(...i.split(":").filter(Boolean));
|
|
19
|
-
let a = v(t);
|
|
20
|
-
if (e(a)) for (let e of n(a)) r.push(s(a, e));
|
|
21
|
-
return r;
|
|
22
|
-
}
|
|
23
|
-
function b(e = y()) {
|
|
24
|
-
let n = [], r = [], i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
25
|
-
for (let c of e) {
|
|
26
|
-
let e = C(c);
|
|
27
|
-
if (!e || i.has(e)) continue;
|
|
28
|
-
i.add(e);
|
|
29
|
-
let l = m(t(s(e, "manifest.yaml"), "utf8")), u = E(l.name) ?? a(e);
|
|
30
|
-
if (o.has(u)) continue;
|
|
31
|
-
o.add(u);
|
|
32
|
-
let d = T(l.artifact_types), f = T(l.object_types);
|
|
33
|
-
n.push({
|
|
34
|
-
name: u,
|
|
35
|
-
version: E(l.version),
|
|
36
|
-
root: e,
|
|
37
|
-
artifactTypes: d.map((e) => String(e.name)),
|
|
38
|
-
objectTypes: f.map((e) => String(e.name))
|
|
39
|
-
});
|
|
40
|
-
for (let t of d) {
|
|
41
|
-
let n = String(t.name), i = E(t.frontmatter_schema_ref);
|
|
42
|
-
r.push({
|
|
43
|
-
name: n,
|
|
44
|
-
kind: "artifact",
|
|
45
|
-
moduleName: u,
|
|
46
|
-
moduleRoot: e,
|
|
47
|
-
schemaRef: i,
|
|
48
|
-
schemaPath: i ? s(e, i) : void 0,
|
|
49
|
-
skeletonPath: w(e, n)
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
for (let t of f) {
|
|
53
|
-
let n = String(t.name);
|
|
54
|
-
r.push({
|
|
55
|
-
name: n,
|
|
56
|
-
kind: "object",
|
|
57
|
-
moduleName: u,
|
|
58
|
-
moduleRoot: e,
|
|
59
|
-
skeletonPath: w(e, n)
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
modules: n,
|
|
65
|
-
entries: r,
|
|
66
|
-
duplicates: ie(r)
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function x(e, t) {
|
|
70
|
-
let n = S(t);
|
|
71
|
-
return e.entries.find((e) => S(e.name) === n);
|
|
72
|
-
}
|
|
73
|
-
function S(e) {
|
|
74
|
-
return e.toLowerCase();
|
|
75
|
-
}
|
|
76
|
-
function C(t) {
|
|
77
|
-
let r = c(t);
|
|
78
|
-
if (e(r)) {
|
|
79
|
-
if (e(s(r, "manifest.yaml"))) return r;
|
|
80
|
-
if (i(r).isDirectory()) for (let t of n(r)) {
|
|
81
|
-
let n = s(r, t);
|
|
82
|
-
if (e(s(n, "manifest.yaml"))) return n;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function w(t, n) {
|
|
87
|
-
return [s(t, "skeletons", `${n}.md`), s(t, "skeletons", `${n.toLowerCase()}.md`)].find((t) => e(t));
|
|
88
|
-
}
|
|
89
|
-
function T(e) {
|
|
90
|
-
return Array.isArray(e) ? e.filter((e) => !!e && typeof e == "object" && "name" in e) : [];
|
|
91
|
-
}
|
|
92
|
-
function E(e) {
|
|
93
|
-
return typeof e == "string" ? e : void 0;
|
|
94
|
-
}
|
|
95
|
-
function ie(e) {
|
|
96
|
-
let t = /* @__PURE__ */ new Map();
|
|
97
|
-
for (let n of e) {
|
|
98
|
-
let e = `${n.kind}:${n.name}`, r = t.get(e) ?? /* @__PURE__ */ new Set();
|
|
99
|
-
r.add(n.moduleName), t.set(e, r);
|
|
100
|
-
}
|
|
101
|
-
return [...t.entries()].filter(([, e]) => e.size > 1).map(([e, t]) => {
|
|
102
|
-
let [n, r] = e.split(":");
|
|
103
|
-
return {
|
|
104
|
-
kind: n,
|
|
105
|
-
name: r,
|
|
106
|
-
modules: [...t].sort()
|
|
107
|
-
};
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/plugins.ts
|
|
112
|
-
function D(e = _()) {
|
|
113
|
-
return s(e, "filament", "registry.json");
|
|
114
|
-
}
|
|
115
|
-
function O(e) {
|
|
116
|
-
return {
|
|
117
|
-
cacheRoot: s(e, "cache", "ts-plugin-kit"),
|
|
118
|
-
targetRoot: v(e),
|
|
119
|
-
registryPath: D(e),
|
|
120
|
-
readName: N,
|
|
121
|
-
materialize: "copy"
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
function k(e) {
|
|
125
|
-
if (e.startsWith("path:")) return {
|
|
126
|
-
type: "path",
|
|
127
|
-
path: e.slice(5)
|
|
128
|
-
};
|
|
129
|
-
if (e.startsWith("github:")) {
|
|
130
|
-
let [t, n] = e.slice(7).split("@"), r = t.indexOf("//");
|
|
131
|
-
return r === -1 ? {
|
|
132
|
-
type: "github",
|
|
133
|
-
repo: t,
|
|
134
|
-
ref: n
|
|
135
|
-
} : {
|
|
136
|
-
type: "git-subdir",
|
|
137
|
-
url: t.slice(0, r),
|
|
138
|
-
path: t.slice(r + 2),
|
|
139
|
-
ref: n
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
if (e.startsWith("package:")) {
|
|
143
|
-
let t = e.slice(8), n = t.lastIndexOf("@");
|
|
144
|
-
return n > 0 ? {
|
|
145
|
-
type: "npm",
|
|
146
|
-
package: t.slice(0, n),
|
|
147
|
-
version: t.slice(n + 1)
|
|
148
|
-
} : {
|
|
149
|
-
type: "npm",
|
|
150
|
-
package: t
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
type: "path",
|
|
155
|
-
path: e
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
function A(e, t = _()) {
|
|
159
|
-
return ee({ source: k(e) }, O(t));
|
|
160
|
-
}
|
|
161
|
-
function j(e = _()) {
|
|
162
|
-
return h(D(e)).plugins;
|
|
163
|
-
}
|
|
164
|
-
function M(e, t = _()) {
|
|
165
|
-
let n = h(D(t));
|
|
166
|
-
r(s(v(t), e), {
|
|
167
|
-
force: !0,
|
|
168
|
-
recursive: !0
|
|
169
|
-
}), ne(D(t), {
|
|
170
|
-
schemaVersion: 1,
|
|
171
|
-
plugins: n.plugins.filter((t) => t.name !== e)
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
function N(n) {
|
|
175
|
-
let r = e(s(n, "manifest.yaml")) ? s(n, "manifest.yaml") : s(n, a(n), "manifest.yaml");
|
|
176
|
-
if (!e(r)) throw Error(`no manifest.yaml found under ${n}`);
|
|
177
|
-
let i = m(t(r, "utf8"));
|
|
178
|
-
if (typeof i.name != "string" || i.name.length === 0) throw Error(`manifest ${r} has no name`);
|
|
179
|
-
return i.name;
|
|
180
|
-
}
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region src/modules.ts
|
|
183
|
-
function P() {
|
|
184
|
-
return o(o(l(import.meta.url)));
|
|
185
|
-
}
|
|
186
|
-
function F() {
|
|
187
|
-
return g(m(t(s(P(), "default-modules.yaml"), "utf8")));
|
|
188
|
-
}
|
|
189
|
-
function I(e = _(), t = F()) {
|
|
190
|
-
te(t, {
|
|
191
|
-
...O(e),
|
|
192
|
-
mode: "lazy"
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
//#endregion
|
|
196
|
-
//#region src/flows.ts
|
|
197
|
-
var L = {
|
|
198
|
-
review: {
|
|
199
|
-
packageSkill: "spec-review",
|
|
200
|
-
runtimeSkill: "review"
|
|
201
|
-
},
|
|
202
|
-
matrix: {
|
|
203
|
-
packageSkill: "spec-matrix",
|
|
204
|
-
runtimeSkill: "matrix"
|
|
205
|
-
},
|
|
206
|
-
"to-plan": {
|
|
207
|
-
packageSkill: "spec-to-plan",
|
|
208
|
-
runtimeSkill: "to-plan"
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
function R() {
|
|
212
|
-
return Object.keys(L);
|
|
213
|
-
}
|
|
214
|
-
async function ae(e, t = {}) {
|
|
215
|
-
let n = oe(e), r = _(), i = [
|
|
216
|
-
"run",
|
|
217
|
-
e,
|
|
218
|
-
"--path",
|
|
219
|
-
n,
|
|
220
|
-
"--config-root",
|
|
221
|
-
r,
|
|
222
|
-
"--state-dir",
|
|
223
|
-
s(r, "flows")
|
|
224
|
-
];
|
|
225
|
-
t.id && i.push("--id", t.id), t.json && i.push("--json");
|
|
226
|
-
for (let e of t.target ?? []) i.push("--target", e);
|
|
227
|
-
await B(i);
|
|
228
|
-
}
|
|
229
|
-
function oe(t) {
|
|
230
|
-
let n = L[t];
|
|
231
|
-
if (!n) throw Error(`unknown spec flow ${t}`);
|
|
232
|
-
let r = [
|
|
233
|
-
process.env.IX_SPEC_WORKFLOWS_ROOT,
|
|
234
|
-
z(),
|
|
235
|
-
s(o(c(process.cwd())), "ix-spec-workflows"),
|
|
236
|
-
s(p(), ".ix", "plugins", "ix-spec-workflows")
|
|
237
|
-
].filter((e) => !!e);
|
|
238
|
-
for (let t of r) {
|
|
239
|
-
let r = s(t, n.packageSkill, "workflow-assets", "skills", n.runtimeSkill);
|
|
240
|
-
if (e(r)) return r;
|
|
241
|
-
}
|
|
242
|
-
throw Error(`could not find ix-spec workflow skill ${n.runtimeSkill}; set IX_SPEC_WORKFLOWS_ROOT`);
|
|
243
|
-
}
|
|
244
|
-
function z() {
|
|
245
|
-
return s(o(o(l(import.meta.url))), "skills");
|
|
246
|
-
}
|
|
247
|
-
async function B(e) {
|
|
248
|
-
await new Promise((t, n) => {
|
|
249
|
-
let r = re("ix-flow", e, { stdio: "inherit" });
|
|
250
|
-
r.on("error", n), r.on("close", (e) => {
|
|
251
|
-
if (e === 0) {
|
|
252
|
-
t();
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
process.exitCode = e ?? 1, t();
|
|
256
|
-
});
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
//#endregion
|
|
260
|
-
//#region src/write.ts
|
|
261
|
-
function V(e) {
|
|
262
|
-
return (Array.isArray(e) ? e : e ? [e] : []).flatMap((e) => e.split(",")).map((e) => e.trim()).filter(Boolean);
|
|
263
|
-
}
|
|
264
|
-
function H(t, n, r) {
|
|
265
|
-
if (r.length === 0) throw Error("write requires --types <type[,type...]>");
|
|
266
|
-
let a = c(n);
|
|
267
|
-
if (!e(a) || !i(a).isDirectory()) throw Error(`write repo_dir is not a directory: ${n}`);
|
|
268
|
-
return {
|
|
269
|
-
repoRoot: a,
|
|
270
|
-
types: r.map((e) => {
|
|
271
|
-
let n = x(t, e);
|
|
272
|
-
if (!n) throw Error(`catalog type not found: ${e}\nAvailable types: ${t.entries.map((e) => e.name).sort((e, t) => e.localeCompare(t)).join(", ")}`);
|
|
273
|
-
return W(n);
|
|
274
|
-
}),
|
|
275
|
-
validation: {
|
|
276
|
-
command: `quire validate --scope ${G(a)} "spec/**/*.md"`,
|
|
277
|
-
scope: a,
|
|
278
|
-
globs: ["spec/**/*.md"]
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
function U(e) {
|
|
283
|
-
let t = [
|
|
284
|
-
"quoin write",
|
|
285
|
-
"",
|
|
286
|
-
`Repo: ${e.repoRoot}`,
|
|
287
|
-
"",
|
|
288
|
-
"Authoring contracts:"
|
|
289
|
-
];
|
|
290
|
-
for (let n of e.types) t.push(`- ${n.name} (${n.kind})`), t.push(` module: ${n.moduleName}`), t.push(` module_root: ${n.moduleRoot}`), n.skeletonPath && t.push(` skeleton: ${n.skeletonPath}`), n.schemaPath && t.push(` schema: ${n.schemaPath}`), !n.skeletonPath && !n.schemaPath && t.push(" contract: manifest only");
|
|
291
|
-
return t.push(""), t.push("Author files directly in the repo, then validate changed spec files."), t.push(`Validate scope: ${e.validation.scope}`), t.push(`Validate command: ${e.validation.command}`), t.join("\n");
|
|
292
|
-
}
|
|
293
|
-
function W(e) {
|
|
294
|
-
return {
|
|
295
|
-
name: e.name,
|
|
296
|
-
kind: e.kind,
|
|
297
|
-
moduleName: e.moduleName,
|
|
298
|
-
moduleRoot: e.moduleRoot,
|
|
299
|
-
...e.schemaPath ? { schemaPath: e.schemaPath } : {},
|
|
300
|
-
...e.skeletonPath ? { skeletonPath: e.skeletonPath } : {}
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
function G(e) {
|
|
304
|
-
return /^[A-Za-z0-9_./:-]+$/.test(e) ? e : `'${e.replaceAll("'", "'\\''")}'`;
|
|
305
|
-
}
|
|
306
|
-
//#endregion
|
|
307
|
-
//#region src/cli.ts
|
|
308
|
-
var K = "https://registry.npmjs.org/", q = "quoin\n\nSpec workflow and catalog CLI for Agent IX.\n\nquoin starts spec-domain work. ix-flow resumes, advances, acknowledges gates,\nand inspects workflow runs created by quoin.\n\nDefault modules (installed on first use into ~/.ix/filament/modules):\n Artifact modules: spec-artifacts-iso, spec-artifacts-app, spec-artifacts-process\n Object modules: spec-objects-business, spec-objects-architecture,\n spec-objects-enterprise, spec-objects-operational,\n spec-objects-security\n Workflows: review, matrix, to-plan\n\nUsage:\n quoin write <repo_dir> --types <type[,type...]>\n quoin catalog list|validate\n quoin catalog show <type>\n quoin plugin install <path:...|github:...>\n quoin plugin list\n quoin plugin remove <name>\n quoin review|matrix|to-plan [--target <ref>...]\n quoin update [--check] [--registry <url>]\n\nGlobal flags:\n --json\n --config-root <dir> Defaults to ~/.ix\n\nExamples:\n quoin catalog list\n quoin catalog show FR\n quoin plugin install github:agent-ix/spec-objects-custom\n quoin write . --types FR,domain\n ix-flow status <run-id>\n", J = "quoin write\n\nBuild an authoring pack for spec files an agent is about to create or edit.\n\nPass the target repository and the artifact/object types involved in the work.\nquoin resolves those types from the active catalog and returns the local\nskeletons, schemas, module roots, and Quire validation command for the repo.\n\nUsage:\n quoin write <repo_dir> --types <type[,type...]>\n\nExamples:\n quoin write . --types FR\n quoin write . --types FR,domain,entity\n quoin write ../my-service --types fr,DOMAIN --json\n\nNotes:\n - Type lookup is case-insensitive; FR and fr are the same type.\n - Types can be artifacts or objects from the default module set or plugins.\n - Use the returned skeletons and schemas as the authoring contract.\n - Run the returned Quire command after editing spec files.\n", se = "quoin catalog\n\nInspect the active artifact/object catalog.\n\nThe catalog is assembled from, in order:\n 1. QUOIN_MODULE_PATHS\n 2. modules installed under ~/.ix/filament/modules\n\nThe default module set is installed there automatically on first catalog access,\nand updated by \"quoin plugin install\". The same directory is read by quire-rs.\n\nDefault artifact modules:\n spec-artifacts-iso FR, NFR, StR, US, IT, TC, AC, CON, Spec\n spec-artifacts-app app-level artifacts\n spec-artifacts-process plans, reviews, matrices, ADRs, tasks, findings\n\nDefault object modules:\n spec-objects-business\n spec-objects-architecture\n spec-objects-enterprise\n spec-objects-operational\n spec-objects-security\n\nUsage:\n quoin catalog list\n quoin catalog show <type>\n quoin catalog validate\n\nExamples:\n quoin catalog show FR\n quoin catalog show entity\n quoin catalog validate --json\n", ce = "quoin plugin\n\nInstall and manage user/community spec modules.\n\nPlugins add or override artifact/object modules under ~/.ix/filament/modules.\nUse \"catalog list\" to see the full active catalog, including default modules and\nplugins.\n\nSupported install sources:\n path:<dir> Use a local directory containing manifest.yaml\n github:<owner>/<repo> Clone a GitHub repository (manifest at root)\n github:<owner>/<repo>@<ref> Pin to a tag, branch, or sha\n github:<owner>/<repo>//<subdir> Manifest in a monorepo subdirectory (@<ref> ok)\n package:<name> Install a module from an npm package (manifest at root)\n package:<name>@<version> Pin to an npm version\n\nUsage:\n quoin plugin install <path:...|github:...|package:...>\n quoin plugin list\n quoin plugin remove <name>\n quoin plugin ensure-defaults\n\nExamples:\n quoin plugin install path:../spec-objects-custom\n quoin plugin install github:agent-ix/spec-objects-custom\n quoin plugin install github:agent-ix/spec-objects-security//spec_objects_security@v0.1.1\n quoin plugin install package:@agent-ix/spec-objects-security@0.4.0\n quoin plugin list\n quoin plugin ensure-defaults\n", le = "quoin update\n\nCheck for and install the latest published quoin.\n\nquoin is distributed on the public npm registry as @agent-ix/quoin. This command\nqueries the registry for the latest version, compares it to the running version,\nand (unless --check) runs npm install -g to upgrade in place.\n\nUsage:\n quoin update [--check] [--registry <url>]\n\nFlags:\n --check Report whether an update is available; do not install.\n --registry <url> Force an npm registry to query/install from. Defaults\n to the public npm registry\n (https://registry.npmjs.org/), where @agent-ix/quoin is\n published. Pass http://npm.ix/ for local dev snapshots.\n\nExamples:\n quoin update\n quoin update --check\n quoin update --registry http://npm.ix/\n", Y = "quoin workflows\n\nStart bundled spec review/planning workflows. quoin creates the workflow run in ~/.ix/flows.\nUse ix-flow to inspect, resume, advance phases, and acknowledge human gates.\n\nAvailable workflow launchers:\n review Run a composite spec review\n matrix Build or update a requirements test matrix\n to-plan Convert accepted requirements into an implementation plan\n\nUsage:\n quoin review|matrix|to-plan [--target <ref>...]\n\nExamples:\n quoin review --target spec/\n quoin matrix --target spec/\n ix-flow status <run-id>\n ix-flow resume <run-id>\n";
|
|
309
|
-
async function ue(e) {
|
|
310
|
-
let t = _e(e);
|
|
311
|
-
if (t.flags.version || t.flags.v || t.command === "version") {
|
|
312
|
-
console.log(Z());
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
if (!t.command) {
|
|
316
|
-
console.log(q);
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
if (t.flags.help || t.flags.h) {
|
|
320
|
-
console.log(fe(t));
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
let n = Q(t, "config-root") ?? _();
|
|
324
|
-
if (process.env.IX_HOME = n, u({
|
|
325
|
-
configRoot: n,
|
|
326
|
-
configNamespace: "ix",
|
|
327
|
-
projectConfigRoot: `${process.cwd()}/.ix`,
|
|
328
|
-
projectConfigEnabled: t.flags["no-project-config"] !== !0
|
|
329
|
-
}), t.command !== "update" && t.flags.json !== !0 && await d({
|
|
330
|
-
packageName: "@agent-ix/quoin",
|
|
331
|
-
currentVersion: Z()
|
|
332
|
-
}), t.command === "update") return me(t);
|
|
333
|
-
if (t.command === "catalog") return he(t);
|
|
334
|
-
if (t.command === "plugin") return ge(t);
|
|
335
|
-
if (t.command === "write") return pe(t);
|
|
336
|
-
if (R().includes(t.command)) return ae(t.command, {
|
|
337
|
-
json: t.flags.json === !0,
|
|
338
|
-
id: Q(t, "id"),
|
|
339
|
-
target: $(t, "target")
|
|
340
|
-
});
|
|
341
|
-
throw Error(`unknown command ${t.command}\n\n${q}`);
|
|
342
|
-
}
|
|
343
|
-
function de() {
|
|
344
|
-
let e = o(o(l(import.meta.url))), n = JSON.parse(t(s(e, "package.json"), "utf8"));
|
|
345
|
-
if (typeof n.version != "string") throw Error("package.json version is missing");
|
|
346
|
-
return n.version;
|
|
347
|
-
}
|
|
348
|
-
function X(e) {
|
|
349
|
-
return e || de();
|
|
350
|
-
}
|
|
351
|
-
function Z() {
|
|
352
|
-
return X("0.5.4");
|
|
353
|
-
}
|
|
354
|
-
function fe(e) {
|
|
355
|
-
return e.command === "update" ? le : e.command === "write" ? J : e.command === "catalog" ? se : e.command === "plugin" ? ce : R().includes(e.command) ? Y : q;
|
|
356
|
-
}
|
|
357
|
-
function pe(e) {
|
|
358
|
-
let [t] = e.positionals;
|
|
359
|
-
if (!t) throw Error(`write requires <repo_dir>\n\n${J}`);
|
|
360
|
-
I();
|
|
361
|
-
let n = H(b(), t, V($(e, "types")));
|
|
362
|
-
console.log(e.flags.json ? JSON.stringify(n, null, 2) : U(n));
|
|
363
|
-
}
|
|
364
|
-
async function me(e) {
|
|
365
|
-
await f({
|
|
366
|
-
packageName: "@agent-ix/quoin",
|
|
367
|
-
currentVersion: Z(),
|
|
368
|
-
header: "quoin update",
|
|
369
|
-
registry: Q(e, "registry") ?? K,
|
|
370
|
-
check: e.flags.check === !0
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
function he(e) {
|
|
374
|
-
I();
|
|
375
|
-
let t = b();
|
|
376
|
-
switch (e.subcommand) {
|
|
377
|
-
case "list":
|
|
378
|
-
case void 0:
|
|
379
|
-
if (e.flags.json) {
|
|
380
|
-
console.log(JSON.stringify(t, null, 2));
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
for (let e of t.modules) console.log(`${e.name}@${e.version ?? "unknown"} ${e.root}`);
|
|
384
|
-
return;
|
|
385
|
-
case "show": {
|
|
386
|
-
let [n] = e.positionals;
|
|
387
|
-
if (!n) throw Error("catalog show requires <type>");
|
|
388
|
-
let r = x(t, n);
|
|
389
|
-
if (!r) throw Error(`catalog type not found: ${n}`);
|
|
390
|
-
console.log(e.flags.json ? JSON.stringify(r, null, 2) : `${r.kind} ${r.name} from ${r.moduleName}\n${r.moduleRoot}`);
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
case "validate":
|
|
394
|
-
if (t.duplicates.length > 0) {
|
|
395
|
-
console.error(JSON.stringify({
|
|
396
|
-
ok: !1,
|
|
397
|
-
duplicates: t.duplicates
|
|
398
|
-
}, null, 2)), process.exitCode = 1;
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
console.log(e.flags.json ? JSON.stringify({
|
|
402
|
-
ok: !0,
|
|
403
|
-
modules: t.modules.length
|
|
404
|
-
}, null, 2) : `catalog ok (${t.modules.length} modules)`);
|
|
405
|
-
return;
|
|
406
|
-
default: throw Error(`unknown catalog command ${e.subcommand}`);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
function ge(e) {
|
|
410
|
-
switch (e.subcommand) {
|
|
411
|
-
case "list":
|
|
412
|
-
case void 0:
|
|
413
|
-
console.log(JSON.stringify({ plugins: j() }, null, 2));
|
|
414
|
-
return;
|
|
415
|
-
case "install": {
|
|
416
|
-
let [t] = e.positionals;
|
|
417
|
-
if (!t) throw Error("plugin install requires <source>");
|
|
418
|
-
console.log(JSON.stringify(A(t), null, 2));
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
case "remove": {
|
|
422
|
-
let [t] = e.positionals;
|
|
423
|
-
if (!t) throw Error("plugin remove requires <name>");
|
|
424
|
-
M(t), console.log(`removed ${t}`);
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
case "ensure-defaults":
|
|
428
|
-
I(), console.log(JSON.stringify({
|
|
429
|
-
ensured: !0,
|
|
430
|
-
plugins: j().map((e) => e.name)
|
|
431
|
-
}, null, 2));
|
|
432
|
-
return;
|
|
433
|
-
default: throw Error(`unknown plugin command ${e.subcommand}`);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
function _e(e) {
|
|
437
|
-
let t = {}, n = [], r, i;
|
|
438
|
-
for (let a = 0; a < e.length; a++) {
|
|
439
|
-
let o = e[a];
|
|
440
|
-
if (o.startsWith("--")) {
|
|
441
|
-
let n = o.indexOf("="), r = o.slice(2, n === -1 ? void 0 : n), i = n === -1 ? e[a + 1] && !e[a + 1].startsWith("-") ? e[++a] : !0 : o.slice(n + 1);
|
|
442
|
-
r === "target" || r === "types" ? t[r] = [...$({ flags: t }, r), String(i)] : t[r] = i;
|
|
443
|
-
} else o.startsWith("-") && o.length > 1 ? t[o.slice(1)] = !0 : r ? !i && (r === "catalog" || r === "plugin") ? i = o : n.push(o) : r = o;
|
|
444
|
-
}
|
|
445
|
-
return {
|
|
446
|
-
command: r,
|
|
447
|
-
subcommand: i,
|
|
448
|
-
positionals: n,
|
|
449
|
-
flags: t
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
function Q(e, t) {
|
|
453
|
-
let n = e.flags[t];
|
|
454
|
-
return typeof n == "string" ? n : void 0;
|
|
455
|
-
}
|
|
456
|
-
function $(e, t) {
|
|
457
|
-
let n = e.flags[t];
|
|
458
|
-
return Array.isArray(n) ? n : [];
|
|
459
|
-
}
|
|
460
|
-
//#endregion
|
|
461
|
-
export { U as a, I as c, k as d, M as f, b as g, x as h, H as i, A as l, v as m, Z as n, V as o, y as p, X as r, F as s, ue as t, j as u };
|