@you-agent-factory/factory-emulator 0.0.0 → 0.0.2
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
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://you-agent-factory.dev/schemas/factory-emulator/scenario/v1",
|
|
4
|
-
"title": "Factory Emulator Scenario v1",
|
|
5
|
-
"description": "A deterministic, authored scenario for a Factory emulator. activityLabel is transient emulator metadata and is never canonical Factory event content.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"required": ["version", "id", "seed", "startAt", "rules", "unmatchedBehavior"],
|
|
9
|
-
"properties": {
|
|
10
|
-
"version": { "const": "you-agent-factory.emulator.scenario.v1" },
|
|
11
|
-
"id": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
12
|
-
"seed": { "type": "string", "minLength": 1, "maxLength": 256 },
|
|
13
|
-
"startAt": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"format": "date-time",
|
|
16
|
-
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]+)?Z$"
|
|
17
|
-
},
|
|
18
|
-
"initialSubmissions": {
|
|
19
|
-
"type": "array",
|
|
20
|
-
"items": { "$ref": "#/$defs/initialSubmission" }
|
|
21
|
-
},
|
|
22
|
-
"rules": {
|
|
23
|
-
"type": "array",
|
|
24
|
-
"items": { "$ref": "#/$defs/rule" }
|
|
25
|
-
},
|
|
26
|
-
"unmatchedBehavior": { "$ref": "#/$defs/unmatchedBehavior" },
|
|
27
|
-
"activityLabel": {
|
|
28
|
-
"type": "string",
|
|
29
|
-
"minLength": 1,
|
|
30
|
-
"maxLength": 120,
|
|
31
|
-
"description": "Bounded transient emulator activity metadata. It is never a canonical Factory event field."
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"$defs": {
|
|
35
|
-
"initialSubmission": {
|
|
36
|
-
"type": "object",
|
|
37
|
-
"additionalProperties": false,
|
|
38
|
-
"required": ["id", "workType"],
|
|
39
|
-
"properties": {
|
|
40
|
-
"id": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
41
|
-
"workType": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
42
|
-
"input": { "type": "object", "additionalProperties": true }
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"rule": {
|
|
46
|
-
"type": "object",
|
|
47
|
-
"additionalProperties": false,
|
|
48
|
-
"required": ["id", "match", "outcomes", "exhaustionBehavior"],
|
|
49
|
-
"properties": {
|
|
50
|
-
"id": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
51
|
-
"match": { "$ref": "#/$defs/matcher" },
|
|
52
|
-
"outcomes": {
|
|
53
|
-
"type": "array",
|
|
54
|
-
"minItems": 1,
|
|
55
|
-
"items": { "$ref": "#/$defs/outcome" }
|
|
56
|
-
},
|
|
57
|
-
"exhaustionBehavior": { "$ref": "#/$defs/exhaustionBehavior" }
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"matcher": {
|
|
61
|
-
"oneOf": [
|
|
62
|
-
{
|
|
63
|
-
"type": "object",
|
|
64
|
-
"additionalProperties": false,
|
|
65
|
-
"required": ["kind"],
|
|
66
|
-
"properties": { "kind": { "const": "all" } }
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"type": "object",
|
|
70
|
-
"additionalProperties": false,
|
|
71
|
-
"required": ["kind", "workType"],
|
|
72
|
-
"properties": {
|
|
73
|
-
"kind": { "const": "workType" },
|
|
74
|
-
"workType": { "type": "string", "minLength": 1, "maxLength": 128 }
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"type": "object",
|
|
79
|
-
"additionalProperties": false,
|
|
80
|
-
"required": ["kind", "submissionId"],
|
|
81
|
-
"properties": {
|
|
82
|
-
"kind": { "const": "submissionId" },
|
|
83
|
-
"submissionId": { "type": "string", "minLength": 1, "maxLength": 128 }
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
"outcome": {
|
|
89
|
-
"oneOf": [
|
|
90
|
-
{
|
|
91
|
-
"type": "object",
|
|
92
|
-
"additionalProperties": false,
|
|
93
|
-
"required": ["kind"],
|
|
94
|
-
"properties": {
|
|
95
|
-
"kind": { "const": "complete" },
|
|
96
|
-
"durationMs": {
|
|
97
|
-
"type": "integer",
|
|
98
|
-
"minimum": 0,
|
|
99
|
-
"maximum": 9007199254740991,
|
|
100
|
-
"description": "Deterministic virtual execution duration in milliseconds. Defaults to zero."
|
|
101
|
-
},
|
|
102
|
-
"output": { "type": "object", "additionalProperties": true },
|
|
103
|
-
"lineageCursor": { "$ref": "#/$defs/lineageCursor" }
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"type": "object",
|
|
108
|
-
"additionalProperties": false,
|
|
109
|
-
"required": ["kind", "reason"],
|
|
110
|
-
"properties": {
|
|
111
|
-
"kind": { "const": "reject" },
|
|
112
|
-
"durationMs": {
|
|
113
|
-
"type": "integer",
|
|
114
|
-
"minimum": 0,
|
|
115
|
-
"maximum": 9007199254740991,
|
|
116
|
-
"description": "Deterministic virtual execution duration in milliseconds. Defaults to zero."
|
|
117
|
-
},
|
|
118
|
-
"reason": { "type": "string", "minLength": 1, "maxLength": 512 }
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
]
|
|
122
|
-
},
|
|
123
|
-
"lineageCursor": {
|
|
124
|
-
"oneOf": [
|
|
125
|
-
{
|
|
126
|
-
"type": "object",
|
|
127
|
-
"additionalProperties": false,
|
|
128
|
-
"required": ["kind", "submissionId"],
|
|
129
|
-
"properties": {
|
|
130
|
-
"kind": { "const": "initialSubmission" },
|
|
131
|
-
"submissionId": { "type": "string", "minLength": 1, "maxLength": 128 }
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"type": "object",
|
|
136
|
-
"additionalProperties": false,
|
|
137
|
-
"required": ["kind", "ruleId", "outcomeIndex"],
|
|
138
|
-
"properties": {
|
|
139
|
-
"kind": { "const": "scriptedOutcome" },
|
|
140
|
-
"ruleId": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
141
|
-
"outcomeIndex": { "type": "integer", "minimum": 0 }
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
},
|
|
146
|
-
"exhaustionBehavior": {
|
|
147
|
-
"oneOf": [
|
|
148
|
-
{
|
|
149
|
-
"type": "object",
|
|
150
|
-
"additionalProperties": false,
|
|
151
|
-
"required": ["kind"],
|
|
152
|
-
"properties": { "kind": { "const": "repeatLast" } }
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"type": "object",
|
|
156
|
-
"additionalProperties": false,
|
|
157
|
-
"required": ["kind"],
|
|
158
|
-
"properties": { "kind": { "const": "useUnmatchedBehavior" } }
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
"type": "object",
|
|
162
|
-
"additionalProperties": false,
|
|
163
|
-
"required": ["kind", "reason"],
|
|
164
|
-
"properties": {
|
|
165
|
-
"kind": { "const": "reject" },
|
|
166
|
-
"reason": { "type": "string", "minLength": 1, "maxLength": 512 }
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
},
|
|
171
|
-
"unmatchedBehavior": {
|
|
172
|
-
"oneOf": [
|
|
173
|
-
{
|
|
174
|
-
"type": "object",
|
|
175
|
-
"additionalProperties": false,
|
|
176
|
-
"required": ["kind"],
|
|
177
|
-
"properties": { "kind": { "const": "ignore" } }
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
"type": "object",
|
|
181
|
-
"additionalProperties": false,
|
|
182
|
-
"required": ["kind", "reason"],
|
|
183
|
-
"properties": {
|
|
184
|
-
"kind": { "const": "reject" },
|
|
185
|
-
"reason": { "type": "string", "minLength": 1, "maxLength": 512 }
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|