meguro-mcp 0.2.8 → 0.2.10
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/CHANGELOG.md +20 -0
- package/README.md +10 -4
- package/package.json +1 -1
- package/src/docs.mjs +316 -4
- package/src/server.mjs +1 -1
- package/src/tools.mjs +55 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `meguro-mcp` are recorded here. Versions follow Semantic Versioning.
|
|
4
4
|
|
|
5
|
+
## 0.2.10 — 2026-08-10
|
|
6
|
+
|
|
7
|
+
- Adds immutable getting-started v8, product-guide v5, and documentation-index v4 resources that
|
|
8
|
+
cross-link current guidance from one registry-derived currency authority; receipt-guide v7 remains
|
|
9
|
+
the current receipt guide.
|
|
10
|
+
- Removes the remaining fixed Admin API version from current observation-plan metadata and derives
|
|
11
|
+
the declared target from the supported-version registry without changing historical resources.
|
|
12
|
+
- Adds current troubleshooting for incompatible model data, assertion-family exercise guidance, and
|
|
13
|
+
the channel-abstraction explanation while preserving existing tool identities and input schemas.
|
|
14
|
+
|
|
15
|
+
## 0.2.9 — 2026-08-10
|
|
16
|
+
|
|
17
|
+
- Keeps the full real-store history-run family in the public STDIO registry while the hosted OAuth
|
|
18
|
+
surface now teaches and exposes only the practice-world run lane.
|
|
19
|
+
- Adds immutable getting-started v7, product-guide v4, and documentation-index v2 resources with
|
|
20
|
+
hosted-first control-plane guidance, Gate-policy v2 citations, and one honest STDIO history-lane
|
|
21
|
+
bridge.
|
|
22
|
+
- Reconciles `usage_read` with the exempt auto-provisioned sample store shown by `stores_list`, while
|
|
23
|
+
preserving every existing tool name, input schema, and prior documentation byte stream.
|
|
24
|
+
|
|
5
25
|
## 0.2.8 — 2026-08-09
|
|
6
26
|
|
|
7
27
|
- Adds `practice_runs_list` so a cold MCP-only evaluator can discover existing practice attempts
|
package/README.md
CHANGED
|
@@ -105,15 +105,21 @@ local stdio server and the hosted OAuth resource server:
|
|
|
105
105
|
|---|---|
|
|
106
106
|
| `meguro://docs/gate-policy/v1` | `6d647b3c78fd4e2d93f59a85b90a853096cc73e9cdfd6ba5e3ea505dc07b4aaf` |
|
|
107
107
|
| `meguro://docs/gate-policy/v2` | `e49378fd745f71aab893db34864aefeb7345c9a25000ad328dfba4e44d007469` |
|
|
108
|
+
| `meguro://docs/gate-policy/v3` | `bcd1434cddf99f42261081d9d217285ebf4a93d9e42d23a47bf577c8ee91fbe9` |
|
|
108
109
|
| `meguro://docs/getting-started/v1` | `afd19ca6576ae2a8fb03c2e143d25d47fb739682f44180541dd13f779a5f29df` |
|
|
109
110
|
| `meguro://docs/getting-started/v2` | `70fdbf36d68a6dd7abb93fe9b403f85c9c0323b3dc3472ab638c6cbe5982ec61` |
|
|
110
111
|
| `meguro://docs/getting-started/v3` | `765cba2b68806f0b1d83255a1742d83ce71ebf7f65f8095e7076cd36e4a1ba6c` |
|
|
111
112
|
| `meguro://docs/getting-started/v4` | `db534eb544e414be353d6cd4db8dfb9e8dba772dcb10d8287a1a27f8736e5307` |
|
|
112
113
|
| `meguro://docs/getting-started/v5` | `156dcf81266f2bd4e4203dbd09661e49a481395ba4a63528f0540d8ea89bc285` |
|
|
113
114
|
| `meguro://docs/getting-started/v6` | `34cf3ab48a32714b0c3edb24a7920843954172c0d5501e60574adc5a1058071f` |
|
|
115
|
+
| `meguro://docs/getting-started/v7` | `650201c983138cb2c34cfef3e93611d510faf42d974f32762207216c3189ece1` |
|
|
116
|
+
| `meguro://docs/index/v1` | `1d52205148a3438339238c9e65271b2c377cd0a96c7088d75de7f2dce9552843` |
|
|
117
|
+
| `meguro://docs/index/v2` | `df861c87fa17db23d3173c1d900a884d39b228d493d7e35fcab9b2a531ae9aad` |
|
|
118
|
+
| `meguro://docs/index/v3` | `422e91488281867aa2454223a8042248a667c57ea2ae56878bdb136693fe4894` |
|
|
114
119
|
| `meguro://docs/product-guide/v1` | `e5450c1b4181cec4d6ed0a498dbff1cb25d2e223ff2228928aecbbce9674f074` |
|
|
115
120
|
| `meguro://docs/product-guide/v2` | `b15590df7699f7ad685a30b0698e2c25b5b7b1531afa4e43e9f04a4b38ab9db2` |
|
|
116
121
|
| `meguro://docs/product-guide/v3` | `8dc9e0fae91a2433ea7ca02b9278484250be0d336e2daac96f949da577487dc9` |
|
|
122
|
+
| `meguro://docs/product-guide/v4` | `a874a1af1bcf18e7abe6b32b8d226a648b1292458010992528a551c270e9816e` |
|
|
117
123
|
| `meguro://docs/receipt-guide/v1` | `9d8150258765d252cb7cc3bad307acdc429b0435ca22f0362b69cf7471e3a333` |
|
|
118
124
|
| `meguro://docs/receipt-guide/v2` | `7df261021b48ce732e6043a8917f8a2673b1f83ff1d8790927abc18f34fb3f6f` |
|
|
119
125
|
| `meguro://docs/receipt-guide/v3` | `c76b823aed8187834c8ae79a751b53d2720fe7245a31b0b195f440deac9b75cb` |
|
|
@@ -182,11 +188,11 @@ See [the agency quickstart](../../docs/agency-practice-run-quickstart.md) and [H
|
|
|
182
188
|
## Advanced: CI or local STDIO
|
|
183
189
|
|
|
184
190
|
Use the public STDIO package for CI, local automation, or clients without hosted Streamable HTTP and
|
|
185
|
-
OAuth support. It requires a workspace-bound `meg_sk_…` API key and exposes the full
|
|
191
|
+
OAuth support. It requires a workspace-bound `meg_sk_…` API key and exposes the full 47-tool local
|
|
186
192
|
surface. Pin the exact public version in client configuration so a quickstart stays reproducible:
|
|
187
193
|
|
|
188
194
|
```bash
|
|
189
|
-
npx -y meguro-mcp@0.2.
|
|
195
|
+
npx -y meguro-mcp@0.2.10
|
|
190
196
|
```
|
|
191
197
|
|
|
192
198
|
### Environment
|
|
@@ -204,7 +210,7 @@ claude mcp add meguro \
|
|
|
204
210
|
-e MEGURO_API_BASE_URL=https://api-dev.meguro.io \
|
|
205
211
|
-e MEGURO_API_TOKEN=meg_sk_... \
|
|
206
212
|
-e MEGURO_DASHBOARD_URL=https://... \
|
|
207
|
-
-- npx -y meguro-mcp@0.2.
|
|
213
|
+
-- npx -y meguro-mcp@0.2.10
|
|
208
214
|
```
|
|
209
215
|
|
|
210
216
|
### Register — Cursor (`.cursor/mcp.json`)
|
|
@@ -214,7 +220,7 @@ claude mcp add meguro \
|
|
|
214
220
|
"mcpServers": {
|
|
215
221
|
"meguro": {
|
|
216
222
|
"command": "npx",
|
|
217
|
-
"args": ["-y", "meguro-mcp@0.2.
|
|
223
|
+
"args": ["-y", "meguro-mcp@0.2.10"],
|
|
218
224
|
"env": {
|
|
219
225
|
"MEGURO_API_BASE_URL": "https://api-dev.meguro.io",
|
|
220
226
|
"MEGURO_API_TOKEN": "meg_sk_...",
|
package/package.json
CHANGED
package/src/docs.mjs
CHANGED
|
@@ -14,15 +14,20 @@ const RECEIPT_GUIDE_V6_VERSION = 6;
|
|
|
14
14
|
const RECEIPT_GUIDE_V7_VERSION = 7;
|
|
15
15
|
const GATE_POLICY_VERSION = 1;
|
|
16
16
|
const GATE_POLICY_V2_VERSION = 2;
|
|
17
|
+
const GATE_POLICY_V3_VERSION = 3;
|
|
17
18
|
const GETTING_STARTED_VERSION = 1;
|
|
18
19
|
const GETTING_STARTED_V2_VERSION = 2;
|
|
19
20
|
const GETTING_STARTED_LATEST_VERSION = 3;
|
|
20
21
|
const GETTING_STARTED_V4_VERSION = 4;
|
|
21
22
|
const GETTING_STARTED_V5_VERSION = 5;
|
|
22
23
|
const GETTING_STARTED_V6_VERSION = 6;
|
|
24
|
+
const GETTING_STARTED_V7_VERSION = 7;
|
|
25
|
+
const GETTING_STARTED_V8_VERSION = 8;
|
|
23
26
|
const PRODUCT_GUIDE_VERSION = 1;
|
|
24
27
|
const PRODUCT_GUIDE_V2_VERSION = 2;
|
|
25
28
|
const PRODUCT_GUIDE_V3_VERSION = 3;
|
|
29
|
+
const PRODUCT_GUIDE_V4_VERSION = 4;
|
|
30
|
+
const PRODUCT_GUIDE_V5_VERSION = 5;
|
|
26
31
|
const RECEIPT_GUIDE_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_VERSION}`;
|
|
27
32
|
const RECEIPT_GUIDE_V2_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_V2_VERSION}`;
|
|
28
33
|
const RECEIPT_GUIDE_V3_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_V3_VERSION}`;
|
|
@@ -32,16 +37,24 @@ const RECEIPT_GUIDE_V6_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_V6_VE
|
|
|
32
37
|
const RECEIPT_GUIDE_V7_URI = `meguro://docs/receipt-guide/v${RECEIPT_GUIDE_V7_VERSION}`;
|
|
33
38
|
const GATE_POLICY_URI = `meguro://docs/gate-policy/v${GATE_POLICY_VERSION}`;
|
|
34
39
|
const GATE_POLICY_V2_URI = `meguro://docs/gate-policy/v${GATE_POLICY_V2_VERSION}`;
|
|
40
|
+
const GATE_POLICY_V3_URI = `meguro://docs/gate-policy/v${GATE_POLICY_V3_VERSION}`;
|
|
35
41
|
const GETTING_STARTED_URI = `meguro://docs/getting-started/v${GETTING_STARTED_VERSION}`;
|
|
36
42
|
const GETTING_STARTED_V2_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V2_VERSION}`;
|
|
37
43
|
const GETTING_STARTED_LATEST_URI = `meguro://docs/getting-started/v${GETTING_STARTED_LATEST_VERSION}`;
|
|
38
44
|
const GETTING_STARTED_V4_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V4_VERSION}`;
|
|
39
45
|
const GETTING_STARTED_V5_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V5_VERSION}`;
|
|
40
46
|
const GETTING_STARTED_V6_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V6_VERSION}`;
|
|
47
|
+
const GETTING_STARTED_V7_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V7_VERSION}`;
|
|
48
|
+
const GETTING_STARTED_V8_URI = `meguro://docs/getting-started/v${GETTING_STARTED_V8_VERSION}`;
|
|
41
49
|
const PRODUCT_GUIDE_URI = `meguro://docs/product-guide/v${PRODUCT_GUIDE_VERSION}`;
|
|
42
50
|
const PRODUCT_GUIDE_V2_URI = `meguro://docs/product-guide/v${PRODUCT_GUIDE_V2_VERSION}`;
|
|
43
51
|
const PRODUCT_GUIDE_V3_URI = `meguro://docs/product-guide/v${PRODUCT_GUIDE_V3_VERSION}`;
|
|
52
|
+
const PRODUCT_GUIDE_V4_URI = `meguro://docs/product-guide/v${PRODUCT_GUIDE_V4_VERSION}`;
|
|
53
|
+
const PRODUCT_GUIDE_V5_URI = `meguro://docs/product-guide/v${PRODUCT_GUIDE_V5_VERSION}`;
|
|
44
54
|
export const DOCUMENTATION_INDEX_URI = 'meguro://docs/index/v1';
|
|
55
|
+
export const DOCUMENTATION_INDEX_V2_URI = 'meguro://docs/index/v2';
|
|
56
|
+
export const DOCUMENTATION_INDEX_V3_URI = 'meguro://docs/index/v3';
|
|
57
|
+
export const DOCUMENTATION_INDEX_V4_URI = 'meguro://docs/index/v4';
|
|
45
58
|
|
|
46
59
|
const DOCUMENTATION_CURRENCY_V1 = deepFreeze({
|
|
47
60
|
indexVersion: 1,
|
|
@@ -53,7 +66,37 @@ const DOCUMENTATION_CURRENCY_V1 = deepFreeze({
|
|
|
53
66
|
'receipt-guide': RECEIPT_GUIDE_V7_URI,
|
|
54
67
|
},
|
|
55
68
|
});
|
|
56
|
-
const
|
|
69
|
+
const DOCUMENTATION_CURRENCY_V2 = deepFreeze({
|
|
70
|
+
indexVersion: 2,
|
|
71
|
+
currentUriByTopic: {
|
|
72
|
+
'gate-policy': GATE_POLICY_V2_URI,
|
|
73
|
+
'getting-started': GETTING_STARTED_V7_URI,
|
|
74
|
+
index: DOCUMENTATION_INDEX_V2_URI,
|
|
75
|
+
'product-guide': PRODUCT_GUIDE_V4_URI,
|
|
76
|
+
'receipt-guide': RECEIPT_GUIDE_V7_URI,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
const DOCUMENTATION_CURRENCY_V3 = deepFreeze({
|
|
80
|
+
indexVersion: 3,
|
|
81
|
+
currentUriByTopic: {
|
|
82
|
+
'gate-policy': GATE_POLICY_V3_URI,
|
|
83
|
+
'getting-started': GETTING_STARTED_V7_URI,
|
|
84
|
+
index: DOCUMENTATION_INDEX_V3_URI,
|
|
85
|
+
'product-guide': PRODUCT_GUIDE_V4_URI,
|
|
86
|
+
'receipt-guide': RECEIPT_GUIDE_V7_URI,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
const DOCUMENTATION_CURRENCY_V4 = deepFreeze({
|
|
90
|
+
indexVersion: 4,
|
|
91
|
+
currentUriByTopic: {
|
|
92
|
+
'gate-policy': GATE_POLICY_V3_URI,
|
|
93
|
+
'getting-started': GETTING_STARTED_V8_URI,
|
|
94
|
+
index: DOCUMENTATION_INDEX_V4_URI,
|
|
95
|
+
'product-guide': PRODUCT_GUIDE_V5_URI,
|
|
96
|
+
'receipt-guide': RECEIPT_GUIDE_V7_URI,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
const CURRENT_DOCUMENTATION_CURRENCY = DOCUMENTATION_CURRENCY_V4;
|
|
57
100
|
|
|
58
101
|
function documentationVersionFromUri(uri) {
|
|
59
102
|
const match = /\/v([1-9][0-9]*)$/u.exec(uri);
|
|
@@ -61,12 +104,12 @@ function documentationVersionFromUri(uri) {
|
|
|
61
104
|
return Number(match[1]);
|
|
62
105
|
}
|
|
63
106
|
|
|
64
|
-
function documentationIndexText(currency) {
|
|
107
|
+
function documentationIndexText(currency, publishedUri = DOCUMENTATION_INDEX_URI) {
|
|
65
108
|
const rows = Object.entries(currency.currentUriByTopic).sort(([left], [right]) => codepointCompare(left, right));
|
|
66
109
|
return [
|
|
67
110
|
`# Meguro documentation index v${currency.indexVersion}`,
|
|
68
111
|
'',
|
|
69
|
-
`Published URI: \`${
|
|
112
|
+
`Published URI: \`${publishedUri}\``,
|
|
70
113
|
'',
|
|
71
114
|
'This immutable index records the current published version of every documentation family at issuance.',
|
|
72
115
|
'Use the `meguro/status` annotations from `resources/list` for live currency; cited versioned resources never change.',
|
|
@@ -79,7 +122,10 @@ function documentationIndexText(currency) {
|
|
|
79
122
|
|
|
80
123
|
const CURRENT_GETTING_STARTED_URI = CURRENT_DOCUMENTATION_CURRENCY.currentUriByTopic['getting-started'];
|
|
81
124
|
const CURRENT_PRODUCT_GUIDE_URI = CURRENT_DOCUMENTATION_CURRENCY.currentUriByTopic['product-guide'];
|
|
82
|
-
|
|
125
|
+
const CURRENT_RECEIPT_GUIDE_URI = CURRENT_DOCUMENTATION_CURRENCY.currentUriByTopic['receipt-guide'];
|
|
126
|
+
const CURRENT_GATE_POLICY_URI = CURRENT_DOCUMENTATION_CURRENCY.currentUriByTopic['gate-policy'];
|
|
127
|
+
const CURRENT_INDEX_URI = CURRENT_DOCUMENTATION_CURRENCY.currentUriByTopic.index;
|
|
128
|
+
export const MCP_INITIALIZE_INSTRUCTIONS = `Start with \`${CURRENT_GETTING_STARTED_URI}\` or call \`docs_read({ topic: "getting-started", version: ${documentationVersionFromUri(CURRENT_GETTING_STARTED_URI)} })\`; for general Meguro questions, read \`${CURRENT_PRODUCT_GUIDE_URI}\` or call \`docs_read({ topic: "product-guide", version: ${documentationVersionFromUri(CURRENT_PRODUCT_GUIDE_URI)} })\`; distinguish the documentation resource version in each \`meguro://docs/.../vN\` URI, the runtime Gate policy contract \`meguro.release-gate-policy.v1\` version 1, and the requested Shopify Admin API version from ${ADMIN_API_SUPPORTED_VERSIONS.map((version) => `\`${version}\``).join(' or ')} with default \`${ADMIN_API_DEFAULT_VERSION}\`.`;
|
|
83
129
|
export const PRODUCT_GUIDE_SHA256 = 'e5450c1b4181cec4d6ed0a498dbff1cb25d2e223ff2228928aecbbce9674f074';
|
|
84
130
|
|
|
85
131
|
function deepFreeze(value) {
|
|
@@ -913,6 +959,23 @@ export const GATE_POLICY_V1_CHECKS = deepFreeze([
|
|
|
913
959
|
},
|
|
914
960
|
]);
|
|
915
961
|
|
|
962
|
+
function absoluteGateVerdictFactPath(path) {
|
|
963
|
+
return `facts.${path}`;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
function absoluteGateVerdictFactText(text) {
|
|
967
|
+
return String(text)
|
|
968
|
+
.replaceAll('catalogSourceSummary.', 'facts.catalogSourceSummary.')
|
|
969
|
+
.replaceAll('summary.', 'facts.summary.');
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
export const GATE_POLICY_V3_CHECKS = deepFreeze(GATE_POLICY_V1_CHECKS.map((check) => ({
|
|
973
|
+
...check,
|
|
974
|
+
facts: check.facts.map(absoluteGateVerdictFactPath),
|
|
975
|
+
threshold: absoluteGateVerdictFactText(check.threshold),
|
|
976
|
+
flip: absoluteGateVerdictFactText(check.flip),
|
|
977
|
+
})));
|
|
978
|
+
|
|
916
979
|
const GATE_POLICY_TEXT = `# Meguro Gate policy v1
|
|
917
980
|
|
|
918
981
|
Published URI: \`${GATE_POLICY_URI}\`
|
|
@@ -1248,6 +1311,118 @@ a plan, consent for the human, or reveal a credential that the human has not gra
|
|
|
1248
1311
|
## Question-to-source routing`,
|
|
1249
1312
|
)
|
|
1250
1313
|
.replace('Read \`meguro://docs/getting-started/v1\`.', `Read \`${GETTING_STARTED_V6_URI}\`.`);
|
|
1314
|
+
const REAL_STORE_HISTORY_LANE_BRIDGE = 'Meguro\'s separate real-store history lane still exists in the public STDIO distribution for internal and CI use; hosted OAuth MCP does not expose or teach that lane.';
|
|
1315
|
+
const GETTING_STARTED_V7_TEXT = GETTING_STARTED_V6_TEXT
|
|
1316
|
+
.replace('# Getting started with Meguro v6', '# Getting started with Meguro v7')
|
|
1317
|
+
.replace(`Published URI: \`${GETTING_STARTED_V6_URI}\``, `Published URI: \`${GETTING_STARTED_V7_URI}\``)
|
|
1318
|
+
.replaceAll('meguro://docs/gate-policy/v1', 'meguro://docs/gate-policy/v2')
|
|
1319
|
+
.replace(
|
|
1320
|
+
`The local \`meguro-mcp\` server is the Meguro control plane: it discovers stores and drives run
|
|
1321
|
+
lifecycle. The practice store's returned Shopify-shaped Admin endpoint is the data plane used by the
|
|
1322
|
+
commerce agent under evaluation. A practice store's storefront MCP endpoint is neither of those and
|
|
1323
|
+
cannot replace the local control plane or the Shopify-shaped Admin endpoint.`,
|
|
1324
|
+
`Hosted OAuth MCP is the recommended control plane for interactive agents. The public STDIO
|
|
1325
|
+
distribution is the CI and internal fallback. The practice store's returned Shopify-shaped Admin
|
|
1326
|
+
endpoint is the data plane used by the commerce agent under evaluation; its storefront MCP endpoint
|
|
1327
|
+
is neither control plane nor a substitute for the Shopify-shaped Admin endpoint.
|
|
1328
|
+
|
|
1329
|
+
${REAL_STORE_HISTORY_LANE_BRIDGE}`,
|
|
1330
|
+
);
|
|
1331
|
+
const PRODUCT_GUIDE_V4_TEXT = PRODUCT_GUIDE_V3_TEXT
|
|
1332
|
+
.replace('# Meguro product guide v3', '# Meguro product guide v4')
|
|
1333
|
+
.replace(`Published URI: \`${PRODUCT_GUIDE_V3_URI}\``, `Published URI: \`${PRODUCT_GUIDE_V4_URI}\``)
|
|
1334
|
+
.replaceAll('meguro://docs/gate-policy/v1', 'meguro://docs/gate-policy/v2')
|
|
1335
|
+
.replace(`Read \`${GETTING_STARTED_V6_URI}\`.`, `Read \`${GETTING_STARTED_V7_URI}\`.`)
|
|
1336
|
+
.replace(
|
|
1337
|
+
'- **Public STDIO MCP** is the local and CI fallback.',
|
|
1338
|
+
`- **Public STDIO MCP** is the CI and internal fallback.
|
|
1339
|
+
|
|
1340
|
+
${REAL_STORE_HISTORY_LANE_BRIDGE}`,
|
|
1341
|
+
)
|
|
1342
|
+
.replace(
|
|
1343
|
+
'| What runs exist or what happened? | Call \`runs_list\` and the relevant status, report, or impact tool. |',
|
|
1344
|
+
'| What practice runs exist or what happened? | Call \`practice_runs_list\` and the relevant \`practice_run_status\`, \`practice_run_report\`, or \`practice_run_impact\` tool. |',
|
|
1345
|
+
);
|
|
1346
|
+
const CURRENT_VERSION_LABELS_TEXT = `## Three different version labels
|
|
1347
|
+
|
|
1348
|
+
- **Documentation resource version:** the trailing \`vN\` in an immutable \`meguro://docs/.../vN\`
|
|
1349
|
+
URI identifies that document's bytes. Read \`${CURRENT_INDEX_URI}\` for the current resource URI in
|
|
1350
|
+
every documentation family.
|
|
1351
|
+
- **Runtime Gate policy contract version:** \`meguro.release-gate-policy.v1\`, version \`1\`, identifies
|
|
1352
|
+
the policy evaluated against receipt facts. The current explanatory documentation for that contract
|
|
1353
|
+
is \`${CURRENT_GATE_POLICY_URI}\`; its documentation resource version is a separate number.
|
|
1354
|
+
- **Requested Shopify Admin API version:** the version segment in an Admin request selects one of
|
|
1355
|
+
${ADMIN_API_SUPPORTED_VERSIONS.map((version) => `\`${version}\``).join(' or ')}. The current default is
|
|
1356
|
+
\`${ADMIN_API_DEFAULT_VERSION}\`; a caller may still request a supported non-default version, and the
|
|
1357
|
+
resulting plan and evidence retain that requested value.`;
|
|
1358
|
+
const CURRENT_DEEPER_DOCUMENTATION_TEXT = `## Deeper in-band documentation
|
|
1359
|
+
|
|
1360
|
+
- Receipt interpretation: read \`${CURRENT_RECEIPT_GUIDE_URI}\` or call
|
|
1361
|
+
\`docs_read({ topic: "receipt-guide", version: ${documentationVersionFromUri(CURRENT_RECEIPT_GUIDE_URI)} })\`.
|
|
1362
|
+
- Gate policy: read \`${CURRENT_GATE_POLICY_URI}\` or call
|
|
1363
|
+
\`docs_read({ topic: "gate-policy", version: ${documentationVersionFromUri(CURRENT_GATE_POLICY_URI)} })\`.
|
|
1364
|
+
- Current-document pointers: read \`${CURRENT_INDEX_URI}\` or call
|
|
1365
|
+
\`docs_read({ topic: "index", version: ${documentationVersionFromUri(CURRENT_INDEX_URI)} })\`.
|
|
1366
|
+
|
|
1367
|
+
All published documentation resources are immutable. Cite the exact URI, version, and SHA-256
|
|
1368
|
+
digest returned by Meguro.`;
|
|
1369
|
+
const GETTING_STARTED_V7_DEEPER_DOCUMENTATION_TEXT = `## Deeper in-band documentation
|
|
1370
|
+
|
|
1371
|
+
- Receipt interpretation: read \`${RECEIPT_GUIDE_URI}\` or
|
|
1372
|
+
\`${RECEIPT_GUIDE_V2_URI}\`, or call
|
|
1373
|
+
\`docs_read({ topic: "receipt-guide", version: 1 })\` or
|
|
1374
|
+
\`docs_read({ topic: "receipt-guide", version: 2 })\`.
|
|
1375
|
+
- Gate policy: read \`${GATE_POLICY_V2_URI}\`, or call
|
|
1376
|
+
\`docs_read({ topic: "gate-policy", version: 1 })\`.
|
|
1377
|
+
|
|
1378
|
+
All published documentation resources are immutable. Cite the exact URI, version, and SHA-256
|
|
1379
|
+
digest returned by Meguro.`;
|
|
1380
|
+
const CIMD_TROUBLESHOOTING_TEXT = `## Claude Code authentication troubleshooting
|
|
1381
|
+
|
|
1382
|
+
If Claude Code reports Authenticated but calls return \`401 invalid_token\`, remove the stored Meguro
|
|
1383
|
+
server entry and re-add it; the CLI can retain an expired token across logout/login.`;
|
|
1384
|
+
const ASSERTION_FAMILY_EXERCISE_TEXT = `## How to exercise each assertion family
|
|
1385
|
+
|
|
1386
|
+
- **Receipt:** complete a run after the agent sends at least one Admin call, then read the immutable
|
|
1387
|
+
receipt. This exercises receipt construction and attribution; an empty or incomplete run does not.
|
|
1388
|
+
- **State safety:** during an open run, issue the representative supported state-changing action and
|
|
1389
|
+
any intended refusal case, then inspect the recorded accepted/rejected action and resulting store
|
|
1390
|
+
state. A read-only run cannot establish this family.
|
|
1391
|
+
- **Backoff:** use genuinely provoked throttling, for example with cost-heavy queries that drain the
|
|
1392
|
+
configured GraphQL bucket, observe the throttled response, wait as directed, and send the matching
|
|
1393
|
+
retry. Ordinary successful traffic does not exercise retry recovery or throttle discipline.
|
|
1394
|
+
- **Webhook:** this family is not available in this run mode on the current hosted practice lane:
|
|
1395
|
+
the lane has no supported webhook-subscription registration or delivery endpoint. That is a lane limitation,
|
|
1396
|
+
never an agent omission. This documentation adds no webhook capability.`;
|
|
1397
|
+
const CHANNEL_ABSTRACTION_TEXT = `## Effect-level channel abstraction
|
|
1398
|
+
|
|
1399
|
+
Messaging and fulfillment channels are represented as effect-level practice actions. For example,
|
|
1400
|
+
cart-recovery's supported write is **Recover abandoned checkout**, while generic email/SMS sending is
|
|
1401
|
+
\`knownUnsupported\`. The practice world grades the decision's effect, not the delivery channel; a
|
|
1402
|
+
generic channel appearing in \`knownUnsupported\` does not mean the corresponding commerce decision
|
|
1403
|
+
is absent when an effect-level action is declared.`;
|
|
1404
|
+
const GETTING_STARTED_V8_TEXT = GETTING_STARTED_V7_TEXT
|
|
1405
|
+
.replace('# Getting started with Meguro v7', '# Getting started with Meguro v8')
|
|
1406
|
+
.replace(`Published URI: \`${GETTING_STARTED_V7_URI}\``, `Published URI: \`${GETTING_STARTED_V8_URI}\``)
|
|
1407
|
+
.replace(GETTING_STARTED_V7_DEEPER_DOCUMENTATION_TEXT, CURRENT_DEEPER_DOCUMENTATION_TEXT)
|
|
1408
|
+
.replace('## Control and data planes', `${CURRENT_VERSION_LABELS_TEXT}\n\n## Control and data planes`)
|
|
1409
|
+
.replace('## Deeper in-band documentation', `${CIMD_TROUBLESHOOTING_TEXT}\n\n## Deeper in-band documentation`);
|
|
1410
|
+
const PRODUCT_GUIDE_V5_TEXT = PRODUCT_GUIDE_V4_TEXT
|
|
1411
|
+
.replace('# Meguro product guide v4', '# Meguro product guide v5')
|
|
1412
|
+
.replace(`Published URI: \`${PRODUCT_GUIDE_V4_URI}\``, `Published URI: \`${PRODUCT_GUIDE_V5_URI}\``)
|
|
1413
|
+
.replace(
|
|
1414
|
+
`read
|
|
1415
|
+
\`${RECEIPT_GUIDE_URI}\` or \`${RECEIPT_GUIDE_V2_URI}\`.`,
|
|
1416
|
+
`read \`${CURRENT_RECEIPT_GUIDE_URI}\`.`,
|
|
1417
|
+
)
|
|
1418
|
+
.replaceAll(RECEIPT_GUIDE_URI, CURRENT_RECEIPT_GUIDE_URI)
|
|
1419
|
+
.replaceAll(RECEIPT_GUIDE_V2_URI, CURRENT_RECEIPT_GUIDE_URI)
|
|
1420
|
+
.replaceAll(GATE_POLICY_V2_URI, CURRENT_GATE_POLICY_URI)
|
|
1421
|
+
.replaceAll(GETTING_STARTED_V7_URI, CURRENT_GETTING_STARTED_URI)
|
|
1422
|
+
.replace(
|
|
1423
|
+
'## Stable concepts versus changing facts',
|
|
1424
|
+
`${CURRENT_VERSION_LABELS_TEXT}\n\n${ASSERTION_FAMILY_EXERCISE_TEXT}\n\n${CHANNEL_ABSTRACTION_TEXT}\n\n## Stable concepts versus changing facts`,
|
|
1425
|
+
);
|
|
1251
1426
|
const RECEIPT_GUIDE_V6_TEXT = simulationVocabularyText(
|
|
1252
1427
|
RECEIPT_GUIDE_V5_TEXT
|
|
1253
1428
|
.replace('# Meguro receipt guide v5', '# Meguro receipt guide v6')
|
|
@@ -1285,6 +1460,71 @@ const GATE_POLICY_V2_TEXT = simulationVocabularyText(
|
|
|
1285
1460
|
.replace('# Meguro Gate policy v1', '# Meguro Gate policy v2')
|
|
1286
1461
|
.replace(`Published URI: \`${GATE_POLICY_URI}\``, `Published URI: \`${GATE_POLICY_V2_URI}\``),
|
|
1287
1462
|
);
|
|
1463
|
+
const GATE_POLICY_V1_CHECK_TEXT = GATE_POLICY_V1_CHECKS.map((check) => `### ${check.name}
|
|
1464
|
+
|
|
1465
|
+
- Receipt facts: ${check.facts.map((fact) => `\`${fact}\``).join(', ')}
|
|
1466
|
+
- Threshold: ${check.threshold}.
|
|
1467
|
+
- Flip condition: ${check.flip}.`).join('\n\n');
|
|
1468
|
+
const GATE_POLICY_V3_CHECK_TEXT = GATE_POLICY_V3_CHECKS.map((check) => `### ${check.name}
|
|
1469
|
+
|
|
1470
|
+
- Receipt facts: ${check.facts.map((fact) => `\`${fact}\``).join(', ')}
|
|
1471
|
+
- Threshold: ${check.threshold}.
|
|
1472
|
+
- Flip condition: ${check.flip}.`).join('\n\n');
|
|
1473
|
+
const GATE_POLICY_V3_FACT_ROOT_TEXT = `## Canonical fact root
|
|
1474
|
+
|
|
1475
|
+
Every receipt-fact path in this policy is absolute against the complete
|
|
1476
|
+
\`meguro.gate-verdict.v1\` payload returned by \`gate_verdict\`. The authoritative facts live
|
|
1477
|
+
under \`facts\`; do not strip that prefix, resolve a citation against another receipt projection,
|
|
1478
|
+
or copy a citation's value as a substitute for resolving its path.
|
|
1479
|
+
|
|
1480
|
+
Resolve every required path before applying a threshold. If any path is absent, fail closed with:
|
|
1481
|
+
|
|
1482
|
+
\`\`\`json
|
|
1483
|
+
{"schemaVersion":"meguro.gate-policy-fact-resolution.v1","status":"refused","code":"required-receipt-fact-missing","policyUri":"${GATE_POLICY_V3_URI}","missingFactPaths":["facts.example"],"meaning":"The canonical Gate verdict does not contain every fact required by this policy.","nextStep":"Call gate_evaluate for the receipt, then call gate_verdict again. Do not infer, fabricate, or default a missing fact."}
|
|
1484
|
+
\`\`\``;
|
|
1485
|
+
const GATE_POLICY_V3_TEXT = GATE_POLICY_V2_TEXT
|
|
1486
|
+
.replace('# Meguro Gate policy v2', '# Meguro Gate policy v3')
|
|
1487
|
+
.replace(`Published URI: \`${GATE_POLICY_V2_URI}\``, `Published URI: \`${GATE_POLICY_V3_URI}\``)
|
|
1488
|
+
.replace('## Checks', `${GATE_POLICY_V3_FACT_ROOT_TEXT}\n\n## Checks`)
|
|
1489
|
+
.replace(GATE_POLICY_V1_CHECK_TEXT, GATE_POLICY_V3_CHECK_TEXT)
|
|
1490
|
+
.replace(
|
|
1491
|
+
`A verdict citing policy version 1 always resolves to \`${GATE_POLICY_URI}\`. This content and digest
|
|
1492
|
+
do not change. A future policy receives a new id, version, URI, and digest; it is appended beside v1
|
|
1493
|
+
instead of replacing it.`,
|
|
1494
|
+
`The runtime policy remains \`meguro.release-gate-policy.v1\`, version \`1\`. Documentation version 3
|
|
1495
|
+
corrects its fact-path addressing against the complete canonical verdict payload; it does not rewrite
|
|
1496
|
+
the runtime thresholds or either historical documentation resource. Versions 1 and 2 retain their
|
|
1497
|
+
original bytes and digests, while this corrected resource remains immutable at \`${GATE_POLICY_V3_URI}\`.`,
|
|
1498
|
+
);
|
|
1499
|
+
|
|
1500
|
+
function gatePolicyValueAt(value, path) {
|
|
1501
|
+
return path.replace(/\[(\d+)\]/gu, '.$1').split('.').reduce((current, key) => {
|
|
1502
|
+
if (!current || typeof current !== 'object' || !Object.hasOwn(current, key)) return undefined;
|
|
1503
|
+
return current[key];
|
|
1504
|
+
}, value);
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
export function gatePolicyFactResolution(verdict) {
|
|
1508
|
+
const required = [...new Set(GATE_POLICY_V3_CHECKS.flatMap((check) => check.facts))];
|
|
1509
|
+
const missingFactPaths = required.filter((path) => gatePolicyValueAt(verdict, path) === undefined);
|
|
1510
|
+
if (missingFactPaths.length) {
|
|
1511
|
+
return deepFreeze({
|
|
1512
|
+
schemaVersion: 'meguro.gate-policy-fact-resolution.v1',
|
|
1513
|
+
status: 'refused',
|
|
1514
|
+
code: 'required-receipt-fact-missing',
|
|
1515
|
+
policyUri: GATE_POLICY_V3_URI,
|
|
1516
|
+
missingFactPaths,
|
|
1517
|
+
meaning: 'The canonical Gate verdict does not contain every fact required by this policy.',
|
|
1518
|
+
nextStep: 'Call gate_evaluate for the receipt, then call gate_verdict again. Do not infer, fabricate, or default a missing fact.',
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
return deepFreeze({
|
|
1522
|
+
schemaVersion: 'meguro.gate-policy-fact-resolution.v1',
|
|
1523
|
+
status: 'resolved',
|
|
1524
|
+
policyUri: GATE_POLICY_V3_URI,
|
|
1525
|
+
resolvedFactPaths: required,
|
|
1526
|
+
});
|
|
1527
|
+
}
|
|
1288
1528
|
|
|
1289
1529
|
function entry(input) {
|
|
1290
1530
|
const text = String(input.text);
|
|
@@ -1415,6 +1655,24 @@ const CATALOG = buildDocumentationCatalog([
|
|
|
1415
1655
|
description: `World-first discovery sequence for Shopify Admin GraphQL ${ADMIN_API_SUPPORTED_VERSIONS.join(' and ')} with default ${ADMIN_API_DEFAULT_VERSION}.`,
|
|
1416
1656
|
text: GETTING_STARTED_V6_TEXT,
|
|
1417
1657
|
},
|
|
1658
|
+
{
|
|
1659
|
+
topic: 'getting-started',
|
|
1660
|
+
version: GETTING_STARTED_V7_VERSION,
|
|
1661
|
+
uri: GETTING_STARTED_V7_URI,
|
|
1662
|
+
name: 'Getting started with Meguro v7',
|
|
1663
|
+
title: 'Getting started with Meguro v7',
|
|
1664
|
+
description: `Hosted-first practice-store sequence for Shopify Admin GraphQL ${ADMIN_API_SUPPORTED_VERSIONS.join(' and ')} with default ${ADMIN_API_DEFAULT_VERSION}.`,
|
|
1665
|
+
text: GETTING_STARTED_V7_TEXT,
|
|
1666
|
+
},
|
|
1667
|
+
{
|
|
1668
|
+
topic: 'getting-started',
|
|
1669
|
+
version: GETTING_STARTED_V8_VERSION,
|
|
1670
|
+
uri: GETTING_STARTED_V8_URI,
|
|
1671
|
+
name: 'Getting started with Meguro v8',
|
|
1672
|
+
title: 'Getting started with Meguro v8',
|
|
1673
|
+
description: `Current-link-derived hosted sequence with explicit document, Gate-contract, and Shopify Admin version labels; supported Admin versions ${ADMIN_API_SUPPORTED_VERSIONS.join(' and ')}, default ${ADMIN_API_DEFAULT_VERSION}.`,
|
|
1674
|
+
text: GETTING_STARTED_V8_TEXT,
|
|
1675
|
+
},
|
|
1418
1676
|
{
|
|
1419
1677
|
topic: 'product-guide',
|
|
1420
1678
|
version: PRODUCT_GUIDE_VERSION,
|
|
@@ -1443,6 +1701,24 @@ const CATALOG = buildDocumentationCatalog([
|
|
|
1443
1701
|
description: 'World-first product concepts, evidence boundaries, surface responsibilities, and question-to-source routing.',
|
|
1444
1702
|
text: PRODUCT_GUIDE_V3_TEXT,
|
|
1445
1703
|
},
|
|
1704
|
+
{
|
|
1705
|
+
topic: 'product-guide',
|
|
1706
|
+
version: PRODUCT_GUIDE_V4_VERSION,
|
|
1707
|
+
uri: PRODUCT_GUIDE_V4_URI,
|
|
1708
|
+
name: 'Meguro product guide v4',
|
|
1709
|
+
title: 'Meguro product guide v4',
|
|
1710
|
+
description: 'Hosted-first product concepts, practice-run vocabulary, evidence boundaries, and question-to-source routing.',
|
|
1711
|
+
text: PRODUCT_GUIDE_V4_TEXT,
|
|
1712
|
+
},
|
|
1713
|
+
{
|
|
1714
|
+
topic: 'product-guide',
|
|
1715
|
+
version: PRODUCT_GUIDE_V5_VERSION,
|
|
1716
|
+
uri: PRODUCT_GUIDE_V5_URI,
|
|
1717
|
+
name: 'Meguro product guide v5',
|
|
1718
|
+
title: 'Meguro product guide v5',
|
|
1719
|
+
description: 'Current-link-derived product concepts with version-label, assertion-family, and effect-level channel guidance.',
|
|
1720
|
+
text: PRODUCT_GUIDE_V5_TEXT,
|
|
1721
|
+
},
|
|
1446
1722
|
{
|
|
1447
1723
|
topic: 'index',
|
|
1448
1724
|
version: DOCUMENTATION_CURRENCY_V1.indexVersion,
|
|
@@ -1452,6 +1728,33 @@ const CATALOG = buildDocumentationCatalog([
|
|
|
1452
1728
|
description: 'Immutable current-version pointers for every published Meguro documentation family.',
|
|
1453
1729
|
text: documentationIndexText(DOCUMENTATION_CURRENCY_V1),
|
|
1454
1730
|
},
|
|
1731
|
+
{
|
|
1732
|
+
topic: 'index',
|
|
1733
|
+
version: DOCUMENTATION_CURRENCY_V2.indexVersion,
|
|
1734
|
+
uri: DOCUMENTATION_INDEX_V2_URI,
|
|
1735
|
+
name: 'Meguro documentation index v2',
|
|
1736
|
+
title: 'Meguro documentation index v2',
|
|
1737
|
+
description: 'Immutable current-version pointers for every published Meguro documentation family after the hosted run-lane separation.',
|
|
1738
|
+
text: documentationIndexText(DOCUMENTATION_CURRENCY_V2, DOCUMENTATION_INDEX_V2_URI),
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
topic: 'index',
|
|
1742
|
+
version: DOCUMENTATION_CURRENCY_V3.indexVersion,
|
|
1743
|
+
uri: DOCUMENTATION_INDEX_V3_URI,
|
|
1744
|
+
name: 'Meguro documentation index v3',
|
|
1745
|
+
title: 'Meguro documentation index v3',
|
|
1746
|
+
description: 'Immutable current-version pointers after correcting Gate-policy fact paths against the canonical verdict payload.',
|
|
1747
|
+
text: documentationIndexText(DOCUMENTATION_CURRENCY_V3, DOCUMENTATION_INDEX_V3_URI),
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
topic: 'index',
|
|
1751
|
+
version: DOCUMENTATION_CURRENCY_V4.indexVersion,
|
|
1752
|
+
uri: DOCUMENTATION_INDEX_V4_URI,
|
|
1753
|
+
name: 'Meguro documentation index v4',
|
|
1754
|
+
title: 'Meguro documentation index v4',
|
|
1755
|
+
description: 'Immutable current-version pointers after the current-link, version-label, and explanatory-rider documentation mint.',
|
|
1756
|
+
text: documentationIndexText(DOCUMENTATION_CURRENCY_V4, DOCUMENTATION_INDEX_V4_URI),
|
|
1757
|
+
},
|
|
1455
1758
|
{
|
|
1456
1759
|
topic: 'receipt-guide',
|
|
1457
1760
|
version: RECEIPT_GUIDE_VERSION,
|
|
@@ -1533,6 +1836,15 @@ const CATALOG = buildDocumentationCatalog([
|
|
|
1533
1836
|
description: 'Immutable named checks and flip conditions republished with the simulation-run vocabulary.',
|
|
1534
1837
|
text: GATE_POLICY_V2_TEXT,
|
|
1535
1838
|
},
|
|
1839
|
+
{
|
|
1840
|
+
topic: 'gate-policy',
|
|
1841
|
+
version: GATE_POLICY_V3_VERSION,
|
|
1842
|
+
uri: GATE_POLICY_V3_URI,
|
|
1843
|
+
name: 'Meguro Gate policy v3',
|
|
1844
|
+
title: 'Meguro Gate policy v3',
|
|
1845
|
+
description: 'Immutable named checks with absolute fact paths against the complete canonical Gate verdict payload.',
|
|
1846
|
+
text: GATE_POLICY_V3_TEXT,
|
|
1847
|
+
},
|
|
1536
1848
|
], CURRENT_DOCUMENTATION_CURRENCY);
|
|
1537
1849
|
|
|
1538
1850
|
export function documentationResources() {
|
package/src/server.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from './protocol.mjs';
|
|
15
15
|
import { createTools, redactSecrets } from './tools.mjs';
|
|
16
16
|
|
|
17
|
-
const SERVER_INFO = { name: 'meguro', version: '0.2.
|
|
17
|
+
const SERVER_INFO = { name: 'meguro', version: '0.2.10' };
|
|
18
18
|
const PROTOCOL_VERSION = '2025-03-26';
|
|
19
19
|
|
|
20
20
|
const tools = createTools({
|
package/src/tools.mjs
CHANGED
|
@@ -397,7 +397,12 @@ const PRACTICE_RUN_OBSERVATION_REQUEST_INPUT_SCHEMA = Object.freeze({
|
|
|
397
397
|
type: 'object',
|
|
398
398
|
additionalProperties: false,
|
|
399
399
|
properties: {
|
|
400
|
-
apiVersion: {
|
|
400
|
+
apiVersion: {
|
|
401
|
+
type: 'string',
|
|
402
|
+
enum: [...ADMIN_API_SUPPORTED_VERSIONS],
|
|
403
|
+
default: ADMIN_API_DEFAULT_VERSION,
|
|
404
|
+
description: `Requested Shopify Admin API version for this checkpoint observation. Supported: ${ADMIN_API_SUPPORTED_VERSION_LABEL}; default: ${ADMIN_API_DEFAULT_VERSION}. The retained non-default version remains explicit in the stored plan and evidence.`,
|
|
405
|
+
},
|
|
401
406
|
query: { type: 'string', minLength: 1, maxLength: 30000, description: 'One read-only Shopify Admin GraphQL document.' },
|
|
402
407
|
operationName: { type: 'string', minLength: 1, description: 'Required when query contains more than one operation.' },
|
|
403
408
|
// GraphQL variables are deliberately arbitrary JSON keys. The registry sweep pins this one
|
|
@@ -725,12 +730,49 @@ function receiptProjection(value) {
|
|
|
725
730
|
const practiceRun = attempt.practiceRun ?? value?.practiceRun ?? null;
|
|
726
731
|
const calls = Array.isArray(value?.events?.calls) ? value.events.calls : [];
|
|
727
732
|
const actions = Array.isArray(value?.events?.actions) ? value.events.actions : [];
|
|
733
|
+
const capabilityMatrix = value?.receiptEvidence?.assertionCapabilities;
|
|
734
|
+
const webhookCapability = capabilityMatrix?.schemaVersion === 'meguro.receipt-assertion-capabilities.v1'
|
|
735
|
+
&& capabilityMatrix?.families?.webhook
|
|
736
|
+
&& typeof capabilityMatrix.families.webhook === 'object'
|
|
737
|
+
? capabilityMatrix.families.webhook
|
|
738
|
+
: null;
|
|
728
739
|
const assertions = Array.isArray(value?.receiptEvidence?.assertions)
|
|
729
|
-
? value.receiptEvidence.assertions.slice(0, 50).map((assertion) =>
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
740
|
+
? value.receiptEvidence.assertions.slice(0, 50).map((assertion) => {
|
|
741
|
+
if (assertion?.category !== 'webhook') {
|
|
742
|
+
return { id: assertion.id, status: assertion.status, label: assertion.label };
|
|
743
|
+
}
|
|
744
|
+
if (webhookCapability?.availability === 'available') {
|
|
745
|
+
return { id: assertion.id, status: assertion.status, label: assertion.label, detail: assertion.detail };
|
|
746
|
+
}
|
|
747
|
+
if (webhookCapability?.availability === 'unavailable'
|
|
748
|
+
&& webhookCapability.statusLabel === 'not available in this run mode'
|
|
749
|
+
&& typeof webhookCapability.detail === 'string'
|
|
750
|
+
&& webhookCapability.detail.trim()) {
|
|
751
|
+
return {
|
|
752
|
+
id: assertion.id,
|
|
753
|
+
status: webhookCapability.statusLabel,
|
|
754
|
+
label: assertion.label,
|
|
755
|
+
detail: webhookCapability.detail,
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
if (webhookCapability?.availability === 'unknown'
|
|
759
|
+
&& webhookCapability.statusLabel === 'availability unknown'
|
|
760
|
+
&& typeof webhookCapability.detail === 'string'
|
|
761
|
+
&& webhookCapability.detail.trim()) {
|
|
762
|
+
return {
|
|
763
|
+
id: assertion.id,
|
|
764
|
+
status: webhookCapability.statusLabel,
|
|
765
|
+
label: assertion.label,
|
|
766
|
+
detail: webhookCapability.detail,
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
return {
|
|
770
|
+
id: assertion.id,
|
|
771
|
+
status: 'availability unknown',
|
|
772
|
+
label: assertion.label,
|
|
773
|
+
detail: 'Webhook assertion availability is unknown because this receipt has no capability metadata.',
|
|
774
|
+
};
|
|
775
|
+
})
|
|
734
776
|
: [];
|
|
735
777
|
const verdict = value?.report?.verdict && typeof value.report.verdict === 'object'
|
|
736
778
|
? Object.fromEntries(['status', 'outcome', 'grade', 'score', 'headline', 'horizonDays']
|
|
@@ -1048,6 +1090,7 @@ function usageProjection(value) {
|
|
|
1048
1090
|
? 'Retained activity does not agree with the tier meter; the competing activity-derived total is withheld.'
|
|
1049
1091
|
: 'Retained activity is incomplete; no activity-derived consumption total is projected.',
|
|
1050
1092
|
},
|
|
1093
|
+
simulationRunAccounting: value?.simulationRunAccounting ?? null,
|
|
1051
1094
|
headroom: {
|
|
1052
1095
|
remainingSimulationRuns,
|
|
1053
1096
|
remainingStoreSlots: Math.max(0, activeStoreLimit - activeStores),
|
|
@@ -1055,6 +1098,11 @@ function usageProjection(value) {
|
|
|
1055
1098
|
},
|
|
1056
1099
|
limits: {
|
|
1057
1100
|
activeStores,
|
|
1101
|
+
activeStoreAccounting: {
|
|
1102
|
+
basis: 'metered-active-stores',
|
|
1103
|
+
exemptionMarker: 'auto-provisioned-sample-store',
|
|
1104
|
+
note: 'activeStores counts metered stores. A stores_list row marked auto-provisioned-sample-store is an exempt sample store and is not counted here.',
|
|
1105
|
+
},
|
|
1058
1106
|
activeStoreLimit,
|
|
1059
1107
|
activeWorkspaces,
|
|
1060
1108
|
activeWorkspaceLimit,
|
|
@@ -1991,7 +2039,7 @@ export function createTools(config) {
|
|
|
1991
2039
|
},
|
|
1992
2040
|
{
|
|
1993
2041
|
name: 'usage_read',
|
|
1994
|
-
description: 'Read authoritative tier-meter simulation runs, practice-store, and workspace headroom before starting work.
|
|
2042
|
+
description: 'Read authoritative tier-meter simulation runs, practice-store, and workspace headroom before starting work. When retained activity reconciles, simulationRunAccounting gives the exact counted + excluded non-billable sample = visible completed equation and the stable exclusion-policy identity. Incomplete coverage or a source mismatch is disclosed without projecting a competing consumption number.',
|
|
1995
2043
|
inputSchema: { type: 'object', additionalProperties: false, properties: {}, required: [] },
|
|
1996
2044
|
},
|
|
1997
2045
|
{
|