@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.
Files changed (75) hide show
  1. package/README.md +36 -3
  2. package/dist/.tsbuildinfo.build +1 -1
  3. package/dist/agentick-instance.d.ts.map +1 -1
  4. package/dist/agentick-instance.js +2 -1
  5. package/dist/agentick-instance.js.map +1 -1
  6. package/dist/app/session.d.ts +5 -0
  7. package/dist/app/session.d.ts.map +1 -1
  8. package/dist/app/session.js +58 -31
  9. package/dist/app/session.js.map +1 -1
  10. package/dist/app/types.d.ts +20 -4
  11. package/dist/app/types.d.ts.map +1 -1
  12. package/dist/com/object-model.d.ts.map +1 -1
  13. package/dist/com/object-model.js +8 -3
  14. package/dist/com/object-model.js.map +1 -1
  15. package/dist/compiler/collector.d.ts.map +1 -1
  16. package/dist/compiler/collector.js +14 -5
  17. package/dist/compiler/collector.js.map +1 -1
  18. package/dist/compiler/fiber-compiler.d.ts +2 -0
  19. package/dist/compiler/fiber-compiler.d.ts.map +1 -1
  20. package/dist/compiler/fiber-compiler.js +29 -1
  21. package/dist/compiler/fiber-compiler.js.map +1 -1
  22. package/dist/compiler/index.d.ts +1 -1
  23. package/dist/compiler/index.d.ts.map +1 -1
  24. package/dist/compiler/index.js.map +1 -1
  25. package/dist/compiler/structure-renderer.d.ts.map +1 -1
  26. package/dist/compiler/structure-renderer.js +4 -15
  27. package/dist/compiler/structure-renderer.js.map +1 -1
  28. package/dist/compiler/types.d.ts +2 -10
  29. package/dist/compiler/types.d.ts.map +1 -1
  30. package/dist/compiler/types.js.map +1 -1
  31. package/dist/hooks/index.d.ts +2 -2
  32. package/dist/hooks/index.d.ts.map +1 -1
  33. package/dist/hooks/index.js +2 -2
  34. package/dist/hooks/index.js.map +1 -1
  35. package/dist/hooks/knob.d.ts +12 -0
  36. package/dist/hooks/knob.d.ts.map +1 -1
  37. package/dist/hooks/knob.js +32 -2
  38. package/dist/hooks/knob.js.map +1 -1
  39. package/dist/hooks/knobs-component.d.ts +1 -0
  40. package/dist/hooks/knobs-component.d.ts.map +1 -1
  41. package/dist/hooks/knobs-component.js +5 -1
  42. package/dist/hooks/knobs-component.js.map +1 -1
  43. package/dist/hooks/lifecycle.d.ts +21 -14
  44. package/dist/hooks/lifecycle.d.ts.map +1 -1
  45. package/dist/hooks/lifecycle.js +32 -13
  46. package/dist/hooks/lifecycle.js.map +1 -1
  47. package/dist/hooks/runtime-context.d.ts +12 -1
  48. package/dist/hooks/runtime-context.d.ts.map +1 -1
  49. package/dist/hooks/runtime-context.js +21 -0
  50. package/dist/hooks/runtime-context.js.map +1 -1
  51. package/dist/hooks/types.d.ts +8 -0
  52. package/dist/hooks/types.d.ts.map +1 -1
  53. package/dist/hooks/types.js.map +1 -1
  54. package/dist/index.d.ts +2 -2
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/index.js.map +1 -1
  58. package/dist/jsx/jsx-runtime.d.ts +6 -0
  59. package/dist/jsx/jsx-runtime.d.ts.map +1 -1
  60. package/dist/jsx/jsx-runtime.js.map +1 -1
  61. package/dist/testing/compile-agent.d.ts +4 -3
  62. package/dist/testing/compile-agent.d.ts.map +1 -1
  63. package/dist/testing/compile-agent.js +2 -2
  64. package/dist/testing/compile-agent.js.map +1 -1
  65. package/dist/testing/test-runner.d.ts +7 -7
  66. package/dist/testing/test-runner.js +8 -8
  67. package/dist/tool/tool.d.ts +13 -1
  68. package/dist/tool/tool.d.ts.map +1 -1
  69. package/dist/tool/tool.js +39 -6
  70. package/dist/tool/tool.js.map +1 -1
  71. package/dist/utils/token-estimate.d.ts +4 -3
  72. package/dist/utils/token-estimate.d.ts.map +1 -1
  73. package/dist/utils/token-estimate.js +16 -15
  74. package/dist/utils/token-estimate.js.map +1 -1
  75. 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 what the model sees — replace tool schemas with prose descriptions,
1019
+ // Transform the compiled structure — replace tool schemas with prose descriptions,
987
1020
  // expose a single "execute" tool, restructure sections, anything.
988
- prepareModelInput(compiled, tools) {
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
- | `prepareModelInput` | Transform compiled context before the model sees it | Per tick |
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 |