@agent-teams/docs-protocol 0.0.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.
- package/CHANGELOG.md +7 -0
- package/LICENSE +201 -0
- package/README.md +92 -0
- package/dist/adapters/adoption-input.d.ts +9 -0
- package/dist/adapters/adoption-input.d.ts.map +1 -0
- package/dist/adapters/adoption-input.js +72 -0
- package/dist/adapters/adoption-input.js.map +1 -0
- package/dist/adapters/adoption-package-identity.d.ts +7 -0
- package/dist/adapters/adoption-package-identity.d.ts.map +1 -0
- package/dist/adapters/adoption-package-identity.js +69 -0
- package/dist/adapters/adoption-package-identity.js.map +1 -0
- package/dist/adapters/docs-command-envelope-schema-validator.d.ts +2 -0
- package/dist/adapters/docs-command-envelope-schema-validator.d.ts.map +1 -0
- package/dist/adapters/docs-command-envelope-schema-validator.js +24 -0
- package/dist/adapters/docs-command-envelope-schema-validator.js.map +1 -0
- package/dist/adapters/docs-profile-schema-validator.d.ts +2 -0
- package/dist/adapters/docs-profile-schema-validator.d.ts.map +1 -0
- package/dist/adapters/docs-profile-schema-validator.js +28 -0
- package/dist/adapters/docs-profile-schema-validator.js.map +1 -0
- package/dist/adapters/foundation-docs-port.d.ts +12 -0
- package/dist/adapters/foundation-docs-port.d.ts.map +1 -0
- package/dist/adapters/foundation-docs-port.js +108 -0
- package/dist/adapters/foundation-docs-port.js.map +1 -0
- package/dist/adapters/node-adoption-inspector.d.ts +5 -0
- package/dist/adapters/node-adoption-inspector.d.ts.map +1 -0
- package/dist/adapters/node-adoption-inspector.js +102 -0
- package/dist/adapters/node-adoption-inspector.js.map +1 -0
- package/dist/adapters/node-code-anchor-matcher.d.ts +5 -0
- package/dist/adapters/node-code-anchor-matcher.d.ts.map +1 -0
- package/dist/adapters/node-code-anchor-matcher.js +65 -0
- package/dist/adapters/node-code-anchor-matcher.js.map +1 -0
- package/dist/adapters/node-profile-reader.d.ts +9 -0
- package/dist/adapters/node-profile-reader.d.ts.map +1 -0
- package/dist/adapters/node-profile-reader.js +118 -0
- package/dist/adapters/node-profile-reader.js.map +1 -0
- package/dist/application/authority-handshake.d.ts +14 -0
- package/dist/application/authority-handshake.d.ts.map +1 -0
- package/dist/application/authority-handshake.js +15 -0
- package/dist/application/authority-handshake.js.map +1 -0
- package/dist/application/docs-new-completion.d.ts +33 -0
- package/dist/application/docs-new-completion.d.ts.map +1 -0
- package/dist/application/docs-new-completion.js +226 -0
- package/dist/application/docs-new-completion.js.map +1 -0
- package/dist/application/docs-protocol.d.ts +168 -0
- package/dist/application/docs-protocol.d.ts.map +1 -0
- package/dist/application/docs-protocol.js +450 -0
- package/dist/application/docs-protocol.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -0
- package/dist/composition/cli.d.ts +4 -0
- package/dist/composition/cli.d.ts.map +1 -0
- package/dist/composition/cli.js +436 -0
- package/dist/composition/cli.js.map +1 -0
- package/dist/composition/node-docs-api.d.ts +148 -0
- package/dist/composition/node-docs-api.d.ts.map +1 -0
- package/dist/composition/node-docs-api.js +38 -0
- package/dist/composition/node-docs-api.js.map +1 -0
- package/dist/domain/document-semantics.d.ts +7 -0
- package/dist/domain/document-semantics.d.ts.map +1 -0
- package/dist/domain/document-semantics.js +146 -0
- package/dist/domain/document-semantics.js.map +1 -0
- package/dist/domain/model.d.ts +285 -0
- package/dist/domain/model.d.ts.map +1 -0
- package/dist/domain/model.js +3 -0
- package/dist/domain/model.js.map +1 -0
- package/dist/domain/profile-policy.d.ts +7 -0
- package/dist/domain/profile-policy.d.ts.map +1 -0
- package/dist/domain/profile-policy.js +109 -0
- package/dist/domain/profile-policy.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/qualification/index.d.ts +23 -0
- package/dist/qualification/index.d.ts.map +1 -0
- package/dist/qualification/index.js +462 -0
- package/dist/qualification/index.js.map +1 -0
- package/package.json +64 -0
- package/schemas/docs-protocol/v1.schema.json +12 -0
- package/schemas/docs-protocol-command-envelope/v1.schema.json +239 -0
- package/schemas/docs-protocol-profile/v1.schema.json +46 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agent-teams.ai/schemas/docs-protocol-command-envelope/v1",
|
|
4
|
+
"title": "Agent Teams Docs Protocol Command Envelope",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "protocol", "command", "outcome", "diagnostics", "result"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": 1 },
|
|
10
|
+
"protocol": { "$ref": "#/$defs/protocol" },
|
|
11
|
+
"command": { "enum": ["docs.info", "docs.find", "docs.new", "docs.doctor", "docs.recover", "docs.check"] },
|
|
12
|
+
"outcome": { "enum": ["success", "conflict", "violation", "authority-stale", "recovery-required", "invalid-input", "execution-failure", "cancelled"] },
|
|
13
|
+
"diagnostics": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/diagnostic" } },
|
|
14
|
+
"result": {
|
|
15
|
+
"oneOf": [
|
|
16
|
+
{ "$ref": "#/$defs/emptyResult" },
|
|
17
|
+
{ "$ref": "#/$defs/infoResult" },
|
|
18
|
+
{ "$ref": "#/$defs/findResult" },
|
|
19
|
+
{ "$ref": "#/$defs/newResult" },
|
|
20
|
+
{ "$ref": "#/$defs/doctorResult" },
|
|
21
|
+
{ "$ref": "#/$defs/recoverResult" },
|
|
22
|
+
{ "$ref": "#/$defs/checkResult" }
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"allOf": [
|
|
27
|
+
{ "$ref": "#/$defs/infoEnvelope" },
|
|
28
|
+
{ "$ref": "#/$defs/findEnvelope" },
|
|
29
|
+
{ "$ref": "#/$defs/newEnvelope" },
|
|
30
|
+
{ "$ref": "#/$defs/doctorEnvelope" },
|
|
31
|
+
{ "$ref": "#/$defs/recoverEnvelope" },
|
|
32
|
+
{ "$ref": "#/$defs/checkEnvelope" }
|
|
33
|
+
],
|
|
34
|
+
"$defs": {
|
|
35
|
+
"protocol": {
|
|
36
|
+
"type": "object", "additionalProperties": false, "required": ["id", "version"],
|
|
37
|
+
"properties": { "id": { "const": "agent-teams.docs-protocol" }, "version": { "const": 1 } }
|
|
38
|
+
},
|
|
39
|
+
"lowerId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[a-z0-9][a-z0-9._/-]*$" },
|
|
40
|
+
"opaqueId": { "type": "string", "minLength": 1, "maxLength": 214, "pattern": "^[A-Za-z0-9@][A-Za-z0-9@._/-]*$" },
|
|
41
|
+
"repositoryPath": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9._@-]{1,255}(?:/[A-Za-z0-9._@-]{1,255})*$" },
|
|
42
|
+
"digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
|
|
43
|
+
"emptyResult": { "type": "object", "additionalProperties": false, "maxProperties": 0 },
|
|
44
|
+
"diagnostic": {
|
|
45
|
+
"type": "object", "additionalProperties": false,
|
|
46
|
+
"required": ["ruleId", "severity", "phase", "subject", "message"],
|
|
47
|
+
"properties": {
|
|
48
|
+
"ruleId": { "$ref": "#/$defs/opaqueId" },
|
|
49
|
+
"severity": { "enum": ["error", "info", "warning"] },
|
|
50
|
+
"phase": { "enum": ["apply", "authority", "input", "planning", "query", "recovery"] },
|
|
51
|
+
"subject": { "type": "string", "minLength": 1, "maxLength": 512 },
|
|
52
|
+
"message": { "type": "string", "minLength": 1, "maxLength": 1000 }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"jsonValue": {
|
|
56
|
+
"oneOf": [
|
|
57
|
+
{ "type": "boolean" },
|
|
58
|
+
{ "type": "null" },
|
|
59
|
+
{ "type": "number" },
|
|
60
|
+
{ "type": "string" },
|
|
61
|
+
{ "type": "array", "maxItems": 10000, "items": { "$ref": "#/$defs/jsonValue" } },
|
|
62
|
+
{ "type": "object", "maxProperties": 10000, "additionalProperties": { "$ref": "#/$defs/jsonValue" } }
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"foundationProfile": {
|
|
66
|
+
"type": "object", "additionalProperties": false,
|
|
67
|
+
"required": ["path", "schemaVersion", "metadataSidecarPolicy"],
|
|
68
|
+
"properties": {
|
|
69
|
+
"path": { "$ref": "#/$defs/repositoryPath" },
|
|
70
|
+
"schemaVersion": { "const": 2 },
|
|
71
|
+
"metadataSidecarPolicy": { "const": "foundation-profile-v2-strict-merge" }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"metadataSidecar": {
|
|
75
|
+
"oneOf": [
|
|
76
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "const": "none" } } },
|
|
77
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "path"], "properties": { "kind": { "const": "path-metadata-map" }, "path": { "$ref": "#/$defs/repositoryPath" } } }
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"identity": {
|
|
81
|
+
"type": "object", "additionalProperties": false, "required": ["kind", "format"],
|
|
82
|
+
"properties": {
|
|
83
|
+
"kind": { "const": "explicit" },
|
|
84
|
+
"format": { "enum": ["adr-four-digits", "open-decision-three-digits", "qualified"] },
|
|
85
|
+
"grammar": {
|
|
86
|
+
"type": "object", "additionalProperties": false,
|
|
87
|
+
"required": ["prefixSegments", "minSuffixSegments", "maxSuffixSegments"],
|
|
88
|
+
"properties": {
|
|
89
|
+
"prefixSegments": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "$ref": "#/$defs/lowerId" } },
|
|
90
|
+
"minSuffixSegments": { "type": "integer", "minimum": 1, "maximum": 16 },
|
|
91
|
+
"maxSuffixSegments": { "type": "integer", "minimum": 1, "maximum": 16 }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"placement": {
|
|
97
|
+
"oneOf": [
|
|
98
|
+
{
|
|
99
|
+
"type": "object", "additionalProperties": false, "required": ["kind", "directory", "filename"],
|
|
100
|
+
"properties": { "kind": { "const": "collection" }, "directory": { "$ref": "#/$defs/repositoryPath" }, "filename": { "enum": ["numeric-id-slug", "id-slug", "slug", "README.md"] } }
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"type": "object", "additionalProperties": false, "required": ["kind", "root", "requiredBasename"],
|
|
104
|
+
"properties": { "kind": { "const": "qualified-leaf-index" }, "root": { "$ref": "#/$defs/repositoryPath" }, "requiredBasename": { "const": "README.md" } }
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "object", "additionalProperties": false,
|
|
108
|
+
"required": ["kind", "allowedRoots", "requiredSegmentsInOrder", "requiredBasename", "minimumSegmentsBeforeRequired", "minimumSegmentsAfterRequired"],
|
|
109
|
+
"properties": {
|
|
110
|
+
"kind": { "const": "explicit" },
|
|
111
|
+
"allowedRoots": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "$ref": "#/$defs/repositoryPath" } },
|
|
112
|
+
"requiredSegmentsInOrder": { "type": "array", "minItems": 1, "maxItems": 16, "items": { "type": "string", "pattern": "^[A-Za-z0-9._@-]+$", "maxLength": 255 } },
|
|
113
|
+
"requiredBasename": { "const": "README.md" },
|
|
114
|
+
"minimumSegmentsBeforeRequired": { "type": "integer", "minimum": 0, "maximum": 16 },
|
|
115
|
+
"minimumSegmentsAfterRequired": { "type": "integer", "minimum": 0, "maximum": 16 }
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"reachability": {
|
|
121
|
+
"oneOf": [
|
|
122
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "indexPath"], "properties": { "kind": { "const": "manual-fixed-index" }, "indexPath": { "$ref": "#/$defs/repositoryPath" } } },
|
|
123
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "pathPrefix", "indexBasename"], "properties": { "kind": { "const": "manual-colocated-index" }, "pathPrefix": { "const": "before-required-segments" }, "indexBasename": { "const": "README.md" } } },
|
|
124
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "reason"], "properties": { "kind": { "const": "not-required" }, "reason": { "type": "string", "minLength": 1, "maxLength": 500 } } }
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"typeInfo": {
|
|
128
|
+
"type": "object", "additionalProperties": false,
|
|
129
|
+
"required": ["type", "initialStatus", "allowedOwnerIds", "identity", "heading", "placement", "template", "requiredMetadata", "reachability"],
|
|
130
|
+
"properties": {
|
|
131
|
+
"type": { "$ref": "#/$defs/lowerId" },
|
|
132
|
+
"initialStatus": { "$ref": "#/$defs/lowerId" },
|
|
133
|
+
"allowedOwnerIds": { "type": "array", "minItems": 1, "maxItems": 4096, "items": { "$ref": "#/$defs/opaqueId" } },
|
|
134
|
+
"identity": { "$ref": "#/$defs/identity" },
|
|
135
|
+
"heading": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["id-colon-title", "title"] } } },
|
|
136
|
+
"placement": { "$ref": "#/$defs/placement" },
|
|
137
|
+
"template": { "type": "object", "additionalProperties": false, "required": ["kind", "path"], "properties": { "kind": { "const": "fenced-markdown-body" }, "path": { "$ref": "#/$defs/repositoryPath" } } },
|
|
138
|
+
"requiredMetadata": { "type": "array", "minItems": 5, "maxItems": 128, "items": { "type": "string", "maxLength": 128 } },
|
|
139
|
+
"reachability": { "$ref": "#/$defs/reachability" }
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"infoResult": {
|
|
143
|
+
"type": "object", "additionalProperties": false,
|
|
144
|
+
"required": ["kind", "projectId", "protocol", "foundationProfile", "agentWorkflow", "metadataSchemaPath", "metadataSidecar", "ownerIds", "types", "semanticValidatorIds"],
|
|
145
|
+
"properties": {
|
|
146
|
+
"kind": { "const": "info" }, "projectId": { "$ref": "#/$defs/lowerId" }, "protocol": { "$ref": "#/$defs/protocol" },
|
|
147
|
+
"foundationProfile": { "$ref": "#/$defs/foundationProfile" },
|
|
148
|
+
"agentWorkflow": { "type": "object", "additionalProperties": false, "required": ["skillPath"], "properties": { "skillPath": { "$ref": "#/$defs/repositoryPath" } } },
|
|
149
|
+
"metadataSchemaPath": { "$ref": "#/$defs/repositoryPath" }, "metadataSidecar": { "$ref": "#/$defs/metadataSidecar" },
|
|
150
|
+
"ownerIds": { "type": "array", "maxItems": 4096, "items": { "$ref": "#/$defs/opaqueId" } },
|
|
151
|
+
"types": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "$ref": "#/$defs/typeInfo" } },
|
|
152
|
+
"semanticValidatorIds": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/lowerId" } }
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"document": {
|
|
156
|
+
"type": "object", "additionalProperties": false,
|
|
157
|
+
"required": ["id", "type", "status", "owner", "summary", "title", "repositoryPath", "source", "metadata", "related", "blockedBy"],
|
|
158
|
+
"properties": {
|
|
159
|
+
"id": { "$ref": "#/$defs/opaqueId" }, "type": { "$ref": "#/$defs/lowerId" }, "status": { "$ref": "#/$defs/lowerId" },
|
|
160
|
+
"owner": { "$ref": "#/$defs/opaqueId" }, "summary": { "type": "string", "minLength": 1, "maxLength": 1000 },
|
|
161
|
+
"title": { "type": "string", "minLength": 1, "maxLength": 240 }, "repositoryPath": { "$ref": "#/$defs/repositoryPath" },
|
|
162
|
+
"source": { "enum": ["frontmatter-readme", "markdown-tree"] },
|
|
163
|
+
"metadata": { "type": "object", "maxProperties": 10000, "additionalProperties": { "$ref": "#/$defs/jsonValue" } },
|
|
164
|
+
"related": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/opaqueId" } },
|
|
165
|
+
"blockedBy": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/opaqueId" } }
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"findResult": { "type": "object", "additionalProperties": false, "required": ["kind", "matches", "documents"], "properties": { "kind": { "const": "find" }, "matches": { "type": "integer", "minimum": 0, "maximum": 10000 }, "documents": { "type": "array", "maxItems": 10000, "items": { "$ref": "#/$defs/document" } } } },
|
|
169
|
+
"reachabilityAction": {
|
|
170
|
+
"oneOf": [
|
|
171
|
+
{ "type": "object", "additionalProperties": false, "required": ["state", "indexPath", "markdownLink"], "properties": { "state": { "const": "manual-required" }, "indexPath": { "$ref": "#/$defs/repositoryPath" }, "markdownLink": { "type": "string", "minLength": 1, "maxLength": 1024 } } },
|
|
172
|
+
{ "type": "object", "additionalProperties": false, "required": ["state", "reason"], "properties": { "state": { "const": "not-required" }, "reason": { "type": "string", "minLength": 1, "maxLength": 500 } } }
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"recovery": { "type": "object", "additionalProperties": false, "required": ["commandId", "args"], "properties": { "commandId": { "enum": ["detach", "docs.recover", "docs-recover", "scaffold-recover"] }, "args": { "type": "object", "maxProperties": 16, "additionalProperties": { "type": "string", "maxLength": 512 } } } },
|
|
176
|
+
"receiptEvidence": {
|
|
177
|
+
"type": "object", "additionalProperties": false, "required": ["outcome", "commit"],
|
|
178
|
+
"properties": {
|
|
179
|
+
"outcome": { "enum": ["applied", "already-applied", "authority-stale", "rejected", "recovery-required", "manual-recovery-required", "failed-before-publication", "cancelled"] },
|
|
180
|
+
"commit": { "type": "object", "additionalProperties": false, "required": ["state", "publication", "recoverability"], "properties": { "state": { "enum": ["committed", "not-published", "recovery-required", "manual-recovery-required"] }, "publication": { "enum": ["none", "preexisting-exact", "published", "unknown"] }, "recoverability": { "enum": ["not-required", "preserved-for-recovery"] } } },
|
|
181
|
+
"directoryMaterialization": { "type": "object", "additionalProperties": false, "required": ["state", "plannedDirectories", "observedCreatedDirectories"], "properties": { "state": { "enum": ["none-created", "created-and-retained", "preserved-unknown"] }, "plannedDirectories": { "type": "array", "maxItems": 128, "items": { "$ref": "#/$defs/repositoryPath" } }, "observedCreatedDirectories": { "type": "array", "maxItems": 128, "items": { "$ref": "#/$defs/repositoryPath" } } } }
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"transaction": {
|
|
185
|
+
"type": "object", "additionalProperties": false, "required": ["state"],
|
|
186
|
+
"properties": { "state": { "enum": ["idle", "recoverable", "manual-recovery-required"] }, "transactionKind": { "enum": ["corrupt", "document", "local-mode", "scaffold", "transition-residue", "unknown", "version-mismatch"] }, "reason": { "type": "string", "minLength": 1, "maxLength": 1000 }, "recovery": { "$ref": "#/$defs/recovery" } }
|
|
187
|
+
},
|
|
188
|
+
"newResult": {
|
|
189
|
+
"oneOf": [
|
|
190
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "reservation", "writeState", "transaction"], "properties": { "kind": { "const": "new" }, "reservation": { "const": "none" }, "writeState": { "const": "blocked" }, "transaction": { "$ref": "#/$defs/transaction" } } },
|
|
191
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "reservation", "writeState", "reason"], "properties": { "kind": { "const": "new" }, "reservation": { "const": "none" }, "writeState": { "const": "blocked" }, "reason": { "enum": ["adoption-invalid", "authority-stale"] } } },
|
|
192
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "reservation", "writeState", "documentPath", "planDigest", "reachability"], "properties": { "kind": { "const": "new" }, "reservation": { "const": "none" }, "writeState": { "const": "preview" }, "documentPath": { "$ref": "#/$defs/repositoryPath" }, "planDigest": { "$ref": "#/$defs/digest" }, "reachability": { "$ref": "#/$defs/reachabilityAction" } } },
|
|
193
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "reservation", "writeState", "documentPath", "planDigest", "receiptDigest", "receiptOutcome", "receipt"], "properties": { "kind": { "const": "new" }, "reservation": { "const": "none" }, "writeState": { "enum": ["applied", "already-applied", "published-recovery-required", "unchanged", "unknown"] }, "documentPath": { "$ref": "#/$defs/repositoryPath" }, "planDigest": { "$ref": "#/$defs/digest" }, "receiptDigest": { "$ref": "#/$defs/digest" }, "receiptOutcome": { "enum": ["applied", "already-applied", "authority-stale", "rejected", "recovery-required", "manual-recovery-required", "failed-before-publication", "cancelled"] }, "receipt": { "$ref": "#/$defs/receiptEvidence" }, "reachability": { "$ref": "#/$defs/reachabilityAction" } } }
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"environment": { "type": "object", "additionalProperties": false, "required": ["installedFoundationVersion", "installedFoundationBuildIdentity", "filesystem"], "properties": { "installedFoundationVersion": { "type": "string", "minLength": 1, "maxLength": 100 }, "installedFoundationBuildIdentity": { "$ref": "#/$defs/digest" }, "filesystem": { "type": "object", "additionalProperties": false, "required": ["basis", "strictDirectoryDurability"], "properties": { "basis": { "const": "platform-contract" }, "strictDirectoryDurability": { "enum": ["platform-supported", "platform-unsupported"] } } } } },
|
|
197
|
+
"doctorResult": { "type": "object", "additionalProperties": false, "required": ["kind", "protocol", "environment", "transaction"], "properties": { "kind": { "const": "doctor" }, "protocol": { "$ref": "#/$defs/protocol" }, "projectId": { "$ref": "#/$defs/lowerId" }, "environment": { "$ref": "#/$defs/environment" }, "transaction": { "$ref": "#/$defs/transaction" } } },
|
|
198
|
+
"recoverResult": { "oneOf": [
|
|
199
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "transactionState", "writeState"], "properties": { "kind": { "const": "recover" }, "transactionState": { "const": "no-pending-transaction" }, "writeState": { "const": "unchanged" } } },
|
|
200
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "transactionState", "writeState", "transaction"], "properties": { "kind": { "const": "recover" }, "transactionState": { "const": "manual-required" }, "writeState": { "const": "unknown" }, "transaction": { "$ref": "#/$defs/transaction" } } },
|
|
201
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "transactionState", "writeState", "receiptDigest", "receipt"], "properties": { "kind": { "const": "recover" }, "transactionState": { "enum": ["recovered", "recovery-required"] }, "writeState": { "enum": ["unchanged", "unknown", "committed", "published-recovery-required"] }, "receiptDigest": { "$ref": "#/$defs/digest" }, "receipt": { "$ref": "#/$defs/receiptEvidence" } } }
|
|
202
|
+
] },
|
|
203
|
+
"checkResult": { "type": "object", "additionalProperties": false, "required": ["kind", "projectId", "catalogStatus", "documents", "foundationProfile", "metadataSidecar", "semanticValidatorIds", "valid"], "properties": { "kind": { "const": "check" }, "projectId": { "$ref": "#/$defs/lowerId" }, "catalogStatus": { "enum": ["complete", "partial"] }, "documents": { "type": "integer", "minimum": 0, "maximum": 100000 }, "foundationProfile": { "$ref": "#/$defs/foundationProfile" }, "metadataSidecar": { "$ref": "#/$defs/metadataSidecar" }, "semanticValidatorIds": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/lowerId" } }, "valid": { "type": "boolean" } } },
|
|
204
|
+
"infoEnvelope": { "if": { "type": "object", "properties": { "command": { "const": "docs.info" } }, "required": ["command"] }, "then": { "type": "object", "properties": { "outcome": { "enum": ["success", "invalid-input", "execution-failure", "cancelled"] } }, "allOf": [{ "if": { "type": "object", "properties": { "outcome": { "const": "success" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/infoResult" } } }, "else": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } }] } },
|
|
205
|
+
"findEnvelope": { "if": { "type": "object", "properties": { "command": { "const": "docs.find" } }, "required": ["command"] }, "then": { "type": "object", "properties": { "outcome": { "enum": ["success", "invalid-input", "execution-failure", "cancelled"] } }, "allOf": [{ "if": { "type": "object", "properties": { "outcome": { "const": "success" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/findResult" } } }, "else": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } }] } },
|
|
206
|
+
"newEnvelope": {
|
|
207
|
+
"if": { "type": "object", "properties": { "command": { "const": "docs.new" } }, "required": ["command"] },
|
|
208
|
+
"then": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"properties": { "outcome": { "enum": ["success", "conflict", "violation", "authority-stale", "recovery-required", "invalid-input", "execution-failure", "cancelled"] } },
|
|
211
|
+
"allOf": [
|
|
212
|
+
{ "if": { "type": "object", "properties": { "outcome": { "const": "success" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "enum": ["preview", "applied", "already-applied"] } }, "required": ["writeState"] }] } } } },
|
|
213
|
+
{ "if": { "type": "object", "properties": { "outcome": { "const": "authority-stale" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "enum": ["blocked", "unchanged", "unknown"] } }, "required": ["writeState"] }] } } } },
|
|
214
|
+
{ "if": { "type": "object", "properties": { "outcome": { "const": "recovery-required" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "enum": ["blocked", "published-recovery-required", "unknown", "unchanged"] } }, "required": ["writeState"] }] } } } },
|
|
215
|
+
{ "if": { "type": "object", "properties": { "outcome": { "const": "conflict" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "enum": ["unchanged", "unknown"] }, "receipt": true }, "required": ["writeState", "receipt"] }] } } } },
|
|
216
|
+
{ "if": { "type": "object", "properties": { "outcome": { "const": "violation" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "const": "blocked" }, "reason": { "const": "adoption-invalid" } }, "required": ["writeState", "reason"] }] } } } },
|
|
217
|
+
{ "if": { "type": "object", "properties": { "outcome": { "const": "invalid-input" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } },
|
|
218
|
+
{ "if": { "type": "object", "properties": { "outcome": { "enum": ["execution-failure", "cancelled"] } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "oneOf": [{ "$ref": "#/$defs/emptyResult" }, { "allOf": [{ "$ref": "#/$defs/newResult" }, { "type": "object", "properties": { "writeState": { "enum": ["unchanged", "unknown", "published-recovery-required"] }, "receipt": true }, "required": ["writeState", "receipt"] }] }] } } } }
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"doctorEnvelope": { "if": { "type": "object", "properties": { "command": { "const": "docs.doctor" } }, "required": ["command"] }, "then": { "type": "object", "properties": { "outcome": { "enum": ["success", "violation", "recovery-required", "invalid-input", "execution-failure", "cancelled"] } }, "allOf": [{ "if": { "type": "object", "properties": { "outcome": { "enum": ["success", "violation", "recovery-required"] } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/doctorResult" } } }, "else": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } }] } },
|
|
223
|
+
"recoverEnvelope": {
|
|
224
|
+
"if": { "type": "object", "properties": { "command": { "const": "docs.recover" } }, "required": ["command"] },
|
|
225
|
+
"then": {
|
|
226
|
+
"type": "object",
|
|
227
|
+
"properties": { "outcome": { "enum": ["success", "conflict", "authority-stale", "recovery-required", "invalid-input", "execution-failure", "cancelled"] } },
|
|
228
|
+
"allOf": [
|
|
229
|
+
{ "if": { "type": "object", "properties": { "outcome": { "const": "success" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/recoverResult" }, { "type": "object", "properties": { "transactionState": { "enum": ["no-pending-transaction", "recovered"] } }, "required": ["transactionState"] }] } } } },
|
|
230
|
+
{ "if": { "type": "object", "properties": { "outcome": { "const": "recovery-required" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/recoverResult" }, { "type": "object", "properties": { "transactionState": { "enum": ["manual-required", "recovery-required"] } }, "required": ["transactionState"] }] } } } },
|
|
231
|
+
{ "if": { "type": "object", "properties": { "outcome": { "enum": ["conflict", "authority-stale"] } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "allOf": [{ "$ref": "#/$defs/recoverResult" }, { "type": "object", "properties": { "transactionState": { "const": "recovery-required" }, "receipt": true }, "required": ["transactionState", "receipt"] }] } } } },
|
|
232
|
+
{ "if": { "type": "object", "properties": { "outcome": { "const": "invalid-input" } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } },
|
|
233
|
+
{ "if": { "type": "object", "properties": { "outcome": { "enum": ["execution-failure", "cancelled"] } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "oneOf": [{ "$ref": "#/$defs/emptyResult" }, { "allOf": [{ "$ref": "#/$defs/recoverResult" }, { "type": "object", "properties": { "transactionState": { "const": "recovery-required" }, "receipt": true }, "required": ["transactionState", "receipt"] }] }] } } } }
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"checkEnvelope": { "if": { "type": "object", "properties": { "command": { "const": "docs.check" } }, "required": ["command"] }, "then": { "type": "object", "properties": { "outcome": { "enum": ["success", "violation", "invalid-input", "execution-failure", "cancelled"] } }, "allOf": [{ "if": { "type": "object", "properties": { "outcome": { "enum": ["success", "violation"] } }, "required": ["outcome"] }, "then": { "type": "object", "properties": { "result": { "$ref": "#/$defs/checkResult" } } }, "else": { "type": "object", "properties": { "result": { "$ref": "#/$defs/emptyResult" } } } }] } }
|
|
238
|
+
}
|
|
239
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agent-teams.ai/schemas/docs-protocol-profile/v1",
|
|
4
|
+
"title": "Agent Teams Docs Protocol Profile",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "protocol", "foundationProfile", "agentWorkflow", "semanticValidatorIds"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": 1 },
|
|
10
|
+
"protocol": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"required": ["id", "version"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"id": { "const": "agent-teams.docs-protocol" },
|
|
16
|
+
"version": { "const": 1 }
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"foundationProfile": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"required": ["path", "schemaVersion", "metadataSidecarPolicy"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"path": { "$ref": "#/$defs/repositoryPath" },
|
|
25
|
+
"schemaVersion": { "const": 2 },
|
|
26
|
+
"metadataSidecarPolicy": { "const": "foundation-profile-v2-strict-merge" }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"agentWorkflow": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"required": ["skillPath"],
|
|
33
|
+
"properties": { "skillPath": { "$ref": "#/$defs/repositoryPath" } }
|
|
34
|
+
},
|
|
35
|
+
"semanticValidatorIds": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"maxItems": 256,
|
|
38
|
+
"uniqueItems": true,
|
|
39
|
+
"items": { "$ref": "#/$defs/lowerId" }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"$defs": {
|
|
43
|
+
"lowerId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[a-z0-9][a-z0-9._/-]*$" },
|
|
44
|
+
"repositoryPath": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9._@-]{1,255}(?:/[A-Za-z0-9._@-]{1,255})*$" }
|
|
45
|
+
}
|
|
46
|
+
}
|