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.
- package/CHANGELOG.md +55 -1
- package/README.md +64 -10
- package/package.json +4 -3
- package/src/agent/runtime-context-capabilities.ts +19 -0
- package/src/agent/runtime-context-events.ts +127 -0
- package/src/agent/runtime-context-maintenance.ts +780 -0
- package/src/agent/runtime-interactions.ts +291 -0
- package/src/agent/runtime-prompt-scheduler.ts +182 -0
- package/src/agent/runtime-session-contracts.ts +317 -0
- package/src/agent/runtime-session.ts +253 -2117
- package/src/agent/runtime-skills.ts +544 -0
- package/src/cli/runner-dependencies.ts +6 -5
- package/src/context/context-automation-policy.ts +12 -118
- package/src/events/types.ts +13 -1
- package/src/memory/memory-get-tool.ts +1 -1
- package/src/observation/observation-builder.ts +41 -11
- package/src/session/resume-projection.ts +47 -21
- package/src/session/session-history-access.ts +238 -0
- package/src/session/session-store-context-readers.ts +183 -0
- package/src/session/session-store-ledger-writer.ts +315 -0
- package/src/session/session-store-record-writer.ts +318 -0
- package/src/session/session-store-recovery.ts +225 -0
- package/src/session/session-store-revisions.ts +1004 -0
- package/src/session/session-store-sql.ts +40 -0
- package/src/session/session-store-validation.ts +657 -0
- package/src/session/session-store.ts +756 -3186
- package/src/tools/bash-task.ts +20 -2
- package/src/tools/bash.ts +1 -1
- package/src/tools/context-maintenance.ts +1 -1
- package/src/tools/read.ts +1 -1
- package/src/tools/recall.ts +106 -50
- package/src/tools/registry.ts +4 -6
- package/src/tools/task-output-range.ts +146 -0
- package/src/tools/task-output-tool.ts +35 -5
- package/src/tools/task-output.ts +35 -0
- package/src/tools/task-tool-args.ts +34 -0
- package/src/tools/types.ts +9 -0
- package/src/tools/wait.ts +1 -3
- package/src/tui/event-store.ts +8 -3
package/src/tools/types.ts
CHANGED
|
@@ -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,
|
package/src/tui/event-store.ts
CHANGED
|
@@ -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"
|