@ai-matrx/desktop-protocol 0.21.28 → 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 +12 -0
- package/dist/client.cjs +1553 -369
- 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 +1553 -369
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +1694 -95
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3650 -264
- package/dist/index.d.ts +3650 -264
- package/dist/index.js +1694 -95
- package/dist/index.js.map +1 -1
- package/dist/{models-NgxBS190.d.cts → models-CzKyJhDP.d.cts} +9669 -4046
- package/dist/{models-NgxBS190.d.ts → models-CzKyJhDP.d.ts} +9669 -4046
- package/dist/react.d.cts +2977 -404
- package/dist/react.d.ts +2977 -404
- package/generated/desktop-protocol.schema.json +14917 -7363
- 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_-]+$/);
|
|
@@ -227,8 +227,11 @@ var ErrorReason = import_zod2.z.enum([
|
|
|
227
227
|
// AUTH_FORBIDDEN: the named browser is signed in to another account
|
|
228
228
|
"browser_connection_off",
|
|
229
229
|
// AUTH_FORBIDDEN: the person turned Browser connection off
|
|
230
|
-
"awaiting_confirmation"
|
|
230
|
+
"awaiting_confirmation",
|
|
231
231
|
// TIMEOUT: the person did not answer the browser's confirmation in time
|
|
232
|
+
// 1.34 (REASONS_SINCE): the per-device tool policy (src/tools/policy.ts)
|
|
233
|
+
"tool_disabled_on_device"
|
|
234
|
+
// AUTH_FORBIDDEN: the person turned this tool off for agents on this computer (Agents › Tools)
|
|
232
235
|
]);
|
|
233
236
|
var FsPatchEditFailure = import_zod2.z.strictObject({ edit_index: nonNegInt, reason: import_zod2.z.string().max(300) });
|
|
234
237
|
var ProtocolErrorBody = import_zod2.z.strictObject({
|
|
@@ -1103,7 +1106,22 @@ var AccountAgent = import_zod14.z.strictObject({
|
|
|
1103
1106
|
shared_by: import_zod14.z.string().max(320).nullable(),
|
|
1104
1107
|
/** The organization it belongs to. */
|
|
1105
1108
|
organization: import_zod14.z.string().max(200).nullable(),
|
|
1106
|
-
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()
|
|
1107
1125
|
});
|
|
1108
1126
|
var AccountAgentsListParams = import_zod14.z.strictObject({});
|
|
1109
1127
|
var AccountAgentsListResult = import_zod14.z.strictObject({
|
|
@@ -1112,6 +1130,70 @@ var AccountAgentsListResult = import_zod14.z.strictObject({
|
|
|
1112
1130
|
problem: import_zod14.z.string().max(300).nullable(),
|
|
1113
1131
|
agents: import_zod14.z.array(AccountAgent).max(2e3)
|
|
1114
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() });
|
|
1115
1197
|
var VaultItemKind = import_zod14.z.enum(["login", "passkey", "key", "other"]);
|
|
1116
1198
|
var VaultFieldSummary = import_zod14.z.strictObject({
|
|
1117
1199
|
key: import_zod14.z.string().min(1).max(120),
|
|
@@ -1239,7 +1321,9 @@ var SystemSettingsPane = import_zod16.z.enum([
|
|
|
1239
1321
|
"energy",
|
|
1240
1322
|
"about",
|
|
1241
1323
|
"storage",
|
|
1242
|
-
"system_report"
|
|
1324
|
+
"system_report",
|
|
1325
|
+
/** (1.35) Privacy & Security › Microphone: where the person allows Matrx 2 the microphone. */
|
|
1326
|
+
"microphone"
|
|
1243
1327
|
]);
|
|
1244
1328
|
var SystemOpenSettingsParams = import_zod16.z.strictObject({ pane: SystemSettingsPane });
|
|
1245
1329
|
var SystemOpenSettingsResult = import_zod16.z.strictObject({ pane: SystemSettingsPane });
|
|
@@ -2019,24 +2103,389 @@ var CodingHistoryProgressEvent = import_zod27.z.strictObject({
|
|
|
2019
2103
|
failed: nonNegInt
|
|
2020
2104
|
});
|
|
2021
2105
|
|
|
2022
|
-
// src/schema/
|
|
2106
|
+
// src/schema/coding-sessions.ts
|
|
2023
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");
|
|
2024
2473
|
var import_uuid4 = require("@ai-matrx/kit/uuid");
|
|
2025
|
-
var AppKey =
|
|
2026
|
-
var AppProfileId =
|
|
2027
|
-
var AppProfileLocator =
|
|
2028
|
-
var AppSupport =
|
|
2029
|
-
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({
|
|
2030
2479
|
status: AppSupport,
|
|
2031
2480
|
/** One line, set whenever status is not "supported". */
|
|
2032
|
-
reason:
|
|
2481
|
+
reason: import_zod29.z.string().max(140).nullable()
|
|
2033
2482
|
});
|
|
2034
|
-
var AppInfo =
|
|
2483
|
+
var AppInfo = import_zod29.z.strictObject({
|
|
2035
2484
|
app_key: AppKey,
|
|
2036
|
-
name:
|
|
2037
|
-
installed:
|
|
2485
|
+
name: import_zod29.z.string().max(64),
|
|
2486
|
+
installed: import_zod29.z.boolean(),
|
|
2038
2487
|
/** The app's own version string, or null when it is not installed or does not say. */
|
|
2039
|
-
version:
|
|
2488
|
+
version: import_zod29.z.string().max(64).nullable(),
|
|
2040
2489
|
/** The install found (an .app bundle, an .exe, a binary), or null. */
|
|
2041
2490
|
location: AbsPath.nullable(),
|
|
2042
2491
|
/** Open the app at all on this OS. */
|
|
@@ -2046,148 +2495,148 @@ var AppInfo = import_zod28.z.strictObject({
|
|
|
2046
2495
|
/** Plan usage read from the app's own files on this OS. */
|
|
2047
2496
|
usage: AppFeatureStatus
|
|
2048
2497
|
});
|
|
2049
|
-
var AppUsageReading =
|
|
2050
|
-
window:
|
|
2498
|
+
var AppUsageReading = import_zod29.z.strictObject({
|
|
2499
|
+
window: import_zod29.z.enum(["five_hour", "weekly", "extra"]),
|
|
2051
2500
|
/** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
|
|
2052
|
-
percent:
|
|
2501
|
+
percent: import_zod29.z.number().min(0).max(1e4),
|
|
2053
2502
|
/** When the app recorded it. */
|
|
2054
2503
|
sampled_at_ms: epochMs,
|
|
2055
2504
|
/** True when the window has rolled over since the sample, so the figure has reset. */
|
|
2056
|
-
reset_since:
|
|
2505
|
+
reset_since: import_zod29.z.boolean()
|
|
2057
2506
|
});
|
|
2058
|
-
var AppProfile =
|
|
2507
|
+
var AppProfile = import_zod29.z.strictObject({
|
|
2059
2508
|
/** The row's id; null for a folder found on disk that no row names yet. */
|
|
2060
2509
|
id: AppProfileId.nullable(),
|
|
2061
2510
|
app_key: AppKey,
|
|
2062
|
-
display_name:
|
|
2511
|
+
display_name: import_zod29.z.string().min(1).max(120),
|
|
2063
2512
|
/** The account the person means to be signed in here; null when not stated (never guessed). */
|
|
2064
|
-
account_identity:
|
|
2513
|
+
account_identity: import_zod29.z.string().min(3).max(320).nullable(),
|
|
2065
2514
|
profile_locator: AppProfileLocator.nullable(),
|
|
2066
2515
|
/** The device the row is tied to; null when the row names none. */
|
|
2067
2516
|
device_id: DeviceId.nullable(),
|
|
2068
2517
|
/** The folder this profile resolves to on this device; null for a row tied to another device. */
|
|
2069
2518
|
folder: AbsPath.nullable(),
|
|
2070
2519
|
/** The folder exists on this device. */
|
|
2071
|
-
on_disk:
|
|
2520
|
+
on_disk: import_zod29.z.boolean(),
|
|
2072
2521
|
/** An instance with this profile is running; null when it could not be determined. */
|
|
2073
|
-
running:
|
|
2522
|
+
running: import_zod29.z.boolean().nullable(),
|
|
2074
2523
|
/** Usage the app recorded for this profile; null when the app exposes none here. */
|
|
2075
|
-
usage:
|
|
2524
|
+
usage: import_zod29.z.array(AppUsageReading).nullable(),
|
|
2076
2525
|
last_opened_ms: epochMs.nullable()
|
|
2077
2526
|
});
|
|
2078
|
-
var AppsListParams =
|
|
2079
|
-
var AppsListResult =
|
|
2080
|
-
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({
|
|
2081
2530
|
/** Only this app's profiles; every app's when absent. */
|
|
2082
2531
|
app_key: AppKey.optional()
|
|
2083
2532
|
});
|
|
2084
|
-
var AppsProfilesListResult =
|
|
2085
|
-
profiles:
|
|
2533
|
+
var AppsProfilesListResult = import_zod29.z.strictObject({
|
|
2534
|
+
profiles: import_zod29.z.array(AppProfile),
|
|
2086
2535
|
/**
|
|
2087
2536
|
* Whether the saved rows could be read: false while signed out or offline, when only folders
|
|
2088
2537
|
* found on disk are listed.
|
|
2089
2538
|
*/
|
|
2090
|
-
registry:
|
|
2539
|
+
registry: import_zod29.z.enum(["ok", "signed_out", "unavailable"])
|
|
2091
2540
|
});
|
|
2092
|
-
var AppsProfilesSaveParams =
|
|
2541
|
+
var AppsProfilesSaveParams = import_zod29.z.strictObject({
|
|
2093
2542
|
id: AppProfileId.optional(),
|
|
2094
2543
|
app_key: AppKey,
|
|
2095
|
-
display_name:
|
|
2096
|
-
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(),
|
|
2097
2546
|
/** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
|
|
2098
2547
|
profile_locator: AppProfileLocator.nullable(),
|
|
2099
2548
|
/** On create with profile_locator null: make a new folder named after display_name instead. */
|
|
2100
|
-
new_folder:
|
|
2549
|
+
new_folder: import_zod29.z.boolean().default(false)
|
|
2101
2550
|
});
|
|
2102
2551
|
var AppsProfilesSaveResult = AppProfile;
|
|
2103
|
-
var AppsProfilesRemoveParams =
|
|
2104
|
-
var AppsProfilesRemoveResult =
|
|
2105
|
-
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({
|
|
2106
2555
|
app_key: AppKey,
|
|
2107
2556
|
profile_id: AppProfileId.optional()
|
|
2108
2557
|
});
|
|
2109
|
-
var AppsOpenResult =
|
|
2558
|
+
var AppsOpenResult = import_zod29.z.strictObject({
|
|
2110
2559
|
/** True when an instance with this profile was already running; it is brought forward. */
|
|
2111
|
-
already_running:
|
|
2560
|
+
already_running: import_zod29.z.boolean(),
|
|
2112
2561
|
folder: AbsPath.nullable()
|
|
2113
2562
|
});
|
|
2114
2563
|
|
|
2115
2564
|
// src/schema/apps-chats.ts
|
|
2116
|
-
var
|
|
2117
|
-
var ChatId =
|
|
2118
|
-
var ChatPlace =
|
|
2119
|
-
var ChatProjectId =
|
|
2120
|
-
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({
|
|
2121
2570
|
key: ChatPlace,
|
|
2122
2571
|
/** The app's default profile (Claude: the main window, which lists every account's chats). */
|
|
2123
|
-
main:
|
|
2572
|
+
main: import_zod30.z.boolean(),
|
|
2124
2573
|
/** The account the window is signed into, when known. */
|
|
2125
|
-
account:
|
|
2574
|
+
account: import_zod30.z.string().max(320).nullable()
|
|
2126
2575
|
});
|
|
2127
|
-
var ChatProject =
|
|
2576
|
+
var ChatProject = import_zod30.z.strictObject({
|
|
2128
2577
|
id: ChatProjectId,
|
|
2129
|
-
name:
|
|
2130
|
-
archived:
|
|
2578
|
+
name: import_zod30.z.string().min(1).max(200),
|
|
2579
|
+
archived: import_zod30.z.boolean(),
|
|
2131
2580
|
/** Chats in it. */
|
|
2132
2581
|
count: nonNegInt
|
|
2133
2582
|
});
|
|
2134
|
-
var ChatPin =
|
|
2583
|
+
var ChatPin = import_zod30.z.strictObject({
|
|
2135
2584
|
/** The window whose account pins it; an account with no window of its own is named by its email. */
|
|
2136
|
-
window:
|
|
2585
|
+
window: import_zod30.z.string().min(1).max(320),
|
|
2137
2586
|
/** When that account's pin list was last read; null when the reading has no time. */
|
|
2138
2587
|
observed_at_ms: epochMs.nullable()
|
|
2139
2588
|
});
|
|
2140
|
-
var ChatRunning =
|
|
2589
|
+
var ChatRunning = import_zod30.z.strictObject({
|
|
2141
2590
|
window: ChatPlace,
|
|
2142
2591
|
/** process: a live process resumed this chat there (exact); activity: that window's own record moved in the last 3 minutes. */
|
|
2143
|
-
how:
|
|
2592
|
+
how: import_zod30.z.enum(["process", "activity"])
|
|
2144
2593
|
});
|
|
2145
|
-
var ChatHidden =
|
|
2594
|
+
var ChatHidden = import_zod30.z.strictObject({
|
|
2146
2595
|
window: ChatPlace,
|
|
2147
|
-
reason:
|
|
2596
|
+
reason: import_zod30.z.string().max(200)
|
|
2148
2597
|
});
|
|
2149
|
-
var ChatLastUse =
|
|
2598
|
+
var ChatLastUse = import_zod30.z.strictObject({
|
|
2150
2599
|
/** The conversation's last reply. */
|
|
2151
2600
|
at_ms: epochMs,
|
|
2152
2601
|
window: ChatPlace.nullable(),
|
|
2153
|
-
account:
|
|
2602
|
+
account: import_zod30.z.string().max(320).nullable(),
|
|
2154
2603
|
/** How the window was decided (one short line). */
|
|
2155
|
-
how:
|
|
2604
|
+
how: import_zod30.z.string().max(120).nullable(),
|
|
2156
2605
|
/** The account's 1-hour prompt cache is still warm. */
|
|
2157
|
-
cache_warm:
|
|
2606
|
+
cache_warm: import_zod30.z.boolean(),
|
|
2158
2607
|
cache_minutes_left: nonNegInt
|
|
2159
2608
|
});
|
|
2160
|
-
var ChatAppProject =
|
|
2161
|
-
id:
|
|
2162
|
-
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)
|
|
2163
2612
|
});
|
|
2164
|
-
var ChatTitleSource =
|
|
2165
|
-
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({
|
|
2166
2615
|
id: ChatId,
|
|
2167
2616
|
/** The short id people see (the listing's first 8 characters). */
|
|
2168
|
-
short_id:
|
|
2617
|
+
short_id: import_zod30.z.string().max(16),
|
|
2169
2618
|
/** The listing's own name (Claude: local_<id>), null for a chat only in the holder. */
|
|
2170
|
-
record:
|
|
2171
|
-
title:
|
|
2619
|
+
record: import_zod30.z.string().max(160).nullable(),
|
|
2620
|
+
title: import_zod30.z.string().max(1e3),
|
|
2172
2621
|
last_active_ms: epochMs.nullable(),
|
|
2173
2622
|
created_ms: epochMs.nullable(),
|
|
2174
|
-
projects:
|
|
2175
|
-
starred:
|
|
2176
|
-
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),
|
|
2177
2626
|
/** Every place it is listed now: window keys, plus "holder". */
|
|
2178
|
-
places:
|
|
2179
|
-
held:
|
|
2180
|
-
running:
|
|
2181
|
-
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),
|
|
2182
2631
|
/** Kept out of the main window on purpose. */
|
|
2183
|
-
hidden_from_main:
|
|
2632
|
+
hidden_from_main: import_zod30.z.boolean(),
|
|
2184
2633
|
/** Listed in a side window and not yet copied into main. */
|
|
2185
|
-
main_pending:
|
|
2634
|
+
main_pending: import_zod30.z.boolean(),
|
|
2186
2635
|
/** A scheduled routine's run (its task id). */
|
|
2187
|
-
scheduled:
|
|
2636
|
+
scheduled: import_zod30.z.string().max(200).nullable(),
|
|
2188
2637
|
/** Created recently and in no project: offered for filing. */
|
|
2189
|
-
new_unfiled:
|
|
2190
|
-
warnings:
|
|
2638
|
+
new_unfiled: import_zod30.z.boolean(),
|
|
2639
|
+
warnings: import_zod30.z.array(import_zod30.z.string().max(400)).max(20),
|
|
2191
2640
|
last_use: ChatLastUse.nullable(),
|
|
2192
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. */
|
|
2193
2642
|
app_project: ChatAppProject.optional(),
|
|
@@ -2197,140 +2646,140 @@ var ChatRow = import_zod29.z.strictObject({
|
|
|
2197
2646
|
* 1.14: the chat's own title before the person's rename (the one title rule, `@ai-matrx/coding-sessions/sessions`);
|
|
2198
2647
|
* `title` is what to show (`title_override` when set, else this).
|
|
2199
2648
|
*/
|
|
2200
|
-
original_title:
|
|
2649
|
+
original_title: import_zod30.z.string().max(1e3).optional(),
|
|
2201
2650
|
/** 1.14: where `original_title` came from (the one rule's sources, strongest first; 1.15: a closed set). */
|
|
2202
2651
|
title_source: ChatTitleSource.optional(),
|
|
2203
2652
|
/** 1.14: the person's rename inside Matrx (Coding Sessions), applied once by the row builder; absent = none. */
|
|
2204
|
-
title_override:
|
|
2653
|
+
title_override: import_zod30.z.string().min(1).max(300).optional(),
|
|
2205
2654
|
/** 1.15: the app itself archived it (hidden_in says where and why, in words for people; this is the typed fact). */
|
|
2206
|
-
archived:
|
|
2655
|
+
archived: import_zod30.z.boolean().optional()
|
|
2207
2656
|
});
|
|
2208
|
-
var ChatFamily =
|
|
2657
|
+
var ChatFamily = import_zod30.z.strictObject({
|
|
2209
2658
|
id: ChatId,
|
|
2210
2659
|
fork_of: ChatId.nullable(),
|
|
2211
2660
|
copy_of: ChatId.nullable()
|
|
2212
2661
|
});
|
|
2213
|
-
var AppsChatsListParams =
|
|
2662
|
+
var AppsChatsListParams = import_zod30.z.strictObject({
|
|
2214
2663
|
app_key: AppKey,
|
|
2215
2664
|
/** Only these chats (a live update re-reads just what changed). */
|
|
2216
|
-
ids:
|
|
2665
|
+
ids: import_zod30.z.array(ChatId).max(500).optional()
|
|
2217
2666
|
});
|
|
2218
|
-
var AppsChatsListResult =
|
|
2667
|
+
var AppsChatsListResult = import_zod30.z.strictObject({
|
|
2219
2668
|
app_key: AppKey,
|
|
2220
2669
|
/** Bumps on every change the index sees; `apps.chats.changed` carries the same number. */
|
|
2221
2670
|
version: nonNegInt,
|
|
2222
|
-
windows:
|
|
2223
|
-
projects:
|
|
2224
|
-
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),
|
|
2225
2674
|
/** How long a chat in no project counts as new. */
|
|
2226
2675
|
new_window_ms: nonNegInt,
|
|
2227
2676
|
/** 1.9: this is the copy saved at the last read, shown while everything is read again. */
|
|
2228
|
-
updating:
|
|
2677
|
+
updating: import_zod30.z.boolean().optional(),
|
|
2229
2678
|
/** 1.9: false while the folder watches are down (changes are not arriving); `apps.chats.watch_state` says when it changes. */
|
|
2230
|
-
live:
|
|
2679
|
+
live: import_zod30.z.boolean().optional(),
|
|
2231
2680
|
/** 1.10: every listed chat that is a fork or a copy of another (read from the conversations' first lines). */
|
|
2232
|
-
families:
|
|
2681
|
+
families: import_zod30.z.array(ChatFamily).max(2e4).optional()
|
|
2233
2682
|
});
|
|
2234
|
-
var AppsChatsWatchParams =
|
|
2235
|
-
var AppsChatsWatchResult =
|
|
2236
|
-
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({
|
|
2237
2686
|
app_key: AppKey,
|
|
2238
2687
|
version: nonNegInt,
|
|
2239
|
-
ids:
|
|
2240
|
-
all:
|
|
2688
|
+
ids: import_zod30.z.array(ChatId).max(1e3),
|
|
2689
|
+
all: import_zod30.z.boolean()
|
|
2241
2690
|
});
|
|
2242
|
-
var AppsChatsWatchStateEvent =
|
|
2691
|
+
var AppsChatsWatchStateEvent = import_zod30.z.strictObject({
|
|
2243
2692
|
app_key: AppKey,
|
|
2244
|
-
live:
|
|
2245
|
-
updating:
|
|
2246
|
-
reason:
|
|
2693
|
+
live: import_zod30.z.boolean(),
|
|
2694
|
+
updating: import_zod30.z.boolean(),
|
|
2695
|
+
reason: import_zod30.z.string().max(300).nullable()
|
|
2247
2696
|
});
|
|
2248
|
-
var AppsChatsPlaceParams =
|
|
2697
|
+
var AppsChatsPlaceParams = import_zod30.z.strictObject({
|
|
2249
2698
|
app_key: AppKey,
|
|
2250
2699
|
chat_id: ChatId,
|
|
2251
|
-
action:
|
|
2700
|
+
action: import_zod30.z.enum(["place", "take_off", "hold"]),
|
|
2252
2701
|
/** The window (for place and take_off). */
|
|
2253
2702
|
window: ChatPlace.optional(),
|
|
2254
2703
|
/** take_off where it is open: stop it there first (the person confirmed). */
|
|
2255
|
-
stop_if_open:
|
|
2704
|
+
stop_if_open: import_zod30.z.boolean().default(false)
|
|
2256
2705
|
});
|
|
2257
|
-
var AppsChatsPlaceResult =
|
|
2258
|
-
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({
|
|
2259
2708
|
app_key: AppKey,
|
|
2260
|
-
chat_ids:
|
|
2709
|
+
chat_ids: import_zod30.z.array(ChatId).min(1).max(500),
|
|
2261
2710
|
project_id: ChatProjectId.optional(),
|
|
2262
|
-
new_project_name:
|
|
2711
|
+
new_project_name: import_zod30.z.string().min(1).max(200).optional()
|
|
2263
2712
|
});
|
|
2264
|
-
var AppsProjectsFileManyResult =
|
|
2265
|
-
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({
|
|
2266
2715
|
app_key: AppKey,
|
|
2267
2716
|
project_id: ChatProjectId,
|
|
2268
|
-
name:
|
|
2269
|
-
archived:
|
|
2717
|
+
name: import_zod30.z.string().min(1).max(200).optional(),
|
|
2718
|
+
archived: import_zod30.z.boolean().optional()
|
|
2270
2719
|
});
|
|
2271
|
-
var AppsProjectsUpdateResult =
|
|
2272
|
-
var AppsProjectsCopyParams =
|
|
2273
|
-
var AppsProjectsCopyResult =
|
|
2274
|
-
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({
|
|
2275
2724
|
app_key: AppKey,
|
|
2276
2725
|
chat_id: ChatId,
|
|
2277
2726
|
project_id: ChatProjectId.optional(),
|
|
2278
|
-
new_project_name:
|
|
2727
|
+
new_project_name: import_zod30.z.string().min(1).max(200).optional()
|
|
2279
2728
|
});
|
|
2280
|
-
var AppsProjectsFileResult =
|
|
2281
|
-
var AppsProjectsUnfileParams =
|
|
2282
|
-
var AppsProjectsUnfileResult =
|
|
2283
|
-
var AppsChatsStarParams =
|
|
2284
|
-
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 });
|
|
2285
2734
|
|
|
2286
2735
|
// src/schema/apps-accounts.ts
|
|
2287
|
-
var
|
|
2288
|
-
var AppWindowInfo =
|
|
2736
|
+
var import_zod31 = require("zod");
|
|
2737
|
+
var AppWindowInfo = import_zod31.z.strictObject({
|
|
2289
2738
|
key: ChatPlace,
|
|
2290
2739
|
/** The app's default profile (Claude: main, which may sign into any account). */
|
|
2291
|
-
main:
|
|
2740
|
+
main: import_zod31.z.boolean(),
|
|
2292
2741
|
/** The account the window is meant for (null for main). */
|
|
2293
|
-
account:
|
|
2742
|
+
account: import_zod31.z.string().max(320).nullable(),
|
|
2294
2743
|
/** The account signed in there now: an email, or the account id while it has no saved name. */
|
|
2295
|
-
signed_in:
|
|
2296
|
-
signed_in_is_email:
|
|
2744
|
+
signed_in: import_zod31.z.string().max(320).nullable(),
|
|
2745
|
+
signed_in_is_email: import_zod31.z.boolean(),
|
|
2297
2746
|
/** Signed into another account than the one it is meant for. */
|
|
2298
|
-
mismatch:
|
|
2747
|
+
mismatch: import_zod31.z.boolean(),
|
|
2299
2748
|
/** Its folder exists. */
|
|
2300
|
-
created:
|
|
2749
|
+
created: import_zod31.z.boolean(),
|
|
2301
2750
|
/** Open now. */
|
|
2302
|
-
running:
|
|
2751
|
+
running: import_zod31.z.boolean(),
|
|
2303
2752
|
/** Chats open in it now (a process resuming each one). */
|
|
2304
2753
|
open_chats: nonNegInt
|
|
2305
2754
|
});
|
|
2306
|
-
var AccountUsage =
|
|
2755
|
+
var AccountUsage = import_zod31.z.strictObject({
|
|
2307
2756
|
/** The account's email, or "org <8 chars>" when no window has ever sampled that org. */
|
|
2308
|
-
account:
|
|
2309
|
-
org:
|
|
2757
|
+
account: import_zod31.z.string().max(320),
|
|
2758
|
+
org: import_zod31.z.string().max(80).nullable(),
|
|
2310
2759
|
/** False when the org was sampled in several accounts' windows and the vote is not clear (≥ 75 %). */
|
|
2311
|
-
account_certain:
|
|
2760
|
+
account_certain: import_zod31.z.boolean(),
|
|
2312
2761
|
/** 5-hour use in percent (0 once the reading is over 5 hours old). */
|
|
2313
|
-
five_hour:
|
|
2314
|
-
five_hour_reset_since:
|
|
2762
|
+
five_hour: import_zod31.z.number().nullable(),
|
|
2763
|
+
five_hour_reset_since: import_zod31.z.boolean(),
|
|
2315
2764
|
/** Weekly use in percent (0 once the week reset after the reading). */
|
|
2316
|
-
weekly:
|
|
2317
|
-
weekly_reset_since:
|
|
2765
|
+
weekly: import_zod31.z.number().nullable(),
|
|
2766
|
+
weekly_reset_since: import_zod31.z.boolean(),
|
|
2318
2767
|
/** Extra-usage spend in percent of its cap, when on. */
|
|
2319
|
-
extra_usage:
|
|
2768
|
+
extra_usage: import_zod31.z.number().nullable(),
|
|
2320
2769
|
extra_usage_as_of_ms: epochMs.nullable(),
|
|
2321
2770
|
as_of_ms: epochMs,
|
|
2322
2771
|
/** The windows meant for this account (and main when main took the reading). */
|
|
2323
|
-
windows:
|
|
2772
|
+
windows: import_zod31.z.array(ChatPlace).max(200),
|
|
2324
2773
|
/** The window that took the reading is open now and the reading is under 30 minutes old. */
|
|
2325
|
-
live:
|
|
2774
|
+
live: import_zod31.z.boolean(),
|
|
2326
2775
|
/** The next weekly reset, when known. */
|
|
2327
2776
|
weekly_resets_at_ms: epochMs.nullable(),
|
|
2328
2777
|
/** That reset time is Claude's own (its reading, or a reset seen in its usage history). */
|
|
2329
|
-
weekly_reset_official:
|
|
2778
|
+
weekly_reset_official: import_zod31.z.boolean().nullable(),
|
|
2330
2779
|
/** 1.13: the account's plan as the app names it (Codex: "pro", "prolite"), when recorded. */
|
|
2331
|
-
plan:
|
|
2780
|
+
plan: import_zod31.z.string().max(80).optional(),
|
|
2332
2781
|
/** 1.13: the account's credit balance as the app records it (Codex), when recorded. */
|
|
2333
|
-
credits:
|
|
2782
|
+
credits: import_zod31.z.string().max(40).optional(),
|
|
2334
2783
|
/**
|
|
2335
2784
|
* 1.25: the latest the account's 5-hour window can reset: 5 hours after the first reading of this
|
|
2336
2785
|
* window's use (its usage history), so the real reset is at or before it. Absent when no 5-hour
|
|
@@ -2338,81 +2787,81 @@ var AccountUsage = import_zod30.z.strictObject({
|
|
|
2338
2787
|
*/
|
|
2339
2788
|
five_hour_resets_by_ms: epochMs.optional()
|
|
2340
2789
|
});
|
|
2341
|
-
var AccountReset =
|
|
2790
|
+
var AccountReset = import_zod31.z.strictObject({
|
|
2342
2791
|
window: ChatPlace,
|
|
2343
|
-
account:
|
|
2792
|
+
account: import_zod31.z.string().max(320).nullable(),
|
|
2344
2793
|
next_reset_ms: epochMs.nullable(),
|
|
2345
2794
|
/** claude: the app's own reading; usage_history: a weekly drop seen in its usage record; your_list: the person's own entry. */
|
|
2346
|
-
source:
|
|
2795
|
+
source: import_zod31.z.enum(["claude", "usage_history", "your_list"]).nullable(),
|
|
2347
2796
|
/** claude or usage_history. */
|
|
2348
|
-
official:
|
|
2797
|
+
official: import_zod31.z.boolean(),
|
|
2349
2798
|
/** Set when the person's list disagrees with the official time. */
|
|
2350
|
-
note:
|
|
2799
|
+
note: import_zod31.z.string().max(200).nullable()
|
|
2351
2800
|
});
|
|
2352
|
-
var AppsWindowsListParams =
|
|
2353
|
-
var AppsWindowsListResult =
|
|
2354
|
-
var AppsAccountsUsageParams =
|
|
2355
|
-
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({
|
|
2356
2805
|
app_key: AppKey,
|
|
2357
|
-
accounts:
|
|
2806
|
+
accounts: import_zod31.z.array(AccountUsage).max(500),
|
|
2358
2807
|
/** 1.12: the rows are right but something around them failed (a newly read reset time could not be saved); shown, never hidden. */
|
|
2359
|
-
problem:
|
|
2808
|
+
problem: import_zod31.z.string().max(400).optional()
|
|
2360
2809
|
});
|
|
2361
|
-
var AppsAccountsResetsParams =
|
|
2362
|
-
var AppsAccountsResetsResult =
|
|
2810
|
+
var AppsAccountsResetsParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
2811
|
+
var AppsAccountsResetsResult = import_zod31.z.strictObject({
|
|
2363
2812
|
app_key: AppKey,
|
|
2364
|
-
resets:
|
|
2813
|
+
resets: import_zod31.z.array(AccountReset).max(200),
|
|
2365
2814
|
/** 1.12: as on `apps.accounts.usage`. */
|
|
2366
|
-
problem:
|
|
2815
|
+
problem: import_zod31.z.string().max(400).optional()
|
|
2367
2816
|
});
|
|
2368
|
-
var AppsWindowActionResult =
|
|
2369
|
-
var AppsWindowsOpenParams =
|
|
2370
|
-
var AppsWindowsReloadParams =
|
|
2371
|
-
var ShownSection =
|
|
2372
|
-
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),
|
|
2373
2822
|
/** Rows drawn under it (a collapsed section draws none). */
|
|
2374
|
-
rows:
|
|
2375
|
-
expanded:
|
|
2823
|
+
rows: import_zod31.z.number().int().nonnegative(),
|
|
2824
|
+
expanded: import_zod31.z.boolean()
|
|
2376
2825
|
});
|
|
2377
|
-
var AppsWindowsShownParams =
|
|
2378
|
-
var AppsWindowsShownResult =
|
|
2826
|
+
var AppsWindowsShownParams = import_zod31.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
2827
|
+
var AppsWindowsShownResult = import_zod31.z.strictObject({
|
|
2379
2828
|
window: ChatPlace,
|
|
2380
|
-
open:
|
|
2381
|
-
sections:
|
|
2382
|
-
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()
|
|
2383
2832
|
});
|
|
2384
|
-
var AppsWindowsRestartParams =
|
|
2385
|
-
var AppsWindowsRefreshUsageParams =
|
|
2386
|
-
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({
|
|
2387
2836
|
app_key: AppKey,
|
|
2388
2837
|
chat_id: ChatId,
|
|
2389
2838
|
from_project_id: ChatProjectId,
|
|
2390
2839
|
to_project_id: ChatProjectId.optional(),
|
|
2391
|
-
new_project_name:
|
|
2392
|
-
});
|
|
2393
|
-
var AppsProjectsMoveResult =
|
|
2394
|
-
var AppsProjectsCreateParams =
|
|
2395
|
-
var AppsProjectsCreateResult =
|
|
2396
|
-
var AppsProjectsImportPinsParams =
|
|
2397
|
-
var AppsProjectsImportPinsResult =
|
|
2398
|
-
var ProjectMoveChat =
|
|
2399
|
-
var ProjectMoveSkip =
|
|
2400
|
-
var ProjectMoveGroup =
|
|
2401
|
-
ok:
|
|
2402
|
-
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),
|
|
2403
2852
|
/** Why it is not (or was not) grouped — e.g. the window is open. */
|
|
2404
|
-
reason:
|
|
2853
|
+
reason: import_zod31.z.string().max(400).optional(),
|
|
2405
2854
|
/** Chats that get (or got) the group; already in it; taken from another group of the window. */
|
|
2406
2855
|
assign: nonNegInt.optional(),
|
|
2407
2856
|
already: nonNegInt.optional(),
|
|
2408
2857
|
from_other_groups: nonNegInt.optional(),
|
|
2409
2858
|
/** A group of that name was already there (reused, never doubled). */
|
|
2410
|
-
group_exists:
|
|
2859
|
+
group_exists: import_zod31.z.boolean().optional()
|
|
2411
2860
|
});
|
|
2412
|
-
var ProjectMovePin =
|
|
2413
|
-
ok:
|
|
2861
|
+
var ProjectMovePin = import_zod31.z.strictObject({
|
|
2862
|
+
ok: import_zod31.z.boolean(),
|
|
2414
2863
|
/** "now" = written into the closed window; "next_close" = queued until that window closes. */
|
|
2415
|
-
when:
|
|
2864
|
+
when: import_zod31.z.enum(["now", "next_close"]),
|
|
2416
2865
|
/** Pinned by this call (dry run: would be). */
|
|
2417
2866
|
pinned: nonNegInt,
|
|
2418
2867
|
/** Already pinned there. */
|
|
@@ -2420,104 +2869,108 @@ var ProjectMovePin = import_zod30.z.strictObject({
|
|
|
2420
2869
|
/** Waiting for the window to close (dry run: would wait). */
|
|
2421
2870
|
queued: nonNegInt,
|
|
2422
2871
|
/** Why not pinned (ok false), or why queued. */
|
|
2423
|
-
reason:
|
|
2872
|
+
reason: import_zod31.z.string().max(400).optional()
|
|
2424
2873
|
});
|
|
2425
|
-
var AppsProjectsToWindowParams =
|
|
2874
|
+
var AppsProjectsToWindowParams = import_zod31.z.strictObject({
|
|
2426
2875
|
app_key: AppKey,
|
|
2427
2876
|
project_id: ChatProjectId,
|
|
2428
2877
|
window: ChatPlace,
|
|
2429
2878
|
/** Also take each chat off its other side windows where safe (never main, the holder, an open window). */
|
|
2430
|
-
take_off:
|
|
2879
|
+
take_off: import_zod31.z.boolean().default(false),
|
|
2431
2880
|
/** Also group them under the project's name in that window's sidebar (closed windows only). */
|
|
2432
|
-
group:
|
|
2881
|
+
group: import_zod31.z.boolean().default(false),
|
|
2433
2882
|
/** 1.32: also pin them in that window (now if closed, else when it next closes). */
|
|
2434
|
-
pin:
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2883
|
+
pin: import_zod31.z.boolean().optional(),
|
|
2884
|
+
/** 1.36: a batch: exactly these chats of the project and no other (a reused marker is a label, never a sweep). */
|
|
2885
|
+
chat_ids: import_zod31.z.array(ChatId).min(1).max(5e3).optional(),
|
|
2886
|
+
/** 1.36: take them off this one side window only (a Move's origin), never main or another window that lists them. */
|
|
2887
|
+
take_off_from: ChatPlace.optional(),
|
|
2888
|
+
dry_run: import_zod31.z.boolean().default(false)
|
|
2889
|
+
});
|
|
2890
|
+
var AppsProjectsToWindowResult = import_zod31.z.strictObject({
|
|
2438
2891
|
project_id: ChatProjectId,
|
|
2439
2892
|
window: ChatPlace,
|
|
2440
|
-
dry_run:
|
|
2441
|
-
place:
|
|
2442
|
-
already:
|
|
2443
|
-
take_off:
|
|
2444
|
-
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),
|
|
2445
2898
|
/** Chats of the project from other apps (no windows to place into), left as they are. */
|
|
2446
2899
|
other_apps: nonNegInt,
|
|
2447
2900
|
group: ProjectMoveGroup.nullable(),
|
|
2448
2901
|
/** 1.32: the pin in the target window (absent: not asked). */
|
|
2449
2902
|
pin: ProjectMovePin.optional(),
|
|
2450
|
-
message:
|
|
2903
|
+
message: import_zod31.z.string().max(400)
|
|
2451
2904
|
});
|
|
2452
|
-
var ColdChat =
|
|
2905
|
+
var ColdChat = import_zod31.z.strictObject({
|
|
2453
2906
|
id: ChatId,
|
|
2454
|
-
title:
|
|
2455
|
-
repo:
|
|
2456
|
-
window:
|
|
2457
|
-
account:
|
|
2458
|
-
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(),
|
|
2459
2912
|
context_tokens: nonNegInt,
|
|
2460
2913
|
cold_at_ms: epochMs,
|
|
2461
2914
|
/** Waking it once the cache is cold. */
|
|
2462
|
-
cold_cost:
|
|
2915
|
+
cold_cost: import_zod31.z.number().nullable(),
|
|
2463
2916
|
/** Waking it while the cache is warm. */
|
|
2464
|
-
warm_cost:
|
|
2917
|
+
warm_cost: import_zod31.z.number().nullable(),
|
|
2465
2918
|
/** Its account is on extra usage (a 5-minute cache, and real money). */
|
|
2466
|
-
extra_usage:
|
|
2919
|
+
extra_usage: import_zod31.z.boolean(),
|
|
2467
2920
|
/** A scheduled routine's run. */
|
|
2468
|
-
scheduled:
|
|
2921
|
+
scheduled: import_zod31.z.boolean(),
|
|
2469
2922
|
/** It can be shown in its window (started in the desktop app). */
|
|
2470
|
-
openable:
|
|
2923
|
+
openable: import_zod31.z.boolean(),
|
|
2471
2924
|
/** How its window was decided, or why it can't be opened. */
|
|
2472
|
-
how:
|
|
2925
|
+
how: import_zod31.z.string().max(200).nullable()
|
|
2473
2926
|
});
|
|
2474
|
-
var AppsChatsColdParams =
|
|
2475
|
-
var AppsChatsColdResult =
|
|
2927
|
+
var AppsChatsColdParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
2928
|
+
var AppsChatsColdResult = import_zod31.z.strictObject({
|
|
2476
2929
|
app_key: AppKey,
|
|
2477
2930
|
/** Waiting for the person with a warm cache, most urgent first. */
|
|
2478
|
-
waiting:
|
|
2931
|
+
waiting: import_zod31.z.array(ColdChat).max(2e3),
|
|
2479
2932
|
/** Went cold in the last while. */
|
|
2480
|
-
recently_cold:
|
|
2933
|
+
recently_cold: import_zod31.z.array(ColdChat).max(2e3),
|
|
2481
2934
|
/** Chats working right now (not waiting). */
|
|
2482
2935
|
working: nonNegInt
|
|
2483
2936
|
});
|
|
2484
|
-
var TitleCopies =
|
|
2937
|
+
var TitleCopies = import_zod31.z.strictObject({
|
|
2485
2938
|
window: ChatPlace,
|
|
2486
2939
|
/** Record copies in that window holding a different name (main keeps one per account folder). */
|
|
2487
2940
|
copies: nonNegInt,
|
|
2488
|
-
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)
|
|
2489
2942
|
});
|
|
2490
|
-
var TitleMismatch =
|
|
2943
|
+
var TitleMismatch = import_zod31.z.strictObject({
|
|
2491
2944
|
chat_id: ChatId,
|
|
2492
2945
|
/** The right name: the latest one a person gave it (in any window, or in Matrx), else the newest automatic title. */
|
|
2493
|
-
title:
|
|
2494
|
-
title_source:
|
|
2946
|
+
title: import_zod31.z.string().max(2e3),
|
|
2947
|
+
title_source: import_zod31.z.enum(["user", "auto"]),
|
|
2495
2948
|
/** Where the right name came from: a window, "matrx", or "ledger" (decided earlier). */
|
|
2496
|
-
decided_from:
|
|
2497
|
-
kind:
|
|
2498
|
-
windows:
|
|
2499
|
-
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)
|
|
2500
2953
|
});
|
|
2501
|
-
var StaleTitleWindow =
|
|
2954
|
+
var StaleTitleWindow = import_zod31.z.strictObject({
|
|
2502
2955
|
window: ChatPlace,
|
|
2503
2956
|
/** First and latest time (ms) it was seen writing an old name back. */
|
|
2504
2957
|
since_ms: nonNegInt,
|
|
2505
2958
|
last_ms: nonNegInt
|
|
2506
2959
|
});
|
|
2507
|
-
var AppsChatsTitlesCheckParams =
|
|
2508
|
-
var AppsChatsTitlesCheckResult =
|
|
2960
|
+
var AppsChatsTitlesCheckParams = import_zod31.z.strictObject({ app_key: AppKey });
|
|
2961
|
+
var AppsChatsTitlesCheckResult = import_zod31.z.strictObject({
|
|
2509
2962
|
app_key: AppKey,
|
|
2510
2963
|
chats_total: nonNegInt,
|
|
2511
2964
|
chats_in_several_windows: nonNegInt,
|
|
2512
2965
|
/** Chats with a different name in some window (or in Matrx). */
|
|
2513
2966
|
chats_with_a_different_name: nonNegInt,
|
|
2514
2967
|
copies_to_write: nonNegInt,
|
|
2515
|
-
chats:
|
|
2968
|
+
chats: import_zod31.z.array(TitleMismatch).max(5e3),
|
|
2516
2969
|
/** Windows that keep writing old names back (each is fixed every pass; reloading it, Cmd+R, stops it). Since 1.33. */
|
|
2517
|
-
stale_windows:
|
|
2970
|
+
stale_windows: import_zod31.z.array(StaleTitleWindow).max(200).optional()
|
|
2518
2971
|
});
|
|
2519
|
-
var AppsChatsTitlesPushParams =
|
|
2520
|
-
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({
|
|
2521
2974
|
app_key: AppKey,
|
|
2522
2975
|
/** Record files rewritten (title and titleSource only, each backed up first). */
|
|
2523
2976
|
written: nonNegInt,
|
|
@@ -2527,122 +2980,122 @@ var AppsChatsTitlesPushResult = import_zod30.z.strictObject({
|
|
|
2527
2980
|
/** Still different after the push (dry_run: would be written). */
|
|
2528
2981
|
chats_with_a_different_name: nonNegInt
|
|
2529
2982
|
});
|
|
2530
|
-
var AppsChatsOpenParams =
|
|
2531
|
-
var SpendSplit =
|
|
2532
|
-
var SpendScopes =
|
|
2533
|
-
var SpendAccount =
|
|
2534
|
-
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),
|
|
2535
2988
|
spend: SpendScopes,
|
|
2536
|
-
last_hour:
|
|
2537
|
-
last_5h:
|
|
2538
|
-
five_hour:
|
|
2539
|
-
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(),
|
|
2540
2993
|
as_of_ms: epochMs.nullable(),
|
|
2541
2994
|
weekly_resets_at_ms: epochMs.nullable(),
|
|
2542
2995
|
/** When the 5-hour or weekly limit is projected to be reached at the current burn. */
|
|
2543
2996
|
five_hour_full_at_ms: epochMs.nullable(),
|
|
2544
2997
|
weekly_full_at_ms: epochMs.nullable(),
|
|
2545
2998
|
/** The reading is too old to project. */
|
|
2546
|
-
stale:
|
|
2999
|
+
stale: import_zod31.z.boolean()
|
|
2547
3000
|
});
|
|
2548
|
-
var SpendModel =
|
|
2549
|
-
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({
|
|
2550
3003
|
id: ChatId,
|
|
2551
|
-
title:
|
|
2552
|
-
repo:
|
|
2553
|
-
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(),
|
|
2554
3007
|
spend: SpendScopes,
|
|
2555
3008
|
helpers: nonNegInt
|
|
2556
3009
|
});
|
|
2557
|
-
var SpendHelper =
|
|
2558
|
-
var SpendLive =
|
|
2559
|
-
var SpendIdleScope =
|
|
2560
|
-
var SpendIdle =
|
|
2561
|
-
var SpendStart =
|
|
2562
|
-
var SpendDay =
|
|
2563
|
-
var AppsSpendParams =
|
|
2564
|
-
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({
|
|
2565
3018
|
app_key: AppKey,
|
|
2566
3019
|
/** False while older chats are still being read. */
|
|
2567
|
-
complete:
|
|
2568
|
-
today_total:
|
|
2569
|
-
week_total:
|
|
2570
|
-
idle_today:
|
|
2571
|
-
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(),
|
|
2572
3025
|
/** Models with no known list price. */
|
|
2573
|
-
unpriced:
|
|
3026
|
+
unpriced: import_zod31.z.array(import_zod31.z.string().max(120)).max(100),
|
|
2574
3027
|
/** Helpers past their step budget, unusual starting sizes. */
|
|
2575
|
-
alarms:
|
|
2576
|
-
live:
|
|
2577
|
-
accounts:
|
|
2578
|
-
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),
|
|
2579
3032
|
/** (1.24) The last 7 days, oldest first (today last). */
|
|
2580
|
-
days:
|
|
2581
|
-
chats:
|
|
2582
|
-
idle:
|
|
2583
|
-
starts:
|
|
2584
|
-
});
|
|
2585
|
-
var AppsSyncStatusParams =
|
|
2586
|
-
var AppsSyncStatusResult =
|
|
2587
|
-
healthy:
|
|
2588
|
-
summary:
|
|
2589
|
-
problems:
|
|
2590
|
-
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),
|
|
2591
3044
|
/** Accounts seen with no saved name yet (Save account names fixes them). */
|
|
2592
|
-
unnamed_accounts:
|
|
3045
|
+
unnamed_accounts: import_zod31.z.array(import_zod31.z.string().max(80)).max(200),
|
|
2593
3046
|
/** The full report. */
|
|
2594
|
-
output:
|
|
2595
|
-
});
|
|
2596
|
-
var AppsSyncRunParams =
|
|
2597
|
-
var AppsWindowsProcessesParams =
|
|
2598
|
-
var AppsWindowsProcessesResult =
|
|
2599
|
-
var AppsWindowsAddParams =
|
|
2600
|
-
var AppsWindowsSaveNamesParams =
|
|
2601
|
-
var AppsWindowsUpdateStateParams =
|
|
2602
|
-
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({
|
|
2603
3056
|
app_key: AppKey,
|
|
2604
|
-
pending:
|
|
3057
|
+
pending: import_zod31.z.boolean(),
|
|
2605
3058
|
/** The downloaded release's name (Claude: "Claude 2.31226.1"), when the app's log names it. */
|
|
2606
|
-
version:
|
|
3059
|
+
version: import_zod31.z.string().max(120).nullable(),
|
|
2607
3060
|
/** When the update became pending (the download's time), when known. */
|
|
2608
3061
|
since_ms: epochMs.nullable(),
|
|
2609
3062
|
/** Windows open when the update became pending (or last seen open) that are closed now. */
|
|
2610
|
-
closed:
|
|
3063
|
+
closed: import_zod31.z.array(ChatPlace).max(200),
|
|
2611
3064
|
/**
|
|
2612
3065
|
* Since 1.27: the windows in `closed` that the update itself quit (the app's log records a quit for
|
|
2613
3066
|
* the update within a minute of when each was last seen running). Absent: not known.
|
|
2614
3067
|
*/
|
|
2615
|
-
closed_by_update:
|
|
3068
|
+
closed_by_update: import_zod31.z.array(ChatPlace).max(200).optional()
|
|
2616
3069
|
});
|
|
2617
|
-
var AppsWindowsReopenParams =
|
|
2618
|
-
var AppsWindowsReopenResult =
|
|
2619
|
-
var AppsWindowsUpdateAndReopenParams =
|
|
2620
|
-
var AppsWindowsUpdateAndReopenResult =
|
|
2621
|
-
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),
|
|
2622
3075
|
/** Windows quit (with dry_run: to be quit). */
|
|
2623
|
-
quit:
|
|
3076
|
+
quit: import_zod31.z.array(ChatPlace).max(200),
|
|
2624
3077
|
/** Windows reopened (with dry_run: to be reopened), main first. */
|
|
2625
|
-
reopened:
|
|
3078
|
+
reopened: import_zod31.z.array(ChatPlace).max(200),
|
|
2626
3079
|
/** The version installed, null when the install did not happen (or dry_run). */
|
|
2627
|
-
installed_version:
|
|
3080
|
+
installed_version: import_zod31.z.string().max(64).nullable()
|
|
2628
3081
|
});
|
|
2629
3082
|
|
|
2630
3083
|
// src/schema/browser.ts
|
|
2631
|
-
var
|
|
2632
|
-
var BrowserClientInstance =
|
|
2633
|
-
var BrowserKind =
|
|
2634
|
-
var BrowserSessionState =
|
|
2635
|
-
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({
|
|
2636
3089
|
client_instance: BrowserClientInstance,
|
|
2637
3090
|
/** What the person sees ("Chrome — Work"), set by the extension. */
|
|
2638
|
-
client_label:
|
|
3091
|
+
client_label: import_zod32.z.string().min(1).max(128),
|
|
2639
3092
|
browser: BrowserKind,
|
|
2640
|
-
extension_version:
|
|
3093
|
+
extension_version: import_zod32.z.string().min(1).max(32),
|
|
2641
3094
|
state: BrowserSessionState,
|
|
2642
3095
|
/** True only for `connected`: an agent's call can reach this session. */
|
|
2643
|
-
routable:
|
|
3096
|
+
routable: import_zod32.z.boolean(),
|
|
2644
3097
|
/** The extension's account email from its token (null when signed out or unknown). */
|
|
2645
|
-
account_email:
|
|
3098
|
+
account_email: import_zod32.z.string().max(320).nullable(),
|
|
2646
3099
|
connected_at_ms: epochMs,
|
|
2647
3100
|
last_call_at_ms: epochMs.nullable(),
|
|
2648
3101
|
calls: nonNegInt,
|
|
@@ -2651,84 +3104,688 @@ var BrowserSession = import_zod31.z.strictObject({
|
|
|
2651
3104
|
p50_ms: nonNegInt.nullable(),
|
|
2652
3105
|
p95_ms: nonNegInt.nullable(),
|
|
2653
3106
|
/** A call is waiting for the person to confirm it in the browser. */
|
|
2654
|
-
awaiting_confirmation:
|
|
3107
|
+
awaiting_confirmation: import_zod32.z.boolean()
|
|
2655
3108
|
});
|
|
2656
|
-
var BrowserRegisterParams =
|
|
3109
|
+
var BrowserRegisterParams = import_zod32.z.strictObject({
|
|
2657
3110
|
client_instance: BrowserClientInstance,
|
|
2658
|
-
client_label:
|
|
3111
|
+
client_label: import_zod32.z.string().min(1).max(128),
|
|
2659
3112
|
browser: BrowserKind,
|
|
2660
|
-
extension_version:
|
|
3113
|
+
extension_version: import_zod32.z.string().min(1).max(32),
|
|
2661
3114
|
/** The extension's current AI Matrx access token, checked against the device owner; null when signed out. */
|
|
2662
|
-
account_token:
|
|
3115
|
+
account_token: import_zod32.z.string().min(16).max(8192).nullable()
|
|
2663
3116
|
});
|
|
2664
|
-
var BrowserRegisterResult =
|
|
2665
|
-
var BrowserCallError =
|
|
2666
|
-
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),
|
|
2667
3120
|
/** The extension's own error code, when it has one ("tool_not_found", "denied"). */
|
|
2668
|
-
code:
|
|
3121
|
+
code: import_zod32.z.string().max(64).nullable()
|
|
2669
3122
|
});
|
|
2670
|
-
var BrowserResultParams =
|
|
2671
|
-
call_id:
|
|
2672
|
-
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(),
|
|
2673
3126
|
/** The tool's result when ok (any JSON). */
|
|
2674
|
-
result:
|
|
3127
|
+
result: import_zod32.z.unknown(),
|
|
2675
3128
|
error: BrowserCallError.nullable()
|
|
2676
3129
|
});
|
|
2677
|
-
var BrowserResultResult =
|
|
2678
|
-
var BrowserCallPhase =
|
|
2679
|
-
var BrowserProgressParams =
|
|
2680
|
-
var BrowserProgressResult =
|
|
2681
|
-
var BrowserSessionsParams =
|
|
2682
|
-
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({
|
|
2683
3136
|
/** The person's Browser connection switch. Off: no pairing, no extension sessions. */
|
|
2684
|
-
enabled:
|
|
3137
|
+
enabled: import_zod32.z.boolean(),
|
|
2685
3138
|
/** Whether Matrx 2 is signed in (without an owner no session is routable). */
|
|
2686
|
-
owner_signed_in:
|
|
2687
|
-
sessions:
|
|
2688
|
-
});
|
|
2689
|
-
var BrowserDisconnectParams =
|
|
2690
|
-
var BrowserDisconnectResult =
|
|
2691
|
-
var BrowserSetEnabledParams =
|
|
2692
|
-
var BrowserSetEnabledResult =
|
|
2693
|
-
var BrowserPairCodeParams =
|
|
2694
|
-
var BrowserPairCodeResult =
|
|
2695
|
-
var BrowserPairResetParams =
|
|
2696
|
-
var BrowserCallParams =
|
|
2697
|
-
tool:
|
|
2698
|
-
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()),
|
|
2699
3152
|
/** Which session; default: the most recently active routable one (BROWSER ambiguity → CONFLICT). */
|
|
2700
3153
|
client_instance: BrowserClientInstance.optional(),
|
|
2701
3154
|
/** How long to wait, including a person's confirmation; default 120 s. */
|
|
2702
|
-
timeout_ms:
|
|
3155
|
+
timeout_ms: import_zod32.z.int().min(1e3).max(6e5).optional()
|
|
2703
3156
|
});
|
|
2704
|
-
var BrowserCallResult =
|
|
3157
|
+
var BrowserCallResult = import_zod32.z.strictObject({
|
|
2705
3158
|
client_instance: BrowserClientInstance,
|
|
2706
|
-
result:
|
|
3159
|
+
result: import_zod32.z.unknown(),
|
|
2707
3160
|
duration_ms: nonNegInt
|
|
2708
3161
|
});
|
|
2709
|
-
var
|
|
2710
|
-
|
|
2711
|
-
tool:
|
|
2712
|
-
|
|
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),
|
|
3165
|
+
calls: nonNegInt,
|
|
3166
|
+
errors: nonNegInt,
|
|
3167
|
+
/** Over the last 200 answered calls; null before the first answer. */
|
|
3168
|
+
p50_ms: nonNegInt.nullable(),
|
|
3169
|
+
p95_ms: nonNegInt.nullable(),
|
|
3170
|
+
last_call_at_ms: epochMs.nullable(),
|
|
3171
|
+
last_error: import_zod32.z.string().max(2048).nullable()
|
|
3172
|
+
});
|
|
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({
|
|
3177
|
+
/** Only messages after this seq (0: from the oldest kept; the core keeps the last 500). */
|
|
3178
|
+
after_seq: nonNegInt.default(0),
|
|
3179
|
+
limit: import_zod32.z.int().min(1).max(500).default(500)
|
|
3180
|
+
});
|
|
3181
|
+
var BrowserLogMessage = import_zod32.z.strictObject({
|
|
3182
|
+
seq: nonNegInt,
|
|
3183
|
+
at_ms: epochMs,
|
|
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),
|
|
3194
|
+
/** The newest seq the core has written (pass it back as after_seq to follow the log). */
|
|
3195
|
+
last_seq: nonNegInt
|
|
3196
|
+
});
|
|
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()),
|
|
2713
3201
|
deadline_ms: epochMs
|
|
2714
3202
|
});
|
|
2715
|
-
var BrowserSessionsChangedEvent =
|
|
2716
|
-
var BrowserProgressEvent =
|
|
2717
|
-
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),
|
|
2718
3206
|
client_instance: BrowserClientInstance,
|
|
2719
3207
|
phase: BrowserCallPhase
|
|
2720
3208
|
});
|
|
2721
|
-
var DesktopHealth =
|
|
2722
|
-
status:
|
|
2723
|
-
service:
|
|
2724
|
-
version:
|
|
2725
|
-
protocol_version:
|
|
2726
|
-
ws_path:
|
|
2727
|
-
device_id:
|
|
2728
|
-
browser_connection:
|
|
2729
|
-
});
|
|
2730
|
-
var BrowserPairRequest =
|
|
2731
|
-
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") });
|
|
3220
|
+
|
|
3221
|
+
// src/schema/net.ts
|
|
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(),
|
|
3228
|
+
/** CIDR form ("192.168.1.20/24"); null where the OS gives no prefix. */
|
|
3229
|
+
cidr: import_zod33.z.string().nullable()
|
|
3230
|
+
});
|
|
3231
|
+
var NetInterface = import_zod33.z.strictObject({
|
|
3232
|
+
name: import_zod33.z.string(),
|
|
3233
|
+
mac: import_zod33.z.string().nullable(),
|
|
3234
|
+
/** Loopback and other internal interfaces. */
|
|
3235
|
+
internal: import_zod33.z.boolean(),
|
|
3236
|
+
addresses: import_zod33.z.array(NetAddress)
|
|
3237
|
+
});
|
|
3238
|
+
var NetInfoResult = import_zod33.z.strictObject({
|
|
3239
|
+
hostname: import_zod33.z.string(),
|
|
3240
|
+
interfaces: import_zod33.z.array(NetInterface),
|
|
3241
|
+
/** The default route's gateway; null when the OS does not say (or there is none). */
|
|
3242
|
+
gateway: import_zod33.z.string().nullable(),
|
|
3243
|
+
/** The DNS servers the OS uses; empty when it does not say. */
|
|
3244
|
+
dns: import_zod33.z.array(import_zod33.z.string())
|
|
3245
|
+
});
|
|
3246
|
+
var NetWifiParams = import_zod33.z.strictObject({});
|
|
3247
|
+
var NetWifiNetwork = import_zod33.z.strictObject({
|
|
3248
|
+
/** null: the OS hides the name (macOS without Location Services for this app). */
|
|
3249
|
+
ssid: import_zod33.z.string().nullable(),
|
|
3250
|
+
/** dBm; null where the OS does not say. */
|
|
3251
|
+
rssi: import_zod33.z.int().nullable(),
|
|
3252
|
+
channel: import_zod33.z.string().nullable(),
|
|
3253
|
+
security: import_zod33.z.string().nullable()
|
|
3254
|
+
});
|
|
3255
|
+
var NetWifiResult = import_zod33.z.strictObject({
|
|
3256
|
+
/** Whether the computer has a Wi-Fi interface at all. */
|
|
3257
|
+
available: import_zod33.z.boolean(),
|
|
3258
|
+
/** The network the computer is on; null when it is on none. */
|
|
3259
|
+
current: NetWifiNetwork.nullable(),
|
|
3260
|
+
/** Networks in range (may be empty where the OS lists none to apps). */
|
|
3261
|
+
networks: import_zod33.z.array(NetWifiNetwork)
|
|
3262
|
+
});
|
|
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(),
|
|
3268
|
+
/** What it is, in the OS's words ("Headphones", "Keyboard"); null where it does not say. */
|
|
3269
|
+
kind: import_zod33.z.string().nullable(),
|
|
3270
|
+
/** Battery percent, where the OS reports it. */
|
|
3271
|
+
battery: import_zod33.z.int().min(0).max(100).nullable()
|
|
3272
|
+
});
|
|
3273
|
+
var NetBluetoothResult = import_zod33.z.strictObject({
|
|
3274
|
+
/** Bluetooth is on; null where the OS does not say. */
|
|
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(),
|
|
3283
|
+
/** The name the local network gives it (reverse DNS / mDNS), when the table carries one. */
|
|
3284
|
+
hostname: import_zod33.z.string().nullable()
|
|
3285
|
+
});
|
|
3286
|
+
var NetDevicesResult = import_zod33.z.strictObject({ devices: import_zod33.z.array(NetDevice) });
|
|
3287
|
+
var NetMdnsParams = import_zod33.z.strictObject({
|
|
3288
|
+
/** A service type ("_http._tcp"); absent lists the service types found. */
|
|
3289
|
+
service_type: import_zod33.z.string().min(1).max(64).regex(/^_[A-Za-z0-9-]+\._(tcp|udp)$/).optional(),
|
|
3290
|
+
/** How long to listen. */
|
|
3291
|
+
timeout_s: import_zod33.z.int().min(1).max(30).default(3)
|
|
3292
|
+
});
|
|
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()
|
|
3298
|
+
});
|
|
3299
|
+
var NetMdnsResult = import_zod33.z.strictObject({ services: import_zod33.z.array(NetMdnsService) });
|
|
3300
|
+
var NetScanParams = import_zod33.z.strictObject({
|
|
3301
|
+
/** A host name or address; a private or loopback address unless `allow_public`. */
|
|
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),
|
|
3305
|
+
/** Scanning a host on the public internet needs saying so. */
|
|
3306
|
+
allow_public: import_zod33.z.boolean().default(false)
|
|
3307
|
+
});
|
|
3308
|
+
var NetScanResult = import_zod33.z.strictObject({
|
|
3309
|
+
host: import_zod33.z.string(),
|
|
3310
|
+
/** The address the host resolved to. */
|
|
3311
|
+
address: import_zod33.z.string(),
|
|
3312
|
+
open: import_zod33.z.array(import_zod33.z.int().min(1).max(65535)),
|
|
3313
|
+
closed: nonNegInt,
|
|
3314
|
+
elapsed_ms: nonNegInt
|
|
3315
|
+
});
|
|
3316
|
+
var NetDownloadParams = import_zod33.z.strictObject({
|
|
3317
|
+
url: import_zod33.z.string().min(1).max(8192).regex(/^https?:\/\//),
|
|
3318
|
+
/** Where to save it: an absolute path (a folder keeps the URL's file name). */
|
|
3319
|
+
path: AbsPath,
|
|
3320
|
+
overwrite: import_zod33.z.boolean().default(false),
|
|
3321
|
+
timeout_s: import_zod33.z.int().min(1).max(3600).default(300),
|
|
3322
|
+
/** Refuse anything larger. */
|
|
3323
|
+
max_bytes: import_zod33.z.int().min(1).max(10737418240).default(2147483648)
|
|
3324
|
+
});
|
|
3325
|
+
var NetDownloadResult = import_zod33.z.strictObject({
|
|
3326
|
+
path: import_zod33.z.string(),
|
|
3327
|
+
bytes: nonNegInt,
|
|
3328
|
+
content_type: import_zod33.z.string().nullable(),
|
|
3329
|
+
/** The final URL after redirects. */
|
|
3330
|
+
url: import_zod33.z.string(),
|
|
3331
|
+
elapsed_ms: nonNegInt
|
|
3332
|
+
});
|
|
3333
|
+
|
|
3334
|
+
// src/schema/personal.ts
|
|
3335
|
+
var import_zod34 = require("zod");
|
|
3336
|
+
var Text = import_zod34.z.string().max(65536);
|
|
3337
|
+
var AutomationScriptParams = import_zod34.z.strictObject({
|
|
3338
|
+
/** applescript and jxa: macOS (osascript); powershell: Windows (and pwsh where installed). */
|
|
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(),
|
|
3348
|
+
/** stdout or stderr was cut at 1 MiB. */
|
|
3349
|
+
truncated: import_zod34.z.boolean(),
|
|
3350
|
+
elapsed_ms: nonNegInt
|
|
3351
|
+
});
|
|
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({
|
|
3356
|
+
/** The account's name in Mail; absent: every account. */
|
|
3357
|
+
account: import_zod34.z.string().min(1).max(256).optional(),
|
|
3358
|
+
/** The mailbox's name ("INBOX", "Sent Messages"). */
|
|
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(),
|
|
3367
|
+
received_at_ms: epochMs.nullable(),
|
|
3368
|
+
read: import_zod34.z.boolean(),
|
|
3369
|
+
account: import_zod34.z.string(),
|
|
3370
|
+
mailbox: import_zod34.z.string(),
|
|
3371
|
+
/** The first lines of the message's text. */
|
|
3372
|
+
preview: import_zod34.z.string()
|
|
3373
|
+
});
|
|
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),
|
|
3379
|
+
body: Text,
|
|
3380
|
+
/** The sending account's address; absent: Mail's default. */
|
|
3381
|
+
from: import_zod34.z.string().min(3).max(320).optional(),
|
|
3382
|
+
/** false leaves it open in Mail as a draft for the person to send. */
|
|
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()),
|
|
3391
|
+
last_message_at_ms: epochMs.nullable(),
|
|
3392
|
+
service: import_zod34.z.string().nullable()
|
|
3393
|
+
});
|
|
3394
|
+
var MessagesChatsResult = import_zod34.z.strictObject({ chats: import_zod34.z.array(MessagesChat) });
|
|
3395
|
+
var MessagesListParams = import_zod34.z.strictObject({
|
|
3396
|
+
/** One chat (messages.chats' chat_id); absent: the newest across all. */
|
|
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(),
|
|
3405
|
+
/** The other person's handle (phone or email); null for the person's own messages. */
|
|
3406
|
+
sender: import_zod34.z.string().nullable(),
|
|
3407
|
+
sent_at_ms: epochMs.nullable()
|
|
3408
|
+
});
|
|
3409
|
+
var MessagesListResult = import_zod34.z.strictObject({ messages: import_zod34.z.array(MessagesMessage) });
|
|
3410
|
+
var MessagesSendParams = import_zod34.z.strictObject({
|
|
3411
|
+
/** A phone number or email the person can message. */
|
|
3412
|
+
to: import_zod34.z.string().min(3).max(320),
|
|
3413
|
+
text: import_zod34.z.string().min(1).max(2e4)
|
|
3414
|
+
});
|
|
3415
|
+
var MessagesSendResult = import_zod34.z.strictObject({ sent: import_zod34.z.boolean() });
|
|
3416
|
+
var ContactsSearchParams = import_zod34.z.strictObject({
|
|
3417
|
+
/** Matched against names, organizations, emails and phone numbers. */
|
|
3418
|
+
query: import_zod34.z.string().min(1).max(256),
|
|
3419
|
+
limit: import_zod34.z.int().min(1).max(200).default(25)
|
|
3420
|
+
});
|
|
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({
|
|
3444
|
+
from_ms: epochMs,
|
|
3445
|
+
to_ms: epochMs,
|
|
3446
|
+
/** One calendar's name; absent: every calendar. */
|
|
3447
|
+
calendar: import_zod34.z.string().min(1).max(256).optional(),
|
|
3448
|
+
limit: import_zod34.z.int().min(1).max(500).default(100)
|
|
3449
|
+
});
|
|
3450
|
+
var CalendarEvent = import_zod34.z.strictObject({
|
|
3451
|
+
id: import_zod34.z.string(),
|
|
3452
|
+
title: import_zod34.z.string(),
|
|
3453
|
+
start_ms: epochMs,
|
|
3454
|
+
end_ms: epochMs,
|
|
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),
|
|
3463
|
+
start_ms: epochMs,
|
|
3464
|
+
end_ms: epochMs,
|
|
3465
|
+
all_day: import_zod34.z.boolean().default(false),
|
|
3466
|
+
/** The calendar's name; absent: the first writable calendar. */
|
|
3467
|
+
calendar: import_zod34.z.string().min(1).max(256).optional(),
|
|
3468
|
+
location: import_zod34.z.string().max(1024).optional(),
|
|
3469
|
+
notes: Text.optional()
|
|
3470
|
+
});
|
|
3471
|
+
var CalendarCreateResult = import_zod34.z.strictObject({ id: import_zod34.z.string(), calendar: import_zod34.z.string() });
|
|
3472
|
+
var RemindersListParams = import_zod34.z.strictObject({
|
|
3473
|
+
/** One list's name; absent: every 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(),
|
|
3482
|
+
due_ms: epochMs.nullable(),
|
|
3483
|
+
completed: import_zod34.z.boolean(),
|
|
3484
|
+
notes: import_zod34.z.string().nullable()
|
|
3485
|
+
});
|
|
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),
|
|
3489
|
+
due_ms: epochMs.optional(),
|
|
3490
|
+
list: import_zod34.z.string().min(1).max(256).optional(),
|
|
3491
|
+
notes: Text.optional()
|
|
3492
|
+
});
|
|
3493
|
+
var RemindersCreateResult = import_zod34.z.strictObject({ id: import_zod34.z.string(), list: import_zod34.z.string() });
|
|
3494
|
+
var PhotosSearchParams = import_zod34.z.strictObject({
|
|
3495
|
+
/** Matched against file names, titles, descriptions and keywords; absent: the newest. */
|
|
3496
|
+
query: import_zod34.z.string().min(1).max(256).optional(),
|
|
3497
|
+
from_ms: epochMs.optional(),
|
|
3498
|
+
to_ms: epochMs.optional(),
|
|
3499
|
+
favorites_only: import_zod34.z.boolean().default(false),
|
|
3500
|
+
limit: import_zod34.z.int().min(1).max(200).default(25)
|
|
3501
|
+
});
|
|
3502
|
+
var Photo = import_zod34.z.strictObject({
|
|
3503
|
+
id: import_zod34.z.string(),
|
|
3504
|
+
filename: import_zod34.z.string(),
|
|
3505
|
+
taken_at_ms: epochMs.nullable(),
|
|
3506
|
+
width: nonNegInt.nullable(),
|
|
3507
|
+
height: nonNegInt.nullable(),
|
|
3508
|
+
favorite: import_zod34.z.boolean(),
|
|
3509
|
+
title: import_zod34.z.string().nullable()
|
|
3510
|
+
});
|
|
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),
|
|
3514
|
+
/** Copy the original into a folder Matrx 2 owns and answer its path (then fs_read or desktop_documents reads it). */
|
|
3515
|
+
export: import_zod34.z.boolean().default(false)
|
|
3516
|
+
});
|
|
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),
|
|
3522
|
+
/** Metres; null where the OS does not say. */
|
|
3523
|
+
accuracy_m: import_zod34.z.number().min(0).nullable(),
|
|
3524
|
+
at_ms: epochMs,
|
|
3525
|
+
/** Who answered: the OS's own location service. */
|
|
3526
|
+
source: import_zod34.z.enum(["corelocation", "windows", "geoclue"])
|
|
3527
|
+
});
|
|
3528
|
+
|
|
3529
|
+
// src/schema/windows.ts
|
|
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({
|
|
3534
|
+
key: RegistryKey,
|
|
3535
|
+
/** One value's name ("" is the key's default value); absent: every value and the subkeys. */
|
|
3536
|
+
name: import_zod35.z.string().max(16383).optional()
|
|
3537
|
+
});
|
|
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())
|
|
3544
|
+
});
|
|
3545
|
+
var WindowsRegistryWriteParams = import_zod35.z.strictObject({
|
|
3546
|
+
key: RegistryKey,
|
|
3547
|
+
name: import_zod35.z.string().max(16383),
|
|
3548
|
+
type: RegistryValueType.default("REG_SZ"),
|
|
3549
|
+
/** As reg.exe takes it: text, a number, hex for binary, \\0 between the strings of a multi-string. */
|
|
3550
|
+
data: import_zod35.z.string().max(1048576),
|
|
3551
|
+
/** Remove the value instead of writing it. */
|
|
3552
|
+
delete: import_zod35.z.boolean().default(false)
|
|
3553
|
+
});
|
|
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({
|
|
3556
|
+
/** Matched against the service's name and display name. */
|
|
3557
|
+
filter: import_zod35.z.string().min(1).max(256).optional(),
|
|
3558
|
+
limit: import_zod35.z.int().min(1).max(1e3).default(200)
|
|
3559
|
+
});
|
|
3560
|
+
var WindowsService = import_zod35.z.strictObject({
|
|
3561
|
+
name: import_zod35.z.string(),
|
|
3562
|
+
display_name: import_zod35.z.string(),
|
|
3563
|
+
/** Running, Stopped, Paused… as Windows says it. */
|
|
3564
|
+
status: import_zod35.z.string(),
|
|
3565
|
+
/** Automatic, Manual, Disabled…; null where Windows does not say. */
|
|
3566
|
+
start_type: import_zod35.z.string().nullable()
|
|
3567
|
+
});
|
|
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"])
|
|
3572
|
+
});
|
|
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"),
|
|
3576
|
+
/** Only these levels; absent: all. */
|
|
3577
|
+
levels: import_zod35.z.array(import_zod35.z.enum(["critical", "error", "warning", "information", "verbose"])).max(5).optional(),
|
|
3578
|
+
since_ms: epochMs.optional(),
|
|
3579
|
+
limit: import_zod35.z.int().min(1).max(500).default(50)
|
|
3580
|
+
});
|
|
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(),
|
|
3585
|
+
at_ms: epochMs,
|
|
3586
|
+
message: import_zod35.z.string()
|
|
3587
|
+
});
|
|
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) });
|
|
3592
|
+
|
|
3593
|
+
// src/schema/schedule.ts
|
|
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),
|
|
3598
|
+
op: OpRef,
|
|
3599
|
+
/** The op's params, exactly as the op takes them; checked when the task is created. */
|
|
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),
|
|
3602
|
+
/** Stop after this many runs; absent: until cancelled. */
|
|
3603
|
+
max_runs: import_zod36.z.int().min(1).max(1e5).optional(),
|
|
3604
|
+
/** Run once now, before the first interval. */
|
|
3605
|
+
run_now: import_zod36.z.boolean().default(false)
|
|
3606
|
+
});
|
|
3607
|
+
var ScheduleRun = import_zod36.z.strictObject({
|
|
3608
|
+
at_ms: epochMs,
|
|
3609
|
+
ok: import_zod36.z.boolean(),
|
|
3610
|
+
elapsed_ms: nonNegInt,
|
|
3611
|
+
/** The error's code and message when the run failed. */
|
|
3612
|
+
error: import_zod36.z.string().nullable(),
|
|
3613
|
+
/** The start of the answer, as JSON (cut at 4 KiB). */
|
|
3614
|
+
result_preview: import_zod36.z.string().nullable()
|
|
3615
|
+
});
|
|
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()),
|
|
3621
|
+
interval_s: nonNegInt,
|
|
3622
|
+
max_runs: nonNegInt.nullable(),
|
|
3623
|
+
runs: nonNegInt,
|
|
3624
|
+
created_at_ms: epochMs,
|
|
3625
|
+
next_run_at_ms: epochMs.nullable(),
|
|
3626
|
+
/** active, done (ran max_runs), cancelled. */
|
|
3627
|
+
state: import_zod36.z.enum(["active", "done", "cancelled"]),
|
|
3628
|
+
/** The newest runs, newest first (at most 10). */
|
|
3629
|
+
recent: import_zod36.z.array(ScheduleRun)
|
|
3630
|
+
});
|
|
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 });
|
|
3636
|
+
|
|
3637
|
+
// src/schema/notes.ts
|
|
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({
|
|
3644
|
+
/** The notes root on this computer. */
|
|
3645
|
+
root: import_zod37.z.string(),
|
|
3646
|
+
folders: import_zod37.z.array(NotesFolder)
|
|
3647
|
+
});
|
|
3648
|
+
var NotesListParams = import_zod37.z.strictObject({
|
|
3649
|
+
folder: NoteFolder.optional(),
|
|
3650
|
+
limit: import_zod37.z.int().min(1).max(2e3).default(500)
|
|
3651
|
+
});
|
|
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(),
|
|
3656
|
+
bytes: nonNegInt,
|
|
3657
|
+
modified_at_ms: epochMs
|
|
3658
|
+
});
|
|
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(),
|
|
3664
|
+
bytes: nonNegInt,
|
|
3665
|
+
modified_at_ms: epochMs,
|
|
3666
|
+
/** SHA-256 of the content: pass it back as `if_hash` to write only over this version. */
|
|
3667
|
+
hash: import_zod37.z.string()
|
|
3668
|
+
});
|
|
3669
|
+
var NotesWriteParams = import_zod37.z.strictObject({
|
|
3670
|
+
folder: NoteFolder.default("General"),
|
|
3671
|
+
/** The note's name, without ".md". */
|
|
3672
|
+
label: import_zod37.z.string().min(1).max(200).regex(/^[^/\\:*?"<>|]+$/),
|
|
3673
|
+
content: import_zod37.z.string().max(10485760),
|
|
3674
|
+
/** Write only when the note is still this version (notes.read's hash); a change since answers CONFLICT. */
|
|
3675
|
+
if_hash: import_zod37.z.string().length(64).optional()
|
|
3676
|
+
});
|
|
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)
|
|
3681
|
+
});
|
|
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(),
|
|
3686
|
+
/** The matching lines (at most five), trimmed. */
|
|
3687
|
+
lines: import_zod37.z.array(import_zod37.z.string())
|
|
3688
|
+
});
|
|
3689
|
+
var NotesSearchResult = import_zod37.z.strictObject({ matches: import_zod37.z.array(NotesMatch), total: nonNegInt });
|
|
3690
|
+
|
|
3691
|
+
// src/schema/documents.ts
|
|
3692
|
+
var import_zod38 = require("zod");
|
|
3693
|
+
var DOCUMENTS_MAX_TEXT_CHARS = 1048576;
|
|
3694
|
+
var DocumentsPdfTextParams = import_zod38.z.strictObject({
|
|
3695
|
+
path: AbsPath,
|
|
3696
|
+
/** 1-based, inclusive. */
|
|
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)
|
|
3700
|
+
});
|
|
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({
|
|
3703
|
+
pages: nonNegInt,
|
|
3704
|
+
/** Each page read, in order (an image-only page has empty text: OCR it). */
|
|
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()
|
|
3709
|
+
});
|
|
3710
|
+
var DocumentsOcrParams = import_zod38.z.strictObject({
|
|
3711
|
+
path: AbsPath,
|
|
3712
|
+
/** BCP-47 language hints ("en-US", "fr-FR"); absent: the OS's own choice. */
|
|
3713
|
+
languages: import_zod38.z.array(import_zod38.z.string().min(2).max(16)).max(8).optional(),
|
|
3714
|
+
/** Faster, less accurate. */
|
|
3715
|
+
fast: import_zod38.z.boolean().default(false)
|
|
3716
|
+
});
|
|
3717
|
+
var DocumentsOcrLine = import_zod38.z.strictObject({
|
|
3718
|
+
text: import_zod38.z.string(),
|
|
3719
|
+
/** 0–1; null where the engine does not say. */
|
|
3720
|
+
confidence: import_zod38.z.number().min(0).max(1).nullable()
|
|
3721
|
+
});
|
|
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(),
|
|
3726
|
+
/** Which engine read it ("vision" on macOS, "windows-ocr", "tesseract"). */
|
|
3727
|
+
engine: import_zod38.z.string()
|
|
3728
|
+
});
|
|
3729
|
+
var DocumentsImageResizeParams = import_zod38.z.strictObject({
|
|
3730
|
+
path: AbsPath,
|
|
3731
|
+
/** Where to write it; absent: next to the original, "<name>-resized.<ext>". */
|
|
3732
|
+
out_path: AbsPath.optional(),
|
|
3733
|
+
/** The longest side, kept in proportion; absent: the size stays (a format change only). */
|
|
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)
|
|
3737
|
+
});
|
|
3738
|
+
var DocumentsImageResizeResult = import_zod38.z.strictObject({
|
|
3739
|
+
path: import_zod38.z.string(),
|
|
3740
|
+
width: nonNegInt,
|
|
3741
|
+
height: nonNegInt,
|
|
3742
|
+
bytes: nonNegInt
|
|
3743
|
+
});
|
|
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)
|
|
3747
|
+
});
|
|
3748
|
+
var DocumentsSheet = import_zod38.z.strictObject({
|
|
3749
|
+
name: import_zod38.z.string().min(1).max(31),
|
|
3750
|
+
/** Rows of cells; the first row is the header when `header` is true. */
|
|
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)
|
|
3753
|
+
});
|
|
3754
|
+
var DocumentsOfficeGenerateParams = import_zod38.z.strictObject({
|
|
3755
|
+
kind: import_zod38.z.enum(["docx", "xlsx"]),
|
|
3756
|
+
path: AbsPath,
|
|
3757
|
+
title: import_zod38.z.string().max(1024).optional(),
|
|
3758
|
+
/** docx: the document's paragraphs, in order. */
|
|
3759
|
+
paragraphs: import_zod38.z.array(DocumentsParagraph).max(5e4).optional(),
|
|
3760
|
+
/** xlsx: the workbook's sheets, in order. */
|
|
3761
|
+
sheets: import_zod38.z.array(DocumentsSheet).min(1).max(64).optional(),
|
|
3762
|
+
overwrite: import_zod38.z.boolean().default(false)
|
|
3763
|
+
});
|
|
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),
|
|
3767
|
+
/** Which kinds to keep; absent: all three. */
|
|
3768
|
+
labels: import_zod38.z.array(import_zod38.z.enum(["person", "place", "organization"])).min(1).max(3).optional()
|
|
3769
|
+
});
|
|
3770
|
+
var EntitySpan = import_zod38.z.strictObject({
|
|
3771
|
+
text: import_zod38.z.string(),
|
|
3772
|
+
label: import_zod38.z.string(),
|
|
3773
|
+
/** Character offsets into the text (UTF-16, as JavaScript counts). */
|
|
3774
|
+
start: nonNegInt,
|
|
3775
|
+
end: nonNegInt
|
|
3776
|
+
});
|
|
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(),
|
|
3782
|
+
/** Also answer the text with each finding replaced by its kind ("[email]"). */
|
|
3783
|
+
redact: import_zod38.z.boolean().default(false)
|
|
3784
|
+
});
|
|
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()
|
|
3788
|
+
});
|
|
2732
3789
|
|
|
2733
3790
|
// src/schema/registry.ts
|
|
2734
3791
|
var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
|
|
@@ -2861,6 +3918,36 @@ var OPS = {
|
|
|
2861
3918
|
"apps.windows.shown": { params: AppsWindowsShownParams, result: AppsWindowsShownResult, kind: "unary", since: "1.21", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2862
3919
|
// Claude Code history (SPEC §6 coding): served by the `coding` Python service through SERVICES below.
|
|
2863
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"] },
|
|
2864
3951
|
// 1.22: git for agents (core `git`, the system git; the cloud sandbox's /git/* set, SPEC 6.1).
|
|
2865
3952
|
"git.status": { params: GitStatusParams, result: GitStatusResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2866
3953
|
"git.diff": { params: GitDiffParams, result: GitDiffResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
@@ -2881,6 +3968,10 @@ var OPS = {
|
|
|
2881
3968
|
"account.agents.list": { params: AccountAgentsListParams, result: AccountAgentsListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
|
|
2882
3969
|
"account.vault.list": { params: AccountVaultListParams, result: AccountVaultListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
|
|
2883
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"] },
|
|
2884
3975
|
// 1.26: the app's own update (it installs only once every window quit) and bringing the windows back.
|
|
2885
3976
|
"apps.windows.update_state": { params: AppsWindowsUpdateStateParams, result: AppsWindowsUpdateStateResult, kind: "unary", since: "1.26", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2886
3977
|
"apps.windows.reopen": { params: AppsWindowsReopenParams, result: AppsWindowsReopenResult, kind: "unary", since: "1.26", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
@@ -2894,7 +3985,55 @@ var OPS = {
|
|
|
2894
3985
|
"browser.set_enabled": { params: BrowserSetEnabledParams, result: BrowserSetEnabledResult, kind: "unary", since: "1.28", errors: ["AUTH_FORBIDDEN", "INTERNAL"] },
|
|
2895
3986
|
"browser.pair_code": { params: BrowserPairCodeParams, result: BrowserPairCodeResult, kind: "unary", since: "1.28", errors: ["AUTH_FORBIDDEN", "INTERNAL"] },
|
|
2896
3987
|
"browser.pair_reset": { params: BrowserPairResetParams, result: BrowserPairCodeResult, kind: "unary", since: "1.28", errors: ["AUTH_FORBIDDEN", "INTERNAL"] },
|
|
2897
|
-
"browser.
|
|
3988
|
+
"browser.tool_metrics": { params: BrowserToolMetricsParams, result: BrowserToolMetricsResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS"] },
|
|
3989
|
+
"browser.reset_counters": { params: BrowserResetCountersParams, result: BrowserResetCountersResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS"] },
|
|
3990
|
+
"browser.log": { params: BrowserLogParams, result: BrowserLogResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS"] },
|
|
3991
|
+
"browser.call": { params: BrowserCallParams, result: BrowserCallResult, kind: "unary", since: "1.28", errors: ["NOT_FOUND", "CONFLICT", "AUTH_FORBIDDEN", "INVALID_PARAMS", "TIMEOUT", "CANCELLED", "RESOURCE_GONE", "PAYLOAD_TOO_LARGE", "INTERNAL"] },
|
|
3992
|
+
// 1.37: Matrx Local's remaining sidecar tools in the core (net, automation, the person's apps,
|
|
3993
|
+
// Windows administration, schedules, local notes, documents and entities).
|
|
3994
|
+
"net.info": { params: NetInfoParams, result: NetInfoResult, kind: "unary", since: "1.37", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
3995
|
+
"net.wifi": { params: NetWifiParams, result: NetWifiResult, kind: "unary", since: "1.37", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
3996
|
+
"net.bluetooth": { params: NetBluetoothParams, result: NetBluetoothResult, kind: "unary", since: "1.37", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
3997
|
+
"net.devices": { params: NetDevicesParams, result: NetDevicesResult, kind: "unary", since: "1.37", errors: ["PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
3998
|
+
"net.mdns": { params: NetMdnsParams, result: NetMdnsResult, kind: "unary", since: "1.37", errors: ["PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
3999
|
+
"net.scan": { params: NetScanParams, result: NetScanResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "AUTH_FORBIDDEN", "TIMEOUT", "INTERNAL"] },
|
|
4000
|
+
"net.download": { params: NetDownloadParams, result: NetDownloadResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "CONFLICT", "PERMISSION_DENIED_OS", "PAYLOAD_TOO_LARGE", "TIMEOUT", "INTERNAL"] },
|
|
4001
|
+
"automation.script": { params: AutomationScriptParams, result: AutomationScriptResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4002
|
+
"mail.accounts": { params: MailAccountsParams, result: MailAccountsResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4003
|
+
"mail.list": { params: MailListParams, result: MailListResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4004
|
+
"mail.send": { params: MailSendParams, result: MailSendResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4005
|
+
"messages.chats": { params: MessagesChatsParams, result: MessagesChatsResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4006
|
+
"messages.list": { params: MessagesListParams, result: MessagesListResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4007
|
+
"messages.send": { params: MessagesSendParams, result: MessagesSendResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4008
|
+
"contacts.search": { params: ContactsSearchParams, result: ContactsSearchResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4009
|
+
"contacts.get": { params: ContactsGetParams, result: ContactsGetResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4010
|
+
"calendar.list": { params: CalendarListParams, result: CalendarListResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4011
|
+
"calendar.create": { params: CalendarCreateParams, result: CalendarCreateResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4012
|
+
"reminders.list": { params: RemindersListParams, result: RemindersListResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4013
|
+
"reminders.create": { params: RemindersCreateParams, result: RemindersCreateResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4014
|
+
"photos.search": { params: PhotosSearchParams, result: PhotosSearchResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4015
|
+
"photos.get": { params: PhotosGetParams, result: PhotosGetResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4016
|
+
"location.get": { params: LocationGetParams, result: LocationGetResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4017
|
+
"windows.registry_read": { params: WindowsRegistryReadParams, result: WindowsRegistryReadResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4018
|
+
"windows.registry_write": { params: WindowsRegistryWriteParams, result: WindowsRegistryWriteResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4019
|
+
"windows.services": { params: WindowsServicesParams, result: WindowsServicesResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4020
|
+
"windows.service_control": { params: WindowsServiceControlParams, result: WindowsServiceControlResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4021
|
+
"windows.event_log": { params: WindowsEventLogParams, result: WindowsEventLogResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4022
|
+
"windows.features": { params: WindowsFeaturesParams, result: WindowsFeaturesResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4023
|
+
"schedule.create": { params: ScheduleCreateParams, result: ScheduleCreateResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "INTERNAL"] },
|
|
4024
|
+
"schedule.list": { params: ScheduleListParams, result: ScheduleListResult, kind: "unary", since: "1.37", errors: ["INTERNAL"] },
|
|
4025
|
+
"schedule.cancel": { params: ScheduleCancelParams, result: ScheduleCancelResult, kind: "unary", since: "1.37", errors: ["NOT_FOUND", "INTERNAL"] },
|
|
4026
|
+
"notes.folders": { params: NotesFoldersParams, result: NotesFoldersResult, kind: "unary", since: "1.37", errors: ["INTERNAL"] },
|
|
4027
|
+
"notes.list": { params: NotesListParams, result: NotesListResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "INTERNAL"] },
|
|
4028
|
+
"notes.read": { params: NotesReadParams, result: NotesReadResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "INTERNAL"] },
|
|
4029
|
+
"notes.write": { params: NotesWriteParams, result: NotesWriteResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "CONFLICT", "PERMISSION_DENIED_OS", "INTERNAL"] },
|
|
4030
|
+
"notes.search": { params: NotesSearchParams, result: NotesSearchResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "INTERNAL"] },
|
|
4031
|
+
"documents.pdf_text": { params: DocumentsPdfTextParams, result: DocumentsPdfTextResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4032
|
+
"documents.ocr": { params: DocumentsOcrParams, result: DocumentsOcrResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4033
|
+
"documents.image_resize": { params: DocumentsImageResizeParams, result: DocumentsImageResizeResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4034
|
+
"documents.office_generate": { params: DocumentsOfficeGenerateParams, result: DocumentsOfficeGenerateResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "CONFLICT", "PERMISSION_DENIED_OS", "INTERNAL"] },
|
|
4035
|
+
"entities.ner": { params: EntitiesNerParams, result: EntitiesNerResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
4036
|
+
"entities.pii": { params: EntitiesPiiParams, result: EntitiesPiiResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "INTERNAL"] }
|
|
2898
4037
|
};
|
|
2899
4038
|
var EVENTS = {
|
|
2900
4039
|
"fs.changed": FsChangedEvent,
|
|
@@ -2906,6 +4045,10 @@ var EVENTS = {
|
|
|
2906
4045
|
"session.control_changed": SessionControlChangedEvent,
|
|
2907
4046
|
"models.progress": ModelsProgressEvent,
|
|
2908
4047
|
"coding.history.progress": CodingHistoryProgressEvent,
|
|
4048
|
+
"coding.changed": CodingChangedEvent,
|
|
4049
|
+
"coding.watch_state": CodingWatchStateEvent,
|
|
4050
|
+
"coding.item": CodingItemEvent,
|
|
4051
|
+
"coding.gap": CodingGapEvent,
|
|
2909
4052
|
"relay.device_status": RelayDeviceStatusEvent,
|
|
2910
4053
|
"relay.auth_expiring": RelayAuthExpiringEvent,
|
|
2911
4054
|
"diag.errors.changed": DiagErrorsChangedEvent,
|
|
@@ -2914,6 +4057,42 @@ var EVENTS = {
|
|
|
2914
4057
|
"browser.progress": BrowserProgressEvent
|
|
2915
4058
|
};
|
|
2916
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
|
+
|
|
2917
4096
|
// src/client/client.ts
|
|
2918
4097
|
var WS_OPEN = 1;
|
|
2919
4098
|
var defaultTimers = {
|
|
@@ -3262,6 +4441,11 @@ function createDesktopClient(options) {
|
|
|
3262
4441
|
backoff.markConnected();
|
|
3263
4442
|
authRefusals = 0;
|
|
3264
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
|
+
}
|
|
3265
4449
|
for (const w of [...readyWaiters]) {
|
|
3266
4450
|
readyWaiters.delete(w);
|
|
3267
4451
|
w.resolve(welcome.data);
|