@wjarka/cezarion 0.17.0-dev.5661 → 0.17.0-dev.5675
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/README.md +7 -7
- package/dist/activity/tool-activity.d.ts +4 -3
- package/dist/activity/tool-activity.js +4 -3
- package/dist/activity/tool-activity.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +37 -37
- package/dist/core/agent-runner.d.ts +3 -3
- package/dist/core/claude-cli-runner.js +2 -2
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-approvals.js +2 -1
- package/dist/core/codex-approvals.js.map +1 -1
- package/dist/core/omp-ui-mapper.d.ts +1 -1
- package/dist/core/opencode-server-runner.js +1 -1
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/delegation/transport.d.ts +62 -62
- package/dist/server/self-update-routes.d.ts +19 -19
- package/dist/voice/routes.d.ts +19 -19
- package/dist/workflows/pasted-content.d.ts +1 -1
- package/package.json +3 -3
- package/scripts/mock-codex-app-server.mjs +2 -1
- package/scripts/parity-rows.ts +160 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wjarka/cezarion",
|
|
3
|
-
"version": "0.17.0-dev.
|
|
3
|
+
"version": "0.17.0-dev.5675",
|
|
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",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@babel/parser": "^8.0.8",
|
|
62
62
|
"@babel/types": "^8.0.8",
|
|
63
|
-
"@open-mercato/cezar-api-client": "0.17.0-dev.
|
|
64
|
-
"@open-mercato/cezar-contract": "0.17.0-dev.
|
|
63
|
+
"@open-mercato/cezar-api-client": "0.17.0-dev.5675",
|
|
64
|
+
"@open-mercato/cezar-contract": "0.17.0-dev.5675",
|
|
65
65
|
"@types/node": "^24.19.1",
|
|
66
66
|
"@types/ws": "^8.18.1",
|
|
67
67
|
"esbuild": "^0.28.1",
|
|
@@ -233,7 +233,8 @@ const completeSteerTurn = (turnId) => {
|
|
|
233
233
|
};
|
|
234
234
|
|
|
235
235
|
// #708: requirements shape from Codex's generated ConfigRequirementsReadResponse.
|
|
236
|
-
// Retain an invalid requested override to reproduce fallback warnings on later turns.
|
|
236
|
+
// Retain an invalid requested override to reproduce fallback warnings on later turns. This
|
|
237
|
+
// models the reported diagnostic pattern; no enterprise-account trace was captured.
|
|
237
238
|
const managedRequirements = process.env.MOCK_CODEX_REQUIREMENTS
|
|
238
239
|
? JSON.parse(process.env.MOCK_CODEX_REQUIREMENTS) : null;
|
|
239
240
|
let rejectedPermissionOverride = false;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prints the parity row index: every row the parity kits declare, and the runners exempt from it.
|
|
3
|
+
*
|
|
4
|
+
* node packages/cezar/scripts/parity-rows.ts [--row <id>] [--runner <id>] [--json]
|
|
5
|
+
*
|
|
6
|
+
* `--row` prints one row id; `--runner` prints the rows that runner is exempt from.
|
|
7
|
+
*
|
|
8
|
+
* The index is read from the lists the kits export. This file names the kit modules and holds no
|
|
9
|
+
* row and no exemption. `src/core/parity-rows.test.ts` fails when a kit declares a row id that is
|
|
10
|
+
* missing here.
|
|
11
|
+
*/
|
|
12
|
+
import { parseArgs } from 'node:util';
|
|
13
|
+
|
|
14
|
+
import { RUNNER_IDS } from '../src/core/agent-runner.ts';
|
|
15
|
+
import * as harnessCore from '../src/core/harness-parity-core.testkit.ts';
|
|
16
|
+
import * as harnessRows from '../src/core/harness-parity-rows.testkit.ts';
|
|
17
|
+
import { PARITY_ROW_ID } from '../src/core/parity-classes.testkit.ts';
|
|
18
|
+
import * as seamContract from '../src/core/seam-contract.testkit.ts';
|
|
19
|
+
import * as monitoringTurn from '../src/workflows/monitoring-turn.testkit.ts';
|
|
20
|
+
import * as waits from '../src/workflows/waits-parity.testkit.ts';
|
|
21
|
+
import * as subagents from '../src/workflows/waits-subagents-rows.testkit.ts';
|
|
22
|
+
|
|
23
|
+
/** The kit modules that declare rows, by path under `packages/cezar/src`. */
|
|
24
|
+
const KITS: Readonly<Record<string, object>> = {
|
|
25
|
+
'core/harness-parity-core.testkit.ts': harnessCore,
|
|
26
|
+
'core/harness-parity-rows.testkit.ts': harnessRows,
|
|
27
|
+
'core/seam-contract.testkit.ts': seamContract,
|
|
28
|
+
'workflows/monitoring-turn.testkit.ts': monitoringTurn,
|
|
29
|
+
'workflows/waits-parity.testkit.ts': waits,
|
|
30
|
+
'workflows/waits-subagents-rows.testkit.ts': subagents,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export interface IndexedExemption {
|
|
34
|
+
readonly runner: string;
|
|
35
|
+
/** Absent where the kit's exemption list declares no kind. */
|
|
36
|
+
readonly kind?: string;
|
|
37
|
+
readonly reason: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** One row id of one kit. Two kits that declare the same id give two rows. */
|
|
41
|
+
export interface IndexedRow {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly kit: string;
|
|
44
|
+
/** The exported lists that declare it. */
|
|
45
|
+
readonly lists: readonly string[];
|
|
46
|
+
/** More than one where a list declares the id once for each variant. */
|
|
47
|
+
readonly names: readonly string[];
|
|
48
|
+
readonly scenarios: readonly string[];
|
|
49
|
+
/** Exemption lists name a row by id only, so two kits' rows with one id show the same ones. */
|
|
50
|
+
readonly exemptions: readonly IndexedExemption[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type Entry = Readonly<Record<string, unknown>>;
|
|
54
|
+
const isEntry = (value: unknown): value is Entry => typeof value === 'object' && value !== null;
|
|
55
|
+
const text = (value: unknown): string | undefined => typeof value === 'string' ? value : undefined;
|
|
56
|
+
|
|
57
|
+
/** Every exported list of a kit whose entries all pass `match`. */
|
|
58
|
+
function exportedLists(kit: object, match: (entry: Entry) => boolean): [string, readonly Entry[]][] {
|
|
59
|
+
return Object.entries(kit).filter((pair): pair is [string, Entry[]] => {
|
|
60
|
+
const list: unknown = pair[1];
|
|
61
|
+
return Array.isArray(list) && list.length > 0 && list.every(entry => isEntry(entry) && match(entry));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const isRow = (entry: Entry) => PARITY_ROW_ID.test(text(entry.id) ?? '');
|
|
66
|
+
const isExemption = (entry: Entry) => text(entry.criterion) !== undefined && text(entry.reason) !== undefined
|
|
67
|
+
&& text(entry.backend ?? entry.runner) !== undefined;
|
|
68
|
+
|
|
69
|
+
export function parityRowIndex(): IndexedRow[] {
|
|
70
|
+
const exemptions = new Map<string, IndexedExemption[]>();
|
|
71
|
+
for (const kit of Object.values(KITS)) {
|
|
72
|
+
for (const [, list] of exportedLists(kit, isExemption)) {
|
|
73
|
+
for (const entry of list) {
|
|
74
|
+
const kind = text(entry.kind);
|
|
75
|
+
const exemption = { runner: text(entry.backend ?? entry.runner)!, ...(kind === undefined ? {} : { kind }), reason: text(entry.reason)! };
|
|
76
|
+
exemptions.set(text(entry.criterion)!, [...(exemptions.get(text(entry.criterion)!) ?? []), exemption]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const rows = new Map<string, { id: string; kit: string; lists: Set<string>; names: Set<string>; scenarios: Set<string> }>();
|
|
81
|
+
for (const [kit, module] of Object.entries(KITS)) {
|
|
82
|
+
for (const [list, entries] of exportedLists(module, isRow)) {
|
|
83
|
+
for (const entry of entries) {
|
|
84
|
+
const id = text(entry.id)!;
|
|
85
|
+
const row = rows.get(`${kit} ${id}`) ?? { id, kit, lists: new Set(), names: new Set(), scenarios: new Set() };
|
|
86
|
+
rows.set(`${kit} ${id}`, row);
|
|
87
|
+
row.lists.add(list);
|
|
88
|
+
if (text(entry.name) !== undefined) row.names.add(text(entry.name)!);
|
|
89
|
+
if (text(entry.scenario) !== undefined) row.scenarios.add(text(entry.scenario)!);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return [...rows.values()].map(row => ({
|
|
94
|
+
id: row.id, kit: row.kit, lists: [...row.lists], names: [...row.names], scenarios: [...row.scenarios],
|
|
95
|
+
exemptions: exemptions.get(row.id) ?? [],
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** The exemption ids that name no indexed row. */
|
|
100
|
+
export function unmatchedExemptions(index: readonly IndexedRow[]): string[] {
|
|
101
|
+
const ids = new Set(index.map(row => row.id));
|
|
102
|
+
return Object.values(KITS).flatMap(kit => exportedLists(kit, isExemption))
|
|
103
|
+
.flatMap(([, list]) => list.map(entry => text(entry.criterion)!)).filter(id => !ids.has(id));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** The lines that print one row. */
|
|
107
|
+
export function formatRow(row: IndexedRow): string[] {
|
|
108
|
+
// Some kits start a name with the row id; the id is already the first column.
|
|
109
|
+
const names = row.names.map(name => name.startsWith(`${row.id} `) ? name.slice(row.id.length + 1) : name);
|
|
110
|
+
return [
|
|
111
|
+
`${row.id} ${names[0] ?? '(no name: its cells carry it in their titles)'}`,
|
|
112
|
+
...names.slice(1).map(name => ` also: ${name}`),
|
|
113
|
+
` scenario: ${row.scenarios.join(', ') || '(none declared)'}`,
|
|
114
|
+
` kit: ${row.kit} (${row.lists.join(', ')})`,
|
|
115
|
+
...row.exemptions.map(({ runner, kind, reason }) => ` exempt: ${runner}${kind === undefined ? '' : ` (${kind})`}: ${reason}`),
|
|
116
|
+
];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const count = (n: number, word: string) => `${n} ${word}${n === 1 ? '' : 's'}`;
|
|
120
|
+
|
|
121
|
+
export interface RowQuery { readonly row?: string; readonly runner?: string; readonly json?: boolean }
|
|
122
|
+
|
|
123
|
+
/** What the command prints for a query: `out` on stdout, `error` on stderr with exit code 1. */
|
|
124
|
+
export function renderRows(index: readonly IndexedRow[], query: RowQuery): { out: string[]; error?: string } {
|
|
125
|
+
if (query.runner !== undefined && !(RUNNER_IDS as readonly string[]).includes(query.runner)) {
|
|
126
|
+
return { out: [], error: `unknown runner "${query.runner}"; the runners are ${RUNNER_IDS.join(', ')}` };
|
|
127
|
+
}
|
|
128
|
+
const named = index.filter(row => query.row === undefined || row.id === query.row);
|
|
129
|
+
const rows = named
|
|
130
|
+
.map(row => query.runner === undefined ? row : { ...row, exemptions: row.exemptions.filter(exemption => exemption.runner === query.runner) })
|
|
131
|
+
.filter(row => query.runner === undefined || row.exemptions.length > 0);
|
|
132
|
+
const out = query.json
|
|
133
|
+
? [JSON.stringify(rows, null, 2)]
|
|
134
|
+
: [...rows.flatMap(formatRow), `${count(rows.length, 'row')} in ${count(new Set(rows.map(row => row.kit)).size, 'kit')}`];
|
|
135
|
+
return named.length === 0 && query.row !== undefined ? { out, error: `no kit declares row "${query.row}"` } : { out };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const USAGE = 'usage: node packages/cezar/scripts/parity-rows.ts [--row <id>] [--runner <id>] [--json]';
|
|
139
|
+
|
|
140
|
+
/** What the command prints for its arguments. A flag `parseArgs` refuses is an error with the usage line. */
|
|
141
|
+
export function runParityRows(args: readonly string[]): { out: string[]; error?: string } {
|
|
142
|
+
let query: RowQuery;
|
|
143
|
+
try {
|
|
144
|
+
query = parseArgs({ args: [...args], options: { row: { type: 'string' }, runner: { type: 'string' }, json: { type: 'boolean' } } }).values;
|
|
145
|
+
} catch (error) {
|
|
146
|
+
return { out: [], error: `${(error as Error).message}\n${USAGE}` };
|
|
147
|
+
}
|
|
148
|
+
return renderRows(parityRowIndex(), query);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function main(): void {
|
|
152
|
+
const { out, error } = runParityRows(process.argv.slice(2));
|
|
153
|
+
for (const line of out) console.log(line);
|
|
154
|
+
if (error !== undefined) {
|
|
155
|
+
console.error(error);
|
|
156
|
+
process.exitCode = 1;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (import.meta.main) main();
|