@sema-agent/sdk 0.1.3 → 0.1.4

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 (2) hide show
  1. package/openapi.yaml +103 -0
  2. package/package.json +1 -1
package/openapi.yaml CHANGED
@@ -6160,6 +6160,109 @@ components:
6160
6160
  source: { type: string }
6161
6161
  isNew: { type: boolean }
6162
6162
 
6163
+ ToolApprovalFrame:
6164
+ type: object
6165
+ description: >
6166
+ LIVE tool-approval frame (SSE, `type` IS the event name). NOT an AgentEvent arm — it interleaves on the
6167
+ run's stream when TOOL_APPROVAL_ENABLED. The shell renders `tool_approval` as the three-choice card and
6168
+ dismisses it on `tool_approval_complete`. Respond via POST /v1/tool-approvals/{approvalId}/respond.
6169
+ required: [type, approvalId]
6170
+ additionalProperties: true
6171
+ properties:
6172
+ type: { type: string, enum: [tool_approval, tool_approval_complete] }
6173
+ approvalId:
6174
+ type: string
6175
+ description: 'The approval''s OWN key (uuidv7) — echo it to respond; the complete frame settles by it.'
6176
+ toolCallId:
6177
+ type: string
6178
+ description: >
6179
+ server >= 1.307 (ADDITIVE), "tool_approval" only: the ENGINE's tool-call id — the same `call_…` that
6180
+ rides the assistant message's tool_use block. ANCHOR THE CARD ON THIS. `approvalId` is unrelated to
6181
+ that block and nothing else on the stream ever mentions it again, so a card keyed by it is never
6182
+ reclaimed. Anchoring on "the most recent tool_start" does not work either: the approval frame arrives
6183
+ BEFORE tool_start (measured 4020ms vs 4142ms in one turn). Absent on the complete frame (a second
6184
+ anchor would only add ambiguity) and on servers < 1.307.
6185
+ toolName: { type: string, description: '"tool_approval" only: canonical core tool name.' }
6186
+ message: { type: string, description: '"tool_approval" only: the policy''s ask message, secret-redacted. UNTRUSTED for display.' }
6187
+ args:
6188
+ description: '"tool_approval" only: the call''s args, secret-redacted. UNTRUSTED for display. Absent (with argsOmitted) when over the byte cap or unserializable.'
6189
+ argsOmitted: { type: boolean, enum: [true] }
6190
+ fromSubagent:
6191
+ type: boolean
6192
+ enum: [true]
6193
+ description: 'Present ⇔ the ask comes from a DELEGATED background/nested child — the EXPLICIT discriminator (trusted engine fact).'
6194
+ sourceTaskId:
6195
+ type: string
6196
+ description: 'Child''s core session id (same id domain as task_progress.taskId) — row-join value + fallback discriminator against a server predating fromSubagent.'
6197
+ sourceAgentName: { type: string, description: 'Display name of the child agent, redacted. UNTRUSTED.' }
6198
+ outcome:
6199
+ type: string
6200
+ enum: [allowed, denied, expired]
6201
+ description: '"tool_approval_complete" only. `expired` = TTL/abort/disconnect — a fail-closed DENY the shell should render as such, not as "still pending".'
6202
+
6203
+ QuestionFrame:
6204
+ type: object
6205
+ description: >
6206
+ LIVE AskUserQuestion frame (SSE, `type` IS the event name). NOT an AgentEvent arm. Respond via
6207
+ POST /v1/questions/{questionId}/respond; unanswered asks fall back to the headless default.
6208
+ required: [type, questionId]
6209
+ additionalProperties: true
6210
+ properties:
6211
+ type: { type: string, enum: [question, question_complete] }
6212
+ questionId: { type: string, description: 'Echo it to respond.' }
6213
+ questions:
6214
+ type: array
6215
+ items: { $ref: '#/components/schemas/AskQuestion' }
6216
+ description: '"question" only: the model''s structured questions, secret-redacted. UNTRUSTED — never re-feed to a model. Absent on an over-cap payload (the ask then headless-defaults and the shell never renders it).'
6217
+ outcome:
6218
+ type: string
6219
+ enum: [answered, unanswered]
6220
+ description: '"question_complete" only: `answered` = a human responded; `unanswered` = ttl/abort/throttle released it (the model got the headless default). Cosmetic dismiss reason.'
6221
+
6222
+ AskQuestion:
6223
+ type: object
6224
+ description: 'One structured question inside a QuestionFrame (= core AskUserQuestion shape).'
6225
+ required: [question, header, options, multiSelect]
6226
+ additionalProperties: true
6227
+ properties:
6228
+ question: { type: string }
6229
+ header: { type: string, description: 'Very short chip label (<= 12 chars).' }
6230
+ multiSelect: { type: boolean }
6231
+ options:
6232
+ type: array
6233
+ items: { $ref: '#/components/schemas/AskQuestionOption' }
6234
+
6235
+ AskQuestionOption:
6236
+ type: object
6237
+ required: [label, description]
6238
+ additionalProperties: true
6239
+ properties:
6240
+ label: { type: string }
6241
+ description: { type: string }
6242
+ preview: { type: string, description: 'Optional monospace preview body (mockups / code / diagrams) rendered when this option is focused.' }
6243
+
6244
+ ElicitationFrame:
6245
+ type: object
6246
+ description: >
6247
+ LIVE MCP elicitation frame (SSE, `type` IS the event name). NOT an AgentEvent arm. Respond via
6248
+ POST /v1/elicitations/{elicitationId}/respond.
6249
+ required: [type, elicitationId, mcpServerName]
6250
+ additionalProperties: true
6251
+ properties:
6252
+ type: { type: string, enum: [elicitation, elicitation_complete] }
6253
+ elicitationId: { type: string, description: 'Echo it to respond.' }
6254
+ mcpServerName:
6255
+ type: string
6256
+ description: 'Which opted-in MCP server asked — also the trust label core fences `message` against.'
6257
+ message: { type: string, description: '"elicitation" only: FENCED + secret-redacted human-facing prompt. UNTRUSTED — never re-feed to a model.' }
6258
+ requestedSchema:
6259
+ description: '"elicitation" only: the server''s requested input schema. OPAQUE passthrough — never interpreted/validated; still server-controlled UNTRUSTED, so fence it on display.'
6260
+ mode: { type: string, enum: [form], description: '"elicitation" only: always "form" in v1 (url-mode is rejected upstream).' }
6261
+ action:
6262
+ type: string
6263
+ enum: [accept, decline, cancel]
6264
+ description: '"elicitation_complete" only: how it resolved (dialog dismiss reason).'
6265
+
6163
6266
  Event_steering_injected:
6164
6267
  type: object
6165
6268
  description: >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/sdk",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Typed, zero-runtime-dependency SDK for the Sema agent fleet usage plane. The shared substrate for all doors (CC/Codex MCP façade + web). Server-side only — tokens never enter the browser.",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",