@namzu/sdk 31.1.0 → 32.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/dist/agents/ReactiveAgent.d.ts.map +1 -1
- package/dist/agents/ReactiveAgent.js +4 -0
- package/dist/agents/ReactiveAgent.js.map +1 -1
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js +4 -0
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/agents/runAgent.d.ts +4 -0
- package/dist/agents/runAgent.d.ts.map +1 -1
- package/dist/agents/runAgent.js +4 -0
- package/dist/agents/runAgent.js.map +1 -1
- package/dist/directory/derive-supervisor.d.ts.map +1 -1
- package/dist/directory/derive-supervisor.js +5 -0
- package/dist/directory/derive-supervisor.js.map +1 -1
- package/dist/directory/derive.d.ts.map +1 -1
- package/dist/directory/derive.js +5 -0
- package/dist/directory/derive.js.map +1 -1
- package/dist/directory/load.d.ts.map +1 -1
- package/dist/directory/load.js +1 -0
- package/dist/directory/load.js.map +1 -1
- package/dist/directory/types.d.ts +2 -0
- package/dist/directory/types.d.ts.map +1 -1
- package/dist/execution/code-runtime/types.d.ts +11 -1
- package/dist/execution/code-runtime/types.d.ts.map +1 -1
- package/dist/execution/code-runtime/types.js.map +1 -1
- package/dist/execution/code-runtime/worker.d.ts.map +1 -1
- package/dist/execution/code-runtime/worker.js +67 -9
- package/dist/execution/code-runtime/worker.js.map +1 -1
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +1 -0
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/provider/errors.d.ts +1 -0
- package/dist/provider/errors.d.ts.map +1 -1
- package/dist/provider/errors.js +39 -1
- package/dist/provider/errors.js.map +1 -1
- package/dist/public-runtime.d.ts +5 -3
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +7 -2
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-types.d.ts +2 -1
- package/dist/public-types.d.ts.map +1 -1
- package/dist/run/reporter.d.ts.map +1 -1
- package/dist/run/reporter.js +6 -1
- package/dist/run/reporter.js.map +1 -1
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +214 -29
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts +5 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +1 -0
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts +1 -0
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +34 -14
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/advisory.js +2 -2
- package/dist/runtime/query/iteration/phases/advisory.js.map +1 -1
- package/dist/runtime/query/iteration/provider-rejected-image.d.ts +13 -0
- package/dist/runtime/query/iteration/provider-rejected-image.d.ts.map +1 -0
- package/dist/runtime/query/iteration/provider-rejected-image.js +91 -0
- package/dist/runtime/query/iteration/provider-rejected-image.js.map +1 -0
- package/dist/runtime/query/iteration/stream-turn.d.ts +4 -1
- package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.js +7 -3
- package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
- package/dist/runtime/query/request-rich-content.d.ts +13 -0
- package/dist/runtime/query/request-rich-content.d.ts.map +1 -1
- package/dist/runtime/query/request-rich-content.js +153 -17
- package/dist/runtime/query/request-rich-content.js.map +1 -1
- package/dist/runtime/query/result.d.ts.map +1 -1
- package/dist/runtime/query/result.js +1 -0
- package/dist/runtime/query/result.js.map +1 -1
- package/dist/store/attachment/index.d.ts +24 -2
- package/dist/store/attachment/index.d.ts.map +1 -1
- package/dist/store/attachment/index.js +52 -5
- package/dist/store/attachment/index.js.map +1 -1
- package/dist/tools/builtins/lsp.d.ts +1 -1
- package/dist/tools/builtins/run-code.d.ts.map +1 -1
- package/dist/tools/builtins/run-code.js +15 -5
- package/dist/tools/builtins/run-code.js.map +1 -1
- package/dist/types/agent/base.d.ts +4 -0
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/factory.d.ts +1 -0
- package/dist/types/agent/factory.d.ts.map +1 -1
- package/dist/types/message/index.d.ts +31 -1
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +42 -0
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/provider/error.d.ts +4 -1
- package/dist/types/provider/error.d.ts.map +1 -1
- package/dist/types/run/events.d.ts +10 -2
- package/dist/types/run/events.d.ts.map +1 -1
- package/dist/types/run/events.js.map +1 -1
- package/dist/types/tool/index.d.ts +52 -6
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/package.json +1 -1
- package/src/agents/ReactiveAgent.ts +4 -0
- package/src/agents/SupervisorAgent.ts +4 -0
- package/src/agents/runAgent.ts +8 -0
- package/src/directory/derive-supervisor.ts +5 -0
- package/src/directory/derive.ts +5 -0
- package/src/directory/load.ts +1 -0
- package/src/directory/types.ts +2 -0
- package/src/execution/code-runtime/types.ts +15 -1
- package/src/execution/code-runtime/worker.ts +72 -9
- package/src/manager/agent/lifecycle.ts +1 -0
- package/src/provider/errors.ts +40 -1
- package/src/public-runtime.ts +16 -1
- package/src/public-types.ts +11 -0
- package/src/run/reporter.ts +7 -1
- package/src/runtime/query/executor.ts +235 -26
- package/src/runtime/query/index.ts +6 -0
- package/src/runtime/query/iteration/index.ts +69 -29
- package/src/runtime/query/iteration/phases/advisory.ts +2 -2
- package/src/runtime/query/iteration/provider-rejected-image.ts +106 -0
- package/src/runtime/query/iteration/stream-turn.ts +12 -2
- package/src/runtime/query/request-rich-content.ts +188 -15
- package/src/runtime/query/result.ts +1 -0
- package/src/store/attachment/index.ts +100 -15
- package/src/tools/builtins/run-code.ts +15 -5
- package/src/types/agent/base.ts +4 -0
- package/src/types/agent/factory.ts +1 -0
- package/src/types/message/index.ts +77 -1
- package/src/types/provider/error.ts +4 -1
- package/src/types/run/events.ts +18 -4
- package/src/types/tool/index.ts +74 -9
|
@@ -105,6 +105,17 @@ export class WorkerCodeRuntime implements CodeRuntime {
|
|
|
105
105
|
let output = ''
|
|
106
106
|
let truncated = false
|
|
107
107
|
|
|
108
|
+
// A withdrawn caller owns admission. Do not start an isolate merely to
|
|
109
|
+
// discover the signal was already aborted after construction.
|
|
110
|
+
if (options.signal?.aborted) {
|
|
111
|
+
return {
|
|
112
|
+
outcome: { status: 'cancelled' },
|
|
113
|
+
output,
|
|
114
|
+
outputTruncated: truncated,
|
|
115
|
+
calls,
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
108
119
|
const appendOutput = (lines: readonly string[]): void => {
|
|
109
120
|
for (const line of lines) {
|
|
110
121
|
if (truncated) return
|
|
@@ -143,6 +154,10 @@ export class WorkerCodeRuntime implements CodeRuntime {
|
|
|
143
154
|
|
|
144
155
|
return await new Promise<CodeRunResult>((resolve) => {
|
|
145
156
|
let settled = false
|
|
157
|
+
let terminal: CodeRunResult | undefined
|
|
158
|
+
const inFlight = new Set<Promise<void>>()
|
|
159
|
+
const operation = new AbortController()
|
|
160
|
+
|
|
146
161
|
const finish = (result: CodeRunResult): void => {
|
|
147
162
|
// The Promise already ignores a second `resolve`, so removing
|
|
148
163
|
// this guard changes no result — a mutation removing it
|
|
@@ -153,18 +168,42 @@ export class WorkerCodeRuntime implements CodeRuntime {
|
|
|
153
168
|
// then `exit` is the ordinary sequence, not an edge case.
|
|
154
169
|
if (settled) return
|
|
155
170
|
settled = true
|
|
171
|
+
// Terminating the worker only stops the program. Host work already
|
|
172
|
+
// admitted through onHostCall lives outside it, so revoke the signal
|
|
173
|
+
// that was handed to every such call before reporting settlement.
|
|
174
|
+
if (!operation.signal.aborted) {
|
|
175
|
+
operation.abort(new Error(`Code runtime settled with status ${result.outcome.status}`))
|
|
176
|
+
}
|
|
156
177
|
clearTimeout(deadline)
|
|
157
178
|
options.signal?.removeEventListener('abort', onAbort)
|
|
158
179
|
void worker.terminate()
|
|
159
|
-
|
|
180
|
+
// A late, non-cooperative host call must not mutate a result the
|
|
181
|
+
// caller already received.
|
|
182
|
+
resolve({ ...result, calls: [...calls] })
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const finishTerminalWhenHostCallsSettle = (): void => {
|
|
186
|
+
if (terminal && inFlight.size === 0) finish(terminal)
|
|
160
187
|
}
|
|
161
188
|
|
|
162
189
|
const deadline = setTimeout(() => {
|
|
163
|
-
|
|
190
|
+
operation.abort(new Error(`Code runtime exceeded ${options.timeoutMs}ms`))
|
|
191
|
+
finish({
|
|
192
|
+
outcome: { status: 'timed-out' },
|
|
193
|
+
output,
|
|
194
|
+
outputTruncated: truncated,
|
|
195
|
+
calls,
|
|
196
|
+
})
|
|
164
197
|
}, options.timeoutMs)
|
|
165
198
|
|
|
166
199
|
const onAbort = (): void => {
|
|
167
|
-
|
|
200
|
+
operation.abort(options.signal?.reason)
|
|
201
|
+
finish({
|
|
202
|
+
outcome: { status: 'cancelled' },
|
|
203
|
+
output,
|
|
204
|
+
outputTruncated: truncated,
|
|
205
|
+
calls,
|
|
206
|
+
})
|
|
168
207
|
}
|
|
169
208
|
options.signal?.addEventListener('abort', onAbort, { once: true })
|
|
170
209
|
if (options.signal?.aborted) {
|
|
@@ -185,13 +224,23 @@ export class WorkerCodeRuntime implements CodeRuntime {
|
|
|
185
224
|
kind: 'call-result',
|
|
186
225
|
id,
|
|
187
226
|
ok: false,
|
|
188
|
-
error: new HostCallDeniedError({
|
|
227
|
+
error: new HostCallDeniedError({
|
|
228
|
+
name,
|
|
229
|
+
allowed: options.allowedCalls,
|
|
230
|
+
}).message,
|
|
189
231
|
})
|
|
190
232
|
return
|
|
191
233
|
}
|
|
192
|
-
|
|
193
|
-
|
|
234
|
+
const runtimeToolCallId = String(id)
|
|
235
|
+
const hostCall = Promise.resolve()
|
|
236
|
+
.then(() =>
|
|
237
|
+
options.onHostCall(
|
|
238
|
+
{ name, input: message.input },
|
|
239
|
+
{ runtimeToolCallId, signal: operation.signal },
|
|
240
|
+
),
|
|
241
|
+
)
|
|
194
242
|
.then((result) => {
|
|
243
|
+
if (settled) return
|
|
195
244
|
calls.push({ name, ok: result.ok })
|
|
196
245
|
worker.postMessage({
|
|
197
246
|
kind: 'call-result',
|
|
@@ -202,6 +251,7 @@ export class WorkerCodeRuntime implements CodeRuntime {
|
|
|
202
251
|
})
|
|
203
252
|
})
|
|
204
253
|
.catch((err: unknown) => {
|
|
254
|
+
if (settled) return
|
|
205
255
|
calls.push({ name, ok: false })
|
|
206
256
|
worker.postMessage({
|
|
207
257
|
kind: 'call-result',
|
|
@@ -210,6 +260,11 @@ export class WorkerCodeRuntime implements CodeRuntime {
|
|
|
210
260
|
error: err instanceof Error ? err.message : String(err),
|
|
211
261
|
})
|
|
212
262
|
})
|
|
263
|
+
.finally(() => {
|
|
264
|
+
inFlight.delete(hostCall)
|
|
265
|
+
finishTerminalWhenHostCallsSettle()
|
|
266
|
+
})
|
|
267
|
+
inFlight.add(hostCall)
|
|
213
268
|
return
|
|
214
269
|
}
|
|
215
270
|
|
|
@@ -219,12 +274,17 @@ export class WorkerCodeRuntime implements CodeRuntime {
|
|
|
219
274
|
}
|
|
220
275
|
|
|
221
276
|
if (message.kind === 'done') {
|
|
222
|
-
|
|
277
|
+
// A program may start a host call without awaiting it. The worker
|
|
278
|
+
// declaring its JavaScript body complete is not evidence that the
|
|
279
|
+
// effect it started is complete, so keep the runtime open until the
|
|
280
|
+
// already-admitted host calls settle (or the deadline revokes them).
|
|
281
|
+
terminal = {
|
|
223
282
|
outcome: { status: 'completed', result: message.result },
|
|
224
283
|
output,
|
|
225
284
|
outputTruncated: truncated,
|
|
226
285
|
calls,
|
|
227
|
-
}
|
|
286
|
+
}
|
|
287
|
+
finishTerminalWhenHostCallsSettle()
|
|
228
288
|
return
|
|
229
289
|
}
|
|
230
290
|
|
|
@@ -255,7 +315,10 @@ export class WorkerCodeRuntime implements CodeRuntime {
|
|
|
255
315
|
// `error` message — a hard crash, or a program that called
|
|
256
316
|
// `process.exit` through something we failed to withhold.
|
|
257
317
|
finish({
|
|
258
|
-
outcome: {
|
|
318
|
+
outcome: {
|
|
319
|
+
status: 'failed',
|
|
320
|
+
error: `The program exited with code ${code}.`,
|
|
321
|
+
},
|
|
259
322
|
output,
|
|
260
323
|
outputTruncated: truncated,
|
|
261
324
|
calls,
|
|
@@ -396,6 +396,7 @@ export class AgentManager {
|
|
|
396
396
|
timeoutMs: options.budgetAllocation?.timeoutMs ?? this.config.childTimeoutMs,
|
|
397
397
|
streamIdleTimeoutMs: options.configOverrides?.streamIdleTimeoutMs,
|
|
398
398
|
maxRequestRichContentBytes: options.configOverrides?.maxRequestRichContentBytes,
|
|
399
|
+
attachmentResolveTimeoutMs: options.configOverrides?.attachmentResolveTimeoutMs,
|
|
399
400
|
temperature: options.configOverrides?.temperature,
|
|
400
401
|
parentSpan: options.configOverrides?.parentSpan,
|
|
401
402
|
maxIterations: options.configOverrides?.maxIterations,
|
package/src/provider/errors.ts
CHANGED
|
@@ -57,6 +57,7 @@ const PROVIDER_ERROR_KINDS: readonly ProviderErrorKind[] = [
|
|
|
57
57
|
export class ProviderRequestError extends Error {
|
|
58
58
|
public readonly kind: ProviderErrorKind
|
|
59
59
|
public readonly providerId: string
|
|
60
|
+
public readonly providerCode?: string
|
|
60
61
|
public readonly status?: number
|
|
61
62
|
public readonly retryAfterMs?: number
|
|
62
63
|
/**
|
|
@@ -81,6 +82,8 @@ export class ProviderRequestError extends Error {
|
|
|
81
82
|
this.name = 'ProviderRequestError'
|
|
82
83
|
this.kind = init.kind
|
|
83
84
|
this.providerId = init.providerId
|
|
85
|
+
const exactProviderCode = safeProviderCode(init.providerCode)
|
|
86
|
+
if (exactProviderCode !== undefined) this.providerCode = exactProviderCode
|
|
84
87
|
if (init.status !== undefined) this.status = init.status
|
|
85
88
|
if (init.retryAfterMs !== undefined) this.retryAfterMs = init.retryAfterMs
|
|
86
89
|
if (init.detail !== undefined) this.detail = init.detail
|
|
@@ -90,6 +93,32 @@ export class ProviderRequestError extends Error {
|
|
|
90
93
|
/** Longest detail worth carrying. A provider's complaint is a sentence. */
|
|
91
94
|
const DETAIL_MAX = 400
|
|
92
95
|
|
|
96
|
+
/** Provider codes are identifiers, not another channel for an arbitrary response body. */
|
|
97
|
+
const PROVIDER_CODE = /^[A-Za-z][A-Za-z0-9._-]{0,79}$/
|
|
98
|
+
|
|
99
|
+
function safeProviderCode(value: unknown): string | undefined {
|
|
100
|
+
if (typeof value !== 'string' || !PROVIDER_CODE.test(value)) return undefined
|
|
101
|
+
return redactSecrets(value) === value ? value : undefined
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function providerCode(value: unknown): string | undefined {
|
|
105
|
+
let decoded = value
|
|
106
|
+
if (typeof decoded === 'string') {
|
|
107
|
+
try {
|
|
108
|
+
decoded = JSON.parse(decoded)
|
|
109
|
+
} catch {
|
|
110
|
+
return undefined
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (typeof decoded !== 'object' || decoded === null) return undefined
|
|
114
|
+
const record = decoded as Record<string, unknown>
|
|
115
|
+
const nested =
|
|
116
|
+
typeof record.error === 'object' && record.error !== null
|
|
117
|
+
? (record.error as Record<string, unknown>).code
|
|
118
|
+
: undefined
|
|
119
|
+
return safeProviderCode(record.code ?? nested)
|
|
120
|
+
}
|
|
121
|
+
|
|
93
122
|
/**
|
|
94
123
|
* Credential shapes to scrub before a provider's words are kept.
|
|
95
124
|
*
|
|
@@ -161,11 +190,15 @@ function pickMessage(value: unknown): string | undefined {
|
|
|
161
190
|
|
|
162
191
|
/** Is this a classified provider failure, whichever SDK copy threw it? */
|
|
163
192
|
export function isProviderRequestError(err: unknown): err is ProviderRequestError {
|
|
193
|
+
const exactProviderCode = (err as { providerCode?: unknown } | null)?.providerCode
|
|
164
194
|
return (
|
|
165
195
|
err instanceof Error &&
|
|
166
196
|
err.name === 'ProviderRequestError' &&
|
|
167
197
|
typeof (err as { providerId?: unknown }).providerId === 'string' &&
|
|
168
|
-
PROVIDER_ERROR_KINDS.includes(
|
|
198
|
+
PROVIDER_ERROR_KINDS.includes(
|
|
199
|
+
(err as { kind?: ProviderErrorKind }).kind as ProviderErrorKind,
|
|
200
|
+
) &&
|
|
201
|
+
(exactProviderCode === undefined || safeProviderCode(exactProviderCode) === exactProviderCode)
|
|
169
202
|
)
|
|
170
203
|
}
|
|
171
204
|
|
|
@@ -393,6 +426,7 @@ export function providerVendorError(input: {
|
|
|
393
426
|
}): ProviderRequestError {
|
|
394
427
|
const { error } = input
|
|
395
428
|
const status = vendorErrorStatus(error)
|
|
429
|
+
const exactProviderCode = providerCode(error)
|
|
396
430
|
const name = error instanceof Error ? error.name : ''
|
|
397
431
|
const message = error instanceof Error ? error.message : ''
|
|
398
432
|
|
|
@@ -411,6 +445,8 @@ export function providerVendorError(input: {
|
|
|
411
445
|
kind = 'server'
|
|
412
446
|
} else if (status !== undefined) {
|
|
413
447
|
kind = classifyProviderHttpStatus(status, message)
|
|
448
|
+
} else if (exactProviderCode === 'invalid_image') {
|
|
449
|
+
kind = 'bad_request'
|
|
414
450
|
} else if (bodySaysContextOverflow(message)) {
|
|
415
451
|
kind = 'context_overflow'
|
|
416
452
|
} else {
|
|
@@ -428,6 +464,7 @@ export function providerVendorError(input: {
|
|
|
428
464
|
return new ProviderRequestError({
|
|
429
465
|
kind,
|
|
430
466
|
providerId: input.providerId,
|
|
467
|
+
...(exactProviderCode !== undefined ? { providerCode: exactProviderCode } : {}),
|
|
431
468
|
...(status !== undefined ? { status } : {}),
|
|
432
469
|
...(retryAfterMs !== undefined ? { retryAfterMs } : {}),
|
|
433
470
|
...(detail !== undefined ? { detail } : {}),
|
|
@@ -450,9 +487,11 @@ export function providerHttpError(input: {
|
|
|
450
487
|
const kind = classifyProviderHttpStatus(input.status, input.body)
|
|
451
488
|
const retryAfterMs = parseRetryAfterMs(input.retryAfter, input.now ?? Date.now())
|
|
452
489
|
const detail = vendorDetail(input.body)
|
|
490
|
+
const exactProviderCode = providerCode(input.body)
|
|
453
491
|
return new ProviderRequestError({
|
|
454
492
|
kind,
|
|
455
493
|
providerId: input.providerId,
|
|
494
|
+
...(exactProviderCode !== undefined ? { providerCode: exactProviderCode } : {}),
|
|
456
495
|
status: input.status,
|
|
457
496
|
...(retryAfterMs !== undefined ? { retryAfterMs } : {}),
|
|
458
497
|
...(detail !== undefined ? { detail } : {}),
|
package/src/public-runtime.ts
CHANGED
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
export { VERSION } from './version.js'
|
|
14
14
|
|
|
15
|
+
// The opt-in model-authored-code backend. `RunCodeToolOptions.runtime` has
|
|
16
|
+
// always accepted this contract; exporting the implementation and its refusal
|
|
17
|
+
// class makes that signature nameable from the package root.
|
|
18
|
+
export { HostCallDeniedError } from './execution/code-runtime/types.js'
|
|
19
|
+
export { WorkerCodeRuntime } from './execution/code-runtime/worker.js'
|
|
20
|
+
|
|
15
21
|
export {
|
|
16
22
|
CompactionConfigSchema,
|
|
17
23
|
PluginRuntimeConfigSchema,
|
|
@@ -995,6 +1001,7 @@ export { assertMemoryStatus } from './types/memory/index.js'
|
|
|
995
1001
|
export {
|
|
996
1002
|
createAssistantMessage,
|
|
997
1003
|
createProjectInstructionMessage,
|
|
1004
|
+
createRuntimeContextMessage,
|
|
998
1005
|
createSystemMessage,
|
|
999
1006
|
createToolMessage,
|
|
1000
1007
|
hasNonTextBlocks,
|
|
@@ -1002,7 +1009,10 @@ export {
|
|
|
1002
1009
|
toolResultToText,
|
|
1003
1010
|
createUserMessage,
|
|
1004
1011
|
isProjectInstructionMessageSource,
|
|
1012
|
+
isRuntimeContextMessageSource,
|
|
1013
|
+
isModelContentOmission,
|
|
1005
1014
|
MAX_PROJECT_INSTRUCTION_SOURCE_FILES,
|
|
1015
|
+
RUNTIME_CONTEXT_MESSAGE_KINDS,
|
|
1006
1016
|
} from './types/message/index.js'
|
|
1007
1017
|
export { isTerminalPlanStatus } from './types/plan/index.js'
|
|
1008
1018
|
export {
|
|
@@ -1198,8 +1208,10 @@ export {
|
|
|
1198
1208
|
// Inline base64 lands in the transcript, in every checkpoint, and on the
|
|
1199
1209
|
// wire once per turn; a reference does not.
|
|
1200
1210
|
export {
|
|
1211
|
+
DEFAULT_ATTACHMENT_RESOLVE_TIMEOUT_MS,
|
|
1201
1212
|
AttachmentMediaTypeMismatchError,
|
|
1202
1213
|
AttachmentNotFoundError,
|
|
1214
|
+
AttachmentResolutionTimeoutError,
|
|
1203
1215
|
NoAttachmentStoreError,
|
|
1204
1216
|
isStoredAttachment,
|
|
1205
1217
|
resolveAttachment,
|
|
@@ -1254,7 +1266,10 @@ export type {
|
|
|
1254
1266
|
CompactionVerificationOptions,
|
|
1255
1267
|
UsageSink,
|
|
1256
1268
|
} from './compaction/verifier.js'
|
|
1257
|
-
export type {
|
|
1269
|
+
export type {
|
|
1270
|
+
PluginDiscoveryOptions,
|
|
1271
|
+
PluginEnablementCapabilities,
|
|
1272
|
+
} from './plugin/loader.js'
|
|
1258
1273
|
export type { ProbeContextInput } from './probe/context.js'
|
|
1259
1274
|
export type {
|
|
1260
1275
|
GoalCommandScope,
|
package/src/public-types.ts
CHANGED
|
@@ -19,6 +19,16 @@ export type * from './types/common/index.js'
|
|
|
19
19
|
export type { CoalesceOptions } from './streaming/coalesce.js'
|
|
20
20
|
export type * from './types/bidi/index.js'
|
|
21
21
|
export type * from './types/tool/index.js'
|
|
22
|
+
export type {
|
|
23
|
+
CodeRunOutcome,
|
|
24
|
+
CodeRunResult,
|
|
25
|
+
CodeRuntime,
|
|
26
|
+
HostCallContext,
|
|
27
|
+
HostCallHandler,
|
|
28
|
+
HostCallRequest,
|
|
29
|
+
HostCallResult,
|
|
30
|
+
RunCodeOptions,
|
|
31
|
+
} from './execution/code-runtime/types.js'
|
|
22
32
|
// The directory convention: what a loaded `agent/` directory is, and what the
|
|
23
33
|
// loader reports about the files it could not use.
|
|
24
34
|
export type * from './directory/types.js'
|
|
@@ -336,6 +346,7 @@ export type {
|
|
|
336
346
|
|
|
337
347
|
export type {
|
|
338
348
|
AttachmentOperationOptions,
|
|
349
|
+
AttachmentResolutionOptions,
|
|
339
350
|
AttachmentStore,
|
|
340
351
|
StoredAttachment,
|
|
341
352
|
StoredBytes,
|
package/src/run/reporter.ts
CHANGED
|
@@ -344,12 +344,18 @@ export function createRunReporter(parentLogger?: Logger): RunReporter {
|
|
|
344
344
|
break
|
|
345
345
|
|
|
346
346
|
case 'message_history_repaired':
|
|
347
|
-
log.warn('Repaired provider-invalid
|
|
347
|
+
log.warn('Repaired provider-invalid conversation history', {
|
|
348
348
|
[NAMZU.RUN_ID]: event.runId,
|
|
349
349
|
'namzu.history.source': event.source,
|
|
350
350
|
'namzu.history.duplicate_tool_results_removed': event.duplicateToolResultsRemoved,
|
|
351
351
|
'namzu.history.orphaned_tool_results_removed': event.orphanedToolResultsRemoved,
|
|
352
352
|
'namzu.history.synthetic_tool_results_inserted': event.syntheticToolResultsInserted,
|
|
353
|
+
...(event.providerRejectedImagesSuppressed !== undefined
|
|
354
|
+
? {
|
|
355
|
+
'namzu.history.provider_rejected_images_suppressed':
|
|
356
|
+
event.providerRejectedImagesSuppressed,
|
|
357
|
+
}
|
|
358
|
+
: {}),
|
|
353
359
|
})
|
|
354
360
|
break
|
|
355
361
|
|