@ifsoul/core 0.3.0 → 0.4.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 (137) hide show
  1. package/README.md +28 -34
  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/index.js +1 -1
  8. package/package.json +2 -3
  9. package/packages/protocol/schemas/current/archive.schema.json +16 -16
  10. package/packages/protocol/schemas/current/character.schema.json +21 -21
  11. package/packages/protocol/schemas/current/common.schema.json +15 -15
  12. package/packages/protocol/schemas/current/context.schema.json +24 -24
  13. package/packages/protocol/schemas/current/conversation.schema.json +39 -39
  14. package/packages/protocol/schemas/current/environment.schema.json +18 -18
  15. package/packages/protocol/schemas/current/memory.schema.json +66 -66
  16. package/packages/protocol/schemas/current/model-provider.schema.json +40 -40
  17. package/packages/protocol/schemas/current/planning.schema.json +61 -61
  18. package/packages/protocol/schemas/current/provider-common.schema.json +6 -6
  19. package/release.json +7 -12
  20. package/specs/README.md +3 -86
  21. package/specs/current/README.md +3 -5
  22. package/specs/current/examples/archive-fork.json +12 -12
  23. package/specs/current/examples/archive-resume.json +12 -12
  24. package/specs/current/examples/character-instance.json +1 -1
  25. package/specs/current/examples/character-template.json +1 -1
  26. package/specs/current/examples/context-after-inspection.json +1 -1
  27. package/specs/current/examples/context-chat.json +1 -1
  28. package/specs/current/examples/context-daily.json +1 -1
  29. package/specs/current/examples/context-no-speech.json +1 -1
  30. package/specs/current/examples/conversation-delivery.json +1 -1
  31. package/specs/current/examples/conversation-live-request.json +1 -1
  32. package/specs/current/examples/conversation-live-response.json +1 -1
  33. package/specs/current/examples/conversation-no-speech-request.json +1 -1
  34. package/specs/current/examples/conversation-no-speech-response.json +1 -1
  35. package/specs/current/examples/conversation-requested-request.json +1 -1
  36. package/specs/current/examples/conversation-requested-response.json +1 -1
  37. package/specs/current/examples/environment-chat.json +1 -1
  38. package/specs/current/examples/environment-game.json +1 -1
  39. package/specs/current/examples/environment-no-speech.json +1 -1
  40. package/specs/current/examples/intent-checkpoint.json +1 -1
  41. package/specs/current/examples/memory-episode.json +1 -1
  42. package/specs/current/examples/memory-event-conversation.json +1 -1
  43. package/specs/current/examples/memory-event-observed.json +2 -2
  44. package/specs/current/examples/memory-event-plan-proposal.json +2 -2
  45. package/specs/current/examples/memory-event-proposed.json +2 -2
  46. package/specs/current/examples/memory-fact.json +1 -1
  47. package/specs/current/examples/memory-relationship.json +1 -1
  48. package/specs/current/examples/memory-working-context.json +1 -1
  49. package/specs/current/examples/plan-cancel-request.json +1 -1
  50. package/specs/current/examples/plan-cancel-result.json +1 -1
  51. package/specs/current/examples/plan-daily.json +1 -1
  52. package/specs/current/examples/plan-partial-decision.json +1 -1
  53. package/specs/current/examples/portable-memory.jsonl +9 -9
  54. package/specs/current/examples/task-outcome.json +1 -1
  55. package/specs/current/examples/task-progress.json +1 -1
  56. package/specs/current/model-provider/examples/capabilities.json +1 -1
  57. package/specs/current/model-provider/examples/error.json +1 -1
  58. package/specs/current/model-provider/examples/request.json +1 -1
  59. package/specs/current/model-provider/examples/response.json +1 -1
  60. package/docs/npm-publishing.md +0 -44
  61. package/packages/protocol/schemas/action-result.schema.json +0 -187
  62. package/packages/protocol/schemas/action.schema.json +0 -68
  63. package/packages/protocol/schemas/archive-manifest.schema.json +0 -126
  64. package/packages/protocol/schemas/capability.schema.json +0 -131
  65. package/packages/protocol/schemas/character-instance.schema.json +0 -73
  66. package/packages/protocol/schemas/character-template.schema.json +0 -67
  67. package/packages/protocol/schemas/common.schema.json +0 -154
  68. package/packages/protocol/schemas/derived-memory.schema.json +0 -145
  69. package/packages/protocol/schemas/memory-event.schema.json +0 -123
  70. package/packages/protocol/schemas/model-provider.schema.json +0 -326
  71. package/packages/protocol/schemas/perception.schema.json +0 -89
  72. package/packages/protocol/schemas/permission-policy.schema.json +0 -153
  73. package/packages/protocol/schemas/v0.2/archive.schema.json +0 -205
  74. package/packages/protocol/schemas/v0.2/character.schema.json +0 -344
  75. package/packages/protocol/schemas/v0.2/common.schema.json +0 -239
  76. package/packages/protocol/schemas/v0.2/context.schema.json +0 -230
  77. package/packages/protocol/schemas/v0.2/conversation.schema.json +0 -340
  78. package/packages/protocol/schemas/v0.2/environment.schema.json +0 -244
  79. package/packages/protocol/schemas/v0.2/memory.schema.json +0 -495
  80. package/packages/protocol/schemas/v0.2/planning.schema.json +0 -443
  81. package/packages/protocol/schemas/world-event.schema.json +0 -74
  82. package/specs/character/README.md +0 -84
  83. package/specs/character/examples/archive-manifest.json +0 -32
  84. package/specs/character/examples/character-instance.json +0 -20
  85. package/specs/character/examples/character-template.json +0 -19
  86. package/specs/memory/README.md +0 -80
  87. package/specs/memory/examples/derived-memory.json +0 -21
  88. package/specs/memory/examples/memory-event.json +0 -35
  89. package/specs/model-provider/README.md +0 -85
  90. package/specs/model-provider/examples/capabilities.json +0 -10
  91. package/specs/model-provider/examples/error.json +0 -18
  92. package/specs/model-provider/examples/request.json +0 -17
  93. package/specs/model-provider/examples/response.json +0 -19
  94. package/specs/v0.2/README.md +0 -421
  95. package/specs/v0.2/examples/archive-fork.json +0 -64
  96. package/specs/v0.2/examples/archive-resume.json +0 -63
  97. package/specs/v0.2/examples/character-instance.json +0 -57
  98. package/specs/v0.2/examples/character-template.json +0 -45
  99. package/specs/v0.2/examples/context-after-inspection.json +0 -44
  100. package/specs/v0.2/examples/context-chat.json +0 -27
  101. package/specs/v0.2/examples/context-daily.json +0 -69
  102. package/specs/v0.2/examples/context-no-speech.json +0 -27
  103. package/specs/v0.2/examples/conversation-delivery.json +0 -17
  104. package/specs/v0.2/examples/conversation-live-request.json +0 -31
  105. package/specs/v0.2/examples/conversation-live-response.json +0 -23
  106. package/specs/v0.2/examples/conversation-no-speech-request.json +0 -23
  107. package/specs/v0.2/examples/conversation-no-speech-response.json +0 -22
  108. package/specs/v0.2/examples/conversation-requested-request.json +0 -31
  109. package/specs/v0.2/examples/conversation-requested-response.json +0 -23
  110. package/specs/v0.2/examples/environment-chat.json +0 -43
  111. package/specs/v0.2/examples/environment-game.json +0 -80
  112. package/specs/v0.2/examples/environment-no-speech.json +0 -47
  113. package/specs/v0.2/examples/intent-checkpoint.json +0 -29
  114. package/specs/v0.2/examples/memory-episode.json +0 -28
  115. package/specs/v0.2/examples/memory-event-conversation.json +0 -32
  116. package/specs/v0.2/examples/memory-event-observed.json +0 -50
  117. package/specs/v0.2/examples/memory-event-plan-proposal.json +0 -82
  118. package/specs/v0.2/examples/memory-event-proposed.json +0 -53
  119. package/specs/v0.2/examples/memory-fact.json +0 -23
  120. package/specs/v0.2/examples/memory-relationship.json +0 -25
  121. package/specs/v0.2/examples/memory-working-context.json +0 -24
  122. package/specs/v0.2/examples/plan-cancel-request.json +0 -16
  123. package/specs/v0.2/examples/plan-cancel-result.json +0 -21
  124. package/specs/v0.2/examples/plan-daily.json +0 -57
  125. package/specs/v0.2/examples/plan-partial-decision.json +0 -28
  126. package/specs/v0.2/examples/portable-memory.jsonl +0 -9
  127. package/specs/v0.2/examples/task-outcome.json +0 -21
  128. package/specs/v0.2/examples/task-progress.json +0 -19
  129. package/specs/world-adapter/README.md +0 -114
  130. package/specs/world-adapter/examples/action-result-unknown.json +0 -23
  131. package/specs/world-adapter/examples/action-result.json +0 -45
  132. package/specs/world-adapter/examples/action.json +0 -17
  133. package/specs/world-adapter/examples/capability.json +0 -44
  134. package/specs/world-adapter/examples/perception.json +0 -30
  135. package/specs/world-adapter/examples/permission-decision.json +0 -14
  136. package/specs/world-adapter/examples/permission-policy.json +0 -17
  137. package/specs/world-adapter/examples/world-event.json +0 -25
@@ -1,82 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "memory-event",
4
- "memoryId": "event-plan-proposal",
5
- "characterId": "character-mira",
6
- "recordedAt": "2026-01-01T08:03:00Z",
7
- "scope": {
8
- "audience": "private",
9
- "participantIds": ["participant-mira"],
10
- "export": "allowed"
11
- },
12
- "provenance": {
13
- "sources": [
14
- {
15
- "sourceType": "plan-proposal",
16
- "sourceId": "plan-day-1"
17
- }
18
- ]
19
- },
20
- "eventType": "plan-proposed",
21
- "summary": "A proposed plan included inspection and tending. A proposal is not accepted work or an observed effect.",
22
- "participantIds": ["participant-mira"],
23
- "environmentId": "garden",
24
- "sessionId": "garden-session-1",
25
- "recordedPayload": {
26
- "schemaVersion": "draft-0.2.0",
27
- "kind": "plan-proposal",
28
- "binding": {
29
- "environmentId": "garden",
30
- "sessionId": "garden-session-1",
31
- "characterId": "character-mira",
32
- "embodimentId": "gardener-1"
33
- },
34
- "correlationId": "daily-cycle-1",
35
- "planId": "plan-day-1",
36
- "requestId": "daily-request-1",
37
- "contextReportId": "briefing-day-1",
38
- "contextRevision": "context-100",
39
- "environmentRevision": "garden-profile-1",
40
- "createdAt": "2026-01-01T08:00:00Z",
41
- "expiresAt": "2026-01-01T08:05:00Z",
42
- "horizon": {
43
- "basis": "world-ticks",
44
- "timelineId": "garden-day-1",
45
- "fromTick": 100,
46
- "toTick": 600
47
- },
48
- "tasks": [
49
- {
50
- "taskId": "task-inspect",
51
- "intentId": "inspect-area",
52
- "arguments": {
53
- "area": {
54
- "type": "entity-ref",
55
- "entityId": "herb-area"
56
- }
57
- },
58
- "priority": "normal",
59
- "dependsOnTaskIds": [],
60
- "explanation": "Inspect before deciding whether further care is possible."
61
- },
62
- {
63
- "taskId": "task-tend",
64
- "intentId": "tend-plot",
65
- "arguments": {
66
- "plot": {
67
- "type": "entity-ref",
68
- "entityId": "plot-1"
69
- },
70
- "amount": {
71
- "type": "quantity",
72
- "value": 100,
73
- "unit": "ml"
74
- }
75
- },
76
- "priority": "low",
77
- "dependsOnTaskIds": ["task-inspect"],
78
- "explanation": "A conditional care proposal; the host can reject it when water is unavailable."
79
- }
80
- ]
81
- }
82
- }
@@ -1,53 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "memory-event",
4
- "memoryId": "event-plan-proposed",
5
- "characterId": "character-mira",
6
- "recordedAt": "2026-01-01T08:03:00Z",
7
- "scope": {
8
- "audience": "private",
9
- "participantIds": ["participant-mira"],
10
- "export": "allowed"
11
- },
12
- "provenance": {
13
- "sources": [
14
- {
15
- "sourceType": "plan-decision",
16
- "sourceId": "decision-day-1"
17
- }
18
- ]
19
- },
20
- "eventType": "plan-decision-observed",
21
- "summary": "Inspection was accepted and watering was rejected. Acceptance is not achievement.",
22
- "participantIds": ["participant-mira"],
23
- "environmentId": "garden",
24
- "sessionId": "garden-session-1",
25
- "recordedPayload": {
26
- "schemaVersion": "draft-0.2.0",
27
- "kind": "plan-decision",
28
- "binding": {
29
- "environmentId": "garden",
30
- "sessionId": "garden-session-1",
31
- "characterId": "character-mira",
32
- "embodimentId": "gardener-1"
33
- },
34
- "correlationId": "daily-cycle-1",
35
- "planId": "plan-day-1",
36
- "decisionId": "decision-day-1",
37
- "requestId": "daily-request-1",
38
- "contextRevision": "context-100",
39
- "recordedAt": "2026-01-01T08:00:00Z",
40
- "status": "partially-accepted",
41
- "taskDecisions": [
42
- {
43
- "taskId": "task-inspect",
44
- "decision": "accepted"
45
- },
46
- {
47
- "taskId": "task-tend",
48
- "decision": "rejected",
49
- "reason": "The existing host facility reports no available water."
50
- }
51
- ]
52
- }
53
- }
@@ -1,23 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "memory-fact",
4
- "memoryId": "fact-inspection",
5
- "characterId": "character-mira",
6
- "recordedAt": "2026-01-01T08:03:00Z",
7
- "scope": {
8
- "audience": "private",
9
- "participantIds": ["participant-mira"],
10
- "export": "allowed"
11
- },
12
- "provenance": {
13
- "sources": [
14
- {
15
- "sourceType": "memory",
16
- "sourceId": "event-inspection"
17
- }
18
- ]
19
- },
20
- "claim": "The host reported that two herb beds were inspected during this session.",
21
- "sourceMemoryIds": ["event-inspection"],
22
- "confidence": 0.9
23
- }
@@ -1,25 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "memory-relationship",
4
- "memoryId": "relationship-visitor",
5
- "characterId": "character-mira",
6
- "recordedAt": "2026-01-01T08:03:00Z",
7
- "scope": {
8
- "audience": "private",
9
- "participantIds": ["participant-mira"],
10
- "export": "allowed"
11
- },
12
- "provenance": {
13
- "sources": [
14
- {
15
- "sourceType": "conversation",
16
- "sourceId": "visitor-hello"
17
- }
18
- ]
19
- },
20
- "subjectParticipantId": "participant-mira",
21
- "objectParticipantId": "participant-visitor",
22
- "relation": "acquaintance",
23
- "description": "Mira recalls a synthetic visitor who asked about the garden.",
24
- "sourceMemoryIds": ["event-visitor-question"]
25
- }
@@ -1,24 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "working-context",
4
- "memoryId": "working-garden",
5
- "characterId": "character-mira",
6
- "recordedAt": "2026-01-01T08:03:00Z",
7
- "scope": {
8
- "audience": "private",
9
- "participantIds": ["participant-mira"],
10
- "export": "allowed"
11
- },
12
- "provenance": {
13
- "sources": [
14
- {
15
- "sourceType": "memory",
16
- "sourceId": "event-inspection"
17
- }
18
- ]
19
- },
20
- "summary": "Inspection was reported complete; actual watering was not reported.",
21
- "activeTopics": ["Finding an authorized source of water."],
22
- "relevantMemoryIds": ["event-inspection"],
23
- "expiresAt": "2026-01-02T08:00:00Z"
24
- }
@@ -1,16 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "plan-cancel-request",
4
- "binding": {
5
- "environmentId": "garden",
6
- "sessionId": "garden-session-1",
7
- "characterId": "character-mira",
8
- "embodimentId": "gardener-1"
9
- },
10
- "correlationId": "daily-cycle-1",
11
- "planId": "plan-day-1",
12
- "cancellationId": "cancel-inspect-1",
13
- "taskIds": ["task-inspect"],
14
- "requestedAt": "2026-01-01T08:00:45Z",
15
- "reason": "The host operator requested a stop."
16
- }
@@ -1,21 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "plan-cancel-result",
4
- "binding": {
5
- "environmentId": "garden",
6
- "sessionId": "garden-session-1",
7
- "characterId": "character-mira",
8
- "embodimentId": "gardener-1"
9
- },
10
- "correlationId": "daily-cycle-1",
11
- "planId": "plan-day-1",
12
- "cancellationId": "cancel-inspect-1",
13
- "recordedAt": "2026-01-01T08:01:01Z",
14
- "taskResults": [
15
- {
16
- "taskId": "task-inspect",
17
- "status": "already-finished",
18
- "reason": "The host completed inspection before cancellation could be confirmed."
19
- }
20
- ]
21
- }
@@ -1,57 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "plan-proposal",
4
- "binding": {
5
- "environmentId": "garden",
6
- "sessionId": "garden-session-1",
7
- "characterId": "character-mira",
8
- "embodimentId": "gardener-1"
9
- },
10
- "correlationId": "daily-cycle-1",
11
- "planId": "plan-day-1",
12
- "requestId": "daily-request-1",
13
- "contextReportId": "briefing-day-1",
14
- "contextRevision": "context-100",
15
- "environmentRevision": "garden-profile-1",
16
- "createdAt": "2026-01-01T08:00:00Z",
17
- "expiresAt": "2026-01-01T08:05:00Z",
18
- "horizon": {
19
- "basis": "world-ticks",
20
- "timelineId": "garden-day-1",
21
- "fromTick": 100,
22
- "toTick": 600
23
- },
24
- "tasks": [
25
- {
26
- "taskId": "task-inspect",
27
- "intentId": "inspect-area",
28
- "arguments": {
29
- "area": {
30
- "type": "entity-ref",
31
- "entityId": "herb-area"
32
- }
33
- },
34
- "priority": "normal",
35
- "dependsOnTaskIds": [],
36
- "explanation": "Inspect before deciding whether further care is possible."
37
- },
38
- {
39
- "taskId": "task-tend",
40
- "intentId": "tend-plot",
41
- "arguments": {
42
- "plot": {
43
- "type": "entity-ref",
44
- "entityId": "plot-1"
45
- },
46
- "amount": {
47
- "type": "quantity",
48
- "value": 100,
49
- "unit": "ml"
50
- }
51
- },
52
- "priority": "low",
53
- "dependsOnTaskIds": ["task-inspect"],
54
- "explanation": "A conditional care proposal; the host can reject it when water is unavailable."
55
- }
56
- ]
57
- }
@@ -1,28 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "plan-decision",
4
- "binding": {
5
- "environmentId": "garden",
6
- "sessionId": "garden-session-1",
7
- "characterId": "character-mira",
8
- "embodimentId": "gardener-1"
9
- },
10
- "correlationId": "daily-cycle-1",
11
- "planId": "plan-day-1",
12
- "decisionId": "decision-day-1",
13
- "requestId": "daily-request-1",
14
- "contextRevision": "context-100",
15
- "recordedAt": "2026-01-01T08:00:00Z",
16
- "status": "partially-accepted",
17
- "taskDecisions": [
18
- {
19
- "taskId": "task-inspect",
20
- "decision": "accepted"
21
- },
22
- {
23
- "taskId": "task-tend",
24
- "decision": "rejected",
25
- "reason": "The existing host facility reports no available water."
26
- }
27
- ]
28
- }
@@ -1,9 +0,0 @@
1
- {"schemaVersion":"draft-0.2.0","kind":"intent-checkpoint","memoryId":"checkpoint-initial","characterId":"character-mira","recordedAt":"2026-01-01T08:00:00Z","scope":{"audience":"private","participantIds":["participant-mira"],"export":"allowed"},"provenance":{"sources":[{"sourceType":"authored","sourceId":"template-mira-v2"}]},"intents":[{"portableIntentId":"learn-herb-care","description":"Learn to care for herbs when an environment supports it.","desiredOutcome":"Understand appropriate care through permitted experiences.","status":"pending","sourceMemoryIds":[]}]}
2
- {"schemaVersion":"draft-0.2.0","kind":"memory-event","memoryId":"event-inspection","characterId":"character-mira","recordedAt":"2026-01-01T08:03:00Z","scope":{"audience":"private","participantIds":["participant-mira"],"export":"allowed"},"provenance":{"sources":[{"sourceType":"host-report","sourceId":"outcome-inspect-1"}]},"eventType":"host-reported-outcome","summary":"The host reported completed inspection. This does not claim the rejected watering task happened.","participantIds":["participant-mira"],"environmentId":"garden","sessionId":"garden-session-1","worldTime":{"timelineId":"garden-day-1","tick":110},"recordedPayload":{"schemaVersion":"draft-0.2.0","kind":"task-report","binding":{"environmentId":"garden","sessionId":"garden-session-1","characterId":"character-mira","embodimentId":"gardener-1"},"correlationId":"daily-cycle-1","planId":"plan-day-1","reportId":"outcome-inspect-1","taskId":"task-inspect","contextRevision":"context-102","recordedAt":"2026-01-01T08:01:00Z","status":"succeeded","summary":"The host reports inspection completed.","observedEffects":["Two herb beds were inspected by the existing host facility."]}}
3
- {"schemaVersion":"draft-0.2.0","kind":"memory-event","memoryId":"event-visitor-question","characterId":"character-mira","recordedAt":"2026-01-01T08:03:00Z","scope":{"audience":"private","participantIds":["participant-mira"],"export":"allowed"},"provenance":{"sources":[{"sourceType":"conversation","sourceId":"visitor-hello"}]},"eventType":"received-conversation","summary":"A synthetic visitor asked Mira how the garden was doing.","participantIds":["participant-mira","participant-visitor"],"environmentId":"garden","sessionId":"garden-session-1","recordedPayload":{"messageId":"visitor-hello","participantId":"participant-visitor","recordedAt":"2026-01-01T08:02:00Z","modality":"speech","content":"How is the garden today?"}}
4
- {"schemaVersion":"draft-0.2.0","kind":"memory-event","memoryId":"event-plan-proposal","characterId":"character-mira","recordedAt":"2026-01-01T08:03:00Z","scope":{"audience":"private","participantIds":["participant-mira"],"export":"allowed"},"provenance":{"sources":[{"sourceType":"plan-proposal","sourceId":"plan-day-1"}]},"eventType":"plan-proposed","summary":"A proposed plan included inspection and tending. A proposal is not accepted work or an observed effect.","participantIds":["participant-mira"],"environmentId":"garden","sessionId":"garden-session-1","recordedPayload":{"schemaVersion":"draft-0.2.0","kind":"plan-proposal","binding":{"environmentId":"garden","sessionId":"garden-session-1","characterId":"character-mira","embodimentId":"gardener-1"},"correlationId":"daily-cycle-1","planId":"plan-day-1","requestId":"daily-request-1","contextReportId":"briefing-day-1","contextRevision":"context-100","environmentRevision":"garden-profile-1","createdAt":"2026-01-01T08:00:00Z","expiresAt":"2026-01-01T08:05:00Z","horizon":{"basis":"world-ticks","timelineId":"garden-day-1","fromTick":100,"toTick":600},"tasks":[{"taskId":"task-inspect","intentId":"inspect-area","arguments":{"area":{"type":"entity-ref","entityId":"herb-area"}},"priority":"normal","dependsOnTaskIds":[],"explanation":"Inspect before deciding whether further care is possible."},{"taskId":"task-tend","intentId":"tend-plot","arguments":{"plot":{"type":"entity-ref","entityId":"plot-1"},"amount":{"type":"quantity","value":100,"unit":"ml"}},"priority":"low","dependsOnTaskIds":["task-inspect"],"explanation":"A conditional care proposal; the host can reject it when water is unavailable."}]}}
5
- {"schemaVersion":"draft-0.2.0","kind":"memory-event","memoryId":"event-plan-proposed","characterId":"character-mira","recordedAt":"2026-01-01T08:03:00Z","scope":{"audience":"private","participantIds":["participant-mira"],"export":"allowed"},"provenance":{"sources":[{"sourceType":"plan-decision","sourceId":"decision-day-1"}]},"eventType":"plan-decision-observed","summary":"Inspection was accepted and watering was rejected. Acceptance is not achievement.","participantIds":["participant-mira"],"environmentId":"garden","sessionId":"garden-session-1","recordedPayload":{"schemaVersion":"draft-0.2.0","kind":"plan-decision","binding":{"environmentId":"garden","sessionId":"garden-session-1","characterId":"character-mira","embodimentId":"gardener-1"},"correlationId":"daily-cycle-1","planId":"plan-day-1","decisionId":"decision-day-1","requestId":"daily-request-1","contextRevision":"context-100","recordedAt":"2026-01-01T08:00:00Z","status":"partially-accepted","taskDecisions":[{"taskId":"task-inspect","decision":"accepted"},{"taskId":"task-tend","decision":"rejected","reason":"The existing host facility reports no available water."}]}}
6
- {"schemaVersion":"draft-0.2.0","kind":"working-context","memoryId":"working-garden","characterId":"character-mira","recordedAt":"2026-01-01T08:03:00Z","scope":{"audience":"private","participantIds":["participant-mira"],"export":"allowed"},"provenance":{"sources":[{"sourceType":"memory","sourceId":"event-inspection"}]},"summary":"Inspection was reported complete; actual watering was not reported.","activeTopics":["Finding an authorized source of water."],"relevantMemoryIds":["event-inspection"],"expiresAt":"2026-01-02T08:00:00Z"}
7
- {"schemaVersion":"draft-0.2.0","kind":"memory-episode","memoryId":"episode-garden","characterId":"character-mira","recordedAt":"2026-01-01T08:03:00Z","scope":{"audience":"private","participantIds":["participant-mira"],"export":"allowed"},"provenance":{"sources":[{"sourceType":"memory","sourceId":"event-inspection"}]},"summary":"Mira received the host report of an inspection.","sourceMemoryIds":["event-inspection"],"period":{"basis":"world-ticks","timelineId":"garden-day-1","fromTick":100,"toTick":110}}
8
- {"schemaVersion":"draft-0.2.0","kind":"memory-fact","memoryId":"fact-inspection","characterId":"character-mira","recordedAt":"2026-01-01T08:03:00Z","scope":{"audience":"private","participantIds":["participant-mira"],"export":"allowed"},"provenance":{"sources":[{"sourceType":"memory","sourceId":"event-inspection"}]},"claim":"The host reported that two herb beds were inspected during this session.","sourceMemoryIds":["event-inspection"],"confidence":0.9}
9
- {"schemaVersion":"draft-0.2.0","kind":"memory-relationship","memoryId":"relationship-visitor","characterId":"character-mira","recordedAt":"2026-01-01T08:03:00Z","scope":{"audience":"private","participantIds":["participant-mira"],"export":"allowed"},"provenance":{"sources":[{"sourceType":"conversation","sourceId":"visitor-hello"}]},"subjectParticipantId":"participant-mira","objectParticipantId":"participant-visitor","relation":"acquaintance","description":"Mira recalls a synthetic visitor who asked about the garden.","sourceMemoryIds":["event-visitor-question"]}
@@ -1,21 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "task-report",
4
- "binding": {
5
- "environmentId": "garden",
6
- "sessionId": "garden-session-1",
7
- "characterId": "character-mira",
8
- "embodimentId": "gardener-1"
9
- },
10
- "correlationId": "daily-cycle-1",
11
- "planId": "plan-day-1",
12
- "reportId": "outcome-inspect-1",
13
- "taskId": "task-inspect",
14
- "contextRevision": "context-102",
15
- "recordedAt": "2026-01-01T08:01:00Z",
16
- "status": "succeeded",
17
- "summary": "The host reports inspection completed.",
18
- "observedEffects": [
19
- "Two herb beds were inspected by the existing host facility."
20
- ]
21
- }
@@ -1,19 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.2.0",
3
- "kind": "task-report",
4
- "binding": {
5
- "environmentId": "garden",
6
- "sessionId": "garden-session-1",
7
- "characterId": "character-mira",
8
- "embodimentId": "gardener-1"
9
- },
10
- "correlationId": "daily-cycle-1",
11
- "planId": "plan-day-1",
12
- "reportId": "progress-inspect-1",
13
- "taskId": "task-inspect",
14
- "contextRevision": "context-101",
15
- "recordedAt": "2026-01-01T08:00:30Z",
16
- "status": "running",
17
- "summary": "The host NPC state machine is carrying out inspection.",
18
- "observedEffects": []
19
- }
@@ -1,114 +0,0 @@
1
- # WorldAdapter and authorization contracts
2
-
3
- Historical v0.1 contract. The [v0.2 design](../v0.2/README.md) uses host-owned
4
- planning/dialogue profiles. Do not interpret this legacy action vocabulary as
5
- authorization to implement NPC locomotion, combat or pathfinding in IfSoul bridges.
6
-
7
- WorldAdapter is a planned transport-independent boundary: negotiate versions,
8
- obtain capabilities, perceive an actor's available world, submit an action, and
9
- receive authoritative results/events. No adapter methods, transport, engine,
10
- network endpoint, or game integration are implemented by these schemas.
11
-
12
- | Envelope | Required fields beyond `schemaVersion`, `kind` |
13
- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
14
- | Capability set | `adapterId`, `worldId`, `sessionId`, `actorId`, `capabilityRevision`, `supportedSchemaVersions`, `capabilities` |
15
- | Perception | `observationId`, `adapterId`, `worldId`, `sessionId`, `observerId`, `observedAt`, `worldTime`, `observations` |
16
- | Action | `actionId`, `worldId`, `sessionId`, `actorId`, `capabilityId`, `capabilityRevision`, `arguments`, `requestedAt`, `deadlineAt` |
17
- | Action Result | `resultId`, `actionId`, `adapterId`, `worldId`, `sessionId`, `actorId`, `recordedAt`, `worldTime`, `status`, `execution`, `events` |
18
- | World Event | `eventId`, `adapterId`, `worldId`, `sessionId`, `sourceSequence`, `recordedAt`, `worldTime`, `scope`, `type`, `payload` |
19
- | Permission Policy | `policyId`, `revision`, `worldId`, `sessionId`, `rules` |
20
- | Permission Decision | `decisionId`, `policyId`, `policyRevision`, `worldId`, `sessionId`, `subjectId`, `resource`, `action`, `decision`, `evaluatedAt` |
21
-
22
- ## Capabilities, observations, and permission
23
-
24
- A capability describes what an adapter can attempt, not what a particular actor
25
- may do. Each entry contains `capabilityId`, `description`, `argumentsSchema`,
26
- `requiredPermissions`, `semantics`, and `idempotency`. `semantics.preconditions`
27
- and `semantics.possibleEffects` are human-readable descriptions, not executable
28
- code or proof that effects occurred. Capability IDs MUST be unique in a set.
29
- `capabilityRevision` identifies the exact set; a request using an obsolete or
30
- unsupported revision is rejected rather than reinterpreted.
31
-
32
- The consumer and adapter MUST select an explicitly shared schema version before
33
- exchanging actions. The bootstrap supports only `draft-0.1.0`; the supported
34
- version list is not a range parser or an implemented handshake. Identities MUST
35
- match the bound world, session, and actor; matching IDs from another context do
36
- not confer access.
37
-
38
- Perception is an explicitly limited observation: `observations` contains
39
- `subjectId`, `scope`, and open `payload` objects. Missing observations mean
40
- unknown, not false. Optional `availableCapabilityIds` is an advisory subset, not
41
- an authorization grant. Optional `worldRevision` can be carried back as the
42
- action's `observedWorldRevision`; the game decides whether it is still usable.
43
- World state can change after observation. An adapter MAY reject stale or newly
44
- invalid actions even when runtime previously allowed them.
45
-
46
- A Permission Policy is a synthetic declarative baseline. Rules match exact
47
- `subjectId`, `resource`, and `action` in the policy's world/session; no wildcard,
48
- inheritance, or free-text matching is defined. Each has a unique `ruleId` and
49
- `effect: "grant" | "revoke"`. Any matching revoke denies; otherwise a matching
50
- grant allows; no match denies. Revocation is represented in a new policy revision,
51
- not deletion of audit history. `resource` and `action` are opaque IDs resolved by
52
- trusted policy; a resource named in a payload cannot create authority.
53
-
54
- `requiredPermissions` lists prerequisites to check, not grants. Runtime MUST
55
- check authorization for the proposed operation, including current policy and
56
- scope; the adapter MUST independently check current game restrictions. An empty
57
- prerequisite list never bypasses those checks. A Permission Decision records an
58
- `allow` or `deny` for a policy revision at `evaluatedAt`; it is evidence, not a
59
- bearer token, and may already be stale. Neither an instance, model tool call,
60
- capability advertisement, observation, nor memory event can grant permissions.
61
-
62
- ## Execution, deadlines, and retries
63
-
64
- Action arguments MUST validate against the selected capability's separately
65
- validated JSON Schema. The adapter checks deadline and current preconditions
66
- before starting; expiry before starting yields rejection. Once execution might
67
- have started, a timeout or cancellation MUST NOT be treated as proof of failure.
68
- `deadlineAt` requests a bound on starting/waiting; it does not roll back the world.
69
- This draft has no cancellation message; a future transport must distinguish
70
- cancelling a wait from confirmed prevention of execution.
71
-
72
- | `status` | `execution` | Meaning |
73
- | ---------- | -------------------------- | -------------------------------------------------------------------------------------------- |
74
- | `success` | `completed` | The requested operation completed; no `error` |
75
- | `rejected` | `not-started` | Validation, authorization, deadline, or current-world rejection; requires `error`, no events |
76
- | `failed` | `not-started` or `partial` | Authoritative execution failure; requires `error`; no events when not started |
77
- | `unknown` | `unknown` | Execution cannot be determined; requires `error.retry: "reconcile-first"` |
78
-
79
- `events` contains only actual reported effects of this action, never predicted
80
- or unrelated events. Empty events do not prove no effect. Correlation across all
81
- nested events MUST match the result's world/session/adapter/action; unique event
82
- IDs, source-local `sourceSequence`, and optional `worldRevision` need semantic
83
- checks. Only the adapter/game is authoritative about execution. A `resultId`
84
- identifies one reported result; the same action can later have a distinct
85
- reconciled result. Consumers deduplicate facts by event ID and retain provenance.
86
-
87
- Errors contain `code`, safe human-readable `message`, and `retry`, plus optional
88
- `retryAfterMs`. Retry values mean `never`, `after-correction`, `same-request`, or
89
- `reconcile-first`; they are guidance subject to current authorization and
90
- idempotency. A not-started operation can be retried when the cause is corrected.
91
- A failed partial operation requires reconciliation before another attempt,
92
- regardless of a generic retry hint.
93
-
94
- For `idempotency: "none"`, automatic resubmission after possible execution is
95
- forbidden. For `action-id`, the adapter promises duplicate submissions with the
96
- same action ID and identical arguments/context will not execute again for the
97
- **bound session**; it MUST retain reconciliation information throughout that
98
- session and reject changed input under that ID. No guarantee survives an
99
- unnegotiated session change. The baseline has no persistent deduplication store.
100
- Retrying an unknown result requires querying/reconciling with the authoritative
101
- adapter first; if that is unavailable, preserve unknown and require an explicit
102
- recovery decision. Neither a fresh action ID nor repeated transport delivery
103
- guarantees exactly-once execution.
104
-
105
- World events are source facts with access scope; an observer's Memory Event
106
- records only what that observer was allowed to receive. Tick order applies only
107
- to one timeline, and event sequence only to one adapter/world/session stream.
108
-
109
- Positive examples: [capabilities](examples/capability.json),
110
- [perception](examples/perception.json), [policy](examples/permission-policy.json),
111
- [decision](examples/permission-decision.json), [action](examples/action.json),
112
- [success](examples/action-result.json), [unknown result](examples/action-result-unknown.json),
113
- [world event](examples/world-event.json). The unknown result is an alternative
114
- transport outcome for the example action, not a second execution.
@@ -1,23 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.1.0",
3
- "kind": "action-result",
4
- "resultId": "result-water-unknown",
5
- "actionId": "action-water-1",
6
- "adapterId": "synthetic-garden",
7
- "worldId": "garden",
8
- "sessionId": "session-1",
9
- "actorId": "actor-mira",
10
- "recordedAt": "2026-01-01T12:00:00Z",
11
- "worldTime": {
12
- "timelineId": "garden-day-1",
13
- "tick": 20
14
- },
15
- "status": "unknown",
16
- "execution": "unknown",
17
- "events": [],
18
- "error": {
19
- "code": "timeout",
20
- "message": "The transport closed before an authoritative result arrived.",
21
- "retry": "reconcile-first"
22
- }
23
- }
@@ -1,45 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.1.0",
3
- "kind": "action-result",
4
- "resultId": "result-water-1",
5
- "actionId": "action-water-1",
6
- "adapterId": "synthetic-garden",
7
- "worldId": "garden",
8
- "sessionId": "session-1",
9
- "actorId": "actor-mira",
10
- "recordedAt": "2026-01-01T12:00:00Z",
11
- "worldTime": {
12
- "timelineId": "garden-day-1",
13
- "tick": 20
14
- },
15
- "status": "success",
16
- "execution": "completed",
17
- "events": [
18
- {
19
- "schemaVersion": "draft-0.1.0",
20
- "kind": "world-event",
21
- "eventId": "world-event-water-1",
22
- "adapterId": "synthetic-garden",
23
- "worldId": "garden",
24
- "sessionId": "session-1",
25
- "sourceSequence": 1,
26
- "recordedAt": "2026-01-01T12:00:00Z",
27
- "worldTime": {
28
- "timelineId": "garden-day-1",
29
- "tick": 20
30
- },
31
- "scope": {
32
- "audience": "private",
33
- "subjectIds": ["actor-mira"],
34
- "export": "allowed"
35
- },
36
- "type": "plant-watered",
37
- "payload": {
38
- "plantId": "plant-1",
39
- "amountMl": 100
40
- },
41
- "actionId": "action-water-1"
42
- }
43
- ],
44
- "worldRevision": "revision-20"
45
- }
@@ -1,17 +0,0 @@
1
- {
2
- "schemaVersion": "draft-0.1.0",
3
- "kind": "action",
4
- "actionId": "action-water-1",
5
- "worldId": "garden",
6
- "sessionId": "session-1",
7
- "actorId": "actor-mira",
8
- "capabilityId": "water-plant",
9
- "capabilityRevision": "capabilities-1",
10
- "arguments": {
11
- "plantId": "plant-1",
12
- "amountMl": 100
13
- },
14
- "requestedAt": "2026-01-01T12:00:00Z",
15
- "deadlineAt": "2026-01-01T12:00:05Z",
16
- "observedWorldRevision": "revision-19"
17
- }