@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.
Files changed (69) hide show
  1. package/LICENSE.md +19 -1
  2. package/README.md +305 -286
  3. package/dist/compatibility.d.ts +19 -0
  4. package/dist/compatibility.js +156 -0
  5. package/dist/event-sink.d.ts +29 -0
  6. package/dist/event-sink.js +58 -0
  7. package/dist/generated/scenario-schema.d.ts +268 -0
  8. package/dist/generated/scenario-schema.js +319 -0
  9. package/dist/index.d.ts +8 -0
  10. package/dist/index.js +8 -0
  11. package/dist/logical-move.d.ts +10 -0
  12. package/dist/logical-move.js +18 -0
  13. package/dist/recording-sink.d.ts +22 -0
  14. package/dist/recording-sink.js +122 -0
  15. package/dist/runtime-reference-conformance.d.ts +20 -0
  16. package/dist/runtime-reference-conformance.js +138 -0
  17. package/dist/runtime-reference-evidence.d.ts +9 -0
  18. package/dist/runtime-reference-evidence.js +193 -0
  19. package/dist/runtime-reference-fixtures.d.ts +7 -0
  20. package/dist/runtime-reference-fixtures.js +308 -0
  21. package/dist/runtime-reference.d.ts +48 -0
  22. package/dist/runtime-reference.js +143 -0
  23. package/dist/scenario-contracts.d.ts +81 -0
  24. package/dist/scenario-contracts.js +11 -0
  25. package/dist/scenario.d.ts +271 -0
  26. package/dist/scenario.js +333 -0
  27. package/dist/scheduler.d.ts +24 -0
  28. package/dist/scheduler.js +104 -0
  29. package/dist/session-contracts.d.ts +262 -0
  30. package/dist/session-contracts.js +74 -0
  31. package/dist/session.d.ts +4 -0
  32. package/dist/session.js +1490 -0
  33. package/dist/submission-replay.d.ts +14 -0
  34. package/dist/submission-replay.js +96 -0
  35. package/dist/submission-validation.d.ts +3 -0
  36. package/dist/submission-validation.js +113 -0
  37. package/examples/customer-support.scenario.v1.json +45 -0
  38. package/package.json +44 -22
  39. package/schema/scenario.schema.json +171 -0
  40. package/generated/factory-emulator-scenario.schema.json +0 -191
  41. package/generated/factory.schema.json +0 -2606
  42. package/src/contracts.ts +0 -41
  43. package/src/data-error.js +0 -21
  44. package/src/data-only.js +0 -208
  45. package/src/emulator.js +0 -195
  46. package/src/emulator.ts +0 -86
  47. package/src/examples.js +0 -86
  48. package/src/examples.ts +0 -11
  49. package/src/generated/factory-schema.d.ts +0 -3
  50. package/src/generated/factory-schema.js +0 -5
  51. package/src/generated/scenario-schema.d.ts +0 -4
  52. package/src/generated/scenario-schema.js +0 -6
  53. package/src/generated/scenario.ts +0 -103
  54. package/src/identity.js +0 -55
  55. package/src/index.js +0 -34
  56. package/src/index.ts +0 -102
  57. package/src/limits.js +0 -125
  58. package/src/parser.js +0 -113
  59. package/src/parser.ts +0 -56
  60. package/src/scheduler.js +0 -374
  61. package/src/semantics.js +0 -354
  62. package/src/semantics.ts +0 -38
  63. package/src/session.js +0 -1201
  64. package/src/session.ts +0 -324
  65. package/src/sinks.js +0 -118
  66. package/src/sinks.ts +0 -56
  67. package/src/support.js +0 -334
  68. package/src/support.ts +0 -15
  69. 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
- }