larness 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -181
- package/app.js +22 -31
- package/apps/server/dist/{address-UO6lb2Hx.js → address-BE25lU9-.js} +4 -5
- package/apps/server/dist/{client-DGXcZxzL.js → client-Co1thYbK.js} +2 -3
- package/apps/server/dist/{doctor-CTealIcx.js → doctor-ClvbJZvj.js} +5 -9
- package/apps/server/dist/doctor.js +2 -3
- package/apps/server/dist/index.js +4908 -3040
- package/apps/server/dist/{lock-8kmtcopF.js → lock-DyEoZgG_.js} +1 -2
- package/apps/server/dist/managed-CLFUiDbj.js +2138 -0
- package/apps/server/dist/{paths-Bp1nTSw3.js → paths-BHryFHwq.js} +91 -188
- package/apps/server/dist/{status-Dyecl2ni.js → status-idXF0pm6.js} +3 -4
- package/apps/server/dist/status.js +4 -5
- package/apps/server/dist/tui.js +53 -55
- package/apps/server/drizzle/0023_turn_terminal_reason.sql +1 -0
- package/apps/server/drizzle/0024_turn_checkpoints.sql +4 -0
- package/apps/server/drizzle/0025_turn_resume.sql +1 -0
- package/apps/server/drizzle/0026_session_pin.sql +1 -0
- package/apps/server/drizzle/0027_project_sort_order.sql +2 -0
- package/apps/server/drizzle/meta/0023_snapshot.json +4967 -0
- package/apps/server/drizzle/meta/0024_snapshot.json +4994 -0
- package/apps/server/drizzle/meta/0025_snapshot.json +5001 -0
- package/apps/server/drizzle/meta/0026_snapshot.json +5008 -0
- package/apps/server/drizzle/meta/0027_snapshot.json +5021 -0
- package/apps/server/drizzle/meta/_journal.json +35 -0
- package/apps/server/package.json +12 -12
- package/apps/web/dist/assets/FileEditor-twkRcPR8.js +1 -0
- package/apps/web/dist/assets/FileViewer-B6J1gfWW.js +1 -0
- package/apps/web/dist/assets/abap-08VXUWAP.js +1 -0
- package/apps/web/dist/assets/apex-BWPQTe0t.js +1 -0
- package/apps/web/dist/assets/azcli-Bc_sGQ0U.js +1 -0
- package/apps/web/dist/assets/bat-i0X4ZdIN.js +1 -0
- package/apps/web/dist/assets/bicep-B5-_aFwp.js +2 -0
- package/apps/web/dist/assets/cameligo-DMUM7wLl.js +1 -0
- package/apps/web/dist/assets/clojure-Cm7r79vr.js +1 -0
- package/apps/web/dist/assets/coffee-Ba7i2nA0.js +1 -0
- package/apps/web/dist/assets/cpp-C7h46wYY.js +1 -0
- package/apps/web/dist/assets/csharp-BKxtCVv1.js +1 -0
- package/apps/web/dist/assets/csp-bTuwJoIa.js +1 -0
- package/apps/web/dist/assets/css-DIMkf-bt.js +3 -0
- package/apps/web/dist/assets/css.worker-C5TGqYcS.js +96 -0
- package/apps/web/dist/assets/cssMode-B2gCrV51.js +1 -0
- package/apps/web/dist/assets/cypher-CVaqCwHa.js +1 -0
- package/apps/web/dist/assets/dart-onAF5SnQ.js +1 -0
- package/apps/web/dist/assets/dockerfile-DZFCIeNp.js +1 -0
- package/apps/web/dist/assets/ecl-94qehhXe.js +1 -0
- package/apps/web/dist/assets/editor-B8GMDV7_.css +1 -0
- package/apps/web/dist/assets/editor.api-TQGsXQVT.js +908 -0
- package/apps/web/dist/assets/editor.worker-uJzjfcWc.js +33 -0
- package/apps/web/dist/assets/elixir-6RTg0lbw.js +1 -0
- package/apps/web/dist/assets/flow9-C5_-GSwl.js +1 -0
- package/apps/web/dist/assets/freemarker2-Due01FLd.js +3 -0
- package/apps/web/dist/assets/fsharp-C8Ef5oNN.js +1 -0
- package/apps/web/dist/assets/go-C-y9NEjX.js +1 -0
- package/apps/web/dist/assets/graphql-fmXr3nnJ.js +1 -0
- package/apps/web/dist/assets/handlebars-Cbmho-0R.js +1 -0
- package/apps/web/dist/assets/hcl-CpzslTdj.js +1 -0
- package/apps/web/dist/assets/html-1Ke8CI8o.js +1 -0
- package/apps/web/dist/assets/html.worker-DthhmbAk.js +509 -0
- package/apps/web/dist/assets/htmlMode-KxcipU--.js +1 -0
- package/apps/web/dist/assets/index-BvfzAW2A.js +158 -0
- package/apps/web/dist/assets/index-DxcI8GSl.css +1 -0
- package/apps/web/dist/assets/ini-sBoK_t0W.js +1 -0
- package/apps/web/dist/assets/java-BEtHBSE6.js +1 -0
- package/apps/web/dist/assets/javascript-DMPkDcJu.js +1 -0
- package/apps/web/dist/assets/json.worker-BGaEIa3n.js +65 -0
- package/apps/web/dist/assets/jsonMode-CLqudskm.js +7 -0
- package/apps/web/dist/assets/julia-Bri6UV-V.js +1 -0
- package/apps/web/dist/assets/kotlin-BOotOW0E.js +1 -0
- package/apps/web/dist/assets/less-B9JPFI3C.js +2 -0
- package/apps/web/dist/assets/lexon-CfSJPG6W.js +1 -0
- package/apps/web/dist/assets/liquid-bIUiAHG1.js +1 -0
- package/apps/web/dist/assets/lspLanguageFeatures-CplKbdW4.js +4 -0
- package/apps/web/dist/assets/lua-CsQS60Ue.js +1 -0
- package/apps/web/dist/assets/m3-D-oSqn_W.js +1 -0
- package/apps/web/dist/assets/markdown-Cimd5fb3.js +1 -0
- package/apps/web/dist/assets/mdx-DiInMCu3.js +1 -0
- package/apps/web/dist/assets/mips-CIPQ_RoX.js +1 -0
- package/apps/web/dist/assets/monaco-D_A7VB90.js +68 -0
- package/apps/web/dist/assets/monaco-n7clI0si.css +1 -0
- package/apps/web/dist/assets/msdax-DauUninz.js +1 -0
- package/apps/web/dist/assets/mysql-SOo6toE5.js +1 -0
- package/apps/web/dist/assets/objective-c-FvmIjYaQ.js +1 -0
- package/apps/web/dist/assets/pascal-DrH0SRf2.js +1 -0
- package/apps/web/dist/assets/pascaligo-D-ptJ9y-.js +1 -0
- package/apps/web/dist/assets/perl-oz_6vUea.js +1 -0
- package/apps/web/dist/assets/pgsql-DTj74zXo.js +1 -0
- package/apps/web/dist/assets/php-nr791fC2.js +1 -0
- package/apps/web/dist/assets/pla-CopQ2nXW.js +1 -0
- package/apps/web/dist/assets/postiats-43DmfD33.js +1 -0
- package/apps/web/dist/assets/powerquery-D3hlyOfw.js +1 -0
- package/apps/web/dist/assets/powershell-DmHpPYUd.js +1 -0
- package/apps/web/dist/assets/protobuf-C531GsRP.js +2 -0
- package/apps/web/dist/assets/pug-Z5eAx3Zn.js +1 -0
- package/apps/web/dist/assets/python-O93J5sRJ.js +1 -0
- package/apps/web/dist/assets/qsharp-DkqhCAOL.js +1 -0
- package/apps/web/dist/assets/r-BwWrilGY.js +1 -0
- package/apps/web/dist/assets/razor-DpA8sAYd.js +1 -0
- package/apps/web/dist/assets/redis-ClamHrr6.js +1 -0
- package/apps/web/dist/assets/redshift-DT7zqm-g.js +1 -0
- package/apps/web/dist/assets/restructuredtext-BYgofb2h.js +1 -0
- package/apps/web/dist/assets/ruby-DezsRK8O.js +1 -0
- package/apps/web/dist/assets/rust-DdL9SqIa.js +1 -0
- package/apps/web/dist/assets/sb-CcwsVR0C.js +1 -0
- package/apps/web/dist/assets/scala-DHpiXF5c.js +1 -0
- package/apps/web/dist/assets/scheme-BeGwcela.js +1 -0
- package/apps/web/dist/assets/scss-gp-XZpBa.js +3 -0
- package/apps/web/dist/assets/shell-CC2rA5mh.js +1 -0
- package/apps/web/dist/assets/solidity-BEEn4gHE.js +1 -0
- package/apps/web/dist/assets/sophia-CRfGWb83.js +1 -0
- package/apps/web/dist/assets/sparql-D_Lu-MrJ.js +1 -0
- package/apps/web/dist/assets/sql-NEE52Syq.js +1 -0
- package/apps/web/dist/assets/st-DbInun42.js +1 -0
- package/apps/web/dist/assets/swift-Bxkupp3x.js +1 -0
- package/apps/web/dist/assets/systemverilog-Bz4Y3fRF.js +1 -0
- package/apps/web/dist/assets/tcl-DISqw1ZD.js +1 -0
- package/apps/web/dist/assets/{ts.worker-BrLZGe_E.js → ts.worker-CUR_zL4j.js} +260 -241
- package/apps/web/dist/assets/tsMode-qBmFN2NS.js +11 -0
- package/apps/web/dist/assets/twig-De2hgUGE.js +1 -0
- package/apps/web/dist/assets/typescript-BjR2yH8S.js +1 -0
- package/apps/web/dist/assets/typespec-B8J7ngcE.js +1 -0
- package/apps/web/dist/assets/vb-DV3o63ZY.js +1 -0
- package/apps/web/dist/assets/{wgsl-BTesnYfV.js → wgsl-DpFanUEy.js} +9 -9
- package/apps/web/dist/assets/workers-x9_8y1ur.js +1 -0
- package/apps/web/dist/assets/xml-CL70_TAY.js +1 -0
- package/apps/web/dist/assets/yaml-qno5z39m.js +1 -0
- package/apps/web/dist/index.html +2 -2
- package/docs/README.md +4 -4
- package/docs/guides/install.md +31 -6
- package/package.json +18 -17
- package/apps/server/dist/managed-CHal_mk1.js +0 -216
- package/apps/web/dist/assets/FileEditor-DpVfk7t3.js +0 -1
- package/apps/web/dist/assets/FileViewer-Bv5VYaA3.js +0 -1
- package/apps/web/dist/assets/abap-DLDM7-KI.js +0 -1
- package/apps/web/dist/assets/apex-DNDY2TF8.js +0 -1
- package/apps/web/dist/assets/azcli-Y6nb8tq_.js +0 -1
- package/apps/web/dist/assets/bat-BwHxbl9M.js +0 -1
- package/apps/web/dist/assets/bicep-CFznDFnq.js +0 -2
- package/apps/web/dist/assets/cameligo-Bf6VGUru.js +0 -1
- package/apps/web/dist/assets/clojure-Dnu-v4kV.js +0 -1
- package/apps/web/dist/assets/coffee-Bd8akH9Z.js +0 -1
- package/apps/web/dist/assets/cpp-BbWJElDN.js +0 -1
- package/apps/web/dist/assets/csharp-Co3qMtFm.js +0 -1
- package/apps/web/dist/assets/csp-D-4FJmMZ.js +0 -1
- package/apps/web/dist/assets/css-DdJfP1eB.js +0 -3
- package/apps/web/dist/assets/css.worker-C_6RgliQ.js +0 -97
- package/apps/web/dist/assets/cssMode-EHCHSzzL.js +0 -1
- package/apps/web/dist/assets/cypher-cTPe9QuQ.js +0 -1
- package/apps/web/dist/assets/dart-BOtBlQCF.js +0 -1
- package/apps/web/dist/assets/dockerfile-BG73LgW2.js +0 -1
- package/apps/web/dist/assets/ecl-BEgZUVRK.js +0 -1
- package/apps/web/dist/assets/editor.worker-D1TDBLlL.js +0 -30
- package/apps/web/dist/assets/elixir-BkW5O-1t.js +0 -1
- package/apps/web/dist/assets/flow9-BeJ5waoc.js +0 -1
- package/apps/web/dist/assets/freemarker2-CYDUi4bR.js +0 -3
- package/apps/web/dist/assets/fsharp-PahG7c26.js +0 -1
- package/apps/web/dist/assets/go-acbASCJo.js +0 -1
- package/apps/web/dist/assets/graphql-BxJiqAUM.js +0 -1
- package/apps/web/dist/assets/handlebars-Bl5r-XBz.js +0 -1
- package/apps/web/dist/assets/hcl-DtV1sZF8.js +0 -1
- package/apps/web/dist/assets/html-Dimr8AuT.js +0 -1
- package/apps/web/dist/assets/html.worker-CLyYFd_g.js +0 -474
- package/apps/web/dist/assets/htmlMode-DbKEQN5e.js +0 -1
- package/apps/web/dist/assets/index-CiO_U1kt.js +0 -158
- package/apps/web/dist/assets/index-Cn8Mc6ux.css +0 -1
- package/apps/web/dist/assets/ini-Kd9XrMLS.js +0 -1
- package/apps/web/dist/assets/java-CXBNlu9o.js +0 -1
- package/apps/web/dist/assets/javascript-CAsmnqI3.js +0 -1
- package/apps/web/dist/assets/json.worker-BggoxaER.js +0 -62
- package/apps/web/dist/assets/jsonMode-FAO7KTW2.js +0 -7
- package/apps/web/dist/assets/julia-cl7-CwDS.js +0 -1
- package/apps/web/dist/assets/kotlin-s7OhZKlX.js +0 -1
- package/apps/web/dist/assets/less-9HpZscsL.js +0 -2
- package/apps/web/dist/assets/lexon-OrD6JF1K.js +0 -1
- package/apps/web/dist/assets/liquid-5H_43_EZ.js +0 -1
- package/apps/web/dist/assets/lspLanguageFeatures-DnuYc3pX.js +0 -4
- package/apps/web/dist/assets/lua-Cyyb5UIc.js +0 -1
- package/apps/web/dist/assets/m3-B8OfTtLu.js +0 -1
- package/apps/web/dist/assets/markdown-BFxVWTOG.js +0 -1
- package/apps/web/dist/assets/mdx-DJvtDn95.js +0 -1
- package/apps/web/dist/assets/mips-CiqrrVzr.js +0 -1
- package/apps/web/dist/assets/monaco-BEZSi3GX.js +0 -1005
- package/apps/web/dist/assets/monaco-Ced-qlZg.css +0 -1
- package/apps/web/dist/assets/msdax-DmeGPVcC.js +0 -1
- package/apps/web/dist/assets/mysql-C_tMU-Nz.js +0 -1
- package/apps/web/dist/assets/objective-c-BDtDVThU.js +0 -1
- package/apps/web/dist/assets/pascal-vHIfCaH5.js +0 -1
- package/apps/web/dist/assets/pascaligo-DtZ0uQbO.js +0 -1
- package/apps/web/dist/assets/perl-Ub6l9XKa.js +0 -1
- package/apps/web/dist/assets/pgsql-BlNEE0v7.js +0 -1
- package/apps/web/dist/assets/php-BBUBE1dy.js +0 -1
- package/apps/web/dist/assets/pla-DSh2-awV.js +0 -1
- package/apps/web/dist/assets/postiats-CocnycG-.js +0 -1
- package/apps/web/dist/assets/powerquery-tScXyioY.js +0 -1
- package/apps/web/dist/assets/powershell-COWaemsV.js +0 -1
- package/apps/web/dist/assets/protobuf-Brw8urJB.js +0 -2
- package/apps/web/dist/assets/pug-8SOpv6rk.js +0 -1
- package/apps/web/dist/assets/python-D4581wh8.js +0 -1
- package/apps/web/dist/assets/qsharp-Bw9ernYp.js +0 -1
- package/apps/web/dist/assets/r-j7ic8hl3.js +0 -1
- package/apps/web/dist/assets/razor-Cob92s3y.js +0 -1
- package/apps/web/dist/assets/redis-Bu5POkcn.js +0 -1
- package/apps/web/dist/assets/redshift-Bs9aos_-.js +0 -1
- package/apps/web/dist/assets/restructuredtext-CqXO7rUv.js +0 -1
- package/apps/web/dist/assets/ruby-zBfavPgS.js +0 -1
- package/apps/web/dist/assets/rust-BzKRNQWT.js +0 -1
- package/apps/web/dist/assets/sb-BBc9UKZt.js +0 -1
- package/apps/web/dist/assets/scala-D9hQfWCl.js +0 -1
- package/apps/web/dist/assets/scheme-BPhDTwHR.js +0 -1
- package/apps/web/dist/assets/scss-CBJaRo0y.js +0 -3
- package/apps/web/dist/assets/shell-DiJ1NA_G.js +0 -1
- package/apps/web/dist/assets/solidity-Db0IVjzk.js +0 -1
- package/apps/web/dist/assets/sophia-CnS9iZB_.js +0 -1
- package/apps/web/dist/assets/sparql-CJmd_6j2.js +0 -1
- package/apps/web/dist/assets/sql-ClhHkBeG.js +0 -1
- package/apps/web/dist/assets/st-CHwy0fLd.js +0 -1
- package/apps/web/dist/assets/swift-CnmFD0ga.js +0 -1
- package/apps/web/dist/assets/systemverilog-Bs9z6M-B.js +0 -1
- package/apps/web/dist/assets/tcl-Dm6ycUr_.js +0 -1
- package/apps/web/dist/assets/tsMode-WJsr57wC.js +0 -11
- package/apps/web/dist/assets/twig-Csy3S7wG.js +0 -1
- package/apps/web/dist/assets/typescript-8M7GiCNW.js +0 -1
- package/apps/web/dist/assets/typespec-Btyra-wh.js +0 -1
- package/apps/web/dist/assets/vb-Db0cS2oM.js +0 -1
- package/apps/web/dist/assets/workers-FOC7l7Wh.js +0 -1
- package/apps/web/dist/assets/xml-Hm5ZZqOZ.js +0 -1
- package/apps/web/dist/assets/yaml-E7sEyvM5.js +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "node:module";
|
|
2
1
|
import { closeSync, constants, existsSync, fsyncSync, openSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import { fileURLToPath } from "node:url";
|
|
@@ -10,23 +9,23 @@ import { check, index, integer, sqliteTable, text, uniqueIndex } from "drizzle-o
|
|
|
10
9
|
import BetterSqlite3 from "better-sqlite3";
|
|
11
10
|
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
|
|
12
11
|
import envPaths from "env-paths";
|
|
13
|
-
|
|
12
|
+
// \0rolldown/runtime.js
|
|
14
13
|
var __defProp = Object.defineProperty;
|
|
15
|
-
var __exportAll = (all,
|
|
16
|
-
let target = {};
|
|
14
|
+
var __exportAll = (all, flags) => {
|
|
15
|
+
let target = Object.setPrototypeOf({}, null);
|
|
17
16
|
for (var name in all) __defProp(target, name, {
|
|
18
17
|
get: all[name],
|
|
19
18
|
enumerable: true
|
|
20
19
|
});
|
|
21
|
-
if (!
|
|
22
|
-
return target;
|
|
20
|
+
if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
21
|
+
return flags & 2 ? target : Object.preventExtensions(target);
|
|
23
22
|
};
|
|
24
23
|
z.enum([
|
|
25
24
|
"project",
|
|
26
25
|
"default",
|
|
27
26
|
"session"
|
|
28
27
|
]);
|
|
29
|
-
const MAX_EDITABLE_FILE_BYTES =
|
|
28
|
+
const MAX_EDITABLE_FILE_BYTES = 524288;
|
|
30
29
|
const resourceId = z.string().min(1).max(128);
|
|
31
30
|
const FileScopeSchema = z.union([
|
|
32
31
|
z.object({ workspace: z.literal("default") }).strict(),
|
|
@@ -41,7 +40,7 @@ const FileVersionSchema = z.string().regex(/^[a-f0-9]{64}$/);
|
|
|
41
40
|
const FileSaveSchema = z.object({
|
|
42
41
|
scope: FileScopeSchema,
|
|
43
42
|
path: FilePathSchema,
|
|
44
|
-
content: z.string().max(
|
|
43
|
+
content: z.string().max(1048576),
|
|
45
44
|
expectedVersion: FileVersionSchema
|
|
46
45
|
}).strict();
|
|
47
46
|
const FileReadQuerySchema = z.union([
|
|
@@ -94,8 +93,7 @@ const FileResultTargetSchema = z.object({
|
|
|
94
93
|
path: FilePathSchema,
|
|
95
94
|
version: FileVersionSchema.optional()
|
|
96
95
|
}).strict();
|
|
97
|
-
|
|
98
|
-
//#region ../../packages/shared/src/commands.ts
|
|
96
|
+
// ../../packages/shared/src/commands.ts
|
|
99
97
|
const CommandParamsSchema = z.object({
|
|
100
98
|
executable: z.string().min(1).max(4096).refine((value) => !value.includes("\0")),
|
|
101
99
|
args: z.array(z.string().max(8192).refine((value) => !value.includes("\0"))).max(256),
|
|
@@ -118,7 +116,7 @@ const CommandOutputQuerySchema = z.object({
|
|
|
118
116
|
}).strict();
|
|
119
117
|
const CommandOutputChunkSchema = z.object({
|
|
120
118
|
cursor: z.number().int().positive(),
|
|
121
|
-
data: z.string().max(
|
|
119
|
+
data: z.string().max(16384).refine((data) => new TextEncoder().encode(data).byteLength <= 16384),
|
|
122
120
|
channel: z.enum(["stdout", "stderr"]),
|
|
123
121
|
timestamp: z.number().int()
|
|
124
122
|
}).strict();
|
|
@@ -131,8 +129,8 @@ const CommandStatusPayloadSchema = z.object({
|
|
|
131
129
|
endedAt: z.number().nullable()
|
|
132
130
|
});
|
|
133
131
|
const CommandCancelSchema = z.object({}).strict();
|
|
134
|
-
const COMMAND_OUTPUT_RETENTION_MS =
|
|
135
|
-
const COMMAND_RETENTION_MS =
|
|
132
|
+
const COMMAND_OUTPUT_RETENTION_MS = 6048e5;
|
|
133
|
+
const COMMAND_RETENTION_MS = 2592e6;
|
|
136
134
|
const CommandIdSchema = z.string().regex(/^cmd_[a-f0-9-]{36}$/);
|
|
137
135
|
const CommandSubscriptionSchema = z.object({
|
|
138
136
|
topic: z.literal("command"),
|
|
@@ -173,8 +171,7 @@ CommandOutputChunkSchema.extend({
|
|
|
173
171
|
kind: z.literal("command.output"),
|
|
174
172
|
resourceId: CommandIdSchema
|
|
175
173
|
}).strict();
|
|
176
|
-
|
|
177
|
-
//#region ../../packages/shared/src/config.ts
|
|
174
|
+
// ../../packages/shared/src/config.ts
|
|
178
175
|
const LOG_LEVELS = [
|
|
179
176
|
"trace",
|
|
180
177
|
"debug",
|
|
@@ -225,6 +222,29 @@ const PreviewConfigSchema = z.strictObject({
|
|
|
225
222
|
enabled: z.boolean(),
|
|
226
223
|
port: z.number().int().min(1).max(65535).default(3211)
|
|
227
224
|
});
|
|
225
|
+
const CleanupRetentionSchema = z.strictObject({
|
|
226
|
+
events: z.number().int().min(1).max(3650).default(90),
|
|
227
|
+
turns: z.number().int().min(1).max(3650).default(180),
|
|
228
|
+
summaries: z.number().int().min(1).max(3650).default(90)
|
|
229
|
+
});
|
|
230
|
+
/**
|
|
231
|
+
* Retention cleanup is opt-in (ADR-058 decision 4): disabled by default and
|
|
232
|
+
* dry-run only until a human turns it on.
|
|
233
|
+
*/
|
|
234
|
+
const CleanupConfigSchema = z.strictObject({
|
|
235
|
+
enabled: z.boolean().default(false),
|
|
236
|
+
/** Remove the session row as well; default keeps history entries visible. */
|
|
237
|
+
deleteSessions: z.boolean().default(false),
|
|
238
|
+
keepPinned: z.boolean().default(true),
|
|
239
|
+
retentionDays: CleanupRetentionSchema.default({
|
|
240
|
+
events: 90,
|
|
241
|
+
turns: 180,
|
|
242
|
+
summaries: 90
|
|
243
|
+
}),
|
|
244
|
+
/** Hard size budget in bytes; 0 disables the check. */
|
|
245
|
+
maxBytes: z.number().int().min(0).default(0)
|
|
246
|
+
});
|
|
247
|
+
const DEFAULT_CLEANUP_CONFIG = CleanupConfigSchema.parse({});
|
|
228
248
|
const AppConfigSchema = z.strictObject({
|
|
229
249
|
version: z.literal(1),
|
|
230
250
|
server: ServerConfigSchema,
|
|
@@ -232,7 +252,8 @@ const AppConfigSchema = z.strictObject({
|
|
|
232
252
|
webauthn: WebAuthnConfigSchema,
|
|
233
253
|
logging: LoggingConfigSchema,
|
|
234
254
|
updates: UpdatesConfigSchema,
|
|
235
|
-
preview: PreviewConfigSchema
|
|
255
|
+
preview: PreviewConfigSchema,
|
|
256
|
+
cleanup: CleanupConfigSchema.default(DEFAULT_CLEANUP_CONFIG)
|
|
236
257
|
});
|
|
237
258
|
const DEFAULT_APP_CONFIG = {
|
|
238
259
|
version: 1,
|
|
@@ -264,7 +285,8 @@ const DEFAULT_APP_CONFIG = {
|
|
|
264
285
|
preview: {
|
|
265
286
|
enabled: false,
|
|
266
287
|
port: 3211
|
|
267
|
-
}
|
|
288
|
+
},
|
|
289
|
+
cleanup: DEFAULT_CLEANUP_CONFIG
|
|
268
290
|
};
|
|
269
291
|
function isIpHostname(hostname) {
|
|
270
292
|
const host = hostname.replace(/^\[/, "").replace(/\]$/, "");
|
|
@@ -283,8 +305,7 @@ function deriveWebAuthn(server, rpName) {
|
|
|
283
305
|
reason
|
|
284
306
|
};
|
|
285
307
|
}
|
|
286
|
-
|
|
287
|
-
//#region ../../packages/shared/src/deployments.ts
|
|
308
|
+
// ../../packages/shared/src/deployments.ts
|
|
288
309
|
const ServiceControlInputSchema = z.object({
|
|
289
310
|
action: z.enum([
|
|
290
311
|
"start",
|
|
@@ -666,7 +687,7 @@ const ServiceActionAuthorizationDtoSchema = z.object({
|
|
|
666
687
|
reasonCode: z.string().max(64).nullable(),
|
|
667
688
|
createdAt: z.int()
|
|
668
689
|
});
|
|
669
|
-
const DEPLOYMENT_APPROVAL_TTL_MS =
|
|
690
|
+
const DEPLOYMENT_APPROVAL_TTL_MS = 3e5;
|
|
670
691
|
const DeploymentArtifactManifestSchema = z.strictObject({
|
|
671
692
|
version: z.literal(1),
|
|
672
693
|
artifactId: DeploymentArtifactIdSchema,
|
|
@@ -678,11 +699,11 @@ const DeploymentArtifactManifestSchema = z.strictObject({
|
|
|
678
699
|
hash: z.string().regex(/^[a-f0-9]{64}$/)
|
|
679
700
|
}))
|
|
680
701
|
});
|
|
681
|
-
const DEPLOYMENT_PLAN_TTL_MS =
|
|
682
|
-
const DEPLOYMENT_ARTIFACT_MAX_BYTES =
|
|
702
|
+
const DEPLOYMENT_PLAN_TTL_MS = 18e5;
|
|
703
|
+
const DEPLOYMENT_ARTIFACT_MAX_BYTES = 536870912;
|
|
683
704
|
const DEPLOYMENT_ARTIFACT_MAX_FILES = 2e4;
|
|
684
705
|
const DEPLOYMENT_ARTIFACT_MAX_PATH = 1024;
|
|
685
|
-
const DEPLOYMENT_BUILD_LOG_MAX_BYTES =
|
|
706
|
+
const DEPLOYMENT_BUILD_LOG_MAX_BYTES = 1048576;
|
|
686
707
|
z.object({
|
|
687
708
|
available: z.boolean(),
|
|
688
709
|
nodeExecutable: z.string(),
|
|
@@ -711,134 +732,10 @@ z.object({
|
|
|
711
732
|
updatedAt: z.int()
|
|
712
733
|
}))
|
|
713
734
|
});
|
|
714
|
-
|
|
715
|
-
//#region ../../packages/shared/src/domain.ts
|
|
735
|
+
// ../../packages/shared/src/domain.ts
|
|
716
736
|
const DEFAULT_PROJECT_ID = "prj_default";
|
|
717
737
|
z.boolean().default(false);
|
|
718
|
-
|
|
719
|
-
//#region ../../packages/shared/src/errors.ts
|
|
720
|
-
const ERROR_CODES = {
|
|
721
|
-
validation: "VALIDATION_ERROR",
|
|
722
|
-
unauthenticated: "UNAUTHENTICATED",
|
|
723
|
-
forbidden: "FORBIDDEN",
|
|
724
|
-
originInvalid: "ORIGIN_INVALID",
|
|
725
|
-
httpsRequired: "HTTPS_REQUIRED",
|
|
726
|
-
csrfInvalid: "CSRF_INVALID",
|
|
727
|
-
notFound: "NOT_FOUND",
|
|
728
|
-
notInitialized: "NOT_INITIALIZED",
|
|
729
|
-
conflict: "CONFLICT",
|
|
730
|
-
turnInProgress: "TURN_IN_PROGRESS",
|
|
731
|
-
resourceLocked: "RESOURCE_LOCKED",
|
|
732
|
-
versionConflict: "VERSION_CONFLICT",
|
|
733
|
-
fileNotEditable: "FILE_NOT_EDITABLE",
|
|
734
|
-
payloadTooLarge: "PAYLOAD_TOO_LARGE",
|
|
735
|
-
resourceUnavailable: "RESOURCE_UNAVAILABLE",
|
|
736
|
-
terminalLeaseRequired: "TERMINAL_LEASE_REQUIRED",
|
|
737
|
-
gitUnavailable: "GIT_UNAVAILABLE",
|
|
738
|
-
gitConflict: "GIT_CONFLICT",
|
|
739
|
-
gitAuthRequired: "GIT_AUTH_REQUIRED",
|
|
740
|
-
pairingDenied: "PAIRING_DENIED",
|
|
741
|
-
pairingExpired: "PAIRING_EXPIRED",
|
|
742
|
-
codeInvalid: "CODE_INVALID",
|
|
743
|
-
enrollmentExpired: "ENROLLMENT_EXPIRED",
|
|
744
|
-
challengeExpired: "CHALLENGE_EXPIRED",
|
|
745
|
-
passkeyRegistrationFailed: "PASSKEY_REGISTRATION_FAILED",
|
|
746
|
-
passkeyAuthFailed: "PASSKEY_AUTH_FAILED",
|
|
747
|
-
webauthnNotConfigured: "WEBAUTHN_NOT_CONFIGURED",
|
|
748
|
-
rateLimited: "RATE_LIMITED",
|
|
749
|
-
pathOutsideProject: "PATH_OUTSIDE_PROJECT",
|
|
750
|
-
approvalInvalid: "APPROVAL_INVALID",
|
|
751
|
-
previewTargetInvalid: "PREVIEW_TARGET_INVALID",
|
|
752
|
-
previewUnavailable: "PREVIEW_UNAVAILABLE",
|
|
753
|
-
previewDisabled: "PREVIEW_DISABLED",
|
|
754
|
-
previewGrantInvalid: "PREVIEW_GRANT_INVALID",
|
|
755
|
-
deployTargetInvalid: "DEPLOY_TARGET_INVALID",
|
|
756
|
-
deploySpecInvalid: "DEPLOY_SPEC_INVALID",
|
|
757
|
-
deployBuildFailed: "DEPLOY_BUILD_FAILED",
|
|
758
|
-
deployArtifactInvalid: "DEPLOY_ARTIFACT_INVALID",
|
|
759
|
-
deployPlanInvalid: "DEPLOY_PLAN_INVALID",
|
|
760
|
-
deployPlanExpired: "DEPLOY_PLAN_EXPIRED",
|
|
761
|
-
deployAuthRequired: "DEPLOY_AUTH_REQUIRED",
|
|
762
|
-
deployAuthInvalid: "DEPLOY_AUTH_INVALID",
|
|
763
|
-
deployApprovalInvalid: "DEPLOY_APPROVAL_INVALID",
|
|
764
|
-
deployApprovalExpired: "DEPLOY_APPROVAL_EXPIRED",
|
|
765
|
-
deployConflict: "DEPLOY_CONFLICT",
|
|
766
|
-
deployUnavailable: "DEPLOY_UNAVAILABLE",
|
|
767
|
-
providerUnavailable: "PROVIDER_UNAVAILABLE",
|
|
768
|
-
providerAuthFailed: "PROVIDER_AUTH_FAILED",
|
|
769
|
-
providerRateLimited: "PROVIDER_RATE_LIMITED",
|
|
770
|
-
providerQuotaExhausted: "PROVIDER_QUOTA_EXHAUSTED",
|
|
771
|
-
providerContextLimit: "PROVIDER_CONTEXT_LIMIT",
|
|
772
|
-
providerContentFiltered: "PROVIDER_CONTENT_FILTERED",
|
|
773
|
-
providerUnknown: "PROVIDER_UNKNOWN",
|
|
774
|
-
modelCredentialMissing: "MODEL_CREDENTIAL_MISSING",
|
|
775
|
-
modelCatalogInvalid: "MODEL_CATALOG_INVALID",
|
|
776
|
-
modelUnsupported: "MODEL_UNSUPPORTED",
|
|
777
|
-
devWebUnavailable: "DEV_WEB_UNAVAILABLE",
|
|
778
|
-
internal: "INTERNAL"
|
|
779
|
-
};
|
|
780
|
-
const ERROR_HTTP_STATUS = {
|
|
781
|
-
VALIDATION_ERROR: 400,
|
|
782
|
-
UNAUTHENTICATED: 401,
|
|
783
|
-
FORBIDDEN: 403,
|
|
784
|
-
ORIGIN_INVALID: 403,
|
|
785
|
-
HTTPS_REQUIRED: 403,
|
|
786
|
-
CSRF_INVALID: 403,
|
|
787
|
-
NOT_FOUND: 404,
|
|
788
|
-
NOT_INITIALIZED: 409,
|
|
789
|
-
CONFLICT: 409,
|
|
790
|
-
TURN_IN_PROGRESS: 409,
|
|
791
|
-
RESOURCE_LOCKED: 409,
|
|
792
|
-
VERSION_CONFLICT: 409,
|
|
793
|
-
FILE_NOT_EDITABLE: 422,
|
|
794
|
-
PAYLOAD_TOO_LARGE: 413,
|
|
795
|
-
RESOURCE_UNAVAILABLE: 409,
|
|
796
|
-
TERMINAL_LEASE_REQUIRED: 409,
|
|
797
|
-
GIT_UNAVAILABLE: 503,
|
|
798
|
-
GIT_CONFLICT: 409,
|
|
799
|
-
GIT_AUTH_REQUIRED: 409,
|
|
800
|
-
PAIRING_DENIED: 403,
|
|
801
|
-
PAIRING_EXPIRED: 410,
|
|
802
|
-
CODE_INVALID: 400,
|
|
803
|
-
ENROLLMENT_EXPIRED: 410,
|
|
804
|
-
CHALLENGE_EXPIRED: 410,
|
|
805
|
-
PASSKEY_REGISTRATION_FAILED: 400,
|
|
806
|
-
PASSKEY_AUTH_FAILED: 401,
|
|
807
|
-
WEBAUTHN_NOT_CONFIGURED: 409,
|
|
808
|
-
RATE_LIMITED: 429,
|
|
809
|
-
PATH_OUTSIDE_PROJECT: 403,
|
|
810
|
-
APPROVAL_INVALID: 409,
|
|
811
|
-
PREVIEW_TARGET_INVALID: 403,
|
|
812
|
-
PREVIEW_UNAVAILABLE: 503,
|
|
813
|
-
PREVIEW_DISABLED: 503,
|
|
814
|
-
PREVIEW_GRANT_INVALID: 401,
|
|
815
|
-
DEPLOY_TARGET_INVALID: 400,
|
|
816
|
-
DEPLOY_SPEC_INVALID: 400,
|
|
817
|
-
DEPLOY_BUILD_FAILED: 422,
|
|
818
|
-
DEPLOY_ARTIFACT_INVALID: 409,
|
|
819
|
-
DEPLOY_PLAN_INVALID: 409,
|
|
820
|
-
DEPLOY_PLAN_EXPIRED: 410,
|
|
821
|
-
DEPLOY_AUTH_REQUIRED: 409,
|
|
822
|
-
DEPLOY_AUTH_INVALID: 409,
|
|
823
|
-
DEPLOY_APPROVAL_INVALID: 409,
|
|
824
|
-
DEPLOY_APPROVAL_EXPIRED: 410,
|
|
825
|
-
DEPLOY_CONFLICT: 409,
|
|
826
|
-
DEPLOY_UNAVAILABLE: 503,
|
|
827
|
-
PROVIDER_UNAVAILABLE: 503,
|
|
828
|
-
PROVIDER_AUTH_FAILED: 502,
|
|
829
|
-
PROVIDER_RATE_LIMITED: 429,
|
|
830
|
-
PROVIDER_QUOTA_EXHAUSTED: 402,
|
|
831
|
-
PROVIDER_CONTEXT_LIMIT: 413,
|
|
832
|
-
PROVIDER_CONTENT_FILTERED: 422,
|
|
833
|
-
PROVIDER_UNKNOWN: 502,
|
|
834
|
-
MODEL_CREDENTIAL_MISSING: 409,
|
|
835
|
-
MODEL_CATALOG_INVALID: 502,
|
|
836
|
-
MODEL_UNSUPPORTED: 400,
|
|
837
|
-
DEV_WEB_UNAVAILABLE: 503,
|
|
838
|
-
INTERNAL: 500
|
|
839
|
-
};
|
|
840
|
-
//#endregion
|
|
841
|
-
//#region ../../packages/shared/src/events.ts
|
|
738
|
+
// ../../packages/shared/src/events.ts
|
|
842
739
|
const WORKSPACE_SESSIONS_CHANGED = "workspace.sessions.changed";
|
|
843
740
|
const WORKSPACE_JOBS_CHANGED = "workspace.jobs.changed";
|
|
844
741
|
z.discriminatedUnion("kind", [z.object({
|
|
@@ -849,8 +746,15 @@ z.discriminatedUnion("kind", [z.object({
|
|
|
849
746
|
})
|
|
850
747
|
}), z.object({ kind: z.literal(WORKSPACE_SESSIONS_CHANGED) })]);
|
|
851
748
|
z.object({ kind: z.literal(WORKSPACE_JOBS_CHANGED) });
|
|
852
|
-
|
|
853
|
-
|
|
749
|
+
const TurnFileResultSchema = z.object({
|
|
750
|
+
path: z.string().min(1),
|
|
751
|
+
changeType: z.enum(["created", "modified"]),
|
|
752
|
+
version: z.string().min(1),
|
|
753
|
+
existed: z.boolean(),
|
|
754
|
+
category: z.enum(["deliverable", "process"])
|
|
755
|
+
});
|
|
756
|
+
z.array(TurnFileResultSchema);
|
|
757
|
+
// ../../packages/shared/src/git.ts
|
|
854
758
|
const GitPathSchema = z.string().min(1).max(4096).refine((value) => !value.includes("\0"), "Git path cannot contain NUL");
|
|
855
759
|
const GitBranchNameSchema = z.string().min(1).max(255).refine((value) => !value.includes("\0") && !value.startsWith("-"), "Invalid branch name");
|
|
856
760
|
const GitAddActionSchema = z.object({
|
|
@@ -926,6 +830,7 @@ z.enum([
|
|
|
926
830
|
"JOB_TIMEOUT",
|
|
927
831
|
"JOB_RUN_CANCELLED",
|
|
928
832
|
"JOB_AGENT_FAILED",
|
|
833
|
+
"JOB_AGENT_INCOMPLETE",
|
|
929
834
|
"JOB_INTERRUPTED",
|
|
930
835
|
"JOB_OVERLAP"
|
|
931
836
|
]);
|
|
@@ -981,8 +886,7 @@ const ScheduledJobPatchSchema = z.object({
|
|
|
981
886
|
approvalPolicy: ScheduledJobApprovalPolicySchema.optional()
|
|
982
887
|
}).strict().optional()
|
|
983
888
|
}).strict();
|
|
984
|
-
|
|
985
|
-
//#region ../../packages/shared/src/plans.ts
|
|
889
|
+
// ../../packages/shared/src/plans.ts
|
|
986
890
|
const PlanStepSchema = z.object({
|
|
987
891
|
id: z.string().min(1).max(80),
|
|
988
892
|
title: z.string().trim().min(1).max(200),
|
|
@@ -1013,8 +917,7 @@ PlanParamsSchema.safeExtend({
|
|
|
1013
917
|
createdAt: z.number().int().nonnegative(),
|
|
1014
918
|
turnId: z.string().optional()
|
|
1015
919
|
});
|
|
1016
|
-
|
|
1017
|
-
//#region ../../packages/shared/src/terminals.ts
|
|
920
|
+
// ../../packages/shared/src/terminals.ts
|
|
1018
921
|
const TerminalIdSchema = z.string().regex(/^term_[a-f0-9-]{36}$/);
|
|
1019
922
|
const TerminalRenameSchema = z.object({ title: z.string().min(1).max(80).refine((value) => [...value].every((char) => {
|
|
1020
923
|
const code = char.codePointAt(0) ?? 0;
|
|
@@ -1204,8 +1107,7 @@ z.object({
|
|
|
1204
1107
|
items: z.array(TerminalSchema),
|
|
1205
1108
|
nextCursor: TerminalIdSchema.nullable()
|
|
1206
1109
|
});
|
|
1207
|
-
|
|
1208
|
-
//#region ../../packages/shared/src/services.ts
|
|
1110
|
+
// ../../packages/shared/src/services.ts
|
|
1209
1111
|
const ServiceIdSchema = z.string().regex(/^svc_[a-f0-9-]{36}$/);
|
|
1210
1112
|
const ServiceStatusSchema = z.enum([
|
|
1211
1113
|
"REGISTERING",
|
|
@@ -1287,9 +1189,8 @@ const ServiceSubscriptionSchema = z.object({
|
|
|
1287
1189
|
resourceId: ServiceIdSchema,
|
|
1288
1190
|
after: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER).default(0)
|
|
1289
1191
|
}).strict();
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
const RESOURCE_EVENT_RETENTION_MS = 720 * 60 * 6e4;
|
|
1192
|
+
// ../../packages/shared/src/resources.ts
|
|
1193
|
+
const RESOURCE_EVENT_RETENTION_MS = 2592e6;
|
|
1293
1194
|
const FileResourceIdSchema = z.string().regex(/^(?:(?:project|session):[a-zA-Z0-9_-]{1,128}|workspace:default)$/);
|
|
1294
1195
|
const FileStreamIdSchema = z.string().regex(/^file:(?:(?:project|session):[a-zA-Z0-9_-]{1,128}|workspace:default)$/);
|
|
1295
1196
|
const FileSubscriptionSchema = z.object({
|
|
@@ -1388,13 +1289,11 @@ z.object({
|
|
|
1388
1289
|
code: z.string(),
|
|
1389
1290
|
message: z.string()
|
|
1390
1291
|
});
|
|
1391
|
-
|
|
1392
|
-
//#region src/db/ids.ts
|
|
1292
|
+
// src/db/ids.ts
|
|
1393
1293
|
function newId(prefix) {
|
|
1394
1294
|
return `${prefix}_${randomUUID()}`;
|
|
1395
1295
|
}
|
|
1396
|
-
|
|
1397
|
-
//#region src/db/schema.ts
|
|
1296
|
+
// src/db/schema.ts
|
|
1398
1297
|
var schema_exports = /* @__PURE__ */ __exportAll({
|
|
1399
1298
|
agentEvents: () => agentEvents,
|
|
1400
1299
|
appMeta: () => appMeta,
|
|
@@ -1450,9 +1349,11 @@ const projects = sqliteTable("projects", {
|
|
|
1450
1349
|
realPath: text("real_path").notNull().unique(),
|
|
1451
1350
|
settingsJson: text("settings_json").notNull().default("{}"),
|
|
1452
1351
|
gitDetected: integer("git_detected", { mode: "boolean" }).notNull().default(false),
|
|
1352
|
+
/** User-defined project list order; lower values appear first. */
|
|
1353
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
1453
1354
|
createdAt: integer("created_at").notNull(),
|
|
1454
1355
|
updatedAt: integer("updated_at").notNull()
|
|
1455
|
-
}, (table) => [index("idx_projects_updated").on(table.updatedAt)]);
|
|
1356
|
+
}, (table) => [index("idx_projects_updated").on(table.updatedAt), index("idx_projects_order").on(table.sortOrder, table.updatedAt)]);
|
|
1456
1357
|
const sessions = sqliteTable("sessions", {
|
|
1457
1358
|
id: text("id").primaryKey(),
|
|
1458
1359
|
projectId: text("project_id").references(() => projects.id, { onDelete: "set null" }),
|
|
@@ -1467,7 +1368,9 @@ const sessions = sqliteTable("sessions", {
|
|
|
1467
1368
|
approvalPolicyId: text("approval_policy_id").notNull().default("standard"),
|
|
1468
1369
|
createdAt: integer("created_at").notNull(),
|
|
1469
1370
|
updatedAt: integer("updated_at").notNull(),
|
|
1470
|
-
lastActivityAt: integer("last_activity_at").notNull()
|
|
1371
|
+
lastActivityAt: integer("last_activity_at").notNull(),
|
|
1372
|
+
/** Set when the user explicitly keeps this session out of retention cleanup. */
|
|
1373
|
+
pinnedAt: integer("pinned_at")
|
|
1471
1374
|
}, (table) => [
|
|
1472
1375
|
index("idx_sessions_project_updated").on(table.projectId, table.updatedAt),
|
|
1473
1376
|
index("idx_sessions_updated").on(table.updatedAt),
|
|
@@ -1486,6 +1389,9 @@ const turns = sqliteTable("turns", {
|
|
|
1486
1389
|
inputJson: text("input_json").notNull(),
|
|
1487
1390
|
usageJson: text("usage_json"),
|
|
1488
1391
|
errorJson: text("error_json"),
|
|
1392
|
+
terminalReason: text("terminal_reason").$type(),
|
|
1393
|
+
/** Set when this Turn continues an interrupted Turn. */
|
|
1394
|
+
resumedFromTurnId: text("resumed_from_turn_id"),
|
|
1489
1395
|
idempotencyKey: text("idempotency_key"),
|
|
1490
1396
|
createdAt: integer("created_at").notNull(),
|
|
1491
1397
|
startedAt: integer("started_at"),
|
|
@@ -1580,8 +1486,12 @@ const sessionContextSummaries = sqliteTable("session_context_summaries", {
|
|
|
1580
1486
|
tokensBefore: integer("tokens_before").notNull(),
|
|
1581
1487
|
tokensAfter: integer("tokens_after").notNull(),
|
|
1582
1488
|
degraded: integer("degraded").notNull().default(0),
|
|
1489
|
+
/** `session`: cross-Turn compression; `turn`: in-Turn checkpoint. */
|
|
1490
|
+
scope: text("scope").$type().notNull().default("session"),
|
|
1491
|
+
turnId: text("turn_id"),
|
|
1492
|
+
reason: text("reason"),
|
|
1583
1493
|
createdAt: integer("created_at").notNull()
|
|
1584
|
-
}, (table) => [index("idx_context_summaries_session").on(table.sessionId, table.createdAt)]);
|
|
1494
|
+
}, (table) => [index("idx_context_summaries_session").on(table.sessionId, table.createdAt), index("idx_summaries_session_scope_created").on(table.sessionId, table.scope, table.createdAt)]);
|
|
1585
1495
|
const modelDefaults = sqliteTable("model_defaults", {
|
|
1586
1496
|
id: text("id").primaryKey(),
|
|
1587
1497
|
credentialProfileId: text("credential_profile_id").notNull().references(() => credentialProfiles.id, { onDelete: "cascade" }),
|
|
@@ -2089,8 +1999,7 @@ const scheduledJobRuns = sqliteTable("scheduled_job_runs", {
|
|
|
2089
1999
|
errorMessage: text("error_message"),
|
|
2090
2000
|
createdAt: integer("created_at").notNull()
|
|
2091
2001
|
}, (table) => [index("idx_scheduled_job_runs_job").on(table.jobId, table.createdAt), index("idx_scheduled_job_runs_status").on(table.status, table.createdAt)]);
|
|
2092
|
-
|
|
2093
|
-
//#region src/db/repositories/meta.ts
|
|
2002
|
+
// src/db/repositories/meta.ts
|
|
2094
2003
|
function getMeta(db, key) {
|
|
2095
2004
|
return db.select().from(appMeta).where(eq(appMeta.key, key)).get()?.value ?? null;
|
|
2096
2005
|
}
|
|
@@ -2117,19 +2026,18 @@ function ensureInstanceId(db, now = Date.now()) {
|
|
|
2117
2026
|
function deleteMeta(db, key) {
|
|
2118
2027
|
db.delete(appMeta).where(eq(appMeta.key, key)).run();
|
|
2119
2028
|
}
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
function readPackageVersion() {
|
|
2029
|
+
// src/version.ts
|
|
2030
|
+
function readPackageMetadata() {
|
|
2123
2031
|
try {
|
|
2124
|
-
|
|
2125
|
-
return typeof raw.version === "string" ? raw.version : "0.0.0";
|
|
2032
|
+
return JSON.parse(readFileSync(new URL("../../../package.json", import.meta.url), "utf8")) ?? {};
|
|
2126
2033
|
} catch {
|
|
2127
|
-
return
|
|
2034
|
+
return {};
|
|
2128
2035
|
}
|
|
2129
2036
|
}
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2132
|
-
|
|
2037
|
+
const metadata = readPackageMetadata();
|
|
2038
|
+
const SERVER_VERSION = typeof metadata.version === "string" ? metadata.version : "0.0.0";
|
|
2039
|
+
const SUPPORTED_NODE_RANGE = typeof metadata.engines?.node === "string" ? metadata.engines.node : "^22.22.0 || >=24";
|
|
2040
|
+
// src/db/migrate.ts
|
|
2133
2041
|
const SERVER_PACKAGE_NAME = "@larness/server";
|
|
2134
2042
|
function findServerRoot(startDirectory) {
|
|
2135
2043
|
let directory = startDirectory;
|
|
@@ -2166,8 +2074,7 @@ function expectedMigrationCount(folder = migrationsDirectory()) {
|
|
|
2166
2074
|
function quickCheck(sqlite) {
|
|
2167
2075
|
return sqlite.pragma("quick_check", { simple: true }) === "ok";
|
|
2168
2076
|
}
|
|
2169
|
-
|
|
2170
|
-
//#region src/bootstrap/config.ts
|
|
2077
|
+
// src/bootstrap/config.ts
|
|
2171
2078
|
var ConfigError = class extends Error {
|
|
2172
2079
|
issues;
|
|
2173
2080
|
constructor(message, issues = []) {
|
|
@@ -2260,8 +2167,7 @@ function resolveConfig(raw, env) {
|
|
|
2260
2167
|
webAuthn
|
|
2261
2168
|
};
|
|
2262
2169
|
}
|
|
2263
|
-
|
|
2264
|
-
//#region src/init/recovery.ts
|
|
2170
|
+
// src/init/recovery.ts
|
|
2265
2171
|
const InitPendingSchema = z.strictObject({
|
|
2266
2172
|
version: z.literal(1),
|
|
2267
2173
|
config: AppConfigSchema
|
|
@@ -2300,8 +2206,7 @@ function recoverInitialization(db, dataDir) {
|
|
|
2300
2206
|
rmSync(temporary, { force: true });
|
|
2301
2207
|
}
|
|
2302
2208
|
}
|
|
2303
|
-
|
|
2304
|
-
//#region src/db/inspect.ts
|
|
2209
|
+
// src/db/inspect.ts
|
|
2305
2210
|
function hasAuthSettings(sqlite) {
|
|
2306
2211
|
try {
|
|
2307
2212
|
const row = sqlite.prepare("SELECT count(*) AS count FROM auth_settings").get();
|
|
@@ -2357,8 +2262,7 @@ function inspectPendingInitialization(file) {
|
|
|
2357
2262
|
sqlite.close();
|
|
2358
2263
|
}
|
|
2359
2264
|
}
|
|
2360
|
-
|
|
2361
|
-
//#region src/platform/paths.ts
|
|
2265
|
+
// src/platform/paths.ts
|
|
2362
2266
|
const DATA_SUBDIRS = [
|
|
2363
2267
|
"logs",
|
|
2364
2268
|
"backups",
|
|
@@ -2430,5 +2334,4 @@ async function ensureDataDirs(dataDir) {
|
|
|
2430
2334
|
hardened
|
|
2431
2335
|
};
|
|
2432
2336
|
}
|
|
2433
|
-
|
|
2434
|
-
export { terminalLeases as $, DEPLOYMENT_ARTIFACT_MAX_PATH as $t, deploymentTargets as A, FilePathSchema as An, TerminalOutputChunkSchema as At, resourceLocks as B, GitActionDecisionSchema as Bt, commandExecutions as C, CommandIdSchema as Cn, StopProjectTerminalParamsSchema as Ct, deploymentAuthorizations as D, CommandStatusPayloadSchema as Dn, TerminalIdSchema as Dt, deploymentArtifacts as E, CommandParamsSchema as En, TerminalDevSchema as Et, modelProfiles as F, FileScopeSchema as Fn, TerminalSubscriptionSchema as Ft, schema_exports as G, WORKSPACE_JOBS_CHANGED as Gt, resourceStreams as H, GitBranchesQuerySchema as Ht, modelVisibility as I, MAX_EDITABLE_FILE_BYTES as In, TerminalTakeoverSchema as It, serviceOpsDeployments as J, ERROR_HTTP_STATUS as Jt, secrets as K, WORKSPACE_SESSIONS_CHANGED as Kt, projects as L, PlanParamsSchema as Lt, fileVersions as M, FileResultTargetSchema as Mn, TerminalRenameSchema as Mt, modelCatalogCache as N, FileSaveResultSchema as Nn, TerminalResizeSchema as Nt, deploymentBuilds as O, CommandSubscriptionSchema as On, TerminalInputSchema as Ot, modelDefaults as P, FileSaveSchema as Pn, TerminalResultTargetSchema as Pt, sessions as Q, DEPLOYMENT_ARTIFACT_MAX_FILES as Qt, resourceActions as R, ScheduledJobInputSchema as Rt, browserSessions as S, CommandCancelSchema as Sn, SendTerminalInputParamsSchema as St, deploymentApprovals as T, CommandOutputQuerySchema as Tn, TerminalCreateSchema as Tt, scheduledJobRuns as U, GitDiffQuerySchema as Ut, resourceOperations as V, GitActionSchema as Vt, scheduledJobs as W, GitLogQuerySchema as Wt, services as X, DEPLOYMENT_APPROVAL_TTL_MS as Xt, serviceOpsServices as Y, DEFAULT_PROJECT_ID as Yt, sessionContextSummaries as Z, DEPLOYMENT_ARTIFACT_MAX_BYTES as Zt, setMeta as _, DEFAULT_APP_CONFIG as _n, AcquireTerminalControlParamsSchema as _t, inspectPendingInitialization as a, DeploymentPlanDocumentSchema as an, newId as at, auditLogs as b, COMMAND_OUTPUT_RETENTION_MS as bn, ReadTerminalOutputParamsSchema as bt, loadConfig as c, DeploymentTargetNameSchema as cn, FileStreamIdSchema as ct, expectedMigrationCount as d, ServiceActionScopeSchema as dn, ResourceEventsQuerySchema as dt, DEPLOYMENT_BUILD_LOG_MAX_BYTES as en, terminals as et, findServerRoot as f, ServiceControlInputSchema as fn, ServiceEventPayloadSchema as ft, getMeta as g, AppConfigSchema as gn, ServiceSubscriptionSchema as gt, ensureInstanceId as h, hasControlCharacters as hn, ServiceStatusSchema as ht, inspectDatabase as i, DeploymentAuthorizationScopeSchema as in, webauthnCredentials as it, deviceRequests as j, FileReadQuerySchema as jn, TerminalPayloadSchema as jt, deploymentPlans as k, FileListQuerySchema as kn, TerminalLeaseSchema as kt, resolveConfig as l, DeploymentTargetRefSchema as ln, FileSubscriptionSchema as lt, SERVER_VERSION as m, ServiceOpsSubscriptionSchema as mn, ServiceRegisterInputSchema as mt, ensureDataDirs as n, DeploymentArtifactManifestSchema as nn, turns as nt, recoverInitialization as o, DeploymentSourceSchema as on, FileChangedPayloadSchema as ot, runMigrations as p, ServiceOpsEventPayloadSchema as pn, ServiceIdSchema as pt, serviceActionAuthorizations as q, ERROR_CODES as qt, resolveDataDir as r, DeploymentAuthorizationContextSchema as rn, webauthnChallenges as rt, configFilePath as s, DeploymentSpecSchema as sn, FileResyncPayloadSchema as st, DATA_SUBDIRS as t, DEPLOYMENT_PLAN_TTL_MS as tn, trustedDevices as tt, appliedMigrationCount as u, ServiceActionAuthorizationDtoSchema as un, RESOURCE_EVENT_RETENTION_MS as ut, agentEvents as v, OriginUrlSchema as vn, InterruptTerminalParamsSchema as vt, credentialProfiles as w, CommandOutputChunkSchema as wn, TERMINAL_LEASE_TTL_MS as wt, authSettings as x, COMMAND_RETENTION_MS as xn, ReleaseTerminalControlParamsSchema as xt, approvals as y, deriveWebAuthn as yn, PreviewResultTargetSchema as yt, resourceEvents as z, ScheduledJobPatchSchema as zt };
|
|
2337
|
+
export { sessions as $, DEPLOYMENT_BUILD_LOG_MAX_BYTES as $t, deploymentPlans as A, FileReadQuerySchema as An, TerminalLeaseSchema as At, resourceEvents as B, ScheduledJobPatchSchema as Bt, browserSessions as C, CommandOutputChunkSchema as Cn, SendTerminalInputParamsSchema as Ct, deploymentArtifacts as D, CommandSubscriptionSchema as Dn, TerminalDevSchema as Dt, deploymentApprovals as E, CommandStatusPayloadSchema as En, TerminalCreateSchema as Et, modelDefaults as F, MAX_EDITABLE_FILE_BYTES as Fn, TerminalResultTargetSchema as Ft, scheduledJobs as G, GitLogQuerySchema as Gt, resourceOperations as H, GitActionSchema as Ht, modelProfiles as I, TerminalSubscriptionSchema as It, serviceActionAuthorizations as J, DEFAULT_PROJECT_ID as Jt, schema_exports as K, WORKSPACE_JOBS_CHANGED as Kt, modelVisibility as L, TerminalTakeoverSchema as Lt, deviceRequests as M, FileSaveResultSchema as Mn, TerminalPayloadSchema as Mt, fileVersions as N, FileSaveSchema as Nn, TerminalRenameSchema as Nt, deploymentAuthorizations as O, FileListQuerySchema as On, TerminalIdSchema as Ot, modelCatalogCache as P, FileScopeSchema as Pn, TerminalResizeSchema as Pt, sessionContextSummaries as Q, DEPLOYMENT_ARTIFACT_MAX_PATH as Qt, projects as R, PlanParamsSchema as Rt, authSettings as S, CommandIdSchema as Sn, ReleaseTerminalControlParamsSchema as St, credentialProfiles as T, CommandParamsSchema as Tn, TERMINAL_LEASE_TTL_MS as Tt, resourceStreams as U, GitBranchesQuerySchema as Ut, resourceLocks as V, GitActionDecisionSchema as Vt, scheduledJobRuns as W, GitDiffQuerySchema as Wt, serviceOpsServices as X, DEPLOYMENT_ARTIFACT_MAX_BYTES as Xt, serviceOpsDeployments as Y, DEPLOYMENT_APPROVAL_TTL_MS as Yt, services as Z, DEPLOYMENT_ARTIFACT_MAX_FILES as Zt, getMeta as _, OriginUrlSchema as _n, ServiceSubscriptionSchema as _t, inspectPendingInitialization as a, DeploymentSourceSchema as an, webauthnCredentials as at, approvals as b, COMMAND_RETENTION_MS as bn, PreviewResultTargetSchema as bt, loadConfig as c, DeploymentTargetRefSchema as cn, FileResyncPayloadSchema as ct, expectedMigrationCount as d, ServiceControlInputSchema as dn, RESOURCE_EVENT_RETENTION_MS as dt, DEPLOYMENT_PLAN_TTL_MS as en, terminalLeases as et, findServerRoot as f, ServiceOpsEventPayloadSchema as fn, ResourceEventsQuerySchema as ft, ensureInstanceId as g, DEFAULT_APP_CONFIG as gn, ServiceStatusSchema as gt, SUPPORTED_NODE_RANGE as h, AppConfigSchema as hn, ServiceRegisterInputSchema as ht, inspectDatabase as i, DeploymentPlanDocumentSchema as in, webauthnChallenges as it, deploymentTargets as j, FileResultTargetSchema as jn, TerminalOutputChunkSchema as jt, deploymentBuilds as k, FilePathSchema as kn, TerminalInputSchema as kt, resolveConfig as l, ServiceActionAuthorizationDtoSchema as ln, FileStreamIdSchema as lt, SERVER_VERSION as m, hasControlCharacters as mn, ServiceIdSchema as mt, ensureDataDirs as n, DeploymentAuthorizationContextSchema as nn, trustedDevices as nt, recoverInitialization as o, DeploymentSpecSchema as on, newId as ot, runMigrations as p, ServiceOpsSubscriptionSchema as pn, ServiceEventPayloadSchema as pt, secrets as q, WORKSPACE_SESSIONS_CHANGED as qt, resolveDataDir as r, DeploymentAuthorizationScopeSchema as rn, turns as rt, configFilePath as s, DeploymentTargetNameSchema as sn, FileChangedPayloadSchema as st, DATA_SUBDIRS as t, DeploymentArtifactManifestSchema as tn, terminals as tt, appliedMigrationCount as u, ServiceActionScopeSchema as un, FileSubscriptionSchema as ut, setMeta as v, deriveWebAuthn as vn, AcquireTerminalControlParamsSchema as vt, commandExecutions as w, CommandOutputQuerySchema as wn, StopProjectTerminalParamsSchema as wt, auditLogs as x, CommandCancelSchema as xn, ReadTerminalOutputParamsSchema as xt, agentEvents as y, COMMAND_OUTPUT_RETENTION_MS as yn, InterruptTerminalParamsSchema as yt, resourceActions as z, ScheduledJobInputSchema as zt };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as loadConfig, i as inspectDatabase, m as SERVER_VERSION, r as resolveDataDir } from "./paths-
|
|
2
|
-
import { n as inspectInstanceLock } from "./lock-
|
|
1
|
+
import { c as loadConfig, i as inspectDatabase, m as SERVER_VERSION, r as resolveDataDir } from "./paths-BHryFHwq.js";
|
|
2
|
+
import { n as inspectInstanceLock } from "./lock-DyEoZgG_.js";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
|
|
4
|
+
// src/status.ts
|
|
5
5
|
async function collectStatus(options = {}) {
|
|
6
6
|
const env = options.env ?? process.env;
|
|
7
7
|
const dataDir = options.dataDir ?? resolveDataDir(env);
|
|
@@ -46,5 +46,4 @@ async function collectStatus(options = {}) {
|
|
|
46
46
|
warnings
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
//#endregion
|
|
50
49
|
export { collectStatus as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { n as connectIpc } from "./client-Co1thYbK.js";
|
|
2
|
+
import { r as resolveDataDir } from "./paths-BHryFHwq.js";
|
|
3
|
+
import { t as collectStatus } from "./status-idXF0pm6.js";
|
|
4
|
+
// src/cli/status.ts
|
|
5
5
|
async function readStatus() {
|
|
6
6
|
const dataDir = resolveDataDir();
|
|
7
7
|
try {
|
|
@@ -27,5 +27,4 @@ try {
|
|
|
27
27
|
process.stderr.write(`[larness] status failed: ${message}\n`);
|
|
28
28
|
process.exitCode = 1;
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export {};
|