@shipfox/api-logs-dto 10.2.0 → 16.0.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/events.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inter-module.d.ts +132 -0
- package/dist/inter-module.d.ts.map +1 -0
- package/dist/inter-module.js +54 -0
- package/dist/inter-module.js.map +1 -0
- package/dist/schemas/append.d.ts +6 -1
- package/dist/schemas/append.d.ts.map +1 -1
- package/dist/schemas/append.js +4 -1
- package/dist/schemas/append.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +2 -2
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/read.d.ts +1 -1
- package/dist/schemas/read.d.ts.map +1 -1
- package/dist/schemas/read.js +1 -1
- package/dist/schemas/read.js.map +1 -1
- package/dist/schemas/record.d.ts +116 -27
- package/dist/schemas/record.d.ts.map +1 -1
- package/dist/schemas/record.js +9 -5
- package/dist/schemas/record.js.map +1 -1
- package/dist/schemas/session-view.d.ts +21 -21
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +7 -2
- package/src/index.ts +4 -0
- package/src/inter-module.test.ts +69 -0
- package/src/inter-module.ts +69 -0
- package/src/schemas/append.ts +8 -1
- package/src/schemas/index.ts +4 -0
- package/src/schemas/read.ts +3 -1
- package/src/schemas/record.ts +12 -4
- package/tsconfig.build.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
$ shipfox-swc
|
|
2
|
-
Successfully compiled:
|
|
2
|
+
Successfully compiled: 8 files with swc (265.13ms)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @shipfox/api-logs-dto
|
|
2
2
|
|
|
3
|
+
## 16.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 64155fb: Adds the server-origin log append contract and enforces bounded, validated writes.
|
|
8
|
+
|
|
9
|
+
## 12.0.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- f78740d: Remove Unicode dash punctuation from package prose and source comments.
|
|
14
|
+
|
|
3
15
|
## 10.2.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/events.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { LOG_STREAM_CLOSED, type LogStreamClosedEvent, type LogsEventMap, logStreamClosedEventSchema, logsEventSchemas, } from './events.js';
|
|
2
|
-
export { type AppendLogsQueryDto, type AppendLogsResponseDto, appendLogsQuerySchema, appendLogsResponseSchema, type LogRecord, logRecordSchema, MAX_RECORD_DATA_BYTES, MAX_RECORD_NAME_BYTES, type OffsetGapResponseDto, offsetGapResponseSchema, parseLogRecordLine, parseRawLogRecordLine, type RawLogRecord, type ReadLogsQueryDto, type ReadLogsResponseDto, rawLogRecordSchema, readLogsQuerySchema, readLogsResponseSchema, SESSION_VIEW_VERSION, type SessionViewDto, type SessionViewLifecycleRow, type SessionViewMessageRow, type SessionViewRawRow, type SessionViewRow, type SessionViewRowMeta, type SessionViewThinkingRow, type SessionViewToolCallRow, type SessionViewToolResultRow, sessionViewLifecycleRowSchema, sessionViewMessageRowSchema, sessionViewRawRowSchema, sessionViewRowMetaSchema, sessionViewRowSchema, sessionViewSchema, sessionViewThinkingRowSchema, sessionViewToolCallRowSchema, sessionViewToolResultRowSchema, } from './schemas/index.js';
|
|
2
|
+
export { type AppendLogsQueryDto, type AppendLogsResponseDto, appendLogsQuerySchema, appendLogsResponseSchema, type LogRecord, type LogWriterConflictResponseDto, logRecordSchema, logWriterConflictResponseSchema, MAX_RECORD_DATA_BYTES, MAX_RECORD_NAME_BYTES, type OffsetGapResponseDto, offsetGapResponseSchema, parseLogRecordLine, parseRawLogRecordLine, type RawLogRecord, type ReadLogsQueryDto, type ReadLogsResponseDto, rawLogRecordSchema, readLogsQuerySchema, readLogsResponseSchema, SESSION_VIEW_VERSION, type ServerLogRecord, type SessionViewDto, type SessionViewLifecycleRow, type SessionViewMessageRow, type SessionViewRawRow, type SessionViewRow, type SessionViewRowMeta, type SessionViewThinkingRow, type SessionViewToolCallRow, type SessionViewToolResultRow, serverLogRecordSchema, sessionViewLifecycleRowSchema, sessionViewMessageRowSchema, sessionViewRawRowSchema, sessionViewRowMetaSchema, sessionViewRowSchema, sessionViewSchema, sessionViewThinkingRowSchema, sessionViewToolCallRowSchema, sessionViewToolResultRowSchema, } from './schemas/index.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,SAAS,EACd,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,4BAA4B,EAC5B,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,SAAS,EACd,KAAK,4BAA4B,EACjC,eAAe,EACf,+BAA+B,EAC/B,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,4BAA4B,EAC5B,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { LOG_STREAM_CLOSED, logStreamClosedEventSchema, logsEventSchemas } from './events.js';
|
|
2
|
-
export { appendLogsQuerySchema, appendLogsResponseSchema, logRecordSchema, MAX_RECORD_DATA_BYTES, MAX_RECORD_NAME_BYTES, offsetGapResponseSchema, parseLogRecordLine, parseRawLogRecordLine, rawLogRecordSchema, readLogsQuerySchema, readLogsResponseSchema, SESSION_VIEW_VERSION, sessionViewLifecycleRowSchema, sessionViewMessageRowSchema, sessionViewRawRowSchema, sessionViewRowMetaSchema, sessionViewRowSchema, sessionViewSchema, sessionViewThinkingRowSchema, sessionViewToolCallRowSchema, sessionViewToolResultRowSchema } from './schemas/index.js';
|
|
2
|
+
export { appendLogsQuerySchema, appendLogsResponseSchema, logRecordSchema, logWriterConflictResponseSchema, MAX_RECORD_DATA_BYTES, MAX_RECORD_NAME_BYTES, offsetGapResponseSchema, parseLogRecordLine, parseRawLogRecordLine, rawLogRecordSchema, readLogsQuerySchema, readLogsResponseSchema, SESSION_VIEW_VERSION, serverLogRecordSchema, sessionViewLifecycleRowSchema, sessionViewMessageRowSchema, sessionViewRawRowSchema, sessionViewRowMetaSchema, sessionViewRowSchema, sessionViewSchema, sessionViewThinkingRowSchema, sessionViewToolCallRowSchema, sessionViewToolResultRowSchema } from './schemas/index.js';
|
|
3
3
|
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n LOG_STREAM_CLOSED,\n type LogStreamClosedEvent,\n type LogsEventMap,\n logStreamClosedEventSchema,\n logsEventSchemas,\n} from './events.js';\nexport {\n type AppendLogsQueryDto,\n type AppendLogsResponseDto,\n appendLogsQuerySchema,\n appendLogsResponseSchema,\n type LogRecord,\n logRecordSchema,\n MAX_RECORD_DATA_BYTES,\n MAX_RECORD_NAME_BYTES,\n type OffsetGapResponseDto,\n offsetGapResponseSchema,\n parseLogRecordLine,\n parseRawLogRecordLine,\n type RawLogRecord,\n type ReadLogsQueryDto,\n type ReadLogsResponseDto,\n rawLogRecordSchema,\n readLogsQuerySchema,\n readLogsResponseSchema,\n SESSION_VIEW_VERSION,\n type SessionViewDto,\n type SessionViewLifecycleRow,\n type SessionViewMessageRow,\n type SessionViewRawRow,\n type SessionViewRow,\n type SessionViewRowMeta,\n type SessionViewThinkingRow,\n type SessionViewToolCallRow,\n type SessionViewToolResultRow,\n sessionViewLifecycleRowSchema,\n sessionViewMessageRowSchema,\n sessionViewRawRowSchema,\n sessionViewRowMetaSchema,\n sessionViewRowSchema,\n sessionViewSchema,\n sessionViewThinkingRowSchema,\n sessionViewToolCallRowSchema,\n sessionViewToolResultRowSchema,\n} from './schemas/index.js';\n"],"names":["LOG_STREAM_CLOSED","logStreamClosedEventSchema","logsEventSchemas","appendLogsQuerySchema","appendLogsResponseSchema","logRecordSchema","MAX_RECORD_DATA_BYTES","MAX_RECORD_NAME_BYTES","offsetGapResponseSchema","parseLogRecordLine","parseRawLogRecordLine","rawLogRecordSchema","readLogsQuerySchema","readLogsResponseSchema","SESSION_VIEW_VERSION","sessionViewLifecycleRowSchema","sessionViewMessageRowSchema","sessionViewRawRowSchema","sessionViewRowMetaSchema","sessionViewRowSchema","sessionViewSchema","sessionViewThinkingRowSchema","sessionViewToolCallRowSchema","sessionViewToolResultRowSchema"],"mappings":"AAAA,SACEA,iBAAiB,EAGjBC,0BAA0B,EAC1BC,gBAAgB,QACX,cAAc;AACrB,SAGEC,qBAAqB,EACrBC,wBAAwB,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n LOG_STREAM_CLOSED,\n type LogStreamClosedEvent,\n type LogsEventMap,\n logStreamClosedEventSchema,\n logsEventSchemas,\n} from './events.js';\nexport {\n type AppendLogsQueryDto,\n type AppendLogsResponseDto,\n appendLogsQuerySchema,\n appendLogsResponseSchema,\n type LogRecord,\n type LogWriterConflictResponseDto,\n logRecordSchema,\n logWriterConflictResponseSchema,\n MAX_RECORD_DATA_BYTES,\n MAX_RECORD_NAME_BYTES,\n type OffsetGapResponseDto,\n offsetGapResponseSchema,\n parseLogRecordLine,\n parseRawLogRecordLine,\n type RawLogRecord,\n type ReadLogsQueryDto,\n type ReadLogsResponseDto,\n rawLogRecordSchema,\n readLogsQuerySchema,\n readLogsResponseSchema,\n SESSION_VIEW_VERSION,\n type ServerLogRecord,\n type SessionViewDto,\n type SessionViewLifecycleRow,\n type SessionViewMessageRow,\n type SessionViewRawRow,\n type SessionViewRow,\n type SessionViewRowMeta,\n type SessionViewThinkingRow,\n type SessionViewToolCallRow,\n type SessionViewToolResultRow,\n serverLogRecordSchema,\n sessionViewLifecycleRowSchema,\n sessionViewMessageRowSchema,\n sessionViewRawRowSchema,\n sessionViewRowMetaSchema,\n sessionViewRowSchema,\n sessionViewSchema,\n sessionViewThinkingRowSchema,\n sessionViewToolCallRowSchema,\n sessionViewToolResultRowSchema,\n} from './schemas/index.js';\n"],"names":["LOG_STREAM_CLOSED","logStreamClosedEventSchema","logsEventSchemas","appendLogsQuerySchema","appendLogsResponseSchema","logRecordSchema","logWriterConflictResponseSchema","MAX_RECORD_DATA_BYTES","MAX_RECORD_NAME_BYTES","offsetGapResponseSchema","parseLogRecordLine","parseRawLogRecordLine","rawLogRecordSchema","readLogsQuerySchema","readLogsResponseSchema","SESSION_VIEW_VERSION","serverLogRecordSchema","sessionViewLifecycleRowSchema","sessionViewMessageRowSchema","sessionViewRawRowSchema","sessionViewRowMetaSchema","sessionViewRowSchema","sessionViewSchema","sessionViewThinkingRowSchema","sessionViewToolCallRowSchema","sessionViewToolResultRowSchema"],"mappings":"AAAA,SACEA,iBAAiB,EAGjBC,0BAA0B,EAC1BC,gBAAgB,QACX,cAAc;AACrB,SAGEC,qBAAqB,EACrBC,wBAAwB,EAGxBC,eAAe,EACfC,+BAA+B,EAC/BC,qBAAqB,EACrBC,qBAAqB,EAErBC,uBAAuB,EACvBC,kBAAkB,EAClBC,qBAAqB,EAIrBC,kBAAkB,EAClBC,mBAAmB,EACnBC,sBAAsB,EACtBC,oBAAoB,EAWpBC,qBAAqB,EACrBC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,uBAAuB,EACvBC,wBAAwB,EACxBC,oBAAoB,EACpBC,iBAAiB,EACjBC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,8BAA8B,QACzB,qBAAqB"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { type InterModuleClient } from '@shipfox/inter-module';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Producer-owned Logs commands used by synchronous callers. The only method
|
|
5
|
+
* today is the server-origin append for server-executed steps (the tool step
|
|
6
|
+
* executor): it writes already-normalized stored records through the same
|
|
7
|
+
* offset-CAS and budget pipeline as the lease-bound runner route, but with
|
|
8
|
+
* chunk `origin` `server` and a tail-derived CAS offset (the caller owns no
|
|
9
|
+
* spool cursor). This is a trusted internal boundary, not an authorization
|
|
10
|
+
* boundary: the caller must derive the identity fields from its execution
|
|
11
|
+
* context rather than pass through arbitrary external input.
|
|
12
|
+
*/
|
|
13
|
+
export declare const logsInterModuleContract: import("@shipfox/inter-module").InterModuleContract<{
|
|
14
|
+
readonly module: "logs";
|
|
15
|
+
readonly methods: {
|
|
16
|
+
appendServerRecords: {
|
|
17
|
+
input: z.ZodObject<{
|
|
18
|
+
jobId: z.ZodString;
|
|
19
|
+
workspaceId: z.ZodString;
|
|
20
|
+
projectId: z.ZodString;
|
|
21
|
+
workflowRunAttemptId: z.ZodString;
|
|
22
|
+
stepId: z.ZodString;
|
|
23
|
+
attempt: z.ZodNumber;
|
|
24
|
+
records: z.ZodArray<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
25
|
+
v: z.ZodLiteral<1>;
|
|
26
|
+
ts: z.ZodNumber;
|
|
27
|
+
type: z.ZodLiteral<"output">;
|
|
28
|
+
stream: z.ZodEnum<{
|
|
29
|
+
stderr: "stderr";
|
|
30
|
+
stdout: "stdout";
|
|
31
|
+
}>;
|
|
32
|
+
data: z.ZodString;
|
|
33
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
+
v: z.ZodLiteral<1>;
|
|
35
|
+
ts: z.ZodNumber;
|
|
36
|
+
type: z.ZodLiteral<"group_start">;
|
|
37
|
+
group_id: z.ZodString;
|
|
38
|
+
parent_group_id: z.ZodNullable<z.ZodString>;
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
+
v: z.ZodLiteral<1>;
|
|
42
|
+
ts: z.ZodNumber;
|
|
43
|
+
type: z.ZodLiteral<"group_end">;
|
|
44
|
+
group_id: z.ZodString;
|
|
45
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
46
|
+
v: z.ZodLiteral<1>;
|
|
47
|
+
ts: z.ZodNumber;
|
|
48
|
+
type: z.ZodLiteral<"end">;
|
|
49
|
+
total_bytes: z.ZodNumber;
|
|
50
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
+
v: z.ZodLiteral<1>;
|
|
52
|
+
ts: z.ZodNumber;
|
|
53
|
+
type: z.ZodLiteral<"gap">;
|
|
54
|
+
dropped_bytes: z.ZodNumber;
|
|
55
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
+
v: z.ZodLiteral<1>;
|
|
57
|
+
ts: z.ZodNumber;
|
|
58
|
+
type: z.ZodLiteral<"agent_session">;
|
|
59
|
+
row: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
60
|
+
timestamp: z.ZodNumber;
|
|
61
|
+
kind: z.ZodLiteral<"message">;
|
|
62
|
+
role: z.ZodString;
|
|
63
|
+
label: z.ZodString;
|
|
64
|
+
meta: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
65
|
+
label: z.ZodString;
|
|
66
|
+
value: z.ZodString;
|
|
67
|
+
inline: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
}, z.core.$strip>>>;
|
|
69
|
+
text: z.ZodString;
|
|
70
|
+
terminalFailure: z.ZodBoolean;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
timestamp: z.ZodNumber;
|
|
73
|
+
kind: z.ZodLiteral<"thinking">;
|
|
74
|
+
text: z.ZodString;
|
|
75
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
76
|
+
timestamp: z.ZodNumber;
|
|
77
|
+
kind: z.ZodLiteral<"tool-call">;
|
|
78
|
+
id: z.ZodNullable<z.ZodString>;
|
|
79
|
+
name: z.ZodString;
|
|
80
|
+
input: z.ZodString;
|
|
81
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
+
timestamp: z.ZodNumber;
|
|
84
|
+
kind: z.ZodLiteral<"tool-result">;
|
|
85
|
+
toolCallId: z.ZodNullable<z.ZodString>;
|
|
86
|
+
toolName: z.ZodString;
|
|
87
|
+
output: z.ZodString;
|
|
88
|
+
isError: z.ZodBoolean;
|
|
89
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
90
|
+
timestamp: z.ZodNumber;
|
|
91
|
+
kind: z.ZodLiteral<"lifecycle">;
|
|
92
|
+
label: z.ZodString;
|
|
93
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
94
|
+
meta: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
95
|
+
label: z.ZodString;
|
|
96
|
+
value: z.ZodString;
|
|
97
|
+
inline: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
+
}, z.core.$strip>>>;
|
|
99
|
+
tone: z.ZodEnum<{
|
|
100
|
+
default: "default";
|
|
101
|
+
error: "error";
|
|
102
|
+
warning: "warning";
|
|
103
|
+
}>;
|
|
104
|
+
terminalFailure: z.ZodBoolean;
|
|
105
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
106
|
+
timestamp: z.ZodNumber;
|
|
107
|
+
kind: z.ZodLiteral<"raw">;
|
|
108
|
+
label: z.ZodString;
|
|
109
|
+
raw: z.ZodString;
|
|
110
|
+
}, z.core.$strip>], "kind">;
|
|
111
|
+
}, z.core.$strip>], "type">>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
output: z.ZodObject<{
|
|
114
|
+
committedLength: z.ZodNumber;
|
|
115
|
+
capped: z.ZodBoolean;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
errors: {
|
|
118
|
+
'lease-stream-mismatch': z.ZodObject<{}, z.core.$strip>;
|
|
119
|
+
'malformed-log-chunk': z.ZodObject<{}, z.core.$strip>;
|
|
120
|
+
'append-body-too-large': z.ZodObject<{
|
|
121
|
+
maxBytes: z.ZodNumber;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
'runner-writer-active': z.ZodObject<{}, z.core.$strip>;
|
|
124
|
+
'offset-gap': z.ZodObject<{
|
|
125
|
+
committedLength: z.ZodNumber;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
}>;
|
|
131
|
+
export type LogsModuleClient = InterModuleClient<typeof logsInterModuleContract>;
|
|
132
|
+
//# sourceMappingURL=inter-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inter-module.d.ts","sourceRoot":"","sources":["../src/inter-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB;;;QAGhC,mBAAmB;YACjB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAuBL,MAAM;;;;YAcN,MAAM;gBACJ,uBAAuB;gBACvB,qBAAqB;gBACrB,uBAAuB;;;gBACvB,sBAAsB;gBACtB,YAAY;;;;;;EAIlB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineInterModuleContract } from '@shipfox/inter-module';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { serverLogRecordSchema } from './schemas/index.js';
|
|
4
|
+
const idSchema = z.string().uuid();
|
|
5
|
+
/**
|
|
6
|
+
* Producer-owned Logs commands used by synchronous callers. The only method
|
|
7
|
+
* today is the server-origin append for server-executed steps (the tool step
|
|
8
|
+
* executor): it writes already-normalized stored records through the same
|
|
9
|
+
* offset-CAS and budget pipeline as the lease-bound runner route, but with
|
|
10
|
+
* chunk `origin` `server` and a tail-derived CAS offset (the caller owns no
|
|
11
|
+
* spool cursor). This is a trusted internal boundary, not an authorization
|
|
12
|
+
* boundary: the caller must derive the identity fields from its execution
|
|
13
|
+
* context rather than pass through arbitrary external input.
|
|
14
|
+
*/ export const logsInterModuleContract = defineInterModuleContract({
|
|
15
|
+
module: 'logs',
|
|
16
|
+
methods: {
|
|
17
|
+
appendServerRecords: {
|
|
18
|
+
input: z.object({
|
|
19
|
+
jobId: idSchema,
|
|
20
|
+
workspaceId: idSchema,
|
|
21
|
+
projectId: idSchema,
|
|
22
|
+
workflowRunAttemptId: idSchema,
|
|
23
|
+
stepId: idSchema,
|
|
24
|
+
attempt: z.number().int().min(1).max(2_147_483_647).describe('Attempt number of the step this batch belongs to.'),
|
|
25
|
+
/**
|
|
26
|
+
* Already-normalized server-writable stored records (the read union
|
|
27
|
+
* without server-only tombstones), serialized to whole newline-terminated
|
|
28
|
+
* NDJSON lines on ingest. Server-origin records skip the raw-to-stored
|
|
29
|
+
* normalization the runner path applies: they are stored verbatim. Callers should
|
|
30
|
+
* coalesce records into batches up to (but never over) `LOG_APPEND_BODY_LIMIT_BYTES`;
|
|
31
|
+
* an empty batch is reserved for a heartbeat. A server-origin writer owns its stream;
|
|
32
|
+
* it cannot be mixed with a lease-bound runner writer because their byte cursors differ.
|
|
33
|
+
*/ records: z.array(serverLogRecordSchema)
|
|
34
|
+
}),
|
|
35
|
+
output: z.object({
|
|
36
|
+
committedLength: z.number().int().min(0).describe('New server-held byte position of the stream after this batch was applied (the tail the next call continues from).'),
|
|
37
|
+
capped: z.boolean().describe('When true, the per-job log budget is exhausted and further output is dropped.')
|
|
38
|
+
}),
|
|
39
|
+
errors: {
|
|
40
|
+
'lease-stream-mismatch': z.object({}),
|
|
41
|
+
'malformed-log-chunk': z.object({}),
|
|
42
|
+
'append-body-too-large': z.object({
|
|
43
|
+
maxBytes: z.number().int().positive()
|
|
44
|
+
}),
|
|
45
|
+
'runner-writer-active': z.object({}),
|
|
46
|
+
'offset-gap': z.object({
|
|
47
|
+
committedLength: z.number().int().nonnegative()
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=inter-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/inter-module.ts"],"sourcesContent":["import {defineInterModuleContract, type InterModuleClient} from '@shipfox/inter-module';\nimport {z} from 'zod';\nimport {serverLogRecordSchema} from './schemas/index.js';\n\nconst idSchema = z.string().uuid();\n\n/**\n * Producer-owned Logs commands used by synchronous callers. The only method\n * today is the server-origin append for server-executed steps (the tool step\n * executor): it writes already-normalized stored records through the same\n * offset-CAS and budget pipeline as the lease-bound runner route, but with\n * chunk `origin` `server` and a tail-derived CAS offset (the caller owns no\n * spool cursor). This is a trusted internal boundary, not an authorization\n * boundary: the caller must derive the identity fields from its execution\n * context rather than pass through arbitrary external input.\n */\nexport const logsInterModuleContract = defineInterModuleContract({\n module: 'logs',\n methods: {\n appendServerRecords: {\n input: z.object({\n jobId: idSchema,\n workspaceId: idSchema,\n projectId: idSchema,\n workflowRunAttemptId: idSchema,\n stepId: idSchema,\n attempt: z\n .number()\n .int()\n .min(1)\n .max(2_147_483_647)\n .describe('Attempt number of the step this batch belongs to.'),\n /**\n * Already-normalized server-writable stored records (the read union\n * without server-only tombstones), serialized to whole newline-terminated\n * NDJSON lines on ingest. Server-origin records skip the raw-to-stored\n * normalization the runner path applies: they are stored verbatim. Callers should\n * coalesce records into batches up to (but never over) `LOG_APPEND_BODY_LIMIT_BYTES`;\n * an empty batch is reserved for a heartbeat. A server-origin writer owns its stream;\n * it cannot be mixed with a lease-bound runner writer because their byte cursors differ.\n */\n records: z.array(serverLogRecordSchema),\n }),\n output: z.object({\n committedLength: z\n .number()\n .int()\n .min(0)\n .describe(\n 'New server-held byte position of the stream after this batch was applied (the tail the next call continues from).',\n ),\n capped: z\n .boolean()\n .describe(\n 'When true, the per-job log budget is exhausted and further output is dropped.',\n ),\n }),\n errors: {\n 'lease-stream-mismatch': z.object({}),\n 'malformed-log-chunk': z.object({}),\n 'append-body-too-large': z.object({maxBytes: z.number().int().positive()}),\n 'runner-writer-active': z.object({}),\n 'offset-gap': z.object({committedLength: z.number().int().nonnegative()}),\n },\n },\n },\n});\n\nexport type LogsModuleClient = InterModuleClient<typeof logsInterModuleContract>;\n"],"names":["defineInterModuleContract","z","serverLogRecordSchema","idSchema","string","uuid","logsInterModuleContract","module","methods","appendServerRecords","input","object","jobId","workspaceId","projectId","workflowRunAttemptId","stepId","attempt","number","int","min","max","describe","records","array","output","committedLength","capped","boolean","errors","maxBytes","positive","nonnegative"],"mappings":"AAAA,SAAQA,yBAAyB,QAA+B,wBAAwB;AACxF,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,qBAAqB,QAAO,qBAAqB;AAEzD,MAAMC,WAAWF,EAAEG,MAAM,GAAGC,IAAI;AAEhC;;;;;;;;;CASC,GACD,OAAO,MAAMC,0BAA0BN,0BAA0B;IAC/DO,QAAQ;IACRC,SAAS;QACPC,qBAAqB;YACnBC,OAAOT,EAAEU,MAAM,CAAC;gBACdC,OAAOT;gBACPU,aAAaV;gBACbW,WAAWX;gBACXY,sBAAsBZ;gBACtBa,QAAQb;gBACRc,SAAShB,EACNiB,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJC,GAAG,CAAC,eACJC,QAAQ,CAAC;gBACZ;;;;;;;;SAQC,GACDC,SAAStB,EAAEuB,KAAK,CAACtB;YACnB;YACAuB,QAAQxB,EAAEU,MAAM,CAAC;gBACfe,iBAAiBzB,EACdiB,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJE,QAAQ,CACP;gBAEJK,QAAQ1B,EACL2B,OAAO,GACPN,QAAQ,CACP;YAEN;YACAO,QAAQ;gBACN,yBAAyB5B,EAAEU,MAAM,CAAC,CAAC;gBACnC,uBAAuBV,EAAEU,MAAM,CAAC,CAAC;gBACjC,yBAAyBV,EAAEU,MAAM,CAAC;oBAACmB,UAAU7B,EAAEiB,MAAM,GAAGC,GAAG,GAAGY,QAAQ;gBAAE;gBACxE,wBAAwB9B,EAAEU,MAAM,CAAC,CAAC;gBAClC,cAAcV,EAAEU,MAAM,CAAC;oBAACe,iBAAiBzB,EAAEiB,MAAM,GAAGC,GAAG,GAAGa,WAAW;gBAAE;YACzE;QACF;IACF;AACF,GAAG"}
|
package/dist/schemas/append.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
* Append endpoint contract: `POST .../steps/:stepId/logs?attempt=N&offset=B`.
|
|
4
4
|
*
|
|
5
5
|
* The body is raw NDJSON bytes (whole records, newline-terminated), not a
|
|
6
|
-
* Zod-validated object
|
|
6
|
+
* Zod-validated object: it is parsed line by line against the raw log record
|
|
7
7
|
* union (`rawLogRecordSchema`). `offset` is a position in the raw
|
|
8
8
|
* NDJSON spool stream; both `offset` and the returned `committed_length` are
|
|
9
9
|
* bounded far below 2^53 by the accrual budget, so JavaScript `number` is safe.
|
|
@@ -26,4 +26,9 @@ export declare const offsetGapResponseSchema: z.ZodObject<{
|
|
|
26
26
|
}, z.core.$strip>;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
28
|
export type OffsetGapResponseDto = z.infer<typeof offsetGapResponseSchema>;
|
|
29
|
+
/** A lease append was attempted on a stream owned by a server-origin writer. */
|
|
30
|
+
export declare const logWriterConflictResponseSchema: z.ZodObject<{
|
|
31
|
+
code: z.ZodLiteral<"log-writer-conflict">;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type LogWriterConflictResponseDto = z.infer<typeof logWriterConflictResponseSchema>;
|
|
29
34
|
//# sourceMappingURL=append.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"append.d.ts","sourceRoot":"","sources":["../../src/schemas/append.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;iBAchC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,eAAO,MAAM,wBAAwB;;;iBASnC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE7E,yFAAyF;AACzF,eAAO,MAAM,uBAAuB;;;;;iBASlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"append.d.ts","sourceRoot":"","sources":["../../src/schemas/append.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;iBAchC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,eAAO,MAAM,wBAAwB;;;iBASnC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE7E,yFAAyF;AACzF,eAAO,MAAM,uBAAuB;;;;;iBASlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E,gFAAgF;AAChF,eAAO,MAAM,+BAA+B;;iBAE1C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
|
package/dist/schemas/append.js
CHANGED
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
* Append endpoint contract: `POST .../steps/:stepId/logs?attempt=N&offset=B`.
|
|
4
4
|
*
|
|
5
5
|
* The body is raw NDJSON bytes (whole records, newline-terminated), not a
|
|
6
|
-
* Zod-validated object
|
|
6
|
+
* Zod-validated object: it is parsed line by line against the raw log record
|
|
7
7
|
* union (`rawLogRecordSchema`). `offset` is a position in the raw
|
|
8
8
|
* NDJSON spool stream; both `offset` and the returned `committed_length` are
|
|
9
9
|
* bounded far below 2^53 by the accrual budget, so JavaScript `number` is safe.
|
|
@@ -21,5 +21,8 @@ export const appendLogsResponseSchema = z.object({
|
|
|
21
21
|
committed_length: z.number().int().min(0).describe('Current server-held committed length the runner should rewind to.')
|
|
22
22
|
})
|
|
23
23
|
});
|
|
24
|
+
/** A lease append was attempted on a stream owned by a server-origin writer. */ export const logWriterConflictResponseSchema = z.object({
|
|
25
|
+
code: z.literal('log-writer-conflict')
|
|
26
|
+
});
|
|
24
27
|
|
|
25
28
|
//# sourceMappingURL=append.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schemas/append.ts"],"sourcesContent":["import {z} from 'zod';\n\n/**\n * Append endpoint contract: `POST .../steps/:stepId/logs?attempt=N&offset=B`.\n *\n * The body is raw NDJSON bytes (whole records, newline-terminated), not a\n * Zod-validated object
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/append.ts"],"sourcesContent":["import {z} from 'zod';\n\n/**\n * Append endpoint contract: `POST .../steps/:stepId/logs?attempt=N&offset=B`.\n *\n * The body is raw NDJSON bytes (whole records, newline-terminated), not a\n * Zod-validated object: it is parsed line by line against the raw log record\n * union (`rawLogRecordSchema`). `offset` is a position in the raw\n * NDJSON spool stream; both `offset` and the returned `committed_length` are\n * bounded far below 2^53 by the accrual budget, so JavaScript `number` is safe.\n */\nexport const appendLogsQuerySchema = z.object({\n attempt: z.coerce\n .number()\n .int()\n .min(1)\n .max(2_147_483_647)\n .describe('Attempt number of the step this chunk belongs to.'),\n offset: z.coerce\n .number()\n .int()\n .min(0)\n .describe(\n 'Byte position of this chunk in the raw NDJSON spool. Must equal the server-held committed length: an earlier offset is acknowledged as already applied, a later offset returns 409 so the runner rewinds.',\n ),\n});\n\nexport type AppendLogsQueryDto = z.infer<typeof appendLogsQuerySchema>;\n\nexport const appendLogsResponseSchema = z.object({\n committed_length: z\n .number()\n .int()\n .min(0)\n .describe('New server-held byte position after this chunk was applied.'),\n capped: z\n .boolean()\n .describe('When true, the per-job log budget is exhausted and further output is dropped.'),\n});\n\nexport type AppendLogsResponseDto = z.infer<typeof appendLogsResponseSchema>;\n\n/** Body of the 409 returned on an offset gap, so the runner rewinds its spool cursor. */\nexport const offsetGapResponseSchema = z.object({\n code: z.literal('offset-gap'),\n details: z.object({\n committed_length: z\n .number()\n .int()\n .min(0)\n .describe('Current server-held committed length the runner should rewind to.'),\n }),\n});\n\nexport type OffsetGapResponseDto = z.infer<typeof offsetGapResponseSchema>;\n\n/** A lease append was attempted on a stream owned by a server-origin writer. */\nexport const logWriterConflictResponseSchema = z.object({\n code: z.literal('log-writer-conflict'),\n});\n\nexport type LogWriterConflictResponseDto = z.infer<typeof logWriterConflictResponseSchema>;\n"],"names":["z","appendLogsQuerySchema","object","attempt","coerce","number","int","min","max","describe","offset","appendLogsResponseSchema","committed_length","capped","boolean","offsetGapResponseSchema","code","literal","details","logWriterConflictResponseSchema"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwBD,EAAEE,MAAM,CAAC;IAC5CC,SAASH,EAAEI,MAAM,CACdC,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJC,GAAG,CAAC,eACJC,QAAQ,CAAC;IACZC,QAAQV,EAAEI,MAAM,CACbC,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJE,QAAQ,CACP;AAEN,GAAG;AAIH,OAAO,MAAME,2BAA2BX,EAAEE,MAAM,CAAC;IAC/CU,kBAAkBZ,EACfK,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJE,QAAQ,CAAC;IACZI,QAAQb,EACLc,OAAO,GACPL,QAAQ,CAAC;AACd,GAAG;AAIH,uFAAuF,GACvF,OAAO,MAAMM,0BAA0Bf,EAAEE,MAAM,CAAC;IAC9Cc,MAAMhB,EAAEiB,OAAO,CAAC;IAChBC,SAASlB,EAAEE,MAAM,CAAC;QAChBU,kBAAkBZ,EACfK,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJE,QAAQ,CAAC;IACd;AACF,GAAG;AAIH,8EAA8E,GAC9E,OAAO,MAAMU,kCAAkCnB,EAAEE,MAAM,CAAC;IACtDc,MAAMhB,EAAEiB,OAAO,CAAC;AAClB,GAAG"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { type AppendLogsQueryDto, type AppendLogsResponseDto, appendLogsQuerySchema, appendLogsResponseSchema, type OffsetGapResponseDto, offsetGapResponseSchema, } from './append.js';
|
|
1
|
+
export { type AppendLogsQueryDto, type AppendLogsResponseDto, appendLogsQuerySchema, appendLogsResponseSchema, type LogWriterConflictResponseDto, logWriterConflictResponseSchema, type OffsetGapResponseDto, offsetGapResponseSchema, } from './append.js';
|
|
2
2
|
export { type ReadLogsQueryDto, type ReadLogsResponseDto, readLogsQuerySchema, readLogsResponseSchema, } from './read.js';
|
|
3
|
-
export { type LogRecord, logRecordSchema, MAX_RECORD_DATA_BYTES, MAX_RECORD_NAME_BYTES, parseLogRecordLine, parseRawLogRecordLine, type RawLogRecord, rawLogRecordSchema, } from './record.js';
|
|
3
|
+
export { type LogRecord, logRecordSchema, MAX_RECORD_DATA_BYTES, MAX_RECORD_NAME_BYTES, parseLogRecordLine, parseRawLogRecordLine, type RawLogRecord, rawLogRecordSchema, type ServerLogRecord, serverLogRecordSchema, } from './record.js';
|
|
4
4
|
export { SESSION_VIEW_VERSION, type SessionViewDto, type SessionViewLifecycleRow, type SessionViewMessageRow, type SessionViewRawRow, type SessionViewRow, type SessionViewRowMeta, type SessionViewThinkingRow, type SessionViewToolCallRow, type SessionViewToolResultRow, sessionViewLifecycleRowSchema, sessionViewMessageRowSchema, sessionViewRawRowSchema, sessionViewRowMetaSchema, sessionViewRowSchema, sessionViewSchema, sessionViewThinkingRowSchema, sessionViewToolCallRowSchema, sessionViewToolResultRowSchema, } from './session-view.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,SAAS,EACd,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,YAAY,EACjB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,4BAA4B,EACjC,+BAA+B,EAC/B,KAAK,oBAAoB,EACzB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,SAAS,EACd,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,eAAe,EACpB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,4BAA4B,EAC5B,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { appendLogsQuerySchema, appendLogsResponseSchema, offsetGapResponseSchema } from './append.js';
|
|
1
|
+
export { appendLogsQuerySchema, appendLogsResponseSchema, logWriterConflictResponseSchema, offsetGapResponseSchema } from './append.js';
|
|
2
2
|
export { readLogsQuerySchema, readLogsResponseSchema } from './read.js';
|
|
3
|
-
export { logRecordSchema, MAX_RECORD_DATA_BYTES, MAX_RECORD_NAME_BYTES, parseLogRecordLine, parseRawLogRecordLine, rawLogRecordSchema } from './record.js';
|
|
3
|
+
export { logRecordSchema, MAX_RECORD_DATA_BYTES, MAX_RECORD_NAME_BYTES, parseLogRecordLine, parseRawLogRecordLine, rawLogRecordSchema, serverLogRecordSchema } from './record.js';
|
|
4
4
|
export { SESSION_VIEW_VERSION, sessionViewLifecycleRowSchema, sessionViewMessageRowSchema, sessionViewRawRowSchema, sessionViewRowMetaSchema, sessionViewRowSchema, sessionViewSchema, sessionViewThinkingRowSchema, sessionViewToolCallRowSchema, sessionViewToolResultRowSchema } from './session-view.js';
|
|
5
5
|
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schemas/index.ts"],"sourcesContent":["export {\n type AppendLogsQueryDto,\n type AppendLogsResponseDto,\n appendLogsQuerySchema,\n appendLogsResponseSchema,\n type OffsetGapResponseDto,\n offsetGapResponseSchema,\n} from './append.js';\nexport {\n type ReadLogsQueryDto,\n type ReadLogsResponseDto,\n readLogsQuerySchema,\n readLogsResponseSchema,\n} from './read.js';\nexport {\n type LogRecord,\n logRecordSchema,\n MAX_RECORD_DATA_BYTES,\n MAX_RECORD_NAME_BYTES,\n parseLogRecordLine,\n parseRawLogRecordLine,\n type RawLogRecord,\n rawLogRecordSchema,\n} from './record.js';\nexport {\n SESSION_VIEW_VERSION,\n type SessionViewDto,\n type SessionViewLifecycleRow,\n type SessionViewMessageRow,\n type SessionViewRawRow,\n type SessionViewRow,\n type SessionViewRowMeta,\n type SessionViewThinkingRow,\n type SessionViewToolCallRow,\n type SessionViewToolResultRow,\n sessionViewLifecycleRowSchema,\n sessionViewMessageRowSchema,\n sessionViewRawRowSchema,\n sessionViewRowMetaSchema,\n sessionViewRowSchema,\n sessionViewSchema,\n sessionViewThinkingRowSchema,\n sessionViewToolCallRowSchema,\n sessionViewToolResultRowSchema,\n} from './session-view.js';\n"],"names":["appendLogsQuerySchema","appendLogsResponseSchema","offsetGapResponseSchema","readLogsQuerySchema","readLogsResponseSchema","logRecordSchema","MAX_RECORD_DATA_BYTES","MAX_RECORD_NAME_BYTES","parseLogRecordLine","parseRawLogRecordLine","rawLogRecordSchema","SESSION_VIEW_VERSION","sessionViewLifecycleRowSchema","sessionViewMessageRowSchema","sessionViewRawRowSchema","sessionViewRowMetaSchema","sessionViewRowSchema","sessionViewSchema","sessionViewThinkingRowSchema","sessionViewToolCallRowSchema","sessionViewToolResultRowSchema"],"mappings":"AAAA,SAGEA,qBAAqB,EACrBC,wBAAwB,EAExBC,uBAAuB,QAClB,cAAc;AACrB,SAGEC,mBAAmB,EACnBC,sBAAsB,QACjB,YAAY;AACnB,SAEEC,eAAe,EACfC,qBAAqB,EACrBC,qBAAqB,EACrBC,kBAAkB,EAClBC,qBAAqB,EAErBC,kBAAkB,
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/index.ts"],"sourcesContent":["export {\n type AppendLogsQueryDto,\n type AppendLogsResponseDto,\n appendLogsQuerySchema,\n appendLogsResponseSchema,\n type LogWriterConflictResponseDto,\n logWriterConflictResponseSchema,\n type OffsetGapResponseDto,\n offsetGapResponseSchema,\n} from './append.js';\nexport {\n type ReadLogsQueryDto,\n type ReadLogsResponseDto,\n readLogsQuerySchema,\n readLogsResponseSchema,\n} from './read.js';\nexport {\n type LogRecord,\n logRecordSchema,\n MAX_RECORD_DATA_BYTES,\n MAX_RECORD_NAME_BYTES,\n parseLogRecordLine,\n parseRawLogRecordLine,\n type RawLogRecord,\n rawLogRecordSchema,\n type ServerLogRecord,\n serverLogRecordSchema,\n} from './record.js';\nexport {\n SESSION_VIEW_VERSION,\n type SessionViewDto,\n type SessionViewLifecycleRow,\n type SessionViewMessageRow,\n type SessionViewRawRow,\n type SessionViewRow,\n type SessionViewRowMeta,\n type SessionViewThinkingRow,\n type SessionViewToolCallRow,\n type SessionViewToolResultRow,\n sessionViewLifecycleRowSchema,\n sessionViewMessageRowSchema,\n sessionViewRawRowSchema,\n sessionViewRowMetaSchema,\n sessionViewRowSchema,\n sessionViewSchema,\n sessionViewThinkingRowSchema,\n sessionViewToolCallRowSchema,\n sessionViewToolResultRowSchema,\n} from './session-view.js';\n"],"names":["appendLogsQuerySchema","appendLogsResponseSchema","logWriterConflictResponseSchema","offsetGapResponseSchema","readLogsQuerySchema","readLogsResponseSchema","logRecordSchema","MAX_RECORD_DATA_BYTES","MAX_RECORD_NAME_BYTES","parseLogRecordLine","parseRawLogRecordLine","rawLogRecordSchema","serverLogRecordSchema","SESSION_VIEW_VERSION","sessionViewLifecycleRowSchema","sessionViewMessageRowSchema","sessionViewRawRowSchema","sessionViewRowMetaSchema","sessionViewRowSchema","sessionViewSchema","sessionViewThinkingRowSchema","sessionViewToolCallRowSchema","sessionViewToolResultRowSchema"],"mappings":"AAAA,SAGEA,qBAAqB,EACrBC,wBAAwB,EAExBC,+BAA+B,EAE/BC,uBAAuB,QAClB,cAAc;AACrB,SAGEC,mBAAmB,EACnBC,sBAAsB,QACjB,YAAY;AACnB,SAEEC,eAAe,EACfC,qBAAqB,EACrBC,qBAAqB,EACrBC,kBAAkB,EAClBC,qBAAqB,EAErBC,kBAAkB,EAElBC,qBAAqB,QAChB,cAAc;AACrB,SACEC,oBAAoB,EAUpBC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,uBAAuB,EACvBC,wBAAwB,EACxBC,oBAAoB,EACpBC,iBAAiB,EACjBC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,8BAA8B,QACzB,oBAAoB"}
|
package/dist/schemas/read.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ export declare const readLogsResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
18
18
|
next_cursor: z.ZodNumber;
|
|
19
19
|
has_more: z.ZodBoolean;
|
|
20
20
|
state: z.ZodEnum<{
|
|
21
|
-
open: "open";
|
|
22
21
|
closed: "closed";
|
|
22
|
+
open: "open";
|
|
23
23
|
}>;
|
|
24
24
|
truncated: z.ZodBoolean;
|
|
25
25
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/schemas/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;iBAS9B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/schemas/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;iBAS9B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AA0DnE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;2BAGjC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/dist/schemas/read.js
CHANGED
|
@@ -37,7 +37,7 @@ import { z } from 'zod';
|
|
|
37
37
|
expires_at: z.string().datetime({
|
|
38
38
|
offset: true
|
|
39
39
|
}).describe('ISO 8601 instant after which the presigned URL stops working.'),
|
|
40
|
-
total_bytes: z.number().int().min(0).describe('Committed append byte position for the attempt. This is the
|
|
40
|
+
total_bytes: z.number().int().min(0).describe('Committed append byte position for the attempt. This is the active writer CAS axis.'),
|
|
41
41
|
truncated: z.boolean().describe('True when the stream was force-closed because the runner stopped reporting.')
|
|
42
42
|
});
|
|
43
43
|
export const readLogsResponseSchema = z.discriminatedUnion('mode', [
|
package/dist/schemas/read.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schemas/read.ts"],"sourcesContent":["import {z} from 'zod';\n\n/**\n * Read endpoint contract: `GET .../steps/:stepId/attempts/:attempt/logs?cursor=N`.\n *\n * `cursor` is an opaque chunk-sequence position, not a byte offset. Server-injected\n * control tombstones (`capped`, `runner_lost`) do not advance the runner byte axis, so\n * the read walks chunks by insertion `seq` to keep every record in stream order. The\n * same `seq` walk backs compaction, so the inline `ndjson` is byte-identical to the\n * decompressed compacted object. Start at 0 and echo back `next_cursor` to page forward.\n */\nexport const readLogsQuerySchema = z.object({\n cursor: z.coerce\n .number()\n .int()\n .min(0)\n .default(0)\n .describe(\n 'Opaque chunk-sequence cursor. Start at 0; echo back the previous response next_cursor to page forward. Not a byte offset.',\n ),\n});\n\nexport type ReadLogsQueryDto = z.infer<typeof readLogsQuerySchema>;\n\n/**\n * Inline shape: stored NDJSON bytes from `cursor`, parsed client-side with\n * `parseLogRecordLine`. Served while the stream is open or closed but not yet compacted.\n * The bytes carry every record of every type for the `(step, attempt)`; the client\n * filters by record type for display.\n */\nconst readLogsInlineSchema = z.object({\n mode: z.literal('inline'),\n ndjson: z\n .string()\n .describe('Stored NDJSON: every record for this (step, attempt) from cursor, in stream order.'),\n next_cursor: z\n .number()\n .int()\n .min(0)\n .describe('Cursor to pass on the next poll to fetch records after this page.'),\n has_more: z\n .boolean()\n .describe(\n 'True when more buffered records remain past this page; re-poll immediately to drain before tailing at the refresh interval.',\n ),\n state: z\n .enum(['open', 'closed'])\n .describe('Stream lifecycle: open still accepts appends, closed is terminal.'),\n truncated: z\n .boolean()\n .describe('True when the stream was force-closed because the runner stopped reporting.'),\n});\n\n/**\n * Presigned shape: a short-lived GET URL to the compacted object, fetched directly by\n * the browser (API egress bypassed). Served once the stream is compacted (`object_key`\n * set). The object is the same NDJSON the inline shape streams, gzip-compressed.\n */\nconst readLogsPresignedSchema = z.object({\n mode: z.literal('presigned'),\n url: z.string().url().describe('Presigned GET URL for the compacted NDJSON object.'),\n state: z\n .literal('closed')\n .describe('Compacted streams are closed before they are served by URL.'),\n expires_at: z\n .string()\n .datetime({offset: true})\n .describe('ISO 8601 instant after which the presigned URL stops working.'),\n total_bytes: z\n .number()\n .int()\n .min(0)\n .describe('Committed append byte position for the attempt. This is the
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/read.ts"],"sourcesContent":["import {z} from 'zod';\n\n/**\n * Read endpoint contract: `GET .../steps/:stepId/attempts/:attempt/logs?cursor=N`.\n *\n * `cursor` is an opaque chunk-sequence position, not a byte offset. Server-injected\n * control tombstones (`capped`, `runner_lost`) do not advance the runner byte axis, so\n * the read walks chunks by insertion `seq` to keep every record in stream order. The\n * same `seq` walk backs compaction, so the inline `ndjson` is byte-identical to the\n * decompressed compacted object. Start at 0 and echo back `next_cursor` to page forward.\n */\nexport const readLogsQuerySchema = z.object({\n cursor: z.coerce\n .number()\n .int()\n .min(0)\n .default(0)\n .describe(\n 'Opaque chunk-sequence cursor. Start at 0; echo back the previous response next_cursor to page forward. Not a byte offset.',\n ),\n});\n\nexport type ReadLogsQueryDto = z.infer<typeof readLogsQuerySchema>;\n\n/**\n * Inline shape: stored NDJSON bytes from `cursor`, parsed client-side with\n * `parseLogRecordLine`. Served while the stream is open or closed but not yet compacted.\n * The bytes carry every record of every type for the `(step, attempt)`; the client\n * filters by record type for display.\n */\nconst readLogsInlineSchema = z.object({\n mode: z.literal('inline'),\n ndjson: z\n .string()\n .describe('Stored NDJSON: every record for this (step, attempt) from cursor, in stream order.'),\n next_cursor: z\n .number()\n .int()\n .min(0)\n .describe('Cursor to pass on the next poll to fetch records after this page.'),\n has_more: z\n .boolean()\n .describe(\n 'True when more buffered records remain past this page; re-poll immediately to drain before tailing at the refresh interval.',\n ),\n state: z\n .enum(['open', 'closed'])\n .describe('Stream lifecycle: open still accepts appends, closed is terminal.'),\n truncated: z\n .boolean()\n .describe('True when the stream was force-closed because the runner stopped reporting.'),\n});\n\n/**\n * Presigned shape: a short-lived GET URL to the compacted object, fetched directly by\n * the browser (API egress bypassed). Served once the stream is compacted (`object_key`\n * set). The object is the same NDJSON the inline shape streams, gzip-compressed.\n */\nconst readLogsPresignedSchema = z.object({\n mode: z.literal('presigned'),\n url: z.string().url().describe('Presigned GET URL for the compacted NDJSON object.'),\n state: z\n .literal('closed')\n .describe('Compacted streams are closed before they are served by URL.'),\n expires_at: z\n .string()\n .datetime({offset: true})\n .describe('ISO 8601 instant after which the presigned URL stops working.'),\n total_bytes: z\n .number()\n .int()\n .min(0)\n .describe(\n 'Committed append byte position for the attempt. This is the active writer CAS axis.',\n ),\n truncated: z\n .boolean()\n .describe('True when the stream was force-closed because the runner stopped reporting.'),\n});\n\nexport const readLogsResponseSchema = z.discriminatedUnion('mode', [\n readLogsInlineSchema,\n readLogsPresignedSchema,\n]);\n\nexport type ReadLogsResponseDto = z.infer<typeof readLogsResponseSchema>;\n"],"names":["z","readLogsQuerySchema","object","cursor","coerce","number","int","min","default","describe","readLogsInlineSchema","mode","literal","ndjson","string","next_cursor","has_more","boolean","state","enum","truncated","readLogsPresignedSchema","url","expires_at","datetime","offset","total_bytes","readLogsResponseSchema","discriminatedUnion"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsBD,EAAEE,MAAM,CAAC;IAC1CC,QAAQH,EAAEI,MAAM,CACbC,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJC,OAAO,CAAC,GACRC,QAAQ,CACP;AAEN,GAAG;AAIH;;;;;CAKC,GACD,MAAMC,uBAAuBV,EAAEE,MAAM,CAAC;IACpCS,MAAMX,EAAEY,OAAO,CAAC;IAChBC,QAAQb,EACLc,MAAM,GACNL,QAAQ,CAAC;IACZM,aAAaf,EACVK,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJE,QAAQ,CAAC;IACZO,UAAUhB,EACPiB,OAAO,GACPR,QAAQ,CACP;IAEJS,OAAOlB,EACJmB,IAAI,CAAC;QAAC;QAAQ;KAAS,EACvBV,QAAQ,CAAC;IACZW,WAAWpB,EACRiB,OAAO,GACPR,QAAQ,CAAC;AACd;AAEA;;;;CAIC,GACD,MAAMY,0BAA0BrB,EAAEE,MAAM,CAAC;IACvCS,MAAMX,EAAEY,OAAO,CAAC;IAChBU,KAAKtB,EAAEc,MAAM,GAAGQ,GAAG,GAAGb,QAAQ,CAAC;IAC/BS,OAAOlB,EACJY,OAAO,CAAC,UACRH,QAAQ,CAAC;IACZc,YAAYvB,EACTc,MAAM,GACNU,QAAQ,CAAC;QAACC,QAAQ;IAAI,GACtBhB,QAAQ,CAAC;IACZiB,aAAa1B,EACVK,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJE,QAAQ,CACP;IAEJW,WAAWpB,EACRiB,OAAO,GACPR,QAAQ,CAAC;AACd;AAEA,OAAO,MAAMkB,yBAAyB3B,EAAE4B,kBAAkB,CAAC,QAAQ;IACjElB;IACAW;CACD,EAAE"}
|