wicked-crew 0.18.21 → 0.18.22
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/audit.d.ts +28 -1
- package/dist/api/audit.d.ts.map +1 -1
- package/dist/api/audit.js +90 -9
- package/dist/api/audit.js.map +1 -1
- package/dist/api/auth.d.ts +7 -0
- package/dist/api/auth.d.ts.map +1 -1
- package/dist/api/auth.js +53 -10
- package/dist/api/auth.js.map +1 -1
- package/dist/api/capture.d.ts +11 -2
- package/dist/api/capture.d.ts.map +1 -1
- package/dist/api/capture.js +7 -2
- package/dist/api/capture.js.map +1 -1
- package/dist/api/chat-context.d.ts +6 -1
- package/dist/api/chat-context.d.ts.map +1 -1
- package/dist/api/chat-context.js +45 -11
- package/dist/api/chat-context.js.map +1 -1
- package/dist/api/chat-proposals.d.ts +24 -7
- package/dist/api/chat-proposals.d.ts.map +1 -1
- package/dist/api/chat-proposals.js +98 -18
- package/dist/api/chat-proposals.js.map +1 -1
- package/dist/api/chat-scope.d.ts +6 -2
- package/dist/api/chat-scope.d.ts.map +1 -1
- package/dist/api/chat-scope.js +13 -7
- package/dist/api/chat-scope.js.map +1 -1
- package/dist/api/cluster-status.d.ts +17 -0
- package/dist/api/cluster-status.d.ts.map +1 -1
- package/dist/api/cluster-status.js +70 -3
- package/dist/api/cluster-status.js.map +1 -1
- package/dist/api/compose-facts.d.ts +35 -0
- package/dist/api/compose-facts.d.ts.map +1 -0
- package/dist/api/compose-facts.js +46 -0
- package/dist/api/compose-facts.js.map +1 -0
- package/dist/api/cut-read.d.ts +62 -0
- package/dist/api/cut-read.d.ts.map +1 -0
- package/dist/api/cut-read.js +101 -0
- package/dist/api/cut-read.js.map +1 -0
- package/dist/api/desk-snoozes.d.ts +54 -0
- package/dist/api/desk-snoozes.d.ts.map +1 -0
- package/dist/api/desk-snoozes.js +174 -0
- package/dist/api/desk-snoozes.js.map +1 -0
- package/dist/api/diagnostics.d.ts +4 -0
- package/dist/api/diagnostics.d.ts.map +1 -1
- package/dist/api/diagnostics.js +15 -7
- package/dist/api/diagnostics.js.map +1 -1
- package/dist/api/disk-stores.d.ts +66 -0
- package/dist/api/disk-stores.d.ts.map +1 -0
- package/dist/api/disk-stores.js +206 -0
- package/dist/api/disk-stores.js.map +1 -0
- package/dist/api/gate-cache.d.ts +8 -0
- package/dist/api/gate-cache.d.ts.map +1 -1
- package/dist/api/gate-cache.js +8 -1
- package/dist/api/gate-cache.js.map +1 -1
- package/dist/api/mcp.d.ts +16 -0
- package/dist/api/mcp.d.ts.map +1 -1
- package/dist/api/mcp.js +118 -1
- package/dist/api/mcp.js.map +1 -1
- package/dist/api/needs.d.ts +3 -0
- package/dist/api/needs.d.ts.map +1 -1
- package/dist/api/needs.js +7 -3
- package/dist/api/needs.js.map +1 -1
- package/dist/api/post-hoc-deliver.d.ts +7 -0
- package/dist/api/post-hoc-deliver.d.ts.map +1 -1
- package/dist/api/post-hoc-deliver.js +16 -5
- package/dist/api/post-hoc-deliver.js.map +1 -1
- package/dist/api/product-publish.d.ts +242 -0
- package/dist/api/product-publish.d.ts.map +1 -0
- package/dist/api/product-publish.js +902 -0
- package/dist/api/product-publish.js.map +1 -0
- package/dist/api/product.d.ts +5 -6
- package/dist/api/product.d.ts.map +1 -1
- package/dist/api/product.js +4 -4
- package/dist/api/product.js.map +1 -1
- package/dist/api/proposal-cut.d.ts +95 -0
- package/dist/api/proposal-cut.d.ts.map +1 -0
- package/dist/api/proposal-cut.js +231 -0
- package/dist/api/proposal-cut.js.map +1 -0
- package/dist/api/requirements.d.ts +3 -3
- package/dist/api/requirements.js +3 -3
- package/dist/api/routes.d.ts +15 -0
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +410 -88
- package/dist/api/routes.js.map +1 -1
- package/dist/api/run-liveness.d.ts.map +1 -1
- package/dist/api/run-liveness.js +3 -1
- package/dist/api/run-liveness.js.map +1 -1
- package/dist/api/run-timing-index.d.ts +10 -0
- package/dist/api/run-timing-index.d.ts.map +1 -1
- package/dist/api/run-timing-index.js +29 -9
- package/dist/api/run-timing-index.js.map +1 -1
- package/dist/api/seat-container-login.d.ts +11 -17
- package/dist/api/seat-container-login.d.ts.map +1 -1
- package/dist/api/seat-container-login.js +36 -69
- package/dist/api/seat-container-login.js.map +1 -1
- package/dist/api/system-snapshot.d.ts +2 -1
- package/dist/api/system-snapshot.d.ts.map +1 -1
- package/dist/api/system-snapshot.js +17 -6
- package/dist/api/system-snapshot.js.map +1 -1
- package/dist/api/ui-text.d.ts.map +1 -1
- package/dist/api/ui-text.js +3 -1
- package/dist/api/ui-text.js.map +1 -1
- package/dist/apps/store.d.ts +11 -0
- package/dist/apps/store.d.ts.map +1 -1
- package/dist/apps/store.js +47 -0
- package/dist/apps/store.js.map +1 -1
- package/dist/apps-server/server/lib/bundle/server.mjs +12 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +27 -52
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/start-stand-ins.d.ts +13 -0
- package/dist/cli/start-stand-ins.d.ts.map +1 -0
- package/dist/cli/start-stand-ins.js +30 -0
- package/dist/cli/start-stand-ins.js.map +1 -0
- package/dist/core/adapter.d.ts +43 -6
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +169 -30
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/ado-env.d.ts +17 -0
- package/dist/core/ado-env.d.ts.map +1 -0
- package/dist/core/ado-env.js +34 -0
- package/dist/core/ado-env.js.map +1 -0
- package/dist/core/deliver-text.d.ts +17 -0
- package/dist/core/deliver-text.d.ts.map +1 -1
- package/dist/core/deliver-text.js +76 -1
- package/dist/core/deliver-text.js.map +1 -1
- package/dist/core/deliver.d.ts +6 -0
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +12 -4
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/exec.d.ts +1 -10
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +4 -17
- package/dist/core/exec.js.map +1 -1
- package/dist/core/governance-store.d.ts +3 -1
- package/dist/core/governance-store.d.ts.map +1 -1
- package/dist/core/governance-store.js +7 -2
- package/dist/core/governance-store.js.map +1 -1
- package/dist/core/repo-clone.d.ts.map +1 -1
- package/dist/core/repo-clone.js +2 -1
- package/dist/core/repo-clone.js.map +1 -1
- package/dist/core/run-log-facts.d.ts +56 -0
- package/dist/core/run-log-facts.d.ts.map +1 -0
- package/dist/core/run-log-facts.js +230 -0
- package/dist/core/run-log-facts.js.map +1 -0
- package/dist/core/shutdown.d.ts +27 -0
- package/dist/core/shutdown.d.ts.map +1 -1
- package/dist/core/shutdown.js +72 -0
- package/dist/core/shutdown.js.map +1 -1
- package/dist/core/stand-in.d.ts +40 -0
- package/dist/core/stand-in.d.ts.map +1 -0
- package/dist/core/stand-in.js +118 -0
- package/dist/core/stand-in.js.map +1 -0
- package/dist/core/types.d.ts +17 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/editors/pack-extras.d.ts +162 -0
- package/dist/editors/pack-extras.d.ts.map +1 -0
- package/dist/editors/pack-extras.js +596 -0
- package/dist/editors/pack-extras.js.map +1 -0
- package/dist/editors/pack-install.d.ts +15 -7
- package/dist/editors/pack-install.d.ts.map +1 -1
- package/dist/editors/pack-install.js +140 -19
- package/dist/editors/pack-install.js.map +1 -1
- package/dist/editors/registry.d.ts +42 -3
- package/dist/editors/registry.d.ts.map +1 -1
- package/dist/editors/registry.js +114 -11
- package/dist/editors/registry.js.map +1 -1
- package/dist/editors/routes.d.ts +10 -5
- package/dist/editors/routes.d.ts.map +1 -1
- package/dist/editors/routes.js +45 -11
- package/dist/editors/routes.js.map +1 -1
- package/dist/interactive/bridge-pool.d.ts +5 -2
- package/dist/interactive/bridge-pool.d.ts.map +1 -1
- package/dist/interactive/bridge-pool.js +4 -1
- package/dist/interactive/bridge-pool.js.map +1 -1
- package/dist/interactive/landing-guard.d.ts.map +1 -1
- package/dist/interactive/landing-guard.js +79 -5
- package/dist/interactive/landing-guard.js.map +1 -1
- package/dist/knowledge/adapters/toolbox/memory.d.ts.map +1 -1
- package/dist/knowledge/adapters/toolbox/memory.js +3 -2
- package/dist/knowledge/adapters/toolbox/memory.js.map +1 -1
- package/dist/knowledge/trackers/set.d.ts +28 -0
- package/dist/knowledge/trackers/set.d.ts.map +1 -1
- package/dist/knowledge/trackers/set.js +26 -0
- package/dist/knowledge/trackers/set.js.map +1 -1
- package/dist/mcp/policies.d.ts +35 -0
- package/dist/mcp/policies.d.ts.map +1 -1
- package/dist/mcp/policies.js +138 -1
- package/dist/mcp/policies.js.map +1 -1
- package/dist/mcp/registry-store.d.ts +10 -0
- package/dist/mcp/registry-store.d.ts.map +1 -1
- package/dist/mcp/registry-store.js.map +1 -1
- package/dist/mcp/registry.d.ts +40 -3
- package/dist/mcp/registry.d.ts.map +1 -1
- package/dist/mcp/registry.js +211 -16
- package/dist/mcp/registry.js.map +1 -1
- package/dist/mcp/trigger-names.d.ts +32 -0
- package/dist/mcp/trigger-names.d.ts.map +1 -0
- package/dist/mcp/trigger-names.js +529 -0
- package/dist/mcp/trigger-names.js.map +1 -0
- package/dist/skills/store.d.ts +11 -1
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/skills/store.js +37 -3
- package/dist/skills/store.js.map +1 -1
- package/dist/studio/apps-standalone/fixture.js +3 -3
- package/dist/studio/assets/{KnowledgeGraph-yP4WsnST.js → KnowledgeGraph-D6RRLDnV.js} +1 -1
- package/dist/studio/assets/{index-DW53FKuT.js → index-BLo9vFQI.js} +324 -310
- package/dist/studio/assets/index-xW21Gkam.css +32 -0
- package/dist/studio/editors/wicked-apps/editor.json +1 -1
- package/dist/studio/editors/wicked-apps/index.html +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-insights/editor.json +1 -1
- package/dist/studio/editors/wicked-insights/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 +539 -5
- package/dist/team/routes.d.ts +4 -1
- package/dist/team/routes.d.ts.map +1 -1
- package/dist/team/routes.js +1 -1
- package/dist/team/routes.js.map +1 -1
- package/dist/voice/tts.d.ts +6 -0
- package/dist/voice/tts.d.ts.map +1 -1
- package/dist/voice/tts.js +16 -1
- package/dist/voice/tts.js.map +1 -1
- package/endpoint-manifest.json +85 -6
- package/package.json +4 -4
- package/voice-locks/darwin-arm64-cp310.txt +12 -0
- package/voice-locks/darwin-arm64-cp311.txt +8 -0
- package/voice-locks/darwin-arm64-cp312.txt +8 -0
- package/voice-locks/darwin-arm64-cp313.txt +8 -0
- package/voice-locks/darwin-arm64-cp314.txt +8 -0
- package/voice-locks/darwin-arm64-cp39.txt +12 -0
- package/voice-locks/darwin-x64-cp310.txt +12 -0
- package/voice-locks/darwin-x64-cp311.txt +12 -0
- package/voice-locks/darwin-x64-cp312.txt +12 -0
- package/voice-locks/darwin-x64-cp313.txt +12 -0
- package/voice-locks/darwin-x64-cp39.txt +12 -0
- package/voice-locks/linux-arm64-cp310.txt +12 -0
- package/voice-locks/linux-arm64-cp311.txt +8 -0
- package/voice-locks/linux-arm64-cp312.txt +8 -0
- package/voice-locks/linux-arm64-cp313.txt +8 -0
- package/voice-locks/linux-arm64-cp314.txt +8 -0
- package/voice-locks/linux-arm64-cp39.txt +12 -0
- package/voice-locks/linux-x64-cp310.txt +12 -0
- package/voice-locks/linux-x64-cp311.txt +8 -0
- package/voice-locks/linux-x64-cp312.txt +8 -0
- package/voice-locks/linux-x64-cp313.txt +8 -0
- package/voice-locks/linux-x64-cp314.txt +8 -0
- package/voice-locks/linux-x64-cp39.txt +12 -0
- package/dist/studio/assets/index-DNaLjJ7M.css +0 -32
|
@@ -48,6 +48,7 @@ import { documentPathPlan } from '../interactive/source-packet.js';
|
|
|
48
48
|
import { tornTailPrefix } from './chat-transcripts.js';
|
|
49
49
|
import { catalogDigest, detect, detectable } from '../workflow-catalog/detect.js';
|
|
50
50
|
import { OnboardBlock, resolveOnboard } from './proposal-onboard.js';
|
|
51
|
+
import { CUT_BLOCKING, CutBlock, cutInterruptedWords, resolveCut } from './proposal-cut.js';
|
|
51
52
|
// ── the block ──────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
52
53
|
/** Sources a block may name. */
|
|
53
54
|
export const PROPOSAL_SOURCES_MAX = 12;
|
|
@@ -108,7 +109,7 @@ export function parseMakeBlock(body) {
|
|
|
108
109
|
if (raw === null || typeof raw !== 'object' || Array.isArray(raw))
|
|
109
110
|
return null;
|
|
110
111
|
const o = raw;
|
|
111
|
-
const ops = ['entry', 'refine', 'theme', 'onboard'].filter((k) => o[k] !== undefined && o[k] !== null);
|
|
112
|
+
const ops = ['entry', 'refine', 'theme', 'onboard', 'cut'].filter((k) => o[k] !== undefined && o[k] !== null);
|
|
112
113
|
if (ops.length !== 1)
|
|
113
114
|
return null;
|
|
114
115
|
if (ops[0] === 'entry') {
|
|
@@ -124,6 +125,11 @@ export function parseMakeBlock(body) {
|
|
|
124
125
|
const r = OnboardBlock.safeParse(o);
|
|
125
126
|
return r.success ? { op: 'onboard', ...r.data } : null;
|
|
126
127
|
}
|
|
128
|
+
if (ops[0] === 'cut') {
|
|
129
|
+
// studio#1140 (a): a change to the demo video open in the chat (resolved by `proposal-cut.ts`).
|
|
130
|
+
const r = CutBlock.safeParse(o);
|
|
131
|
+
return r.success ? { op: 'cut', ...r.data } : null;
|
|
132
|
+
}
|
|
127
133
|
const r = ThemeBlock.safeParse(o);
|
|
128
134
|
return r.success ? { op: 'theme', ...r.data } : null;
|
|
129
135
|
}
|
|
@@ -357,9 +363,10 @@ export class LaunchOnceRegistry {
|
|
|
357
363
|
/** The run this identity names, when it exists (adopted, never started again), with whether a stub took it. */
|
|
358
364
|
async find(kind, identity) {
|
|
359
365
|
const d = this.dispatchers.get(kind);
|
|
360
|
-
|
|
366
|
+
const found = d === undefined ? false : await d.find(identity);
|
|
367
|
+
if (d === undefined || found === false)
|
|
361
368
|
return null;
|
|
362
|
-
return { stub: d.stub === true };
|
|
369
|
+
return { stub: d.stub === true, ...(typeof found === 'object' ? { version: found.version } : {}) };
|
|
363
370
|
}
|
|
364
371
|
async live(kind, runId, runs) {
|
|
365
372
|
const d = this.dispatchers.get(kind);
|
|
@@ -382,13 +389,15 @@ export class LaunchOnceRegistry {
|
|
|
382
389
|
return Promise.reject(new Error(`nothing can start a ${dispatch.kind} on this daemon yet`));
|
|
383
390
|
return this.lock.run(dispatch.identity.runId, async () => {
|
|
384
391
|
const base = { runId: dispatch.identity.runId, artifactRef: dispatch.identity.artifactRef, stub: d.stub === true };
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
392
|
+
const found = await d.find(dispatch.identity);
|
|
393
|
+
if (found !== false)
|
|
394
|
+
return { ...base, adopted: true, ...(typeof found === 'object' ? { version: found.version } : {}) };
|
|
395
|
+
const made = await d.launch(dispatch);
|
|
388
396
|
const ref = dispatch.identity.artifactRef;
|
|
389
|
-
|
|
397
|
+
// A cut starts no run: nothing of it is live after its launch (its version is its outcome).
|
|
398
|
+
if (ref !== null && dispatch.kind !== 'cut')
|
|
390
399
|
this.byArtifact.set(ref, [...(this.byArtifact.get(ref) ?? []).slice(-15), { kind: dispatch.kind, runId: dispatch.identity.runId }]);
|
|
391
|
-
return { ...base, adopted: false };
|
|
400
|
+
return { ...base, adopted: false, ...(made !== undefined && made !== null ? { version: made.version } : {}) };
|
|
392
401
|
});
|
|
393
402
|
}
|
|
394
403
|
}
|
|
@@ -490,7 +499,7 @@ export const PROPOSAL_WORKFLOWS = {
|
|
|
490
499
|
demo: 'demo',
|
|
491
500
|
};
|
|
492
501
|
/** studio#1140: why a refine of a demo cut is blocked (the card says it after the document's title). */
|
|
493
|
-
export const CUT_BLOCKED = "a demo video: this chat
|
|
502
|
+
export const CUT_BLOCKED = "a demo video: ask for its change in this chat as a video change, not a page change (or change it by hand in the video editor)";
|
|
494
503
|
const STOPS = {
|
|
495
504
|
create: 'Stops for you if the check fails. The plan or an escalation may also ask.',
|
|
496
505
|
refine: 'Stops for you if the check fails. The plan or an escalation may also ask.',
|
|
@@ -782,6 +791,8 @@ export class ChatProposals {
|
|
|
782
791
|
// crew-0182: the onboard block, for a client that draws the card (its seat is told only then).
|
|
783
792
|
// `o.onboard`: this message's own declaration (the chat's stored one changes only once the message is accepted).
|
|
784
793
|
...(on && f.onboard === true && chatId !== undefined && this.deps.onboard !== undefined && (o.onboard ?? this.deps.acceptsOnboard?.(chatId)) === true ? { onboard: true } : {}),
|
|
794
|
+
// crew#1814: the cut block, for a client that draws the card (crew's note on an open video says when it fits).
|
|
795
|
+
...(on && f.cut === true && chatId !== undefined && this.deps.cut !== undefined && (o.cut ?? this.deps.acceptsCut?.(chatId)) === true ? { cut: true } : {}),
|
|
785
796
|
entries,
|
|
786
797
|
...(jobs !== undefined ? { jobs } : {}),
|
|
787
798
|
};
|
|
@@ -931,6 +942,15 @@ export class ChatProposals {
|
|
|
931
942
|
return this.refused(chatId, 'onboard');
|
|
932
943
|
return resolveOnboard(block, { pid, chatId, turnId, seat, chatProjectId: chat.projectId === null || chat.projectId === 'default' ? null : chat.projectId, words }, this.deps.onboard);
|
|
933
944
|
}
|
|
945
|
+
if (block.op === 'cut') {
|
|
946
|
+
// Only for a client that draws the card (its seat was told the block exists only then), and only for the video
|
|
947
|
+
// open in this very turn.
|
|
948
|
+
if (flags.cut !== true || this.deps.cut === undefined || this.deps.acceptsCut?.(chatId) !== true)
|
|
949
|
+
return this.refused(chatId, 'cut');
|
|
950
|
+
const projectId = chat.projectId === null || chat.projectId === 'default' ? null : chat.projectId;
|
|
951
|
+
const f = await filedIn(projectId);
|
|
952
|
+
return resolveCut(block, { pid, chatId, turnId, seat, binding: turnHas ? binding : null, projectId, filedInLabel: f.label }, this.deps.cut);
|
|
953
|
+
}
|
|
934
954
|
if (block.op === 'theme') {
|
|
935
955
|
if (!flags.theme)
|
|
936
956
|
return this.refused(chatId, 'theme');
|
|
@@ -1385,16 +1405,32 @@ export class ChatProposals {
|
|
|
1385
1405
|
}
|
|
1386
1406
|
if (folded.state === 'accepting' && folded.accepting !== undefined) {
|
|
1387
1407
|
const acc = folded.accepting;
|
|
1388
|
-
|
|
1408
|
+
let found;
|
|
1409
|
+
try {
|
|
1410
|
+
found = await this.deps.registry.find(kind, acc.identity);
|
|
1411
|
+
}
|
|
1412
|
+
catch (err) {
|
|
1413
|
+
// studio#1140 (a): a cut still rendering is neither decided nor declined; a deleted video blocks its card; a
|
|
1414
|
+
// video tool that can't answer leaves the Go interrupted (Go again asks again).
|
|
1415
|
+
if (err instanceof LaunchRefusal && kind === 'cut' && err.body['code'] === 'cut_pending') {
|
|
1416
|
+
return { code: 409, body: { code: 'cut_pending', error: err.message, view: viewOf(folded) } };
|
|
1417
|
+
}
|
|
1418
|
+
if (err instanceof LaunchRefusal && kind === 'cut' && CUT_BLOCKING.has(err.body['code'])) {
|
|
1419
|
+
return this.blockCut(chatId, folded, acc.resolution, instance, err.body['code'], err.message);
|
|
1420
|
+
}
|
|
1421
|
+
if (kind !== 'cut')
|
|
1422
|
+
throw err;
|
|
1423
|
+
return { code: 502, body: { code: 'launch_failed', error: cutInterruptedWords(err instanceof Error ? err.message : String(err)), view: viewOf(folded) } };
|
|
1424
|
+
}
|
|
1389
1425
|
if (found !== null) {
|
|
1390
1426
|
// Its run exists: adopt it and decide (a crash after the launch, or a lost response).
|
|
1391
|
-
const result = { runId: acc.identity.runId, artifactRef: acc.identity.artifactRef, adopted: true, stub: found.stub };
|
|
1427
|
+
const result = { runId: acc.identity.runId, artifactRef: acc.identity.artifactRef, adopted: true, stub: found.stub, ...(found.version !== undefined ? { version: found.version } : {}) };
|
|
1392
1428
|
if (!this.decided(chatId, folded.turnId, pid, actor, 'go', result, acc.resolution, acc.edits, instance))
|
|
1393
1429
|
return this.gone(chatId);
|
|
1394
1430
|
const after = reread();
|
|
1395
1431
|
if (body.decision === 'go')
|
|
1396
1432
|
return ok(after);
|
|
1397
|
-
return { code: 409, body: { code: 'proposal_decided', error: 'this proposal had already started', view: viewOf(after) } };
|
|
1433
|
+
return { code: 409, body: { code: 'proposal_decided', error: kind === 'cut' ? `The new version was already made${found.version !== undefined ? ` (version ${found.version})` : ''}, so it stays. Undo in the video's editor brings back the one before.` : 'this proposal had already started', view: viewOf(after) } };
|
|
1398
1434
|
}
|
|
1399
1435
|
if (body.decision === 'not_now') {
|
|
1400
1436
|
if (!this.decided(chatId, folded.turnId, pid, actor, 'not_now', null, acc.resolution, acc.edits, instance))
|
|
@@ -1576,12 +1612,25 @@ export class ChatProposals {
|
|
|
1576
1612
|
return { code: 409, body: { code: 'source_gone', error: gone, view: viewOf(folded) } };
|
|
1577
1613
|
// A theme is no job (§15.2): applying colours never waits for a run of this chat.
|
|
1578
1614
|
// An onboard card starts no job of this chat either (crew-0182): it registers a repository.
|
|
1579
|
-
|
|
1615
|
+
// A cut starts no run either (studio#1140): the video tool's queue serializes it with the person's hand edits.
|
|
1616
|
+
const busy = kind === 'theme' || kind === 'onboard' || kind === 'cut' ? null : await this.busy(chatId, identity.artifactRef, resolution);
|
|
1580
1617
|
if (busy !== null)
|
|
1581
1618
|
return { code: 409, body: { code: busy.code, error: busy.reason, view: viewOf(folded) } };
|
|
1582
1619
|
// A refine is on the head it was proposed on; else the card re-resolves (same pid, the new base). Read last, right
|
|
1583
1620
|
// before the record: the landing itself is checked against this base (`expect_head`, slices I1 and A5).
|
|
1584
|
-
if (resolution.target !== undefined) {
|
|
1621
|
+
if (kind === 'cut' && resolution.target !== undefined) {
|
|
1622
|
+
// studio#1140 (a): a cut is never rebased. A fresh Go on a moved video blocks the card; Go again (an accepting
|
|
1623
|
+
// record) skips this check, because the video tool checks the Go's request id before its head (DES-B7 R3).
|
|
1624
|
+
const ref = parseArtifactRef(resolution.target.ref);
|
|
1625
|
+
const root = await this.deps.docsRoot(ref.projectId);
|
|
1626
|
+
const head = root === null ? null : artifactHead(root, ref.doc);
|
|
1627
|
+
if (head === null)
|
|
1628
|
+
return this.blockCut(chatId, folded, resolution, instance, 'cut_gone', `${resolution.target.title} is gone.`);
|
|
1629
|
+
if (folded.state !== 'accepting' && head !== resolution.target.base) {
|
|
1630
|
+
return this.blockCut(chatId, folded, resolution, instance, 'cut_moved', `The video changed since this was proposed (now version ${head}). Ask again to change the new version.`);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
else if (resolution.target !== undefined) {
|
|
1585
1634
|
const ref = parseArtifactRef(resolution.target.ref);
|
|
1586
1635
|
const root = await this.deps.docsRoot(ref.projectId);
|
|
1587
1636
|
const head = root === null ? null : artifactHead(root, ref.doc);
|
|
@@ -1653,6 +1702,16 @@ export class ChatProposals {
|
|
|
1653
1702
|
catch (err) {
|
|
1654
1703
|
// crew#1695: every refusal after this Go's accepting write names that record (`acceptingAt`), so a client marks
|
|
1655
1704
|
// only it stopped, never another tab's newer Go.
|
|
1705
|
+
// studio#1140 (a): a cut the video tool refused is blocked with its words (asking again is the way on); one still
|
|
1706
|
+
// rendering keeps its accepting record.
|
|
1707
|
+
if (err instanceof LaunchRefusal && kind === 'cut' && err.body['code'] === 'cut_pending') {
|
|
1708
|
+
return { code: 409, body: { code: 'cut_pending', error: err.message, acceptingAt: accepting.at, view: viewOf(foldProposals(this.deps.records(chatId)).get(pid) ?? folded) } };
|
|
1709
|
+
}
|
|
1710
|
+
if (err instanceof LaunchRefusal && kind === 'cut' && CUT_BLOCKING.has(err.body['code'])) {
|
|
1711
|
+
this.deps.audit('chat.proposal.launch_refused', actor, { chatId, pid, code: err.body['code'], error: err.message });
|
|
1712
|
+
const r = this.blockCut(chatId, folded, resolution, instance, err.body['code'], err.message, err.status);
|
|
1713
|
+
return { code: r.code, body: { ...r.body, acceptingAt: accepting.at } };
|
|
1714
|
+
}
|
|
1656
1715
|
if (err instanceof LaunchRefusal) {
|
|
1657
1716
|
const reopened = this.reopenLaunch(chatId, folded, resolution, instance);
|
|
1658
1717
|
if (reopened === null)
|
|
@@ -1669,13 +1728,23 @@ export class ChatProposals {
|
|
|
1669
1728
|
const msg = err instanceof Error ? err.message : String(err);
|
|
1670
1729
|
this.deps.audit('chat.proposal.launch_failed', actor, { chatId, pid, error: msg, ...(power !== undefined ? { power } : {}) });
|
|
1671
1730
|
const after = foldProposals(this.deps.records(chatId)).get(pid);
|
|
1672
|
-
|
|
1731
|
+
// A cut starts no run: its card says crew's own sentence and what Go again does (R2 C1).
|
|
1732
|
+
const said = resolution.kind === 'cut' ? cutInterruptedWords(msg) : `could not start it: ${msg}. Go again resumes the same job.`;
|
|
1733
|
+
return { code: 502, body: { code: 'launch_failed', error: said, acceptingAt: accepting.at, ...(after !== undefined ? { view: viewOf(after) } : {}) } };
|
|
1673
1734
|
}
|
|
1674
1735
|
if (!this.decided(chatId, folded.turnId, pid, actor, 'go', result, resolution, edits, instance, power))
|
|
1675
1736
|
return this.gone(chatId, accepting.at);
|
|
1676
1737
|
const after = foldProposals(this.deps.records(chatId)).get(pid) ?? folded;
|
|
1677
1738
|
return { code: 200, body: { view: viewOf(after) } };
|
|
1678
1739
|
}
|
|
1740
|
+
/** studio#1140 (a): a cut card that can't make its change any more is re-written blocked with the words (no rebase,
|
|
1741
|
+
* no Go). The person asks again for a new card. */
|
|
1742
|
+
blockCut(chatId, folded, resolution, instance, code, words, status = 409) {
|
|
1743
|
+
if (!this.write(chatId, { at: this.now(), turnId: folded.turnId, kind: 'proposal', proposal: { ...resolution, blocked: words } }, instance))
|
|
1744
|
+
return this.gone(chatId);
|
|
1745
|
+
const after = foldProposals(this.deps.records(chatId)).get(resolution.pid);
|
|
1746
|
+
return { code: status, body: { code, error: words, ...(after !== undefined ? { view: viewOf(after) } : {}) } };
|
|
1747
|
+
}
|
|
1679
1748
|
reopenLaunch(chatId, folded, resolution, instance) {
|
|
1680
1749
|
const proposal = { ...resolution };
|
|
1681
1750
|
// A Go-only opt-in belongs to that attempt; a reshape card keeps its own prior choice.
|
|
@@ -1720,7 +1789,7 @@ export class ChatProposals {
|
|
|
1720
1789
|
/** The identity a Go is named by (DES §4.3 step 2). */
|
|
1721
1790
|
identityOf(p) {
|
|
1722
1791
|
const runId = proposalRunId(p.pid);
|
|
1723
|
-
if (p.kind === 'refine')
|
|
1792
|
+
if (p.kind === 'refine' || p.kind === 'cut')
|
|
1724
1793
|
return { artifactRef: p.target?.ref ?? null, runId };
|
|
1725
1794
|
if (p.kind === 'create') {
|
|
1726
1795
|
// A retry fills the same document again (§4.3: artifact identity and attempt identity are separate).
|
|
@@ -1833,6 +1902,8 @@ export class ChatProposals {
|
|
|
1833
1902
|
demo: ['audience', 'show', 'helpers'],
|
|
1834
1903
|
// An onboard card is changed by saying so in the chat (a new proposal replaces it); Go takes no edits.
|
|
1835
1904
|
onboard: [],
|
|
1905
|
+
// So is a cut card (studio#1140): its ops are frozen with the head they were proposed on.
|
|
1906
|
+
cut: [],
|
|
1836
1907
|
};
|
|
1837
1908
|
const kindAllowed = allowed[p.kind];
|
|
1838
1909
|
for (const k of Object.keys(edits)) {
|
|
@@ -3548,10 +3619,19 @@ export class ChatProposals {
|
|
|
3548
3619
|
const acc = f?.accepting;
|
|
3549
3620
|
if (f === undefined || acc === undefined || f.state !== 'accepting')
|
|
3550
3621
|
return false;
|
|
3551
|
-
|
|
3622
|
+
let found;
|
|
3623
|
+
try {
|
|
3624
|
+
found = await this.deps.registry.find(f.proposal.kind, acc.identity);
|
|
3625
|
+
}
|
|
3626
|
+
catch (err) {
|
|
3627
|
+
// A cut still rendering, or a video tool that can't answer, settles at the person's Go again.
|
|
3628
|
+
if (f.proposal.kind === 'cut')
|
|
3629
|
+
return false;
|
|
3630
|
+
throw err;
|
|
3631
|
+
}
|
|
3552
3632
|
if (found === null)
|
|
3553
3633
|
return false;
|
|
3554
|
-
const result = { runId: acc.identity.runId, artifactRef: acc.identity.artifactRef, adopted: true, stub: found.stub };
|
|
3634
|
+
const result = { runId: acc.identity.runId, artifactRef: acc.identity.artifactRef, adopted: true, stub: found.stub, ...(found.version !== undefined ? { version: found.version } : {}) };
|
|
3555
3635
|
const actor = { id: acc.actor, kind: 'human', trust: 'operator' };
|
|
3556
3636
|
return this.decided(chatId, f.turnId, pid, actor, 'go', result, acc.resolution, acc.edits, instance);
|
|
3557
3637
|
});
|