wicked-crew 0.15.3 → 0.15.4
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/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +6 -0
- package/dist/api/routes.js.map +1 -1
- package/dist/api/seat-work-default.d.ts +22 -0
- package/dist/api/seat-work-default.d.ts.map +1 -0
- package/dist/api/seat-work-default.js +91 -0
- package/dist/api/seat-work-default.js.map +1 -0
- package/dist/studio/assets/{index-CvH1l1tp.js → index-CK-ppFAd.js} +155 -155
- package/dist/studio/assets/{index-70ozkvqx.css → index-Chzb3FOa.css} +1 -1
- package/dist/studio/editors/wicked-deck/editor.json +1 -1
- package/dist/studio/editors/wicked-deck/index.html +1 -1
- package/dist/studio/editors/wicked-doc/editor.json +1 -1
- package/dist/studio/editors/wicked-doc/index.html +1 -1
- package/dist/studio/editors/wicked-page/editor.json +1 -1
- package/dist/studio/editors/wicked-page/index.html +1 -1
- package/dist/studio/editors/wicked-video/editor.json +1 -1
- package/dist/studio/editors/wicked-video/index.html +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +9 -3
- package/endpoint-manifest.json +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HealthWarning } from 'wicked-crew-api-types';
|
|
2
|
+
/** The engine's built-in seat keys (wicked-council `registry::builtin`). */
|
|
3
|
+
export declare const BUILTIN_SEAT_KEYS: readonly string[];
|
|
4
|
+
export declare const SEAT_WORK_DEFAULT_KIND = "seat.work_default";
|
|
5
|
+
/** What the overlay says about one seat's roles, after folding every record with its key. */
|
|
6
|
+
export interface OverlaySeatRoles {
|
|
7
|
+
key: string;
|
|
8
|
+
/** The last value a record wrote; `undefined` when none wrote the flag. */
|
|
9
|
+
enabled_for_council: boolean | undefined;
|
|
10
|
+
/** Some record with this key writes `seat_eligible_for_work` (true or false). */
|
|
11
|
+
work_flag_written: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function isBuiltinSeat(key: string): boolean;
|
|
14
|
+
/** The overlay's seats, in first-appearance order, each folded over its records. Throws on a
|
|
15
|
+
* malformed file (the caller treats that as "nothing to say"). */
|
|
16
|
+
export declare function readOverlaySeatRoles(text: string): OverlaySeatRoles[];
|
|
17
|
+
/** One `seat.work_default` warning per custom seat that is council-off with no work flag written. */
|
|
18
|
+
export declare function seatWorkDefaultWarnings(seats: readonly OverlaySeatRoles[]): HealthWarning[];
|
|
19
|
+
/** The warnings for the overlay the engine reads now. Re-read when the file changes (one `stat` per
|
|
20
|
+
* call otherwise), so an edit is reported without a restart; none when there is no overlay. */
|
|
21
|
+
export declare function seatWorkDefaultNow(env?: NodeJS.ProcessEnv): HealthWarning[];
|
|
22
|
+
//# sourceMappingURL=seat-work-default.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-work-default.d.ts","sourceRoot":"","sources":["../../src/api/seat-work-default.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAA4D,CAAC;AAE5G,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAE1D,6FAA6F;AAC7F,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAC;IACzC,iFAAiF;IACjF,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;mEACmE;AACnE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAiBrE;AAED,qGAAqG;AACrG,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,GAAG,aAAa,EAAE,CAa3F;AAID;gGACgG;AAChG,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,aAAa,EAAE,CAmBxF"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// crew 0.15.2 (#916, wicked-core#572) read a seat's two roles separately: `enabled_for_council` (may
|
|
2
|
+
// cast a council ballot) and `seat_eligible_for_work` (may be seated for work, engine default TRUE).
|
|
3
|
+
// Before it, crew read `enabled_for_council = false` as "off both". So an operator's CUSTOM seat
|
|
4
|
+
// written `enabled_for_council = false` with no work flag (a chat-only or helper seat) silently
|
|
5
|
+
// became work-eligible on upgrade, and the engine may now seat it on a unit, for example as the
|
|
6
|
+
// distinct evaluator of a review. This module names each such seat once, on `GET /health.warnings`
|
|
7
|
+
// (`seat.work_default`), `GET /diagnostics.seatGovernance.roleFindings` and `wicked-crew status`.
|
|
8
|
+
//
|
|
9
|
+
// Only the operator's overlay can say whether the key was WRITTEN: the engine's merged roster has
|
|
10
|
+
// already filled the default. So this parses the overlay file itself, the one the engine loads
|
|
11
|
+
// (`seatRosterFile`), and folds its `[[cli]]` records by the engine's own rules
|
|
12
|
+
// (wicked-council `registry::load`): a record whose key matches an earlier one (a built-in or a
|
|
13
|
+
// previous record) inherits that record's `false` for a flag it omits. An unreadable or malformed
|
|
14
|
+
// file yields no finding (the engine reports a malformed overlay itself).
|
|
15
|
+
//
|
|
16
|
+
// Built-in seats never warn: a record whose key is EXACTLY a built-in's overrides it, and an omitted
|
|
17
|
+
// flag inherits the built-in's value, so its standing did not change. Keys match exactly, as in the
|
|
18
|
+
// engine: `agy#2` in the overlay is a new custom seat, not agy.
|
|
19
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
20
|
+
import { parse } from 'smol-toml';
|
|
21
|
+
import { seatRosterFile } from './diagnostics.js';
|
|
22
|
+
/** The engine's built-in seat keys (wicked-council `registry::builtin`). */
|
|
23
|
+
export const BUILTIN_SEAT_KEYS = ['claude', 'agy', 'codex', 'pi', 'copilot', 'opencode'];
|
|
24
|
+
export const SEAT_WORK_DEFAULT_KIND = 'seat.work_default';
|
|
25
|
+
export function isBuiltinSeat(key) {
|
|
26
|
+
return BUILTIN_SEAT_KEYS.includes(key);
|
|
27
|
+
}
|
|
28
|
+
/** The overlay's seats, in first-appearance order, each folded over its records. Throws on a
|
|
29
|
+
* malformed file (the caller treats that as "nothing to say"). */
|
|
30
|
+
export function readOverlaySeatRoles(text) {
|
|
31
|
+
const doc = parse(text);
|
|
32
|
+
const records = Array.isArray(doc.cli) ? doc.cli : [];
|
|
33
|
+
const byKey = new Map();
|
|
34
|
+
for (const raw of records) {
|
|
35
|
+
if (raw === null || typeof raw !== 'object')
|
|
36
|
+
continue;
|
|
37
|
+
const r = raw;
|
|
38
|
+
if (typeof r['key'] !== 'string')
|
|
39
|
+
continue;
|
|
40
|
+
const prev = byKey.get(r['key']);
|
|
41
|
+
const council = typeof r['enabled_for_council'] === 'boolean' ? r['enabled_for_council'] : prev?.enabled_for_council;
|
|
42
|
+
byKey.set(r['key'], {
|
|
43
|
+
key: r['key'],
|
|
44
|
+
enabled_for_council: council,
|
|
45
|
+
work_flag_written: (prev?.work_flag_written ?? false) || typeof r['seat_eligible_for_work'] === 'boolean',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return [...byKey.values()];
|
|
49
|
+
}
|
|
50
|
+
/** One `seat.work_default` warning per custom seat that is council-off with no work flag written. */
|
|
51
|
+
export function seatWorkDefaultWarnings(seats) {
|
|
52
|
+
const out = [];
|
|
53
|
+
for (const r of seats) {
|
|
54
|
+
if (isBuiltinSeat(r.key) || r.enabled_for_council !== false || r.work_flag_written)
|
|
55
|
+
continue;
|
|
56
|
+
out.push({
|
|
57
|
+
kind: SEAT_WORK_DEFAULT_KIND,
|
|
58
|
+
severity: 'warning',
|
|
59
|
+
message: `seat ${r.key} is not enabled for council but is now eligible for work (since crew 0.15.2 the two are separate); ` +
|
|
60
|
+
'set seat_eligible_for_work = false to keep it off work',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
let cache = null;
|
|
66
|
+
/** The warnings for the overlay the engine reads now. Re-read when the file changes (one `stat` per
|
|
67
|
+
* call otherwise), so an edit is reported without a restart; none when there is no overlay. */
|
|
68
|
+
export function seatWorkDefaultNow(env = process.env) {
|
|
69
|
+
const file = seatRosterFile(env);
|
|
70
|
+
if (file === null || !file.present)
|
|
71
|
+
return [];
|
|
72
|
+
try {
|
|
73
|
+
const st = statSync(file.path);
|
|
74
|
+
if (cache !== null && cache.path === file.path && cache.mtimeMs === st.mtimeMs && cache.size === st.size) {
|
|
75
|
+
return cache.warnings;
|
|
76
|
+
}
|
|
77
|
+
let warnings;
|
|
78
|
+
try {
|
|
79
|
+
warnings = seatWorkDefaultWarnings(readOverlaySeatRoles(readFileSync(file.path, 'utf8')));
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
warnings = []; // malformed: the engine reports the overlay itself; not re-parsed until it changes
|
|
83
|
+
}
|
|
84
|
+
cache = { path: file.path, mtimeMs: st.mtimeMs, size: st.size, warnings };
|
|
85
|
+
return warnings;
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=seat-work-default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-work-default.js","sourceRoot":"","sources":["../../src/api/seat-work-default.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,qGAAqG;AACrG,iGAAiG;AACjG,gGAAgG;AAChG,gGAAgG;AAChG,mGAAmG;AACnG,kGAAkG;AAClG,EAAE;AACF,kGAAkG;AAClG,+FAA+F;AAC/F,gFAAgF;AAChF,gGAAgG;AAChG,kGAAkG;AAClG,0EAA0E;AAC1E,EAAE;AACF,qGAAqG;AACrG,oGAAoG;AACpG,gEAAgE;AAChE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,M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