tinker-agent 2.7.0 → 2.9.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 (39) hide show
  1. package/CHANGELOG.md +55 -1
  2. package/README.md +64 -10
  3. package/package.json +4 -3
  4. package/src/agent/runtime-context-capabilities.ts +19 -0
  5. package/src/agent/runtime-context-events.ts +127 -0
  6. package/src/agent/runtime-context-maintenance.ts +780 -0
  7. package/src/agent/runtime-interactions.ts +291 -0
  8. package/src/agent/runtime-prompt-scheduler.ts +182 -0
  9. package/src/agent/runtime-session-contracts.ts +317 -0
  10. package/src/agent/runtime-session.ts +253 -2117
  11. package/src/agent/runtime-skills.ts +544 -0
  12. package/src/cli/runner-dependencies.ts +6 -5
  13. package/src/context/context-automation-policy.ts +12 -118
  14. package/src/events/types.ts +13 -1
  15. package/src/memory/memory-get-tool.ts +1 -1
  16. package/src/observation/observation-builder.ts +41 -11
  17. package/src/session/resume-projection.ts +47 -21
  18. package/src/session/session-history-access.ts +238 -0
  19. package/src/session/session-store-context-readers.ts +183 -0
  20. package/src/session/session-store-ledger-writer.ts +315 -0
  21. package/src/session/session-store-record-writer.ts +318 -0
  22. package/src/session/session-store-recovery.ts +225 -0
  23. package/src/session/session-store-revisions.ts +1004 -0
  24. package/src/session/session-store-sql.ts +40 -0
  25. package/src/session/session-store-validation.ts +657 -0
  26. package/src/session/session-store.ts +756 -3186
  27. package/src/tools/bash-task.ts +20 -2
  28. package/src/tools/bash.ts +1 -1
  29. package/src/tools/context-maintenance.ts +1 -1
  30. package/src/tools/read.ts +1 -1
  31. package/src/tools/recall.ts +106 -50
  32. package/src/tools/registry.ts +4 -6
  33. package/src/tools/task-output-range.ts +146 -0
  34. package/src/tools/task-output-tool.ts +35 -5
  35. package/src/tools/task-output.ts +35 -0
  36. package/src/tools/task-tool-args.ts +34 -0
  37. package/src/tools/types.ts +9 -0
  38. package/src/tools/wait.ts +1 -3
  39. package/src/tui/event-store.ts +8 -3
@@ -9,6 +9,7 @@ import type {
9
9
  } from "../session/session-history-reader";
10
10
  import type { ShellTaskSnapshot, ShellTaskStatus } from "./bash-task";
11
11
  import type { SkillScope } from "../skills/skill-loader";
12
+ import type { TaskOutputRange } from "./task-output-range";
12
13
 
13
14
  export type JsonSchema = Record<string, unknown>;
14
15
 
@@ -173,6 +174,7 @@ export type UpdatePlanRawResult =
173
174
  };
174
175
 
175
176
  export type TaskOutputRawResult = {
177
+ range?: TaskOutputRange;
176
178
  ok: boolean;
177
179
  taskId: string;
178
180
  task?: ShellTaskSnapshot;
@@ -273,6 +275,7 @@ export type GenericToolRawResult = {
273
275
  };
274
276
 
275
277
  export type RecallToolErrorCode =
278
+ | import("../session/session-history-access").RecallSessionErrorCode
276
279
  | "RECALL_ARGS_INVALID"
277
280
  | "RECALL_SOURCE_INVALID"
278
281
  | "RECALL_SOURCE_NOT_FOUND"
@@ -284,6 +287,9 @@ export type RecallSearchRawResult =
284
287
  ok: true;
285
288
  mode: "search";
286
289
  historical: true;
290
+ /** Optional only for persisted results produced before session selection. */
291
+ sessionId?: SessionId;
292
+ workspaceRoot?: string;
287
293
  query: string;
288
294
  filters: RecallSearchFilters;
289
295
  page: RecallSearchPage;
@@ -300,6 +306,9 @@ export type RecallGetRawResult =
300
306
  ok: true;
301
307
  mode: "get";
302
308
  historical: true;
309
+ /** Optional only for persisted results produced before session selection. */
310
+ sessionId?: SessionId;
311
+ workspaceRoot?: string;
303
312
  page: RecallGetPage;
304
313
  }
305
314
  | {
package/src/tools/wait.ts CHANGED
@@ -13,9 +13,7 @@ export function createWaitToolExecutor(): ToolExecutor {
13
13
  return defineToolExecutor("wait", {
14
14
  definition: {
15
15
  name: "Wait",
16
- description:
17
- `Wait for a given number of integer seconds before continuing, from ${MIN_WAIT_SECONDS} to ${MAX_WAIT_SECONDS}. ` +
18
- "Use this to pause between polling attempts or to give an external process time to make progress.",
16
+ description: `Wait for a given number of integer seconds before continuing, from ${MIN_WAIT_SECONDS} to ${MAX_WAIT_SECONDS}. `,
19
17
  parameters: {
20
18
  type: "object",
21
19
  additionalProperties: false,
@@ -922,13 +922,18 @@ function toolRawResultSummary(name: string, args: unknown, raw: ToolRawResult):
922
922
  return raw.route === undefined
923
923
  ? base
924
924
  : `${base} -> ok (${raw.route}${raw.refined === true ? ", refined" : ""})`;
925
- case "recall":
925
+ case "recall": {
926
926
  if (!raw.ok) {
927
927
  return base;
928
928
  }
929
+ const provenance =
930
+ raw.sessionId === undefined
931
+ ? ""
932
+ : ` [session=${raw.sessionId}, workspace=${raw.workspaceRoot ?? "unknown"}]`;
929
933
  return raw.mode === "search"
930
- ? `${base} -> ${raw.page.hits.length} historical match${raw.page.hits.length === 1 ? "" : "es"}`
931
- : `${base} -> ${raw.page.returnedBytes} historical bytes`;
934
+ ? `${base} -> ${raw.page.hits.length} historical match${raw.page.hits.length === 1 ? "" : "es"}${provenance}`
935
+ : `${base} -> ${raw.page.returnedBytes} historical bytes${provenance}`;
936
+ }
932
937
  case "context_maintenance":
933
938
  if (!raw.ok) {
934
939
  return raw.operation === "swap"