@mediamonks/canopy-cli 0.7.53 → 0.7.54
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/{dev-L5slb6ke.mjs → dev-BvzqZU_F.mjs} +4 -4
- package/dist/dev-wHv8RrDn.mjs +2 -0
- package/dist/{dev-worker-DBBN0F6X.mjs → dev-worker-BdVcP-SM.mjs} +1 -1
- package/dist/{docs-bnQLqEOn.mjs → docs-CoH01QrG.mjs} +1 -1
- package/dist/{feedback-vHJwLyWF.mjs → feedback-CFaqNiiw.mjs} +1 -1
- package/dist/index.mjs +7 -7
- package/dist/{local-B15wYk6z.mjs → local-B1N4TpE9.mjs} +2 -2
- package/dist/{mcp-BmT4Es_B.mjs → mcp-B8VXA-TE.mjs} +1 -1
- package/dist/{package-DtU4jB_Z.mjs → package-BDKvR7By.mjs} +1 -1
- package/dist/{skill-CRTV3ZQ1.mjs → skill-BXlKClK3.mjs} +1 -1
- package/dist/{src-UBUAqzqH.mjs → src-B0WdnVz9.mjs} +26 -4
- package/dist/templates/spa/package.json +1 -1
- package/dist/templates/spa/tsconfig.json +1 -0
- package/dist/templates/worker/package.json +1 -1
- package/dist/templates/worker/tsconfig.json +1 -0
- package/dist/{upgrade-LTEfQn4L.mjs → upgrade-CJln-B-I.mjs} +1 -1
- package/package.json +3 -3
- package/dist/dev-CVC7elOr.mjs +0 -2
|
@@ -2,7 +2,7 @@ import { c as projectDialect, f as resolveProject, h as tryReadCanopyJson, l as
|
|
|
2
2
|
import { a as apiRequest, m as withContext, t as ApiError } from "./api-D4KUT6Ly.mjs";
|
|
3
3
|
import { i as reportErrors, n as formatDateTime } from "./ui-BPq6-hKS.mjs";
|
|
4
4
|
import { r as readMigrationFiles } from "./migrations-k5pyUUR0.mjs";
|
|
5
|
-
import { r as stampWorkerHeaders, t as WORKER_ATTEST_HEADER } from "./src-
|
|
5
|
+
import { r as stampWorkerHeaders, t as WORKER_ATTEST_HEADER } from "./src-B0WdnVz9.mjs";
|
|
6
6
|
import { a as parseAppRoleFlag } from "./roles-Yn8U3cr-.mjs";
|
|
7
7
|
import { n as writeDevServerRecord } from "./dev-server-file-Dk9pk4AR.mjs";
|
|
8
8
|
import { createRequire } from "node:module";
|
|
@@ -107,7 +107,7 @@ async function workerPlugin(flags, slug, workerAttest, remoteUser, roles) {
|
|
|
107
107
|
console.log(`note: canopy.json points "worker" at ${entry}, which does not exist — skipping.`);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
const { missingSecretNames, readDevVars, workerDevPlugin } = await import("./dev-worker-
|
|
110
|
+
const { missingSecretNames, readDevVars, workerDevPlugin } = await import("./dev-worker-BdVcP-SM.mjs");
|
|
111
111
|
const secrets = readDevVars(flags.dir);
|
|
112
112
|
const email = siteConfig().email;
|
|
113
113
|
const found = await remoteUser?.() ?? (email ? {
|
|
@@ -326,7 +326,7 @@ async function devRemote(flags, slug) {
|
|
|
326
326
|
async function devLocal(flags, slug) {
|
|
327
327
|
let dump;
|
|
328
328
|
if (flags.pull) {
|
|
329
|
-
const { fetchProjectDump } = await import("./local-
|
|
329
|
+
const { fetchProjectDump } = await import("./local-B1N4TpE9.mjs");
|
|
330
330
|
console.log(`Pulling a fresh export of ${slug}${flags.staging ? " [staging]" : ""}…`);
|
|
331
331
|
dump = await fetchProjectDump(slug, flags.staging ? "staging" : "live");
|
|
332
332
|
}
|
|
@@ -343,7 +343,7 @@ async function devLocal(flags, slug) {
|
|
|
343
343
|
}
|
|
344
344
|
const workerAttest = randomBytes(24).toString("base64url");
|
|
345
345
|
const devRoles = await resolveDevRoles(slug, flags.asRoles);
|
|
346
|
-
const { createSandbox } = await import("./local-
|
|
346
|
+
const { createSandbox } = await import("./local-B1N4TpE9.mjs");
|
|
347
347
|
const sandbox = await createSandbox({
|
|
348
348
|
slug,
|
|
349
349
|
persistDir: join(flags.dir, ".canopy", "local"),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as readPersonCaller, i as CALLER_HEADER, n as redactCanopyCredentials, o as readUser, r as stampWorkerHeaders, t as WORKER_ATTEST_HEADER } from "./src-
|
|
1
|
+
import { a as readPersonCaller, i as CALLER_HEADER, n as redactCanopyCredentials, o as readUser, r as stampWorkerHeaders, t as WORKER_ATTEST_HEADER } from "./src-B0WdnVz9.mjs";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { relative, resolve, sep } from "node:path";
|
|
4
4
|
//#region src/dev-worker.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as version } from "./package-
|
|
1
|
+
import { t as version } from "./package-BDKvR7By.mjs";
|
|
2
2
|
import { r as siteConfig } from "./site-C0nf9RXY.mjs";
|
|
3
3
|
import { i as latestKnownVersion, r as compareSemver } from "./version-check-CcsA1QjI.mjs";
|
|
4
4
|
import { n as agentHeaders } from "./api-D4KUT6Ly.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as version } from "./package-
|
|
1
|
+
import { t as version } from "./package-BDKvR7By.mjs";
|
|
2
2
|
import { f as resolveProject, g as tryResolveProject, h as tryReadCanopyJson, l as projectDirArgs, r as siteConfig } from "./site-C0nf9RXY.mjs";
|
|
3
3
|
import { a as apiRequest, c as credentials, i as apiDownload, o as apiUpload, s as commonHeaders } from "./api-D4KUT6Ly.mjs";
|
|
4
4
|
import { i as reportErrors, n as formatDateTime } from "./ui-BPq6-hKS.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as version } from "./package-
|
|
2
|
+
import { t as version } from "./package-BDKvR7By.mjs";
|
|
3
3
|
import { i as siteHeaderLine, n as setInvocationProfile } from "./site-C0nf9RXY.mjs";
|
|
4
4
|
import { a as notifyOfUpdate, o as runRefresh } from "./version-check-CcsA1QjI.mjs";
|
|
5
5
|
import { defineCommand, runMain } from "citty";
|
|
@@ -59,7 +59,7 @@ const main = defineCommand({
|
|
|
59
59
|
projects: () => import("./projects-ztlDQi0P.mjs").then((m) => m.projectsCommand),
|
|
60
60
|
delete: () => import("./projects-ztlDQi0P.mjs").then((m) => m.deleteCommand),
|
|
61
61
|
rename: () => import("./rename-BZ8hvUUt.mjs").then((m) => m.renameCommand),
|
|
62
|
-
dev: () => import("./dev-
|
|
62
|
+
dev: () => import("./dev-wHv8RrDn.mjs").then((m) => m.devCommand),
|
|
63
63
|
deploy: () => import("./deploy-DHjZj2Pq.mjs").then((m) => m.deployCommand),
|
|
64
64
|
promote: () => import("./deploy-DHjZj2Pq.mjs").then((m) => m.promoteCommand),
|
|
65
65
|
staging: () => import("./staging-C9mn0EBS.mjs").then((m) => m.stagingCommand),
|
|
@@ -72,18 +72,18 @@ const main = defineCommand({
|
|
|
72
72
|
roles: () => import("./roles-DvywfJ8x.mjs").then((m) => m.rolesCommand),
|
|
73
73
|
members: () => import("./roles-DvywfJ8x.mjs").then((m) => m.membersCommand),
|
|
74
74
|
schedule: () => import("./schedule-Cv26MIfS.mjs").then((m) => m.scheduleCommand),
|
|
75
|
-
feedback: () => import("./feedback-
|
|
75
|
+
feedback: () => import("./feedback-CFaqNiiw.mjs").then((m) => m.feedbackCommand),
|
|
76
76
|
db: () => import("./db-Dy1csI71.mjs").then((m) => m.dbCommand),
|
|
77
77
|
files: () => import("./files-DKtyMjY0.mjs").then((m) => m.filesCommand),
|
|
78
78
|
usage: () => import("./usage-DBhL6SUo.mjs").then((m) => m.usageCommand),
|
|
79
79
|
ai: () => import("./ai-BlqO9NhM.mjs").then((m) => m.aiCommand),
|
|
80
80
|
open: () => import("./open-CYfkeTaw.mjs").then((m) => m.openCommand),
|
|
81
81
|
browse: () => import("./browse-CW3CnhK_.mjs").then((m) => m.browseCommand),
|
|
82
|
-
docs: () => import("./docs-
|
|
83
|
-
skill: () => import("./skill-
|
|
84
|
-
upgrade: () => import("./upgrade-
|
|
82
|
+
docs: () => import("./docs-CoH01QrG.mjs").then((m) => m.docsCommand),
|
|
83
|
+
skill: () => import("./skill-BXlKClK3.mjs").then((m) => m.skillCommand),
|
|
84
|
+
upgrade: () => import("./upgrade-CJln-B-I.mjs").then((m) => m.upgradeCommand),
|
|
85
85
|
logs: () => import("./logs-ByDPHO28.mjs").then((m) => m.logsCommand),
|
|
86
|
-
mcp: () => import("./mcp-
|
|
86
|
+
mcp: () => import("./mcp-B8VXA-TE.mjs").then((m) => m.mcpCommand),
|
|
87
87
|
repo: () => import("./repo-fDD4TcJ4.mjs").then((m) => m.repoCommand),
|
|
88
88
|
template: () => import("./project-template-B6YpesjZ.mjs").then((m) => m.templateCommand),
|
|
89
89
|
audience: () => import("./audience-Dlrsdthb.mjs").then((m) => m.audienceCommand)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as apiDataRequest } from "./api-D4KUT6Ly.mjs";
|
|
2
|
-
import { c as dbRouter, d as STREAMED_BLOB_BYTES, f as blobRouter, l as hasPrivateNames, p as isCreateOnly, s as realtimeRouter, t as WORKER_ATTEST_HEADER, u as META_COLUMNS } from "./src-
|
|
3
|
-
import { a as rewriteApiPath } from "./dev-
|
|
2
|
+
import { c as dbRouter, d as STREAMED_BLOB_BYTES, f as blobRouter, l as hasPrivateNames, p as isCreateOnly, s as realtimeRouter, t as WORKER_ATTEST_HEADER, u as META_COLUMNS } from "./src-B0WdnVz9.mjs";
|
|
3
|
+
import { a as rewriteApiPath } from "./dev-BvzqZU_F.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { dirname, join, relative, sep } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as version } from "./package-
|
|
1
|
+
import { t as version } from "./package-BDKvR7By.mjs";
|
|
2
2
|
import { d as projectUrl, g as tryResolveProject, m as stagingUrl, r as siteConfig } from "./site-C0nf9RXY.mjs";
|
|
3
3
|
import { a as apiRequest, f as noticeRenamesOnly, l as currentSlug, t as ApiError } from "./api-D4KUT6Ly.mjs";
|
|
4
4
|
import { t as liveDevServer } from "./dev-server-file-Dk9pk4AR.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as version } from "./package-
|
|
1
|
+
import { t as version } from "./package-BDKvR7By.mjs";
|
|
2
2
|
import { i as reportErrors } from "./ui-BPq6-hKS.mjs";
|
|
3
3
|
import { defineCommand } from "citty";
|
|
4
4
|
import { cpSync, existsSync, mkdirSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
@@ -1114,6 +1114,25 @@ function readPersonCaller(headers) {
|
|
|
1114
1114
|
};
|
|
1115
1115
|
}
|
|
1116
1116
|
//#endregion
|
|
1117
|
+
//#region ../data-plane/src/trust-headers.ts
|
|
1118
|
+
/**
|
|
1119
|
+
* Project scope a data-plane call carries, and the gateway JWT that vouches
|
|
1120
|
+
* for it — the one definition.
|
|
1121
|
+
*
|
|
1122
|
+
* The gateway stamps the project and channel on a call it forwards and signs
|
|
1123
|
+
* it with its short-lived internal JWT; canopy-api trusts the first two only
|
|
1124
|
+
* when the third verifies (D17). A client's own copies are dropped at the
|
|
1125
|
+
* gateway and re-stamped from what it saw.
|
|
1126
|
+
*
|
|
1127
|
+
* A leaf module: no imports, so any worker can take it without pulling the
|
|
1128
|
+
* data-plane routers along. The Workers-for-Platforms shim (worker-shim.ts)
|
|
1129
|
+
* ships as source text and keeps its own literals.
|
|
1130
|
+
*/
|
|
1131
|
+
/** The project a data-plane call is for; trusted only beside a valid INTERNAL_JWT_HEADER (D17). */
|
|
1132
|
+
const PROJECT_HEADER = "x-canopy-project";
|
|
1133
|
+
/** `staging` when the call is for the project's staging channel (docs/14); absent means live. */
|
|
1134
|
+
const CHANNEL_HEADER = "x-canopy-channel";
|
|
1135
|
+
//#endregion
|
|
1117
1136
|
//#region ../data-plane/src/caller-headers.cases.ts
|
|
1118
1137
|
const ada = {
|
|
1119
1138
|
sub: "u-ada",
|
|
@@ -1190,7 +1209,10 @@ const AGENT_CREDENTIAL_HEADER = "x-canopy-agent-credential";
|
|
|
1190
1209
|
/**
|
|
1191
1210
|
* Cookies that authenticate to Canopy itself — the monk session, the
|
|
1192
1211
|
* client-page session, an agent's browse session and an outside account's
|
|
1193
|
-
* session (outside-sign-in).
|
|
1212
|
+
* session (outside-sign-in). Project code must never see them (R-01): hosts
|
|
1213
|
+
* redact them from the bundle's request, and a sealed backend gets them only
|
|
1214
|
+
* inside a credential handle. The gateway and the project runtime split
|
|
1215
|
+
* cookies by this set; the WfP shim keeps a transcription (it cannot import).
|
|
1194
1216
|
*/
|
|
1195
1217
|
const CANOPY_COOKIE_NAMES = /* @__PURE__ */ new Set([
|
|
1196
1218
|
"canopy_session",
|
|
@@ -1238,9 +1260,9 @@ function redactCanopyCredentials(headers) {
|
|
|
1238
1260
|
function stampWorkerHeaders(headers, ctx) {
|
|
1239
1261
|
headers.delete("host");
|
|
1240
1262
|
for (const stamp of IDENTITY_STAMP_HEADERS) headers.delete(stamp);
|
|
1241
|
-
headers.set(
|
|
1242
|
-
if (ctx.channel === "staging") headers.set(
|
|
1243
|
-
else headers.delete(
|
|
1263
|
+
headers.set(PROJECT_HEADER, ctx.projectSlug);
|
|
1264
|
+
if (ctx.channel === "staging") headers.set(CHANNEL_HEADER, "staging");
|
|
1265
|
+
else headers.delete(CHANNEL_HEADER);
|
|
1244
1266
|
return headers;
|
|
1245
1267
|
}
|
|
1246
1268
|
String.raw`// Canopy Workers-for-Platforms shim (generated by canopy-api — do not edit).
|
|
@@ -112,7 +112,7 @@ const upgradeCommand = defineCommand({
|
|
|
112
112
|
const spec = `${PACKAGE_NAME}@${args.version ?? "latest"}`;
|
|
113
113
|
const command = pmCommand(pm);
|
|
114
114
|
const cmd = installArgs(pm, spec);
|
|
115
|
-
const { skillInstalled } = await import("./skill-
|
|
115
|
+
const { skillInstalled } = await import("./skill-BXlKClK3.mjs");
|
|
116
116
|
const { homedir } = await import("node:os");
|
|
117
117
|
const refreshGlobal = skillInstalled(homedir());
|
|
118
118
|
const refreshRepo = process.cwd() !== homedir() && skillInstalled(process.cwd());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediamonks/canopy-cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.54",
|
|
4
4
|
"description": "Canopy CLI — create, develop and deploy Canopy projects.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"canopy": "./dist/index.mjs"
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"esbuild": "^0.28.1",
|
|
23
23
|
"hono": "^4.8.0",
|
|
24
24
|
"vite-server": "npm:vite@^7",
|
|
25
|
-
"@mediamonks/canopy
|
|
26
|
-
"@mediamonks/canopy": "0.0.
|
|
25
|
+
"@mediamonks/canopy": "0.0.20",
|
|
26
|
+
"@mediamonks/canopy-data-plane": "0.0.4"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^26.1.1",
|
package/dist/dev-CVC7elOr.mjs
DELETED