@reminix/runtime 0.0.17 → 0.0.18
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 +17 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ Returns runtime information, available agents, and tools:
|
|
|
65
65
|
{
|
|
66
66
|
"runtime": {
|
|
67
67
|
"name": "reminix-runtime",
|
|
68
|
-
"version": "0.0.
|
|
68
|
+
"version": "0.0.18",
|
|
69
69
|
"language": "typescript",
|
|
70
70
|
"framework": "hono"
|
|
71
71
|
},
|
|
@@ -403,6 +403,8 @@ const streamingAgent = agent('streaming-agent', {
|
|
|
403
403
|
});
|
|
404
404
|
```
|
|
405
405
|
|
|
406
|
+
To receive request context (e.g. `user_id` from the request body), use a handler that accepts `(input, context)`: `handler: async (input, context) => { ... }`. For full request access (e.g. `stream`), use the [Agent class](#agent-class) and a handler that receives the full request object.
|
|
407
|
+
|
|
406
408
|
### `tool(name, options)`
|
|
407
409
|
|
|
408
410
|
Factory function to create a tool.
|
|
@@ -427,6 +429,20 @@ const myTool = tool('my_tool', {
|
|
|
427
429
|
},
|
|
428
430
|
handler: async (input) => ({ result: input.input }),
|
|
429
431
|
});
|
|
432
|
+
|
|
433
|
+
// With context (optional second argument receives request context)
|
|
434
|
+
const myToolWithContext = tool('my_tool', {
|
|
435
|
+
description: 'Example with context',
|
|
436
|
+
input: {
|
|
437
|
+
type: 'object',
|
|
438
|
+
properties: { param: { type: 'string' } },
|
|
439
|
+
required: ['param'],
|
|
440
|
+
},
|
|
441
|
+
handler: async (input, context) => ({
|
|
442
|
+
param: input.param,
|
|
443
|
+
userId: (context as Record<string, unknown>)?.user_id ?? 'anonymous',
|
|
444
|
+
}),
|
|
445
|
+
});
|
|
430
446
|
```
|
|
431
447
|
|
|
432
448
|
### Request/Response Types
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED