@agentshouse/session-content 0.1.0-c27fa9c4d6971 → 0.1.0-cad437697294e

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 CHANGED
@@ -31,3 +31,7 @@ isTurn({ parts, tokens: null, state });
31
31
  ```
32
32
 
33
33
  `isPart`, `isOperation`, `isState` and `isTurn` check a value and narrow its type.
34
+ `isOwn` holds for a part that is the Agent's own rather than a sub-agent's.
35
+ `standingState(state, saved, ended)` is the state a turn saved at `saved` leaves, with nothing
36
+ still running once the process ended at or after it; both instants are UTC ISO text of one
37
+ precision, so they compare as text.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { DIFF_CHARACTERS, FIRST_PART_CHARACTERS, firstPart, keptDiff, lastLines, OUTPUT_CHARACTERS, OUTPUT_LINES, } from './bounds.js';
2
- export { isPart } from './parts.js';
2
+ export { isOwn, isPart } from './parts.js';
3
3
  export type { Call, FileChange, Part, Status } from './parts.js';
4
- export { isState } from './state.js';
4
+ export { isState, standingState } from './state.js';
5
5
  export type { SessionState, Tokens } from './state.js';
6
6
  export { applied, isOperation, isTurn } from './turn.js';
7
7
  export type { Operation, Turn } from './turn.js';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { DIFF_CHARACTERS, FIRST_PART_CHARACTERS, firstPart, keptDiff, lastLines, OUTPUT_CHARACTERS, OUTPUT_LINES, } from './bounds.js';
2
- export { isPart } from './parts.js';
3
- export { isState } from './state.js';
2
+ export { isOwn, isPart } from './parts.js';
3
+ export { isState, standingState } from './state.js';
4
4
  export { applied, isOperation, isTurn } from './turn.js';
package/dist/parts.d.ts CHANGED
@@ -98,4 +98,5 @@ export type Call = Extract<Part, {
98
98
  readonly type: 'call';
99
99
  }>;
100
100
  export declare const isPart: Check<Part>;
101
+ export declare function isOwn(part: Part): boolean;
101
102
  export {};
package/dist/parts.js CHANGED
@@ -63,3 +63,6 @@ const PART = anyOf(exact({ type: oneOf('text', 'reasoning'), parent: PARENT, tex
63
63
  status: STATUS,
64
64
  }));
65
65
  export const isPart = PART;
66
+ export function isOwn(part) {
67
+ return part.parent === null;
68
+ }
package/dist/state.d.ts CHANGED
@@ -57,4 +57,5 @@ declare const STATE: Check<import("./check.js").Shaped<{
57
57
  }>>;
58
58
  export type SessionState = Checked<typeof STATE>;
59
59
  export declare const isState: Check<SessionState>;
60
+ export declare function standingState(state: SessionState, saved: string, ended: string | null): SessionState;
60
61
  export {};
package/dist/state.js CHANGED
@@ -28,3 +28,6 @@ const STATE = exact({
28
28
  })),
29
29
  });
30
30
  export const isState = STATE;
31
+ export function standingState(state, saved, ended) {
32
+ return ended !== null && saved <= ended ? { ...state, running: [] } : state;
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/session-content",
3
- "version": "0.1.0-c27fa9c4d6971",
3
+ "version": "0.1.0-cad437697294e",
4
4
  "description": "Session content: one model of what an agent CLI's session reports, the same for every CLI, with its parser, its fold of a running turn and its bounds on bulk",
5
5
  "license": "MIT",
6
6
  "type": "module",