@dosu/seshi-model 0.0.0-stage → 0.11.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/LICENSE +21 -0
- package/README.md +8 -2
- package/dist/index.js +1553 -0
- package/package.json +33 -4
- package/types/api.d.ts +219 -0
- package/types/authz.d.ts +18 -0
- package/types/canonical.d.ts +5 -0
- package/types/errors.d.ts +53 -0
- package/types/format-adapter.d.ts +66 -0
- package/types/generated/change.d.ts +81 -0
- package/types/generated/common.d.ts +253 -0
- package/types/generated/envelope.d.ts +228 -0
- package/types/generated/layout.d.ts +65 -0
- package/types/generated/metadata.d.ts +307 -0
- package/types/generated/trace.d.ts +484 -0
- package/types/index.d.ts +24 -0
- package/types/parse.d.ts +18 -0
- package/types/prefix-hash.d.ts +47 -0
- package/types/schemas/otlp.d.ts +51 -0
- package/types/schemas/renders.d.ts +95 -0
- package/types/schemas/store.d.ts +32 -0
- package/types/schemas/trace.d.ts +3 -0
- package/types/schemas/trajectory.d.ts +15 -0
- package/types/schemas/validate.d.ts +5 -0
- package/types/search.d.ts +91 -0
- package/types/spans.d.ts +156 -0
- package/types/version.d.ts +1 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/** Generated from spec/schemas/common.schema.json by scripts/model-types.ts (`bun run types`). Do not edit: change the schema and regenerate. */
|
|
2
|
+
/** A SHA-256 digest as 64 lowercase hex characters. */
|
|
3
|
+
export type Sha256 = string;
|
|
4
|
+
/** An RFC 3339 time in UTC, as seshi writes it (`2026-11-14T09:00:00.000Z`). */
|
|
5
|
+
export type Timestamp = string;
|
|
6
|
+
/** How an envelope arrived (X4.1): an upload from the CLI, a capture hook, an OTLP push, or one of the pollers. */
|
|
7
|
+
export type SourceKind = "upload" | "hook" | "otlp" | "datadog" | "s3" | "cursor-cloud";
|
|
8
|
+
/** A configured source's id, or `upload` for hooks and the CLI: words of lowercase letters and digits joined by single `-`. */
|
|
9
|
+
export type SourceId = string;
|
|
10
|
+
/** Which kind of credential made a call (X5.1, X5.9): `person` (IdP session token or org key with a stated username), `device` (write-only device token), `service` (a service account: a reader, an OTLP destination, a poller), `admin` (an admin token, or the session token of a person with the admin role), `static` (a token from config) or `local` (a serverless laptop writing its owner's folder of the bucket directly, F11.4). */
|
|
11
|
+
export type CallerKind = "person" | "device" | "service" | "admin" | "static" | "local";
|
|
12
|
+
/** Who wrote something (X5.5): the caller's kind, the person or service account, the credential it used, and the source the data came through. */
|
|
13
|
+
export interface Writer {
|
|
14
|
+
kind: CallerKind;
|
|
15
|
+
/** The owner id of the person (X5.8), or `svc:<source-id>` for a service account. */
|
|
16
|
+
principal: string;
|
|
17
|
+
/** The id of the token or key used, when it has one; never the secret. */
|
|
18
|
+
credential_id?: string;
|
|
19
|
+
source_id: SourceId;
|
|
20
|
+
}
|
|
21
|
+
/** Why the session belongs to its owner (X5.5): `verified` (an IdP sign-in, or a credential the operator bound to the owner), `claimed` (an org-key caller stated the username, X5.12) or `service` (an org-level source's service account, X5.4). */
|
|
22
|
+
export type OwnerBasis = "verified" | "claimed" | "service";
|
|
23
|
+
/** How a log is encoded: one JSON value per line (`jsonl`), or one JSON document (`json`). */
|
|
24
|
+
export type LogEncoding = "jsonl" | "json";
|
|
25
|
+
/** Who may read a session (X5.10): `org`, every member; `owner`, only its owner. Admins and services see everything. */
|
|
26
|
+
export type Visibility = "org" | "owner";
|
|
27
|
+
/** Identity the data asserts, copied from a fixed allowlist (X5.5). Never decides ownership (X5.4); with no raw stored, this is the only place it survives. */
|
|
28
|
+
export interface Claims {
|
|
29
|
+
/** An email the data names (`trajectory.user_email`). */
|
|
30
|
+
email?: string;
|
|
31
|
+
/** A display name the data names. */
|
|
32
|
+
name?: string;
|
|
33
|
+
/** A username the caller stated or the data names. */
|
|
34
|
+
username?: string;
|
|
35
|
+
/** The git `user.email` of the working copy. */
|
|
36
|
+
git_email?: string;
|
|
37
|
+
/** The git `user.name` of the working copy. */
|
|
38
|
+
git_name?: string;
|
|
39
|
+
/** Account ids by vendor (`anthropic`, `openai`, `cursor`, …), as the agent records them. */
|
|
40
|
+
account_ids?: {
|
|
41
|
+
[key: string]: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Where in the source the data was read (X4.1): enough to fetch it again for reprocessing (X4.9), never the content. */
|
|
45
|
+
export interface SourceLocation {
|
|
46
|
+
/** An S3 object's key. */
|
|
47
|
+
object_key?: string;
|
|
48
|
+
/** That object's ETag when it was read. */
|
|
49
|
+
etag?: string;
|
|
50
|
+
/** An API cursor or time window, as the poller writes it. */
|
|
51
|
+
cursor?: string;
|
|
52
|
+
}
|
|
53
|
+
/** Which source a write came from and how it was read: the route, the configured source, the format adapter that normalized it and where in the source it was. */
|
|
54
|
+
export interface Provenance {
|
|
55
|
+
source: SourceKind;
|
|
56
|
+
source_id: SourceId;
|
|
57
|
+
/** The format adapter the payload was normalized with (`claude-code`, `otlp-genai`, …). */
|
|
58
|
+
format?: string;
|
|
59
|
+
location?: SourceLocation;
|
|
60
|
+
}
|
|
61
|
+
/** Which code normalized the records, so the sessions an adapter fix affects can be picked out and rebuilt (X4.9). */
|
|
62
|
+
export interface Normalizer {
|
|
63
|
+
name: string;
|
|
64
|
+
version: string;
|
|
65
|
+
/** The format adapter's own normalizer version (`1+trajectory.0.3.0`): what the records a transcript normalizes to depend on, compared number by number. On a session's metadata it is the oldest that built any of its stored traces, so a session is stale when it is older than the format's current one (X4.9). Absent on what was written before it was recorded, which counts as stale. */
|
|
66
|
+
format_version?: string;
|
|
67
|
+
}
|
|
68
|
+
/** Marks a trace that is the tail of an already-stored session. */
|
|
69
|
+
export interface Continuation {
|
|
70
|
+
/** Index of the first record of this trace (after its meta record) within the session's full record list. */
|
|
71
|
+
from_record: number;
|
|
72
|
+
/** `prefixSha256` of the session's records before it: sha256 of their canonical JSON. */
|
|
73
|
+
prefix_sha256: Sha256;
|
|
74
|
+
}
|
|
75
|
+
/** What redaction did, never what it matched (F2): the rule set that ran, and how many times each rule fired. */
|
|
76
|
+
export interface RedactionSummary {
|
|
77
|
+
/** sha256 of the rule set that ran (built-in rules plus the operator's packs). */
|
|
78
|
+
rule_set: Sha256;
|
|
79
|
+
/** Matches by rule id. */
|
|
80
|
+
counts: {
|
|
81
|
+
[key: string]: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/** common.schema.json as data, without its annotations: what `schemaProblems` checks against. */
|
|
85
|
+
export declare const JSON_SCHEMA: {
|
|
86
|
+
$id: string;
|
|
87
|
+
$defs: {
|
|
88
|
+
Sha256: {
|
|
89
|
+
type: string;
|
|
90
|
+
pattern: string;
|
|
91
|
+
};
|
|
92
|
+
Timestamp: {
|
|
93
|
+
type: string;
|
|
94
|
+
format: string;
|
|
95
|
+
};
|
|
96
|
+
SourceKind: {
|
|
97
|
+
type: string;
|
|
98
|
+
enum: string[];
|
|
99
|
+
};
|
|
100
|
+
SourceId: {
|
|
101
|
+
type: string;
|
|
102
|
+
pattern: string;
|
|
103
|
+
};
|
|
104
|
+
CallerKind: {
|
|
105
|
+
type: string;
|
|
106
|
+
enum: string[];
|
|
107
|
+
};
|
|
108
|
+
Writer: {
|
|
109
|
+
type: string;
|
|
110
|
+
properties: {
|
|
111
|
+
kind: {
|
|
112
|
+
$ref: string;
|
|
113
|
+
};
|
|
114
|
+
principal: {
|
|
115
|
+
type: string;
|
|
116
|
+
minLength: number;
|
|
117
|
+
};
|
|
118
|
+
credential_id: {
|
|
119
|
+
type: string;
|
|
120
|
+
minLength: number;
|
|
121
|
+
};
|
|
122
|
+
source_id: {
|
|
123
|
+
$ref: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
required: string[];
|
|
127
|
+
additionalProperties: boolean;
|
|
128
|
+
};
|
|
129
|
+
OwnerBasis: {
|
|
130
|
+
type: string;
|
|
131
|
+
enum: string[];
|
|
132
|
+
};
|
|
133
|
+
LogEncoding: {
|
|
134
|
+
enum: string[];
|
|
135
|
+
};
|
|
136
|
+
Visibility: {
|
|
137
|
+
type: string;
|
|
138
|
+
enum: string[];
|
|
139
|
+
};
|
|
140
|
+
Claims: {
|
|
141
|
+
type: string;
|
|
142
|
+
properties: {
|
|
143
|
+
email: {
|
|
144
|
+
type: string;
|
|
145
|
+
};
|
|
146
|
+
name: {
|
|
147
|
+
type: string;
|
|
148
|
+
};
|
|
149
|
+
username: {
|
|
150
|
+
type: string;
|
|
151
|
+
};
|
|
152
|
+
git_email: {
|
|
153
|
+
type: string;
|
|
154
|
+
};
|
|
155
|
+
git_name: {
|
|
156
|
+
type: string;
|
|
157
|
+
};
|
|
158
|
+
account_ids: {
|
|
159
|
+
type: string;
|
|
160
|
+
additionalProperties: {
|
|
161
|
+
type: string;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
additionalProperties: boolean;
|
|
166
|
+
};
|
|
167
|
+
SourceLocation: {
|
|
168
|
+
type: string;
|
|
169
|
+
properties: {
|
|
170
|
+
object_key: {
|
|
171
|
+
type: string;
|
|
172
|
+
};
|
|
173
|
+
etag: {
|
|
174
|
+
type: string;
|
|
175
|
+
};
|
|
176
|
+
cursor: {
|
|
177
|
+
type: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
additionalProperties: boolean;
|
|
181
|
+
};
|
|
182
|
+
Provenance: {
|
|
183
|
+
type: string;
|
|
184
|
+
properties: {
|
|
185
|
+
source: {
|
|
186
|
+
$ref: string;
|
|
187
|
+
};
|
|
188
|
+
source_id: {
|
|
189
|
+
$ref: string;
|
|
190
|
+
};
|
|
191
|
+
format: {
|
|
192
|
+
type: string;
|
|
193
|
+
minLength: number;
|
|
194
|
+
};
|
|
195
|
+
location: {
|
|
196
|
+
$ref: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
required: string[];
|
|
200
|
+
additionalProperties: boolean;
|
|
201
|
+
};
|
|
202
|
+
Normalizer: {
|
|
203
|
+
type: string;
|
|
204
|
+
properties: {
|
|
205
|
+
name: {
|
|
206
|
+
type: string;
|
|
207
|
+
minLength: number;
|
|
208
|
+
};
|
|
209
|
+
version: {
|
|
210
|
+
type: string;
|
|
211
|
+
minLength: number;
|
|
212
|
+
};
|
|
213
|
+
format_version: {
|
|
214
|
+
type: string;
|
|
215
|
+
minLength: number;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
required: string[];
|
|
219
|
+
additionalProperties: boolean;
|
|
220
|
+
};
|
|
221
|
+
Continuation: {
|
|
222
|
+
type: string;
|
|
223
|
+
properties: {
|
|
224
|
+
from_record: {
|
|
225
|
+
type: string;
|
|
226
|
+
minimum: number;
|
|
227
|
+
};
|
|
228
|
+
prefix_sha256: {
|
|
229
|
+
$ref: string;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
required: string[];
|
|
233
|
+
additionalProperties: boolean;
|
|
234
|
+
};
|
|
235
|
+
RedactionSummary: {
|
|
236
|
+
type: string;
|
|
237
|
+
properties: {
|
|
238
|
+
rule_set: {
|
|
239
|
+
$ref: string;
|
|
240
|
+
};
|
|
241
|
+
counts: {
|
|
242
|
+
type: string;
|
|
243
|
+
additionalProperties: {
|
|
244
|
+
type: string;
|
|
245
|
+
minimum: number;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
required: string[];
|
|
250
|
+
additionalProperties: boolean;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
};
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/** Generated from spec/schemas/envelope.schema.json by scripts/model-types.ts (`bun run types`). Do not edit: change the schema and regenerate. */
|
|
2
|
+
import type { CallerKind, Claims, LogEncoding, OwnerBasis, Sha256, SourceId, SourceKind, SourceLocation, Timestamp, Visibility } from "./common.js";
|
|
3
|
+
/** The `schema` value of every Envelope object. */
|
|
4
|
+
export declare const SCHEMA_ID: "seshi/envelope/1";
|
|
5
|
+
/** `seshi/envelope/1`: the only input to the pipeline (X4.1). Every source builds one: the HTTP routes from requests, integrations through the submit() context. It carries the payload, which session it is, who sent it and whom it belongs to, and enough provenance to fetch it again. Never stored: the pipeline normalizes, redacts, filters and reviews it in memory and writes the trace (X4.3). */
|
|
6
|
+
export interface Envelope {
|
|
7
|
+
schema: "seshi/envelope/1";
|
|
8
|
+
source: SourceKind;
|
|
9
|
+
source_id: SourceId;
|
|
10
|
+
/** The format adapter for the payload (`claude-code`, `codex`, `otlp-genai`, …). */
|
|
11
|
+
format: string;
|
|
12
|
+
/** The session's id as the source names it (the agent's session id; `anthropic.session.id` for OTLP). */
|
|
13
|
+
session_key: string;
|
|
14
|
+
payload: Payload;
|
|
15
|
+
caller: Caller;
|
|
16
|
+
claims?: Claims;
|
|
17
|
+
/** The owner the session belongs to, resolved from the caller (X5.4, X5.8). */
|
|
18
|
+
owner: string;
|
|
19
|
+
owner_basis: OwnerBasis;
|
|
20
|
+
/** Identifies the envelope across resends (X4.7): a resend with the same key gets the same answer and is processed once. Session, byte offset and a digest of the text for a hook or upload; bucket, key and ETag for S3; trace and span ids for OTLP and Datadog; agent and run id for Cursor Cloud. */
|
|
21
|
+
idempotency_key: string;
|
|
22
|
+
provenance?: SourceLocation;
|
|
23
|
+
received_at: Timestamp;
|
|
24
|
+
/** The visibility the request asked for, if any (X5.10). */
|
|
25
|
+
visibility?: Visibility;
|
|
26
|
+
/** A whole upload that may replace the session rather than extend it (X4.6). Only the session's original writer or an admin may set it. */
|
|
27
|
+
replace?: boolean;
|
|
28
|
+
/** A whole upload that rebuilds the session from the whole log and reviews it again, even when the log only extends what is stored (X4.9): the session is replaced as with `replace`, which it needs the same permission as. The uploader sends it for sessions the server marks stale, and `seshi capture resend` by hand. */
|
|
29
|
+
rebuild?: boolean;
|
|
30
|
+
/** What the uploader says shipped of the session before, from an earlier answer. The server's own state decides whether a whole upload extends the session; this is used only for a session that has none. */
|
|
31
|
+
shipped?: ShippedPrefix;
|
|
32
|
+
project?: string;
|
|
33
|
+
branch?: string;
|
|
34
|
+
parent_session_id?: string;
|
|
35
|
+
fork_of?: string;
|
|
36
|
+
/** The hash of the uploader's retraction secret (F9.7), sent with a session's first upload. */
|
|
37
|
+
retract_hash?: Sha256;
|
|
38
|
+
}
|
|
39
|
+
/** An append-only log (X4.2), whole or a chunk from `offset`, or a batch of spans for the span assembler. */
|
|
40
|
+
export type Payload = LogPayload | SpanPayload;
|
|
41
|
+
export interface LogPayload {
|
|
42
|
+
kind: "log";
|
|
43
|
+
encoding: LogEncoding;
|
|
44
|
+
/** The log's text from `offset`. */
|
|
45
|
+
text: string;
|
|
46
|
+
/** The byte offset of `text` in the session's log: 0 for the whole log. */
|
|
47
|
+
offset: number;
|
|
48
|
+
}
|
|
49
|
+
/** A batch of spans for the span assembler (X4.2, F4.4): the call returns once they are in the span store, and the assembler publishes the session later. */
|
|
50
|
+
export interface SpanPayload {
|
|
51
|
+
kind: "spans";
|
|
52
|
+
/** OTLP spans in their JSON mapping, as received or as a poller built them. */
|
|
53
|
+
spans: Record<string, unknown>[];
|
|
54
|
+
/** The batch's OTLP resource attributes (`service.name`, …) in their JSON mapping, when the spans came with one. */
|
|
55
|
+
resource?: Record<string, unknown>[];
|
|
56
|
+
}
|
|
57
|
+
export interface ShippedPrefix {
|
|
58
|
+
/** How many normalized records shipped, from the start. */
|
|
59
|
+
records: number;
|
|
60
|
+
prefix_sha256: Sha256;
|
|
61
|
+
}
|
|
62
|
+
/** The verified principal that sent the envelope and the credential it used; pollers act as their source's service account (X5.4). */
|
|
63
|
+
export interface Caller {
|
|
64
|
+
kind: CallerKind;
|
|
65
|
+
principal: string;
|
|
66
|
+
credential_id?: string;
|
|
67
|
+
}
|
|
68
|
+
/** envelope.schema.json as data, without its annotations: what `schemaProblems` checks against. */
|
|
69
|
+
export declare const JSON_SCHEMA: {
|
|
70
|
+
$id: string;
|
|
71
|
+
type: string;
|
|
72
|
+
properties: {
|
|
73
|
+
schema: {
|
|
74
|
+
const: string;
|
|
75
|
+
};
|
|
76
|
+
source: {
|
|
77
|
+
$ref: string;
|
|
78
|
+
};
|
|
79
|
+
source_id: {
|
|
80
|
+
$ref: string;
|
|
81
|
+
};
|
|
82
|
+
format: {
|
|
83
|
+
type: string;
|
|
84
|
+
minLength: number;
|
|
85
|
+
};
|
|
86
|
+
session_key: {
|
|
87
|
+
type: string;
|
|
88
|
+
minLength: number;
|
|
89
|
+
};
|
|
90
|
+
payload: {
|
|
91
|
+
$ref: string;
|
|
92
|
+
};
|
|
93
|
+
caller: {
|
|
94
|
+
$ref: string;
|
|
95
|
+
};
|
|
96
|
+
claims: {
|
|
97
|
+
$ref: string;
|
|
98
|
+
};
|
|
99
|
+
owner: {
|
|
100
|
+
type: string;
|
|
101
|
+
minLength: number;
|
|
102
|
+
};
|
|
103
|
+
owner_basis: {
|
|
104
|
+
$ref: string;
|
|
105
|
+
};
|
|
106
|
+
idempotency_key: {
|
|
107
|
+
type: string;
|
|
108
|
+
minLength: number;
|
|
109
|
+
maxLength: number;
|
|
110
|
+
};
|
|
111
|
+
provenance: {
|
|
112
|
+
$ref: string;
|
|
113
|
+
};
|
|
114
|
+
received_at: {
|
|
115
|
+
$ref: string;
|
|
116
|
+
};
|
|
117
|
+
visibility: {
|
|
118
|
+
$ref: string;
|
|
119
|
+
};
|
|
120
|
+
replace: {
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
rebuild: {
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
shipped: {
|
|
127
|
+
$ref: string;
|
|
128
|
+
};
|
|
129
|
+
project: {
|
|
130
|
+
type: string;
|
|
131
|
+
};
|
|
132
|
+
branch: {
|
|
133
|
+
type: string;
|
|
134
|
+
};
|
|
135
|
+
parent_session_id: {
|
|
136
|
+
type: string;
|
|
137
|
+
};
|
|
138
|
+
fork_of: {
|
|
139
|
+
type: string;
|
|
140
|
+
};
|
|
141
|
+
retract_hash: {
|
|
142
|
+
$ref: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
required: string[];
|
|
146
|
+
additionalProperties: boolean;
|
|
147
|
+
$defs: {
|
|
148
|
+
Payload: {
|
|
149
|
+
oneOf: {
|
|
150
|
+
$ref: string;
|
|
151
|
+
}[];
|
|
152
|
+
};
|
|
153
|
+
LogPayload: {
|
|
154
|
+
type: string;
|
|
155
|
+
properties: {
|
|
156
|
+
kind: {
|
|
157
|
+
const: string;
|
|
158
|
+
};
|
|
159
|
+
encoding: {
|
|
160
|
+
$ref: string;
|
|
161
|
+
};
|
|
162
|
+
text: {
|
|
163
|
+
type: string;
|
|
164
|
+
};
|
|
165
|
+
offset: {
|
|
166
|
+
type: string;
|
|
167
|
+
minimum: number;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
required: string[];
|
|
171
|
+
additionalProperties: boolean;
|
|
172
|
+
};
|
|
173
|
+
SpanPayload: {
|
|
174
|
+
type: string;
|
|
175
|
+
properties: {
|
|
176
|
+
kind: {
|
|
177
|
+
const: string;
|
|
178
|
+
};
|
|
179
|
+
spans: {
|
|
180
|
+
type: string;
|
|
181
|
+
items: {
|
|
182
|
+
type: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
resource: {
|
|
186
|
+
type: string;
|
|
187
|
+
items: {
|
|
188
|
+
type: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
required: string[];
|
|
193
|
+
additionalProperties: boolean;
|
|
194
|
+
};
|
|
195
|
+
ShippedPrefix: {
|
|
196
|
+
type: string;
|
|
197
|
+
properties: {
|
|
198
|
+
records: {
|
|
199
|
+
type: string;
|
|
200
|
+
minimum: number;
|
|
201
|
+
};
|
|
202
|
+
prefix_sha256: {
|
|
203
|
+
$ref: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
required: string[];
|
|
207
|
+
additionalProperties: boolean;
|
|
208
|
+
};
|
|
209
|
+
Caller: {
|
|
210
|
+
type: string;
|
|
211
|
+
properties: {
|
|
212
|
+
kind: {
|
|
213
|
+
$ref: string;
|
|
214
|
+
};
|
|
215
|
+
principal: {
|
|
216
|
+
type: string;
|
|
217
|
+
minLength: number;
|
|
218
|
+
};
|
|
219
|
+
credential_id: {
|
|
220
|
+
type: string;
|
|
221
|
+
minLength: number;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
required: string[];
|
|
225
|
+
additionalProperties: boolean;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** Generated from spec/schemas/layout.schema.json by scripts/model-types.ts (`bun run types`). Do not edit: change the schema and regenerate. */
|
|
2
|
+
import type { Timestamp } from "./common.js";
|
|
3
|
+
/** `<prefix>/seshi.json`, written once (If-None-Match) when a prefix is first used. It says the prefix holds seshi's layout, which canonical trace format its traces are, and which deployment and organization it belongs to: a server whose config names another refuses to start (X1.4). `seshi/layout/2` (F11.7) adds the mode the bucket is used in and the oldest seshi that may write it; a `seshi/layout/1` marker reads as mode unknown and no minimum version. Writers upgrade 1 to 2 (If-Match) only when a command sets one of the new fields. */
|
|
4
|
+
export interface LayoutMarker {
|
|
5
|
+
schema: "seshi/layout/1" | "seshi/layout/2";
|
|
6
|
+
/** The canonical trace format every trace object under the prefix is written in. */
|
|
7
|
+
trace_schema: "seshi/trace/1";
|
|
8
|
+
/** The deployment the prefix belongs to: config's `store.deployment_id`, or one generated by the first writer. */
|
|
9
|
+
deployment_id: string;
|
|
10
|
+
/** The organization the deployment serves (X1.1), once a config has named it. */
|
|
11
|
+
org?: string;
|
|
12
|
+
created_at: Timestamp;
|
|
13
|
+
/** The program that wrote the marker (`seshi/0.9.0`). */
|
|
14
|
+
created_by: string;
|
|
15
|
+
/** Schema 2: which mode the bucket is used in now (F11.8): `server` (laptops upload through `seshi serve`) or `serverless` (laptops write it directly). */
|
|
16
|
+
mode?: "server" | "serverless";
|
|
17
|
+
/** Schema 2: the oldest seshi that may write the bucket, as `0.10.0`. Older ones refuse to write and read with a warning. */
|
|
18
|
+
min_version?: string;
|
|
19
|
+
/** Schema 2: when `mode` was last set. */
|
|
20
|
+
mode_changed_at?: Timestamp;
|
|
21
|
+
/** Schema 2: the program that last set `mode` (`seshi/0.10.0`). */
|
|
22
|
+
mode_changed_by?: string;
|
|
23
|
+
}
|
|
24
|
+
/** layout.schema.json as data, without its annotations: what `schemaProblems` checks against. */
|
|
25
|
+
export declare const JSON_SCHEMA: {
|
|
26
|
+
$id: string;
|
|
27
|
+
type: string;
|
|
28
|
+
properties: {
|
|
29
|
+
schema: {
|
|
30
|
+
enum: string[];
|
|
31
|
+
};
|
|
32
|
+
trace_schema: {
|
|
33
|
+
const: string;
|
|
34
|
+
};
|
|
35
|
+
deployment_id: {
|
|
36
|
+
type: string;
|
|
37
|
+
minLength: number;
|
|
38
|
+
};
|
|
39
|
+
org: {
|
|
40
|
+
type: string;
|
|
41
|
+
minLength: number;
|
|
42
|
+
};
|
|
43
|
+
created_at: {
|
|
44
|
+
$ref: string;
|
|
45
|
+
};
|
|
46
|
+
created_by: {
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
49
|
+
mode: {
|
|
50
|
+
enum: string[];
|
|
51
|
+
};
|
|
52
|
+
min_version: {
|
|
53
|
+
type: string;
|
|
54
|
+
pattern: string;
|
|
55
|
+
};
|
|
56
|
+
mode_changed_at: {
|
|
57
|
+
$ref: string;
|
|
58
|
+
};
|
|
59
|
+
mode_changed_by: {
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
required: string[];
|
|
64
|
+
additionalProperties: boolean;
|
|
65
|
+
};
|