deepspace 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cli.js +149 -68
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +53 -1
- package/dist/server.js +86 -1
- package/dist/server.js.map +1 -1
- package/dist/worker.d.ts +53 -1
- package/dist/worker.js +86 -1
- package/dist/worker.js.map +1 -1
- package/features/ai-chat/src/ChatPanel.tsx +14 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# deepspace
|
|
2
2
|
|
|
3
|
+
## 0.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- RecordRoom now gates its HTTP debug API (`/api/debug/*`) behind `ALLOW_DEBUG_ROUTES` at the Durable Object's own ingress, matching the app-worker proxy gate. Enforcement lives at the one place every caller funnels through, so it can no longer be bypassed by a caller that forgets to gate. The platform's shared-data rooms hard-disable the debug API entirely. No change for apps that already gate via the proxy.
|
|
8
|
+
- Refresh the AI chat model lineup to the current generation. ChatPanel's default picker and the scaffolded starter's `ALLOWED_MODELS` now offer Claude Sonnet 5 (new default), Claude Opus 4.8, Claude Haiku 4.5, and the GPT-5.6 family (Sol / Terra / Luna) alongside GPT-OSS 120B; the retired-generation entries (Sonnet 4.6, Opus 4.7, the GPT-5.4 picker rows) are dropped from the picker, while their ids stay server-allowlisted. The scaffolded chat route now sends `reasoningEffort: 'none'` for OpenAI models — GPT-5.6 on /v1/chat/completions rejects function tools otherwise ("Function tools with reasoning_effort are not supported"). Apps scaffolded before this release that upgrade `deepspace` must add the new model ids to their `ALLOWED_MODELS` in `src/ai/chat-routes.ts` AND add the same `providerOptions: { openai: { reasoningEffort: 'none' } }` to their `streamText` call for OpenAI models (or pass their own `models` prop to `ChatPanel`) — otherwise the picker's new ids are rejected with a 400 by design, and GPT-5.6 turns with tools error.
|
|
9
|
+
- Add `BaseRoom.disconnectAllSockets({ code?, reason? })` and a built-in internal
|
|
10
|
+
`POST /internal/disconnect-sockets` endpoint (every room type, `RecordRoom`
|
|
11
|
+
included). Use it after an out-of-band, server-side write (admin import,
|
|
12
|
+
migration script, cron, server action) to close every live WebSocket (default
|
|
13
|
+
close 1012 / `state-refresh`) so clients reconnect and fully resync — no more
|
|
14
|
+
stale editors autosaving over server-side writes. Internal-only: reachable via
|
|
15
|
+
DO stub fetch from the app worker, same trust model as `/api/tools/execute`.
|
|
16
|
+
The client already reconnects and re-subscribes on any close, so `useQuery`
|
|
17
|
+
consumers get fresh data automatically.
|
|
18
|
+
- Add `deepspace usage` — credit balance, quota headroom (per-bucket breakdown with renewal/expiry dates), and per-integration spend for the last 30 days, from the platform's billing ledger. `--json` emits the raw summary for scripts and agents. Previously the only balance surface was the web dashboard, which agents driving `deepspace invoke` can't read.
|
|
19
|
+
|
|
3
20
|
## 0.6.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/cli/cli.ts
|
|
4
|
-
import { defineCommand as
|
|
4
|
+
import { defineCommand as defineCommand23, runMain } from "citty";
|
|
5
5
|
import { spawnSync as spawnSync6 } from "child_process";
|
|
6
6
|
import { readFileSync as readFileSync17, existsSync as existsSync15 } from "fs";
|
|
7
7
|
import { dirname as dirname5, join as join16 } from "path";
|
|
@@ -3822,8 +3822,88 @@ var apps_default = defineCommand11({
|
|
|
3822
3822
|
}
|
|
3823
3823
|
});
|
|
3824
3824
|
|
|
3825
|
-
// src/cli/commands/
|
|
3825
|
+
// src/cli/commands/usage.ts
|
|
3826
3826
|
import { defineCommand as defineCommand12 } from "citty";
|
|
3827
|
+
var API_URL3 = process.env.DEEPSPACE_API_URL ?? PLATFORM_URLS.api;
|
|
3828
|
+
function formatCredits(value) {
|
|
3829
|
+
if (value > 0 && value < 1) return "<1";
|
|
3830
|
+
if (value < 10) return value.toFixed(1).replace(/\.0$/, "");
|
|
3831
|
+
return Math.round(value).toLocaleString("en-US");
|
|
3832
|
+
}
|
|
3833
|
+
function formatUsd(value) {
|
|
3834
|
+
return `$${Math.abs(value) >= 0.01 || value === 0 ? value.toFixed(2) : value.toFixed(4)}`;
|
|
3835
|
+
}
|
|
3836
|
+
function formatDate(iso) {
|
|
3837
|
+
return new Date(iso).toLocaleDateString("en-US", {
|
|
3838
|
+
month: "short",
|
|
3839
|
+
day: "numeric",
|
|
3840
|
+
year: "numeric",
|
|
3841
|
+
timeZone: "UTC"
|
|
3842
|
+
});
|
|
3843
|
+
}
|
|
3844
|
+
function renderSummary(summary) {
|
|
3845
|
+
const { credits, usageByIntegration } = summary;
|
|
3846
|
+
const lines = [];
|
|
3847
|
+
const renews = credits.subscription.renewsAt ? ` \xB7 renews ${formatDate(credits.subscription.renewsAt)}` : "";
|
|
3848
|
+
lines.push(`Plan: ${credits.subscription.tier}${renews}`);
|
|
3849
|
+
lines.push(
|
|
3850
|
+
`Credits: ${formatCredits(credits.credits)} of ${formatCredits(credits.totalAllocation)} remaining (100 credits = $1)`
|
|
3851
|
+
);
|
|
3852
|
+
const bonusActive = credits.bonus.allocation > 0 || credits.bonus.expired;
|
|
3853
|
+
const purchasedActive = credits.purchased.allocation > 0 || credits.purchased.used > 0;
|
|
3854
|
+
if (bonusActive || purchasedActive) {
|
|
3855
|
+
const bucket = (b) => `${formatCredits(b.remaining)} of ${formatCredits(b.allocation)} remaining`;
|
|
3856
|
+
lines.push(` Subscription: ${bucket(credits.subscription)}`);
|
|
3857
|
+
if (bonusActive) {
|
|
3858
|
+
const expires = credits.bonus.expiresAt ? ` \xB7 expires ${formatDate(credits.bonus.expiresAt)}` : "";
|
|
3859
|
+
lines.push(
|
|
3860
|
+
` Bonus: ${credits.bonus.expired ? "expired" : bucket(credits.bonus) + expires}`
|
|
3861
|
+
);
|
|
3862
|
+
}
|
|
3863
|
+
if (purchasedActive) {
|
|
3864
|
+
lines.push(` Purchased: ${bucket(credits.purchased)}`);
|
|
3865
|
+
}
|
|
3866
|
+
}
|
|
3867
|
+
lines.push("");
|
|
3868
|
+
if (!usageByIntegration.length) {
|
|
3869
|
+
lines.push("No integration usage in the last 30 days.");
|
|
3870
|
+
} else {
|
|
3871
|
+
lines.push("Usage by integration (last 30 days):");
|
|
3872
|
+
const nameWidth = Math.max(11, ...usageByIntegration.map((u) => u.name.length));
|
|
3873
|
+
lines.push(`${"INTEGRATION".padEnd(nameWidth)} CALLS COST`);
|
|
3874
|
+
for (const u of usageByIntegration) {
|
|
3875
|
+
lines.push(`${u.name.padEnd(nameWidth)} ${String(u.count).padEnd(5)} ${formatUsd(u.totalCost)}`);
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
lines.push("");
|
|
3879
|
+
lines.push(`Dashboard: ${DASHBOARD_URL}`);
|
|
3880
|
+
return lines.join("\n");
|
|
3881
|
+
}
|
|
3882
|
+
var usage_default = defineCommand12({
|
|
3883
|
+
meta: {
|
|
3884
|
+
name: "usage",
|
|
3885
|
+
description: "Show credit balance, quota headroom, and per-integration spend"
|
|
3886
|
+
},
|
|
3887
|
+
args: {
|
|
3888
|
+
json: {
|
|
3889
|
+
type: "boolean",
|
|
3890
|
+
description: "Emit the raw usage summary as JSON instead of human output",
|
|
3891
|
+
default: false
|
|
3892
|
+
}
|
|
3893
|
+
},
|
|
3894
|
+
async run({ args }) {
|
|
3895
|
+
const token = await ensureToken();
|
|
3896
|
+
const summary = await apiFetch(API_URL3, token, "/api/usage/summary");
|
|
3897
|
+
if (args.json) {
|
|
3898
|
+
process.stdout.write(JSON.stringify(summary, null, 2) + "\n");
|
|
3899
|
+
return;
|
|
3900
|
+
}
|
|
3901
|
+
console.log(renderSummary(summary));
|
|
3902
|
+
}
|
|
3903
|
+
});
|
|
3904
|
+
|
|
3905
|
+
// src/cli/commands/add.ts
|
|
3906
|
+
import { defineCommand as defineCommand13 } from "citty";
|
|
3827
3907
|
import { existsSync as existsSync12, readFileSync as readFileSync12 } from "fs";
|
|
3828
3908
|
import { resolve as resolve8, join as join13, dirname as dirname3 } from "path";
|
|
3829
3909
|
import { fileURLToPath } from "url";
|
|
@@ -3859,7 +3939,7 @@ function runInstaller(script, passArgs, cwd) {
|
|
|
3859
3939
|
}
|
|
3860
3940
|
process.exit(res.status ?? 1);
|
|
3861
3941
|
}
|
|
3862
|
-
var add_default =
|
|
3942
|
+
var add_default = defineCommand13({
|
|
3863
3943
|
meta: {
|
|
3864
3944
|
name: "add",
|
|
3865
3945
|
description: "Add a feature to your DeepSpace app"
|
|
@@ -3932,9 +4012,9 @@ var add_default = defineCommand12({
|
|
|
3932
4012
|
});
|
|
3933
4013
|
|
|
3934
4014
|
// src/cli/commands/domain.ts
|
|
3935
|
-
import { defineCommand as
|
|
3936
|
-
var
|
|
3937
|
-
var api = (token, path, init) => apiFetch(
|
|
4015
|
+
import { defineCommand as defineCommand14 } from "citty";
|
|
4016
|
+
var API_URL4 = process.env.DEEPSPACE_API_URL ?? PLATFORM_URLS.api;
|
|
4017
|
+
var api = (token, path, init) => apiFetch(API_URL4, token, path, init);
|
|
3938
4018
|
function scrubInternal(value) {
|
|
3939
4019
|
if (Array.isArray(value)) return value.map(scrubInternal);
|
|
3940
4020
|
if (value && typeof value === "object") {
|
|
@@ -3968,7 +4048,7 @@ async function confirm3(message) {
|
|
|
3968
4048
|
});
|
|
3969
4049
|
});
|
|
3970
4050
|
}
|
|
3971
|
-
var search =
|
|
4051
|
+
var search = defineCommand14({
|
|
3972
4052
|
meta: { name: "search", description: "Search for available domains" },
|
|
3973
4053
|
args: {
|
|
3974
4054
|
query: { type: "positional", description: "Domain or keyword", required: true },
|
|
@@ -3998,7 +4078,7 @@ var search = defineCommand13({
|
|
|
3998
4078
|
}
|
|
3999
4079
|
}
|
|
4000
4080
|
});
|
|
4001
|
-
var buy =
|
|
4081
|
+
var buy = defineCommand14({
|
|
4002
4082
|
meta: { name: "buy", description: "Buy a domain and attach it to an app" },
|
|
4003
4083
|
args: {
|
|
4004
4084
|
domain: { type: "positional", description: "Domain to buy", required: true },
|
|
@@ -4108,7 +4188,7 @@ var buy = defineCommand13({
|
|
|
4108
4188
|
process.exit(1);
|
|
4109
4189
|
}
|
|
4110
4190
|
});
|
|
4111
|
-
var list2 =
|
|
4191
|
+
var list2 = defineCommand14({
|
|
4112
4192
|
meta: { name: "list", description: "List your domains" },
|
|
4113
4193
|
args: {
|
|
4114
4194
|
json: { type: "boolean", description: "Emit JSON" }
|
|
@@ -4134,7 +4214,7 @@ var list2 = defineCommand13({
|
|
|
4134
4214
|
}
|
|
4135
4215
|
}
|
|
4136
4216
|
});
|
|
4137
|
-
var status =
|
|
4217
|
+
var status = defineCommand14({
|
|
4138
4218
|
meta: { name: "status", description: "Show details for one domain" },
|
|
4139
4219
|
args: {
|
|
4140
4220
|
domain: { type: "positional", description: "Domain", required: true },
|
|
@@ -4164,7 +4244,7 @@ var status = defineCommand13({
|
|
|
4164
4244
|
console.log(`Charged: ${fmtCents(found.chargedCents)}/yr`);
|
|
4165
4245
|
}
|
|
4166
4246
|
});
|
|
4167
|
-
var attach =
|
|
4247
|
+
var attach = defineCommand14({
|
|
4168
4248
|
meta: { name: "attach", description: "Re-point a domain at a different app" },
|
|
4169
4249
|
args: {
|
|
4170
4250
|
domain: { type: "positional", description: "Domain to re-point", required: true },
|
|
@@ -4195,7 +4275,7 @@ var attach = defineCommand13({
|
|
|
4195
4275
|
console.log(`\u2713 ${args.domain} now points at ${targetApp}`);
|
|
4196
4276
|
}
|
|
4197
4277
|
});
|
|
4198
|
-
var detach =
|
|
4278
|
+
var detach = defineCommand14({
|
|
4199
4279
|
meta: {
|
|
4200
4280
|
name: "detach",
|
|
4201
4281
|
description: "Stop routing the domain (keeps the registration; auto-renew unchanged)"
|
|
@@ -4227,7 +4307,7 @@ var detach = defineCommand13({
|
|
|
4227
4307
|
);
|
|
4228
4308
|
}
|
|
4229
4309
|
});
|
|
4230
|
-
var renew =
|
|
4310
|
+
var renew = defineCommand14({
|
|
4231
4311
|
meta: { name: "renew", description: "Toggle auto-renewal at the registrar" },
|
|
4232
4312
|
args: {
|
|
4233
4313
|
domain: { type: "positional", description: "Domain", required: true },
|
|
@@ -4253,13 +4333,13 @@ var renew = defineCommand13({
|
|
|
4253
4333
|
console.log(`\u2713 ${args.domain} auto-renew ${enabled ? "enabled" : "disabled"}`);
|
|
4254
4334
|
}
|
|
4255
4335
|
});
|
|
4256
|
-
var domain_default =
|
|
4336
|
+
var domain_default = defineCommand14({
|
|
4257
4337
|
meta: { name: "domain", description: "Buy and manage custom domains" },
|
|
4258
4338
|
subCommands: { search, buy, list: list2, status, attach, detach, renew }
|
|
4259
4339
|
});
|
|
4260
4340
|
|
|
4261
4341
|
// src/cli/commands/collaborators.ts
|
|
4262
|
-
import { defineCommand as
|
|
4342
|
+
import { defineCommand as defineCommand15 } from "citty";
|
|
4263
4343
|
|
|
4264
4344
|
// src/server/auth/testAccounts.ts
|
|
4265
4345
|
var TEST_ACCOUNT_EMAIL_SUFFIX = "@deepspace.test";
|
|
@@ -4268,12 +4348,12 @@ function isTestAccountEmail(email) {
|
|
|
4268
4348
|
}
|
|
4269
4349
|
|
|
4270
4350
|
// src/cli/commands/collaborators.ts
|
|
4271
|
-
var
|
|
4351
|
+
var API_URL5 = process.env.DEEPSPACE_API_URL ?? PLATFORM_URLS.api;
|
|
4272
4352
|
var DEPLOY_URL6 = process.env.DEEPSPACE_DEPLOY_URL ?? PLATFORM_URLS.deploy;
|
|
4273
4353
|
function api2(token, path, init) {
|
|
4274
|
-
return apiFetch(
|
|
4354
|
+
return apiFetch(API_URL5, token, path, init);
|
|
4275
4355
|
}
|
|
4276
|
-
var list3 =
|
|
4356
|
+
var list3 = defineCommand15({
|
|
4277
4357
|
meta: { name: "list", description: "List collaborators on your app" },
|
|
4278
4358
|
args: {
|
|
4279
4359
|
app: { type: "string", alias: "a", description: "App id or name (defaults to ./wrangler.toml)" },
|
|
@@ -4305,7 +4385,7 @@ var list3 = defineCommand14({
|
|
|
4305
4385
|
}
|
|
4306
4386
|
}
|
|
4307
4387
|
});
|
|
4308
|
-
var add =
|
|
4388
|
+
var add = defineCommand15({
|
|
4309
4389
|
meta: { name: "add", description: "Authorize someone to deploy your app" },
|
|
4310
4390
|
args: {
|
|
4311
4391
|
email: {
|
|
@@ -4350,7 +4430,7 @@ var add = defineCommand14({
|
|
|
4350
4430
|
console.log(`\u2713 ${res.collaborator.emailDisplay} can now deploy ${app}`);
|
|
4351
4431
|
}
|
|
4352
4432
|
});
|
|
4353
|
-
var remove =
|
|
4433
|
+
var remove = defineCommand15({
|
|
4354
4434
|
meta: { name: "remove", description: "Remove a collaborator from your app" },
|
|
4355
4435
|
args: {
|
|
4356
4436
|
email: { type: "positional", description: "Collaborator email", required: true },
|
|
@@ -4382,7 +4462,7 @@ var remove = defineCommand14({
|
|
|
4382
4462
|
console.log(`\u2713 ${found.emailDisplay} can no longer deploy ${app}`);
|
|
4383
4463
|
}
|
|
4384
4464
|
});
|
|
4385
|
-
var cancel4 =
|
|
4465
|
+
var cancel4 = defineCommand15({
|
|
4386
4466
|
meta: { name: "cancel", description: "Cancel a pending (un-accepted) email invite" },
|
|
4387
4467
|
args: {
|
|
4388
4468
|
email: { type: "positional", description: "Invited email", required: true },
|
|
@@ -4414,17 +4494,17 @@ var cancel4 = defineCommand14({
|
|
|
4414
4494
|
console.log(`\u2713 Cancelled the pending invite to ${found.email} on ${app}`);
|
|
4415
4495
|
}
|
|
4416
4496
|
});
|
|
4417
|
-
var collaborators_default =
|
|
4497
|
+
var collaborators_default = defineCommand15({
|
|
4418
4498
|
meta: { name: "collaborators", description: "Manage who can deploy your app" },
|
|
4419
4499
|
subCommands: { list: list3, add, remove, cancel: cancel4 }
|
|
4420
4500
|
});
|
|
4421
4501
|
|
|
4422
4502
|
// src/cli/commands/transfer.ts
|
|
4423
|
-
import { defineCommand as
|
|
4503
|
+
import { defineCommand as defineCommand16 } from "citty";
|
|
4424
4504
|
import * as p6 from "@clack/prompts";
|
|
4425
|
-
var
|
|
4505
|
+
var API_URL6 = process.env.DEEPSPACE_API_URL ?? PLATFORM_URLS.api;
|
|
4426
4506
|
var DEPLOY_URL7 = process.env.DEEPSPACE_DEPLOY_URL ?? PLATFORM_URLS.deploy;
|
|
4427
|
-
var offer =
|
|
4507
|
+
var offer = defineCommand16({
|
|
4428
4508
|
meta: { name: "offer", description: "Offer this app to another DeepSpace user" },
|
|
4429
4509
|
args: {
|
|
4430
4510
|
email: { type: "positional", description: "Recipient email", required: true },
|
|
@@ -4438,7 +4518,7 @@ var offer = defineCommand15({
|
|
|
4438
4518
|
const token = await ensureToken();
|
|
4439
4519
|
const app = await resolveAppTarget(DEPLOY_URL7, token, args.app);
|
|
4440
4520
|
const pending = await apiFetch(
|
|
4441
|
-
|
|
4521
|
+
API_URL6,
|
|
4442
4522
|
token,
|
|
4443
4523
|
`/api/app-transfers/${encodeURIComponent(app)}`
|
|
4444
4524
|
);
|
|
@@ -4459,7 +4539,7 @@ var offer = defineCommand15({
|
|
|
4459
4539
|
}
|
|
4460
4540
|
}
|
|
4461
4541
|
const { expiresAt } = await apiFetch(
|
|
4462
|
-
|
|
4542
|
+
API_URL6,
|
|
4463
4543
|
token,
|
|
4464
4544
|
`/api/app-transfers/${encodeURIComponent(app)}`,
|
|
4465
4545
|
{ method: "POST", body: JSON.stringify({ email: args.email }) }
|
|
@@ -4473,7 +4553,7 @@ var offer = defineCommand15({
|
|
|
4473
4553
|
);
|
|
4474
4554
|
}
|
|
4475
4555
|
});
|
|
4476
|
-
var status2 =
|
|
4556
|
+
var status2 = defineCommand16({
|
|
4477
4557
|
meta: { name: "status", description: "Show the pending transfer offer, if any" },
|
|
4478
4558
|
args: {
|
|
4479
4559
|
app: { type: "string", alias: "a", description: "App id or name (defaults to ./wrangler.toml)" }
|
|
@@ -4481,7 +4561,7 @@ var status2 = defineCommand15({
|
|
|
4481
4561
|
async run({ args }) {
|
|
4482
4562
|
const token = await ensureToken();
|
|
4483
4563
|
const app = await resolveAppTarget(DEPLOY_URL7, token, args.app);
|
|
4484
|
-
const { transfer } = await apiFetch(
|
|
4564
|
+
const { transfer } = await apiFetch(API_URL6, token, `/api/app-transfers/${encodeURIComponent(app)}`);
|
|
4485
4565
|
if (!transfer) {
|
|
4486
4566
|
console.log(`No pending transfer for ${app}.`);
|
|
4487
4567
|
return;
|
|
@@ -4489,7 +4569,7 @@ var status2 = defineCommand15({
|
|
|
4489
4569
|
console.log(`Pending: ${app} \u2192 ${transfer.toEmailDisplay} (expires ${transfer.expiresAt}).`);
|
|
4490
4570
|
}
|
|
4491
4571
|
});
|
|
4492
|
-
var accept =
|
|
4572
|
+
var accept = defineCommand16({
|
|
4493
4573
|
meta: { name: "accept", description: "Accept a transfer offered to you" },
|
|
4494
4574
|
args: {
|
|
4495
4575
|
app: { type: "string", alias: "a", description: "App id of the offered app", required: true }
|
|
@@ -4505,7 +4585,7 @@ var accept = defineCommand15({
|
|
|
4505
4585
|
);
|
|
4506
4586
|
}
|
|
4507
4587
|
});
|
|
4508
|
-
var cancel5 =
|
|
4588
|
+
var cancel5 = defineCommand16({
|
|
4509
4589
|
meta: { name: "cancel", description: "Cancel/decline the pending offer (either party)" },
|
|
4510
4590
|
args: {
|
|
4511
4591
|
app: { type: "string", alias: "a", description: "App id or name (defaults to ./wrangler.toml)" }
|
|
@@ -4513,22 +4593,22 @@ var cancel5 = defineCommand15({
|
|
|
4513
4593
|
async run({ args }) {
|
|
4514
4594
|
const token = await ensureToken();
|
|
4515
4595
|
const app = await resolveAppTarget(DEPLOY_URL7, token, args.app);
|
|
4516
|
-
await apiFetch(
|
|
4596
|
+
await apiFetch(API_URL6, token, `/api/app-transfers/${encodeURIComponent(app)}`, { method: "DELETE" });
|
|
4517
4597
|
console.log(`\u2713 Transfer offer for ${app} cancelled.`);
|
|
4518
4598
|
}
|
|
4519
4599
|
});
|
|
4520
|
-
var transfer_default =
|
|
4600
|
+
var transfer_default = defineCommand16({
|
|
4521
4601
|
meta: { name: "transfer", description: "Transfer app ownership to another user" },
|
|
4522
4602
|
subCommands: { offer, status: status2, accept, cancel: cancel5 }
|
|
4523
4603
|
});
|
|
4524
4604
|
|
|
4525
4605
|
// src/cli/commands/integrations.ts
|
|
4526
|
-
import { defineCommand as
|
|
4606
|
+
import { defineCommand as defineCommand17 } from "citty";
|
|
4527
4607
|
|
|
4528
4608
|
// src/cli/commands/_invoke-impl.ts
|
|
4529
4609
|
import { readFileSync as readFileSync13 } from "fs";
|
|
4530
4610
|
import * as p7 from "@clack/prompts";
|
|
4531
|
-
var
|
|
4611
|
+
var API_URL7 = process.env.DEEPSPACE_API_URL ?? PLATFORM_URLS.api;
|
|
4532
4612
|
var DEFAULT_TIMEOUT_MS = 12e4;
|
|
4533
4613
|
function parseTarget(target) {
|
|
4534
4614
|
if (!target || typeof target !== "string") {
|
|
@@ -4570,7 +4650,7 @@ function flushAndExit(code) {
|
|
|
4570
4650
|
});
|
|
4571
4651
|
}
|
|
4572
4652
|
async function fetchCatalog(opts = {}) {
|
|
4573
|
-
const url = opts.summary ? `${
|
|
4653
|
+
const url = opts.summary ? `${API_URL7}/api/integrations?summary=1` : `${API_URL7}/api/integrations`;
|
|
4574
4654
|
const res = await fetch(url);
|
|
4575
4655
|
if (!res.ok) {
|
|
4576
4656
|
throw new Error(`Failed to fetch integration catalog (${res.status})`);
|
|
@@ -4694,7 +4774,7 @@ async function runInvoke(args) {
|
|
|
4694
4774
|
const startedAt = Date.now();
|
|
4695
4775
|
let res;
|
|
4696
4776
|
try {
|
|
4697
|
-
res = await fetch(`${
|
|
4777
|
+
res = await fetch(`${API_URL7}/api/integrations/${integration}/${endpoint}`, {
|
|
4698
4778
|
method: "POST",
|
|
4699
4779
|
headers: {
|
|
4700
4780
|
"Content-Type": "application/json",
|
|
@@ -4745,7 +4825,7 @@ async function runInvoke(args) {
|
|
|
4745
4825
|
}
|
|
4746
4826
|
|
|
4747
4827
|
// src/cli/commands/integrations.ts
|
|
4748
|
-
var list4 =
|
|
4828
|
+
var list4 = defineCommand17({
|
|
4749
4829
|
meta: {
|
|
4750
4830
|
name: "list",
|
|
4751
4831
|
description: "List all available integrations"
|
|
@@ -4766,7 +4846,7 @@ var list4 = defineCommand16({
|
|
|
4766
4846
|
}
|
|
4767
4847
|
}
|
|
4768
4848
|
});
|
|
4769
|
-
var info =
|
|
4849
|
+
var info = defineCommand17({
|
|
4770
4850
|
meta: {
|
|
4771
4851
|
name: "info",
|
|
4772
4852
|
description: "Print schema + example body for an integration endpoint"
|
|
@@ -4792,7 +4872,7 @@ var info = defineCommand16({
|
|
|
4792
4872
|
}
|
|
4793
4873
|
}
|
|
4794
4874
|
});
|
|
4795
|
-
var invoke =
|
|
4875
|
+
var invoke = defineCommand17({
|
|
4796
4876
|
meta: {
|
|
4797
4877
|
name: "invoke",
|
|
4798
4878
|
description: "Invoke a platform integration as the logged-in user"
|
|
@@ -4852,7 +4932,7 @@ var invoke = defineCommand16({
|
|
|
4852
4932
|
}
|
|
4853
4933
|
}
|
|
4854
4934
|
});
|
|
4855
|
-
var integrations_default =
|
|
4935
|
+
var integrations_default = defineCommand17({
|
|
4856
4936
|
meta: {
|
|
4857
4937
|
name: "integrations",
|
|
4858
4938
|
description: "List, inspect, and invoke platform integrations"
|
|
@@ -4865,8 +4945,8 @@ var integrations_default = defineCommand16({
|
|
|
4865
4945
|
});
|
|
4866
4946
|
|
|
4867
4947
|
// src/cli/commands/invoke.ts
|
|
4868
|
-
import { defineCommand as
|
|
4869
|
-
var invoke_default =
|
|
4948
|
+
import { defineCommand as defineCommand18 } from "citty";
|
|
4949
|
+
var invoke_default = defineCommand18({
|
|
4870
4950
|
meta: {
|
|
4871
4951
|
name: "invoke",
|
|
4872
4952
|
description: "Invoke a platform integration as the logged-in user"
|
|
@@ -4946,13 +5026,13 @@ var invoke_default = defineCommand17({
|
|
|
4946
5026
|
});
|
|
4947
5027
|
|
|
4948
5028
|
// src/cli/commands/library.ts
|
|
4949
|
-
import { defineCommand as
|
|
5029
|
+
import { defineCommand as defineCommand19 } from "citty";
|
|
4950
5030
|
import { existsSync as existsSync13, readFileSync as readFileSync14 } from "fs";
|
|
4951
5031
|
import { join as join14, resolve as resolve9 } from "path";
|
|
4952
5032
|
import { parse as parseToml4 } from "smol-toml";
|
|
4953
5033
|
import * as p8 from "@clack/prompts";
|
|
4954
5034
|
var DEFAULT_LIBRARY_APP = "deepdotspace-site";
|
|
4955
|
-
var publish =
|
|
5035
|
+
var publish = defineCommand19({
|
|
4956
5036
|
meta: {
|
|
4957
5037
|
name: "publish",
|
|
4958
5038
|
description: "Publish the current app to the DeepSpace library"
|
|
@@ -5091,7 +5171,7 @@ var publish = defineCommand18({
|
|
|
5091
5171
|
p8.outro("Done");
|
|
5092
5172
|
}
|
|
5093
5173
|
});
|
|
5094
|
-
var unpublish =
|
|
5174
|
+
var unpublish = defineCommand19({
|
|
5095
5175
|
meta: {
|
|
5096
5176
|
name: "unpublish",
|
|
5097
5177
|
description: "Remove a library entry (owner or admin only)"
|
|
@@ -5150,7 +5230,7 @@ var unpublish = defineCommand18({
|
|
|
5150
5230
|
p8.outro("Done");
|
|
5151
5231
|
}
|
|
5152
5232
|
});
|
|
5153
|
-
var library_default =
|
|
5233
|
+
var library_default = defineCommand19({
|
|
5154
5234
|
meta: {
|
|
5155
5235
|
name: "library",
|
|
5156
5236
|
description: "Manage your DeepSpace library entries"
|
|
@@ -5162,13 +5242,13 @@ var library_default = defineCommand18({
|
|
|
5162
5242
|
});
|
|
5163
5243
|
|
|
5164
5244
|
// src/cli/commands/feedback.ts
|
|
5165
|
-
import { defineCommand as
|
|
5245
|
+
import { defineCommand as defineCommand20 } from "citty";
|
|
5166
5246
|
import * as p9 from "@clack/prompts";
|
|
5167
5247
|
import { existsSync as existsSync14, readFileSync as readFileSync15 } from "fs";
|
|
5168
5248
|
import { dirname as dirname4, join as join15 } from "path";
|
|
5169
5249
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
5170
5250
|
import { release } from "os";
|
|
5171
|
-
var
|
|
5251
|
+
var API_URL8 = process.env.DEEPSPACE_API_URL ?? PLATFORM_URLS.api;
|
|
5172
5252
|
var TYPES = ["bug", "feature", "other"];
|
|
5173
5253
|
var TYPE_LABELS = {
|
|
5174
5254
|
bug: "Bug report",
|
|
@@ -5178,7 +5258,7 @@ var TYPE_LABELS = {
|
|
|
5178
5258
|
var MAX_TITLE_LEN = 200;
|
|
5179
5259
|
var MAX_BODY_LEN = 1e4;
|
|
5180
5260
|
var MAX_CONTEXT_LEN = 200;
|
|
5181
|
-
var api3 = (token, path, init) => apiFetch(
|
|
5261
|
+
var api3 = (token, path, init) => apiFetch(API_URL8, token, path, init);
|
|
5182
5262
|
function normalizeType(raw) {
|
|
5183
5263
|
const value = (raw ?? "bug").toLowerCase();
|
|
5184
5264
|
if (TYPES.includes(value)) return value;
|
|
@@ -5240,7 +5320,7 @@ function buildFeedbackPayload(input) {
|
|
|
5240
5320
|
...input.context
|
|
5241
5321
|
};
|
|
5242
5322
|
}
|
|
5243
|
-
var feedback_default =
|
|
5323
|
+
var feedback_default = defineCommand20({
|
|
5244
5324
|
meta: {
|
|
5245
5325
|
name: "feedback",
|
|
5246
5326
|
description: "Submit a bug report, feature request, or feedback to DeepSpace"
|
|
@@ -5402,7 +5482,7 @@ Context: deepspace ${payload.cliVersion} \xB7 ${payload.nodeVersion} \xB7 ${payl
|
|
|
5402
5482
|
});
|
|
5403
5483
|
|
|
5404
5484
|
// src/cli/commands/secrets.ts
|
|
5405
|
-
import { defineCommand as
|
|
5485
|
+
import { defineCommand as defineCommand21 } from "citty";
|
|
5406
5486
|
import { readFileSync as readFileSync16 } from "fs";
|
|
5407
5487
|
|
|
5408
5488
|
// src/cli/lib/citty-args.ts
|
|
@@ -5472,7 +5552,7 @@ function warnIfDebugRoutesEnabled(secrets) {
|
|
|
5472
5552
|
}
|
|
5473
5553
|
var APPLY_HINT = "Run `deepspace deploy` to apply \u2014 secrets take effect at deploy time.";
|
|
5474
5554
|
var LOCAL_DEV_HINT = "Running `deepspace dev`? Restart it to load the change locally.";
|
|
5475
|
-
var list5 =
|
|
5555
|
+
var list5 = defineCommand21({
|
|
5476
5556
|
meta: { name: "list", description: "List masked secrets in a config" },
|
|
5477
5557
|
args: {
|
|
5478
5558
|
...COMMON_ARGS,
|
|
@@ -5503,7 +5583,7 @@ var list5 = defineCommand20({
|
|
|
5503
5583
|
}
|
|
5504
5584
|
}
|
|
5505
5585
|
});
|
|
5506
|
-
var set =
|
|
5586
|
+
var set = defineCommand21({
|
|
5507
5587
|
meta: { name: "set", description: "Set secrets from KEY=value pairs" },
|
|
5508
5588
|
args: {
|
|
5509
5589
|
...COMMON_ARGS,
|
|
@@ -5545,7 +5625,7 @@ var set = defineCommand20({
|
|
|
5545
5625
|
}
|
|
5546
5626
|
}
|
|
5547
5627
|
});
|
|
5548
|
-
var get =
|
|
5628
|
+
var get = defineCommand21({
|
|
5549
5629
|
meta: { name: "get", description: "Get a secret; pass --plain to print the value" },
|
|
5550
5630
|
args: {
|
|
5551
5631
|
...COMMON_ARGS,
|
|
@@ -5570,7 +5650,7 @@ var get = defineCommand20({
|
|
|
5570
5650
|
}
|
|
5571
5651
|
}
|
|
5572
5652
|
});
|
|
5573
|
-
var del2 =
|
|
5653
|
+
var del2 = defineCommand21({
|
|
5574
5654
|
meta: { name: "delete", description: "Delete one or more secrets" },
|
|
5575
5655
|
args: {
|
|
5576
5656
|
...COMMON_ARGS,
|
|
@@ -5600,7 +5680,7 @@ var del2 = defineCommand20({
|
|
|
5600
5680
|
}
|
|
5601
5681
|
}
|
|
5602
5682
|
});
|
|
5603
|
-
var upload =
|
|
5683
|
+
var upload = defineCommand21({
|
|
5604
5684
|
meta: { name: "upload", description: "Upload secrets from a dotenv or JSON file" },
|
|
5605
5685
|
args: {
|
|
5606
5686
|
...COMMON_ARGS,
|
|
@@ -5625,7 +5705,7 @@ var upload = defineCommand20({
|
|
|
5625
5705
|
}
|
|
5626
5706
|
}
|
|
5627
5707
|
});
|
|
5628
|
-
var download =
|
|
5708
|
+
var download = defineCommand21({
|
|
5629
5709
|
meta: { name: "download", description: "Download a config\u2019s secrets (dotenv/json/shell)" },
|
|
5630
5710
|
args: {
|
|
5631
5711
|
...COMMON_ARGS,
|
|
@@ -5649,7 +5729,7 @@ var download = defineCommand20({
|
|
|
5649
5729
|
}
|
|
5650
5730
|
}
|
|
5651
5731
|
});
|
|
5652
|
-
var pull =
|
|
5732
|
+
var pull = defineCommand21({
|
|
5653
5733
|
meta: { name: "pull", description: "Refresh the .dev.vars cache from the app store" },
|
|
5654
5734
|
args: { ...COMMON_ARGS },
|
|
5655
5735
|
async run({ args }) {
|
|
@@ -5677,7 +5757,7 @@ var pull = defineCommand20({
|
|
|
5677
5757
|
}
|
|
5678
5758
|
}
|
|
5679
5759
|
});
|
|
5680
|
-
var configsList =
|
|
5760
|
+
var configsList = defineCommand21({
|
|
5681
5761
|
meta: { name: "list", description: "List the app\u2019s configs" },
|
|
5682
5762
|
args: { ...COMMON_ARGS },
|
|
5683
5763
|
async run({ args }) {
|
|
@@ -5696,7 +5776,7 @@ var configsList = defineCommand20({
|
|
|
5696
5776
|
}
|
|
5697
5777
|
}
|
|
5698
5778
|
});
|
|
5699
|
-
var configsCreate =
|
|
5779
|
+
var configsCreate = defineCommand21({
|
|
5700
5780
|
meta: { name: "create", description: "Create a config (optionally copying another)" },
|
|
5701
5781
|
args: {
|
|
5702
5782
|
...COMMON_ARGS,
|
|
@@ -5727,7 +5807,7 @@ var configsCreate = defineCommand20({
|
|
|
5727
5807
|
}
|
|
5728
5808
|
}
|
|
5729
5809
|
});
|
|
5730
|
-
var configsDelete =
|
|
5810
|
+
var configsDelete = defineCommand21({
|
|
5731
5811
|
meta: { name: "delete", description: "Delete a config and all of its secrets" },
|
|
5732
5812
|
args: {
|
|
5733
5813
|
...COMMON_ARGS,
|
|
@@ -5744,11 +5824,11 @@ var configsDelete = defineCommand20({
|
|
|
5744
5824
|
}
|
|
5745
5825
|
}
|
|
5746
5826
|
});
|
|
5747
|
-
var configs =
|
|
5827
|
+
var configs = defineCommand21({
|
|
5748
5828
|
meta: { name: "configs", description: "Manage the app\u2019s secrets configs" },
|
|
5749
5829
|
subCommands: { list: configsList, create: configsCreate, delete: configsDelete }
|
|
5750
5830
|
});
|
|
5751
|
-
var secrets_default =
|
|
5831
|
+
var secrets_default = defineCommand21({
|
|
5752
5832
|
meta: { name: "secrets", description: "Manage the app\u2019s secrets store" },
|
|
5753
5833
|
subCommands: {
|
|
5754
5834
|
list: list5,
|
|
@@ -5763,8 +5843,8 @@ var secrets_default = defineCommand20({
|
|
|
5763
5843
|
});
|
|
5764
5844
|
|
|
5765
5845
|
// src/cli/commands/init.ts
|
|
5766
|
-
import { defineCommand as
|
|
5767
|
-
var init_default =
|
|
5846
|
+
import { defineCommand as defineCommand22 } from "citty";
|
|
5847
|
+
var init_default = defineCommand22({
|
|
5768
5848
|
meta: {
|
|
5769
5849
|
name: "init",
|
|
5770
5850
|
description: "Mint this app\u2019s immutable DEEPSPACE_APP_ID into wrangler.toml"
|
|
@@ -5814,7 +5894,7 @@ var pkg = JSON.parse(readFileSync17(join16(__dirname, "..", "package.json"), "ut
|
|
|
5814
5894
|
if (process.platform === "linux" && !process.env.SSL_CERT_FILE && existsSync15("/etc/ssl/certs/ca-certificates.crt")) {
|
|
5815
5895
|
process.env.SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt";
|
|
5816
5896
|
}
|
|
5817
|
-
var create2 =
|
|
5897
|
+
var create2 = defineCommand23({
|
|
5818
5898
|
meta: {
|
|
5819
5899
|
name: "create",
|
|
5820
5900
|
description: "Create a new DeepSpace app (runs create-deepspace; all flags are forwarded)"
|
|
@@ -5841,7 +5921,7 @@ var create2 = defineCommand22({
|
|
|
5841
5921
|
process.exit(res.status ?? 1);
|
|
5842
5922
|
}
|
|
5843
5923
|
});
|
|
5844
|
-
var main =
|
|
5924
|
+
var main = defineCommand23({
|
|
5845
5925
|
meta: {
|
|
5846
5926
|
name: "deepspace",
|
|
5847
5927
|
version: pkg.version,
|
|
@@ -5854,6 +5934,7 @@ var main = defineCommand22({
|
|
|
5854
5934
|
logout: logout_default,
|
|
5855
5935
|
whoami: whoami_default,
|
|
5856
5936
|
apps: apps_default,
|
|
5937
|
+
usage: usage_default,
|
|
5857
5938
|
dev: dev_default,
|
|
5858
5939
|
kill: kill_default,
|
|
5859
5940
|
test: test_default,
|