@gmickel/gno 1.24.0 → 1.26.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.
Files changed (96) hide show
  1. package/README.md +18 -4
  2. package/assets/skill/SKILL.md +40 -17
  3. package/assets/skill/recipes/capture-and-file.md +20 -5
  4. package/browser-extension/artifacts/gno-browser-clipper-v1.26.0.zip +0 -0
  5. package/browser-extension/artifacts/gno-browser-clipper-v1.26.0.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 +196 -4
  15. package/spec/db/schema.sql +102 -1
  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/project-profile-apply.schema.json +209 -0
  28. package/spec/output-schemas/project-profile-command.schema.json +160 -0
  29. package/spec/output-schemas/query-diagnose.schema.json +7 -1
  30. package/spec/output-schemas/setup-profile-result.schema.json +87 -0
  31. package/spec/project-profile.schema.json +301 -0
  32. package/src/cli/commands/collection/add.ts +39 -45
  33. package/src/cli/commands/collection/remove.ts +28 -28
  34. package/src/cli/commands/collection/rename.ts +55 -73
  35. package/src/cli/commands/context/add.ts +37 -26
  36. package/src/cli/commands/context/rm.ts +47 -20
  37. package/src/cli/commands/init.ts +55 -125
  38. package/src/cli/commands/models/use.ts +43 -38
  39. package/src/cli/commands/profile-apply.ts +334 -0
  40. package/src/cli/commands/profile.ts +409 -0
  41. package/src/cli/commands/setup-activation.ts +205 -54
  42. package/src/cli/commands/setup-profile.ts +223 -0
  43. package/src/cli/commands/setup.ts +3 -0
  44. package/src/cli/program.ts +110 -9
  45. package/src/config/index.ts +3 -0
  46. package/src/config/project-profile.ts +367 -0
  47. package/src/config/saver.ts +16 -7
  48. package/src/config/types.ts +42 -0
  49. package/src/core/browser-clip-provenance.ts +139 -0
  50. package/src/core/browser-clip.ts +473 -0
  51. package/src/core/capture-write.ts +5 -0
  52. package/src/core/capture.ts +75 -18
  53. package/src/core/config-mutation.ts +138 -76
  54. package/src/core/config-write-lock.ts +89 -0
  55. package/src/core/context-identity.ts +16 -0
  56. package/src/core/context-resolver.ts +2 -12
  57. package/src/core/file-lock.ts +20 -6
  58. package/src/core/folder-setup-planning.ts +6 -21
  59. package/src/core/folder-setup.ts +30 -2
  60. package/src/core/path-rules.ts +53 -0
  61. package/src/core/project-affinity-surface.ts +102 -7
  62. package/src/core/project-profile-apply-state.ts +268 -0
  63. package/src/core/project-profile-apply-validation.ts +95 -0
  64. package/src/core/project-profile-apply.ts +408 -0
  65. package/src/core/project-profile-canonical.ts +71 -0
  66. package/src/core/project-profile-diff.ts +302 -0
  67. package/src/core/project-profile-discovery.ts +519 -0
  68. package/src/core/project-profile-file.ts +37 -0
  69. package/src/core/project-profile-parser.ts +98 -0
  70. package/src/core/project-profile.ts +490 -0
  71. package/src/ingestion/walker.ts +85 -44
  72. package/src/llm/cache.ts +21 -0
  73. package/src/serve/capture-service.ts +420 -0
  74. package/src/serve/clipper-body.ts +62 -0
  75. package/src/serve/clipper-capture.ts +248 -0
  76. package/src/serve/clipper-contract.ts +57 -0
  77. package/src/serve/clipper-idempotency.ts +35 -0
  78. package/src/serve/clipper-pairing.ts +297 -0
  79. package/src/serve/clipper-security-errors.ts +23 -0
  80. package/src/serve/clipper-security.ts +449 -0
  81. package/src/serve/config-sync.ts +2 -2
  82. package/src/serve/public/app.tsx +8 -1
  83. package/src/serve/public/globals.built.css +1 -1
  84. package/src/serve/public/index.html +1 -0
  85. package/src/serve/public/lib/clipper-approval.ts +206 -0
  86. package/src/serve/public/pages/ClipperPairing.tsx +210 -0
  87. package/src/serve/resident-runtime.ts +1 -0
  88. package/src/serve/routes/api.ts +20 -115
  89. package/src/serve/routes/clipper.ts +394 -0
  90. package/src/serve/server.ts +22 -0
  91. package/src/store/migrations/020-browser-clipper-security.ts +128 -0
  92. package/src/store/migrations/021-multi-context-identity.ts +37 -0
  93. package/src/store/migrations/index.ts +4 -0
  94. package/src/store/sqlite/adapter.ts +83 -0
  95. package/src/store/sqlite/clipper-store-types.ts +104 -0
  96. package/src/store/sqlite/clipper-store.ts +496 -0
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/clipper-error@1.0",
4
+ "title": "Browser Clipper Error",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["error"],
8
+ "properties": {
9
+ "error": {
10
+ "type": "object",
11
+ "additionalProperties": false,
12
+ "required": ["code", "message"],
13
+ "properties": {
14
+ "code": {
15
+ "enum": [
16
+ "CLIPPER_ABORTED",
17
+ "CLIPPER_BODY_TOO_LARGE",
18
+ "CLIPPER_BUSY",
19
+ "CLIPPER_FORBIDDEN",
20
+ "CLIPPER_INVALID_JSON",
21
+ "CLIPPER_RATE_LIMITED",
22
+ "CLIPPER_UNAUTHORIZED",
23
+ "CLIPPER_PAIRING_UNAVAILABLE",
24
+ "CLIPPER_CSRF",
25
+ "CLIPPER_INVALID_REQUEST",
26
+ "CLIPPER_PAIR_NOT_FOUND",
27
+ "CLIPPER_PAIR_EXPIRED",
28
+ "CLIPPER_PAIR_INVALID_CODE",
29
+ "CLIPPER_PAIR_ALREADY_USED",
30
+ "CLIPPER_PREVIEW_MISMATCH",
31
+ "CLIPPER_PREVIEW_REQUIRED",
32
+ "CLIPPER_IDEMPOTENCY_PENDING",
33
+ "CLIPPER_IDEMPOTENCY_CONFLICT",
34
+ "CLIPPER_IDEMPOTENCY_RECOVERY_CONFLICT",
35
+ "CLIPPER_IDEMPOTENCY_GRANT_INACTIVE",
36
+ "CLIPPER_CAPTURE_FAILED",
37
+ "NOT_FOUND",
38
+ "RUNTIME",
39
+ "VALIDATION"
40
+ ]
41
+ },
42
+ "message": { "type": "string", "minLength": 1 }
43
+ }
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/clipper-pair-approval@1.0",
4
+ "title": "Browser Clipper Pair Approval",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "status", "origin", "expiresAt"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "1.0" },
10
+ "status": { "const": "approved" },
11
+ "origin": {
12
+ "type": "string",
13
+ "pattern": "^chrome-extension://[a-p]{32}$"
14
+ },
15
+ "expiresAt": { "type": "string", "format": "date-time" }
16
+ }
17
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/clipper-pair-start@1.0",
4
+ "title": "Browser Clipper Pair Start",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "pairId",
10
+ "pairingCode",
11
+ "expiresAt",
12
+ "origin",
13
+ "approvalPath"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": { "const": "1.0" },
17
+ "pairId": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
18
+ "pairingCode": { "type": "string", "pattern": "^[0-9]{8}$" },
19
+ "expiresAt": { "type": "string", "format": "date-time" },
20
+ "origin": {
21
+ "type": "string",
22
+ "pattern": "^chrome-extension://[a-p]{32}$"
23
+ },
24
+ "approvalPath": { "const": "/api/clipper/pair/approve" }
25
+ }
26
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/clipper-pair-status@1.0",
4
+ "title": "Browser Clipper Pair Status",
5
+ "oneOf": [
6
+ {
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "required": ["schemaVersion", "status", "expiresAt"],
10
+ "properties": {
11
+ "schemaVersion": { "const": "1.0" },
12
+ "status": { "const": "pending" },
13
+ "expiresAt": { "type": "string", "format": "date-time" }
14
+ }
15
+ },
16
+ {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "required": [
20
+ "schemaVersion",
21
+ "status",
22
+ "grantId",
23
+ "grantToken",
24
+ "expiresAt"
25
+ ],
26
+ "properties": {
27
+ "schemaVersion": { "const": "1.0" },
28
+ "status": { "const": "approved" },
29
+ "grantId": { "type": "string", "format": "uuid" },
30
+ "grantToken": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
31
+ "expiresAt": { "type": "string", "format": "date-time" }
32
+ }
33
+ },
34
+ {
35
+ "type": "object",
36
+ "additionalProperties": false,
37
+ "required": ["schemaVersion", "status"],
38
+ "properties": {
39
+ "schemaVersion": { "const": "1.0" },
40
+ "status": {
41
+ "enum": ["consumed", "expired", "not_found", "origin_mismatch"]
42
+ }
43
+ }
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/clipper-revoke@1.0",
4
+ "title": "Browser Clipper Grant Revocation",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "grantId", "status"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "1.0" },
10
+ "grantId": { "type": "string", "format": "uuid" },
11
+ "status": {
12
+ "enum": ["revoked", "already_revoked", "expired", "not_found"]
13
+ },
14
+ "revokedAt": { "type": "string", "format": "date-time" }
15
+ },
16
+ "allOf": [
17
+ {
18
+ "if": { "properties": { "status": { "const": "revoked" } } },
19
+ "then": {
20
+ "properties": {
21
+ "revokedAt": { "type": "string", "format": "date-time" }
22
+ },
23
+ "required": ["revokedAt"]
24
+ },
25
+ "else": { "not": { "required": ["revokedAt"] } }
26
+ }
27
+ ]
28
+ }
@@ -89,9 +89,20 @@
89
89
  "mime": { "type": "string" },
90
90
  "ext": { "type": "string" },
91
91
  "author": { "type": "string" },
92
+ "canonicalUrl": { "type": "string", "format": "uri" },
93
+ "site": { "type": "string" },
94
+ "publishedAt": {
95
+ "oneOf": [
96
+ { "type": "string", "format": "date" },
97
+ { "type": "string", "format": "date-time" }
98
+ ]
99
+ },
92
100
  "observedAt": { "type": "string", "format": "date-time" },
93
101
  "capturedAt": { "type": "string", "format": "date-time" },
94
- "externalId": { "type": "string" }
102
+ "externalId": { "type": "string" },
103
+ "browserClip": {
104
+ "$ref": "gno://schemas/browser-clip@1.0#/definitions/provenance"
105
+ }
95
106
  }
96
107
  },
97
108
  "tags": {
@@ -0,0 +1,209 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/project-profile-apply@1.0",
4
+ "title": "GNO Project Profile Apply Result",
5
+ "description": "Deterministic, path-redacted receipt for create/update-only project profile application.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "command",
11
+ "status",
12
+ "applied",
13
+ "discovery",
14
+ "receipt",
15
+ "diagnostics"
16
+ ],
17
+ "properties": {
18
+ "schemaVersion": { "const": "1.0" },
19
+ "command": { "const": "apply" },
20
+ "status": {
21
+ "enum": [
22
+ "applied",
23
+ "unchanged",
24
+ "invalid",
25
+ "not_found",
26
+ "disabled",
27
+ "failed"
28
+ ]
29
+ },
30
+ "applied": { "type": "boolean" },
31
+ "discovery": { "$ref": "#/definitions/discovery" },
32
+ "receipt": {
33
+ "oneOf": [{ "$ref": "#/definitions/receipt" }, { "type": "null" }]
34
+ },
35
+ "diagnostics": {
36
+ "type": "array",
37
+ "items": { "$ref": "#/definitions/diagnostic" }
38
+ }
39
+ },
40
+ "definitions": {
41
+ "diagnostic": {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": ["code", "severity", "path", "message", "remediation"],
45
+ "properties": {
46
+ "code": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]*$" },
47
+ "severity": { "enum": ["error", "warning"] },
48
+ "path": { "type": "string" },
49
+ "message": { "type": "string", "minLength": 1 },
50
+ "remediation": { "type": "string", "minLength": 1 }
51
+ }
52
+ },
53
+ "discovery": {
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "required": [
57
+ "status",
58
+ "source",
59
+ "boundary",
60
+ "profile",
61
+ "ambiguous",
62
+ "shadowedProfiles"
63
+ ],
64
+ "properties": {
65
+ "status": { "enum": ["found", "not_found", "disabled", "error"] },
66
+ "source": { "enum": ["cwd", "override", "remote"] },
67
+ "boundary": {
68
+ "enum": ["repository", "filesystem", "explicit", "remote"]
69
+ },
70
+ "profile": {
71
+ "type": ["string", "null"],
72
+ "enum": [".gno/index.yml", null]
73
+ },
74
+ "ambiguous": { "type": "boolean" },
75
+ "shadowedProfiles": { "type": "integer", "minimum": 0 }
76
+ }
77
+ },
78
+ "change": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "required": ["action", "field", "destructive", "summary"],
82
+ "properties": {
83
+ "action": { "enum": ["add", "update", "repair", "review"] },
84
+ "field": { "type": "string", "minLength": 1 },
85
+ "destructive": { "const": false },
86
+ "summary": { "type": "string", "minLength": 1 }
87
+ }
88
+ },
89
+ "staleMapping": {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": ["collection", "reason", "choices"],
93
+ "properties": {
94
+ "collection": { "type": "string", "minLength": 1 },
95
+ "reason": { "enum": ["name_changed", "root_changed"] },
96
+ "choices": {
97
+ "type": "array",
98
+ "minItems": 2,
99
+ "maxItems": 2,
100
+ "items": { "enum": ["repair", "remove_explicitly"] }
101
+ }
102
+ }
103
+ },
104
+ "diff": {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": ["status", "changes", "staleMappings"],
108
+ "properties": {
109
+ "status": { "enum": ["in_sync", "changes_required"] },
110
+ "changes": {
111
+ "type": "array",
112
+ "items": { "$ref": "#/definitions/change" }
113
+ },
114
+ "staleMappings": {
115
+ "type": "array",
116
+ "items": { "$ref": "#/definitions/staleMapping" }
117
+ }
118
+ }
119
+ },
120
+ "resource": {
121
+ "type": "object",
122
+ "additionalProperties": false,
123
+ "required": ["kind", "id", "disposition", "pendingIndexing"],
124
+ "properties": {
125
+ "kind": {
126
+ "enum": [
127
+ "capability",
128
+ "collection",
129
+ "content_type",
130
+ "contexts",
131
+ "profile_binding",
132
+ "project_affinity",
133
+ "stale_mapping"
134
+ ]
135
+ },
136
+ "id": { "type": "string", "minLength": 1 },
137
+ "disposition": {
138
+ "enum": ["created", "reused", "updated", "skipped"]
139
+ },
140
+ "pendingIndexing": { "type": "boolean" }
141
+ }
142
+ },
143
+ "receipt": {
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "required": [
147
+ "schemaVersion",
148
+ "command",
149
+ "status",
150
+ "profile",
151
+ "diff",
152
+ "resources",
153
+ "pendingIndexing",
154
+ "diagnostics"
155
+ ],
156
+ "properties": {
157
+ "schemaVersion": { "const": "1.0" },
158
+ "command": { "const": "apply" },
159
+ "status": { "enum": ["applied", "unchanged"] },
160
+ "profile": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "required": ["fingerprint"],
164
+ "properties": {
165
+ "fingerprint": {
166
+ "type": "string",
167
+ "pattern": "^[a-f0-9]{64}$"
168
+ }
169
+ }
170
+ },
171
+ "diff": { "$ref": "#/definitions/diff" },
172
+ "resources": {
173
+ "type": "array",
174
+ "items": { "$ref": "#/definitions/resource" }
175
+ },
176
+ "pendingIndexing": {
177
+ "type": "array",
178
+ "uniqueItems": true,
179
+ "items": { "type": "string", "minLength": 1 }
180
+ },
181
+ "diagnostics": {
182
+ "type": "array",
183
+ "items": { "$ref": "#/definitions/diagnostic" }
184
+ }
185
+ }
186
+ }
187
+ },
188
+ "allOf": [
189
+ {
190
+ "if": {
191
+ "properties": {
192
+ "status": { "enum": ["applied", "unchanged"] }
193
+ },
194
+ "required": ["status"]
195
+ },
196
+ "then": {
197
+ "properties": {
198
+ "receipt": { "$ref": "#/definitions/receipt" }
199
+ }
200
+ },
201
+ "else": {
202
+ "properties": {
203
+ "receipt": { "type": "null" },
204
+ "applied": { "const": false }
205
+ }
206
+ }
207
+ }
208
+ ]
209
+ }
@@ -0,0 +1,160 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/project-profile-command@1.0",
4
+ "title": "GNO Project Profile Read Command",
5
+ "description": "Deterministic, path-redacted result shared by profile check, show, and diff.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "command",
11
+ "status",
12
+ "valid",
13
+ "discovery",
14
+ "profile",
15
+ "diff",
16
+ "diagnostics"
17
+ ],
18
+ "properties": {
19
+ "schemaVersion": { "const": "1.0" },
20
+ "command": { "enum": ["check", "show", "diff"] },
21
+ "status": { "enum": ["valid", "invalid", "not_found", "disabled"] },
22
+ "valid": { "type": "boolean" },
23
+ "discovery": { "$ref": "#/definitions/discovery" },
24
+ "profile": {
25
+ "oneOf": [{ "$ref": "#/definitions/profile" }, { "type": "null" }]
26
+ },
27
+ "diff": {
28
+ "oneOf": [{ "$ref": "#/definitions/diff" }, { "type": "null" }]
29
+ },
30
+ "diagnostics": {
31
+ "type": "array",
32
+ "items": { "$ref": "#/definitions/diagnostic" }
33
+ }
34
+ },
35
+ "definitions": {
36
+ "diagnostic": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["code", "severity", "path", "message", "remediation"],
40
+ "properties": {
41
+ "code": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]*$" },
42
+ "severity": { "enum": ["error", "warning"] },
43
+ "path": { "type": "string" },
44
+ "message": { "type": "string", "minLength": 1 },
45
+ "remediation": { "type": "string", "minLength": 1 }
46
+ }
47
+ },
48
+ "discovery": {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "required": [
52
+ "status",
53
+ "source",
54
+ "boundary",
55
+ "profile",
56
+ "ambiguous",
57
+ "shadowedProfiles"
58
+ ],
59
+ "properties": {
60
+ "status": { "enum": ["found", "not_found", "disabled", "error"] },
61
+ "source": { "enum": ["cwd", "override", "remote"] },
62
+ "boundary": {
63
+ "enum": ["repository", "filesystem", "explicit", "remote"]
64
+ },
65
+ "profile": {
66
+ "type": ["string", "null"],
67
+ "enum": [".gno/index.yml", null]
68
+ },
69
+ "ambiguous": { "type": "boolean" },
70
+ "shadowedProfiles": { "type": "integer", "minimum": 0 }
71
+ }
72
+ },
73
+ "profile": {
74
+ "type": "object",
75
+ "additionalProperties": false,
76
+ "required": ["fingerprint", "desiredState"],
77
+ "properties": {
78
+ "fingerprint": {
79
+ "type": "string",
80
+ "pattern": "^[a-f0-9]{64}$"
81
+ },
82
+ "desiredState": {
83
+ "oneOf": [{ "type": "object" }, { "type": "null" }]
84
+ }
85
+ }
86
+ },
87
+ "change": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": ["action", "field", "destructive", "summary"],
91
+ "properties": {
92
+ "action": { "enum": ["add", "update", "repair", "review"] },
93
+ "field": { "type": "string", "minLength": 1 },
94
+ "destructive": { "type": "boolean" },
95
+ "summary": { "type": "string", "minLength": 1 }
96
+ }
97
+ },
98
+ "staleMapping": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "required": ["collection", "reason", "choices"],
102
+ "properties": {
103
+ "collection": { "type": "string", "minLength": 1 },
104
+ "reason": { "enum": ["name_changed", "root_changed"] },
105
+ "choices": {
106
+ "type": "array",
107
+ "minItems": 2,
108
+ "maxItems": 2,
109
+ "items": { "enum": ["repair", "remove_explicitly"] }
110
+ }
111
+ }
112
+ },
113
+ "diff": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": ["status", "changes", "staleMappings"],
117
+ "properties": {
118
+ "status": { "enum": ["in_sync", "changes_required"] },
119
+ "changes": {
120
+ "type": "array",
121
+ "items": { "$ref": "#/definitions/change" }
122
+ },
123
+ "staleMappings": {
124
+ "type": "array",
125
+ "items": { "$ref": "#/definitions/staleMapping" }
126
+ }
127
+ }
128
+ }
129
+ },
130
+ "allOf": [
131
+ {
132
+ "if": {
133
+ "properties": { "valid": { "const": true } },
134
+ "required": ["valid"]
135
+ },
136
+ "then": {
137
+ "properties": {
138
+ "status": { "const": "valid" },
139
+ "profile": { "$ref": "#/definitions/profile" }
140
+ }
141
+ }
142
+ },
143
+ {
144
+ "if": {
145
+ "properties": { "command": { "const": "diff" } },
146
+ "required": ["command"]
147
+ },
148
+ "then": {
149
+ "properties": {
150
+ "diff": {
151
+ "oneOf": [{ "$ref": "#/definitions/diff" }, { "type": "null" }]
152
+ }
153
+ }
154
+ },
155
+ "else": {
156
+ "properties": { "diff": { "type": "null" } }
157
+ }
158
+ }
159
+ ]
160
+ }
@@ -149,7 +149,13 @@
149
149
  },
150
150
  "source": {
151
151
  "type": ["string", "null"],
152
- "enum": ["cli_cwd", "cli_explicit", "cli_worktree", null]
152
+ "enum": [
153
+ "cli_cwd",
154
+ "cli_explicit",
155
+ "cli_worktree",
156
+ "project_profile",
157
+ null
158
+ ]
153
159
  }
154
160
  },
155
161
  "additionalProperties": false
@@ -0,0 +1,87 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/setup-profile-result@1.0",
4
+ "title": "GNO Setup Profile Result",
5
+ "description": "Closed opt-in project-profile apply composition around verified setup and optional connectors.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "status", "profile", "setup", "connectors"],
9
+ "properties": {
10
+ "schemaVersion": { "const": "1.0" },
11
+ "status": {
12
+ "enum": ["completed", "completed_with_actions", "failed"]
13
+ },
14
+ "profile": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["check", "apply"],
18
+ "properties": {
19
+ "check": {
20
+ "allOf": [
21
+ { "$ref": "gno://schemas/project-profile-command@1.0" },
22
+ {
23
+ "type": "object",
24
+ "properties": { "command": { "const": "check" } },
25
+ "required": ["command"]
26
+ }
27
+ ]
28
+ },
29
+ "apply": {
30
+ "oneOf": [
31
+ { "$ref": "gno://schemas/project-profile-apply@1.0" },
32
+ { "type": "null" }
33
+ ]
34
+ }
35
+ }
36
+ },
37
+ "setup": { "$ref": "gno://schemas/setup-command-result@1.0" },
38
+ "connectors": {
39
+ "$ref": "gno://schemas/setup-activation-result@1.0#/properties/connectors"
40
+ }
41
+ },
42
+ "allOf": [
43
+ {
44
+ "if": {
45
+ "properties": { "status": { "const": "completed" } },
46
+ "required": ["status"]
47
+ },
48
+ "then": {
49
+ "properties": {
50
+ "profile": {
51
+ "type": "object",
52
+ "properties": {
53
+ "check": {
54
+ "type": "object",
55
+ "properties": { "status": { "const": "valid" } }
56
+ },
57
+ "apply": {
58
+ "type": "object",
59
+ "properties": {
60
+ "status": { "enum": ["applied", "unchanged"] }
61
+ }
62
+ }
63
+ }
64
+ },
65
+ "setup": {
66
+ "type": "object",
67
+ "properties": { "status": { "const": "completed" } }
68
+ }
69
+ }
70
+ }
71
+ },
72
+ {
73
+ "if": {
74
+ "properties": { "status": { "const": "failed" } },
75
+ "required": ["status"]
76
+ },
77
+ "then": {
78
+ "properties": {
79
+ "setup": {
80
+ "type": "object",
81
+ "properties": { "status": { "const": "failed" } }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ ]
87
+ }