@gmickel/gno 2.4.0 → 2.6.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 +69 -6
- package/assets/skill/README.md +5 -1
- package/assets/skill/SKILL.md +98 -1
- package/assets/skill/cli-reference.md +140 -0
- package/assets/skill/examples.md +45 -0
- package/assets/skill/mcp-reference.md +62 -0
- package/assets/skill/recipes/capture-and-file.md +6 -0
- package/assets/skill/recipes/memory-file-decision.md +6 -0
- package/assets/skill/recipes/memory-supersede-fact.md +5 -0
- package/assets/skill/recipes/session-evidence-lookup.md +98 -0
- package/assets/spa-production.json.gz +0 -0
- package/browser-extension/artifacts/{gno-browser-clipper-v2.4.0.zip → gno-browser-clipper-v2.6.0.zip} +0 -0
- package/browser-extension/artifacts/gno-browser-clipper-v2.6.0.zip.sha256 +1 -0
- package/browser-extension/dist/manifest.json +1 -1
- package/package.json +2 -1
- package/spec/cli.md +358 -24
- package/spec/compiled-context.md +68 -0
- package/spec/mcp.md +223 -2
- package/spec/output-schemas/capture-receipt.schema.json +3 -0
- package/spec/output-schemas/compiled-context-check.schema.json +44 -0
- package/spec/output-schemas/compiled-context-file.schema.json +165 -0
- package/spec/output-schemas/compiled-context-preview.schema.json +142 -0
- package/spec/output-schemas/mcp-capture-result.schema.json +3 -0
- package/spec/output-schemas/memory-remember.schema.json +8 -2
- package/spec/output-schemas/request-status.schema.json +113 -0
- package/spec/output-schemas/sessions-automation-run.schema.json +46 -0
- package/spec/output-schemas/sessions-discovery.schema.json +38 -0
- package/spec/output-schemas/sessions-import-receipt.schema.json +156 -0
- package/spec/output-schemas/sessions-status.schema.json +432 -0
- package/src/app/compiled-context-files.ts +361 -0
- package/src/app/compiled-context.ts +240 -0
- package/src/app/context-surface.ts +7 -2
- package/src/cli/commands/ask.ts +14 -2
- package/src/cli/commands/audit.ts +4 -0
- package/src/cli/commands/capture.ts +55 -96
- package/src/cli/commands/context-compiled.ts +136 -0
- package/src/cli/commands/daemon.ts +41 -0
- package/src/cli/commands/ls.ts +3 -0
- package/src/cli/commands/memory.ts +12 -3
- package/src/cli/commands/request-status.ts +59 -0
- package/src/cli/commands/reset.ts +39 -5
- package/src/cli/commands/sessions.ts +713 -0
- package/src/cli/commands/shared.ts +14 -1
- package/src/cli/errors.ts +10 -3
- package/src/cli/program.ts +458 -1
- package/src/cli/session-binding.ts +49 -0
- package/src/config/types.ts +8 -0
- package/src/core/capture-publish.ts +239 -0
- package/src/core/capture-sync.ts +3 -0
- package/src/core/compiled-context.ts +254 -0
- package/src/core/context-budget.ts +2 -10
- package/src/core/file-lock.ts +22 -5
- package/src/core/folder-setup-planning.ts +2 -1
- package/src/core/memory-remember.ts +233 -122
- package/src/core/memory-types.ts +11 -0
- package/src/core/network-boundary-inventory.ts +16 -0
- package/src/core/request-receipts.ts +671 -0
- package/src/core/setup-receipt.ts +27 -20
- package/src/core/typed-metadata.ts +4 -0
- package/src/core/validation.ts +9 -2
- package/src/core/windows-private-path.ts +96 -0
- package/src/index.ts +11 -2
- package/src/ingestion/compiled-context.ts +15 -0
- package/src/ingestion/sync.ts +40 -8
- package/src/ingestion/walker.ts +5 -4
- package/src/llm/nodeLlamaCpp/simulator-install.ts +6 -2
- package/src/mcp/context.ts +8 -0
- package/src/mcp/http-egress.ts +15 -3
- package/src/mcp/http-transport.ts +2 -0
- package/src/mcp/retrieval-warnings.ts +24 -0
- package/src/mcp/tools/ask.ts +14 -1
- package/src/mcp/tools/capture.ts +87 -83
- package/src/mcp/tools/context.ts +46 -2
- package/src/mcp/tools/index.ts +119 -7
- package/src/mcp/tools/memory-remember.ts +7 -0
- package/src/mcp/tools/memory-shared.ts +7 -1
- package/src/mcp/tools/query.ts +3 -1
- package/src/mcp/tools/request-status.ts +73 -0
- package/src/mcp/tools/search.ts +3 -1
- package/src/mcp/tools/sessions.ts +208 -0
- package/src/mcp/tools/vsearch.ts +3 -1
- package/src/sdk/client.ts +252 -89
- package/src/sdk/index.ts +13 -0
- package/src/sdk/types.ts +82 -3
- package/src/serve/capture-service.ts +98 -32
- package/src/serve/compiled-context.ts +84 -0
- package/src/serve/config-sync.ts +3 -2
- package/src/serve/public/app.tsx +15 -1
- package/src/serve/public/components/CaptureModal.tsx +26 -8
- package/src/serve/public/components/sessions/AutomationPanel.tsx +800 -0
- package/src/serve/public/components/sessions/ImportReceipt.tsx +238 -0
- package/src/serve/public/components/sessions/SessionSearch.tsx +286 -0
- package/src/serve/public/components/sessions/SourcesPanel.tsx +541 -0
- package/src/serve/public/components/sessions/api.ts +40 -0
- package/src/serve/public/components/sessions/snippet.tsx +53 -0
- package/src/serve/public/globals.built.css +1 -1
- package/src/serve/public/hooks/use-api.ts +10 -2
- package/src/serve/public/lib/request-intent.ts +69 -0
- package/src/serve/public/lib/workspace-actions.ts +12 -1
- package/src/serve/public/lib/workspace-tabs.ts +4 -0
- package/src/serve/public/pages/CompiledContext.tsx +364 -0
- package/src/serve/public/pages/Dashboard.tsx +17 -0
- package/src/serve/public/pages/DocView.tsx +15 -1
- package/src/serve/public/pages/DocumentEditor.tsx +139 -96
- package/src/serve/public/pages/Sessions.tsx +350 -0
- package/src/serve/resident-runtime.ts +43 -3
- package/src/serve/routes/api.ts +476 -147
- package/src/serve/routes/sessions.ts +766 -0
- package/src/serve/security.ts +9 -0
- package/src/serve/server.ts +248 -3
- package/src/serve/session-automation.ts +146 -0
- package/src/serve/spa-production-build.ts +6 -5
- package/src/sessions/archive.ts +348 -0
- package/src/sessions/automation-state.ts +444 -0
- package/src/sessions/automation-status.ts +239 -0
- package/src/sessions/automation.ts +1169 -0
- package/src/sessions/binding.ts +105 -0
- package/src/sessions/claude-hook.ts +240 -0
- package/src/sessions/config.ts +176 -0
- package/src/sessions/format.ts +191 -0
- package/src/sessions/import-child-env.ts +8 -0
- package/src/sessions/import-child.ts +152 -0
- package/src/sessions/parsers/claude-code.ts +259 -0
- package/src/sessions/parsers/codex.ts +303 -0
- package/src/sessions/parsers/hermes.ts +248 -0
- package/src/sessions/parsers/openclaw.ts +496 -0
- package/src/sessions/parsers/shared.ts +184 -0
- package/src/sessions/sanitize.ts +222 -0
- package/src/sessions/service.ts +1533 -0
- package/src/sessions/setup.ts +477 -0
- package/src/sessions/sources.ts +518 -0
- package/src/sessions/state.ts +118 -0
- package/src/sessions/types.ts +457 -0
- package/src/store/sqlite/adapter.ts +68 -16
- package/src/store/sqlite/scoped-index.ts +9 -0
- package/browser-extension/artifacts/gno-browser-clipper-v2.4.0.zip.sha256 +0 -1
package/src/mcp/tools/search.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
type MetadataPredicate,
|
|
25
25
|
} from "../../core/typed-metadata";
|
|
26
26
|
import { searchBm25 } from "../../pipeline/search";
|
|
27
|
+
import { appendRetrievalWarnings } from "../retrieval-warnings";
|
|
27
28
|
import { normalizeTagFilters, runTool, type ToolResult } from "./index";
|
|
28
29
|
|
|
29
30
|
interface SearchInput {
|
|
@@ -175,6 +176,7 @@ export function handleSearch(
|
|
|
175
176
|
throw cause;
|
|
176
177
|
}
|
|
177
178
|
},
|
|
178
|
-
|
|
179
|
+
(data) =>
|
|
180
|
+
appendRetrievalWarnings(formatSearchResults(data), data.meta.warnings)
|
|
179
181
|
);
|
|
180
182
|
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP session-archive tools: bounded status (including opt-in automation),
|
|
3
|
+
* import of owner-registered sources, and a run request for a configured
|
|
4
|
+
* automation profile. Thin adapters over the core sessions services. Hooks,
|
|
5
|
+
* schedules and source access are managed only by the local owner.
|
|
6
|
+
*
|
|
7
|
+
* Remote callers never discover host directories and never name paths:
|
|
8
|
+
* import accepts a registered source ID only. Import is registered only with
|
|
9
|
+
* `--enable-write`, and neither tool is part of the core profile.
|
|
10
|
+
*
|
|
11
|
+
* @module src/mcp/tools/sessions
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
|
|
16
|
+
import type { ToolContext } from "../server";
|
|
17
|
+
|
|
18
|
+
import { runAutomationProfile } from "../../sessions/automation";
|
|
19
|
+
import {
|
|
20
|
+
formatAutomationRunText,
|
|
21
|
+
formatImportReceiptText,
|
|
22
|
+
formatStatusText,
|
|
23
|
+
} from "../../sessions/format";
|
|
24
|
+
import { importInChildProcess } from "../../sessions/import-child";
|
|
25
|
+
import { SessionsService } from "../../sessions/service";
|
|
26
|
+
import {
|
|
27
|
+
MAX_IMPORT_LIMIT,
|
|
28
|
+
type SessionAutomationRunResult,
|
|
29
|
+
type SessionImportReceipt,
|
|
30
|
+
remoteSafeSessionsError,
|
|
31
|
+
} from "../../sessions/types";
|
|
32
|
+
import { runTool, type ToolResult } from "./index";
|
|
33
|
+
|
|
34
|
+
export const sessionsStatusInputSchema = z.object({});
|
|
35
|
+
|
|
36
|
+
export const sessionsImportInputSchema = z
|
|
37
|
+
.object({
|
|
38
|
+
sourceId: z
|
|
39
|
+
.string()
|
|
40
|
+
.trim()
|
|
41
|
+
.min(1)
|
|
42
|
+
.max(64)
|
|
43
|
+
.describe(
|
|
44
|
+
"ID of an owner-registered session source (see gno_sessions_status)"
|
|
45
|
+
),
|
|
46
|
+
dryRun: z
|
|
47
|
+
.boolean()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("Parse and report without writing archive or index state"),
|
|
50
|
+
limit: z
|
|
51
|
+
.number()
|
|
52
|
+
.int()
|
|
53
|
+
.min(1)
|
|
54
|
+
.max(MAX_IMPORT_LIMIT)
|
|
55
|
+
.optional()
|
|
56
|
+
.describe(
|
|
57
|
+
"Maximum changed units processed this call; the rest are deferred"
|
|
58
|
+
),
|
|
59
|
+
})
|
|
60
|
+
.strict();
|
|
61
|
+
|
|
62
|
+
export type SessionsImportToolInput = z.infer<typeof sessionsImportInputSchema>;
|
|
63
|
+
|
|
64
|
+
export const sessionsAutomationRunInputSchema = z
|
|
65
|
+
.object({
|
|
66
|
+
profileId: z
|
|
67
|
+
.string()
|
|
68
|
+
.trim()
|
|
69
|
+
.min(1)
|
|
70
|
+
.max(64)
|
|
71
|
+
.describe(
|
|
72
|
+
"ID of an owner-configured automation profile (see gno_sessions_status)"
|
|
73
|
+
),
|
|
74
|
+
})
|
|
75
|
+
.strict();
|
|
76
|
+
|
|
77
|
+
export type SessionsAutomationRunToolInput = z.infer<
|
|
78
|
+
typeof sessionsAutomationRunInputSchema
|
|
79
|
+
>;
|
|
80
|
+
|
|
81
|
+
export const SESSIONS_AUTOMATION_RUN_MCP_ANNOTATIONS = {
|
|
82
|
+
readOnlyHint: false,
|
|
83
|
+
destructiveHint: false,
|
|
84
|
+
idempotentHint: true,
|
|
85
|
+
openWorldHint: false,
|
|
86
|
+
} as const;
|
|
87
|
+
|
|
88
|
+
export const SESSIONS_STATUS_MCP_ANNOTATIONS = {
|
|
89
|
+
readOnlyHint: true,
|
|
90
|
+
destructiveHint: false,
|
|
91
|
+
idempotentHint: true,
|
|
92
|
+
openWorldHint: false,
|
|
93
|
+
} as const;
|
|
94
|
+
|
|
95
|
+
export const SESSIONS_IMPORT_MCP_ANNOTATIONS = {
|
|
96
|
+
readOnlyHint: false,
|
|
97
|
+
destructiveHint: false,
|
|
98
|
+
idempotentHint: true,
|
|
99
|
+
openWorldHint: false,
|
|
100
|
+
} as const;
|
|
101
|
+
|
|
102
|
+
function service(ctx: ToolContext): SessionsService {
|
|
103
|
+
return new SessionsService({
|
|
104
|
+
config: ctx.config,
|
|
105
|
+
configPath: ctx.actualConfigPath,
|
|
106
|
+
indexName: ctx.indexName,
|
|
107
|
+
store: ctx.store,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Re-throw as `CODE: message` (the shape runTool parses), never with host paths. */
|
|
112
|
+
function rethrowSessionsError(error: unknown): never {
|
|
113
|
+
const typed = remoteSafeSessionsError(error);
|
|
114
|
+
throw new Error(`${typed.code}: ${typed.message}`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function handleSessionsStatus(ctx: ToolContext): Promise<ToolResult> {
|
|
118
|
+
return runTool(
|
|
119
|
+
ctx,
|
|
120
|
+
"gno_sessions_status",
|
|
121
|
+
async () => {
|
|
122
|
+
try {
|
|
123
|
+
return await service(ctx).status();
|
|
124
|
+
} catch (error) {
|
|
125
|
+
return rethrowSessionsError(error);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
formatStatusText
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function handleSessionsImport(
|
|
133
|
+
args: SessionsImportToolInput,
|
|
134
|
+
ctx: ToolContext
|
|
135
|
+
): Promise<ToolResult> {
|
|
136
|
+
return runTool(
|
|
137
|
+
ctx,
|
|
138
|
+
"gno_sessions_import",
|
|
139
|
+
async () => {
|
|
140
|
+
if (!ctx.enableWrite) {
|
|
141
|
+
throw new Error(
|
|
142
|
+
"WRITE_DISABLED: gno_sessions_import requires --enable-write or GNO_MCP_ENABLE_WRITE=1"
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
let receipt: SessionImportReceipt;
|
|
146
|
+
try {
|
|
147
|
+
// A child process keeps this server answering during a long import.
|
|
148
|
+
receipt = await importInChildProcess({
|
|
149
|
+
config: ctx.config,
|
|
150
|
+
configPath: ctx.actualConfigPath,
|
|
151
|
+
indexName: ctx.indexName,
|
|
152
|
+
sourceId: args.sourceId,
|
|
153
|
+
dryRun: args.dryRun === true,
|
|
154
|
+
limit: args.limit,
|
|
155
|
+
});
|
|
156
|
+
} catch (error) {
|
|
157
|
+
return rethrowSessionsError(error);
|
|
158
|
+
}
|
|
159
|
+
if (!receipt.dryRun && receipt.lexical.collections.length > 0) {
|
|
160
|
+
ctx.markContentMutation?.();
|
|
161
|
+
ctx.markIndexMutation?.();
|
|
162
|
+
}
|
|
163
|
+
return receipt;
|
|
164
|
+
},
|
|
165
|
+
formatImportReceiptText
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function handleSessionsAutomationRun(
|
|
170
|
+
args: SessionsAutomationRunToolInput,
|
|
171
|
+
ctx: ToolContext
|
|
172
|
+
): Promise<ToolResult> {
|
|
173
|
+
return runTool(
|
|
174
|
+
ctx,
|
|
175
|
+
"gno_sessions_automation_run",
|
|
176
|
+
async () => {
|
|
177
|
+
if (!ctx.enableWrite) {
|
|
178
|
+
throw new Error(
|
|
179
|
+
"WRITE_DISABLED: gno_sessions_automation_run requires --enable-write or GNO_MCP_ENABLE_WRITE=1"
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
let result: SessionAutomationRunResult;
|
|
183
|
+
try {
|
|
184
|
+
result = await runAutomationProfile(
|
|
185
|
+
{
|
|
186
|
+
configPath: ctx.actualConfigPath,
|
|
187
|
+
indexName: ctx.indexName,
|
|
188
|
+
store: ctx.store,
|
|
189
|
+
// A child process keeps this server answering during the run.
|
|
190
|
+
inChildProcess: true,
|
|
191
|
+
},
|
|
192
|
+
args.profileId,
|
|
193
|
+
{ trigger: "manual" }
|
|
194
|
+
);
|
|
195
|
+
} catch (error) {
|
|
196
|
+
return rethrowSessionsError(error);
|
|
197
|
+
}
|
|
198
|
+
if (
|
|
199
|
+
result.receipts.some((receipt) => receipt.lexical.collections.length)
|
|
200
|
+
) {
|
|
201
|
+
ctx.markContentMutation?.();
|
|
202
|
+
ctx.markIndexMutation?.();
|
|
203
|
+
}
|
|
204
|
+
return result;
|
|
205
|
+
},
|
|
206
|
+
formatAutomationRunText
|
|
207
|
+
);
|
|
208
|
+
}
|
package/src/mcp/tools/vsearch.ts
CHANGED
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
type VectorSearchDeps,
|
|
36
36
|
} from "../../pipeline/vsearch";
|
|
37
37
|
import { createVectorIndexPort } from "../../store/vector";
|
|
38
|
+
import { appendRetrievalWarnings } from "../retrieval-warnings";
|
|
38
39
|
import { normalizeTagFilters, runTool, type ToolResult } from "./index";
|
|
39
40
|
|
|
40
41
|
interface VsearchInput {
|
|
@@ -280,6 +281,7 @@ export function handleVsearch(
|
|
|
280
281
|
await embedPort?.dispose();
|
|
281
282
|
}
|
|
282
283
|
},
|
|
283
|
-
|
|
284
|
+
(data) =>
|
|
285
|
+
appendRetrievalWarnings(formatSearchResults(data), data.meta.warnings)
|
|
284
286
|
);
|
|
285
287
|
}
|