yam-flow 2.4.0 → 2.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yam-flow",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Progressive proof-first agent flow: start fast, deepen deliberately, stay honest by design.",
5
5
  "type": "module",
6
6
  "author": "0kim0bos",
@@ -43,7 +43,7 @@
43
43
  ],
44
44
  "scripts": {
45
45
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
46
- "build": "npm run clean && tsc -p tsconfig.json",
46
+ "build": "npm run clean && tsc -p tsconfig.json && node -e \"require('node:fs').chmodSync('dist/bin/yam.js',0o755)\"",
47
47
  "typecheck": "tsc -p tsconfig.json --noEmit",
48
48
  "install:skills": "node ./dist/bin/yam.js install",
49
49
  "uninstall:skills": "node ./dist/bin/yam.js uninstall",
@@ -52,7 +52,7 @@
52
52
  "doctor": "node ./dist/bin/yam.js doctor",
53
53
  "list": "node ./dist/bin/yam.js list",
54
54
  "examples": "node ./dist/bin/yam.js examples",
55
- "verify:self": "npm run build && node --check ./dist/bin/yam.js && node --check ./dist/lib/trust-kernel.js && node --check ./dist/lib/skill-installation.js && npm run hook-latency-smoke && node ./scripts/install-transaction-smoke.mjs && node ./dist/bin/yam.js verify && node ./dist/bin/yam.js doctor",
55
+ "verify:self": "npm run build && node --check ./dist/bin/yam.js && node --check ./dist/lib/trust-kernel.js && node --check ./dist/lib/skill-installation.js && node --check ./dist/lib/external-updates.js && npm run hook-latency-smoke && node ./scripts/external-updates-smoke.mjs && node ./scripts/install-transaction-smoke.mjs && node ./dist/bin/yam.js verify && node ./dist/bin/yam.js doctor",
56
56
  "prepare": "npm run build",
57
57
  "prepack": "npm run verify:self",
58
58
  "prepublishOnly": "npm run verify:self",
@@ -64,6 +64,7 @@
64
64
  "dist:freshness": "node ./scripts/check-dist-freshness.mjs",
65
65
  "registry:check": "node ./scripts/check-registry-version.mjs",
66
66
  "cli-smoke": "node ./scripts/cli-smoke.mjs",
67
+ "external-updates-smoke": "npm run build && node ./scripts/external-updates-smoke.mjs",
67
68
  "hook-latency-smoke": "node ./scripts/hook-latency-smoke.mjs",
68
69
  "install-transaction-smoke": "npm run build && node ./scripts/install-transaction-smoke.mjs",
69
70
  "release:check": "npm run typecheck && npm run forbidden-names:check && npm run verify:self && npm run dist:freshness && npm run package-boundary:check && npm run registry:check && npm run cli-smoke",
package/src/bin/yam.ts CHANGED
@@ -39,6 +39,12 @@ import {
39
39
  installSkillSetTransactional,
40
40
  uninstallSkillSetSafely
41
41
  } from '../lib/skill-installation.js';
42
+ import {
43
+ EXTERNAL_UPDATE_COMPONENTS,
44
+ applyExternalUpdates,
45
+ checkExternalUpdates
46
+ } from '../lib/external-updates.js';
47
+ import type { ExternalUpdateComponent } from '../lib/external-updates.js';
42
48
 
43
49
  type AnyRecord = Record<string, any>;
44
50
 
@@ -180,6 +186,9 @@ Usage:
180
186
  yam mission queue [--agent-id id] [--scope text] [--changed file] [--verification-hint text] [--json]
181
187
  yam mission receipt [--thread-id id] [--role reviewer] [--lifecycle stopped] [--outcome passed] [--evidence text] [--json]
182
188
  yam mission gate [--expected-thread id] [--receipt file] [--json]
189
+ yam update check [--json]
190
+ yam update apply --component yam|scrapling|insane-search [--json]
191
+ yam update apply --all [--json]
183
192
  yam benchmark report [--baseline n] [--current n] [--unit ms] [--target lower|higher] [--json]
184
193
  yam release report [--json]
185
194
  yam safety [text...]
@@ -3564,6 +3573,83 @@ async function mission(args = []) {
3564
3573
  return missionUsage();
3565
3574
  }
3566
3575
 
3576
+ async function updateCommand(args: string[] = []) {
3577
+ const subcommand = args[0] || 'help';
3578
+ if (subcommand === 'help' || subcommand === '--help' || subcommand === '-h') return updateUsage();
3579
+ if (subcommand === 'check') {
3580
+ const rest = args.slice(1);
3581
+ const invalid = rest.filter((arg) => arg !== '--json');
3582
+ if (invalid.length || rest.filter((arg) => arg === '--json').length > 1) {
3583
+ throw new Error(`invalid update check option: ${invalid[0] || '--json repeated'}`);
3584
+ }
3585
+ const report = await checkExternalUpdates(VERSION);
3586
+ printJsonOrHuman(report, rest.includes('--json'), 'External update check');
3587
+ if (!report.success) process.exitCode = 1;
3588
+ return;
3589
+ }
3590
+ if (subcommand !== 'apply') {
3591
+ throw new Error(`unknown update command: ${subcommand}`);
3592
+ }
3593
+
3594
+ const parsed = parseUpdateApplyArgs(args.slice(1));
3595
+ const report = await applyExternalUpdates(VERSION, {
3596
+ component: parsed.component,
3597
+ all: parsed.all
3598
+ });
3599
+ printJsonOrHuman(report, parsed.json, 'External update apply');
3600
+ if (!report.success) process.exitCode = 1;
3601
+ }
3602
+
3603
+ function parseUpdateApplyArgs(args: string[]) {
3604
+ let component: ExternalUpdateComponent | undefined;
3605
+ let all = false;
3606
+ let json = false;
3607
+ for (let index = 0; index < args.length; index += 1) {
3608
+ const arg = String(args[index] || '');
3609
+ if (arg === '--json') {
3610
+ if (json) throw new Error('--json may be supplied only once');
3611
+ json = true;
3612
+ continue;
3613
+ }
3614
+ if (arg === '--all') {
3615
+ if (all) throw new Error('--all may be supplied only once');
3616
+ all = true;
3617
+ continue;
3618
+ }
3619
+ if (arg === '--component' || arg.startsWith('--component=')) {
3620
+ if (component) throw new Error('--component may be supplied only once');
3621
+ const value = arg === '--component' ? String(args[index + 1] || '') : arg.slice('--component='.length);
3622
+ if (arg === '--component') index += 1;
3623
+ if (!EXTERNAL_UPDATE_COMPONENTS.includes(value as ExternalUpdateComponent)) {
3624
+ throw new Error('component must be one of: yam, scrapling, insane-search');
3625
+ }
3626
+ component = value as ExternalUpdateComponent;
3627
+ continue;
3628
+ }
3629
+ throw new Error(`invalid update apply option: ${arg}`);
3630
+ }
3631
+ if ((all && component) || (!all && !component)) {
3632
+ throw new Error('choose exactly one of --component yam|scrapling|insane-search or --all');
3633
+ }
3634
+ return { component, all, json };
3635
+ }
3636
+
3637
+ function updateUsage() {
3638
+ console.log(`yam update
3639
+
3640
+ Usage:
3641
+ yam update check [--json]
3642
+ yam update apply --component yam|scrapling|insane-search [--json]
3643
+ yam update apply --all [--json]
3644
+
3645
+ Safety:
3646
+ check is read-only. apply requires an explicit component or --all.
3647
+ --all updates Scrapling and Insane Search before yam, then stops at the first failed/manual component.
3648
+ Insane Search is updated only through the official Codex CLI; plugin caches are never edited directly.
3649
+ Every apply attempt records component checks, outcome, side effects, and rollback guidance.
3650
+ `);
3651
+ }
3652
+
3567
3653
  function missionUsage() {
3568
3654
  console.log(`yam mission
3569
3655
 
@@ -5332,6 +5418,7 @@ function showRequestedHelp(args: string[]) {
5332
5418
  media: mediaUsage,
5333
5419
  runtime: runtimeUsage,
5334
5420
  mission: missionUsage,
5421
+ update: updateUsage,
5335
5422
  benchmark: benchmarkUsage,
5336
5423
  memory: memoryUsage
5337
5424
  };
@@ -5361,6 +5448,7 @@ async function main() {
5361
5448
  if (command === 'media') return media(process.argv.slice(3));
5362
5449
  if (command === 'runtime') return runtime(process.argv.slice(3));
5363
5450
  if (command === 'mission') return mission(process.argv.slice(3));
5451
+ if (command === 'update') return updateCommand(process.argv.slice(3));
5364
5452
  if (command === 'benchmark') return benchmark(process.argv.slice(3));
5365
5453
  if (command === 'release') return release(process.argv.slice(3));
5366
5454
  if (command === 'safety') return safety(process.argv.slice(3));