@miniaxolotl/grove-server 1.11.2 → 1.11.3
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/server.js +86 -19
- package/dist/server.js.map +2 -2
- package/dist/telemetry-build.json +1 -1
- package/dist/worker.js +52 -2
- package/dist/worker.js.map +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"enabled":true,"revision":"
|
|
1
|
+
{"enabled":true,"revision":"311212e29921d19c8f58b2ca5382ec0790867293","version":"1.11.3","component":"api"}
|
package/dist/worker.js
CHANGED
|
@@ -13,7 +13,7 @@ var __export = (target, all2) => {
|
|
|
13
13
|
var define_GROVE_TELEMETRY_default;
|
|
14
14
|
var init_define_GROVE_TELEMETRY = __esm({
|
|
15
15
|
"<define:__GROVE_TELEMETRY__>"() {
|
|
16
|
-
define_GROVE_TELEMETRY_default = { enabled: true, revision: "
|
|
16
|
+
define_GROVE_TELEMETRY_default = { enabled: true, revision: "311212e29921d19c8f58b2ca5382ec0790867293", version: "1.11.3", component: "api", key: "phc_AqVrjhk7W2X2pFjyngY7uWxcSSRREfJhgr8mBmKbXYEh", cliDsn: "https://3f6d0711b5890dea4ce8e6ccf2a1a7fd@o4511632209346560.ingest.us.sentry.io/4512290791620608", apiDsn: "https://4524e8910e318110277babdfe818999b@o4511632209346560.ingest.us.sentry.io/4512290791489536" };
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
|
|
@@ -4498,6 +4498,11 @@ var serverSchema = z.object({
|
|
|
4498
4498
|
API_INTERACTIVE_TIMEOUT_MS: z.coerce.number().int().min(100).max(18e4).default(9e4),
|
|
4499
4499
|
API_ORIGIN: origin,
|
|
4500
4500
|
SITE_URL: origin,
|
|
4501
|
+
// Public ownership proof, never an account credential. Empty values are omitted below.
|
|
4502
|
+
OPENAI_APPS_CHALLENGE: z.string().min(1).max(512).refine(
|
|
4503
|
+
(value) => !/\s/.test(value),
|
|
4504
|
+
"Use the exact non-whitespace verification token"
|
|
4505
|
+
).optional(),
|
|
4501
4506
|
CLERK_PUBLISHABLE_KEY: z.string().startsWith("pk_"),
|
|
4502
4507
|
CLERK_SECRET_KEY: z.string().startsWith("sk_"),
|
|
4503
4508
|
CLERK_ISSUER: origin,
|
|
@@ -12851,6 +12856,9 @@ var grantSchema = z7.object({
|
|
|
12851
12856
|
var connectionSchema = grantSchema.extend({
|
|
12852
12857
|
clientId: z7.string().min(1).max(500)
|
|
12853
12858
|
});
|
|
12859
|
+
var connectionUpdateSchema = grantSchema.extend({
|
|
12860
|
+
expectedState: z7.string().regex(/^[a-f0-9]{64}$/).optional()
|
|
12861
|
+
});
|
|
12854
12862
|
var agentSchema = z7.enum(["opencode", "claude", "codex"]);
|
|
12855
12863
|
var connectSchema = z7.object({
|
|
12856
12864
|
agent: agentSchema,
|
|
@@ -12951,25 +12959,30 @@ var notebookToolLifecycleSchema = z8.object({
|
|
|
12951
12959
|
);
|
|
12952
12960
|
var memoryTools = {
|
|
12953
12961
|
remember: {
|
|
12962
|
+
title: "Save a memory",
|
|
12954
12963
|
schema: rememberSchema,
|
|
12955
12964
|
description: "Save a concise memory or replace it by id/expectedVersion. Corrections replace metadata too: prefer update_memory for partial edits. Reuse operationId on retries. Handoffs default to 30 days; expired records are hidden and later soft-deleted."
|
|
12956
12965
|
},
|
|
12957
12966
|
recall: {
|
|
12967
|
+
title: "Recall saved context",
|
|
12958
12968
|
schema: recallSchema,
|
|
12959
12969
|
readOnly: true,
|
|
12960
12970
|
description: "Recall bounded relevant active memories in the explicit project/personal scope. Without query, retrieve a compact profile and selected task handoff."
|
|
12961
12971
|
},
|
|
12962
12972
|
memories: {
|
|
12973
|
+
title: "Find memories",
|
|
12963
12974
|
schema: listSchema,
|
|
12964
12975
|
readOnly: true,
|
|
12965
12976
|
description: "Search and list notes with IDs, versions, provenance, status/tag filters and cursor pagination. Omit projectId to inspect all granted scopes; null means Personal."
|
|
12966
12977
|
},
|
|
12967
12978
|
forget: {
|
|
12979
|
+
title: "Delete selected memories",
|
|
12968
12980
|
schema: forgetSchema,
|
|
12969
12981
|
destructive: true,
|
|
12970
12982
|
description: "Soft-delete exact note IDs at their expectedVersion. Retained authored history is hidden, not physically erased. There is no ordinary restore/Undo for deletion. Inspect each outcome; previously delivered text cannot be retracted."
|
|
12971
12983
|
},
|
|
12972
12984
|
get_memory: {
|
|
12985
|
+
title: "Read a memory",
|
|
12973
12986
|
schema: z8.object({
|
|
12974
12987
|
id: uuidSchema,
|
|
12975
12988
|
revision: z8.number().int().positive().optional()
|
|
@@ -12978,19 +12991,23 @@ var memoryTools = {
|
|
|
12978
12991
|
description: "Read one exact note by ID, optionally at a historical revision. Current scope, deletion and historical-source expiry checks still apply."
|
|
12979
12992
|
},
|
|
12980
12993
|
memory_history: {
|
|
12994
|
+
title: "Read memory history",
|
|
12981
12995
|
schema: z8.object({ id: uuidSchema }).strict(),
|
|
12982
12996
|
readOnly: true,
|
|
12983
12997
|
description: "Read up to 100 most recent revisions of an accessible note. Use get_memory with revision for historical content."
|
|
12984
12998
|
},
|
|
12985
12999
|
update_memory: {
|
|
13000
|
+
title: "Update a memory",
|
|
12986
13001
|
schema: memoryUpdateSchema,
|
|
12987
13002
|
description: "Partially update a note at expectedVersion. Omitted content, scope, kind, provenance and lifetime are preserved. projectId moves the note; null means Personal. Reuse operationId on retry."
|
|
12988
13003
|
},
|
|
12989
13004
|
move_memories: {
|
|
13005
|
+
title: "Move memories",
|
|
12990
13006
|
schema: moveMemoriesSchema,
|
|
12991
13007
|
description: "Atomically move up to 50 exact ID/version notes into an existing notebook (projectId) or Personal (null). Preserve content and metadata; source and destination must be granted. Reuse operationId."
|
|
12992
13008
|
},
|
|
12993
13009
|
archive_memory: {
|
|
13010
|
+
title: "Archive a memory",
|
|
12994
13011
|
schema: z8.object({
|
|
12995
13012
|
id: uuidSchema,
|
|
12996
13013
|
operationId: operationSchema,
|
|
@@ -12999,23 +13016,28 @@ var memoryTools = {
|
|
|
12999
13016
|
description: "Archive an exact note at expectedVersion, removing it from recall. Content/history remain available; restore_memory reverses archive. Reuse operationId."
|
|
13000
13017
|
},
|
|
13001
13018
|
restore_memory: {
|
|
13019
|
+
title: "Restore a memory",
|
|
13002
13020
|
schema: versionSchema.extend({ id: uuidSchema }),
|
|
13003
13021
|
description: "Restore an archived/expired note or a historical revision at expectedVersion. Deleted notes cannot be restored. Optional revision selects history; durable removes expiry. Reuse operationId."
|
|
13004
13022
|
},
|
|
13005
13023
|
notebooks: {
|
|
13024
|
+
title: "Find notebooks",
|
|
13006
13025
|
schema: notebookListSchema,
|
|
13007
13026
|
readOnly: true,
|
|
13008
13027
|
description: "List/search granted notebooks (folders) with IDs, names, parentId, versions and cursor pagination. Follow every page to build a tree. Archived notebooks require an owner website session."
|
|
13009
13028
|
},
|
|
13010
13029
|
create_notebook: {
|
|
13030
|
+
title: "Create a notebook",
|
|
13011
13031
|
schema: notebookCreateSchema,
|
|
13012
13032
|
description: "Create a notebook, optionally under parentId. Requires all-project write access or an owner session. Reuse operationId for retry-safe creation."
|
|
13013
13033
|
},
|
|
13014
13034
|
update_notebook: {
|
|
13035
|
+
title: "Update a notebook",
|
|
13015
13036
|
schema: notebookUpdateSchema,
|
|
13016
13037
|
description: "Rename and/or move an existing notebook at expectedVersion. Omitted fields are preserved; parentId=null moves to root. Source and parent must be granted; cycles are rejected. Reuse operationId."
|
|
13017
13038
|
},
|
|
13018
13039
|
notebook_lifecycle: {
|
|
13040
|
+
title: "Manage notebook lifecycle",
|
|
13019
13041
|
schema: notebookToolLifecycleSchema,
|
|
13020
13042
|
destructive: true,
|
|
13021
13043
|
description: "Owner website session only: preview a notebook subtree, then archive/restore/soft-delete using its fingerprint, expectedVersion and operationId. Agent OAuth/API keys cannot administer subtrees. Deletion hides retained history and has no ordinary Undo."
|
|
@@ -20273,11 +20295,33 @@ ${input.query}`.slice(-1e3) : input.query;
|
|
|
20273
20295
|
if (created) currentTelemetry().capture("notebook_created");
|
|
20274
20296
|
return result;
|
|
20275
20297
|
}
|
|
20298
|
+
connectionState(connection) {
|
|
20299
|
+
return createHmac2("sha256", this.cursorSecret).update(
|
|
20300
|
+
JSON.stringify([
|
|
20301
|
+
"connection-review-v1",
|
|
20302
|
+
connection.accountId,
|
|
20303
|
+
connection.id,
|
|
20304
|
+
connection.clientId,
|
|
20305
|
+
connection.name,
|
|
20306
|
+
[...connection.capabilities].sort(),
|
|
20307
|
+
connection.personal,
|
|
20308
|
+
connection.allProjects,
|
|
20309
|
+
[...connection.projectIds].sort(),
|
|
20310
|
+
connection.expiresAt,
|
|
20311
|
+
connection.revokedAt,
|
|
20312
|
+
connection.authorizedAfter,
|
|
20313
|
+
connection.setup ?? null
|
|
20314
|
+
])
|
|
20315
|
+
).digest("hex");
|
|
20316
|
+
}
|
|
20276
20317
|
async connections(principal) {
|
|
20277
20318
|
return this.access(
|
|
20278
20319
|
principal,
|
|
20279
20320
|
"admin",
|
|
20280
|
-
async ({ trx }) => trx("connections").orderBy("createdAt", "desc").limit(100)
|
|
20321
|
+
async ({ trx }) => (await trx("connections").orderBy("createdAt", "desc").limit(100)).map((connection) => ({
|
|
20322
|
+
...connection,
|
|
20323
|
+
state: this.connectionState(connection)
|
|
20324
|
+
}))
|
|
20281
20325
|
);
|
|
20282
20326
|
}
|
|
20283
20327
|
async grant(principal, input, options = {}) {
|
|
@@ -20297,6 +20341,12 @@ ${input.query}`.slice(-1e3) : input.query;
|
|
|
20297
20341
|
const old = await trx("connections").where({ id: options.id }).forUpdate().first();
|
|
20298
20342
|
if (!old)
|
|
20299
20343
|
throw new GroveError("not_found", "Connection not found", 404);
|
|
20344
|
+
if (options.expectedState && options.expectedState !== this.connectionState(old))
|
|
20345
|
+
throw new GroveError(
|
|
20346
|
+
"connection_conflict",
|
|
20347
|
+
"Connection access changed. Close this dialog, refresh Connections, and review the current permissions before saving.",
|
|
20348
|
+
409
|
|
20349
|
+
);
|
|
20300
20350
|
if (old.revokedAt && !old.clientId)
|
|
20301
20351
|
throw new GroveError(
|
|
20302
20352
|
"connection_revoked",
|