attention-manifest-protocol 0.4.3 → 0.4.4
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/docs/schemas/collaboration.schema.json +73 -0
- package/docs/schemas/common.schema.json +125 -0
- package/docs/schemas/compaction.schema.json +121 -0
- package/docs/schemas/concept-compaction.schema.json +73 -0
- package/docs/schemas/concept.schema.json +97 -0
- package/docs/schemas/epistemic.schema.json +178 -0
- package/docs/schemas/federation.schema.json +66 -0
- package/docs/schemas/frame.schema.json +86 -0
- package/docs/schemas/ledger-snapshot.schema.json +30 -0
- package/docs/schemas/manifest.schema.json +169 -0
- package/docs/schemas/message.schema.json +41 -0
- package/docs/schemas/plan.schema.json +189 -0
- package/docs/schemas/receipt.schema.json +45 -0
- package/docs/schemas/social.schema.json +153 -0
- package/docs/schemas/team.schema.json +56 -0
- package/docs/schemas/verb.schema.json +120 -0
- package/lib/context/workspaceProtocol.d.ts +30 -0
- package/lib/context/workspaceProtocol.js +49 -0
- package/package.json +1 -1
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://amp.dev/schema/0.1/plan.schema.json",
|
|
4
|
+
"title": "AMP planning objects (goal | process | plan)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"type": "object",
|
|
9
|
+
"required": ["amp", "kind", "id", "statement", "success", "value", "priority"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"amp": { "const": "0.1" },
|
|
12
|
+
"kind": { "const": "goal" },
|
|
13
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
14
|
+
"statement": { "type": "string", "minLength": 1 },
|
|
15
|
+
"success": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"minItems": 1,
|
|
18
|
+
"items": { "$ref": "common.schema.json#/$defs/criterion" }
|
|
19
|
+
},
|
|
20
|
+
"value": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
21
|
+
"priority": { "type": "integer", "minimum": 0 },
|
|
22
|
+
"deadline": { "$ref": "common.schema.json#/$defs/ts" },
|
|
23
|
+
"horizon": { "type": "string", "enum": ["task", "session", "long"] }
|
|
24
|
+
},
|
|
25
|
+
"additionalProperties": false
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": ["amp", "kind", "id", "label", "purpose", "actors", "stages", "invariants", "confidence", "provenance"],
|
|
30
|
+
"properties": {
|
|
31
|
+
"amp": { "const": "0.1" },
|
|
32
|
+
"kind": { "const": "process" },
|
|
33
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
34
|
+
"label": { "type": "string", "minLength": 1 },
|
|
35
|
+
"purpose": { "type": "string", "minLength": 1 },
|
|
36
|
+
"actors": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"minItems": 1,
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"required": ["kind", "id"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"kind": { "type": "string", "enum": ["human", "agent", "tool"] },
|
|
44
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
45
|
+
"permissions": { "type": "array", "items": { "type": "string" } }
|
|
46
|
+
},
|
|
47
|
+
"additionalProperties": false
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"stages": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"minItems": 1,
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"required": ["id", "actor", "action"],
|
|
56
|
+
"properties": {
|
|
57
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
58
|
+
"actor": { "$ref": "common.schema.json#/$defs/id" },
|
|
59
|
+
"action": { "type": "string" },
|
|
60
|
+
"consumes": { "type": "string" },
|
|
61
|
+
"produces": { "type": "string" }
|
|
62
|
+
},
|
|
63
|
+
"additionalProperties": false
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"invariants": { "type": "array", "items": { "type": "string" } },
|
|
67
|
+
"observability": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"required": ["stage", "signal", "where"],
|
|
72
|
+
"properties": {
|
|
73
|
+
"stage": { "$ref": "common.schema.json#/$defs/id" },
|
|
74
|
+
"signal": { "type": "string" },
|
|
75
|
+
"where": { "type": "string" }
|
|
76
|
+
},
|
|
77
|
+
"additionalProperties": false
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"failure_modes": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": ["mode", "signal", "discriminating_test", "mitigation"],
|
|
85
|
+
"properties": {
|
|
86
|
+
"mode": { "type": "string" },
|
|
87
|
+
"signal": { "type": "string" },
|
|
88
|
+
"discriminating_test": { "type": "string" },
|
|
89
|
+
"mitigation": { "type": "string" }
|
|
90
|
+
},
|
|
91
|
+
"additionalProperties": false
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"causal_edges": {
|
|
95
|
+
"type": "array",
|
|
96
|
+
"items": {
|
|
97
|
+
"type": "array",
|
|
98
|
+
"minItems": 2,
|
|
99
|
+
"maxItems": 2,
|
|
100
|
+
"items": { "type": "string" }
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"unknowns": { "type": "array", "items": { "type": "string" } },
|
|
104
|
+
"confidence": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
105
|
+
"provenance": { "$ref": "common.schema.json#/$defs/provenance" }
|
|
106
|
+
},
|
|
107
|
+
"additionalProperties": false
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"type": "object",
|
|
111
|
+
"required": ["amp", "kind", "id", "goal", "tasks", "edges", "commitment_window", "budget", "abandon_if", "status", "created"],
|
|
112
|
+
"properties": {
|
|
113
|
+
"amp": { "const": "0.1" },
|
|
114
|
+
"kind": { "const": "plan" },
|
|
115
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
116
|
+
"goal": { "$ref": "common.schema.json#/$defs/ref" },
|
|
117
|
+
"process": { "$ref": "common.schema.json#/$defs/ref" },
|
|
118
|
+
"tasks": {
|
|
119
|
+
"type": "array",
|
|
120
|
+
"minItems": 1,
|
|
121
|
+
"maxItems": 12,
|
|
122
|
+
"items": {
|
|
123
|
+
"type": "object",
|
|
124
|
+
"required": ["id", "intent", "actor", "pre", "expect", "irreversibility", "status"],
|
|
125
|
+
"properties": {
|
|
126
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
127
|
+
"intent": { "type": "string", "minLength": 1 },
|
|
128
|
+
"actor": { "type": "string", "enum": ["self", "tool", "other"] },
|
|
129
|
+
"ref": { "$ref": "common.schema.json#/$defs/ref" },
|
|
130
|
+
"pre": { "type": "array", "items": { "type": "string" } },
|
|
131
|
+
"expect": {
|
|
132
|
+
"type": "object",
|
|
133
|
+
"required": ["observation", "check"],
|
|
134
|
+
"properties": {
|
|
135
|
+
"observation": { "type": "string" },
|
|
136
|
+
"check": { "type": "string" }
|
|
137
|
+
},
|
|
138
|
+
"additionalProperties": false
|
|
139
|
+
},
|
|
140
|
+
"irreversibility": { "type": "integer", "minimum": 0, "maximum": 3 },
|
|
141
|
+
"budget": { "$ref": "common.schema.json#/$defs/budget" },
|
|
142
|
+
"status": { "type": "string", "enum": ["pending", "running", "done", "failed", "skipped"] }
|
|
143
|
+
},
|
|
144
|
+
"additionalProperties": false
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"edges": {
|
|
148
|
+
"type": "array",
|
|
149
|
+
"items": {
|
|
150
|
+
"type": "array",
|
|
151
|
+
"minItems": 2,
|
|
152
|
+
"maxItems": 2,
|
|
153
|
+
"items": { "type": "string" }
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"commitment_window": { "type": "integer", "minimum": 1, "maximum": 5 },
|
|
157
|
+
"budget": { "$ref": "common.schema.json#/$defs/budget" },
|
|
158
|
+
"abandon_if": {
|
|
159
|
+
"type": "array",
|
|
160
|
+
"minItems": 1,
|
|
161
|
+
"items": { "$ref": "common.schema.json#/$defs/criterion" }
|
|
162
|
+
},
|
|
163
|
+
"monitor": {
|
|
164
|
+
"type": "object",
|
|
165
|
+
"properties": {
|
|
166
|
+
"triggers": {
|
|
167
|
+
"type": "array",
|
|
168
|
+
"items": {
|
|
169
|
+
"type": "object",
|
|
170
|
+
"required": ["when", "action"],
|
|
171
|
+
"properties": {
|
|
172
|
+
"when": { "type": "string" },
|
|
173
|
+
"action": { "type": "string", "enum": ["retry", "adjust", "recompose", "replan", "abandon"] }
|
|
174
|
+
},
|
|
175
|
+
"additionalProperties": false
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"additionalProperties": false
|
|
180
|
+
},
|
|
181
|
+
"rollback": { "type": "string" },
|
|
182
|
+
"warrant": { "$ref": "common.schema.json#/$defs/ref" },
|
|
183
|
+
"status": { "type": "string", "enum": ["draft", "committed", "executing", "done", "abandoned"] },
|
|
184
|
+
"created": { "$ref": "common.schema.json#/$defs/ts" }
|
|
185
|
+
},
|
|
186
|
+
"additionalProperties": false
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://amp.dev/schema/0.1/receipt.schema.json",
|
|
4
|
+
"title": "AMP receipt | event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"type": "object",
|
|
9
|
+
"required": ["amp", "kind", "id", "op", "at", "usage", "outcome"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"amp": { "const": "0.1" },
|
|
12
|
+
"kind": { "const": "receipt" },
|
|
13
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
14
|
+
"op": { "type": "string", "enum": ["attend", "act", "ask", "note", "plan", "reflect", "read"] },
|
|
15
|
+
"target": { "$ref": "common.schema.json#/$defs/ref" },
|
|
16
|
+
"at": { "$ref": "common.schema.json#/$defs/ts" },
|
|
17
|
+
"ms": { "type": "integer", "minimum": 0 },
|
|
18
|
+
"usage": { "$ref": "common.schema.json#/$defs/usage" },
|
|
19
|
+
"outcome": { "type": "string", "enum": ["success", "partial", "failure", "blocked"] },
|
|
20
|
+
"predicted_voi": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
21
|
+
"realized_voi": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
22
|
+
"handle": { "$ref": "common.schema.json#/$defs/handle" },
|
|
23
|
+
"note": { "type": "string" }
|
|
24
|
+
},
|
|
25
|
+
"additionalProperties": false
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": ["amp", "kind", "id", "at", "actor", "type", "digest"],
|
|
30
|
+
"properties": {
|
|
31
|
+
"amp": { "const": "0.1" },
|
|
32
|
+
"kind": { "const": "event" },
|
|
33
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
34
|
+
"at": { "$ref": "common.schema.json#/$defs/ts" },
|
|
35
|
+
"actor": { "$ref": "common.schema.json#/$defs/ref" },
|
|
36
|
+
"type": { "type": "string", "minLength": 1 },
|
|
37
|
+
"caused_by": { "$ref": "common.schema.json#/$defs/id" },
|
|
38
|
+
"refs": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } },
|
|
39
|
+
"digest": { "$ref": "common.schema.json#/$defs/digest" },
|
|
40
|
+
"payload": { "type": "object" }
|
|
41
|
+
},
|
|
42
|
+
"additionalProperties": false
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://amp.dev/schema/0.1/social.schema.json",
|
|
4
|
+
"title": "AMP social objects (other-model | common-ground | attention-request)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"type": "object",
|
|
9
|
+
"required": ["amp", "kind", "id", "subject", "beliefs", "confidence", "updated", "privacy"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"amp": { "const": "0.1" },
|
|
12
|
+
"kind": { "const": "other-model" },
|
|
13
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
14
|
+
"subject": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": ["kind", "id"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"kind": { "type": "string", "enum": ["human", "agent"] },
|
|
19
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
20
|
+
"label": { "type": "string" }
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
},
|
|
24
|
+
"beliefs": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"required": ["slot", "order", "proposition", "confidence", "source", "volatility", "ttl"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"slot": { "$ref": "common.schema.json#/$defs/id" },
|
|
31
|
+
"order": { "type": "integer", "minimum": 1, "maximum": 3 },
|
|
32
|
+
"proposition": { "type": "string", "minLength": 1 },
|
|
33
|
+
"confidence": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
34
|
+
"source": { "type": "string" },
|
|
35
|
+
"volatility": { "type": "string", "enum": ["low", "medium", "high"] },
|
|
36
|
+
"ttl": { "type": "integer", "minimum": 0 }
|
|
37
|
+
},
|
|
38
|
+
"additionalProperties": false
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"goals": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"required": ["goal", "priority", "confidence"],
|
|
46
|
+
"properties": {
|
|
47
|
+
"goal": { "type": "string" },
|
|
48
|
+
"priority": { "type": "integer", "minimum": 0 },
|
|
49
|
+
"confidence": { "$ref": "common.schema.json#/$defs/confidence" }
|
|
50
|
+
},
|
|
51
|
+
"additionalProperties": false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"knowledge": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"known": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } },
|
|
58
|
+
"unknown": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } },
|
|
59
|
+
"uncertain": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } }
|
|
60
|
+
},
|
|
61
|
+
"additionalProperties": false
|
|
62
|
+
},
|
|
63
|
+
"preferences": {
|
|
64
|
+
"type": "array",
|
|
65
|
+
"items": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"required": ["key", "value", "confidence"],
|
|
68
|
+
"properties": {
|
|
69
|
+
"key": { "type": "string" },
|
|
70
|
+
"value": { "type": "string" },
|
|
71
|
+
"confidence": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
72
|
+
"source": { "type": "string" }
|
|
73
|
+
},
|
|
74
|
+
"additionalProperties": false
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"attention": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"required": ["state"],
|
|
80
|
+
"properties": {
|
|
81
|
+
"state": { "type": "string", "enum": ["idle", "busy", "interruptible"] },
|
|
82
|
+
"load": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
83
|
+
"last_interaction": { "$ref": "common.schema.json#/$defs/ts" }
|
|
84
|
+
},
|
|
85
|
+
"additionalProperties": false
|
|
86
|
+
},
|
|
87
|
+
"trust": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"required": ["level"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"domain": { "type": "string" },
|
|
92
|
+
"level": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
93
|
+
"basis": { "type": "string" }
|
|
94
|
+
},
|
|
95
|
+
"additionalProperties": false
|
|
96
|
+
},
|
|
97
|
+
"common_ground": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } },
|
|
98
|
+
"privacy": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"required": ["scope"],
|
|
101
|
+
"properties": {
|
|
102
|
+
"scope": { "type": "string", "enum": ["turn", "session", "task", "persistent"] },
|
|
103
|
+
"retention_days": { "type": "integer", "minimum": 0 },
|
|
104
|
+
"redact": { "type": "array", "items": { "type": "string" } }
|
|
105
|
+
},
|
|
106
|
+
"additionalProperties": false
|
|
107
|
+
},
|
|
108
|
+
"confidence": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
109
|
+
"updated": { "$ref": "common.schema.json#/$defs/ts" }
|
|
110
|
+
},
|
|
111
|
+
"additionalProperties": false
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"type": "object",
|
|
115
|
+
"required": ["amp", "kind", "id", "proposition", "established_by", "participants", "confidence", "established_at"],
|
|
116
|
+
"properties": {
|
|
117
|
+
"amp": { "const": "0.1" },
|
|
118
|
+
"kind": { "const": "common-ground" },
|
|
119
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
120
|
+
"proposition": { "type": "string", "minLength": 1 },
|
|
121
|
+
"established_by": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"enum": ["assertion", "confirmation", "repair", "shared_observation", "assumption"]
|
|
124
|
+
},
|
|
125
|
+
"participants": { "type": "array", "minItems": 2, "items": { "$ref": "common.schema.json#/$defs/ref" } },
|
|
126
|
+
"confidence": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
127
|
+
"established_at": { "$ref": "common.schema.json#/$defs/ts" }
|
|
128
|
+
},
|
|
129
|
+
"additionalProperties": false
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"type": "object",
|
|
133
|
+
"required": ["amp", "kind", "id", "from", "to", "target", "class", "urgency", "why_now", "if_ignored", "cost", "fallback"],
|
|
134
|
+
"properties": {
|
|
135
|
+
"amp": { "const": "0.1" },
|
|
136
|
+
"kind": { "const": "attention-request" },
|
|
137
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
138
|
+
"from": { "$ref": "common.schema.json#/$defs/ref" },
|
|
139
|
+
"to": { "$ref": "common.schema.json#/$defs/ref" },
|
|
140
|
+
"target": { "$ref": "common.schema.json#/$defs/ref" },
|
|
141
|
+
"class": { "type": "string", "enum": ["safety", "commitment", "opportunity", "curiosity"] },
|
|
142
|
+
"urgency": { "type": "integer", "minimum": 1, "maximum": 5 },
|
|
143
|
+
"why_now": { "type": "string", "minLength": 1 },
|
|
144
|
+
"if_ignored": { "type": "string", "minLength": 1 },
|
|
145
|
+
"cost": { "$ref": "common.schema.json#/$defs/budget" },
|
|
146
|
+
"expected_value": { "$ref": "common.schema.json#/$defs/confidence" },
|
|
147
|
+
"expires": { "$ref": "common.schema.json#/$defs/ts" },
|
|
148
|
+
"fallback": { "type": "string", "enum": ["queue", "drop", "escalate"] }
|
|
149
|
+
},
|
|
150
|
+
"additionalProperties": false
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://amp.dev/schema/0.1/team.schema.json",
|
|
4
|
+
"title": "AMP team objects (team-manifest | commitment-record)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"type": "object",
|
|
9
|
+
"required": ["amp", "kind", "id", "version", "members", "max_depth", "max_fanout", "budget", "termination", "attested_at"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"amp": { "const": "0.1" },
|
|
12
|
+
"kind": { "const": "team-manifest" },
|
|
13
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
14
|
+
"version": { "type": "integer", "minimum": 1 },
|
|
15
|
+
"members": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"minItems": 1,
|
|
18
|
+
"items": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"required": ["id", "role", "authority"],
|
|
21
|
+
"properties": {
|
|
22
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
23
|
+
"role": { "type": "string" },
|
|
24
|
+
"capabilities": { "type": "array", "items": { "type": "string" } },
|
|
25
|
+
"authority": { "type": "array", "items": { "type": "string" } }
|
|
26
|
+
},
|
|
27
|
+
"additionalProperties": false
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"max_depth": { "type": "integer", "minimum": 0, "maximum": 2 },
|
|
31
|
+
"max_fanout": { "type": "integer", "minimum": 1, "maximum": 10 },
|
|
32
|
+
"budget": { "$ref": "common.schema.json#/$defs/budget" },
|
|
33
|
+
"termination": { "type": "string", "enum": ["verified", "budget", "stall", "authority"] },
|
|
34
|
+
"attested_at": { "$ref": "common.schema.json#/$defs/ts" }
|
|
35
|
+
},
|
|
36
|
+
"additionalProperties": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": ["amp", "kind", "id", "parties", "proposition", "satisfaction", "status", "proposed_by", "created"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"amp": { "const": "0.1" },
|
|
43
|
+
"kind": { "const": "commitment-record" },
|
|
44
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
45
|
+
"parties": { "type": "array", "minItems": 2, "items": { "$ref": "common.schema.json#/$defs/id" } },
|
|
46
|
+
"proposition": { "type": "string", "minLength": 1 },
|
|
47
|
+
"satisfaction": { "type": "array", "minItems": 1, "items": { "$ref": "common.schema.json#/$defs/criterion" } },
|
|
48
|
+
"status": { "type": "string", "enum": ["proposed", "active", "discharged", "cancelled", "breached"] },
|
|
49
|
+
"proposed_by": { "$ref": "common.schema.json#/$defs/id" },
|
|
50
|
+
"accepted_by": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/id" } },
|
|
51
|
+
"created": { "$ref": "common.schema.json#/$defs/ts" }
|
|
52
|
+
},
|
|
53
|
+
"additionalProperties": false
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://amp.dev/schema/0.1/verb.schema.json",
|
|
4
|
+
"title": "AMP model-facing verbs (M-surface)",
|
|
5
|
+
"description": "Six cognitive verbs plus one mechanical read. Verbs are proposals: the host may decline and must record why.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"oneOf": [
|
|
8
|
+
{
|
|
9
|
+
"type": "object",
|
|
10
|
+
"required": ["amp", "kind", "verb", "target", "why"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"amp": { "const": "0.1" },
|
|
13
|
+
"kind": { "const": "call" },
|
|
14
|
+
"verb": { "const": "attend" },
|
|
15
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
16
|
+
"target": { "$ref": "common.schema.json#/$defs/ref" },
|
|
17
|
+
"why": { "type": "string", "minLength": 1 },
|
|
18
|
+
"budget": { "$ref": "common.schema.json#/$defs/budget" }
|
|
19
|
+
},
|
|
20
|
+
"additionalProperties": false
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "object",
|
|
24
|
+
"required": ["amp", "kind", "verb", "goal"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"amp": { "const": "0.1" },
|
|
27
|
+
"kind": { "const": "call" },
|
|
28
|
+
"verb": { "const": "plan" },
|
|
29
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
30
|
+
"goal": { "$ref": "common.schema.json#/$defs/ref" },
|
|
31
|
+
"process": { "$ref": "common.schema.json#/$defs/ref" },
|
|
32
|
+
"mode": { "type": "string", "enum": ["draft", "commit"] }
|
|
33
|
+
},
|
|
34
|
+
"additionalProperties": false
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "object",
|
|
38
|
+
"required": ["amp", "kind", "verb", "action"],
|
|
39
|
+
"properties": {
|
|
40
|
+
"amp": { "const": "0.1" },
|
|
41
|
+
"kind": { "const": "call" },
|
|
42
|
+
"verb": { "const": "act" },
|
|
43
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
44
|
+
"action": { "type": "string", "minLength": 1 },
|
|
45
|
+
"ref": { "$ref": "common.schema.json#/$defs/ref" },
|
|
46
|
+
"args": { "type": "object" },
|
|
47
|
+
"expect": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"required": ["observation", "check"],
|
|
50
|
+
"properties": {
|
|
51
|
+
"observation": { "type": "string" },
|
|
52
|
+
"check": { "type": "string" }
|
|
53
|
+
},
|
|
54
|
+
"additionalProperties": false
|
|
55
|
+
},
|
|
56
|
+
"budget": { "$ref": "common.schema.json#/$defs/budget" }
|
|
57
|
+
},
|
|
58
|
+
"additionalProperties": false
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "object",
|
|
62
|
+
"required": ["amp", "kind", "verb", "question"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"amp": { "const": "0.1" },
|
|
65
|
+
"kind": { "const": "call" },
|
|
66
|
+
"verb": { "const": "ask" },
|
|
67
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
68
|
+
"question": { "type": "string", "minLength": 1 },
|
|
69
|
+
"to": { "$ref": "common.schema.json#/$defs/ref" },
|
|
70
|
+
"class": { "type": "string", "enum": ["safety", "commitment", "opportunity", "curiosity"] },
|
|
71
|
+
"urgency": { "type": "integer", "minimum": 1, "maximum": 5 },
|
|
72
|
+
"expires": { "$ref": "common.schema.json#/$defs/ts" }
|
|
73
|
+
},
|
|
74
|
+
"additionalProperties": false
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "object",
|
|
78
|
+
"required": ["amp", "kind", "verb", "assertion", "as"],
|
|
79
|
+
"properties": {
|
|
80
|
+
"amp": { "const": "0.1" },
|
|
81
|
+
"kind": { "const": "call" },
|
|
82
|
+
"verb": { "const": "note" },
|
|
83
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
84
|
+
"assertion": { "type": "string", "minLength": 1 },
|
|
85
|
+
"as": { "type": "string", "enum": ["claim", "hypothesis", "unknown", "concept"] },
|
|
86
|
+
"tier": { "$ref": "common.schema.json#/$defs/tier" },
|
|
87
|
+
"evidence": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/ref" } },
|
|
88
|
+
"refutes_if": { "type": "string" },
|
|
89
|
+
"label": { "type": "string" }
|
|
90
|
+
},
|
|
91
|
+
"additionalProperties": false
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "object",
|
|
95
|
+
"required": ["amp", "kind", "verb"],
|
|
96
|
+
"properties": {
|
|
97
|
+
"amp": { "const": "0.1" },
|
|
98
|
+
"kind": { "const": "call" },
|
|
99
|
+
"verb": { "const": "reflect" },
|
|
100
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
101
|
+
"scope": { "type": "string", "enum": ["turn", "task", "session"] }
|
|
102
|
+
},
|
|
103
|
+
"additionalProperties": false
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "object",
|
|
107
|
+
"required": ["amp", "kind", "verb", "handle", "cursor"],
|
|
108
|
+
"properties": {
|
|
109
|
+
"amp": { "const": "0.1" },
|
|
110
|
+
"kind": { "const": "call" },
|
|
111
|
+
"verb": { "const": "read" },
|
|
112
|
+
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
113
|
+
"handle": { "type": "string", "minLength": 1 },
|
|
114
|
+
"cursor": { "type": "integer", "minimum": 0 },
|
|
115
|
+
"limit": { "type": "integer", "minimum": 1 }
|
|
116
|
+
},
|
|
117
|
+
"additionalProperties": false
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AMP workspace extension v1. Local entity IDs are opaque workspace keys,
|
|
3
|
+
* not paths or global AMP object IDs. JSON Schemas are shared by all adapters.
|
|
4
|
+
*/
|
|
5
|
+
type WorkspaceProtocolName = "amp.workspace";
|
|
6
|
+
type WorkspaceVersion = 1;
|
|
7
|
+
export declare const WorkspaceProtocol: WorkspaceProtocolName;
|
|
8
|
+
export declare const WorkspaceProtocolVersion: WorkspaceVersion;
|
|
9
|
+
export type WorkspaceErrorCode = "invalid_arguments" | "unknown_tool" | "revision_mismatch" | "not_available" | "frame_unavailable" | "budget_exhausted" | "capacity_exceeded" | "response_too_large" | "integrity_failure" | "internal_error";
|
|
10
|
+
export type WorkspaceResponse = {
|
|
11
|
+
protocol: typeof WorkspaceProtocol;
|
|
12
|
+
version: typeof WorkspaceProtocolVersion;
|
|
13
|
+
revision: string;
|
|
14
|
+
} & ({
|
|
15
|
+
ok: true;
|
|
16
|
+
data: Record<string, unknown>;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
error: {
|
|
20
|
+
code: WorkspaceErrorCode;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
export interface WorkspaceToolDefinition {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
inputSchema: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export declare const workspaceToolDefinitions: () => WorkspaceToolDefinition[];
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export const WorkspaceProtocol = "amp.workspace";
|
|
2
|
+
export const WorkspaceProtocolVersion = 1;
|
|
3
|
+
const Key = { type: "string", minLength: 1, maxLength: 4096 };
|
|
4
|
+
const Keys = { type: "array", items: Key, maxItems: 100 };
|
|
5
|
+
const Kinds = ["project_depends_on", "imports", "calls", "references", "documents"];
|
|
6
|
+
const Page = {
|
|
7
|
+
offset: { type: "integer", minimum: 0, maximum: Number.MAX_SAFE_INTEGER },
|
|
8
|
+
limit: { type: "integer", minimum: 1, maximum: 100 },
|
|
9
|
+
};
|
|
10
|
+
const definition = (name, description, properties, required = []) => ({
|
|
11
|
+
name: `amp_workspace_${name}`,
|
|
12
|
+
description,
|
|
13
|
+
inputSchema: { type: "object", properties, required, additionalProperties: false },
|
|
14
|
+
});
|
|
15
|
+
const Definitions = [
|
|
16
|
+
definition("capabilities", "Discover authorized workspace projects, revision, registered Frame IDs and service limits. Does not grant new access.", {}),
|
|
17
|
+
definition("tree", "List project roots or direct structural children with native source locations; no summary or detail bodies. Use offset for pagination.", { revision: Key, parentId: Key, ...Page }, ["revision"]),
|
|
18
|
+
definition("query", "Find candidate IDs using lexical AND search and bounded graph traversal. Candidates need host Frame allocation before content reads.", {
|
|
19
|
+
revision: Key,
|
|
20
|
+
text: { type: "string", maxLength: 4096 },
|
|
21
|
+
seedIds: Keys,
|
|
22
|
+
projectIds: Keys,
|
|
23
|
+
relationKinds: { type: "array", items: { type: "string", enum: Kinds }, maxItems: 5 },
|
|
24
|
+
direction: { type: "string", enum: ["incoming", "outgoing", "both"] },
|
|
25
|
+
maxDepth: { type: "integer", minimum: 0, maximum: 10 },
|
|
26
|
+
limit: Page.limit,
|
|
27
|
+
}, ["revision"]),
|
|
28
|
+
definition("relations", "Page descriptive dependency/call/reference edges for one authorized node. Does not materialize either endpoint.", {
|
|
29
|
+
revision: Key,
|
|
30
|
+
nodeId: Key,
|
|
31
|
+
direction: { type: "string", enum: ["incoming", "outgoing"] },
|
|
32
|
+
relationKind: { type: "string", enum: Kinds },
|
|
33
|
+
...Page,
|
|
34
|
+
}, ["revision", "nodeId", "direction"]),
|
|
35
|
+
definition("materialize", "Materialize a host-registered Frame once. Repeated calls reuse its Context. Only summaries fitting the requested and host/Frame budgets are returned.", {
|
|
36
|
+
revision: Key,
|
|
37
|
+
frameId: Key,
|
|
38
|
+
budgetTokens: { type: "integer", minimum: 1, maximum: 32000 },
|
|
39
|
+
}, ["revision", "frameId", "budgetTokens"]),
|
|
40
|
+
definition("read", "Read a bounded page of CAS-verified detail from an explicitly allocated, materialized target. Structural ancestors alone do not grant detail access. Offsets count UTF-16 code units.", {
|
|
41
|
+
revision: Key,
|
|
42
|
+
contextId: Key,
|
|
43
|
+
nodeId: Key,
|
|
44
|
+
offset: Page.offset,
|
|
45
|
+
maxChars: { type: "integer", minimum: 1, maximum: 16000 },
|
|
46
|
+
}, ["revision", "contextId", "nodeId"]),
|
|
47
|
+
definition("release", "Release this service's Context handle. Does not create an action Receipt or refund/reopen its Frame budget.", { revision: Key, contextId: Key }, ["revision", "contextId"]),
|
|
48
|
+
];
|
|
49
|
+
export const workspaceToolDefinitions = () => structuredClone(Definitions);
|