@miniaxolotl/grove-server 1.11.24 → 1.11.28
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/dist/bootstrap.js +28 -1
- package/dist/bootstrap.js.map +4 -4
- package/dist/migrate.js +28 -1
- package/dist/migrate.js.map +4 -4
- package/dist/server.js +719 -282
- package/dist/server.js.map +4 -4
- package/dist/telemetry-build.json +1 -1
- package/dist/worker.js +223 -93
- package/dist/worker.js.map +4 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"enabled":true,"revision":"
|
|
1
|
+
{"enabled":true,"revision":"d6b98466a41776dca9beb1ab0d039dc1029d8b79","version":"1.11.28","component":"api"}
|
package/dist/worker.js
CHANGED
|
@@ -18,7 +18,7 @@ var __export = (target2, all2) => {
|
|
|
18
18
|
var define_GROVE_TELEMETRY_default;
|
|
19
19
|
var init_define_GROVE_TELEMETRY = __esm({
|
|
20
20
|
"<define:__GROVE_TELEMETRY__>"() {
|
|
21
|
-
define_GROVE_TELEMETRY_default = { enabled: true, revision: "
|
|
21
|
+
define_GROVE_TELEMETRY_default = { enabled: true, revision: "d6b98466a41776dca9beb1ab0d039dc1029d8b79", version: "1.11.28", component: "api", key: "phc_AqVrjhk7W2X2pFjyngY7uWxcSSRREfJhgr8mBmKbXYEh", cliDsn: "https://3f6d0711b5890dea4ce8e6ccf2a1a7fd@o4511632209346560.ingest.us.sentry.io/4512290791620608", apiDsn: "https://4524e8910e318110277babdfe818999b@o4511632209346560.ingest.us.sentry.io/4512290791489536" };
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
|
|
@@ -450,7 +450,7 @@ var init_share_durations = __esm({
|
|
|
450
450
|
});
|
|
451
451
|
|
|
452
452
|
// lib/shared/src/sharing.ts
|
|
453
|
-
import { z as
|
|
453
|
+
import { z as z25 } from "zod";
|
|
454
454
|
var shareTokenSchema, shareDurationSchema, shareMutationSchema, shareEnableSchema, shareScopeSchema, publicShareQuerySchema, notebook, publicNoteSchema, publicShareSchema;
|
|
455
455
|
var init_sharing = __esm({
|
|
456
456
|
"lib/shared/src/sharing.ts"() {
|
|
@@ -460,8 +460,8 @@ var init_sharing = __esm({
|
|
|
460
460
|
init_search();
|
|
461
461
|
init_limits();
|
|
462
462
|
init_share_durations();
|
|
463
|
-
shareTokenSchema =
|
|
464
|
-
shareDurationSchema =
|
|
463
|
+
shareTokenSchema = z25.string().regex(/^gsh_[A-Za-z0-9_-]{43}$/);
|
|
464
|
+
shareDurationSchema = z25.enum([
|
|
465
465
|
"1h",
|
|
466
466
|
"4h",
|
|
467
467
|
"1d",
|
|
@@ -469,45 +469,45 @@ var init_sharing = __esm({
|
|
|
469
469
|
"2w",
|
|
470
470
|
"1mo"
|
|
471
471
|
]);
|
|
472
|
-
shareMutationSchema =
|
|
472
|
+
shareMutationSchema = z25.object({
|
|
473
473
|
operationId: operationSchema,
|
|
474
|
-
expectedVersion:
|
|
474
|
+
expectedVersion: z25.number().int().positive()
|
|
475
475
|
}).strict();
|
|
476
476
|
shareEnableSchema = shareMutationSchema.extend({
|
|
477
|
-
expectedVersion:
|
|
478
|
-
expectedTargetVersion:
|
|
479
|
-
includeDescendants:
|
|
477
|
+
expectedVersion: z25.number().int().min(0),
|
|
478
|
+
expectedTargetVersion: z25.number().int().positive(),
|
|
479
|
+
includeDescendants: z25.boolean().default(false),
|
|
480
480
|
duration: shareDurationSchema.nullable().optional()
|
|
481
481
|
});
|
|
482
482
|
shareScopeSchema = shareMutationSchema.extend({
|
|
483
|
-
includeDescendants:
|
|
483
|
+
includeDescendants: z25.boolean().optional(),
|
|
484
484
|
duration: shareDurationSchema.nullable().optional()
|
|
485
485
|
}).refine(
|
|
486
486
|
(value) => value.includeDescendants !== void 0 || value.duration !== void 0,
|
|
487
487
|
"Choose a sharing setting to change"
|
|
488
488
|
);
|
|
489
|
-
publicShareQuerySchema =
|
|
490
|
-
cursor:
|
|
491
|
-
limit:
|
|
489
|
+
publicShareQuerySchema = z25.object({
|
|
490
|
+
cursor: z25.string().max(SHARE_CURSOR_MAX).optional(),
|
|
491
|
+
limit: z25.coerce.number().int().min(1).max(100).default(30)
|
|
492
492
|
}).strict();
|
|
493
|
-
notebook =
|
|
494
|
-
publicNoteSchema =
|
|
493
|
+
notebook = z25.object({ id: uuidSchema, name: z25.string() }).strict();
|
|
494
|
+
publicNoteSchema = z25.object({
|
|
495
495
|
id: uuidSchema,
|
|
496
|
-
title:
|
|
497
|
-
content:
|
|
498
|
-
updatedAt:
|
|
499
|
-
linkedNoteIds:
|
|
496
|
+
title: z25.string(),
|
|
497
|
+
content: z25.string(),
|
|
498
|
+
updatedAt: z25.string(),
|
|
499
|
+
linkedNoteIds: z25.array(uuidSchema)
|
|
500
500
|
}).strict();
|
|
501
|
-
publicShareSchema =
|
|
502
|
-
kind:
|
|
501
|
+
publicShareSchema = z25.object({
|
|
502
|
+
kind: z25.enum(["note", "notebook"]),
|
|
503
503
|
root: notebook,
|
|
504
504
|
notebook: notebook.nullable(),
|
|
505
505
|
note: publicNoteSchema.nullable(),
|
|
506
|
-
notebooks:
|
|
507
|
-
notes:
|
|
506
|
+
notebooks: z25.array(notebook),
|
|
507
|
+
notes: z25.array(
|
|
508
508
|
publicNoteSchema.pick({ id: true, title: true, updatedAt: true })
|
|
509
509
|
),
|
|
510
|
-
nextCursor:
|
|
510
|
+
nextCursor: z25.string().nullable()
|
|
511
511
|
}).strict();
|
|
512
512
|
}
|
|
513
513
|
});
|
|
@@ -4860,6 +4860,33 @@ var aiPreferences = {
|
|
|
4860
4860
|
}
|
|
4861
4861
|
};
|
|
4862
4862
|
|
|
4863
|
+
// lib/database/src/proofing-migration.ts
|
|
4864
|
+
init_define_GROVE_TELEMETRY();
|
|
4865
|
+
var proofingConsents = {
|
|
4866
|
+
name: "20261118_044_proofing_consent",
|
|
4867
|
+
async up(db) {
|
|
4868
|
+
await db.raw(`CREATE TABLE proofing_consents (
|
|
4869
|
+
account_id uuid NOT NULL REFERENCES accounts(id) ON DELETE CASCADE,
|
|
4870
|
+
scope text NOT NULL CHECK(scope='grove-note-editor'),
|
|
4871
|
+
version integer NOT NULL CHECK(version>0),
|
|
4872
|
+
generation uuid NOT NULL,
|
|
4873
|
+
automatic boolean NOT NULL,
|
|
4874
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
4875
|
+
revoked_at timestamptz,
|
|
4876
|
+
CHECK(revoked_at IS NULL OR NOT automatic),
|
|
4877
|
+
PRIMARY KEY(account_id,scope)
|
|
4878
|
+
);
|
|
4879
|
+
ALTER TABLE proofing_consents ENABLE ROW LEVEL SECURITY;
|
|
4880
|
+
ALTER TABLE proofing_consents FORCE ROW LEVEL SECURITY;
|
|
4881
|
+
CREATE POLICY tenant ON proofing_consents USING(account_id=nullif(current_setting('grove.account_id',true),'')::uuid);
|
|
4882
|
+
GRANT SELECT, INSERT, UPDATE ON proofing_consents TO grove_runtime;
|
|
4883
|
+
GRANT SELECT, DELETE ON proofing_consents TO grove_worker;`);
|
|
4884
|
+
},
|
|
4885
|
+
async down() {
|
|
4886
|
+
throw new Error("Use a forward migration");
|
|
4887
|
+
}
|
|
4888
|
+
};
|
|
4889
|
+
|
|
4863
4890
|
// lib/database/src/queue-migration.ts
|
|
4864
4891
|
init_define_GROVE_TELEMETRY();
|
|
4865
4892
|
|
|
@@ -6373,7 +6400,8 @@ var migrations = [
|
|
|
6373
6400
|
billingTrial,
|
|
6374
6401
|
writingAllowance,
|
|
6375
6402
|
dailyNotes,
|
|
6376
|
-
cacheRetention
|
|
6403
|
+
cacheRetention,
|
|
6404
|
+
proofingConsents
|
|
6377
6405
|
];
|
|
6378
6406
|
var migrationSource = {
|
|
6379
6407
|
getMigrations: async () => migrations,
|
|
@@ -6496,6 +6524,9 @@ async function probeDatabase(db) {
|
|
|
6496
6524
|
await db.raw(
|
|
6497
6525
|
"SELECT account_id, local_date, memory_id FROM daily_notes LIMIT 0"
|
|
6498
6526
|
);
|
|
6527
|
+
await db.raw(
|
|
6528
|
+
"SELECT scope, version, generation, automatic, revoked_at FROM proofing_consents LIMIT 0"
|
|
6529
|
+
);
|
|
6499
6530
|
}
|
|
6500
6531
|
var MemoryModel = class extends Model {
|
|
6501
6532
|
static tableName = "memories";
|
|
@@ -25537,6 +25568,7 @@ function cleanupHandlers(db, deleteIdentity, cancelBilling) {
|
|
|
25537
25568
|
return rows.length;
|
|
25538
25569
|
};
|
|
25539
25570
|
const count2 = await deleteBatch(table);
|
|
25571
|
+
const proofing = table === "notebook_expiries" ? await deleteBatch("proofing_consents") : 0;
|
|
25540
25572
|
const daily = table === "notebook_expiries" ? await deleteBatch("daily_notes") : 0;
|
|
25541
25573
|
const research = table === "inference_usage" ? await trx("research_account_usage").select("day").limit(batchSize) : [];
|
|
25542
25574
|
if (research.length)
|
|
@@ -25549,7 +25581,7 @@ function cleanupHandlers(db, deleteIdentity, cancelBilling) {
|
|
|
25549
25581
|
cursor: {
|
|
25550
25582
|
stage: count2 === batchSize || daily === batchSize || research.length === batchSize || cache === batchSize ? stage : stage + 1
|
|
25551
25583
|
},
|
|
25552
|
-
processed: Number(task.processed) + count2 + daily + research.length + cache
|
|
25584
|
+
processed: Number(task.processed) + count2 + daily + proofing + research.length + cache
|
|
25553
25585
|
};
|
|
25554
25586
|
});
|
|
25555
25587
|
return;
|
|
@@ -25917,6 +25949,104 @@ function speechHandlers(service, providers, store, readSource, db = service.db,
|
|
|
25917
25949
|
return { speech_transcribe: execute2, speech_synthesize: execute2 };
|
|
25918
25950
|
}
|
|
25919
25951
|
|
|
25952
|
+
// lib/memory/src/proofing-consents.ts
|
|
25953
|
+
init_define_GROVE_TELEMETRY();
|
|
25954
|
+
init_contracts();
|
|
25955
|
+
|
|
25956
|
+
// lib/shared/src/proofing-contract.ts
|
|
25957
|
+
init_define_GROVE_TELEMETRY();
|
|
25958
|
+
import { z as z22 } from "zod";
|
|
25959
|
+
|
|
25960
|
+
// lib/shared/src/writing-settings.ts
|
|
25961
|
+
init_define_GROVE_TELEMETRY();
|
|
25962
|
+
import { z as z21 } from "zod";
|
|
25963
|
+
|
|
25964
|
+
// lib/shared/src/writing-markdown.ts
|
|
25965
|
+
init_define_GROVE_TELEMETRY();
|
|
25966
|
+
|
|
25967
|
+
// lib/shared/src/writing-settings.ts
|
|
25968
|
+
var writingRules = [
|
|
25969
|
+
"brackets",
|
|
25970
|
+
"quotes",
|
|
25971
|
+
"articles",
|
|
25972
|
+
"repetition",
|
|
25973
|
+
"spacing",
|
|
25974
|
+
"capitalization",
|
|
25975
|
+
"redundancy",
|
|
25976
|
+
"agreement",
|
|
25977
|
+
"plurals",
|
|
25978
|
+
"confusion"
|
|
25979
|
+
];
|
|
25980
|
+
var personalWordLimit = 1e3;
|
|
25981
|
+
var ruleSchema = z21.object({
|
|
25982
|
+
brackets: z21.boolean().default(true),
|
|
25983
|
+
quotes: z21.boolean().default(true),
|
|
25984
|
+
articles: z21.boolean().default(true),
|
|
25985
|
+
repetition: z21.boolean().default(true),
|
|
25986
|
+
spacing: z21.boolean().default(true),
|
|
25987
|
+
capitalization: z21.boolean().default(true),
|
|
25988
|
+
redundancy: z21.boolean().default(true),
|
|
25989
|
+
agreement: z21.boolean().default(true),
|
|
25990
|
+
plurals: z21.boolean().default(true),
|
|
25991
|
+
confusion: z21.boolean().default(true)
|
|
25992
|
+
}).strict();
|
|
25993
|
+
var writingSettingsSchema = z21.object({
|
|
25994
|
+
language: z21.literal("en").default("en"),
|
|
25995
|
+
enabled: z21.boolean().default(true),
|
|
25996
|
+
spelling: z21.boolean().default(true),
|
|
25997
|
+
grammar: z21.boolean().default(true),
|
|
25998
|
+
aiRewrites: z21.boolean().default(true),
|
|
25999
|
+
automatic: z21.boolean().default(true),
|
|
26000
|
+
highlights: z21.boolean().default(true),
|
|
26001
|
+
rules: ruleSchema.default(() => ruleSchema.parse({})),
|
|
26002
|
+
words: z21.array(
|
|
26003
|
+
z21.string().min(1).max(80).regex(/^[\p{L}\p{M}]+(?:['’‐‑-][\p{L}\p{M}]+)*$/u)
|
|
26004
|
+
).max(personalWordLimit).default([])
|
|
26005
|
+
}).strict();
|
|
26006
|
+
var writingPatchSchema = z21.object({
|
|
26007
|
+
language: z21.literal("en").optional(),
|
|
26008
|
+
enabled: z21.boolean().optional(),
|
|
26009
|
+
spelling: z21.boolean().optional(),
|
|
26010
|
+
grammar: z21.boolean().optional(),
|
|
26011
|
+
aiRewrites: z21.boolean().optional(),
|
|
26012
|
+
automatic: z21.boolean().optional(),
|
|
26013
|
+
highlights: z21.boolean().optional(),
|
|
26014
|
+
rules: z21.partialRecord(z21.enum(writingRules), z21.boolean()).optional(),
|
|
26015
|
+
words: writingSettingsSchema.shape.words.removeDefault().optional()
|
|
26016
|
+
}).strict();
|
|
26017
|
+
|
|
26018
|
+
// lib/shared/src/proofing-contract.ts
|
|
26019
|
+
var consentFields = z22.strictObject({
|
|
26020
|
+
enabled: z22.boolean(),
|
|
26021
|
+
automatic: z22.boolean()
|
|
26022
|
+
});
|
|
26023
|
+
var validConsent = (value) => value.enabled || !value.automatic;
|
|
26024
|
+
var proofingConsentSchema = consentFields.refine(validConsent);
|
|
26025
|
+
var proofingConsentStatusSchema = consentFields.extend({ available: z22.boolean().optional() }).refine(validConsent);
|
|
26026
|
+
var rule = z22.enum(["spelling", ...writingRules]);
|
|
26027
|
+
var proofingCheckSchema = z22.strictObject({
|
|
26028
|
+
text: z22.string().min(1).max(1500).refine(
|
|
26029
|
+
(text5) => !/[\r\n]\s*[\r\n]|\u2029/u.test(text5.replaceAll("\r\n", "\n")) && !/[\p{Cs}]/u.test(text5)
|
|
26030
|
+
),
|
|
26031
|
+
revision: z22.int().nonnegative(),
|
|
26032
|
+
rules: z22.record(rule, z22.boolean())
|
|
26033
|
+
});
|
|
26034
|
+
var proofingResultSchema = z22.strictObject({
|
|
26035
|
+
revision: z22.int().nonnegative(),
|
|
26036
|
+
complete: z22.boolean(),
|
|
26037
|
+
issues: z22.array(
|
|
26038
|
+
z22.strictObject({
|
|
26039
|
+
id: z22.string().max(80),
|
|
26040
|
+
rule,
|
|
26041
|
+
message: rule,
|
|
26042
|
+
from: z22.int().nonnegative(),
|
|
26043
|
+
to: z22.int().max(1500),
|
|
26044
|
+
original: z22.string().max(160),
|
|
26045
|
+
replacements: z22.array(z22.string().max(100)).max(3)
|
|
26046
|
+
})
|
|
26047
|
+
).max(50)
|
|
26048
|
+
});
|
|
26049
|
+
|
|
25920
26050
|
// lib/memory/src/exports.ts
|
|
25921
26051
|
init_define_GROVE_TELEMETRY();
|
|
25922
26052
|
import { randomUUID as randomUUID11, createHash as createHash16 } from "node:crypto";
|
|
@@ -26436,13 +26566,13 @@ init_contracts();
|
|
|
26436
26566
|
|
|
26437
26567
|
// lib/shared/src/jobs.ts
|
|
26438
26568
|
init_define_GROVE_TELEMETRY();
|
|
26439
|
-
import { z as
|
|
26569
|
+
import { z as z24 } from "zod";
|
|
26440
26570
|
|
|
26441
26571
|
// lib/shared/src/web-capture.ts
|
|
26442
26572
|
init_define_GROVE_TELEMETRY();
|
|
26443
26573
|
init_contracts();
|
|
26444
26574
|
init_limits();
|
|
26445
|
-
import { z as
|
|
26575
|
+
import { z as z23 } from "zod";
|
|
26446
26576
|
var trackingParameters = /* @__PURE__ */ new Set([
|
|
26447
26577
|
"utm_source",
|
|
26448
26578
|
"utm_medium",
|
|
@@ -26483,37 +26613,37 @@ function normalizeWebUrl(input) {
|
|
|
26483
26613
|
throw new Error("Invalid source URL: too long");
|
|
26484
26614
|
return normalized;
|
|
26485
26615
|
}
|
|
26486
|
-
var webCaptureSchema =
|
|
26487
|
-
url:
|
|
26616
|
+
var webCaptureSchema = z23.object({
|
|
26617
|
+
url: z23.string().max(WEB_URL_MAX).transform((value, ctx) => {
|
|
26488
26618
|
try {
|
|
26489
26619
|
return normalizeWebUrl(value);
|
|
26490
26620
|
} catch {
|
|
26491
26621
|
ctx.addIssue({ code: "custom", message: "Invalid source URL" });
|
|
26492
|
-
return
|
|
26622
|
+
return z23.NEVER;
|
|
26493
26623
|
}
|
|
26494
26624
|
}),
|
|
26495
|
-
title:
|
|
26625
|
+
title: z23.string().max(300).refine((value) => !containsControlCharacters(value), {
|
|
26496
26626
|
message: "Source title must be a single line"
|
|
26497
26627
|
}),
|
|
26498
|
-
capturedAt:
|
|
26628
|
+
capturedAt: z23.iso.datetime()
|
|
26499
26629
|
}).strict();
|
|
26500
|
-
var browserCaptureRequestSchema =
|
|
26501
|
-
operationId:
|
|
26502
|
-
id:
|
|
26503
|
-
expectedVersion:
|
|
26504
|
-
editSession:
|
|
26630
|
+
var browserCaptureRequestSchema = z23.object({
|
|
26631
|
+
operationId: z23.uuid(),
|
|
26632
|
+
id: z23.uuid().optional(),
|
|
26633
|
+
expectedVersion: z23.number().int().positive().optional(),
|
|
26634
|
+
editSession: z23.uuid().optional(),
|
|
26505
26635
|
content: rememberSchema.shape.content,
|
|
26506
|
-
projectId:
|
|
26507
|
-
capture:
|
|
26636
|
+
projectId: z23.uuid().nullable(),
|
|
26637
|
+
capture: z23.literal("explicit"),
|
|
26508
26638
|
provenance: webCaptureSchema.optional()
|
|
26509
26639
|
}).strict().refine(
|
|
26510
26640
|
(input) => Boolean(input.id) === Boolean(input.expectedVersion),
|
|
26511
26641
|
"Updates require both id and expectedVersion"
|
|
26512
26642
|
);
|
|
26513
|
-
var browserPageRequestSchema =
|
|
26643
|
+
var browserPageRequestSchema = z23.object({
|
|
26514
26644
|
url: webCaptureSchema.shape.url,
|
|
26515
|
-
projectId:
|
|
26516
|
-
cursor:
|
|
26645
|
+
projectId: z23.uuid().nullable(),
|
|
26646
|
+
cursor: z23.string().max(2048).optional()
|
|
26517
26647
|
}).strict();
|
|
26518
26648
|
|
|
26519
26649
|
// lib/shared/src/jobs.ts
|
|
@@ -26524,22 +26654,22 @@ var queueLanes = [
|
|
|
26524
26654
|
"maintenance",
|
|
26525
26655
|
"bulk"
|
|
26526
26656
|
];
|
|
26527
|
-
var exportRequestSchema =
|
|
26528
|
-
id:
|
|
26529
|
-
projectId:
|
|
26530
|
-
includeDescendants:
|
|
26531
|
-
includeMedia:
|
|
26657
|
+
var exportRequestSchema = z24.object({
|
|
26658
|
+
id: z24.uuid(),
|
|
26659
|
+
projectId: z24.uuid().optional(),
|
|
26660
|
+
includeDescendants: z24.boolean().default(false),
|
|
26661
|
+
includeMedia: z24.boolean().optional()
|
|
26532
26662
|
}).strict();
|
|
26533
|
-
var importRecordSchema =
|
|
26534
|
-
sourceId:
|
|
26535
|
-
content:
|
|
26536
|
-
projectId:
|
|
26663
|
+
var importRecordSchema = z24.object({
|
|
26664
|
+
sourceId: z24.string().min(1).max(200),
|
|
26665
|
+
content: z24.string().min(1).max(6e3),
|
|
26666
|
+
projectId: z24.uuid().nullable().default(null),
|
|
26537
26667
|
webCapture: webCaptureSchema.optional()
|
|
26538
26668
|
}).strict();
|
|
26539
|
-
var importRequestSchema =
|
|
26540
|
-
id:
|
|
26541
|
-
source:
|
|
26542
|
-
records:
|
|
26669
|
+
var importRequestSchema = z24.object({
|
|
26670
|
+
id: z24.uuid(),
|
|
26671
|
+
source: z24.string().regex(/^[a-zA-Z0-9._-]{1,100}$/),
|
|
26672
|
+
records: z24.array(importRecordSchema).min(1).max(100)
|
|
26543
26673
|
}).strict();
|
|
26544
26674
|
|
|
26545
26675
|
// lib/memory/src/imports.ts
|
|
@@ -26669,16 +26799,16 @@ init_contracts();
|
|
|
26669
26799
|
|
|
26670
26800
|
// lib/shared/src/conversation-history.ts
|
|
26671
26801
|
init_define_GROVE_TELEMETRY();
|
|
26672
|
-
import { z as
|
|
26673
|
-
var conversationHistorySchema =
|
|
26674
|
-
query:
|
|
26675
|
-
after:
|
|
26802
|
+
import { z as z26 } from "zod";
|
|
26803
|
+
var conversationHistorySchema = z26.object({
|
|
26804
|
+
query: z26.string().trim().max(200).default(""),
|
|
26805
|
+
after: z26.string().max(2048).optional()
|
|
26676
26806
|
}).strict();
|
|
26677
|
-
var conversationHistoryCursorSchema =
|
|
26678
|
-
owner:
|
|
26679
|
-
query:
|
|
26680
|
-
id:
|
|
26681
|
-
at:
|
|
26807
|
+
var conversationHistoryCursorSchema = z26.object({
|
|
26808
|
+
owner: z26.uuid(),
|
|
26809
|
+
query: z26.string(),
|
|
26810
|
+
id: z26.uuid(),
|
|
26811
|
+
at: z26.iso.datetime()
|
|
26682
26812
|
});
|
|
26683
26813
|
|
|
26684
26814
|
// lib/memory/src/tools.ts
|
|
@@ -26688,11 +26818,11 @@ init_contracts();
|
|
|
26688
26818
|
// lib/shared/src/notebook-lifecycle.ts
|
|
26689
26819
|
init_define_GROVE_TELEMETRY();
|
|
26690
26820
|
init_contracts();
|
|
26691
|
-
import { z as
|
|
26692
|
-
var notebookLifecycleSchema =
|
|
26821
|
+
import { z as z27 } from "zod";
|
|
26822
|
+
var notebookLifecycleSchema = z27.object({
|
|
26693
26823
|
operationId: operationSchema,
|
|
26694
|
-
expectedVersion:
|
|
26695
|
-
fingerprint:
|
|
26824
|
+
expectedVersion: z27.number().int().positive(),
|
|
26825
|
+
fingerprint: z27.string().regex(/^[a-f0-9]{64}$/)
|
|
26696
26826
|
}).strict();
|
|
26697
26827
|
|
|
26698
26828
|
// lib/memory/src/system-admin.ts
|
|
@@ -26702,39 +26832,39 @@ init_contracts();
|
|
|
26702
26832
|
// lib/shared/src/system-admin.ts
|
|
26703
26833
|
init_define_GROVE_TELEMETRY();
|
|
26704
26834
|
init_contracts();
|
|
26705
|
-
import { z as
|
|
26706
|
-
var adminChangeSchema =
|
|
26835
|
+
import { z as z28 } from "zod";
|
|
26836
|
+
var adminChangeSchema = z28.object({
|
|
26707
26837
|
accountId: uuidSchema,
|
|
26708
26838
|
operationId: uuidSchema,
|
|
26709
|
-
expectedVersion:
|
|
26710
|
-
role:
|
|
26711
|
-
access:
|
|
26712
|
-
reason:
|
|
26839
|
+
expectedVersion: z28.number().int().min(0),
|
|
26840
|
+
role: z28.enum(["user", "system_admin"]),
|
|
26841
|
+
access: z28.enum(["default", "pro", "unlimited"]),
|
|
26842
|
+
reason: z28.string().trim().min(3).max(300)
|
|
26713
26843
|
}).strict();
|
|
26714
|
-
var adminSettingsSchema =
|
|
26715
|
-
captureEnabled:
|
|
26716
|
-
recallEnabled:
|
|
26717
|
-
suspended:
|
|
26718
|
-
supportNote:
|
|
26844
|
+
var adminSettingsSchema = z28.object({
|
|
26845
|
+
captureEnabled: z28.boolean(),
|
|
26846
|
+
recallEnabled: z28.boolean(),
|
|
26847
|
+
suspended: z28.boolean(),
|
|
26848
|
+
supportNote: z28.string().max(500)
|
|
26719
26849
|
}).strict();
|
|
26720
|
-
var adminSupportSchema =
|
|
26850
|
+
var adminSupportSchema = z28.object({
|
|
26721
26851
|
accountId: uuidSchema,
|
|
26722
26852
|
operationId: uuidSchema,
|
|
26723
|
-
expectedVersion:
|
|
26853
|
+
expectedVersion: z28.number().int().min(0),
|
|
26724
26854
|
expectedSettings: adminSettingsSchema,
|
|
26725
26855
|
settings: adminSettingsSchema,
|
|
26726
|
-
reason:
|
|
26856
|
+
reason: z28.string().trim().min(3).max(300)
|
|
26727
26857
|
}).strict();
|
|
26728
|
-
var adminTrialResetSchema =
|
|
26858
|
+
var adminTrialResetSchema = z28.object({
|
|
26729
26859
|
accountId: uuidSchema,
|
|
26730
26860
|
operationId: uuidSchema,
|
|
26731
|
-
reason:
|
|
26861
|
+
reason: z28.string().trim().min(3).max(300)
|
|
26732
26862
|
}).strict();
|
|
26733
|
-
var adminDetailsSchema =
|
|
26734
|
-
var adminBrowseSchema =
|
|
26735
|
-
var adminUsageReportSchema =
|
|
26736
|
-
from:
|
|
26737
|
-
to:
|
|
26863
|
+
var adminDetailsSchema = z28.object({ accountId: uuidSchema }).strict();
|
|
26864
|
+
var adminBrowseSchema = z28.object({ after: uuidSchema.optional() }).strict();
|
|
26865
|
+
var adminUsageReportSchema = z28.object({
|
|
26866
|
+
from: z28.iso.date().optional(),
|
|
26867
|
+
to: z28.iso.date().optional(),
|
|
26738
26868
|
after: uuidSchema.optional()
|
|
26739
26869
|
}).strict().superRefine((input, ctx) => {
|
|
26740
26870
|
if (!!input.from !== !!input.to || input.from && input.to && (input.from > input.to || Date.parse(input.to) - Date.parse(input.from) > 365 * 864e5))
|
|
@@ -30279,7 +30409,7 @@ function s3Media(client, bucket, spacesLifecycleVerified = false) {
|
|
|
30279
30409
|
{ abortSignal: signal }
|
|
30280
30410
|
);
|
|
30281
30411
|
if (lifecycle.Rules?.some(
|
|
30282
|
-
(
|
|
30412
|
+
(rule2) => rule2.Status === "Enabled" && (rule2.Expiration || rule2.NoncurrentVersionExpiration)
|
|
30283
30413
|
))
|
|
30284
30414
|
throw new Error("media_bucket_must_not_expire_source");
|
|
30285
30415
|
} catch (error3) {
|
|
@@ -30637,8 +30767,8 @@ This is a transactional account notification.`,
|
|
|
30637
30767
|
// packages/api/src/broker.ts
|
|
30638
30768
|
init_define_GROVE_TELEMETRY();
|
|
30639
30769
|
import amqp from "amqplib";
|
|
30640
|
-
import { z as
|
|
30641
|
-
var envelope =
|
|
30770
|
+
import { z as z29 } from "zod";
|
|
30771
|
+
var envelope = z29.object({ kind: z29.enum(["memory", "email", "task"]), id: z29.uuid() }).strict();
|
|
30642
30772
|
var queueName = (lane) => `grove.jobs.v2.${lane}`;
|
|
30643
30773
|
var limits = {
|
|
30644
30774
|
"x-message-ttl": 36e5,
|