@namzu/sdk 31.0.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.
Files changed (133) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/agents/ReactiveAgent.d.ts.map +1 -1
  3. package/dist/agents/ReactiveAgent.js +4 -0
  4. package/dist/agents/ReactiveAgent.js.map +1 -1
  5. package/dist/agents/SupervisorAgent.d.ts.map +1 -1
  6. package/dist/agents/SupervisorAgent.js +4 -0
  7. package/dist/agents/SupervisorAgent.js.map +1 -1
  8. package/dist/agents/runAgent.d.ts +4 -0
  9. package/dist/agents/runAgent.d.ts.map +1 -1
  10. package/dist/agents/runAgent.js +4 -0
  11. package/dist/agents/runAgent.js.map +1 -1
  12. package/dist/directory/derive-supervisor.d.ts.map +1 -1
  13. package/dist/directory/derive-supervisor.js +5 -0
  14. package/dist/directory/derive-supervisor.js.map +1 -1
  15. package/dist/directory/derive.d.ts.map +1 -1
  16. package/dist/directory/derive.js +5 -0
  17. package/dist/directory/derive.js.map +1 -1
  18. package/dist/directory/load.d.ts.map +1 -1
  19. package/dist/directory/load.js +1 -0
  20. package/dist/directory/load.js.map +1 -1
  21. package/dist/directory/types.d.ts +2 -0
  22. package/dist/directory/types.d.ts.map +1 -1
  23. package/dist/execution/code-runtime/types.d.ts +11 -1
  24. package/dist/execution/code-runtime/types.d.ts.map +1 -1
  25. package/dist/execution/code-runtime/types.js.map +1 -1
  26. package/dist/execution/code-runtime/worker.d.ts.map +1 -1
  27. package/dist/execution/code-runtime/worker.js +67 -9
  28. package/dist/execution/code-runtime/worker.js.map +1 -1
  29. package/dist/manager/agent/lifecycle.d.ts.map +1 -1
  30. package/dist/manager/agent/lifecycle.js +1 -0
  31. package/dist/manager/agent/lifecycle.js.map +1 -1
  32. package/dist/provider/errors.d.ts +1 -0
  33. package/dist/provider/errors.d.ts.map +1 -1
  34. package/dist/provider/errors.js +39 -1
  35. package/dist/provider/errors.js.map +1 -1
  36. package/dist/public-runtime.d.ts +5 -3
  37. package/dist/public-runtime.d.ts.map +1 -1
  38. package/dist/public-runtime.js +7 -2
  39. package/dist/public-runtime.js.map +1 -1
  40. package/dist/public-types.d.ts +2 -1
  41. package/dist/public-types.d.ts.map +1 -1
  42. package/dist/run/reporter.d.ts.map +1 -1
  43. package/dist/run/reporter.js +6 -1
  44. package/dist/run/reporter.js.map +1 -1
  45. package/dist/runtime/query/executor.d.ts.map +1 -1
  46. package/dist/runtime/query/executor.js +214 -29
  47. package/dist/runtime/query/executor.js.map +1 -1
  48. package/dist/runtime/query/index.d.ts +5 -0
  49. package/dist/runtime/query/index.d.ts.map +1 -1
  50. package/dist/runtime/query/index.js +1 -0
  51. package/dist/runtime/query/index.js.map +1 -1
  52. package/dist/runtime/query/iteration/index.d.ts +1 -0
  53. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  54. package/dist/runtime/query/iteration/index.js +34 -14
  55. package/dist/runtime/query/iteration/index.js.map +1 -1
  56. package/dist/runtime/query/iteration/phases/advisory.js +2 -2
  57. package/dist/runtime/query/iteration/phases/advisory.js.map +1 -1
  58. package/dist/runtime/query/iteration/provider-rejected-image.d.ts +13 -0
  59. package/dist/runtime/query/iteration/provider-rejected-image.d.ts.map +1 -0
  60. package/dist/runtime/query/iteration/provider-rejected-image.js +91 -0
  61. package/dist/runtime/query/iteration/provider-rejected-image.js.map +1 -0
  62. package/dist/runtime/query/iteration/stream-turn.d.ts +4 -1
  63. package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
  64. package/dist/runtime/query/iteration/stream-turn.js +7 -3
  65. package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
  66. package/dist/runtime/query/request-rich-content.d.ts +13 -0
  67. package/dist/runtime/query/request-rich-content.d.ts.map +1 -1
  68. package/dist/runtime/query/request-rich-content.js +153 -17
  69. package/dist/runtime/query/request-rich-content.js.map +1 -1
  70. package/dist/runtime/query/result.d.ts.map +1 -1
  71. package/dist/runtime/query/result.js +1 -0
  72. package/dist/runtime/query/result.js.map +1 -1
  73. package/dist/store/attachment/index.d.ts +24 -2
  74. package/dist/store/attachment/index.d.ts.map +1 -1
  75. package/dist/store/attachment/index.js +52 -5
  76. package/dist/store/attachment/index.js.map +1 -1
  77. package/dist/tools/builtins/lsp.d.ts +1 -1
  78. package/dist/tools/builtins/run-code.d.ts.map +1 -1
  79. package/dist/tools/builtins/run-code.js +15 -5
  80. package/dist/tools/builtins/run-code.js.map +1 -1
  81. package/dist/types/agent/base.d.ts +4 -0
  82. package/dist/types/agent/base.d.ts.map +1 -1
  83. package/dist/types/agent/factory.d.ts +1 -0
  84. package/dist/types/agent/factory.d.ts.map +1 -1
  85. package/dist/types/message/index.d.ts +35 -4
  86. package/dist/types/message/index.d.ts.map +1 -1
  87. package/dist/types/message/index.js +42 -0
  88. package/dist/types/message/index.js.map +1 -1
  89. package/dist/types/provider/error.d.ts +4 -1
  90. package/dist/types/provider/error.d.ts.map +1 -1
  91. package/dist/types/provider/index.d.ts +1 -1
  92. package/dist/types/provider/index.d.ts.map +1 -1
  93. package/dist/types/provider/model.d.ts +12 -0
  94. package/dist/types/provider/model.d.ts.map +1 -1
  95. package/dist/types/run/events.d.ts +10 -2
  96. package/dist/types/run/events.d.ts.map +1 -1
  97. package/dist/types/run/events.js.map +1 -1
  98. package/dist/types/tool/index.d.ts +52 -6
  99. package/dist/types/tool/index.d.ts.map +1 -1
  100. package/dist/types/tool/index.js.map +1 -1
  101. package/package.json +1 -1
  102. package/src/agents/ReactiveAgent.ts +4 -0
  103. package/src/agents/SupervisorAgent.ts +4 -0
  104. package/src/agents/runAgent.ts +8 -0
  105. package/src/directory/derive-supervisor.ts +5 -0
  106. package/src/directory/derive.ts +5 -0
  107. package/src/directory/load.ts +1 -0
  108. package/src/directory/types.ts +2 -0
  109. package/src/execution/code-runtime/types.ts +15 -1
  110. package/src/execution/code-runtime/worker.ts +72 -9
  111. package/src/manager/agent/lifecycle.ts +1 -0
  112. package/src/provider/errors.ts +40 -1
  113. package/src/public-runtime.ts +16 -1
  114. package/src/public-types.ts +11 -0
  115. package/src/run/reporter.ts +7 -1
  116. package/src/runtime/query/executor.ts +235 -26
  117. package/src/runtime/query/index.ts +6 -0
  118. package/src/runtime/query/iteration/index.ts +69 -29
  119. package/src/runtime/query/iteration/phases/advisory.ts +2 -2
  120. package/src/runtime/query/iteration/provider-rejected-image.ts +106 -0
  121. package/src/runtime/query/iteration/stream-turn.ts +12 -2
  122. package/src/runtime/query/request-rich-content.ts +188 -15
  123. package/src/runtime/query/result.ts +1 -0
  124. package/src/store/attachment/index.ts +100 -15
  125. package/src/tools/builtins/run-code.ts +15 -5
  126. package/src/types/agent/base.ts +4 -0
  127. package/src/types/agent/factory.ts +1 -0
  128. package/src/types/message/index.ts +81 -4
  129. package/src/types/provider/error.ts +4 -1
  130. package/src/types/provider/index.ts +1 -1
  131. package/src/types/provider/model.ts +13 -0
  132. package/src/types/run/events.ts +18 -4
  133. package/src/types/tool/index.ts +74 -9
@@ -72,6 +72,11 @@ export function deriveRunOptions(
72
72
  maxRequestRichContentBytes: manifest.config.maxRequestRichContentBytes,
73
73
  }
74
74
  : {}),
75
+ ...(manifest.config.attachmentResolveTimeoutMs !== undefined
76
+ ? {
77
+ attachmentResolveTimeoutMs: manifest.config.attachmentResolveTimeoutMs,
78
+ }
79
+ : {}),
75
80
  ...(input.identity ?? {}),
76
81
  ...(input.overrides ?? {}),
77
82
  }
@@ -187,6 +187,7 @@ function readConfig(
187
187
  take('timeoutMs', isNumber, 'finite number')
188
188
  take('streamIdleTimeoutMs', isNumber, 'finite number')
189
189
  take('maxRequestRichContentBytes', isNumber, 'finite number')
190
+ take('attachmentResolveTimeoutMs', isNumber, 'finite number')
190
191
 
191
192
  // `metadata` is typed `Record<string, string>` and was admitted on
192
193
  // `typeof === 'object'` alone — which an array also satisfies, and which
@@ -170,6 +170,8 @@ export interface DirectoryConfig {
170
170
  readonly streamIdleTimeoutMs?: number
171
171
  /** Accumulated inline image/document bytes per provider request; `0` disables. */
172
172
  readonly maxRequestRichContentBytes?: number
173
+ /** Maximum stored-attachment materialization time; `0` disables the bound. */
174
+ readonly attachmentResolveTimeoutMs?: number
173
175
  /** Names the agent in traces and events when declared. */
174
176
  readonly name?: string
175
177
  /** Free-form labels for an inspector. Never interpreted by this package. */
@@ -42,6 +42,17 @@ export interface HostCallResult {
42
42
  readonly error?: string
43
43
  }
44
44
 
45
+ /** Authority and provenance for one call from a running program. */
46
+ export interface HostCallContext {
47
+ /** Unique within this program execution. */
48
+ readonly runtimeToolCallId: string
49
+ /**
50
+ * Revoked when the caller cancels or the program's own wall clock expires.
51
+ * A conforming host threads this into the operation it starts.
52
+ */
53
+ readonly signal: AbortSignal
54
+ }
55
+
45
56
  /**
46
57
  * What the host will answer.
47
58
  *
@@ -50,7 +61,10 @@ export interface HostCallResult {
50
61
  * exactly the point: the program's reach is the run's reach, resolved at
51
62
  * the moment of the call rather than frozen when the program started.
52
63
  */
53
- export type HostCallHandler = (request: HostCallRequest) => Promise<HostCallResult>
64
+ export type HostCallHandler = (
65
+ request: HostCallRequest,
66
+ context: HostCallContext,
67
+ ) => Promise<HostCallResult>
54
68
 
55
69
  export interface RunCodeOptions {
56
70
  /** The program. Untrusted text, from the model. */
@@ -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
- resolve(result)
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
- finish({ outcome: { status: 'timed-out' }, output, outputTruncated: truncated, calls })
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
- finish({ outcome: { status: 'cancelled' }, output, outputTruncated: truncated, calls })
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({ name, allowed: options.allowedCalls }).message,
227
+ error: new HostCallDeniedError({
228
+ name,
229
+ allowed: options.allowedCalls,
230
+ }).message,
189
231
  })
190
232
  return
191
233
  }
192
- void options
193
- .onHostCall({ name, input: message.input })
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
- finish({
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: { status: 'failed', error: `The program exited with code ${code}.` },
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,
@@ -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((err as { kind?: ProviderErrorKind }).kind as ProviderErrorKind)
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 } : {}),
@@ -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 { PluginDiscoveryOptions, PluginEnablementCapabilities } from './plugin/loader.js'
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,
@@ -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,
@@ -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 tool history', {
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