@gmickel/gno 1.23.0 → 1.25.1

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.
Files changed (68) hide show
  1. package/README.md +26 -12
  2. package/assets/skill/SKILL.md +37 -19
  3. package/assets/skill/recipes/capture-and-file.md +20 -5
  4. package/browser-extension/artifacts/gno-browser-clipper-v1.25.1.zip +0 -0
  5. package/browser-extension/artifacts/gno-browser-clipper-v1.25.1.zip.sha256 +1 -0
  6. package/browser-extension/dist/PRIVACY.md +55 -0
  7. package/browser-extension/dist/chunk-vn5f663b.js +50 -0
  8. package/browser-extension/dist/chunk-ydfx5d7p.css +1 -0
  9. package/browser-extension/dist/content.js +1 -0
  10. package/browser-extension/dist/manifest.json +25 -0
  11. package/browser-extension/dist/preview.html +13 -0
  12. package/browser-extension/dist/service-worker.js +40 -0
  13. package/package.json +13 -3
  14. package/spec/cli.md +141 -0
  15. package/spec/db/schema.sql +101 -0
  16. package/spec/mcp.md +10 -0
  17. package/spec/output-schemas/browser-clip-preview.schema.json +83 -0
  18. package/spec/output-schemas/browser-clip.schema.json +586 -0
  19. package/spec/output-schemas/capture-receipt.schema.json +22 -1
  20. package/spec/output-schemas/clipper-csrf.schema.json +12 -0
  21. package/spec/output-schemas/clipper-error.schema.json +46 -0
  22. package/spec/output-schemas/clipper-pair-approval.schema.json +17 -0
  23. package/spec/output-schemas/clipper-pair-start.schema.json +26 -0
  24. package/spec/output-schemas/clipper-pair-status.schema.json +46 -0
  25. package/spec/output-schemas/clipper-revoke.schema.json +28 -0
  26. package/spec/output-schemas/mcp-capture-result.schema.json +12 -1
  27. package/spec/output-schemas/setup-activation-result.schema.json +456 -0
  28. package/spec/output-schemas/setup-command-result.schema.json +93 -0
  29. package/spec/output-schemas/setup-receipt.schema.json +258 -0
  30. package/spec/output-schemas/setup-semantic-receipt.schema.json +195 -0
  31. package/src/cli/commands/completion/scripts.ts +2 -0
  32. package/src/cli/commands/embed.ts +7 -2
  33. package/src/cli/commands/setup-activation.ts +324 -0
  34. package/src/cli/commands/setup-semantic.ts +591 -0
  35. package/src/cli/commands/setup.ts +410 -0
  36. package/src/cli/program.ts +64 -0
  37. package/src/cli/setup-semantic-worker.ts +177 -0
  38. package/src/core/browser-clip-provenance.ts +139 -0
  39. package/src/core/browser-clip.ts +473 -0
  40. package/src/core/capture-write.ts +5 -0
  41. package/src/core/capture.ts +75 -18
  42. package/src/core/config-mutation.ts +94 -64
  43. package/src/core/file-lock.ts +89 -36
  44. package/src/core/folder-setup-planning.ts +453 -0
  45. package/src/core/folder-setup.ts +490 -0
  46. package/src/core/setup-activation.ts +309 -0
  47. package/src/core/setup-receipt.ts +321 -0
  48. package/src/serve/capture-service.ts +420 -0
  49. package/src/serve/clipper-body.ts +62 -0
  50. package/src/serve/clipper-capture.ts +248 -0
  51. package/src/serve/clipper-contract.ts +57 -0
  52. package/src/serve/clipper-idempotency.ts +35 -0
  53. package/src/serve/clipper-pairing.ts +297 -0
  54. package/src/serve/clipper-security-errors.ts +23 -0
  55. package/src/serve/clipper-security.ts +449 -0
  56. package/src/serve/connectors.ts +29 -2
  57. package/src/serve/public/app.tsx +8 -1
  58. package/src/serve/public/globals.built.css +1 -1
  59. package/src/serve/public/index.html +1 -0
  60. package/src/serve/public/lib/clipper-approval.ts +206 -0
  61. package/src/serve/public/pages/ClipperPairing.tsx +210 -0
  62. package/src/serve/routes/api.ts +19 -115
  63. package/src/serve/routes/clipper.ts +394 -0
  64. package/src/serve/server.ts +22 -0
  65. package/src/store/migrations/020-browser-clipper-security.ts +128 -0
  66. package/src/store/migrations/index.ts +2 -0
  67. package/src/store/sqlite/clipper-store-types.ts +104 -0
  68. package/src/store/sqlite/clipper-store.ts +496 -0
@@ -0,0 +1,93 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/setup-command-result@1.0",
4
+ "title": "GNO Setup Command Result",
5
+ "description": "Closed standalone setup result with separate lexical and semantic projections.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "status", "lexical", "semantic"],
9
+ "properties": {
10
+ "schemaVersion": { "const": "1.0" },
11
+ "status": { "enum": ["completed", "failed"] },
12
+ "lexical": {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "required": ["receipt", "error"],
16
+ "properties": {
17
+ "receipt": {
18
+ "oneOf": [
19
+ { "$ref": "gno://schemas/setup-receipt@1.0" },
20
+ { "type": "null" }
21
+ ]
22
+ },
23
+ "error": {
24
+ "oneOf": [
25
+ {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["code", "message", "remediation"],
29
+ "properties": {
30
+ "code": { "type": "string", "minLength": 1 },
31
+ "message": { "type": "string", "minLength": 1 },
32
+ "remediation": { "type": "string", "minLength": 1 }
33
+ }
34
+ },
35
+ { "type": "null" }
36
+ ]
37
+ }
38
+ }
39
+ },
40
+ "semantic": {
41
+ "oneOf": [
42
+ { "$ref": "gno://schemas/setup-semantic@1.0" },
43
+ { "type": "null" }
44
+ ]
45
+ }
46
+ },
47
+ "allOf": [
48
+ {
49
+ "if": {
50
+ "properties": { "status": { "const": "completed" } },
51
+ "required": ["status"]
52
+ },
53
+ "then": {
54
+ "properties": {
55
+ "lexical": {
56
+ "type": "object",
57
+ "properties": {
58
+ "receipt": {
59
+ "allOf": [
60
+ { "$ref": "gno://schemas/setup-receipt@1.0" },
61
+ {
62
+ "type": "object",
63
+ "properties": { "status": { "const": "completed" } },
64
+ "required": ["status"]
65
+ }
66
+ ]
67
+ },
68
+ "error": { "type": "null" }
69
+ }
70
+ },
71
+ "semantic": { "$ref": "gno://schemas/setup-semantic@1.0" }
72
+ }
73
+ }
74
+ },
75
+ {
76
+ "if": {
77
+ "properties": { "status": { "const": "failed" } },
78
+ "required": ["status"]
79
+ },
80
+ "then": {
81
+ "properties": {
82
+ "lexical": {
83
+ "type": "object",
84
+ "properties": {
85
+ "error": { "type": "object" }
86
+ }
87
+ },
88
+ "semantic": { "type": "null" }
89
+ }
90
+ }
91
+ }
92
+ ]
93
+ }
@@ -0,0 +1,258 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/setup-receipt@1.0",
4
+ "title": "GNO Verified Folder Setup Receipt",
5
+ "description": "Canonical local receipt for resumable lexical-first folder setup.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "status",
11
+ "generatedAt",
12
+ "input",
13
+ "fingerprints",
14
+ "collection",
15
+ "paths",
16
+ "stages",
17
+ "pending",
18
+ "failure",
19
+ "activation"
20
+ ],
21
+ "properties": {
22
+ "schemaVersion": { "const": "1.0" },
23
+ "status": {
24
+ "enum": ["in_progress", "failed", "completed"]
25
+ },
26
+ "generatedAt": {
27
+ "type": "string",
28
+ "format": "date-time"
29
+ },
30
+ "input": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": [
34
+ "folder",
35
+ "folderFingerprint",
36
+ "indexName",
37
+ "requestedName",
38
+ "excludes",
39
+ "secretRiskAuthorized"
40
+ ],
41
+ "properties": {
42
+ "folder": { "type": "string", "minLength": 1 },
43
+ "folderFingerprint": {
44
+ "type": "string",
45
+ "pattern": "^[a-f0-9]{64}$"
46
+ },
47
+ "indexName": { "type": "string", "minLength": 1, "maxLength": 64 },
48
+ "requestedName": {
49
+ "type": ["string", "null"],
50
+ "minLength": 1,
51
+ "maxLength": 64
52
+ },
53
+ "excludes": {
54
+ "type": "array",
55
+ "uniqueItems": true,
56
+ "items": { "type": "string", "minLength": 1 }
57
+ },
58
+ "secretRiskAuthorized": { "type": "boolean" }
59
+ }
60
+ },
61
+ "fingerprints": {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "required": ["input", "config", "index"],
65
+ "properties": {
66
+ "input": { "$ref": "#/definitions/fingerprint" },
67
+ "config": {
68
+ "oneOf": [{ "$ref": "#/definitions/fingerprint" }, { "type": "null" }]
69
+ },
70
+ "index": {
71
+ "oneOf": [{ "$ref": "#/definitions/fingerprint" }, { "type": "null" }]
72
+ }
73
+ }
74
+ },
75
+ "collection": {
76
+ "type": "object",
77
+ "additionalProperties": false,
78
+ "required": ["name", "path", "disposition"],
79
+ "properties": {
80
+ "name": {
81
+ "type": ["string", "null"],
82
+ "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
83
+ },
84
+ "path": { "type": "string", "minLength": 1 },
85
+ "disposition": {
86
+ "enum": ["pending", "created", "reused"]
87
+ }
88
+ }
89
+ },
90
+ "paths": {
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "required": ["config", "receipt"],
94
+ "properties": {
95
+ "config": { "type": "string", "minLength": 1 },
96
+ "receipt": { "type": "string", "minLength": 1 }
97
+ }
98
+ },
99
+ "stages": {
100
+ "type": "object",
101
+ "additionalProperties": false,
102
+ "required": [
103
+ "preflight",
104
+ "config_saved",
105
+ "store_synced",
106
+ "lexical_indexed",
107
+ "lexical_proved",
108
+ "completed"
109
+ ],
110
+ "properties": {
111
+ "preflight": { "$ref": "#/definitions/stage" },
112
+ "config_saved": { "$ref": "#/definitions/stage" },
113
+ "store_synced": { "$ref": "#/definitions/stage" },
114
+ "lexical_indexed": { "$ref": "#/definitions/stage" },
115
+ "lexical_proved": { "$ref": "#/definitions/stage" },
116
+ "completed": { "$ref": "#/definitions/stage" }
117
+ }
118
+ },
119
+ "pending": {
120
+ "type": "array",
121
+ "uniqueItems": true,
122
+ "items": { "type": "string", "minLength": 1 }
123
+ },
124
+ "failure": {
125
+ "oneOf": [{ "$ref": "#/definitions/failure" }, { "type": "null" }]
126
+ },
127
+ "activation": {
128
+ "oneOf": [
129
+ { "$ref": "gno://schemas/activation-verification@1.0" },
130
+ { "type": "null" }
131
+ ]
132
+ }
133
+ },
134
+ "allOf": [
135
+ {
136
+ "if": {
137
+ "type": "object",
138
+ "properties": { "status": { "const": "completed" } },
139
+ "required": ["status"]
140
+ },
141
+ "then": {
142
+ "type": "object",
143
+ "properties": {
144
+ "failure": { "type": "null" },
145
+ "activation": {
146
+ "allOf": [
147
+ { "$ref": "gno://schemas/activation-verification@1.0" },
148
+ {
149
+ "type": "object",
150
+ "properties": { "ready": { "const": true } },
151
+ "required": ["ready"]
152
+ }
153
+ ]
154
+ },
155
+ "stages": {
156
+ "type": "object",
157
+ "properties": {
158
+ "preflight": {
159
+ "type": "object",
160
+ "properties": { "status": { "const": "passed" } }
161
+ },
162
+ "config_saved": {
163
+ "type": "object",
164
+ "properties": { "status": { "const": "passed" } }
165
+ },
166
+ "store_synced": {
167
+ "type": "object",
168
+ "properties": { "status": { "const": "passed" } }
169
+ },
170
+ "lexical_indexed": {
171
+ "type": "object",
172
+ "properties": { "status": { "const": "passed" } }
173
+ },
174
+ "lexical_proved": {
175
+ "type": "object",
176
+ "properties": { "status": { "const": "passed" } }
177
+ },
178
+ "completed": {
179
+ "type": "object",
180
+ "properties": { "status": { "const": "passed" } }
181
+ }
182
+ }
183
+ }
184
+ }
185
+ }
186
+ },
187
+ {
188
+ "if": {
189
+ "type": "object",
190
+ "properties": { "status": { "const": "failed" } },
191
+ "required": ["status"]
192
+ },
193
+ "then": {
194
+ "type": "object",
195
+ "properties": {
196
+ "failure": { "$ref": "#/definitions/failure" }
197
+ }
198
+ }
199
+ }
200
+ ],
201
+ "definitions": {
202
+ "fingerprint": {
203
+ "type": "string",
204
+ "pattern": "^[a-f0-9]{64}$"
205
+ },
206
+ "stage": {
207
+ "type": "object",
208
+ "additionalProperties": false,
209
+ "required": [
210
+ "status",
211
+ "token",
212
+ "startedAt",
213
+ "completedAt",
214
+ "code",
215
+ "remediation"
216
+ ],
217
+ "properties": {
218
+ "status": {
219
+ "enum": ["pending", "in_progress", "passed", "failed"]
220
+ },
221
+ "token": {
222
+ "type": ["string", "null"],
223
+ "pattern": "^[a-f0-9]{64}$"
224
+ },
225
+ "startedAt": {
226
+ "type": ["string", "null"],
227
+ "format": "date-time"
228
+ },
229
+ "completedAt": {
230
+ "type": ["string", "null"],
231
+ "format": "date-time"
232
+ },
233
+ "code": { "type": ["string", "null"] },
234
+ "remediation": { "type": ["string", "null"] }
235
+ }
236
+ },
237
+ "failure": {
238
+ "type": "object",
239
+ "additionalProperties": false,
240
+ "required": ["stage", "code", "message", "remediation"],
241
+ "properties": {
242
+ "stage": {
243
+ "enum": [
244
+ "preflight",
245
+ "config_saved",
246
+ "store_synced",
247
+ "lexical_indexed",
248
+ "lexical_proved",
249
+ "completed"
250
+ ]
251
+ },
252
+ "code": { "type": "string", "minLength": 1 },
253
+ "message": { "type": "string", "minLength": 1 },
254
+ "remediation": { "type": "string", "minLength": 1 }
255
+ }
256
+ }
257
+ }
258
+ }
@@ -0,0 +1,195 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/setup-semantic@1.0",
4
+ "title": "GNO Setup Semantic Handoff Receipt",
5
+ "description": "Privacy-bounded state for one standalone collection-scoped semantic setup worker.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "status",
11
+ "generatedAt",
12
+ "startedAt",
13
+ "completedAt",
14
+ "jobId",
15
+ "collection",
16
+ "indexName",
17
+ "folderFingerprint",
18
+ "pid",
19
+ "offline",
20
+ "setupReceiptFingerprint",
21
+ "setupReceiptPath",
22
+ "receiptPath",
23
+ "logPath",
24
+ "resumeCommand",
25
+ "counts",
26
+ "error"
27
+ ],
28
+ "properties": {
29
+ "schemaVersion": { "const": "1.0" },
30
+ "status": {
31
+ "enum": [
32
+ "scheduled",
33
+ "running",
34
+ "completed",
35
+ "failed",
36
+ "pending",
37
+ "skipped"
38
+ ]
39
+ },
40
+ "generatedAt": { "type": "string", "format": "date-time" },
41
+ "startedAt": {
42
+ "type": ["string", "null"],
43
+ "format": "date-time"
44
+ },
45
+ "completedAt": {
46
+ "type": ["string", "null"],
47
+ "format": "date-time"
48
+ },
49
+ "jobId": { "$ref": "#/definitions/fingerprint" },
50
+ "collection": {
51
+ "type": "string",
52
+ "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
53
+ },
54
+ "indexName": { "type": "string", "minLength": 1, "maxLength": 64 },
55
+ "folderFingerprint": { "$ref": "#/definitions/fingerprint" },
56
+ "pid": {
57
+ "type": ["integer", "null"],
58
+ "minimum": 1
59
+ },
60
+ "offline": { "type": "boolean" },
61
+ "setupReceiptFingerprint": { "$ref": "#/definitions/fingerprint" },
62
+ "setupReceiptPath": { "type": "string", "minLength": 1 },
63
+ "receiptPath": { "type": "string", "minLength": 1 },
64
+ "logPath": { "type": "string", "minLength": 1 },
65
+ "resumeCommand": {
66
+ "type": "string",
67
+ "pattern": "^gno .* embed "
68
+ },
69
+ "counts": {
70
+ "oneOf": [
71
+ {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["embedded", "errors"],
75
+ "properties": {
76
+ "embedded": { "type": "integer", "minimum": 0 },
77
+ "errors": { "type": "integer", "minimum": 0 }
78
+ }
79
+ },
80
+ { "type": "null" }
81
+ ]
82
+ },
83
+ "error": {
84
+ "oneOf": [
85
+ {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "required": ["message", "remediation"],
89
+ "properties": {
90
+ "message": { "type": "string", "minLength": 1, "maxLength": 500 },
91
+ "remediation": {
92
+ "type": "string",
93
+ "minLength": 1,
94
+ "maxLength": 8192
95
+ }
96
+ }
97
+ },
98
+ { "type": "null" }
99
+ ]
100
+ }
101
+ },
102
+ "allOf": [
103
+ {
104
+ "if": {
105
+ "properties": { "status": { "const": "scheduled" } },
106
+ "required": ["status"]
107
+ },
108
+ "then": {
109
+ "properties": {
110
+ "startedAt": { "type": "null" },
111
+ "completedAt": { "type": "null" },
112
+ "counts": { "type": "null" },
113
+ "error": { "type": "null" }
114
+ }
115
+ }
116
+ },
117
+ {
118
+ "if": {
119
+ "properties": { "status": { "const": "running" } },
120
+ "required": ["status"]
121
+ },
122
+ "then": {
123
+ "properties": {
124
+ "pid": { "type": "integer", "minimum": 1 },
125
+ "startedAt": { "type": "string", "format": "date-time" },
126
+ "completedAt": { "type": "null" },
127
+ "counts": { "type": "null" },
128
+ "error": { "type": "null" }
129
+ }
130
+ }
131
+ },
132
+ {
133
+ "if": {
134
+ "properties": { "status": { "const": "completed" } },
135
+ "required": ["status"]
136
+ },
137
+ "then": {
138
+ "type": "object",
139
+ "properties": {
140
+ "pid": { "type": "null" },
141
+ "counts": { "type": "object" },
142
+ "error": { "type": "null" },
143
+ "completedAt": { "type": "string", "format": "date-time" }
144
+ }
145
+ }
146
+ },
147
+ {
148
+ "if": {
149
+ "properties": { "status": { "const": "failed" } },
150
+ "required": ["status"]
151
+ },
152
+ "then": {
153
+ "type": "object",
154
+ "properties": {
155
+ "pid": { "type": "null" },
156
+ "error": { "type": "object" },
157
+ "completedAt": { "type": "string", "format": "date-time" }
158
+ }
159
+ }
160
+ },
161
+ {
162
+ "if": {
163
+ "properties": { "status": { "const": "pending" } },
164
+ "required": ["status"]
165
+ },
166
+ "then": {
167
+ "properties": {
168
+ "completedAt": { "type": "null" },
169
+ "counts": { "type": "null" },
170
+ "error": { "type": "object" }
171
+ }
172
+ }
173
+ },
174
+ {
175
+ "if": {
176
+ "properties": { "status": { "const": "skipped" } },
177
+ "required": ["status"]
178
+ },
179
+ "then": {
180
+ "type": "object",
181
+ "properties": {
182
+ "counts": { "type": "null" },
183
+ "error": { "type": "null" },
184
+ "completedAt": { "type": "string", "format": "date-time" }
185
+ }
186
+ }
187
+ }
188
+ ],
189
+ "definitions": {
190
+ "fingerprint": {
191
+ "type": "string",
192
+ "pattern": "^[a-f0-9]{64}$"
193
+ }
194
+ }
195
+ }
@@ -14,6 +14,7 @@ export const SUPPORTED_SHELLS: Shell[] = ["bash", "zsh", "fish"];
14
14
  */
15
15
  const COMMANDS = [
16
16
  "init",
17
+ "setup",
17
18
  "index",
18
19
  "update",
19
20
  "embed",
@@ -317,6 +318,7 @@ export function getCompletionScript(shell: Shell): string {
317
318
  function getCommandDescription(cmd: string): string {
318
319
  const descriptions: Record<string, string> = {
319
320
  init: "Initialize GNO configuration",
321
+ setup: "Add and verify a folder",
320
322
  index: "Index files from collections",
321
323
  update: "Sync files from disk",
322
324
  embed: "Generate embeddings",
@@ -68,6 +68,8 @@ export interface EmbedOptions {
68
68
  json?: boolean;
69
69
  /** Verbose error logging */
70
70
  verbose?: boolean;
71
+ /** Use cached models only (also used by the standalone setup worker). */
72
+ offline?: boolean;
71
73
  }
72
74
 
73
75
  export type EmbedResult =
@@ -469,9 +471,12 @@ export async function embed(options: EmbedOptions = {}): Promise<EmbedResult> {
469
471
  }
470
472
 
471
473
  // Create LLM adapter and embedding port with auto-download
472
- const globals = getGlobals();
474
+ let offline = options.offline;
475
+ if (offline === undefined) {
476
+ offline = getGlobals().offline;
477
+ }
473
478
  const policy = resolveDownloadPolicy(process.env, {
474
- offline: globals.offline,
479
+ offline,
475
480
  });
476
481
 
477
482
  // Create progress renderer for model download (throttled to avoid spam)