ai-tool-set 1.1.0 → 1.2.0

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/README.md CHANGED
@@ -521,6 +521,19 @@ type Inactive = InferInactiveTools<typeof toolSet>;
521
521
  // 'cancel_order'
522
522
  ```
523
523
 
524
+ ### `InferAllTools`
525
+
526
+ Extract all tool names from a `ToolSet` instance, regardless of activation state. Works for both immutable and mutable toolsets since the tool record is statically known.
527
+
528
+ ```ts
529
+ import type { InferAllTools } from 'ai-tool-set';
530
+
531
+ const toolSet = createToolSet({ tools }).deactivate(['cancel_order']);
532
+
533
+ type All = InferAllTools<typeof toolSet>;
534
+ // 'search' | 'list_orders' | 'cancel_order'
535
+ ```
536
+
524
537
  ## License
525
538
 
526
539
  MIT
package/dist/index.d.mts CHANGED
@@ -21,6 +21,11 @@ type InferActiveTools<TOOLSET extends AnyToolSet> = TOOLSET extends ImmutableToo
21
21
  * Returns `never` for MutableToolSet (cannot be determined at compile time).
22
22
  */
23
23
  type InferInactiveTools<TOOLSET extends AnyToolSet> = TOOLSET extends ImmutableToolSet<any, any, any, any, infer D> ? D : never;
24
+ /**
25
+ * Extract all tool names from a ToolSet instance — both active and inactive.
26
+ * Works for both ImmutableToolSet and MutableToolSet since the tool record is statically known.
27
+ */
28
+ type InferAllTools<TOOLSET extends AnyToolSet> = keyof InferToolSet<TOOLSET> & string;
24
29
  /**
25
30
  * Input passed to activation predicates.
26
31
  * Use `ActivationInput<MyMsg>` to get per-tool narrowing in callbacks.
@@ -176,4 +181,4 @@ declare function createToolSet<const TOOLS extends ToolRecord, MESSAGE extends M
176
181
  mutable?: false;
177
182
  }): ImmutableToolSet<TOOLS, MESSAGE, CONTEXT, keyof TOOLS & string>;
178
183
  //#endregion
179
- export { type ActivationInput, type InferActiveTools, type InferInactiveTools, type InferToolSet, type InferUIToolSet, type ToolSet, createToolSet };
184
+ export { type ActivationInput, type InferActiveTools, type InferAllTools, type InferInactiveTools, type InferToolSet, type InferUIToolSet, type ToolSet, createToolSet };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-tool-set",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Conditional tool activation for the AI SDK, fully type-safe",
5
5
  "keywords": [
6
6
  "ai",