@agent-phonon/protocol 0.2.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 (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -0
  3. package/dist/index.d.ts +24 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +24 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/json-schema/_index.json +3794 -0
  8. package/dist/json-schema/connect.hello.json +117 -0
  9. package/dist/json-schema/discovery.changed.json +190 -0
  10. package/dist/json-schema/discovery.get.json +183 -0
  11. package/dist/json-schema/discovery.list.json +182 -0
  12. package/dist/json-schema/document.prepare_upload.json +96 -0
  13. package/dist/json-schema/document.send.json +165 -0
  14. package/dist/json-schema/hook.fired.json +100 -0
  15. package/dist/json-schema/hook.resolve.json +96 -0
  16. package/dist/json-schema/interaction.cancel.json +48 -0
  17. package/dist/json-schema/interaction.request.json +376 -0
  18. package/dist/json-schema/interaction.response.json +68 -0
  19. package/dist/json-schema/project.create.json +89 -0
  20. package/dist/json-schema/project.get.json +76 -0
  21. package/dist/json-schema/project.git.deleteBranch.json +64 -0
  22. package/dist/json-schema/project.list.json +72 -0
  23. package/dist/json-schema/project.remove.json +69 -0
  24. package/dist/json-schema/project.worktree.create.json +88 -0
  25. package/dist/json-schema/project.worktree.list.json +77 -0
  26. package/dist/json-schema/project.worktree.remove.json +61 -0
  27. package/dist/json-schema/session.compress.json +72 -0
  28. package/dist/json-schema/session.create.json +128 -0
  29. package/dist/json-schema/session.inject.json +72 -0
  30. package/dist/json-schema/session.interrupt.json +58 -0
  31. package/dist/json-schema/session.list.json +127 -0
  32. package/dist/json-schema/session.send.json +132 -0
  33. package/dist/json-schema/session.status.json +94 -0
  34. package/dist/json-schema/session.switchModel.json +73 -0
  35. package/dist/json-schema/session.terminate.json +54 -0
  36. package/dist/json-schema/skill.install.json +171 -0
  37. package/dist/json-schema/skill.list.json +101 -0
  38. package/dist/json-schema/skill.uninstall.json +76 -0
  39. package/dist/json-schema/stream.ack.json +36 -0
  40. package/dist/json-schema/stream.event.json +381 -0
  41. package/dist/schemas/capabilities.d.ts +90 -0
  42. package/dist/schemas/capabilities.d.ts.map +1 -0
  43. package/dist/schemas/capabilities.js +59 -0
  44. package/dist/schemas/capabilities.js.map +1 -0
  45. package/dist/schemas/common.d.ts +66 -0
  46. package/dist/schemas/common.d.ts.map +1 -0
  47. package/dist/schemas/common.js +97 -0
  48. package/dist/schemas/common.js.map +1 -0
  49. package/dist/schemas/connect.d.ts +111 -0
  50. package/dist/schemas/connect.d.ts.map +1 -0
  51. package/dist/schemas/connect.js +46 -0
  52. package/dist/schemas/connect.js.map +1 -0
  53. package/dist/schemas/device.d.ts +221 -0
  54. package/dist/schemas/device.d.ts.map +1 -0
  55. package/dist/schemas/device.js +59 -0
  56. package/dist/schemas/device.js.map +1 -0
  57. package/dist/schemas/discovery.d.ts +892 -0
  58. package/dist/schemas/discovery.d.ts.map +1 -0
  59. package/dist/schemas/discovery.js +66 -0
  60. package/dist/schemas/discovery.js.map +1 -0
  61. package/dist/schemas/document.d.ts +351 -0
  62. package/dist/schemas/document.d.ts.map +1 -0
  63. package/dist/schemas/document.js +103 -0
  64. package/dist/schemas/document.js.map +1 -0
  65. package/dist/schemas/env.d.ts +265 -0
  66. package/dist/schemas/env.d.ts.map +1 -0
  67. package/dist/schemas/env.js +44 -0
  68. package/dist/schemas/env.js.map +1 -0
  69. package/dist/schemas/file.d.ts +274 -0
  70. package/dist/schemas/file.d.ts.map +1 -0
  71. package/dist/schemas/file.js +72 -0
  72. package/dist/schemas/file.js.map +1 -0
  73. package/dist/schemas/hook.d.ts +132 -0
  74. package/dist/schemas/hook.d.ts.map +1 -0
  75. package/dist/schemas/hook.js +58 -0
  76. package/dist/schemas/hook.js.map +1 -0
  77. package/dist/schemas/interaction.d.ts +1583 -0
  78. package/dist/schemas/interaction.d.ts.map +1 -0
  79. package/dist/schemas/interaction.js +112 -0
  80. package/dist/schemas/interaction.js.map +1 -0
  81. package/dist/schemas/jsonrpc.d.ts +314 -0
  82. package/dist/schemas/jsonrpc.d.ts.map +1 -0
  83. package/dist/schemas/jsonrpc.js +64 -0
  84. package/dist/schemas/jsonrpc.js.map +1 -0
  85. package/dist/schemas/methods.d.ts +3826 -0
  86. package/dist/schemas/methods.d.ts.map +1 -0
  87. package/dist/schemas/methods.js +311 -0
  88. package/dist/schemas/methods.js.map +1 -0
  89. package/dist/schemas/policy.d.ts +81 -0
  90. package/dist/schemas/policy.d.ts.map +1 -0
  91. package/dist/schemas/policy.js +66 -0
  92. package/dist/schemas/policy.js.map +1 -0
  93. package/dist/schemas/project.d.ts +506 -0
  94. package/dist/schemas/project.d.ts.map +1 -0
  95. package/dist/schemas/project.js +148 -0
  96. package/dist/schemas/project.js.map +1 -0
  97. package/dist/schemas/session.d.ts +730 -0
  98. package/dist/schemas/session.d.ts.map +1 -0
  99. package/dist/schemas/session.js +287 -0
  100. package/dist/schemas/session.js.map +1 -0
  101. package/dist/schemas/skill.d.ts +465 -0
  102. package/dist/schemas/skill.d.ts.map +1 -0
  103. package/dist/schemas/skill.js +103 -0
  104. package/dist/schemas/skill.js.map +1 -0
  105. package/dist/schemas/stream.d.ts +688 -0
  106. package/dist/schemas/stream.d.ts.map +1 -0
  107. package/dist/schemas/stream.js +133 -0
  108. package/dist/schemas/stream.js.map +1 -0
  109. package/package.json +52 -0
  110. package/src/index.ts +24 -0
  111. package/src/schemas/capabilities.ts +62 -0
  112. package/src/schemas/common.ts +119 -0
  113. package/src/schemas/connect.ts +50 -0
  114. package/src/schemas/device.ts +67 -0
  115. package/src/schemas/discovery.ts +80 -0
  116. package/src/schemas/document.ts +121 -0
  117. package/src/schemas/env.ts +60 -0
  118. package/src/schemas/file.ts +97 -0
  119. package/src/schemas/hook.ts +66 -0
  120. package/src/schemas/interaction.ts +135 -0
  121. package/src/schemas/jsonrpc.ts +80 -0
  122. package/src/schemas/methods.ts +414 -0
  123. package/src/schemas/policy.ts +71 -0
  124. package/src/schemas/project.ts +185 -0
  125. package/src/schemas/session.ts +336 -0
  126. package/src/schemas/skill.ts +121 -0
  127. package/src/schemas/stream.ts +149 -0
@@ -0,0 +1,1583 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * 人机交互协议(design 平面③ / D21)。
4
+ *
5
+ * 场景:HITL 时、或 agent 主动想问人,发一个**可交互卡片/表单**(抽象结构),
6
+ * phonon → server 渲染给人(飞书卡片/网页/TG 按钮…由服务端决定,复用「甩锅服务端」原则),
7
+ * 人填完 → 原路返回 → 注入回 agent。
8
+ *
9
+ * 两个层次:
10
+ * - InteractionDirective :agent emit 的表单定义(skill 教,让任何模型都能发)
11
+ * - interaction.request :phonon → server 线协议(带 requestId,阻塞等回填)
12
+ * - interaction.response :server → phonon 线协议(人填完的值)
13
+ *
14
+ * 表单只定义**抽象字段结构**,不绑定任何渲染方式——服务端自由渲染。
15
+ */
16
+ /** 字段类型(抽象,渲染由服务端决定)。 */
17
+ export declare const FieldType: z.ZodEnum<["text", "textarea", "number", "boolean", "select", "multiselect", "date"]>;
18
+ export type FieldType = z.infer<typeof FieldType>;
19
+ export declare const FormFieldOption: z.ZodObject<{
20
+ label: z.ZodString;
21
+ value: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ value: string;
24
+ label: string;
25
+ }, {
26
+ value: string;
27
+ label: string;
28
+ }>;
29
+ export type FormFieldOption = z.infer<typeof FormFieldOption>;
30
+ export declare const FormField: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
31
+ type: z.ZodLiteral<"text">;
32
+ placeholder: z.ZodOptional<z.ZodString>;
33
+ defaultValue: z.ZodOptional<z.ZodString>;
34
+ key: z.ZodString;
35
+ label: z.ZodString;
36
+ required: z.ZodDefault<z.ZodBoolean>;
37
+ help: z.ZodOptional<z.ZodString>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ type: "text";
40
+ label: string;
41
+ key: string;
42
+ required: boolean;
43
+ placeholder?: string | undefined;
44
+ defaultValue?: string | undefined;
45
+ help?: string | undefined;
46
+ }, {
47
+ type: "text";
48
+ label: string;
49
+ key: string;
50
+ placeholder?: string | undefined;
51
+ defaultValue?: string | undefined;
52
+ required?: boolean | undefined;
53
+ help?: string | undefined;
54
+ }>, z.ZodObject<{
55
+ type: z.ZodLiteral<"textarea">;
56
+ placeholder: z.ZodOptional<z.ZodString>;
57
+ defaultValue: z.ZodOptional<z.ZodString>;
58
+ key: z.ZodString;
59
+ label: z.ZodString;
60
+ required: z.ZodDefault<z.ZodBoolean>;
61
+ help: z.ZodOptional<z.ZodString>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ type: "textarea";
64
+ label: string;
65
+ key: string;
66
+ required: boolean;
67
+ placeholder?: string | undefined;
68
+ defaultValue?: string | undefined;
69
+ help?: string | undefined;
70
+ }, {
71
+ type: "textarea";
72
+ label: string;
73
+ key: string;
74
+ placeholder?: string | undefined;
75
+ defaultValue?: string | undefined;
76
+ required?: boolean | undefined;
77
+ help?: string | undefined;
78
+ }>, z.ZodObject<{
79
+ type: z.ZodLiteral<"number">;
80
+ defaultValue: z.ZodOptional<z.ZodNumber>;
81
+ key: z.ZodString;
82
+ label: z.ZodString;
83
+ required: z.ZodDefault<z.ZodBoolean>;
84
+ help: z.ZodOptional<z.ZodString>;
85
+ }, "strip", z.ZodTypeAny, {
86
+ type: "number";
87
+ label: string;
88
+ key: string;
89
+ required: boolean;
90
+ defaultValue?: number | undefined;
91
+ help?: string | undefined;
92
+ }, {
93
+ type: "number";
94
+ label: string;
95
+ key: string;
96
+ defaultValue?: number | undefined;
97
+ required?: boolean | undefined;
98
+ help?: string | undefined;
99
+ }>, z.ZodObject<{
100
+ type: z.ZodLiteral<"boolean">;
101
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
102
+ key: z.ZodString;
103
+ label: z.ZodString;
104
+ required: z.ZodDefault<z.ZodBoolean>;
105
+ help: z.ZodOptional<z.ZodString>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ type: "boolean";
108
+ label: string;
109
+ key: string;
110
+ required: boolean;
111
+ defaultValue?: boolean | undefined;
112
+ help?: string | undefined;
113
+ }, {
114
+ type: "boolean";
115
+ label: string;
116
+ key: string;
117
+ defaultValue?: boolean | undefined;
118
+ required?: boolean | undefined;
119
+ help?: string | undefined;
120
+ }>, z.ZodObject<{
121
+ type: z.ZodLiteral<"select">;
122
+ options: z.ZodArray<z.ZodObject<{
123
+ label: z.ZodString;
124
+ value: z.ZodString;
125
+ }, "strip", z.ZodTypeAny, {
126
+ value: string;
127
+ label: string;
128
+ }, {
129
+ value: string;
130
+ label: string;
131
+ }>, "many">;
132
+ defaultValue: z.ZodOptional<z.ZodString>;
133
+ key: z.ZodString;
134
+ label: z.ZodString;
135
+ required: z.ZodDefault<z.ZodBoolean>;
136
+ help: z.ZodOptional<z.ZodString>;
137
+ }, "strip", z.ZodTypeAny, {
138
+ options: {
139
+ value: string;
140
+ label: string;
141
+ }[];
142
+ type: "select";
143
+ label: string;
144
+ key: string;
145
+ required: boolean;
146
+ defaultValue?: string | undefined;
147
+ help?: string | undefined;
148
+ }, {
149
+ options: {
150
+ value: string;
151
+ label: string;
152
+ }[];
153
+ type: "select";
154
+ label: string;
155
+ key: string;
156
+ defaultValue?: string | undefined;
157
+ required?: boolean | undefined;
158
+ help?: string | undefined;
159
+ }>, z.ZodObject<{
160
+ type: z.ZodLiteral<"multiselect">;
161
+ options: z.ZodArray<z.ZodObject<{
162
+ label: z.ZodString;
163
+ value: z.ZodString;
164
+ }, "strip", z.ZodTypeAny, {
165
+ value: string;
166
+ label: string;
167
+ }, {
168
+ value: string;
169
+ label: string;
170
+ }>, "many">;
171
+ defaultValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
172
+ key: z.ZodString;
173
+ label: z.ZodString;
174
+ required: z.ZodDefault<z.ZodBoolean>;
175
+ help: z.ZodOptional<z.ZodString>;
176
+ }, "strip", z.ZodTypeAny, {
177
+ options: {
178
+ value: string;
179
+ label: string;
180
+ }[];
181
+ type: "multiselect";
182
+ label: string;
183
+ key: string;
184
+ required: boolean;
185
+ defaultValue?: string[] | undefined;
186
+ help?: string | undefined;
187
+ }, {
188
+ options: {
189
+ value: string;
190
+ label: string;
191
+ }[];
192
+ type: "multiselect";
193
+ label: string;
194
+ key: string;
195
+ defaultValue?: string[] | undefined;
196
+ required?: boolean | undefined;
197
+ help?: string | undefined;
198
+ }>, z.ZodObject<{
199
+ type: z.ZodLiteral<"date">;
200
+ defaultValue: z.ZodOptional<z.ZodString>;
201
+ key: z.ZodString;
202
+ label: z.ZodString;
203
+ required: z.ZodDefault<z.ZodBoolean>;
204
+ help: z.ZodOptional<z.ZodString>;
205
+ }, "strip", z.ZodTypeAny, {
206
+ type: "date";
207
+ label: string;
208
+ key: string;
209
+ required: boolean;
210
+ defaultValue?: string | undefined;
211
+ help?: string | undefined;
212
+ }, {
213
+ type: "date";
214
+ label: string;
215
+ key: string;
216
+ defaultValue?: string | undefined;
217
+ required?: boolean | undefined;
218
+ help?: string | undefined;
219
+ }>]>;
220
+ export type FormField = z.infer<typeof FormField>;
221
+ /** 表单/卡片定义(抽象)。 */
222
+ export declare const InteractionForm: z.ZodObject<{
223
+ title: z.ZodString;
224
+ /** 卡片正文/说明(可选)。 */
225
+ description: z.ZodOptional<z.ZodString>;
226
+ fields: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
227
+ type: z.ZodLiteral<"text">;
228
+ placeholder: z.ZodOptional<z.ZodString>;
229
+ defaultValue: z.ZodOptional<z.ZodString>;
230
+ key: z.ZodString;
231
+ label: z.ZodString;
232
+ required: z.ZodDefault<z.ZodBoolean>;
233
+ help: z.ZodOptional<z.ZodString>;
234
+ }, "strip", z.ZodTypeAny, {
235
+ type: "text";
236
+ label: string;
237
+ key: string;
238
+ required: boolean;
239
+ placeholder?: string | undefined;
240
+ defaultValue?: string | undefined;
241
+ help?: string | undefined;
242
+ }, {
243
+ type: "text";
244
+ label: string;
245
+ key: string;
246
+ placeholder?: string | undefined;
247
+ defaultValue?: string | undefined;
248
+ required?: boolean | undefined;
249
+ help?: string | undefined;
250
+ }>, z.ZodObject<{
251
+ type: z.ZodLiteral<"textarea">;
252
+ placeholder: z.ZodOptional<z.ZodString>;
253
+ defaultValue: z.ZodOptional<z.ZodString>;
254
+ key: z.ZodString;
255
+ label: z.ZodString;
256
+ required: z.ZodDefault<z.ZodBoolean>;
257
+ help: z.ZodOptional<z.ZodString>;
258
+ }, "strip", z.ZodTypeAny, {
259
+ type: "textarea";
260
+ label: string;
261
+ key: string;
262
+ required: boolean;
263
+ placeholder?: string | undefined;
264
+ defaultValue?: string | undefined;
265
+ help?: string | undefined;
266
+ }, {
267
+ type: "textarea";
268
+ label: string;
269
+ key: string;
270
+ placeholder?: string | undefined;
271
+ defaultValue?: string | undefined;
272
+ required?: boolean | undefined;
273
+ help?: string | undefined;
274
+ }>, z.ZodObject<{
275
+ type: z.ZodLiteral<"number">;
276
+ defaultValue: z.ZodOptional<z.ZodNumber>;
277
+ key: z.ZodString;
278
+ label: z.ZodString;
279
+ required: z.ZodDefault<z.ZodBoolean>;
280
+ help: z.ZodOptional<z.ZodString>;
281
+ }, "strip", z.ZodTypeAny, {
282
+ type: "number";
283
+ label: string;
284
+ key: string;
285
+ required: boolean;
286
+ defaultValue?: number | undefined;
287
+ help?: string | undefined;
288
+ }, {
289
+ type: "number";
290
+ label: string;
291
+ key: string;
292
+ defaultValue?: number | undefined;
293
+ required?: boolean | undefined;
294
+ help?: string | undefined;
295
+ }>, z.ZodObject<{
296
+ type: z.ZodLiteral<"boolean">;
297
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
298
+ key: z.ZodString;
299
+ label: z.ZodString;
300
+ required: z.ZodDefault<z.ZodBoolean>;
301
+ help: z.ZodOptional<z.ZodString>;
302
+ }, "strip", z.ZodTypeAny, {
303
+ type: "boolean";
304
+ label: string;
305
+ key: string;
306
+ required: boolean;
307
+ defaultValue?: boolean | undefined;
308
+ help?: string | undefined;
309
+ }, {
310
+ type: "boolean";
311
+ label: string;
312
+ key: string;
313
+ defaultValue?: boolean | undefined;
314
+ required?: boolean | undefined;
315
+ help?: string | undefined;
316
+ }>, z.ZodObject<{
317
+ type: z.ZodLiteral<"select">;
318
+ options: z.ZodArray<z.ZodObject<{
319
+ label: z.ZodString;
320
+ value: z.ZodString;
321
+ }, "strip", z.ZodTypeAny, {
322
+ value: string;
323
+ label: string;
324
+ }, {
325
+ value: string;
326
+ label: string;
327
+ }>, "many">;
328
+ defaultValue: z.ZodOptional<z.ZodString>;
329
+ key: z.ZodString;
330
+ label: z.ZodString;
331
+ required: z.ZodDefault<z.ZodBoolean>;
332
+ help: z.ZodOptional<z.ZodString>;
333
+ }, "strip", z.ZodTypeAny, {
334
+ options: {
335
+ value: string;
336
+ label: string;
337
+ }[];
338
+ type: "select";
339
+ label: string;
340
+ key: string;
341
+ required: boolean;
342
+ defaultValue?: string | undefined;
343
+ help?: string | undefined;
344
+ }, {
345
+ options: {
346
+ value: string;
347
+ label: string;
348
+ }[];
349
+ type: "select";
350
+ label: string;
351
+ key: string;
352
+ defaultValue?: string | undefined;
353
+ required?: boolean | undefined;
354
+ help?: string | undefined;
355
+ }>, z.ZodObject<{
356
+ type: z.ZodLiteral<"multiselect">;
357
+ options: z.ZodArray<z.ZodObject<{
358
+ label: z.ZodString;
359
+ value: z.ZodString;
360
+ }, "strip", z.ZodTypeAny, {
361
+ value: string;
362
+ label: string;
363
+ }, {
364
+ value: string;
365
+ label: string;
366
+ }>, "many">;
367
+ defaultValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
368
+ key: z.ZodString;
369
+ label: z.ZodString;
370
+ required: z.ZodDefault<z.ZodBoolean>;
371
+ help: z.ZodOptional<z.ZodString>;
372
+ }, "strip", z.ZodTypeAny, {
373
+ options: {
374
+ value: string;
375
+ label: string;
376
+ }[];
377
+ type: "multiselect";
378
+ label: string;
379
+ key: string;
380
+ required: boolean;
381
+ defaultValue?: string[] | undefined;
382
+ help?: string | undefined;
383
+ }, {
384
+ options: {
385
+ value: string;
386
+ label: string;
387
+ }[];
388
+ type: "multiselect";
389
+ label: string;
390
+ key: string;
391
+ defaultValue?: string[] | undefined;
392
+ required?: boolean | undefined;
393
+ help?: string | undefined;
394
+ }>, z.ZodObject<{
395
+ type: z.ZodLiteral<"date">;
396
+ defaultValue: z.ZodOptional<z.ZodString>;
397
+ key: z.ZodString;
398
+ label: z.ZodString;
399
+ required: z.ZodDefault<z.ZodBoolean>;
400
+ help: z.ZodOptional<z.ZodString>;
401
+ }, "strip", z.ZodTypeAny, {
402
+ type: "date";
403
+ label: string;
404
+ key: string;
405
+ required: boolean;
406
+ defaultValue?: string | undefined;
407
+ help?: string | undefined;
408
+ }, {
409
+ type: "date";
410
+ label: string;
411
+ key: string;
412
+ defaultValue?: string | undefined;
413
+ required?: boolean | undefined;
414
+ help?: string | undefined;
415
+ }>]>, "many">>;
416
+ /** 提交/操作按钮;纯通知类可只放一个「知道了」。 */
417
+ submitLabel: z.ZodDefault<z.ZodString>;
418
+ cancelLabel: z.ZodOptional<z.ZodString>;
419
+ }, "strip", z.ZodTypeAny, {
420
+ title: string;
421
+ fields: ({
422
+ type: "text";
423
+ label: string;
424
+ key: string;
425
+ required: boolean;
426
+ placeholder?: string | undefined;
427
+ defaultValue?: string | undefined;
428
+ help?: string | undefined;
429
+ } | {
430
+ type: "textarea";
431
+ label: string;
432
+ key: string;
433
+ required: boolean;
434
+ placeholder?: string | undefined;
435
+ defaultValue?: string | undefined;
436
+ help?: string | undefined;
437
+ } | {
438
+ type: "number";
439
+ label: string;
440
+ key: string;
441
+ required: boolean;
442
+ defaultValue?: number | undefined;
443
+ help?: string | undefined;
444
+ } | {
445
+ type: "boolean";
446
+ label: string;
447
+ key: string;
448
+ required: boolean;
449
+ defaultValue?: boolean | undefined;
450
+ help?: string | undefined;
451
+ } | {
452
+ options: {
453
+ value: string;
454
+ label: string;
455
+ }[];
456
+ type: "select";
457
+ label: string;
458
+ key: string;
459
+ required: boolean;
460
+ defaultValue?: string | undefined;
461
+ help?: string | undefined;
462
+ } | {
463
+ options: {
464
+ value: string;
465
+ label: string;
466
+ }[];
467
+ type: "multiselect";
468
+ label: string;
469
+ key: string;
470
+ required: boolean;
471
+ defaultValue?: string[] | undefined;
472
+ help?: string | undefined;
473
+ } | {
474
+ type: "date";
475
+ label: string;
476
+ key: string;
477
+ required: boolean;
478
+ defaultValue?: string | undefined;
479
+ help?: string | undefined;
480
+ })[];
481
+ submitLabel: string;
482
+ description?: string | undefined;
483
+ cancelLabel?: string | undefined;
484
+ }, {
485
+ title: string;
486
+ description?: string | undefined;
487
+ fields?: ({
488
+ type: "text";
489
+ label: string;
490
+ key: string;
491
+ placeholder?: string | undefined;
492
+ defaultValue?: string | undefined;
493
+ required?: boolean | undefined;
494
+ help?: string | undefined;
495
+ } | {
496
+ type: "textarea";
497
+ label: string;
498
+ key: string;
499
+ placeholder?: string | undefined;
500
+ defaultValue?: string | undefined;
501
+ required?: boolean | undefined;
502
+ help?: string | undefined;
503
+ } | {
504
+ type: "number";
505
+ label: string;
506
+ key: string;
507
+ defaultValue?: number | undefined;
508
+ required?: boolean | undefined;
509
+ help?: string | undefined;
510
+ } | {
511
+ type: "boolean";
512
+ label: string;
513
+ key: string;
514
+ defaultValue?: boolean | undefined;
515
+ required?: boolean | undefined;
516
+ help?: string | undefined;
517
+ } | {
518
+ options: {
519
+ value: string;
520
+ label: string;
521
+ }[];
522
+ type: "select";
523
+ label: string;
524
+ key: string;
525
+ defaultValue?: string | undefined;
526
+ required?: boolean | undefined;
527
+ help?: string | undefined;
528
+ } | {
529
+ options: {
530
+ value: string;
531
+ label: string;
532
+ }[];
533
+ type: "multiselect";
534
+ label: string;
535
+ key: string;
536
+ defaultValue?: string[] | undefined;
537
+ required?: boolean | undefined;
538
+ help?: string | undefined;
539
+ } | {
540
+ type: "date";
541
+ label: string;
542
+ key: string;
543
+ defaultValue?: string | undefined;
544
+ required?: boolean | undefined;
545
+ help?: string | undefined;
546
+ })[] | undefined;
547
+ submitLabel?: string | undefined;
548
+ cancelLabel?: string | undefined;
549
+ }>;
550
+ export type InteractionForm = z.infer<typeof InteractionForm>;
551
+ /**
552
+ * agent emit 的指令(skill 教)——和 interaction.request 结构基本一致,
553
+ * 但不带 requestId(由 phonon 生成)。
554
+ */
555
+ export declare const InteractionDirective: z.ZodObject<{
556
+ form: z.ZodObject<{
557
+ title: z.ZodString;
558
+ /** 卡片正文/说明(可选)。 */
559
+ description: z.ZodOptional<z.ZodString>;
560
+ fields: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
561
+ type: z.ZodLiteral<"text">;
562
+ placeholder: z.ZodOptional<z.ZodString>;
563
+ defaultValue: z.ZodOptional<z.ZodString>;
564
+ key: z.ZodString;
565
+ label: z.ZodString;
566
+ required: z.ZodDefault<z.ZodBoolean>;
567
+ help: z.ZodOptional<z.ZodString>;
568
+ }, "strip", z.ZodTypeAny, {
569
+ type: "text";
570
+ label: string;
571
+ key: string;
572
+ required: boolean;
573
+ placeholder?: string | undefined;
574
+ defaultValue?: string | undefined;
575
+ help?: string | undefined;
576
+ }, {
577
+ type: "text";
578
+ label: string;
579
+ key: string;
580
+ placeholder?: string | undefined;
581
+ defaultValue?: string | undefined;
582
+ required?: boolean | undefined;
583
+ help?: string | undefined;
584
+ }>, z.ZodObject<{
585
+ type: z.ZodLiteral<"textarea">;
586
+ placeholder: z.ZodOptional<z.ZodString>;
587
+ defaultValue: z.ZodOptional<z.ZodString>;
588
+ key: z.ZodString;
589
+ label: z.ZodString;
590
+ required: z.ZodDefault<z.ZodBoolean>;
591
+ help: z.ZodOptional<z.ZodString>;
592
+ }, "strip", z.ZodTypeAny, {
593
+ type: "textarea";
594
+ label: string;
595
+ key: string;
596
+ required: boolean;
597
+ placeholder?: string | undefined;
598
+ defaultValue?: string | undefined;
599
+ help?: string | undefined;
600
+ }, {
601
+ type: "textarea";
602
+ label: string;
603
+ key: string;
604
+ placeholder?: string | undefined;
605
+ defaultValue?: string | undefined;
606
+ required?: boolean | undefined;
607
+ help?: string | undefined;
608
+ }>, z.ZodObject<{
609
+ type: z.ZodLiteral<"number">;
610
+ defaultValue: z.ZodOptional<z.ZodNumber>;
611
+ key: z.ZodString;
612
+ label: z.ZodString;
613
+ required: z.ZodDefault<z.ZodBoolean>;
614
+ help: z.ZodOptional<z.ZodString>;
615
+ }, "strip", z.ZodTypeAny, {
616
+ type: "number";
617
+ label: string;
618
+ key: string;
619
+ required: boolean;
620
+ defaultValue?: number | undefined;
621
+ help?: string | undefined;
622
+ }, {
623
+ type: "number";
624
+ label: string;
625
+ key: string;
626
+ defaultValue?: number | undefined;
627
+ required?: boolean | undefined;
628
+ help?: string | undefined;
629
+ }>, z.ZodObject<{
630
+ type: z.ZodLiteral<"boolean">;
631
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
632
+ key: z.ZodString;
633
+ label: z.ZodString;
634
+ required: z.ZodDefault<z.ZodBoolean>;
635
+ help: z.ZodOptional<z.ZodString>;
636
+ }, "strip", z.ZodTypeAny, {
637
+ type: "boolean";
638
+ label: string;
639
+ key: string;
640
+ required: boolean;
641
+ defaultValue?: boolean | undefined;
642
+ help?: string | undefined;
643
+ }, {
644
+ type: "boolean";
645
+ label: string;
646
+ key: string;
647
+ defaultValue?: boolean | undefined;
648
+ required?: boolean | undefined;
649
+ help?: string | undefined;
650
+ }>, z.ZodObject<{
651
+ type: z.ZodLiteral<"select">;
652
+ options: z.ZodArray<z.ZodObject<{
653
+ label: z.ZodString;
654
+ value: z.ZodString;
655
+ }, "strip", z.ZodTypeAny, {
656
+ value: string;
657
+ label: string;
658
+ }, {
659
+ value: string;
660
+ label: string;
661
+ }>, "many">;
662
+ defaultValue: z.ZodOptional<z.ZodString>;
663
+ key: z.ZodString;
664
+ label: z.ZodString;
665
+ required: z.ZodDefault<z.ZodBoolean>;
666
+ help: z.ZodOptional<z.ZodString>;
667
+ }, "strip", z.ZodTypeAny, {
668
+ options: {
669
+ value: string;
670
+ label: string;
671
+ }[];
672
+ type: "select";
673
+ label: string;
674
+ key: string;
675
+ required: boolean;
676
+ defaultValue?: string | undefined;
677
+ help?: string | undefined;
678
+ }, {
679
+ options: {
680
+ value: string;
681
+ label: string;
682
+ }[];
683
+ type: "select";
684
+ label: string;
685
+ key: string;
686
+ defaultValue?: string | undefined;
687
+ required?: boolean | undefined;
688
+ help?: string | undefined;
689
+ }>, z.ZodObject<{
690
+ type: z.ZodLiteral<"multiselect">;
691
+ options: z.ZodArray<z.ZodObject<{
692
+ label: z.ZodString;
693
+ value: z.ZodString;
694
+ }, "strip", z.ZodTypeAny, {
695
+ value: string;
696
+ label: string;
697
+ }, {
698
+ value: string;
699
+ label: string;
700
+ }>, "many">;
701
+ defaultValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
702
+ key: z.ZodString;
703
+ label: z.ZodString;
704
+ required: z.ZodDefault<z.ZodBoolean>;
705
+ help: z.ZodOptional<z.ZodString>;
706
+ }, "strip", z.ZodTypeAny, {
707
+ options: {
708
+ value: string;
709
+ label: string;
710
+ }[];
711
+ type: "multiselect";
712
+ label: string;
713
+ key: string;
714
+ required: boolean;
715
+ defaultValue?: string[] | undefined;
716
+ help?: string | undefined;
717
+ }, {
718
+ options: {
719
+ value: string;
720
+ label: string;
721
+ }[];
722
+ type: "multiselect";
723
+ label: string;
724
+ key: string;
725
+ defaultValue?: string[] | undefined;
726
+ required?: boolean | undefined;
727
+ help?: string | undefined;
728
+ }>, z.ZodObject<{
729
+ type: z.ZodLiteral<"date">;
730
+ defaultValue: z.ZodOptional<z.ZodString>;
731
+ key: z.ZodString;
732
+ label: z.ZodString;
733
+ required: z.ZodDefault<z.ZodBoolean>;
734
+ help: z.ZodOptional<z.ZodString>;
735
+ }, "strip", z.ZodTypeAny, {
736
+ type: "date";
737
+ label: string;
738
+ key: string;
739
+ required: boolean;
740
+ defaultValue?: string | undefined;
741
+ help?: string | undefined;
742
+ }, {
743
+ type: "date";
744
+ label: string;
745
+ key: string;
746
+ defaultValue?: string | undefined;
747
+ required?: boolean | undefined;
748
+ help?: string | undefined;
749
+ }>]>, "many">>;
750
+ /** 提交/操作按钮;纯通知类可只放一个「知道了」。 */
751
+ submitLabel: z.ZodDefault<z.ZodString>;
752
+ cancelLabel: z.ZodOptional<z.ZodString>;
753
+ }, "strip", z.ZodTypeAny, {
754
+ title: string;
755
+ fields: ({
756
+ type: "text";
757
+ label: string;
758
+ key: string;
759
+ required: boolean;
760
+ placeholder?: string | undefined;
761
+ defaultValue?: string | undefined;
762
+ help?: string | undefined;
763
+ } | {
764
+ type: "textarea";
765
+ label: string;
766
+ key: string;
767
+ required: boolean;
768
+ placeholder?: string | undefined;
769
+ defaultValue?: string | undefined;
770
+ help?: string | undefined;
771
+ } | {
772
+ type: "number";
773
+ label: string;
774
+ key: string;
775
+ required: boolean;
776
+ defaultValue?: number | undefined;
777
+ help?: string | undefined;
778
+ } | {
779
+ type: "boolean";
780
+ label: string;
781
+ key: string;
782
+ required: boolean;
783
+ defaultValue?: boolean | undefined;
784
+ help?: string | undefined;
785
+ } | {
786
+ options: {
787
+ value: string;
788
+ label: string;
789
+ }[];
790
+ type: "select";
791
+ label: string;
792
+ key: string;
793
+ required: boolean;
794
+ defaultValue?: string | undefined;
795
+ help?: string | undefined;
796
+ } | {
797
+ options: {
798
+ value: string;
799
+ label: string;
800
+ }[];
801
+ type: "multiselect";
802
+ label: string;
803
+ key: string;
804
+ required: boolean;
805
+ defaultValue?: string[] | undefined;
806
+ help?: string | undefined;
807
+ } | {
808
+ type: "date";
809
+ label: string;
810
+ key: string;
811
+ required: boolean;
812
+ defaultValue?: string | undefined;
813
+ help?: string | undefined;
814
+ })[];
815
+ submitLabel: string;
816
+ description?: string | undefined;
817
+ cancelLabel?: string | undefined;
818
+ }, {
819
+ title: string;
820
+ description?: string | undefined;
821
+ fields?: ({
822
+ type: "text";
823
+ label: string;
824
+ key: string;
825
+ placeholder?: string | undefined;
826
+ defaultValue?: string | undefined;
827
+ required?: boolean | undefined;
828
+ help?: string | undefined;
829
+ } | {
830
+ type: "textarea";
831
+ label: string;
832
+ key: string;
833
+ placeholder?: string | undefined;
834
+ defaultValue?: string | undefined;
835
+ required?: boolean | undefined;
836
+ help?: string | undefined;
837
+ } | {
838
+ type: "number";
839
+ label: string;
840
+ key: string;
841
+ defaultValue?: number | undefined;
842
+ required?: boolean | undefined;
843
+ help?: string | undefined;
844
+ } | {
845
+ type: "boolean";
846
+ label: string;
847
+ key: string;
848
+ defaultValue?: boolean | undefined;
849
+ required?: boolean | undefined;
850
+ help?: string | undefined;
851
+ } | {
852
+ options: {
853
+ value: string;
854
+ label: string;
855
+ }[];
856
+ type: "select";
857
+ label: string;
858
+ key: string;
859
+ defaultValue?: string | undefined;
860
+ required?: boolean | undefined;
861
+ help?: string | undefined;
862
+ } | {
863
+ options: {
864
+ value: string;
865
+ label: string;
866
+ }[];
867
+ type: "multiselect";
868
+ label: string;
869
+ key: string;
870
+ defaultValue?: string[] | undefined;
871
+ required?: boolean | undefined;
872
+ help?: string | undefined;
873
+ } | {
874
+ type: "date";
875
+ label: string;
876
+ key: string;
877
+ defaultValue?: string | undefined;
878
+ required?: boolean | undefined;
879
+ help?: string | undefined;
880
+ })[] | undefined;
881
+ submitLabel?: string | undefined;
882
+ cancelLabel?: string | undefined;
883
+ }>;
884
+ /** 是否阻塞等待人回填(true=问答;false=纯通知不等)。 */
885
+ blocking: z.ZodDefault<z.ZodBoolean>;
886
+ /** 关联 hookId(若由 HITL hook 触发,便于和 hook.resolve 合流)。 */
887
+ hookId: z.ZodOptional<z.ZodString>;
888
+ }, "strip", z.ZodTypeAny, {
889
+ form: {
890
+ title: string;
891
+ fields: ({
892
+ type: "text";
893
+ label: string;
894
+ key: string;
895
+ required: boolean;
896
+ placeholder?: string | undefined;
897
+ defaultValue?: string | undefined;
898
+ help?: string | undefined;
899
+ } | {
900
+ type: "textarea";
901
+ label: string;
902
+ key: string;
903
+ required: boolean;
904
+ placeholder?: string | undefined;
905
+ defaultValue?: string | undefined;
906
+ help?: string | undefined;
907
+ } | {
908
+ type: "number";
909
+ label: string;
910
+ key: string;
911
+ required: boolean;
912
+ defaultValue?: number | undefined;
913
+ help?: string | undefined;
914
+ } | {
915
+ type: "boolean";
916
+ label: string;
917
+ key: string;
918
+ required: boolean;
919
+ defaultValue?: boolean | undefined;
920
+ help?: string | undefined;
921
+ } | {
922
+ options: {
923
+ value: string;
924
+ label: string;
925
+ }[];
926
+ type: "select";
927
+ label: string;
928
+ key: string;
929
+ required: boolean;
930
+ defaultValue?: string | undefined;
931
+ help?: string | undefined;
932
+ } | {
933
+ options: {
934
+ value: string;
935
+ label: string;
936
+ }[];
937
+ type: "multiselect";
938
+ label: string;
939
+ key: string;
940
+ required: boolean;
941
+ defaultValue?: string[] | undefined;
942
+ help?: string | undefined;
943
+ } | {
944
+ type: "date";
945
+ label: string;
946
+ key: string;
947
+ required: boolean;
948
+ defaultValue?: string | undefined;
949
+ help?: string | undefined;
950
+ })[];
951
+ submitLabel: string;
952
+ description?: string | undefined;
953
+ cancelLabel?: string | undefined;
954
+ };
955
+ blocking: boolean;
956
+ hookId?: string | undefined;
957
+ }, {
958
+ form: {
959
+ title: string;
960
+ description?: string | undefined;
961
+ fields?: ({
962
+ type: "text";
963
+ label: string;
964
+ key: string;
965
+ placeholder?: string | undefined;
966
+ defaultValue?: string | undefined;
967
+ required?: boolean | undefined;
968
+ help?: string | undefined;
969
+ } | {
970
+ type: "textarea";
971
+ label: string;
972
+ key: string;
973
+ placeholder?: string | undefined;
974
+ defaultValue?: string | undefined;
975
+ required?: boolean | undefined;
976
+ help?: string | undefined;
977
+ } | {
978
+ type: "number";
979
+ label: string;
980
+ key: string;
981
+ defaultValue?: number | undefined;
982
+ required?: boolean | undefined;
983
+ help?: string | undefined;
984
+ } | {
985
+ type: "boolean";
986
+ label: string;
987
+ key: string;
988
+ defaultValue?: boolean | undefined;
989
+ required?: boolean | undefined;
990
+ help?: string | undefined;
991
+ } | {
992
+ options: {
993
+ value: string;
994
+ label: string;
995
+ }[];
996
+ type: "select";
997
+ label: string;
998
+ key: string;
999
+ defaultValue?: string | undefined;
1000
+ required?: boolean | undefined;
1001
+ help?: string | undefined;
1002
+ } | {
1003
+ options: {
1004
+ value: string;
1005
+ label: string;
1006
+ }[];
1007
+ type: "multiselect";
1008
+ label: string;
1009
+ key: string;
1010
+ defaultValue?: string[] | undefined;
1011
+ required?: boolean | undefined;
1012
+ help?: string | undefined;
1013
+ } | {
1014
+ type: "date";
1015
+ label: string;
1016
+ key: string;
1017
+ defaultValue?: string | undefined;
1018
+ required?: boolean | undefined;
1019
+ help?: string | undefined;
1020
+ })[] | undefined;
1021
+ submitLabel?: string | undefined;
1022
+ cancelLabel?: string | undefined;
1023
+ };
1024
+ hookId?: string | undefined;
1025
+ blocking?: boolean | undefined;
1026
+ }>;
1027
+ export type InteractionDirective = z.infer<typeof InteractionDirective>;
1028
+ export declare const InteractionRequestParams: z.ZodObject<{
1029
+ /** 本次交互唯一 id,response 用它配对。 */
1030
+ requestId: z.ZodString;
1031
+ sessionId: z.ZodOptional<z.ZodBranded<z.ZodString, "SessionId">>;
1032
+ turnId: z.ZodOptional<z.ZodString>;
1033
+ form: z.ZodObject<{
1034
+ title: z.ZodString;
1035
+ /** 卡片正文/说明(可选)。 */
1036
+ description: z.ZodOptional<z.ZodString>;
1037
+ fields: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1038
+ type: z.ZodLiteral<"text">;
1039
+ placeholder: z.ZodOptional<z.ZodString>;
1040
+ defaultValue: z.ZodOptional<z.ZodString>;
1041
+ key: z.ZodString;
1042
+ label: z.ZodString;
1043
+ required: z.ZodDefault<z.ZodBoolean>;
1044
+ help: z.ZodOptional<z.ZodString>;
1045
+ }, "strip", z.ZodTypeAny, {
1046
+ type: "text";
1047
+ label: string;
1048
+ key: string;
1049
+ required: boolean;
1050
+ placeholder?: string | undefined;
1051
+ defaultValue?: string | undefined;
1052
+ help?: string | undefined;
1053
+ }, {
1054
+ type: "text";
1055
+ label: string;
1056
+ key: string;
1057
+ placeholder?: string | undefined;
1058
+ defaultValue?: string | undefined;
1059
+ required?: boolean | undefined;
1060
+ help?: string | undefined;
1061
+ }>, z.ZodObject<{
1062
+ type: z.ZodLiteral<"textarea">;
1063
+ placeholder: z.ZodOptional<z.ZodString>;
1064
+ defaultValue: z.ZodOptional<z.ZodString>;
1065
+ key: z.ZodString;
1066
+ label: z.ZodString;
1067
+ required: z.ZodDefault<z.ZodBoolean>;
1068
+ help: z.ZodOptional<z.ZodString>;
1069
+ }, "strip", z.ZodTypeAny, {
1070
+ type: "textarea";
1071
+ label: string;
1072
+ key: string;
1073
+ required: boolean;
1074
+ placeholder?: string | undefined;
1075
+ defaultValue?: string | undefined;
1076
+ help?: string | undefined;
1077
+ }, {
1078
+ type: "textarea";
1079
+ label: string;
1080
+ key: string;
1081
+ placeholder?: string | undefined;
1082
+ defaultValue?: string | undefined;
1083
+ required?: boolean | undefined;
1084
+ help?: string | undefined;
1085
+ }>, z.ZodObject<{
1086
+ type: z.ZodLiteral<"number">;
1087
+ defaultValue: z.ZodOptional<z.ZodNumber>;
1088
+ key: z.ZodString;
1089
+ label: z.ZodString;
1090
+ required: z.ZodDefault<z.ZodBoolean>;
1091
+ help: z.ZodOptional<z.ZodString>;
1092
+ }, "strip", z.ZodTypeAny, {
1093
+ type: "number";
1094
+ label: string;
1095
+ key: string;
1096
+ required: boolean;
1097
+ defaultValue?: number | undefined;
1098
+ help?: string | undefined;
1099
+ }, {
1100
+ type: "number";
1101
+ label: string;
1102
+ key: string;
1103
+ defaultValue?: number | undefined;
1104
+ required?: boolean | undefined;
1105
+ help?: string | undefined;
1106
+ }>, z.ZodObject<{
1107
+ type: z.ZodLiteral<"boolean">;
1108
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
1109
+ key: z.ZodString;
1110
+ label: z.ZodString;
1111
+ required: z.ZodDefault<z.ZodBoolean>;
1112
+ help: z.ZodOptional<z.ZodString>;
1113
+ }, "strip", z.ZodTypeAny, {
1114
+ type: "boolean";
1115
+ label: string;
1116
+ key: string;
1117
+ required: boolean;
1118
+ defaultValue?: boolean | undefined;
1119
+ help?: string | undefined;
1120
+ }, {
1121
+ type: "boolean";
1122
+ label: string;
1123
+ key: string;
1124
+ defaultValue?: boolean | undefined;
1125
+ required?: boolean | undefined;
1126
+ help?: string | undefined;
1127
+ }>, z.ZodObject<{
1128
+ type: z.ZodLiteral<"select">;
1129
+ options: z.ZodArray<z.ZodObject<{
1130
+ label: z.ZodString;
1131
+ value: z.ZodString;
1132
+ }, "strip", z.ZodTypeAny, {
1133
+ value: string;
1134
+ label: string;
1135
+ }, {
1136
+ value: string;
1137
+ label: string;
1138
+ }>, "many">;
1139
+ defaultValue: z.ZodOptional<z.ZodString>;
1140
+ key: z.ZodString;
1141
+ label: z.ZodString;
1142
+ required: z.ZodDefault<z.ZodBoolean>;
1143
+ help: z.ZodOptional<z.ZodString>;
1144
+ }, "strip", z.ZodTypeAny, {
1145
+ options: {
1146
+ value: string;
1147
+ label: string;
1148
+ }[];
1149
+ type: "select";
1150
+ label: string;
1151
+ key: string;
1152
+ required: boolean;
1153
+ defaultValue?: string | undefined;
1154
+ help?: string | undefined;
1155
+ }, {
1156
+ options: {
1157
+ value: string;
1158
+ label: string;
1159
+ }[];
1160
+ type: "select";
1161
+ label: string;
1162
+ key: string;
1163
+ defaultValue?: string | undefined;
1164
+ required?: boolean | undefined;
1165
+ help?: string | undefined;
1166
+ }>, z.ZodObject<{
1167
+ type: z.ZodLiteral<"multiselect">;
1168
+ options: z.ZodArray<z.ZodObject<{
1169
+ label: z.ZodString;
1170
+ value: z.ZodString;
1171
+ }, "strip", z.ZodTypeAny, {
1172
+ value: string;
1173
+ label: string;
1174
+ }, {
1175
+ value: string;
1176
+ label: string;
1177
+ }>, "many">;
1178
+ defaultValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1179
+ key: z.ZodString;
1180
+ label: z.ZodString;
1181
+ required: z.ZodDefault<z.ZodBoolean>;
1182
+ help: z.ZodOptional<z.ZodString>;
1183
+ }, "strip", z.ZodTypeAny, {
1184
+ options: {
1185
+ value: string;
1186
+ label: string;
1187
+ }[];
1188
+ type: "multiselect";
1189
+ label: string;
1190
+ key: string;
1191
+ required: boolean;
1192
+ defaultValue?: string[] | undefined;
1193
+ help?: string | undefined;
1194
+ }, {
1195
+ options: {
1196
+ value: string;
1197
+ label: string;
1198
+ }[];
1199
+ type: "multiselect";
1200
+ label: string;
1201
+ key: string;
1202
+ defaultValue?: string[] | undefined;
1203
+ required?: boolean | undefined;
1204
+ help?: string | undefined;
1205
+ }>, z.ZodObject<{
1206
+ type: z.ZodLiteral<"date">;
1207
+ defaultValue: z.ZodOptional<z.ZodString>;
1208
+ key: z.ZodString;
1209
+ label: z.ZodString;
1210
+ required: z.ZodDefault<z.ZodBoolean>;
1211
+ help: z.ZodOptional<z.ZodString>;
1212
+ }, "strip", z.ZodTypeAny, {
1213
+ type: "date";
1214
+ label: string;
1215
+ key: string;
1216
+ required: boolean;
1217
+ defaultValue?: string | undefined;
1218
+ help?: string | undefined;
1219
+ }, {
1220
+ type: "date";
1221
+ label: string;
1222
+ key: string;
1223
+ defaultValue?: string | undefined;
1224
+ required?: boolean | undefined;
1225
+ help?: string | undefined;
1226
+ }>]>, "many">>;
1227
+ /** 提交/操作按钮;纯通知类可只放一个「知道了」。 */
1228
+ submitLabel: z.ZodDefault<z.ZodString>;
1229
+ cancelLabel: z.ZodOptional<z.ZodString>;
1230
+ }, "strip", z.ZodTypeAny, {
1231
+ title: string;
1232
+ fields: ({
1233
+ type: "text";
1234
+ label: string;
1235
+ key: string;
1236
+ required: boolean;
1237
+ placeholder?: string | undefined;
1238
+ defaultValue?: string | undefined;
1239
+ help?: string | undefined;
1240
+ } | {
1241
+ type: "textarea";
1242
+ label: string;
1243
+ key: string;
1244
+ required: boolean;
1245
+ placeholder?: string | undefined;
1246
+ defaultValue?: string | undefined;
1247
+ help?: string | undefined;
1248
+ } | {
1249
+ type: "number";
1250
+ label: string;
1251
+ key: string;
1252
+ required: boolean;
1253
+ defaultValue?: number | undefined;
1254
+ help?: string | undefined;
1255
+ } | {
1256
+ type: "boolean";
1257
+ label: string;
1258
+ key: string;
1259
+ required: boolean;
1260
+ defaultValue?: boolean | undefined;
1261
+ help?: string | undefined;
1262
+ } | {
1263
+ options: {
1264
+ value: string;
1265
+ label: string;
1266
+ }[];
1267
+ type: "select";
1268
+ label: string;
1269
+ key: string;
1270
+ required: boolean;
1271
+ defaultValue?: string | undefined;
1272
+ help?: string | undefined;
1273
+ } | {
1274
+ options: {
1275
+ value: string;
1276
+ label: string;
1277
+ }[];
1278
+ type: "multiselect";
1279
+ label: string;
1280
+ key: string;
1281
+ required: boolean;
1282
+ defaultValue?: string[] | undefined;
1283
+ help?: string | undefined;
1284
+ } | {
1285
+ type: "date";
1286
+ label: string;
1287
+ key: string;
1288
+ required: boolean;
1289
+ defaultValue?: string | undefined;
1290
+ help?: string | undefined;
1291
+ })[];
1292
+ submitLabel: string;
1293
+ description?: string | undefined;
1294
+ cancelLabel?: string | undefined;
1295
+ }, {
1296
+ title: string;
1297
+ description?: string | undefined;
1298
+ fields?: ({
1299
+ type: "text";
1300
+ label: string;
1301
+ key: string;
1302
+ placeholder?: string | undefined;
1303
+ defaultValue?: string | undefined;
1304
+ required?: boolean | undefined;
1305
+ help?: string | undefined;
1306
+ } | {
1307
+ type: "textarea";
1308
+ label: string;
1309
+ key: string;
1310
+ placeholder?: string | undefined;
1311
+ defaultValue?: string | undefined;
1312
+ required?: boolean | undefined;
1313
+ help?: string | undefined;
1314
+ } | {
1315
+ type: "number";
1316
+ label: string;
1317
+ key: string;
1318
+ defaultValue?: number | undefined;
1319
+ required?: boolean | undefined;
1320
+ help?: string | undefined;
1321
+ } | {
1322
+ type: "boolean";
1323
+ label: string;
1324
+ key: string;
1325
+ defaultValue?: boolean | undefined;
1326
+ required?: boolean | undefined;
1327
+ help?: string | undefined;
1328
+ } | {
1329
+ options: {
1330
+ value: string;
1331
+ label: string;
1332
+ }[];
1333
+ type: "select";
1334
+ label: string;
1335
+ key: string;
1336
+ defaultValue?: string | undefined;
1337
+ required?: boolean | undefined;
1338
+ help?: string | undefined;
1339
+ } | {
1340
+ options: {
1341
+ value: string;
1342
+ label: string;
1343
+ }[];
1344
+ type: "multiselect";
1345
+ label: string;
1346
+ key: string;
1347
+ defaultValue?: string[] | undefined;
1348
+ required?: boolean | undefined;
1349
+ help?: string | undefined;
1350
+ } | {
1351
+ type: "date";
1352
+ label: string;
1353
+ key: string;
1354
+ defaultValue?: string | undefined;
1355
+ required?: boolean | undefined;
1356
+ help?: string | undefined;
1357
+ })[] | undefined;
1358
+ submitLabel?: string | undefined;
1359
+ cancelLabel?: string | undefined;
1360
+ }>;
1361
+ blocking: z.ZodDefault<z.ZodBoolean>;
1362
+ /** 关联 hookId(HITL 场景)。 */
1363
+ hookId: z.ZodOptional<z.ZodString>;
1364
+ /**
1365
+ * 可选超时(秒,P1-5)。超时后 phonon 以 timeout 收尾本次交互,agent 按预设继续。
1366
+ * 0 或缺省 = 不超时(人可能去开会/带娃,长期挂起)。
1367
+ */
1368
+ timeoutSeconds: z.ZodOptional<z.ZodNumber>;
1369
+ at: z.ZodString;
1370
+ }, "strip", z.ZodTypeAny, {
1371
+ at: string;
1372
+ form: {
1373
+ title: string;
1374
+ fields: ({
1375
+ type: "text";
1376
+ label: string;
1377
+ key: string;
1378
+ required: boolean;
1379
+ placeholder?: string | undefined;
1380
+ defaultValue?: string | undefined;
1381
+ help?: string | undefined;
1382
+ } | {
1383
+ type: "textarea";
1384
+ label: string;
1385
+ key: string;
1386
+ required: boolean;
1387
+ placeholder?: string | undefined;
1388
+ defaultValue?: string | undefined;
1389
+ help?: string | undefined;
1390
+ } | {
1391
+ type: "number";
1392
+ label: string;
1393
+ key: string;
1394
+ required: boolean;
1395
+ defaultValue?: number | undefined;
1396
+ help?: string | undefined;
1397
+ } | {
1398
+ type: "boolean";
1399
+ label: string;
1400
+ key: string;
1401
+ required: boolean;
1402
+ defaultValue?: boolean | undefined;
1403
+ help?: string | undefined;
1404
+ } | {
1405
+ options: {
1406
+ value: string;
1407
+ label: string;
1408
+ }[];
1409
+ type: "select";
1410
+ label: string;
1411
+ key: string;
1412
+ required: boolean;
1413
+ defaultValue?: string | undefined;
1414
+ help?: string | undefined;
1415
+ } | {
1416
+ options: {
1417
+ value: string;
1418
+ label: string;
1419
+ }[];
1420
+ type: "multiselect";
1421
+ label: string;
1422
+ key: string;
1423
+ required: boolean;
1424
+ defaultValue?: string[] | undefined;
1425
+ help?: string | undefined;
1426
+ } | {
1427
+ type: "date";
1428
+ label: string;
1429
+ key: string;
1430
+ required: boolean;
1431
+ defaultValue?: string | undefined;
1432
+ help?: string | undefined;
1433
+ })[];
1434
+ submitLabel: string;
1435
+ description?: string | undefined;
1436
+ cancelLabel?: string | undefined;
1437
+ };
1438
+ blocking: boolean;
1439
+ requestId: string;
1440
+ sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1441
+ turnId?: string | undefined;
1442
+ hookId?: string | undefined;
1443
+ timeoutSeconds?: number | undefined;
1444
+ }, {
1445
+ at: string;
1446
+ form: {
1447
+ title: string;
1448
+ description?: string | undefined;
1449
+ fields?: ({
1450
+ type: "text";
1451
+ label: string;
1452
+ key: string;
1453
+ placeholder?: string | undefined;
1454
+ defaultValue?: string | undefined;
1455
+ required?: boolean | undefined;
1456
+ help?: string | undefined;
1457
+ } | {
1458
+ type: "textarea";
1459
+ label: string;
1460
+ key: string;
1461
+ placeholder?: string | undefined;
1462
+ defaultValue?: string | undefined;
1463
+ required?: boolean | undefined;
1464
+ help?: string | undefined;
1465
+ } | {
1466
+ type: "number";
1467
+ label: string;
1468
+ key: string;
1469
+ defaultValue?: number | undefined;
1470
+ required?: boolean | undefined;
1471
+ help?: string | undefined;
1472
+ } | {
1473
+ type: "boolean";
1474
+ label: string;
1475
+ key: string;
1476
+ defaultValue?: boolean | undefined;
1477
+ required?: boolean | undefined;
1478
+ help?: string | undefined;
1479
+ } | {
1480
+ options: {
1481
+ value: string;
1482
+ label: string;
1483
+ }[];
1484
+ type: "select";
1485
+ label: string;
1486
+ key: string;
1487
+ defaultValue?: string | undefined;
1488
+ required?: boolean | undefined;
1489
+ help?: string | undefined;
1490
+ } | {
1491
+ options: {
1492
+ value: string;
1493
+ label: string;
1494
+ }[];
1495
+ type: "multiselect";
1496
+ label: string;
1497
+ key: string;
1498
+ defaultValue?: string[] | undefined;
1499
+ required?: boolean | undefined;
1500
+ help?: string | undefined;
1501
+ } | {
1502
+ type: "date";
1503
+ label: string;
1504
+ key: string;
1505
+ defaultValue?: string | undefined;
1506
+ required?: boolean | undefined;
1507
+ help?: string | undefined;
1508
+ })[] | undefined;
1509
+ submitLabel?: string | undefined;
1510
+ cancelLabel?: string | undefined;
1511
+ };
1512
+ requestId: string;
1513
+ sessionId?: string | undefined;
1514
+ turnId?: string | undefined;
1515
+ hookId?: string | undefined;
1516
+ blocking?: boolean | undefined;
1517
+ timeoutSeconds?: number | undefined;
1518
+ }>;
1519
+ export type InteractionRequestParams = z.infer<typeof InteractionRequestParams>;
1520
+ /** 人机交互的生命周期状态(P1-5):pending → submitted | cancelled | timeout。 */
1521
+ export declare const InteractionStatus: z.ZodEnum<["pending", "submitted", "cancelled", "timeout"]>;
1522
+ export type InteractionStatus = z.infer<typeof InteractionStatus>;
1523
+ /** 阻塞模式下,request 的最终结果(人填完后服务端回的)。 */
1524
+ export declare const InteractionRequestResult: z.ZodObject<{
1525
+ requestId: z.ZodString;
1526
+ /** 结果状态:submit | cancel | timeout。 */
1527
+ action: z.ZodEnum<["submit", "cancel", "timeout"]>;
1528
+ /** 提交时各字段值(key → 值)。 */
1529
+ values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodBoolean, z.ZodNumber]>>>;
1530
+ }, "strip", z.ZodTypeAny, {
1531
+ action: "timeout" | "submit" | "cancel";
1532
+ requestId: string;
1533
+ values?: Record<string, string | number | boolean | string[]> | undefined;
1534
+ }, {
1535
+ action: "timeout" | "submit" | "cancel";
1536
+ requestId: string;
1537
+ values?: Record<string, string | number | boolean | string[]> | undefined;
1538
+ }>;
1539
+ export type InteractionRequestResult = z.infer<typeof InteractionRequestResult>;
1540
+ export declare const InteractionCancelParams: z.ZodObject<{
1541
+ requestId: z.ZodString;
1542
+ reason: z.ZodOptional<z.ZodString>;
1543
+ }, "strip", z.ZodTypeAny, {
1544
+ requestId: string;
1545
+ reason?: string | undefined;
1546
+ }, {
1547
+ requestId: string;
1548
+ reason?: string | undefined;
1549
+ }>;
1550
+ export type InteractionCancelParams = z.infer<typeof InteractionCancelParams>;
1551
+ export declare const InteractionCancelResult: z.ZodObject<{
1552
+ requestId: z.ZodString;
1553
+ cancelled: z.ZodBoolean;
1554
+ }, "strip", z.ZodTypeAny, {
1555
+ requestId: string;
1556
+ cancelled: boolean;
1557
+ }, {
1558
+ requestId: string;
1559
+ cancelled: boolean;
1560
+ }>;
1561
+ export type InteractionCancelResult = z.infer<typeof InteractionCancelResult>;
1562
+ /**
1563
+ * server → phonon 的回填(非阻塞模式或异步回填走这个 notification;
1564
+ * 阻塞模式可直接用 interaction.request 的 result 返回,二选一,实现可都支持)。
1565
+ */
1566
+ export declare const InteractionResponseParams: z.ZodObject<{
1567
+ requestId: z.ZodString;
1568
+ action: z.ZodEnum<["submit", "cancel", "timeout"]>;
1569
+ values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodBoolean, z.ZodNumber]>>>;
1570
+ at: z.ZodString;
1571
+ }, "strip", z.ZodTypeAny, {
1572
+ at: string;
1573
+ action: "timeout" | "submit" | "cancel";
1574
+ requestId: string;
1575
+ values?: Record<string, string | number | boolean | string[]> | undefined;
1576
+ }, {
1577
+ at: string;
1578
+ action: "timeout" | "submit" | "cancel";
1579
+ requestId: string;
1580
+ values?: Record<string, string | number | boolean | string[]> | undefined;
1581
+ }>;
1582
+ export type InteractionResponseParams = z.infer<typeof InteractionResponseParams>;
1583
+ //# sourceMappingURL=interaction.d.ts.map