@akagilnc/pi-workflow-roles 0.1.5207 → 0.1.5212

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.
@@ -1,67 +0,0 @@
1
- const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 183e3;
2
- const STREAM_IDLE_TIMEOUT_CODE = "AK_STREAM_IDLE_TIMEOUT";
3
- class StreamIdleTimeoutError extends Error {
4
- code = STREAM_IDLE_TIMEOUT_CODE;
5
- idleTimeoutMs;
6
- constructor(idleTimeoutMs, options) {
7
- super(`stream idle timeout after ${idleTimeoutMs}ms`, options);
8
- this.name = "StreamIdleTimeoutError";
9
- this.idleTimeoutMs = idleTimeoutMs;
10
- }
11
- }
12
- function isStreamIdleTimeoutError(value) {
13
- return value instanceof StreamIdleTimeoutError || typeof value === "object" && value !== null && value.name === "StreamIdleTimeoutError" && value.code === STREAM_IDLE_TIMEOUT_CODE;
14
- }
15
- function createStreamIdleGuard(options = {}) {
16
- const idleTimeoutMs = options.idleTimeoutMs ?? DEFAULT_STREAM_IDLE_TIMEOUT_MS;
17
- const parentSignal = options.parentSignal;
18
- const controller = new AbortController();
19
- let timer;
20
- let disposed = false;
21
- const clear = () => {
22
- if (timer !== void 0) {
23
- clearTimeout(timer);
24
- timer = void 0;
25
- }
26
- };
27
- const arm = () => {
28
- if (disposed || controller.signal.aborted || idleTimeoutMs <= 0) return;
29
- clear();
30
- timer = setTimeout(() => {
31
- timer = void 0;
32
- if (disposed || controller.signal.aborted) return;
33
- controller.abort(new StreamIdleTimeoutError(idleTimeoutMs));
34
- }, idleTimeoutMs);
35
- };
36
- const onParentAbort = () => {
37
- if (controller.signal.aborted) return;
38
- clear();
39
- controller.abort(parentSignal?.reason);
40
- };
41
- if (parentSignal !== void 0) {
42
- if (parentSignal.aborted) {
43
- controller.abort(parentSignal.reason);
44
- } else {
45
- parentSignal.addEventListener("abort", onParentAbort);
46
- }
47
- }
48
- arm();
49
- return {
50
- signal: controller.signal,
51
- poke() {
52
- arm();
53
- },
54
- dispose() {
55
- disposed = true;
56
- clear();
57
- parentSignal?.removeEventListener("abort", onParentAbort);
58
- }
59
- };
60
- }
61
- export {
62
- DEFAULT_STREAM_IDLE_TIMEOUT_MS,
63
- STREAM_IDLE_TIMEOUT_CODE,
64
- StreamIdleTimeoutError,
65
- createStreamIdleGuard,
66
- isStreamIdleTimeoutError
67
- };
@@ -1,107 +0,0 @@
1
- {
2
- "anyOf": [
3
- {
4
- "type": "object",
5
- "required": [
6
- "role",
7
- "toolCallId",
8
- "toolName",
9
- "timestamp",
10
- "event"
11
- ],
12
- "properties": {
13
- "role": {
14
- "type": "string",
15
- "minLength": 1
16
- },
17
- "toolCallId": {
18
- "type": "string",
19
- "minLength": 1
20
- },
21
- "toolName": {
22
- "type": "string",
23
- "minLength": 1
24
- },
25
- "timestamp": {
26
- "type": "string",
27
- "format": "date-time"
28
- },
29
- "event": {
30
- "type": "string",
31
- "const": "tool_execution_start"
32
- }
33
- },
34
- "additionalProperties": true
35
- },
36
- {
37
- "type": "object",
38
- "required": [
39
- "role",
40
- "toolCallId",
41
- "toolName",
42
- "timestamp",
43
- "event"
44
- ],
45
- "properties": {
46
- "role": {
47
- "type": "string",
48
- "minLength": 1
49
- },
50
- "toolCallId": {
51
- "type": "string",
52
- "minLength": 1
53
- },
54
- "toolName": {
55
- "type": "string",
56
- "minLength": 1
57
- },
58
- "timestamp": {
59
- "type": "string",
60
- "format": "date-time"
61
- },
62
- "event": {
63
- "type": "string",
64
- "const": "tool_execution_update"
65
- }
66
- },
67
- "additionalProperties": true
68
- },
69
- {
70
- "type": "object",
71
- "required": [
72
- "role",
73
- "toolCallId",
74
- "toolName",
75
- "timestamp",
76
- "event",
77
- "isError"
78
- ],
79
- "properties": {
80
- "role": {
81
- "type": "string",
82
- "minLength": 1
83
- },
84
- "toolCallId": {
85
- "type": "string",
86
- "minLength": 1
87
- },
88
- "toolName": {
89
- "type": "string",
90
- "minLength": 1
91
- },
92
- "timestamp": {
93
- "type": "string",
94
- "format": "date-time"
95
- },
96
- "event": {
97
- "type": "string",
98
- "const": "tool_execution_end"
99
- },
100
- "isError": {
101
- "type": "boolean"
102
- }
103
- },
104
- "additionalProperties": true
105
- }
106
- ]
107
- }
@@ -1,7 +0,0 @@
1
- import { writeFile } from "node:fs/promises";
2
- import { toolExecutionObservationRecordSchema } from "../src/tool-execution-observation.ts";
3
-
4
- await writeFile(
5
- new URL("../schemas/tool-execution-observation.schema.json", import.meta.url),
6
- `${JSON.stringify(toolExecutionObservationRecordSchema, null, 2)}\n`,
7
- );
@@ -1 +0,0 @@
1
- export * from "./pi/in-process-session.ts";