@hearsay-tools/squawk 0.18.0-pr4301.8357 → 0.18.0-pr4303.8356
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.
|
@@ -13,7 +13,6 @@ import { fileURLToPath } from 'node:url';
|
|
|
13
13
|
*/
|
|
14
14
|
/** The entry files of a bundled runner folder, in lookup order: built `dist/` has `index.js`, the source checkout `index.ts`. */
|
|
15
15
|
export const BUNDLED_RUNNER_ENTRY_FILES = ['index.mjs', 'index.js', 'index.ts'];
|
|
16
|
-
// oxlint-disable-next-line cez/regex-module-syntax -- reads the one-line declaration the entry contract above fixes, fails closed, and production code has no parser
|
|
17
16
|
const DISPLAY_ORDER = /^export const displayOrder = (\d+);$/gm;
|
|
18
17
|
/** The `runners/` folder next to this module's folder, in the source checkout and in `dist/`. */
|
|
19
18
|
export function bundledRunnersDir() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundled-runners.js","sourceRoot":"","sources":["../../src/plugin/bundled-runners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;GASG;AAEH,iIAAiI;AACjI,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,CAAU,CAAC;AAUzF,
|
|
1
|
+
{"version":3,"file":"bundled-runners.js","sourceRoot":"","sources":["../../src/plugin/bundled-runners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;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O,OAAO,CAAC;AACjB,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,gBAAgB,CAAC,GAAY;IAC3C,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC5D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hearsay-tools/squawk",
|
|
3
|
-
"version": "0.18.0-
|
|
3
|
+
"version": "0.18.0-pr4303.8356",
|
|
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",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@babel/parser": "^8.0.8",
|
|
70
70
|
"@babel/types": "^8.0.8",
|
|
71
|
-
"@open-mercato/cezar-api-client": "0.18.0-
|
|
72
|
-
"@open-mercato/cezar-contract": "0.18.0-
|
|
71
|
+
"@open-mercato/cezar-api-client": "0.18.0-pr4303.8356",
|
|
72
|
+
"@open-mercato/cezar-contract": "0.18.0-pr4303.8356",
|
|
73
73
|
"@types/node": "^24.19.1",
|
|
74
74
|
"@types/ws": "^8.18.1",
|
|
75
75
|
"esbuild": "^0.28.1",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "98ced5b452b317b628d53141833bf7e295f01591"
|
|
90
90
|
}
|
|
@@ -13,8 +13,6 @@ import { createRequire } from 'node:module';
|
|
|
13
13
|
import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
14
14
|
import { basename, dirname, join, relative, resolve } from 'node:path';
|
|
15
15
|
import { fileURLToPath } from 'node:url';
|
|
16
|
-
import { parse } from '@babel/parser';
|
|
17
|
-
import { traverse } from '@babel/types';
|
|
18
16
|
import { build } from 'esbuild';
|
|
19
17
|
|
|
20
18
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
@@ -46,17 +44,7 @@ scan(dist);
|
|
|
46
44
|
// specifiers (`from`, `import(...)`, side-effect `import`) to the sibling `dist/plugin/<stem>.js`
|
|
47
45
|
// declaration without touching string-literal type constants; `.js` runtime imports stay on the
|
|
48
46
|
// package specifier and resolve through `installPluginResolveHook()`.
|
|
49
|
-
const
|
|
50
|
-
const PLUGIN_SPEC = /^@hearsay-tools\/squawk\/plugin(?:\/(runtime|model-settings|managed-cli|pi-rpc))?$/;
|
|
51
|
-
/** The module specifier literals of a declaration file: `from`, side-effect `import` and `import(...)` types. */
|
|
52
|
-
function declarationSpecifiers(text) {
|
|
53
|
-
const found = [];
|
|
54
|
-
traverse(parse(text, { sourceType: 'module', plugins: [['typescript', { dts: true }]] }), (node) => {
|
|
55
|
-
if ((node.type === 'ImportDeclaration' || node.type === 'ExportNamedDeclaration' || node.type === 'ExportAllDeclaration'
|
|
56
|
-
|| node.type === 'TSImportType' || node.type === 'ImportExpression') && node.source?.type === 'StringLiteral') found.push(node.source);
|
|
57
|
-
});
|
|
58
|
-
return found;
|
|
59
|
-
}
|
|
47
|
+
const PLUGIN_SPEC = /(from\s+|import\s*\(\s*|import\s+)(['"])@hearsay-tools\/squawk\/plugin(?:\/(runtime|model-settings|managed-cli|pi-rpc))?\2/g;
|
|
60
48
|
const pluginDir = join(dist, 'plugin');
|
|
61
49
|
function repointPluginDecls() {
|
|
62
50
|
if (!existsSync(join(pluginDir, 'index.d.ts'))) return 0;
|
|
@@ -68,19 +56,13 @@ function repointPluginDecls() {
|
|
|
68
56
|
if (p !== outdir) walk(p);
|
|
69
57
|
} else if (item.name.endsWith('.d.ts')) {
|
|
70
58
|
const text = readFileSync(p, 'utf8');
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return match ? [{ literal, sub: match[1] }] : [];
|
|
75
|
-
});
|
|
76
|
-
if (targets.length === 0) continue;
|
|
77
|
-
let next = text;
|
|
78
|
-
// Replace from the end, so the offsets of earlier literals stay valid.
|
|
79
|
-
for (const { literal, sub } of targets.reverse()) {
|
|
59
|
+
PLUGIN_SPEC.lastIndex = 0;
|
|
60
|
+
if (!PLUGIN_SPEC.test(text)) continue;
|
|
61
|
+
const next = text.replace(PLUGIN_SPEC, (_match, prefix, _quote, sub) => {
|
|
80
62
|
let rel = relative(dirname(p), join(pluginDir, `${sub ?? 'index'}.js`)).replaceAll('\\', '/');
|
|
81
63
|
if (!rel.startsWith('.')) rel = `./${rel}`;
|
|
82
|
-
|
|
83
|
-
}
|
|
64
|
+
return `${prefix}'${rel}'`;
|
|
65
|
+
});
|
|
84
66
|
writeFileSync(p, next, 'utf8');
|
|
85
67
|
count++;
|
|
86
68
|
}
|
|
@@ -115,12 +97,8 @@ const bundled = await build({
|
|
|
115
97
|
// root bundle's unrelated exports (hearsay-tools/cezarion#1813).
|
|
116
98
|
const rootExports = new Set(Object.values(bundled.metafile.outputs).flatMap((output) => output.exports));
|
|
117
99
|
for (const file of referrers.filter((name) => name.endsWith('.js'))) {
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
if (node.type === 'ExportAllDeclaration' && node.source.value.startsWith('@open-mercato/cezar-contract/')) wildcards.push(node.source.value);
|
|
121
|
-
});
|
|
122
|
-
for (const specifier of wildcards) {
|
|
123
|
-
const source = join(contractRoot, 'src', `${specifier.slice('@open-mercato/cezar-contract/'.length)}.ts`);
|
|
100
|
+
for (const match of readFileSync(file, 'utf8').matchAll(/export\s+\*\s+from\s+['"](@open-mercato\/cezar-contract\/([^'"]+))['"]/g)) {
|
|
101
|
+
const source = join(contractRoot, 'src', `${match[2]}.ts`);
|
|
124
102
|
const original = await build({
|
|
125
103
|
entryPoints: [source], bundle: true, write: false, metafile: true,
|
|
126
104
|
format: 'esm', platform: 'neutral', external: ['zod'],
|
|
@@ -128,7 +106,7 @@ for (const file of referrers.filter((name) => name.endsWith('.js'))) {
|
|
|
128
106
|
const missing = Object.values(original.metafile.outputs).flatMap((output) => output.exports)
|
|
129
107
|
.filter((name) => !rootExports.has(name));
|
|
130
108
|
if (missing.length) {
|
|
131
|
-
console.error(`inline-contract: ${relative(dist, file)} wildcard re-export of "${
|
|
109
|
+
console.error(`inline-contract: ${relative(dist, file)} wildcard re-export of "${match[1]}" loses root exports: ${missing.join(', ')}`);
|
|
132
110
|
process.exit(1);
|
|
133
111
|
}
|
|
134
112
|
}
|
|
@@ -169,7 +147,6 @@ const gaps = importers.length === 0 ? [] : await build({
|
|
|
169
147
|
if (gaps.length > 0) {
|
|
170
148
|
for (const { text, location } of gaps) {
|
|
171
149
|
const where = location ? `${join(basename(dist), location.file)}:${location.line}` : basename(dist);
|
|
172
|
-
// oxlint-disable-next-line cez/regex-module-syntax -- reads esbuild's error message text, not module source.
|
|
173
150
|
const name = /import "([^"]+)"/i.exec(text)?.[1];
|
|
174
151
|
const subpath = /"contract:([^"]+)"/.exec(text)?.[1];
|
|
175
152
|
console.error(name && subpath
|