@ggui-ai/mcp-server-handlers 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blueprints/search-blueprints.d.ts +10 -6
- package/dist/blueprints/search-blueprints.d.ts.map +1 -1
- package/dist/blueprints/search-blueprints.js +10 -6
- package/dist/ops-blueprint/generate.d.ts.map +1 -1
- package/dist/ops-blueprint/generate.js +5 -1
- package/dist/renders/blueprint-matcher.d.ts +6 -7
- package/dist/renders/blueprint-matcher.d.ts.map +1 -1
- package/dist/renders/blueprint-matcher.js +18 -11
- package/dist/renders/index.d.ts +1 -0
- package/dist/renders/index.d.ts.map +1 -1
- package/dist/renders/index.js +1 -0
- package/dist/renders/match-precision/run-probe.js +197 -18
- package/dist/renders/probe-anthropic-judge.d.ts +1 -0
- package/dist/renders/probe-anthropic-judge.d.ts.map +1 -1
- package/dist/renders/probe-anthropic-judge.js +1 -1
- package/dist/renders/record-committed-one-shot.d.ts +54 -0
- package/dist/renders/record-committed-one-shot.d.ts.map +1 -0
- package/dist/renders/record-committed-one-shot.js +41 -0
- package/dist/renders/render.d.ts.map +1 -1
- package/dist/renders/render.js +8 -3
- package/dist/renders/slice-meta-derivation.d.ts +8 -1
- package/dist/renders/slice-meta-derivation.d.ts.map +1 -1
- package/dist/renders/slice-meta-derivation.js +11 -0
- package/dist/renders/submit-action.d.ts.map +1 -1
- package/dist/renders/submit-action.js +30 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -53,12 +53,16 @@
|
|
|
53
53
|
import { z } from 'zod';
|
|
54
54
|
import type { BlueprintProvider, EmbeddingProvider, VectorStore } from '@ggui-ai/mcp-server-core';
|
|
55
55
|
/**
|
|
56
|
-
* The similarity floor for
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
56
|
+
* The similarity floor for this tool: a hit under it is dropped. Below
|
|
57
|
+
* this is noise; callers that want stricter matching post-filter by
|
|
58
|
+
* `score`.
|
|
59
|
+
*
|
|
60
|
+
* The handshake matcher (`matchBlueprint`) gates its judge with its own
|
|
61
|
+
* number (0.2), not this one, because the two are not on one scale: the
|
|
62
|
+
* matcher's retrieval query embeds a request's intent without its
|
|
63
|
+
* contract while stored vectors embed both, which depresses its cosines
|
|
64
|
+
* (ggui#606, ggui#1275). One shared number returns when the matcher's
|
|
65
|
+
* query is composed like the stored side.
|
|
62
66
|
*/
|
|
63
67
|
export declare const MIN_SIMILARITY_SCORE = 0.3;
|
|
64
68
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-blueprints.d.ts","sourceRoot":"","sources":["../../src/blueprints/search-blueprints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAEV,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAUlC
|
|
1
|
+
{"version":3,"file":"search-blueprints.d.ts","sourceRoot":"","sources":["../../src/blueprints/search-blueprints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAEV,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAUlC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,IAAM,CAAC;AAE7C;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,OAAO,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAC;IACxC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,8BAA8B,CAAC;CACpD;AAcD;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDvE"}
|
|
@@ -54,12 +54,16 @@ import { z } from 'zod';
|
|
|
54
54
|
import { bundleHostScheme, DEFAULT_BUNDLE_HOST, flatToBlueprintSource, gguiSearchBlueprintsOutputSchema, searchBlueprintsInputShape, } from '@ggui-ai/protocol';
|
|
55
55
|
import { defineHandler } from '../types.js';
|
|
56
56
|
/**
|
|
57
|
-
* The similarity floor for
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
57
|
+
* The similarity floor for this tool: a hit under it is dropped. Below
|
|
58
|
+
* this is noise; callers that want stricter matching post-filter by
|
|
59
|
+
* `score`.
|
|
60
|
+
*
|
|
61
|
+
* The handshake matcher (`matchBlueprint`) gates its judge with its own
|
|
62
|
+
* number (0.2), not this one, because the two are not on one scale: the
|
|
63
|
+
* matcher's retrieval query embeds a request's intent without its
|
|
64
|
+
* contract while stored vectors embed both, which depresses its cosines
|
|
65
|
+
* (ggui#606, ggui#1275). One shared number returns when the matcher's
|
|
66
|
+
* query is composed like the stored side.
|
|
63
67
|
*/
|
|
64
68
|
export const MIN_SIMILARITY_SCORE = 0.3;
|
|
65
69
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/ops-blueprint/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,aAAa,EAGd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,YAAY,EAIlB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAyB,KAAK,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAsBxF;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,SAAS,EAAE,CAAC,CAAC;IAC1E;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;;;;;;OAOG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;CACzD;AA2CD,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;GA0SnC"}
|
|
@@ -250,7 +250,11 @@ export function createGguiOpsGenerateBlueprintHandler(deps) {
|
|
|
250
250
|
}
|
|
251
251
|
// 6. Persist the blueprint + code body.
|
|
252
252
|
const componentCode = result.response.componentCode;
|
|
253
|
-
|
|
253
|
+
// The full sha256, the `CodeStore` key domain (`CODE_HASH_REGEX`) and
|
|
254
|
+
// the same key `ggui_ops_register_blueprint` computes for the same
|
|
255
|
+
// bytes. A 32-hex prefix here (ggui#1287) was refused by every
|
|
256
|
+
// conforming code store.
|
|
257
|
+
const codeHash = createHash("sha256").update(componentCode).digest("hex");
|
|
254
258
|
// The advanced generator tunnels `validatorScore` through
|
|
255
259
|
// `metadata` until the UiGenerator interface widens to carry
|
|
256
260
|
// it explicitly. Read it via the typed helper so the default
|
|
@@ -125,13 +125,12 @@ export interface MatchBlueprintOptions {
|
|
|
125
125
|
/** RAG top-K. Default 20 — balance between recall and prompt cost. */
|
|
126
126
|
readonly topK?: number;
|
|
127
127
|
/**
|
|
128
|
-
* Minimum cosine a candidate needs to reach the LLM judge. Default
|
|
129
|
-
*
|
|
130
|
-
* `ggui_search_blueprints`
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* it, the judge is skipped entirely and the rerank cost is saved.
|
|
128
|
+
* Minimum cosine a candidate needs to reach the LLM judge. Default 0.2
|
|
129
|
+
* (see the DEFAULT_MIN_COSINE note for why it is not
|
|
130
|
+
* `ggui_search_blueprints`' 0.3). Applied PER CANDIDATE (ggui#1275): a
|
|
131
|
+
* candidate under the floor is never offered to the judge, so it can
|
|
132
|
+
* never become a reuse; when even top-1 is under it, the judge is skipped
|
|
133
|
+
* entirely and the rerank cost is saved.
|
|
135
134
|
*/
|
|
136
135
|
readonly minCosineForRerank?: number;
|
|
137
136
|
/** LLM judge confidence threshold for treating a semantic-strategy decision as a hit. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blueprint-matcher.d.ts","sourceRoot":"","sources":["../../src/renders/blueprint-matcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"blueprint-matcher.d.ts","sourceRoot":"","sources":["../../src/renders/blueprint-matcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAe,KAAK,WAA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AyF;IACzF,+EAA+E;IAC/E,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACpC;AA8BD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,kBAAkB,EACxB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IACL,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACvC,EACD,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CAuW/B"}
|
|
@@ -4,7 +4,6 @@ import { blueprintKey, variantKey } from '@ggui-ai/protocol/blueprint-key';
|
|
|
4
4
|
import { emitCacheTraceEvent, newCacheTraceId, truncateCacheTraceIntent, } from './cache-trace-sink.js';
|
|
5
5
|
import { findBlueprintExact, findBlueprintsByEmbedding, recordBlueprintHit, } from './blueprint-registry.js';
|
|
6
6
|
import { coverageGap } from './blueprint-coverage.js';
|
|
7
|
-
import { MIN_SIMILARITY_SCORE } from '../blueprints/search-blueprints.js';
|
|
8
7
|
/** An all-empty coverage gap — used for exact-key hits (canonical-key
|
|
9
8
|
* equality already implies full coverage) and for contract-less requests
|
|
10
9
|
* (nothing to cover against). */
|
|
@@ -16,16 +15,24 @@ const EMPTY_GAP = {
|
|
|
16
15
|
gadgets: [],
|
|
17
16
|
};
|
|
18
17
|
const DEFAULT_TOP_K = 20;
|
|
19
|
-
// The cosine
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
|
|
18
|
+
// The cosine gate before the judge. It is 0.2 and deliberately NOT
|
|
19
|
+
// `ggui_search_blueprints`' 0.3, because the two numbers are not on one
|
|
20
|
+
// scale: the retrieval query below embeds the request's intent ALONE
|
|
21
|
+
// (`ragArg = { intent }`), while every stored vector embeds its contract
|
|
22
|
+
// summary AND its intent (`composeEmbeddingInput(contract, intent)`). That
|
|
23
|
+
// asymmetry (ggui#606) depresses every cosine this matcher sees. Measured
|
|
24
|
+
// on a development deployment with the production embedder (ggui#1275): a
|
|
25
|
+
// request with the same contract and a near-identical intent scored 0.29
|
|
26
|
+
// here and 0.87 when the query carries the contract too. So a 0.3 gate on
|
|
27
|
+
// this scale turns true matches away before the judge sees them.
|
|
28
|
+
// 0.2 is the gate ggui#606's ranking probe ran under, with the judge
|
|
29
|
+
// picking correctly; what the 0.2–0.3 band admits past the judge was
|
|
30
|
+
// sampled once on dev and not calibrated: 8 reuses, 6 right (short
|
|
31
|
+
// intents at 0.27–0.30) and 2 wrong, both on a blueprint with no cached
|
|
32
|
+
// intent, which ggui#1275 (3) now keeps out of the judge entirely. The
|
|
33
|
+
// gate is recalibrated when the query is composed like the stored side
|
|
34
|
+
// (ggui#606, rnd's design and gate).
|
|
35
|
+
const DEFAULT_MIN_COSINE = 0.2;
|
|
29
36
|
// Loosened for Path-A: accept a semantic judge's pick more readily, so a
|
|
30
37
|
// paraphrased / similar contract is reused instead of cold-generating.
|
|
31
38
|
// Over-proposal is bounded by the agent decision step plus the COVERAGE_GAP
|
package/dist/renders/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
*/
|
|
34
34
|
export { applyGguiSessionPatch, type ApplyGguiSessionPatchInput, type ApplyGguiSessionPatchResult, type GguiSessionTarget, } from "./apply-ggui-session-patch.js";
|
|
35
35
|
export { assertActionContract } from "./assert-action-contract.js";
|
|
36
|
+
export { recordCommittedOneShot, type CommittedOneShotOutcome, type RecordCommittedOneShotInput, } from "./record-committed-one-shot.js";
|
|
36
37
|
export { assertContractNoRetiredFields, ContractRetiredFieldError, } from "./assert-contract-no-retired-fields.js";
|
|
37
38
|
export { assertGadgetsRegistered, filterDescriptorsToContract, findClosestRegisteredHook, GadgetNotRegisteredError, GadgetPackageMismatchError, type PackageMismatchEntry, type UnregisteredHookEntry, } from "./assert-gadgets.js";
|
|
38
39
|
export { isGeneratorRegistered } from "./assert-generator.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renders/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,KAAK,kBAAkB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,0BAA0B,GAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,wBAAwB,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AAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAKjG,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,GACpC,MAAM,sBAAsB,CAAC"}
|
package/dist/renders/index.js
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
*/
|
|
34
34
|
export { applyGguiSessionPatch, } from "./apply-ggui-session-patch.js";
|
|
35
35
|
export { assertActionContract } from "./assert-action-contract.js";
|
|
36
|
+
export { recordCommittedOneShot, } from "./record-committed-one-shot.js";
|
|
36
37
|
export { assertContractNoRetiredFields, ContractRetiredFieldError, } from "./assert-contract-no-retired-fields.js";
|
|
37
38
|
export { assertGadgetsRegistered, filterDescriptorsToContract, findClosestRegisteredHook, GadgetNotRegisteredError, GadgetPackageMismatchError, } from "./assert-gadgets.js";
|
|
38
39
|
export { isGeneratorRegistered } from "./assert-generator.js";
|
|
@@ -31,21 +31,40 @@
|
|
|
31
31
|
* (reads ANTHROPIC_API_KEY or ~/.ggui/credentials.json; ~30-40
|
|
32
32
|
* Haiku calls ≈ well under $1)
|
|
33
33
|
*
|
|
34
|
-
*
|
|
34
|
+
* Arms (env, all optional; unset = the historical run above):
|
|
35
|
+
* - `RND_EMBEDDER_MODULE` — another embedding geometry (see
|
|
36
|
+
* `resolveEmbedding`).
|
|
37
|
+
* - `RND_JUDGE_MODULE` (+ `RND_JUDGE_LABEL`) — another rerank judge
|
|
38
|
+
* behind the same `LLMCaller` seam (see `resolveJudge`).
|
|
39
|
+
* - `RND_TOP_K`, `RND_MIN_COSINE`, `RND_JUDGE_THRESHOLD` — pass those
|
|
40
|
+
* `matchBlueprint` options explicitly, so a run measures the judge
|
|
41
|
+
* at a stated gate whatever default its checkout carries; `0` for
|
|
42
|
+
* `RND_MIN_COSINE` opens the gate (every candidate reaches the
|
|
43
|
+
* judge), for a floor sweep read offline from the recorded cosines.
|
|
44
|
+
* - `RND_OUT_DIR` — output directory, resolved against the working
|
|
45
|
+
* directory (default: the repo's `.tmp/rnd-economy-001`).
|
|
46
|
+
* Every run records, per pair and run, the top-K the matcher retrieved
|
|
47
|
+
* (id, cosine, cached intent) and each judge call (order, wall-clock,
|
|
48
|
+
* candidates shown, decision or error).
|
|
49
|
+
*
|
|
50
|
+
* Experiments: rnd/gen-ui/economy/experiments/001-match-precision-instrument.md
|
|
51
|
+
* (and 002, the second-judge arm)
|
|
35
52
|
*/
|
|
36
53
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
37
54
|
import { homedir } from 'node:os';
|
|
38
|
-
import { join, resolve as pathResolve } from 'node:path';
|
|
55
|
+
import { basename, join, resolve as pathResolve } from 'node:path';
|
|
56
|
+
import { performance } from 'node:perf_hooks';
|
|
39
57
|
import { InMemoryBlueprintIndex, InMemoryVectorStore, } from '@ggui-ai/mcp-server-core/in-memory';
|
|
40
58
|
import { createLocalEmbeddingProvider } from '@ggui-ai/embedding-local';
|
|
41
|
-
import {
|
|
59
|
+
import { isRecord } from '@ggui-ai/protocol';
|
|
60
|
+
import { anthropicProbeJudge, DEFAULT_PROBE_JUDGE_MODEL, } from '../probe-anthropic-judge.js';
|
|
42
61
|
import { matchBlueprint } from '../blueprint-matcher.js';
|
|
43
62
|
import { findBlueprintsByEmbedding, registerBlueprint, } from '../blueprint-registry.js';
|
|
44
63
|
import { setCacheTraceSink, } from '../cache-trace-sink.js';
|
|
45
64
|
import { PAIRS, STUB_CODE } from './pairs.js';
|
|
46
65
|
const SCOPE = 'match-precision-probe';
|
|
47
66
|
const DEBATED_RUNS = 3;
|
|
48
|
-
const OUT_DIR = pathResolve(process.cwd(), '../../../.tmp/rnd-economy-001');
|
|
67
|
+
const OUT_DIR = pathResolve(process.cwd(), process.env['RND_OUT_DIR'] ?? '../../../.tmp/rnd-economy-001');
|
|
49
68
|
// --- judge plumbing (same shape as cache-reuse-probe.ts) -------------------
|
|
50
69
|
function resolveKey() {
|
|
51
70
|
const env = process.env['ANTHROPIC_API_KEY'];
|
|
@@ -58,8 +77,121 @@ function resolveKey() {
|
|
|
58
77
|
throw new Error(`no anthropic key (env or ${p})`);
|
|
59
78
|
return k;
|
|
60
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The rerank judge for this run.
|
|
82
|
+
*
|
|
83
|
+
* Default: the Anthropic probe judge (the control every receipted
|
|
84
|
+
* number was taken under).
|
|
85
|
+
*
|
|
86
|
+
* Judge arm: set `RND_JUDGE_MODULE` to the absolute path of a module
|
|
87
|
+
* exporting `createJudge(): LLMCaller` and the SAME pairs run with that
|
|
88
|
+
* caller behind the rerank's `callStructured` seam — the matcher, the
|
|
89
|
+
* prompt and the candidate list are unchanged; only who answers moves.
|
|
90
|
+
* Loaded by path, like `RND_EMBEDDER_MODULE`, so this script names no
|
|
91
|
+
* provider. `RND_JUDGE_LABEL` names the arm in the summary and the
|
|
92
|
+
* output file (default: the module's file name).
|
|
93
|
+
*/
|
|
94
|
+
async function resolveJudge() {
|
|
95
|
+
const modulePath = process.env['RND_JUDGE_MODULE'];
|
|
96
|
+
if (modulePath === undefined || modulePath.length === 0) {
|
|
97
|
+
return { llm: anthropicProbeJudge(resolveKey()), label: DEFAULT_PROBE_JUDGE_MODEL };
|
|
98
|
+
}
|
|
99
|
+
const mod = (await import(pathResolve(modulePath)));
|
|
100
|
+
if (typeof mod.createJudge !== 'function') {
|
|
101
|
+
throw new Error(`RND_JUDGE_MODULE (${modulePath}) must export createJudge(): LLMCaller`);
|
|
102
|
+
}
|
|
103
|
+
const llm = mod.createJudge();
|
|
104
|
+
if (typeof llm.callStructured !== 'function') {
|
|
105
|
+
throw new Error(`RND_JUDGE_MODULE (${modulePath}) createJudge() returned an LLMCaller without callStructured — the rerank judge answers through a forced tool`);
|
|
106
|
+
}
|
|
107
|
+
const label = process.env['RND_JUDGE_LABEL'];
|
|
108
|
+
return {
|
|
109
|
+
llm,
|
|
110
|
+
label: label !== undefined && label.length > 0
|
|
111
|
+
? label
|
|
112
|
+
: basename(modulePath).replace(/\.[cm]?[jt]s$/, ''),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/** A whole or fractional number from the env, range-checked; unset ⇒ undefined. */
|
|
116
|
+
function numberFromEnv(name, lo, hi, whole) {
|
|
117
|
+
const raw = process.env[name];
|
|
118
|
+
if (raw === undefined || raw.length === 0)
|
|
119
|
+
return undefined;
|
|
120
|
+
const value = Number(raw);
|
|
121
|
+
if (!Number.isFinite(value) || value < lo || value > hi || (whole && !Number.isInteger(value))) {
|
|
122
|
+
throw new Error(`${name}=${raw} is not a ${whole ? 'whole ' : ''}number in [${lo}, ${hi}]`);
|
|
123
|
+
}
|
|
124
|
+
return value;
|
|
125
|
+
}
|
|
126
|
+
/** The `matchBlueprint` options this run passes — empty ⇒ production defaults. */
|
|
127
|
+
function resolveMatchOptions() {
|
|
128
|
+
const topK = numberFromEnv('RND_TOP_K', 1, 200, true);
|
|
129
|
+
const minCosineForRerank = numberFromEnv('RND_MIN_COSINE', 0, 1, false);
|
|
130
|
+
const judgeThreshold = numberFromEnv('RND_JUDGE_THRESHOLD', 0, 1, false);
|
|
131
|
+
return {
|
|
132
|
+
...(topK !== undefined ? { topK } : {}),
|
|
133
|
+
...(minCosineForRerank !== undefined ? { minCosineForRerank } : {}),
|
|
134
|
+
...(judgeThreshold !== undefined ? { judgeThreshold } : {}),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function readDecision(raw) {
|
|
138
|
+
if (!isRecord(raw))
|
|
139
|
+
return { kind: 'unparsed' };
|
|
140
|
+
const matchId = raw['matchId'];
|
|
141
|
+
const confidence = raw['confidence'];
|
|
142
|
+
return (typeof matchId === 'string' || matchId === null) && typeof confidence === 'number'
|
|
143
|
+
? { kind: 'decision', matchId, confidence }
|
|
144
|
+
: { kind: 'unparsed' };
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Wrap a judge so every structured call is recorded — the rerank itself
|
|
148
|
+
* reports no latency or raw decision to the matcher's trace, and turns a
|
|
149
|
+
* thrown call into a quiet no-match, so without this a failed call reads
|
|
150
|
+
* exactly like a declined one. Errors are recorded and re-thrown
|
|
151
|
+
* unchanged; the matcher still sees what the judge did.
|
|
152
|
+
*/
|
|
153
|
+
function recordingJudge(inner) {
|
|
154
|
+
const structured = inner.callStructured?.bind(inner);
|
|
155
|
+
if (structured === undefined) {
|
|
156
|
+
throw new Error('recordingJudge: the judge has no callStructured');
|
|
157
|
+
}
|
|
158
|
+
let seq = 0;
|
|
159
|
+
let pending = [];
|
|
160
|
+
const llm = {
|
|
161
|
+
call: (system, user, maxTokens) => inner.call(system, user, maxTokens),
|
|
162
|
+
async callStructured(system, user, tool, maxTokens) {
|
|
163
|
+
seq += 1;
|
|
164
|
+
const n = seq;
|
|
165
|
+
const shownMatch = /^CANDIDATES \((\d+)\)$/m.exec(user);
|
|
166
|
+
const shown = shownMatch !== null ? Number(shownMatch[1]) : null;
|
|
167
|
+
const t0 = performance.now();
|
|
168
|
+
try {
|
|
169
|
+
const out = await structured(system, user, tool, maxTokens);
|
|
170
|
+
pending.push({ seq: n, wallMs: performance.now() - t0, shown, outcome: readDecision(out) });
|
|
171
|
+
return out;
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
pending.push({
|
|
175
|
+
seq: n,
|
|
176
|
+
wallMs: performance.now() - t0,
|
|
177
|
+
shown,
|
|
178
|
+
outcome: { kind: 'threw', message: err instanceof Error ? err.message : String(err) },
|
|
179
|
+
});
|
|
180
|
+
throw err;
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
return {
|
|
185
|
+
llm,
|
|
186
|
+
take() {
|
|
187
|
+
const out = pending;
|
|
188
|
+
pending = [];
|
|
189
|
+
return out;
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
}
|
|
61
193
|
// --- runner ----------------------------------------------------------------
|
|
62
|
-
async function runPair(pair,
|
|
194
|
+
async function runPair(pair, judge, embedding, options) {
|
|
63
195
|
const registry = {
|
|
64
196
|
embedding,
|
|
65
197
|
vectorStore: new InMemoryVectorStore(),
|
|
@@ -85,11 +217,19 @@ async function runPair(pair, llm, embedding) {
|
|
|
85
217
|
},
|
|
86
218
|
});
|
|
87
219
|
try {
|
|
88
|
-
const result = await matchBlueprint({ registry, llm }, SCOPE, {
|
|
220
|
+
const result = await matchBlueprint({ registry, llm: judge.llm }, SCOPE, {
|
|
89
221
|
intent: pair.probe.intent,
|
|
90
222
|
...(pair.probe.contract !== undefined ? { contract: pair.probe.contract } : {}),
|
|
91
223
|
...(pair.probe.variance !== undefined ? { variance: pair.probe.variance } : {}),
|
|
92
|
-
});
|
|
224
|
+
}, options);
|
|
225
|
+
const recorded = {
|
|
226
|
+
candidates: (traced?.candidates ?? []).map((c) => ({
|
|
227
|
+
id: c.key,
|
|
228
|
+
cosine: c.score,
|
|
229
|
+
cachedIntent: c.cachedIntent,
|
|
230
|
+
})),
|
|
231
|
+
judgeCalls: judge.take(),
|
|
232
|
+
};
|
|
93
233
|
runs.push(result.strategy === 'no-match'
|
|
94
234
|
? {
|
|
95
235
|
strategy: 'no-match',
|
|
@@ -98,6 +238,7 @@ async function runPair(pair, llm, embedding) {
|
|
|
98
238
|
judgeConfidence: traced?.judgeConfidence,
|
|
99
239
|
judgeReason: result.judgeReason ?? traced?.judgeReason,
|
|
100
240
|
hitBlueprintIntent: undefined,
|
|
241
|
+
...recorded,
|
|
101
242
|
}
|
|
102
243
|
: {
|
|
103
244
|
strategy: result.strategy,
|
|
@@ -106,6 +247,7 @@ async function runPair(pair, llm, embedding) {
|
|
|
106
247
|
judgeConfidence: result.judgeConfidence,
|
|
107
248
|
judgeReason: traced?.judgeReason,
|
|
108
249
|
hitBlueprintIntent: result.blueprint.intent,
|
|
250
|
+
...recorded,
|
|
109
251
|
});
|
|
110
252
|
}
|
|
111
253
|
finally {
|
|
@@ -183,20 +325,29 @@ async function resolveEmbedding() {
|
|
|
183
325
|
}
|
|
184
326
|
return provider;
|
|
185
327
|
}
|
|
328
|
+
/** Nearest-rank percentile of a non-empty sample; null when empty. */
|
|
329
|
+
function percentile(values, p) {
|
|
330
|
+
if (values.length === 0)
|
|
331
|
+
return null;
|
|
332
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
333
|
+
return sorted[Math.min(sorted.length - 1, Math.max(0, Math.ceil((p / 100) * sorted.length) - 1))];
|
|
334
|
+
}
|
|
186
335
|
async function main() {
|
|
187
|
-
const
|
|
336
|
+
const resolvedJudge = await resolveJudge();
|
|
337
|
+
const judge = recordingJudge(resolvedJudge.llm);
|
|
338
|
+
const options = resolveMatchOptions();
|
|
188
339
|
const embedding = await resolveEmbedding();
|
|
189
|
-
process.stdout.write(`embedding provider: ${embedding.id}\n`);
|
|
340
|
+
process.stdout.write(`embedding provider: ${embedding.id} · judge: ${resolvedJudge.label} · options: ${JSON.stringify(options)}\n`);
|
|
190
341
|
mkdirSync(OUT_DIR, { recursive: true });
|
|
191
342
|
const results = [];
|
|
192
343
|
for (const pair of PAIRS) {
|
|
193
|
-
const r = await runPair(pair,
|
|
344
|
+
const r = await runPair(pair, judge, embedding, options);
|
|
194
345
|
results.push(r);
|
|
195
346
|
const first = r.runs[0];
|
|
196
347
|
const flag = r.tier === 'debated' ? '~' : r.verdictOk && r.strategyOk && r.decisionOk ? 'ok' : 'XX';
|
|
197
348
|
process.stdout.write(`[${flag}] ${r.id.padEnd(26)} ${String(first.strategy).padEnd(10)} ` +
|
|
198
349
|
`decision=${String(first.decision).padEnd(24)} cos=${first.cosine?.toFixed(3) ?? ' - '} ` +
|
|
199
|
-
`judge=${first.judgeConfidence?.toFixed(2) ?? ' - '}` +
|
|
350
|
+
`judge=${first.judgeConfidence?.toFixed(2) ?? ' - '} calls=${first.judgeCalls.length}` +
|
|
200
351
|
(r.h1
|
|
201
352
|
? ` | h1 intent=${r.h1.intentOnlyTop1?.toFixed(3)} c+i=${r.h1.contractPlusIntentTop1?.toFixed(3)}`
|
|
202
353
|
: '') +
|
|
@@ -229,12 +380,27 @@ async function main() {
|
|
|
229
380
|
const verdicts = r.runs.map((run) => run.strategy !== 'no-match');
|
|
230
381
|
return verdicts.every((v) => v === verdicts[0]);
|
|
231
382
|
});
|
|
383
|
+
// Every judge call of the run (all runs of all pairs), for the
|
|
384
|
+
// paired latency read and the error count.
|
|
385
|
+
const calls = results.flatMap((r) => r.runs.flatMap((run) => run.judgeCalls));
|
|
386
|
+
const answeredMs = calls
|
|
387
|
+
.filter((c) => c.outcome.kind === 'decision')
|
|
388
|
+
.map((c) => c.wallMs);
|
|
389
|
+
const overridden = Object.keys(options).length > 0;
|
|
232
390
|
const summary = {
|
|
233
391
|
probedAt: new Date().toISOString(),
|
|
234
392
|
pairs: results.length,
|
|
235
|
-
thresholds: 'production defaults (no overrides passed)',
|
|
393
|
+
thresholds: overridden ? options : 'production defaults (no overrides passed)',
|
|
236
394
|
embedding: embedding.id,
|
|
237
|
-
judgeModel:
|
|
395
|
+
judgeModel: resolvedJudge.label,
|
|
396
|
+
judgeCalls: {
|
|
397
|
+
total: calls.length,
|
|
398
|
+
decided: answeredMs.length,
|
|
399
|
+
unparsed: calls.filter((c) => c.outcome.kind === 'unparsed').length,
|
|
400
|
+
threw: calls.filter((c) => c.outcome.kind === 'threw').length,
|
|
401
|
+
p50Ms: percentile(answeredMs, 50),
|
|
402
|
+
p95Ms: percentile(answeredMs, 95),
|
|
403
|
+
},
|
|
238
404
|
recall_shouldHit: pct(recallOk, shouldHit.length),
|
|
239
405
|
falseHits_mustMiss: pct(falseHits.length, mustMiss.length),
|
|
240
406
|
falseHitIds: falseHits.map((r) => r.id),
|
|
@@ -247,11 +413,24 @@ async function main() {
|
|
|
247
413
|
};
|
|
248
414
|
// The default (local) geometry keeps the historical `results.json`
|
|
249
415
|
// name; alternate-embedder runs write alongside it so geometries can
|
|
250
|
-
// be diffed without clobbering the series.
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
416
|
+
// be diffed without clobbering the series. A judge arm or an explicit
|
|
417
|
+
// option set names all three axes, so every arm of a paired run gets
|
|
418
|
+
// its own file.
|
|
419
|
+
const embedderArm = (process.env['RND_EMBEDDER_MODULE'] ?? '').length > 0;
|
|
420
|
+
const judgeArm = (process.env['RND_JUDGE_MODULE'] ?? '').length > 0;
|
|
421
|
+
const optionTag = [
|
|
422
|
+
options.topK !== undefined ? `k${options.topK}` : '',
|
|
423
|
+
options.minCosineForRerank !== undefined ? `c${options.minCosineForRerank}` : '',
|
|
424
|
+
options.judgeThreshold !== undefined ? `j${options.judgeThreshold}` : '',
|
|
425
|
+
].join('');
|
|
426
|
+
const outName = judgeArm || overridden
|
|
427
|
+
? `results-${[embedding.id, resolvedJudge.label, optionTag]
|
|
428
|
+
.filter((part) => part.length > 0)
|
|
429
|
+
.join('-')
|
|
430
|
+
.replace(/[^\w.-]+/g, '_')}.json`
|
|
431
|
+
: embedderArm
|
|
432
|
+
? `results-${embedding.id}.json`
|
|
433
|
+
: 'results.json';
|
|
255
434
|
writeFileSync(pathResolve(OUT_DIR, outName), JSON.stringify({ summary, results }, null, 2));
|
|
256
435
|
process.stdout.write(`\n${JSON.stringify(summary, null, 2)}\n`);
|
|
257
436
|
process.stdout.write(`full detail → ${pathResolve(OUT_DIR, outName)}\n`);
|
|
@@ -14,5 +14,6 @@
|
|
|
14
14
|
* decision, which a probe then scored as a no-match.
|
|
15
15
|
*/
|
|
16
16
|
import type { LLMCaller } from "@ggui-ai/negotiator";
|
|
17
|
+
export declare const DEFAULT_PROBE_JUDGE_MODEL = "claude-haiku-4-5";
|
|
17
18
|
export declare function anthropicProbeJudge(apiKey: string, model?: string): LLMCaller;
|
|
18
19
|
//# sourceMappingURL=probe-anthropic-judge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probe-anthropic-judge.d.ts","sourceRoot":"","sources":["../../src/renders/probe-anthropic-judge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"probe-anthropic-judge.d.ts","sourceRoot":"","sources":["../../src/renders/probe-anthropic-judge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AAIjE,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAW5D,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAAkC,GACxC,SAAS,CA4DX"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { anthropicRejectsForcedToolChoice, isRecord } from "@ggui-ai/protocol";
|
|
2
2
|
const ANTHROPIC_MESSAGES_URL = "https://api.anthropic.com/v1/messages";
|
|
3
|
-
const DEFAULT_PROBE_JUDGE_MODEL = "claude-haiku-4-5";
|
|
3
|
+
export const DEFAULT_PROBE_JUDGE_MODEL = "claude-haiku-4-5";
|
|
4
4
|
const PROBE_ANSWER_BUDGET = 512;
|
|
5
5
|
/**
|
|
6
6
|
* Thinking budget added for a model that refuses a forced tool. Same
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ggui#1223 / #1305 — record a COMMITTED `oneShot` dispatch on its card, so
|
|
3
|
+
* a re-served card renders the action spent after a reload.
|
|
4
|
+
*
|
|
5
|
+
* ONE decision, called by both ingress paths after the write each treats as
|
|
6
|
+
* load-bearing: the live channel's `data:submit` after its ledger append,
|
|
7
|
+
* and `ggui_runtime_submit_action` after its pipe append. "Committed" means
|
|
8
|
+
* the same thing the runtime's wire guard means by it (spend only on a fire
|
|
9
|
+
* that passed the card's contract), so the decision evaluates the contract
|
|
10
|
+
* itself. It never changes whether a path ACCEPTS a dispatch: a dispatch the
|
|
11
|
+
* contract rejects is delivered exactly as before and simply does not spend.
|
|
12
|
+
*
|
|
13
|
+
* The card is the head card unless the dispatch names another. A named
|
|
14
|
+
* epoch other than the head's is a superseded card: nothing is written,
|
|
15
|
+
* because the projection only ever shows a record on its own card, and a
|
|
16
|
+
* superseded card re-serves frozen (#483). Absent ⇒ the head, which is what
|
|
17
|
+
* every dispatch means before the wire carries a card epoch.
|
|
18
|
+
*/
|
|
19
|
+
import { type GguiSession } from '@ggui-ai/protocol';
|
|
20
|
+
import type { GguiSessionStore } from '@ggui-ai/mcp-server-core';
|
|
21
|
+
/**
|
|
22
|
+
* What {@link recordCommittedOneShot} decided. Every arm but `recorded` wrote
|
|
23
|
+
* nothing, and none of them is an error: a caller logs only a thrown store
|
|
24
|
+
* failure (fail-open, the gesture has already been delivered).
|
|
25
|
+
*/
|
|
26
|
+
export type CommittedOneShotOutcome =
|
|
27
|
+
/** The store applied the spend (a repeat of an already-spent action included). */
|
|
28
|
+
'recorded'
|
|
29
|
+
/** The card does not declare this action `oneShot` (or is not a component card). */
|
|
30
|
+
| 'not-one-shot'
|
|
31
|
+
/** The dispatch failed the card's action contract, so it never spends. */
|
|
32
|
+
| 'not-committed'
|
|
33
|
+
/** The dispatch named a card that is no longer the head. */
|
|
34
|
+
| 'superseded-card'
|
|
35
|
+
/** The store does not implement `recordSpentOneShot`; named once at server construction. */
|
|
36
|
+
| 'not-durable';
|
|
37
|
+
export interface RecordCommittedOneShotInput {
|
|
38
|
+
readonly store: GguiSessionStore;
|
|
39
|
+
readonly sessionId: string;
|
|
40
|
+
/** The render as stored: the head card, its `actionSpec` and its `epoch`. */
|
|
41
|
+
readonly render: GguiSession;
|
|
42
|
+
/** The dispatched `actionSpec` name. */
|
|
43
|
+
readonly action: string;
|
|
44
|
+
/** The dispatched payload (`ActionEventValue.data`). */
|
|
45
|
+
readonly data: unknown;
|
|
46
|
+
/** The dispatching card's history epoch, when the dispatch carries one. */
|
|
47
|
+
readonly cardEpoch?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Decide and, when the dispatch is a committed `oneShot` on the head card,
|
|
51
|
+
* record it. A store failure propagates: the caller owns its named warn line.
|
|
52
|
+
*/
|
|
53
|
+
export declare function recordCommittedOneShot(input: RecordCommittedOneShotInput): Promise<CommittedOneShotOutcome>;
|
|
54
|
+
//# sourceMappingURL=record-committed-one-shot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-committed-one-shot.d.ts","sourceRoot":"","sources":["../../src/renders/record-committed-one-shot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,uBAAuB;AACjC,kFAAkF;AAChF,UAAU;AACZ,oFAAoF;GAClF,cAAc;AAChB,0EAA0E;GACxE,eAAe;AACjB,4DAA4D;GAC1D,iBAAiB;AACnB,4FAA4F;GAC1F,aAAa,CAAC;AAElB,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,uBAAuB,CAAC,CAYlC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ggui#1223 / #1305 — record a COMMITTED `oneShot` dispatch on its card, so
|
|
3
|
+
* a re-served card renders the action spent after a reload.
|
|
4
|
+
*
|
|
5
|
+
* ONE decision, called by both ingress paths after the write each treats as
|
|
6
|
+
* load-bearing: the live channel's `data:submit` after its ledger append,
|
|
7
|
+
* and `ggui_runtime_submit_action` after its pipe append. "Committed" means
|
|
8
|
+
* the same thing the runtime's wire guard means by it (spend only on a fire
|
|
9
|
+
* that passed the card's contract), so the decision evaluates the contract
|
|
10
|
+
* itself. It never changes whether a path ACCEPTS a dispatch: a dispatch the
|
|
11
|
+
* contract rejects is delivered exactly as before and simply does not spend.
|
|
12
|
+
*
|
|
13
|
+
* The card is the head card unless the dispatch names another. A named
|
|
14
|
+
* epoch other than the head's is a superseded card: nothing is written,
|
|
15
|
+
* because the projection only ever shows a record on its own card, and a
|
|
16
|
+
* superseded card re-serves frozen (#483). Absent ⇒ the head, which is what
|
|
17
|
+
* every dispatch means before the wire carries a card epoch.
|
|
18
|
+
*/
|
|
19
|
+
import { validateActionData } from '@ggui-ai/protocol';
|
|
20
|
+
/**
|
|
21
|
+
* Decide and, when the dispatch is a committed `oneShot` on the head card,
|
|
22
|
+
* record it. A store failure propagates: the caller owns its named warn line.
|
|
23
|
+
*/
|
|
24
|
+
export async function recordCommittedOneShot(input) {
|
|
25
|
+
const { render, action } = input;
|
|
26
|
+
if (render.type !== 'component')
|
|
27
|
+
return 'not-one-shot';
|
|
28
|
+
const spec = render.actionSpec;
|
|
29
|
+
if (spec?.[action]?.oneShot !== true)
|
|
30
|
+
return 'not-one-shot';
|
|
31
|
+
if (!validateActionData({ action, data: input.data }, spec).valid)
|
|
32
|
+
return 'not-committed';
|
|
33
|
+
const headEpoch = render.epoch ?? 0;
|
|
34
|
+
const epoch = input.cardEpoch ?? headEpoch;
|
|
35
|
+
if (epoch !== headEpoch)
|
|
36
|
+
return 'superseded-card';
|
|
37
|
+
if (input.store.recordSpentOneShot === undefined)
|
|
38
|
+
return 'not-durable';
|
|
39
|
+
await input.store.recordSpentOneShot(input.sessionId, { epoch, action });
|
|
40
|
+
return 'recorded';
|
|
41
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/renders/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAEL,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EAGjB,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/renders/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAEL,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EAGjB,KAAK,WAAW,EASjB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EAEd,aAAa,EAEb,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAOrB,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,uBAAuB,CAAC;AAY/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,E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AAG;IAClB,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;IAEnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,KAAK,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAyEJ;;;;;;;;;;;;;;;;;;;GAmBG;AACH;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,GAClD,OAAO,CAAC,IAAI,CAAC,CAcf;AAsCD;;;;;;GAMG;AACH,qBAAa,4BAA6B,SAAQ,WAAW,CAAC,2BAA2B,CAAC;gBAC5E,MAAM,EAAE,MAAM;CAG3B;AAuBD,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA80D5B"}
|
package/dist/renders/render.js
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
*/
|
|
48
48
|
import { randomUUID, randomBytes } from 'node:crypto';
|
|
49
49
|
import { DomainError } from '@ggui-ai/protocol';
|
|
50
|
-
import { projectRenderRefusal, renderInputEnvelopeSchema, renderInputRouteGuardSchema, PRE_GENERATION_REFUSAL_ROWS, } from '@ggui-ai/protocol';
|
|
50
|
+
import { projectRenderRefusal, renderInputEnvelopeSchema, renderInputRouteGuardSchema, PRE_GENERATION_REFUSAL_ROWS, HOST_CAPABILITY_UI_MESSAGE_TURN, } from '@ggui-ai/protocol';
|
|
51
51
|
import { GGUI_RENDER_UI_META, toMcpAppEnvelope, } from '@ggui-ai/protocol/integrations/mcp-apps';
|
|
52
52
|
import { defineHandler, handlerFailure, isHandlerFailure, } from '../types.js';
|
|
53
53
|
import { consumeHandshakeRecord, peekHandshakeRecord, HandshakeNotFoundError, } from './handshake.js';
|
|
@@ -1499,7 +1499,12 @@ export function createGguiRenderHandler(deps) {
|
|
|
1499
1499
|
// for the agent to consume.
|
|
1500
1500
|
const hasActions = effectiveContract.actionSpec !== undefined &&
|
|
1501
1501
|
Object.keys(effectiveContract.actionSpec).length > 0;
|
|
1502
|
-
|
|
1502
|
+
// ggui#1309 — a host that declares `ui-message-turn` delivers a later
|
|
1503
|
+
// gesture as the next agent turn, so the in-turn long-poll buys nothing
|
|
1504
|
+
// there: omit the hint and let the agent end its turn at paint. Declared
|
|
1505
|
+
// by the host's own code (a request header), never by the model.
|
|
1506
|
+
const hostDeliversGesturesAsTurns = ctx.hostCapabilities?.includes(HOST_CAPABILITY_UI_MESSAGE_TURN) === true;
|
|
1507
|
+
const nextStep = hasActions && !hostDeliversGesturesAsTurns
|
|
1503
1508
|
? {
|
|
1504
1509
|
tool: 'ggui_consume',
|
|
1505
1510
|
// Imperative + honest: `timeout` MUST ride the hint —
|
|
@@ -1611,7 +1616,7 @@ export function createGguiRenderHandler(deps) {
|
|
|
1611
1616
|
// 2. Prerequisite — handshake first, always.
|
|
1612
1617
|
'PREREQUISITE: call ggui_handshake({intent, blueprintDraft}) FIRST. The response carries handshakeId + suggestion (origin: cache | agent | synth) — a `rendered` or `failed` render consumes the handshake; a `refused` render or a recoverable validation error leaves it intact, so the same handshakeId works again once the fix lands. A call without `handshakeId` is rejected at input validation (-32602); an id that does not resolve fails as not found (`handshake_not_found`).',
|
|
1613
1618
|
// 2b. Next step — driven by the response, not blanket-applied.
|
|
1614
|
-
"NEXT STEP: read the response. If it carries a `nextStep` field (
|
|
1619
|
+
"NEXT STEP: read the response. If it carries a `nextStep` field (emitted only with a non-empty actionSpec, and not when this host delivers gestures as new messages), it names ggui_consume({sessionId}): long-poll once for an immediate gesture, and if none arrives, end your turn. If the response has NO nextStep, end your turn — either the UI has no actions, or this host delivers the user's gestures to you as new messages; either way the user reads the UI and interacts or prompts you when ready. After consume returns an event, the event's own `nextStep` (if any) tells you the tool to call next; otherwise loop back to handshake → render.",
|
|
1615
1620
|
// 3. Recovery shape — what happens on validation failure.
|
|
1616
1621
|
"RECOVERABLE FAILURES: contract_validation_failed / schema_mismatch_error / contract_violation (props — a missing required prop included) / override_contract_invalid all preserve the handshake — fix your input and retry on the SAME handshakeId. contract_validation_failed fires when the contract gate rejects the draft: a malformed inner JSON Schema (e.g. `propsSpec.properties.X.schema` missing `type`), or an `actionSpec[name].nextStep` / `streamSpec[channel].source.tool` naming a tool not declared in `agentCapabilities.tools` — every referenced tool MUST appear in agentCapabilities.tools (catalog discoverability; same-MCP and cross-MCP both go here). override_contract_invalid is the same gate on an `override.contract` (STRICT — drop the override and re-handshake with that draft, which repairs it). schema_mismatch_error fires when an actionSpec entry's `schema` is not a subset of the named tool's registered inputSchema, OR a streamSpec channel's `schema` doesn't accept the tool's return shape — adjust the action/channel schema to match the tool, or omit `nextStep` if the agent will compose the call from a different toolset entirely. Only handshake_not_found forces a re-handshake.",
|
|
1617
1622
|
// 4. Mutation rule — never re-render.
|
|
@@ -338,6 +338,13 @@ export interface RenderMetaView {
|
|
|
338
338
|
* none.
|
|
339
339
|
*/
|
|
340
340
|
readonly actionSpec?: ActionSpec;
|
|
341
|
+
/**
|
|
342
|
+
* The card's spent `oneShot` action names (ggui#1223): the stored record's
|
|
343
|
+
* `actions`, projected ONLY when the record's `epoch` is the projected
|
|
344
|
+
* card's. Component variant only; absent when nothing was spent on this
|
|
345
|
+
* card.
|
|
346
|
+
*/
|
|
347
|
+
readonly spentOneShots?: readonly string[];
|
|
341
348
|
/** History head epoch (#483) — the mount's own epoch for the freeze latch. */
|
|
342
349
|
readonly epoch?: number;
|
|
343
350
|
readonly propsJson?: string;
|
|
@@ -547,7 +554,7 @@ export declare const CODE_B64_MAX_CHARS = 262144;
|
|
|
547
554
|
* indistinguishable to every consumer's projection) and re-spread into
|
|
548
555
|
* fresh arrays so no emitter aliases the view's internals.
|
|
549
556
|
*/
|
|
550
|
-
export declare function spreadRenderMetaViewOntoSlice(view: RenderMetaView | undefined): Pick<McpAppAiGguiRenderMeta, 'epoch' | 'propsJson' | 'contextSlots' | 'permissionsPolicy' | 'theme' | 'gadgets' | 'actionSpec'>;
|
|
557
|
+
export declare function spreadRenderMetaViewOntoSlice(view: RenderMetaView | undefined): Pick<McpAppAiGguiRenderMeta, 'epoch' | 'propsJson' | 'contextSlots' | 'permissionsPolicy' | 'theme' | 'gadgets' | 'actionSpec' | 'spentOneShots'>;
|
|
551
558
|
export declare function deriveRenderMeta(item: GguiSession): RenderMetaView;
|
|
552
559
|
/**
|
|
553
560
|
* Deps fields powering the `ai.ggui/render` slice envelope, shared by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slice-meta-derivation.d.ts","sourceRoot":"","sources":["../../src/renders/slice-meta-derivation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAMhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,CACZ,IAAI,CACF,gBAAgB,EAChB,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAChE,CACF,GACA;IAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAY7D;AA6ED;;;;GAIG;AACH,eAAO,MAAM,qBAA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AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,cAAc,EACpB,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,gBAAgB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAC7C,UAAU,CAqBZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,mBAAmB,EACzB,IAAI,EAAE;IACJ,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CACzD,GACA,eAAe,CA4CjB"}
|
|
@@ -766,6 +766,7 @@ export function spreadRenderMetaViewOntoSlice(view) {
|
|
|
766
766
|
return {};
|
|
767
767
|
return {
|
|
768
768
|
...(view.actionSpec !== undefined ? { actionSpec: view.actionSpec } : {}),
|
|
769
|
+
...(view.spentOneShots !== undefined ? { spentOneShots: [...view.spentOneShots] } : {}),
|
|
769
770
|
...(view.epoch !== undefined ? { epoch: view.epoch } : {}),
|
|
770
771
|
...(view.propsJson !== undefined ? { propsJson: view.propsJson } : {}),
|
|
771
772
|
...(view.contextSlots !== undefined && view.contextSlots.length > 0
|
|
@@ -815,6 +816,15 @@ export function deriveRenderMeta(item) {
|
|
|
815
816
|
const contentSecurityPolicy = composeContentSecurityPolicy(deriveBundleOrigins(item), theme);
|
|
816
817
|
const gadgets = deriveGadgetRegistrations(item);
|
|
817
818
|
const codeB64 = deriveCodeB64(item);
|
|
819
|
+
// ggui#1223 — the card's spent oneShot names. Gated on the CARD: a record
|
|
820
|
+
// written on an earlier card (before a `ggui_update`) is not this card's.
|
|
821
|
+
// Filtered to the names THIS card's actionSpec declares `oneShot`, so a
|
|
822
|
+
// stray or non-oneShot name never reaches the slice (the runtime guard
|
|
823
|
+
// reads the flag from the contract too — this keeps the slice honest).
|
|
824
|
+
const spentRecord = item.spentOneShots;
|
|
825
|
+
const spentOneShots = spentRecord !== undefined && spentRecord.epoch === (item.epoch ?? 0)
|
|
826
|
+
? spentRecord.actions.filter((name) => item.actionSpec?.[name]?.oneShot === true)
|
|
827
|
+
: [];
|
|
818
828
|
return {
|
|
819
829
|
// History head epoch (#483) — the mount reads this as its OWN
|
|
820
830
|
// epoch for the freeze latch. Always projected (0 default) so a
|
|
@@ -834,6 +844,7 @@ export function deriveRenderMeta(item) {
|
|
|
834
844
|
// ggui#1178 — the action contract, whole, for a runtime painting without
|
|
835
845
|
// a live WS session frame (the only other carrier).
|
|
836
846
|
...(item.actionSpec !== undefined ? { actionSpec: item.actionSpec } : {}),
|
|
847
|
+
...(spentOneShots.length > 0 ? { spentOneShots } : {}),
|
|
837
848
|
};
|
|
838
849
|
}
|
|
839
850
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-action.d.ts","sourceRoot":"","sources":["../../src/renders/submit-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"submit-action.d.ts","sourceRoot":"","sources":["../../src/renders/submit-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,0BAA0B,CAAC;AAiFlC,KAAK,kBAAkB,GAAG;IACxB,QAAQ,CAAC,EAAE,EAAE,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{ PendingPipeNotFoundError, } from '@ggui-ai/mcp-server-core';
|
|
67
67
|
import { defineHandler } from '../types.js';
|
|
68
|
+
import { recordCommittedOneShot } from './record-committed-one-shot.js';
|
|
68
69
|
// `kind` accepts the closed primary set OR an extension string. Zod
|
|
69
70
|
// can't represent `(string & {})` directly; we use `z.string().min(1)`
|
|
70
71
|
// and rely on `isGguiSubmitActionInput` (from protocol) for the
|
|
@@ -128,6 +129,30 @@ const outputSchema = {
|
|
|
128
129
|
*/
|
|
129
130
|
consumerPresent: z.boolean().optional(),
|
|
130
131
|
};
|
|
132
|
+
/**
|
|
133
|
+
* Record a pipe-committed dispatch's `oneShot` spend (ggui#1223 / #1305).
|
|
134
|
+
* FAIL-OPEN: the gesture has already reached the agent, so a failed record
|
|
135
|
+
* degrades to the behaviour that predates it (the card re-serves live) and
|
|
136
|
+
* is named on one warn line, never allowed to fail the dispatch.
|
|
137
|
+
*/
|
|
138
|
+
async function recordDispatchSpend(deps, sessionId, action, data) {
|
|
139
|
+
const store = deps.renderStore;
|
|
140
|
+
if (store === undefined)
|
|
141
|
+
return;
|
|
142
|
+
try {
|
|
143
|
+
const stored = await store.get(sessionId);
|
|
144
|
+
if (stored === null)
|
|
145
|
+
return;
|
|
146
|
+
await recordCommittedOneShot({ store, sessionId, render: stored.render, action, data });
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
deps.logger?.warn?.('submit_action_spent_oneshot_persist_failed', {
|
|
150
|
+
sessionId,
|
|
151
|
+
action,
|
|
152
|
+
error: err instanceof Error ? err.message : String(err),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
131
156
|
export function createGguiSubmitActionHandler(deps = {}) {
|
|
132
157
|
return defineHandler({
|
|
133
158
|
name: 'ggui_runtime_submit_action',
|
|
@@ -249,6 +274,11 @@ export function createGguiSubmitActionHandler(deps = {}) {
|
|
|
249
274
|
: String(ledgerResult.reason),
|
|
250
275
|
});
|
|
251
276
|
}
|
|
277
|
+
// ggui#1223 / #1305 — the gesture is on the pipe, so a committed
|
|
278
|
+
// `oneShot` now spends its card durably. This never changes the
|
|
279
|
+
// answer: a dispatch that fails the card's contract was accepted
|
|
280
|
+
// above exactly as before and simply does not spend.
|
|
281
|
+
await recordDispatchSpend(deps, env.sessionId, dispatchPayload.intent, dispatchPayload.actionData);
|
|
252
282
|
// Pipe append succeeded — query the active-consumer registry
|
|
253
283
|
// (if wired) so the iframe knows whether an in-flight
|
|
254
284
|
// `ggui_consume` long-poll will drain this event soon. When
|
package/dist/types.d.ts
CHANGED
|
@@ -92,6 +92,14 @@ export interface HandlerContext {
|
|
|
92
92
|
* session) rather than treating a missing scope as permission.
|
|
93
93
|
*/
|
|
94
94
|
readonly credentialScope?: CredentialScope;
|
|
95
|
+
/**
|
|
96
|
+
* The host's declared capabilities, parsed from the request's
|
|
97
|
+
* `Ggui-Host-Capabilities` header (ggui#1309, `parseHostCapabilitiesHeader`
|
|
98
|
+
* in `@ggui-ai/protocol`). Set by the host's own code, never by the model.
|
|
99
|
+
* Absent or empty ⇒ nothing declared, today's behaviour. The render handler
|
|
100
|
+
* reads `ui-message-turn` to omit its `ggui_consume` hint.
|
|
101
|
+
*/
|
|
102
|
+
readonly hostCapabilities?: readonly string[];
|
|
95
103
|
/**
|
|
96
104
|
* How the caller's identity was proved, forwarded verbatim from the
|
|
97
105
|
* resolved `AuthResult.source` upstream of the handler.
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAE/D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B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AuBG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/mcp-server-handlers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "MCP tool handler logic for the ggui protocol. Pure over @ggui-ai/mcp-server-core seams and consumed by @ggui-ai/mcp-server. Never imports AWS, HTTP transports, or CLI concerns.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ggui",
|
|
@@ -70,18 +70,18 @@
|
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"canonicalize": "^2.0.0",
|
|
72
72
|
"zod": "^4.3.6",
|
|
73
|
-
"@ggui-ai/mcp-server-core": "0.
|
|
74
|
-
"@ggui-ai/
|
|
75
|
-
"@ggui-ai/
|
|
76
|
-
"@ggui-ai/ui-gen": "0.
|
|
77
|
-
"@ggui-ai/ui-registry": "0.
|
|
73
|
+
"@ggui-ai/mcp-server-core": "0.23.0",
|
|
74
|
+
"@ggui-ai/negotiator": "0.23.0",
|
|
75
|
+
"@ggui-ai/protocol": "0.23.0",
|
|
76
|
+
"@ggui-ai/ui-gen": "0.23.0",
|
|
77
|
+
"@ggui-ai/ui-registry": "0.23.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@types/node": "^22.0.0",
|
|
81
81
|
"typescript": "^5.0.0",
|
|
82
82
|
"vitest": "^3.2.6",
|
|
83
|
-
"@ggui-ai/embedding-local": "0.
|
|
84
|
-
"@ggui-ai/protocol-conformance": "0.
|
|
83
|
+
"@ggui-ai/embedding-local": "0.23.0",
|
|
84
|
+
"@ggui-ai/protocol-conformance": "0.23.0"
|
|
85
85
|
},
|
|
86
86
|
"repository": {
|
|
87
87
|
"type": "git",
|