@cadenya/cadenya 1.0.0 → 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/api.md +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/resources/objectives.d.ts +7 -4
- package/dist/resources/objectives.d.ts.map +1 -1
- package/dist/resources/objectives.js +1 -1
- package/dist/resources/objectives.js.map +1 -1
- package/dist/resources/tool-search.d.ts +1 -3
- package/dist/resources/tool-search.d.ts.map +1 -1
- package/dist/resources/tool-search.js.map +1 -1
- package/dist/resources/tools.d.ts +8 -0
- package/dist/resources/tools.d.ts.map +1 -1
- package/dist/resources/tools.js +1 -1
- package/dist/resources/tools.js.map +1 -1
- package/dist/types.d.ts +471 -32
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +14 -5
- package/src/client.ts +1 -1
- package/src/resources/objectives.ts +7 -4
- package/src/resources/tool-search.ts +1 -3
- package/src/resources/tools.ts +9 -1
- package/src/types.ts +500 -32
package/src/types.ts
CHANGED
|
@@ -637,10 +637,8 @@ export interface AgentVariationSpec_Constraints {
|
|
|
637
637
|
* When not set, objectives are still swept at the system-wide 24 hour
|
|
638
638
|
* maximum — every objective eventually reaches a terminal state.
|
|
639
639
|
*
|
|
640
|
-
*
|
|
641
|
-
*
|
|
642
|
-
* Durations — a "<seconds>s" string — so the SDKs must type this as a
|
|
643
|
-
* string (like AgentScheduleSpec.every), not an integer.
|
|
640
|
+
* SDKs represent this as a duration string, like AgentScheduleSpec.every,
|
|
641
|
+
* rather than an integer.
|
|
644
642
|
*/
|
|
645
643
|
inactivityTimeout?: string;
|
|
646
644
|
}
|
|
@@ -658,7 +656,7 @@ export type AgentVariationSpecModelConfigReasoningEffort = 'REASONING_EFFORT_UNS
|
|
|
658
656
|
*/
|
|
659
657
|
export interface AgentVariationSpec_ModelConfig {
|
|
660
658
|
/**
|
|
661
|
-
* The model identifier
|
|
659
|
+
* 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")
|
|
662
660
|
*/
|
|
663
661
|
modelId: string;
|
|
664
662
|
/**
|
|
@@ -1278,9 +1276,12 @@ export interface CreateObjectiveRequest {
|
|
|
1278
1276
|
subject?: SubjectAssertion;
|
|
1279
1277
|
/**
|
|
1280
1278
|
* Parameters forced onto this objective's tool calls. A pinned parameter
|
|
1281
|
-
* is
|
|
1282
|
-
*
|
|
1283
|
-
*
|
|
1279
|
+
* is removed from the tool schema the LLM sees, and its value is always
|
|
1280
|
+
* overwritten server-side with the pinned value — the model cannot choose
|
|
1281
|
+
* a different value for it. By default a pinned key applies to every tool
|
|
1282
|
+
* with a top-level parameter of the same name; a tool set's overlays
|
|
1283
|
+
* (ToolSetSpec.overlays) can bind pinned keys to nested paths, differently
|
|
1284
|
+
* named parameters, or a subset of tools.
|
|
1284
1285
|
*/
|
|
1285
1286
|
pinnedParameters?: Record<string, string>;
|
|
1286
1287
|
}
|
|
@@ -1532,7 +1533,7 @@ export interface EnableModelRequest {
|
|
|
1532
1533
|
|
|
1533
1534
|
export interface GetObjectiveDiagnosticsResponse {
|
|
1534
1535
|
/**
|
|
1535
|
-
*
|
|
1536
|
+
* Context usage from the objective's most recent iteration.
|
|
1536
1537
|
*/
|
|
1537
1538
|
diagnostics: ObjectiveDiagnostics;
|
|
1538
1539
|
}
|
|
@@ -2086,7 +2087,7 @@ export type ModelSpec_Capability =
|
|
|
2086
2087
|
export type NoticeLevel = 'LEVEL_UNSPECIFIED' | 'LEVEL_INFO' | 'LEVEL_WARN';
|
|
2087
2088
|
|
|
2088
2089
|
/**
|
|
2089
|
-
* Notice is a non-terminal
|
|
2090
|
+
* Notice is a non-terminal event emitted by the runtime when something
|
|
2090
2091
|
* noteworthy but non-fatal happens during an objective — for example a
|
|
2091
2092
|
* just-in-time tool set failing to load, or a previously loaded tool being
|
|
2092
2093
|
* dropped because it was archived. Notices carry no structured payload; they
|
|
@@ -2259,10 +2260,10 @@ export interface ObjectiveContextWindowInfo {
|
|
|
2259
2260
|
}
|
|
2260
2261
|
|
|
2261
2262
|
/**
|
|
2262
|
-
*
|
|
2263
|
-
*
|
|
2264
|
-
*
|
|
2265
|
-
*
|
|
2263
|
+
* Context-usage breakdown measured for a single iteration at request-assembly
|
|
2264
|
+
* time. It reports how much of the context window each component occupies so
|
|
2265
|
+
* tool parameters, memory cascades, and prompts can be tuned against real
|
|
2266
|
+
* token usage.
|
|
2266
2267
|
*/
|
|
2267
2268
|
export interface ObjectiveDiagnostics {
|
|
2268
2269
|
/**
|
|
@@ -2580,6 +2581,12 @@ export interface ObjectiveToolCallInfo {
|
|
|
2580
2581
|
* short-lived signed URLs rather than inline bytes.
|
|
2581
2582
|
*/
|
|
2582
2583
|
export interface ObjectiveToolCallResult {
|
|
2584
|
+
/**
|
|
2585
|
+
* The result content as recorded — which is what the model was shown.
|
|
2586
|
+
* When a tool set overlay transformed the result (ToolOverlay
|
|
2587
|
+
* result_actions), this is the transformed content; the adapter's raw
|
|
2588
|
+
* response is kept in the tool call's debug log, not here.
|
|
2589
|
+
*/
|
|
2583
2590
|
content: Array<ObjectiveToolCallResult_ContentBlock>;
|
|
2584
2591
|
}
|
|
2585
2592
|
|
|
@@ -2770,6 +2777,82 @@ export interface Page {
|
|
|
2770
2777
|
nextCursor: string;
|
|
2771
2778
|
}
|
|
2772
2779
|
|
|
2780
|
+
/**
|
|
2781
|
+
* Default: ON_MISSING_FAIL.
|
|
2782
|
+
*/
|
|
2783
|
+
export type ParameterActionPinOnMissing = 'ON_MISSING_UNSPECIFIED' | 'ON_MISSING_FAIL' | 'ON_MISSING_SKIP';
|
|
2784
|
+
|
|
2785
|
+
/**
|
|
2786
|
+
* Bind the parameter to one of the objective's pinned parameters. It is
|
|
2787
|
+
* deleted from the schema (including any `required` entry), and on every
|
|
2788
|
+
* call the pinned value is written into the arguments, overwriting
|
|
2789
|
+
* anything the model supplied.
|
|
2790
|
+
* This is the authoritative-value action: the model never sees the
|
|
2791
|
+
* parameter and cannot influence it.
|
|
2792
|
+
*
|
|
2793
|
+
* `pin` differs from `set` with `{{ pinned_parameters.key }}` only in
|
|
2794
|
+
* how a missing key is handled (see `on_missing`) and in intent —
|
|
2795
|
+
* reading the tool set config, `pin` says "this comes from the caller".
|
|
2796
|
+
*/
|
|
2797
|
+
export interface ParameterAction_Pin {
|
|
2798
|
+
path: string;
|
|
2799
|
+
/**
|
|
2800
|
+
* Key into the objective's pinned_parameters map. Need not equal the
|
|
2801
|
+
* last segment of `path` — this is how a pinned `orgId` reaches a
|
|
2802
|
+
* tool whose parameter is named `organizationId`.
|
|
2803
|
+
*/
|
|
2804
|
+
pinnedParameter: string;
|
|
2805
|
+
/**
|
|
2806
|
+
* Default: ON_MISSING_FAIL.
|
|
2807
|
+
*/
|
|
2808
|
+
onMissing: ParameterActionPinOnMissing;
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
/**
|
|
2812
|
+
* Remove the parameter entirely. It is deleted from the schema
|
|
2813
|
+
* (including any `required` entry) and stripped from the arguments if
|
|
2814
|
+
* the model supplies it anyway. The tool receives no value for it — the
|
|
2815
|
+
* upstream default, if any, applies. Use this to save context on
|
|
2816
|
+
* parameters the model has no business setting (pagination cursors,
|
|
2817
|
+
* expansion flags, debug toggles).
|
|
2818
|
+
*/
|
|
2819
|
+
export interface ParameterAction_Remove {
|
|
2820
|
+
path: string;
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2823
|
+
/**
|
|
2824
|
+
* Force the parameter to a value. It is deleted from the schema
|
|
2825
|
+
* (including any `required` entry), and on every call the rendered
|
|
2826
|
+
* value is written into the arguments, overwriting anything the model
|
|
2827
|
+
* supplied.
|
|
2828
|
+
*
|
|
2829
|
+
* `value_template` is a Liquid template rendered against the objective:
|
|
2830
|
+
*
|
|
2831
|
+
* {{ pinned_parameters.<key> }} the objective's pinned parameters
|
|
2832
|
+
* {{ objective.id }} the objective's id
|
|
2833
|
+
* {{ objective.external_id }} the objective's external id
|
|
2834
|
+
* {{ objective.labels.<key> }} the objective's labels
|
|
2835
|
+
*
|
|
2836
|
+
* Templates render with strict variables: referencing a pinned
|
|
2837
|
+
* parameter or label that does not exist fails the call rather than
|
|
2838
|
+
* rendering an empty value.
|
|
2839
|
+
*
|
|
2840
|
+
* Tool set secrets are intentionally not exposed here: overlay-set
|
|
2841
|
+
* values are recorded as tool call arguments in events and tool call
|
|
2842
|
+
* history, and would leak. Use adapter headers for credentials.
|
|
2843
|
+
*
|
|
2844
|
+
* The rendered string is coerced to the parameter's declared schema
|
|
2845
|
+
* type: for a non-string parameter (integer, number, boolean, object,
|
|
2846
|
+
* array) the output is parsed as JSON. A value that fails to parse
|
|
2847
|
+
* errors the tool call. Prefer `pin` when the value is simply a pinned
|
|
2848
|
+
* parameter — it fails loudly when the key is absent instead of
|
|
2849
|
+
* rendering an empty string.
|
|
2850
|
+
*/
|
|
2851
|
+
export interface ParameterAction_Set {
|
|
2852
|
+
path: string;
|
|
2853
|
+
valueTemplate: string;
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2773
2856
|
/**
|
|
2774
2857
|
* Pause agent schedule request.
|
|
2775
2858
|
*/
|
|
@@ -2934,6 +3017,67 @@ export interface RestoreToolRequest {
|
|
|
2934
3017
|
id?: string;
|
|
2935
3018
|
}
|
|
2936
3019
|
|
|
3020
|
+
/**
|
|
3021
|
+
* Default: ON_ERROR_RAW_CONTENT.
|
|
3022
|
+
*/
|
|
3023
|
+
export type ResultActionTransformOnError = 'ON_ERROR_UNSPECIFIED' | 'ON_ERROR_RAW_CONTENT' | 'ON_ERROR_FAIL';
|
|
3024
|
+
|
|
3025
|
+
/**
|
|
3026
|
+
* Replace the result's text content with a rendered Liquid template.
|
|
3027
|
+
* Used to compact verbose responses to the fields the model actually
|
|
3028
|
+
* needs, or to rewrite a JSON response into a smaller JSON document.
|
|
3029
|
+
*
|
|
3030
|
+
* `content_template` is rendered against the call:
|
|
3031
|
+
*
|
|
3032
|
+
* {{ result.text }} the result's text content (text blocks
|
|
3033
|
+
* joined with newlines)
|
|
3034
|
+
* {{ result.json }} result.text parsed as JSON — objects and
|
|
3035
|
+
* arrays are navigable (`result.json.items`,
|
|
3036
|
+
* `| map: "id"`); absent when the text is not
|
|
3037
|
+
* valid JSON
|
|
3038
|
+
* {{ result.blocks }} every content block: [{type, text?,
|
|
3039
|
+
* mime_type?, size_bytes?}]
|
|
3040
|
+
* {{ parameters }} the arguments the tool was called with,
|
|
3041
|
+
* after parameter actions were applied
|
|
3042
|
+
* {{ tool.name }} the tool's metadata.name
|
|
3043
|
+
* {{ tool.llm_tool_name }} the name the model called it by
|
|
3044
|
+
* {{ pinned_parameters }} the objective's pinned parameters
|
|
3045
|
+
* {{ objective.id }} / {{ objective.external_id }} /
|
|
3046
|
+
* {{ objective.labels.<key> }}
|
|
3047
|
+
*
|
|
3048
|
+
* Templates render with strict variables: referencing `result.json` on
|
|
3049
|
+
* a non-JSON result, or any other undefined variable, is a render error
|
|
3050
|
+
* and `on_error` decides the outcome. The `json` filter pretty-prints a
|
|
3051
|
+
* value as JSON; `sanitized_json` emits it compact and escaped for
|
|
3052
|
+
* embedding.
|
|
3053
|
+
*
|
|
3054
|
+
* Transforms are text-only. `result.text` and `result.json` are built
|
|
3055
|
+
* from the result's text blocks; media blocks (images, audio) are opaque
|
|
3056
|
+
* to the template and pass through unchanged. The rendered text replaces
|
|
3057
|
+
* the text blocks as a single text block. A result with no text blocks
|
|
3058
|
+
* at all (an image-only or audio-only result) is out of scope: the
|
|
3059
|
+
* transform is skipped, the result is recorded as returned, and the
|
|
3060
|
+
* skip is noted in the tool call's debug log — this is not an `on_error`
|
|
3061
|
+
* case, nothing was attempted. The one exception is `expect_json`, where
|
|
3062
|
+
* a result with no text is a violated precondition and `on_error`
|
|
3063
|
+
* applies.
|
|
3064
|
+
*/
|
|
3065
|
+
export interface ResultAction_Transform {
|
|
3066
|
+
contentTemplate: string;
|
|
3067
|
+
/**
|
|
3068
|
+
* Default: ON_ERROR_RAW_CONTENT.
|
|
3069
|
+
*/
|
|
3070
|
+
onError: ResultActionTransformOnError;
|
|
3071
|
+
/**
|
|
3072
|
+
* Require the tool result to have text content that parses as JSON
|
|
3073
|
+
* before rendering. A non-JSON (or text-less) result is then an error
|
|
3074
|
+
* subject to `on_error` even if the template never reads
|
|
3075
|
+
* `result.json`. Off by default: `result.json` is simply absent for
|
|
3076
|
+
* non-JSON results, and text-less results skip the transform.
|
|
3077
|
+
*/
|
|
3078
|
+
expectJson: boolean;
|
|
3079
|
+
}
|
|
3080
|
+
|
|
2937
3081
|
/**
|
|
2938
3082
|
* Resume agent schedule request.
|
|
2939
3083
|
*/
|
|
@@ -3039,6 +3183,26 @@ export interface SearchToolsOrToolSetsResponse {
|
|
|
3039
3183
|
agents: Array<Agent>;
|
|
3040
3184
|
}
|
|
3041
3185
|
|
|
3186
|
+
/**
|
|
3187
|
+
* A single selector condition.
|
|
3188
|
+
*/
|
|
3189
|
+
export type Selector_Condition =
|
|
3190
|
+
| Selector_Condition_Attribute
|
|
3191
|
+
| Selector_Condition_HasParameter
|
|
3192
|
+
| Selector_Condition_Tools;
|
|
3193
|
+
|
|
3194
|
+
/**
|
|
3195
|
+
* An explicit list of tools, matched on spec.llm_tool_name — the name
|
|
3196
|
+
* the model calls the tool by. It identifies a tool across versions:
|
|
3197
|
+
* just-in-time MCP sets keep one tool per signature and every version
|
|
3198
|
+
* shares the LLM name, so the condition keeps matching as the source
|
|
3199
|
+
* evolves. Any name in the list matches (OR). Names of tools not (or
|
|
3200
|
+
* not yet) present in the set are allowed and match nothing.
|
|
3201
|
+
*/
|
|
3202
|
+
export interface Selector_ToolNames {
|
|
3203
|
+
names?: Array<string>;
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3042
3206
|
/**
|
|
3043
3207
|
* SetToolCallContentRequest lets an external API consumer supply the result
|
|
3044
3208
|
* of a bare tool call (one whose tool set has no execution adapter). Used
|
|
@@ -3405,6 +3569,12 @@ export interface ToolCalled {
|
|
|
3405
3569
|
* The arguments passed to the tool.
|
|
3406
3570
|
*/
|
|
3407
3571
|
arguments?: Record<string, unknown>;
|
|
3572
|
+
/**
|
|
3573
|
+
* Whether the runtime authorized this call's arguments to be exposed in
|
|
3574
|
+
* public widget events. This records the resolved policy at call time so
|
|
3575
|
+
* consumers do not need to re-evaluate the tool set's current overlays.
|
|
3576
|
+
*/
|
|
3577
|
+
argumentsExposedInWidgets?: boolean;
|
|
3408
3578
|
}
|
|
3409
3579
|
|
|
3410
3580
|
export interface ToolDenied {
|
|
@@ -3433,9 +3603,205 @@ export interface ToolInfo {
|
|
|
3433
3603
|
* Content signature identifying the tool within its tool set: a hash of the
|
|
3434
3604
|
* sanitized llm_tool_name, description, and canonical parameters. Two tools
|
|
3435
3605
|
* with the same llm_tool_name but different parameters or description (as
|
|
3436
|
-
* MCP servers may return per user) have distinct signatures.
|
|
3606
|
+
* MCP servers may return per user) have distinct signatures. Computed over
|
|
3607
|
+
* the raw spec — overlays do not change a tool's signature.
|
|
3437
3608
|
*/
|
|
3438
3609
|
signature: string;
|
|
3610
|
+
/**
|
|
3611
|
+
* Keys of the tool set's overlays whose selectors match this tool
|
|
3612
|
+
* (ToolSetSpec.overlays), in evaluation order. Disabled overlays are
|
|
3613
|
+
* excluded. An overlay is listed when its selector matches even if none
|
|
3614
|
+
* of its actions changed this tool's schema (all its paths were absent),
|
|
3615
|
+
* so this answers "which policies apply to this tool" — diff
|
|
3616
|
+
* effective_parameters against spec.parameters for "what changed".
|
|
3617
|
+
* Empty when no overlay applies.
|
|
3618
|
+
*/
|
|
3619
|
+
overlays?: Array<string>;
|
|
3620
|
+
/**
|
|
3621
|
+
* The parameter schema as presented to the model: spec.parameters after
|
|
3622
|
+
* every matching overlay's parameter actions have been applied, in order,
|
|
3623
|
+
* including maintenance of the schema's `required` list. Actions whose
|
|
3624
|
+
* outcome depends on the objective (pin with ON_MISSING_SKIP) are applied
|
|
3625
|
+
* as if the pinned key were present, so this reflects the intended steady
|
|
3626
|
+
* state rather than any one objective. Equals spec.parameters when no
|
|
3627
|
+
* overlay applies. Result actions have no effect here.
|
|
3628
|
+
*/
|
|
3629
|
+
effectiveParameters?: Record<string, unknown>;
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
/**
|
|
3633
|
+
* A tool overlay is a policy attached to a tool set that reshapes the tools
|
|
3634
|
+
* the model sees and calls. It pairs a selector (which tools it applies to)
|
|
3635
|
+
* with actions that run before a call — rewriting the tool's parameter
|
|
3636
|
+
* schema and the arguments the model supplied — and after a call —
|
|
3637
|
+
* rewriting the result before it enters the model's context. It can also
|
|
3638
|
+
* explicitly allow the final call arguments to cross the otherwise-private
|
|
3639
|
+
* widget API boundary.
|
|
3640
|
+
*
|
|
3641
|
+
* Overlays exist for three reasons:
|
|
3642
|
+
*
|
|
3643
|
+
* - Authority. Adapter-derived tool sets (OpenAPI especially) expose many
|
|
3644
|
+
* parameters the model must never guess — a workspace id, a tenant id,
|
|
3645
|
+
* an account scope. Overlays bind those parameters to the objective's
|
|
3646
|
+
* `pinned_parameters` (see CreateObjectiveRequest.pinned_parameters):
|
|
3647
|
+
* the parameter disappears from the schema and the value is forced
|
|
3648
|
+
* server-side, so the model has no opportunity to supply a different
|
|
3649
|
+
* one.
|
|
3650
|
+
* - Context. Large specs carry pagination cursors, expansion flags and
|
|
3651
|
+
* verbose responses that cost tokens without helping the model.
|
|
3652
|
+
* Overlays strip parameters, fix them to literals, and compact results.
|
|
3653
|
+
* - Widget presentation. Tool arguments are private by default. An overlay
|
|
3654
|
+
* can opt matching tools into exposing their final call arguments in
|
|
3655
|
+
* visitor-facing widget events so an embedding UI can select a custom
|
|
3656
|
+
* renderer or presentation.
|
|
3657
|
+
*
|
|
3658
|
+
* Pinned parameters and overlays are complementary: pinned parameters are
|
|
3659
|
+
* *data* supplied per objective (or per widget session) by the caller;
|
|
3660
|
+
* overlays are *policy* authored once on the tool set. Pinning by name
|
|
3661
|
+
* still works without an overlay — a pinned key that matches a top-level
|
|
3662
|
+
* parameter name is applied to every tool in the objective — overlays are
|
|
3663
|
+
* for the cases that needs more: nested paths, renamed keys, a subset of
|
|
3664
|
+
* tools, or values that are literals rather than caller-supplied.
|
|
3665
|
+
*
|
|
3666
|
+
* Evaluation model:
|
|
3667
|
+
*
|
|
3668
|
+
* - Overlays are evaluated in list order; within an overlay, actions are
|
|
3669
|
+
* evaluated in list order. Later actions win on the same path (a `set`
|
|
3670
|
+
* followed by a `remove` leaves the parameter removed).
|
|
3671
|
+
* - The parameter schema the model sees is computed when tools are
|
|
3672
|
+
* assembled for an objective, so pre-call actions can consult that
|
|
3673
|
+
* objective's pinned parameters (this is what makes `pin` with
|
|
3674
|
+
* ON_MISSING_SKIP meaningful). Argument rewriting runs on every call.
|
|
3675
|
+
* - An action whose `path` does not exist in the tool's parameter schema
|
|
3676
|
+
* changes nothing in the schema the model sees. This is deliberate: a
|
|
3677
|
+
* broad selector (every `list_*` tool) may match tools with different
|
|
3678
|
+
* shapes, and one overlay should be able to cover all of them without
|
|
3679
|
+
* erroring on the ones that lack a given parameter. At call time the
|
|
3680
|
+
* model's arguments can still not widen what it controls: `remove`
|
|
3681
|
+
* strips the path whether or not it is declared, and `set`/`pin`
|
|
3682
|
+
* overwrite a value the model sent at an undeclared path (a schema this
|
|
3683
|
+
* evaluator cannot see through, e.g. behind $ref/allOf) while injecting
|
|
3684
|
+
* nothing into tools that lack the parameter.
|
|
3685
|
+
* - Overlays apply to just-in-time tool sets as well; the tools are
|
|
3686
|
+
* evaluated against overlays at the moment they are loaded.
|
|
3687
|
+
* - Result actions run once, when the tool call's result is recorded; the
|
|
3688
|
+
* stored result is the transformed one, so every reader (the model,
|
|
3689
|
+
* compaction, the API) sees the same content. They are not supported on
|
|
3690
|
+
* bare tool sets.
|
|
3691
|
+
*/
|
|
3692
|
+
export interface ToolOverlay {
|
|
3693
|
+
/**
|
|
3694
|
+
* Identifies the overlay within its tool set. Unique across the tool
|
|
3695
|
+
* set's overlays (enforced by the server), stable across reorders, and
|
|
3696
|
+
* surfaced in tool call messages ("parameter removed by overlay
|
|
3697
|
+
* strip-list-knobs") so an operator can trace a rewritten call back to
|
|
3698
|
+
* the policy that rewrote it. Referenced by ToolInfo.overlays and the
|
|
3699
|
+
* ListToolsRequest.overlays filter.
|
|
3700
|
+
*/
|
|
3701
|
+
key: string;
|
|
3702
|
+
/**
|
|
3703
|
+
* Which tools this overlay applies to. Required; an empty selector
|
|
3704
|
+
* (no conditions) matches every tool in the set.
|
|
3705
|
+
*/
|
|
3706
|
+
selector: ToolOverlay_Selector;
|
|
3707
|
+
/**
|
|
3708
|
+
* Pre-call actions, applied in order. See ParameterAction.
|
|
3709
|
+
*/
|
|
3710
|
+
parameterActions?: Array<ToolOverlay_ParameterAction>;
|
|
3711
|
+
/**
|
|
3712
|
+
* Post-call actions, applied in order. See ResultAction.
|
|
3713
|
+
*/
|
|
3714
|
+
resultActions?: Array<ToolOverlay_ResultAction>;
|
|
3715
|
+
/**
|
|
3716
|
+
* When true the overlay is retained in the spec but not evaluated. Lets an
|
|
3717
|
+
* operator switch a policy off to diagnose a misbehaving tool without
|
|
3718
|
+
* deleting it and losing the configuration.
|
|
3719
|
+
*/
|
|
3720
|
+
disabled: boolean;
|
|
3721
|
+
/**
|
|
3722
|
+
* Arguments may carry sensitive customer data, including values injected by
|
|
3723
|
+
* parameter actions, so they stay private unless an overlay enables them.
|
|
3724
|
+
*
|
|
3725
|
+
* Unset means this overlay has no opinion. When several enabled overlays
|
|
3726
|
+
* match a tool, they are evaluated in list order and the last overlay that
|
|
3727
|
+
* supplies this policy wins. If none supplies it, arguments stay private.
|
|
3728
|
+
* Disabled overlays never participate.
|
|
3729
|
+
*/
|
|
3730
|
+
widgetArgumentExposure?: ToolOverlay_WidgetArgumentExposure;
|
|
3731
|
+
}
|
|
3732
|
+
|
|
3733
|
+
/**
|
|
3734
|
+
* A pre-call action. Parameter actions rewrite the tool's parameter
|
|
3735
|
+
* schema as presented to the model and the arguments the model supplies
|
|
3736
|
+
* when it calls the tool. Both sides are always kept in agreement: a
|
|
3737
|
+
* parameter that is hidden from the schema is also stripped from (or
|
|
3738
|
+
* forced in) the arguments, so the model can neither see nor smuggle it.
|
|
3739
|
+
*/
|
|
3740
|
+
export type ToolOverlay_ParameterAction =
|
|
3741
|
+
| ToolOverlay_ParameterAction_Remove
|
|
3742
|
+
| ToolOverlay_ParameterAction_Set
|
|
3743
|
+
| ToolOverlay_ParameterAction_Pin;
|
|
3744
|
+
|
|
3745
|
+
/**
|
|
3746
|
+
* A dotted path into a tool's parameter schema. Each segment is a property
|
|
3747
|
+
* name; the path `filter.workspaceId` addresses
|
|
3748
|
+
* `properties.filter.properties.workspaceId` in the schema and
|
|
3749
|
+
* `arguments.filter.workspaceId` in the call. Only object properties are
|
|
3750
|
+
* addressable — there is no array indexing, wildcarding or filtering.
|
|
3751
|
+
*
|
|
3752
|
+
* This is deliberately not JSONPath: every action needs a single,
|
|
3753
|
+
* unambiguous location in both the schema and the arguments so that
|
|
3754
|
+
* removing a parameter from the schema and stripping it from the call are
|
|
3755
|
+
* guaranteed to agree.
|
|
3756
|
+
*/
|
|
3757
|
+
export interface ToolOverlay_ParameterPath {
|
|
3758
|
+
path: string;
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
/**
|
|
3762
|
+
* A post-call action. Result actions rewrite a tool call's result after
|
|
3763
|
+
* the adapter returns and before it is recorded: the transformed content
|
|
3764
|
+
* is what is stored and what the model reads (ObjectiveToolCallResult
|
|
3765
|
+
* content). The adapter's raw response is kept in the tool call's debug
|
|
3766
|
+
* log for operators; it is not otherwise retained.
|
|
3767
|
+
*
|
|
3768
|
+
* Result actions apply to MCP, OpenAPI and HTTP tool sets. They are not
|
|
3769
|
+
* supported on bare tool sets — a bare tool's content is supplied by an
|
|
3770
|
+
* external consumer, so there is nothing for the platform to reshape —
|
|
3771
|
+
* and a tool set whose adapter is `bare` rejects overlays that carry
|
|
3772
|
+
* result actions.
|
|
3773
|
+
*
|
|
3774
|
+
* When several matching overlays carry transforms they run in overlay
|
|
3775
|
+
* order, each one reading the previous one's output.
|
|
3776
|
+
*/
|
|
3777
|
+
export type ToolOverlay_ResultAction =
|
|
3778
|
+
| ToolOverlay_ResultAction_Transform;
|
|
3779
|
+
|
|
3780
|
+
/**
|
|
3781
|
+
* Default: OPERATOR_AND.
|
|
3782
|
+
*/
|
|
3783
|
+
export type ToolOverlaySelectorOperator = 'OPERATOR_UNSPECIFIED' | 'OPERATOR_AND' | 'OPERATOR_OR';
|
|
3784
|
+
|
|
3785
|
+
/**
|
|
3786
|
+
* Which tools in the tool set an overlay applies to. Conditions are
|
|
3787
|
+
* combined with `operator`; an overlay with no conditions matches every
|
|
3788
|
+
* tool in the set.
|
|
3789
|
+
*/
|
|
3790
|
+
export interface ToolOverlay_Selector {
|
|
3791
|
+
conditions?: Array<Selector_Condition>;
|
|
3792
|
+
/**
|
|
3793
|
+
* Default: OPERATOR_AND.
|
|
3794
|
+
*/
|
|
3795
|
+
operator: ToolOverlaySelectorOperator;
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3798
|
+
/**
|
|
3799
|
+
* Controls whether matching tool calls may expose their final arguments to
|
|
3800
|
+
* visitor-facing widget events. The containing message's presence means the
|
|
3801
|
+
* overlay has an opinion; enabled selects whether that opinion is on or off.
|
|
3802
|
+
*/
|
|
3803
|
+
export interface ToolOverlay_WidgetArgumentExposure {
|
|
3804
|
+
enabled: boolean;
|
|
3439
3805
|
}
|
|
3440
3806
|
|
|
3441
3807
|
export interface ToolResult {
|
|
@@ -3481,7 +3847,7 @@ export type ToolSetAdapter_ApprovalRequirementFilter =
|
|
|
3481
3847
|
| ToolSetAdapter_ApprovalRequirementFilter_Always
|
|
3482
3848
|
| ToolSetAdapter_ApprovalRequirementFilter_Only;
|
|
3483
3849
|
|
|
3484
|
-
export type ToolSetAdapterAttributeFilterAttribute = 'ATTRIBUTE_UNSPECIFIED' | 'ATTRIBUTE_NAME' | 'ATTRIBUTE_TITLE' | 'ATTRIBUTE_DESCRIPTION';
|
|
3850
|
+
export type ToolSetAdapterAttributeFilterAttribute = 'ATTRIBUTE_UNSPECIFIED' | 'ATTRIBUTE_NAME' | 'ATTRIBUTE_TITLE' | 'ATTRIBUTE_DESCRIPTION' | 'ATTRIBUTE_LLM_TOOL_NAME';
|
|
3485
3851
|
|
|
3486
3852
|
/**
|
|
3487
3853
|
* Single attribute filter
|
|
@@ -3508,6 +3874,27 @@ export interface ToolSetAdapter_Bare {
|
|
|
3508
3874
|
}
|
|
3509
3875
|
|
|
3510
3876
|
export interface ToolSetAdapter_HTTP {
|
|
3877
|
+
/**
|
|
3878
|
+
* Base URL for dispatching tool calls.
|
|
3879
|
+
*
|
|
3880
|
+
* May be templated. Two reference forms are supported, and they resolve
|
|
3881
|
+
* in a single pass each so neither can inject into the other:
|
|
3882
|
+
*
|
|
3883
|
+
* ${SECRET_NAME} a workspace or tool set secret
|
|
3884
|
+
* {{ pinned_parameters.<key> }} the objective's pinned parameters
|
|
3885
|
+
* (see CreateObjectiveRequest.pinned_parameters)
|
|
3886
|
+
*
|
|
3887
|
+
* Pinned parameters are what make a per-tenant host possible: one tool
|
|
3888
|
+
* set can serve every customer of a product that assigns each of them
|
|
3889
|
+
* their own subdomain, e.g.
|
|
3890
|
+
*
|
|
3891
|
+
* https://{{ pinned_parameters.tenant }}.example.com
|
|
3892
|
+
*
|
|
3893
|
+
* Because the value may be a template rather than a literal URL, this
|
|
3894
|
+
* field is not constrained to a URI shape. It is validated as an
|
|
3895
|
+
* absolute http(s) URL after references are resolved, both on write
|
|
3896
|
+
* (with references stubbed) and again before each tool call.
|
|
3897
|
+
*/
|
|
3511
3898
|
baseUrl?: string;
|
|
3512
3899
|
headers?: Record<string, string>;
|
|
3513
3900
|
}
|
|
@@ -3632,6 +4019,15 @@ export interface ToolSetSecretSpec {
|
|
|
3632
4019
|
export interface ToolSetSpec {
|
|
3633
4020
|
description?: string;
|
|
3634
4021
|
adapter: ToolSetAdapter;
|
|
4022
|
+
/**
|
|
4023
|
+
* Overlays applied to this tool set's tools, evaluated in order. See
|
|
4024
|
+
* ToolOverlay. Overlay keys must be unique within the list.
|
|
4025
|
+
*
|
|
4026
|
+
* As a repeated field this is replaced wholesale on update: an
|
|
4027
|
+
* update_mask of `spec.overlays` swaps the entire list for the one in the
|
|
4028
|
+
* request. Read-modify-write to add or remove a single overlay.
|
|
4029
|
+
*/
|
|
4030
|
+
overlays?: Array<ToolOverlay>;
|
|
3635
4031
|
}
|
|
3636
4032
|
|
|
3637
4033
|
/**
|
|
@@ -3668,8 +4064,9 @@ export interface ToolSpec {
|
|
|
3668
4064
|
*/
|
|
3669
4065
|
parameters: Record<string, unknown>;
|
|
3670
4066
|
/**
|
|
3671
|
-
* Configuration for this specific tool.
|
|
3672
|
-
* such as endpoint
|
|
4067
|
+
* Configuration for this specific tool. Its transport is derived from the
|
|
4068
|
+
* tool set adapter, while details such as endpoint and method are stored on
|
|
4069
|
+
* the tool itself.
|
|
3673
4070
|
*
|
|
3674
4071
|
* Required, and exactly one adapter must be set.
|
|
3675
4072
|
*/
|
|
@@ -4374,13 +4771,13 @@ export interface WidgetSessionSpec {
|
|
|
4374
4771
|
tokenExpiresAt?: string;
|
|
4375
4772
|
/**
|
|
4376
4773
|
* Parameters forced onto tool calls made by this session's conversations.
|
|
4377
|
-
* A pinned parameter is
|
|
4378
|
-
* is
|
|
4379
|
-
*
|
|
4380
|
-
*
|
|
4381
|
-
*
|
|
4382
|
-
*
|
|
4383
|
-
*
|
|
4774
|
+
* A pinned parameter is removed from the tool schema the LLM sees, and its
|
|
4775
|
+
* value is always overwritten server-side with the pinned value — so the
|
|
4776
|
+
* model cannot be tricked into calling a tool with a different id than the
|
|
4777
|
+
* one the session was minted for (e.g. pin "workspaceId" for an OpenAPI
|
|
4778
|
+
* tool with a /workspaces/{workspaceId} path). Flows to every objective
|
|
4779
|
+
* the session creates. See ToolSetSpec.overlays for binding pinned keys to
|
|
4780
|
+
* nested or differently named parameters.
|
|
4384
4781
|
*/
|
|
4385
4782
|
pinnedParameters?: Record<string, string>;
|
|
4386
4783
|
}
|
|
@@ -4647,6 +5044,17 @@ export interface ToolSetAdapter_OpenAPI_Url {
|
|
|
4647
5044
|
/**
|
|
4648
5045
|
* Base URL for dispatching tool calls. If set, overrides the server
|
|
4649
5046
|
* resolved from the spec's servers array.
|
|
5047
|
+
*
|
|
5048
|
+
* May be templated with the same two reference forms the HTTP adapter's
|
|
5049
|
+
* base_url accepts:
|
|
5050
|
+
*
|
|
5051
|
+
* ${SECRET_NAME} a workspace or tool set secret
|
|
5052
|
+
* {{ pinned_parameters.<key> }} the objective's pinned parameters
|
|
5053
|
+
*
|
|
5054
|
+
* A spec written against a single host can therefore be dispatched to a
|
|
5055
|
+
* per-tenant one, e.g. https://{{ pinned_parameters.tenant }}.example.com,
|
|
5056
|
+
* without cloning the tool set per customer. Validated as an absolute
|
|
5057
|
+
* http(s) URL after references are resolved rather than as a literal URI.
|
|
4650
5058
|
*/
|
|
4651
5059
|
baseUrl?: string;
|
|
4652
5060
|
/**
|
|
@@ -4674,6 +5082,17 @@ export interface ToolSetAdapter_OpenAPI_UploadId {
|
|
|
4674
5082
|
/**
|
|
4675
5083
|
* Base URL for dispatching tool calls. If set, overrides the server
|
|
4676
5084
|
* resolved from the spec's servers array.
|
|
5085
|
+
*
|
|
5086
|
+
* May be templated with the same two reference forms the HTTP adapter's
|
|
5087
|
+
* base_url accepts:
|
|
5088
|
+
*
|
|
5089
|
+
* ${SECRET_NAME} a workspace or tool set secret
|
|
5090
|
+
* {{ pinned_parameters.<key> }} the objective's pinned parameters
|
|
5091
|
+
*
|
|
5092
|
+
* A spec written against a single host can therefore be dispatched to a
|
|
5093
|
+
* per-tenant one, e.g. https://{{ pinned_parameters.tenant }}.example.com,
|
|
5094
|
+
* without cloning the tool set per customer. Validated as an absolute
|
|
5095
|
+
* http(s) URL after references are resolved rather than as a literal URI.
|
|
4677
5096
|
*/
|
|
4678
5097
|
baseUrl?: string;
|
|
4679
5098
|
/**
|
|
@@ -4685,6 +5104,55 @@ export interface ToolSetAdapter_OpenAPI_UploadId {
|
|
|
4685
5104
|
serverName?: string;
|
|
4686
5105
|
}
|
|
4687
5106
|
|
|
5107
|
+
export interface Selector_Condition_Attribute {
|
|
5108
|
+
type: 'attribute';
|
|
5109
|
+
/**
|
|
5110
|
+
* Match on a tool attribute (name, title, description,
|
|
5111
|
+
* llm_tool_name) with a string matcher — the same filter used by
|
|
5112
|
+
* the adapter's include/exclude lists.
|
|
5113
|
+
*/
|
|
5114
|
+
attribute: ToolSetAdapter_AttributeFilter;
|
|
5115
|
+
}
|
|
5116
|
+
|
|
5117
|
+
export interface Selector_Condition_HasParameter {
|
|
5118
|
+
type: 'hasParameter';
|
|
5119
|
+
/**
|
|
5120
|
+
* Match tools whose parameter schema contains the given path. This
|
|
5121
|
+
* is the usual way to target "every tool that takes a workspaceId"
|
|
5122
|
+
* without enumerating tools by name.
|
|
5123
|
+
*/
|
|
5124
|
+
hasParameter: ToolOverlay_ParameterPath;
|
|
5125
|
+
}
|
|
5126
|
+
|
|
5127
|
+
export interface Selector_Condition_Tools {
|
|
5128
|
+
type: 'tools';
|
|
5129
|
+
/**
|
|
5130
|
+
* Match specific tools by LLM tool name. The direct way to assign an
|
|
5131
|
+
* overlay to one tool (or a handful) without writing a matcher.
|
|
5132
|
+
*/
|
|
5133
|
+
tools: Selector_ToolNames;
|
|
5134
|
+
}
|
|
5135
|
+
|
|
5136
|
+
export interface ToolOverlay_ParameterAction_Remove {
|
|
5137
|
+
type: 'remove';
|
|
5138
|
+
remove: ParameterAction_Remove;
|
|
5139
|
+
}
|
|
5140
|
+
|
|
5141
|
+
export interface ToolOverlay_ParameterAction_Set {
|
|
5142
|
+
type: 'set';
|
|
5143
|
+
set: ParameterAction_Set;
|
|
5144
|
+
}
|
|
5145
|
+
|
|
5146
|
+
export interface ToolOverlay_ParameterAction_Pin {
|
|
5147
|
+
type: 'pin';
|
|
5148
|
+
pin: ParameterAction_Pin;
|
|
5149
|
+
}
|
|
5150
|
+
|
|
5151
|
+
export interface ToolOverlay_ResultAction_Transform {
|
|
5152
|
+
type: 'transform';
|
|
5153
|
+
transform: ResultAction_Transform;
|
|
5154
|
+
}
|
|
5155
|
+
|
|
4688
5156
|
export interface ToolSpec_Config_Http {
|
|
4689
5157
|
type: 'http';
|
|
4690
5158
|
http: Config_HTTP;
|
|
@@ -5073,13 +5541,13 @@ export interface WidgetSessionSpecParam {
|
|
|
5073
5541
|
expiresAt?: string;
|
|
5074
5542
|
/**
|
|
5075
5543
|
* Parameters forced onto tool calls made by this session's conversations.
|
|
5076
|
-
* A pinned parameter is
|
|
5077
|
-
* is
|
|
5078
|
-
*
|
|
5079
|
-
*
|
|
5080
|
-
*
|
|
5081
|
-
*
|
|
5082
|
-
*
|
|
5544
|
+
* A pinned parameter is removed from the tool schema the LLM sees, and its
|
|
5545
|
+
* value is always overwritten server-side with the pinned value — so the
|
|
5546
|
+
* model cannot be tricked into calling a tool with a different id than the
|
|
5547
|
+
* one the session was minted for (e.g. pin "workspaceId" for an OpenAPI
|
|
5548
|
+
* tool with a /workspaces/{workspaceId} path). Flows to every objective
|
|
5549
|
+
* the session creates. See ToolSetSpec.overlays for binding pinned keys to
|
|
5550
|
+
* nested or differently named parameters.
|
|
5083
5551
|
*/
|
|
5084
5552
|
pinnedParameters?: Record<string, string>;
|
|
5085
5553
|
}
|