taias 0.4.1 → 0.5.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
@@ -53,7 +53,11 @@ const taias = createTaias({
53
53
  ```ts
54
54
  // Inside your tool handler
55
55
 
56
- const affordances = await taias.resolve({ toolName: "scan_repo" });
56
+ const affordances = await taias.resolve({
57
+ toolName: "scan_repo",
58
+ params: input, // Pass tool input parameters (optional)
59
+ result: { language: scanResult.language }, // Pass tool output (optional)
60
+ });
57
61
 
58
62
  let message = "Scan successful!";
59
63
 
@@ -118,7 +122,11 @@ const taias = createTaias({
118
122
  Resolves a tool call to get the suggested next step. Advice text to send the LLM is generated based on the `nextTool` specified in your step handler.
119
123
 
120
124
  ```ts
121
- const affordances = await taias.resolve({ toolName: "scan_repo" });
125
+ const affordances = await taias.resolve({
126
+ toolName: "scan_repo",
127
+ params: { repoUrl: "https://github.com/..." }, // optional
128
+ result: { language: "python", hasConfig: true }, // optional
129
+ });
122
130
  // affordances.advice → "FOR THE BEST USER EXPERIENCE, TELL THE USER TO USE THE configure_app TOOL NEXT!!!!!"
123
131
  ```
124
132
 
@@ -126,6 +134,8 @@ const affordances = await taias.resolve({ toolName: "scan_repo" });
126
134
 
127
135
  **Parameters:**
128
136
  - `ctx.toolName` - The name of the tool being called
137
+ - `ctx.params` - The input parameters of the tool call (optional)
138
+ - `ctx.result` - The output of the tool's execution (optional)
129
139
 
130
140
  **Returns:** `Affordances | null`
131
141
  - Returns an `Affordances` object with `advice` (and more) if a matching step is found
package/dist/index.d.cts CHANGED
@@ -56,9 +56,15 @@ type AffordanceRegistry<S extends string = DefaultSlots> = {
56
56
  type Decision = Record<string, string | undefined>;
57
57
  /**
58
58
  * Context passed to a step handler.
59
+ *
60
+ * - toolName: the name of the tool being executed
61
+ * - params: the input parameters of the tool call (optional)
62
+ * - result: the output of the tool's execution (optional)
59
63
  */
60
64
  type TaiasContext = {
61
65
  toolName: string;
66
+ params?: Record<string, unknown>;
67
+ result?: Record<string, unknown>;
62
68
  };
63
69
  /**
64
70
  * Decision returned by a step handler specifying the next tool.
package/dist/index.d.ts CHANGED
@@ -56,9 +56,15 @@ type AffordanceRegistry<S extends string = DefaultSlots> = {
56
56
  type Decision = Record<string, string | undefined>;
57
57
  /**
58
58
  * Context passed to a step handler.
59
+ *
60
+ * - toolName: the name of the tool being executed
61
+ * - params: the input parameters of the tool call (optional)
62
+ * - result: the output of the tool's execution (optional)
59
63
  */
60
64
  type TaiasContext = {
61
65
  toolName: string;
66
+ params?: Record<string, unknown>;
67
+ result?: Record<string, unknown>;
62
68
  };
63
69
  /**
64
70
  * Decision returned by a step handler specifying the next tool.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taias",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "Taias - Give your MCP server an opinion, guide your users to achieve outcomes",
6
6
  "license": "Apache-2.0",