@agentick/core 0.4.0 → 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 +36 -3
- package/dist/.tsbuildinfo.build +1 -1
- package/dist/agentick-instance.d.ts.map +1 -1
- package/dist/agentick-instance.js +2 -1
- package/dist/agentick-instance.js.map +1 -1
- package/dist/app/session.d.ts +5 -0
- package/dist/app/session.d.ts.map +1 -1
- package/dist/app/session.js +58 -31
- package/dist/app/session.js.map +1 -1
- package/dist/app/types.d.ts +20 -4
- package/dist/app/types.d.ts.map +1 -1
- package/dist/com/object-model.d.ts.map +1 -1
- package/dist/com/object-model.js +8 -3
- package/dist/com/object-model.js.map +1 -1
- package/dist/compiler/collector.d.ts.map +1 -1
- package/dist/compiler/collector.js +14 -5
- package/dist/compiler/collector.js.map +1 -1
- package/dist/compiler/fiber-compiler.d.ts +2 -0
- package/dist/compiler/fiber-compiler.d.ts.map +1 -1
- package/dist/compiler/fiber-compiler.js +29 -1
- package/dist/compiler/fiber-compiler.js.map +1 -1
- package/dist/compiler/index.d.ts +1 -1
- package/dist/compiler/index.d.ts.map +1 -1
- package/dist/compiler/index.js.map +1 -1
- package/dist/compiler/structure-renderer.d.ts.map +1 -1
- package/dist/compiler/structure-renderer.js +4 -15
- package/dist/compiler/structure-renderer.js.map +1 -1
- package/dist/compiler/types.d.ts +2 -10
- package/dist/compiler/types.d.ts.map +1 -1
- package/dist/compiler/types.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/knob.d.ts +12 -0
- package/dist/hooks/knob.d.ts.map +1 -1
- package/dist/hooks/knob.js +32 -2
- package/dist/hooks/knob.js.map +1 -1
- package/dist/hooks/knobs-component.d.ts +1 -0
- package/dist/hooks/knobs-component.d.ts.map +1 -1
- package/dist/hooks/knobs-component.js +5 -1
- package/dist/hooks/knobs-component.js.map +1 -1
- package/dist/hooks/lifecycle.d.ts +21 -14
- package/dist/hooks/lifecycle.d.ts.map +1 -1
- package/dist/hooks/lifecycle.js +32 -13
- package/dist/hooks/lifecycle.js.map +1 -1
- package/dist/hooks/runtime-context.d.ts +12 -1
- package/dist/hooks/runtime-context.d.ts.map +1 -1
- package/dist/hooks/runtime-context.js +21 -0
- package/dist/hooks/runtime-context.js.map +1 -1
- package/dist/hooks/types.d.ts +8 -0
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/hooks/types.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/jsx/jsx-runtime.d.ts +6 -0
- package/dist/jsx/jsx-runtime.d.ts.map +1 -1
- package/dist/jsx/jsx-runtime.js.map +1 -1
- package/dist/testing/compile-agent.d.ts +4 -3
- package/dist/testing/compile-agent.d.ts.map +1 -1
- package/dist/testing/compile-agent.js +2 -2
- package/dist/testing/compile-agent.js.map +1 -1
- package/dist/testing/test-runner.d.ts +7 -7
- package/dist/testing/test-runner.js +8 -8
- package/dist/tool/tool.d.ts +13 -1
- package/dist/tool/tool.d.ts.map +1 -1
- package/dist/tool/tool.js +39 -6
- package/dist/tool/tool.js.map +1 -1
- package/dist/utils/token-estimate.d.ts +4 -3
- package/dist/utils/token-estimate.d.ts.map +1 -1
- package/dist/utils/token-estimate.js +16 -15
- package/dist/utils/token-estimate.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -616,6 +616,39 @@ function App() {
|
|
|
616
616
|
}
|
|
617
617
|
```
|
|
618
618
|
|
|
619
|
+
### Prop Overrides
|
|
620
|
+
|
|
621
|
+
Customize pre-built tool metadata via JSX props without creating new tools:
|
|
622
|
+
|
|
623
|
+
```tsx
|
|
624
|
+
<WeatherTool description="Check weather. Always include units." />
|
|
625
|
+
<ShellTool name="bash" requiresConfirmation={true} />
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
### Tool Sources
|
|
629
|
+
|
|
630
|
+
Tools merge from four sources (lowest → highest priority):
|
|
631
|
+
|
|
632
|
+
```tsx
|
|
633
|
+
// 1. App-level — available to all sessions
|
|
634
|
+
const app = createApp(Agent, { tools: [SearchTool] });
|
|
635
|
+
|
|
636
|
+
// 2. Session-level — available for this session
|
|
637
|
+
const session = await app.session({ tools: [FileTool] });
|
|
638
|
+
|
|
639
|
+
// 3. Per-execution — available only during this send()
|
|
640
|
+
await session.send({ messages: [...], tools: [DynamicTool] });
|
|
641
|
+
|
|
642
|
+
// 4. JSX-reconciled — highest priority, re-evaluated each tick
|
|
643
|
+
function Agent() {
|
|
644
|
+
return <SearchTool description="Custom desc" />;
|
|
645
|
+
}
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
On each tick, tools merge in order: app → session → execution → JSX. Last-in wins by name.
|
|
649
|
+
|
|
650
|
+
Spawned sessions (`session.spawn()`) start fresh — they do **not** inherit parent tools. Each child defines its own toolset via JSX and app-level tools.
|
|
651
|
+
|
|
619
652
|
## App & Session
|
|
620
653
|
|
|
621
654
|
### Creating an App
|
|
@@ -983,9 +1016,9 @@ import { createApp, type ExecutionRunner } from "@agentick/core";
|
|
|
983
1016
|
const replRunner: ExecutionRunner = {
|
|
984
1017
|
name: "repl",
|
|
985
1018
|
|
|
986
|
-
// Transform
|
|
1019
|
+
// Transform the compiled structure — replace tool schemas with prose descriptions,
|
|
987
1020
|
// expose a single "execute" tool, restructure sections, anything.
|
|
988
|
-
|
|
1021
|
+
transformCompiled(compiled, tools) {
|
|
989
1022
|
const commandList = tools
|
|
990
1023
|
.map((t) => `- ${t.metadata?.name}: ${t.metadata?.description}`)
|
|
991
1024
|
.join("\n");
|
|
@@ -1031,7 +1064,7 @@ All methods are optional. Omitted methods use default behavior.
|
|
|
1031
1064
|
|
|
1032
1065
|
| Hook | Purpose | Timing |
|
|
1033
1066
|
| ------------------- | --------------------------------------------------- | ------------- |
|
|
1034
|
-
| `
|
|
1067
|
+
| `transformCompiled` | Transform compiled context before the model sees it | Per tick |
|
|
1035
1068
|
| `executeToolCall` | Intercept, transform, or replace tool execution | Per tool call |
|
|
1036
1069
|
| `onSessionInit` | Set up per-session resources (sandbox, workspace) | Once |
|
|
1037
1070
|
| `onPersist` | Add runner state to session snapshot | Per save |
|