@linnlabs/linnkit 0.8.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 (123) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/LICENSE +21 -0
  3. package/README.md +178 -0
  4. package/README.zh-CN.md +182 -0
  5. package/dist/agent-invocation-BHcNfrBV.d.cts +30 -0
  6. package/dist/agent-invocation-BznDaXDs.d.ts +30 -0
  7. package/dist/agentEvents-DEB7Fy_J.d.cts +81 -0
  8. package/dist/agentEvents-DEB7Fy_J.d.ts +81 -0
  9. package/dist/agentSpec-EkmviZjy.d.cts +2621 -0
  10. package/dist/agentSpec-EkmviZjy.d.ts +2621 -0
  11. package/dist/ai-engine.types-BpeU_XQG.d.cts +158 -0
  12. package/dist/ai-engine.types-vZRnQcJa.d.ts +158 -0
  13. package/dist/audit-BaRUGaqv.d.cts +307 -0
  14. package/dist/audit-BaRUGaqv.d.ts +307 -0
  15. package/dist/audit-CtcfART1.d.ts +33 -0
  16. package/dist/audit-LeOrm2hX.d.cts +33 -0
  17. package/dist/checkpointMarker-DAI3wUQu.d.cts +8 -0
  18. package/dist/checkpointMarker-DAI3wUQu.d.ts +8 -0
  19. package/dist/cli.cjs +8028 -0
  20. package/dist/cli.cjs.map +1 -0
  21. package/dist/cli.d.cts +4 -0
  22. package/dist/cli.d.ts +4 -0
  23. package/dist/cli.js +8025 -0
  24. package/dist/cli.js.map +1 -0
  25. package/dist/context-manager.cjs +8704 -0
  26. package/dist/context-manager.cjs.map +1 -0
  27. package/dist/context-manager.d.cts +2190 -0
  28. package/dist/context-manager.d.ts +2190 -0
  29. package/dist/context-manager.js +8650 -0
  30. package/dist/context-manager.js.map +1 -0
  31. package/dist/context-trace-DRi5M4lX.d.ts +239 -0
  32. package/dist/context-trace-HE2qY5Q-.d.cts +239 -0
  33. package/dist/contracts.cjs +1333 -0
  34. package/dist/contracts.cjs.map +1 -0
  35. package/dist/contracts.d.cts +8 -0
  36. package/dist/contracts.d.ts +8 -0
  37. package/dist/contracts.js +1214 -0
  38. package/dist/contracts.js.map +1 -0
  39. package/dist/defaultGraphExecutor-BBswR8wn.d.ts +624 -0
  40. package/dist/defaultGraphExecutor-BIjJj7WF.d.cts +624 -0
  41. package/dist/execution-CAIypb41.d.cts +129 -0
  42. package/dist/execution-CAIypb41.d.ts +129 -0
  43. package/dist/index-CHqwkvGp.d.ts +149 -0
  44. package/dist/index-CJeWHopy.d.ts +584 -0
  45. package/dist/index-Cm-JbzTH.d.cts +1450 -0
  46. package/dist/index-Cvr23YCl.d.cts +23 -0
  47. package/dist/index-DDzuSb0n.d.ts +23 -0
  48. package/dist/index-DO4dQgf2.d.cts +584 -0
  49. package/dist/index-DRBWi1fy.d.ts +1450 -0
  50. package/dist/index-Dl5PLgAv.d.cts +149 -0
  51. package/dist/index.cjs +9577 -0
  52. package/dist/index.cjs.map +1 -0
  53. package/dist/index.d.cts +89 -0
  54. package/dist/index.d.ts +89 -0
  55. package/dist/index.js +9563 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/messages-XthmnHZ3.d.cts +8007 -0
  58. package/dist/messages-XthmnHZ3.d.ts +8007 -0
  59. package/dist/ports-DaatKJXp.d.cts +90 -0
  60. package/dist/ports-DnLuKfpE.d.ts +90 -0
  61. package/dist/ports.cjs +4 -0
  62. package/dist/ports.cjs.map +1 -0
  63. package/dist/ports.d.cts +7 -0
  64. package/dist/ports.d.ts +7 -0
  65. package/dist/ports.js +3 -0
  66. package/dist/ports.js.map +1 -0
  67. package/dist/quickstart.cjs +7697 -0
  68. package/dist/quickstart.cjs.map +1 -0
  69. package/dist/quickstart.d.cts +24 -0
  70. package/dist/quickstart.d.ts +24 -0
  71. package/dist/quickstart.js +7691 -0
  72. package/dist/quickstart.js.map +1 -0
  73. package/dist/runAgent-CPj_9e58.d.ts +88 -0
  74. package/dist/runAgent-HYKlXbVr.d.cts +88 -0
  75. package/dist/runHandle-CyXvzgzk.d.ts +239 -0
  76. package/dist/runHandle-D3gPsD7B.d.cts +239 -0
  77. package/dist/runtime-kernel/events.cjs +1485 -0
  78. package/dist/runtime-kernel/events.cjs.map +1 -0
  79. package/dist/runtime-kernel/events.d.cts +8 -0
  80. package/dist/runtime-kernel/events.d.ts +8 -0
  81. package/dist/runtime-kernel/events.js +1475 -0
  82. package/dist/runtime-kernel/events.js.map +1 -0
  83. package/dist/runtime-kernel.cjs +8656 -0
  84. package/dist/runtime-kernel.cjs.map +1 -0
  85. package/dist/runtime-kernel.d.cts +19 -0
  86. package/dist/runtime-kernel.d.ts +19 -0
  87. package/dist/runtime-kernel.js +8568 -0
  88. package/dist/runtime-kernel.js.map +1 -0
  89. package/dist/sse-vPyrOPa0.d.cts +1687 -0
  90. package/dist/sse-vPyrOPa0.d.ts +1687 -0
  91. package/dist/testkit.cjs +10613 -0
  92. package/dist/testkit.cjs.map +1 -0
  93. package/dist/testkit.d.cts +284 -0
  94. package/dist/testkit.d.ts +284 -0
  95. package/dist/testkit.js +10593 -0
  96. package/dist/testkit.js.map +1 -0
  97. package/dist/todo-B1PmDlp3.d.cts +2253 -0
  98. package/dist/todo-B1PmDlp3.d.ts +2253 -0
  99. package/dist/tokenizer-DFL4I7-I.d.ts +28 -0
  100. package/dist/tokenizer-DH_JXv-H.d.cts +28 -0
  101. package/dist/toolContracts-Blll0241.d.ts +463 -0
  102. package/dist/toolContracts-CLkQmhTG.d.cts +463 -0
  103. package/docs/README.md +76 -0
  104. package/docs/integration/01-installation.md +94 -0
  105. package/docs/integration/02-quickstart.md +104 -0
  106. package/docs/integration/README.md +223 -0
  107. package/docs/integration/agent-registration-guide.md +330 -0
  108. package/docs/integration/audit.md +64 -0
  109. package/docs/integration/child-runs.md +87 -0
  110. package/docs/integration/constraints-and-pitfalls.md +87 -0
  111. package/docs/integration/context-engineering.md +650 -0
  112. package/docs/integration/context-fences.md +289 -0
  113. package/docs/integration/glossary.md +69 -0
  114. package/docs/integration/llm-provider.md +76 -0
  115. package/docs/integration/persistence.md +44 -0
  116. package/docs/integration/realtime.md +76 -0
  117. package/docs/integration/run-supervisor.md +69 -0
  118. package/docs/integration/telemetry.md +48 -0
  119. package/docs/integration/testing.md +95 -0
  120. package/docs/integration/tool-development-guide.md +362 -0
  121. package/docs/integration/tool-history.md +202 -0
  122. package/docs/integration/tools.md +188 -0
  123. package/package.json +115 -0
@@ -0,0 +1,307 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const AUDIT_ACTIONS: readonly ["model.select", "model.fallback", "tool.allow", "tool.deny", "wait_user.request", "sandbox.decide", "run.cancel", "run.pause", "run.resume", "memory.write"];
4
+ declare const AUDIT_DECISION_OUTCOMES: readonly ["allowed", "denied", "fallback", "retry", "cancelled", "paused", "resumed", "requested", "recorded"];
5
+ declare const AuditActor: z.ZodObject<{
6
+ kind: z.ZodEnum<["system", "host", "agent", "model", "tool", "user"]>;
7
+ id: z.ZodOptional<z.ZodString>;
8
+ name: z.ZodOptional<z.ZodString>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ kind: "system" | "user" | "tool" | "agent" | "host" | "model";
11
+ id?: string | undefined;
12
+ name?: string | undefined;
13
+ }, {
14
+ kind: "system" | "user" | "tool" | "agent" | "host" | "model";
15
+ id?: string | undefined;
16
+ name?: string | undefined;
17
+ }>;
18
+ type AuditActor = z.infer<typeof AuditActor>;
19
+ declare const AuditDecision: z.ZodObject<{
20
+ outcome: z.ZodEnum<["allowed", "denied", "fallback", "retry", "cancelled", "paused", "resumed", "requested", "recorded"]>;
21
+ reason: z.ZodOptional<z.ZodString>;
22
+ policy: z.ZodOptional<z.ZodString>;
23
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
26
+ metadata?: Record<string, unknown> | undefined;
27
+ reason?: string | undefined;
28
+ policy?: string | undefined;
29
+ }, {
30
+ outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
31
+ metadata?: Record<string, unknown> | undefined;
32
+ reason?: string | undefined;
33
+ policy?: string | undefined;
34
+ }>;
35
+ type AuditDecision = z.infer<typeof AuditDecision>;
36
+ declare const AuditEvidence: z.ZodObject<{
37
+ kind: z.ZodString;
38
+ ref: z.ZodOptional<z.ZodString>;
39
+ summary: z.ZodOptional<z.ZodString>;
40
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ kind: string;
43
+ summary?: string | undefined;
44
+ metadata?: Record<string, unknown> | undefined;
45
+ ref?: string | undefined;
46
+ }, {
47
+ kind: string;
48
+ summary?: string | undefined;
49
+ metadata?: Record<string, unknown> | undefined;
50
+ ref?: string | undefined;
51
+ }>;
52
+ type AuditEvidence = z.infer<typeof AuditEvidence>;
53
+ declare const AuditCostDelta: z.ZodObject<{
54
+ tokensInput: z.ZodOptional<z.ZodNumber>;
55
+ tokensOutput: z.ZodOptional<z.ZodNumber>;
56
+ totalCostUsd: z.ZodOptional<z.ZodNumber>;
57
+ latencyMs: z.ZodOptional<z.ZodNumber>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ tokensInput?: number | undefined;
60
+ tokensOutput?: number | undefined;
61
+ totalCostUsd?: number | undefined;
62
+ latencyMs?: number | undefined;
63
+ }, {
64
+ tokensInput?: number | undefined;
65
+ tokensOutput?: number | undefined;
66
+ totalCostUsd?: number | undefined;
67
+ latencyMs?: number | undefined;
68
+ }>;
69
+ type AuditCostDelta = z.infer<typeof AuditCostDelta>;
70
+ declare const AuditScope: z.ZodObject<{
71
+ conversationId: z.ZodOptional<z.ZodString>;
72
+ runId: z.ZodOptional<z.ZodString>;
73
+ parentRunId: z.ZodOptional<z.ZodString>;
74
+ turnId: z.ZodOptional<z.ZodString>;
75
+ traceId: z.ZodOptional<z.ZodString>;
76
+ agentSpecId: z.ZodOptional<z.ZodString>;
77
+ toolCallId: z.ZodOptional<z.ZodString>;
78
+ toolName: z.ZodOptional<z.ZodString>;
79
+ modelId: z.ZodOptional<z.ZodString>;
80
+ nodeId: z.ZodOptional<z.ZodString>;
81
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ metadata?: Record<string, unknown> | undefined;
84
+ toolName?: string | undefined;
85
+ conversationId?: string | undefined;
86
+ runId?: string | undefined;
87
+ parentRunId?: string | undefined;
88
+ turnId?: string | undefined;
89
+ traceId?: string | undefined;
90
+ agentSpecId?: string | undefined;
91
+ toolCallId?: string | undefined;
92
+ modelId?: string | undefined;
93
+ nodeId?: string | undefined;
94
+ }, {
95
+ metadata?: Record<string, unknown> | undefined;
96
+ toolName?: string | undefined;
97
+ conversationId?: string | undefined;
98
+ runId?: string | undefined;
99
+ parentRunId?: string | undefined;
100
+ turnId?: string | undefined;
101
+ traceId?: string | undefined;
102
+ agentSpecId?: string | undefined;
103
+ toolCallId?: string | undefined;
104
+ modelId?: string | undefined;
105
+ nodeId?: string | undefined;
106
+ }>;
107
+ type AuditScope = z.infer<typeof AuditScope>;
108
+ /**
109
+ * 标准审计信封。
110
+ *
111
+ * 中文备注:
112
+ * - action 保持 string,以便 host 扩展自己的动作名;
113
+ * - decision/evidence/costDelta 都是可选事实片段,避免把所有审计场景压成同一种形状;
114
+ * - envelope 必须追加只读,更新/撤回应追加新的补偿 envelope。
115
+ */
116
+ declare const AuditEnvelope: z.ZodObject<{
117
+ envelopeId: z.ZodString;
118
+ runId: z.ZodString;
119
+ parentRunId: z.ZodOptional<z.ZodString>;
120
+ ts: z.ZodNumber;
121
+ actor: z.ZodObject<{
122
+ kind: z.ZodEnum<["system", "host", "agent", "model", "tool", "user"]>;
123
+ id: z.ZodOptional<z.ZodString>;
124
+ name: z.ZodOptional<z.ZodString>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ kind: "system" | "user" | "tool" | "agent" | "host" | "model";
127
+ id?: string | undefined;
128
+ name?: string | undefined;
129
+ }, {
130
+ kind: "system" | "user" | "tool" | "agent" | "host" | "model";
131
+ id?: string | undefined;
132
+ name?: string | undefined;
133
+ }>;
134
+ action: z.ZodString;
135
+ decision: z.ZodOptional<z.ZodObject<{
136
+ outcome: z.ZodEnum<["allowed", "denied", "fallback", "retry", "cancelled", "paused", "resumed", "requested", "recorded"]>;
137
+ reason: z.ZodOptional<z.ZodString>;
138
+ policy: z.ZodOptional<z.ZodString>;
139
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
140
+ }, "strip", z.ZodTypeAny, {
141
+ outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
142
+ metadata?: Record<string, unknown> | undefined;
143
+ reason?: string | undefined;
144
+ policy?: string | undefined;
145
+ }, {
146
+ outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
147
+ metadata?: Record<string, unknown> | undefined;
148
+ reason?: string | undefined;
149
+ policy?: string | undefined;
150
+ }>>;
151
+ evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
152
+ kind: z.ZodString;
153
+ ref: z.ZodOptional<z.ZodString>;
154
+ summary: z.ZodOptional<z.ZodString>;
155
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
156
+ }, "strip", z.ZodTypeAny, {
157
+ kind: string;
158
+ summary?: string | undefined;
159
+ metadata?: Record<string, unknown> | undefined;
160
+ ref?: string | undefined;
161
+ }, {
162
+ kind: string;
163
+ summary?: string | undefined;
164
+ metadata?: Record<string, unknown> | undefined;
165
+ ref?: string | undefined;
166
+ }>, "many">>;
167
+ costDelta: z.ZodOptional<z.ZodObject<{
168
+ tokensInput: z.ZodOptional<z.ZodNumber>;
169
+ tokensOutput: z.ZodOptional<z.ZodNumber>;
170
+ totalCostUsd: z.ZodOptional<z.ZodNumber>;
171
+ latencyMs: z.ZodOptional<z.ZodNumber>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ tokensInput?: number | undefined;
174
+ tokensOutput?: number | undefined;
175
+ totalCostUsd?: number | undefined;
176
+ latencyMs?: number | undefined;
177
+ }, {
178
+ tokensInput?: number | undefined;
179
+ tokensOutput?: number | undefined;
180
+ totalCostUsd?: number | undefined;
181
+ latencyMs?: number | undefined;
182
+ }>>;
183
+ scope: z.ZodOptional<z.ZodObject<{
184
+ conversationId: z.ZodOptional<z.ZodString>;
185
+ runId: z.ZodOptional<z.ZodString>;
186
+ parentRunId: z.ZodOptional<z.ZodString>;
187
+ turnId: z.ZodOptional<z.ZodString>;
188
+ traceId: z.ZodOptional<z.ZodString>;
189
+ agentSpecId: z.ZodOptional<z.ZodString>;
190
+ toolCallId: z.ZodOptional<z.ZodString>;
191
+ toolName: z.ZodOptional<z.ZodString>;
192
+ modelId: z.ZodOptional<z.ZodString>;
193
+ nodeId: z.ZodOptional<z.ZodString>;
194
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
195
+ }, "strip", z.ZodTypeAny, {
196
+ metadata?: Record<string, unknown> | undefined;
197
+ toolName?: string | undefined;
198
+ conversationId?: string | undefined;
199
+ runId?: string | undefined;
200
+ parentRunId?: string | undefined;
201
+ turnId?: string | undefined;
202
+ traceId?: string | undefined;
203
+ agentSpecId?: string | undefined;
204
+ toolCallId?: string | undefined;
205
+ modelId?: string | undefined;
206
+ nodeId?: string | undefined;
207
+ }, {
208
+ metadata?: Record<string, unknown> | undefined;
209
+ toolName?: string | undefined;
210
+ conversationId?: string | undefined;
211
+ runId?: string | undefined;
212
+ parentRunId?: string | undefined;
213
+ turnId?: string | undefined;
214
+ traceId?: string | undefined;
215
+ agentSpecId?: string | undefined;
216
+ toolCallId?: string | undefined;
217
+ modelId?: string | undefined;
218
+ nodeId?: string | undefined;
219
+ }>>;
220
+ }, "strip", z.ZodTypeAny, {
221
+ runId: string;
222
+ envelopeId: string;
223
+ ts: number;
224
+ actor: {
225
+ kind: "system" | "user" | "tool" | "agent" | "host" | "model";
226
+ id?: string | undefined;
227
+ name?: string | undefined;
228
+ };
229
+ action: string;
230
+ parentRunId?: string | undefined;
231
+ decision?: {
232
+ outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
233
+ metadata?: Record<string, unknown> | undefined;
234
+ reason?: string | undefined;
235
+ policy?: string | undefined;
236
+ } | undefined;
237
+ evidence?: {
238
+ kind: string;
239
+ summary?: string | undefined;
240
+ metadata?: Record<string, unknown> | undefined;
241
+ ref?: string | undefined;
242
+ }[] | undefined;
243
+ costDelta?: {
244
+ tokensInput?: number | undefined;
245
+ tokensOutput?: number | undefined;
246
+ totalCostUsd?: number | undefined;
247
+ latencyMs?: number | undefined;
248
+ } | undefined;
249
+ scope?: {
250
+ metadata?: Record<string, unknown> | undefined;
251
+ toolName?: string | undefined;
252
+ conversationId?: string | undefined;
253
+ runId?: string | undefined;
254
+ parentRunId?: string | undefined;
255
+ turnId?: string | undefined;
256
+ traceId?: string | undefined;
257
+ agentSpecId?: string | undefined;
258
+ toolCallId?: string | undefined;
259
+ modelId?: string | undefined;
260
+ nodeId?: string | undefined;
261
+ } | undefined;
262
+ }, {
263
+ runId: string;
264
+ envelopeId: string;
265
+ ts: number;
266
+ actor: {
267
+ kind: "system" | "user" | "tool" | "agent" | "host" | "model";
268
+ id?: string | undefined;
269
+ name?: string | undefined;
270
+ };
271
+ action: string;
272
+ parentRunId?: string | undefined;
273
+ decision?: {
274
+ outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
275
+ metadata?: Record<string, unknown> | undefined;
276
+ reason?: string | undefined;
277
+ policy?: string | undefined;
278
+ } | undefined;
279
+ evidence?: {
280
+ kind: string;
281
+ summary?: string | undefined;
282
+ metadata?: Record<string, unknown> | undefined;
283
+ ref?: string | undefined;
284
+ }[] | undefined;
285
+ costDelta?: {
286
+ tokensInput?: number | undefined;
287
+ tokensOutput?: number | undefined;
288
+ totalCostUsd?: number | undefined;
289
+ latencyMs?: number | undefined;
290
+ } | undefined;
291
+ scope?: {
292
+ metadata?: Record<string, unknown> | undefined;
293
+ toolName?: string | undefined;
294
+ conversationId?: string | undefined;
295
+ runId?: string | undefined;
296
+ parentRunId?: string | undefined;
297
+ turnId?: string | undefined;
298
+ traceId?: string | undefined;
299
+ agentSpecId?: string | undefined;
300
+ toolCallId?: string | undefined;
301
+ modelId?: string | undefined;
302
+ nodeId?: string | undefined;
303
+ } | undefined;
304
+ }>;
305
+ type AuditEnvelope = z.infer<typeof AuditEnvelope>;
306
+
307
+ export { AUDIT_ACTIONS as A, AUDIT_DECISION_OUTCOMES as a, AuditActor as b, AuditCostDelta as c, AuditDecision as d, AuditEnvelope as e, AuditEvidence as f, AuditScope as g };
@@ -0,0 +1,33 @@
1
+ import { a as LlmRequestMessage, L as LlmCallOptions, d as ToolCallChunk, P as ProviderReasoningDetails } from './ai-engine.types-vZRnQcJa.js';
2
+ import { e as AuditEnvelope } from './audit-BaRUGaqv.js';
3
+
4
+ type AgentAiEngineStreamContent = string | {
5
+ content?: string;
6
+ tool_calls?: ToolCallChunk[];
7
+ reasoning_details?: ProviderReasoningDetails;
8
+ };
9
+ interface AgentAiEngine {
10
+ chatCompletion(modelId: string, messages: LlmRequestMessage[], options?: LlmCallOptions & {
11
+ signal?: AbortSignal;
12
+ }): Promise<unknown>;
13
+ chatCompletionStream(modelId: string, messages: LlmRequestMessage[], options?: LlmCallOptions & {
14
+ signal?: AbortSignal;
15
+ stream_options?: {
16
+ include_usage?: boolean;
17
+ };
18
+ }, onContent?: (content: AgentAiEngineStreamContent) => void, onError?: (error: Error) => void, onFinish?: (reason: string) => void, onThought?: (thought: string) => void, onUsage?: (usage: unknown) => void): Promise<void>;
19
+ }
20
+
21
+ /**
22
+ * 审计事件输出端口。
23
+ *
24
+ * 中文备注:
25
+ * - emit 允许同步或异步实现;framework 调用方需要 await,避免 file sink 未写完;
26
+ * - envelope 是追加只读事实,不提供 update/delete。
27
+ */
28
+ interface AuditPort {
29
+ emit(envelope: AuditEnvelope): void | Promise<void>;
30
+ flush?(): void | Promise<void>;
31
+ }
32
+
33
+ export type { AgentAiEngine as A, AgentAiEngineStreamContent as a, AuditPort as b };
@@ -0,0 +1,33 @@
1
+ import { a as LlmRequestMessage, L as LlmCallOptions, d as ToolCallChunk, P as ProviderReasoningDetails } from './ai-engine.types-BpeU_XQG.cjs';
2
+ import { e as AuditEnvelope } from './audit-BaRUGaqv.cjs';
3
+
4
+ type AgentAiEngineStreamContent = string | {
5
+ content?: string;
6
+ tool_calls?: ToolCallChunk[];
7
+ reasoning_details?: ProviderReasoningDetails;
8
+ };
9
+ interface AgentAiEngine {
10
+ chatCompletion(modelId: string, messages: LlmRequestMessage[], options?: LlmCallOptions & {
11
+ signal?: AbortSignal;
12
+ }): Promise<unknown>;
13
+ chatCompletionStream(modelId: string, messages: LlmRequestMessage[], options?: LlmCallOptions & {
14
+ signal?: AbortSignal;
15
+ stream_options?: {
16
+ include_usage?: boolean;
17
+ };
18
+ }, onContent?: (content: AgentAiEngineStreamContent) => void, onError?: (error: Error) => void, onFinish?: (reason: string) => void, onThought?: (thought: string) => void, onUsage?: (usage: unknown) => void): Promise<void>;
19
+ }
20
+
21
+ /**
22
+ * 审计事件输出端口。
23
+ *
24
+ * 中文备注:
25
+ * - emit 允许同步或异步实现;framework 调用方需要 await,避免 file sink 未写完;
26
+ * - envelope 是追加只读事实,不提供 update/delete。
27
+ */
28
+ interface AuditPort {
29
+ emit(envelope: AuditEnvelope): void | Promise<void>;
30
+ flush?(): void | Promise<void>;
31
+ }
32
+
33
+ export type { AgentAiEngine as A, AgentAiEngineStreamContent as a, AuditPort as b };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @file shared/checkpointMarker.ts
3
+ * @description 上下文 checkpoint 的跨模块共享协议常量。
4
+ */
5
+ declare const CHECKPOINT_MARKER_TYPE: "context_checkpoint";
6
+ declare const DEFAULT_CONTEXT_CHECKPOINT_TOOL_NAME: "context_checkpoint";
7
+
8
+ export { CHECKPOINT_MARKER_TYPE as C, DEFAULT_CONTEXT_CHECKPOINT_TOOL_NAME as D };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @file shared/checkpointMarker.ts
3
+ * @description 上下文 checkpoint 的跨模块共享协议常量。
4
+ */
5
+ declare const CHECKPOINT_MARKER_TYPE: "context_checkpoint";
6
+ declare const DEFAULT_CONTEXT_CHECKPOINT_TOOL_NAME: "context_checkpoint";
7
+
8
+ export { CHECKPOINT_MARKER_TYPE as C, DEFAULT_CONTEXT_CHECKPOINT_TOOL_NAME as D };