@ggui-ai/mcp-server-handlers 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/blueprints/search-blueprints.d.ts +5 -5
- package/dist/blueprints/search-blueprints.js +5 -5
- package/dist/credits/index.d.ts +2 -2
- package/dist/credits/index.d.ts.map +1 -1
- package/dist/credits/index.js +1 -1
- package/dist/credits/list-credit-transactions.d.ts +21 -7
- package/dist/credits/list-credit-transactions.d.ts.map +1 -1
- package/dist/credits/list-credit-transactions.js +12 -2
- package/dist/index.d.ts +2 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -9
- package/dist/ops-apps/create-app.d.ts +10 -11
- package/dist/ops-apps/create-app.d.ts.map +1 -1
- package/dist/ops-apps/create-app.js +12 -13
- package/dist/ops-apps/identity.d.ts +9 -8
- package/dist/ops-apps/identity.d.ts.map +1 -1
- package/dist/ops-apps/identity.js +2 -1
- package/dist/ops-apps/index.d.ts +2 -2
- package/dist/ops-apps/index.js +2 -2
- package/dist/ops-apps/list-apps.d.ts +5 -6
- package/dist/ops-apps/list-apps.d.ts.map +1 -1
- package/dist/ops-apps/list-apps.js +6 -7
- package/dist/ops-apps/set-app-theme.d.ts +12 -8
- package/dist/ops-apps/set-app-theme.d.ts.map +1 -1
- package/dist/ops-apps/set-app-theme.js +11 -7
- package/dist/ops-apps/set-default-app.d.ts +1 -2
- package/dist/ops-apps/set-default-app.d.ts.map +1 -1
- package/dist/ops-apps/set-default-app.js +1 -2
- package/dist/ops-apps/types.d.ts +20 -23
- package/dist/ops-apps/types.d.ts.map +1 -1
- package/dist/ops-apps/types.js +4 -6
- package/dist/ops-blueprint/cache-mirror.d.ts +41 -0
- package/dist/ops-blueprint/cache-mirror.d.ts.map +1 -0
- package/dist/ops-blueprint/cache-mirror.js +19 -0
- package/dist/ops-blueprint/delete.d.ts +18 -0
- package/dist/ops-blueprint/delete.d.ts.map +1 -1
- package/dist/ops-blueprint/delete.js +21 -2
- package/dist/ops-blueprint/errors.d.ts +23 -0
- package/dist/ops-blueprint/errors.d.ts.map +1 -1
- package/dist/ops-blueprint/errors.js +29 -0
- package/dist/ops-blueprint/generate.d.ts +1 -3
- package/dist/ops-blueprint/generate.d.ts.map +1 -1
- package/dist/ops-blueprint/generate.js +47 -58
- package/dist/ops-blueprint/index.d.ts +1 -1
- package/dist/ops-blueprint/index.d.ts.map +1 -1
- package/dist/ops-blueprint/index.js +1 -1
- package/dist/ops-blueprint/list.d.ts.map +1 -1
- package/dist/ops-blueprint/list.js +1 -2
- package/dist/ops-blueprint/register.d.ts +83 -6
- package/dist/ops-blueprint/register.d.ts.map +1 -1
- package/dist/ops-blueprint/register.js +261 -158
- package/dist/ops-blueprint/update.d.ts +3 -2
- package/dist/ops-blueprint/update.d.ts.map +1 -1
- package/dist/ops-blueprint/update.js +4 -3
- package/dist/renders/blueprint-coverage.d.ts +23 -4
- package/dist/renders/blueprint-coverage.d.ts.map +1 -1
- package/dist/renders/blueprint-coverage.js +45 -5
- package/dist/renders/blueprint-durability.d.ts.map +1 -1
- package/dist/renders/blueprint-durability.js +36 -21
- package/dist/renders/blueprint-matcher.d.ts +57 -7
- package/dist/renders/blueprint-matcher.d.ts.map +1 -1
- package/dist/renders/blueprint-matcher.js +154 -36
- package/dist/renders/blueprint-registry.d.ts +154 -1
- package/dist/renders/blueprint-registry.d.ts.map +1 -1
- package/dist/renders/blueprint-registry.js +337 -10
- package/dist/renders/build-seed-pool.d.ts.map +1 -1
- package/dist/renders/build-seed-pool.js +6 -0
- package/dist/renders/cache-trace-sink.d.ts +12 -0
- package/dist/renders/cache-trace-sink.d.ts.map +1 -1
- package/dist/renders/cache-trace-sink.js +15 -1
- package/dist/renders/consume.d.ts +3 -2
- package/dist/renders/consume.d.ts.map +1 -1
- package/dist/renders/consume.js +50 -15
- package/dist/renders/cross-app-refused.d.ts +17 -0
- package/dist/renders/cross-app-refused.d.ts.map +1 -0
- package/dist/renders/cross-app-refused.js +23 -0
- package/dist/renders/decide-handshake.d.ts +47 -1
- package/dist/renders/decide-handshake.d.ts.map +1 -1
- package/dist/renders/decide-handshake.js +74 -6
- package/dist/renders/declare-tool-catalog.d.ts.map +1 -1
- package/dist/renders/declare-tool-catalog.js +20 -17
- package/dist/renders/export-registry.d.ts +8 -1
- package/dist/renders/export-registry.d.ts.map +1 -1
- package/dist/renders/export-registry.js +3 -0
- package/dist/renders/fits.d.ts +60 -0
- package/dist/renders/fits.d.ts.map +1 -0
- package/dist/renders/fits.js +114 -0
- package/dist/renders/handshake-generation-inputs.d.ts +89 -0
- package/dist/renders/handshake-generation-inputs.d.ts.map +1 -0
- package/dist/renders/handshake-generation-inputs.js +65 -0
- package/dist/renders/handshake.d.ts +6 -42
- package/dist/renders/handshake.d.ts.map +1 -1
- package/dist/renders/handshake.js +1 -1
- package/dist/renders/index.d.ts +10 -5
- package/dist/renders/index.d.ts.map +1 -1
- package/dist/renders/index.js +10 -3
- package/dist/renders/installed-blueprints-provider.d.ts.map +1 -1
- package/dist/renders/installed-blueprints-provider.js +3 -1
- package/dist/renders/match-precision/pairs.d.ts +6 -5
- package/dist/renders/match-precision/pairs.d.ts.map +1 -1
- package/dist/renders/match-precision/run-probe.js +1 -2
- package/dist/renders/match-precision/topk-probe.js +13 -8
- package/dist/renders/record-committed-one-shot.d.ts +18 -3
- package/dist/renders/record-committed-one-shot.d.ts.map +1 -1
- package/dist/renders/record-committed-one-shot.js +14 -7
- package/dist/renders/refresh-ws-token.d.ts +66 -87
- package/dist/renders/refresh-ws-token.d.ts.map +1 -1
- package/dist/renders/refresh-ws-token.js +93 -89
- package/dist/renders/render-identity.d.ts +16 -5
- package/dist/renders/render-identity.d.ts.map +1 -1
- package/dist/renders/render-identity.js +26 -10
- package/dist/renders/render-read-gate.d.ts +85 -0
- package/dist/renders/render-read-gate.d.ts.map +1 -0
- package/dist/renders/render-read-gate.js +57 -0
- package/dist/renders/render.d.ts +77 -27
- package/dist/renders/render.d.ts.map +1 -1
- package/dist/renders/render.js +269 -95
- package/dist/renders/report-render-failure.d.ts +69 -0
- package/dist/renders/report-render-failure.d.ts.map +1 -0
- package/dist/renders/report-render-failure.js +83 -0
- package/dist/renders/runtime-pull.d.ts.map +1 -1
- package/dist/renders/runtime-pull.js +6 -0
- 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 +1 -0
- package/dist/renders/submit-action.d.ts +47 -78
- package/dist/renders/submit-action.d.ts.map +1 -1
- package/dist/renders/submit-action.js +312 -84
- package/dist/renders/sync-context.d.ts +3 -1
- package/dist/renders/sync-context.d.ts.map +1 -1
- package/dist/renders/sync-context.js +53 -20
- package/dist/types.d.ts +71 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +32 -0
- package/package.json +8 -20
- package/dist/ops-connector-keys/in-memory-fake.test-util.d.ts +0 -26
- package/dist/ops-connector-keys/in-memory-fake.test-util.d.ts.map +0 -1
- package/dist/ops-connector-keys/in-memory-fake.test-util.js +0 -60
- package/dist/ops-connector-keys/index.d.ts +0 -19
- package/dist/ops-connector-keys/index.d.ts.map +0 -1
- package/dist/ops-connector-keys/index.js +0 -14
- package/dist/ops-connector-keys/issue-connector-key.d.ts +0 -76
- package/dist/ops-connector-keys/issue-connector-key.d.ts.map +0 -1
- package/dist/ops-connector-keys/issue-connector-key.js +0 -84
- package/dist/ops-connector-keys/list-connector-keys.d.ts +0 -58
- package/dist/ops-connector-keys/list-connector-keys.d.ts.map +0 -1
- package/dist/ops-connector-keys/list-connector-keys.js +0 -39
- package/dist/ops-connector-keys/revoke-connector-key.d.ts +0 -32
- package/dist/ops-connector-keys/revoke-connector-key.d.ts.map +0 -1
- package/dist/ops-connector-keys/revoke-connector-key.js +0 -49
- package/dist/ops-connector-keys/types.d.ts +0 -91
- package/dist/ops-connector-keys/types.d.ts.map +0 -1
- package/dist/ops-connector-keys/types.js +0 -24
- package/dist/ops-coupon/in-memory-fake.test-util.d.ts +0 -28
- package/dist/ops-coupon/in-memory-fake.test-util.d.ts.map +0 -1
- package/dist/ops-coupon/in-memory-fake.test-util.js +0 -66
- package/dist/ops-coupon/index.d.ts +0 -15
- package/dist/ops-coupon/index.d.ts.map +0 -1
- package/dist/ops-coupon/index.js +0 -12
- package/dist/ops-coupon/redeem-coupon.d.ts +0 -51
- package/dist/ops-coupon/redeem-coupon.d.ts.map +0 -1
- package/dist/ops-coupon/redeem-coupon.js +0 -61
- package/dist/ops-coupon/types.d.ts +0 -59
- package/dist/ops-coupon/types.d.ts.map +0 -1
- package/dist/ops-coupon/types.js +0 -38
- package/dist/ops-orgs/create-org.d.ts +0 -45
- package/dist/ops-orgs/create-org.d.ts.map +0 -1
- package/dist/ops-orgs/create-org.js +0 -55
- package/dist/ops-orgs/get-org-balance.d.ts +0 -29
- package/dist/ops-orgs/get-org-balance.d.ts.map +0 -1
- package/dist/ops-orgs/get-org-balance.js +0 -45
- package/dist/ops-orgs/in-memory-fake.test-util.d.ts +0 -84
- package/dist/ops-orgs/in-memory-fake.test-util.d.ts.map +0 -1
- package/dist/ops-orgs/in-memory-fake.test-util.js +0 -209
- package/dist/ops-orgs/index.d.ts +0 -33
- package/dist/ops-orgs/index.d.ts.map +0 -1
- package/dist/ops-orgs/index.js +0 -24
- package/dist/ops-orgs/invite-to-org.d.ts +0 -56
- package/dist/ops-orgs/invite-to-org.d.ts.map +0 -1
- package/dist/ops-orgs/invite-to-org.js +0 -72
- package/dist/ops-orgs/list-orgs.d.ts +0 -53
- package/dist/ops-orgs/list-orgs.d.ts.map +0 -1
- package/dist/ops-orgs/list-orgs.js +0 -38
- package/dist/ops-orgs/remove-org-member.d.ts +0 -42
- package/dist/ops-orgs/remove-org-member.d.ts.map +0 -1
- package/dist/ops-orgs/remove-org-member.js +0 -67
- package/dist/ops-orgs/rename-org.d.ts +0 -33
- package/dist/ops-orgs/rename-org.d.ts.map +0 -1
- package/dist/ops-orgs/rename-org.js +0 -57
- package/dist/ops-orgs/revoke-invite.d.ts +0 -38
- package/dist/ops-orgs/revoke-invite.d.ts.map +0 -1
- package/dist/ops-orgs/revoke-invite.js +0 -53
- package/dist/ops-orgs/types.d.ts +0 -209
- package/dist/ops-orgs/types.d.ts.map +0 -1
- package/dist/ops-orgs/types.js +0 -60
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @ggui-ai/mcp-server-handlers
|
|
2
2
|
|
|
3
|
-
MCP tool handler logic for the **
|
|
3
|
+
MCP tool handler logic for the **GGUI protocol**.
|
|
4
4
|
|
|
5
|
-
This package implements the actual behavior behind every
|
|
5
|
+
This package implements the actual behavior behind every GGUI MCP tool — render
|
|
6
6
|
lifecycle, the contract handshake, UI emission, blueprint management, threads, app
|
|
7
7
|
discovery, and the operator (`ggui_ops_*`) tools. The handlers are written purely
|
|
8
8
|
over the seam interfaces in
|
|
@@ -58,11 +58,11 @@ import type { BlueprintProvider, EmbeddingProvider, VectorStore } from '@ggui-ai
|
|
|
58
58
|
* `score`.
|
|
59
59
|
*
|
|
60
60
|
* The handshake matcher (`matchBlueprint`) gates its judge with its own
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
61
|
+
* numbers, not this one, because its query comes in two kinds on two
|
|
62
|
+
* scales (ggui#606): a request that carries a contract composes its query
|
|
63
|
+
* like the stored vectors (contract summary + intent) and is gated at 0.50;
|
|
64
|
+
* a request without one embeds its intent alone, on a lower scale, and is
|
|
65
|
+
* gated at 0.2 (ggui#1275). Neither is this tool's intent-only search.
|
|
66
66
|
*/
|
|
67
67
|
export declare const MIN_SIMILARITY_SCORE = 0.3;
|
|
68
68
|
/**
|
|
@@ -59,11 +59,11 @@ import { defineHandler } from '../types.js';
|
|
|
59
59
|
* `score`.
|
|
60
60
|
*
|
|
61
61
|
* The handshake matcher (`matchBlueprint`) gates its judge with its own
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
62
|
+
* numbers, not this one, because its query comes in two kinds on two
|
|
63
|
+
* scales (ggui#606): a request that carries a contract composes its query
|
|
64
|
+
* like the stored vectors (contract summary + intent) and is gated at 0.50;
|
|
65
|
+
* a request without one embeds its intent alone, on a lower scale, and is
|
|
66
|
+
* gated at 0.2 (ggui#1275). Neither is this tool's intent-only search.
|
|
67
67
|
*/
|
|
68
68
|
export const MIN_SIMILARITY_SCORE = 0.3;
|
|
69
69
|
/**
|
package/dist/credits/index.d.ts
CHANGED
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
*/
|
|
26
26
|
export { createGetCreditBalanceHandler, } from './get-credit-balance.js';
|
|
27
27
|
export type { CreditBalanceSource, CreditBalanceView, GetCreditBalanceDeps, GetCreditBalanceOutput, } from './get-credit-balance.js';
|
|
28
|
-
export { createListCreditTransactionsHandler, } from './list-credit-transactions.js';
|
|
29
|
-
export type { CreditTransactionSource, CreditTransactionView, ListCreditTransactionsDeps, ListCreditTransactionsOutput, } from './list-credit-transactions.js';
|
|
28
|
+
export { createListCreditTransactionsHandler, KNOWN_CREDIT_TRANSACTION_KINDS, } from './list-credit-transactions.js';
|
|
29
|
+
export type { CreditTransactionKind, CreditTransactionSource, CreditTransactionView, KnownCreditTransactionKind, ListCreditTransactionsDeps, ListCreditTransactionsOutput, } from './list-credit-transactions.js';
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credits/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,mCAAmC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credits/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC"}
|
package/dist/credits/index.js
CHANGED
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
* side-channel — same posture as the blueprint family.
|
|
25
25
|
*/
|
|
26
26
|
export { createGetCreditBalanceHandler, } from './get-credit-balance.js';
|
|
27
|
-
export { createListCreditTransactionsHandler, } from './list-credit-transactions.js';
|
|
27
|
+
export { createListCreditTransactionsHandler, KNOWN_CREDIT_TRANSACTION_KINDS, } from './list-credit-transactions.js';
|
|
@@ -34,9 +34,28 @@ export interface CreditTransactionSource {
|
|
|
34
34
|
nextCursor?: string;
|
|
35
35
|
}>;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* The ledger kinds this package names (ggui#1532). The vocabulary is OPEN: a
|
|
39
|
+
* deployment's ledger may carry kinds not listed here, and a reader MUST accept
|
|
40
|
+
* one it does not know, keep it as named, and never read it as a render charge.
|
|
41
|
+
* Listing a kind here documents it; it is not the set of kinds that may appear.
|
|
42
|
+
*/
|
|
43
|
+
export declare const KNOWN_CREDIT_TRANSACTION_KINDS: readonly ["free_credit", "render_charge", "topup", "refund"];
|
|
44
|
+
/** One of the kinds this package names. */
|
|
45
|
+
export type KnownCreditTransactionKind = (typeof KNOWN_CREDIT_TRANSACTION_KINDS)[number];
|
|
46
|
+
/**
|
|
47
|
+
* A ledger entry's kind: a known kind, or any other non-empty kind a
|
|
48
|
+
* deployment names. The `string & {}` arm keeps the set OPEN while editors
|
|
49
|
+
* still offer the known kinds and a `switch` can name them (it needs a default).
|
|
50
|
+
*/
|
|
51
|
+
export type CreditTransactionKind = KnownCreditTransactionKind | (string & {});
|
|
37
52
|
export interface CreditTransactionView {
|
|
38
53
|
readonly transactionId: string;
|
|
39
|
-
|
|
54
|
+
/**
|
|
55
|
+
* The entry's kind: one of {@link KNOWN_CREDIT_TRANSACTION_KINDS}, or a kind
|
|
56
|
+
* the deployment names that this package does not. Open vocabulary.
|
|
57
|
+
*/
|
|
58
|
+
readonly kind: CreditTransactionKind;
|
|
40
59
|
readonly deltaCents: number;
|
|
41
60
|
readonly balanceAfterCents: number;
|
|
42
61
|
readonly reason: string;
|
|
@@ -58,12 +77,7 @@ export declare function createListCreditTransactionsHandler(deps: ListCreditTran
|
|
|
58
77
|
}, {
|
|
59
78
|
transactions: z.ZodArray<z.ZodObject<{
|
|
60
79
|
transactionId: z.ZodString;
|
|
61
|
-
kind: z.
|
|
62
|
-
free_credit: "free_credit";
|
|
63
|
-
render_charge: "render_charge";
|
|
64
|
-
topup: "topup";
|
|
65
|
-
refund: "refund";
|
|
66
|
-
}>;
|
|
80
|
+
kind: z.ZodString;
|
|
67
81
|
deltaCents: z.ZodNumber;
|
|
68
82
|
balanceAfterCents: z.ZodNumber;
|
|
69
83
|
reason: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-credit-transactions.d.ts","sourceRoot":"","sources":["../../src/credits/list-credit-transactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,EAAE,MAAM,CAAC;QACf,oCAAoC;QACpC,KAAK,EAAE,MAAM,CAAC;QACd,4EAA4E;QAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC;QACV,YAAY,EAAE,qBAAqB,EAAE,CAAC;QACtC,6CAA6C;QAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"list-credit-transactions.d.ts","sourceRoot":"","sources":["../../src/credits/list-credit-transactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,EAAE,MAAM,CAAC;QACf,oCAAoC;QACpC,KAAK,EAAE,MAAM,CAAC;QACd,4EAA4E;QAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC;QACV,YAAY,EAAE,qBAAqB,EAAE,CAAC;QACtC,6CAA6C;QAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;CACJ;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,8DAA+D,CAAC;AAE3G,2CAA2C;AAC3C,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAE/E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,kBAAkB,EAAE,uBAAuB,CAAC;CACtD;AA8BD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,YAAY,EAAE,qBAAqB,EAAE,CAAC;IAC/C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,0BAA0B;IAjChC,2BAA2B;;IAE3B,kEAAkE;;;;;;;;;;;;IAqBlE,oFAAoF;;;;;GAgDrF"}
|
|
@@ -17,6 +17,13 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
import { defineHandler } from '../types.js';
|
|
20
|
+
/**
|
|
21
|
+
* The ledger kinds this package names (ggui#1532). The vocabulary is OPEN: a
|
|
22
|
+
* deployment's ledger may carry kinds not listed here, and a reader MUST accept
|
|
23
|
+
* one it does not know, keep it as named, and never read it as a render charge.
|
|
24
|
+
* Listing a kind here documents it; it is not the set of kinds that may appear.
|
|
25
|
+
*/
|
|
26
|
+
export const KNOWN_CREDIT_TRANSACTION_KINDS = ['free_credit', 'render_charge', 'topup', 'refund'];
|
|
20
27
|
const inputSchema = {
|
|
21
28
|
/** Default 20. Cap 100. */
|
|
22
29
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -26,7 +33,10 @@ const inputSchema = {
|
|
|
26
33
|
const outputSchema = {
|
|
27
34
|
transactions: z.array(z.object({
|
|
28
35
|
transactionId: z.string(),
|
|
29
|
-
kind: z
|
|
36
|
+
kind: z
|
|
37
|
+
.string()
|
|
38
|
+
.min(1)
|
|
39
|
+
.describe("The ledger entry's kind, an open vocabulary. Known kinds: 'free_credit', 'render_charge', 'topup', 'refund'. A deployment may add others: accept a kind you do not know, keep it as named, and never read it as a render charge."),
|
|
30
40
|
deltaCents: z.number().int(),
|
|
31
41
|
balanceAfterCents: z.number().int(),
|
|
32
42
|
reason: z.string(),
|
|
@@ -41,7 +51,7 @@ export function createListCreditTransactionsHandler(deps) {
|
|
|
41
51
|
name: 'ggui_ops_list_credit_transactions',
|
|
42
52
|
title: 'List credit transactions',
|
|
43
53
|
audience: ['ops'],
|
|
44
|
-
description: "Returns the calling user's credit transaction ledger, newest-first. Each row carries kind ('free_credit'
|
|
54
|
+
description: "Returns the calling user's credit transaction ledger, newest-first. Each row carries kind (an open vocabulary: known kinds are 'free_credit', 'render_charge', 'topup' and 'refund', and a deployment may add others; treat an unknown kind as a ledger entry of that name, never as a render charge), deltaCents (signed — positive for grants/topups, negative for charges), balanceAfterCents (snapshot at time of write), reason (human-readable), and optional relatedSessionId for render_charge rows. Default limit 20, cap 100; pass `cursor` from the previous response's `nextCursor` for paging.",
|
|
45
55
|
inputSchema,
|
|
46
56
|
outputSchema,
|
|
47
57
|
// No `allowedFor` — same toolset on every deployment kind. Callers
|
package/dist/index.d.ts
CHANGED
|
@@ -15,14 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export * from "./blueprints/index.js";
|
|
17
17
|
export * from "./renders/index.js";
|
|
18
|
-
export { AuthRequiredError, HANDLER_FAILURE_MARKER, defineHandler, handlerFailure, isHandlerFailure, } from "./types.js";
|
|
19
|
-
export type { AudienceTag, EnvelopedHandlerDefinition, EnvelopeFor, HandlerContext, HandlerDefinition, HandlerFailure, ShapeOutput, SharedHandler, SharedHandlerOutputBound, SharedHandlerOutputData, SharedHandlerResult, } from "./types.js";
|
|
18
|
+
export { AuthRequiredError, HANDLER_FAILURE_MARKER, createSessionRowReads, defineHandler, handlerFailure, isHandlerFailure, readSessionRow, viewProofUseFor, } from "./types.js";
|
|
19
|
+
export type { AudienceTag, EnvelopedHandlerDefinition, EnvelopeFor, HandlerContext, HandlerDefinition, HandlerFailure, SessionRowReads, ShapeOutput, SharedHandler, SharedHandlerOutputBound, SharedHandlerOutputData, SharedHandlerResult, ViewProofDeclaration, ViewProofUse, } from "./types.js";
|
|
20
20
|
export * from "./threads/index.js";
|
|
21
21
|
export * from "./credits/index.js";
|
|
22
22
|
export * from "./app-discovery/index.js";
|
|
23
23
|
export * from "./ops-blueprint/index.js";
|
|
24
24
|
export * from "./ops-apps/index.js";
|
|
25
|
-
export * from "./ops-connector-keys/index.js";
|
|
26
|
-
export * from "./ops-coupon/index.js";
|
|
27
|
-
export * from "./ops-orgs/index.js";
|
|
28
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,WAAW,EACX,0BAA0B,EAC1B,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,GACb,MAAM,YAAY,CAAC;AAIpB,cAAc,oBAAoB,CAAC;AAInC,cAAc,oBAAoB,CAAC;AAInC,cAAc,0BAA0B,CAAC;AAIzC,cAAc,0BAA0B,CAAC;AAKzC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export * from "./blueprints/index.js";
|
|
17
17
|
export * from "./renders/index.js";
|
|
18
|
-
export { AuthRequiredError, HANDLER_FAILURE_MARKER, defineHandler, handlerFailure, isHandlerFailure, } from "./types.js";
|
|
18
|
+
export { AuthRequiredError, HANDLER_FAILURE_MARKER, createSessionRowReads, defineHandler, handlerFailure, isHandlerFailure, readSessionRow, viewProofUseFor, } from "./types.js";
|
|
19
19
|
// Persistent-chat handler family — thread storage and message
|
|
20
20
|
// history MCP tools. Thin over @ggui-ai/mcp-server-core ThreadStore.
|
|
21
21
|
// Available under `@ggui-ai/mcp-server-handlers/threads` subpath too.
|
|
@@ -32,12 +32,8 @@ export * from "./app-discovery/index.js";
|
|
|
32
32
|
// served on the `/control` plane. Available under
|
|
33
33
|
// `@ggui-ai/mcp-server-handlers/ops-blueprint` subpath too.
|
|
34
34
|
export * from "./ops-blueprint/index.js";
|
|
35
|
-
// Operator-class apps
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
// `@ggui-ai/mcp-server-handlers/ops-apps
|
|
39
|
-
// `…/ops-connector-keys`, `…/ops-coupon`.
|
|
35
|
+
// Operator-class apps handler family — `ggui_ops_*` tools that
|
|
36
|
+
// manage a deployment's apps, pure over the `AppsSource` seam the
|
|
37
|
+
// deployment binds. Available under
|
|
38
|
+
// `@ggui-ai/mcp-server-handlers/ops-apps` subpath too.
|
|
40
39
|
export * from "./ops-apps/index.js";
|
|
41
|
-
export * from "./ops-connector-keys/index.js";
|
|
42
|
-
export * from "./ops-coupon/index.js";
|
|
43
|
-
export * from "./ops-orgs/index.js";
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `ggui_ops_create_app` —
|
|
3
|
-
* calling user. Sibling of the `provisionGguiApp` AppSync mutation
|
|
4
|
-
* (`backend/amplify/data/create-app/handler.ts`); same identity gate
|
|
5
|
-
* (caller's sub, NEVER an argument-supplied userId), same default
|
|
6
|
-
* displayName, same server-side appId allocation — exposed through
|
|
7
|
-
* the `ops` MCP surface so an LLM agent in the console can create an
|
|
8
|
-
* app without a custom GraphQL call.
|
|
2
|
+
* `ggui_ops_create_app` — create a new app owned by the calling user.
|
|
9
3
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
4
|
+
* The owner is always the caller's own identity (`resolveOwnerSub`),
|
|
5
|
+
* never a userId passed as an argument, so an operator agent can only
|
|
6
|
+
* create apps for the account it acts for. The appId is minted by the
|
|
7
|
+
* deployment's {@link AppsSource}: the handler never takes one from the
|
|
8
|
+
* caller, and uniqueness (including any retry on a collision) is the
|
|
9
|
+
* store's job. An in-memory store can use any unique string; a store
|
|
10
|
+
* over a database mints ids in whatever format that database keys on.
|
|
11
|
+
*
|
|
12
|
+
* Pure over the {@link AppsSource} seam.
|
|
14
13
|
*/
|
|
15
14
|
import { z } from 'zod';
|
|
16
15
|
import { type ShapeOutput } from '../types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../src/ops-apps/create-app.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../src/ops-apps/create-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAiB,KAAK,WAAW,EAAuB,MAAM,aAAa,CAAC;AAEnF,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,YAAY,CAAC;AAaxD,QAAA,MAAM,YAAY;;;;;;;CAYR,CAAC;AAEX,oFAAoF;AACpF,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,OAAO,YAAY,CAAC,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,aAAa;;;;;;;;;;;;;;;;GAiCpB"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `ggui_ops_create_app` —
|
|
3
|
-
* calling user. Sibling of the `provisionGguiApp` AppSync mutation
|
|
4
|
-
* (`backend/amplify/data/create-app/handler.ts`); same identity gate
|
|
5
|
-
* (caller's sub, NEVER an argument-supplied userId), same default
|
|
6
|
-
* displayName, same server-side appId allocation — exposed through
|
|
7
|
-
* the `ops` MCP surface so an LLM agent in the console can create an
|
|
8
|
-
* app without a custom GraphQL call.
|
|
2
|
+
* `ggui_ops_create_app` — create a new app owned by the calling user.
|
|
9
3
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
4
|
+
* The owner is always the caller's own identity (`resolveOwnerSub`),
|
|
5
|
+
* never a userId passed as an argument, so an operator agent can only
|
|
6
|
+
* create apps for the account it acts for. The appId is minted by the
|
|
7
|
+
* deployment's {@link AppsSource}: the handler never takes one from the
|
|
8
|
+
* caller, and uniqueness (including any retry on a collision) is the
|
|
9
|
+
* store's job. An in-memory store can use any unique string; a store
|
|
10
|
+
* over a database mints ids in whatever format that database keys on.
|
|
11
|
+
*
|
|
12
|
+
* Pure over the {@link AppsSource} seam.
|
|
14
13
|
*/
|
|
15
14
|
import { z } from 'zod';
|
|
16
15
|
import { defineHandler } from '../types.js';
|
|
@@ -21,7 +20,7 @@ const inputSchema = {
|
|
|
21
20
|
.min(1)
|
|
22
21
|
.max(120)
|
|
23
22
|
.optional()
|
|
24
|
-
.describe("Human-friendly label for the new app. Defaults to 'My ggui app' when absent
|
|
23
|
+
.describe("Human-friendly label for the new app. Defaults to 'My ggui app' when absent."),
|
|
25
24
|
};
|
|
26
25
|
const outputSchema = {
|
|
27
26
|
appId: z.string(),
|
|
@@ -39,7 +38,7 @@ export function createCreateAppHandler(deps) {
|
|
|
39
38
|
name: 'ggui_ops_create_app',
|
|
40
39
|
title: 'Create app',
|
|
41
40
|
audience: ['ops'],
|
|
42
|
-
description: "
|
|
41
|
+
description: "Create a new app owned by the calling user. The server mints the appId (it is never an argument), displayName defaults to 'My ggui app' when absent (max 120 chars). Returns the stored app — call `ggui_ops_set_default_app({appId})` afterwards to make it the caller's default.",
|
|
43
42
|
inputSchema,
|
|
44
43
|
outputSchema,
|
|
45
44
|
async handler(rawInput, ctx) {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Per-call identity resolution for `ops-apps` handlers.
|
|
3
|
-
*
|
|
4
|
-
* upstream `AuthAdapter` populates `ctx.userId`
|
|
5
|
-
*
|
|
6
|
-
* workspaceId ?? userId`) leaves `ctx.userId` undefined and
|
|
7
|
-
* value sits on `ctx.appId`. Read whichever is set; fail when
|
|
8
|
-
* is.
|
|
2
|
+
* Per-call identity resolution for `ops-apps` handlers. A deployment
|
|
3
|
+
* with per-user accounts calls these tools as `kind: 'user'`
|
|
4
|
+
* identities — the upstream `AuthAdapter` populates `ctx.userId`
|
|
5
|
+
* directly. Single-app mode (where the auth adapter collapses
|
|
6
|
+
* `appId = workspaceId ?? userId`) leaves `ctx.userId` undefined and
|
|
7
|
+
* the same value sits on `ctx.appId`. Read whichever is set; fail when
|
|
8
|
+
* neither is.
|
|
9
9
|
*/
|
|
10
10
|
import type { HandlerContext } from '../types.js';
|
|
11
11
|
/**
|
|
12
|
-
* Resolve the caller's
|
|
12
|
+
* Resolve the caller's owner id (`ctx.userId`, or `ctx.appId` in
|
|
13
|
+
* single-app mode). Throws
|
|
13
14
|
* when neither field is set — that means an unauthenticated caller
|
|
14
15
|
* slipped past the upstream auth adapter, which is a real bug worth
|
|
15
16
|
* surfacing as a 5xx rather than masking as "empty list".
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/ops-apps/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/ops-apps/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,cAAc,GAClB,MAAM,CAQR"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Resolve the caller's
|
|
2
|
+
* Resolve the caller's owner id (`ctx.userId`, or `ctx.appId` in
|
|
3
|
+
* single-app mode). Throws
|
|
3
4
|
* when neither field is set — that means an unauthenticated caller
|
|
4
5
|
* slipped past the upstream auth adapter, which is a real bug worth
|
|
5
6
|
* surfacing as a 5xx rather than masking as "empty list".
|
package/dist/ops-apps/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Six MCP tools, all `audience: ['ops']`, all served on `/control`. Pure
|
|
5
5
|
* over the {@link AppsSource} + {@link UserDefaultAppSource} seams —
|
|
6
|
-
*
|
|
7
|
-
* use in-memory fakes.
|
|
6
|
+
* no storage imports. A deployment binds adapters over its own store;
|
|
7
|
+
* tests use in-memory fakes.
|
|
8
8
|
*
|
|
9
9
|
* - `createListAppsHandler` → `ggui_ops_list_apps`
|
|
10
10
|
* - `createCreateAppHandler` → `ggui_ops_create_app`
|
package/dist/ops-apps/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Six MCP tools, all `audience: ['ops']`, all served on `/control`. Pure
|
|
5
5
|
* over the {@link AppsSource} + {@link UserDefaultAppSource} seams —
|
|
6
|
-
*
|
|
7
|
-
* use in-memory fakes.
|
|
6
|
+
* no storage imports. A deployment binds adapters over its own store;
|
|
7
|
+
* tests use in-memory fakes.
|
|
8
8
|
*
|
|
9
9
|
* - `createListAppsHandler` → `ggui_ops_list_apps`
|
|
10
10
|
* - `createCreateAppHandler` → `ggui_ops_create_app`
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `ggui_ops_list_apps` — enumerate the calling user's `GguiApp` rows.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* in-memory Map.
|
|
4
|
+
* The MCP door onto the same data an app-management UI lists. Pure over
|
|
5
|
+
* the {@link AppsSource} seam; a production deployment binds its own
|
|
6
|
+
* implementation, tests bind an in-memory Map.
|
|
8
7
|
*
|
|
9
|
-
* Identity scope: caller's
|
|
10
|
-
* `ctx.appId` in
|
|
8
|
+
* Identity scope: the caller's owner id from `ctx.userId` (or
|
|
9
|
+
* `ctx.appId` in single-app mode). Cross-user list is impossible
|
|
11
10
|
* by construction — `AppsSource.list` only returns rows whose
|
|
12
11
|
* `ownerSub` matches.
|
|
13
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-apps.d.ts","sourceRoot":"","sources":["../../src/ops-apps/list-apps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"list-apps.d.ts","sourceRoot":"","sources":["../../src/ops-apps/list-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C,QAAA,MAAM,YAAY;;;;;;;;CAUR,CAAC;AAEX,oFAAoF;AACpF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,YAAY,CAAC,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY;;;;;;;;;;;;;;;;GA4BvD"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `ggui_ops_list_apps` — enumerate the calling user's `GguiApp` rows.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* in-memory Map.
|
|
4
|
+
* The MCP door onto the same data an app-management UI lists. Pure over
|
|
5
|
+
* the {@link AppsSource} seam; a production deployment binds its own
|
|
6
|
+
* implementation, tests bind an in-memory Map.
|
|
8
7
|
*
|
|
9
|
-
* Identity scope: caller's
|
|
10
|
-
* `ctx.appId` in
|
|
8
|
+
* Identity scope: the caller's owner id from `ctx.userId` (or
|
|
9
|
+
* `ctx.appId` in single-app mode). Cross-user list is impossible
|
|
11
10
|
* by construction — `AppsSource.list` only returns rows whose
|
|
12
11
|
* `ownerSub` matches.
|
|
13
12
|
*/
|
|
@@ -29,7 +28,7 @@ export function createListAppsHandler(deps) {
|
|
|
29
28
|
name: 'ggui_ops_list_apps',
|
|
30
29
|
title: 'List apps',
|
|
31
30
|
audience: ['ops'],
|
|
32
|
-
description: "Enumerate every `GguiApp` row owned by the calling user. Returns metadata only (appId, displayName, optional systemPrompt, createdAt, updatedAt).
|
|
31
|
+
description: "Enumerate every `GguiApp` row owned by the calling user. Returns metadata only (appId, displayName, optional systemPrompt, createdAt, updatedAt). Use to discover ids before calling `ggui_ops_update_app` / `ggui_ops_set_default_app` / `ggui_ops_delete_app`.",
|
|
33
32
|
inputSchema,
|
|
34
33
|
outputSchema,
|
|
35
34
|
async handler(_input, ctx) {
|
|
@@ -15,15 +15,19 @@
|
|
|
15
15
|
* 2. attestation — `overlayHash` is recomputed with
|
|
16
16
|
* `canonicalOverlayHash` and a mismatch is refused;
|
|
17
17
|
* 3. coverage — the injected overlay validator judges each mode's
|
|
18
|
-
* set against the consumed-token manifest: a
|
|
19
|
-
*
|
|
20
|
-
* (`
|
|
18
|
+
* set against the consumed-token manifest: a consumed token left
|
|
19
|
+
* unset (`uncovered`) is refused, per mode. A key outside the
|
|
20
|
+
* manifest (`unknown`) is ADMITTED, never refused (ggui#1286): the
|
|
21
|
+
* theme is stored verbatim and the write logs the names
|
|
22
|
+
* (`app_theme_unknown_overlay_names`).
|
|
21
23
|
*
|
|
22
24
|
* A refusal is a schema-conformant `{ ok: false, code:
|
|
23
25
|
* 'invalid_app_config', refusal }` RESULT (not a thrown error): the
|
|
24
|
-
* body is one
|
|
25
|
-
*
|
|
26
|
-
*
|
|
26
|
+
* body is one the protocol names (`appThemeRefusalBodySchema`, five
|
|
27
|
+
* bodies; this door raises three of them: `refused: 'v1 shape'`,
|
|
28
|
+
* `overlayHash: 'mismatch'` and `uncovered`), so a client reads the
|
|
29
|
+
* same refusal from every write door a deployment offers, this one
|
|
30
|
+
* included. A body the schema itself rejects carries `issues` instead.
|
|
27
31
|
*
|
|
28
32
|
* Ownership: `AppsSource.get` first (scoped by `ownerSub`); cross-user
|
|
29
33
|
* probes return the uniform "not found" shape. The store scopes the
|
|
@@ -102,7 +106,7 @@ declare const outputSchema: {
|
|
|
102
106
|
readonly updatedAt: z.ZodOptional<z.ZodString>;
|
|
103
107
|
/** Present on a refusal: the one refusal class this door emits. */
|
|
104
108
|
readonly code: z.ZodOptional<z.ZodLiteral<"invalid_app_config">>;
|
|
105
|
-
/** Present on a coverage / attestation / v1-shape refusal —
|
|
109
|
+
/** Present on a coverage / attestation / v1-shape refusal — a protocol-named body (`appThemeRefusalBodySchema`). */
|
|
106
110
|
readonly refusal: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
107
111
|
uncovered: z.ZodObject<{
|
|
108
112
|
light: z.ZodArray<z.ZodString>;
|
|
@@ -265,7 +269,7 @@ export declare function createSetAppThemeHandler(deps: SetAppThemeDeps): import(
|
|
|
265
269
|
readonly updatedAt: z.ZodOptional<z.ZodString>;
|
|
266
270
|
/** Present on a refusal: the one refusal class this door emits. */
|
|
267
271
|
readonly code: z.ZodOptional<z.ZodLiteral<"invalid_app_config">>;
|
|
268
|
-
/** Present on a coverage / attestation / v1-shape refusal —
|
|
272
|
+
/** Present on a coverage / attestation / v1-shape refusal — a protocol-named body (`appThemeRefusalBodySchema`). */
|
|
269
273
|
readonly refusal: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
270
274
|
uncovered: z.ZodObject<{
|
|
271
275
|
light: z.ZodArray<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-app-theme.d.ts","sourceRoot":"","sources":["../../src/ops-apps/set-app-theme.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"set-app-theme.d.ts","sourceRoot":"","sources":["../../src/ops-apps/set-app-theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK;IACpF,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;AAcF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKhB,mEAAmE;;IAEnE,oHAAoH;;;;;;;;;;;;;;;;;;IAEpH,yFAAyF;;CAEjF,CAAC;AAEX,uEAAuE;AACvE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,8FAA8F;IAC9F,QAAQ,CAAC,eAAe,EAAE,wBAAwB,CAAC;CACpD;AAED,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,8GAA8G;IAC9G,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC;CAC3F,GACD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAY/D;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,wBAAwB,GACxC,OAAO,CAAC,iBAAiB,CAAC,CAmB5B;AAqBD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAzF5D,mEAAmE;;IAEnE,oHAAoH;;;;;;;;;;;;;;;;;;IAEpH,yFAAyF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmI1F"}
|
|
@@ -15,15 +15,19 @@
|
|
|
15
15
|
* 2. attestation — `overlayHash` is recomputed with
|
|
16
16
|
* `canonicalOverlayHash` and a mismatch is refused;
|
|
17
17
|
* 3. coverage — the injected overlay validator judges each mode's
|
|
18
|
-
* set against the consumed-token manifest: a
|
|
19
|
-
*
|
|
20
|
-
* (`
|
|
18
|
+
* set against the consumed-token manifest: a consumed token left
|
|
19
|
+
* unset (`uncovered`) is refused, per mode. A key outside the
|
|
20
|
+
* manifest (`unknown`) is ADMITTED, never refused (ggui#1286): the
|
|
21
|
+
* theme is stored verbatim and the write logs the names
|
|
22
|
+
* (`app_theme_unknown_overlay_names`).
|
|
21
23
|
*
|
|
22
24
|
* A refusal is a schema-conformant `{ ok: false, code:
|
|
23
25
|
* 'invalid_app_config', refusal }` RESULT (not a thrown error): the
|
|
24
|
-
* body is one
|
|
25
|
-
*
|
|
26
|
-
*
|
|
26
|
+
* body is one the protocol names (`appThemeRefusalBodySchema`, five
|
|
27
|
+
* bodies; this door raises three of them: `refused: 'v1 shape'`,
|
|
28
|
+
* `overlayHash: 'mismatch'` and `uncovered`), so a client reads the
|
|
29
|
+
* same refusal from every write door a deployment offers, this one
|
|
30
|
+
* included. A body the schema itself rejects carries `issues` instead.
|
|
27
31
|
*
|
|
28
32
|
* Ownership: `AppsSource.get` first (scoped by `ownerSub`); cross-user
|
|
29
33
|
* probes return the uniform "not found" shape. The store scopes the
|
|
@@ -50,7 +54,7 @@ const outputSchema = {
|
|
|
50
54
|
updatedAt: z.string().optional(),
|
|
51
55
|
/** Present on a refusal: the one refusal class this door emits. */
|
|
52
56
|
code: z.literal('invalid_app_config').optional(),
|
|
53
|
-
/** Present on a coverage / attestation / v1-shape refusal —
|
|
57
|
+
/** Present on a coverage / attestation / v1-shape refusal — a protocol-named body (`appThemeRefusalBodySchema`). */
|
|
54
58
|
refusal: appThemeRefusalBodySchema.optional(),
|
|
55
59
|
/** Present on a shape refusal the schema itself raised — its messages, one per issue. */
|
|
56
60
|
issues: z.array(z.string()).optional(),
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* `ggui_ops_set_default_app` — write the calling user's
|
|
3
3
|
* `GguiUser.defaultAppId` column.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* Same column, MCP surface. The handler chains `AppsSource.get` first
|
|
5
|
+
* The MCP door onto the user's default-app setting. The handler chains `AppsSource.get` first
|
|
7
6
|
* (verify the user owns the target appId) before writing
|
|
8
7
|
* `UserDefaultAppSource.setDefault` — invariant: `defaultAppId` MUST
|
|
9
8
|
* point at an app the user owns.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-default-app.d.ts","sourceRoot":"","sources":["../../src/ops-apps/set-default-app.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"set-default-app.d.ts","sourceRoot":"","sources":["../../src/ops-apps/set-default-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAenE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;CAC/C;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,iBAAiB;;;;wBA8BxB"}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* `ggui_ops_set_default_app` — write the calling user's
|
|
3
3
|
* `GguiUser.defaultAppId` column.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* Same column, MCP surface. The handler chains `AppsSource.get` first
|
|
5
|
+
* The MCP door onto the user's default-app setting. The handler chains `AppsSource.get` first
|
|
7
6
|
* (verify the user owns the target appId) before writing
|
|
8
7
|
* `UserDefaultAppSource.setDefault` — invariant: `defaultAppId` MUST
|
|
9
8
|
* point at an app the user owns.
|