@deeprelay/mcp 0.1.2 → 0.2.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 CHANGED
@@ -4,10 +4,11 @@ This server connects Claude Code, Claude Desktop, Cursor, or any other
4
4
  [MCP](https://modelcontextprotocol.io) client straight to the deeprelay
5
5
  serverless inference API. The agent can browse models and their prices, run
6
6
  chat, embeddings, image and video generation inside a budget you approve, read
7
- your balance and usage, manage webhook endpoints, lower or clear your spending
8
- limit, and create checkout or billing links, all without leaving the editor.
7
+ your balance, usage and request log, manage webhook endpoints, lower or clear
8
+ your spending limit, change alert settings, and create checkout or billing
9
+ links, all without leaving the editor.
9
10
 
10
- **29 tools in three tiers: reads are free, writes confirm once, money tools
11
+ **33 tools in three tiers: reads are free, writes confirm once, money tools
11
12
  quote a price and require explicit confirmation.** The server enforces these
12
13
  rules, so they do not depend on the agent behaving well.
13
14
 
@@ -89,7 +90,7 @@ clear error on the first tool call. The key is never echoed in a result, an
89
90
  error or a confirmation prompt.
90
91
 
91
92
  **Use a dedicated key** for agent work, so you can revoke it on its own and see
92
- its usage separately. A `read_only` key covers all 17 free tools and cannot
93
+ its usage separately. A `read_only` key covers all 20 free tools and cannot
93
94
  write or spend. Checkout, the billing portal and spending-limit changes also
94
95
  need the org-admin role. **No key scope limits how much a key can spend.** Your
95
96
  organization's spending limit and the session budget below do.
@@ -98,8 +99,8 @@ organization's spending limit and the session budget below do.
98
99
 
99
100
  | Tier | Tools | What happens before it runs |
100
101
  | --- | --- | --- |
101
- | Free, read-only | 17 | Nothing. No confirmation, no charge, no change. |
102
- | Writes: single confirmation | 8 | One confirmation. The first call describes the change and returns a `confirmation_token`. The second call, with the same arguments plus the token, runs it. |
102
+ | Free, read-only | 20 | Nothing. No confirmation, no charge, no change. |
103
+ | Writes: single confirmation | 9 | One confirmation. The first call describes the change and returns a `confirmation_token`. The second call, with the same arguments plus the token, runs it. |
103
104
  | Money tools | 4 | A price. Priced from the catalog, then checked against the per-call ceiling and the session budget. |
104
105
 
105
106
  Tokens are single-use, expire after five minutes, and are bound to the exact
@@ -150,26 +151,30 @@ finishes, the reservation is dropped and the real charge appears in
150
151
  - `deeprelay_subscription_checkout`, `deeprelay_billing_portal` and
151
152
  `deeprelay_deposits_create_crypto` **only create links** (or a deposit
152
153
  address). They never charge. Nothing is paid until you complete the step
153
- yourself.
154
+ yourself. For the same reason there is **no upgrade tool**: moving to the
155
+ Plus plan charges the card on file immediately, so it happens only from the
156
+ billing page or `deeprelay billing upgrade`, never from inside a tool call.
154
157
  - `deeprelay_deposits_create_crypto` is listed only on accounts with crypto
155
158
  deposits enabled. It stays hidden at startup and appears once the account is
156
159
  shown to have the feature.
157
160
 
158
161
  ## Tools
159
162
 
160
- **Free, read-only (17):** `deeprelay_auth_status`, `deeprelay_health`,
163
+ **Free, read-only (20):** `deeprelay_auth_status`, `deeprelay_health`,
161
164
  `deeprelay_models_list`, `deeprelay_models_get`,
162
165
  `deeprelay_inference_preflight`, `deeprelay_usage_get`,
163
166
  `deeprelay_balance_get`, `deeprelay_spending_limit_get`,
164
167
  `deeprelay_subscription_get`, `deeprelay_deposits_list`,
165
168
  `deeprelay_deposits_get`, `deeprelay_referrals_get`,
166
169
  `deeprelay_webhooks_list`, `deeprelay_webhooks_get`, `deeprelay_videos_list`,
167
- `deeprelay_videos_get`, `deeprelay_videos_content`.
170
+ `deeprelay_videos_get`, `deeprelay_videos_content`,
171
+ `deeprelay_requests_list`, `deeprelay_requests_get`, `deeprelay_alerts_get`.
168
172
 
169
- **Writes: single confirmation (8):** `deeprelay_webhooks_create`,
173
+ **Writes: single confirmation (9):** `deeprelay_webhooks_create`,
170
174
  `deeprelay_webhooks_delete`, `deeprelay_spending_limit_update`,
171
175
  `deeprelay_spending_limit_clear`, `deeprelay_subscription_checkout`, `deeprelay_billing_portal`,
172
- `deeprelay_deposits_create_crypto`, `deeprelay_videos_cancel`.
176
+ `deeprelay_deposits_create_crypto`, `deeprelay_videos_cancel`,
177
+ `deeprelay_alerts_set`.
173
178
 
174
179
  **Money (4):** `deeprelay_chat_completion`, `deeprelay_embeddings_create`,
175
180
  `deeprelay_images_generate`, `deeprelay_videos_create`.
@@ -188,6 +193,23 @@ to a local file (under the system temp directory by default, or an absolute
188
193
  advertises `readOnlyHint: false` and `idempotentHint: false`; it still costs
189
194
  nothing and needs no confirmation.
190
195
 
196
+ Results use the API's own snake_case field names. `deeprelay_models_list` and
197
+ `deeprelay_models_get` return each model exactly as the API does, including
198
+ `name`, `tier`, `max_completion_tokens`, `reasoning_efforts` and the observed
199
+ `metrics` (median time to first token, tokens per second, success rate).
200
+
201
+ `deeprelay_chat_completion` takes `model`, `messages` and optional
202
+ `max_tokens` (or `max_completion_tokens`), `temperature`, `tools`,
203
+ `tool_choice`, `parallel_tool_calls`, `response_format` (JSON mode or a strict
204
+ JSON schema), `reasoning_effort` and `seed`. A reply that calls tools comes back
205
+ with `finish_reason: "tool_calls"`, `message.tool_calls` and `content: null`;
206
+ send the assistant message back with one `tool` message per call
207
+ (`tool_call_id` plus `content`) to continue. Tool definitions count toward the
208
+ quoted price. `deeprelay_requests_list` / `deeprelay_requests_get` read the
209
+ request log (90 days, never prompt or completion content), and
210
+ `deeprelay_alerts_get` / `deeprelay_alerts_set` read and change the alert
211
+ settings.
212
+
191
213
  Per-tool arguments and the full guide are at <https://deeprelay.ai/docs/mcp>.
192
214
 
193
215
  ## Support
@@ -20,10 +20,19 @@ export interface PricingLike {
20
20
  }
21
21
  /** Agent-supplied request parameters that the estimate depends on. */
22
22
  export interface EstimateParams {
23
- /** Chat: messages. Content may be a string or an array of `{ text }` parts. */
23
+ /**
24
+ * Chat: messages. Content may be a string, null, or an array of `{ text }`
25
+ * parts; an assistant message's tool_calls count as prompt text too.
26
+ */
24
27
  messages?: ReadonlyArray<{
25
28
  content?: unknown;
29
+ tool_calls?: unknown;
26
30
  } | string>;
31
+ /**
32
+ * Chat: request parts the model reads as prompt besides the messages (tool
33
+ * definitions, a response_format JSON schema). Counted by their JSON length.
34
+ */
35
+ promptExtras?: ReadonlyArray<unknown>;
27
36
  /** Chat: the completion bound. Defaults to DEFAULT_MAX_TOKENS. */
28
37
  maxTokens?: number;
29
38
  /** Embeddings: input string(s). */
@@ -69,10 +69,20 @@ function textOf(content) {
69
69
  }
70
70
  return "";
71
71
  }
72
+ function jsonText(v) {
73
+ if (v === undefined || v === null)
74
+ return "";
75
+ try {
76
+ return JSON.stringify(v) ?? "";
77
+ }
78
+ catch {
79
+ return "";
80
+ }
81
+ }
72
82
  function messageTexts(messages) {
73
83
  if (!messages)
74
84
  return [];
75
- return messages.map((m) => (typeof m === "string" ? m : textOf(m?.content)));
85
+ return messages.map((m) => typeof m === "string" ? m : textOf(m?.content) + (m?.tool_calls === undefined ? "" : jsonText(m.tool_calls)));
76
86
  }
77
87
  function inputTexts(input) {
78
88
  if (input === undefined)
@@ -124,7 +134,10 @@ function videoRaw(seconds, pricing) {
124
134
  function estimateMicroCents(modality, params, pricing) {
125
135
  switch (modality) {
126
136
  case "chat": {
127
- const promptTokens = estimatePromptTokens(messageTexts(params.messages));
137
+ const promptTokens = estimatePromptTokens([
138
+ ...messageTexts(params.messages),
139
+ ...(params.promptExtras ?? []).map(jsonText),
140
+ ]);
128
141
  const maxTokens = positiveCount(params.maxTokens, exports.DEFAULT_MAX_TOKENS);
129
142
  return {
130
143
  microCents: (0, budget_js_1.billedMicroCents)(tokenMicroCents(promptTokens, pricing.inputPer1mTokensCents) +
@@ -1 +1 @@
1
- {"version":3,"file":"estimate.js","sourceRoot":"","sources":["../../src/guardrail/estimate.ts"],"names":[],"mappings":";;;AA+FA,oDAOC;AA2BD,gCAMC;AAkBD,oCAEC;AAgBD,gDAsCC;AAyBD,4CAgCC;AA1QD,+EAA+E;AAC/E,yBAAyB;AACzB,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,iFAAiF;AACjF,kBAAkB;AAClB,EAAE;AACF,gFAAgF;AAChF,iCAAiC;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,CAAC,YAAY,CAAC;gBAAE,OAAO,QAAQ,CAAC;YAC9C,OAAO,IAAA,4BAAgB,EAAC,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAC9F,KAAK,OAAO;YACV,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC;gBAAE,OAAO,QAAQ,CAAC;YAC5C,OAAO,IAAA,4BAAgB,EAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,KAAK,OAAO;YACV,IAAI,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC;gBAAE,OAAO,IAAA,4BAAgB,EAAC,KAAK,CAAC,SAAS,GAAG,gCAAoB,CAAC,CAAC;YAC1F,yEAAyE;YACzE,0CAA0C;YAC1C,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;gBAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;gBACpE,IAAI,GAAG,GAAG,CAAC;oBAAE,OAAO,IAAA,4BAAgB,EAAC,GAAG,CAAC,CAAC;YAC5C,CAAC;YACD,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC"}
package/dist/roster.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  export declare const TOOL_PREFIX = "deeprelay_";
2
2
  /** Free, non-mutating reads. No confirmation. Every route is a GET. */
3
- export declare const READ_TOOLS: readonly ["deeprelay_auth_status", "deeprelay_health", "deeprelay_models_list", "deeprelay_models_get", "deeprelay_inference_preflight", "deeprelay_usage_get", "deeprelay_balance_get", "deeprelay_spending_limit_get", "deeprelay_subscription_get", "deeprelay_deposits_list", "deeprelay_deposits_get", "deeprelay_referrals_get", "deeprelay_webhooks_list", "deeprelay_webhooks_get", "deeprelay_videos_list", "deeprelay_videos_get", "deeprelay_videos_content"];
3
+ export declare const READ_TOOLS: readonly ["deeprelay_auth_status", "deeprelay_health", "deeprelay_models_list", "deeprelay_models_get", "deeprelay_inference_preflight", "deeprelay_usage_get", "deeprelay_balance_get", "deeprelay_spending_limit_get", "deeprelay_subscription_get", "deeprelay_deposits_list", "deeprelay_deposits_get", "deeprelay_referrals_get", "deeprelay_webhooks_list", "deeprelay_webhooks_get", "deeprelay_videos_list", "deeprelay_videos_get", "deeprelay_videos_content", "deeprelay_requests_list", "deeprelay_requests_get", "deeprelay_alerts_get"];
4
4
  /**
5
5
  * Mutations that do not charge the account directly. Each one asks for
6
6
  * confirmation once. Payment-link tools are here with no quote (D-09), because
7
7
  * nothing is charged until the user acts on the link.
8
8
  */
9
- export declare const WRITE_TOOLS: readonly ["deeprelay_webhooks_create", "deeprelay_webhooks_delete", "deeprelay_spending_limit_update", "deeprelay_spending_limit_clear", "deeprelay_subscription_checkout", "deeprelay_billing_portal", "deeprelay_deposits_create_crypto", "deeprelay_videos_cancel"];
9
+ export declare const WRITE_TOOLS: readonly ["deeprelay_webhooks_create", "deeprelay_webhooks_delete", "deeprelay_spending_limit_update", "deeprelay_spending_limit_clear", "deeprelay_subscription_checkout", "deeprelay_billing_portal", "deeprelay_deposits_create_crypto", "deeprelay_videos_cancel", "deeprelay_alerts_set"];
10
10
  /** Billable inference. Each call goes quote → session budget → confirm (D-06..D-08, D-10). */
11
11
  export declare const SPEND_TOOLS: readonly ["deeprelay_chat_completion", "deeprelay_embeddings_create", "deeprelay_images_generate", "deeprelay_videos_create"];
12
- export declare const ALL_TOOLS: readonly ["deeprelay_auth_status", "deeprelay_health", "deeprelay_models_list", "deeprelay_models_get", "deeprelay_inference_preflight", "deeprelay_usage_get", "deeprelay_balance_get", "deeprelay_spending_limit_get", "deeprelay_subscription_get", "deeprelay_deposits_list", "deeprelay_deposits_get", "deeprelay_referrals_get", "deeprelay_webhooks_list", "deeprelay_webhooks_get", "deeprelay_videos_list", "deeprelay_videos_get", "deeprelay_videos_content", "deeprelay_webhooks_create", "deeprelay_webhooks_delete", "deeprelay_spending_limit_update", "deeprelay_spending_limit_clear", "deeprelay_subscription_checkout", "deeprelay_billing_portal", "deeprelay_deposits_create_crypto", "deeprelay_videos_cancel", "deeprelay_chat_completion", "deeprelay_embeddings_create", "deeprelay_images_generate", "deeprelay_videos_create"];
12
+ export declare const ALL_TOOLS: readonly ["deeprelay_auth_status", "deeprelay_health", "deeprelay_models_list", "deeprelay_models_get", "deeprelay_inference_preflight", "deeprelay_usage_get", "deeprelay_balance_get", "deeprelay_spending_limit_get", "deeprelay_subscription_get", "deeprelay_deposits_list", "deeprelay_deposits_get", "deeprelay_referrals_get", "deeprelay_webhooks_list", "deeprelay_webhooks_get", "deeprelay_videos_list", "deeprelay_videos_get", "deeprelay_videos_content", "deeprelay_requests_list", "deeprelay_requests_get", "deeprelay_alerts_get", "deeprelay_webhooks_create", "deeprelay_webhooks_delete", "deeprelay_spending_limit_update", "deeprelay_spending_limit_clear", "deeprelay_subscription_checkout", "deeprelay_billing_portal", "deeprelay_deposits_create_crypto", "deeprelay_videos_cancel", "deeprelay_alerts_set", "deeprelay_chat_completion", "deeprelay_embeddings_create", "deeprelay_images_generate", "deeprelay_videos_create"];
13
13
  export type ReadToolName = (typeof READ_TOOLS)[number];
14
14
  export type WriteToolName = (typeof WRITE_TOOLS)[number];
15
15
  export type SpendToolName = (typeof SPEND_TOOLS)[number];
package/dist/roster.js CHANGED
@@ -29,6 +29,11 @@
29
29
  // @deeprelay/sdk@0.2.0, exposes BillingApi.deleteSpendingLimit
30
30
  // (DELETE /billing/spending-limit). It is a WRITE because it removes a safety
31
31
  // cap: it confirms once, and requires the org-admin role server-side.
32
+ // Phase 111 (R-08, D-15) adds tools 30-33: deeprelay_requests_list,
33
+ // deeprelay_requests_get and deeprelay_alerts_get (READ) and
34
+ // deeprelay_alerts_set (WRITE, confirms once, org-admin server-side), served
35
+ // by @deeprelay/sdk RequestsApi / AlertsApi since the 0.3.0 pin.
36
+ // /api-keys* is excluded on purpose.
32
37
  Object.defineProperty(exports, "__esModule", { value: true });
33
38
  exports.EXCLUDED_PATHS = exports.TOOL_ROUTES = exports.ALL_TOOLS = exports.SPEND_TOOLS = exports.WRITE_TOOLS = exports.READ_TOOLS = exports.TOOL_PREFIX = void 0;
34
39
  exports.TOOL_PREFIX = "deeprelay_";
@@ -51,6 +56,10 @@ exports.READ_TOOLS = [
51
56
  "deeprelay_videos_list",
52
57
  "deeprelay_videos_get",
53
58
  "deeprelay_videos_content",
59
+ // Phase 111 (R-08): the request log and the alert settings.
60
+ "deeprelay_requests_list",
61
+ "deeprelay_requests_get",
62
+ "deeprelay_alerts_get",
54
63
  ];
55
64
  /**
56
65
  * Mutations that do not charge the account directly. Each one asks for
@@ -66,6 +75,7 @@ exports.WRITE_TOOLS = [
66
75
  "deeprelay_billing_portal",
67
76
  "deeprelay_deposits_create_crypto",
68
77
  "deeprelay_videos_cancel",
78
+ "deeprelay_alerts_set",
69
79
  ];
70
80
  /** Billable inference. Each call goes quote → session budget → confirm (D-06..D-08, D-10). */
71
81
  exports.SPEND_TOOLS = [
@@ -99,6 +109,9 @@ exports.TOOL_ROUTES = {
99
109
  deeprelay_videos_list: { method: "GET", path: "/videos" },
100
110
  deeprelay_videos_get: { method: "GET", path: "/videos/{id}" },
101
111
  deeprelay_videos_content: { method: "GET", path: "/videos/{id}/content" },
112
+ deeprelay_requests_list: { method: "GET", path: "/requests" },
113
+ deeprelay_requests_get: { method: "GET", path: "/requests/{id}" },
114
+ deeprelay_alerts_get: { method: "GET", path: "/alerts/settings" },
102
115
  // WRITE
103
116
  deeprelay_webhooks_create: { method: "POST", path: "/webhook-endpoints" },
104
117
  deeprelay_webhooks_delete: { method: "DELETE", path: "/webhook-endpoints/{id}" },
@@ -108,6 +121,7 @@ exports.TOOL_ROUTES = {
108
121
  deeprelay_billing_portal: { method: "POST", path: "/billing/subscription/portal" },
109
122
  deeprelay_deposits_create_crypto: { method: "POST", path: "/billing/deposits/crypto" },
110
123
  deeprelay_videos_cancel: { method: "POST", path: "/videos/{id}/cancel" },
124
+ deeprelay_alerts_set: { method: "PUT", path: "/alerts/settings" },
111
125
  // SPEND
112
126
  deeprelay_chat_completion: { method: "POST", path: "/chat/completions" },
113
127
  deeprelay_embeddings_create: { method: "POST", path: "/embeddings" },
@@ -121,6 +135,63 @@ exports.TOOL_ROUTES = {
121
135
  */
122
136
  exports.EXCLUDED_PATHS = {
123
137
  "/openapi.json": "spec download, not an agent capability (D-05)",
138
+ // Phase 105: the Anthropic Messages protocol for Claude Code and Anthropic
139
+ // SDK clients. chat_completion already covers inference for an agent; these
140
+ // are a wire-protocol twin, not a new capability.
141
+ "/messages": "Anthropic Messages protocol twin of chat completions, for Claude Code and Anthropic SDK clients (Phase 105)",
142
+ "/messages/count_tokens": "local, unbilled token estimate for Anthropic Messages clients (Phase 105)",
143
+ // Phase 106: the OpenAI Responses protocol for the Codex CLI. Same reasoning
144
+ // as /messages: a wire-protocol twin of chat completions, not a new agent
145
+ // capability. The four sub-routes and /responses/compact only ever return a
146
+ // documented stateless/compaction error.
147
+ "/responses": "OpenAI Responses protocol twin of chat completions, for the Codex CLI (Phase 106)",
148
+ "/responses/{id}": "stateless: always 404 `stateless`, deeprelay stores no responses (Phase 106)",
149
+ "/responses/{id}/cancel": "stateless: always 404 `stateless`, deeprelay stores no responses (Phase 106)",
150
+ "/responses/{id}/input_items": "stateless: always 404 `stateless`, deeprelay stores no responses (Phase 106)",
151
+ "/responses/compact": "always 400 `compaction_unsupported`; Codex compacts client-side (Phase 106)",
152
+ // Plus tier (2026-10-07): the upgrade endpoint CHARGES THE CARD ON FILE
153
+ // directly (full new price now, new period now). The MCP's payment surface
154
+ // is link-only (D-09): checkout and the portal mint a page the human
155
+ // completes, and nothing is paid from inside a tool call. An agent that
156
+ // wants a bigger plan sends the human to the billing page or
157
+ // `deeprelay billing upgrade`.
158
+ "/billing/subscription/upgrade": "charges the card on file directly; the MCP payment surface is link-only (D-09) — upgrade from the console or `deeprelay billing upgrade`",
159
+ // Payment methods and in-app plan management (dark-launched on demo):
160
+ // payment instruments and money/plan actions stay out of agent reach, like
161
+ // upgrade (D-09). Console Billing → Payment methods, or the CLI.
162
+ "/billing/payment-methods": "lists the org's payment instruments; admin-only and out of agent reach (D-09) — console or `deeprelay billing payment-methods`",
163
+ "/billing/payment-methods/setup": "adds a payment method; the MCP payment surface is link-only (D-09) — console or `deeprelay billing payment-methods add`",
164
+ "/billing/payment-methods/default": "changes which method auto-pay charges (D-09) — console or `deeprelay billing payment-methods set --auto-pay`",
165
+ "/billing/payment-methods/{id}": "removes a payment method and can cancel the plan (D-09) — console or `deeprelay billing payment-methods remove`",
166
+ "/billing/subscription/payment-method": "changes the plan's renewal method and retries a failed renewal, a charge (D-09) — console or `deeprelay billing payment-methods set --plan`",
167
+ "/billing/subscription/cancel": "cancels the plan (D-09) — console or `deeprelay billing cancel`",
168
+ "/billing/subscription/resume": "resumes a cancelling plan (D-09) — console or `deeprelay billing resume`",
169
+ // Phase 111 (R-08). The CSV export is a file download; an agent reads the
170
+ // same rows through deeprelay_requests_list. Key management stays out of
171
+ // agent reach entirely: an agent that can mint, widen or revoke keys is
172
+ // exactly what the keys:manage capability guards against.
173
+ "/requests/export": "file download; agents use deeprelay_requests_list (Phase 111)",
174
+ "/api-keys": "agent key management is what keys:manage guards against (R-08)",
175
+ "/api-keys/{id}": "agent key management is what keys:manage guards against (R-08)",
176
+ // Dedicated endpoints. These are marked `x-dark-launch: true` rather than
177
+ // `x-gpu-supply-paused`, and this audit's scanner only treats the latter as
178
+ // leaving its domain, so a dark path arrives here as an UNPAUSED path with
179
+ // no tool and has to be declined explicitly. That is the right shape: the
180
+ // routes exist only when DEDICATED_ENDPOINTS_ENABLED is on, which is
181
+ // nowhere, so a tool for them would be a tool whose every call 404s, and
182
+ // the replicas they provision are hourly GPU instances an agent must not be
183
+ // able to rent unattended. When the flag flips, whoever removes the marker
184
+ // meets these two entries and decides deliberately whether a tool is
185
+ // wanted, which is exactly what the mapped-or-excluded contract is for.
186
+ "/endpoints": "dark-launched (DEDICATED_ENDPOINTS_ENABLED is off everywhere); creating one rents hourly GPU replicas, which is not agent-unattended spend authority",
187
+ "/endpoints/{id}": "dark-launched (DEDICATED_ENDPOINTS_ENABLED is off everywhere); read, scale and delete follow the create exclusion above",
188
+ "/deployments": "dark-launched (the product is unpublished); creating one rents dedicated GPUs billed per second, which is not agent-unattended spend authority",
189
+ "/deployments/hardware": "dark-launched; the hardware list only feeds the create above",
190
+ "/deployments/{id}": "dark-launched; read, scale and delete follow the create exclusion above",
191
+ "/deployments/{id}/stop": "dark-launched; follows the create exclusion above",
192
+ "/deployments/{id}/start": "dark-launched; starting resumes paid GPUs, which follows the create exclusion above",
193
+ "/deployments/{id}/events": "dark-launched; follows the create exclusion above",
194
+ "/deployments/{id}/metrics": "dark-launched; follows the create exclusion above",
124
195
  // /operations/{id} was listed here while it was still an UNPAUSED path with
125
196
  // no tool. Phase 103 D-08 landed the x-gpu-supply-paused marker, so it is no
126
197
  // longer unpaused and an exclusion entry for it would now fail the audit's
@@ -1 +1 @@
1
- {"version":3,"file":"roster.js","sourceRoot":"","sources":["../src/roster.ts"],"names":[],"mappings":";AAAA,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,iFAAiF;AACjF,+EAA+E;AAC/E,uBAAuB;AACvB,EAAE;AACF,2BAA2B;AAC3B,gFAAgF;AAChF,6EAA6E;AAC7E,uBAAuB;AACvB,uEAAuE;AACvE,4EAA4E;AAC5E,+EAA+E;AAC/E,8EAA8E;AAC9E,sEAAsE;AACtE,mEAAmE;AACnE,kFAAkF;AAClF,0EAA0E;AAC1E,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,yEAAyE;AACzE,EAAE;AACF,gFAAgF;AAChF,kEAAkE;AAClE,+EAA+E;AAC/E,+DAA+D;AAC/D,8EAA8E;AAC9E,s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C5E,oEAAoE;CACrE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ApiResponse } from "@deeprelay/sdk";
2
+ /** Await a *Raw SDK call and decode its JSON body without the SDK's model mapping. */
3
+ export declare function apiJson(call: Promise<ApiResponse<unknown>>): Promise<unknown>;
4
+ /** apiJson for an endpoint that answers with a JSON object (for spreading into a view). */
5
+ export declare function apiObject(call: Promise<ApiResponse<unknown>>): Promise<Record<string, unknown>>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.apiJson = apiJson;
4
+ exports.apiObject = apiObject;
5
+ /** Await a *Raw SDK call and decode its JSON body without the SDK's model mapping. */
6
+ async function apiJson(call) {
7
+ const response = await call;
8
+ return (await response.raw.json());
9
+ }
10
+ /** apiJson for an endpoint that answers with a JSON object (for spreading into a view). */
11
+ async function apiObject(call) {
12
+ const body = await apiJson(call);
13
+ return typeof body === "object" && body !== null && !Array.isArray(body) ? body : {};
14
+ }
15
+ //# sourceMappingURL=api-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-json.js","sourceRoot":"","sources":["../../src/tools/api-json.ts"],"names":[],"mappings":";;AAuBA,0BAGC;AAGD,8BAGC;AAVD,sFAAsF;AAC/E,KAAK,UAAU,OAAO,CAAC,IAAmC;IAC/D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC;IAC5B,OAAO,CAAC,MAAM,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAY,CAAC;AAChD,CAAC;AAED,2FAA2F;AACpF,KAAK,UAAU,SAAS,CAAC,IAAmC;IACjE,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,IAAgC,CAAC,CAAC,CAAC,EAAE,CAAC;AACpH,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type Configuration } from "@deeprelay/sdk";
2
+ import { z } from "zod";
3
+ export declare const alertEmailTogglesSchema: z.ZodObject<{
4
+ balance_low: z.ZodBoolean;
5
+ subscription_quota: z.ZodBoolean;
6
+ api_key_budget: z.ZodBoolean;
7
+ member_spend: z.ZodBoolean;
8
+ }, z.core.$strip>;
9
+ /** The settings view. Closed: unknown fields are dropped. */
10
+ export declare const alertSettingsSchema: z.ZodObject<{
11
+ balance_threshold_cents: z.ZodNumber;
12
+ email: z.ZodObject<{
13
+ balance_low: z.ZodBoolean;
14
+ subscription_quota: z.ZodBoolean;
15
+ api_key_budget: z.ZodBoolean;
16
+ member_spend: z.ZodBoolean;
17
+ }, z.core.$strip>;
18
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
+ note: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export type AlertSettings = z.infer<typeof alertSettingsSchema>;
22
+ /** GET /alerts/settings, parsed. */
23
+ export declare function getAlertSettings(config: Configuration): Promise<AlertSettings>;
24
+ /** The view the agent sees: the API fields plus the threshold in dollars. */
25
+ export declare function alertSettingsView(s: AlertSettings): Record<string, unknown>;
26
+ export declare const alertReadTools: import("../types.js").ToolDefinition[];
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.alertReadTools = exports.alertSettingsSchema = exports.alertEmailTogglesSchema = void 0;
4
+ exports.getAlertSettings = getAlertSettings;
5
+ exports.alertSettingsView = alertSettingsView;
6
+ // deeprelay_alerts_get: the organization's alert settings (Phase 111, D-13,
7
+ // D-15). Transport: @deeprelay/sdk AlertsApi, with the body parsed by the
8
+ // closed zod schema below (see tools/api-json.ts).
9
+ //
10
+ // The write half (deeprelay_alerts_set) lives in tools/write/alerts.ts and
11
+ // reuses getAlertSettings/alertSettingsSchema from here.
12
+ const sdk_1 = require("@deeprelay/sdk");
13
+ const zod_1 = require("zod");
14
+ const api_json_js_1 = require("../api-json.js");
15
+ const define_js_1 = require("./define.js");
16
+ exports.alertEmailTogglesSchema = zod_1.z.object({
17
+ balance_low: zod_1.z.boolean(),
18
+ subscription_quota: zod_1.z.boolean(),
19
+ api_key_budget: zod_1.z.boolean(),
20
+ member_spend: zod_1.z.boolean(),
21
+ });
22
+ /** The settings view. Closed: unknown fields are dropped. */
23
+ exports.alertSettingsSchema = zod_1.z.object({
24
+ balance_threshold_cents: zod_1.z.number().int(),
25
+ email: exports.alertEmailTogglesSchema,
26
+ updated_at: zod_1.z.string().nullable().optional(),
27
+ note: zod_1.z.string().optional(),
28
+ });
29
+ /** GET /alerts/settings, parsed. */
30
+ async function getAlertSettings(config) {
31
+ return exports.alertSettingsSchema.parse(await (0, api_json_js_1.apiJson)(new sdk_1.AlertsApi(config).getAlertSettingsRaw()));
32
+ }
33
+ /** The view the agent sees: the API fields plus the threshold in dollars. */
34
+ function alertSettingsView(s) {
35
+ return {
36
+ balance_threshold_cents: s.balance_threshold_cents,
37
+ balance_threshold_dollars: `$${(s.balance_threshold_cents / 100).toFixed(2)}`,
38
+ email: s.email,
39
+ updated_at: s.updated_at ?? null,
40
+ ...(s.note === undefined ? {} : { note: s.note }),
41
+ };
42
+ }
43
+ exports.alertReadTools = [
44
+ (0, define_js_1.defineTool)({
45
+ name: "deeprelay_alerts_get",
46
+ title: "Get the deeprelay alert settings",
47
+ description: "Get the organization's alert settings: the low-balance threshold, and which governance alerts are emailed " +
48
+ "to org admins (balance_low, subscription_quota, api_key_budget, member_spend). updated_at is null until the " +
49
+ "organization saves its settings once. Change them with deeprelay_alerts_set. Free: charges nothing and needs " +
50
+ "no confirmation.",
51
+ inputSchema: {},
52
+ context: "getting the alert settings",
53
+ async call(_args, config) {
54
+ return alertSettingsView(await getAlertSettings(config));
55
+ },
56
+ }),
57
+ ];
58
+ //# sourceMappingURL=alerts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../../src/tools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E,CAAC,CAAC,UAAU,IAAI,IAAI;QAChC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC;AAEY,QAAA,cAAc,GAAG;IAC5B,IAAA,sBAAU,EAAC;QACT,IAAI,EAAE,sBAAsB;QAC5B,KAAK,EAAE,kCAAkC;QACzC,WAAW,EACT,4GAA4G;YAC5G,8GAA8G;YAC9G,+GAA+G;YAC/G,kBAAkB;QACpB,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,4BAA4B;QACrC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM;YACtB,OAAO,iBAAiB,CAAC,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3D,CAAC;KACF,CAAC;CACH,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import type { ToolDefinition } from "../types.js";
2
2
  export { defineTool, LOCAL_WRITE_READ_ANNOTATIONS, READ_ANNOTATIONS } from "./define.js";
3
3
  export { observeVideoJob, VIDEO_TMP_DIR, videoReadTools } from "./video-reads.js";
4
+ export { alertReadTools } from "./alerts.js";
5
+ export { requestReadTools } from "./requests.js";
4
6
  /** The in-process session budget (D-06/D-08), in dollars, with pending video holds. */
5
7
  export declare function renderSessionBudget(): Record<string, unknown>;
6
8
  /** The full read tier. Every name in roster READ_TOOLS appears here exactly once. */