@shipfox/api-logs-dto 9.0.2 → 12.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/schemas/append.d.ts +1 -1
- package/dist/schemas/append.js +1 -1
- package/dist/schemas/append.js.map +1 -1
- package/dist/schemas/record.d.ts +4 -3
- package/dist/schemas/record.d.ts.map +1 -1
- package/dist/schemas/record.js +3 -3
- package/dist/schemas/record.js.map +1 -1
- package/dist/schemas/session-view.d.ts +3 -0
- package/dist/schemas/session-view.d.ts.map +1 -1
- package/dist/schemas/session-view.js +2 -1
- package/dist/schemas/session-view.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/schemas/append.ts +1 -1
- package/src/schemas/record.ts +3 -3
- package/src/schemas/session-view.test.ts +1 -0
- package/src/schemas/session-view.ts +1 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
$ shipfox-swc
|
|
2
|
-
Successfully compiled: 7 files with swc (
|
|
2
|
+
Successfully compiled: 7 files with swc (270.71ms)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @shipfox/api-logs-dto
|
|
2
2
|
|
|
3
|
+
## 12.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f78740d: Remove Unicode dash punctuation from package prose and source comments.
|
|
8
|
+
|
|
9
|
+
## 10.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 57e69d8: Preserve and display Claude tool-use summaries on their matching tool-call rows.
|
|
14
|
+
|
|
3
15
|
## 9.0.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
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.
|
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.
|
|
@@ -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"],"names":["z","appendLogsQuerySchema","object","attempt","coerce","number","int","min","max","describe","offset","appendLogsResponseSchema","committed_length","capped","boolean","offsetGapResponseSchema","code","literal","details"],"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"}
|
package/dist/schemas/record.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/**
|
|
3
|
-
* NDJSON log record contract
|
|
3
|
+
* NDJSON log record contract: one JSON object per line, runner-framed.
|
|
4
4
|
*
|
|
5
5
|
* `offset` / `committed_length` are byte positions in the raw append NDJSON spool stream
|
|
6
|
-
* (envelope included)
|
|
6
|
+
* (envelope included): the offset-CAS axis the runner tracks. The per-job accrual
|
|
7
7
|
* budget charges the normalized NDJSON bytes the server stores, so framing and control records
|
|
8
8
|
* count against it too. The per-record byte caps below bound each record so a single
|
|
9
9
|
* entry's overhead is known and a runner cannot grow storage without moving the
|
|
@@ -125,6 +125,7 @@ export declare const logRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
125
125
|
id: z.ZodNullable<z.ZodString>;
|
|
126
126
|
name: z.ZodString;
|
|
127
127
|
input: z.ZodString;
|
|
128
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
128
129
|
timestamp: z.ZodNumber;
|
|
129
130
|
}, z.core.$strip>, z.ZodObject<{
|
|
130
131
|
kind: z.ZodLiteral<"tool-result">;
|
|
@@ -172,7 +173,7 @@ export declare function parseLogRecordLine(line: string): LogRecord;
|
|
|
172
173
|
/**
|
|
173
174
|
* Parses one NDJSON line against the raw write union. A forged
|
|
174
175
|
* server-only `capped` / `runner_lost` record fails here even though it is valid
|
|
175
|
-
* under the read union
|
|
176
|
+
* under the read union: this is the write-path forgery guard.
|
|
176
177
|
*/
|
|
177
178
|
export declare function parseRawLogRecordLine(line: string): RawLogRecord;
|
|
178
179
|
//# sourceMappingURL=record.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/schemas/record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,QAAY,CAAC;AAE/C,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AA4E7C,uFAAuF;AACvF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAO7B,CAAC;AAEH,uFAAuF;AACvF,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/schemas/record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,QAAY,CAAC;AAE/C,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AA4E7C,uFAAuF;AACvF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAO7B,CAAC;AAEH,uFAAuF;AACvF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAS1B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAE1D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAEhE"}
|
package/dist/schemas/record.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { sessionViewRowSchema } from './session-view.js';
|
|
3
3
|
/**
|
|
4
|
-
* NDJSON log record contract
|
|
4
|
+
* NDJSON log record contract: one JSON object per line, runner-framed.
|
|
5
5
|
*
|
|
6
6
|
* `offset` / `committed_length` are byte positions in the raw append NDJSON spool stream
|
|
7
|
-
* (envelope included)
|
|
7
|
+
* (envelope included): the offset-CAS axis the runner tracks. The per-job accrual
|
|
8
8
|
* budget charges the normalized NDJSON bytes the server stores, so framing and control records
|
|
9
9
|
* count against it too. The per-record byte caps below bound each record so a single
|
|
10
10
|
* entry's overhead is known and a runner cannot grow storage without moving the
|
|
@@ -128,7 +128,7 @@ export function parseLogRecordLine(line) {
|
|
|
128
128
|
/**
|
|
129
129
|
* Parses one NDJSON line against the raw write union. A forged
|
|
130
130
|
* server-only `capped` / `runner_lost` record fails here even though it is valid
|
|
131
|
-
* under the read union
|
|
131
|
+
* under the read union: this is the write-path forgery guard.
|
|
132
132
|
*/ export function parseRawLogRecordLine(line) {
|
|
133
133
|
return rawLogRecordSchema.parse(JSON.parse(line));
|
|
134
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schemas/record.ts"],"sourcesContent":["import {z} from 'zod';\nimport {sessionViewRowSchema} from './session-view.js';\n\n/**\n * NDJSON log record contract
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/record.ts"],"sourcesContent":["import {z} from 'zod';\nimport {sessionViewRowSchema} from './session-view.js';\n\n/**\n * NDJSON log record contract: one JSON object per line, runner-framed.\n *\n * `offset` / `committed_length` are byte positions in the raw append NDJSON spool stream\n * (envelope included): the offset-CAS axis the runner tracks. The per-job accrual\n * budget charges the normalized NDJSON bytes the server stores, so framing and control records\n * count against it too. The per-record byte caps below bound each record so a single\n * entry's overhead is known and a runner cannot grow storage without moving the\n * budget: `data` is non-empty and <= MAX_RECORD_DATA_BYTES, the group `name` is\n * <= MAX_RECORD_NAME_BYTES, the group ids are <= MAX_RECORD_GROUP_ID_BYTES, and every\n * other field is fixed-shape.\n *\n * The envelope is `{v, ts}`, and every record is discriminated by a single flat\n * `type`. The raw/write and stored/read unions are distinct types: the server-only\n * `capped` / `runner_lost` tombstones are members of the read union only, so a forged\n * tombstone cannot pass append validation.\n *\n * The append-side `agent_session` record carries one verbatim agent session entry line\n * in `data`, forwarded opaquely by the runner. On successful ingest, the API normalizes\n * that raw entry into one or more read-side `agent_session` records whose `row` is the\n * canonical session view row. The raw and normalized records travel through the same log\n * append/read pipe; only their contract at each boundary differs.\n */\n\n/** Largest decoded `data` payload per record. Longer lines are split by the runner. */\nexport const MAX_RECORD_DATA_BYTES = 16 * 1024;\n\n/** Largest `group_start` name. Bounds the only variable-length control field. */\nexport const MAX_RECORD_NAME_BYTES = 1024;\n\n/**\n * Largest `group_id` / `parent_group_id`. The runner emits short monotonic ids (`g1`,\n * `g2`, …); this only bounds a forged id from a lease-scoped writer so the ids stay a\n * fixed-shape field like every other record field.\n */\nexport const MAX_RECORD_GROUP_ID_BYTES = 256;\n\n// UTF-8 byte length without node:buffer, so this shared DTO stays browser-safe (the\n// client log viewer imports these types too). Identical to Buffer.byteLength(x, 'utf8').\nconst utf8Encoder = new TextEncoder();\nconst utf8ByteLength = (value: string): number => utf8Encoder.encode(value).length;\n\nconst groupId = z\n .string()\n .min(1, {message: 'group id must not be empty'})\n .refine((value) => utf8ByteLength(value) <= MAX_RECORD_GROUP_ID_BYTES, {\n message: `group id exceeds ${MAX_RECORD_GROUP_ID_BYTES} bytes`,\n });\n\nconst envelope = {\n v: z.literal(1),\n /** Epoch milliseconds, assigned by the runner at capture. */\n ts: z.number().int().nonnegative(),\n};\n\nconst logOutput = z.object({\n ...envelope,\n type: z.literal('output'),\n stream: z.enum(['stdout', 'stderr']),\n data: z\n .string()\n .min(1, {message: 'output data must not be empty'})\n .refine((value) => utf8ByteLength(value) <= MAX_RECORD_DATA_BYTES, {\n message: `data exceeds ${MAX_RECORD_DATA_BYTES} payload bytes`,\n }),\n});\n\nconst logGroupStart = z.object({\n ...envelope,\n type: z.literal('group_start'),\n group_id: groupId,\n parent_group_id: groupId.nullable(),\n name: z.string().refine((value) => utf8ByteLength(value) <= MAX_RECORD_NAME_BYTES, {\n message: `group name exceeds ${MAX_RECORD_NAME_BYTES} bytes`,\n }),\n});\n\nconst logGroupEnd = z.object({...envelope, type: z.literal('group_end'), group_id: groupId});\n\nconst logEnd = z.object({\n ...envelope,\n type: z.literal('end'),\n total_bytes: z.number().int().nonnegative(),\n});\n\nconst logGap = z.object({\n ...envelope,\n type: z.literal('gap'),\n dropped_bytes: z.number().int().nonnegative(),\n});\n\n// One verbatim agent session entry line, forwarded opaquely by the runner. `data` is\n// intentionally uncapped here: the per-line byte limit is the server's configurable\n// LOG_MAX_SESSION_LINE_BYTES (a Zod schema cannot read runtime config, and a static cap\n// would collide with the body-limit invariant), enforced in the append write path.\nconst rawAgentSession = z.object({\n ...envelope,\n type: z.literal('agent_session'),\n data: z.string().min(1, {message: 'agent_session data must not be empty'}),\n});\n\nconst agentSession = z.object({\n ...envelope,\n type: z.literal('agent_session'),\n row: sessionViewRowSchema,\n});\n\n// Server-only tombstones: NOT members of the raw write union.\nconst logCapped = z.object({...envelope, type: z.literal('capped')});\nconst logRunnerLost = z.object({...envelope, type: z.literal('runner_lost')});\n\n/** Records a lease-scoped runner may append. The write path validates against this. */\nexport const rawLogRecordSchema = z.discriminatedUnion('type', [\n logOutput,\n logGroupStart,\n logGroupEnd,\n logEnd,\n logGap,\n rawAgentSession,\n]);\n\n/** Stored/read records: regular records, normalized agent sessions, and tombstones. */\nexport const logRecordSchema = z.discriminatedUnion('type', [\n logOutput,\n logGroupStart,\n logGroupEnd,\n logEnd,\n logGap,\n agentSession,\n logCapped,\n logRunnerLost,\n]);\n\nexport type RawLogRecord = z.infer<typeof rawLogRecordSchema>;\nexport type LogRecord = z.infer<typeof logRecordSchema>;\n\nexport function parseLogRecordLine(line: string): LogRecord {\n return logRecordSchema.parse(JSON.parse(line));\n}\n\n/**\n * Parses one NDJSON line against the raw write union. A forged\n * server-only `capped` / `runner_lost` record fails here even though it is valid\n * under the read union: this is the write-path forgery guard.\n */\nexport function parseRawLogRecordLine(line: string): RawLogRecord {\n return rawLogRecordSchema.parse(JSON.parse(line));\n}\n"],"names":["z","sessionViewRowSchema","MAX_RECORD_DATA_BYTES","MAX_RECORD_NAME_BYTES","MAX_RECORD_GROUP_ID_BYTES","utf8Encoder","TextEncoder","utf8ByteLength","value","encode","length","groupId","string","min","message","refine","envelope","v","literal","ts","number","int","nonnegative","logOutput","object","type","stream","enum","data","logGroupStart","group_id","parent_group_id","nullable","name","logGroupEnd","logEnd","total_bytes","logGap","dropped_bytes","rawAgentSession","agentSession","row","logCapped","logRunnerLost","rawLogRecordSchema","discriminatedUnion","logRecordSchema","parseLogRecordLine","line","parse","JSON","parseRawLogRecordLine"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,oBAAoB,QAAO,oBAAoB;AAEvD;;;;;;;;;;;;;;;;;;;;;;CAsBC,GAED,qFAAqF,GACrF,OAAO,MAAMC,wBAAwB,KAAK,KAAK;AAE/C,+EAA+E,GAC/E,OAAO,MAAMC,wBAAwB,KAAK;AAE1C;;;;CAIC,GACD,OAAO,MAAMC,4BAA4B,IAAI;AAE7C,oFAAoF;AACpF,yFAAyF;AACzF,MAAMC,cAAc,IAAIC;AACxB,MAAMC,iBAAiB,CAACC,QAA0BH,YAAYI,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AAK,CAACC,KAAKD,KAAK,CAACD;AAC7C"}
|
|
@@ -28,6 +28,7 @@ export declare const sessionViewToolCallRowSchema: z.ZodObject<{
|
|
|
28
28
|
id: z.ZodNullable<z.ZodString>;
|
|
29
29
|
name: z.ZodString;
|
|
30
30
|
input: z.ZodString;
|
|
31
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
31
32
|
timestamp: z.ZodNumber;
|
|
32
33
|
}, z.core.$strip>;
|
|
33
34
|
export declare const sessionViewToolResultRowSchema: z.ZodObject<{
|
|
@@ -82,6 +83,7 @@ export declare const sessionViewRowSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
82
83
|
id: z.ZodNullable<z.ZodString>;
|
|
83
84
|
name: z.ZodString;
|
|
84
85
|
input: z.ZodString;
|
|
86
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
85
87
|
timestamp: z.ZodNumber;
|
|
86
88
|
}, z.core.$strip>, z.ZodObject<{
|
|
87
89
|
kind: z.ZodLiteral<"tool-result">;
|
|
@@ -135,6 +137,7 @@ export declare const sessionViewSchema: z.ZodObject<{
|
|
|
135
137
|
id: z.ZodNullable<z.ZodString>;
|
|
136
138
|
name: z.ZodString;
|
|
137
139
|
input: z.ZodString;
|
|
140
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
138
141
|
timestamp: z.ZodNumber;
|
|
139
142
|
}, z.core.$strip>, z.ZodObject<{
|
|
140
143
|
kind: z.ZodLiteral<"tool-result">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-view.d.ts","sourceRoot":"","sources":["../../src/schemas/session-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAItC,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAC;AAMH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;iBAQtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;iBA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AO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -28,7 +28,8 @@ export const sessionViewToolCallRowSchema = z.object({
|
|
|
28
28
|
kind: z.literal('tool-call'),
|
|
29
29
|
id: z.string().nullable(),
|
|
30
30
|
name: z.string().min(1),
|
|
31
|
-
input: z.string()
|
|
31
|
+
input: z.string(),
|
|
32
|
+
summary: z.string().optional()
|
|
32
33
|
});
|
|
33
34
|
export const sessionViewToolResultRowSchema = z.object({
|
|
34
35
|
...sessionViewRowBase,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schemas/session-view.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const SESSION_VIEW_VERSION = 1;\n\nconst timestampSchema = z.number().int().nonnegative();\n\nexport const sessionViewRowMetaSchema = z.object({\n label: z.string().min(1),\n value: z.string(),\n inline: z.boolean().optional(),\n});\n\nconst sessionViewRowBase = {\n timestamp: timestampSchema,\n};\n\nexport const sessionViewMessageRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('message'),\n role: z.string().min(1),\n label: z.string().min(1),\n meta: z.array(sessionViewRowMetaSchema).readonly(),\n text: z.string(),\n terminalFailure: z.boolean(),\n});\n\nexport const sessionViewThinkingRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('thinking'),\n text: z.string(),\n});\n\nexport const sessionViewToolCallRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('tool-call'),\n id: z.string().nullable(),\n name: z.string().min(1),\n input: z.string(),\n});\n\nexport const sessionViewToolResultRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('tool-result'),\n toolCallId: z.string().nullable(),\n toolName: z.string().min(1),\n output: z.string(),\n isError: z.boolean(),\n});\n\nexport const sessionViewLifecycleRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('lifecycle'),\n label: z.string().min(1),\n detail: z.string().nullable(),\n meta: z.array(sessionViewRowMetaSchema).readonly(),\n tone: z.enum(['default', 'warning', 'error']),\n terminalFailure: z.boolean(),\n});\n\nexport const sessionViewRawRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('raw'),\n label: z.string().min(1),\n raw: z.string(),\n});\n\nexport const sessionViewRowSchema = z.discriminatedUnion('kind', [\n sessionViewMessageRowSchema,\n sessionViewThinkingRowSchema,\n sessionViewToolCallRowSchema,\n sessionViewToolResultRowSchema,\n sessionViewLifecycleRowSchema,\n sessionViewRawRowSchema,\n]);\n\nexport const sessionViewSchema = z.object({\n v: z.literal(SESSION_VIEW_VERSION),\n rows: z.array(sessionViewRowSchema).readonly(),\n});\n\nexport type SessionViewRowMeta = z.infer<typeof sessionViewRowMetaSchema>;\nexport type SessionViewMessageRow = z.infer<typeof sessionViewMessageRowSchema>;\nexport type SessionViewThinkingRow = z.infer<typeof sessionViewThinkingRowSchema>;\nexport type SessionViewToolCallRow = z.infer<typeof sessionViewToolCallRowSchema>;\nexport type SessionViewToolResultRow = z.infer<typeof sessionViewToolResultRowSchema>;\nexport type SessionViewLifecycleRow = z.infer<typeof sessionViewLifecycleRowSchema>;\nexport type SessionViewRawRow = z.infer<typeof sessionViewRawRowSchema>;\nexport type SessionViewRow = z.infer<typeof sessionViewRowSchema>;\nexport type SessionViewDto = z.infer<typeof sessionViewSchema>;\n"],"names":["z","SESSION_VIEW_VERSION","timestampSchema","number","int","nonnegative","sessionViewRowMetaSchema","object","label","string","min","value","inline","boolean","optional","sessionViewRowBase","timestamp","sessionViewMessageRowSchema","kind","literal","role","meta","array","readonly","text","terminalFailure","sessionViewThinkingRowSchema","sessionViewToolCallRowSchema","id","nullable","name","input","sessionViewToolResultRowSchema","toolCallId","toolName","output","isError","sessionViewLifecycleRowSchema","detail","tone","enum","sessionViewRawRowSchema","raw","sessionViewRowSchema","discriminatedUnion","sessionViewSchema","v","rows"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,uBAAuB,EAAE;AAEtC,MAAMC,kBAAkBF,EAAEG,MAAM,GAAGC,GAAG,GAAGC,WAAW;AAEpD,OAAO,MAAMC,2BAA2BN,EAAEO,MAAM,CAAC;IAC/CC,OAAOR,EAAES,MAAM,GAAGC,GAAG,CAAC;IACtBC,OAAOX,EAAES,MAAM;IACfG,QAAQZ,EAAEa,OAAO,GAAGC,QAAQ;AAC9B,GAAG;AAEH,MAAMC,qBAAqB;IACzBC,WAAWd;AACb;AAEA,OAAO,MAAMe,8BAA8BjB,EAAEO,MAAM,CAAC;IAClD,GAAGQ,kBAAkB;IACrBG,MAAMlB,EAAEmB,OAAO,CAAC;IAChBC,MAAMpB,EAAES,MAAM,GAAGC,GAAG,CAAC;IACrBF,OAAOR,EAAES,MAAM,GAAGC,GAAG,CAAC;IACtBW,MAAMrB,EAAEsB,KAAK,CAAChB,0BAA0BiB,QAAQ;IAChDC,MAAMxB,EAAES,MAAM;IACdgB,iBAAiBzB,EAAEa,OAAO;AAC5B,GAAG;AAEH,OAAO,MAAMa,+BAA+B1B,EAAEO,MAAM,CAAC;IACnD,GAAGQ,kBAAkB;IACrBG,MAAMlB,EAAEmB,OAAO,CAAC;IAChBK,MAAMxB,EAAES,MAAM;AAChB,GAAG;AAEH,OAAO,MAAMkB,+BAA+B3B,EAAEO,MAAM,CAAC;IACnD,GAAGQ,kBAAkB;IACrBG,MAAMlB,EAAEmB,OAAO,CAAC;IAChBS,IAAI5B,EAAES,MAAM,GAAGoB,QAAQ;IACvBC,MAAM9B,EAAES,MAAM,GAAGC,GAAG,CAAC;IACrBqB,OAAO/B,EAAES,MAAM;
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/session-view.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const SESSION_VIEW_VERSION = 1;\n\nconst timestampSchema = z.number().int().nonnegative();\n\nexport const sessionViewRowMetaSchema = z.object({\n label: z.string().min(1),\n value: z.string(),\n inline: z.boolean().optional(),\n});\n\nconst sessionViewRowBase = {\n timestamp: timestampSchema,\n};\n\nexport const sessionViewMessageRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('message'),\n role: z.string().min(1),\n label: z.string().min(1),\n meta: z.array(sessionViewRowMetaSchema).readonly(),\n text: z.string(),\n terminalFailure: z.boolean(),\n});\n\nexport const sessionViewThinkingRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('thinking'),\n text: z.string(),\n});\n\nexport const sessionViewToolCallRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('tool-call'),\n id: z.string().nullable(),\n name: z.string().min(1),\n input: z.string(),\n summary: z.string().optional(),\n});\n\nexport const sessionViewToolResultRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('tool-result'),\n toolCallId: z.string().nullable(),\n toolName: z.string().min(1),\n output: z.string(),\n isError: z.boolean(),\n});\n\nexport const sessionViewLifecycleRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('lifecycle'),\n label: z.string().min(1),\n detail: z.string().nullable(),\n meta: z.array(sessionViewRowMetaSchema).readonly(),\n tone: z.enum(['default', 'warning', 'error']),\n terminalFailure: z.boolean(),\n});\n\nexport const sessionViewRawRowSchema = z.object({\n ...sessionViewRowBase,\n kind: z.literal('raw'),\n label: z.string().min(1),\n raw: z.string(),\n});\n\nexport const sessionViewRowSchema = z.discriminatedUnion('kind', [\n sessionViewMessageRowSchema,\n sessionViewThinkingRowSchema,\n sessionViewToolCallRowSchema,\n sessionViewToolResultRowSchema,\n sessionViewLifecycleRowSchema,\n sessionViewRawRowSchema,\n]);\n\nexport const sessionViewSchema = z.object({\n v: z.literal(SESSION_VIEW_VERSION),\n rows: z.array(sessionViewRowSchema).readonly(),\n});\n\nexport type SessionViewRowMeta = z.infer<typeof sessionViewRowMetaSchema>;\nexport type SessionViewMessageRow = z.infer<typeof sessionViewMessageRowSchema>;\nexport type SessionViewThinkingRow = z.infer<typeof sessionViewThinkingRowSchema>;\nexport type SessionViewToolCallRow = z.infer<typeof sessionViewToolCallRowSchema>;\nexport type SessionViewToolResultRow = z.infer<typeof sessionViewToolResultRowSchema>;\nexport type SessionViewLifecycleRow = z.infer<typeof sessionViewLifecycleRowSchema>;\nexport type SessionViewRawRow = z.infer<typeof sessionViewRawRowSchema>;\nexport type SessionViewRow = z.infer<typeof sessionViewRowSchema>;\nexport type SessionViewDto = z.infer<typeof sessionViewSchema>;\n"],"names":["z","SESSION_VIEW_VERSION","timestampSchema","number","int","nonnegative","sessionViewRowMetaSchema","object","label","string","min","value","inline","boolean","optional","sessionViewRowBase","timestamp","sessionViewMessageRowSchema","kind","literal","role","meta","array","readonly","text","terminalFailure","sessionViewThinkingRowSchema","sessionViewToolCallRowSchema","id","nullable","name","input","summary","sessionViewToolResultRowSchema","toolCallId","toolName","output","isError","sessionViewLifecycleRowSchema","detail","tone","enum","sessionViewRawRowSchema","raw","sessionViewRowSchema","discriminatedUnion","sessionViewSchema","v","rows"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,uBAAuB,EAAE;AAEtC,MAAMC,kBAAkBF,EAAEG,MAAM,GAAGC,GAAG,GAAGC,WAAW;AAEpD,OAAO,MAAMC,2BAA2BN,EAAEO,MAAM,CAAC;IAC/CC,OAAOR,EAAES,MAAM,GAAGC,GAAG,CAAC;IACtBC,OAAOX,EAAES,MAAM;IACfG,QAAQZ,EAAEa,OAAO,GAAGC,QAAQ;AAC9B,GAAG;AAEH,MAAMC,qBAAqB;IACzBC,WAAWd;AACb;AAEA,OAAO,MAAMe,8BAA8BjB,EAAEO,MAAM,CAAC;IAClD,GAAGQ,kBAAkB;IACrBG,MAAMlB,EAAEmB,OAAO,CAAC;IAChBC,MAAMpB,EAA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