@cadenya/cadenya 1.0.1 → 1.0.2

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/dist/types.d.ts CHANGED
@@ -595,10 +595,8 @@ export interface AgentVariationSpec_Constraints {
595
595
  * When not set, objectives are still swept at the system-wide 24 hour
596
596
  * maximum — every objective eventually reaches a terminal state.
597
597
  *
598
- * Note: no gnostic integer hint here on purpose. The Envoy gRPC-JSON
599
- * transcoder only accepts the canonical protobuf JSON form for
600
- * Durations — a "<seconds>s" string — so the SDKs must type this as a
601
- * string (like AgentScheduleSpec.every), not an integer.
598
+ * SDKs represent this as a duration string, like AgentScheduleSpec.every,
599
+ * rather than an integer.
602
600
  */
603
601
  inactivityTimeout?: string;
604
602
  }
@@ -614,7 +612,7 @@ export type AgentVariationSpecModelConfigReasoningEffort = 'REASONING_EFFORT_UNS
614
612
  */
615
613
  export interface AgentVariationSpec_ModelConfig {
616
614
  /**
617
- * The model identifier in family/model format (e.g., "claude/opus-4.6", "claude/sonnet-4.5")
615
+ * The model identifier for the agent variation to use. Should be either the reference key (ai-provider.model-name) or the canonical model ID (e.g.: "model_ABC123")
618
616
  */
619
617
  modelId: string;
620
618
  /**
@@ -1190,9 +1188,12 @@ export interface CreateObjectiveRequest {
1190
1188
  subject?: SubjectAssertion;
1191
1189
  /**
1192
1190
  * Parameters forced onto this objective's tool calls. A pinned parameter
1193
- * is an overlay on a tool's JSON schema: the parameter is removed from
1194
- * what the LLM sees, and its value is always overwritten server-side with
1195
- * the pinned value — the model cannot choose a different value for it.
1191
+ * is removed from the tool schema the LLM sees, and its value is always
1192
+ * overwritten server-side with the pinned value — the model cannot choose
1193
+ * a different value for it. By default a pinned key applies to every tool
1194
+ * with a top-level parameter of the same name; a tool set's overlays
1195
+ * (ToolSetSpec.overlays) can bind pinned keys to nested paths, differently
1196
+ * named parameters, or a subset of tools.
1196
1197
  */
1197
1198
  pinnedParameters?: Record<string, string>;
1198
1199
  }
@@ -1423,7 +1424,7 @@ export interface EnableModelRequest {
1423
1424
  }
1424
1425
  export interface GetObjectiveDiagnosticsResponse {
1425
1426
  /**
1426
- * Diagnostics from the objective's most recent iteration.
1427
+ * Context usage from the objective's most recent iteration.
1427
1428
  */
1428
1429
  diagnostics: ObjectiveDiagnostics;
1429
1430
  }
@@ -1915,7 +1916,7 @@ export interface ModelSpec {
1915
1916
  export type ModelSpec_Capability = ModelSpec_Capability_Temperature | ModelSpec_Capability_TopP | ModelSpec_Capability_TopK | ModelSpec_Capability_StopSequences | ModelSpec_Capability_MaxOutputTokens | ModelSpec_Capability_Reasoning | ModelSpec_Capability_Caching;
1916
1917
  export type NoticeLevel = 'LEVEL_UNSPECIFIED' | 'LEVEL_INFO' | 'LEVEL_WARN';
1917
1918
  /**
1918
- * Notice is a non-terminal diagnostic emitted by the runtime when something
1919
+ * Notice is a non-terminal event emitted by the runtime when something
1919
1920
  * noteworthy but non-fatal happens during an objective — for example a
1920
1921
  * just-in-time tool set failing to load, or a previously loaded tool being
1921
1922
  * dropped because it was archived. Notices carry no structured payload; they
@@ -2080,10 +2081,10 @@ export interface ObjectiveContextWindowInfo {
2080
2081
  createdBy?: Profile;
2081
2082
  }
2082
2083
  /**
2083
- * ObjectiveDiagnostics is the context-usage breakdown measured for a single
2084
- * iteration at request-assembly time. It reports how much of the context
2085
- * window each component occupies so tool parameters, memory cascades, and
2086
- * prompts can be tuned against real token usage.
2084
+ * Context-usage breakdown measured for a single iteration at request-assembly
2085
+ * time. It reports how much of the context window each component occupies so
2086
+ * tool parameters, memory cascades, and prompts can be tuned against real
2087
+ * token usage.
2087
2088
  */
2088
2089
  export interface ObjectiveDiagnostics {
2089
2090
  /**
@@ -2363,6 +2364,12 @@ export interface ObjectiveToolCallInfo {
2363
2364
  * short-lived signed URLs rather than inline bytes.
2364
2365
  */
2365
2366
  export interface ObjectiveToolCallResult {
2367
+ /**
2368
+ * The result content as recorded — which is what the model was shown.
2369
+ * When a tool set overlay transformed the result (ToolOverlay
2370
+ * result_actions), this is the transformed content; the adapter's raw
2371
+ * response is kept in the tool call's debug log, not here.
2372
+ */
2366
2373
  content: Array<ObjectiveToolCallResult_ContentBlock>;
2367
2374
  }
2368
2375
  export interface ObjectiveToolCallResult_AudioBlock {
@@ -2535,6 +2542,78 @@ export interface OperationMetadata {
2535
2542
  export interface Page {
2536
2543
  nextCursor: string;
2537
2544
  }
2545
+ /**
2546
+ * Default: ON_MISSING_FAIL.
2547
+ */
2548
+ export type ParameterActionPinOnMissing = 'ON_MISSING_UNSPECIFIED' | 'ON_MISSING_FAIL' | 'ON_MISSING_SKIP';
2549
+ /**
2550
+ * Bind the parameter to one of the objective's pinned parameters. It is
2551
+ * deleted from the schema (including any `required` entry), and on every
2552
+ * call the pinned value is written into the arguments, overwriting
2553
+ * anything the model supplied.
2554
+ * This is the authoritative-value action: the model never sees the
2555
+ * parameter and cannot influence it.
2556
+ *
2557
+ * `pin` differs from `set` with `{{ pinned_parameters.key }}` only in
2558
+ * how a missing key is handled (see `on_missing`) and in intent —
2559
+ * reading the tool set config, `pin` says "this comes from the caller".
2560
+ */
2561
+ export interface ParameterAction_Pin {
2562
+ path: string;
2563
+ /**
2564
+ * Key into the objective's pinned_parameters map. Need not equal the
2565
+ * last segment of `path` — this is how a pinned `orgId` reaches a
2566
+ * tool whose parameter is named `organizationId`.
2567
+ */
2568
+ pinnedParameter: string;
2569
+ /**
2570
+ * Default: ON_MISSING_FAIL.
2571
+ */
2572
+ onMissing: ParameterActionPinOnMissing;
2573
+ }
2574
+ /**
2575
+ * Remove the parameter entirely. It is deleted from the schema
2576
+ * (including any `required` entry) and stripped from the arguments if
2577
+ * the model supplies it anyway. The tool receives no value for it — the
2578
+ * upstream default, if any, applies. Use this to save context on
2579
+ * parameters the model has no business setting (pagination cursors,
2580
+ * expansion flags, debug toggles).
2581
+ */
2582
+ export interface ParameterAction_Remove {
2583
+ path: string;
2584
+ }
2585
+ /**
2586
+ * Force the parameter to a value. It is deleted from the schema
2587
+ * (including any `required` entry), and on every call the rendered
2588
+ * value is written into the arguments, overwriting anything the model
2589
+ * supplied.
2590
+ *
2591
+ * `value_template` is a Liquid template rendered against the objective:
2592
+ *
2593
+ * {{ pinned_parameters.<key> }} the objective's pinned parameters
2594
+ * {{ objective.id }} the objective's id
2595
+ * {{ objective.external_id }} the objective's external id
2596
+ * {{ objective.labels.<key> }} the objective's labels
2597
+ *
2598
+ * Templates render with strict variables: referencing a pinned
2599
+ * parameter or label that does not exist fails the call rather than
2600
+ * rendering an empty value.
2601
+ *
2602
+ * Tool set secrets are intentionally not exposed here: overlay-set
2603
+ * values are recorded as tool call arguments in events and tool call
2604
+ * history, and would leak. Use adapter headers for credentials.
2605
+ *
2606
+ * The rendered string is coerced to the parameter's declared schema
2607
+ * type: for a non-string parameter (integer, number, boolean, object,
2608
+ * array) the output is parsed as JSON. A value that fails to parse
2609
+ * errors the tool call. Prefer `pin` when the value is simply a pinned
2610
+ * parameter — it fails loudly when the key is absent instead of
2611
+ * rendering an empty string.
2612
+ */
2613
+ export interface ParameterAction_Set {
2614
+ path: string;
2615
+ valueTemplate: string;
2616
+ }
2538
2617
  /**
2539
2618
  * Pause agent schedule request.
2540
2619
  */
@@ -2689,6 +2768,65 @@ export interface RestoreToolRequest {
2689
2768
  */
2690
2769
  id?: string;
2691
2770
  }
2771
+ /**
2772
+ * Default: ON_ERROR_RAW_CONTENT.
2773
+ */
2774
+ export type ResultActionTransformOnError = 'ON_ERROR_UNSPECIFIED' | 'ON_ERROR_RAW_CONTENT' | 'ON_ERROR_FAIL';
2775
+ /**
2776
+ * Replace the result's text content with a rendered Liquid template.
2777
+ * Used to compact verbose responses to the fields the model actually
2778
+ * needs, or to rewrite a JSON response into a smaller JSON document.
2779
+ *
2780
+ * `content_template` is rendered against the call:
2781
+ *
2782
+ * {{ result.text }} the result's text content (text blocks
2783
+ * joined with newlines)
2784
+ * {{ result.json }} result.text parsed as JSON — objects and
2785
+ * arrays are navigable (`result.json.items`,
2786
+ * `| map: "id"`); absent when the text is not
2787
+ * valid JSON
2788
+ * {{ result.blocks }} every content block: [{type, text?,
2789
+ * mime_type?, size_bytes?}]
2790
+ * {{ parameters }} the arguments the tool was called with,
2791
+ * after parameter actions were applied
2792
+ * {{ tool.name }} the tool's metadata.name
2793
+ * {{ tool.llm_tool_name }} the name the model called it by
2794
+ * {{ pinned_parameters }} the objective's pinned parameters
2795
+ * {{ objective.id }} / {{ objective.external_id }} /
2796
+ * {{ objective.labels.<key> }}
2797
+ *
2798
+ * Templates render with strict variables: referencing `result.json` on
2799
+ * a non-JSON result, or any other undefined variable, is a render error
2800
+ * and `on_error` decides the outcome. The `json` filter pretty-prints a
2801
+ * value as JSON; `sanitized_json` emits it compact and escaped for
2802
+ * embedding.
2803
+ *
2804
+ * Transforms are text-only. `result.text` and `result.json` are built
2805
+ * from the result's text blocks; media blocks (images, audio) are opaque
2806
+ * to the template and pass through unchanged. The rendered text replaces
2807
+ * the text blocks as a single text block. A result with no text blocks
2808
+ * at all (an image-only or audio-only result) is out of scope: the
2809
+ * transform is skipped, the result is recorded as returned, and the
2810
+ * skip is noted in the tool call's debug log — this is not an `on_error`
2811
+ * case, nothing was attempted. The one exception is `expect_json`, where
2812
+ * a result with no text is a violated precondition and `on_error`
2813
+ * applies.
2814
+ */
2815
+ export interface ResultAction_Transform {
2816
+ contentTemplate: string;
2817
+ /**
2818
+ * Default: ON_ERROR_RAW_CONTENT.
2819
+ */
2820
+ onError: ResultActionTransformOnError;
2821
+ /**
2822
+ * Require the tool result to have text content that parses as JSON
2823
+ * before rendering. A non-JSON (or text-less) result is then an error
2824
+ * subject to `on_error` even if the template never reads
2825
+ * `result.json`. Off by default: `result.json` is simply absent for
2826
+ * non-JSON results, and text-less results skip the transform.
2827
+ */
2828
+ expectJson: boolean;
2829
+ }
2692
2830
  /**
2693
2831
  * Resume agent schedule request.
2694
2832
  */
@@ -2785,6 +2923,21 @@ export interface SearchToolsOrToolSetsResponse {
2785
2923
  toolSets: Array<ToolSet>;
2786
2924
  agents: Array<Agent>;
2787
2925
  }
2926
+ /**
2927
+ * A single selector condition.
2928
+ */
2929
+ export type Selector_Condition = Selector_Condition_Attribute | Selector_Condition_HasParameter | Selector_Condition_Tools;
2930
+ /**
2931
+ * An explicit list of tools, matched on spec.llm_tool_name — the name
2932
+ * the model calls the tool by. It identifies a tool across versions:
2933
+ * just-in-time MCP sets keep one tool per signature and every version
2934
+ * shares the LLM name, so the condition keeps matching as the source
2935
+ * evolves. Any name in the list matches (OR). Names of tools not (or
2936
+ * not yet) present in the set are allowed and match nothing.
2937
+ */
2938
+ export interface Selector_ToolNames {
2939
+ names?: Array<string>;
2940
+ }
2788
2941
  /**
2789
2942
  * SetToolCallContentRequest lets an external API consumer supply the result
2790
2943
  * of a bare tool call (one whose tool set has no execution adapter). Used
@@ -3120,6 +3273,12 @@ export interface ToolCalled {
3120
3273
  * The arguments passed to the tool.
3121
3274
  */
3122
3275
  arguments?: Record<string, unknown>;
3276
+ /**
3277
+ * Whether the runtime authorized this call's arguments to be exposed in
3278
+ * public widget events. This records the resolved policy at call time so
3279
+ * consumers do not need to re-evaluate the tool set's current overlays.
3280
+ */
3281
+ argumentsExposedInWidgets?: boolean;
3123
3282
  }
3124
3283
  export interface ToolDenied {
3125
3284
  /**
@@ -3145,9 +3304,194 @@ export interface ToolInfo {
3145
3304
  * Content signature identifying the tool within its tool set: a hash of the
3146
3305
  * sanitized llm_tool_name, description, and canonical parameters. Two tools
3147
3306
  * with the same llm_tool_name but different parameters or description (as
3148
- * MCP servers may return per user) have distinct signatures.
3307
+ * MCP servers may return per user) have distinct signatures. Computed over
3308
+ * the raw spec — overlays do not change a tool's signature.
3149
3309
  */
3150
3310
  signature: string;
3311
+ /**
3312
+ * Keys of the tool set's overlays whose selectors match this tool
3313
+ * (ToolSetSpec.overlays), in evaluation order. Disabled overlays are
3314
+ * excluded. An overlay is listed when its selector matches even if none
3315
+ * of its actions changed this tool's schema (all its paths were absent),
3316
+ * so this answers "which policies apply to this tool" — diff
3317
+ * effective_parameters against spec.parameters for "what changed".
3318
+ * Empty when no overlay applies.
3319
+ */
3320
+ overlays?: Array<string>;
3321
+ /**
3322
+ * The parameter schema as presented to the model: spec.parameters after
3323
+ * every matching overlay's parameter actions have been applied, in order,
3324
+ * including maintenance of the schema's `required` list. Actions whose
3325
+ * outcome depends on the objective (pin with ON_MISSING_SKIP) are applied
3326
+ * as if the pinned key were present, so this reflects the intended steady
3327
+ * state rather than any one objective. Equals spec.parameters when no
3328
+ * overlay applies. Result actions have no effect here.
3329
+ */
3330
+ effectiveParameters?: Record<string, unknown>;
3331
+ }
3332
+ /**
3333
+ * A tool overlay is a policy attached to a tool set that reshapes the tools
3334
+ * the model sees and calls. It pairs a selector (which tools it applies to)
3335
+ * with actions that run before a call — rewriting the tool's parameter
3336
+ * schema and the arguments the model supplied — and after a call —
3337
+ * rewriting the result before it enters the model's context. It can also
3338
+ * explicitly allow the final call arguments to cross the otherwise-private
3339
+ * widget API boundary.
3340
+ *
3341
+ * Overlays exist for three reasons:
3342
+ *
3343
+ * - Authority. Adapter-derived tool sets (OpenAPI especially) expose many
3344
+ * parameters the model must never guess — a workspace id, a tenant id,
3345
+ * an account scope. Overlays bind those parameters to the objective's
3346
+ * `pinned_parameters` (see CreateObjectiveRequest.pinned_parameters):
3347
+ * the parameter disappears from the schema and the value is forced
3348
+ * server-side, so the model has no opportunity to supply a different
3349
+ * one.
3350
+ * - Context. Large specs carry pagination cursors, expansion flags and
3351
+ * verbose responses that cost tokens without helping the model.
3352
+ * Overlays strip parameters, fix them to literals, and compact results.
3353
+ * - Widget presentation. Tool arguments are private by default. An overlay
3354
+ * can opt matching tools into exposing their final call arguments in
3355
+ * visitor-facing widget events so an embedding UI can select a custom
3356
+ * renderer or presentation.
3357
+ *
3358
+ * Pinned parameters and overlays are complementary: pinned parameters are
3359
+ * *data* supplied per objective (or per widget session) by the caller;
3360
+ * overlays are *policy* authored once on the tool set. Pinning by name
3361
+ * still works without an overlay — a pinned key that matches a top-level
3362
+ * parameter name is applied to every tool in the objective — overlays are
3363
+ * for the cases that needs more: nested paths, renamed keys, a subset of
3364
+ * tools, or values that are literals rather than caller-supplied.
3365
+ *
3366
+ * Evaluation model:
3367
+ *
3368
+ * - Overlays are evaluated in list order; within an overlay, actions are
3369
+ * evaluated in list order. Later actions win on the same path (a `set`
3370
+ * followed by a `remove` leaves the parameter removed).
3371
+ * - The parameter schema the model sees is computed when tools are
3372
+ * assembled for an objective, so pre-call actions can consult that
3373
+ * objective's pinned parameters (this is what makes `pin` with
3374
+ * ON_MISSING_SKIP meaningful). Argument rewriting runs on every call.
3375
+ * - An action whose `path` does not exist in the tool's parameter schema
3376
+ * changes nothing in the schema the model sees. This is deliberate: a
3377
+ * broad selector (every `list_*` tool) may match tools with different
3378
+ * shapes, and one overlay should be able to cover all of them without
3379
+ * erroring on the ones that lack a given parameter. At call time the
3380
+ * model's arguments can still not widen what it controls: `remove`
3381
+ * strips the path whether or not it is declared, and `set`/`pin`
3382
+ * overwrite a value the model sent at an undeclared path (a schema this
3383
+ * evaluator cannot see through, e.g. behind $ref/allOf) while injecting
3384
+ * nothing into tools that lack the parameter.
3385
+ * - Overlays apply to just-in-time tool sets as well; the tools are
3386
+ * evaluated against overlays at the moment they are loaded.
3387
+ * - Result actions run once, when the tool call's result is recorded; the
3388
+ * stored result is the transformed one, so every reader (the model,
3389
+ * compaction, the API) sees the same content. They are not supported on
3390
+ * bare tool sets.
3391
+ */
3392
+ export interface ToolOverlay {
3393
+ /**
3394
+ * Identifies the overlay within its tool set. Unique across the tool
3395
+ * set's overlays (enforced by the server), stable across reorders, and
3396
+ * surfaced in tool call messages ("parameter removed by overlay
3397
+ * strip-list-knobs") so an operator can trace a rewritten call back to
3398
+ * the policy that rewrote it. Referenced by ToolInfo.overlays and the
3399
+ * ListToolsRequest.overlays filter.
3400
+ */
3401
+ key: string;
3402
+ /**
3403
+ * Which tools this overlay applies to. Required; an empty selector
3404
+ * (no conditions) matches every tool in the set.
3405
+ */
3406
+ selector: ToolOverlay_Selector;
3407
+ /**
3408
+ * Pre-call actions, applied in order. See ParameterAction.
3409
+ */
3410
+ parameterActions?: Array<ToolOverlay_ParameterAction>;
3411
+ /**
3412
+ * Post-call actions, applied in order. See ResultAction.
3413
+ */
3414
+ resultActions?: Array<ToolOverlay_ResultAction>;
3415
+ /**
3416
+ * When true the overlay is retained in the spec but not evaluated. Lets an
3417
+ * operator switch a policy off to diagnose a misbehaving tool without
3418
+ * deleting it and losing the configuration.
3419
+ */
3420
+ disabled: boolean;
3421
+ /**
3422
+ * Arguments may carry sensitive customer data, including values injected by
3423
+ * parameter actions, so they stay private unless an overlay enables them.
3424
+ *
3425
+ * Unset means this overlay has no opinion. When several enabled overlays
3426
+ * match a tool, they are evaluated in list order and the last overlay that
3427
+ * supplies this policy wins. If none supplies it, arguments stay private.
3428
+ * Disabled overlays never participate.
3429
+ */
3430
+ widgetArgumentExposure?: ToolOverlay_WidgetArgumentExposure;
3431
+ }
3432
+ /**
3433
+ * A pre-call action. Parameter actions rewrite the tool's parameter
3434
+ * schema as presented to the model and the arguments the model supplies
3435
+ * when it calls the tool. Both sides are always kept in agreement: a
3436
+ * parameter that is hidden from the schema is also stripped from (or
3437
+ * forced in) the arguments, so the model can neither see nor smuggle it.
3438
+ */
3439
+ export type ToolOverlay_ParameterAction = ToolOverlay_ParameterAction_Remove | ToolOverlay_ParameterAction_Set | ToolOverlay_ParameterAction_Pin;
3440
+ /**
3441
+ * A dotted path into a tool's parameter schema. Each segment is a property
3442
+ * name; the path `filter.workspaceId` addresses
3443
+ * `properties.filter.properties.workspaceId` in the schema and
3444
+ * `arguments.filter.workspaceId` in the call. Only object properties are
3445
+ * addressable — there is no array indexing, wildcarding or filtering.
3446
+ *
3447
+ * This is deliberately not JSONPath: every action needs a single,
3448
+ * unambiguous location in both the schema and the arguments so that
3449
+ * removing a parameter from the schema and stripping it from the call are
3450
+ * guaranteed to agree.
3451
+ */
3452
+ export interface ToolOverlay_ParameterPath {
3453
+ path: string;
3454
+ }
3455
+ /**
3456
+ * A post-call action. Result actions rewrite a tool call's result after
3457
+ * the adapter returns and before it is recorded: the transformed content
3458
+ * is what is stored and what the model reads (ObjectiveToolCallResult
3459
+ * content). The adapter's raw response is kept in the tool call's debug
3460
+ * log for operators; it is not otherwise retained.
3461
+ *
3462
+ * Result actions apply to MCP, OpenAPI and HTTP tool sets. They are not
3463
+ * supported on bare tool sets — a bare tool's content is supplied by an
3464
+ * external consumer, so there is nothing for the platform to reshape —
3465
+ * and a tool set whose adapter is `bare` rejects overlays that carry
3466
+ * result actions.
3467
+ *
3468
+ * When several matching overlays carry transforms they run in overlay
3469
+ * order, each one reading the previous one's output.
3470
+ */
3471
+ export type ToolOverlay_ResultAction = ToolOverlay_ResultAction_Transform;
3472
+ /**
3473
+ * Default: OPERATOR_AND.
3474
+ */
3475
+ export type ToolOverlaySelectorOperator = 'OPERATOR_UNSPECIFIED' | 'OPERATOR_AND' | 'OPERATOR_OR';
3476
+ /**
3477
+ * Which tools in the tool set an overlay applies to. Conditions are
3478
+ * combined with `operator`; an overlay with no conditions matches every
3479
+ * tool in the set.
3480
+ */
3481
+ export interface ToolOverlay_Selector {
3482
+ conditions?: Array<Selector_Condition>;
3483
+ /**
3484
+ * Default: OPERATOR_AND.
3485
+ */
3486
+ operator: ToolOverlaySelectorOperator;
3487
+ }
3488
+ /**
3489
+ * Controls whether matching tool calls may expose their final arguments to
3490
+ * visitor-facing widget events. The containing message's presence means the
3491
+ * overlay has an opinion; enabled selects whether that opinion is on or off.
3492
+ */
3493
+ export interface ToolOverlay_WidgetArgumentExposure {
3494
+ enabled: boolean;
3151
3495
  }
3152
3496
  export interface ToolResult {
3153
3497
  toolCallId: string;
@@ -3181,7 +3525,7 @@ export type ToolSetAdapter = ToolSetAdapter_McpVariant | ToolSetAdapter_HttpVari
3181
3525
  * Approval filters that will automatically set the approval requirement on tools synced from an external source
3182
3526
  */
3183
3527
  export type ToolSetAdapter_ApprovalRequirementFilter = ToolSetAdapter_ApprovalRequirementFilter_Always | ToolSetAdapter_ApprovalRequirementFilter_Only;
3184
- export type ToolSetAdapterAttributeFilterAttribute = 'ATTRIBUTE_UNSPECIFIED' | 'ATTRIBUTE_NAME' | 'ATTRIBUTE_TITLE' | 'ATTRIBUTE_DESCRIPTION';
3528
+ export type ToolSetAdapterAttributeFilterAttribute = 'ATTRIBUTE_UNSPECIFIED' | 'ATTRIBUTE_NAME' | 'ATTRIBUTE_TITLE' | 'ATTRIBUTE_DESCRIPTION' | 'ATTRIBUTE_LLM_TOOL_NAME';
3185
3529
  /**
3186
3530
  * Single attribute filter
3187
3531
  */
@@ -3205,6 +3549,27 @@ export interface ToolSetAdapter_Bare {
3205
3549
  contentTimeout?: number;
3206
3550
  }
3207
3551
  export interface ToolSetAdapter_HTTP {
3552
+ /**
3553
+ * Base URL for dispatching tool calls.
3554
+ *
3555
+ * May be templated. Two reference forms are supported, and they resolve
3556
+ * in a single pass each so neither can inject into the other:
3557
+ *
3558
+ * ${SECRET_NAME} a workspace or tool set secret
3559
+ * {{ pinned_parameters.<key> }} the objective's pinned parameters
3560
+ * (see CreateObjectiveRequest.pinned_parameters)
3561
+ *
3562
+ * Pinned parameters are what make a per-tenant host possible: one tool
3563
+ * set can serve every customer of a product that assigns each of them
3564
+ * their own subdomain, e.g.
3565
+ *
3566
+ * https://{{ pinned_parameters.tenant }}.example.com
3567
+ *
3568
+ * Because the value may be a template rather than a literal URL, this
3569
+ * field is not constrained to a URI shape. It is validated as an
3570
+ * absolute http(s) URL after references are resolved, both on write
3571
+ * (with references stubbed) and again before each tool call.
3572
+ */
3208
3573
  baseUrl?: string;
3209
3574
  headers?: Record<string, string>;
3210
3575
  }
@@ -3305,6 +3670,15 @@ export interface ToolSetSecretSpec {
3305
3670
  export interface ToolSetSpec {
3306
3671
  description?: string;
3307
3672
  adapter: ToolSetAdapter;
3673
+ /**
3674
+ * Overlays applied to this tool set's tools, evaluated in order. See
3675
+ * ToolOverlay. Overlay keys must be unique within the list.
3676
+ *
3677
+ * As a repeated field this is replaced wholesale on update: an
3678
+ * update_mask of `spec.overlays` swaps the entire list for the one in the
3679
+ * request. Read-modify-write to add or remove a single overlay.
3680
+ */
3681
+ overlays?: Array<ToolOverlay>;
3308
3682
  }
3309
3683
  /**
3310
3684
  * ToolSetUsage describes one agent variation that uses the tool set (or, when
@@ -3339,8 +3713,9 @@ export interface ToolSpec {
3339
3713
  */
3340
3714
  parameters: Record<string, unknown>;
3341
3715
  /**
3342
- * Configuration for this specific tool. Transport/Protocol are derived from the tool set adapter, while specifics
3343
- * such as endpoint, method, etc, are stored on the tool itself.
3716
+ * Configuration for this specific tool. Its transport is derived from the
3717
+ * tool set adapter, while details such as endpoint and method are stored on
3718
+ * the tool itself.
3344
3719
  *
3345
3720
  * Required, and exactly one adapter must be set.
3346
3721
  */
@@ -3999,13 +4374,13 @@ export interface WidgetSessionSpec {
3999
4374
  tokenExpiresAt?: string;
4000
4375
  /**
4001
4376
  * Parameters forced onto tool calls made by this session's conversations.
4002
- * A pinned parameter is an overlay on a tool's JSON schema: the parameter
4003
- * is removed from what the LLM sees, and its value is always overwritten
4004
- * server-side with the pinned value — so the model cannot be tricked into
4005
- * calling a tool with a different id than the one the session was minted
4006
- * for (e.g. pin "workspaceId" for an OpenAPI tool with a
4007
- * /workspaces/{workspaceId} path). Flows to every objective the session
4008
- * creates.
4377
+ * A pinned parameter is removed from the tool schema the LLM sees, and its
4378
+ * value is always overwritten server-side with the pinned value — so the
4379
+ * model cannot be tricked into calling a tool with a different id than the
4380
+ * one the session was minted for (e.g. pin "workspaceId" for an OpenAPI
4381
+ * tool with a /workspaces/{workspaceId} path). Flows to every objective
4382
+ * the session creates. See ToolSetSpec.overlays for binding pinned keys to
4383
+ * nested or differently named parameters.
4009
4384
  */
4010
4385
  pinnedParameters?: Record<string, string>;
4011
4386
  }
@@ -4239,6 +4614,17 @@ export interface ToolSetAdapter_OpenAPI_Url {
4239
4614
  /**
4240
4615
  * Base URL for dispatching tool calls. If set, overrides the server
4241
4616
  * resolved from the spec's servers array.
4617
+ *
4618
+ * May be templated with the same two reference forms the HTTP adapter's
4619
+ * base_url accepts:
4620
+ *
4621
+ * ${SECRET_NAME} a workspace or tool set secret
4622
+ * {{ pinned_parameters.<key> }} the objective's pinned parameters
4623
+ *
4624
+ * A spec written against a single host can therefore be dispatched to a
4625
+ * per-tenant one, e.g. https://{{ pinned_parameters.tenant }}.example.com,
4626
+ * without cloning the tool set per customer. Validated as an absolute
4627
+ * http(s) URL after references are resolved rather than as a literal URI.
4242
4628
  */
4243
4629
  baseUrl?: string;
4244
4630
  /**
@@ -4265,6 +4651,17 @@ export interface ToolSetAdapter_OpenAPI_UploadId {
4265
4651
  /**
4266
4652
  * Base URL for dispatching tool calls. If set, overrides the server
4267
4653
  * resolved from the spec's servers array.
4654
+ *
4655
+ * May be templated with the same two reference forms the HTTP adapter's
4656
+ * base_url accepts:
4657
+ *
4658
+ * ${SECRET_NAME} a workspace or tool set secret
4659
+ * {{ pinned_parameters.<key> }} the objective's pinned parameters
4660
+ *
4661
+ * A spec written against a single host can therefore be dispatched to a
4662
+ * per-tenant one, e.g. https://{{ pinned_parameters.tenant }}.example.com,
4663
+ * without cloning the tool set per customer. Validated as an absolute
4664
+ * http(s) URL after references are resolved rather than as a literal URI.
4268
4665
  */
4269
4666
  baseUrl?: string;
4270
4667
  /**
@@ -4275,6 +4672,48 @@ export interface ToolSetAdapter_OpenAPI_UploadId {
4275
4672
  */
4276
4673
  serverName?: string;
4277
4674
  }
4675
+ export interface Selector_Condition_Attribute {
4676
+ type: 'attribute';
4677
+ /**
4678
+ * Match on a tool attribute (name, title, description,
4679
+ * llm_tool_name) with a string matcher — the same filter used by
4680
+ * the adapter's include/exclude lists.
4681
+ */
4682
+ attribute: ToolSetAdapter_AttributeFilter;
4683
+ }
4684
+ export interface Selector_Condition_HasParameter {
4685
+ type: 'hasParameter';
4686
+ /**
4687
+ * Match tools whose parameter schema contains the given path. This
4688
+ * is the usual way to target "every tool that takes a workspaceId"
4689
+ * without enumerating tools by name.
4690
+ */
4691
+ hasParameter: ToolOverlay_ParameterPath;
4692
+ }
4693
+ export interface Selector_Condition_Tools {
4694
+ type: 'tools';
4695
+ /**
4696
+ * Match specific tools by LLM tool name. The direct way to assign an
4697
+ * overlay to one tool (or a handful) without writing a matcher.
4698
+ */
4699
+ tools: Selector_ToolNames;
4700
+ }
4701
+ export interface ToolOverlay_ParameterAction_Remove {
4702
+ type: 'remove';
4703
+ remove: ParameterAction_Remove;
4704
+ }
4705
+ export interface ToolOverlay_ParameterAction_Set {
4706
+ type: 'set';
4707
+ set: ParameterAction_Set;
4708
+ }
4709
+ export interface ToolOverlay_ParameterAction_Pin {
4710
+ type: 'pin';
4711
+ pin: ParameterAction_Pin;
4712
+ }
4713
+ export interface ToolOverlay_ResultAction_Transform {
4714
+ type: 'transform';
4715
+ transform: ResultAction_Transform;
4716
+ }
4278
4717
  export interface ToolSpec_Config_Http {
4279
4718
  type: 'http';
4280
4719
  http: Config_HTTP;
@@ -4598,13 +5037,13 @@ export interface WidgetSessionSpecParam {
4598
5037
  expiresAt?: string;
4599
5038
  /**
4600
5039
  * Parameters forced onto tool calls made by this session's conversations.
4601
- * A pinned parameter is an overlay on a tool's JSON schema: the parameter
4602
- * is removed from what the LLM sees, and its value is always overwritten
4603
- * server-side with the pinned value — so the model cannot be tricked into
4604
- * calling a tool with a different id than the one the session was minted
4605
- * for (e.g. pin "workspaceId" for an OpenAPI tool with a
4606
- * /workspaces/{workspaceId} path). Flows to every objective the session
4607
- * creates.
5040
+ * A pinned parameter is removed from the tool schema the LLM sees, and its
5041
+ * value is always overwritten server-side with the pinned value — so the
5042
+ * model cannot be tricked into calling a tool with a different id than the
5043
+ * one the session was minted for (e.g. pin "workspaceId" for an OpenAPI
5044
+ * tool with a /workspaces/{workspaceId} path). Flows to every objective
5045
+ * the session creates. See ToolSetSpec.overlays for binding pinned keys to
5046
+ * nested or differently named parameters.
4608
5047
  */
4609
5048
  pinnedParameters?: Record<string, string>;
4610
5049
  }