@everfur/cli 0.1.0 → 0.2.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.
package/dist/index.js CHANGED
@@ -1,22 +1,3 @@
1
1
  #!/usr/bin/env node
2
- export { COMMANDS, ExitCode, REASON_CODES, buildDiagnosisDocument, buildExplanationDocument, buildSandboxDocument, buildVerificationDocument, editDistance, failureOutcome, formatOutcome, isKnownReasonCode, matchCommand, nextActionFor2 as nextActionForErrorCode, nextActionFor as nextActionForReason, nextActionsFor, parseCapabilities, parseDiagnostics, parseIdentityMode, parseSessionMintLanguage, parseSuppliedFacts, projectSandboxCreate, renderDiagnosis, renderExplanation, renderPlan, renderSandboxCreate, renderVerification, runCli, suggestCodes } from './chunk-67H43MI6.js';
3
- export { ADMIN_TOKEN, API_PREFIX, BASE_URL_ENV_VAR, CLI_VERSION, CREDENTIAL_SPECS, DEFAULT_TIMEOUT_MS, EMPTY_REGISTRY, ERRORS_DOCUMENT_KEY, IDEMPOTENT_METHODS, MISSING_FACT_NAMES, PARTNER_KEY, PARTNER_SECRET_KEY, PLAN_DOCUMENT_KIND, PLAN_SCHEMA_VERSION, REDACTED, SCHEMAS, SESSION_TOKEN, TransportError, apiUrl, buildDecisionSpace, clampTimeout, createApiClient, createRecordingClock, describeFailure, detectProject, digestOfProjection, digestsEqual, entryFromRow, ephemeralCredential, errorCodeOf, failureDetails, fetchTransport, isCorrelatableRequestId, isIdempotent, loadDecisionSpace, loadErrorRegistry, missingFactsFor, nodeFileSystem, planIntegration, resolveContractPath, resolveCredential, resolveEndpoint, runVerification, systemClock, validateContractFile, validateContractPublicEnvelope, validateDiagnosisDocument, validateErrorExplanationDocument, validatePlanDocument, validateSandboxCreateDocument, validateVerificationDocument, verifyDigest, walkSingle, walkTree, withPrefix } from './chunk-KQZ6ZXL7.js';
4
-
5
- // src/fs/memory-fs.ts
6
- function createMemoryFileSystem(files) {
7
- const table = new Map(Object.entries(files));
8
- const directories = /* @__PURE__ */ new Set();
9
- for (const path of table.keys()) {
10
- const segments = path.split("/");
11
- for (let index = 1; index < segments.length; index += 1) {
12
- directories.add(segments.slice(0, index).join("/"));
13
- }
14
- }
15
- return Object.freeze({
16
- readFile: (path) => table.get(path) ?? null,
17
- exists: (path) => table.has(path) || directories.has(path),
18
- isDirectory: (path) => directories.has(path) && !table.has(path)
19
- });
20
- }
21
-
22
- export { createMemoryFileSystem };
2
+ export { COMMANDS, buildSandboxDocument, buildVerificationDocument, failureOutcome, formatOutcome, matchCommand, nextActionsFor, parseCapabilities, parseIdentityMode, parseSessionMintLanguage, parseSuppliedFacts, projectSandboxCreate, renderDiagnosis, renderPlan, renderSandboxCreate, renderVerification, runCli } from './chunk-4UB26D67.js';
3
+ export { ADMIN_TOKEN, API_PREFIX, BASE_URL_ENV_VAR, CLI_VERSION, CREDENTIAL_SPECS, DEFAULT_TIMEOUT_MS, EMPTY_REGISTRY, ERRORS_DOCUMENT_KEY, ExitCode, IDEMPOTENT_METHODS, MISSING_FACT_NAMES, PARTNER_KEY, PARTNER_SECRET_KEY, PLAN_DOCUMENT_KIND, PLAN_SCHEMA_VERSION, REASON_CODES, REDACTED, SCHEMAS, SESSION_TOKEN, THEME_TOKEN_ORDER, TransportError, apiUrl, buildDecisionSpace, buildDiagnosisDocument, buildExplanationDocument, clampTimeout, createApiClient, createMemoryFileSystem, createRecordingClock, describeFailure, detectProject, detectTheme, detectThemeFromText, digestOfProjection, digestsEqual, editDistance, entryFromRow, ephemeralCredential, errorCodeOf, failureDetails, fetchTransport, isCorrelatableRequestId, isIdempotent, isKnownReasonCode, loadDecisionSpace, loadErrorRegistry, missingFactsFor, nextActionFor2 as nextActionForErrorCode, nextActionFor as nextActionForReason, nodeFileSystem, parseDiagnostics, planIntegration, renderExplanation, resolveContractPath, resolveCredential, resolveEndpoint, runVerification, suggestCodes, systemClock, validateContractFile, validateContractPublicEnvelope, validateDiagnosisDocument, validateErrorExplanationDocument, validatePlanDocument, validateSandboxCreateDocument, validateVerificationDocument, verifyDigest, walkSingle, walkTree, withPrefix } from './chunk-KQICUK54.js';
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@everfur/cli",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Everfur CLI: plan, verify, and diagnose an Everfur pet-health integration from the terminal.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "sideEffects": false,
8
8
  "bin": {
9
9
  "everfur": "./dist/everfur.js",
10
- "everfur-mcp": "./dist/everfur-mcp.js"
10
+ "everfur-mcp": "./dist/everfur-mcp.js",
11
+ "everfur-mcp-http": "./dist/everfur-mcp-http.js",
12
+ "everfur-mcp-hosted": "./dist/everfur-mcp-hosted.js"
11
13
  },
12
14
  "files": [
13
15
  "dist",
14
16
  "!dist/**/*.map",
15
- "schema",
16
- "contract"
17
+ "schema"
17
18
  ],
18
19
  "publishConfig": {
19
20
  "access": "public"
@@ -106,6 +106,10 @@
106
106
  "capabilities": {
107
107
  "type": "array",
108
108
  "items": { "$ref": "#/$defs/CapabilityDiagnosis" }
109
+ },
110
+ "switches": {
111
+ "description": "Additive to v1. Every partner switch the diagnostics response reported, in the order sent and under its own name. Null when the deployment sent no switches block (one older than it); an empty array is a deployment that reports switches and has none. Optional: a document from a CLI older than this field omits it.",
112
+ "oneOf": [{ "type": "null" }, { "type": "array", "items": { "$ref": "#/$defs/SwitchDiagnosis" } }]
109
113
  }
110
114
  },
111
115
  "$defs": {
@@ -161,6 +165,43 @@
161
165
  "minLength": 1
162
166
  }
163
167
  }
168
+ },
169
+ "SwitchDiagnosis": {
170
+ "type": "object",
171
+ "required": ["name", "enabled", "kind", "gates", "tenantTerm", "reason", "nextAction"],
172
+ "properties": {
173
+ "name": {
174
+ "description": "The switch's name as the backend sends it, e.g. partner.notifications_enabled. Never a store value source.",
175
+ "type": "string",
176
+ "minLength": 1
177
+ },
178
+ "enabled": {
179
+ "description": "On, off, or null when the entry carried no state the CLI can read.",
180
+ "oneOf": [{ "type": "null" }, { "type": "boolean" }]
181
+ },
182
+ "kind": {
183
+ "description": "route_gate: off, its routes answer 404. posture: changes how routes behave, and off is often its normal state. unknown: the entry neither says which nor names what it gates. The backend's kind when it sends one; otherwise a switch that names what it gates is a route_gate. Members may be added.",
184
+ "enum": ["route_gate", "posture", "unknown"]
185
+ },
186
+ "gates": {
187
+ "description": "What the switch governs, as the backend names it: routes, capabilities or a description.",
188
+ "type": "array",
189
+ "items": { "type": "string", "minLength": 1 }
190
+ },
191
+ "tenantTerm": {
192
+ "description": "The tenant-level feature term the switch pairs with, or null.",
193
+ "oneOf": [{ "type": "null" }, { "type": "string", "minLength": 1 }]
194
+ },
195
+ "reason": {
196
+ "description": "The server's own copy for the switch, or an empty string.",
197
+ "type": "string"
198
+ },
199
+ "nextAction": {
200
+ "description": "CLI-authored. Only a route_gate is told to ask Everfur to switch it on.",
201
+ "type": "string",
202
+ "minLength": 1
203
+ }
204
+ }
164
205
  }
165
206
  }
166
207
  }
@@ -48,6 +48,14 @@
48
48
  "sessionMintLanguage": {
49
49
  "description": "The backend language that mints sessions. Non-null only when the identity mode requires a server-side mint.",
50
50
  "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/OptionId" }]
51
+ },
52
+ "embedding": {
53
+ "description": "--embedding, when given: how a web project embeds the surface (an option of the platform tree's web-embedding question). null means the detected embedding decided. Additive to v1; absent on documents written before the web shapes existed.",
54
+ "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/OptionId" }]
55
+ },
56
+ "environment": {
57
+ "description": "--environment, when given: the Everfur deployment the generated configuration targets. null means it was not given; a plan that writes configuration refuses without it. Additive to v1.",
58
+ "oneOf": [{ "type": "null" }, { "enum": ["test", "staging", "production"] }]
51
59
  }
52
60
  }
53
61
  },
@@ -73,6 +81,10 @@
73
81
  "type": "array",
74
82
  "items": { "$ref": "#/$defs/PlanWarning" }
75
83
  },
84
+ "platformBlock": {
85
+ "description": "Non-null when the host project shape refuses every plan, whatever was asked for. Absent on documents written before the field existed.",
86
+ "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/PlatformBlock" }]
87
+ },
76
88
  "decisionSpace": {
77
89
  "description": "Which contract projection produced this plan. Null only on the refusal that says none was found.",
78
90
  "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/DecisionSpaceProvenance" }]
@@ -128,7 +140,7 @@
128
140
  "$ref": "#/$defs/OptionId"
129
141
  },
130
142
  "ProjectType": {
131
- "enum": ["expo-managed", "bare-react-native", "flutter", "web", "unknown"]
143
+ "enum": ["expo-managed", "bare-react-native", "flutter", "web", "shopify-storefront", "unknown"]
132
144
  },
133
145
  "PackageManager": {
134
146
  "enum": ["npm", "pnpm", "yarn", "bun", "not-applicable", "undetermined"]
@@ -149,7 +161,66 @@
149
161
  "projectTypeEvidence": { "type": "array", "items": { "type": "string" } },
150
162
  "packageManager": { "$ref": "#/$defs/PackageManager" },
151
163
  "packageManagerEvidence": { "type": "array", "items": { "type": "string" } },
152
- "dependencies": { "type": "array", "items": { "$ref": "#/$defs/Dependency" } }
164
+ "dependencies": { "type": "array", "items": { "$ref": "#/$defs/Dependency" } },
165
+ "webEmbedding": {
166
+ "description": "The detected embedding of a web project: in-page when package.json declares react-dom, frame otherwise. null for every other shape. Additive to v1.",
167
+ "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/OptionId" }]
168
+ },
169
+ "webFramework": {
170
+ "description": "The detected framework of a web project, which spells the generated files. null for every other shape. Additive to v1.",
171
+ "oneOf": [{ "type": "null" }, { "enum": ["next-app-router", "next-pages-router", "vite-react", "remix", "static-html", "other-web"] }]
172
+ },
173
+ "theme": {
174
+ "description": "What the project says about its own look, read statically by the theme detector: the source, the confidence, the SDK theme fields it mapped, the file:line evidence for each, the files it read, and the facts it could not establish. null for a shape the plan writes no provider for, or a detection built by hand. Additive to v1.",
175
+ "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/ThemeDetection" }]
176
+ }
177
+ }
178
+ },
179
+ "ThemeToken": {
180
+ "enum": ["primaryColor", "accentColor", "primaryColorDark", "accentColorDark", "brightness", "surfaceStyle", "radiusScale", "fontFamily", "fontRegular", "fontMedium", "fontBold"]
181
+ },
182
+ "ThemeDetection": {
183
+ "type": "object",
184
+ "required": ["source", "confidence", "theme", "evidence", "scanned", "missing", "inferred"],
185
+ "properties": {
186
+ "source": { "enum": ["tailwind-v4", "tailwind-v3", "css-variables", "react-navigation", "rn-colors", "none"] },
187
+ "confidence": { "enum": ["high", "medium", "low"] },
188
+ "theme": {
189
+ "description": "The EverfurThemeInput fields the detector mapped, every value a string. Empty at low confidence.",
190
+ "type": "object",
191
+ "properties": {
192
+ "primaryColor": { "type": "string", "pattern": "^#[0-9A-F]{6}$" },
193
+ "accentColor": { "type": "string", "pattern": "^#[0-9A-F]{6}$" },
194
+ "primaryColorDark": { "type": "string", "pattern": "^#[0-9A-F]{6}$" },
195
+ "accentColorDark": { "type": "string", "pattern": "^#[0-9A-F]{6}$" },
196
+ "brightness": { "enum": ["light", "dark"] },
197
+ "surfaceStyle": { "enum": ["white", "cream", "subtle"] },
198
+ "radiusScale": { "enum": ["sharp", "default", "round"] },
199
+ "fontFamily": { "type": "string", "minLength": 1 },
200
+ "fontRegular": { "type": "string", "minLength": 1, "description": "The registered regular face a React Native theme file names (the SDK's fonts.regular). Additive to v1." },
201
+ "fontMedium": { "type": "string", "minLength": 1, "description": "The registered medium face (fonts.medium). Additive to v1." },
202
+ "fontBold": { "type": "string", "minLength": 1, "description": "The registered bold face (fonts.bold). Additive to v1." }
203
+ },
204
+ "additionalProperties": false
205
+ },
206
+ "evidence": {
207
+ "type": "array",
208
+ "items": {
209
+ "type": "object",
210
+ "required": ["file", "line", "key", "value", "token", "reason"],
211
+ "properties": {
212
+ "file": { "type": "string", "minLength": 1 },
213
+ "line": { "type": "integer", "minimum": 1 },
214
+ "key": { "type": "string", "minLength": 1 },
215
+ "value": { "type": "string" },
216
+ "token": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/ThemeToken" }] },
217
+ "reason": { "type": "string", "minLength": 1 }
218
+ }
219
+ }
220
+ },
221
+ "scanned": { "type": "array", "items": { "type": "string", "minLength": 1 } },
222
+ "missing": { "type": "array", "items": { "type": "string", "minLength": 1 } },
223
+ "inferred": { "type": "array", "items": { "$ref": "#/$defs/ThemeToken" } }
153
224
  }
154
225
  },
155
226
  "Dependency": {
@@ -176,12 +247,25 @@
176
247
  "pattern": "^/"
177
248
  },
178
249
  "capabilityKeys": {
179
- "description": "The capability pack keys this block derives from.",
250
+ "description": "The capability pack keys this block derives from. Empty when the platform, not the capability, is what refused.",
180
251
  "type": "array",
181
252
  "items": { "type": "string", "minLength": 1 }
253
+ },
254
+ "blockedBy": {
255
+ "description": "What refused it: a BLOCKED terminal in the capabilities tree, or the host project shape. Absent means capability, for documents written before the field existed.",
256
+ "enum": ["capability", "platform"]
182
257
  }
183
258
  }
184
259
  },
260
+ "PlatformBlock": {
261
+ "type": "object",
262
+ "required": ["reason", "unblockOwner", "requestPath"],
263
+ "properties": {
264
+ "reason": { "type": "string", "minLength": 1 },
265
+ "unblockOwner": { "type": "string", "minLength": 1 },
266
+ "requestPath": { "type": "string", "pattern": "^/" }
267
+ }
268
+ },
185
269
  "PlanPrinciple": {
186
270
  "type": "object",
187
271
  "required": ["treeId", "id", "title", "statement", "docPath"],
@@ -211,9 +295,11 @@
211
295
  "decisionTrees",
212
296
  "projectType",
213
297
  "packageManager",
298
+ "embedding",
214
299
  "capabilities",
215
300
  "identityMode",
216
- "sessionMintLanguage"
301
+ "sessionMintLanguage",
302
+ "environment"
217
303
  ]
218
304
  },
219
305
  "reason": { "type": "string", "minLength": 1 },
@@ -17,7 +17,7 @@
17
17
  }
18
18
  },
19
19
  "status": {
20
- "description": "passed = every step PASSed. failed = at least one FAILed (exit 7). incomplete = nothing failed but a step was skipped (exit 3).",
20
+ "description": "passed = every step PASSed or was GATED. failed = at least one FAILed (exit 7). incomplete = nothing failed but a step was skipped (exit 3).",
21
21
  "enum": ["passed", "failed", "incomplete"]
22
22
  },
23
23
  "baseUrl": { "type": "string", "minLength": 1 },
@@ -27,7 +27,8 @@
27
27
  "properties": {
28
28
  "passed": { "type": "integer", "minimum": 0 },
29
29
  "failed": { "type": "integer", "minimum": 0 },
30
- "skipped": { "type": "integer", "minimum": 0 }
30
+ "skipped": { "type": "integer", "minimum": 0 },
31
+ "gated": { "description": "Additive to v1: steps that found a surface switched off by Everfur.", "type": "integer", "minimum": 0 }
31
32
  }
32
33
  },
33
34
  "steps": {
@@ -39,7 +40,10 @@
39
40
  "properties": {
40
41
  "id": { "type": "string", "minLength": 1 },
41
42
  "title": { "type": "string", "minLength": 1 },
42
- "result": { "enum": ["PASS", "FAIL", "SKIP"] },
43
+ "result": {
44
+ "description": "GATED (additive to v1): the step ran and found a surface Everfur has switched off for the tenant. It is not a failure and not a skip, so it changes the status in neither direction.",
45
+ "enum": ["PASS", "FAIL", "SKIP", "GATED"]
46
+ },
43
47
  "reason": {
44
48
  "description": "Always populated, for every result. A bare PASS is not a report.",
45
49
  "type": "string",