@ai-matrx/desktop-protocol 0.21.29 → 0.21.30
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/CHANGELOG.md +6 -0
- package/dist/client.cjs +1277 -754
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +7 -2
- package/dist/client.d.ts +7 -2
- package/dist/client.js +1277 -754
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +1136 -456
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2195 -85
- package/dist/index.d.ts +2195 -85
- package/dist/index.js +1136 -456
- package/dist/index.js.map +1 -1
- package/dist/{models-BpzT2hqF.d.cts → models-CzKyJhDP.d.cts} +6864 -3303
- package/dist/{models-BpzT2hqF.d.ts → models-CzKyJhDP.d.ts} +6864 -3303
- package/dist/react.d.cts +1585 -1
- package/dist/react.d.ts +1585 -1
- package/generated/desktop-protocol.schema.json +3923 -222
- package/package.json +2 -2
package/dist/client.cjs
CHANGED
|
@@ -144,7 +144,7 @@ var import_zod2 = require("zod");
|
|
|
144
144
|
var import_zod = require("zod");
|
|
145
145
|
var import_uuid = require("@ai-matrx/kit/uuid");
|
|
146
146
|
var PROTOCOL_MAJOR = 1;
|
|
147
|
-
var PROTOCOL_MINOR =
|
|
147
|
+
var PROTOCOL_MINOR = 39;
|
|
148
148
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
149
149
|
var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
150
150
|
var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -1106,7 +1106,22 @@ var AccountAgent = import_zod14.z.strictObject({
|
|
|
1106
1106
|
shared_by: import_zod14.z.string().max(320).nullable(),
|
|
1107
1107
|
/** The organization it belongs to. */
|
|
1108
1108
|
organization: import_zod14.z.string().max(200).nullable(),
|
|
1109
|
-
updated_at_ms: epochMs
|
|
1109
|
+
updated_at_ms: epochMs,
|
|
1110
|
+
// 1.39: the catalogue's own row (agx_get_list_full, read whole through @ai-matrx/agents/catalog).
|
|
1111
|
+
/** The agent's tags (the library's search and its inspector). */
|
|
1112
|
+
tags: import_zod14.z.array(import_zod14.z.string().max(120)).max(50).optional(),
|
|
1113
|
+
/** The model it runs (a model catalogue id); absent when it names none. */
|
|
1114
|
+
model_id: AccountRowId.optional(),
|
|
1115
|
+
/** The person's access: owner, admin, editor, viewer or system (the database's own words); absent when unknown. */
|
|
1116
|
+
access_level: import_zod14.z.string().min(1).max(40).optional(),
|
|
1117
|
+
/** The organization's id (the label is `organization`); absent when it has none. */
|
|
1118
|
+
organization_id: AccountRowId.optional(),
|
|
1119
|
+
/** Whose it is: the person's own, shared with them, or one AI Matrx ships (Gallery). */
|
|
1120
|
+
origin: import_zod14.z.enum(["mine", "shared", "system"]).optional(),
|
|
1121
|
+
/** Archived (the catalogue's archive filter decides whether the library lists it). */
|
|
1122
|
+
is_archived: import_zod14.z.boolean().optional(),
|
|
1123
|
+
/** An orchestra: it conducts other agents. */
|
|
1124
|
+
orchestra: import_zod14.z.boolean().optional()
|
|
1110
1125
|
});
|
|
1111
1126
|
var AccountAgentsListParams = import_zod14.z.strictObject({});
|
|
1112
1127
|
var AccountAgentsListResult = import_zod14.z.strictObject({
|
|
@@ -1115,6 +1130,70 @@ var AccountAgentsListResult = import_zod14.z.strictObject({
|
|
|
1115
1130
|
problem: import_zod14.z.string().max(300).nullable(),
|
|
1116
1131
|
agents: import_zod14.z.array(AccountAgent).max(2e3)
|
|
1117
1132
|
});
|
|
1133
|
+
var AccountAgentVariable = import_zod14.z.strictObject({
|
|
1134
|
+
name: import_zod14.z.string().min(1).max(200),
|
|
1135
|
+
/** The default value as text ("" when it has none). */
|
|
1136
|
+
default_value: import_zod14.z.string().max(4e3),
|
|
1137
|
+
required: import_zod14.z.boolean(),
|
|
1138
|
+
help: import_zod14.z.string().max(1e3)
|
|
1139
|
+
});
|
|
1140
|
+
var AccountAgentDetail = import_zod14.z.strictObject({
|
|
1141
|
+
agent: AccountAgent,
|
|
1142
|
+
/** The inputs a run asks for (the agent's variables). */
|
|
1143
|
+
variables: import_zod14.z.array(AccountAgentVariable).max(100),
|
|
1144
|
+
/** How many tools, custom tools, skills and connections it may use. */
|
|
1145
|
+
tool_count: import_zod14.z.int().min(0),
|
|
1146
|
+
custom_tool_count: import_zod14.z.int().min(0),
|
|
1147
|
+
skill_count: import_zod14.z.int().min(0),
|
|
1148
|
+
connection_count: import_zod14.z.int().min(0),
|
|
1149
|
+
/** The model's display name when the catalogue knows it. */
|
|
1150
|
+
model_name: import_zod14.z.string().max(200).nullable()
|
|
1151
|
+
});
|
|
1152
|
+
var AccountAgentsGetParams = import_zod14.z.strictObject({ agent_id: AccountRowId });
|
|
1153
|
+
var AccountAgentsGetResult = import_zod14.z.strictObject({
|
|
1154
|
+
state: AccountReadState,
|
|
1155
|
+
problem: import_zod14.z.string().max(300).nullable(),
|
|
1156
|
+
/** Null when the person cannot open it (not theirs, not shared with them, or gone). */
|
|
1157
|
+
detail: AccountAgentDetail.nullable()
|
|
1158
|
+
});
|
|
1159
|
+
var AccountAgentRunStatus = import_zod14.z.enum(["succeeded", "warned", "failed", "stopped", "waiting", "running"]);
|
|
1160
|
+
var AccountAgentRun = import_zod14.z.strictObject({
|
|
1161
|
+
run_id: AccountRowId,
|
|
1162
|
+
status: AccountAgentRunStatus,
|
|
1163
|
+
started_at_ms: epochMs,
|
|
1164
|
+
completed_at_ms: epochMs.nullable(),
|
|
1165
|
+
duration_ms: import_zod14.z.int().min(0).nullable(),
|
|
1166
|
+
cost: import_zod14.z.number().min(0).nullable(),
|
|
1167
|
+
tokens: import_zod14.z.int().min(0).nullable(),
|
|
1168
|
+
/** One line of the answer (at most 240 characters), when the run kept one. */
|
|
1169
|
+
output_preview: import_zod14.z.string().max(240).nullable(),
|
|
1170
|
+
/** The run's error, one line. */
|
|
1171
|
+
error: import_zod14.z.string().max(300).nullable(),
|
|
1172
|
+
/** The mandate it served, when one named it. */
|
|
1173
|
+
mandate_key: import_zod14.z.string().max(200).nullable(),
|
|
1174
|
+
organization: import_zod14.z.string().max(200).nullable(),
|
|
1175
|
+
/** The conversation that holds its transcript, when it kept one. */
|
|
1176
|
+
conversation_id: AccountRowId.nullable(),
|
|
1177
|
+
has_transcript: import_zod14.z.boolean()
|
|
1178
|
+
});
|
|
1179
|
+
var AccountAgentRunSort = import_zod14.z.enum(["started_at", "duration", "cost", "status"]);
|
|
1180
|
+
var AccountAgentsRunsParams = import_zod14.z.strictObject({
|
|
1181
|
+
agent_id: AccountRowId,
|
|
1182
|
+
status: AccountAgentRunStatus.optional(),
|
|
1183
|
+
sort: AccountAgentRunSort.optional(),
|
|
1184
|
+
descending: import_zod14.z.boolean().optional(),
|
|
1185
|
+
offset: import_zod14.z.int().min(0).max(1e5).optional(),
|
|
1186
|
+
limit: import_zod14.z.int().min(1).max(100).optional()
|
|
1187
|
+
});
|
|
1188
|
+
var AccountAgentsRunsResult = import_zod14.z.strictObject({
|
|
1189
|
+
state: AccountReadState,
|
|
1190
|
+
problem: import_zod14.z.string().max(300).nullable(),
|
|
1191
|
+
/** Every run of this agent the person may see (rows is one page of it). */
|
|
1192
|
+
total: import_zod14.z.int().min(0),
|
|
1193
|
+
rows: import_zod14.z.array(AccountAgentRun).max(100)
|
|
1194
|
+
});
|
|
1195
|
+
var AccountAgentsFavoriteParams = import_zod14.z.strictObject({ agent_id: AccountRowId, favorite: import_zod14.z.boolean() });
|
|
1196
|
+
var AccountAgentsFavoriteResult = import_zod14.z.strictObject({ favorite: import_zod14.z.boolean() });
|
|
1118
1197
|
var VaultItemKind = import_zod14.z.enum(["login", "passkey", "key", "other"]);
|
|
1119
1198
|
var VaultFieldSummary = import_zod14.z.strictObject({
|
|
1120
1199
|
key: import_zod14.z.string().min(1).max(120),
|
|
@@ -2024,24 +2103,389 @@ var CodingHistoryProgressEvent = import_zod27.z.strictObject({
|
|
|
2024
2103
|
failed: nonNegInt
|
|
2025
2104
|
});
|
|
2026
2105
|
|
|
2027
|
-
// src/schema/
|
|
2106
|
+
// src/schema/coding-sessions.ts
|
|
2028
2107
|
var import_zod28 = require("zod");
|
|
2108
|
+
var CodingProviderName = import_zod28.z.enum(["claude", "codex"]);
|
|
2109
|
+
var CodingRunStatus = import_zod28.z.enum(["starting", "running", "completed", "stopped", "failed"]);
|
|
2110
|
+
var SessionKey = import_zod28.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/);
|
|
2111
|
+
var IsoTime = import_zod28.z.string().min(10).max(40);
|
|
2112
|
+
var LocalPath = import_zod28.z.string().min(1).max(4096);
|
|
2113
|
+
var CodingClientRequestId = import_zod28.z.string().regex(/^[A-Za-z0-9_-]{8,64}$/);
|
|
2114
|
+
var ShortText = import_zod28.z.string().max(500);
|
|
2115
|
+
var CodingRunUsage = import_zod28.z.strictObject({
|
|
2116
|
+
inputTokens: nonNegInt,
|
|
2117
|
+
outputTokens: nonNegInt,
|
|
2118
|
+
cachedInputTokens: nonNegInt
|
|
2119
|
+
});
|
|
2120
|
+
var CodingStartedBy = import_zod28.z.strictObject({
|
|
2121
|
+
kind: import_zod28.z.enum(["this_computer", "web", "phone", "agent", "other"]),
|
|
2122
|
+
label: import_zod28.z.string().min(1).max(80)
|
|
2123
|
+
});
|
|
2124
|
+
var CodingRunRecord = import_zod28.z.strictObject({
|
|
2125
|
+
runId: import_zod28.z.string().min(1).max(64),
|
|
2126
|
+
sessionId: SessionKey,
|
|
2127
|
+
provider: CodingProviderName,
|
|
2128
|
+
cwd: LocalPath,
|
|
2129
|
+
prompt: import_zod28.z.string().max(1048576),
|
|
2130
|
+
model: import_zod28.z.string().max(200).nullable(),
|
|
2131
|
+
status: CodingRunStatus,
|
|
2132
|
+
startedAt: IsoTime,
|
|
2133
|
+
endedAt: IsoTime.nullable(),
|
|
2134
|
+
error: import_zod28.z.string().max(65536).nullable(),
|
|
2135
|
+
usage: CodingRunUsage.nullable(),
|
|
2136
|
+
costUsd: import_zod28.z.number().nullable(),
|
|
2137
|
+
billing: import_zod28.z.enum(["subscription", "api", "unknown"]).nullable(),
|
|
2138
|
+
startedBy: CodingStartedBy.nullable()
|
|
2139
|
+
});
|
|
2140
|
+
var CodingSessionAgentPart = import_zod28.z.strictObject({
|
|
2141
|
+
part: import_zod28.z.enum(["instructions", "skills", "tools"]),
|
|
2142
|
+
loaded: nonNegInt,
|
|
2143
|
+
total: nonNegInt
|
|
2144
|
+
});
|
|
2145
|
+
var CodingSessionAgent = import_zod28.z.strictObject({
|
|
2146
|
+
agentId: import_zod28.z.string().min(1).max(64),
|
|
2147
|
+
versionId: import_zod28.z.string().max(64).nullable(),
|
|
2148
|
+
versionNumber: nonNegInt.nullable(),
|
|
2149
|
+
name: import_zod28.z.string().max(300),
|
|
2150
|
+
definitionHash: import_zod28.z.string().max(200),
|
|
2151
|
+
loaded: import_zod28.z.array(CodingSessionAgentPart).max(3),
|
|
2152
|
+
unavailable: import_zod28.z.array(import_zod28.z.strictObject({ kind: import_zod28.z.string().max(60), name: import_zod28.z.string().max(300), reason: ShortText })).max(500),
|
|
2153
|
+
skills: import_zod28.z.array(import_zod28.z.string().max(300)).max(500),
|
|
2154
|
+
tools: import_zod28.z.array(import_zod28.z.string().max(300)).max(500),
|
|
2155
|
+
variables: import_zod28.z.record(import_zod28.z.string().max(200), import_zod28.z.unknown()),
|
|
2156
|
+
blockDue: import_zod28.z.boolean(),
|
|
2157
|
+
deliveredAt: IsoTime.nullable(),
|
|
2158
|
+
replaces: import_zod28.z.string().max(300).nullable()
|
|
2159
|
+
});
|
|
2160
|
+
var CodingSessionRecord = import_zod28.z.strictObject({
|
|
2161
|
+
id: SessionKey,
|
|
2162
|
+
provider: CodingProviderName,
|
|
2163
|
+
providerSessionId: SessionKey.nullable(),
|
|
2164
|
+
cwd: LocalPath,
|
|
2165
|
+
title: import_zod28.z.string().max(500),
|
|
2166
|
+
model: import_zod28.z.string().max(200).nullable(),
|
|
2167
|
+
effort: import_zod28.z.string().max(40).nullable(),
|
|
2168
|
+
origin: import_zod28.z.enum(["started", "takeover"]),
|
|
2169
|
+
createdAt: IsoTime,
|
|
2170
|
+
updatedAt: IsoTime,
|
|
2171
|
+
lastRunId: import_zod28.z.string().max(64).nullable(),
|
|
2172
|
+
lastRunStatus: CodingRunStatus.nullable(),
|
|
2173
|
+
queued: import_zod28.z.array(import_zod28.z.string().max(1048576)).max(100),
|
|
2174
|
+
agent: CodingSessionAgent.nullable(),
|
|
2175
|
+
agentRemovedDue: import_zod28.z.boolean()
|
|
2176
|
+
});
|
|
2177
|
+
var CodingActiveElsewhere = import_zod28.z.strictObject({
|
|
2178
|
+
reason: import_zod28.z.enum(["process", "recent-write", "open-tool-call", "open"]),
|
|
2179
|
+
message: ShortText,
|
|
2180
|
+
/** The process driving it, when the evidence is a process (re-checked before any stop). */
|
|
2181
|
+
pid: import_zod28.z.int().min(1).nullable()
|
|
2182
|
+
});
|
|
2183
|
+
var CodingTitleSource = import_zod28.z.enum(["app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt", "unknown"]);
|
|
2184
|
+
var CodingDiscoveredChat = import_zod28.z.strictObject({
|
|
2185
|
+
provider: CodingProviderName,
|
|
2186
|
+
providerSessionId: SessionKey,
|
|
2187
|
+
cwd: LocalPath.nullable(),
|
|
2188
|
+
title: import_zod28.z.string().max(500),
|
|
2189
|
+
titleSource: CodingTitleSource.optional(),
|
|
2190
|
+
titlePending: import_zod28.z.boolean().optional(),
|
|
2191
|
+
archived: import_zod28.z.boolean().optional(),
|
|
2192
|
+
scheduled: import_zod28.z.boolean().optional(),
|
|
2193
|
+
unlisted: import_zod28.z.boolean().optional(),
|
|
2194
|
+
unavailable: ShortText.nullable(),
|
|
2195
|
+
updatedAt: IsoTime,
|
|
2196
|
+
source: import_zod28.z.string().max(60).nullable(),
|
|
2197
|
+
activeElsewhere: CodingActiveElsewhere.nullable()
|
|
2198
|
+
});
|
|
2199
|
+
var CodingTranscriptItem = import_zod28.z.discriminatedUnion("kind", [
|
|
2200
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("user"), id: import_zod28.z.string().max(200), text: import_zod28.z.string(), at: IsoTime.nullable() }),
|
|
2201
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("text"), id: import_zod28.z.string().max(200), text: import_zod28.z.string() }),
|
|
2202
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("text-delta"), id: import_zod28.z.string().max(200), text: import_zod28.z.string() }),
|
|
2203
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("reasoning"), id: import_zod28.z.string().max(200), text: import_zod28.z.string() }),
|
|
2204
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("tool-call"), id: import_zod28.z.string().max(200), name: import_zod28.z.string().max(300), input: import_zod28.z.unknown() }),
|
|
2205
|
+
import_zod28.z.strictObject({
|
|
2206
|
+
kind: import_zod28.z.literal("tool-result"),
|
|
2207
|
+
id: import_zod28.z.string().max(200),
|
|
2208
|
+
output: import_zod28.z.string(),
|
|
2209
|
+
isError: import_zod28.z.boolean(),
|
|
2210
|
+
/** The output's full size when only its start is here; `coding.item.full` reads the rest. */
|
|
2211
|
+
fullBytes: nonNegInt.optional()
|
|
2212
|
+
}),
|
|
2213
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("usage"), usage: CodingRunUsage, costUsd: import_zod28.z.number().nullable() }),
|
|
2214
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("notice"), id: import_zod28.z.string().max(200), level: import_zod28.z.enum(["info", "warning"]), text: import_zod28.z.string() }),
|
|
2215
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("error"), id: import_zod28.z.string().max(200), text: import_zod28.z.string() })
|
|
2216
|
+
]);
|
|
2217
|
+
var CodingHistoryRecord = import_zod28.z.strictObject({
|
|
2218
|
+
items: import_zod28.z.array(CodingTranscriptItem),
|
|
2219
|
+
/** Only the end of the chat is here; "Show earlier" reads more (a bigger `max_bytes`). */
|
|
2220
|
+
truncated: import_zod28.z.boolean(),
|
|
2221
|
+
unavailable: ShortText.nullable(),
|
|
2222
|
+
/** The last live item `seq` this read already contains; a watch applies only newer ones. */
|
|
2223
|
+
seq: nonNegInt
|
|
2224
|
+
});
|
|
2225
|
+
var CodingQuotaWindow = import_zod28.z.strictObject({
|
|
2226
|
+
label: import_zod28.z.string().max(120),
|
|
2227
|
+
usedPercent: import_zod28.z.number().nullable(),
|
|
2228
|
+
resetsAt: import_zod28.z.string().max(80).nullable(),
|
|
2229
|
+
valueLabel: import_zod28.z.string().max(120).nullable()
|
|
2230
|
+
});
|
|
2231
|
+
var CodingProviderProblem = import_zod28.z.strictObject({
|
|
2232
|
+
kind: import_zod28.z.enum(["usage-limit", "signed-out"]),
|
|
2233
|
+
message: import_zod28.z.string().max(2e3),
|
|
2234
|
+
until: import_zod28.z.string().max(120).nullable(),
|
|
2235
|
+
at: IsoTime
|
|
2236
|
+
});
|
|
2237
|
+
var CodingProviderBinary = import_zod28.z.strictObject({
|
|
2238
|
+
path: LocalPath,
|
|
2239
|
+
version: import_zod28.z.string().max(80).nullable(),
|
|
2240
|
+
source: import_zod28.z.enum(["desktop-app", "path", "npm-global", "configured"]),
|
|
2241
|
+
sourceLabel: import_zod28.z.string().max(120),
|
|
2242
|
+
newer: import_zod28.z.strictObject({ path: LocalPath, version: import_zod28.z.string().max(80), sourceLabel: import_zod28.z.string().max(120) }).nullable()
|
|
2243
|
+
});
|
|
2244
|
+
var CodingProviderStatus = import_zod28.z.strictObject({
|
|
2245
|
+
provider: CodingProviderName,
|
|
2246
|
+
label: import_zod28.z.string().max(60),
|
|
2247
|
+
installed: import_zod28.z.boolean(),
|
|
2248
|
+
version: import_zod28.z.string().max(80).nullable(),
|
|
2249
|
+
loggedIn: import_zod28.z.boolean(),
|
|
2250
|
+
billing: import_zod28.z.enum(["subscription", "api", "unknown"]),
|
|
2251
|
+
plan: import_zod28.z.string().max(80).nullable(),
|
|
2252
|
+
account: import_zod28.z.string().max(320).nullable(),
|
|
2253
|
+
problem: ShortText.nullable(),
|
|
2254
|
+
fix: ShortText.nullable(),
|
|
2255
|
+
ready: import_zod28.z.boolean(),
|
|
2256
|
+
lastProblem: CodingProviderProblem.nullable(),
|
|
2257
|
+
quota: import_zod28.z.array(CodingQuotaWindow).max(20),
|
|
2258
|
+
models: import_zod28.z.array(import_zod28.z.strictObject({ id: import_zod28.z.string().max(200), label: import_zod28.z.string().max(200) })).max(200),
|
|
2259
|
+
efforts: import_zod28.z.array(import_zod28.z.string().max(40)).max(20),
|
|
2260
|
+
defaultModel: import_zod28.z.strictObject({ id: import_zod28.z.string().max(200), source: import_zod28.z.enum(["settings", "driver"]) }).nullable(),
|
|
2261
|
+
defaultEffort: import_zod28.z.string().max(40).nullable(),
|
|
2262
|
+
binary: CodingProviderBinary.nullable()
|
|
2263
|
+
});
|
|
2264
|
+
var CodingChatPreference = import_zod28.z.strictObject({
|
|
2265
|
+
title: import_zod28.z.string().max(500).nullable(),
|
|
2266
|
+
pinned: import_zod28.z.boolean(),
|
|
2267
|
+
hidden: import_zod28.z.boolean(),
|
|
2268
|
+
/** When the person last had this chat open on any screen of this computer (the "New output" dot). */
|
|
2269
|
+
lastSeenAt: IsoTime.nullable(),
|
|
2270
|
+
updatedAt: IsoTime.nullable()
|
|
2271
|
+
});
|
|
2272
|
+
var CodingTitleStatus = import_zod28.z.strictObject({
|
|
2273
|
+
owner: import_zod28.z.boolean(),
|
|
2274
|
+
pending: import_zod28.z.boolean(),
|
|
2275
|
+
problem: ShortText.nullable(),
|
|
2276
|
+
renames: ShortText.nullable()
|
|
2277
|
+
});
|
|
2278
|
+
var CodingRecentRow = import_zod28.z.strictObject({
|
|
2279
|
+
target: import_zod28.z.string().min(3).max(200),
|
|
2280
|
+
title: import_zod28.z.string().max(500),
|
|
2281
|
+
provider: CodingProviderName,
|
|
2282
|
+
sessionId: SessionKey.nullable(),
|
|
2283
|
+
providerSessionId: SessionKey.nullable(),
|
|
2284
|
+
cwd: LocalPath.nullable(),
|
|
2285
|
+
updatedAt: IsoTime,
|
|
2286
|
+
state: import_zod28.z.enum(["running", "needs_attention", "new_output", "elsewhere", "idle"]),
|
|
2287
|
+
stateLabel: import_zod28.z.string().max(120).nullable(),
|
|
2288
|
+
pinned: import_zod28.z.boolean(),
|
|
2289
|
+
startedBy: CodingStartedBy.nullable()
|
|
2290
|
+
});
|
|
2291
|
+
var CodingFolderCheck = import_zod28.z.strictObject({
|
|
2292
|
+
path: import_zod28.z.string().max(4096),
|
|
2293
|
+
exists: import_zod28.z.boolean(),
|
|
2294
|
+
isDirectory: import_zod28.z.boolean()
|
|
2295
|
+
});
|
|
2296
|
+
var CodingRecentFolder = import_zod28.z.strictObject({ path: LocalPath, lastUsedAt: IsoTime, exists: import_zod28.z.boolean() });
|
|
2297
|
+
var CodingAgentSelectionParams = import_zod28.z.strictObject({
|
|
2298
|
+
agent_id: import_zod28.z.string().min(1).max(64),
|
|
2299
|
+
version_id: import_zod28.z.string().min(1).max(64).optional(),
|
|
2300
|
+
variables: import_zod28.z.record(import_zod28.z.string().max(200), import_zod28.z.unknown()).optional()
|
|
2301
|
+
});
|
|
2302
|
+
var CodingSendResult = import_zod28.z.strictObject({
|
|
2303
|
+
session: CodingSessionRecord,
|
|
2304
|
+
run: CodingRunRecord.nullable(),
|
|
2305
|
+
/** The prompt waits behind a live run (it shows as a queued bubble). */
|
|
2306
|
+
queued: import_zod28.z.boolean()
|
|
2307
|
+
});
|
|
2308
|
+
var CodingProvidersParams = import_zod28.z.strictObject({});
|
|
2309
|
+
var CodingProvidersResult = import_zod28.z.strictObject({ providers: import_zod28.z.array(CodingProviderStatus).max(4) });
|
|
2310
|
+
var CodingSessionsListParams = import_zod28.z.strictObject({});
|
|
2311
|
+
var CodingSessionsListResult = import_zod28.z.strictObject({
|
|
2312
|
+
sessions: import_zod28.z.array(CodingSessionRecord),
|
|
2313
|
+
/** The latest run of each session, by session id. */
|
|
2314
|
+
runs: import_zod28.z.record(import_zod28.z.string().max(128), CodingRunRecord),
|
|
2315
|
+
recent: import_zod28.z.array(CodingRecentRow),
|
|
2316
|
+
title_status: CodingTitleStatus
|
|
2317
|
+
});
|
|
2318
|
+
var CodingDiscoverParams = import_zod28.z.strictObject({ limit: import_zod28.z.int().min(1).max(1e3).optional() });
|
|
2319
|
+
var CodingDiscoverResult = import_zod28.z.strictObject({ chats: import_zod28.z.array(CodingDiscoveredChat) });
|
|
2320
|
+
var CodingRunsListParams = import_zod28.z.strictObject({ session_id: SessionKey });
|
|
2321
|
+
var CodingRunsListResult = import_zod28.z.strictObject({ runs: import_zod28.z.array(CodingRunRecord) });
|
|
2322
|
+
var CodingHistoryParams = import_zod28.z.strictObject({ session_id: SessionKey, max_bytes: import_zod28.z.int().min(1024).max(209715200).optional() });
|
|
2323
|
+
var CodingHistoryResult = CodingHistoryRecord;
|
|
2324
|
+
var CodingTranscriptReadParams = import_zod28.z.strictObject({
|
|
2325
|
+
provider: CodingProviderName,
|
|
2326
|
+
provider_session_id: SessionKey,
|
|
2327
|
+
max_bytes: import_zod28.z.int().min(1024).max(209715200).optional()
|
|
2328
|
+
});
|
|
2329
|
+
var CodingTranscriptReadResult = CodingHistoryRecord;
|
|
2330
|
+
var CodingItemFullParams = import_zod28.z.strictObject({
|
|
2331
|
+
provider: CodingProviderName,
|
|
2332
|
+
provider_session_id: SessionKey,
|
|
2333
|
+
item_id: import_zod28.z.string().min(1).max(200)
|
|
2334
|
+
});
|
|
2335
|
+
var CodingItemFullResult = import_zod28.z.strictObject({ output: import_zod28.z.string(), bytes: nonNegInt });
|
|
2336
|
+
var CodingActivityParams = import_zod28.z.strictObject({ provider: CodingProviderName, provider_session_id: SessionKey });
|
|
2337
|
+
var CodingActivityResult = import_zod28.z.strictObject({ active: CodingActiveElsewhere.nullable() });
|
|
2338
|
+
var CodingFoldersRecentParams = import_zod28.z.strictObject({});
|
|
2339
|
+
var CodingFoldersRecentResult = import_zod28.z.strictObject({ folders: import_zod28.z.array(CodingRecentFolder).max(100) });
|
|
2340
|
+
var CodingFoldersCheckParams = import_zod28.z.strictObject({ path: import_zod28.z.string().min(1).max(4096) });
|
|
2341
|
+
var CodingFoldersCheckResult = CodingFolderCheck;
|
|
2342
|
+
var CodingFoldersCreateParams = import_zod28.z.strictObject({ path: import_zod28.z.string().min(1).max(4096) });
|
|
2343
|
+
var CodingFoldersCreateResult = CodingFolderCheck;
|
|
2344
|
+
var CodingStartParams = import_zod28.z.strictObject({
|
|
2345
|
+
provider: CodingProviderName,
|
|
2346
|
+
cwd: import_zod28.z.string().min(1).max(4096),
|
|
2347
|
+
prompt: import_zod28.z.string().min(1).max(1048576),
|
|
2348
|
+
model: import_zod28.z.string().min(1).max(200).optional(),
|
|
2349
|
+
effort: import_zod28.z.string().min(1).max(40).optional(),
|
|
2350
|
+
agent: CodingAgentSelectionParams.optional(),
|
|
2351
|
+
/** One of the person's coding accounts on this computer (Accounts); absent = the default login. */
|
|
2352
|
+
account_profile_id: import_zod28.z.string().min(1).max(64).optional(),
|
|
2353
|
+
client_request_id: CodingClientRequestId
|
|
2354
|
+
});
|
|
2355
|
+
var CodingStartResult = CodingSendResult;
|
|
2356
|
+
var CodingTakeoverParams = import_zod28.z.strictObject({
|
|
2357
|
+
provider: CodingProviderName,
|
|
2358
|
+
provider_session_id: SessionKey,
|
|
2359
|
+
cwd: import_zod28.z.string().min(1).max(4096),
|
|
2360
|
+
title: import_zod28.z.string().max(500).optional(),
|
|
2361
|
+
agent: CodingAgentSelectionParams.optional(),
|
|
2362
|
+
confirm_elsewhere: import_zod28.z.boolean().optional()
|
|
2363
|
+
});
|
|
2364
|
+
var CodingTakeoverResult = import_zod28.z.strictObject({ session: CodingSessionRecord });
|
|
2365
|
+
var CodingSendParams = import_zod28.z.strictObject({
|
|
2366
|
+
session_id: SessionKey,
|
|
2367
|
+
prompt: import_zod28.z.string().min(1).max(1048576),
|
|
2368
|
+
client_request_id: CodingClientRequestId
|
|
2369
|
+
});
|
|
2370
|
+
var CodingStopParams = import_zod28.z.strictObject({ run_id: import_zod28.z.string().min(1).max(64) });
|
|
2371
|
+
var CodingStopResult = import_zod28.z.strictObject({ run: CodingRunRecord.nullable() });
|
|
2372
|
+
var CodingStopElsewhereParams = import_zod28.z.strictObject({
|
|
2373
|
+
provider: CodingProviderName,
|
|
2374
|
+
provider_session_id: SessionKey,
|
|
2375
|
+
pid: import_zod28.z.int().min(1)
|
|
2376
|
+
});
|
|
2377
|
+
var CodingStopElsewhereResult = import_zod28.z.strictObject({ stopped: import_zod28.z.boolean(), message: ShortText });
|
|
2378
|
+
var CodingOptionsSetParams = import_zod28.z.strictObject({
|
|
2379
|
+
session_id: SessionKey,
|
|
2380
|
+
model: import_zod28.z.string().max(200).optional(),
|
|
2381
|
+
effort: import_zod28.z.string().max(40).optional()
|
|
2382
|
+
});
|
|
2383
|
+
var CodingOptionsSetResult = import_zod28.z.strictObject({ session: CodingSessionRecord });
|
|
2384
|
+
var CodingAgentSetParams = import_zod28.z.strictObject({ session_id: SessionKey, agent: CodingAgentSelectionParams.optional() });
|
|
2385
|
+
var CodingAgentSetResult = import_zod28.z.strictObject({ session: CodingSessionRecord });
|
|
2386
|
+
var CodingAgentsAccessParams = import_zod28.z.strictObject({});
|
|
2387
|
+
var CodingAgentsAccessResult = import_zod28.z.strictObject({
|
|
2388
|
+
signedIn: import_zod28.z.boolean(),
|
|
2389
|
+
userId: import_zod28.z.string().max(64).nullable(),
|
|
2390
|
+
organizationId: import_zod28.z.string().max(64).nullable(),
|
|
2391
|
+
configured: import_zod28.z.boolean()
|
|
2392
|
+
});
|
|
2393
|
+
var CodingTitlesStatusParams = import_zod28.z.strictObject({});
|
|
2394
|
+
var CodingTitlesStatusResult = CodingTitleStatus;
|
|
2395
|
+
var CodingPrefsListParams = import_zod28.z.strictObject({});
|
|
2396
|
+
var CodingPrefsListResult = import_zod28.z.strictObject({ preferences: import_zod28.z.record(import_zod28.z.string().max(200), CodingChatPreference) });
|
|
2397
|
+
var CodingPrefsSetParams = import_zod28.z.strictObject({
|
|
2398
|
+
key: import_zod28.z.string().min(1).max(200),
|
|
2399
|
+
title: import_zod28.z.string().min(1).max(500).optional(),
|
|
2400
|
+
clear_title: import_zod28.z.boolean().optional(),
|
|
2401
|
+
pinned: import_zod28.z.boolean().optional(),
|
|
2402
|
+
hidden: import_zod28.z.boolean().optional()
|
|
2403
|
+
});
|
|
2404
|
+
var CodingPrefsSetResult = CodingPrefsListResult;
|
|
2405
|
+
var CodingRecentSeenParams = import_zod28.z.strictObject({ target: import_zod28.z.string().min(3).max(200) });
|
|
2406
|
+
var CodingRecentSeenResult = import_zod28.z.strictObject({ recent: import_zod28.z.array(CodingRecentRow) });
|
|
2407
|
+
var CodingSearchParams = import_zod28.z.strictObject({
|
|
2408
|
+
query: import_zod28.z.string().min(1).max(500),
|
|
2409
|
+
cursor: nonNegInt.optional(),
|
|
2410
|
+
limit: import_zod28.z.int().min(1).max(100).optional()
|
|
2411
|
+
});
|
|
2412
|
+
var CodingSearchResult = import_zod28.z.strictObject({
|
|
2413
|
+
query: import_zod28.z.string().max(500),
|
|
2414
|
+
hits: import_zod28.z.array(
|
|
2415
|
+
import_zod28.z.strictObject({
|
|
2416
|
+
provider: CodingProviderName,
|
|
2417
|
+
providerSessionId: SessionKey,
|
|
2418
|
+
title: import_zod28.z.string().max(500),
|
|
2419
|
+
cwd: LocalPath.nullable(),
|
|
2420
|
+
updatedAt: IsoTime,
|
|
2421
|
+
where: import_zod28.z.enum(["title", "content"]),
|
|
2422
|
+
snippet: import_zod28.z.string().max(2e3).nullable()
|
|
2423
|
+
})
|
|
2424
|
+
),
|
|
2425
|
+
scanned: nonNegInt,
|
|
2426
|
+
total: nonNegInt,
|
|
2427
|
+
nextCursor: nonNegInt.nullable()
|
|
2428
|
+
});
|
|
2429
|
+
var CodingReconcileParams = import_zod28.z.strictObject({ provider: CodingProviderName, provider_session_id: SessionKey });
|
|
2430
|
+
var CodingReconcileResult = import_zod28.z.strictObject({
|
|
2431
|
+
state: import_zod28.z.enum(["done", "blocked", "nothing_to_do"]),
|
|
2432
|
+
summary: import_zod28.z.string().max(400)
|
|
2433
|
+
});
|
|
2434
|
+
var CodingTranscriptRawParams = import_zod28.z.strictObject({ provider: CodingProviderName, provider_session_id: SessionKey });
|
|
2435
|
+
var CodingTranscriptRawResult = import_zod28.z.strictObject({
|
|
2436
|
+
available: import_zod28.z.boolean(),
|
|
2437
|
+
reason: ShortText.nullable(),
|
|
2438
|
+
file_name: import_zod28.z.string().max(300).nullable(),
|
|
2439
|
+
bytes: nonNegInt,
|
|
2440
|
+
/** The opt-in cloud backup was refreshed (false: off, unchanged, or signed out). */
|
|
2441
|
+
backup_refreshed: import_zod28.z.boolean(),
|
|
2442
|
+
/** Subagent transcripts beside the chat (Claude Code), downloaded separately. */
|
|
2443
|
+
subagents: nonNegInt
|
|
2444
|
+
});
|
|
2445
|
+
var CodingWatchParams = import_zod28.z.strictObject({});
|
|
2446
|
+
var CodingWatchResult = import_zod28.z.strictObject({ resource_id: ResourceId });
|
|
2447
|
+
var CodingSessionWatchParams = import_zod28.z.strictObject({ session_id: SessionKey, since_seq: nonNegInt.optional() });
|
|
2448
|
+
var CodingSessionWatchResult = import_zod28.z.strictObject({
|
|
2449
|
+
resource_id: ResourceId,
|
|
2450
|
+
/** The newest item seq the device has for this session right now. */
|
|
2451
|
+
seq: nonNegInt
|
|
2452
|
+
});
|
|
2453
|
+
var CodingChangedEvent = import_zod28.z.discriminatedUnion("kind", [
|
|
2454
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("session"), session: CodingSessionRecord }),
|
|
2455
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("run"), run: CodingRunRecord }),
|
|
2456
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("preferences"), preferences: import_zod28.z.record(import_zod28.z.string().max(200), CodingChatPreference) }),
|
|
2457
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("titles") }),
|
|
2458
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("recent"), recent: import_zod28.z.array(CodingRecentRow) })
|
|
2459
|
+
]);
|
|
2460
|
+
var CodingWatchStateEvent = import_zod28.z.strictObject({ live: import_zod28.z.boolean(), reason: ShortText.nullable(), beat_ms: import_zod28.z.int().min(1e3) });
|
|
2461
|
+
var CodingItemEvent = import_zod28.z.strictObject({
|
|
2462
|
+
session_id: SessionKey,
|
|
2463
|
+
run_id: import_zod28.z.string().min(1).max(64),
|
|
2464
|
+
seq: nonNegInt,
|
|
2465
|
+
item: CodingTranscriptItem
|
|
2466
|
+
});
|
|
2467
|
+
var CodingGapEvent = import_zod28.z.strictObject({ session_id: SessionKey, since_seq: nonNegInt, seq: nonNegInt });
|
|
2468
|
+
var SessionIdentifyParams = import_zod28.z.strictObject({ label: import_zod28.z.string().min(1).max(60) });
|
|
2469
|
+
var SessionIdentifyResult = import_zod28.z.strictObject({ label: import_zod28.z.string().max(60) });
|
|
2470
|
+
|
|
2471
|
+
// src/schema/apps.ts
|
|
2472
|
+
var import_zod29 = require("zod");
|
|
2029
2473
|
var import_uuid4 = require("@ai-matrx/kit/uuid");
|
|
2030
|
-
var AppKey =
|
|
2031
|
-
var AppProfileId =
|
|
2032
|
-
var AppProfileLocator =
|
|
2033
|
-
var AppSupport =
|
|
2034
|
-
var AppFeatureStatus =
|
|
2474
|
+
var AppKey = import_zod29.z.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
|
|
2475
|
+
var AppProfileId = import_zod29.z.string().regex(import_uuid4.UUID_SHAPE_PATTERN);
|
|
2476
|
+
var AppProfileLocator = import_zod29.z.string().min(1).max(512).regex(/^[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}(\/[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}){0,7}$/);
|
|
2477
|
+
var AppSupport = import_zod29.z.enum(["supported", "partial", "unsupported"]);
|
|
2478
|
+
var AppFeatureStatus = import_zod29.z.strictObject({
|
|
2035
2479
|
status: AppSupport,
|
|
2036
2480
|
/** One line, set whenever status is not "supported". */
|
|
2037
|
-
reason:
|
|
2481
|
+
reason: import_zod29.z.string().max(140).nullable()
|
|
2038
2482
|
});
|
|
2039
|
-
var AppInfo =
|
|
2483
|
+
var AppInfo = import_zod29.z.strictObject({
|
|
2040
2484
|
app_key: AppKey,
|
|
2041
|
-
name:
|
|
2042
|
-
installed:
|
|
2485
|
+
name: import_zod29.z.string().max(64),
|
|
2486
|
+
installed: import_zod29.z.boolean(),
|
|
2043
2487
|
/** The app's own version string, or null when it is not installed or does not say. */
|
|
2044
|
-
version:
|
|
2488
|
+
version: import_zod29.z.string().max(64).nullable(),
|
|
2045
2489
|
/** The install found (an .app bundle, an .exe, a binary), or null. */
|
|
2046
2490
|
location: AbsPath.nullable(),
|
|
2047
2491
|
/** Open the app at all on this OS. */
|
|
@@ -2051,148 +2495,148 @@ var AppInfo = import_zod28.z.strictObject({
|
|
|
2051
2495
|
/** Plan usage read from the app's own files on this OS. */
|
|
2052
2496
|
usage: AppFeatureStatus
|
|
2053
2497
|
});
|
|
2054
|
-
var AppUsageReading =
|
|
2055
|
-
window:
|
|
2498
|
+
var AppUsageReading = import_zod29.z.strictObject({
|
|
2499
|
+
window: import_zod29.z.enum(["five_hour", "weekly", "extra"]),
|
|
2056
2500
|
/** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
|
|
2057
|
-
percent:
|
|
2501
|
+
percent: import_zod29.z.number().min(0).max(1e4),
|
|
2058
2502
|
/** When the app recorded it. */
|
|
2059
2503
|
sampled_at_ms: epochMs,
|
|
2060
2504
|
/** True when the window has rolled over since the sample, so the figure has reset. */
|
|
2061
|
-
reset_since:
|
|
2505
|
+
reset_since: import_zod29.z.boolean()
|
|
2062
2506
|
});
|
|
2063
|
-
var AppProfile =
|
|
2507
|
+
var AppProfile = import_zod29.z.strictObject({
|
|
2064
2508
|
/** The row's id; null for a folder found on disk that no row names yet. */
|
|
2065
2509
|
id: AppProfileId.nullable(),
|
|
2066
2510
|
app_key: AppKey,
|
|
2067
|
-
display_name:
|
|
2511
|
+
display_name: import_zod29.z.string().min(1).max(120),
|
|
2068
2512
|
/** The account the person means to be signed in here; null when not stated (never guessed). */
|
|
2069
|
-
account_identity:
|
|
2513
|
+
account_identity: import_zod29.z.string().min(3).max(320).nullable(),
|
|
2070
2514
|
profile_locator: AppProfileLocator.nullable(),
|
|
2071
2515
|
/** The device the row is tied to; null when the row names none. */
|
|
2072
2516
|
device_id: DeviceId.nullable(),
|
|
2073
2517
|
/** The folder this profile resolves to on this device; null for a row tied to another device. */
|
|
2074
2518
|
folder: AbsPath.nullable(),
|
|
2075
2519
|
/** The folder exists on this device. */
|
|
2076
|
-
on_disk:
|
|
2520
|
+
on_disk: import_zod29.z.boolean(),
|
|
2077
2521
|
/** An instance with this profile is running; null when it could not be determined. */
|
|
2078
|
-
running:
|
|
2522
|
+
running: import_zod29.z.boolean().nullable(),
|
|
2079
2523
|
/** Usage the app recorded for this profile; null when the app exposes none here. */
|
|
2080
|
-
usage:
|
|
2524
|
+
usage: import_zod29.z.array(AppUsageReading).nullable(),
|
|
2081
2525
|
last_opened_ms: epochMs.nullable()
|
|
2082
2526
|
});
|
|
2083
|
-
var AppsListParams =
|
|
2084
|
-
var AppsListResult =
|
|
2085
|
-
var AppsProfilesListParams =
|
|
2527
|
+
var AppsListParams = import_zod29.z.strictObject({});
|
|
2528
|
+
var AppsListResult = import_zod29.z.strictObject({ apps: import_zod29.z.array(AppInfo) });
|
|
2529
|
+
var AppsProfilesListParams = import_zod29.z.strictObject({
|
|
2086
2530
|
/** Only this app's profiles; every app's when absent. */
|
|
2087
2531
|
app_key: AppKey.optional()
|
|
2088
2532
|
});
|
|
2089
|
-
var AppsProfilesListResult =
|
|
2090
|
-
profiles:
|
|
2533
|
+
var AppsProfilesListResult = import_zod29.z.strictObject({
|
|
2534
|
+
profiles: import_zod29.z.array(AppProfile),
|
|
2091
2535
|
/**
|
|
2092
2536
|
* Whether the saved rows could be read: false while signed out or offline, when only folders
|
|
2093
2537
|
* found on disk are listed.
|
|
2094
2538
|
*/
|
|
2095
|
-
registry:
|
|
2539
|
+
registry: import_zod29.z.enum(["ok", "signed_out", "unavailable"])
|
|
2096
2540
|
});
|
|
2097
|
-
var AppsProfilesSaveParams =
|
|
2541
|
+
var AppsProfilesSaveParams = import_zod29.z.strictObject({
|
|
2098
2542
|
id: AppProfileId.optional(),
|
|
2099
2543
|
app_key: AppKey,
|
|
2100
|
-
display_name:
|
|
2101
|
-
account_identity:
|
|
2544
|
+
display_name: import_zod29.z.string().min(1).max(120),
|
|
2545
|
+
account_identity: import_zod29.z.string().min(3).max(320).nullable(),
|
|
2102
2546
|
/** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
|
|
2103
2547
|
profile_locator: AppProfileLocator.nullable(),
|
|
2104
2548
|
/** On create with profile_locator null: make a new folder named after display_name instead. */
|
|
2105
|
-
new_folder:
|
|
2549
|
+
new_folder: import_zod29.z.boolean().default(false)
|
|
2106
2550
|
});
|
|
2107
2551
|
var AppsProfilesSaveResult = AppProfile;
|
|
2108
|
-
var AppsProfilesRemoveParams =
|
|
2109
|
-
var AppsProfilesRemoveResult =
|
|
2110
|
-
var AppsOpenParams =
|
|
2552
|
+
var AppsProfilesRemoveParams = import_zod29.z.strictObject({ id: AppProfileId });
|
|
2553
|
+
var AppsProfilesRemoveResult = import_zod29.z.strictObject({ removed: import_zod29.z.boolean() });
|
|
2554
|
+
var AppsOpenParams = import_zod29.z.strictObject({
|
|
2111
2555
|
app_key: AppKey,
|
|
2112
2556
|
profile_id: AppProfileId.optional()
|
|
2113
2557
|
});
|
|
2114
|
-
var AppsOpenResult =
|
|
2558
|
+
var AppsOpenResult = import_zod29.z.strictObject({
|
|
2115
2559
|
/** True when an instance with this profile was already running; it is brought forward. */
|
|
2116
|
-
already_running:
|
|
2560
|
+
already_running: import_zod29.z.boolean(),
|
|
2117
2561
|
folder: AbsPath.nullable()
|
|
2118
2562
|
});
|
|
2119
2563
|
|
|
2120
2564
|
// src/schema/apps-chats.ts
|
|
2121
|
-
var
|
|
2122
|
-
var ChatId =
|
|
2123
|
-
var ChatPlace =
|
|
2124
|
-
var ChatProjectId =
|
|
2125
|
-
var ChatWindow =
|
|
2565
|
+
var import_zod30 = require("zod");
|
|
2566
|
+
var ChatId = import_zod30.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
|
|
2567
|
+
var ChatPlace = import_zod30.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
|
|
2568
|
+
var ChatProjectId = import_zod30.z.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
|
|
2569
|
+
var ChatWindow = import_zod30.z.strictObject({
|
|
2126
2570
|
key: ChatPlace,
|
|
2127
2571
|
/** The app's default profile (Claude: the main window, which lists every account's chats). */
|
|
2128
|
-
main:
|
|
2572
|
+
main: import_zod30.z.boolean(),
|
|
2129
2573
|
/** The account the window is signed into, when known. */
|
|
2130
|
-
account:
|
|
2574
|
+
account: import_zod30.z.string().max(320).nullable()
|
|
2131
2575
|
});
|
|
2132
|
-
var ChatProject =
|
|
2576
|
+
var ChatProject = import_zod30.z.strictObject({
|
|
2133
2577
|
id: ChatProjectId,
|
|
2134
|
-
name:
|
|
2135
|
-
archived:
|
|
2578
|
+
name: import_zod30.z.string().min(1).max(200),
|
|
2579
|
+
archived: import_zod30.z.boolean(),
|
|
2136
2580
|
/** Chats in it. */
|
|
2137
2581
|
count: nonNegInt
|
|
2138
2582
|
});
|
|
2139
|
-
var ChatPin =
|
|
2583
|
+
var ChatPin = import_zod30.z.strictObject({
|
|
2140
2584
|
/** The window whose account pins it; an account with no window of its own is named by its email. */
|
|
2141
|
-
window:
|
|
2585
|
+
window: import_zod30.z.string().min(1).max(320),
|
|
2142
2586
|
/** When that account's pin list was last read; null when the reading has no time. */
|
|
2143
2587
|
observed_at_ms: epochMs.nullable()
|
|
2144
2588
|
});
|
|
2145
|
-
var ChatRunning =
|
|
2589
|
+
var ChatRunning = import_zod30.z.strictObject({
|
|
2146
2590
|
window: ChatPlace,
|
|
2147
2591
|
/** process: a live process resumed this chat there (exact); activity: that window's own record moved in the last 3 minutes. */
|
|
2148
|
-
how:
|
|
2592
|
+
how: import_zod30.z.enum(["process", "activity"])
|
|
2149
2593
|
});
|
|
2150
|
-
var ChatHidden =
|
|
2594
|
+
var ChatHidden = import_zod30.z.strictObject({
|
|
2151
2595
|
window: ChatPlace,
|
|
2152
|
-
reason:
|
|
2596
|
+
reason: import_zod30.z.string().max(200)
|
|
2153
2597
|
});
|
|
2154
|
-
var ChatLastUse =
|
|
2598
|
+
var ChatLastUse = import_zod30.z.strictObject({
|
|
2155
2599
|
/** The conversation's last reply. */
|
|
2156
2600
|
at_ms: epochMs,
|
|
2157
2601
|
window: ChatPlace.nullable(),
|
|
2158
|
-
account:
|
|
2602
|
+
account: import_zod30.z.string().max(320).nullable(),
|
|
2159
2603
|
/** How the window was decided (one short line). */
|
|
2160
|
-
how:
|
|
2604
|
+
how: import_zod30.z.string().max(120).nullable(),
|
|
2161
2605
|
/** The account's 1-hour prompt cache is still warm. */
|
|
2162
|
-
cache_warm:
|
|
2606
|
+
cache_warm: import_zod30.z.boolean(),
|
|
2163
2607
|
cache_minutes_left: nonNegInt
|
|
2164
2608
|
});
|
|
2165
|
-
var ChatAppProject =
|
|
2166
|
-
id:
|
|
2167
|
-
name:
|
|
2609
|
+
var ChatAppProject = import_zod30.z.strictObject({
|
|
2610
|
+
id: import_zod30.z.string().min(1).max(200),
|
|
2611
|
+
name: import_zod30.z.string().max(200)
|
|
2168
2612
|
});
|
|
2169
|
-
var ChatTitleSource =
|
|
2170
|
-
var ChatRow =
|
|
2613
|
+
var ChatTitleSource = import_zod30.z.enum(["app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"]);
|
|
2614
|
+
var ChatRow = import_zod30.z.strictObject({
|
|
2171
2615
|
id: ChatId,
|
|
2172
2616
|
/** The short id people see (the listing's first 8 characters). */
|
|
2173
|
-
short_id:
|
|
2617
|
+
short_id: import_zod30.z.string().max(16),
|
|
2174
2618
|
/** The listing's own name (Claude: local_<id>), null for a chat only in the holder. */
|
|
2175
|
-
record:
|
|
2176
|
-
title:
|
|
2619
|
+
record: import_zod30.z.string().max(160).nullable(),
|
|
2620
|
+
title: import_zod30.z.string().max(1e3),
|
|
2177
2621
|
last_active_ms: epochMs.nullable(),
|
|
2178
2622
|
created_ms: epochMs.nullable(),
|
|
2179
|
-
projects:
|
|
2180
|
-
starred:
|
|
2181
|
-
pinned_in:
|
|
2623
|
+
projects: import_zod30.z.array(ChatProjectId).max(500),
|
|
2624
|
+
starred: import_zod30.z.boolean(),
|
|
2625
|
+
pinned_in: import_zod30.z.array(ChatPin).max(200),
|
|
2182
2626
|
/** Every place it is listed now: window keys, plus "holder". */
|
|
2183
|
-
places:
|
|
2184
|
-
held:
|
|
2185
|
-
running:
|
|
2186
|
-
hidden_in:
|
|
2627
|
+
places: import_zod30.z.array(ChatPlace).max(200),
|
|
2628
|
+
held: import_zod30.z.boolean(),
|
|
2629
|
+
running: import_zod30.z.array(ChatRunning).max(200),
|
|
2630
|
+
hidden_in: import_zod30.z.array(ChatHidden).max(200),
|
|
2187
2631
|
/** Kept out of the main window on purpose. */
|
|
2188
|
-
hidden_from_main:
|
|
2632
|
+
hidden_from_main: import_zod30.z.boolean(),
|
|
2189
2633
|
/** Listed in a side window and not yet copied into main. */
|
|
2190
|
-
main_pending:
|
|
2634
|
+
main_pending: import_zod30.z.boolean(),
|
|
2191
2635
|
/** A scheduled routine's run (its task id). */
|
|
2192
|
-
scheduled:
|
|
2636
|
+
scheduled: import_zod30.z.string().max(200).nullable(),
|
|
2193
2637
|
/** Created recently and in no project: offered for filing. */
|
|
2194
|
-
new_unfiled:
|
|
2195
|
-
warnings:
|
|
2638
|
+
new_unfiled: import_zod30.z.boolean(),
|
|
2639
|
+
warnings: import_zod30.z.array(import_zod30.z.string().max(400)).max(20),
|
|
2196
2640
|
last_use: ChatLastUse.nullable(),
|
|
2197
2641
|
/** 1.13: the app's own project the chat is grouped under in the app (Codex), read only; absent = none or not an app that groups. */
|
|
2198
2642
|
app_project: ChatAppProject.optional(),
|
|
@@ -2202,140 +2646,140 @@ var ChatRow = import_zod29.z.strictObject({
|
|
|
2202
2646
|
* 1.14: the chat's own title before the person's rename (the one title rule, `@ai-matrx/coding-sessions/sessions`);
|
|
2203
2647
|
* `title` is what to show (`title_override` when set, else this).
|
|
2204
2648
|
*/
|
|
2205
|
-
original_title:
|
|
2649
|
+
original_title: import_zod30.z.string().max(1e3).optional(),
|
|
2206
2650
|
/** 1.14: where `original_title` came from (the one rule's sources, strongest first; 1.15: a closed set). */
|
|
2207
2651
|
title_source: ChatTitleSource.optional(),
|
|
2208
2652
|
/** 1.14: the person's rename inside Matrx (Coding Sessions), applied once by the row builder; absent = none. */
|
|
2209
|
-
title_override:
|
|
2653
|
+
title_override: import_zod30.z.string().min(1).max(300).optional(),
|
|
2210
2654
|
/** 1.15: the app itself archived it (hidden_in says where and why, in words for people; this is the typed fact). */
|
|
2211
|
-
archived:
|
|
2655
|
+
archived: import_zod30.z.boolean().optional()
|
|
2212
2656
|
});
|
|
2213
|
-
var ChatFamily =
|
|
2657
|
+
var ChatFamily = import_zod30.z.strictObject({
|
|
2214
2658
|
id: ChatId,
|
|
2215
2659
|
fork_of: ChatId.nullable(),
|
|
2216
2660
|
copy_of: ChatId.nullable()
|
|
2217
2661
|
});
|
|
2218
|
-
var AppsChatsListParams =
|
|
2662
|
+
var AppsChatsListParams = import_zod30.z.strictObject({
|
|
2219
2663
|
app_key: AppKey,
|
|
2220
2664
|
/** Only these chats (a live update re-reads just what changed). */
|
|
2221
|
-
ids:
|
|
2665
|
+
ids: import_zod30.z.array(ChatId).max(500).optional()
|
|
2222
2666
|
});
|
|
2223
|
-
var AppsChatsListResult =
|
|
2667
|
+
var AppsChatsListResult = import_zod30.z.strictObject({
|
|
2224
2668
|
app_key: AppKey,
|
|
2225
2669
|
/** Bumps on every change the index sees; `apps.chats.changed` carries the same number. */
|
|
2226
2670
|
version: nonNegInt,
|
|
2227
|
-
windows:
|
|
2228
|
-
projects:
|
|
2229
|
-
chats:
|
|
2671
|
+
windows: import_zod30.z.array(ChatWindow).max(200),
|
|
2672
|
+
projects: import_zod30.z.array(ChatProject).max(5e3),
|
|
2673
|
+
chats: import_zod30.z.array(ChatRow).max(2e4),
|
|
2230
2674
|
/** How long a chat in no project counts as new. */
|
|
2231
2675
|
new_window_ms: nonNegInt,
|
|
2232
2676
|
/** 1.9: this is the copy saved at the last read, shown while everything is read again. */
|
|
2233
|
-
updating:
|
|
2677
|
+
updating: import_zod30.z.boolean().optional(),
|
|
2234
2678
|
/** 1.9: false while the folder watches are down (changes are not arriving); `apps.chats.watch_state` says when it changes. */
|
|
2235
|
-
live:
|
|
2679
|
+
live: import_zod30.z.boolean().optional(),
|
|
2236
2680
|
/** 1.10: every listed chat that is a fork or a copy of another (read from the conversations' first lines). */
|
|
2237
|
-
families:
|
|
2681
|
+
families: import_zod30.z.array(ChatFamily).max(2e4).optional()
|
|
2238
2682
|
});
|
|
2239
|
-
var AppsChatsWatchParams =
|
|
2240
|
-
var AppsChatsWatchResult =
|
|
2241
|
-
var AppsChatsChangedEvent =
|
|
2683
|
+
var AppsChatsWatchParams = import_zod30.z.strictObject({ app_key: AppKey });
|
|
2684
|
+
var AppsChatsWatchResult = import_zod30.z.strictObject({ resource_id: ResourceId, version: nonNegInt });
|
|
2685
|
+
var AppsChatsChangedEvent = import_zod30.z.strictObject({
|
|
2242
2686
|
app_key: AppKey,
|
|
2243
2687
|
version: nonNegInt,
|
|
2244
|
-
ids:
|
|
2245
|
-
all:
|
|
2688
|
+
ids: import_zod30.z.array(ChatId).max(1e3),
|
|
2689
|
+
all: import_zod30.z.boolean()
|
|
2246
2690
|
});
|
|
2247
|
-
var AppsChatsWatchStateEvent =
|
|
2691
|
+
var AppsChatsWatchStateEvent = import_zod30.z.strictObject({
|
|
2248
2692
|
app_key: AppKey,
|
|
2249
|
-
live:
|
|
2250
|
-
updating:
|
|
2251
|
-
reason:
|
|
2693
|
+
live: import_zod30.z.boolean(),
|
|
2694
|
+
updating: import_zod30.z.boolean(),
|
|
2695
|
+
reason: import_zod30.z.string().max(300).nullable()
|
|
2252
2696
|
});
|
|
2253
|
-
var AppsChatsPlaceParams =
|
|
2697
|
+
var AppsChatsPlaceParams = import_zod30.z.strictObject({
|
|
2254
2698
|
app_key: AppKey,
|
|
2255
2699
|
chat_id: ChatId,
|
|
2256
|
-
action:
|
|
2700
|
+
action: import_zod30.z.enum(["place", "take_off", "hold"]),
|
|
2257
2701
|
/** The window (for place and take_off). */
|
|
2258
2702
|
window: ChatPlace.optional(),
|
|
2259
2703
|
/** take_off where it is open: stop it there first (the person confirmed). */
|
|
2260
|
-
stop_if_open:
|
|
2704
|
+
stop_if_open: import_zod30.z.boolean().default(false)
|
|
2261
2705
|
});
|
|
2262
|
-
var AppsChatsPlaceResult =
|
|
2263
|
-
var AppsProjectsFileManyParams =
|
|
2706
|
+
var AppsChatsPlaceResult = import_zod30.z.strictObject({ chat: ChatRow, message: import_zod30.z.string().max(400) });
|
|
2707
|
+
var AppsProjectsFileManyParams = import_zod30.z.strictObject({
|
|
2264
2708
|
app_key: AppKey,
|
|
2265
|
-
chat_ids:
|
|
2709
|
+
chat_ids: import_zod30.z.array(ChatId).min(1).max(500),
|
|
2266
2710
|
project_id: ChatProjectId.optional(),
|
|
2267
|
-
new_project_name:
|
|
2711
|
+
new_project_name: import_zod30.z.string().min(1).max(200).optional()
|
|
2268
2712
|
});
|
|
2269
|
-
var AppsProjectsFileManyResult =
|
|
2270
|
-
var AppsProjectsUpdateParams =
|
|
2713
|
+
var AppsProjectsFileManyResult = import_zod30.z.strictObject({ chats: import_zod30.z.array(ChatRow).max(500), project: ChatProject });
|
|
2714
|
+
var AppsProjectsUpdateParams = import_zod30.z.strictObject({
|
|
2271
2715
|
app_key: AppKey,
|
|
2272
2716
|
project_id: ChatProjectId,
|
|
2273
|
-
name:
|
|
2274
|
-
archived:
|
|
2717
|
+
name: import_zod30.z.string().min(1).max(200).optional(),
|
|
2718
|
+
archived: import_zod30.z.boolean().optional()
|
|
2275
2719
|
});
|
|
2276
|
-
var AppsProjectsUpdateResult =
|
|
2277
|
-
var AppsProjectsCopyParams =
|
|
2278
|
-
var AppsProjectsCopyResult =
|
|
2279
|
-
var AppsProjectsFileParams =
|
|
2720
|
+
var AppsProjectsUpdateResult = import_zod30.z.strictObject({ project: ChatProject });
|
|
2721
|
+
var AppsProjectsCopyParams = import_zod30.z.strictObject({ app_key: AppKey, project_id: ChatProjectId, new_project_name: import_zod30.z.string().min(1).max(200) });
|
|
2722
|
+
var AppsProjectsCopyResult = import_zod30.z.strictObject({ project: ChatProject });
|
|
2723
|
+
var AppsProjectsFileParams = import_zod30.z.strictObject({
|
|
2280
2724
|
app_key: AppKey,
|
|
2281
2725
|
chat_id: ChatId,
|
|
2282
2726
|
project_id: ChatProjectId.optional(),
|
|
2283
|
-
new_project_name:
|
|
2727
|
+
new_project_name: import_zod30.z.string().min(1).max(200).optional()
|
|
2284
2728
|
});
|
|
2285
|
-
var AppsProjectsFileResult =
|
|
2286
|
-
var AppsProjectsUnfileParams =
|
|
2287
|
-
var AppsProjectsUnfileResult =
|
|
2288
|
-
var AppsChatsStarParams =
|
|
2289
|
-
var AppsChatsStarResult =
|
|
2729
|
+
var AppsProjectsFileResult = import_zod30.z.strictObject({ chat: ChatRow, project: ChatProject });
|
|
2730
|
+
var AppsProjectsUnfileParams = import_zod30.z.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
|
|
2731
|
+
var AppsProjectsUnfileResult = import_zod30.z.strictObject({ chat: ChatRow });
|
|
2732
|
+
var AppsChatsStarParams = import_zod30.z.strictObject({ app_key: AppKey, chat_id: ChatId, starred: import_zod30.z.boolean() });
|
|
2733
|
+
var AppsChatsStarResult = import_zod30.z.strictObject({ chat: ChatRow });
|
|
2290
2734
|
|
|
2291
2735
|
// src/schema/apps-accounts.ts
|
|
2292
|
-
var
|
|
2293
|
-
var AppWindowInfo =
|
|
2736
|
+
var import_zod31 = require("zod");
|
|
2737
|
+
var AppWindowInfo = import_zod31.z.strictObject({
|
|
2294
2738
|
key: ChatPlace,
|
|
2295
2739
|
/** The app's default profile (Claude: main, which may sign into any account). */
|
|
2296
|
-
main:
|
|
2740
|
+
main: import_zod31.z.boolean(),
|
|
2297
2741
|
/** The account the window is meant for (null for main). */
|
|
2298
|
-
account:
|
|
2742
|
+
account: import_zod31.z.string().max(320).nullable(),
|
|
2299
2743
|
/** The account signed in there now: an email, or the account id while it has no saved name. */
|
|
2300
|
-
signed_in:
|
|
2301
|
-
signed_in_is_email:
|
|
2744
|
+
signed_in: import_zod31.z.string().max(320).nullable(),
|
|
2745
|
+
signed_in_is_email: import_zod31.z.boolean(),
|
|
2302
2746
|
/** Signed into another account than the one it is meant for. */
|
|
2303
|
-
mismatch:
|
|
2747
|
+
mismatch: import_zod31.z.boolean(),
|
|
2304
2748
|
/** Its folder exists. */
|
|
2305
|
-
created:
|
|
2749
|
+
created: import_zod31.z.boolean(),
|
|
2306
2750
|
/** Open now. */
|
|
2307
|
-
running:
|
|
2751
|
+
running: import_zod31.z.boolean(),
|
|
2308
2752
|
/** Chats open in it now (a process resuming each one). */
|
|
2309
2753
|
open_chats: nonNegInt
|
|
2310
2754
|
});
|
|
2311
|
-
var AccountUsage =
|
|
2755
|
+
var AccountUsage = import_zod31.z.strictObject({
|
|
2312
2756
|
/** The account's email, or "org <8 chars>" when no window has ever sampled that org. */
|
|
2313
|
-
account:
|
|
2314
|
-
org:
|
|
2757
|
+
account: import_zod31.z.string().max(320),
|
|
2758
|
+
org: import_zod31.z.string().max(80).nullable(),
|
|
2315
2759
|
/** False when the org was sampled in several accounts' windows and the vote is not clear (≥ 75 %). */
|
|
2316
|
-
account_certain:
|
|
2760
|
+
account_certain: import_zod31.z.boolean(),
|
|
2317
2761
|
/** 5-hour use in percent (0 once the reading is over 5 hours old). */
|
|
2318
|
-
five_hour:
|
|
2319
|
-
five_hour_reset_since:
|
|
2762
|
+
five_hour: import_zod31.z.number().nullable(),
|
|
2763
|
+
five_hour_reset_since: import_zod31.z.boolean(),
|
|
2320
2764
|
/** Weekly use in percent (0 once the week reset after the reading). */
|
|
2321
|
-
weekly:
|
|
2322
|
-
weekly_reset_since:
|
|
2765
|
+
weekly: import_zod31.z.number().nullable(),
|
|
2766
|
+
weekly_reset_since: import_zod31.z.boolean(),
|
|
2323
2767
|
/** Extra-usage spend in percent of its cap, when on. */
|
|
2324
|
-
extra_usage:
|
|
2768
|
+
extra_usage: import_zod31.z.number().nullable(),
|
|
2325
2769
|
extra_usage_as_of_ms: epochMs.nullable(),
|
|
2326
2770
|
as_of_ms: epochMs,
|
|
2327
2771
|
/** The windows meant for this account (and main when main took the reading). */
|
|
2328
|
-
windows:
|
|
2772
|
+
windows: import_zod31.z.array(ChatPlace).max(200),
|
|
2329
2773
|
/** The window that took the reading is open now and the reading is under 30 minutes old. */
|
|
2330
|
-
live:
|
|
2774
|
+
live: import_zod31.z.boolean(),
|
|
2331
2775
|
/** The next weekly reset, when known. */
|
|
2332
2776
|
weekly_resets_at_ms: epochMs.nullable(),
|
|
2333
2777
|
/** That reset time is Claude's own (its reading, or a reset seen in its usage history). */
|
|
2334
|
-
weekly_reset_official:
|
|
2778
|
+
weekly_reset_official: import_zod31.z.boolean().nullable(),
|
|
2335
2779
|
/** 1.13: the account's plan as the app names it (Codex: "pro", "prolite"), when recorded. */
|
|
2336
|
-
plan:
|
|
2780
|
+
plan: import_zod31.z.string().max(80).optional(),
|
|
2337
2781
|
/** 1.13: the account's credit balance as the app records it (Codex), when recorded. */
|
|
2338
|
-
credits:
|
|
2782
|
+
credits: import_zod31.z.string().max(40).optional(),
|
|
2339
2783
|
/**
|
|
2340
2784
|
* 1.25: the latest the account's 5-hour window can reset: 5 hours after the first reading of this
|
|
2341
2785
|
* window's use (its usage history), so the real reset is at or before it. Absent when no 5-hour
|
|
@@ -2343,81 +2787,81 @@ var AccountUsage = import_zod30.z.strictObject({
|
|
|
2343
2787
|
*/
|
|
2344
2788
|
five_hour_resets_by_ms: epochMs.optional()
|
|
2345
2789
|
});
|
|
2346
|
-
var AccountReset =
|
|
2790
|
+
var AccountReset = import_zod31.z.strictObject({
|
|
2347
2791
|
window: ChatPlace,
|
|
2348
|
-
account:
|
|
2792
|
+
account: import_zod31.z.string().max(320).nullable(),
|
|
2349
2793
|
next_reset_ms: epochMs.nullable(),
|
|
2350
2794
|
/** claude: the app's own reading; usage_history: a weekly drop seen in its usage record; your_list: the person's own entry. */
|
|
2351
|
-
source:
|
|
2795
|
+
source: import_zod31.z.enum(["claude", "usage_history", "your_list"]).nullable(),
|
|
2352
2796
|
/** claude or usage_history. */
|
|
2353
|
-
official:
|
|
2797
|
+
official: import_zod31.z.boolean(),
|
|
2354
2798
|
/** Set when the person's list disagrees with the official time. */
|
|
2355
|
-
note:
|
|
2799
|
+
note: import_zod31.z.string().max(200).nullable()
|
|
2356
2800
|
});
|
|
2357
|
-
var AppsWindowsListParams =
|
|
2358
|
-
var AppsWindowsListResult =
|
|
2359
|
-
var AppsAccountsUsageParams =
|
|
2360
|
-
var AppsAccountsUsageResult =
|
|
2801
|
+
var AppsWindowsListParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
2802
|
+
var AppsWindowsListResult = import_zod31.z.strictObject({ app_key: AppKey, windows: import_zod31.z.array(AppWindowInfo).max(200) });
|
|
2803
|
+
var AppsAccountsUsageParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
2804
|
+
var AppsAccountsUsageResult = import_zod31.z.strictObject({
|
|
2361
2805
|
app_key: AppKey,
|
|
2362
|
-
accounts:
|
|
2806
|
+
accounts: import_zod31.z.array(AccountUsage).max(500),
|
|
2363
2807
|
/** 1.12: the rows are right but something around them failed (a newly read reset time could not be saved); shown, never hidden. */
|
|
2364
|
-
problem:
|
|
2808
|
+
problem: import_zod31.z.string().max(400).optional()
|
|
2365
2809
|
});
|
|
2366
|
-
var AppsAccountsResetsParams =
|
|
2367
|
-
var AppsAccountsResetsResult =
|
|
2810
|
+
var AppsAccountsResetsParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
2811
|
+
var AppsAccountsResetsResult = import_zod31.z.strictObject({
|
|
2368
2812
|
app_key: AppKey,
|
|
2369
|
-
resets:
|
|
2813
|
+
resets: import_zod31.z.array(AccountReset).max(200),
|
|
2370
2814
|
/** 1.12: as on `apps.accounts.usage`. */
|
|
2371
|
-
problem:
|
|
2815
|
+
problem: import_zod31.z.string().max(400).optional()
|
|
2372
2816
|
});
|
|
2373
|
-
var AppsWindowActionResult =
|
|
2374
|
-
var AppsWindowsOpenParams =
|
|
2375
|
-
var AppsWindowsReloadParams =
|
|
2376
|
-
var ShownSection =
|
|
2377
|
-
title:
|
|
2817
|
+
var AppsWindowActionResult = import_zod31.z.strictObject({ message: import_zod31.z.string().max(400) });
|
|
2818
|
+
var AppsWindowsOpenParams = import_zod31.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
2819
|
+
var AppsWindowsReloadParams = import_zod31.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
2820
|
+
var ShownSection = import_zod31.z.strictObject({
|
|
2821
|
+
title: import_zod31.z.string().max(300),
|
|
2378
2822
|
/** Rows drawn under it (a collapsed section draws none). */
|
|
2379
|
-
rows:
|
|
2380
|
-
expanded:
|
|
2823
|
+
rows: import_zod31.z.number().int().nonnegative(),
|
|
2824
|
+
expanded: import_zod31.z.boolean()
|
|
2381
2825
|
});
|
|
2382
|
-
var AppsWindowsShownParams =
|
|
2383
|
-
var AppsWindowsShownResult =
|
|
2826
|
+
var AppsWindowsShownParams = import_zod31.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
2827
|
+
var AppsWindowsShownResult = import_zod31.z.strictObject({
|
|
2384
2828
|
window: ChatPlace,
|
|
2385
|
-
open:
|
|
2386
|
-
sections:
|
|
2387
|
-
problem:
|
|
2829
|
+
open: import_zod31.z.boolean(),
|
|
2830
|
+
sections: import_zod31.z.array(ShownSection).max(200),
|
|
2831
|
+
problem: import_zod31.z.string().max(400).nullable()
|
|
2388
2832
|
});
|
|
2389
|
-
var AppsWindowsRestartParams =
|
|
2390
|
-
var AppsWindowsRefreshUsageParams =
|
|
2391
|
-
var AppsProjectsMoveParams =
|
|
2833
|
+
var AppsWindowsRestartParams = import_zod31.z.strictObject({ app_key: AppKey, window: ChatPlace, force: import_zod31.z.boolean().default(false) });
|
|
2834
|
+
var AppsWindowsRefreshUsageParams = import_zod31.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
2835
|
+
var AppsProjectsMoveParams = import_zod31.z.strictObject({
|
|
2392
2836
|
app_key: AppKey,
|
|
2393
2837
|
chat_id: ChatId,
|
|
2394
2838
|
from_project_id: ChatProjectId,
|
|
2395
2839
|
to_project_id: ChatProjectId.optional(),
|
|
2396
|
-
new_project_name:
|
|
2397
|
-
});
|
|
2398
|
-
var AppsProjectsMoveResult =
|
|
2399
|
-
var AppsProjectsCreateParams =
|
|
2400
|
-
var AppsProjectsCreateResult =
|
|
2401
|
-
var AppsProjectsImportPinsParams =
|
|
2402
|
-
var AppsProjectsImportPinsResult =
|
|
2403
|
-
var ProjectMoveChat =
|
|
2404
|
-
var ProjectMoveSkip =
|
|
2405
|
-
var ProjectMoveGroup =
|
|
2406
|
-
ok:
|
|
2407
|
-
name:
|
|
2840
|
+
new_project_name: import_zod31.z.string().min(1).max(200).optional()
|
|
2841
|
+
});
|
|
2842
|
+
var AppsProjectsMoveResult = import_zod31.z.strictObject({ chat: ChatRow, project: ChatProject });
|
|
2843
|
+
var AppsProjectsCreateParams = import_zod31.z.strictObject({ app_key: AppKey, name: import_zod31.z.string().min(1).max(200) });
|
|
2844
|
+
var AppsProjectsCreateResult = import_zod31.z.strictObject({ project: ChatProject });
|
|
2845
|
+
var AppsProjectsImportPinsParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
2846
|
+
var AppsProjectsImportPinsResult = import_zod31.z.strictObject({ message: import_zod31.z.string().max(400) });
|
|
2847
|
+
var ProjectMoveChat = import_zod31.z.strictObject({ chat_id: ChatId, title: import_zod31.z.string().max(300) });
|
|
2848
|
+
var ProjectMoveSkip = import_zod31.z.strictObject({ chat_id: ChatId, title: import_zod31.z.string().max(300), window: ChatPlace.nullable(), reason: import_zod31.z.string().max(400) });
|
|
2849
|
+
var ProjectMoveGroup = import_zod31.z.strictObject({
|
|
2850
|
+
ok: import_zod31.z.boolean(),
|
|
2851
|
+
name: import_zod31.z.string().max(200),
|
|
2408
2852
|
/** Why it is not (or was not) grouped — e.g. the window is open. */
|
|
2409
|
-
reason:
|
|
2853
|
+
reason: import_zod31.z.string().max(400).optional(),
|
|
2410
2854
|
/** Chats that get (or got) the group; already in it; taken from another group of the window. */
|
|
2411
2855
|
assign: nonNegInt.optional(),
|
|
2412
2856
|
already: nonNegInt.optional(),
|
|
2413
2857
|
from_other_groups: nonNegInt.optional(),
|
|
2414
2858
|
/** A group of that name was already there (reused, never doubled). */
|
|
2415
|
-
group_exists:
|
|
2859
|
+
group_exists: import_zod31.z.boolean().optional()
|
|
2416
2860
|
});
|
|
2417
|
-
var ProjectMovePin =
|
|
2418
|
-
ok:
|
|
2861
|
+
var ProjectMovePin = import_zod31.z.strictObject({
|
|
2862
|
+
ok: import_zod31.z.boolean(),
|
|
2419
2863
|
/** "now" = written into the closed window; "next_close" = queued until that window closes. */
|
|
2420
|
-
when:
|
|
2864
|
+
when: import_zod31.z.enum(["now", "next_close"]),
|
|
2421
2865
|
/** Pinned by this call (dry run: would be). */
|
|
2422
2866
|
pinned: nonNegInt,
|
|
2423
2867
|
/** Already pinned there. */
|
|
@@ -2425,108 +2869,108 @@ var ProjectMovePin = import_zod30.z.strictObject({
|
|
|
2425
2869
|
/** Waiting for the window to close (dry run: would wait). */
|
|
2426
2870
|
queued: nonNegInt,
|
|
2427
2871
|
/** Why not pinned (ok false), or why queued. */
|
|
2428
|
-
reason:
|
|
2872
|
+
reason: import_zod31.z.string().max(400).optional()
|
|
2429
2873
|
});
|
|
2430
|
-
var AppsProjectsToWindowParams =
|
|
2874
|
+
var AppsProjectsToWindowParams = import_zod31.z.strictObject({
|
|
2431
2875
|
app_key: AppKey,
|
|
2432
2876
|
project_id: ChatProjectId,
|
|
2433
2877
|
window: ChatPlace,
|
|
2434
2878
|
/** Also take each chat off its other side windows where safe (never main, the holder, an open window). */
|
|
2435
|
-
take_off:
|
|
2879
|
+
take_off: import_zod31.z.boolean().default(false),
|
|
2436
2880
|
/** Also group them under the project's name in that window's sidebar (closed windows only). */
|
|
2437
|
-
group:
|
|
2881
|
+
group: import_zod31.z.boolean().default(false),
|
|
2438
2882
|
/** 1.32: also pin them in that window (now if closed, else when it next closes). */
|
|
2439
|
-
pin:
|
|
2883
|
+
pin: import_zod31.z.boolean().optional(),
|
|
2440
2884
|
/** 1.36: a batch: exactly these chats of the project and no other (a reused marker is a label, never a sweep). */
|
|
2441
|
-
chat_ids:
|
|
2885
|
+
chat_ids: import_zod31.z.array(ChatId).min(1).max(5e3).optional(),
|
|
2442
2886
|
/** 1.36: take them off this one side window only (a Move's origin), never main or another window that lists them. */
|
|
2443
2887
|
take_off_from: ChatPlace.optional(),
|
|
2444
|
-
dry_run:
|
|
2888
|
+
dry_run: import_zod31.z.boolean().default(false)
|
|
2445
2889
|
});
|
|
2446
|
-
var AppsProjectsToWindowResult =
|
|
2890
|
+
var AppsProjectsToWindowResult = import_zod31.z.strictObject({
|
|
2447
2891
|
project_id: ChatProjectId,
|
|
2448
2892
|
window: ChatPlace,
|
|
2449
|
-
dry_run:
|
|
2450
|
-
place:
|
|
2451
|
-
already:
|
|
2452
|
-
take_off:
|
|
2453
|
-
skipped:
|
|
2893
|
+
dry_run: import_zod31.z.boolean(),
|
|
2894
|
+
place: import_zod31.z.array(ProjectMoveChat).max(5e3),
|
|
2895
|
+
already: import_zod31.z.array(ProjectMoveChat).max(5e3),
|
|
2896
|
+
take_off: import_zod31.z.array(ProjectMoveChat.extend({ window: ChatPlace })).max(2e4),
|
|
2897
|
+
skipped: import_zod31.z.array(ProjectMoveSkip).max(2e4),
|
|
2454
2898
|
/** Chats of the project from other apps (no windows to place into), left as they are. */
|
|
2455
2899
|
other_apps: nonNegInt,
|
|
2456
2900
|
group: ProjectMoveGroup.nullable(),
|
|
2457
2901
|
/** 1.32: the pin in the target window (absent: not asked). */
|
|
2458
2902
|
pin: ProjectMovePin.optional(),
|
|
2459
|
-
message:
|
|
2903
|
+
message: import_zod31.z.string().max(400)
|
|
2460
2904
|
});
|
|
2461
|
-
var ColdChat =
|
|
2905
|
+
var ColdChat = import_zod31.z.strictObject({
|
|
2462
2906
|
id: ChatId,
|
|
2463
|
-
title:
|
|
2464
|
-
repo:
|
|
2465
|
-
window:
|
|
2466
|
-
account:
|
|
2467
|
-
model_name:
|
|
2907
|
+
title: import_zod31.z.string().max(1e3),
|
|
2908
|
+
repo: import_zod31.z.string().max(200).nullable(),
|
|
2909
|
+
window: import_zod31.z.string().max(64).nullable(),
|
|
2910
|
+
account: import_zod31.z.string().max(320).nullable(),
|
|
2911
|
+
model_name: import_zod31.z.string().max(120).nullable(),
|
|
2468
2912
|
context_tokens: nonNegInt,
|
|
2469
2913
|
cold_at_ms: epochMs,
|
|
2470
2914
|
/** Waking it once the cache is cold. */
|
|
2471
|
-
cold_cost:
|
|
2915
|
+
cold_cost: import_zod31.z.number().nullable(),
|
|
2472
2916
|
/** Waking it while the cache is warm. */
|
|
2473
|
-
warm_cost:
|
|
2917
|
+
warm_cost: import_zod31.z.number().nullable(),
|
|
2474
2918
|
/** Its account is on extra usage (a 5-minute cache, and real money). */
|
|
2475
|
-
extra_usage:
|
|
2919
|
+
extra_usage: import_zod31.z.boolean(),
|
|
2476
2920
|
/** A scheduled routine's run. */
|
|
2477
|
-
scheduled:
|
|
2921
|
+
scheduled: import_zod31.z.boolean(),
|
|
2478
2922
|
/** It can be shown in its window (started in the desktop app). */
|
|
2479
|
-
openable:
|
|
2923
|
+
openable: import_zod31.z.boolean(),
|
|
2480
2924
|
/** How its window was decided, or why it can't be opened. */
|
|
2481
|
-
how:
|
|
2925
|
+
how: import_zod31.z.string().max(200).nullable()
|
|
2482
2926
|
});
|
|
2483
|
-
var AppsChatsColdParams =
|
|
2484
|
-
var AppsChatsColdResult =
|
|
2927
|
+
var AppsChatsColdParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
2928
|
+
var AppsChatsColdResult = import_zod31.z.strictObject({
|
|
2485
2929
|
app_key: AppKey,
|
|
2486
2930
|
/** Waiting for the person with a warm cache, most urgent first. */
|
|
2487
|
-
waiting:
|
|
2931
|
+
waiting: import_zod31.z.array(ColdChat).max(2e3),
|
|
2488
2932
|
/** Went cold in the last while. */
|
|
2489
|
-
recently_cold:
|
|
2933
|
+
recently_cold: import_zod31.z.array(ColdChat).max(2e3),
|
|
2490
2934
|
/** Chats working right now (not waiting). */
|
|
2491
2935
|
working: nonNegInt
|
|
2492
2936
|
});
|
|
2493
|
-
var TitleCopies =
|
|
2937
|
+
var TitleCopies = import_zod31.z.strictObject({
|
|
2494
2938
|
window: ChatPlace,
|
|
2495
2939
|
/** Record copies in that window holding a different name (main keeps one per account folder). */
|
|
2496
2940
|
copies: nonNegInt,
|
|
2497
|
-
titles:
|
|
2941
|
+
titles: import_zod31.z.array(import_zod31.z.strictObject({ title: import_zod31.z.string().max(2e3), source: import_zod31.z.string().max(32) })).max(50)
|
|
2498
2942
|
});
|
|
2499
|
-
var TitleMismatch =
|
|
2943
|
+
var TitleMismatch = import_zod31.z.strictObject({
|
|
2500
2944
|
chat_id: ChatId,
|
|
2501
2945
|
/** The right name: the latest one a person gave it (in any window, or in Matrx), else the newest automatic title. */
|
|
2502
|
-
title:
|
|
2503
|
-
title_source:
|
|
2946
|
+
title: import_zod31.z.string().max(2e3),
|
|
2947
|
+
title_source: import_zod31.z.enum(["user", "auto"]),
|
|
2504
2948
|
/** Where the right name came from: a window, "matrx", or "ledger" (decided earlier). */
|
|
2505
|
-
decided_from:
|
|
2506
|
-
kind:
|
|
2507
|
-
windows:
|
|
2508
|
-
differs_in:
|
|
2949
|
+
decided_from: import_zod31.z.string().max(64),
|
|
2950
|
+
kind: import_zod31.z.enum(["user_vs_auto", "user_vs_user", "auto_vs_auto", "source_only"]),
|
|
2951
|
+
windows: import_zod31.z.array(ChatPlace).max(200),
|
|
2952
|
+
differs_in: import_zod31.z.array(TitleCopies).max(200)
|
|
2509
2953
|
});
|
|
2510
|
-
var StaleTitleWindow =
|
|
2954
|
+
var StaleTitleWindow = import_zod31.z.strictObject({
|
|
2511
2955
|
window: ChatPlace,
|
|
2512
2956
|
/** First and latest time (ms) it was seen writing an old name back. */
|
|
2513
2957
|
since_ms: nonNegInt,
|
|
2514
2958
|
last_ms: nonNegInt
|
|
2515
2959
|
});
|
|
2516
|
-
var AppsChatsTitlesCheckParams =
|
|
2517
|
-
var AppsChatsTitlesCheckResult =
|
|
2960
|
+
var AppsChatsTitlesCheckParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
2961
|
+
var AppsChatsTitlesCheckResult = import_zod31.z.strictObject({
|
|
2518
2962
|
app_key: AppKey,
|
|
2519
2963
|
chats_total: nonNegInt,
|
|
2520
2964
|
chats_in_several_windows: nonNegInt,
|
|
2521
2965
|
/** Chats with a different name in some window (or in Matrx). */
|
|
2522
2966
|
chats_with_a_different_name: nonNegInt,
|
|
2523
2967
|
copies_to_write: nonNegInt,
|
|
2524
|
-
chats:
|
|
2968
|
+
chats: import_zod31.z.array(TitleMismatch).max(5e3),
|
|
2525
2969
|
/** Windows that keep writing old names back (each is fixed every pass; reloading it, Cmd+R, stops it). Since 1.33. */
|
|
2526
|
-
stale_windows:
|
|
2970
|
+
stale_windows: import_zod31.z.array(StaleTitleWindow).max(200).optional()
|
|
2527
2971
|
});
|
|
2528
|
-
var AppsChatsTitlesPushParams =
|
|
2529
|
-
var AppsChatsTitlesPushResult =
|
|
2972
|
+
var AppsChatsTitlesPushParams = import_zod31.z.strictObject({ app_key: AppKey, chat_id: ChatId.optional(), dry_run: import_zod31.z.boolean().optional() });
|
|
2973
|
+
var AppsChatsTitlesPushResult = import_zod31.z.strictObject({
|
|
2530
2974
|
app_key: AppKey,
|
|
2531
2975
|
/** Record files rewritten (title and titleSource only, each backed up first). */
|
|
2532
2976
|
written: nonNegInt,
|
|
@@ -2536,122 +2980,122 @@ var AppsChatsTitlesPushResult = import_zod30.z.strictObject({
|
|
|
2536
2980
|
/** Still different after the push (dry_run: would be written). */
|
|
2537
2981
|
chats_with_a_different_name: nonNegInt
|
|
2538
2982
|
});
|
|
2539
|
-
var AppsChatsOpenParams =
|
|
2540
|
-
var SpendSplit =
|
|
2541
|
-
var SpendScopes =
|
|
2542
|
-
var SpendAccount =
|
|
2543
|
-
account:
|
|
2983
|
+
var AppsChatsOpenParams = import_zod31.z.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
|
|
2984
|
+
var SpendSplit = import_zod31.z.strictObject({ main: import_zod31.z.number(), helpers: import_zod31.z.number() });
|
|
2985
|
+
var SpendScopes = import_zod31.z.strictObject({ today: SpendSplit, week: SpendSplit });
|
|
2986
|
+
var SpendAccount = import_zod31.z.strictObject({
|
|
2987
|
+
account: import_zod31.z.string().max(320),
|
|
2544
2988
|
spend: SpendScopes,
|
|
2545
|
-
last_hour:
|
|
2546
|
-
last_5h:
|
|
2547
|
-
five_hour:
|
|
2548
|
-
weekly:
|
|
2989
|
+
last_hour: import_zod31.z.number().nullable(),
|
|
2990
|
+
last_5h: import_zod31.z.number().nullable(),
|
|
2991
|
+
five_hour: import_zod31.z.number().nullable(),
|
|
2992
|
+
weekly: import_zod31.z.number().nullable(),
|
|
2549
2993
|
as_of_ms: epochMs.nullable(),
|
|
2550
2994
|
weekly_resets_at_ms: epochMs.nullable(),
|
|
2551
2995
|
/** When the 5-hour or weekly limit is projected to be reached at the current burn. */
|
|
2552
2996
|
five_hour_full_at_ms: epochMs.nullable(),
|
|
2553
2997
|
weekly_full_at_ms: epochMs.nullable(),
|
|
2554
2998
|
/** The reading is too old to project. */
|
|
2555
|
-
stale:
|
|
2999
|
+
stale: import_zod31.z.boolean()
|
|
2556
3000
|
});
|
|
2557
|
-
var SpendModel =
|
|
2558
|
-
var SpendChat =
|
|
3001
|
+
var SpendModel = import_zod31.z.strictObject({ model: import_zod31.z.string().max(120), name: import_zod31.z.string().max(120), spend: SpendScopes });
|
|
3002
|
+
var SpendChat = import_zod31.z.strictObject({
|
|
2559
3003
|
id: ChatId,
|
|
2560
|
-
title:
|
|
2561
|
-
repo:
|
|
2562
|
-
window:
|
|
3004
|
+
title: import_zod31.z.string().max(1e3),
|
|
3005
|
+
repo: import_zod31.z.string().max(200).nullable(),
|
|
3006
|
+
window: import_zod31.z.string().max(64).nullable(),
|
|
2563
3007
|
spend: SpendScopes,
|
|
2564
3008
|
helpers: nonNegInt
|
|
2565
3009
|
});
|
|
2566
|
-
var SpendHelper =
|
|
2567
|
-
var SpendLive =
|
|
2568
|
-
var SpendIdleScope =
|
|
2569
|
-
var SpendIdle =
|
|
2570
|
-
var SpendStart =
|
|
2571
|
-
var SpendDay =
|
|
2572
|
-
var AppsSpendParams =
|
|
2573
|
-
var AppsSpendResult =
|
|
3010
|
+
var SpendHelper = import_zod31.z.strictObject({ model: import_zod31.z.string().max(120), steps: nonNegInt, over_steps: import_zod31.z.boolean(), description: import_zod31.z.string().max(400) });
|
|
3011
|
+
var SpendLive = import_zod31.z.strictObject({ id: ChatId, title: import_zod31.z.string().max(1e3), window: import_zod31.z.string().max(64).nullable(), helpers: import_zod31.z.array(SpendHelper).max(200) });
|
|
3012
|
+
var SpendIdleScope = import_zod31.z.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: import_zod31.z.number(), avoidable: import_zod31.z.number() });
|
|
3013
|
+
var SpendIdle = import_zod31.z.strictObject({ id: ChatId, chat: import_zod31.z.string().max(1e3), who: import_zod31.z.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
|
|
3014
|
+
var SpendStart = import_zod31.z.strictObject({ repo: import_zod31.z.string().max(200), count: nonNegInt, median: nonNegInt, latest: import_zod31.z.array(nonNegInt).max(20), alarm: import_zod31.z.string().max(400).nullable() });
|
|
3015
|
+
var SpendDay = import_zod31.z.strictObject({ date: import_zod31.z.string().regex(/^\d{4}-\d{2}-\d{2}$/), main: import_zod31.z.number(), helpers: import_zod31.z.number() });
|
|
3016
|
+
var AppsSpendParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
3017
|
+
var AppsSpendResult = import_zod31.z.strictObject({
|
|
2574
3018
|
app_key: AppKey,
|
|
2575
3019
|
/** False while older chats are still being read. */
|
|
2576
|
-
complete:
|
|
2577
|
-
today_total:
|
|
2578
|
-
week_total:
|
|
2579
|
-
idle_today:
|
|
2580
|
-
idle_week:
|
|
3020
|
+
complete: import_zod31.z.boolean(),
|
|
3021
|
+
today_total: import_zod31.z.number(),
|
|
3022
|
+
week_total: import_zod31.z.number(),
|
|
3023
|
+
idle_today: import_zod31.z.number(),
|
|
3024
|
+
idle_week: import_zod31.z.number(),
|
|
2581
3025
|
/** Models with no known list price. */
|
|
2582
|
-
unpriced:
|
|
3026
|
+
unpriced: import_zod31.z.array(import_zod31.z.string().max(120)).max(100),
|
|
2583
3027
|
/** Helpers past their step budget, unusual starting sizes. */
|
|
2584
|
-
alarms:
|
|
2585
|
-
live:
|
|
2586
|
-
accounts:
|
|
2587
|
-
models:
|
|
3028
|
+
alarms: import_zod31.z.array(import_zod31.z.string().max(400)).max(200),
|
|
3029
|
+
live: import_zod31.z.array(SpendLive).max(200),
|
|
3030
|
+
accounts: import_zod31.z.array(SpendAccount).max(200),
|
|
3031
|
+
models: import_zod31.z.array(SpendModel).max(100),
|
|
2588
3032
|
/** (1.24) The last 7 days, oldest first (today last). */
|
|
2589
|
-
days:
|
|
2590
|
-
chats:
|
|
2591
|
-
idle:
|
|
2592
|
-
starts:
|
|
2593
|
-
});
|
|
2594
|
-
var AppsSyncStatusParams =
|
|
2595
|
-
var AppsSyncStatusResult =
|
|
2596
|
-
healthy:
|
|
2597
|
-
summary:
|
|
2598
|
-
problems:
|
|
2599
|
-
warnings:
|
|
3033
|
+
days: import_zod31.z.array(SpendDay).max(14).optional(),
|
|
3034
|
+
chats: import_zod31.z.array(SpendChat).max(500),
|
|
3035
|
+
idle: import_zod31.z.array(SpendIdle).max(500),
|
|
3036
|
+
starts: import_zod31.z.array(SpendStart).max(200)
|
|
3037
|
+
});
|
|
3038
|
+
var AppsSyncStatusParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
3039
|
+
var AppsSyncStatusResult = import_zod31.z.strictObject({
|
|
3040
|
+
healthy: import_zod31.z.boolean(),
|
|
3041
|
+
summary: import_zod31.z.string().max(400),
|
|
3042
|
+
problems: import_zod31.z.array(import_zod31.z.string().max(400)).max(200),
|
|
3043
|
+
warnings: import_zod31.z.array(import_zod31.z.string().max(400)).max(200),
|
|
2600
3044
|
/** Accounts seen with no saved name yet (Save account names fixes them). */
|
|
2601
|
-
unnamed_accounts:
|
|
3045
|
+
unnamed_accounts: import_zod31.z.array(import_zod31.z.string().max(80)).max(200),
|
|
2602
3046
|
/** The full report. */
|
|
2603
|
-
output:
|
|
2604
|
-
});
|
|
2605
|
-
var AppsSyncRunParams =
|
|
2606
|
-
var AppsWindowsProcessesParams =
|
|
2607
|
-
var AppsWindowsProcessesResult =
|
|
2608
|
-
var AppsWindowsAddParams =
|
|
2609
|
-
var AppsWindowsSaveNamesParams =
|
|
2610
|
-
var AppsWindowsUpdateStateParams =
|
|
2611
|
-
var AppsWindowsUpdateStateResult =
|
|
3047
|
+
output: import_zod31.z.string().max(2e5)
|
|
3048
|
+
});
|
|
3049
|
+
var AppsSyncRunParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
3050
|
+
var AppsWindowsProcessesParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
3051
|
+
var AppsWindowsProcessesResult = import_zod31.z.strictObject({ processes: import_zod31.z.array(import_zod31.z.string().max(2e3)).max(2e3) });
|
|
3052
|
+
var AppsWindowsAddParams = import_zod31.z.strictObject({ app_key: AppKey, window: ChatPlace, email: import_zod31.z.string().min(3).max(320) });
|
|
3053
|
+
var AppsWindowsSaveNamesParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
3054
|
+
var AppsWindowsUpdateStateParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
3055
|
+
var AppsWindowsUpdateStateResult = import_zod31.z.strictObject({
|
|
2612
3056
|
app_key: AppKey,
|
|
2613
|
-
pending:
|
|
3057
|
+
pending: import_zod31.z.boolean(),
|
|
2614
3058
|
/** The downloaded release's name (Claude: "Claude 2.31226.1"), when the app's log names it. */
|
|
2615
|
-
version:
|
|
3059
|
+
version: import_zod31.z.string().max(120).nullable(),
|
|
2616
3060
|
/** When the update became pending (the download's time), when known. */
|
|
2617
3061
|
since_ms: epochMs.nullable(),
|
|
2618
3062
|
/** Windows open when the update became pending (or last seen open) that are closed now. */
|
|
2619
|
-
closed:
|
|
3063
|
+
closed: import_zod31.z.array(ChatPlace).max(200),
|
|
2620
3064
|
/**
|
|
2621
3065
|
* Since 1.27: the windows in `closed` that the update itself quit (the app's log records a quit for
|
|
2622
3066
|
* the update within a minute of when each was last seen running). Absent: not known.
|
|
2623
3067
|
*/
|
|
2624
|
-
closed_by_update:
|
|
3068
|
+
closed_by_update: import_zod31.z.array(ChatPlace).max(200).optional()
|
|
2625
3069
|
});
|
|
2626
|
-
var AppsWindowsReopenParams =
|
|
2627
|
-
var AppsWindowsReopenResult =
|
|
2628
|
-
var AppsWindowsUpdateAndReopenParams =
|
|
2629
|
-
var AppsWindowsUpdateAndReopenResult =
|
|
2630
|
-
message:
|
|
3070
|
+
var AppsWindowsReopenParams = import_zod31.z.strictObject({ app_key: AppKey, windows: import_zod31.z.array(ChatPlace).min(1).max(200) });
|
|
3071
|
+
var AppsWindowsReopenResult = import_zod31.z.strictObject({ message: import_zod31.z.string().max(400), opened: import_zod31.z.array(ChatPlace).max(200) });
|
|
3072
|
+
var AppsWindowsUpdateAndReopenParams = import_zod31.z.strictObject({ app_key: AppKey, force: import_zod31.z.boolean().default(false), dry_run: import_zod31.z.boolean().default(false) });
|
|
3073
|
+
var AppsWindowsUpdateAndReopenResult = import_zod31.z.strictObject({
|
|
3074
|
+
message: import_zod31.z.string().max(400),
|
|
2631
3075
|
/** Windows quit (with dry_run: to be quit). */
|
|
2632
|
-
quit:
|
|
3076
|
+
quit: import_zod31.z.array(ChatPlace).max(200),
|
|
2633
3077
|
/** Windows reopened (with dry_run: to be reopened), main first. */
|
|
2634
|
-
reopened:
|
|
3078
|
+
reopened: import_zod31.z.array(ChatPlace).max(200),
|
|
2635
3079
|
/** The version installed, null when the install did not happen (or dry_run). */
|
|
2636
|
-
installed_version:
|
|
3080
|
+
installed_version: import_zod31.z.string().max(64).nullable()
|
|
2637
3081
|
});
|
|
2638
3082
|
|
|
2639
3083
|
// src/schema/browser.ts
|
|
2640
|
-
var
|
|
2641
|
-
var BrowserClientInstance =
|
|
2642
|
-
var BrowserKind =
|
|
2643
|
-
var BrowserSessionState =
|
|
2644
|
-
var BrowserSession =
|
|
3084
|
+
var import_zod32 = require("zod");
|
|
3085
|
+
var BrowserClientInstance = import_zod32.z.string().min(1).max(64).regex(/^[A-Za-z0-9_.:-]+$/);
|
|
3086
|
+
var BrowserKind = import_zod32.z.enum(["chrome", "edge", "brave", "arc", "opera", "vivaldi", "chromium", "firefox", "other"]);
|
|
3087
|
+
var BrowserSessionState = import_zod32.z.enum(["connected", "different_account", "extension_signed_out", "device_signed_out", "unverified"]);
|
|
3088
|
+
var BrowserSession = import_zod32.z.strictObject({
|
|
2645
3089
|
client_instance: BrowserClientInstance,
|
|
2646
3090
|
/** What the person sees ("Chrome — Work"), set by the extension. */
|
|
2647
|
-
client_label:
|
|
3091
|
+
client_label: import_zod32.z.string().min(1).max(128),
|
|
2648
3092
|
browser: BrowserKind,
|
|
2649
|
-
extension_version:
|
|
3093
|
+
extension_version: import_zod32.z.string().min(1).max(32),
|
|
2650
3094
|
state: BrowserSessionState,
|
|
2651
3095
|
/** True only for `connected`: an agent's call can reach this session. */
|
|
2652
|
-
routable:
|
|
3096
|
+
routable: import_zod32.z.boolean(),
|
|
2653
3097
|
/** The extension's account email from its token (null when signed out or unknown). */
|
|
2654
|
-
account_email:
|
|
3098
|
+
account_email: import_zod32.z.string().max(320).nullable(),
|
|
2655
3099
|
connected_at_ms: epochMs,
|
|
2656
3100
|
last_call_at_ms: epochMs.nullable(),
|
|
2657
3101
|
calls: nonNegInt,
|
|
@@ -2660,687 +3104,687 @@ var BrowserSession = import_zod31.z.strictObject({
|
|
|
2660
3104
|
p50_ms: nonNegInt.nullable(),
|
|
2661
3105
|
p95_ms: nonNegInt.nullable(),
|
|
2662
3106
|
/** A call is waiting for the person to confirm it in the browser. */
|
|
2663
|
-
awaiting_confirmation:
|
|
3107
|
+
awaiting_confirmation: import_zod32.z.boolean()
|
|
2664
3108
|
});
|
|
2665
|
-
var BrowserRegisterParams =
|
|
3109
|
+
var BrowserRegisterParams = import_zod32.z.strictObject({
|
|
2666
3110
|
client_instance: BrowserClientInstance,
|
|
2667
|
-
client_label:
|
|
3111
|
+
client_label: import_zod32.z.string().min(1).max(128),
|
|
2668
3112
|
browser: BrowserKind,
|
|
2669
|
-
extension_version:
|
|
3113
|
+
extension_version: import_zod32.z.string().min(1).max(32),
|
|
2670
3114
|
/** The extension's current AI Matrx access token, checked against the device owner; null when signed out. */
|
|
2671
|
-
account_token:
|
|
3115
|
+
account_token: import_zod32.z.string().min(16).max(8192).nullable()
|
|
2672
3116
|
});
|
|
2673
|
-
var BrowserRegisterResult =
|
|
2674
|
-
var BrowserCallError =
|
|
2675
|
-
message:
|
|
3117
|
+
var BrowserRegisterResult = import_zod32.z.strictObject({ session: BrowserSession });
|
|
3118
|
+
var BrowserCallError = import_zod32.z.strictObject({
|
|
3119
|
+
message: import_zod32.z.string().max(1e3),
|
|
2676
3120
|
/** The extension's own error code, when it has one ("tool_not_found", "denied"). */
|
|
2677
|
-
code:
|
|
3121
|
+
code: import_zod32.z.string().max(64).nullable()
|
|
2678
3122
|
});
|
|
2679
|
-
var BrowserResultParams =
|
|
2680
|
-
call_id:
|
|
2681
|
-
ok:
|
|
3123
|
+
var BrowserResultParams = import_zod32.z.strictObject({
|
|
3124
|
+
call_id: import_zod32.z.string().min(1).max(64),
|
|
3125
|
+
ok: import_zod32.z.boolean(),
|
|
2682
3126
|
/** The tool's result when ok (any JSON). */
|
|
2683
|
-
result:
|
|
3127
|
+
result: import_zod32.z.unknown(),
|
|
2684
3128
|
error: BrowserCallError.nullable()
|
|
2685
3129
|
});
|
|
2686
|
-
var BrowserResultResult =
|
|
2687
|
-
var BrowserCallPhase =
|
|
2688
|
-
var BrowserProgressParams =
|
|
2689
|
-
var BrowserProgressResult =
|
|
2690
|
-
var BrowserSessionsParams =
|
|
2691
|
-
var BrowserSessionsResult =
|
|
3130
|
+
var BrowserResultResult = import_zod32.z.strictObject({ accepted: import_zod32.z.boolean() });
|
|
3131
|
+
var BrowserCallPhase = import_zod32.z.enum(["awaiting_confirmation", "running"]);
|
|
3132
|
+
var BrowserProgressParams = import_zod32.z.strictObject({ call_id: import_zod32.z.string().min(1).max(64), phase: BrowserCallPhase });
|
|
3133
|
+
var BrowserProgressResult = import_zod32.z.strictObject({ accepted: import_zod32.z.boolean() });
|
|
3134
|
+
var BrowserSessionsParams = import_zod32.z.strictObject({});
|
|
3135
|
+
var BrowserSessionsResult = import_zod32.z.strictObject({
|
|
2692
3136
|
/** The person's Browser connection switch. Off: no pairing, no extension sessions. */
|
|
2693
|
-
enabled:
|
|
3137
|
+
enabled: import_zod32.z.boolean(),
|
|
2694
3138
|
/** Whether Matrx 2 is signed in (without an owner no session is routable). */
|
|
2695
|
-
owner_signed_in:
|
|
2696
|
-
sessions:
|
|
2697
|
-
});
|
|
2698
|
-
var BrowserDisconnectParams =
|
|
2699
|
-
var BrowserDisconnectResult =
|
|
2700
|
-
var BrowserSetEnabledParams =
|
|
2701
|
-
var BrowserSetEnabledResult =
|
|
2702
|
-
var BrowserPairCodeParams =
|
|
2703
|
-
var BrowserPairCodeResult =
|
|
2704
|
-
var BrowserPairResetParams =
|
|
2705
|
-
var BrowserCallParams =
|
|
2706
|
-
tool:
|
|
2707
|
-
args:
|
|
3139
|
+
owner_signed_in: import_zod32.z.boolean(),
|
|
3140
|
+
sessions: import_zod32.z.array(BrowserSession).max(64)
|
|
3141
|
+
});
|
|
3142
|
+
var BrowserDisconnectParams = import_zod32.z.strictObject({ client_instance: BrowserClientInstance });
|
|
3143
|
+
var BrowserDisconnectResult = import_zod32.z.strictObject({ disconnected: import_zod32.z.boolean() });
|
|
3144
|
+
var BrowserSetEnabledParams = import_zod32.z.strictObject({ enabled: import_zod32.z.boolean() });
|
|
3145
|
+
var BrowserSetEnabledResult = import_zod32.z.strictObject({ enabled: import_zod32.z.boolean() });
|
|
3146
|
+
var BrowserPairCodeParams = import_zod32.z.strictObject({});
|
|
3147
|
+
var BrowserPairCodeResult = import_zod32.z.strictObject({ code: import_zod32.z.string().min(16).max(128) });
|
|
3148
|
+
var BrowserPairResetParams = import_zod32.z.strictObject({});
|
|
3149
|
+
var BrowserCallParams = import_zod32.z.strictObject({
|
|
3150
|
+
tool: import_zod32.z.string().min(1).max(96).regex(/^[a-z][a-z0-9_]*$/),
|
|
3151
|
+
args: import_zod32.z.record(import_zod32.z.string(), import_zod32.z.unknown()),
|
|
2708
3152
|
/** Which session; default: the most recently active routable one (BROWSER ambiguity → CONFLICT). */
|
|
2709
3153
|
client_instance: BrowserClientInstance.optional(),
|
|
2710
3154
|
/** How long to wait, including a person's confirmation; default 120 s. */
|
|
2711
|
-
timeout_ms:
|
|
3155
|
+
timeout_ms: import_zod32.z.int().min(1e3).max(6e5).optional()
|
|
2712
3156
|
});
|
|
2713
|
-
var BrowserCallResult =
|
|
3157
|
+
var BrowserCallResult = import_zod32.z.strictObject({
|
|
2714
3158
|
client_instance: BrowserClientInstance,
|
|
2715
|
-
result:
|
|
3159
|
+
result: import_zod32.z.unknown(),
|
|
2716
3160
|
duration_ms: nonNegInt
|
|
2717
3161
|
});
|
|
2718
|
-
var BrowserToolMetricsParams =
|
|
2719
|
-
var BrowserToolMetric =
|
|
2720
|
-
tool:
|
|
3162
|
+
var BrowserToolMetricsParams = import_zod32.z.strictObject({ client_instance: BrowserClientInstance });
|
|
3163
|
+
var BrowserToolMetric = import_zod32.z.strictObject({
|
|
3164
|
+
tool: import_zod32.z.string().max(256),
|
|
2721
3165
|
calls: nonNegInt,
|
|
2722
3166
|
errors: nonNegInt,
|
|
2723
3167
|
/** Over the last 200 answered calls; null before the first answer. */
|
|
2724
3168
|
p50_ms: nonNegInt.nullable(),
|
|
2725
3169
|
p95_ms: nonNegInt.nullable(),
|
|
2726
3170
|
last_call_at_ms: epochMs.nullable(),
|
|
2727
|
-
last_error:
|
|
3171
|
+
last_error: import_zod32.z.string().max(2048).nullable()
|
|
2728
3172
|
});
|
|
2729
|
-
var BrowserToolMetricsResult =
|
|
2730
|
-
var BrowserResetCountersParams =
|
|
2731
|
-
var BrowserResetCountersResult =
|
|
2732
|
-
var BrowserLogParams =
|
|
3173
|
+
var BrowserToolMetricsResult = import_zod32.z.strictObject({ client_instance: import_zod32.z.string(), tools: import_zod32.z.array(BrowserToolMetric) });
|
|
3174
|
+
var BrowserResetCountersParams = import_zod32.z.strictObject({ client_instance: BrowserClientInstance });
|
|
3175
|
+
var BrowserResetCountersResult = import_zod32.z.strictObject({ reset: import_zod32.z.boolean() });
|
|
3176
|
+
var BrowserLogParams = import_zod32.z.strictObject({
|
|
2733
3177
|
/** Only messages after this seq (0: from the oldest kept; the core keeps the last 500). */
|
|
2734
3178
|
after_seq: nonNegInt.default(0),
|
|
2735
|
-
limit:
|
|
3179
|
+
limit: import_zod32.z.int().min(1).max(500).default(500)
|
|
2736
3180
|
});
|
|
2737
|
-
var BrowserLogMessage =
|
|
3181
|
+
var BrowserLogMessage = import_zod32.z.strictObject({
|
|
2738
3182
|
seq: nonNegInt,
|
|
2739
3183
|
at_ms: epochMs,
|
|
2740
|
-
direction:
|
|
2741
|
-
client_instance:
|
|
2742
|
-
kind:
|
|
2743
|
-
tool:
|
|
2744
|
-
call_id:
|
|
2745
|
-
ok:
|
|
2746
|
-
detail:
|
|
2747
|
-
});
|
|
2748
|
-
var BrowserLogResult =
|
|
2749
|
-
messages:
|
|
3184
|
+
direction: import_zod32.z.enum(["to_browser", "from_browser", "core"]),
|
|
3185
|
+
client_instance: import_zod32.z.string(),
|
|
3186
|
+
kind: import_zod32.z.enum(["register", "invoke", "result", "progress", "timeout", "closed"]),
|
|
3187
|
+
tool: import_zod32.z.string().nullable(),
|
|
3188
|
+
call_id: import_zod32.z.string().nullable(),
|
|
3189
|
+
ok: import_zod32.z.boolean().nullable(),
|
|
3190
|
+
detail: import_zod32.z.string().max(1024)
|
|
3191
|
+
});
|
|
3192
|
+
var BrowserLogResult = import_zod32.z.strictObject({
|
|
3193
|
+
messages: import_zod32.z.array(BrowserLogMessage),
|
|
2750
3194
|
/** The newest seq the core has written (pass it back as after_seq to follow the log). */
|
|
2751
3195
|
last_seq: nonNegInt
|
|
2752
3196
|
});
|
|
2753
|
-
var BrowserInvokeEvent =
|
|
2754
|
-
call_id:
|
|
2755
|
-
tool:
|
|
2756
|
-
args:
|
|
3197
|
+
var BrowserInvokeEvent = import_zod32.z.strictObject({
|
|
3198
|
+
call_id: import_zod32.z.string().min(1).max(64),
|
|
3199
|
+
tool: import_zod32.z.string().min(1).max(96),
|
|
3200
|
+
args: import_zod32.z.record(import_zod32.z.string(), import_zod32.z.unknown()),
|
|
2757
3201
|
deadline_ms: epochMs
|
|
2758
3202
|
});
|
|
2759
|
-
var BrowserSessionsChangedEvent =
|
|
2760
|
-
var BrowserProgressEvent =
|
|
2761
|
-
call_id:
|
|
3203
|
+
var BrowserSessionsChangedEvent = import_zod32.z.strictObject({ count: nonNegInt, enabled: import_zod32.z.boolean() });
|
|
3204
|
+
var BrowserProgressEvent = import_zod32.z.strictObject({
|
|
3205
|
+
call_id: import_zod32.z.string().min(1).max(64),
|
|
2762
3206
|
client_instance: BrowserClientInstance,
|
|
2763
3207
|
phase: BrowserCallPhase
|
|
2764
3208
|
});
|
|
2765
|
-
var DesktopHealth =
|
|
2766
|
-
status:
|
|
2767
|
-
service:
|
|
2768
|
-
version:
|
|
2769
|
-
protocol_version:
|
|
2770
|
-
ws_path:
|
|
2771
|
-
device_id:
|
|
2772
|
-
browser_connection:
|
|
2773
|
-
});
|
|
2774
|
-
var BrowserPairRequest =
|
|
2775
|
-
var BrowserPairResult =
|
|
3209
|
+
var DesktopHealth = import_zod32.z.strictObject({
|
|
3210
|
+
status: import_zod32.z.literal("ok"),
|
|
3211
|
+
service: import_zod32.z.literal("matrx-desktop"),
|
|
3212
|
+
version: import_zod32.z.string().max(32),
|
|
3213
|
+
protocol_version: import_zod32.z.string().max(16),
|
|
3214
|
+
ws_path: import_zod32.z.literal("/v1/connect"),
|
|
3215
|
+
device_id: import_zod32.z.string().max(64),
|
|
3216
|
+
browser_connection: import_zod32.z.enum(["on", "off"])
|
|
3217
|
+
});
|
|
3218
|
+
var BrowserPairRequest = import_zod32.z.strictObject({ client_instance: BrowserClientInstance });
|
|
3219
|
+
var BrowserPairResult = import_zod32.z.strictObject({ pair_token: import_zod32.z.string().min(16).max(128), ws_path: import_zod32.z.literal("/v1/connect") });
|
|
2776
3220
|
|
|
2777
3221
|
// src/schema/net.ts
|
|
2778
|
-
var
|
|
2779
|
-
var NetInfoParams =
|
|
2780
|
-
var NetAddress =
|
|
2781
|
-
address:
|
|
2782
|
-
family:
|
|
2783
|
-
netmask:
|
|
3222
|
+
var import_zod33 = require("zod");
|
|
3223
|
+
var NetInfoParams = import_zod33.z.strictObject({});
|
|
3224
|
+
var NetAddress = import_zod33.z.strictObject({
|
|
3225
|
+
address: import_zod33.z.string(),
|
|
3226
|
+
family: import_zod33.z.enum(["ipv4", "ipv6"]),
|
|
3227
|
+
netmask: import_zod33.z.string().nullable(),
|
|
2784
3228
|
/** CIDR form ("192.168.1.20/24"); null where the OS gives no prefix. */
|
|
2785
|
-
cidr:
|
|
3229
|
+
cidr: import_zod33.z.string().nullable()
|
|
2786
3230
|
});
|
|
2787
|
-
var NetInterface =
|
|
2788
|
-
name:
|
|
2789
|
-
mac:
|
|
3231
|
+
var NetInterface = import_zod33.z.strictObject({
|
|
3232
|
+
name: import_zod33.z.string(),
|
|
3233
|
+
mac: import_zod33.z.string().nullable(),
|
|
2790
3234
|
/** Loopback and other internal interfaces. */
|
|
2791
|
-
internal:
|
|
2792
|
-
addresses:
|
|
3235
|
+
internal: import_zod33.z.boolean(),
|
|
3236
|
+
addresses: import_zod33.z.array(NetAddress)
|
|
2793
3237
|
});
|
|
2794
|
-
var NetInfoResult =
|
|
2795
|
-
hostname:
|
|
2796
|
-
interfaces:
|
|
3238
|
+
var NetInfoResult = import_zod33.z.strictObject({
|
|
3239
|
+
hostname: import_zod33.z.string(),
|
|
3240
|
+
interfaces: import_zod33.z.array(NetInterface),
|
|
2797
3241
|
/** The default route's gateway; null when the OS does not say (or there is none). */
|
|
2798
|
-
gateway:
|
|
3242
|
+
gateway: import_zod33.z.string().nullable(),
|
|
2799
3243
|
/** The DNS servers the OS uses; empty when it does not say. */
|
|
2800
|
-
dns:
|
|
3244
|
+
dns: import_zod33.z.array(import_zod33.z.string())
|
|
2801
3245
|
});
|
|
2802
|
-
var NetWifiParams =
|
|
2803
|
-
var NetWifiNetwork =
|
|
3246
|
+
var NetWifiParams = import_zod33.z.strictObject({});
|
|
3247
|
+
var NetWifiNetwork = import_zod33.z.strictObject({
|
|
2804
3248
|
/** null: the OS hides the name (macOS without Location Services for this app). */
|
|
2805
|
-
ssid:
|
|
3249
|
+
ssid: import_zod33.z.string().nullable(),
|
|
2806
3250
|
/** dBm; null where the OS does not say. */
|
|
2807
|
-
rssi:
|
|
2808
|
-
channel:
|
|
2809
|
-
security:
|
|
3251
|
+
rssi: import_zod33.z.int().nullable(),
|
|
3252
|
+
channel: import_zod33.z.string().nullable(),
|
|
3253
|
+
security: import_zod33.z.string().nullable()
|
|
2810
3254
|
});
|
|
2811
|
-
var NetWifiResult =
|
|
3255
|
+
var NetWifiResult = import_zod33.z.strictObject({
|
|
2812
3256
|
/** Whether the computer has a Wi-Fi interface at all. */
|
|
2813
|
-
available:
|
|
3257
|
+
available: import_zod33.z.boolean(),
|
|
2814
3258
|
/** The network the computer is on; null when it is on none. */
|
|
2815
3259
|
current: NetWifiNetwork.nullable(),
|
|
2816
3260
|
/** Networks in range (may be empty where the OS lists none to apps). */
|
|
2817
|
-
networks:
|
|
3261
|
+
networks: import_zod33.z.array(NetWifiNetwork)
|
|
2818
3262
|
});
|
|
2819
|
-
var NetBluetoothParams =
|
|
2820
|
-
var NetBluetoothDevice =
|
|
2821
|
-
name:
|
|
2822
|
-
address:
|
|
2823
|
-
connected:
|
|
3263
|
+
var NetBluetoothParams = import_zod33.z.strictObject({});
|
|
3264
|
+
var NetBluetoothDevice = import_zod33.z.strictObject({
|
|
3265
|
+
name: import_zod33.z.string(),
|
|
3266
|
+
address: import_zod33.z.string().nullable(),
|
|
3267
|
+
connected: import_zod33.z.boolean(),
|
|
2824
3268
|
/** What it is, in the OS's words ("Headphones", "Keyboard"); null where it does not say. */
|
|
2825
|
-
kind:
|
|
3269
|
+
kind: import_zod33.z.string().nullable(),
|
|
2826
3270
|
/** Battery percent, where the OS reports it. */
|
|
2827
|
-
battery:
|
|
3271
|
+
battery: import_zod33.z.int().min(0).max(100).nullable()
|
|
2828
3272
|
});
|
|
2829
|
-
var NetBluetoothResult =
|
|
3273
|
+
var NetBluetoothResult = import_zod33.z.strictObject({
|
|
2830
3274
|
/** Bluetooth is on; null where the OS does not say. */
|
|
2831
|
-
powered:
|
|
2832
|
-
devices:
|
|
2833
|
-
});
|
|
2834
|
-
var NetDevicesParams =
|
|
2835
|
-
var NetDevice =
|
|
2836
|
-
ip:
|
|
2837
|
-
mac:
|
|
2838
|
-
interface:
|
|
3275
|
+
powered: import_zod33.z.boolean().nullable(),
|
|
3276
|
+
devices: import_zod33.z.array(NetBluetoothDevice)
|
|
3277
|
+
});
|
|
3278
|
+
var NetDevicesParams = import_zod33.z.strictObject({});
|
|
3279
|
+
var NetDevice = import_zod33.z.strictObject({
|
|
3280
|
+
ip: import_zod33.z.string(),
|
|
3281
|
+
mac: import_zod33.z.string().nullable(),
|
|
3282
|
+
interface: import_zod33.z.string().nullable(),
|
|
2839
3283
|
/** The name the local network gives it (reverse DNS / mDNS), when the table carries one. */
|
|
2840
|
-
hostname:
|
|
3284
|
+
hostname: import_zod33.z.string().nullable()
|
|
2841
3285
|
});
|
|
2842
|
-
var NetDevicesResult =
|
|
2843
|
-
var NetMdnsParams =
|
|
3286
|
+
var NetDevicesResult = import_zod33.z.strictObject({ devices: import_zod33.z.array(NetDevice) });
|
|
3287
|
+
var NetMdnsParams = import_zod33.z.strictObject({
|
|
2844
3288
|
/** A service type ("_http._tcp"); absent lists the service types found. */
|
|
2845
|
-
service_type:
|
|
3289
|
+
service_type: import_zod33.z.string().min(1).max(64).regex(/^_[A-Za-z0-9-]+\._(tcp|udp)$/).optional(),
|
|
2846
3290
|
/** How long to listen. */
|
|
2847
|
-
timeout_s:
|
|
3291
|
+
timeout_s: import_zod33.z.int().min(1).max(30).default(3)
|
|
2848
3292
|
});
|
|
2849
|
-
var NetMdnsService =
|
|
2850
|
-
name:
|
|
2851
|
-
type:
|
|
2852
|
-
domain:
|
|
2853
|
-
interface:
|
|
3293
|
+
var NetMdnsService = import_zod33.z.strictObject({
|
|
3294
|
+
name: import_zod33.z.string(),
|
|
3295
|
+
type: import_zod33.z.string(),
|
|
3296
|
+
domain: import_zod33.z.string(),
|
|
3297
|
+
interface: import_zod33.z.string().nullable()
|
|
2854
3298
|
});
|
|
2855
|
-
var NetMdnsResult =
|
|
2856
|
-
var NetScanParams =
|
|
3299
|
+
var NetMdnsResult = import_zod33.z.strictObject({ services: import_zod33.z.array(NetMdnsService) });
|
|
3300
|
+
var NetScanParams = import_zod33.z.strictObject({
|
|
2857
3301
|
/** A host name or address; a private or loopback address unless `allow_public`. */
|
|
2858
|
-
host:
|
|
2859
|
-
ports:
|
|
2860
|
-
timeout_ms:
|
|
3302
|
+
host: import_zod33.z.string().min(1).max(253),
|
|
3303
|
+
ports: import_zod33.z.array(import_zod33.z.int().min(1).max(65535)).min(1).max(1024),
|
|
3304
|
+
timeout_ms: import_zod33.z.int().min(50).max(1e4).default(800),
|
|
2861
3305
|
/** Scanning a host on the public internet needs saying so. */
|
|
2862
|
-
allow_public:
|
|
3306
|
+
allow_public: import_zod33.z.boolean().default(false)
|
|
2863
3307
|
});
|
|
2864
|
-
var NetScanResult =
|
|
2865
|
-
host:
|
|
3308
|
+
var NetScanResult = import_zod33.z.strictObject({
|
|
3309
|
+
host: import_zod33.z.string(),
|
|
2866
3310
|
/** The address the host resolved to. */
|
|
2867
|
-
address:
|
|
2868
|
-
open:
|
|
3311
|
+
address: import_zod33.z.string(),
|
|
3312
|
+
open: import_zod33.z.array(import_zod33.z.int().min(1).max(65535)),
|
|
2869
3313
|
closed: nonNegInt,
|
|
2870
3314
|
elapsed_ms: nonNegInt
|
|
2871
3315
|
});
|
|
2872
|
-
var NetDownloadParams =
|
|
2873
|
-
url:
|
|
3316
|
+
var NetDownloadParams = import_zod33.z.strictObject({
|
|
3317
|
+
url: import_zod33.z.string().min(1).max(8192).regex(/^https?:\/\//),
|
|
2874
3318
|
/** Where to save it: an absolute path (a folder keeps the URL's file name). */
|
|
2875
3319
|
path: AbsPath,
|
|
2876
|
-
overwrite:
|
|
2877
|
-
timeout_s:
|
|
3320
|
+
overwrite: import_zod33.z.boolean().default(false),
|
|
3321
|
+
timeout_s: import_zod33.z.int().min(1).max(3600).default(300),
|
|
2878
3322
|
/** Refuse anything larger. */
|
|
2879
|
-
max_bytes:
|
|
3323
|
+
max_bytes: import_zod33.z.int().min(1).max(10737418240).default(2147483648)
|
|
2880
3324
|
});
|
|
2881
|
-
var NetDownloadResult =
|
|
2882
|
-
path:
|
|
3325
|
+
var NetDownloadResult = import_zod33.z.strictObject({
|
|
3326
|
+
path: import_zod33.z.string(),
|
|
2883
3327
|
bytes: nonNegInt,
|
|
2884
|
-
content_type:
|
|
3328
|
+
content_type: import_zod33.z.string().nullable(),
|
|
2885
3329
|
/** The final URL after redirects. */
|
|
2886
|
-
url:
|
|
3330
|
+
url: import_zod33.z.string(),
|
|
2887
3331
|
elapsed_ms: nonNegInt
|
|
2888
3332
|
});
|
|
2889
3333
|
|
|
2890
3334
|
// src/schema/personal.ts
|
|
2891
|
-
var
|
|
2892
|
-
var Text =
|
|
2893
|
-
var AutomationScriptParams =
|
|
3335
|
+
var import_zod34 = require("zod");
|
|
3336
|
+
var Text = import_zod34.z.string().max(65536);
|
|
3337
|
+
var AutomationScriptParams = import_zod34.z.strictObject({
|
|
2894
3338
|
/** applescript and jxa: macOS (osascript); powershell: Windows (and pwsh where installed). */
|
|
2895
|
-
language:
|
|
2896
|
-
script:
|
|
2897
|
-
timeout_s:
|
|
2898
|
-
});
|
|
2899
|
-
var AutomationScriptResult =
|
|
2900
|
-
stdout:
|
|
2901
|
-
stderr:
|
|
2902
|
-
exit_code:
|
|
2903
|
-
timed_out:
|
|
3339
|
+
language: import_zod34.z.enum(["applescript", "jxa", "powershell"]),
|
|
3340
|
+
script: import_zod34.z.string().min(1).max(262144),
|
|
3341
|
+
timeout_s: import_zod34.z.int().min(1).max(600).default(60)
|
|
3342
|
+
});
|
|
3343
|
+
var AutomationScriptResult = import_zod34.z.strictObject({
|
|
3344
|
+
stdout: import_zod34.z.string(),
|
|
3345
|
+
stderr: import_zod34.z.string(),
|
|
3346
|
+
exit_code: import_zod34.z.int(),
|
|
3347
|
+
timed_out: import_zod34.z.boolean(),
|
|
2904
3348
|
/** stdout or stderr was cut at 1 MiB. */
|
|
2905
|
-
truncated:
|
|
3349
|
+
truncated: import_zod34.z.boolean(),
|
|
2906
3350
|
elapsed_ms: nonNegInt
|
|
2907
3351
|
});
|
|
2908
|
-
var MailAccountsParams =
|
|
2909
|
-
var MailAccount =
|
|
2910
|
-
var MailAccountsResult =
|
|
2911
|
-
var MailListParams =
|
|
3352
|
+
var MailAccountsParams = import_zod34.z.strictObject({});
|
|
3353
|
+
var MailAccount = import_zod34.z.strictObject({ name: import_zod34.z.string(), emails: import_zod34.z.array(import_zod34.z.string()), enabled: import_zod34.z.boolean() });
|
|
3354
|
+
var MailAccountsResult = import_zod34.z.strictObject({ accounts: import_zod34.z.array(MailAccount) });
|
|
3355
|
+
var MailListParams = import_zod34.z.strictObject({
|
|
2912
3356
|
/** The account's name in Mail; absent: every account. */
|
|
2913
|
-
account:
|
|
3357
|
+
account: import_zod34.z.string().min(1).max(256).optional(),
|
|
2914
3358
|
/** The mailbox's name ("INBOX", "Sent Messages"). */
|
|
2915
|
-
mailbox:
|
|
2916
|
-
unread_only:
|
|
2917
|
-
limit:
|
|
2918
|
-
});
|
|
2919
|
-
var MailMessage =
|
|
2920
|
-
id:
|
|
2921
|
-
subject:
|
|
2922
|
-
sender:
|
|
3359
|
+
mailbox: import_zod34.z.string().min(1).max(256).default("INBOX"),
|
|
3360
|
+
unread_only: import_zod34.z.boolean().default(false),
|
|
3361
|
+
limit: import_zod34.z.int().min(1).max(200).default(25)
|
|
3362
|
+
});
|
|
3363
|
+
var MailMessage = import_zod34.z.strictObject({
|
|
3364
|
+
id: import_zod34.z.string(),
|
|
3365
|
+
subject: import_zod34.z.string(),
|
|
3366
|
+
sender: import_zod34.z.string(),
|
|
2923
3367
|
received_at_ms: epochMs.nullable(),
|
|
2924
|
-
read:
|
|
2925
|
-
account:
|
|
2926
|
-
mailbox:
|
|
3368
|
+
read: import_zod34.z.boolean(),
|
|
3369
|
+
account: import_zod34.z.string(),
|
|
3370
|
+
mailbox: import_zod34.z.string(),
|
|
2927
3371
|
/** The first lines of the message's text. */
|
|
2928
|
-
preview:
|
|
3372
|
+
preview: import_zod34.z.string()
|
|
2929
3373
|
});
|
|
2930
|
-
var MailListResult =
|
|
2931
|
-
var MailSendParams =
|
|
2932
|
-
to:
|
|
2933
|
-
cc:
|
|
2934
|
-
subject:
|
|
3374
|
+
var MailListResult = import_zod34.z.strictObject({ messages: import_zod34.z.array(MailMessage) });
|
|
3375
|
+
var MailSendParams = import_zod34.z.strictObject({
|
|
3376
|
+
to: import_zod34.z.array(import_zod34.z.string().min(3).max(320)).min(1).max(50),
|
|
3377
|
+
cc: import_zod34.z.array(import_zod34.z.string().min(3).max(320)).max(50).default([]),
|
|
3378
|
+
subject: import_zod34.z.string().max(998),
|
|
2935
3379
|
body: Text,
|
|
2936
3380
|
/** The sending account's address; absent: Mail's default. */
|
|
2937
|
-
from:
|
|
3381
|
+
from: import_zod34.z.string().min(3).max(320).optional(),
|
|
2938
3382
|
/** false leaves it open in Mail as a draft for the person to send. */
|
|
2939
|
-
send:
|
|
2940
|
-
});
|
|
2941
|
-
var MailSendResult =
|
|
2942
|
-
var MessagesChatsParams =
|
|
2943
|
-
var MessagesChat =
|
|
2944
|
-
chat_id:
|
|
2945
|
-
name:
|
|
2946
|
-
participants:
|
|
3383
|
+
send: import_zod34.z.boolean().default(true)
|
|
3384
|
+
});
|
|
3385
|
+
var MailSendResult = import_zod34.z.strictObject({ sent: import_zod34.z.boolean() });
|
|
3386
|
+
var MessagesChatsParams = import_zod34.z.strictObject({ limit: import_zod34.z.int().min(1).max(200).default(25) });
|
|
3387
|
+
var MessagesChat = import_zod34.z.strictObject({
|
|
3388
|
+
chat_id: import_zod34.z.string(),
|
|
3389
|
+
name: import_zod34.z.string().nullable(),
|
|
3390
|
+
participants: import_zod34.z.array(import_zod34.z.string()),
|
|
2947
3391
|
last_message_at_ms: epochMs.nullable(),
|
|
2948
|
-
service:
|
|
3392
|
+
service: import_zod34.z.string().nullable()
|
|
2949
3393
|
});
|
|
2950
|
-
var MessagesChatsResult =
|
|
2951
|
-
var MessagesListParams =
|
|
3394
|
+
var MessagesChatsResult = import_zod34.z.strictObject({ chats: import_zod34.z.array(MessagesChat) });
|
|
3395
|
+
var MessagesListParams = import_zod34.z.strictObject({
|
|
2952
3396
|
/** One chat (messages.chats' chat_id); absent: the newest across all. */
|
|
2953
|
-
chat_id:
|
|
2954
|
-
limit:
|
|
2955
|
-
});
|
|
2956
|
-
var MessagesMessage =
|
|
2957
|
-
id:
|
|
2958
|
-
chat_id:
|
|
2959
|
-
text:
|
|
2960
|
-
from_me:
|
|
3397
|
+
chat_id: import_zod34.z.string().min(1).max(512).optional(),
|
|
3398
|
+
limit: import_zod34.z.int().min(1).max(500).default(50)
|
|
3399
|
+
});
|
|
3400
|
+
var MessagesMessage = import_zod34.z.strictObject({
|
|
3401
|
+
id: import_zod34.z.string(),
|
|
3402
|
+
chat_id: import_zod34.z.string().nullable(),
|
|
3403
|
+
text: import_zod34.z.string(),
|
|
3404
|
+
from_me: import_zod34.z.boolean(),
|
|
2961
3405
|
/** The other person's handle (phone or email); null for the person's own messages. */
|
|
2962
|
-
sender:
|
|
3406
|
+
sender: import_zod34.z.string().nullable(),
|
|
2963
3407
|
sent_at_ms: epochMs.nullable()
|
|
2964
3408
|
});
|
|
2965
|
-
var MessagesListResult =
|
|
2966
|
-
var MessagesSendParams =
|
|
3409
|
+
var MessagesListResult = import_zod34.z.strictObject({ messages: import_zod34.z.array(MessagesMessage) });
|
|
3410
|
+
var MessagesSendParams = import_zod34.z.strictObject({
|
|
2967
3411
|
/** A phone number or email the person can message. */
|
|
2968
|
-
to:
|
|
2969
|
-
text:
|
|
3412
|
+
to: import_zod34.z.string().min(3).max(320),
|
|
3413
|
+
text: import_zod34.z.string().min(1).max(2e4)
|
|
2970
3414
|
});
|
|
2971
|
-
var MessagesSendResult =
|
|
2972
|
-
var ContactsSearchParams =
|
|
3415
|
+
var MessagesSendResult = import_zod34.z.strictObject({ sent: import_zod34.z.boolean() });
|
|
3416
|
+
var ContactsSearchParams = import_zod34.z.strictObject({
|
|
2973
3417
|
/** Matched against names, organizations, emails and phone numbers. */
|
|
2974
|
-
query:
|
|
2975
|
-
limit:
|
|
3418
|
+
query: import_zod34.z.string().min(1).max(256),
|
|
3419
|
+
limit: import_zod34.z.int().min(1).max(200).default(25)
|
|
2976
3420
|
});
|
|
2977
|
-
var ContactLabeled =
|
|
2978
|
-
var ContactSummary =
|
|
2979
|
-
id:
|
|
2980
|
-
name:
|
|
2981
|
-
organization:
|
|
2982
|
-
emails:
|
|
2983
|
-
phones:
|
|
2984
|
-
});
|
|
2985
|
-
var ContactsSearchResult =
|
|
2986
|
-
var ContactsGetParams =
|
|
2987
|
-
var ContactDetail =
|
|
2988
|
-
id:
|
|
2989
|
-
name:
|
|
2990
|
-
organization:
|
|
2991
|
-
job_title:
|
|
2992
|
-
emails:
|
|
2993
|
-
phones:
|
|
2994
|
-
addresses:
|
|
2995
|
-
birthday:
|
|
2996
|
-
note:
|
|
2997
|
-
});
|
|
2998
|
-
var ContactsGetResult =
|
|
2999
|
-
var CalendarListParams =
|
|
3421
|
+
var ContactLabeled = import_zod34.z.strictObject({ label: import_zod34.z.string().nullable(), value: import_zod34.z.string() });
|
|
3422
|
+
var ContactSummary = import_zod34.z.strictObject({
|
|
3423
|
+
id: import_zod34.z.string(),
|
|
3424
|
+
name: import_zod34.z.string(),
|
|
3425
|
+
organization: import_zod34.z.string().nullable(),
|
|
3426
|
+
emails: import_zod34.z.array(ContactLabeled),
|
|
3427
|
+
phones: import_zod34.z.array(ContactLabeled)
|
|
3428
|
+
});
|
|
3429
|
+
var ContactsSearchResult = import_zod34.z.strictObject({ contacts: import_zod34.z.array(ContactSummary) });
|
|
3430
|
+
var ContactsGetParams = import_zod34.z.strictObject({ id: import_zod34.z.string().min(1).max(256) });
|
|
3431
|
+
var ContactDetail = import_zod34.z.strictObject({
|
|
3432
|
+
id: import_zod34.z.string(),
|
|
3433
|
+
name: import_zod34.z.string(),
|
|
3434
|
+
organization: import_zod34.z.string().nullable(),
|
|
3435
|
+
job_title: import_zod34.z.string().nullable(),
|
|
3436
|
+
emails: import_zod34.z.array(ContactLabeled),
|
|
3437
|
+
phones: import_zod34.z.array(ContactLabeled),
|
|
3438
|
+
addresses: import_zod34.z.array(ContactLabeled),
|
|
3439
|
+
birthday: import_zod34.z.string().nullable(),
|
|
3440
|
+
note: import_zod34.z.string().nullable()
|
|
3441
|
+
});
|
|
3442
|
+
var ContactsGetResult = import_zod34.z.strictObject({ contact: ContactDetail });
|
|
3443
|
+
var CalendarListParams = import_zod34.z.strictObject({
|
|
3000
3444
|
from_ms: epochMs,
|
|
3001
3445
|
to_ms: epochMs,
|
|
3002
3446
|
/** One calendar's name; absent: every calendar. */
|
|
3003
|
-
calendar:
|
|
3004
|
-
limit:
|
|
3447
|
+
calendar: import_zod34.z.string().min(1).max(256).optional(),
|
|
3448
|
+
limit: import_zod34.z.int().min(1).max(500).default(100)
|
|
3005
3449
|
});
|
|
3006
|
-
var CalendarEvent =
|
|
3007
|
-
id:
|
|
3008
|
-
title:
|
|
3450
|
+
var CalendarEvent = import_zod34.z.strictObject({
|
|
3451
|
+
id: import_zod34.z.string(),
|
|
3452
|
+
title: import_zod34.z.string(),
|
|
3009
3453
|
start_ms: epochMs,
|
|
3010
3454
|
end_ms: epochMs,
|
|
3011
|
-
all_day:
|
|
3012
|
-
calendar:
|
|
3013
|
-
location:
|
|
3014
|
-
notes:
|
|
3015
|
-
});
|
|
3016
|
-
var CalendarListResult =
|
|
3017
|
-
var CalendarCreateParams =
|
|
3018
|
-
title:
|
|
3455
|
+
all_day: import_zod34.z.boolean(),
|
|
3456
|
+
calendar: import_zod34.z.string(),
|
|
3457
|
+
location: import_zod34.z.string().nullable(),
|
|
3458
|
+
notes: import_zod34.z.string().nullable()
|
|
3459
|
+
});
|
|
3460
|
+
var CalendarListResult = import_zod34.z.strictObject({ events: import_zod34.z.array(CalendarEvent) });
|
|
3461
|
+
var CalendarCreateParams = import_zod34.z.strictObject({
|
|
3462
|
+
title: import_zod34.z.string().min(1).max(1024),
|
|
3019
3463
|
start_ms: epochMs,
|
|
3020
3464
|
end_ms: epochMs,
|
|
3021
|
-
all_day:
|
|
3465
|
+
all_day: import_zod34.z.boolean().default(false),
|
|
3022
3466
|
/** The calendar's name; absent: the first writable calendar. */
|
|
3023
|
-
calendar:
|
|
3024
|
-
location:
|
|
3467
|
+
calendar: import_zod34.z.string().min(1).max(256).optional(),
|
|
3468
|
+
location: import_zod34.z.string().max(1024).optional(),
|
|
3025
3469
|
notes: Text.optional()
|
|
3026
3470
|
});
|
|
3027
|
-
var CalendarCreateResult =
|
|
3028
|
-
var RemindersListParams =
|
|
3471
|
+
var CalendarCreateResult = import_zod34.z.strictObject({ id: import_zod34.z.string(), calendar: import_zod34.z.string() });
|
|
3472
|
+
var RemindersListParams = import_zod34.z.strictObject({
|
|
3029
3473
|
/** One list's name; absent: every list. */
|
|
3030
|
-
list:
|
|
3031
|
-
include_completed:
|
|
3032
|
-
limit:
|
|
3033
|
-
});
|
|
3034
|
-
var Reminder =
|
|
3035
|
-
id:
|
|
3036
|
-
title:
|
|
3037
|
-
list:
|
|
3474
|
+
list: import_zod34.z.string().min(1).max(256).optional(),
|
|
3475
|
+
include_completed: import_zod34.z.boolean().default(false),
|
|
3476
|
+
limit: import_zod34.z.int().min(1).max(500).default(100)
|
|
3477
|
+
});
|
|
3478
|
+
var Reminder = import_zod34.z.strictObject({
|
|
3479
|
+
id: import_zod34.z.string(),
|
|
3480
|
+
title: import_zod34.z.string(),
|
|
3481
|
+
list: import_zod34.z.string(),
|
|
3038
3482
|
due_ms: epochMs.nullable(),
|
|
3039
|
-
completed:
|
|
3040
|
-
notes:
|
|
3483
|
+
completed: import_zod34.z.boolean(),
|
|
3484
|
+
notes: import_zod34.z.string().nullable()
|
|
3041
3485
|
});
|
|
3042
|
-
var RemindersListResult =
|
|
3043
|
-
var RemindersCreateParams =
|
|
3044
|
-
title:
|
|
3486
|
+
var RemindersListResult = import_zod34.z.strictObject({ reminders: import_zod34.z.array(Reminder) });
|
|
3487
|
+
var RemindersCreateParams = import_zod34.z.strictObject({
|
|
3488
|
+
title: import_zod34.z.string().min(1).max(1024),
|
|
3045
3489
|
due_ms: epochMs.optional(),
|
|
3046
|
-
list:
|
|
3490
|
+
list: import_zod34.z.string().min(1).max(256).optional(),
|
|
3047
3491
|
notes: Text.optional()
|
|
3048
3492
|
});
|
|
3049
|
-
var RemindersCreateResult =
|
|
3050
|
-
var PhotosSearchParams =
|
|
3493
|
+
var RemindersCreateResult = import_zod34.z.strictObject({ id: import_zod34.z.string(), list: import_zod34.z.string() });
|
|
3494
|
+
var PhotosSearchParams = import_zod34.z.strictObject({
|
|
3051
3495
|
/** Matched against file names, titles, descriptions and keywords; absent: the newest. */
|
|
3052
|
-
query:
|
|
3496
|
+
query: import_zod34.z.string().min(1).max(256).optional(),
|
|
3053
3497
|
from_ms: epochMs.optional(),
|
|
3054
3498
|
to_ms: epochMs.optional(),
|
|
3055
|
-
favorites_only:
|
|
3056
|
-
limit:
|
|
3499
|
+
favorites_only: import_zod34.z.boolean().default(false),
|
|
3500
|
+
limit: import_zod34.z.int().min(1).max(200).default(25)
|
|
3057
3501
|
});
|
|
3058
|
-
var Photo =
|
|
3059
|
-
id:
|
|
3060
|
-
filename:
|
|
3502
|
+
var Photo = import_zod34.z.strictObject({
|
|
3503
|
+
id: import_zod34.z.string(),
|
|
3504
|
+
filename: import_zod34.z.string(),
|
|
3061
3505
|
taken_at_ms: epochMs.nullable(),
|
|
3062
3506
|
width: nonNegInt.nullable(),
|
|
3063
3507
|
height: nonNegInt.nullable(),
|
|
3064
|
-
favorite:
|
|
3065
|
-
title:
|
|
3508
|
+
favorite: import_zod34.z.boolean(),
|
|
3509
|
+
title: import_zod34.z.string().nullable()
|
|
3066
3510
|
});
|
|
3067
|
-
var PhotosSearchResult =
|
|
3068
|
-
var PhotosGetParams =
|
|
3069
|
-
id:
|
|
3511
|
+
var PhotosSearchResult = import_zod34.z.strictObject({ photos: import_zod34.z.array(Photo) });
|
|
3512
|
+
var PhotosGetParams = import_zod34.z.strictObject({
|
|
3513
|
+
id: import_zod34.z.string().min(1).max(256),
|
|
3070
3514
|
/** Copy the original into a folder Matrx 2 owns and answer its path (then fs_read or desktop_documents reads it). */
|
|
3071
|
-
export:
|
|
3515
|
+
export: import_zod34.z.boolean().default(false)
|
|
3072
3516
|
});
|
|
3073
|
-
var PhotosGetResult =
|
|
3074
|
-
var LocationGetParams =
|
|
3075
|
-
var LocationGetResult =
|
|
3076
|
-
latitude:
|
|
3077
|
-
longitude:
|
|
3517
|
+
var PhotosGetResult = import_zod34.z.strictObject({ photo: Photo, path: import_zod34.z.string().nullable() });
|
|
3518
|
+
var LocationGetParams = import_zod34.z.strictObject({ timeout_s: import_zod34.z.int().min(1).max(60).default(15) });
|
|
3519
|
+
var LocationGetResult = import_zod34.z.strictObject({
|
|
3520
|
+
latitude: import_zod34.z.number().min(-90).max(90),
|
|
3521
|
+
longitude: import_zod34.z.number().min(-180).max(180),
|
|
3078
3522
|
/** Metres; null where the OS does not say. */
|
|
3079
|
-
accuracy_m:
|
|
3523
|
+
accuracy_m: import_zod34.z.number().min(0).nullable(),
|
|
3080
3524
|
at_ms: epochMs,
|
|
3081
3525
|
/** Who answered: the OS's own location service. */
|
|
3082
|
-
source:
|
|
3526
|
+
source: import_zod34.z.enum(["corelocation", "windows", "geoclue"])
|
|
3083
3527
|
});
|
|
3084
3528
|
|
|
3085
3529
|
// src/schema/windows.ts
|
|
3086
|
-
var
|
|
3087
|
-
var RegistryKey =
|
|
3088
|
-
var RegistryValueType =
|
|
3089
|
-
var WindowsRegistryReadParams =
|
|
3530
|
+
var import_zod35 = require("zod");
|
|
3531
|
+
var RegistryKey = import_zod35.z.string().min(6).max(1024).regex(/^(HKLM|HKCU|HKCR|HKU|HKCC|HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER|HKEY_CLASSES_ROOT|HKEY_USERS|HKEY_CURRENT_CONFIG)(\\.*)?$/);
|
|
3532
|
+
var RegistryValueType = import_zod35.z.enum(["REG_SZ", "REG_EXPAND_SZ", "REG_MULTI_SZ", "REG_DWORD", "REG_QWORD", "REG_BINARY", "REG_NONE"]);
|
|
3533
|
+
var WindowsRegistryReadParams = import_zod35.z.strictObject({
|
|
3090
3534
|
key: RegistryKey,
|
|
3091
3535
|
/** One value's name ("" is the key's default value); absent: every value and the subkeys. */
|
|
3092
|
-
name:
|
|
3536
|
+
name: import_zod35.z.string().max(16383).optional()
|
|
3093
3537
|
});
|
|
3094
|
-
var RegistryValue =
|
|
3095
|
-
var WindowsRegistryReadResult =
|
|
3096
|
-
key:
|
|
3097
|
-
exists:
|
|
3098
|
-
values:
|
|
3099
|
-
subkeys:
|
|
3538
|
+
var RegistryValue = import_zod35.z.strictObject({ name: import_zod35.z.string(), type: RegistryValueType, data: import_zod35.z.string() });
|
|
3539
|
+
var WindowsRegistryReadResult = import_zod35.z.strictObject({
|
|
3540
|
+
key: import_zod35.z.string(),
|
|
3541
|
+
exists: import_zod35.z.boolean(),
|
|
3542
|
+
values: import_zod35.z.array(RegistryValue),
|
|
3543
|
+
subkeys: import_zod35.z.array(import_zod35.z.string())
|
|
3100
3544
|
});
|
|
3101
|
-
var WindowsRegistryWriteParams =
|
|
3545
|
+
var WindowsRegistryWriteParams = import_zod35.z.strictObject({
|
|
3102
3546
|
key: RegistryKey,
|
|
3103
|
-
name:
|
|
3547
|
+
name: import_zod35.z.string().max(16383),
|
|
3104
3548
|
type: RegistryValueType.default("REG_SZ"),
|
|
3105
3549
|
/** As reg.exe takes it: text, a number, hex for binary, \\0 between the strings of a multi-string. */
|
|
3106
|
-
data:
|
|
3550
|
+
data: import_zod35.z.string().max(1048576),
|
|
3107
3551
|
/** Remove the value instead of writing it. */
|
|
3108
|
-
delete:
|
|
3552
|
+
delete: import_zod35.z.boolean().default(false)
|
|
3109
3553
|
});
|
|
3110
|
-
var WindowsRegistryWriteResult =
|
|
3111
|
-
var WindowsServicesParams =
|
|
3554
|
+
var WindowsRegistryWriteResult = import_zod35.z.strictObject({ key: import_zod35.z.string(), name: import_zod35.z.string(), deleted: import_zod35.z.boolean() });
|
|
3555
|
+
var WindowsServicesParams = import_zod35.z.strictObject({
|
|
3112
3556
|
/** Matched against the service's name and display name. */
|
|
3113
|
-
filter:
|
|
3114
|
-
limit:
|
|
3557
|
+
filter: import_zod35.z.string().min(1).max(256).optional(),
|
|
3558
|
+
limit: import_zod35.z.int().min(1).max(1e3).default(200)
|
|
3115
3559
|
});
|
|
3116
|
-
var WindowsService =
|
|
3117
|
-
name:
|
|
3118
|
-
display_name:
|
|
3560
|
+
var WindowsService = import_zod35.z.strictObject({
|
|
3561
|
+
name: import_zod35.z.string(),
|
|
3562
|
+
display_name: import_zod35.z.string(),
|
|
3119
3563
|
/** Running, Stopped, Paused… as Windows says it. */
|
|
3120
|
-
status:
|
|
3564
|
+
status: import_zod35.z.string(),
|
|
3121
3565
|
/** Automatic, Manual, Disabled…; null where Windows does not say. */
|
|
3122
|
-
start_type:
|
|
3566
|
+
start_type: import_zod35.z.string().nullable()
|
|
3123
3567
|
});
|
|
3124
|
-
var WindowsServicesResult =
|
|
3125
|
-
var WindowsServiceControlParams =
|
|
3126
|
-
name:
|
|
3127
|
-
action:
|
|
3568
|
+
var WindowsServicesResult = import_zod35.z.strictObject({ services: import_zod35.z.array(WindowsService) });
|
|
3569
|
+
var WindowsServiceControlParams = import_zod35.z.strictObject({
|
|
3570
|
+
name: import_zod35.z.string().min(1).max(256),
|
|
3571
|
+
action: import_zod35.z.enum(["start", "stop", "restart"])
|
|
3128
3572
|
});
|
|
3129
|
-
var WindowsServiceControlResult =
|
|
3130
|
-
var WindowsEventLogParams =
|
|
3131
|
-
log:
|
|
3573
|
+
var WindowsServiceControlResult = import_zod35.z.strictObject({ name: import_zod35.z.string(), status: import_zod35.z.string() });
|
|
3574
|
+
var WindowsEventLogParams = import_zod35.z.strictObject({
|
|
3575
|
+
log: import_zod35.z.string().min(1).max(256).default("System"),
|
|
3132
3576
|
/** Only these levels; absent: all. */
|
|
3133
|
-
levels:
|
|
3577
|
+
levels: import_zod35.z.array(import_zod35.z.enum(["critical", "error", "warning", "information", "verbose"])).max(5).optional(),
|
|
3134
3578
|
since_ms: epochMs.optional(),
|
|
3135
|
-
limit:
|
|
3579
|
+
limit: import_zod35.z.int().min(1).max(500).default(50)
|
|
3136
3580
|
});
|
|
3137
|
-
var WindowsEvent =
|
|
3138
|
-
id:
|
|
3139
|
-
level:
|
|
3140
|
-
source:
|
|
3581
|
+
var WindowsEvent = import_zod35.z.strictObject({
|
|
3582
|
+
id: import_zod35.z.int(),
|
|
3583
|
+
level: import_zod35.z.string(),
|
|
3584
|
+
source: import_zod35.z.string(),
|
|
3141
3585
|
at_ms: epochMs,
|
|
3142
|
-
message:
|
|
3586
|
+
message: import_zod35.z.string()
|
|
3143
3587
|
});
|
|
3144
|
-
var WindowsEventLogResult =
|
|
3145
|
-
var WindowsFeaturesParams =
|
|
3146
|
-
var WindowsFeature =
|
|
3147
|
-
var WindowsFeaturesResult =
|
|
3588
|
+
var WindowsEventLogResult = import_zod35.z.strictObject({ log: import_zod35.z.string(), events: import_zod35.z.array(WindowsEvent) });
|
|
3589
|
+
var WindowsFeaturesParams = import_zod35.z.strictObject({ filter: import_zod35.z.string().min(1).max(256).optional() });
|
|
3590
|
+
var WindowsFeature = import_zod35.z.strictObject({ name: import_zod35.z.string(), state: import_zod35.z.string() });
|
|
3591
|
+
var WindowsFeaturesResult = import_zod35.z.strictObject({ features: import_zod35.z.array(WindowsFeature) });
|
|
3148
3592
|
|
|
3149
3593
|
// src/schema/schedule.ts
|
|
3150
|
-
var
|
|
3151
|
-
var OpRef =
|
|
3152
|
-
var ScheduleCreateParams =
|
|
3153
|
-
name:
|
|
3594
|
+
var import_zod36 = require("zod");
|
|
3595
|
+
var OpRef = import_zod36.z.string().min(3).max(128).regex(/^[a-z_]+(\.[a-z_]+)+$/);
|
|
3596
|
+
var ScheduleCreateParams = import_zod36.z.strictObject({
|
|
3597
|
+
name: import_zod36.z.string().min(1).max(200),
|
|
3154
3598
|
op: OpRef,
|
|
3155
3599
|
/** The op's params, exactly as the op takes them; checked when the task is created. */
|
|
3156
|
-
params:
|
|
3157
|
-
interval_s:
|
|
3600
|
+
params: import_zod36.z.record(import_zod36.z.string(), import_zod36.z.unknown()).default({}),
|
|
3601
|
+
interval_s: import_zod36.z.int().min(10).max(2592e3),
|
|
3158
3602
|
/** Stop after this many runs; absent: until cancelled. */
|
|
3159
|
-
max_runs:
|
|
3603
|
+
max_runs: import_zod36.z.int().min(1).max(1e5).optional(),
|
|
3160
3604
|
/** Run once now, before the first interval. */
|
|
3161
|
-
run_now:
|
|
3605
|
+
run_now: import_zod36.z.boolean().default(false)
|
|
3162
3606
|
});
|
|
3163
|
-
var ScheduleRun =
|
|
3607
|
+
var ScheduleRun = import_zod36.z.strictObject({
|
|
3164
3608
|
at_ms: epochMs,
|
|
3165
|
-
ok:
|
|
3609
|
+
ok: import_zod36.z.boolean(),
|
|
3166
3610
|
elapsed_ms: nonNegInt,
|
|
3167
3611
|
/** The error's code and message when the run failed. */
|
|
3168
|
-
error:
|
|
3612
|
+
error: import_zod36.z.string().nullable(),
|
|
3169
3613
|
/** The start of the answer, as JSON (cut at 4 KiB). */
|
|
3170
|
-
result_preview:
|
|
3614
|
+
result_preview: import_zod36.z.string().nullable()
|
|
3171
3615
|
});
|
|
3172
|
-
var ScheduledTask =
|
|
3173
|
-
id:
|
|
3174
|
-
name:
|
|
3175
|
-
op:
|
|
3176
|
-
params:
|
|
3616
|
+
var ScheduledTask = import_zod36.z.strictObject({
|
|
3617
|
+
id: import_zod36.z.string(),
|
|
3618
|
+
name: import_zod36.z.string(),
|
|
3619
|
+
op: import_zod36.z.string(),
|
|
3620
|
+
params: import_zod36.z.record(import_zod36.z.string(), import_zod36.z.unknown()),
|
|
3177
3621
|
interval_s: nonNegInt,
|
|
3178
3622
|
max_runs: nonNegInt.nullable(),
|
|
3179
3623
|
runs: nonNegInt,
|
|
3180
3624
|
created_at_ms: epochMs,
|
|
3181
3625
|
next_run_at_ms: epochMs.nullable(),
|
|
3182
3626
|
/** active, done (ran max_runs), cancelled. */
|
|
3183
|
-
state:
|
|
3627
|
+
state: import_zod36.z.enum(["active", "done", "cancelled"]),
|
|
3184
3628
|
/** The newest runs, newest first (at most 10). */
|
|
3185
|
-
recent:
|
|
3629
|
+
recent: import_zod36.z.array(ScheduleRun)
|
|
3186
3630
|
});
|
|
3187
|
-
var ScheduleCreateResult =
|
|
3188
|
-
var ScheduleListParams =
|
|
3189
|
-
var ScheduleListResult =
|
|
3190
|
-
var ScheduleCancelParams =
|
|
3191
|
-
var ScheduleCancelResult =
|
|
3631
|
+
var ScheduleCreateResult = import_zod36.z.strictObject({ task: ScheduledTask });
|
|
3632
|
+
var ScheduleListParams = import_zod36.z.strictObject({ include_finished: import_zod36.z.boolean().default(false) });
|
|
3633
|
+
var ScheduleListResult = import_zod36.z.strictObject({ tasks: import_zod36.z.array(ScheduledTask) });
|
|
3634
|
+
var ScheduleCancelParams = import_zod36.z.strictObject({ id: import_zod36.z.string().min(1).max(64) });
|
|
3635
|
+
var ScheduleCancelResult = import_zod36.z.strictObject({ task: ScheduledTask });
|
|
3192
3636
|
|
|
3193
3637
|
// src/schema/notes.ts
|
|
3194
|
-
var
|
|
3195
|
-
var NoteFolder =
|
|
3196
|
-
var NotePath =
|
|
3197
|
-
var NotesFoldersParams =
|
|
3198
|
-
var NotesFolder =
|
|
3199
|
-
var NotesFoldersResult =
|
|
3638
|
+
var import_zod37 = require("zod");
|
|
3639
|
+
var NoteFolder = import_zod37.z.string().min(1).max(512).regex(/^[^/\\:*?"<>|][^\\:*?"<>|]*$/);
|
|
3640
|
+
var NotePath = import_zod37.z.string().min(4).max(1024).regex(/^[^/\\:*?"<>|][^\\:*?"<>|]*\.md$/);
|
|
3641
|
+
var NotesFoldersParams = import_zod37.z.strictObject({});
|
|
3642
|
+
var NotesFolder = import_zod37.z.strictObject({ folder: import_zod37.z.string(), notes: nonNegInt });
|
|
3643
|
+
var NotesFoldersResult = import_zod37.z.strictObject({
|
|
3200
3644
|
/** The notes root on this computer. */
|
|
3201
|
-
root:
|
|
3202
|
-
folders:
|
|
3645
|
+
root: import_zod37.z.string(),
|
|
3646
|
+
folders: import_zod37.z.array(NotesFolder)
|
|
3203
3647
|
});
|
|
3204
|
-
var NotesListParams =
|
|
3648
|
+
var NotesListParams = import_zod37.z.strictObject({
|
|
3205
3649
|
folder: NoteFolder.optional(),
|
|
3206
|
-
limit:
|
|
3650
|
+
limit: import_zod37.z.int().min(1).max(2e3).default(500)
|
|
3207
3651
|
});
|
|
3208
|
-
var NoteEntry =
|
|
3209
|
-
path:
|
|
3210
|
-
label:
|
|
3211
|
-
folder:
|
|
3652
|
+
var NoteEntry = import_zod37.z.strictObject({
|
|
3653
|
+
path: import_zod37.z.string(),
|
|
3654
|
+
label: import_zod37.z.string(),
|
|
3655
|
+
folder: import_zod37.z.string(),
|
|
3212
3656
|
bytes: nonNegInt,
|
|
3213
3657
|
modified_at_ms: epochMs
|
|
3214
3658
|
});
|
|
3215
|
-
var NotesListResult =
|
|
3216
|
-
var NotesReadParams =
|
|
3217
|
-
var NotesReadResult =
|
|
3218
|
-
path:
|
|
3219
|
-
content:
|
|
3659
|
+
var NotesListResult = import_zod37.z.strictObject({ root: import_zod37.z.string(), notes: import_zod37.z.array(NoteEntry), total: nonNegInt });
|
|
3660
|
+
var NotesReadParams = import_zod37.z.strictObject({ path: NotePath });
|
|
3661
|
+
var NotesReadResult = import_zod37.z.strictObject({
|
|
3662
|
+
path: import_zod37.z.string(),
|
|
3663
|
+
content: import_zod37.z.string(),
|
|
3220
3664
|
bytes: nonNegInt,
|
|
3221
3665
|
modified_at_ms: epochMs,
|
|
3222
3666
|
/** SHA-256 of the content: pass it back as `if_hash` to write only over this version. */
|
|
3223
|
-
hash:
|
|
3667
|
+
hash: import_zod37.z.string()
|
|
3224
3668
|
});
|
|
3225
|
-
var NotesWriteParams =
|
|
3669
|
+
var NotesWriteParams = import_zod37.z.strictObject({
|
|
3226
3670
|
folder: NoteFolder.default("General"),
|
|
3227
3671
|
/** The note's name, without ".md". */
|
|
3228
|
-
label:
|
|
3229
|
-
content:
|
|
3672
|
+
label: import_zod37.z.string().min(1).max(200).regex(/^[^/\\:*?"<>|]+$/),
|
|
3673
|
+
content: import_zod37.z.string().max(10485760),
|
|
3230
3674
|
/** Write only when the note is still this version (notes.read's hash); a change since answers CONFLICT. */
|
|
3231
|
-
if_hash:
|
|
3675
|
+
if_hash: import_zod37.z.string().length(64).optional()
|
|
3232
3676
|
});
|
|
3233
|
-
var NotesWriteResult =
|
|
3234
|
-
var NotesSearchParams =
|
|
3235
|
-
query:
|
|
3236
|
-
limit:
|
|
3677
|
+
var NotesWriteResult = import_zod37.z.strictObject({ path: import_zod37.z.string(), bytes: nonNegInt, created: import_zod37.z.boolean(), hash: import_zod37.z.string() });
|
|
3678
|
+
var NotesSearchParams = import_zod37.z.strictObject({
|
|
3679
|
+
query: import_zod37.z.string().min(1).max(512),
|
|
3680
|
+
limit: import_zod37.z.int().min(1).max(200).default(50)
|
|
3237
3681
|
});
|
|
3238
|
-
var NotesMatch =
|
|
3239
|
-
path:
|
|
3240
|
-
label:
|
|
3241
|
-
folder:
|
|
3682
|
+
var NotesMatch = import_zod37.z.strictObject({
|
|
3683
|
+
path: import_zod37.z.string(),
|
|
3684
|
+
label: import_zod37.z.string(),
|
|
3685
|
+
folder: import_zod37.z.string(),
|
|
3242
3686
|
/** The matching lines (at most five), trimmed. */
|
|
3243
|
-
lines:
|
|
3687
|
+
lines: import_zod37.z.array(import_zod37.z.string())
|
|
3244
3688
|
});
|
|
3245
|
-
var NotesSearchResult =
|
|
3689
|
+
var NotesSearchResult = import_zod37.z.strictObject({ matches: import_zod37.z.array(NotesMatch), total: nonNegInt });
|
|
3246
3690
|
|
|
3247
3691
|
// src/schema/documents.ts
|
|
3248
|
-
var
|
|
3692
|
+
var import_zod38 = require("zod");
|
|
3249
3693
|
var DOCUMENTS_MAX_TEXT_CHARS = 1048576;
|
|
3250
|
-
var DocumentsPdfTextParams =
|
|
3694
|
+
var DocumentsPdfTextParams = import_zod38.z.strictObject({
|
|
3251
3695
|
path: AbsPath,
|
|
3252
3696
|
/** 1-based, inclusive. */
|
|
3253
|
-
first_page:
|
|
3254
|
-
last_page:
|
|
3255
|
-
max_chars:
|
|
3697
|
+
first_page: import_zod38.z.int().min(1).optional(),
|
|
3698
|
+
last_page: import_zod38.z.int().min(1).optional(),
|
|
3699
|
+
max_chars: import_zod38.z.int().min(1).max(DOCUMENTS_MAX_TEXT_CHARS).default(2e5)
|
|
3256
3700
|
});
|
|
3257
|
-
var DocumentsPdfPage =
|
|
3258
|
-
var DocumentsPdfTextResult =
|
|
3701
|
+
var DocumentsPdfPage = import_zod38.z.strictObject({ page: import_zod38.z.int().min(1), text: import_zod38.z.string() });
|
|
3702
|
+
var DocumentsPdfTextResult = import_zod38.z.strictObject({
|
|
3259
3703
|
pages: nonNegInt,
|
|
3260
3704
|
/** Each page read, in order (an image-only page has empty text: OCR it). */
|
|
3261
|
-
read:
|
|
3262
|
-
truncated:
|
|
3263
|
-
title:
|
|
3264
|
-
author:
|
|
3705
|
+
read: import_zod38.z.array(DocumentsPdfPage),
|
|
3706
|
+
truncated: import_zod38.z.boolean(),
|
|
3707
|
+
title: import_zod38.z.string().nullable(),
|
|
3708
|
+
author: import_zod38.z.string().nullable()
|
|
3265
3709
|
});
|
|
3266
|
-
var DocumentsOcrParams =
|
|
3710
|
+
var DocumentsOcrParams = import_zod38.z.strictObject({
|
|
3267
3711
|
path: AbsPath,
|
|
3268
3712
|
/** BCP-47 language hints ("en-US", "fr-FR"); absent: the OS's own choice. */
|
|
3269
|
-
languages:
|
|
3713
|
+
languages: import_zod38.z.array(import_zod38.z.string().min(2).max(16)).max(8).optional(),
|
|
3270
3714
|
/** Faster, less accurate. */
|
|
3271
|
-
fast:
|
|
3715
|
+
fast: import_zod38.z.boolean().default(false)
|
|
3272
3716
|
});
|
|
3273
|
-
var DocumentsOcrLine =
|
|
3274
|
-
text:
|
|
3717
|
+
var DocumentsOcrLine = import_zod38.z.strictObject({
|
|
3718
|
+
text: import_zod38.z.string(),
|
|
3275
3719
|
/** 0–1; null where the engine does not say. */
|
|
3276
|
-
confidence:
|
|
3720
|
+
confidence: import_zod38.z.number().min(0).max(1).nullable()
|
|
3277
3721
|
});
|
|
3278
|
-
var DocumentsOcrResult =
|
|
3279
|
-
text:
|
|
3280
|
-
lines:
|
|
3281
|
-
truncated:
|
|
3722
|
+
var DocumentsOcrResult = import_zod38.z.strictObject({
|
|
3723
|
+
text: import_zod38.z.string(),
|
|
3724
|
+
lines: import_zod38.z.array(DocumentsOcrLine),
|
|
3725
|
+
truncated: import_zod38.z.boolean(),
|
|
3282
3726
|
/** Which engine read it ("vision" on macOS, "windows-ocr", "tesseract"). */
|
|
3283
|
-
engine:
|
|
3727
|
+
engine: import_zod38.z.string()
|
|
3284
3728
|
});
|
|
3285
|
-
var DocumentsImageResizeParams =
|
|
3729
|
+
var DocumentsImageResizeParams = import_zod38.z.strictObject({
|
|
3286
3730
|
path: AbsPath,
|
|
3287
3731
|
/** Where to write it; absent: next to the original, "<name>-resized.<ext>". */
|
|
3288
3732
|
out_path: AbsPath.optional(),
|
|
3289
3733
|
/** The longest side, kept in proportion; absent: the size stays (a format change only). */
|
|
3290
|
-
max_size:
|
|
3291
|
-
format:
|
|
3292
|
-
overwrite:
|
|
3734
|
+
max_size: import_zod38.z.int().min(1).max(32768).optional(),
|
|
3735
|
+
format: import_zod38.z.enum(["png", "jpeg", "tiff", "heic", "bmp", "gif"]).optional(),
|
|
3736
|
+
overwrite: import_zod38.z.boolean().default(false)
|
|
3293
3737
|
});
|
|
3294
|
-
var DocumentsImageResizeResult =
|
|
3295
|
-
path:
|
|
3738
|
+
var DocumentsImageResizeResult = import_zod38.z.strictObject({
|
|
3739
|
+
path: import_zod38.z.string(),
|
|
3296
3740
|
width: nonNegInt,
|
|
3297
3741
|
height: nonNegInt,
|
|
3298
3742
|
bytes: nonNegInt
|
|
3299
3743
|
});
|
|
3300
|
-
var DocumentsParagraph =
|
|
3301
|
-
style:
|
|
3302
|
-
text:
|
|
3744
|
+
var DocumentsParagraph = import_zod38.z.strictObject({
|
|
3745
|
+
style: import_zod38.z.enum(["title", "heading1", "heading2", "heading3", "body", "bullet", "numbered", "quote", "code"]).default("body"),
|
|
3746
|
+
text: import_zod38.z.string().max(1e5)
|
|
3303
3747
|
});
|
|
3304
|
-
var DocumentsSheet =
|
|
3305
|
-
name:
|
|
3748
|
+
var DocumentsSheet = import_zod38.z.strictObject({
|
|
3749
|
+
name: import_zod38.z.string().min(1).max(31),
|
|
3306
3750
|
/** Rows of cells; the first row is the header when `header` is true. */
|
|
3307
|
-
rows:
|
|
3308
|
-
header:
|
|
3751
|
+
rows: import_zod38.z.array(import_zod38.z.array(import_zod38.z.union([import_zod38.z.string().max(32767), import_zod38.z.number(), import_zod38.z.boolean(), import_zod38.z.null()])).max(16384)).max(1e5),
|
|
3752
|
+
header: import_zod38.z.boolean().default(true)
|
|
3309
3753
|
});
|
|
3310
|
-
var DocumentsOfficeGenerateParams =
|
|
3311
|
-
kind:
|
|
3754
|
+
var DocumentsOfficeGenerateParams = import_zod38.z.strictObject({
|
|
3755
|
+
kind: import_zod38.z.enum(["docx", "xlsx"]),
|
|
3312
3756
|
path: AbsPath,
|
|
3313
|
-
title:
|
|
3757
|
+
title: import_zod38.z.string().max(1024).optional(),
|
|
3314
3758
|
/** docx: the document's paragraphs, in order. */
|
|
3315
|
-
paragraphs:
|
|
3759
|
+
paragraphs: import_zod38.z.array(DocumentsParagraph).max(5e4).optional(),
|
|
3316
3760
|
/** xlsx: the workbook's sheets, in order. */
|
|
3317
|
-
sheets:
|
|
3318
|
-
overwrite:
|
|
3761
|
+
sheets: import_zod38.z.array(DocumentsSheet).min(1).max(64).optional(),
|
|
3762
|
+
overwrite: import_zod38.z.boolean().default(false)
|
|
3319
3763
|
});
|
|
3320
|
-
var DocumentsOfficeGenerateResult =
|
|
3321
|
-
var EntitiesNerParams =
|
|
3322
|
-
text:
|
|
3764
|
+
var DocumentsOfficeGenerateResult = import_zod38.z.strictObject({ path: import_zod38.z.string(), bytes: nonNegInt });
|
|
3765
|
+
var EntitiesNerParams = import_zod38.z.strictObject({
|
|
3766
|
+
text: import_zod38.z.string().min(1).max(DOCUMENTS_MAX_TEXT_CHARS),
|
|
3323
3767
|
/** Which kinds to keep; absent: all three. */
|
|
3324
|
-
labels:
|
|
3768
|
+
labels: import_zod38.z.array(import_zod38.z.enum(["person", "place", "organization"])).min(1).max(3).optional()
|
|
3325
3769
|
});
|
|
3326
|
-
var EntitySpan =
|
|
3327
|
-
text:
|
|
3328
|
-
label:
|
|
3770
|
+
var EntitySpan = import_zod38.z.strictObject({
|
|
3771
|
+
text: import_zod38.z.string(),
|
|
3772
|
+
label: import_zod38.z.string(),
|
|
3329
3773
|
/** Character offsets into the text (UTF-16, as JavaScript counts). */
|
|
3330
3774
|
start: nonNegInt,
|
|
3331
3775
|
end: nonNegInt
|
|
3332
3776
|
});
|
|
3333
|
-
var EntitiesNerResult =
|
|
3334
|
-
var PiiKind =
|
|
3335
|
-
var EntitiesPiiParams =
|
|
3336
|
-
text:
|
|
3337
|
-
kinds:
|
|
3777
|
+
var EntitiesNerResult = import_zod38.z.strictObject({ entities: import_zod38.z.array(EntitySpan), engine: import_zod38.z.string() });
|
|
3778
|
+
var PiiKind = import_zod38.z.enum(["email", "phone", "credit_card", "us_ssn", "iban", "ip_address", "url", "api_key"]);
|
|
3779
|
+
var EntitiesPiiParams = import_zod38.z.strictObject({
|
|
3780
|
+
text: import_zod38.z.string().min(1).max(DOCUMENTS_MAX_TEXT_CHARS),
|
|
3781
|
+
kinds: import_zod38.z.array(PiiKind).min(1).max(8).optional(),
|
|
3338
3782
|
/** Also answer the text with each finding replaced by its kind ("[email]"). */
|
|
3339
|
-
redact:
|
|
3783
|
+
redact: import_zod38.z.boolean().default(false)
|
|
3340
3784
|
});
|
|
3341
|
-
var EntitiesPiiResult =
|
|
3342
|
-
findings:
|
|
3343
|
-
redacted:
|
|
3785
|
+
var EntitiesPiiResult = import_zod38.z.strictObject({
|
|
3786
|
+
findings: import_zod38.z.array(import_zod38.z.strictObject({ kind: PiiKind, text: import_zod38.z.string(), start: nonNegInt, end: nonNegInt })),
|
|
3787
|
+
redacted: import_zod38.z.string().nullable()
|
|
3344
3788
|
});
|
|
3345
3789
|
|
|
3346
3790
|
// src/schema/registry.ts
|
|
@@ -3474,6 +3918,36 @@ var OPS = {
|
|
|
3474
3918
|
"apps.windows.shown": { params: AppsWindowsShownParams, result: AppsWindowsShownResult, kind: "unary", since: "1.21", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
3475
3919
|
// Claude Code history (SPEC §6 coding): served by the `coding` Python service through SERVICES below.
|
|
3476
3920
|
"coding.history.import_missing": { params: CodingHistoryImportMissingParams, result: CodingHistoryImportMissingResult, kind: "unary", since: "1.5", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "INTERNAL"] },
|
|
3921
|
+
// Code from anywhere (1.38): the coding engine's sessions, read and driven over any transport.
|
|
3922
|
+
"coding.providers": { params: CodingProvidersParams, result: CodingProvidersResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },
|
|
3923
|
+
"coding.sessions.list": { params: CodingSessionsListParams, result: CodingSessionsListResult, kind: "unary", since: "1.38", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
3924
|
+
"coding.discover": { params: CodingDiscoverParams, result: CodingDiscoverResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
3925
|
+
"coding.runs.list": { params: CodingRunsListParams, result: CodingRunsListResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "INTERNAL"] },
|
|
3926
|
+
"coding.history": { params: CodingHistoryParams, result: CodingHistoryResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "INTERNAL"] },
|
|
3927
|
+
"coding.transcript.read": { params: CodingTranscriptReadParams, result: CodingTranscriptReadResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "INTERNAL"] },
|
|
3928
|
+
"coding.item.full": { params: CodingItemFullParams, result: CodingItemFullResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "PAYLOAD_TOO_LARGE", "INTERNAL"] },
|
|
3929
|
+
"coding.activity": { params: CodingActivityParams, result: CodingActivityResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "INTERNAL"] },
|
|
3930
|
+
"coding.folders.recent": { params: CodingFoldersRecentParams, result: CodingFoldersRecentResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },
|
|
3931
|
+
"coding.folders.check": { params: CodingFoldersCheckParams, result: CodingFoldersCheckResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "AUTH_FORBIDDEN", "INTERNAL"] },
|
|
3932
|
+
"coding.folders.create": { params: CodingFoldersCreateParams, result: CodingFoldersCreateResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INTERNAL"] },
|
|
3933
|
+
"coding.start": { params: CodingStartParams, result: CodingStartResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "AUTH_FORBIDDEN", "RATE_LIMITED", "INTERNAL"] },
|
|
3934
|
+
"coding.takeover": { params: CodingTakeoverParams, result: CodingTakeoverResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "RESOURCE_BUSY", "AUTH_FORBIDDEN", "INTERNAL"] },
|
|
3935
|
+
"coding.send": { params: CodingSendParams, result: CodingSendResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "RATE_LIMITED", "INTERNAL"] },
|
|
3936
|
+
"coding.stop": { params: CodingStopParams, result: CodingStopResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "INTERNAL"] },
|
|
3937
|
+
"coding.stop_elsewhere": { params: CodingStopElsewhereParams, result: CodingStopElsewhereResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "CONFLICT", "PERMISSION_DENIED_OS", "INTERNAL"] },
|
|
3938
|
+
"coding.options.set": { params: CodingOptionsSetParams, result: CodingOptionsSetResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "INTERNAL"] },
|
|
3939
|
+
"coding.agent.set": { params: CodingAgentSetParams, result: CodingAgentSetResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "AUTH_FORBIDDEN", "INTERNAL"] },
|
|
3940
|
+
"coding.agents.access": { params: CodingAgentsAccessParams, result: CodingAgentsAccessResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },
|
|
3941
|
+
"coding.titles.status": { params: CodingTitlesStatusParams, result: CodingTitlesStatusResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },
|
|
3942
|
+
"coding.prefs.list": { params: CodingPrefsListParams, result: CodingPrefsListResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },
|
|
3943
|
+
"coding.prefs.set": { params: CodingPrefsSetParams, result: CodingPrefsSetResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "INTERNAL"] },
|
|
3944
|
+
"coding.recent.seen": { params: CodingRecentSeenParams, result: CodingRecentSeenResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "INTERNAL"] },
|
|
3945
|
+
"coding.search": { params: CodingSearchParams, result: CodingSearchResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "TIMEOUT", "INTERNAL"] },
|
|
3946
|
+
"coding.reconcile": { params: CodingReconcileParams, result: CodingReconcileResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "RESOURCE_BUSY", "CANCELLED", "INTERNAL"] },
|
|
3947
|
+
"coding.transcript.raw": { params: CodingTranscriptRawParams, result: CodingTranscriptRawResult, kind: "stream", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "CANCELLED", "INTERNAL"] },
|
|
3948
|
+
"coding.watch": { params: CodingWatchParams, result: CodingWatchResult, kind: "resource", since: "1.38", errors: ["PLATFORM_UNSUPPORTED", "RATE_LIMITED", "INTERNAL"] },
|
|
3949
|
+
"coding.session.watch": { params: CodingSessionWatchParams, result: CodingSessionWatchResult, kind: "resource", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "RATE_LIMITED", "INTERNAL"] },
|
|
3950
|
+
"session.identify": { params: SessionIdentifyParams, result: SessionIdentifyResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS"] },
|
|
3477
3951
|
// 1.22: git for agents (core `git`, the system git; the cloud sandbox's /git/* set, SPEC 6.1).
|
|
3478
3952
|
"git.status": { params: GitStatusParams, result: GitStatusResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
3479
3953
|
"git.diff": { params: GitDiffParams, result: GitDiffResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
@@ -3494,6 +3968,10 @@ var OPS = {
|
|
|
3494
3968
|
"account.agents.list": { params: AccountAgentsListParams, result: AccountAgentsListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
|
|
3495
3969
|
"account.vault.list": { params: AccountVaultListParams, result: AccountVaultListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
|
|
3496
3970
|
"account.vault.copy": { params: AccountVaultCopyParams, result: AccountVaultCopyResult, kind: "unary", since: "1.23", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "INVALID_PARAMS", "DEVICE_OFFLINE", "INTERNAL"] },
|
|
3971
|
+
// 1.39: one agent opened (its inputs and what it uses), its runs (mandate.run_history, one agent at a time) and its star.
|
|
3972
|
+
"account.agents.get": { params: AccountAgentsGetParams, result: AccountAgentsGetResult, kind: "unary", since: "1.39", errors: ["INVALID_PARAMS", "INTERNAL"] },
|
|
3973
|
+
"account.agents.runs": { params: AccountAgentsRunsParams, result: AccountAgentsRunsResult, kind: "unary", since: "1.39", errors: ["INVALID_PARAMS", "INTERNAL"] },
|
|
3974
|
+
"account.agents.favorite": { params: AccountAgentsFavoriteParams, result: AccountAgentsFavoriteResult, kind: "unary", since: "1.39", errors: ["AUTH_REQUIRED", "NOT_FOUND", "INVALID_PARAMS", "DEVICE_OFFLINE", "INTERNAL"] },
|
|
3497
3975
|
// 1.26: the app's own update (it installs only once every window quit) and bringing the windows back.
|
|
3498
3976
|
"apps.windows.update_state": { params: AppsWindowsUpdateStateParams, result: AppsWindowsUpdateStateResult, kind: "unary", since: "1.26", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
3499
3977
|
"apps.windows.reopen": { params: AppsWindowsReopenParams, result: AppsWindowsReopenResult, kind: "unary", since: "1.26", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
@@ -3567,6 +4045,10 @@ var EVENTS = {
|
|
|
3567
4045
|
"session.control_changed": SessionControlChangedEvent,
|
|
3568
4046
|
"models.progress": ModelsProgressEvent,
|
|
3569
4047
|
"coding.history.progress": CodingHistoryProgressEvent,
|
|
4048
|
+
"coding.changed": CodingChangedEvent,
|
|
4049
|
+
"coding.watch_state": CodingWatchStateEvent,
|
|
4050
|
+
"coding.item": CodingItemEvent,
|
|
4051
|
+
"coding.gap": CodingGapEvent,
|
|
3570
4052
|
"relay.device_status": RelayDeviceStatusEvent,
|
|
3571
4053
|
"relay.auth_expiring": RelayAuthExpiringEvent,
|
|
3572
4054
|
"diag.errors.changed": DiagErrorsChangedEvent,
|
|
@@ -3575,6 +4057,42 @@ var EVENTS = {
|
|
|
3575
4057
|
"browser.progress": BrowserProgressEvent
|
|
3576
4058
|
};
|
|
3577
4059
|
|
|
4060
|
+
// src/versioning.ts
|
|
4061
|
+
function compareVersions(a, b) {
|
|
4062
|
+
const [am = 0, an = 0] = a.split(".").map(Number);
|
|
4063
|
+
const [bm = 0, bn = 0] = b.split(".").map(Number);
|
|
4064
|
+
return am - bm || an - bn;
|
|
4065
|
+
}
|
|
4066
|
+
function knows(version, since) {
|
|
4067
|
+
return compareVersions(version, since) >= 0;
|
|
4068
|
+
}
|
|
4069
|
+
var RESULT_PATH = /* @__PURE__ */ new Map([
|
|
4070
|
+
["fs.patch", "FsPatchResult"],
|
|
4071
|
+
["apps.chats.list", "AppsChatsListResult"],
|
|
4072
|
+
["apps.accounts.usage", "AppsAccountsUsageResult"],
|
|
4073
|
+
["apps.accounts.resets", "AppsAccountsResetsResult"],
|
|
4074
|
+
["apps.windows.update_state", "AppsWindowsUpdateStateResult"]
|
|
4075
|
+
]);
|
|
4076
|
+
var NESTED_RESULTS = /* @__PURE__ */ new Map([
|
|
4077
|
+
["apps.chats.list", [["chats", "ChatRow"]]],
|
|
4078
|
+
["apps.projects.file", [["chat", "ChatRow"]]],
|
|
4079
|
+
["apps.projects.file_many", [["chats", "ChatRow"]]],
|
|
4080
|
+
["apps.projects.unfile", [["chat", "ChatRow"]]],
|
|
4081
|
+
["apps.projects.move", [["chat", "ChatRow"]]],
|
|
4082
|
+
["apps.chats.star", [["chat", "ChatRow"]]],
|
|
4083
|
+
["apps.chats.place", [["chat", "ChatRow"]]],
|
|
4084
|
+
["apps.accounts.usage", [["accounts", "AccountUsage"]]],
|
|
4085
|
+
["resources.snapshot", [["disks", "ResourcesDisk"]]],
|
|
4086
|
+
["stack.state", [["servers", "StackServer"]]],
|
|
4087
|
+
["account.agents.list", [["agents", "AccountAgent"]]]
|
|
4088
|
+
]);
|
|
4089
|
+
var WINDOW_RESULTS = /* @__PURE__ */ new Map([
|
|
4090
|
+
["window.list", "windows"],
|
|
4091
|
+
["window.focus", "window"],
|
|
4092
|
+
["window.move", "window"]
|
|
4093
|
+
]);
|
|
4094
|
+
var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
|
|
4095
|
+
|
|
3578
4096
|
// src/client/client.ts
|
|
3579
4097
|
var WS_OPEN = 1;
|
|
3580
4098
|
var defaultTimers = {
|
|
@@ -3923,6 +4441,11 @@ function createDesktopClient(options) {
|
|
|
3923
4441
|
backoff.markConnected();
|
|
3924
4442
|
authRefusals = 0;
|
|
3925
4443
|
setState({ status: "open", welcome: welcome.data, attempts: 0, retryInMs: null, lastError: null, outcome: null });
|
|
4444
|
+
if (options.clientLabel && knows(welcome.data.protocol_version, "1.38")) {
|
|
4445
|
+
void request("session.identify", { label: options.clientLabel.slice(0, 60) }).catch(
|
|
4446
|
+
(error) => diagnose({ kind: "handler_threw", where: "session.identify", error })
|
|
4447
|
+
);
|
|
4448
|
+
}
|
|
3926
4449
|
for (const w of [...readyWaiters]) {
|
|
3927
4450
|
readyWaiters.delete(w);
|
|
3928
4451
|
w.resolve(welcome.data);
|