@yansirplus/cli 0.5.19 → 0.5.20

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.
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: agentOS
3
- description: Generated installed catalog for agentOS 0.5.19 public packages, API intent, agent navigation, invariants, errors, and provenance.
3
+ description: Generated installed catalog for agentOS 0.5.20 public packages, API intent, agent navigation, invariants, errors, and provenance.
4
4
  ---
5
5
 
6
6
  # agentOS
7
7
 
8
- This catalog is generated for `@yansirplus/cli` 0.5.19. Treat files under `references/` as installed-version facts; do not infer future API from chat context, archived CST events, or source checkouts.
8
+ This catalog is generated for `@yansirplus/cli` 0.5.20. Treat files under `references/` as installed-version facts; do not infer future API from chat context, archived CST events, or source checkouts.
9
9
 
10
10
  ## Routes
11
11
 
@@ -1,6 +1,6 @@
1
1
  # agentOS Package Map
2
2
 
3
- Release version: `0.5.19`
3
+ Release version: `0.5.20`
4
4
  Published scope: `@yansirplus`
5
5
 
6
6
  ## Packages
@@ -9,7 +9,7 @@
9
9
  "package": {
10
10
  "sourcePackage": "@agent-os/cli",
11
11
  "publicPackage": "@yansirplus/cli",
12
- "version": "0.5.19",
12
+ "version": "0.5.20",
13
13
  "publicScope": "@yansirplus",
14
14
  "catalogRoot": "agent-catalog/agentOS"
15
15
  },
@@ -145,32 +145,32 @@
145
145
  },
146
146
  {
147
147
  "path": "package.json",
148
- "sha256": "02940aa4cd34acac3b0b5bb1f39927754e94a23ce9b2a70a155004acb2e3afd4",
148
+ "sha256": "7602f432f07aa72589a6700f26c491d50329094f6fd9770bc709827d344ad978",
149
149
  "byteSize": 5045
150
150
  },
151
151
  {
152
152
  "path": "packages/cli/package.json",
153
- "sha256": "1c2159ba24e9ef008bea31a4f6eed0b884f1b882479536ef4a0fcf8626696f57",
153
+ "sha256": "19cdc2e6c3f13e24d6fe89b16af99aca6874aac7d31d2793d2e5e5b2ae5279fc",
154
154
  "byteSize": 691
155
155
  },
156
156
  {
157
157
  "path": "packages/client/package.json",
158
- "sha256": "d408d2940177fd71f73c9041d87043c476544738df9a7945eb09f2c99995ebb9",
158
+ "sha256": "a6670af7b93bb94056c0a7a197c163a95f5c6a19f8daabb946f90e1efa7e37e5",
159
159
  "byteSize": 1246
160
160
  },
161
161
  {
162
162
  "path": "packages/core/package.json",
163
- "sha256": "d034f01df3a182485df8fc213441b0aaeaf3ab0cf2ea10fc2364f1ee8f11df42",
163
+ "sha256": "34367092b56381ca66738c7cd30d8e1adfa4ccc157fad1bc688aa4b15e5982a3",
164
164
  "byteSize": 3570
165
165
  },
166
166
  {
167
167
  "path": "packages/evals/package.json",
168
- "sha256": "d1b6aed4f7db19c6052b9ec9358e720ced7b106ef4ad2bd6d7cc9d37b0ab161d",
168
+ "sha256": "fd6521f1780f51af6f7d1c48df2b3274a092b3d46787775b0089ee2e45948723",
169
169
  "byteSize": 532
170
170
  },
171
171
  {
172
172
  "path": "packages/runtime/package.json",
173
- "sha256": "b1ab0889c3af19999d41f66da04e54f99c24e1b3c76f88845a6b80653e17eed3",
173
+ "sha256": "0802aae1fdb5e02f8f893fee7841b9a87eb97c86ad1577aa657648121dd4c30b",
174
174
  "byteSize": 4008
175
175
  },
176
176
  {
@@ -182,12 +182,12 @@
182
182
  "outputFiles": [
183
183
  {
184
184
  "path": "agent-catalog/agentOS/SKILL.md",
185
- "sha256": "a4acb0b6cdfbfa2accd1189d49f6993801dffd63be0972911b87218efee53999",
185
+ "sha256": "4969cd3ac708ef73aff1d0ce75d61bd89cbe03179f0b947e5d7540c19388548c",
186
186
  "byteSize": 1048
187
187
  },
188
188
  {
189
189
  "path": "agent-catalog/agentOS/references/package-map.md",
190
- "sha256": "da752eace7b9c924dfae92c3bb613caaf9dc2c6e367ddc444e892439d3ec8f0e",
190
+ "sha256": "5e59a7b83caaf33b6214e0c5d776ecc3a7bc4306bc4ce8399052ecc3e16d260e",
191
191
  "byteSize": 14055
192
192
  },
193
193
  {
package/dist/main.mjs CHANGED
@@ -12,19 +12,6 @@ import {
12
12
  restoreConsumer,
13
13
  } from "./consumer-overlay.mjs";
14
14
  import { releaseStatus } from "./release-status.mjs";
15
- import {
16
- algorithmicCheckerAcceptsArgs,
17
- hasAlgorithmicChecker,
18
- runAlgorithmicChecker,
19
- } from "./check/algorithmic-checks.mjs";
20
- import {
21
- deriveAffectedGates,
22
- printAffectedGates,
23
- runAffectedGates,
24
- } from "./check/gate-selector.mjs";
25
- import { runDefaultGate } from "./check/default-gate.mjs";
26
- import { runEffectScanGate } from "./check/effect-scan-gate.mjs";
27
- import { listGuards, runGroup, runGuard } from "./runner.mjs";
28
15
 
29
16
  const packageRootFromMain = () => path.dirname(path.dirname(fileURLToPath(import.meta.url)));
30
17
 
@@ -110,6 +97,9 @@ const expectNoExtraArgs = (args, command) => {
110
97
  }
111
98
  };
112
99
 
100
+ const isHelpCommand = (command) =>
101
+ command === undefined || command === "--help" || command === "-h";
102
+
113
103
  const runBuildRunner = async (command, args) => {
114
104
  const runner = fileURLToPath(new URL("./build/build-cli.js", import.meta.url));
115
105
  const bundled = await bundleModuleForNode(runner, {
@@ -154,6 +144,21 @@ const runEval = async (args) => runBuildRunner("eval", args);
154
144
 
155
145
  const runPreflight = async (args) => runBuildRunner("preflight", args);
156
146
 
147
+ const loadRunner = () => import("./runner.mjs");
148
+
149
+ const runCheckGroup = async (group) => {
150
+ const { runGroup } = await loadRunner();
151
+ await runGroup(group);
152
+ };
153
+
154
+ const loadAlgorithmicChecks = () => import("./check/algorithmic-checks.mjs");
155
+
156
+ const loadGateSelector = () => import("./check/gate-selector.mjs");
157
+
158
+ const loadDefaultGate = () => import("./check/default-gate.mjs");
159
+
160
+ const loadEffectScanGate = () => import("./check/effect-scan-gate.mjs");
161
+
157
162
  const sourceConsumerProducer = () => {
158
163
  const modulePath = path.join(repoRootFromMain(), "tooling/distribution/pack-check.mjs");
159
164
  const supportPath = path.join(repoRootFromMain(), "tooling/distribution/support.mjs");
@@ -174,6 +179,10 @@ const sourceConsumerProducer = () => {
174
179
 
175
180
  const runConsumer = async (args) => {
176
181
  const [command, ...rest] = args;
182
+ if (isHelpCommand(command)) {
183
+ printHelp();
184
+ return;
185
+ }
177
186
  const commandArgs = rest[0] === "--" ? rest.slice(1) : rest;
178
187
  const sourceContext = sourceConsumerProducer() ?? {};
179
188
  const context = { packageRoot: packageRootFromMain(), ...sourceContext };
@@ -197,6 +206,10 @@ const runConsumer = async (args) => {
197
206
 
198
207
  const runRelease = async (args) => {
199
208
  const [command, ...rest] = args;
209
+ if (isHelpCommand(command)) {
210
+ printHelp();
211
+ return;
212
+ }
200
213
  const commandArgs = rest[0] === "--" ? rest.slice(1) : rest;
201
214
  const sourceContext = sourceConsumerProducer() ?? {};
202
215
  const context = { packageRoot: packageRootFromMain(), ...sourceContext };
@@ -211,18 +224,25 @@ const runRelease = async (args) => {
211
224
 
212
225
  const runCheck = async (args) => {
213
226
  const [command, ...rest] = args;
227
+ if (isHelpCommand(command)) {
228
+ printHelp();
229
+ return;
230
+ }
214
231
  switch (command) {
215
232
  case "all":
216
233
  expectNoExtraArgs(rest, "agentos check all");
217
- await runGroup("all");
234
+ await runCheckGroup("all");
218
235
  return;
219
236
  case "default":
220
237
  expectNoExtraArgs(rest, "agentos check default");
221
- await runDefaultGate();
238
+ {
239
+ const { runDefaultGate } = await loadDefaultGate();
240
+ await runDefaultGate();
241
+ }
222
242
  return;
223
243
  case "structural":
224
244
  expectNoExtraArgs(rest, "agentos check structural");
225
- await runGroup("all");
245
+ await runCheckGroup("all");
226
246
  return;
227
247
  case "affected": {
228
248
  let base;
@@ -249,6 +269,8 @@ const runCheck = async (args) => {
249
269
  throw new Error(`agentos check affected: unexpected argument ${arg}`);
250
270
  }
251
271
  }
272
+ const { deriveAffectedGates, printAffectedGates, runAffectedGates } =
273
+ await loadGateSelector();
252
274
  const result = deriveAffectedGates({ base, head });
253
275
  printAffectedGates(result, { json });
254
276
  if (run) runAffectedGates(result);
@@ -256,45 +278,56 @@ const runCheck = async (args) => {
256
278
  }
257
279
  case "docs":
258
280
  expectNoExtraArgs(rest, "agentos check docs");
259
- await runGroup("check-docs");
281
+ await runCheckGroup("check-docs");
260
282
  return;
261
283
  case "effect-scan":
262
- runEffectScanGate(rest, { defaultRepoRoot: repoRootFromMain() });
284
+ {
285
+ const { runEffectScanGate } = await loadEffectScanGate();
286
+ runEffectScanGate(rest, { defaultRepoRoot: repoRootFromMain() });
287
+ }
263
288
  return;
264
289
  case "effect-manifests":
265
290
  expectNoExtraArgs(rest, "agentos check effect-manifests");
266
- await runGroup("check-effect-manifests");
291
+ await runCheckGroup("check-effect-manifests");
267
292
  return;
268
293
  case "release":
269
294
  expectNoExtraArgs(rest, "agentos check release");
270
- await runGroup("release");
295
+ await runCheckGroup("release");
271
296
  return;
272
297
  case "site":
273
298
  expectNoExtraArgs(rest, "agentos check site");
274
- await runGroup("check-site");
299
+ await runCheckGroup("check-site");
275
300
  return;
276
301
  case "guard-coverage":
277
302
  expectNoExtraArgs(rest, "agentos check guard-coverage");
278
- await runGroup("guard-coverage");
303
+ await runCheckGroup("guard-coverage");
279
304
  return;
280
305
  case "guard": {
281
306
  const [ruleId, ...extra] = rest;
282
307
  if (ruleId === undefined) throw new Error("agentos check guard: missing <rule-id>");
283
308
  expectNoExtraArgs(extra, "agentos check guard");
309
+ const { runGuard } = await loadRunner();
284
310
  await runGuard(ruleId);
285
311
  return;
286
312
  }
287
313
  case "guards":
288
314
  expectNoExtraArgs(rest, "agentos check guards");
289
- for (const id of listGuards()) console.log(id);
315
+ {
316
+ const { listGuards } = await loadRunner();
317
+ for (const id of listGuards()) console.log(id);
318
+ }
290
319
  return;
291
320
  default:
292
- if (command !== undefined && hasAlgorithmicChecker(command)) {
293
- if (!algorithmicCheckerAcceptsArgs(command)) {
294
- expectNoExtraArgs(rest, `agentos check ${command}`);
321
+ {
322
+ const { algorithmicCheckerAcceptsArgs, hasAlgorithmicChecker, runAlgorithmicChecker } =
323
+ await loadAlgorithmicChecks();
324
+ if (command !== undefined && hasAlgorithmicChecker(command)) {
325
+ if (!algorithmicCheckerAcceptsArgs(command)) {
326
+ expectNoExtraArgs(rest, `agentos check ${command}`);
327
+ }
328
+ await runAlgorithmicChecker(command, rest);
329
+ return;
295
330
  }
296
- await runAlgorithmicChecker(command, rest);
297
- return;
298
331
  }
299
332
  throw new Error(
300
333
  "agentos check: choose one of all, default, structural, affected, docs, effect-scan, effect-manifests, release, site, guard-coverage, guard, guards, or an algorithmic checker id",
@@ -304,22 +337,26 @@ const runCheck = async (args) => {
304
337
 
305
338
  const runGenerate = async (args) => {
306
339
  const [command, ...rest] = args;
340
+ if (isHelpCommand(command)) {
341
+ printHelp();
342
+ return;
343
+ }
307
344
  switch (command) {
308
345
  case "docs":
309
346
  expectNoExtraArgs(rest, "agentos generate docs");
310
- await runGroup("generate-docs");
347
+ await runCheckGroup("generate-docs");
311
348
  return;
312
349
  case "effect-manifests":
313
350
  expectNoExtraArgs(rest, "agentos generate effect-manifests");
314
- await runGroup("generate-effect-manifests");
351
+ await runCheckGroup("generate-effect-manifests");
315
352
  return;
316
353
  case "site":
317
354
  if (rest[0] === "--watch") {
318
355
  expectNoExtraArgs(rest.slice(1), "agentos generate site --watch");
319
- await runGroup("generate-site-watch");
356
+ await runCheckGroup("generate-site-watch");
320
357
  } else {
321
358
  expectNoExtraArgs(rest, "agentos generate site");
322
- await runGroup("generate-site");
359
+ await runCheckGroup("generate-site");
323
360
  }
324
361
  return;
325
362
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yansirplus/cli",
3
- "version": "0.5.19",
3
+ "version": "0.5.20",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -24,9 +24,9 @@
24
24
  "PUBLIC_API.md"
25
25
  ],
26
26
  "dependencies": {
27
- "@yansirplus/core": "0.5.19",
28
- "@yansirplus/evals": "0.5.19",
29
- "@yansirplus/runtime": "0.5.19",
27
+ "@yansirplus/core": "0.5.20",
28
+ "@yansirplus/evals": "0.5.20",
29
+ "@yansirplus/runtime": "0.5.20",
30
30
  "esbuild": "0.27.3",
31
31
  "yaml": "2.9.0"
32
32
  },