@you-agent-factory/factory-emulator 0.0.0 → 0.0.1
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/LICENSE.md +19 -1
- package/README.md +305 -286
- package/dist/compatibility.d.ts +19 -0
- package/dist/compatibility.js +156 -0
- package/dist/event-sink.d.ts +29 -0
- package/dist/event-sink.js +58 -0
- package/dist/generated/scenario-schema.d.ts +268 -0
- package/dist/generated/scenario-schema.js +319 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/logical-move.d.ts +10 -0
- package/dist/logical-move.js +18 -0
- package/dist/recording-sink.d.ts +22 -0
- package/dist/recording-sink.js +122 -0
- package/dist/runtime-reference-conformance.d.ts +20 -0
- package/dist/runtime-reference-conformance.js +138 -0
- package/dist/runtime-reference-evidence.d.ts +9 -0
- package/dist/runtime-reference-evidence.js +193 -0
- package/dist/runtime-reference-fixtures.d.ts +7 -0
- package/dist/runtime-reference-fixtures.js +308 -0
- package/dist/runtime-reference.d.ts +48 -0
- package/dist/runtime-reference.js +143 -0
- package/dist/scenario-contracts.d.ts +81 -0
- package/dist/scenario-contracts.js +11 -0
- package/dist/scenario.d.ts +271 -0
- package/dist/scenario.js +333 -0
- package/dist/scheduler.d.ts +24 -0
- package/dist/scheduler.js +104 -0
- package/dist/session-contracts.d.ts +262 -0
- package/dist/session-contracts.js +74 -0
- package/dist/session.d.ts +4 -0
- package/dist/session.js +1490 -0
- package/dist/submission-replay.d.ts +14 -0
- package/dist/submission-replay.js +96 -0
- package/dist/submission-validation.d.ts +3 -0
- package/dist/submission-validation.js +113 -0
- package/examples/customer-support.scenario.v1.json +45 -0
- package/package.json +44 -22
- package/schema/scenario.schema.json +171 -0
- package/generated/factory-emulator-scenario.schema.json +0 -191
- package/generated/factory.schema.json +0 -2606
- package/src/contracts.ts +0 -41
- package/src/data-error.js +0 -21
- package/src/data-only.js +0 -208
- package/src/emulator.js +0 -195
- package/src/emulator.ts +0 -86
- package/src/examples.js +0 -86
- package/src/examples.ts +0 -11
- package/src/generated/factory-schema.d.ts +0 -3
- package/src/generated/factory-schema.js +0 -5
- package/src/generated/scenario-schema.d.ts +0 -4
- package/src/generated/scenario-schema.js +0 -6
- package/src/generated/scenario.ts +0 -103
- package/src/identity.js +0 -55
- package/src/index.js +0 -34
- package/src/index.ts +0 -102
- package/src/limits.js +0 -125
- package/src/parser.js +0 -113
- package/src/parser.ts +0 -56
- package/src/scheduler.js +0 -374
- package/src/semantics.js +0 -354
- package/src/semantics.ts +0 -38
- package/src/session.js +0 -1201
- package/src/session.ts +0 -324
- package/src/sinks.js +0 -118
- package/src/sinks.ts +0 -56
- package/src/support.js +0 -334
- package/src/support.ts +0 -15
- package/src/virtual-time.js +0 -36
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { inspectFactoryEmulatorCompatibility } from "./compatibility.js";
|
|
2
|
+
import { runtimeReferenceFixtures } from "./runtime-reference-fixtures.js";
|
|
3
|
+
import { safeParseFactoryEmulatorScenario, } from "./scenario.js";
|
|
4
|
+
export const FACTORY_EMULATOR_RUNTIME_REFERENCE_SCHEMA_VERSION = "factory-emulator-runtime-reference/v1";
|
|
5
|
+
const factoryEventKinds = new Set([
|
|
6
|
+
"RUN_REQUEST",
|
|
7
|
+
"INITIAL_STRUCTURE_REQUEST",
|
|
8
|
+
"SESSION_STARTED",
|
|
9
|
+
"WORK_REQUEST",
|
|
10
|
+
"RELATIONSHIP_CHANGE_REQUEST",
|
|
11
|
+
"DISPATCH_REQUEST",
|
|
12
|
+
"DISPATCH_RESPONSE",
|
|
13
|
+
"WORK_STATE_CHANGE",
|
|
14
|
+
"SESSION_COMPLETED",
|
|
15
|
+
]);
|
|
16
|
+
function issue(issues, code, path, message) {
|
|
17
|
+
issues.push({ code, path, message });
|
|
18
|
+
}
|
|
19
|
+
function isRecord(value) {
|
|
20
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
21
|
+
}
|
|
22
|
+
function requiredString(value, path, issues) {
|
|
23
|
+
if (typeof value === "string" && value.trim().length > 0)
|
|
24
|
+
return true;
|
|
25
|
+
issue(issues, "missing_required_data", path, `Expected ${path.join(".")} to be a non-empty string.`);
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
/** Validates frozen, package-local evidence before a conformance comparison starts. */
|
|
29
|
+
// biome-ignore lint/complexity/noExcessiveLinesPerFunction: The ordered validation passes deliberately retain every fixture diagnostic in one stable result.
|
|
30
|
+
export function safeParseFactoryEmulatorRuntimeReference(input) {
|
|
31
|
+
const issues = [];
|
|
32
|
+
if (!isRecord(input)) {
|
|
33
|
+
issue(issues, "invalid_value", [], "Expected a runtime reference object.");
|
|
34
|
+
return { success: false, issues };
|
|
35
|
+
}
|
|
36
|
+
if (input.schemaVersion !== FACTORY_EMULATOR_RUNTIME_REFERENCE_SCHEMA_VERSION) {
|
|
37
|
+
issue(issues, "invalid_schema_version", ["schemaVersion"], "Unsupported runtime reference schema version.");
|
|
38
|
+
}
|
|
39
|
+
requiredString(input.id, ["id"], issues);
|
|
40
|
+
requiredString(input.title, ["title"], issues);
|
|
41
|
+
if (!isRecord(input.provenance)) {
|
|
42
|
+
issue(issues, "missing_required_data", ["provenance"], "Expected runtime-reference provenance.");
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
requiredString(input.provenance.source, ["provenance", "source"], issues);
|
|
46
|
+
if (!["public-behavior", "public-documentation", "public-recording"].includes(input.provenance.kind)) {
|
|
47
|
+
issue(issues, "invalid_provenance", ["provenance", "kind"], "Expected public behavior, documentation, or recording provenance.");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (!isRecord(input.factory) ||
|
|
51
|
+
!requiredString(input.factory.name, ["factory", "name"], issues)) {
|
|
52
|
+
issue(issues, "invalid_factory", ["factory"], "Expected a Factory definition with a name.");
|
|
53
|
+
}
|
|
54
|
+
if (!isRecord(input.scenario)) {
|
|
55
|
+
issue(issues, "missing_required_data", ["scenario"], "Expected a complete emulator scenario.");
|
|
56
|
+
}
|
|
57
|
+
else if (isRecord(input.factory)) {
|
|
58
|
+
const parsed = safeParseFactoryEmulatorScenario(input.scenario, input.factory);
|
|
59
|
+
if (!parsed.success) {
|
|
60
|
+
issue(issues, "invalid_value", ["scenario"], `Scenario is invalid: ${parsed.issues[0]?.message ?? "unknown error"}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const ticks = Array.isArray(input.ticks) ? input.ticks : [];
|
|
64
|
+
if (ticks.length === 0) {
|
|
65
|
+
issue(issues, "missing_required_data", ["ticks"], "Expected at least one logical-tick reference.");
|
|
66
|
+
}
|
|
67
|
+
const eventKinds = [];
|
|
68
|
+
for (const [index, tick] of ticks.entries()) {
|
|
69
|
+
const logicalTick = isRecord(tick) ? tick.logicalTick : undefined;
|
|
70
|
+
if (typeof logicalTick !== "number" ||
|
|
71
|
+
!Number.isSafeInteger(logicalTick) ||
|
|
72
|
+
logicalTick < 0) {
|
|
73
|
+
issue(issues, "invalid_tick_order", ["ticks", index, "logicalTick"], "Expected a non-negative integer logical tick.");
|
|
74
|
+
}
|
|
75
|
+
else if (logicalTick !== index) {
|
|
76
|
+
issue(issues, "invalid_tick_order", ["ticks", index, "logicalTick"], "Logical ticks must be contiguous and begin at zero.");
|
|
77
|
+
}
|
|
78
|
+
if (!isRecord(tick) || !Array.isArray(tick.eventKinds)) {
|
|
79
|
+
issue(issues, "missing_required_data", ["ticks", index, "eventKinds"], "Expected the ordered event kinds for this tick.");
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (!isRecord(tick.semantics)) {
|
|
83
|
+
issue(issues, "missing_semantics", ["ticks", index, "semantics"], "Expected normalized semantic evidence for this logical tick.");
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
for (const surface of [
|
|
87
|
+
"dispatchChoices",
|
|
88
|
+
"consumedWork",
|
|
89
|
+
"outcomes",
|
|
90
|
+
"routes",
|
|
91
|
+
"terminalStates",
|
|
92
|
+
"replayProjection",
|
|
93
|
+
]) {
|
|
94
|
+
if (!Array.isArray(tick.semantics[surface])) {
|
|
95
|
+
issue(issues, "missing_semantics", ["ticks", index, "semantics", surface], `Expected ${surface} semantic evidence.`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
for (const [eventIndex, eventKind] of tick.eventKinds.entries()) {
|
|
100
|
+
if (!factoryEventKinds.has(eventKind)) {
|
|
101
|
+
issue(issues, "unexpected_event_kind", ["ticks", index, "eventKinds", eventIndex], `Unexpected Factory event kind ${String(eventKind)}.`);
|
|
102
|
+
}
|
|
103
|
+
else
|
|
104
|
+
eventKinds.push(eventKind);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (!Array.isArray(input.orderedEventKinds)) {
|
|
108
|
+
issue(issues, "missing_required_data", ["orderedEventKinds"], "Expected the complete ordered event-kind sequence.");
|
|
109
|
+
}
|
|
110
|
+
else if (JSON.stringify(input.orderedEventKinds) !== JSON.stringify(eventKinds)) {
|
|
111
|
+
issue(issues, "invalid_value", ["orderedEventKinds"], "Ordered event kinds must exactly concatenate the logical-tick event kinds.");
|
|
112
|
+
}
|
|
113
|
+
if (issues.length > 0)
|
|
114
|
+
return { success: false, issues };
|
|
115
|
+
const reference = input;
|
|
116
|
+
const compatibility = inspectFactoryEmulatorCompatibility(reference.factory);
|
|
117
|
+
if (!compatibility.supported) {
|
|
118
|
+
return {
|
|
119
|
+
success: false,
|
|
120
|
+
issues: [
|
|
121
|
+
{
|
|
122
|
+
code: "invalid_factory",
|
|
123
|
+
path: ["factory"],
|
|
124
|
+
message: compatibility.diagnostics[0]?.message ??
|
|
125
|
+
"Factory is not supported by the emulator.",
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
success: true,
|
|
132
|
+
data: JSON.parse(JSON.stringify(reference)),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/** Returns detached validated fixtures in their frozen package declaration order. */
|
|
136
|
+
export function loadFactoryEmulatorRuntimeReferences() {
|
|
137
|
+
return runtimeReferenceFixtures.map((fixture) => {
|
|
138
|
+
const parsed = safeParseFactoryEmulatorRuntimeReference(fixture);
|
|
139
|
+
if (!parsed.success)
|
|
140
|
+
throw new Error(`Invalid runtime reference ${String(fixture.id)}: ${parsed.issues.map(({ message }) => message).join(" ")}`);
|
|
141
|
+
return parsed.data;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare const FACTORY_EMULATOR_SCENARIO_SCHEMA_VERSION: "factory-emulator-scenario/v1";
|
|
2
|
+
export interface FactoryEmulatorRuleSelector {
|
|
3
|
+
readonly workstation?: string;
|
|
4
|
+
readonly worker?: string;
|
|
5
|
+
readonly input?: {
|
|
6
|
+
readonly workType?: string;
|
|
7
|
+
readonly state?: string;
|
|
8
|
+
readonly name?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface FactoryEmulatorOutcome {
|
|
12
|
+
readonly result: "accepted" | "continued" | "rejected" | "failed";
|
|
13
|
+
readonly durationMs: number;
|
|
14
|
+
readonly output?: string;
|
|
15
|
+
readonly feedback?: string;
|
|
16
|
+
readonly activityLabel?: string;
|
|
17
|
+
readonly error?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface FactoryEmulatorRule {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly selector: FactoryEmulatorRuleSelector;
|
|
22
|
+
readonly cursor: {
|
|
23
|
+
readonly scope: "lineage";
|
|
24
|
+
readonly input: "rootWorkId";
|
|
25
|
+
};
|
|
26
|
+
readonly outcomes: readonly FactoryEmulatorOutcome[];
|
|
27
|
+
readonly exhaustion: "repeat-last" | "fail";
|
|
28
|
+
}
|
|
29
|
+
export interface FactoryEmulatorInitialSubmission {
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly workType: string;
|
|
32
|
+
readonly state: string;
|
|
33
|
+
readonly input?: string;
|
|
34
|
+
readonly parent?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface FactoryEmulatorSubmissionRelation {
|
|
37
|
+
readonly type: "DEPENDS_ON" | "PARENT_CHILD" | "SPAWNED_BY";
|
|
38
|
+
readonly sourceWorkName: string;
|
|
39
|
+
readonly targetWorkName: string;
|
|
40
|
+
readonly requiredState?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface FactoryEmulatorSubmissionBatch {
|
|
43
|
+
readonly works: readonly FactoryEmulatorInitialSubmission[];
|
|
44
|
+
readonly relations?: readonly FactoryEmulatorSubmissionRelation[];
|
|
45
|
+
}
|
|
46
|
+
export type FactoryEmulatorInitialSubmissions = readonly FactoryEmulatorInitialSubmission[] | FactoryEmulatorSubmissionBatch;
|
|
47
|
+
export interface FactoryEmulatorScenario {
|
|
48
|
+
readonly schemaVersion: typeof FACTORY_EMULATOR_SCENARIO_SCHEMA_VERSION;
|
|
49
|
+
readonly id: string;
|
|
50
|
+
readonly factory: {
|
|
51
|
+
readonly name: string;
|
|
52
|
+
};
|
|
53
|
+
readonly seed: string;
|
|
54
|
+
readonly startAt: string;
|
|
55
|
+
readonly rules: readonly FactoryEmulatorRule[];
|
|
56
|
+
readonly unmatched: {
|
|
57
|
+
readonly behavior: "error";
|
|
58
|
+
} | {
|
|
59
|
+
readonly behavior: "outcome";
|
|
60
|
+
readonly outcome: FactoryEmulatorOutcome;
|
|
61
|
+
};
|
|
62
|
+
readonly initialSubmissions?: FactoryEmulatorInitialSubmissions;
|
|
63
|
+
}
|
|
64
|
+
export type FactoryEmulatorScenarioIssueCode = "duplicate_identity" | "fully_shadowed_rule" | "invalid_cursor" | "invalid_exhaustion" | "invalid_factory_identity" | "invalid_initial_submission_relationship" | "invalid_outcome" | "invalid_selector_reference" | "invalid_start_at" | "invalid_type" | "invalid_unmatched" | "invalid_value" | "missing_required_field" | "unsupported_field" | "unsupported_schema_version" | "unstable_identity";
|
|
65
|
+
export interface FactoryEmulatorScenarioIssue {
|
|
66
|
+
readonly category: "structure" | "semantic";
|
|
67
|
+
readonly code: FactoryEmulatorScenarioIssueCode;
|
|
68
|
+
readonly path: readonly (string | number)[];
|
|
69
|
+
readonly message: string;
|
|
70
|
+
}
|
|
71
|
+
export type SafeParseFactoryEmulatorScenarioResult = {
|
|
72
|
+
readonly success: true;
|
|
73
|
+
readonly data: FactoryEmulatorScenario;
|
|
74
|
+
} | {
|
|
75
|
+
readonly success: false;
|
|
76
|
+
readonly issues: readonly FactoryEmulatorScenarioIssue[];
|
|
77
|
+
};
|
|
78
|
+
export declare class FactoryEmulatorScenarioValidationError extends Error {
|
|
79
|
+
readonly issues: readonly FactoryEmulatorScenarioIssue[];
|
|
80
|
+
constructor(issues: readonly FactoryEmulatorScenarioIssue[]);
|
|
81
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const FACTORY_EMULATOR_SCENARIO_SCHEMA_VERSION = "factory-emulator-scenario/v1";
|
|
2
|
+
export class FactoryEmulatorScenarioValidationError extends Error {
|
|
3
|
+
issues;
|
|
4
|
+
constructor(issues) {
|
|
5
|
+
super(issues.length === 1
|
|
6
|
+
? `Factory emulator scenario validation failed: ${issues[0]?.message}`
|
|
7
|
+
: `Factory emulator scenario validation failed with ${issues.length} issues`);
|
|
8
|
+
this.name = "FactoryEmulatorScenarioValidationError";
|
|
9
|
+
this.issues = issues;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import type { FactoryDefinition } from "@you-agent-factory/client";
|
|
2
|
+
import { type FactoryEmulatorScenario, type SafeParseFactoryEmulatorScenarioResult } from "./scenario-contracts.js";
|
|
3
|
+
export * from "./scenario-contracts.js";
|
|
4
|
+
export declare const scenarioSchema: {
|
|
5
|
+
$schema: string;
|
|
6
|
+
$id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
type: string;
|
|
9
|
+
additionalProperties: boolean;
|
|
10
|
+
required: string[];
|
|
11
|
+
properties: {
|
|
12
|
+
schemaVersion: {
|
|
13
|
+
const: string;
|
|
14
|
+
};
|
|
15
|
+
id: {
|
|
16
|
+
$ref: string;
|
|
17
|
+
};
|
|
18
|
+
factory: {
|
|
19
|
+
type: string;
|
|
20
|
+
additionalProperties: boolean;
|
|
21
|
+
required: string[];
|
|
22
|
+
properties: {
|
|
23
|
+
name: {
|
|
24
|
+
$ref: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
seed: {
|
|
29
|
+
type: string;
|
|
30
|
+
minLength: number;
|
|
31
|
+
maxLength: number;
|
|
32
|
+
};
|
|
33
|
+
startAt: {
|
|
34
|
+
type: string;
|
|
35
|
+
format: string;
|
|
36
|
+
pattern: string;
|
|
37
|
+
};
|
|
38
|
+
rules: {
|
|
39
|
+
type: string;
|
|
40
|
+
items: {
|
|
41
|
+
$ref: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
unmatched: {
|
|
45
|
+
$ref: string;
|
|
46
|
+
};
|
|
47
|
+
initialSubmissions: {
|
|
48
|
+
oneOf: ({
|
|
49
|
+
type: string;
|
|
50
|
+
items: {
|
|
51
|
+
$ref: string;
|
|
52
|
+
};
|
|
53
|
+
$ref?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
$ref: string;
|
|
56
|
+
type?: undefined;
|
|
57
|
+
items?: undefined;
|
|
58
|
+
})[];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
$defs: {
|
|
62
|
+
stableIdentity: {
|
|
63
|
+
type: string;
|
|
64
|
+
minLength: number;
|
|
65
|
+
maxLength: number;
|
|
66
|
+
pattern: string;
|
|
67
|
+
};
|
|
68
|
+
nonEmptyText128: {
|
|
69
|
+
type: string;
|
|
70
|
+
minLength: number;
|
|
71
|
+
maxLength: number;
|
|
72
|
+
};
|
|
73
|
+
plainText: {
|
|
74
|
+
type: string;
|
|
75
|
+
maxLength: number;
|
|
76
|
+
};
|
|
77
|
+
feedbackText: {
|
|
78
|
+
type: string;
|
|
79
|
+
maxLength: number;
|
|
80
|
+
};
|
|
81
|
+
activityLabel: {
|
|
82
|
+
type: string;
|
|
83
|
+
minLength: number;
|
|
84
|
+
maxLength: number;
|
|
85
|
+
};
|
|
86
|
+
inputSelector: {
|
|
87
|
+
type: string;
|
|
88
|
+
additionalProperties: boolean;
|
|
89
|
+
properties: {
|
|
90
|
+
workType: {
|
|
91
|
+
$ref: string;
|
|
92
|
+
};
|
|
93
|
+
state: {
|
|
94
|
+
$ref: string;
|
|
95
|
+
};
|
|
96
|
+
name: {
|
|
97
|
+
$ref: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
selector: {
|
|
102
|
+
type: string;
|
|
103
|
+
additionalProperties: boolean;
|
|
104
|
+
properties: {
|
|
105
|
+
workstation: {
|
|
106
|
+
$ref: string;
|
|
107
|
+
};
|
|
108
|
+
worker: {
|
|
109
|
+
$ref: string;
|
|
110
|
+
};
|
|
111
|
+
input: {
|
|
112
|
+
$ref: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
cursor: {
|
|
117
|
+
type: string;
|
|
118
|
+
additionalProperties: boolean;
|
|
119
|
+
required: string[];
|
|
120
|
+
properties: {
|
|
121
|
+
scope: {
|
|
122
|
+
const: string;
|
|
123
|
+
};
|
|
124
|
+
input: {
|
|
125
|
+
const: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
outcome: {
|
|
130
|
+
type: string;
|
|
131
|
+
additionalProperties: boolean;
|
|
132
|
+
required: string[];
|
|
133
|
+
properties: {
|
|
134
|
+
result: {
|
|
135
|
+
enum: string[];
|
|
136
|
+
};
|
|
137
|
+
durationMs: {
|
|
138
|
+
type: string;
|
|
139
|
+
minimum: number;
|
|
140
|
+
};
|
|
141
|
+
output: {
|
|
142
|
+
$ref: string;
|
|
143
|
+
};
|
|
144
|
+
feedback: {
|
|
145
|
+
$ref: string;
|
|
146
|
+
};
|
|
147
|
+
activityLabel: {
|
|
148
|
+
$ref: string;
|
|
149
|
+
};
|
|
150
|
+
error: {
|
|
151
|
+
$ref: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
rule: {
|
|
156
|
+
type: string;
|
|
157
|
+
additionalProperties: boolean;
|
|
158
|
+
required: string[];
|
|
159
|
+
properties: {
|
|
160
|
+
id: {
|
|
161
|
+
$ref: string;
|
|
162
|
+
};
|
|
163
|
+
selector: {
|
|
164
|
+
$ref: string;
|
|
165
|
+
};
|
|
166
|
+
cursor: {
|
|
167
|
+
$ref: string;
|
|
168
|
+
};
|
|
169
|
+
outcomes: {
|
|
170
|
+
type: string;
|
|
171
|
+
minItems: number;
|
|
172
|
+
items: {
|
|
173
|
+
$ref: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
exhaustion: {
|
|
177
|
+
enum: string[];
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
unmatched: {
|
|
182
|
+
oneOf: ({
|
|
183
|
+
type: string;
|
|
184
|
+
additionalProperties: boolean;
|
|
185
|
+
required: string[];
|
|
186
|
+
properties: {
|
|
187
|
+
behavior: {
|
|
188
|
+
const: string;
|
|
189
|
+
};
|
|
190
|
+
outcome?: undefined;
|
|
191
|
+
};
|
|
192
|
+
} | {
|
|
193
|
+
type: string;
|
|
194
|
+
additionalProperties: boolean;
|
|
195
|
+
required: string[];
|
|
196
|
+
properties: {
|
|
197
|
+
behavior: {
|
|
198
|
+
const: string;
|
|
199
|
+
};
|
|
200
|
+
outcome: {
|
|
201
|
+
$ref: string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
})[];
|
|
205
|
+
};
|
|
206
|
+
initialSubmission: {
|
|
207
|
+
type: string;
|
|
208
|
+
additionalProperties: boolean;
|
|
209
|
+
required: string[];
|
|
210
|
+
properties: {
|
|
211
|
+
name: {
|
|
212
|
+
$ref: string;
|
|
213
|
+
};
|
|
214
|
+
workType: {
|
|
215
|
+
$ref: string;
|
|
216
|
+
};
|
|
217
|
+
state: {
|
|
218
|
+
$ref: string;
|
|
219
|
+
};
|
|
220
|
+
input: {
|
|
221
|
+
$ref: string;
|
|
222
|
+
};
|
|
223
|
+
parent: {
|
|
224
|
+
$ref: string;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
submissionRelation: {
|
|
229
|
+
type: string;
|
|
230
|
+
additionalProperties: boolean;
|
|
231
|
+
required: string[];
|
|
232
|
+
properties: {
|
|
233
|
+
type: {
|
|
234
|
+
enum: string[];
|
|
235
|
+
};
|
|
236
|
+
sourceWorkName: {
|
|
237
|
+
$ref: string;
|
|
238
|
+
};
|
|
239
|
+
targetWorkName: {
|
|
240
|
+
$ref: string;
|
|
241
|
+
};
|
|
242
|
+
requiredState: {
|
|
243
|
+
$ref: string;
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
submissionBatch: {
|
|
248
|
+
type: string;
|
|
249
|
+
additionalProperties: boolean;
|
|
250
|
+
required: string[];
|
|
251
|
+
properties: {
|
|
252
|
+
works: {
|
|
253
|
+
type: string;
|
|
254
|
+
items: {
|
|
255
|
+
$ref: string;
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
relations: {
|
|
259
|
+
type: string;
|
|
260
|
+
items: {
|
|
261
|
+
$ref: string;
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
/** Validate an authored scenario without mutating it or the Factory context. */
|
|
269
|
+
export declare function safeParseFactoryEmulatorScenario(input: unknown, factory: FactoryDefinition): SafeParseFactoryEmulatorScenarioResult;
|
|
270
|
+
/** Parse a complete scenario or throw one error containing every diagnostic. */
|
|
271
|
+
export declare function parseFactoryEmulatorScenario(input: unknown, factory: FactoryDefinition): FactoryEmulatorScenario;
|