@takeshape/schema 11.85.2 → 11.87.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.
@@ -1,4 +1,4 @@
1
- import type { AgentJSON, FormConfig, GuardJSON, ProjectSchemaJSON, QueryJSON, ServiceConfigJSON, ShapeJSON, Workflow } from '../project-schema/index.ts';
1
+ import type { AgentJSON, FormConfig, GuardJSON, ProjectSchemaJSON, QueryJSON, ServiceConfigJSON, ShapeJSON, ToolJSON, Workflow } from '../project-schema/index.ts';
2
2
  import type { EncryptFn, SafeDecryptFn } from '../services/types.ts';
3
3
  export type ProjectSchemaMigrationContext = {
4
4
  generateDataKeyFn: () => Promise<string>;
@@ -11,6 +11,7 @@ export type ProjectSchemaUpdate = {
11
11
  shapes?: Record<string, ShapeJSON | null>;
12
12
  'ai-experimental.agents'?: Record<string, AgentJSON | null>;
13
13
  'ai-experimental.guards'?: Record<string, GuardJSON | null>;
14
+ 'ai-experimental.tools'?: Record<string, ToolJSON | null>;
14
15
  forms?: Record<string, FormConfig | null>;
15
16
  workflows?: Record<string, Workflow | null>;
16
17
  services?: Record<string, ServiceConfigJSON | null>;
@@ -293,7 +293,19 @@ export type InteractionTimeoutMilliseconds1 = number;
293
293
  export type Variables = AgentVariable[];
294
294
  export type AgentExecution = AgentExecutionGraphQL | AgentExecutionGenerate | AgentExecutionChat;
295
295
  export type AgentAIStateInput = AgentAIStateInputArgument | AgentAIStateInputTemplate;
296
- export type AgentToolConfigArg = AgentToolConfigArgAgent | AgentToolConfigArgVariable;
296
+ export type AgentToolConfigArg = AgentControlled | VariableValue;
297
+ /**
298
+ * The argument name that will be exposed by the tool for the LLM to use.
299
+ */
300
+ export type ToolArgumentName = string;
301
+ /**
302
+ * Name of argument to pass value to. This prevents the LLM from setting the argument.
303
+ */
304
+ export type ToolArgumentName1 = string;
305
+ /**
306
+ * Name of variable to pull value from.
307
+ */
308
+ export type StateVariableName = string;
297
309
  export type History1 = boolean;
298
310
  /**
299
311
  * Maximum number of tokens to generate. Defaults to 1024
@@ -454,6 +466,7 @@ export type Filter1 = {
454
466
  type: Type;
455
467
  threshold: Threshold;
456
468
  }[];
469
+ export type ToolArg = AgentControlled;
457
470
  /**
458
471
  * Human-readable id for use in the UI
459
472
  */
@@ -1840,33 +1853,20 @@ export interface AgentAIStateInputTemplate {
1840
1853
  type: 'template';
1841
1854
  inputTemplate: string;
1842
1855
  }
1843
- /**
1844
- * This interface was referenced by `ToolMap`'s JSON-Schema definition
1845
- * via the `patternProperty` "^[0-9A-Za-z_]+$".
1846
- */
1847
1856
  export interface AgentToolConfig {
1848
1857
  ref: string;
1849
1858
  description?: string;
1850
1859
  args?: AgentToolConfigArg[];
1851
1860
  selectionSet?: string;
1852
1861
  }
1853
- export interface AgentToolConfigArgAgent {
1862
+ export interface AgentControlled {
1854
1863
  type: 'agent';
1855
- /**
1856
- * The argument name that will be exposed by the tool for the LLM to use.
1857
- */
1858
- argName: string;
1864
+ argName: ToolArgumentName;
1859
1865
  }
1860
- export interface AgentToolConfigArgVariable {
1866
+ export interface VariableValue {
1861
1867
  type: 'variable';
1862
- /**
1863
- * Name of argument to pass value to. This prevents the LLM from setting the argument.
1864
- */
1865
- argName: string;
1866
- /**
1867
- * Name of variable to pull value from.
1868
- */
1869
- variableName: string;
1868
+ argName: ToolArgumentName1;
1869
+ variableName: StateVariableName;
1870
1870
  }
1871
1871
  export interface AgentGenerateOptions {
1872
1872
  history?: History1;
@@ -1986,7 +1986,17 @@ export interface ContextualGroundingPolicy {
1986
1986
  filtersConfig: Filter1;
1987
1987
  }
1988
1988
  export interface ToolMap {
1989
- [k: string]: AgentToolConfig;
1989
+ [k: string]: ToolJSON;
1990
+ }
1991
+ /**
1992
+ * This interface was referenced by `ToolMap`'s JSON-Schema definition
1993
+ * via the `patternProperty` "^[0-9A-Za-z_]+$".
1994
+ */
1995
+ export interface ToolJSON {
1996
+ ref: string;
1997
+ description?: string;
1998
+ args?: ToolArg[];
1999
+ selectionSet?: string;
1990
2000
  }
1991
2001
  /**
1992
2002
  * This interface was referenced by `ProjectSchemaJSON`'s JSON-Schema
@@ -268,7 +268,19 @@ export type InteractionTimeoutMillisecondsV3_48_01 = number;
268
268
  export type VariablesV3_48_0 = AgentVariableV3_48_0[];
269
269
  export type AgentExecutionV3_48_0 = AgentExecutionGraphQLV3_48_0 | AgentExecutionGenerateV3_48_0 | AgentExecutionChatV3_48_0;
270
270
  export type AgentAIStateInputV3_48_0 = AgentAIStateInputArgumentV3_48_0 | AgentAIStateInputTemplateV3_48_0;
271
- export type AgentToolConfigArgV3_48_0 = AgentToolConfigArgAgentV3_48_0 | AgentToolConfigArgVariableV3_48_0;
271
+ export type AgentToolConfigArgV3_48_0 = AgentControlledV3_48_0 | VariableValueV3_48_0;
272
+ /**
273
+ * The argument name that will be exposed by the tool for the LLM to use.
274
+ */
275
+ export type ToolArgumentNameV3_48_0 = string;
276
+ /**
277
+ * Name of argument to pass value to. This prevents the LLM from setting the argument.
278
+ */
279
+ export type ToolArgumentNameV3_48_01 = string;
280
+ /**
281
+ * Name of variable to pull value from.
282
+ */
283
+ export type StateVariableNameV3_48_0 = string;
272
284
  export type HistoryV3_48_01 = boolean;
273
285
  /**
274
286
  * Maximum number of tokens to generate. Defaults to 1024
@@ -429,6 +441,7 @@ export type FilterV3_48_01 = {
429
441
  type: TypeV3_48_0;
430
442
  threshold: ThresholdV3_48_0;
431
443
  }[];
444
+ export type ToolArgV3_48_0 = AgentControlledV3_48_0;
432
445
  /**
433
446
  * Human-readable id for use in the UI
434
447
  */
@@ -1688,33 +1701,20 @@ export interface AgentAIStateInputTemplateV3_48_0 {
1688
1701
  type: 'template';
1689
1702
  inputTemplate: string;
1690
1703
  }
1691
- /**
1692
- * This interface was referenced by `ToolMapV3_48_0`'s JSON-Schema definition
1693
- * via the `patternProperty` "^[0-9A-Za-z_]+$".
1694
- */
1695
1704
  export interface AgentToolConfigV3_48_0 {
1696
1705
  ref: string;
1697
1706
  description?: string;
1698
1707
  args?: AgentToolConfigArgV3_48_0[];
1699
1708
  selectionSet?: string;
1700
1709
  }
1701
- export interface AgentToolConfigArgAgentV3_48_0 {
1710
+ export interface AgentControlledV3_48_0 {
1702
1711
  type: 'agent';
1703
- /**
1704
- * The argument name that will be exposed by the tool for the LLM to use.
1705
- */
1706
- argName: string;
1712
+ argName: ToolArgumentNameV3_48_0;
1707
1713
  }
1708
- export interface AgentToolConfigArgVariableV3_48_0 {
1714
+ export interface VariableValueV3_48_0 {
1709
1715
  type: 'variable';
1710
- /**
1711
- * Name of argument to pass value to. This prevents the LLM from setting the argument.
1712
- */
1713
- argName: string;
1714
- /**
1715
- * Name of variable to pull value from.
1716
- */
1717
- variableName: string;
1716
+ argName: ToolArgumentNameV3_48_01;
1717
+ variableName: StateVariableNameV3_48_0;
1718
1718
  }
1719
1719
  export interface AgentGenerateOptionsV3_48_0 {
1720
1720
  history?: HistoryV3_48_01;
@@ -1834,7 +1834,17 @@ export interface ContextualGroundingPolicyV3_48_0 {
1834
1834
  filtersConfig: FilterV3_48_01;
1835
1835
  }
1836
1836
  export interface ToolMapV3_48_0 {
1837
- [k: string]: AgentToolConfigV3_48_0;
1837
+ [k: string]: ToolJSONV3_48_0;
1838
+ }
1839
+ /**
1840
+ * This interface was referenced by `ToolMapV3_48_0`'s JSON-Schema definition
1841
+ * via the `patternProperty` "^[0-9A-Za-z_]+$".
1842
+ */
1843
+ export interface ToolJSONV3_48_0 {
1844
+ ref: string;
1845
+ description?: string;
1846
+ args?: ToolArgV3_48_0[];
1847
+ selectionSet?: string;
1838
1848
  }
1839
1849
  /**
1840
1850
  * This interface was referenced by `ProjectSchemaJSONV3_48_0`'s JSON-Schema
@@ -268,7 +268,19 @@ export type InteractionTimeoutMillisecondsV3_49_01 = number;
268
268
  export type VariablesV3_49_0 = AgentVariableV3_49_0[];
269
269
  export type AgentExecutionV3_49_0 = AgentExecutionGraphQLV3_49_0 | AgentExecutionGenerateV3_49_0 | AgentExecutionChatV3_49_0;
270
270
  export type AgentAIStateInputV3_49_0 = AgentAIStateInputArgumentV3_49_0 | AgentAIStateInputTemplateV3_49_0;
271
- export type AgentToolConfigArgV3_49_0 = AgentToolConfigArgAgentV3_49_0 | AgentToolConfigArgVariableV3_49_0;
271
+ export type AgentToolConfigArgV3_49_0 = AgentControlledV3_49_0 | VariableValueV3_49_0;
272
+ /**
273
+ * The argument name that will be exposed by the tool for the LLM to use.
274
+ */
275
+ export type ToolArgumentNameV3_49_0 = string;
276
+ /**
277
+ * Name of argument to pass value to. This prevents the LLM from setting the argument.
278
+ */
279
+ export type ToolArgumentNameV3_49_01 = string;
280
+ /**
281
+ * Name of variable to pull value from.
282
+ */
283
+ export type StateVariableNameV3_49_0 = string;
272
284
  export type HistoryV3_49_01 = boolean;
273
285
  /**
274
286
  * Maximum number of tokens to generate. Defaults to 1024
@@ -429,6 +441,7 @@ export type FilterV3_49_01 = {
429
441
  type: TypeV3_49_0;
430
442
  threshold: ThresholdV3_49_0;
431
443
  }[];
444
+ export type ToolArgV3_49_0 = AgentControlledV3_49_0;
432
445
  /**
433
446
  * Human-readable id for use in the UI
434
447
  */
@@ -1688,33 +1701,20 @@ export interface AgentAIStateInputTemplateV3_49_0 {
1688
1701
  type: 'template';
1689
1702
  inputTemplate: string;
1690
1703
  }
1691
- /**
1692
- * This interface was referenced by `ToolMapV3_49_0`'s JSON-Schema definition
1693
- * via the `patternProperty` "^[0-9A-Za-z_]+$".
1694
- */
1695
1704
  export interface AgentToolConfigV3_49_0 {
1696
1705
  ref: string;
1697
1706
  description?: string;
1698
1707
  args?: AgentToolConfigArgV3_49_0[];
1699
1708
  selectionSet?: string;
1700
1709
  }
1701
- export interface AgentToolConfigArgAgentV3_49_0 {
1710
+ export interface AgentControlledV3_49_0 {
1702
1711
  type: 'agent';
1703
- /**
1704
- * The argument name that will be exposed by the tool for the LLM to use.
1705
- */
1706
- argName: string;
1712
+ argName: ToolArgumentNameV3_49_0;
1707
1713
  }
1708
- export interface AgentToolConfigArgVariableV3_49_0 {
1714
+ export interface VariableValueV3_49_0 {
1709
1715
  type: 'variable';
1710
- /**
1711
- * Name of argument to pass value to. This prevents the LLM from setting the argument.
1712
- */
1713
- argName: string;
1714
- /**
1715
- * Name of variable to pull value from.
1716
- */
1717
- variableName: string;
1716
+ argName: ToolArgumentNameV3_49_01;
1717
+ variableName: StateVariableNameV3_49_0;
1718
1718
  }
1719
1719
  export interface AgentGenerateOptionsV3_49_0 {
1720
1720
  history?: HistoryV3_49_01;
@@ -1834,7 +1834,17 @@ export interface ContextualGroundingPolicyV3_49_0 {
1834
1834
  filtersConfig: FilterV3_49_01;
1835
1835
  }
1836
1836
  export interface ToolMapV3_49_0 {
1837
- [k: string]: AgentToolConfigV3_49_0;
1837
+ [k: string]: ToolJSONV3_49_0;
1838
+ }
1839
+ /**
1840
+ * This interface was referenced by `ToolMapV3_49_0`'s JSON-Schema definition
1841
+ * via the `patternProperty` "^[0-9A-Za-z_]+$".
1842
+ */
1843
+ export interface ToolJSONV3_49_0 {
1844
+ ref: string;
1845
+ description?: string;
1846
+ args?: ToolArgV3_49_0[];
1847
+ selectionSet?: string;
1838
1848
  }
1839
1849
  /**
1840
1850
  * This interface was referenced by `ProjectSchemaJSONV3_49_0`'s JSON-Schema
@@ -280,7 +280,19 @@ export type InteractionTimeoutMillisecondsV3_50_01 = number;
280
280
  export type VariablesV3_50_0 = AgentVariableV3_50_0[];
281
281
  export type AgentExecutionV3_50_0 = AgentExecutionGraphQLV3_50_0 | AgentExecutionGenerateV3_50_0 | AgentExecutionChatV3_50_0;
282
282
  export type AgentAIStateInputV3_50_0 = AgentAIStateInputArgumentV3_50_0 | AgentAIStateInputTemplateV3_50_0;
283
- export type AgentToolConfigArgV3_50_0 = AgentToolConfigArgAgentV3_50_0 | AgentToolConfigArgVariableV3_50_0;
283
+ export type AgentToolConfigArgV3_50_0 = AgentControlledV3_50_0 | VariableValueV3_50_0;
284
+ /**
285
+ * The argument name that will be exposed by the tool for the LLM to use.
286
+ */
287
+ export type ToolArgumentNameV3_50_0 = string;
288
+ /**
289
+ * Name of argument to pass value to. This prevents the LLM from setting the argument.
290
+ */
291
+ export type ToolArgumentNameV3_50_01 = string;
292
+ /**
293
+ * Name of variable to pull value from.
294
+ */
295
+ export type StateVariableNameV3_50_0 = string;
284
296
  export type HistoryV3_50_01 = boolean;
285
297
  /**
286
298
  * Maximum number of tokens to generate. Defaults to 1024
@@ -441,6 +453,7 @@ export type FilterV3_50_01 = {
441
453
  type: TypeV3_50_0;
442
454
  threshold: ThresholdV3_50_0;
443
455
  }[];
456
+ export type ToolArgV3_50_0 = AgentControlledV3_50_0;
444
457
  /**
445
458
  * Human-readable id for use in the UI
446
459
  */
@@ -1740,33 +1753,20 @@ export interface AgentAIStateInputTemplateV3_50_0 {
1740
1753
  type: 'template';
1741
1754
  inputTemplate: string;
1742
1755
  }
1743
- /**
1744
- * This interface was referenced by `ToolMapV3_50_0`'s JSON-Schema definition
1745
- * via the `patternProperty` "^[0-9A-Za-z_]+$".
1746
- */
1747
1756
  export interface AgentToolConfigV3_50_0 {
1748
1757
  ref: string;
1749
1758
  description?: string;
1750
1759
  args?: AgentToolConfigArgV3_50_0[];
1751
1760
  selectionSet?: string;
1752
1761
  }
1753
- export interface AgentToolConfigArgAgentV3_50_0 {
1762
+ export interface AgentControlledV3_50_0 {
1754
1763
  type: 'agent';
1755
- /**
1756
- * The argument name that will be exposed by the tool for the LLM to use.
1757
- */
1758
- argName: string;
1764
+ argName: ToolArgumentNameV3_50_0;
1759
1765
  }
1760
- export interface AgentToolConfigArgVariableV3_50_0 {
1766
+ export interface VariableValueV3_50_0 {
1761
1767
  type: 'variable';
1762
- /**
1763
- * Name of argument to pass value to. This prevents the LLM from setting the argument.
1764
- */
1765
- argName: string;
1766
- /**
1767
- * Name of variable to pull value from.
1768
- */
1769
- variableName: string;
1768
+ argName: ToolArgumentNameV3_50_01;
1769
+ variableName: StateVariableNameV3_50_0;
1770
1770
  }
1771
1771
  export interface AgentGenerateOptionsV3_50_0 {
1772
1772
  history?: HistoryV3_50_01;
@@ -1886,7 +1886,17 @@ export interface ContextualGroundingPolicyV3_50_0 {
1886
1886
  filtersConfig: FilterV3_50_01;
1887
1887
  }
1888
1888
  export interface ToolMapV3_50_0 {
1889
- [k: string]: AgentToolConfigV3_50_0;
1889
+ [k: string]: ToolJSONV3_50_0;
1890
+ }
1891
+ /**
1892
+ * This interface was referenced by `ToolMapV3_50_0`'s JSON-Schema definition
1893
+ * via the `patternProperty` "^[0-9A-Za-z_]+$".
1894
+ */
1895
+ export interface ToolJSONV3_50_0 {
1896
+ ref: string;
1897
+ description?: string;
1898
+ args?: ToolArgV3_50_0[];
1899
+ selectionSet?: string;
1890
1900
  }
1891
1901
  /**
1892
1902
  * This interface was referenced by `ProjectSchemaJSONV3_50_0`'s JSON-Schema
@@ -280,7 +280,19 @@ export type InteractionTimeoutMillisecondsV3_51_01 = number;
280
280
  export type VariablesV3_51_0 = AgentVariableV3_51_0[];
281
281
  export type AgentExecutionV3_51_0 = AgentExecutionGraphQLV3_51_0 | AgentExecutionGenerateV3_51_0 | AgentExecutionChatV3_51_0;
282
282
  export type AgentAIStateInputV3_51_0 = AgentAIStateInputArgumentV3_51_0 | AgentAIStateInputTemplateV3_51_0;
283
- export type AgentToolConfigArgV3_51_0 = AgentToolConfigArgAgentV3_51_0 | AgentToolConfigArgVariableV3_51_0;
283
+ export type AgentToolConfigArgV3_51_0 = AgentControlledV3_51_0 | VariableValueV3_51_0;
284
+ /**
285
+ * The argument name that will be exposed by the tool for the LLM to use.
286
+ */
287
+ export type ToolArgumentNameV3_51_0 = string;
288
+ /**
289
+ * Name of argument to pass value to. This prevents the LLM from setting the argument.
290
+ */
291
+ export type ToolArgumentNameV3_51_01 = string;
292
+ /**
293
+ * Name of variable to pull value from.
294
+ */
295
+ export type StateVariableNameV3_51_0 = string;
284
296
  export type HistoryV3_51_01 = boolean;
285
297
  /**
286
298
  * Maximum number of tokens to generate. Defaults to 1024
@@ -441,6 +453,7 @@ export type FilterV3_51_01 = {
441
453
  type: TypeV3_51_0;
442
454
  threshold: ThresholdV3_51_0;
443
455
  }[];
456
+ export type ToolArgV3_51_0 = AgentControlledV3_51_0;
444
457
  /**
445
458
  * Human-readable id for use in the UI
446
459
  */
@@ -1740,33 +1753,20 @@ export interface AgentAIStateInputTemplateV3_51_0 {
1740
1753
  type: 'template';
1741
1754
  inputTemplate: string;
1742
1755
  }
1743
- /**
1744
- * This interface was referenced by `ToolMapV3_51_0`'s JSON-Schema definition
1745
- * via the `patternProperty` "^[0-9A-Za-z_]+$".
1746
- */
1747
1756
  export interface AgentToolConfigV3_51_0 {
1748
1757
  ref: string;
1749
1758
  description?: string;
1750
1759
  args?: AgentToolConfigArgV3_51_0[];
1751
1760
  selectionSet?: string;
1752
1761
  }
1753
- export interface AgentToolConfigArgAgentV3_51_0 {
1762
+ export interface AgentControlledV3_51_0 {
1754
1763
  type: 'agent';
1755
- /**
1756
- * The argument name that will be exposed by the tool for the LLM to use.
1757
- */
1758
- argName: string;
1764
+ argName: ToolArgumentNameV3_51_0;
1759
1765
  }
1760
- export interface AgentToolConfigArgVariableV3_51_0 {
1766
+ export interface VariableValueV3_51_0 {
1761
1767
  type: 'variable';
1762
- /**
1763
- * Name of argument to pass value to. This prevents the LLM from setting the argument.
1764
- */
1765
- argName: string;
1766
- /**
1767
- * Name of variable to pull value from.
1768
- */
1769
- variableName: string;
1768
+ argName: ToolArgumentNameV3_51_01;
1769
+ variableName: StateVariableNameV3_51_0;
1770
1770
  }
1771
1771
  export interface AgentGenerateOptionsV3_51_0 {
1772
1772
  history?: HistoryV3_51_01;
@@ -1886,7 +1886,17 @@ export interface ContextualGroundingPolicyV3_51_0 {
1886
1886
  filtersConfig: FilterV3_51_01;
1887
1887
  }
1888
1888
  export interface ToolMapV3_51_0 {
1889
- [k: string]: AgentToolConfigV3_51_0;
1889
+ [k: string]: ToolJSONV3_51_0;
1890
+ }
1891
+ /**
1892
+ * This interface was referenced by `ToolMapV3_51_0`'s JSON-Schema definition
1893
+ * via the `patternProperty` "^[0-9A-Za-z_]+$".
1894
+ */
1895
+ export interface ToolJSONV3_51_0 {
1896
+ ref: string;
1897
+ description?: string;
1898
+ args?: ToolArgV3_51_0[];
1899
+ selectionSet?: string;
1890
1900
  }
1891
1901
  /**
1892
1902
  * This interface was referenced by `ProjectSchemaJSONV3_51_0`'s JSON-Schema
@@ -280,7 +280,19 @@ export type InteractionTimeoutMillisecondsV3_52_01 = number;
280
280
  export type VariablesV3_52_0 = AgentVariableV3_52_0[];
281
281
  export type AgentExecutionV3_52_0 = AgentExecutionGraphQLV3_52_0 | AgentExecutionGenerateV3_52_0 | AgentExecutionChatV3_52_0;
282
282
  export type AgentAIStateInputV3_52_0 = AgentAIStateInputArgumentV3_52_0 | AgentAIStateInputTemplateV3_52_0;
283
- export type AgentToolConfigArgV3_52_0 = AgentToolConfigArgAgentV3_52_0 | AgentToolConfigArgVariableV3_52_0;
283
+ export type AgentToolConfigArgV3_52_0 = AgentControlledV3_52_0 | VariableValueV3_52_0;
284
+ /**
285
+ * The argument name that will be exposed by the tool for the LLM to use.
286
+ */
287
+ export type ToolArgumentNameV3_52_0 = string;
288
+ /**
289
+ * Name of argument to pass value to. This prevents the LLM from setting the argument.
290
+ */
291
+ export type ToolArgumentNameV3_52_01 = string;
292
+ /**
293
+ * Name of variable to pull value from.
294
+ */
295
+ export type StateVariableNameV3_52_0 = string;
284
296
  export type HistoryV3_52_01 = boolean;
285
297
  /**
286
298
  * Maximum number of tokens to generate. Defaults to 1024
@@ -441,6 +453,7 @@ export type FilterV3_52_01 = {
441
453
  type: TypeV3_52_0;
442
454
  threshold: ThresholdV3_52_0;
443
455
  }[];
456
+ export type ToolArgV3_52_0 = AgentControlledV3_52_0;
444
457
  /**
445
458
  * Human-readable id for use in the UI
446
459
  */
@@ -1740,33 +1753,20 @@ export interface AgentAIStateInputTemplateV3_52_0 {
1740
1753
  type: 'template';
1741
1754
  inputTemplate: string;
1742
1755
  }
1743
- /**
1744
- * This interface was referenced by `ToolMapV3_52_0`'s JSON-Schema definition
1745
- * via the `patternProperty` "^[0-9A-Za-z_]+$".
1746
- */
1747
1756
  export interface AgentToolConfigV3_52_0 {
1748
1757
  ref: string;
1749
1758
  description?: string;
1750
1759
  args?: AgentToolConfigArgV3_52_0[];
1751
1760
  selectionSet?: string;
1752
1761
  }
1753
- export interface AgentToolConfigArgAgentV3_52_0 {
1762
+ export interface AgentControlledV3_52_0 {
1754
1763
  type: 'agent';
1755
- /**
1756
- * The argument name that will be exposed by the tool for the LLM to use.
1757
- */
1758
- argName: string;
1764
+ argName: ToolArgumentNameV3_52_0;
1759
1765
  }
1760
- export interface AgentToolConfigArgVariableV3_52_0 {
1766
+ export interface VariableValueV3_52_0 {
1761
1767
  type: 'variable';
1762
- /**
1763
- * Name of argument to pass value to. This prevents the LLM from setting the argument.
1764
- */
1765
- argName: string;
1766
- /**
1767
- * Name of variable to pull value from.
1768
- */
1769
- variableName: string;
1768
+ argName: ToolArgumentNameV3_52_01;
1769
+ variableName: StateVariableNameV3_52_0;
1770
1770
  }
1771
1771
  export interface AgentGenerateOptionsV3_52_0 {
1772
1772
  history?: HistoryV3_52_01;
@@ -1886,7 +1886,17 @@ export interface ContextualGroundingPolicyV3_52_0 {
1886
1886
  filtersConfig: FilterV3_52_01;
1887
1887
  }
1888
1888
  export interface ToolMapV3_52_0 {
1889
- [k: string]: AgentToolConfigV3_52_0;
1889
+ [k: string]: ToolJSONV3_52_0;
1890
+ }
1891
+ /**
1892
+ * This interface was referenced by `ToolMapV3_52_0`'s JSON-Schema definition
1893
+ * via the `patternProperty` "^[0-9A-Za-z_]+$".
1894
+ */
1895
+ export interface ToolJSONV3_52_0 {
1896
+ ref: string;
1897
+ description?: string;
1898
+ args?: ToolArgV3_52_0[];
1899
+ selectionSet?: string;
1890
1900
  }
1891
1901
  /**
1892
1902
  * This interface was referenced by `ProjectSchemaJSONV3_52_0`'s JSON-Schema
@@ -289,7 +289,19 @@ export type InteractionTimeoutMillisecondsV3_53_01 = number;
289
289
  export type VariablesV3_53_0 = AgentVariableV3_53_0[];
290
290
  export type AgentExecutionV3_53_0 = AgentExecutionGraphQLV3_53_0 | AgentExecutionGenerateV3_53_0 | AgentExecutionChatV3_53_0;
291
291
  export type AgentAIStateInputV3_53_0 = AgentAIStateInputArgumentV3_53_0 | AgentAIStateInputTemplateV3_53_0;
292
- export type AgentToolConfigArgV3_53_0 = AgentToolConfigArgAgentV3_53_0 | AgentToolConfigArgVariableV3_53_0;
292
+ export type AgentToolConfigArgV3_53_0 = AgentControlledV3_53_0 | VariableValueV3_53_0;
293
+ /**
294
+ * The argument name that will be exposed by the tool for the LLM to use.
295
+ */
296
+ export type ToolArgumentNameV3_53_0 = string;
297
+ /**
298
+ * Name of argument to pass value to. This prevents the LLM from setting the argument.
299
+ */
300
+ export type ToolArgumentNameV3_53_01 = string;
301
+ /**
302
+ * Name of variable to pull value from.
303
+ */
304
+ export type StateVariableNameV3_53_0 = string;
293
305
  export type HistoryV3_53_01 = boolean;
294
306
  /**
295
307
  * Maximum number of tokens to generate. Defaults to 1024
@@ -450,6 +462,7 @@ export type FilterV3_53_01 = {
450
462
  type: TypeV3_53_0;
451
463
  threshold: ThresholdV3_53_0;
452
464
  }[];
465
+ export type ToolArgV3_53_0 = AgentControlledV3_53_0;
453
466
  /**
454
467
  * Human-readable id for use in the UI
455
468
  */
@@ -1821,33 +1834,20 @@ export interface AgentAIStateInputTemplateV3_53_0 {
1821
1834
  type: 'template';
1822
1835
  inputTemplate: string;
1823
1836
  }
1824
- /**
1825
- * This interface was referenced by `ToolMapV3_53_0`'s JSON-Schema definition
1826
- * via the `patternProperty` "^[0-9A-Za-z_]+$".
1827
- */
1828
1837
  export interface AgentToolConfigV3_53_0 {
1829
1838
  ref: string;
1830
1839
  description?: string;
1831
1840
  args?: AgentToolConfigArgV3_53_0[];
1832
1841
  selectionSet?: string;
1833
1842
  }
1834
- export interface AgentToolConfigArgAgentV3_53_0 {
1843
+ export interface AgentControlledV3_53_0 {
1835
1844
  type: 'agent';
1836
- /**
1837
- * The argument name that will be exposed by the tool for the LLM to use.
1838
- */
1839
- argName: string;
1845
+ argName: ToolArgumentNameV3_53_0;
1840
1846
  }
1841
- export interface AgentToolConfigArgVariableV3_53_0 {
1847
+ export interface VariableValueV3_53_0 {
1842
1848
  type: 'variable';
1843
- /**
1844
- * Name of argument to pass value to. This prevents the LLM from setting the argument.
1845
- */
1846
- argName: string;
1847
- /**
1848
- * Name of variable to pull value from.
1849
- */
1850
- variableName: string;
1849
+ argName: ToolArgumentNameV3_53_01;
1850
+ variableName: StateVariableNameV3_53_0;
1851
1851
  }
1852
1852
  export interface AgentGenerateOptionsV3_53_0 {
1853
1853
  history?: HistoryV3_53_01;
@@ -1967,7 +1967,17 @@ export interface ContextualGroundingPolicyV3_53_0 {
1967
1967
  filtersConfig: FilterV3_53_01;
1968
1968
  }
1969
1969
  export interface ToolMapV3_53_0 {
1970
- [k: string]: AgentToolConfigV3_53_0;
1970
+ [k: string]: ToolJSONV3_53_0;
1971
+ }
1972
+ /**
1973
+ * This interface was referenced by `ToolMapV3_53_0`'s JSON-Schema definition
1974
+ * via the `patternProperty` "^[0-9A-Za-z_]+$".
1975
+ */
1976
+ export interface ToolJSONV3_53_0 {
1977
+ ref: string;
1978
+ description?: string;
1979
+ args?: ToolArgV3_53_0[];
1980
+ selectionSet?: string;
1971
1981
  }
1972
1982
  /**
1973
1983
  * This interface was referenced by `ProjectSchemaJSONV3_53_0`'s JSON-Schema
@@ -293,7 +293,19 @@ export type InteractionTimeoutMillisecondsV3_54_01 = number;
293
293
  export type VariablesV3_54_0 = AgentVariableV3_54_0[];
294
294
  export type AgentExecutionV3_54_0 = AgentExecutionGraphQLV3_54_0 | AgentExecutionGenerateV3_54_0 | AgentExecutionChatV3_54_0;
295
295
  export type AgentAIStateInputV3_54_0 = AgentAIStateInputArgumentV3_54_0 | AgentAIStateInputTemplateV3_54_0;
296
- export type AgentToolConfigArgV3_54_0 = AgentToolConfigArgAgentV3_54_0 | AgentToolConfigArgVariableV3_54_0;
296
+ export type AgentToolConfigArgV3_54_0 = AgentControlledV3_54_0 | VariableValueV3_54_0;
297
+ /**
298
+ * The argument name that will be exposed by the tool for the LLM to use.
299
+ */
300
+ export type ToolArgumentNameV3_54_0 = string;
301
+ /**
302
+ * Name of argument to pass value to. This prevents the LLM from setting the argument.
303
+ */
304
+ export type ToolArgumentNameV3_54_01 = string;
305
+ /**
306
+ * Name of variable to pull value from.
307
+ */
308
+ export type StateVariableNameV3_54_0 = string;
297
309
  export type HistoryV3_54_01 = boolean;
298
310
  /**
299
311
  * Maximum number of tokens to generate. Defaults to 1024
@@ -454,6 +466,7 @@ export type FilterV3_54_01 = {
454
466
  type: TypeV3_54_0;
455
467
  threshold: ThresholdV3_54_0;
456
468
  }[];
469
+ export type ToolArgV3_54_0 = AgentControlledV3_54_0;
457
470
  /**
458
471
  * Human-readable id for use in the UI
459
472
  */
@@ -1840,33 +1853,20 @@ export interface AgentAIStateInputTemplateV3_54_0 {
1840
1853
  type: 'template';
1841
1854
  inputTemplate: string;
1842
1855
  }
1843
- /**
1844
- * This interface was referenced by `ToolMapV3_54_0`'s JSON-Schema definition
1845
- * via the `patternProperty` "^[0-9A-Za-z_]+$".
1846
- */
1847
1856
  export interface AgentToolConfigV3_54_0 {
1848
1857
  ref: string;
1849
1858
  description?: string;
1850
1859
  args?: AgentToolConfigArgV3_54_0[];
1851
1860
  selectionSet?: string;
1852
1861
  }
1853
- export interface AgentToolConfigArgAgentV3_54_0 {
1862
+ export interface AgentControlledV3_54_0 {
1854
1863
  type: 'agent';
1855
- /**
1856
- * The argument name that will be exposed by the tool for the LLM to use.
1857
- */
1858
- argName: string;
1864
+ argName: ToolArgumentNameV3_54_0;
1859
1865
  }
1860
- export interface AgentToolConfigArgVariableV3_54_0 {
1866
+ export interface VariableValueV3_54_0 {
1861
1867
  type: 'variable';
1862
- /**
1863
- * Name of argument to pass value to. This prevents the LLM from setting the argument.
1864
- */
1865
- argName: string;
1866
- /**
1867
- * Name of variable to pull value from.
1868
- */
1869
- variableName: string;
1868
+ argName: ToolArgumentNameV3_54_01;
1869
+ variableName: StateVariableNameV3_54_0;
1870
1870
  }
1871
1871
  export interface AgentGenerateOptionsV3_54_0 {
1872
1872
  history?: HistoryV3_54_01;
@@ -1986,7 +1986,17 @@ export interface ContextualGroundingPolicyV3_54_0 {
1986
1986
  filtersConfig: FilterV3_54_01;
1987
1987
  }
1988
1988
  export interface ToolMapV3_54_0 {
1989
- [k: string]: AgentToolConfigV3_54_0;
1989
+ [k: string]: ToolJSONV3_54_0;
1990
+ }
1991
+ /**
1992
+ * This interface was referenced by `ToolMapV3_54_0`'s JSON-Schema definition
1993
+ * via the `patternProperty` "^[0-9A-Za-z_]+$".
1994
+ */
1995
+ export interface ToolJSONV3_54_0 {
1996
+ ref: string;
1997
+ description?: string;
1998
+ args?: ToolArgV3_54_0[];
1999
+ selectionSet?: string;
1990
2000
  }
1991
2001
  /**
1992
2002
  * This interface was referenced by `ProjectSchemaJSONV3_54_0`'s JSON-Schema
@@ -35,6 +35,41 @@
35
35
  "required": ["start", "states", "api"],
36
36
  "additionalProperties": false
37
37
  },
38
+ "tool": {
39
+ "title": "Tool JSON",
40
+ "type": "object",
41
+ "properties": {
42
+ "ref": {
43
+ "type": "string"
44
+ },
45
+ "description": {
46
+ "type": "string"
47
+ },
48
+ "args": {
49
+ "type": "array",
50
+ "items": {
51
+ "$ref": "#/definitions/toolArg"
52
+ }
53
+ },
54
+ "selectionSet": {
55
+ "type": "string"
56
+ }
57
+ },
58
+ "required": ["ref"],
59
+ "additionalProperties": false
60
+ },
61
+ "toolArg": {
62
+ "title": "Tool Arg",
63
+ "type": "object",
64
+ "discriminator": {
65
+ "propertyName": "type"
66
+ },
67
+ "oneOf": [
68
+ {
69
+ "$ref": "#/definitions/agentToolConfigArgAgent"
70
+ }
71
+ ]
72
+ },
38
73
  "agentApi": {
39
74
  "title": "Agent API",
40
75
  "discriminator": {
@@ -527,13 +562,14 @@
527
562
  ]
528
563
  },
529
564
  "agentToolConfigArgAgent": {
530
- "title": "Agent Tool Config Arg Agent",
565
+ "title": "Agent-Controlled",
531
566
  "type": "object",
532
567
  "properties": {
533
568
  "type": {
534
569
  "enum": ["agent"]
535
570
  },
536
571
  "argName": {
572
+ "title": "Tool Argument Name",
537
573
  "type": "string",
538
574
  "description": "The argument name that will be exposed by the tool for the LLM to use."
539
575
  }
@@ -542,17 +578,19 @@
542
578
  "additionalProperties": false
543
579
  },
544
580
  "agentToolConfigArgVariable": {
545
- "title": "Agent Tool Config Arg Variable",
581
+ "title": "Variable Value",
546
582
  "type": "object",
547
583
  "properties": {
548
584
  "type": {
549
585
  "enum": ["variable"]
550
586
  },
551
587
  "argName": {
588
+ "title": "Tool Argument Name",
552
589
  "type": "string",
553
590
  "description": "Name of argument to pass value to. This prevents the LLM from setting the argument."
554
591
  },
555
592
  "variableName": {
593
+ "title": "State Variable Name",
556
594
  "type": "string",
557
595
  "description": "Name of variable to pull value from."
558
596
  }
@@ -723,7 +761,7 @@
723
761
  "type": "object",
724
762
  "patternProperties": {
725
763
  "^[0-9A-Za-z_]+$": {
726
- "$ref": "#/definitions/agentToolConfig"
764
+ "$ref": "#/definitions/tool"
727
765
  }
728
766
  },
729
767
  "additionalProperties": false
@@ -13,7 +13,8 @@ const schemaUpdateMergedKeys = [
13
13
  'forms',
14
14
  'services',
15
15
  'ai-experimental.agents',
16
- 'ai-experimental.guards'
16
+ 'ai-experimental.guards',
17
+ 'ai-experimental.tools'
17
18
  ];
18
19
  function shallowMerge(original, update) {
19
20
  const result = { ...original };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/schema",
3
- "version": "11.85.2",
3
+ "version": "11.87.0",
4
4
  "description": "TakeShape Schema",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -57,9 +57,9 @@
57
57
  "p-reduce": "^2.1.0",
58
58
  "semver": "^7.3.2",
59
59
  "tiny-invariant": "^1.2.0",
60
- "@takeshape/errors": "11.85.2",
61
- "@takeshape/json-schema": "11.85.2",
62
- "@takeshape/util": "11.85.2"
60
+ "@takeshape/json-schema": "11.87.0",
61
+ "@takeshape/errors": "11.87.0",
62
+ "@takeshape/util": "11.87.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@takeshape/json-schema-to-typescript": "^11.0.0",
@@ -76,7 +76,7 @@
76
76
  "json-schema-to-ts": "^3.1.1",
77
77
  "meow": "^9.0.0",
78
78
  "shortid": "^2.2.15",
79
- "@takeshape/infra": "11.85.2"
79
+ "@takeshape/infra": "11.87.0"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=20"