@vincemakes/kiso-runtime 0.49.0 → 0.50.1

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.
@@ -119,6 +119,10 @@ export interface TaskAdoptOptions {
119
119
  };
120
120
  /** True when the ready line is what promoted it. */
121
121
  readonly ready?: boolean;
122
+ /** 0.50.1: when the command actually started (ms since the epoch) —
123
+ * before its foreground wait, so earlier than this adoption. Required:
124
+ * every caller that adopts has spawned the command and knows when. */
125
+ readonly startedAt: number;
122
126
  /** Stop the command. The owner then reports `ended` or `unconfirmed`. */
123
127
  readonly stop: () => void;
124
128
  }
@@ -164,7 +164,11 @@ export class TaskManager {
164
164
  ...(options.readyWhen !== undefined ? { readyWhen: options.readyWhen } : {}),
165
165
  });
166
166
  appendRecord(journal, { type: "runner_started", ts: Date.now(), pid: options.runner.pid, startedAt: options.runner.startedAt });
167
- appendRecord(journal, { type: "command_started", ts: Date.now() });
167
+ // 0.50.1: an adopted command started before its foreground wait, so
168
+ // its `command_started.ts` is that start and may be EARLIER than
169
+ // `planned.ts`. The append order is still the durability order; the
170
+ // task's runtime counts from this ts (`#info`).
171
+ appendRecord(journal, { type: "command_started", ts: options.startedAt });
168
172
  fsyncDir(dir);
169
173
  if (options.ready === true && options.readyWhen !== undefined) {
170
174
  appendRecord(journal, { type: "ready", ts: Date.now(), match: options.readyWhen });
@@ -483,6 +487,11 @@ export class TaskManager {
483
487
  const planned = records.find((r) => r.type === "planned");
484
488
  const runner = runnerOf(records);
485
489
  const terminal = records.find((r) => r.type === "terminal");
490
+ // 0.50.1: an adopted (foreground) command's runtime counts from its
491
+ // own start, which `command_started` carries; a spawned task's from
492
+ // `planned`, as before. A journal written before 0.50.1 has the
493
+ // adoption time there — the old reading, unchanged.
494
+ const begun = planned?.backend === "foreground" ? records.find((r) => r.type === "command_started")?.ts : undefined;
486
495
  // an adopted task this very process still owns needs no identity
487
496
  // check: the owner is here, holding the child; and an ended task's
488
497
  // verdict is its terminal — identity cannot change it (Windows P6)
@@ -502,7 +511,7 @@ export class TaskManager {
502
511
  ...(planned?.agent !== undefined ? { agent: planned.agent } : {}),
503
512
  state: verdictOf(records, verified),
504
513
  outputPath: join(this.root, id, OUTPUT),
505
- startedAt: planned?.ts ?? 0,
514
+ startedAt: begun ?? planned?.ts ?? 0,
506
515
  ...(terminal !== undefined ? { endedAt: terminal.ts } : {}),
507
516
  ...(claims.length > 0 ? { claims } : {}),
508
517
  ...(collected !== undefined ? { collection: { outcome: collected.outcome, ...(collected.reason !== undefined ? { reason: collected.reason } : {}) } } : {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-runtime",
3
- "version": "0.49.0",
3
+ "version": "0.50.1",
4
4
  "description": "kiso runtime \u2014 durable multi-turn agent sessions: AgentDefinition, AgentRuntime, AgentSession, Run, append-only JSONL store.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,12 +25,12 @@
25
25
  "test": "vitest run"
26
26
  },
27
27
  "dependencies": {
28
- "@vincemakes/kiso-core": "0.49.0"
28
+ "@vincemakes/kiso-core": "0.50.1"
29
29
  },
30
30
  "peerDependencies": {
31
- "@vincemakes/kiso-provider-anthropic": "0.49.0",
32
- "@vincemakes/kiso-provider-openai": "0.49.0",
33
- "@vincemakes/kiso-provider-openai-responses": "0.49.0"
31
+ "@vincemakes/kiso-provider-anthropic": "0.50.1",
32
+ "@vincemakes/kiso-provider-openai": "0.50.1",
33
+ "@vincemakes/kiso-provider-openai-responses": "0.50.1"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "@vincemakes/kiso-provider-anthropic": {
@@ -44,7 +44,7 @@
44
44
  }
45
45
  },
46
46
  "devDependencies": {
47
- "@vincemakes/kiso-evals": "0.49.0",
47
+ "@vincemakes/kiso-evals": "0.50.1",
48
48
  "@types/node": "^26.1.2",
49
49
  "typescript": "^5.7.2",
50
50
  "vitest": "^3.0.0"