@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/api.md +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 +13 -4
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cadenya/cadenya",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "The official TypeScript SDK for the Cadenya API",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -13,12 +13,21 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"sideEffects": false,
|
|
16
|
-
"publishConfig": {
|
|
17
|
-
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/cadenya/cadenya-typescript"
|
|
22
|
+
},
|
|
18
23
|
"engines": {
|
|
19
24
|
"node": ">=18"
|
|
20
25
|
},
|
|
21
|
-
"files": [
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"src",
|
|
29
|
+
"api.md"
|
|
30
|
+
],
|
|
22
31
|
"scripts": {
|
|
23
32
|
"build": "tsc",
|
|
24
33
|
"typecheck": "tsc --noEmit"
|
|
@@ -144,9 +144,12 @@ export interface ObjectiveCreateParams {
|
|
|
144
144
|
subject?: SubjectAssertion;
|
|
145
145
|
/**
|
|
146
146
|
* Parameters forced onto this objective's tool calls. A pinned parameter
|
|
147
|
-
* is
|
|
148
|
-
*
|
|
149
|
-
*
|
|
147
|
+
* is removed from the tool schema the LLM sees, and its value is always
|
|
148
|
+
* overwritten server-side with the pinned value — the model cannot choose
|
|
149
|
+
* a different value for it. By default a pinned key applies to every tool
|
|
150
|
+
* with a top-level parameter of the same name; a tool set's overlays
|
|
151
|
+
* (ToolSetSpec.overlays) can bind pinned keys to nested paths, differently
|
|
152
|
+
* named parameters, or a subset of tools.
|
|
150
153
|
*/
|
|
151
154
|
pinnedParameters?: Record<string, string>;
|
|
152
155
|
}
|
|
@@ -489,7 +492,7 @@ export class Objectives {
|
|
|
489
492
|
}
|
|
490
493
|
|
|
491
494
|
/**
|
|
492
|
-
* Get objective context
|
|
495
|
+
* Get objective context usage
|
|
493
496
|
*
|
|
494
497
|
* @example
|
|
495
498
|
* ```ts
|
|
@@ -6,9 +6,7 @@ import type { SearchToolsOrToolSetsResponse } from '../types.js';
|
|
|
6
6
|
export interface ToolSearchSearchOrSetsParams {
|
|
7
7
|
query: string;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* does not propagate message-level schema `required` to GET query
|
|
11
|
-
* parameters — overlay.yaml marks the parameter required instead.
|
|
9
|
+
* Workspace that contains the tools and tool sets to search.
|
|
12
10
|
*
|
|
13
11
|
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
14
12
|
*/
|
package/src/resources/tools.ts
CHANGED
|
@@ -40,6 +40,14 @@ export interface ToolListParams {
|
|
|
40
40
|
* requiring approval; false = only tools not requiring approval.
|
|
41
41
|
*/
|
|
42
42
|
requiresApproval?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Filter to tools matched by the tool set overlays with these keys
|
|
45
|
+
* (ToolSetSpec.overlays), i.e. tools whose info.overlays contains the
|
|
46
|
+
* key. Multiple values are OR'd together. Selectors are evaluated
|
|
47
|
+
* against every tool in the set to answer this, so total counts reflect
|
|
48
|
+
* the filtered set. An unknown overlay key matches nothing.
|
|
49
|
+
*/
|
|
50
|
+
overlays?: Array<string>;
|
|
43
51
|
/**
|
|
44
52
|
* Filters by metadata labels. Comma-separated key=value pairs,
|
|
45
53
|
* e.g. "env=prod,team=ai". A resource matches only if every pair
|
|
@@ -133,7 +141,7 @@ export class Tools {
|
|
|
133
141
|
const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
|
|
134
142
|
if (workspaceId === undefined) throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
|
|
135
143
|
const _base = snapshotParams(params);
|
|
136
|
-
const response = await this._client.request<ListToolsResponse>({ method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/tool_sets/${pathSegment('toolSetId', toolSetId)}/tools`, query: { limit: params?.limit, cursor: params?.cursor, prefix: params?.prefix, query: params?.query, names: params?.names, states: params?.states, requiresApproval: params?.requiresApproval, labels: params?.labels, sortOrder: params?.sortOrder, includeInfo: params?.includeInfo } }, options);
|
|
144
|
+
const response = await this._client.request<ListToolsResponse>({ method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/tool_sets/${pathSegment('toolSetId', toolSetId)}/tools`, query: { limit: params?.limit, cursor: params?.cursor, prefix: params?.prefix, query: params?.query, names: params?.names, states: params?.states, requiresApproval: params?.requiresApproval, overlays: params?.overlays, labels: params?.labels, sortOrder: params?.sortOrder, includeInfo: params?.includeInfo } }, options);
|
|
137
145
|
return new Page(response.items ?? [], response.pagination?.nextCursor, (cursor) => this.list(toolSetId, { ..._base, cursor: cursor }, options));
|
|
138
146
|
}
|
|
139
147
|
|