@hearsay-tools/squawk 0.18.0-pr3796.7089 → 0.18.0-pr3796.7091

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": "@hearsay-tools/squawk",
3
- "version": "0.18.0-pr3796.7089",
3
+ "version": "0.18.0-pr3796.7091",
4
4
  "description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -63,8 +63,8 @@
63
63
  "devDependencies": {
64
64
  "@babel/parser": "^8.0.8",
65
65
  "@babel/types": "^8.0.8",
66
- "@open-mercato/cezar-api-client": "0.18.0-pr3796.7089",
67
- "@open-mercato/cezar-contract": "0.18.0-pr3796.7089",
66
+ "@open-mercato/cezar-api-client": "0.18.0-pr3796.7091",
67
+ "@open-mercato/cezar-contract": "0.18.0-pr3796.7091",
68
68
  "@types/node": "^24.19.1",
69
69
  "@types/ws": "^8.18.1",
70
70
  "esbuild": "^0.28.1",
@@ -81,5 +81,5 @@
81
81
  "publishConfig": {
82
82
  "access": "public"
83
83
  },
84
- "gitHead": "b54f8a140bc23df397059f08efa0537bac9e09cf"
84
+ "gitHead": "cfa43c2d9995af3def1d07d62bf64449534b7474"
85
85
  }
@@ -32,17 +32,26 @@ import { activeRunWriteRules } from '../src/lint/active-run-write.ts';
32
32
 
33
33
  interface Measure { label: string; user: number; sys: number; wall: number; load: string }
34
34
 
35
- const args = process.argv.slice(2);
36
- const flag = (name: string) => args.includes(name);
37
- const runsIndex = args.indexOf('--runs');
38
- const runs = runsIndex >= 0 ? Number(args[runsIndex + 1]) : 1;
39
- const paths = args.filter((arg, index) => !arg.startsWith('--') && index !== runsIndex + 1);
40
- if (paths.length === 0) paths.push('packages');
35
+ export interface ProfileOptions { paths: string[]; runs: number; alone: boolean; families: boolean }
36
+
37
+ /** The command line: flags, `--runs N`, and the paths to lint (default `packages`). */
38
+ export function profileArgs(args: readonly string[]): ProfileOptions {
39
+ const runsIndex = args.indexOf('--runs');
40
+ const paths = args.filter((arg, index) => !arg.startsWith('--') && (runsIndex < 0 || index !== runsIndex + 1));
41
+ return {
42
+ paths: paths.length > 0 ? paths : ['packages'],
43
+ runs: runsIndex >= 0 ? Number(args[runsIndex + 1]) : 1,
44
+ alone: args.includes('--alone'),
45
+ families: args.includes('--families'),
46
+ };
47
+ }
48
+
49
+ const { paths, runs, alone, families: byFamily } = profileArgs(process.argv.slice(2));
41
50
 
42
51
  const base = JSON.parse(readFileSync(join(repoRoot, '.oxlintrc.json'), 'utf8')) as { jsPlugins?: string[]; rules: Record<string, unknown> };
43
52
  const pluginPath = resolve(repoRoot, base.jsPlugins?.[0] ?? 'packages/cezar/src/lint/plugin.ts');
44
53
  const builtinRules = Object.fromEntries(Object.entries(base.rules).filter(([name]) => !name.startsWith('cez/')));
45
- const scratch = mkdtempSync(join(tmpdir(), 'cez-profile-lint-'));
54
+ let scratch = '';
46
55
 
47
56
  const loadavg = () => (existsSync('/proc/loadavg') ? readFileSync('/proc/loadavg', 'utf8').split(' ').slice(0, 3).join(' ') : 'n/a');
48
57
  const seconds = (text: string) => {
@@ -99,8 +108,8 @@ function main(): void {
99
108
  add(best('load', writeConfig('load', plugin('load'), { 'noop/noop': 'error' })));
100
109
  add(best('transport', writeConfig('transport', plugin('transport'), { 'noop/noop': 'error' })));
101
110
  add(best('full', join(repoRoot, '.oxlintrc.json')));
102
- if (flag('--families')) for (const [name, rules] of Object.entries(families)) add(best(`family ${name}`, writeConfig(`family-${name}`, [pluginPath], enabled(rules))));
103
- if (flag('--alone')) for (const rule of RULES) add(best(`cez/${rule.name}`, writeConfig(`rule-${rule.name}`, [pluginPath], enabled([rule.name]))));
111
+ if (byFamily) for (const [name, rules] of Object.entries(families)) add(best(`family ${name}`, writeConfig(`family-${name}`, [pluginPath], enabled(rules))));
112
+ if (alone) for (const rule of RULES) add(best(`cez/${rule.name}`, writeConfig(`rule-${rule.name}`, [pluginPath], enabled([rule.name]))));
104
113
  console.log(`Command: oxlint -c <config> ${paths.join(' ')} (cwd ${repoRoot}); best of ${runs}; CPU in seconds.\n`);
105
114
  console.log('| Config | User | Sys | Wall | Load (1/5/15 min) |\n| --- | ---: | ---: | ---: | --- |');
106
115
  for (const m of results) console.log(row(m));
@@ -113,8 +122,11 @@ function main(): void {
113
122
  }
114
123
  }
115
124
 
116
- try {
117
- main();
118
- } finally {
119
- rmSync(scratch, { recursive: true, force: true });
125
+ if (import.meta.main) {
126
+ scratch = mkdtempSync(join(tmpdir(), 'cez-profile-lint-'));
127
+ try {
128
+ main();
129
+ } finally {
130
+ rmSync(scratch, { recursive: true, force: true });
131
+ }
120
132
  }