wicked-crew 0.10.2 → 0.12.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/dist/api/capture.d.ts +2 -2
- package/dist/api/delivery-assurance.d.ts +1 -6
- package/dist/api/delivery-assurance.d.ts.map +1 -1
- package/dist/api/delivery-assurance.js +4 -14
- package/dist/api/delivery-assurance.js.map +1 -1
- package/dist/api/governance-steering.d.ts +2 -2
- package/dist/api/mcp.d.ts +4 -4
- package/dist/api/recording.d.ts +29 -3
- package/dist/api/recording.d.ts.map +1 -1
- package/dist/api/recording.js +188 -0
- package/dist/api/recording.js.map +1 -1
- package/dist/api/roster-standing.d.ts +6 -2
- package/dist/api/roster-standing.d.ts.map +1 -1
- package/dist/api/roster-standing.js +62 -13
- package/dist/api/roster-standing.js.map +1 -1
- package/dist/api/routes.d.ts +115 -112
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +227 -6
- package/dist/api/routes.js.map +1 -1
- package/dist/api/seat-container-login.d.ts +60 -0
- package/dist/api/seat-container-login.d.ts.map +1 -0
- package/dist/api/seat-container-login.js +158 -0
- package/dist/api/seat-container-login.js.map +1 -0
- package/dist/api/seat-probe.d.ts +7 -0
- package/dist/api/seat-probe.d.ts.map +1 -1
- package/dist/api/seat-probe.js +27 -5
- package/dist/api/seat-probe.js.map +1 -1
- package/dist/api/seat-version.d.ts +8 -0
- package/dist/api/seat-version.d.ts.map +1 -1
- package/dist/api/seat-version.js +36 -4
- package/dist/api/seat-version.js.map +1 -1
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +4 -0
- package/dist/api/server.js.map +1 -1
- package/dist/api/testing.d.ts +4 -4
- package/dist/appearance/video-palette.d.ts +14 -0
- package/dist/appearance/video-palette.d.ts.map +1 -0
- package/dist/appearance/video-palette.js +75 -0
- package/dist/appearance/video-palette.js.map +1 -0
- package/dist/campaigns/routes.d.ts +2 -2
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +20 -0
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/builtin-catalog.d.ts.map +1 -1
- package/dist/core/builtin-catalog.js +6 -1
- package/dist/core/builtin-catalog.js.map +1 -1
- package/dist/core/engine-roster.d.ts.map +1 -1
- package/dist/core/engine-roster.js +1 -0
- package/dist/core/engine-roster.js.map +1 -1
- package/dist/core/qe-acceptance-setting.d.ts +65 -0
- package/dist/core/qe-acceptance-setting.d.ts.map +1 -0
- package/dist/core/qe-acceptance-setting.js +93 -0
- package/dist/core/qe-acceptance-setting.js.map +1 -0
- package/dist/core/run-identity.d.ts.map +1 -1
- package/dist/core/run-identity.js +3 -2
- package/dist/core/run-identity.js.map +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +3 -0
- package/dist/core/types.js.map +1 -1
- package/dist/editors/pack-install.d.ts +36 -3
- package/dist/editors/pack-install.d.ts.map +1 -1
- package/dist/editors/pack-install.js +71 -6
- package/dist/editors/pack-install.js.map +1 -1
- package/dist/editors/registry.d.ts +153 -14
- package/dist/editors/registry.d.ts.map +1 -1
- package/dist/editors/registry.js +29 -4
- package/dist/editors/registry.js.map +1 -1
- package/dist/editors/surfaces.d.ts +48 -0
- package/dist/editors/surfaces.d.ts.map +1 -0
- package/dist/editors/surfaces.js +294 -0
- package/dist/editors/surfaces.js.map +1 -0
- package/dist/events/terminals.d.ts +42 -2
- package/dist/events/terminals.d.ts.map +1 -1
- package/dist/events/terminals.js +136 -3
- package/dist/events/terminals.js.map +1 -1
- package/dist/interactive/chat-events.d.ts +4 -3
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +7 -6
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/doc-grounding.d.ts.map +1 -1
- package/dist/interactive/doc-grounding.js +7 -1
- package/dist/interactive/doc-grounding.js.map +1 -1
- package/dist/interactive/draft-skill.d.ts +11 -4
- package/dist/interactive/draft-skill.d.ts.map +1 -1
- package/dist/interactive/draft-skill.js +42 -9
- package/dist/interactive/draft-skill.js.map +1 -1
- package/dist/projects/state-home-registry.d.ts.map +1 -1
- package/dist/projects/state-home-registry.js +2 -0
- package/dist/projects/state-home-registry.js.map +1 -1
- package/dist/studio/assets/index-1Ucvzihb.js +770 -0
- package/dist/studio/assets/index-B0u_f6HD.css +32 -0
- package/dist/studio/editors/wicked-deck/editor.json +88 -0
- package/dist/studio/editors/wicked-deck/index.html +230 -0
- package/dist/studio/editors/wicked-doc/editor.json +91 -0
- package/dist/studio/editors/wicked-doc/index.html +161 -0
- package/dist/studio/editors/wicked-page/editor.json +42 -4
- package/dist/studio/editors/wicked-page/index.html +25 -8
- package/dist/studio/editors/wicked-video/editor.json +271 -0
- package/dist/studio/editors/wicked-video/index.html +28 -0
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +3844 -1364
- package/dist/team/routes.d.ts +2 -2
- package/endpoint-manifest.json +56 -1
- package/package.json +3 -3
- package/dist/studio/assets/index-C6DLorst.css +0 -32
- package/dist/studio/assets/index-CAhuFWeA.js +0 -609
package/dist/api/capture.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export declare const CaptureSchema: z.ZodObject<{
|
|
|
61
61
|
/** wicked-core#850 — the explicit reduced-assurance opt-in, forwarded to `POST /runs` only when `true`. */
|
|
62
62
|
reducedAssurance: z.ZodOptional<z.ZodBoolean>;
|
|
63
63
|
}, "strict", z.ZodTypeAny, {
|
|
64
|
+
reducedAssurance?: boolean | undefined;
|
|
64
65
|
files?: ({
|
|
65
66
|
name: string;
|
|
66
67
|
text: string;
|
|
@@ -70,8 +71,8 @@ export declare const CaptureSchema: z.ZodObject<{
|
|
|
70
71
|
dataBase64: string;
|
|
71
72
|
})[] | undefined;
|
|
72
73
|
notes?: string | undefined;
|
|
73
|
-
reducedAssurance?: boolean | undefined;
|
|
74
74
|
}, {
|
|
75
|
+
reducedAssurance?: boolean | undefined;
|
|
75
76
|
files?: ({
|
|
76
77
|
name: string;
|
|
77
78
|
text: string;
|
|
@@ -81,7 +82,6 @@ export declare const CaptureSchema: z.ZodObject<{
|
|
|
81
82
|
dataBase64: string;
|
|
82
83
|
})[] | undefined;
|
|
83
84
|
notes?: string | undefined;
|
|
84
|
-
reducedAssurance?: boolean | undefined;
|
|
85
85
|
}>;
|
|
86
86
|
/** `POST /proposals/:id/approve` body — present only for an accept WITH an edit. */
|
|
87
87
|
export declare const ApproveEditSchema: z.ZodObject<{
|
|
@@ -22,12 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import type { QeAcceptanceDecision, AssuranceReceipt, DeliveryAssurance, QeAcceptanceCheck, QeAcceptanceRefusal, SessionView, WorkUnit } from '../core/types.js';
|
|
24
24
|
import type { AcceptanceView } from '../qe/acceptance.js';
|
|
25
|
-
|
|
26
|
-
export declare const QE_ACCEPTANCE = "qe_acceptance";
|
|
27
|
-
/** The engine's BUILT-IN presets that require `qe_acceptance` — the mirror of wicked-core's
|
|
28
|
-
* `catalog::builtin_preset_instruments` (QE-IN-APP-WORKFLOWS). A launch naming one of these runs the
|
|
29
|
-
* preset, whatever def of the same name crew holds. */
|
|
30
|
-
export declare const QE_PRESETS: ReadonlySet<string>;
|
|
25
|
+
export { QE_ACCEPTANCE, QE_PRESETS } from '../core/qe-acceptance-setting.js';
|
|
31
26
|
/** `QeAcceptanceRefusal.code`. */
|
|
32
27
|
export declare const QE_ACCEPTANCE_REQUIRED_CODE: "qe_acceptance_required";
|
|
33
28
|
/** Whether the run's persisted contract requires a QE acceptance PASS before delivery. A run from an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-assurance.d.ts","sourceRoot":"","sources":["../../src/api/delivery-assurance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EACV,oBAAoB,EAEpB,gBAAgB,EAEhB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,QAAQ,EACT,MAAM,kBAA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BAAgB,GAAG,IAAI,CAE7E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,gBAAgB,GAAG,IAAI,CA0ChG;AAED,mFAAmF;AACnF,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE;IAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,EACrE,YAAY,EAAE,iBAAiB,GAAG,IAAI,GACrC,iBAAiB,CAUnB"}
|
|
@@ -20,20 +20,10 @@
|
|
|
20
20
|
* body (the deliver script, `DELIVER_UNVERIFIED_MARKER`) and in the run record
|
|
21
21
|
* (`AgentSession.delivery_assurance`, rehydrated from the `run.delivered` audit entry).
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* preset, whatever def of the same name crew holds. */
|
|
28
|
-
export const QE_PRESETS = new Set([
|
|
29
|
-
'feature',
|
|
30
|
-
'migration',
|
|
31
|
-
// core-ts 0.8.2: X-MIG M1 (`bug`, wicked-core#864) and M12 (`mcp-server`, #866) made these
|
|
32
|
-
// built-in presets with qe_acceptance (codex r3 on crew A: without them an unattended delivery
|
|
33
|
-
// of a bug fix pushed past the verdict check).
|
|
34
|
-
'bug',
|
|
35
|
-
'mcp-server',
|
|
36
|
-
]);
|
|
23
|
+
import { QE_ACCEPTANCE } from '../core/qe-acceptance-setting.js';
|
|
24
|
+
// The contract token and the built-in QE presets live with the daemon's QE acceptance setting (the
|
|
25
|
+
// adapter applies it at launch); re-exported here for the deliver paths.
|
|
26
|
+
export { QE_ACCEPTANCE, QE_PRESETS } from '../core/qe-acceptance-setting.js';
|
|
37
27
|
/** `QeAcceptanceRefusal.code`. */
|
|
38
28
|
export const QE_ACCEPTANCE_REQUIRED_CODE = 'qe_acceptance_required';
|
|
39
29
|
/** Whether the run's persisted contract requires a QE acceptance PASS before delivery. A run from an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-assurance.js","sourceRoot":"","sources":["../../src/api/delivery-assurance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"delivery-assurance.js","sourceRoot":"","sources":["../../src/api/delivery-assurance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAaH,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGjE,mGAAmG;AACnG,yEAAyE;AACzE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC7E,kCAAkC;AAClC,MAAM,CAAC,MAAM,2BAA2B,GAAG,wBAAiC,CAAC;AAE7E;oGACoG;AACpG,MAAM,UAAU,oBAAoB,CAAC,IAAiB;IACpD,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;AACrC,CAAC;AAED;uFACuF;AACvF,MAAM,UAAU,YAAY,CAAC,IAAiB;IAC5C,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACjC,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9F,OAAO,CACL,CAAC,CAAC,EAAE,IAAI;QACN,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,8CAA8C;QACtD,OAAO,EAAE,EAAE;QACX,GAAG,EAAE,IAAI;QACT,IAAI,EAAE,IAAI;KACX,CACF,CAAC;AACJ,CAAC;AAED;;;kFAGkF;AAClF,MAAM,UAAU,kBAA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AI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU,CAAC;gBAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IACD,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;QAChC,GAAG;QACH,OAAO;QACP,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,IAAI;QACX,IAAI;QACJ,OAAO,EAAE,CAAC;QACV,GAAG,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7C,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,wBAAwB,CACtC,IAAiB,EACjB,KAAqE,EACrE,YAAsC;IAEtC,MAAM,SAAS,GAAG,KAAK,EAAE,SAAS,IAAI,IAAI,CAAC;IAC3C,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAC;QAC1C,UAAU,EAAE,KAAK,EAAE,UAAU,IAAI,IAAI;QACrC,SAAS;QACT,YAAY;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -103,9 +103,9 @@ export declare const SteeringAuthorSchema: z.ZodObject<{
|
|
|
103
103
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
104
104
|
}, "strict", z.ZodTypeAny, {
|
|
105
105
|
instructions: string;
|
|
106
|
+
sessionId?: string | undefined;
|
|
106
107
|
repoRef?: string | undefined;
|
|
107
108
|
type?: "architecture" | "development" | "security" | "testing" | "operations" | "compliance" | "design-ux" | undefined;
|
|
108
|
-
sessionId?: string | undefined;
|
|
109
109
|
paths?: string[] | undefined;
|
|
110
110
|
documents?: {
|
|
111
111
|
name: string;
|
|
@@ -113,9 +113,9 @@ export declare const SteeringAuthorSchema: z.ZodObject<{
|
|
|
113
113
|
}[] | undefined;
|
|
114
114
|
}, {
|
|
115
115
|
instructions: string;
|
|
116
|
+
sessionId?: string | undefined;
|
|
116
117
|
repoRef?: string | undefined;
|
|
117
118
|
type?: "architecture" | "development" | "security" | "testing" | "operations" | "compliance" | "design-ux" | undefined;
|
|
118
|
-
sessionId?: string | undefined;
|
|
119
119
|
paths?: string[] | undefined;
|
|
120
120
|
documents?: {
|
|
121
121
|
name: string;
|
package/dist/api/mcp.d.ts
CHANGED
|
@@ -94,8 +94,8 @@ export declare const McpServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
94
94
|
*/
|
|
95
95
|
secret: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
96
96
|
}, "strict", z.ZodTypeAny, {
|
|
97
|
-
kind: "mcp-stdio" | "mcp-http" | "rest";
|
|
98
97
|
name: string;
|
|
98
|
+
kind: "mcp-stdio" | "mcp-http" | "rest";
|
|
99
99
|
auth?: {
|
|
100
100
|
ref: string;
|
|
101
101
|
env?: string | undefined;
|
|
@@ -110,8 +110,8 @@ export declare const McpServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
110
110
|
openapiUrl?: string | undefined;
|
|
111
111
|
openapi?: Record<string, unknown> | undefined;
|
|
112
112
|
}, {
|
|
113
|
-
kind: "mcp-stdio" | "mcp-http" | "rest";
|
|
114
113
|
name: string;
|
|
114
|
+
kind: "mcp-stdio" | "mcp-http" | "rest";
|
|
115
115
|
auth?: {
|
|
116
116
|
ref: string;
|
|
117
117
|
env?: string | undefined;
|
|
@@ -126,8 +126,8 @@ export declare const McpServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
126
126
|
openapiUrl?: string | undefined;
|
|
127
127
|
openapi?: Record<string, unknown> | undefined;
|
|
128
128
|
}>, {
|
|
129
|
-
kind: "mcp-stdio" | "mcp-http" | "rest";
|
|
130
129
|
name: string;
|
|
130
|
+
kind: "mcp-stdio" | "mcp-http" | "rest";
|
|
131
131
|
auth?: {
|
|
132
132
|
ref: string;
|
|
133
133
|
env?: string | undefined;
|
|
@@ -142,8 +142,8 @@ export declare const McpServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
142
142
|
openapiUrl?: string | undefined;
|
|
143
143
|
openapi?: Record<string, unknown> | undefined;
|
|
144
144
|
}, {
|
|
145
|
-
kind: "mcp-stdio" | "mcp-http" | "rest";
|
|
146
145
|
name: string;
|
|
146
|
+
kind: "mcp-stdio" | "mcp-http" | "rest";
|
|
147
147
|
auth?: {
|
|
148
148
|
ref: string;
|
|
149
149
|
env?: string | undefined;
|
package/dist/api/recording.d.ts
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
*/
|
|
56
56
|
import type { FastifyInstance } from 'fastify';
|
|
57
57
|
import { z } from 'zod';
|
|
58
|
-
import type { DemoChapter, DemoExportFormat, DemoFinding, DemoMarker, DemoStage, DemoView, WalkthroughView } from 'wicked-crew-api-types';
|
|
58
|
+
import type { DemoDocumentResponse, DemoChapter, DemoExportFormat, DemoFinding, DemoMarker, DemoStage, DemoView, WalkthroughView } from 'wicked-crew-api-types';
|
|
59
59
|
import type { CoreAdapter } from '../core/adapter.js';
|
|
60
60
|
import type { SessionView, WorkUnit } from '../core/types.js';
|
|
61
61
|
import type { AuditLog } from './audit.js';
|
|
@@ -113,14 +113,14 @@ export declare const DemoLaunchSchema: z.ZodObject<{
|
|
|
113
113
|
url: string;
|
|
114
114
|
audience: string;
|
|
115
115
|
show: string;
|
|
116
|
-
reducedAssurance?: boolean | undefined;
|
|
117
116
|
clisJson?: string | undefined;
|
|
117
|
+
reducedAssurance?: boolean | undefined;
|
|
118
118
|
}, {
|
|
119
119
|
url: string;
|
|
120
120
|
audience: string;
|
|
121
121
|
show: string;
|
|
122
|
-
reducedAssurance?: boolean | undefined;
|
|
123
122
|
clisJson?: string | undefined;
|
|
123
|
+
reducedAssurance?: boolean | undefined;
|
|
124
124
|
}>;
|
|
125
125
|
export declare const DemoScriptSchema: z.ZodObject<{
|
|
126
126
|
content: z.ZodString;
|
|
@@ -193,6 +193,32 @@ export declare function parseReview(output: string | null): {
|
|
|
193
193
|
};
|
|
194
194
|
/** Everything studio renders for a demo run, read from its root and its units. */
|
|
195
195
|
export declare function demoView(adapter: CoreAdapter, view: SessionView): Promise<DemoView>;
|
|
196
|
+
/** Under the state home's registered `daemon-` prefix (state-home-registry.ts): a top-level name the worker
|
|
197
|
+
* Read fence classifies, so the file never refuses a launch. Its temp sidecars share the prefix. */
|
|
198
|
+
export declare const DEMO_DOCS_FILE = "daemon-demo-documents.json";
|
|
199
|
+
type DemoDocLink = NonNullable<DemoView['document']>;
|
|
200
|
+
/** The run's linked document, when one was made (and still reads as one). */
|
|
201
|
+
export declare function demoDocumentLink(runId: string): Promise<DemoDocLink | null>;
|
|
202
|
+
/** One call to the project's bridge: JSON or raw bytes in, the status and parsed JSON body out. */
|
|
203
|
+
export type BridgeCall = (method: 'POST' | 'PUT', path: string, body: Buffer | Record<string, unknown>) => Promise<{
|
|
204
|
+
status: number;
|
|
205
|
+
body: Record<string, unknown>;
|
|
206
|
+
}>;
|
|
207
|
+
export interface DemoDocumentDeps {
|
|
208
|
+
/** The project's bridge (reuse-or-start), as a caller of its HTTP surface; null = no such project. */
|
|
209
|
+
bridgeFor: (projectId: string) => Promise<BridgeCall | null>;
|
|
210
|
+
/** The per-segment read cap (default {@link SEGMENT_MAX_BYTES}). */
|
|
211
|
+
segmentMaxBytes?: number;
|
|
212
|
+
}
|
|
213
|
+
/** Make (once) and link the run's demo document. */
|
|
214
|
+
export declare function makeDemoDocument(view: SessionView, deps: DemoDocumentDeps): Promise<{
|
|
215
|
+
status: number;
|
|
216
|
+
body: DemoDocumentResponse | {
|
|
217
|
+
error: string;
|
|
218
|
+
};
|
|
219
|
+
}>;
|
|
220
|
+
/** `POST /runs/:id/demo/document`, registered where the bridge pool exists. One make per run at a time. */
|
|
221
|
+
export declare function registerDemoDocumentRoute(app: FastifyInstance, adapter: CoreAdapter, deps: DemoDocumentDeps): void;
|
|
196
222
|
/** A single `Range: bytes=a-b` → the inclusive span, `null` for no header, `'bad'` for one we cannot serve. */
|
|
197
223
|
export declare function parseRange(header: string | undefined, size: number): {
|
|
198
224
|
start: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recording.d.ts","sourceRoot":"","sources":["../../src/api/recording.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAEhB,WAAW,EACX,UAAU,EACV,SAAS,EACT,QAAQ,EAMR,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAA+B,WAAW,EAA4B,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAOrH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAyE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC9I,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAIlE,sEAAsE;AACtE,eAAO,MAAM,WAAW,SAAS,CAAC;AAKlC,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,QAAa,CAAC;AAYhD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAA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lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=bayer:bayer_scale=3';
|
|
169
169
|
/** The stages an export may run in: no worker of the run is running, so none can write the root. */
|
|
170
170
|
const DEMO_EXPORT_STAGES = new Set(['review_gate', 'done', 'failed']);
|
|
171
|
+
/** Session statuses that never resume (POST /runs/:id/resume refuses exactly these): the root is no longer written. */
|
|
172
|
+
const DEMO_DOCUMENT_STATUSES = new Set(['completed', 'cancelled']);
|
|
171
173
|
/** What each export writes, inside the run's `demo-video/`. */
|
|
172
174
|
const DEMO_EXPORT_FILE = { gif: 'demo.gif', poster: 'poster.jpg' };
|
|
173
175
|
export const DEMO_FFMPEG_HINT = 'install ffmpeg (e.g. `brew install ffmpeg` / `apt install ffmpeg`) on the daemon host, or set WICKED_FFMPEG to its path';
|
|
@@ -543,8 +545,194 @@ export async function demoView(adapter, view) {
|
|
|
543
545
|
review: { verdict, findings, text: reviewOutput, rejected: review?.status === 'rejected' },
|
|
544
546
|
seats: { recorder: record?.assigned_cli ?? null, reviewer: review?.assigned_cli ?? null },
|
|
545
547
|
syntheticLabelled: script !== null && /synthetic/i.test(script),
|
|
548
|
+
document: await demoDocumentLink(runId),
|
|
546
549
|
};
|
|
547
550
|
}
|
|
551
|
+
// ── The run's demo as an editable document ──────────────────────────────────────────────────────────────────
|
|
552
|
+
// `POST /runs/:id/demo/document` imports the run's recorded segments into a wicked-interactive document (one
|
|
553
|
+
// take per chapter, its title and blurb, the brief's URL), so the video editor can re-cut it with E1's API.
|
|
554
|
+
// The link lives in crew's state home, never in the run root: the run's own worker can write there.
|
|
555
|
+
/** Under the state home's registered `daemon-` prefix (state-home-registry.ts): a top-level name the worker
|
|
556
|
+
* Read fence classifies, so the file never refuses a launch. Its temp sidecars share the prefix. */
|
|
557
|
+
export const DEMO_DOCS_FILE = 'daemon-demo-documents.json';
|
|
558
|
+
const DOC_ID = /^[a-z0-9][a-z0-9-]{0,63}$/u;
|
|
559
|
+
const IMPORT_KEY = /^[a-z0-9][a-z0-9-]{0,47}$/u;
|
|
560
|
+
/** A segment is read and uploaded whole; one larger than this is refused rather than buffered. */
|
|
561
|
+
const SEGMENT_MAX_BYTES = 256 * 1024 * 1024;
|
|
562
|
+
async function readDemoDocs() {
|
|
563
|
+
try {
|
|
564
|
+
const raw = JSON.parse(await fsp.readFile(join(crewStateHome(), DEMO_DOCS_FILE), 'utf8'));
|
|
565
|
+
return raw !== null && typeof raw === 'object' && !Array.isArray(raw) ? raw : {};
|
|
566
|
+
}
|
|
567
|
+
catch {
|
|
568
|
+
return {};
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
/** The run's linked document, when one was made (and still reads as one). */
|
|
572
|
+
export async function demoDocumentLink(runId) {
|
|
573
|
+
const link = (await readDemoDocs())[runId];
|
|
574
|
+
return link !== undefined && typeof link.projectId === 'string' && typeof link.docId === 'string' && DOC_ID.test(link.docId)
|
|
575
|
+
? { projectId: link.projectId, docId: link.docId }
|
|
576
|
+
: null;
|
|
577
|
+
}
|
|
578
|
+
/** One writer for the links file across every run: each write reads, adds and renames inside this chain, so two
|
|
579
|
+
* runs' links never overwrite each other. */
|
|
580
|
+
let demoDocsWrites = Promise.resolve();
|
|
581
|
+
function writeDemoDocLink(runId, link) {
|
|
582
|
+
const write = demoDocsWrites.then(async () => {
|
|
583
|
+
const all = await readDemoDocs();
|
|
584
|
+
all[runId] = link;
|
|
585
|
+
const path = join(crewStateHome(), DEMO_DOCS_FILE);
|
|
586
|
+
const tmp = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
587
|
+
await fsp.mkdir(crewStateHome(), { recursive: true });
|
|
588
|
+
try {
|
|
589
|
+
await fsp.writeFile(tmp, JSON.stringify(all, null, 2), 'utf8');
|
|
590
|
+
await fsp.rename(tmp, path);
|
|
591
|
+
}
|
|
592
|
+
finally {
|
|
593
|
+
await fsp.rm(tmp, { force: true });
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
demoDocsWrites = write.catch(() => undefined);
|
|
597
|
+
return write;
|
|
598
|
+
}
|
|
599
|
+
/** Thrown for a segment that is not a plain file inside the run root (or changed while it was read). */
|
|
600
|
+
class SegmentReadError extends Error {
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* A chapter's segment bytes, read like `readStoryline`: no link on the way (`demo-video`, `segments`, the
|
|
604
|
+
* chapter directory, the file), the directory's real path pinned under the root's, the file opened O_NOFOLLOW and
|
|
605
|
+
* at most {@link SEGMENT_MAX_BYTES}, and the inode that was read re-checked at the pinned path afterwards — the
|
|
606
|
+
* run's worker can write the root, so a swap between the check and the open is refused, never followed out.
|
|
607
|
+
*/
|
|
608
|
+
async function readSegment(root, key, maxBytes = SEGMENT_MAX_BYTES) {
|
|
609
|
+
const parts = ['demo-video', 'segments', key];
|
|
610
|
+
let p = root;
|
|
611
|
+
for (const part of parts) {
|
|
612
|
+
p = join(p, part);
|
|
613
|
+
const st = await fsp.lstat(p).catch(() => null);
|
|
614
|
+
if (st === null || st.isSymbolicLink() || !st.isDirectory())
|
|
615
|
+
throw new SegmentReadError(`chapter ${key} has no recorded segment yet`);
|
|
616
|
+
}
|
|
617
|
+
const dir = p;
|
|
618
|
+
const file = join(dir, 'segment.mp4');
|
|
619
|
+
const expected = join(await fsp.realpath(root), ...parts);
|
|
620
|
+
if ((await fsp.realpath(dir)) !== expected)
|
|
621
|
+
throw new SegmentReadError(`chapter ${key}'s segment resolves outside the demo root`);
|
|
622
|
+
const fh = await fsp.open(file, fsConstants.O_RDONLY | (fsConstants.O_NOFOLLOW ?? 0)).catch(() => null);
|
|
623
|
+
if (fh === null)
|
|
624
|
+
throw new SegmentReadError(`chapter ${key} has no recorded segment yet`);
|
|
625
|
+
try {
|
|
626
|
+
const st = await fh.stat();
|
|
627
|
+
if (!st.isFile() || st.size === 0)
|
|
628
|
+
throw new SegmentReadError(`chapter ${key} has no recorded segment yet`);
|
|
629
|
+
if (st.size > maxBytes)
|
|
630
|
+
throw new SegmentReadError(`chapter ${key}'s segment is over ${maxBytes} bytes`);
|
|
631
|
+
// A bounded read: never more than the size fstat reported (+1 to see growth), whatever the file does meanwhile.
|
|
632
|
+
const buf = Buffer.alloc(st.size + 1);
|
|
633
|
+
let n = 0;
|
|
634
|
+
for (;;) {
|
|
635
|
+
const { bytesRead } = await fh.read(buf, n, buf.length - n, n);
|
|
636
|
+
if (bytesRead === 0)
|
|
637
|
+
break;
|
|
638
|
+
n += bytesRead;
|
|
639
|
+
if (n > st.size)
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
const bytes = buf.subarray(0, n);
|
|
643
|
+
const after = await fsp.lstat(file).catch(() => null);
|
|
644
|
+
if (n !== st.size || after === null || after.ino !== st.ino || after.dev !== st.dev || (await fsp.realpath(dir)) !== expected) {
|
|
645
|
+
throw new SegmentReadError(`chapter ${key}'s segment changed while it was read`);
|
|
646
|
+
}
|
|
647
|
+
return bytes;
|
|
648
|
+
}
|
|
649
|
+
finally {
|
|
650
|
+
await fh.close();
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
/** Make (once) and link the run's demo document. */
|
|
654
|
+
export async function makeDemoDocument(view, deps) {
|
|
655
|
+
const runId = view.session.id;
|
|
656
|
+
const existing = await demoDocumentLink(runId);
|
|
657
|
+
if (existing !== null)
|
|
658
|
+
return { status: 200, body: { ...existing, created: false } };
|
|
659
|
+
// Only from a run that can never run again: completed or cancelled. No worker of it is alive, or can be resumed,
|
|
660
|
+
// to write the root while it is read — a review gate's send-back or a failed run's resume restarts the recorder,
|
|
661
|
+
// which could swap a segment's directory mid-read (codex on #1013).
|
|
662
|
+
if (!DEMO_DOCUMENT_STATUSES.has(view.session.status))
|
|
663
|
+
return { status: 409, body: { error: 'a demo becomes a document once its run has completed (or was cancelled)' } };
|
|
664
|
+
const root = await existingDemoRootDir(runId);
|
|
665
|
+
const chapters = parseChapters(await readText(root, 'chapters.json'));
|
|
666
|
+
if (chapters.length === 0)
|
|
667
|
+
return { status: 409, body: { error: 'the demo has no chapters to import' } };
|
|
668
|
+
for (const c of chapters) {
|
|
669
|
+
if (!IMPORT_KEY.test(c.key))
|
|
670
|
+
return { status: 409, body: { error: `chapter key ${JSON.stringify(c.key)} cannot name a take` } };
|
|
671
|
+
const size = await fileSize(root, `demo-video/segments/${c.key}/segment.mp4`);
|
|
672
|
+
if (size === null || size === 0)
|
|
673
|
+
return { status: 409, body: { error: `chapter ${c.key} has no recorded segment yet` } };
|
|
674
|
+
}
|
|
675
|
+
const projectId = view.session.project_id ?? UNFILED_PROJECT;
|
|
676
|
+
const call = await deps.bridgeFor(projectId);
|
|
677
|
+
if (call === null)
|
|
678
|
+
return { status: 404, body: { error: `Project ${projectId} not found` } };
|
|
679
|
+
const docId = `demo-${runId.replace(/[^a-z0-9]/giu, '').toLowerCase().slice(0, 12)}`;
|
|
680
|
+
const { url } = briefFields(await readText(root, 'BRIEF.md'));
|
|
681
|
+
const title = `Demo of ${url ?? 'the app'}`.replace(/[\r\n]+/gu, ' ').slice(0, 80);
|
|
682
|
+
const placeholder = `<main><h1>${title.replace(/[&<>"]/gu, '')}</h1><p>The run's demo, imported for editing.</p></main>`;
|
|
683
|
+
const created = await call('POST', '/api/docs', { name: docId, html: placeholder, ...(projectId !== UNFILED_PROJECT ? { project: projectId } : {}) });
|
|
684
|
+
if (created.status !== 200 && created.status !== 409)
|
|
685
|
+
return { status: 502, body: { error: `interactive refused the document (${created.status}): ${String(created.body['error'] ?? '')}` } };
|
|
686
|
+
for (const c of chapters) {
|
|
687
|
+
let bytes;
|
|
688
|
+
try {
|
|
689
|
+
bytes = await readSegment(root, c.key, deps.segmentMaxBytes);
|
|
690
|
+
}
|
|
691
|
+
catch (e) {
|
|
692
|
+
if (e instanceof SegmentReadError)
|
|
693
|
+
return { status: 409, body: { error: e.message } };
|
|
694
|
+
throw e;
|
|
695
|
+
}
|
|
696
|
+
const staged = await call('PUT', `/d/${encodeURIComponent(docId)}/api/demo/import/${encodeURIComponent(c.key)}`, bytes);
|
|
697
|
+
// 409 cut_exists: an earlier attempt imported it already; the link below is all that is missing.
|
|
698
|
+
if (staged.status === 409 && staged.body['error'] === 'cut_exists')
|
|
699
|
+
break;
|
|
700
|
+
if (staged.status !== 200)
|
|
701
|
+
return { status: 502, body: { error: `interactive refused chapter ${c.key} (${staged.status}): ${String(staged.body['error'] ?? '')}` } };
|
|
702
|
+
}
|
|
703
|
+
const imported = await call('POST', `/d/${encodeURIComponent(docId)}/api/demo/import`, {
|
|
704
|
+
title,
|
|
705
|
+
...(url !== null ? { url } : {}),
|
|
706
|
+
chapters: chapters.map((c) => ({ id: c.key, title: c.title.replace(/[\r\n]+/gu, ' ').slice(0, 80) || c.key, ...(c.blurb ? { say: c.blurb.slice(0, 2000) } : {}) })),
|
|
707
|
+
});
|
|
708
|
+
if (imported.status !== 200 && !(imported.status === 409 && imported.body['error'] === 'cut_exists')) {
|
|
709
|
+
return { status: 502, body: { error: `interactive refused the import (${imported.status}): ${String(imported.body['error'] ?? '')}` } };
|
|
710
|
+
}
|
|
711
|
+
const link = { projectId, docId };
|
|
712
|
+
await writeDemoDocLink(runId, link);
|
|
713
|
+
return { status: 200, body: { ...link, created: true } };
|
|
714
|
+
}
|
|
715
|
+
/** `POST /runs/:id/demo/document`, registered where the bridge pool exists. One make per run at a time. */
|
|
716
|
+
export function registerDemoDocumentRoute(app, adapter, deps) {
|
|
717
|
+
const inFlight = new Map();
|
|
718
|
+
app.post(`${V}/runs/:id/demo/document`, { config: { manifest: { responseType: 'DemoDocumentResponse', statusCodes: [200, 404, 409, 502, 503] } } }, async (req, reply) => {
|
|
719
|
+
const { id } = req.params;
|
|
720
|
+
const views = await adapter.sessionsDetail();
|
|
721
|
+
const run = views.find((v) => v.session.id === id);
|
|
722
|
+
if (run === undefined || !isDemoRun(run))
|
|
723
|
+
return reply.code(404).send({ error: 'no demo run with that id' });
|
|
724
|
+
let pending = inFlight.get(id);
|
|
725
|
+
if (pending === undefined) {
|
|
726
|
+
// A bridge that will not start (or a transport failure mid-import) is a 503 with its reason, never a 500.
|
|
727
|
+
pending = makeDemoDocument(run, deps)
|
|
728
|
+
.catch((e) => ({ status: 503, body: { error: `the interactive bridge is unavailable: ${e instanceof Error ? e.message : String(e)}` } }))
|
|
729
|
+
.finally(() => inFlight.delete(id));
|
|
730
|
+
inFlight.set(id, pending);
|
|
731
|
+
}
|
|
732
|
+
const answer = await pending;
|
|
733
|
+
return reply.code(answer.status).send(answer.body);
|
|
734
|
+
});
|
|
735
|
+
}
|
|
548
736
|
/** `path` resolved inside `root` (symlinks included), or `null` when it would leave it. */
|
|
549
737
|
async function containedPath(root, rel) {
|
|
550
738
|
if (rel === '' || rel.includes('\0'))
|