@miniaxolotl/grove-opencode-plugin 0.5.0 → 1.2.2
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 +2 -1
- package/dist/bridge.js +30 -7
- package/dist/cli.js +506 -32
- package/dist/hook.js +38 -4
- package/dist/index.js +38 -4
- package/dist/index.js.map +3 -3
- package/package.json +28 -28
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Prebuilt four-tool MCP bridge, memory skill and bounded automatic recall.
|
|
4
4
|
Run `grove init --client opencode --url https://YOUR-GROVE-API` with the Grove CLI,
|
|
5
5
|
or add this package to your global `plugins` array after `grove login --client opencode`.
|
|
6
|
-
|
|
6
|
+
OpenCode reloads watched configuration automatically; check its MCP tools and
|
|
7
|
+
restart if Grove has not appeared. Set `private: true` in plugin options or `GROVE_PRIVATE=1` to
|
|
7
8
|
disable automatic context. No raw transcripts or tool logs are captured.
|
|
8
9
|
|
|
9
10
|
See [installation and scopes](https://github.com/miniaxolotl/grove/blob/development/documentation/client.md).
|
package/dist/bridge.js
CHANGED
|
@@ -29124,10 +29124,14 @@ var rememberSchema = external_exports.object({
|
|
|
29124
29124
|
capture: external_exports.enum(["explicit", "automatic"]).default("explicit"),
|
|
29125
29125
|
archived: external_exports.boolean().default(false),
|
|
29126
29126
|
kind: kindSchema.default("fact"),
|
|
29127
|
+
autoKind: external_exports.boolean().default(false),
|
|
29127
29128
|
projectId: uuidSchema.nullable().default(null),
|
|
29128
29129
|
taskId: external_exports.string().min(1).max(128).optional(),
|
|
29130
|
+
retentionDays: external_exports.number().int().min(1).max(365).nullable().optional(),
|
|
29129
29131
|
source: sourceSchema.default({ agent: "api" })
|
|
29130
29132
|
}).strict().superRefine((input, ctx) => {
|
|
29133
|
+
if (input.autoKind && input.kind === "handoff")
|
|
29134
|
+
ctx.addIssue({ code: "custom", message: "Handoff kind is explicit" });
|
|
29131
29135
|
if (Boolean(input.id) !== Boolean(input.expectedVersion)) {
|
|
29132
29136
|
ctx.addIssue({
|
|
29133
29137
|
code: "custom",
|
|
@@ -29149,6 +29153,11 @@ var rememberSchema = external_exports.object({
|
|
|
29149
29153
|
var listSchema = external_exports.object({
|
|
29150
29154
|
projectId: uuidSchema.nullable().optional(),
|
|
29151
29155
|
kind: kindSchema.optional(),
|
|
29156
|
+
tag: external_exports.string().trim().min(1).max(40).optional(),
|
|
29157
|
+
sourceAgent: sourceSchema.shape.agent.removeDefault().optional(),
|
|
29158
|
+
updatedAfter: external_exports.iso.datetime().optional(),
|
|
29159
|
+
sort: external_exports.enum(["updated_desc", "updated_asc", "created_desc"]).optional(),
|
|
29160
|
+
lifetime: external_exports.enum(["permanent", "ephemeral"]).optional(),
|
|
29152
29161
|
status: external_exports.enum(["active", "archived", "expired", "all"]).default("active"),
|
|
29153
29162
|
query: external_exports.string().trim().max(1e3).optional(),
|
|
29154
29163
|
cursor: external_exports.string().max(2048).optional(),
|
|
@@ -29192,20 +29201,31 @@ var grantSchema = external_exports.object({
|
|
|
29192
29201
|
var connectionSchema = grantSchema.extend({
|
|
29193
29202
|
clientId: external_exports.string().min(1).max(500)
|
|
29194
29203
|
});
|
|
29204
|
+
var agentSchema = external_exports.enum(["opencode", "claude", "codex"]);
|
|
29205
|
+
var connectSchema = external_exports.object({
|
|
29206
|
+
agent: agentSchema,
|
|
29207
|
+
project: projectSchema.nullable()
|
|
29208
|
+
}).strict();
|
|
29209
|
+
var approveConnectSchema = grantSchema.extend({
|
|
29210
|
+
currentProject: external_exports.boolean().default(true)
|
|
29211
|
+
});
|
|
29195
29212
|
var memorySchema = external_exports.object({
|
|
29196
29213
|
id: uuidSchema,
|
|
29197
29214
|
projectId: uuidSchema.nullable(),
|
|
29198
29215
|
content: external_exports.string(),
|
|
29199
29216
|
kind: kindSchema,
|
|
29217
|
+
autoKind: external_exports.boolean().optional(),
|
|
29200
29218
|
status: external_exports.enum(["active", "archived"]),
|
|
29201
29219
|
version: external_exports.number().int(),
|
|
29202
29220
|
source: sourceSchema,
|
|
29203
29221
|
taskId: external_exports.string().nullable(),
|
|
29222
|
+
retentionDays: external_exports.number().int().nullable().optional(),
|
|
29204
29223
|
expiresAt: external_exports.string().nullable(),
|
|
29205
29224
|
purgeAt: external_exports.string().nullable(),
|
|
29206
29225
|
createdAt: external_exports.string(),
|
|
29207
29226
|
updatedAt: external_exports.string(),
|
|
29208
|
-
indexing: external_exports.enum(["pending", "ready", "failed"])
|
|
29227
|
+
indexing: external_exports.enum(["disabled", "pending", "ready", "failed"]),
|
|
29228
|
+
enrichment: external_exports.custom().optional()
|
|
29209
29229
|
});
|
|
29210
29230
|
var GroveError = class extends Error {
|
|
29211
29231
|
constructor(code, message, status = 400) {
|
|
@@ -29230,7 +29250,7 @@ function createMemoryMcp(execute2) {
|
|
|
29230
29250
|
{
|
|
29231
29251
|
name: "remember",
|
|
29232
29252
|
schema: rememberSchema,
|
|
29233
|
-
description: "Save a concise durable memory, or correct one by id and expectedVersion. Reuse operationId when retrying. Handoffs require taskId and expire after 30 days (purged after 90)."
|
|
29253
|
+
description: "Save a concise durable memory, or correct one by id and expectedVersion. Set autoKind=true to let the configured decision model select a durable kind; otherwise the supplied kind is preserved. Reuse operationId when retrying. Handoffs require taskId and expire after 30 days (purged after 90)."
|
|
29234
29254
|
},
|
|
29235
29255
|
{
|
|
29236
29256
|
name: "recall",
|
|
@@ -29240,7 +29260,7 @@ function createMemoryMcp(execute2) {
|
|
|
29240
29260
|
{
|
|
29241
29261
|
name: "memories",
|
|
29242
29262
|
schema: listSchema,
|
|
29243
|
-
description: "Inspect memories with IDs, current versions, provenance, status filters and cursor pagination. Use the returned version for corrections/deletion."
|
|
29263
|
+
description: "Inspect memories with IDs, current versions, provenance, generated titles/tags/relationships, status and tag filters, hybrid text/semantic search and cursor pagination. Use the returned version for corrections/deletion."
|
|
29244
29264
|
},
|
|
29245
29265
|
{
|
|
29246
29266
|
name: "forget",
|
|
@@ -30412,8 +30432,8 @@ async function withStoreLock(run, signal) {
|
|
|
30412
30432
|
await rm(lock, { recursive: true, force: true });
|
|
30413
30433
|
}
|
|
30414
30434
|
}
|
|
30415
|
-
async function configuredOrigin(override) {
|
|
30416
|
-
const origin = override ?? process.env.GROVE_API_URL ?? (await readConfig())
|
|
30435
|
+
async function configuredOrigin(override, agent, fallback) {
|
|
30436
|
+
const origin = override ?? (process.env.GROVE_API_URL || void 0) ?? activeOrigin(await readConfig(), agent) ?? fallback;
|
|
30417
30437
|
if (!origin)
|
|
30418
30438
|
throw new GroveError(
|
|
30419
30439
|
"not_configured",
|
|
@@ -30421,6 +30441,9 @@ async function configuredOrigin(override) {
|
|
|
30421
30441
|
);
|
|
30422
30442
|
return apiOrigin(origin);
|
|
30423
30443
|
}
|
|
30444
|
+
function activeOrigin(config2, agent) {
|
|
30445
|
+
return agent && config2.origins?.[agent] || config2.origin;
|
|
30446
|
+
}
|
|
30424
30447
|
function credentialPath(origin, agent, accountId) {
|
|
30425
30448
|
return join(
|
|
30426
30449
|
configDirectory(),
|
|
@@ -30556,7 +30579,7 @@ async function bearer(origin, agent, signal) {
|
|
|
30556
30579
|
}, signal);
|
|
30557
30580
|
}
|
|
30558
30581
|
async function nodeClient(agent = "cli", origin, timeoutMs = 1e4) {
|
|
30559
|
-
const endpoint = await configuredOrigin(origin);
|
|
30582
|
+
const endpoint = await configuredOrigin(origin, agent);
|
|
30560
30583
|
return new ApiClient(
|
|
30561
30584
|
endpoint,
|
|
30562
30585
|
(signal) => bearer(endpoint, agent, signal),
|
|
@@ -30566,8 +30589,8 @@ async function nodeClient(agent = "cli", origin, timeoutMs = 1e4) {
|
|
|
30566
30589
|
|
|
30567
30590
|
// packages/mcp/src/bridge.ts
|
|
30568
30591
|
async function startBridge(agent = "cli") {
|
|
30569
|
-
const client = await nodeClient(agent);
|
|
30570
30592
|
const server = createMemoryMcp(async (tool, raw, signal) => {
|
|
30593
|
+
const client = await nodeClient(agent);
|
|
30571
30594
|
const input = { ...raw };
|
|
30572
30595
|
if (tool === "remember")
|
|
30573
30596
|
input.source = { ...input.source, agent };
|