@ifsoul/core 0.3.0 → 0.5.0

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 (147) hide show
  1. package/README.md +30 -33
  2. package/dist/packages/memory/src/sql.js +54 -5
  3. package/dist/packages/protocol/src/generated/validators.cjs +1 -1
  4. package/dist/packages/protocol/src/index.d.ts +1 -6
  5. package/dist/packages/protocol/src/index.js +3 -16
  6. package/dist/packages/protocol/src/types.d.ts +1 -1
  7. package/dist/packages/runtime/src/behavior-types.d.ts +150 -0
  8. package/dist/packages/runtime/src/behavior-types.js +1 -0
  9. package/dist/packages/runtime/src/behavior.d.ts +40 -0
  10. package/dist/packages/runtime/src/behavior.js +621 -0
  11. package/dist/packages/runtime/src/group-scheduler.d.ts +165 -0
  12. package/dist/packages/runtime/src/group-scheduler.js +647 -0
  13. package/dist/packages/runtime/src/index.d.ts +4 -0
  14. package/dist/packages/runtime/src/index.js +4 -1
  15. package/dist/packages/runtime/src/participants.d.ts +107 -0
  16. package/dist/packages/runtime/src/participants.js +309 -0
  17. package/dist/packages/runtime/src/types.d.ts +1 -0
  18. package/package.json +2 -3
  19. package/packages/protocol/schemas/current/archive.schema.json +16 -16
  20. package/packages/protocol/schemas/current/character.schema.json +21 -21
  21. package/packages/protocol/schemas/current/common.schema.json +15 -15
  22. package/packages/protocol/schemas/current/context.schema.json +24 -24
  23. package/packages/protocol/schemas/current/conversation.schema.json +39 -39
  24. package/packages/protocol/schemas/current/environment.schema.json +18 -18
  25. package/packages/protocol/schemas/current/memory.schema.json +66 -66
  26. package/packages/protocol/schemas/current/model-provider.schema.json +40 -40
  27. package/packages/protocol/schemas/current/planning.schema.json +61 -61
  28. package/packages/protocol/schemas/current/provider-common.schema.json +6 -6
  29. package/release.json +7 -12
  30. package/specs/README.md +3 -86
  31. package/specs/current/README.md +3 -5
  32. package/specs/current/examples/archive-fork.json +12 -12
  33. package/specs/current/examples/archive-resume.json +12 -12
  34. package/specs/current/examples/character-instance.json +1 -1
  35. package/specs/current/examples/character-template.json +1 -1
  36. package/specs/current/examples/context-after-inspection.json +1 -1
  37. package/specs/current/examples/context-chat.json +1 -1
  38. package/specs/current/examples/context-daily.json +1 -1
  39. package/specs/current/examples/context-no-speech.json +1 -1
  40. package/specs/current/examples/conversation-delivery.json +1 -1
  41. package/specs/current/examples/conversation-live-request.json +1 -1
  42. package/specs/current/examples/conversation-live-response.json +1 -1
  43. package/specs/current/examples/conversation-no-speech-request.json +1 -1
  44. package/specs/current/examples/conversation-no-speech-response.json +1 -1
  45. package/specs/current/examples/conversation-requested-request.json +1 -1
  46. package/specs/current/examples/conversation-requested-response.json +1 -1
  47. package/specs/current/examples/environment-chat.json +1 -1
  48. package/specs/current/examples/environment-game.json +1 -1
  49. package/specs/current/examples/environment-no-speech.json +1 -1
  50. package/specs/current/examples/intent-checkpoint.json +1 -1
  51. package/specs/current/examples/memory-episode.json +1 -1
  52. package/specs/current/examples/memory-event-conversation.json +1 -1
  53. package/specs/current/examples/memory-event-observed.json +2 -2
  54. package/specs/current/examples/memory-event-plan-proposal.json +2 -2
  55. package/specs/current/examples/memory-event-proposed.json +2 -2
  56. package/specs/current/examples/memory-fact.json +1 -1
  57. package/specs/current/examples/memory-relationship.json +1 -1
  58. package/specs/current/examples/memory-working-context.json +1 -1
  59. package/specs/current/examples/plan-cancel-request.json +1 -1
  60. package/specs/current/examples/plan-cancel-result.json +1 -1
  61. package/specs/current/examples/plan-daily.json +1 -1
  62. package/specs/current/examples/plan-partial-decision.json +1 -1
  63. package/specs/current/examples/portable-memory.jsonl +9 -9
  64. package/specs/current/examples/task-outcome.json +1 -1
  65. package/specs/current/examples/task-progress.json +1 -1
  66. package/specs/current/model-provider/examples/capabilities.json +1 -1
  67. package/specs/current/model-provider/examples/error.json +1 -1
  68. package/specs/current/model-provider/examples/request.json +1 -1
  69. package/specs/current/model-provider/examples/response.json +1 -1
  70. package/docs/npm-publishing.md +0 -44
  71. package/packages/protocol/schemas/action-result.schema.json +0 -187
  72. package/packages/protocol/schemas/action.schema.json +0 -68
  73. package/packages/protocol/schemas/archive-manifest.schema.json +0 -126
  74. package/packages/protocol/schemas/capability.schema.json +0 -131
  75. package/packages/protocol/schemas/character-instance.schema.json +0 -73
  76. package/packages/protocol/schemas/character-template.schema.json +0 -67
  77. package/packages/protocol/schemas/common.schema.json +0 -154
  78. package/packages/protocol/schemas/derived-memory.schema.json +0 -145
  79. package/packages/protocol/schemas/memory-event.schema.json +0 -123
  80. package/packages/protocol/schemas/model-provider.schema.json +0 -326
  81. package/packages/protocol/schemas/perception.schema.json +0 -89
  82. package/packages/protocol/schemas/permission-policy.schema.json +0 -153
  83. package/packages/protocol/schemas/v0.2/archive.schema.json +0 -205
  84. package/packages/protocol/schemas/v0.2/character.schema.json +0 -344
  85. package/packages/protocol/schemas/v0.2/common.schema.json +0 -239
  86. package/packages/protocol/schemas/v0.2/context.schema.json +0 -230
  87. package/packages/protocol/schemas/v0.2/conversation.schema.json +0 -340
  88. package/packages/protocol/schemas/v0.2/environment.schema.json +0 -244
  89. package/packages/protocol/schemas/v0.2/memory.schema.json +0 -495
  90. package/packages/protocol/schemas/v0.2/planning.schema.json +0 -443
  91. package/packages/protocol/schemas/world-event.schema.json +0 -74
  92. package/specs/character/README.md +0 -84
  93. package/specs/character/examples/archive-manifest.json +0 -32
  94. package/specs/character/examples/character-instance.json +0 -20
  95. package/specs/character/examples/character-template.json +0 -19
  96. package/specs/memory/README.md +0 -80
  97. package/specs/memory/examples/derived-memory.json +0 -21
  98. package/specs/memory/examples/memory-event.json +0 -35
  99. package/specs/model-provider/README.md +0 -85
  100. package/specs/model-provider/examples/capabilities.json +0 -10
  101. package/specs/model-provider/examples/error.json +0 -18
  102. package/specs/model-provider/examples/request.json +0 -17
  103. package/specs/model-provider/examples/response.json +0 -19
  104. package/specs/v0.2/README.md +0 -421
  105. package/specs/v0.2/examples/archive-fork.json +0 -64
  106. package/specs/v0.2/examples/archive-resume.json +0 -63
  107. package/specs/v0.2/examples/character-instance.json +0 -57
  108. package/specs/v0.2/examples/character-template.json +0 -45
  109. package/specs/v0.2/examples/context-after-inspection.json +0 -44
  110. package/specs/v0.2/examples/context-chat.json +0 -27
  111. package/specs/v0.2/examples/context-daily.json +0 -69
  112. package/specs/v0.2/examples/context-no-speech.json +0 -27
  113. package/specs/v0.2/examples/conversation-delivery.json +0 -17
  114. package/specs/v0.2/examples/conversation-live-request.json +0 -31
  115. package/specs/v0.2/examples/conversation-live-response.json +0 -23
  116. package/specs/v0.2/examples/conversation-no-speech-request.json +0 -23
  117. package/specs/v0.2/examples/conversation-no-speech-response.json +0 -22
  118. package/specs/v0.2/examples/conversation-requested-request.json +0 -31
  119. package/specs/v0.2/examples/conversation-requested-response.json +0 -23
  120. package/specs/v0.2/examples/environment-chat.json +0 -43
  121. package/specs/v0.2/examples/environment-game.json +0 -80
  122. package/specs/v0.2/examples/environment-no-speech.json +0 -47
  123. package/specs/v0.2/examples/intent-checkpoint.json +0 -29
  124. package/specs/v0.2/examples/memory-episode.json +0 -28
  125. package/specs/v0.2/examples/memory-event-conversation.json +0 -32
  126. package/specs/v0.2/examples/memory-event-observed.json +0 -50
  127. package/specs/v0.2/examples/memory-event-plan-proposal.json +0 -82
  128. package/specs/v0.2/examples/memory-event-proposed.json +0 -53
  129. package/specs/v0.2/examples/memory-fact.json +0 -23
  130. package/specs/v0.2/examples/memory-relationship.json +0 -25
  131. package/specs/v0.2/examples/memory-working-context.json +0 -24
  132. package/specs/v0.2/examples/plan-cancel-request.json +0 -16
  133. package/specs/v0.2/examples/plan-cancel-result.json +0 -21
  134. package/specs/v0.2/examples/plan-daily.json +0 -57
  135. package/specs/v0.2/examples/plan-partial-decision.json +0 -28
  136. package/specs/v0.2/examples/portable-memory.jsonl +0 -9
  137. package/specs/v0.2/examples/task-outcome.json +0 -21
  138. package/specs/v0.2/examples/task-progress.json +0 -19
  139. package/specs/world-adapter/README.md +0 -114
  140. package/specs/world-adapter/examples/action-result-unknown.json +0 -23
  141. package/specs/world-adapter/examples/action-result.json +0 -45
  142. package/specs/world-adapter/examples/action.json +0 -17
  143. package/specs/world-adapter/examples/capability.json +0 -44
  144. package/specs/world-adapter/examples/perception.json +0 -30
  145. package/specs/world-adapter/examples/permission-decision.json +0 -14
  146. package/specs/world-adapter/examples/permission-policy.json +0 -17
  147. package/specs/world-adapter/examples/world-event.json +0 -25
@@ -1,443 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "urn:ifsoul:protocol:draft-0.2.0:planning",
4
- "oneOf": [
5
- {
6
- "$ref": "#/$defs/proposal"
7
- },
8
- {
9
- "$ref": "#/$defs/decision"
10
- },
11
- {
12
- "$ref": "#/$defs/report"
13
- },
14
- {
15
- "$ref": "#/$defs/cancelRequest"
16
- },
17
- {
18
- "$ref": "#/$defs/cancelResult"
19
- }
20
- ],
21
- "$defs": {
22
- "proposal": {
23
- "type": "object",
24
- "properties": {
25
- "schemaVersion": {
26
- "const": "draft-0.2.0"
27
- },
28
- "kind": {
29
- "const": "plan-proposal"
30
- },
31
- "binding": {
32
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/binding"
33
- },
34
- "correlationId": {
35
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
36
- },
37
- "planId": {
38
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
39
- },
40
- "requestId": {
41
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
42
- },
43
- "contextReportId": {
44
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
45
- },
46
- "contextRevision": {
47
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
48
- },
49
- "environmentRevision": {
50
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
51
- },
52
- "createdAt": {
53
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/utc"
54
- },
55
- "expiresAt": {
56
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/utc"
57
- },
58
- "horizon": {
59
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/period"
60
- },
61
- "tasks": {
62
- "type": "array",
63
- "items": {
64
- "type": "object",
65
- "properties": {
66
- "taskId": {
67
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
68
- },
69
- "intentId": {
70
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
71
- },
72
- "arguments": {
73
- "type": "object",
74
- "maxProperties": 16,
75
- "propertyNames": {
76
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
77
- },
78
- "additionalProperties": {
79
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/argument"
80
- }
81
- },
82
- "priority": {
83
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/priority"
84
- },
85
- "dependsOnTaskIds": {
86
- "type": "array",
87
- "items": {
88
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
89
- },
90
- "minItems": 0,
91
- "maxItems": 16,
92
- "uniqueItems": true
93
- },
94
- "explanation": {
95
- "type": "string",
96
- "minLength": 1,
97
- "maxLength": 500
98
- }
99
- },
100
- "required": [
101
- "taskId",
102
- "intentId",
103
- "arguments",
104
- "priority",
105
- "dependsOnTaskIds"
106
- ],
107
- "additionalProperties": false
108
- },
109
- "minItems": 0,
110
- "maxItems": 16
111
- },
112
- "extensions": {
113
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/extensions"
114
- },
115
- "requiredExtensions": {
116
- "type": "array",
117
- "items": {
118
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/extensionName"
119
- },
120
- "minItems": 0,
121
- "maxItems": 16,
122
- "uniqueItems": true
123
- }
124
- },
125
- "required": [
126
- "schemaVersion",
127
- "kind",
128
- "binding",
129
- "correlationId",
130
- "planId",
131
- "requestId",
132
- "contextReportId",
133
- "contextRevision",
134
- "environmentRevision",
135
- "createdAt",
136
- "expiresAt",
137
- "horizon",
138
- "tasks"
139
- ],
140
- "additionalProperties": false
141
- },
142
- "decision": {
143
- "type": "object",
144
- "properties": {
145
- "schemaVersion": {
146
- "const": "draft-0.2.0"
147
- },
148
- "kind": {
149
- "const": "plan-decision"
150
- },
151
- "binding": {
152
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/binding"
153
- },
154
- "correlationId": {
155
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
156
- },
157
- "planId": {
158
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
159
- },
160
- "decisionId": {
161
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
162
- },
163
- "requestId": {
164
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
165
- },
166
- "contextRevision": {
167
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
168
- },
169
- "recordedAt": {
170
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/utc"
171
- },
172
- "status": {
173
- "enum": ["accepted", "partially-accepted", "rejected"]
174
- },
175
- "taskDecisions": {
176
- "type": "array",
177
- "items": {
178
- "type": "object",
179
- "properties": {
180
- "taskId": {
181
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
182
- },
183
- "decision": {
184
- "enum": ["accepted", "rejected"]
185
- },
186
- "reason": {
187
- "type": "string",
188
- "minLength": 1,
189
- "maxLength": 500
190
- }
191
- },
192
- "required": ["taskId", "decision"],
193
- "additionalProperties": false
194
- },
195
- "minItems": 0,
196
- "maxItems": 16
197
- },
198
- "extensions": {
199
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/extensions"
200
- },
201
- "requiredExtensions": {
202
- "type": "array",
203
- "items": {
204
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/extensionName"
205
- },
206
- "minItems": 0,
207
- "maxItems": 16,
208
- "uniqueItems": true
209
- }
210
- },
211
- "required": [
212
- "schemaVersion",
213
- "kind",
214
- "binding",
215
- "correlationId",
216
- "planId",
217
- "decisionId",
218
- "requestId",
219
- "contextRevision",
220
- "recordedAt",
221
- "status",
222
- "taskDecisions"
223
- ],
224
- "additionalProperties": false
225
- },
226
- "report": {
227
- "type": "object",
228
- "properties": {
229
- "schemaVersion": {
230
- "const": "draft-0.2.0"
231
- },
232
- "kind": {
233
- "const": "task-report"
234
- },
235
- "binding": {
236
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/binding"
237
- },
238
- "correlationId": {
239
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
240
- },
241
- "planId": {
242
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
243
- },
244
- "reportId": {
245
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
246
- },
247
- "taskId": {
248
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
249
- },
250
- "contextRevision": {
251
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
252
- },
253
- "recordedAt": {
254
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/utc"
255
- },
256
- "status": {
257
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/taskStatus"
258
- },
259
- "summary": {
260
- "type": "string",
261
- "minLength": 1,
262
- "maxLength": 1000
263
- },
264
- "observedEffects": {
265
- "type": "array",
266
- "items": {
267
- "type": "string",
268
- "minLength": 1,
269
- "maxLength": 500
270
- },
271
- "minItems": 0,
272
- "maxItems": 16
273
- },
274
- "nextContextReportId": {
275
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
276
- },
277
- "extensions": {
278
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/extensions"
279
- },
280
- "requiredExtensions": {
281
- "type": "array",
282
- "items": {
283
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/extensionName"
284
- },
285
- "minItems": 0,
286
- "maxItems": 16,
287
- "uniqueItems": true
288
- }
289
- },
290
- "required": [
291
- "schemaVersion",
292
- "kind",
293
- "binding",
294
- "correlationId",
295
- "planId",
296
- "reportId",
297
- "taskId",
298
- "contextRevision",
299
- "recordedAt",
300
- "status",
301
- "summary",
302
- "observedEffects"
303
- ],
304
- "additionalProperties": false
305
- },
306
- "cancelRequest": {
307
- "type": "object",
308
- "properties": {
309
- "schemaVersion": {
310
- "const": "draft-0.2.0"
311
- },
312
- "kind": {
313
- "const": "plan-cancel-request"
314
- },
315
- "binding": {
316
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/binding"
317
- },
318
- "correlationId": {
319
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
320
- },
321
- "planId": {
322
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
323
- },
324
- "cancellationId": {
325
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
326
- },
327
- "taskIds": {
328
- "type": "array",
329
- "items": {
330
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
331
- },
332
- "minItems": 1,
333
- "maxItems": 16,
334
- "uniqueItems": true
335
- },
336
- "requestedAt": {
337
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/utc"
338
- },
339
- "reason": {
340
- "type": "string",
341
- "minLength": 1,
342
- "maxLength": 500
343
- },
344
- "extensions": {
345
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/extensions"
346
- },
347
- "requiredExtensions": {
348
- "type": "array",
349
- "items": {
350
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/extensionName"
351
- },
352
- "minItems": 0,
353
- "maxItems": 16,
354
- "uniqueItems": true
355
- }
356
- },
357
- "required": [
358
- "schemaVersion",
359
- "kind",
360
- "binding",
361
- "correlationId",
362
- "planId",
363
- "cancellationId",
364
- "taskIds",
365
- "requestedAt",
366
- "reason"
367
- ],
368
- "additionalProperties": false
369
- },
370
- "cancelResult": {
371
- "type": "object",
372
- "properties": {
373
- "schemaVersion": {
374
- "const": "draft-0.2.0"
375
- },
376
- "kind": {
377
- "const": "plan-cancel-result"
378
- },
379
- "binding": {
380
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/binding"
381
- },
382
- "correlationId": {
383
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
384
- },
385
- "planId": {
386
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
387
- },
388
- "cancellationId": {
389
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
390
- },
391
- "recordedAt": {
392
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/utc"
393
- },
394
- "taskResults": {
395
- "type": "array",
396
- "items": {
397
- "type": "object",
398
- "properties": {
399
- "taskId": {
400
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/id"
401
- },
402
- "status": {
403
- "enum": ["cancelled", "already-finished", "rejected", "unknown"]
404
- },
405
- "reason": {
406
- "type": "string",
407
- "minLength": 1,
408
- "maxLength": 500
409
- }
410
- },
411
- "required": ["taskId", "status"],
412
- "additionalProperties": false
413
- },
414
- "minItems": 1,
415
- "maxItems": 16
416
- },
417
- "extensions": {
418
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/extensions"
419
- },
420
- "requiredExtensions": {
421
- "type": "array",
422
- "items": {
423
- "$ref": "urn:ifsoul:protocol:draft-0.2.0:common#/$defs/extensionName"
424
- },
425
- "minItems": 0,
426
- "maxItems": 16,
427
- "uniqueItems": true
428
- }
429
- },
430
- "required": [
431
- "schemaVersion",
432
- "kind",
433
- "binding",
434
- "correlationId",
435
- "planId",
436
- "cancellationId",
437
- "recordedAt",
438
- "taskResults"
439
- ],
440
- "additionalProperties": false
441
- }
442
- }
443
- }
@@ -1,74 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "urn:ifsoul:protocol:draft-0.1.0:world-event",
4
- "type": "object",
5
- "properties": {
6
- "schemaVersion": {
7
- "const": "draft-0.1.0"
8
- },
9
- "kind": {
10
- "const": "world-event"
11
- },
12
- "eventId": {
13
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/id"
14
- },
15
- "adapterId": {
16
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/id"
17
- },
18
- "worldId": {
19
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/id"
20
- },
21
- "sessionId": {
22
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/id"
23
- },
24
- "sourceSequence": {
25
- "type": "integer",
26
- "minimum": 0,
27
- "maximum": 9007199254740991
28
- },
29
- "recordedAt": {
30
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/utcTimestamp"
31
- },
32
- "worldTime": {
33
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/worldTime"
34
- },
35
- "scope": {
36
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/scope"
37
- },
38
- "type": {
39
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/id"
40
- },
41
- "payload": {
42
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/jsonObject"
43
- },
44
- "actionId": {
45
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/id"
46
- },
47
- "extensions": {
48
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/extensions"
49
- },
50
- "requiredExtensions": {
51
- "type": "array",
52
- "items": {
53
- "$ref": "urn:ifsoul:protocol:draft-0.1.0:common#/$defs/extensionName"
54
- },
55
- "minItems": 0,
56
- "uniqueItems": true
57
- }
58
- },
59
- "required": [
60
- "schemaVersion",
61
- "kind",
62
- "eventId",
63
- "adapterId",
64
- "worldId",
65
- "sessionId",
66
- "sourceSequence",
67
- "recordedAt",
68
- "worldTime",
69
- "scope",
70
- "type",
71
- "payload"
72
- ],
73
- "additionalProperties": false
74
- }
@@ -1,84 +0,0 @@
1
- # Character and archive contracts
2
-
3
- Historical v0.1 contract. See [v0.2](../v0.2/README.md) for the current design;
4
- the v0.1 JSON examples remain unchanged for regression checks.
5
-
6
- A template is reusable authored material; an instance is an individual portable
7
- character with separately referenced history. Importing a template MUST NOT
8
- silently import a person's conversations, memories, relationships, owner
9
- identity, or provider configuration. Closed template fields reject history.
10
- Template edits create a new positive integer `revision`; existing instance
11
- profiles do not automatically change when a template changes.
12
-
13
- | Document | Required fields beyond `schemaVersion`, `kind` |
14
- | ----------------- | --------------------------------------------------------------------------------- |
15
- | CharacterTemplate | `templateId`, `revision`, `profile`, `provenance` |
16
- | CharacterInstance | `characterId`, `createdAt`, `profile`, `historyEventIds`, `relationshipMemoryIds` |
17
- | Archive manifest | `archiveVersion`, `archiveId`, `createdAt`, `schemaVersions`, `files`, `filter` |
18
-
19
- `profile` contains `name`, `description`, and `traits` (a map of simple strings,
20
- numbers, or booleans). A template's `provenance` requires nonempty `authors` and
21
- `license`; an optional `source` describes origin. These are claims to verify,
22
- not automatic proof of rights. An instance's optional `template` is an exact
23
- `templateId` + `revision` reference, not inheritance or a remote fetch request.
24
- `historyEventIds` refer to its memory events; `relationshipMemoryIds` refer to
25
- its derived records whose payload type is `relationship`. An empty array means
26
- there are no referenced records at that snapshot, not that a deleted history
27
- can be reconstructed.
28
-
29
- Preferences and goals may be represented as explicitly documented traits or
30
- namespaced extensions in this small baseline. Experience is represented by
31
- memory events and derived summaries; dedicated preference, goal, skill, or
32
- experience fields are deferred. A consumer MUST preserve unknown optional
33
- extensions or declare losses; it MUST NOT flatten richer input into this profile
34
- and silently discard unsupported state. Profile text does not grant permissions.
35
-
36
- ## Archive manifest
37
-
38
- The manifest describes files; it is not an importer, container format, database,
39
- or encryption scheme. `archiveVersion` versions the archive layout independently
40
- of wire `schemaVersion`, even though both are `draft-0.1.0` now.
41
- `schemaVersions.protocol` declares the contract baseline used. Every file entry
42
- contains a safe relative `path`, `role`, `schemaId`, lowercase hexadecimal
43
- `sha256`, and nonnegative `sizeBytes`. SHA-256 covers the exact uncompressed file
44
- bytes, not a canonicalized JSON document. The manifest does not list itself.
45
-
46
- The draft exchange layout uses one UTF-8 JSON document for template and instance
47
- files, and UTF-8 JSONL for event/derived streams (one complete document per
48
- nonempty line). Roles map to the `character-template`, `character-instance`,
49
- `memory-event`, and `derived-memory` schema IDs respectively. Extension files
50
- require their explicitly declared schema ID and reader support. This draft's
51
- schema-ID pattern only admits baseline URNs; a new external extension file schema
52
- requires a later agreed contract. Optional extension data can already live in
53
- ordinary document `extensions`.
54
-
55
- A future importer MUST independently check:
56
-
57
- - Every listed file exists, matches its exact byte count/checksum, has the
58
- declared role/schema combination, and validates before use.
59
- - Paths are unique and confined to the extraction root after normalization;
60
- platform case collisions, symlinks, archive entries absent from the manifest,
61
- decompression bombs, and oversized files are rejected. The schema's restricted
62
- ASCII path syntax is only the first check. No absolute paths or `..` segments
63
- are accepted.
64
- - Referenced templates, instances, events, and derived records exist and have
65
- consistent identities, or the filtered manifest explicitly declares external
66
- references. Dangling references are not silently invented or discarded.
67
-
68
- `filter` always contains `mode`, `omittedCategories`, `reasons`, and
69
- `externalReferences`. `private-backup` means all data the exporter is authorized
70
- to back up is included: omitted categories and reasons MUST be empty and
71
- external references MUST be `none`. It is not a bypass of consent or access
72
- restrictions. If any selected data cannot be included, use `filtered`, record
73
- categories and nonempty reasons, and set `externalReferences: "present"` when
74
- remaining provenance points outside the archive. That flag declares incomplete
75
- closure, not authority to fetch data or expose omitted private IDs.
76
-
77
- Keys, secrets, owner addresses, provider configuration, and access tokens are
78
- outside this archive contract. Checksums detect changed bytes; they do not
79
- identify a trusted author. Import/export, deletion propagation, migrations,
80
- round-trip guarantees, and archive size limits remain unimplemented.
81
-
82
- Positive examples: [template](examples/character-template.json),
83
- [instance](examples/character-instance.json), [manifest](examples/archive-manifest.json).
84
- The manifest's two sibling files form a synthetic initial snapshot.
@@ -1,32 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.1.0",
3
- "kind": "archive-manifest",
4
- "archiveVersion": "draft-0.1.0",
5
- "archiveId": "archive-mira-initial",
6
- "createdAt": "2026-01-01T12:00:00Z",
7
- "schemaVersions": {
8
- "protocol": "draft-0.1.0"
9
- },
10
- "files": [
11
- {
12
- "path": "character-template.json",
13
- "role": "template",
14
- "schemaId": "urn:ifsoul:protocol:draft-0.1.0:character-template",
15
- "sha256": "ce0aa4a3887f3618f4d31859d14f3bd348afdf318fb6f63beb7793e9deccc2ad",
16
- "sizeBytes": 466
17
- },
18
- {
19
- "path": "character-instance.json",
20
- "role": "instance",
21
- "schemaId": "urn:ifsoul:protocol:draft-0.1.0:character-instance",
22
- "sha256": "4964e8f042835743056b10045c7e0476cc0034ce517e42cfaee1727e415cc806",
23
- "sizeBytes": 475
24
- }
25
- ],
26
- "filter": {
27
- "mode": "private-backup",
28
- "omittedCategories": [],
29
- "reasons": [],
30
- "externalReferences": "none"
31
- }
32
- }
@@ -1,20 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.1.0",
3
- "kind": "character-instance",
4
- "characterId": "character-mira",
5
- "createdAt": "2026-01-01T12:00:00Z",
6
- "template": {
7
- "templateId": "mira-vale",
8
- "revision": 1
9
- },
10
- "profile": {
11
- "name": "Mira Vale",
12
- "description": "An original synthetic garden keeper who values patient observation.",
13
- "traits": {
14
- "curiosity": 0.7,
15
- "patience": "high"
16
- }
17
- },
18
- "historyEventIds": [],
19
- "relationshipMemoryIds": []
20
- }
@@ -1,19 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.1.0",
3
- "kind": "character-template",
4
- "templateId": "mira-vale",
5
- "revision": 1,
6
- "profile": {
7
- "name": "Mira Vale",
8
- "description": "An original synthetic garden keeper who values patient observation.",
9
- "traits": {
10
- "curiosity": 0.7,
11
- "patience": "high"
12
- }
13
- },
14
- "provenance": {
15
- "authors": ["IfSoul contributors"],
16
- "license": "Apache-2.0",
17
- "source": "Original synthetic bootstrap example"
18
- }
19
- }