@ggui-ai/mcp-server-handlers 0.15.0 → 0.17.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/app-discovery/errors.d.ts +2 -2
- package/dist/app-discovery/errors.js +2 -2
- package/dist/app-discovery/list-gadgets.d.ts +2 -2
- package/dist/app-discovery/list-gadgets.js +3 -3
- package/dist/app-discovery/list-themes.d.ts +1 -1
- package/dist/app-discovery/list-themes.js +2 -2
- package/dist/credits/get-credit-balance.d.ts +3 -3
- package/dist/credits/get-credit-balance.js +6 -6
- package/dist/credits/list-credit-transactions.d.ts +5 -6
- package/dist/credits/list-credit-transactions.d.ts.map +1 -1
- package/dist/credits/list-credit-transactions.js +4 -4
- package/dist/ops-apps/delete-app.d.ts +2 -2
- package/dist/ops-apps/delete-app.js +4 -4
- package/dist/ops-apps/identity.d.ts +1 -1
- package/dist/ops-apps/index.d.ts +2 -2
- package/dist/ops-apps/index.d.ts.map +1 -1
- package/dist/ops-apps/index.js +1 -1
- package/dist/ops-apps/list-apps.d.ts +3 -3
- package/dist/ops-apps/list-apps.js +3 -3
- package/dist/ops-apps/set-app-theme.d.ts +304 -60
- package/dist/ops-apps/set-app-theme.d.ts.map +1 -1
- package/dist/ops-apps/set-app-theme.js +99 -58
- package/dist/ops-apps/set-default-app.d.ts +1 -1
- package/dist/ops-apps/set-default-app.js +2 -2
- package/dist/ops-apps/types.d.ts +7 -7
- package/dist/ops-apps/types.d.ts.map +1 -1
- package/dist/ops-apps/types.js +1 -1
- package/dist/ops-apps/update-app.d.ts +3 -3
- package/dist/ops-apps/update-app.js +4 -4
- package/dist/ops-blueprint/delete.d.ts +3 -3
- package/dist/ops-blueprint/delete.js +5 -5
- package/dist/ops-blueprint/errors.d.ts +2 -2
- package/dist/ops-blueprint/errors.js +2 -2
- package/dist/ops-blueprint/generate.d.ts +1 -0
- package/dist/ops-blueprint/generate.d.ts.map +1 -1
- package/dist/ops-blueprint/generate.js +30 -3
- package/dist/ops-blueprint/register.d.ts +1 -1
- package/dist/ops-blueprint/register.d.ts.map +1 -1
- package/dist/ops-blueprint/register.js +17 -7
- package/dist/ops-blueprint/update.d.ts +4 -4
- package/dist/ops-blueprint/update.js +5 -5
- package/dist/ops-connector-keys/types.d.ts +2 -3
- package/dist/ops-connector-keys/types.d.ts.map +1 -1
- package/dist/ops-coupon/types.d.ts +2 -2
- package/dist/ops-orgs/list-orgs.d.ts +2 -2
- package/dist/ops-orgs/list-orgs.js +2 -2
- package/dist/ops-orgs/types.d.ts +1 -1
- package/dist/provider-keys/list-provider-keys.d.ts +5 -5
- package/dist/provider-keys/list-provider-keys.js +3 -3
- package/dist/provider-keys/remove-provider-key.d.ts +2 -2
- package/dist/provider-keys/set-provider-key.d.ts +3 -3
- package/dist/provider-keys/types.d.ts +4 -4
- package/dist/renders/apply-ggui-session-patch.d.ts +2 -2
- package/dist/renders/assert-gadgets.d.ts +3 -4
- package/dist/renders/assert-gadgets.d.ts.map +1 -1
- package/dist/renders/assert-gadgets.js +5 -8
- package/dist/renders/assert-no-duplicate-gadget-hooks.d.ts +2 -2
- package/dist/renders/assert-no-duplicate-gadget-hooks.d.ts.map +1 -1
- package/dist/renders/assert-no-duplicate-gadget-hooks.js +3 -4
- package/dist/renders/assert-public-env.d.ts +2 -2
- package/dist/renders/assert-public-env.d.ts.map +1 -1
- package/dist/renders/assert-public-env.js +3 -4
- package/dist/renders/blueprint-registry.d.ts +3 -3
- package/dist/renders/blueprint-registry.d.ts.map +1 -1
- package/dist/renders/blueprint-registry.js +6 -7
- package/dist/renders/cache-trace-sink.d.ts +1 -1
- package/dist/renders/cache-trace-sink.d.ts.map +1 -1
- package/dist/renders/consume.d.ts +87 -7
- package/dist/renders/consume.d.ts.map +1 -1
- package/dist/renders/consume.js +85 -76
- package/dist/renders/errors.d.ts +7 -7
- package/dist/renders/errors.d.ts.map +1 -1
- package/dist/renders/errors.js +10 -13
- package/dist/renders/fetch-gadget-types.d.ts +2 -2
- package/dist/renders/fetch-gadget-types.d.ts.map +1 -1
- package/dist/renders/fetch-gadget-types.js +3 -4
- package/dist/renders/generation-cache.d.ts +1 -1
- package/dist/renders/generation-cache.js +1 -1
- package/dist/renders/get-render-source.d.ts +3 -3
- package/dist/renders/get-render-source.js +5 -5
- package/dist/renders/get-session.d.ts +1 -1
- package/dist/renders/get-session.js +4 -4
- package/dist/renders/handshake.d.ts +6 -5
- package/dist/renders/handshake.d.ts.map +1 -1
- package/dist/renders/handshake.js +4 -5
- package/dist/renders/import-gate.d.ts +1 -1
- package/dist/renders/index.d.ts +3 -3
- package/dist/renders/index.d.ts.map +1 -1
- package/dist/renders/index.js +2 -2
- package/dist/renders/installed-blueprints-provider.js +0 -0
- package/dist/renders/list-sessions.d.ts +2 -2
- package/dist/renders/list-sessions.js +1 -1
- package/dist/renders/match-precision/pairs.js +1 -1
- package/dist/renders/payload-trace-sink.d.ts +1 -1
- package/dist/renders/payload-trace-sink.d.ts.map +1 -1
- package/dist/renders/props-mutation-core.js +3 -3
- package/dist/renders/provisional-preview.d.ts +4 -4
- package/dist/renders/provisional-preview.js +3 -3
- package/dist/renders/refresh-ws-token.d.ts +3 -3
- package/dist/renders/refresh-ws-token.js +2 -2
- package/dist/renders/render-identity.d.ts +1 -1
- package/dist/renders/render-source-envelope.d.ts +2 -2
- package/dist/renders/{tenancy.d.ts → render-visibility.d.ts} +3 -3
- package/dist/renders/render-visibility.d.ts.map +1 -0
- package/dist/renders/{tenancy.js → render-visibility.js} +1 -1
- package/dist/renders/render.d.ts +41 -25
- package/dist/renders/render.d.ts.map +1 -1
- package/dist/renders/render.js +91 -38
- package/dist/renders/runtime-pull.d.ts +15 -6
- package/dist/renders/runtime-pull.d.ts.map +1 -1
- package/dist/renders/runtime-pull.js +44 -11
- package/dist/renders/runtime-telemetry.d.ts +2 -2
- package/dist/renders/runtime-telemetry.js +1 -1
- package/dist/renders/slice-meta-derivation.d.ts +15 -36
- package/dist/renders/slice-meta-derivation.d.ts.map +1 -1
- package/dist/renders/slice-meta-derivation.js +45 -37
- package/dist/renders/stream-replay-ops.d.ts +2 -2
- package/dist/renders/stream-replay-ops.js +1 -1
- package/dist/renders/stream.d.ts +1 -1
- package/dist/renders/stream.js +2 -2
- package/dist/renders/submit-action.d.ts +1 -1
- package/dist/renders/submit-action.d.ts.map +1 -1
- package/dist/renders/submit-action.js +8 -4
- package/dist/renders/sync-context.js +1 -1
- package/dist/renders/tool-identity-catalog-store.d.ts +1 -1
- package/dist/renders/tool-identity-catalog-store.js +1 -1
- package/dist/renders/update.d.ts +3 -3
- package/dist/renders/update.d.ts.map +1 -1
- package/dist/renders/update.js +6 -6
- package/dist/types.d.ts +6 -6
- package/dist/types.js +2 -2
- package/package.json +8 -12
- package/dist/ops-themes/delete-theme.d.ts +0 -32
- package/dist/ops-themes/delete-theme.d.ts.map +0 -1
- package/dist/ops-themes/delete-theme.js +0 -42
- package/dist/ops-themes/index.d.ts +0 -9
- package/dist/ops-themes/index.d.ts.map +0 -1
- package/dist/ops-themes/index.js +0 -8
- package/dist/ops-themes/list-themes.d.ts +0 -43
- package/dist/ops-themes/list-themes.d.ts.map +0 -1
- package/dist/ops-themes/list-themes.js +0 -52
- package/dist/ops-themes/register-theme.d.ts +0 -65
- package/dist/ops-themes/register-theme.d.ts.map +0 -1
- package/dist/ops-themes/register-theme.js +0 -145
- package/dist/ops-themes/types.d.ts +0 -63
- package/dist/ops-themes/types.d.ts.map +0 -1
- package/dist/ops-themes/types.js +0 -50
- package/dist/renders/tenancy.d.ts.map +0 -1
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* handler-flow diagnostics, not contract-shape violations.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
|
-
* Thrown by `ggui_list_gadgets` (and any future
|
|
9
|
+
* Thrown by `ggui_list_gadgets` (and any future app-
|
|
10
10
|
* scoped app-discovery tool) when the caller supplies an explicit
|
|
11
11
|
* `appId` that does NOT match `ctx.appId` resolved by the upstream
|
|
12
|
-
* auth adapter. Cross-
|
|
12
|
+
* auth adapter. Cross-app probes get a uniform error so the
|
|
13
13
|
* existence of an alternate `appId` is not leaked.
|
|
14
14
|
*
|
|
15
15
|
* Recovery: omit `appId` to default to `ctx.appId`, or call from a
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* handler-flow diagnostics, not contract-shape violations.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
|
-
* Thrown by `ggui_list_gadgets` (and any future
|
|
9
|
+
* Thrown by `ggui_list_gadgets` (and any future app-
|
|
10
10
|
* scoped app-discovery tool) when the caller supplies an explicit
|
|
11
11
|
* `appId` that does NOT match `ctx.appId` resolved by the upstream
|
|
12
|
-
* auth adapter. Cross-
|
|
12
|
+
* auth adapter. Cross-app probes get a uniform error so the
|
|
13
13
|
* existence of an alternate `appId` is not leaked.
|
|
14
14
|
*
|
|
15
15
|
* Recovery: omit `appId` to default to `ctx.appId`, or call from a
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* `appId` defaults to `ctx.appId` resolved by the upstream auth
|
|
15
15
|
* adapter.
|
|
16
16
|
* 2. When `appId` is supplied explicitly, asserts it matches
|
|
17
|
-
* `ctx.appId`; cross-
|
|
17
|
+
* `ctx.appId`; cross-app requests fail with
|
|
18
18
|
* {@link AppAccessDeniedError}.
|
|
19
19
|
* 3. Reads `app.gadgets` from the bound {@link AppMetadataStore}
|
|
20
20
|
* and resolves the effective catalog via `resolveAppGadgets`
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* `null` (app not registered — common for OSS sandbox apps that
|
|
23
23
|
* bypass an explicit register call) the resolution yields
|
|
24
24
|
* exactly `STDLIB_GADGETS`, so callers always get a meaningful
|
|
25
|
-
* catalog. This is a permitted-error path, not
|
|
25
|
+
* catalog. This is a permitted-error path, not an app-scope
|
|
26
26
|
* escape — `ctx.appId` was already proved by the auth adapter;
|
|
27
27
|
* the absence of a registry row just means the deployment runs
|
|
28
28
|
* default-seeded.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* `appId` defaults to `ctx.appId` resolved by the upstream auth
|
|
15
15
|
* adapter.
|
|
16
16
|
* 2. When `appId` is supplied explicitly, asserts it matches
|
|
17
|
-
* `ctx.appId`; cross-
|
|
17
|
+
* `ctx.appId`; cross-app requests fail with
|
|
18
18
|
* {@link AppAccessDeniedError}.
|
|
19
19
|
* 3. Reads `app.gadgets` from the bound {@link AppMetadataStore}
|
|
20
20
|
* and resolves the effective catalog via `resolveAppGadgets`
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* `null` (app not registered — common for OSS sandbox apps that
|
|
23
23
|
* bypass an explicit register call) the resolution yields
|
|
24
24
|
* exactly `STDLIB_GADGETS`, so callers always get a meaningful
|
|
25
|
-
* catalog. This is a permitted-error path, not
|
|
25
|
+
* catalog. This is a permitted-error path, not an app-scope
|
|
26
26
|
* escape — `ctx.appId` was already proved by the auth adapter;
|
|
27
27
|
* the absence of a registry row just means the deployment runs
|
|
28
28
|
* default-seeded.
|
|
@@ -50,7 +50,7 @@ const inputSchema = {
|
|
|
50
50
|
.string()
|
|
51
51
|
.min(1)
|
|
52
52
|
.optional()
|
|
53
|
-
.describe('The app id whose gadget catalog to return. Defaults to the caller-resolved app id from the auth header. Cross-
|
|
53
|
+
.describe('The app id whose gadget catalog to return. Defaults to the caller-resolved app id from the auth header. Cross-app requests fail with app_access_denied.'),
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
56
|
* Output wire schema for one catalog entry. The handler returns
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* ## Behavior
|
|
11
11
|
*
|
|
12
|
-
* 1. Validates input shape (`{appId?: string}`). Cross-
|
|
12
|
+
* 1. Validates input shape (`{appId?: string}`). Cross-app
|
|
13
13
|
* access protected the same way as `ggui_list_gadgets`.
|
|
14
14
|
* 2. Reads the global theme catalog via the bound `themes` dep
|
|
15
15
|
* (a `() => readonly ThemeCatalogEntry[]` resolver — keeps the
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* ## Behavior
|
|
11
11
|
*
|
|
12
|
-
* 1. Validates input shape (`{appId?: string}`). Cross-
|
|
12
|
+
* 1. Validates input shape (`{appId?: string}`). Cross-app
|
|
13
13
|
* access protected the same way as `ggui_list_gadgets`.
|
|
14
14
|
* 2. Reads the global theme catalog via the bound `themes` dep
|
|
15
15
|
* (a `() => readonly ThemeCatalogEntry[]` resolver — keeps the
|
|
@@ -31,7 +31,7 @@ const inputSchema = {
|
|
|
31
31
|
.string()
|
|
32
32
|
.min(1)
|
|
33
33
|
.optional()
|
|
34
|
-
.describe('App id whose theme catalog to return. Defaults to the caller-resolved app id from the auth header. Cross-
|
|
34
|
+
.describe('App id whose theme catalog to return. Defaults to the caller-resolved app id from the auth header. Cross-app requests fail with app_access_denied.'),
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
37
|
* Wire shape for a single theme entry. Mirrors `@ggui-ai/design`'s
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
*
|
|
12
12
|
* Identity scope: credit rows are keyed by USER identity, so the
|
|
13
13
|
* handler reads `ctx.userId` when the host's auth layer resolves a
|
|
14
|
-
* distinct per-user identity (multi-
|
|
14
|
+
* distinct per-user identity (multi-app hosts where `ctx.appId`
|
|
15
15
|
* names the caller's active app, not the caller), and falls back to
|
|
16
|
-
* `ctx.appId` for single-
|
|
16
|
+
* `ctx.appId` for single-app hosts whose auth adapter folds the
|
|
17
17
|
* user into the app slot (`appId = workspaceId ?? userId` — see
|
|
18
18
|
* `packages/mcp-server/src/auth.ts#defaultAppIdFromIdentity`).
|
|
19
19
|
* Reading `ctx.appId` alone silently returns the zero-row fallback
|
|
20
|
-
* for every multi-
|
|
20
|
+
* for every multi-app caller — an app id never keys a credit row.
|
|
21
21
|
* The tool is registered on every deployment kind; callers without a
|
|
22
22
|
* credit account (e.g. agent-builder identities) get the zero-row
|
|
23
23
|
* fallback.
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
*
|
|
12
12
|
* Identity scope: credit rows are keyed by USER identity, so the
|
|
13
13
|
* handler reads `ctx.userId` when the host's auth layer resolves a
|
|
14
|
-
* distinct per-user identity (multi-
|
|
14
|
+
* distinct per-user identity (multi-app hosts where `ctx.appId`
|
|
15
15
|
* names the caller's active app, not the caller), and falls back to
|
|
16
|
-
* `ctx.appId` for single-
|
|
16
|
+
* `ctx.appId` for single-app hosts whose auth adapter folds the
|
|
17
17
|
* user into the app slot (`appId = workspaceId ?? userId` — see
|
|
18
18
|
* `packages/mcp-server/src/auth.ts#defaultAppIdFromIdentity`).
|
|
19
19
|
* Reading `ctx.appId` alone silently returns the zero-row fallback
|
|
20
|
-
* for every multi-
|
|
20
|
+
* for every multi-app caller — an app id never keys a credit row.
|
|
21
21
|
* The tool is registered on every deployment kind; callers without a
|
|
22
22
|
* credit account (e.g. agent-builder identities) get the zero-row
|
|
23
23
|
* fallback.
|
|
@@ -43,13 +43,13 @@ export function createGetCreditBalanceHandler(deps) {
|
|
|
43
43
|
description: "Returns the calling user's prepaid Anthropic-pool credit balance. Surfaces balanceCents (current spendable), lifetimeGrantedCents (total received including the $5 welcome credit), and lifetimeSpentCents (cumulative charges). For non-Anthropic providers, configure a BYOK key at console.ggui.ai/keys/providers — credit doesn't apply. Composing blueprints in Claude Desktop bypasses credits entirely.",
|
|
44
44
|
inputSchema,
|
|
45
45
|
outputSchema,
|
|
46
|
-
// No `allowedFor` — same toolset on every
|
|
46
|
+
// No `allowedFor` — same toolset on every deployment kind. Callers
|
|
47
47
|
// without a credit account get the zero-row fallback below; no
|
|
48
48
|
// separate "tool not registered" UX needed.
|
|
49
49
|
async handler(_input, ctx) {
|
|
50
|
-
// USER identity first — on multi-
|
|
50
|
+
// USER identity first — on multi-app hosts `ctx.appId` is the
|
|
51
51
|
// caller's active app, which never keys a credit row (see the
|
|
52
|
-
// module docstring). Single-
|
|
52
|
+
// module docstring). Single-app hosts leave `ctx.userId`
|
|
53
53
|
// unset and fold the user into the app slot.
|
|
54
54
|
const userId = ctx.userId ?? ctx.appId;
|
|
55
55
|
if (!userId) {
|
|
@@ -12,15 +12,14 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Identity scope mirrors get-credit-balance: `ctx.userId` when the
|
|
14
14
|
* host resolves a distinct per-user identity, else `ctx.appId` (the
|
|
15
|
-
* single-
|
|
16
|
-
* `ctx.appId` alone loses every multi-
|
|
15
|
+
* single-app fold) — see that module's docstring for why reading
|
|
16
|
+
* `ctx.appId` alone loses every multi-app caller.
|
|
17
17
|
*/
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
/**
|
|
20
|
-
* Read-only seam for the credit-transaction ledger.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* this directly via raw DDB Query.
|
|
20
|
+
* Read-only seam for the credit-transaction ledger. A production deployment
|
|
21
|
+
* implements this against its own ledger store; tests use in-memory
|
|
22
|
+
* state.
|
|
24
23
|
*/
|
|
25
24
|
export interface CreditTransactionSource {
|
|
26
25
|
list(args: {
|
|
@@ -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
|
|
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,aAAa,GAAG,eAAe,GAAG,OAAO,GAAG,QAAQ,CAAC;IACpE,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;AAyBD,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;IA5BhC,2BAA2B;;IAE3B,kEAAkE;;;;;;;;;;;;;;;;;IAgBlE,oFAAoF;;;;;GAgDrF"}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Identity scope mirrors get-credit-balance: `ctx.userId` when the
|
|
14
14
|
* host resolves a distinct per-user identity, else `ctx.appId` (the
|
|
15
|
-
* single-
|
|
16
|
-
* `ctx.appId` alone loses every multi-
|
|
15
|
+
* single-app fold) — see that module's docstring for why reading
|
|
16
|
+
* `ctx.appId` alone loses every multi-app caller.
|
|
17
17
|
*/
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
import { defineHandler } from '../types.js';
|
|
@@ -44,11 +44,11 @@ export function createListCreditTransactionsHandler(deps) {
|
|
|
44
44
|
description: "Returns the calling user's credit transaction ledger, newest-first. Each row carries kind ('free_credit' | 'render_charge' | 'topup' | 'refund'), 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
45
|
inputSchema,
|
|
46
46
|
outputSchema,
|
|
47
|
-
// No `allowedFor` — same toolset on every
|
|
47
|
+
// No `allowedFor` — same toolset on every deployment kind. Callers
|
|
48
48
|
// without a credit account see an empty ledger.
|
|
49
49
|
async handler(rawInput, ctx) {
|
|
50
50
|
// USER identity first — `ctx.appId` is the active app on
|
|
51
|
-
// multi-
|
|
51
|
+
// multi-app hosts and never keys a ledger row (see
|
|
52
52
|
// get-credit-balance's module docstring).
|
|
53
53
|
const userId = ctx.userId ?? ctx.appId;
|
|
54
54
|
if (!userId) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* `ggui_ops_delete_app` — hard-delete an app record owned by the
|
|
3
3
|
* caller.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Ownership: cross-user probes return the success shape WITHOUT
|
|
6
6
|
* touching the row (uniform shape; no existence leak). Idempotent —
|
|
7
7
|
* a second delete of the same id resolves cleanly.
|
|
8
8
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* The check runs AFTER the ownership read. `getDefault(ownerSub)`
|
|
14
14
|
* only ever reads the caller's own row, so ordering is not what keeps
|
|
15
|
-
* another
|
|
15
|
+
* another owner's default secret — nothing here could read it under
|
|
16
16
|
* any ordering. What ordering buys is SHAPE UNIFORMITY in the one
|
|
17
17
|
* state where the two branches disagree: the caller's own default
|
|
18
18
|
* naming an app the caller does not own. Ownership first answers that
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* `ggui_ops_delete_app` — hard-delete an app record owned by the
|
|
3
3
|
* caller.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Ownership: cross-user probes return the success shape WITHOUT
|
|
6
6
|
* touching the row (uniform shape; no existence leak). Idempotent —
|
|
7
7
|
* a second delete of the same id resolves cleanly.
|
|
8
8
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* The check runs AFTER the ownership read. `getDefault(ownerSub)`
|
|
14
14
|
* only ever reads the caller's own row, so ordering is not what keeps
|
|
15
|
-
* another
|
|
15
|
+
* another owner's default secret — nothing here could read it under
|
|
16
16
|
* any ordering. What ordering buys is SHAPE UNIFORMITY in the one
|
|
17
17
|
* state where the two branches disagree: the caller's own default
|
|
18
18
|
* naming an app the caller does not own. Ownership first answers that
|
|
@@ -48,7 +48,7 @@ export function createDeleteAppHandler(deps) {
|
|
|
48
48
|
name: 'ggui_ops_delete_app',
|
|
49
49
|
title: 'Delete app',
|
|
50
50
|
audience: ['ops'],
|
|
51
|
-
description: "Hard-delete an app owned by the calling user. Removes the APP RECORD only — data other stores hold for that app (saved blueprints, per-app provider keys, marketplace installs, issued keys) is not removed by this call, and whether the deployment cleans it up separately is the deployment's own policy. Idempotent — a second delete returns `{deleted: true}`.
|
|
51
|
+
description: "Hard-delete an app owned by the calling user. Removes the APP RECORD only — data other stores hold for that app (saved blueprints, per-app provider keys, marketplace installs, issued keys) is not removed by this call, and whether the deployment cleans it up separately is the deployment's own policy. Idempotent — a second delete returns `{deleted: true}`. Probes at an app owned by another user return the same shape without touching foreign rows (no existence leak). Throws `default_app_delete_blocked` when the target is the caller's default app — set a different default first.",
|
|
52
52
|
inputSchema,
|
|
53
53
|
outputSchema,
|
|
54
54
|
async handler(rawInput, ctx) {
|
|
@@ -62,7 +62,7 @@ export function createDeleteAppHandler(deps) {
|
|
|
62
62
|
// Either the row doesn't exist or it lives under a different
|
|
63
63
|
// owner. Either way: return the success shape without
|
|
64
64
|
// touching the store. Uniform across "missing" and
|
|
65
|
-
// "cross-
|
|
65
|
+
// "cross-user" prevents id-existence leak.
|
|
66
66
|
return { deleted: true };
|
|
67
67
|
}
|
|
68
68
|
// AFTER the ownership read, so a caller whose own default names
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Per-call identity resolution for `ops-apps` handlers. The console
|
|
3
3
|
* surfaces these tools call against `kind: 'user'` identities — the
|
|
4
4
|
* upstream `AuthAdapter` populates `ctx.userId` directly. OSS
|
|
5
|
-
* single-
|
|
5
|
+
* single-app mode (where the auth adapter collapses `appId =
|
|
6
6
|
* workspaceId ?? userId`) leaves `ctx.userId` undefined and the same
|
|
7
7
|
* value sits on `ctx.appId`. Read whichever is set; fail when neither
|
|
8
8
|
* is.
|
package/dist/ops-apps/index.d.ts
CHANGED
|
@@ -21,8 +21,8 @@ export { createCreateAppHandler } from './create-app.js';
|
|
|
21
21
|
export type { CreateAppDeps, CreateAppOutput } from './create-app.js';
|
|
22
22
|
export { createUpdateAppHandler } from './update-app.js';
|
|
23
23
|
export type { UpdateAppDeps, UpdateAppOutput } from './update-app.js';
|
|
24
|
-
export { createSetAppThemeHandler } from './set-app-theme.js';
|
|
25
|
-
export type { SetAppThemeDeps, SetAppThemeOutput, } from './set-app-theme.js';
|
|
24
|
+
export { createSetAppThemeHandler, admitAppTheme } from './set-app-theme.js';
|
|
25
|
+
export type { SetAppThemeDeps, SetAppThemeOutput, OverlayCoverageValidator, AppThemeAdmission, } from './set-app-theme.js';
|
|
26
26
|
export { createDeleteAppHandler } from './delete-app.js';
|
|
27
27
|
export type { DeleteAppDeps, DeleteAppOutput } from './delete-app.js';
|
|
28
28
|
export { createSetDefaultAppHandler } from './set-default-app.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ops-apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,EACV,SAAS,EACT,UAAU,EACV,cAAc,EACd,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ops-apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,EACV,SAAS,EACT,UAAU,EACV,cAAc,EACd,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7E,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,YAAY,EACV,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC"}
|
package/dist/ops-apps/index.js
CHANGED
|
@@ -17,6 +17,6 @@ export { AppNotFoundError, DefaultAppDeleteBlockedError, OpsAppsAccessDeniedErro
|
|
|
17
17
|
export { createListAppsHandler } from './list-apps.js';
|
|
18
18
|
export { createCreateAppHandler } from './create-app.js';
|
|
19
19
|
export { createUpdateAppHandler } from './update-app.js';
|
|
20
|
-
export { createSetAppThemeHandler } from './set-app-theme.js';
|
|
20
|
+
export { createSetAppThemeHandler, admitAppTheme } from './set-app-theme.js';
|
|
21
21
|
export { createDeleteAppHandler } from './delete-app.js';
|
|
22
22
|
export { createSetDefaultAppHandler } from './set-default-app.js';
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* `ggui_ops_list_apps` — enumerate the calling user's `GguiApp` rows.
|
|
3
3
|
*
|
|
4
4
|
* Sibling of the console's Apps section (`apps/console/src/.../apps/`)
|
|
5
|
-
* — same data, MCP surface. Pure over the {@link AppsSource} seam;
|
|
6
|
-
*
|
|
5
|
+
* — same data, MCP surface. Pure over the {@link AppsSource} seam; a
|
|
6
|
+
* production deployment binds its own implementation, tests bind an
|
|
7
7
|
* in-memory Map.
|
|
8
8
|
*
|
|
9
9
|
* Identity scope: caller's Cognito sub from `ctx.userId` (or
|
|
10
|
-
* `ctx.appId` in OSS single-
|
|
10
|
+
* `ctx.appId` in OSS single-app mode). Cross-user list is impossible
|
|
11
11
|
* by construction — `AppsSource.list` only returns rows whose
|
|
12
12
|
* `ownerSub` matches.
|
|
13
13
|
*/
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* `ggui_ops_list_apps` — enumerate the calling user's `GguiApp` rows.
|
|
3
3
|
*
|
|
4
4
|
* Sibling of the console's Apps section (`apps/console/src/.../apps/`)
|
|
5
|
-
* — same data, MCP surface. Pure over the {@link AppsSource} seam;
|
|
6
|
-
*
|
|
5
|
+
* — same data, MCP surface. Pure over the {@link AppsSource} seam; a
|
|
6
|
+
* production deployment binds its own implementation, tests bind an
|
|
7
7
|
* in-memory Map.
|
|
8
8
|
*
|
|
9
9
|
* Identity scope: caller's Cognito sub from `ctx.userId` (or
|
|
10
|
-
* `ctx.appId` in OSS single-
|
|
10
|
+
* `ctx.appId` in OSS single-app mode). Cross-user list is impossible
|
|
11
11
|
* by construction — `AppsSource.list` only returns rows whose
|
|
12
12
|
* `ownerSub` matches.
|
|
13
13
|
*/
|