@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/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@cadenya/cadenya",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "The official TypeScript SDK for the Cadenya API",
5
- "license": "UNLICENSED",
5
+ "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -13,12 +13,21 @@
13
13
  }
14
14
  },
15
15
  "sideEffects": false,
16
- "publishConfig": { "access": "public" },
17
- "repository": { "type": "git", "url": "https://github.com/cadenya/cadenya-typescript" },
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": ["dist", "src", "api.md"],
26
+ "files": [
27
+ "dist",
28
+ "src",
29
+ "api.md"
30
+ ],
22
31
  "scripts": {
23
32
  "build": "tsc",
24
33
  "typecheck": "tsc --noEmit"
package/src/client.ts CHANGED
@@ -85,7 +85,7 @@ export class Cadenya {
85
85
  authHeader: () => ({ Authorization: `Bearer ${apiKey}` }),
86
86
  maxRetries: options.maxRetries ?? 0,
87
87
  timeout: options.timeout,
88
- defaultHeaders: { 'User-Agent': 'cadenya-typescript/1.0.0 (api 1.0)', ...options.defaultHeaders },
88
+ defaultHeaders: { 'User-Agent': 'cadenya-typescript/1.0.1 (api 1.0)', ...options.defaultHeaders },
89
89
  fetch: options.fetch,
90
90
  logger: options.logger,
91
91
  logLevel: options.logLevel,
@@ -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 an overlay on a tool's JSON schema: the parameter is removed from
148
- * what the LLM sees, and its value is always overwritten server-side with
149
- * the pinned value — the model cannot choose a different value for it.
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 diagnostics
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
- * NOTE: `query` is runtime-required (buf.validate min_len), but gnostic
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
  */
@@ -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