@vellumai/plugin-api 0.12.2-dev.202609211820.22f71b0 → 0.12.2-dev.202609211913.b0ee78c

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 (3) hide show
  1. package/index.d.ts +48 -0
  2. package/index.js +3 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -12342,6 +12342,13 @@ declare type InterfaceId = (typeof INTERFACE_IDS)[number];
12342
12342
  */
12343
12343
  export declare const INTERNAL_NUDGE_OUTPUT_SUPPRESSION = " This notice is internal: do not repeat, quote, describe, or acknowledge it, and do not narrate whether you will continue or whether the turn is done. Reply with only the content the user should see.";
12344
12344
 
12345
+ /**
12346
+ * Failed-parse tool result for executors that validate their own input (the
12347
+ * pre-execution gate in `ToolApprovalHandler` produces the same message, so
12348
+ * the error reads identically whichever layer catches it first).
12349
+ */
12350
+ export declare function invalidToolInputResult(toolName: string, error: z.ZodError): ToolExecutionResult;
12351
+
12345
12352
  /** Whether the conversation currently has a turn in flight. */
12346
12353
  export declare function isConversationProcessing(id: string): Promise<boolean>;
12347
12354
 
@@ -18105,6 +18112,16 @@ generated: undefined;
18105
18112
  dialect: "sqlite";
18106
18113
  }>;
18107
18114
 
18115
+ /**
18116
+ * Wrap an optional field's schema so an explicit `null` parses as "omitted"
18117
+ * (`undefined`). Models routinely send `null` for optional fields they mean
18118
+ * to skip, and executors read such fields via `input.x ?? fallback`, where
18119
+ * null and absent are equivalent — validation must not reject null there.
18120
+ * The derived JSON Schema is the inner schema's (the null-tolerance is
18121
+ * runtime slack, not advertised contract).
18122
+ */
18123
+ export declare function nullAsOmitted<T extends z.ZodType>(schema: T): z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<T>>;
18124
+
18108
18125
  declare const oauthApps: SQLiteTableWithColumns< {
18109
18126
  name: "oauth_apps";
18110
18127
  schema: undefined;
@@ -24369,6 +24386,37 @@ export declare interface ToolUseContent {
24369
24386
  };
24370
24387
  }
24371
24388
 
24389
+ /**
24390
+ * Derive a tool's LLM-facing `input_schema` from its Zod input schema, so the
24391
+ * schema the model sees and the validation the executor runs share one source
24392
+ * and cannot drift (`TOOL_INPUT_SCHEMAS` in `../tool-input-schemas.ts` holds
24393
+ * the executor-side half).
24394
+ *
24395
+ * Conversion uses Zod 4's native `z.toJSONSchema` (mirroring
24396
+ * `workflows/leaf-runner.ts`), then adjusts the output for the tool-definition
24397
+ * context:
24398
+ *
24399
+ * - The `$schema` marker is dropped — tool definitions don't carry one.
24400
+ * - `additionalProperties` values of `false` / `{}` are dropped. They are
24401
+ * authoring artifacts of `z.object` / `z.looseObject`, not intentional
24402
+ * contract: runtime validation never rejects unknown keys (registry schemas
24403
+ * must tolerate injected fields like `activity`, see
24404
+ * `schema-transforms.ts`), so advertising `additionalProperties: false`
24405
+ * would claim a strictness the runtime doesn't enforce.
24406
+ *
24407
+ * `advertiseRequired` names fields to mark required in the advertised schema
24408
+ * even though the Zod schema treats them as optional. This is the one
24409
+ * sanctioned divergence, and only in the tolerant direction: the model is told
24410
+ * to always send the field (e.g. `activity`, which drives status UX), but a
24411
+ * call that omits it still executes rather than failing on a field the tool
24412
+ * doesn't need. Naming `activity` there also records the schema as carrying
24413
+ * the daemon's own status field (`declareDaemonActivityField`), so a surface
24414
+ * that renders no activity text can drop it from the advertised copy.
24415
+ */
24416
+ export declare function toToolInputSchema(schema: z.ZodType, opts?: {
24417
+ advertiseRequired?: readonly string[];
24418
+ }): Record<string, unknown>;
24419
+
24372
24420
  /**
24373
24421
  * Trust classification of an inbound actor, ordered most- to least-trusted.
24374
24422
  * The one declaration of the vocabulary: the gateway classifies with it and
package/index.js CHANGED
@@ -35,6 +35,7 @@ export const getRecordedConversationToolSurface = api.getRecordedConversationToo
35
35
  export const getWorkspaceDir = api.getWorkspaceDir;
36
36
  export const hasLexicalTokens = api.hasLexicalTokens;
37
37
  export const indexDocument = api.indexDocument;
38
+ export const invalidToolInputResult = api.invalidToolInputResult;
38
39
  export const isConversationProcessing = api.isConversationProcessing;
39
40
  export const isMaxTokensStopReason = api.isMaxTokensStopReason;
40
41
  export const isToolResultMessage = api.isToolResultMessage;
@@ -44,6 +45,7 @@ export const listCatalogSkills = api.listCatalogSkills;
44
45
  export const listConversations = api.listConversations;
45
46
  export const listInstalledSkills = api.listInstalledSkills;
46
47
  export const mediaBlockAttachmentId = api.mediaBlockAttachmentId;
48
+ export const nullAsOmitted = api.nullAsOmitted;
47
49
  export const openTranscriptionSession = api.openTranscriptionSession;
48
50
  export const parseMessageMetadata = api.parseMessageMetadata;
49
51
  export const parseSurfaceShowResultId = api.parseSurfaceShowResultId;
@@ -67,4 +69,5 @@ export const sweepOrphanedGraphNodePoints = api.sweepOrphanedGraphNodePoints;
67
69
  export const syncMessageToDisk = api.syncMessageToDisk;
68
70
  export const synthesizeText = api.synthesizeText;
69
71
  export const throwIfCancelled = api.throwIfCancelled;
72
+ export const toToolInputSchema = api.toToolInputSchema;
70
73
  export const updateMessageMetadata = api.updateMessageMetadata;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.12.2-dev.202609211820.22f71b0",
3
+ "version": "0.12.2-dev.202609211913.b0ee78c",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",