wicked-crew 0.18.21 → 0.18.23
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-view.d.ts.map +1 -1
- package/dist/api/audit-view.js +1 -0
- package/dist/api/audit-view.js.map +1 -1
- 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 +77 -0
- package/dist/api/desk-snoozes.d.ts.map +1 -0
- package/dist/api/desk-snoozes.js +220 -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/domain-model.d.ts +56 -0
- package/dist/api/domain-model.d.ts.map +1 -0
- package/dist/api/domain-model.js +281 -0
- package/dist/api/domain-model.js.map +1 -0
- package/dist/api/domain-scope.d.ts +52 -0
- package/dist/api/domain-scope.d.ts.map +1 -0
- package/dist/api/domain-scope.js +156 -0
- package/dist/api/domain-scope.js.map +1 -0
- package/dist/api/eval-rule-store.d.ts +32 -0
- package/dist/api/eval-rule-store.d.ts.map +1 -0
- package/dist/api/eval-rule-store.js +77 -0
- package/dist/api/eval-rule-store.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 +19 -0
- package/dist/api/mcp.d.ts.map +1 -1
- package/dist/api/mcp.js +166 -3
- 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 +6 -4
- package/dist/api/requirements.d.ts.map +1 -1
- package/dist/api/requirements.js +6 -3
- package/dist/api/requirements.js.map +1 -1
- package/dist/api/routes.d.ts +21 -0
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +578 -94
- 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/server.d.ts.map +1 -1
- package/dist/api/server.js +1 -0
- package/dist/api/server.js.map +1 -1
- package/dist/api/system-snapshot.d.ts +5 -2
- package/dist/api/system-snapshot.d.ts.map +1 -1
- package/dist/api/system-snapshot.js +18 -6
- package/dist/api/system-snapshot.js.map +1 -1
- package/dist/api/testing.d.ts.map +1 -1
- package/dist/api/testing.js +11 -8
- package/dist/api/testing.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/actions/write-path.d.ts +6 -2
- package/dist/apps/actions/write-path.d.ts.map +1 -1
- package/dist/apps/actions/write-path.js +7 -3
- package/dist/apps/actions/write-path.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 +19 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +38 -52
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp.d.ts +14 -0
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +27 -10
- package/dist/cli/mcp.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 +57 -6
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +208 -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/launch-posture.d.ts +3 -0
- package/dist/core/launch-posture.d.ts.map +1 -1
- package/dist/core/launch-posture.js +4 -0
- package/dist/core/launch-posture.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 +62 -0
- package/dist/core/stand-in.d.ts.map +1 -0
- package/dist/core/stand-in.js +153 -0
- package/dist/core/stand-in.js.map +1 -0
- package/dist/core/types.d.ts +22 -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 +44 -0
- package/dist/mcp/policies.d.ts.map +1 -1
- package/dist/mcp/policies.js +153 -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 +43 -3
- package/dist/mcp/registry.d.ts.map +1 -1
- package/dist/mcp/registry.js +224 -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/persona/routes.d.ts +1 -1
- package/dist/persona/store.d.ts +1 -1
- package/dist/schedules/routes.d.ts.map +1 -1
- package/dist/schedules/routes.js +6 -0
- package/dist/schedules/routes.js.map +1 -1
- 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/sources/routes.d.ts +2 -2
- package/dist/sources/routes.d.ts.map +1 -1
- package/dist/studio/apps-standalone/fixture.js +3 -3
- package/dist/studio/assets/{KnowledgeGraph-yP4WsnST.js → KnowledgeGraph-BrHcKpFT.js} +1 -1
- package/dist/studio/assets/index-BCVvMebl.css +32 -0
- package/dist/studio/assets/{index-DW53FKuT.js → index-BqB2Ydq-.js} +337 -311
- 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 +953 -107
- 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 +100 -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
package/dist/core/adapter.js
CHANGED
|
@@ -14,6 +14,7 @@ import { homedir } from 'node:os';
|
|
|
14
14
|
import { randomUUID } from 'node:crypto';
|
|
15
15
|
import { RunReadLane } from './run-read-lane.js';
|
|
16
16
|
import { AskError, AskUnsupportedError } from './types.js';
|
|
17
|
+
import { factsFromEvents, runFingerprint, RunFactsFile } from './run-log-facts.js';
|
|
17
18
|
import { DEFAULT_SETTINGS } from './types.js';
|
|
18
19
|
import { BASE_SKILL_REF_SHAPE } from '../skills/base-skill.js';
|
|
19
20
|
import { cloneRepository } from './repo-clone.js';
|
|
@@ -33,6 +34,7 @@ import { QE_OFF_REASON, launchRequiresQe, qeAcceptanceMode, qeSettingSkipReason
|
|
|
33
34
|
import { applyVaultBinEnv, BOOT_VAULT_BIN, resolveShippedVaultBin } from './vault-bin.js';
|
|
34
35
|
import { withFolderFindings } from './repoPaths.js';
|
|
35
36
|
import { NEW_WORK_SEATS_FIX, NewWorkSeatsRefusal, isSeatKeyList } from './job-seats.js';
|
|
37
|
+
import { isSettingConsent } from './stand-in.js';
|
|
36
38
|
/**
|
|
37
39
|
* Parse a JSON string a napi binding returned. The bindings type their return loosely (`unknown`
|
|
38
40
|
* until a `ts_return_type` regen), so guard BOTH a non-string return and invalid JSON with an error
|
|
@@ -328,6 +330,7 @@ const STORE_READS_OFF_ACTOR = new Set([
|
|
|
328
330
|
'getCoverageReport',
|
|
329
331
|
'getCoverageReportForRepo',
|
|
330
332
|
'getRequirementsGraphForRepo',
|
|
333
|
+
'domainRuling',
|
|
331
334
|
'getGraphKindsForRepo',
|
|
332
335
|
'indexRepoGraph',
|
|
333
336
|
]);
|
|
@@ -501,6 +504,12 @@ export function addonSupportsReducedAssurance() {
|
|
|
501
504
|
export function addonSupportsPowerModeStatic() {
|
|
502
505
|
return typeof Core.supportsPowerMode === 'function' && Core.supportsPowerMode() === true;
|
|
503
506
|
}
|
|
507
|
+
/** (J6 K1) Does the installed addon carry a `domain-extraction` run's scope (`LaunchOptions.scopeJson`,
|
|
508
|
+
* wicked-core#1922)? Asked of the addon, never inferred from its version. */
|
|
509
|
+
export function addonSupportsDomainScope() {
|
|
510
|
+
const probe = Core.supportsDomainScope;
|
|
511
|
+
return typeof probe === 'function' && probe() === true;
|
|
512
|
+
}
|
|
504
513
|
/** Does the installed addon carry the QE acceptance decision (`LaunchOptions.skipQeAcceptanceReason`
|
|
505
514
|
* / `forceQeAcceptance`, `assurance.qe`; QE-IN-APP-WORKFLOWS, >= 0.7.49)? Same doctrine. */
|
|
506
515
|
export function addonSupportsQeOverride() {
|
|
@@ -685,6 +694,13 @@ export class CampaignsUnsupportedError extends Error {
|
|
|
685
694
|
* the engine") on this, never 400 ("fix your request") — and never the WORSE failure of passing
|
|
686
695
|
* a steering-field write through to an engine that would silently drop the fields.
|
|
687
696
|
*/
|
|
697
|
+
/** (J6 K1) The linked engine has no `domainRuling` binding: a ruling on the domain model cannot be recorded. */
|
|
698
|
+
export class DomainRulingUnsupportedError extends Error {
|
|
699
|
+
constructor() {
|
|
700
|
+
super('this wicked-core engine cannot record a ruling on the domain model (it needs the core-ts binding domainRuling); upgrade wicked-core-ts');
|
|
701
|
+
this.name = 'DomainRulingUnsupportedError';
|
|
702
|
+
}
|
|
703
|
+
}
|
|
688
704
|
export class SteeringUnsupportedError extends Error {
|
|
689
705
|
constructor(what) {
|
|
690
706
|
super(`${what} is not supported by this wicked-core build (the installed wicked-core-ts addon ` +
|
|
@@ -951,6 +967,10 @@ export class CoreAdapter {
|
|
|
951
967
|
applyGovernanceStoreEnv(this.governanceStore);
|
|
952
968
|
this.stub = opts.stub === true;
|
|
953
969
|
this.dbPath = opts.dbPath;
|
|
970
|
+
this.runFactsFile =
|
|
971
|
+
typeof opts.dbPath === 'string' && opts.dbPath !== '' && opts.dbPath !== ':memory:'
|
|
972
|
+
? new RunFactsFile(`${opts.dbPath}.run-facts.jsonl`, opts.dbPath)
|
|
973
|
+
: null;
|
|
954
974
|
// The QE acceptance setting's engine mirror (`syncEngineQeSetting`) must hold BEFORE the engine
|
|
955
975
|
// arms its bus bridge inside `spawn`, or a bus request in between would launch under the
|
|
956
976
|
// default: hand the boot value over in the engine's own variable, read at spawn.
|
|
@@ -1211,6 +1231,10 @@ export class CoreAdapter {
|
|
|
1211
1231
|
setDraining(drain) {
|
|
1212
1232
|
this.drainSince = drain ? (this.drainSince ?? Date.now()) : null;
|
|
1213
1233
|
}
|
|
1234
|
+
/** Whether new work is refused for maintenance (the launch's stand-in question is not asked of a draining daemon). */
|
|
1235
|
+
isDraining() {
|
|
1236
|
+
return this.drainSince !== null;
|
|
1237
|
+
}
|
|
1214
1238
|
/** Parked and human-held runs are idle for maintenance, but still hold their repository. */
|
|
1215
1239
|
async maintenanceState() {
|
|
1216
1240
|
const active = (await this.sessionsDetail())
|
|
@@ -1532,6 +1556,12 @@ export class CoreAdapter {
|
|
|
1532
1556
|
if (input.extraReadRoots !== undefined && input.extraReadRoots.length > 0) {
|
|
1533
1557
|
opts.extraReadRoots = input.extraReadRoots;
|
|
1534
1558
|
}
|
|
1559
|
+
// wicked-core#1463: an older addon ignores the field, which only keeps every read root
|
|
1560
|
+
// required (today's fail-closed behaviour), so it needs no version gate. Widened locally, as
|
|
1561
|
+
// `primary` and `voice` are, so crew still compiles against an addon's older declarations.
|
|
1562
|
+
if (input.optionalReadRoots !== undefined && input.optionalReadRoots.length > 0) {
|
|
1563
|
+
opts.optionalReadRoots = input.optionalReadRoots;
|
|
1564
|
+
}
|
|
1535
1565
|
if (input.excludeSeats !== undefined && input.excludeSeats.length > 0) {
|
|
1536
1566
|
// Fail CLOSED on an old addon (napi ignores undeclared fields): a silently-dropped exclusion
|
|
1537
1567
|
// would let the seat that wrote the work judge it — the one thing the caller asked to rule out.
|
|
@@ -1551,6 +1581,17 @@ export class CoreAdapter {
|
|
|
1551
1581
|
}
|
|
1552
1582
|
opts.reducedAssurance = true;
|
|
1553
1583
|
}
|
|
1584
|
+
// (DES-STANDIN-001 §3.8, K2a) Fail CLOSED on an addon without stand-ins (napi ignores undeclared fields): the
|
|
1585
|
+
// person's consent would be dropped and the run would hold or fail where they were told it would be checked.
|
|
1586
|
+
if (input.standInAware === true) {
|
|
1587
|
+
if (!this.supportsStandIns()) {
|
|
1588
|
+
throw new Error('stand-in checks need a wicked-core-ts that carries them (Core.independencePreflight and grantStandIns); upgrade the engine');
|
|
1589
|
+
}
|
|
1590
|
+
const o = opts;
|
|
1591
|
+
o.standInAware = true;
|
|
1592
|
+
if (input.standIn !== undefined)
|
|
1593
|
+
o.standInJson = JSON.stringify(input.standIn);
|
|
1594
|
+
}
|
|
1554
1595
|
// (program DES-POWER-MODE) Fail CLOSED on an addon without power mode (napi ignores an undeclared
|
|
1555
1596
|
// field): the run would launch phased while its launcher reported power mode on.
|
|
1556
1597
|
if (input.power === true) {
|
|
@@ -1581,6 +1622,15 @@ export class CoreAdapter {
|
|
|
1581
1622
|
if (settingSkip !== undefined)
|
|
1582
1623
|
input = { ...input, skipQeAcceptanceReason: settingSkip };
|
|
1583
1624
|
}
|
|
1625
|
+
if (input.domainScopeJson !== undefined) {
|
|
1626
|
+
// Fail CLOSED on an older addon (napi ignores an undeclared field): the run would start with no scope, and
|
|
1627
|
+
// the engine refuses a domain-extraction launch without one only on an addon that knows the field.
|
|
1628
|
+
if (!addonSupportsDomainScope()) {
|
|
1629
|
+
throw new Error('a domain model run needs a wicked-core-ts that carries its scope (Core.supportsDomainScope); the ' +
|
|
1630
|
+
'installed addon would launch it without one');
|
|
1631
|
+
}
|
|
1632
|
+
opts.scopeJson = input.domainScopeJson;
|
|
1633
|
+
}
|
|
1584
1634
|
if (input.skipQeAcceptanceReason !== undefined || input.forceQeAcceptance === true) {
|
|
1585
1635
|
// Fail CLOSED on an old addon (napi ignores undeclared fields): a dropped skip would leave a
|
|
1586
1636
|
// run the operator meant to skip refusing its delivery, and a dropped force would let a score
|
|
@@ -1874,9 +1924,11 @@ export class CoreAdapter {
|
|
|
1874
1924
|
return Promise.reject(new PlanGateNoteUnsupportedError());
|
|
1875
1925
|
}
|
|
1876
1926
|
const core = this.core;
|
|
1927
|
+
// (crew#1698, core#1808) `expectGateSeq`: the opening of the gate the record showed; the engine refuses a
|
|
1928
|
+
// gate that closed and re-opened since (`gate_changed:`), at the same ord too.
|
|
1877
1929
|
return plan !== undefined
|
|
1878
|
-
? core.confirmGate(runId, true, note ?? null, 'edit_plan', null, JSON.stringify(plan), actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null)
|
|
1879
|
-
: core.confirmGate(runId, approve, amend ?? null, action ?? null, amendScope ?? null, null, actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null);
|
|
1930
|
+
? core.confirmGate(runId, true, note ?? null, 'edit_plan', null, JSON.stringify(plan), actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null, expect.gateSeq ?? null)
|
|
1931
|
+
: core.confirmGate(runId, approve, amend ?? null, action ?? null, amendScope ?? null, null, actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null, expect.gateSeq ?? null);
|
|
1880
1932
|
}, undefined, resumesWork);
|
|
1881
1933
|
}
|
|
1882
1934
|
return this.handedToEngine('run', runId, () => {
|
|
@@ -2038,6 +2090,45 @@ export class CoreAdapter {
|
|
|
2038
2090
|
const C = Core;
|
|
2039
2091
|
return typeof C.supportsPlanSendBack === 'function' && C.supportsPlanSendBack() === true;
|
|
2040
2092
|
}
|
|
2093
|
+
/** (DES-STANDIN-001 §3.9, §3.10; K2a) The linked engine takes stand-in launches: it carries both the preflight and
|
|
2094
|
+
* the gate grant (method presence, as core-ts documents). Read at call time. */
|
|
2095
|
+
supportsStandIns() {
|
|
2096
|
+
const c = this.core;
|
|
2097
|
+
return typeof c.independencePreflight === 'function' && typeof c.grantStandIns === 'function';
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* (DES-STANDIN-001 §3.9) Which independent roles this launch would be short of, on the shape it would take: the
|
|
2101
|
+
* engine resolves the contract through the launch's own code. Rejects as the launch would refuse the shape.
|
|
2102
|
+
*/
|
|
2103
|
+
async independencePreflight(input) {
|
|
2104
|
+
const core = this.core;
|
|
2105
|
+
const shape = {
|
|
2106
|
+
...(input.workflow !== undefined ? { workflow: input.workflow } : {}),
|
|
2107
|
+
...(input.projectId !== undefined ? { projectId: input.projectId } : {}),
|
|
2108
|
+
...(input.plan !== undefined ? { planJson: JSON.stringify(input.plan) } : {}),
|
|
2109
|
+
...(input.power === true ? { power: true } : {}),
|
|
2110
|
+
...(input.primary !== undefined ? { primary: input.primary } : {}),
|
|
2111
|
+
...(input.excludeSeats !== undefined && input.excludeSeats.length > 0 ? { excludeSeats: input.excludeSeats } : {}),
|
|
2112
|
+
...(input.skipQeAcceptanceReason !== undefined ? { skipQeAcceptanceReason: input.skipQeAcceptanceReason } : {}),
|
|
2113
|
+
...(input.forceQeAcceptance === true ? { forceQeAcceptance: true } : {}),
|
|
2114
|
+
repoBound: input.repoRef !== undefined,
|
|
2115
|
+
};
|
|
2116
|
+
return core.independencePreflight(engineRosterJson(input.clisJson), JSON.stringify(shape));
|
|
2117
|
+
}
|
|
2118
|
+
/**
|
|
2119
|
+
* (DES-STANDIN-001 §3.10, crew#1856) USE STAND-INS at the run's open `stand_in_needed` gate: the person's consent
|
|
2120
|
+
* (`scope`) goes on the run and the held check continues. `gateSeq` is the open gate's opening (its durable row's
|
|
2121
|
+
* `gate_seq`), `actor` the server's name for the person. The engine refuses a stale opening (`gate_changed:`).
|
|
2122
|
+
*/
|
|
2123
|
+
grantStandIns(runId, scope, gateSeq, actor, ord) {
|
|
2124
|
+
const core = this.core;
|
|
2125
|
+
return this.handedToEngine('run', runId, () => {
|
|
2126
|
+
if (!this.supportsStandIns()) {
|
|
2127
|
+
return Promise.reject(new Error('Using stand-ins at a gate needs a wicked-core-ts with Core.grantStandIns; upgrade the engine'));
|
|
2128
|
+
}
|
|
2129
|
+
return core.grantStandIns(runId, scope, gateSeq, actor, ord ?? null);
|
|
2130
|
+
}, undefined, true);
|
|
2131
|
+
}
|
|
2041
2132
|
/** (workdoc-all-runs; core lane context-block-core) The linked engine keeps a per-run CONTEXT BLOCK it hands every
|
|
2042
2133
|
* seat it spawns (`Core.supportsRunContext`). Until it does, crew's working document re-sends the person's context
|
|
2043
2134
|
* before each later worker step (the standing note). Read at call time. */
|
|
@@ -2133,41 +2224,108 @@ export class CoreAdapter {
|
|
|
2133
2224
|
}
|
|
2134
2225
|
/**
|
|
2135
2226
|
* Each run's launch name as the engine RECORDED it — `sessionStarted.workflowId` from its event
|
|
2136
|
-
* log (the preset, the registered def, `<run>:plan-<rev>`, or `null` for free text).
|
|
2137
|
-
*
|
|
2138
|
-
*
|
|
2139
|
-
*
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2227
|
+
* log (the preset, the registered def, `<run>:plan-<rev>`, or `null` for free text). Seam X2 — the one input
|
|
2228
|
+
* `resolveRunIdentity` needs that the session record lacks.
|
|
2229
|
+
*
|
|
2230
|
+
* crew#1880: read through the run's log FACTS (run-log-facts.ts), one read per run answering both this and the
|
|
2231
|
+
* `ended_at` backfill ({@link runEndedFact}). A read made while the run is terminal is FINAL (its facts settle);
|
|
2232
|
+
* one made while it is live keeps only a found launch name (a live run's frame may not be flushed yet). A final
|
|
2233
|
+
* read's positive facts are kept beside the store, so the next start reads no log for them.
|
|
2234
|
+
*/
|
|
2235
|
+
runFactsMemo = new Map();
|
|
2236
|
+
/** One in-flight read per run and kind (a terminal-time read is never answered by a live-time one). */
|
|
2237
|
+
runFactsReads = new Map();
|
|
2238
|
+
/** crew#1880: `<db>.run-facts.jsonl`; null for an in-memory or unnamed store. */
|
|
2239
|
+
runFactsFile;
|
|
2240
|
+
/** One read of a run's log, shared by concurrent callers. `null` = no event-log binding; a failed read throws. */
|
|
2241
|
+
readRunFacts(view) {
|
|
2143
2242
|
const id = view.session.id;
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2243
|
+
const final = TERMINAL_RUN_STATUSES.has(view.session.status);
|
|
2244
|
+
const key = `${final ? 'T' : 'L'}:${id}`;
|
|
2245
|
+
const inFlight = this.runFactsReads.get(key);
|
|
2246
|
+
if (inFlight !== undefined)
|
|
2247
|
+
return inFlight;
|
|
2248
|
+
const read = (async () => {
|
|
2249
|
+
const events = await this.runEvents(id);
|
|
2250
|
+
if (events === null)
|
|
2251
|
+
return null;
|
|
2252
|
+
const facts = { ...factsFromEvents(events), final };
|
|
2253
|
+
if (final) {
|
|
2254
|
+
this.runFactsMemo.set(id, facts);
|
|
2255
|
+
this.runFactsFile?.put(id, runFingerprint(view.session.problem), facts);
|
|
2256
|
+
}
|
|
2257
|
+
else if (facts.launched !== undefined && this.runFactsMemo.get(id)?.final !== true) {
|
|
2258
|
+
this.runFactsMemo.set(id, facts);
|
|
2259
|
+
}
|
|
2260
|
+
return facts;
|
|
2261
|
+
})();
|
|
2262
|
+
this.runFactsReads.set(key, read);
|
|
2263
|
+
const clear = () => {
|
|
2264
|
+
if (this.runFactsReads.get(key) === read)
|
|
2265
|
+
this.runFactsReads.delete(key);
|
|
2266
|
+
};
|
|
2267
|
+
read.then(clear, clear);
|
|
2268
|
+
return read;
|
|
2269
|
+
}
|
|
2270
|
+
/** The facts kept for this run on disk (bound to its problem). A kept launch name is folded into the in-process
|
|
2271
|
+
* memo (so later folds skip the hash); the memo is FINAL only when both facts were kept (a negative never is). */
|
|
2272
|
+
keptRunFacts(view) {
|
|
2273
|
+
if (this.runFactsFile === null)
|
|
2274
|
+
return undefined;
|
|
2275
|
+
const kept = this.runFactsFile.get(view.session.id, runFingerprint(view.session.problem));
|
|
2276
|
+
if (kept?.launched !== undefined) {
|
|
2277
|
+
this.runFactsMemo.set(view.session.id, {
|
|
2278
|
+
launched: kept.launched,
|
|
2279
|
+
endedAt: kept.endedAt ?? null,
|
|
2280
|
+
final: kept.endedAt !== undefined,
|
|
2281
|
+
});
|
|
2282
|
+
}
|
|
2283
|
+
return kept;
|
|
2284
|
+
}
|
|
2285
|
+
async launchedWorkflowOf(view) {
|
|
2286
|
+
const known = this.runFactsMemo.get(view.session.id);
|
|
2287
|
+
if (known !== undefined && (known.final || known.launched !== undefined))
|
|
2288
|
+
return known.launched;
|
|
2289
|
+
const kept = this.keptRunFacts(view);
|
|
2290
|
+
if (kept?.launched !== undefined)
|
|
2291
|
+
return kept.launched;
|
|
2147
2292
|
try {
|
|
2148
|
-
|
|
2293
|
+
return (await this.readRunFacts(view))?.launched;
|
|
2149
2294
|
}
|
|
2150
2295
|
catch {
|
|
2151
2296
|
return undefined;
|
|
2152
2297
|
}
|
|
2153
|
-
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* crew#1880: a terminal run's FIRST terminal frame `ts` (millis), for the `ended_at` backfill — from the in-process
|
|
2301
|
+
* memo, the kept facts, or one read of its log (shared with the identity read). `null` = the log holds no terminal
|
|
2302
|
+
* frame; `undefined` = no event-log binding. A failed read throws (the backfill retries it on a later request).
|
|
2303
|
+
*/
|
|
2304
|
+
async runEndedFact(view) {
|
|
2305
|
+
const known = this.runFactsMemo.get(view.session.id);
|
|
2306
|
+
if (known?.final === true)
|
|
2307
|
+
return known.endedAt;
|
|
2308
|
+
const kept = this.keptRunFacts(view);
|
|
2309
|
+
if (kept?.endedAt !== undefined)
|
|
2310
|
+
return kept.endedAt;
|
|
2311
|
+
const facts = await this.readRunFacts(view);
|
|
2312
|
+
if (facts === null)
|
|
2154
2313
|
return undefined;
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
this.launchedWorkflows.set(id, launched);
|
|
2161
|
-
}
|
|
2162
|
-
return launched;
|
|
2314
|
+
return facts.final ? facts.endedAt : null;
|
|
2315
|
+
}
|
|
2316
|
+
/** crew#1880: write the kept facts still buffered (tests; `close` flushes too). */
|
|
2317
|
+
flushRunFacts() {
|
|
2318
|
+
return this.runFactsFile?.flush() ?? Promise.resolve();
|
|
2163
2319
|
}
|
|
2164
2320
|
/**
|
|
2165
2321
|
* (DES-CATALOG-002 §2.3) The name one run was launched under, as the engine recorded it (`sessionStarted.workflowId`):
|
|
2166
2322
|
* the run fence's fallback for a run crew no longer holds in memory. Memoized once found; `undefined` = not known.
|
|
2167
2323
|
*/
|
|
2168
2324
|
async launchedWorkflowOfRun(runId) {
|
|
2169
|
-
|
|
2170
|
-
|
|
2325
|
+
// As before crew#1880: a found launch name, or a terminal run's settled "none", answers without a read.
|
|
2326
|
+
const known = this.runFactsMemo.get(runId);
|
|
2327
|
+
if (known !== undefined && (known.final || known.launched !== undefined))
|
|
2328
|
+
return known.launched;
|
|
2171
2329
|
let events;
|
|
2172
2330
|
try {
|
|
2173
2331
|
events = await this.runEvents(runId);
|
|
@@ -2175,13 +2333,14 @@ export class CoreAdapter {
|
|
|
2175
2333
|
catch {
|
|
2176
2334
|
return undefined;
|
|
2177
2335
|
}
|
|
2178
|
-
|
|
2179
|
-
|
|
2336
|
+
if (events === null)
|
|
2337
|
+
return undefined;
|
|
2338
|
+
const facts = factsFromEvents(events);
|
|
2339
|
+
if (facts.launched === undefined)
|
|
2180
2340
|
return undefined;
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
return launched;
|
|
2341
|
+
if (known === undefined)
|
|
2342
|
+
this.runFactsMemo.set(runId, { ...facts, final: false });
|
|
2343
|
+
return facts.launched;
|
|
2185
2344
|
}
|
|
2186
2345
|
/**
|
|
2187
2346
|
* Every run + its ordered units, each with its `run_identity` (seam X2) resolved from the engine's
|
|
@@ -2894,6 +3053,17 @@ export class CoreAdapter {
|
|
|
2894
3053
|
}
|
|
2895
3054
|
return parseEngineJson(await this.core.getRequirementsGraphForRepo(repoRef), 'getRequirementsGraphForRepo');
|
|
2896
3055
|
}
|
|
3056
|
+
/**
|
|
3057
|
+
* (J6 K1) A person's ruling on ONE registered repo's domain model, handed to the engine as core's
|
|
3058
|
+
* `RulingRequest` JSON. Resolves with core's one-line answer: `{ok: true, ruling, build}` (saved; `build.ok`
|
|
3059
|
+
* false when the rebuild failed) or `{ok: false, code, message}` (refused, nothing written). An engine without the
|
|
3060
|
+
* binding throws, naming what is needed.
|
|
3061
|
+
*/
|
|
3062
|
+
async domainRuling(repoRef, request) {
|
|
3063
|
+
if (typeof this.core.domainRuling !== 'function')
|
|
3064
|
+
throw new DomainRulingUnsupportedError();
|
|
3065
|
+
return this.core.domainRuling(repoRef, request);
|
|
3066
|
+
}
|
|
2897
3067
|
/**
|
|
2898
3068
|
* Node-count-by-kind summary of ONE registered repo's code graph, over that repo's OWN store
|
|
2899
3069
|
* (#122) — what the estate graph actually holds for the repo, so an operator can see it was
|
|
@@ -3540,6 +3710,13 @@ export class CoreAdapter {
|
|
|
3540
3710
|
// powerModeDefault (program DES-POWER-MODE): a boolean only; anything else reads as the shipped default (on).
|
|
3541
3711
|
if ('powerModeDefault' in parsed && typeof parsed.powerModeDefault !== 'boolean')
|
|
3542
3712
|
delete parsed.powerModeDefault;
|
|
3713
|
+
// standInReview (DES-STANDIN-001 §4): 'ask' | 'always' only; anything else reads as unset ('ask', asked each time).
|
|
3714
|
+
if ('standInReview' in parsed && parsed.standInReview !== 'ask' && parsed.standInReview !== 'always')
|
|
3715
|
+
delete parsed.standInReview;
|
|
3716
|
+
// standInConsent (wicked-core#1930 F6): the shape the daemon writes, or nothing (a launch then says the setting's
|
|
3717
|
+
// author was not recorded rather than trusting a hand edit).
|
|
3718
|
+
if ('standInConsent' in parsed && !isSettingConsent(parsed.standInConsent))
|
|
3719
|
+
delete parsed.standInConsent;
|
|
3543
3720
|
// newWorkSeats (F1/F2): a list of seat keys, or null. An invalid value is left out of the settings served (they
|
|
3544
3721
|
// keep the API's type) but KEPT for the next write (`kept`): new work reads it strictly (`readNewWorkSeats`) and
|
|
3545
3722
|
// refuses it, and an unrelated write that erased it would quietly widen the pool to every seat.
|
|
@@ -3651,6 +3828,7 @@ export class CoreAdapter {
|
|
|
3651
3828
|
if (this.closed)
|
|
3652
3829
|
return;
|
|
3653
3830
|
this.closed = true;
|
|
3831
|
+
void this.runFactsFile?.flush();
|
|
3654
3832
|
if (this.engineBus !== null && this.busDbPath !== undefined)
|
|
3655
3833
|
detachEngineBus(this.busDbPath, this.engineBus);
|
|
3656
3834
|
this.listeners.clear();
|