agenthooksprotocol 0.0.0-bootstrap.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 (151) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +29 -0
  3. package/dist/src/client/auth.d.ts +147 -0
  4. package/dist/src/client/auth.d.ts.map +1 -0
  5. package/dist/src/client/auth.js +629 -0
  6. package/dist/src/client/auth.js.map +1 -0
  7. package/dist/src/client/composition.d.ts +42 -0
  8. package/dist/src/client/composition.d.ts.map +1 -0
  9. package/dist/src/client/composition.js +523 -0
  10. package/dist/src/client/composition.js.map +1 -0
  11. package/dist/src/client/content.d.ts +73 -0
  12. package/dist/src/client/content.d.ts.map +1 -0
  13. package/dist/src/client/content.js +404 -0
  14. package/dist/src/client/content.js.map +1 -0
  15. package/dist/src/client/hooks.d.ts +62 -0
  16. package/dist/src/client/hooks.d.ts.map +1 -0
  17. package/dist/src/client/hooks.js +997 -0
  18. package/dist/src/client/hooks.js.map +1 -0
  19. package/dist/src/client/index.d.ts +11 -0
  20. package/dist/src/client/index.d.ts.map +1 -0
  21. package/dist/src/client/index.js +9 -0
  22. package/dist/src/client/index.js.map +1 -0
  23. package/dist/src/client/transport.d.ts +12 -0
  24. package/dist/src/client/transport.d.ts.map +1 -0
  25. package/dist/src/client/transport.js +347 -0
  26. package/dist/src/client/transport.js.map +1 -0
  27. package/dist/src/client/types.d.ts +117 -0
  28. package/dist/src/client/types.d.ts.map +1 -0
  29. package/dist/src/client/types.js +10 -0
  30. package/dist/src/client/types.js.map +1 -0
  31. package/dist/src/client/validation.d.ts +3 -0
  32. package/dist/src/client/validation.d.ts.map +1 -0
  33. package/dist/src/client/validation.js +25 -0
  34. package/dist/src/client/validation.js.map +1 -0
  35. package/dist/src/compaction.d.ts +27 -0
  36. package/dist/src/compaction.d.ts.map +1 -0
  37. package/dist/src/compaction.js +155 -0
  38. package/dist/src/compaction.js.map +1 -0
  39. package/dist/src/content-upload.d.ts +60 -0
  40. package/dist/src/content-upload.d.ts.map +1 -0
  41. package/dist/src/content-upload.js +129 -0
  42. package/dist/src/content-upload.js.map +1 -0
  43. package/dist/src/draft/generated.d.ts +3085 -0
  44. package/dist/src/draft/generated.d.ts.map +1 -0
  45. package/dist/src/draft/generated.js +15372 -0
  46. package/dist/src/draft/generated.js.map +1 -0
  47. package/dist/src/draft/index.d.ts +31 -0
  48. package/dist/src/draft/index.d.ts.map +1 -0
  49. package/dist/src/draft/index.js +129 -0
  50. package/dist/src/draft/index.js.map +1 -0
  51. package/dist/src/draft/schemas.d.ts +8848 -0
  52. package/dist/src/draft/schemas.d.ts.map +1 -0
  53. package/dist/src/draft/schemas.js +9219 -0
  54. package/dist/src/draft/schemas.js.map +1 -0
  55. package/dist/src/draft-atomic.d.ts +18 -0
  56. package/dist/src/draft-atomic.d.ts.map +1 -0
  57. package/dist/src/draft-atomic.js +102 -0
  58. package/dist/src/draft-atomic.js.map +1 -0
  59. package/dist/src/draft-runtime.d.ts +89 -0
  60. package/dist/src/draft-runtime.d.ts.map +1 -0
  61. package/dist/src/draft-runtime.js +242 -0
  62. package/dist/src/draft-runtime.js.map +1 -0
  63. package/dist/src/elicitation.d.ts +18 -0
  64. package/dist/src/elicitation.d.ts.map +1 -0
  65. package/dist/src/elicitation.js +191 -0
  66. package/dist/src/elicitation.js.map +1 -0
  67. package/dist/src/errors.d.ts +7 -0
  68. package/dist/src/errors.d.ts.map +1 -0
  69. package/dist/src/errors.js +15 -0
  70. package/dist/src/errors.js.map +1 -0
  71. package/dist/src/framing.d.ts +7 -0
  72. package/dist/src/framing.d.ts.map +1 -0
  73. package/dist/src/framing.js +39 -0
  74. package/dist/src/framing.js.map +1 -0
  75. package/dist/src/generated.d.ts +304 -0
  76. package/dist/src/generated.d.ts.map +1 -0
  77. package/dist/src/generated.js +1885 -0
  78. package/dist/src/generated.js.map +1 -0
  79. package/dist/src/hook-runner.d.ts +11 -0
  80. package/dist/src/hook-runner.d.ts.map +1 -0
  81. package/dist/src/hook-runner.js +223 -0
  82. package/dist/src/hook-runner.js.map +1 -0
  83. package/dist/src/index.d.ts +8 -0
  84. package/dist/src/index.d.ts.map +1 -0
  85. package/dist/src/index.js +8 -0
  86. package/dist/src/index.js.map +1 -0
  87. package/dist/src/observation.d.ts +26 -0
  88. package/dist/src/observation.d.ts.map +1 -0
  89. package/dist/src/observation.js +28 -0
  90. package/dist/src/observation.js.map +1 -0
  91. package/dist/src/server/attachments.d.ts +29 -0
  92. package/dist/src/server/attachments.d.ts.map +1 -0
  93. package/dist/src/server/attachments.js +112 -0
  94. package/dist/src/server/attachments.js.map +1 -0
  95. package/dist/src/server/hooks.d.ts +20 -0
  96. package/dist/src/server/hooks.d.ts.map +1 -0
  97. package/dist/src/server/hooks.js +129 -0
  98. package/dist/src/server/hooks.js.map +1 -0
  99. package/dist/src/server/index.d.ts +7 -0
  100. package/dist/src/server/index.d.ts.map +1 -0
  101. package/dist/src/server/index.js +4 -0
  102. package/dist/src/server/index.js.map +1 -0
  103. package/dist/src/server/stdio.d.ts +15 -0
  104. package/dist/src/server/stdio.d.ts.map +1 -0
  105. package/dist/src/server/stdio.js +69 -0
  106. package/dist/src/server/stdio.js.map +1 -0
  107. package/dist/src/transport.d.ts +7 -0
  108. package/dist/src/transport.d.ts.map +1 -0
  109. package/dist/src/transport.js +195 -0
  110. package/dist/src/transport.js.map +1 -0
  111. package/dist/src/types.d.ts +116 -0
  112. package/dist/src/types.d.ts.map +1 -0
  113. package/dist/src/types.js +14 -0
  114. package/dist/src/types.js.map +1 -0
  115. package/dist/src/validation.d.ts +7 -0
  116. package/dist/src/validation.d.ts.map +1 -0
  117. package/dist/src/validation.js +209 -0
  118. package/dist/src/validation.js.map +1 -0
  119. package/package.json +64 -0
  120. package/src/client/auth.ts +1076 -0
  121. package/src/client/composition.ts +708 -0
  122. package/src/client/content.ts +510 -0
  123. package/src/client/hooks.ts +1368 -0
  124. package/src/client/index.ts +28 -0
  125. package/src/client/transport.ts +408 -0
  126. package/src/client/types.ts +173 -0
  127. package/src/client/validation.ts +24 -0
  128. package/src/compaction.ts +196 -0
  129. package/src/content-upload.ts +205 -0
  130. package/src/draft/README.md +16 -0
  131. package/src/draft/ahp-codegen.lock.json +123 -0
  132. package/src/draft/generated.ts +19143 -0
  133. package/src/draft/index.ts +246 -0
  134. package/src/draft/schemas.ts +9413 -0
  135. package/src/draft-atomic.ts +119 -0
  136. package/src/draft-runtime.ts +365 -0
  137. package/src/elicitation.ts +254 -0
  138. package/src/errors.ts +30 -0
  139. package/src/framing.ts +56 -0
  140. package/src/generated.ts +2408 -0
  141. package/src/hook-runner.ts +310 -0
  142. package/src/index.ts +8 -0
  143. package/src/observation.ts +65 -0
  144. package/src/server/attachments.ts +128 -0
  145. package/src/server/hooks.ts +205 -0
  146. package/src/server/index.ts +18 -0
  147. package/src/server/node-crypto.d.ts +7 -0
  148. package/src/server/stdio.ts +81 -0
  149. package/src/transport.ts +273 -0
  150. package/src/types.ts +124 -0
  151. package/src/validation.ts +372 -0
@@ -0,0 +1,196 @@
1
+ import { validateEffect } from "./draft/index.js";
2
+ /** Serial host-side text compaction. Responses commit atomically. Only `applied`
3
+ * permits downstream use. Upload immutable UTF-8 bodies before wire exposure. */
4
+ export interface CompactionEffect {
5
+ type: string;
6
+ target?: string;
7
+ operation?: string;
8
+ value?: unknown;
9
+ text?: string;
10
+ reason?: string;
11
+ }
12
+ export interface CompactionObserver {
13
+ supplier: string;
14
+ run: (snapshot: any) => unknown;
15
+ }
16
+ export interface CompactionHook {
17
+ supplier: string;
18
+ failurePolicy: "fail-open" | "fail-closed";
19
+ run: (snapshot: any) => CompactionEffect[];
20
+ }
21
+ const copy = <T>(v: T): T => structuredClone(v);
22
+ export function compactionCapabilities(
23
+ boundary: "before" | "after",
24
+ observeOnly = false,
25
+ ): any {
26
+ if (boundary !== "before" && boundary !== "after")
27
+ throw new Error("unknown boundary");
28
+ if (observeOnly) return { effects: [], modify: {} };
29
+ return {
30
+ effects: [
31
+ "modify",
32
+ "message",
33
+ ...(boundary === "before" ? ["return", "deny"] : []),
34
+ ],
35
+ modify: {
36
+ [boundary === "before" ? "instructions" : "summary"]: {
37
+ replace: true,
38
+ merge: false,
39
+ },
40
+ },
41
+ };
42
+ }
43
+ export function runCompaction(
44
+ instructions: string,
45
+ before: CompactionHook[] = [],
46
+ after: CompactionHook[] = [],
47
+ options: {
48
+ generate?: (instructions: string) => string;
49
+ itemId?: string;
50
+ observeOnly?: boolean;
51
+ observers?: CompactionObserver[];
52
+ } = {},
53
+ ): any {
54
+ const itemId = options.itemId ?? "summary-1";
55
+ if (typeof instructions !== "string" || typeof itemId !== "string" || !itemId)
56
+ throw new Error("invalid input");
57
+ for (const h of [...before, ...after])
58
+ if (
59
+ typeof h.supplier !== "string" ||
60
+ !h.supplier ||
61
+ !["fail-open", "fail-closed"].includes(h.failurePolicy) ||
62
+ typeof h.run !== "function"
63
+ )
64
+ throw new Error("invalid hook");
65
+ if (options.observers && !options.observeOnly)
66
+ throw new Error("observers require observeOnly");
67
+ for (const o of options.observers ?? [])
68
+ if (
69
+ typeof o.supplier !== "string" ||
70
+ !o.supplier ||
71
+ typeof o.run !== "function"
72
+ )
73
+ throw new Error("invalid observer");
74
+ let state: any = {
75
+ instructions,
76
+ candidate: null,
77
+ summary: null,
78
+ bodies: {},
79
+ messages: [],
80
+ denied: false,
81
+ };
82
+ const seen: any[] = [],
83
+ failures: any[] = [];
84
+ const summary = (staged: any, body: string) => {
85
+ const ref =
86
+ "urn:ahp:compaction:utf8:" +
87
+ Array.from(new TextEncoder().encode(body), (b) =>
88
+ b.toString(16).padStart(2, "0"),
89
+ ).join("");
90
+ staged.bodies[ref] = body;
91
+ return { id: itemId, ref };
92
+ };
93
+ const pipeline = (boundary: "before" | "after", hooks: CompactionHook[]) => {
94
+ const caps = compactionCapabilities(
95
+ boundary,
96
+ options.observeOnly === true && boundary === "after",
97
+ );
98
+ for (const hook of hooks) {
99
+ const snapshot = { ...copy(state), boundary, capabilities: caps };
100
+ seen.push(copy(snapshot));
101
+ try {
102
+ const effects = hook.run(copy(snapshot));
103
+ if (!Array.isArray(effects)) throw new Error("effects must be array");
104
+ const staged = copy(state);
105
+ for (const e of effects) {
106
+ if (
107
+ !e ||
108
+ typeof e !== "object" ||
109
+ !validateEffect(e).ok ||
110
+ !caps.effects.includes(e.type)
111
+ )
112
+ throw new Error("unsupported effect");
113
+ if (e.type === "modify") {
114
+ if (
115
+ e.target !==
116
+ (boundary === "before" ? "instructions" : "summary") ||
117
+ e.operation !== "replace" ||
118
+ typeof e.value !== "string"
119
+ )
120
+ throw new Error("invalid modification");
121
+ if (boundary === "before") staged.instructions = e.value;
122
+ else staged.summary = summary(staged, e.value);
123
+ } else if (
124
+ e.type === "deny" &&
125
+ (typeof e.reason !== "string" || !e.reason)
126
+ )
127
+ throw new Error("denial requires reason");
128
+ else if (e.type === "return" && typeof e.value !== "string")
129
+ throw new Error("summary must be text");
130
+ else if (e.type === "message" && typeof e.text !== "string")
131
+ throw new Error("message must be text");
132
+ }
133
+ if (staged.instructions !== state.instructions) staged.candidate = null;
134
+ for (const e of effects) {
135
+ if (e.type === "return")
136
+ staged.candidate = { body: e.value, supplier: hook.supplier };
137
+ else if (e.type === "deny") staged.denied = true;
138
+ else if (e.type === "message") staged.messages.push(e.text);
139
+ }
140
+ state = staged;
141
+ } catch {
142
+ failures.push({ boundary, supplier: hook.supplier });
143
+ if (
144
+ hook.failurePolicy === "fail-closed" &&
145
+ !(options.observeOnly && boundary === "after")
146
+ )
147
+ return false;
148
+ }
149
+ if (state.denied) return false;
150
+ }
151
+ return true;
152
+ };
153
+ let generated = false,
154
+ applied = false,
155
+ provenance: any = null;
156
+ if (pipeline("before", before)) {
157
+ let body: string;
158
+ if (state.candidate !== null) {
159
+ body = state.candidate.body;
160
+ provenance = { kind: "supplied", supplier: state.candidate.supplier };
161
+ } else {
162
+ body = (options.generate ?? ((v) => "summary:" + v))(state.instructions);
163
+ if (typeof body !== "string")
164
+ throw new Error("generator must return text");
165
+ generated = true;
166
+ provenance = { kind: "generated" };
167
+ }
168
+ state.summary = summary(state, body);
169
+ applied = options.observeOnly ? true : pipeline("after", after);
170
+ }
171
+ const result = { ...state, seen, failures, generated, provenance, applied };
172
+ if (options.observeOnly && applied) {
173
+ for (const observer of [...after, ...(options.observers ?? [])]) {
174
+ const snapshot = {
175
+ ...copy(state),
176
+ boundary: "after",
177
+ applied: true,
178
+ generated,
179
+ provenance: copy(provenance),
180
+ capabilities: compactionCapabilities("after", true),
181
+ };
182
+ seen.push(copy(snapshot));
183
+ const notify = observer.run;
184
+ // Scheduling never calls user code inline or awaits its returned promise.
185
+ // Browser/Node observers must yield for I/O; blocking native work belongs
186
+ // in a host worker. The unref'd timer cannot keep Node alive on shutdown.
187
+ const timer = setTimeout(() => {
188
+ void Promise.resolve()
189
+ .then(() => notify(snapshot))
190
+ .catch(() => {});
191
+ }, 0);
192
+ (timer as unknown as { unref?: () => void }).unref?.();
193
+ }
194
+ }
195
+ return result;
196
+ }
@@ -0,0 +1,205 @@
1
+ /** Normative HTTP content upload. Event authentication is deliberately not an input. */
2
+ export interface UploadConfiguration {
3
+ endpoint: string;
4
+ auth?: { type: "bearer"; tokenEnv: string; [key: string]: unknown };
5
+ timeoutMs?: number;
6
+ maxBytes?: number;
7
+ [key: string]: unknown;
8
+ }
9
+ export interface BodyReference {
10
+ ref: string;
11
+ size: number;
12
+ sha256: string;
13
+ }
14
+ /** Check the receiver descriptor before exposing a body reference. */
15
+ export function validateBodyReference(
16
+ value: unknown,
17
+ size: number,
18
+ sha256: string,
19
+ ): BodyReference {
20
+ if (!value || typeof value !== "object" || Array.isArray(value))
21
+ throw Error("Invalid upload descriptor");
22
+ const body = value as Record<string, unknown>;
23
+ if (
24
+ Object.keys(body).some((key) => !["ref", "size", "sha256"].includes(key)) ||
25
+ typeof body.ref !== "string" ||
26
+ !body.ref ||
27
+ !Number.isSafeInteger(body.size) ||
28
+ body.size !== size ||
29
+ typeof body.sha256 !== "string" ||
30
+ !/^[a-f0-9]{64}$/.test(body.sha256) ||
31
+ body.sha256 !== sha256
32
+ )
33
+ throw Error("Unconfirmed bytes");
34
+ return { ref: body.ref, size, sha256 };
35
+ }
36
+ export async function uploadContent(
37
+ config: UploadConfiguration,
38
+ bytes: Uint8Array,
39
+ options: {
40
+ resolveToken?: (name: string) => string | undefined;
41
+ allowLoopback?: boolean;
42
+ } = {},
43
+ ): Promise<BodyReference> {
44
+ if (
45
+ !config ||
46
+ typeof config.endpoint !== "string" ||
47
+ (config.timeoutMs !== undefined &&
48
+ (!Number.isSafeInteger(config.timeoutMs) || config.timeoutMs <= 0)) ||
49
+ (config.maxBytes !== undefined &&
50
+ (!Number.isSafeInteger(config.maxBytes) || config.maxBytes < 0))
51
+ )
52
+ throw Error("Invalid upload configuration");
53
+ const url = new URL(config.endpoint);
54
+ if (
55
+ url.username ||
56
+ url.password ||
57
+ url.hash ||
58
+ (url.protocol !== "https:" &&
59
+ !(
60
+ options.allowLoopback &&
61
+ url.protocol === "http:" &&
62
+ ["127.0.0.1", "localhost", "[::1]"].includes(url.hostname)
63
+ ))
64
+ )
65
+ throw Error("Unsafe upload endpoint");
66
+ if (!(bytes instanceof Uint8Array)) throw Error("Invalid content bytes");
67
+ const snapshot = new Uint8Array(bytes);
68
+ if (snapshot.length > (config.maxBytes ?? 52428800))
69
+ throw Error("Upload size limit");
70
+ const hash = new Uint8Array(await crypto.subtle.digest("SHA-256", snapshot));
71
+ const sha256 = Array.from(hash, (byte) =>
72
+ byte.toString(16).padStart(2, "0"),
73
+ ).join("");
74
+ const headers: Record<string, string> = {
75
+ "content-type": "application/octet-stream",
76
+ "content-length": String(snapshot.length),
77
+ "ahp-content-sha256": sha256,
78
+ };
79
+ if (config.auth !== undefined) {
80
+ if (
81
+ !config.auth ||
82
+ config.auth.type !== "bearer" ||
83
+ typeof config.auth.tokenEnv !== "string" ||
84
+ !/^[A-Za-z_][A-Za-z0-9_]*$/.test(config.auth.tokenEnv)
85
+ )
86
+ throw Error("Invalid upload authentication");
87
+ const token = options.resolveToken?.(config.auth.tokenEnv);
88
+ if (typeof token !== "string" || !token)
89
+ throw Error("Missing upload credential");
90
+ headers.authorization = `Bearer ${token}`;
91
+ }
92
+ const response = await fetch(url, {
93
+ method: "POST",
94
+ headers,
95
+ body: snapshot,
96
+ redirect: "error",
97
+ signal: AbortSignal.timeout(config.timeoutMs ?? 15000),
98
+ });
99
+ if (
100
+ response.status !== 201 ||
101
+ response.headers
102
+ .get("content-type")
103
+ ?.split(";")[0]
104
+ ?.trim()
105
+ .toLowerCase() !== "application/json"
106
+ ) {
107
+ await response.body?.cancel();
108
+ throw Error(`Content upload failed: HTTP ${response.status}`);
109
+ }
110
+ return validateBodyReference(await response.json(), snapshot.length, sha256);
111
+ }
112
+ export interface NormalizedContentInput {
113
+ id: string;
114
+ kind: string;
115
+ mediaType: string;
116
+ ref?: string;
117
+ bytes?: Uint8Array;
118
+ category?: string;
119
+ role?: string;
120
+ parentItemId?: string;
121
+ synthesized?: boolean;
122
+ }
123
+ export interface NormalizedContentView {
124
+ id: string;
125
+ kind: string;
126
+ mediaType: string;
127
+ category?: string;
128
+ role?: string;
129
+ parentItemId?: string;
130
+ synthesized?: boolean;
131
+ selection: "body" | "metadata" | "omit";
132
+ body?: BodyReference;
133
+ gap?: { reason: string };
134
+ }
135
+ /** Select once per subscriber. Return no body reference until upload confirms availability. */
136
+ export async function prepareWireContent(
137
+ items: readonly NormalizedContentInput[],
138
+ options: {
139
+ subscription?: string;
140
+ selection: Record<string, "body" | "metadata" | "omit">;
141
+ authorized: (item: NormalizedContentInput) => boolean;
142
+ upload: (bytes: Uint8Array) => Promise<BodyReference>;
143
+ mode: "intercept" | "observe";
144
+ failClosed: boolean;
145
+ timeoutMs?: number;
146
+ maxBytes?: number;
147
+ },
148
+ ): Promise<NormalizedContentView[]> {
149
+ const result: NormalizedContentView[] = [];
150
+ for (const item of items) {
151
+ const { id, kind, mediaType, category, role, parentItemId, synthesized } =
152
+ item;
153
+ const view: NormalizedContentView = {
154
+ id,
155
+ kind,
156
+ mediaType,
157
+ ...(synthesized === undefined ? {} : { synthesized }),
158
+ ...(category ? { category } : {}),
159
+ ...(role ? { role } : {}),
160
+ ...(parentItemId ? { parentItemId } : {}),
161
+ selection:
162
+ options.selection[category ?? kind] ??
163
+ options.selection.default ??
164
+ "metadata",
165
+ };
166
+ if (view.selection === "body") {
167
+ if (!options.authorized(item))
168
+ view.gap = { reason: "permission_withheld" };
169
+ else if (item.bytes === undefined)
170
+ view.gap = { reason: "source_unavailable" };
171
+ else if (item.bytes.length > (options.maxBytes ?? 52428800))
172
+ view.gap = { reason: "limit_exceeded" };
173
+ else
174
+ try {
175
+ const bytes = new Uint8Array(item.bytes);
176
+ let timer: ReturnType<typeof setTimeout> | undefined;
177
+ let body: BodyReference;
178
+ try {
179
+ body = await Promise.race([
180
+ options.upload(bytes.slice()),
181
+ new Promise<never>((_, reject) => {
182
+ timer = setTimeout(
183
+ () => reject(Error("Upload timeout")),
184
+ options.timeoutMs ?? 15000,
185
+ );
186
+ }),
187
+ ]);
188
+ } finally {
189
+ if (timer !== undefined) clearTimeout(timer);
190
+ }
191
+ const hash = Array.from(
192
+ new Uint8Array(await crypto.subtle.digest("SHA-256", bytes)),
193
+ (byte) => byte.toString(16).padStart(2, "0"),
194
+ ).join("");
195
+ view.body = validateBodyReference(body, bytes.length, hash);
196
+ } catch {
197
+ view.gap = { reason: "transfer_failed" };
198
+ }
199
+ if (view.gap && options.mode === "intercept" && options.failClosed)
200
+ throw Error(`Content delivery failure: ${view.gap.reason}`);
201
+ }
202
+ result.push(view);
203
+ }
204
+ return result;
205
+ }
@@ -0,0 +1,16 @@
1
+ # Draft entrypoint
2
+
3
+ `agenthooksprotocol/draft` provides generated models and codecs for the
4
+ canonical draft catalogue, schema-backed validators, and reference runtime
5
+ helpers. It is separate from the root deny/no-effect `tool.before` stdio runner;
6
+ generated catalogue coverage is not full runtime support.
7
+
8
+ See the [draft API guide](../../DRAFT-API.md) for validation, local versus wire
9
+ identity, receiver-allocated content uploads, preparation callbacks, and runtime
10
+ limits. `draftCodecs` is permissive decoding, not authorization validation.
11
+
12
+ Protocol authority lives in the sibling repository's
13
+ [`spec/draft`](../../../../../agent-hooks-protocol/spec/draft/index.md) and
14
+ [`schema/draft`](../../../../../agent-hooks-protocol/schema/draft/manifest.json).
15
+ Generated files in this directory must be regenerated from that source, not
16
+ edited to define a different protocol contract.
@@ -0,0 +1,123 @@
1
+ {
2
+ "sourceRepository": "agenthooksprotocol/agent-hooks-protocol",
3
+ "sourceCommit": "472c16e97cfd456d98cefa0c2a3d23df2f57dbcf",
4
+ "schemaRevision": "draft",
5
+ "protocolVersion": "draft",
6
+ "generatorVersion": "0.1.0",
7
+ "language": "typescript",
8
+ "schemaManifestSha256": "050852ec662d5a29c80d8951252b54a5fa48bb5e6c7ce08d88c45e614964a60a",
9
+ "documents": [
10
+ {
11
+ "path": "schema/draft/capabilities-request.schema.json",
12
+ "sha256": "c139a439d0e21bc59bd2e69b596e684484ba0052a7fdf6f2ec0810d1a5fad299"
13
+ },
14
+ {
15
+ "path": "schema/draft/capabilities-response.schema.json",
16
+ "sha256": "9e3b33d4bde82670770ad598dd70bb276bda120c4429783747dc91defc6911a8"
17
+ },
18
+ {
19
+ "path": "schema/draft/capabilities.schema.json",
20
+ "sha256": "c29b8effdb09a492bc791885ece3d59a824c4082771c782f41cacbb2304fc103"
21
+ },
22
+ {
23
+ "path": "schema/draft/catalogue-event.schema.json",
24
+ "sha256": "06ed4bc91478a93c8edc3b454d58e18e581f537c65fd1688f1533bd058bdbf4e"
25
+ },
26
+ {
27
+ "path": "schema/draft/common.schema.json",
28
+ "sha256": "d46f541db8a5f2a401a6b2b77f1d93e75076847e8f2b2e5d5ed201b8562107e5"
29
+ },
30
+ {
31
+ "path": "schema/draft/content-item.schema.json",
32
+ "sha256": "ef15f47f3f57f3004e89046a79429944b5361e302719f4f45bbf819667a13a38"
33
+ },
34
+ {
35
+ "path": "schema/draft/content-reference.schema.json",
36
+ "sha256": "24221c52d428c6104ce6f526f278d000169777f866adbc2c2de90a635469d692"
37
+ },
38
+ {
39
+ "path": "schema/draft/content-selection.schema.json",
40
+ "sha256": "fe57bce4a7a6c7a8d51728634349621ba327b5ef118bc60b1c330260392e2a62"
41
+ },
42
+ {
43
+ "path": "schema/draft/content-upload.schema.json",
44
+ "sha256": "a405adb54b8de11f3814840f7cbcd54d76cdcc2e25d00942f1c1755eb05c6753"
45
+ },
46
+ {
47
+ "path": "schema/draft/deny-effect.schema.json",
48
+ "sha256": "8ff24b87d1e58764ba1d200446732a216bf72d870a5f4cba72f704020622cd90"
49
+ },
50
+ {
51
+ "path": "schema/draft/effect.schema.json",
52
+ "sha256": "1448151926563244194ed56b15e3074ddfc8ec8c10889f2e42ab49d66be2d031"
53
+ },
54
+ {
55
+ "path": "schema/draft/execution-event.schema.json",
56
+ "sha256": "d9b13cf28e20eced629cfe8eb822eb6dfb2ac453fe14e6d2334c2f4b2793512a"
57
+ },
58
+ {
59
+ "path": "schema/draft/extensions.schema.json",
60
+ "sha256": "5722deafc1bf750e19e033702659fecd6a0804e598d114ebbd9aef9daac48835"
61
+ },
62
+ {
63
+ "path": "schema/draft/interaction-event.schema.json",
64
+ "sha256": "34550586dde5748f14df80e8879b5eec5e3b2ae5353ef84b0208e9248d6a0fb2"
65
+ },
66
+ {
67
+ "path": "schema/draft/intercept-deny-response.schema.json",
68
+ "sha256": "74f024322660b73e370ad086bde82edf0f94bbe7c440592de4ea083e292bcbf6"
69
+ },
70
+ {
71
+ "path": "schema/draft/intercept-no-effect-response.schema.json",
72
+ "sha256": "65429ed03e5580fbd906331f57d60042c18f97eb43d1103140ed9e7101642c16"
73
+ },
74
+ {
75
+ "path": "schema/draft/intercept-request.schema.json",
76
+ "sha256": "fbd5ed20681d918c8647382de6a2bc07de14a7ac57f756e68d2f3293043d534e"
77
+ },
78
+ {
79
+ "path": "schema/draft/intercept-response.schema.json",
80
+ "sha256": "9b71855630e8f5194631395ba907696dea3cd232884aaea783bfe9341711404f"
81
+ },
82
+ {
83
+ "path": "schema/draft/json-rpc-message.schema.json",
84
+ "sha256": "721a8e485e855863915c982368830d28091b8fd83f61e077d12c539714940ffa"
85
+ },
86
+ {
87
+ "path": "schema/draft/mcp-elicitation.schema.json",
88
+ "sha256": "52473b9e5dda9c514081319c9543d03a6ac85997a8fa98355b00502819f99e69"
89
+ },
90
+ {
91
+ "path": "schema/draft/observe-notification.schema.json",
92
+ "sha256": "27255ccd1a6d0fa788161825f4df74f7e0b3c074a8dc7c8cdeb7e07df11d55cf"
93
+ },
94
+ {
95
+ "path": "schema/draft/registration.schema.json",
96
+ "sha256": "3788ae90ee2aa057473ed03833f5310584d531e90a7f50b00541b013ab0a1c11"
97
+ },
98
+ {
99
+ "path": "schema/draft/schema.json",
100
+ "sha256": "191b1fd79f7550f69e6f2bb39ec7953fac727eed5721c7a36fb30d8fc029e8d0"
101
+ },
102
+ {
103
+ "path": "schema/draft/session-end.schema.json",
104
+ "sha256": "9d42bb96f2114e6b31db34f2fc1f40244c45e259c0dd27d2e3d1ea85bdc98cbc"
105
+ },
106
+ {
107
+ "path": "schema/draft/session-start.schema.json",
108
+ "sha256": "11da44d294f939941f19caa4b614a0e48743ceafdb3da70a5eb020a003bc3580"
109
+ },
110
+ {
111
+ "path": "schema/draft/task-workspace-event.schema.json",
112
+ "sha256": "9a11955ba26ca3d2d7f9362f82460d8247f77720d2991b54117b88b42338be21"
113
+ },
114
+ {
115
+ "path": "schema/draft/tool-after.schema.json",
116
+ "sha256": "a5f110d150df12ed4bb0ae7e4b8fd7b5dbb3973da7499a8f9931184c6824408a"
117
+ },
118
+ {
119
+ "path": "schema/draft/tool-before.schema.json",
120
+ "sha256": "8edb0bb32cd96b3e15e7a82d64f964b746cd51e3d98b0270d55a3e30ac57aef6"
121
+ }
122
+ ]
123
+ }