@caelo-cms/provisioning 0.12.8 → 0.12.10

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/agent-db.js CHANGED
@@ -7880,13 +7880,17 @@ var organizationJsonSchema = object({
7880
7880
  var siteDefaultsSetSeoInputSchema = object({
7881
7881
  siteBaseUrl: string2().min(1).max(2048).url("siteBaseUrl must be an absolute URL (https://example.com)"),
7882
7882
  sitemapEnabled: boolean2(),
7883
+ feedEnabled: boolean2(),
7884
+ indexNowEnabled: boolean2(),
7883
7885
  organizationJson: organizationJsonSchema.default({})
7884
7886
  }).strict();
7885
7887
  var siteSeoProposalInputSchema = object({
7886
7888
  siteBaseUrl: string2().min(1).max(2048).optional(),
7887
7889
  sitemapEnabled: boolean2().optional(),
7890
+ feedEnabled: boolean2().optional(),
7891
+ indexNowEnabled: boolean2().optional(),
7888
7892
  organizationJson: organizationJsonSchema.optional()
7889
- }).strict().refine((v) => v.siteBaseUrl !== undefined || v.sitemapEnabled !== undefined || v.organizationJson !== undefined, "pass at least one of `siteBaseUrl`, `sitemapEnabled`, `organizationJson`");
7893
+ }).strict().refine((v) => v.siteBaseUrl !== undefined || v.sitemapEnabled !== undefined || v.feedEnabled !== undefined || v.indexNowEnabled !== undefined || v.organizationJson !== undefined, "pass at least one of `siteBaseUrl`, `sitemapEnabled`, `feedEnabled`, `indexNowEnabled`, `organizationJson`");
7890
7894
 
7891
7895
  // ../shared/src/build-page.ts
7892
7896
  var contentValuesSchema2 = record(string2(), unknown());
@@ -9261,6 +9265,26 @@ var LIVE_TOPICS = [
9261
9265
  var TOPIC_SET = new Set(LIVE_TOPICS);
9262
9266
  // ../shared/src/markup-structure.ts
9263
9267
  var LEAF_TAGS = new Set(["svg", "math", "script", "style", "noscript", "iframe"]);
9268
+ // ../shared/src/mcp-access.ts
9269
+ var MCP_SURFACE_NAMES = ["chat", "power"];
9270
+ var LEGACY_POWER_SURFACE_NAME = "admin";
9271
+ var MCP_ADDRESS_NAMES = [
9272
+ ...MCP_SURFACE_NAMES,
9273
+ LEGACY_POWER_SURFACE_NAME
9274
+ ];
9275
+ var AI_WORK_PERMISSION = "content.write";
9276
+ var MCP_SURFACE_COPY = {
9277
+ chat: {
9278
+ title: "Chat with this site's AI",
9279
+ does: "The AI tool sends requests to Caelo's own AI, which builds and edits the site like the Live Edit chat does.",
9280
+ who: `Everyone who may edit content (${AI_WORK_PERMISSION}).`
9281
+ },
9282
+ power: {
9283
+ title: "Power-MCP: your AI tool does the work",
9284
+ does: "The AI tool gets every tool Caelo's AI has and does the work itself, on its own AI subscription, in the site's draft. Approval-gated actions still wait for a click in Caelo from someone whose role allows that change.",
9285
+ who: `Everyone who may edit content (${AI_WORK_PERMISSION}).`
9286
+ }
9287
+ };
9264
9288
  // ../shared/src/owner-setup-token.ts
9265
9289
  var OwnerBootstrapTokenSchema = object({
9266
9290
  token: string2().regex(/^[0-9a-f]{64}$/),
@@ -9413,6 +9437,25 @@ function err(error) {
9413
9437
  function isErr(result) {
9414
9438
  return !result.ok;
9415
9439
  }
9440
+ // ../shared/src/search-feed.ts
9441
+ var BUILD_CHANGE_KINDS = ["baseline", "added", "changed", "moved", "removed"];
9442
+ var pageChangeSchema = object({
9443
+ pageId: string2().uuid(),
9444
+ kind: _enum(BUILD_CHANGE_KINDS),
9445
+ url: string2().max(2048).nullable(),
9446
+ fingerprint: string2().regex(/^[0-9a-f]{64}$/).nullable(),
9447
+ pluginFingerprint: string2().regex(/^[0-9a-f]{64}$/).nullable(),
9448
+ title: string2().max(1000).nullable(),
9449
+ summary: string2().max(2000).nullable(),
9450
+ prevUrl: string2().max(2048).nullable(),
9451
+ changedAt: string2().datetime({ offset: true })
9452
+ }).strict().refine((c) => c.url === null === (c.fingerprint === null), "url and fingerprint go together").refine((c) => c.kind === "removed" === (c.url === null), "only a removed page has no url").refine((c) => c.url !== null || c.pluginFingerprint === null, "a removed page has no plugin fingerprint").refine((c) => c.url === null === (c.title === null) && c.url === null === (c.summary === null), "a live page has a title and a summary, a removed one neither");
9453
+ var buildSearchFeedSchema = object({
9454
+ base: number2().int().nonnegative().nullable(),
9455
+ changes: array(pageChangeSchema).max(500000),
9456
+ feedUrl: string2().max(2048).nullable(),
9457
+ indexNowKey: string2().regex(/^[A-Za-z0-9-]{8,128}$/).nullable()
9458
+ }).strict();
9416
9459
  // ../shared/src/session-cookie.ts
9417
9460
  var SESSION_ENTRY = {
9418
9461
  visitorId: "vid",
@@ -9608,6 +9651,7 @@ var manifestSchema = object({
9608
9651
  var RESERVED_ROOT_FILES = new Set([
9609
9652
  "robots.txt",
9610
9653
  "sitemap.xml",
9654
+ "feed.xml",
9611
9655
  "routing-manifest.json",
9612
9656
  "cdn_manifest.json",
9613
9657
  "render-deps.json"
@@ -19485,15 +19529,19 @@ function provisionedSchemaName(caller, ddl) {
19485
19529
  async function provisionPluginSchemaInTx(tx, caller, opts) {
19486
19530
  const schemaName = provisionedSchemaName(caller, opts.sql);
19487
19531
  const digest = createHash("sha256").update(opts.sql).digest("hex");
19488
- await tx.execute(sql.raw("SELECT set_config('caelo.actor_kind', 'system', true)"));
19489
- await tx.execute(sql`SELECT set_config('caelo.plugin_id', ${opts.pluginId}, true)`);
19490
- await tx.execute(sql`SELECT pg_advisory_xact_lock(hashtextextended(${`caelo:plugin-schema:${schemaName}`}, 0))`);
19491
- const recorded = await tx.execute(sql`
19492
- SELECT 1 FROM plugin_schema_provisions
19493
- WHERE schema_name = ${schemaName} AND sql_digest = ${digest}
19494
- AND to_regnamespace(${schemaName}) IS NOT NULL
19532
+ await tx.execute(sql`
19533
+ SELECT set_config('caelo.actor_kind', 'system', true),
19534
+ set_config('caelo.plugin_id', ${opts.pluginId}, true)
19495
19535
  `);
19496
- if (recorded.length > 0)
19536
+ const provisioned = async () => (await tx.execute(sql`
19537
+ SELECT 1 FROM plugin_schema_provisions
19538
+ WHERE schema_name = ${schemaName} AND sql_digest = ${digest}
19539
+ AND to_regnamespace(${schemaName}) IS NOT NULL
19540
+ `)).length > 0;
19541
+ if (await provisioned())
19542
+ return { schemaName, droppedColumns: [] };
19543
+ await tx.execute(sql`SELECT pg_advisory_xact_lock(hashtextextended(${`caelo:plugin-schema:${schemaName}`}, 0))`);
19544
+ if (await provisioned())
19497
19545
  return { schemaName, droppedColumns: [] };
19498
19546
  await tx.execute(sql.raw(opts.sql));
19499
19547
  const dropped = await tx.execute(sql.raw(`SELECT coalesce(current_setting('${DROPPED_COLUMNS_SETTING}', true), '') AS v`));
@@ -36,8 +36,16 @@
36
36
  */
37
37
  /**
38
38
  * The paths the MCP rule covers, as an anchored RE2 pattern (Cloud Armor's
39
- * `matches`): the two MCP endpoints and the broker's `oauth/<name>` and
40
- * `oauth/<name>/<surface>` routes — lowercase letters and hyphens only.
39
+ * `matches`): the MCP endpoints (`chat`, `power`, and `admin`, the Power
40
+ * surface's address before #1636) and the broker's `oauth/<name>` and
41
+ * `oauth/<name>/<address>` routes — lowercase letters and hyphens only.
42
+ *
43
+ * A path the pattern does not name is still served: the proxy's policy has
44
+ * no other rule, so it falls to the default (allow) and meets the proxy's
45
+ * own rate limit (apps/mcp-auth-proxy rate-limit.ts), which is the same
46
+ * 600 a minute. That is why #1636 could add `power` without a contract
47
+ * bump: an install gets the edge throttle for it with its next converge,
48
+ * and nothing depends on it until then (epic #763, decision E3).
41
49
  *
42
50
  * Deliberately not a prefix match. A `startsWith('/api/mcp/')` rule also
43
51
  * matches `/api/mcp/../forms/submit` or `/api/mcp/%2e%2e/comments`, which
@@ -48,7 +56,7 @@
48
56
  * The dotted metadata aliases (`/.well-known/…`, `oauth/.well-known/…`) are
49
57
  * one-off GETs per connection and stay under the general rules.
50
58
  */
51
- export declare const MCP_ARMOR_PATH_PATTERN = "^/api/mcp/(?:chat|admin|oauth/[a-z-]+(?:/[a-z-]+)?)$";
59
+ export declare const MCP_ARMOR_PATH_PATTERN = "^/api/mcp/(?:chat|power|admin|oauth/[a-z-]+(?:/[a-z-]+)?)$";
52
60
  /** The general per-IP ban rule and the OWASP rule packs the MCP rule must precede. */
53
61
  export declare const GENERAL_RATE_LIMIT_PRIORITY = 1000;
54
62
  export declare const OWASP_RULE_PRIORITIES: readonly number[];
@@ -56,7 +64,7 @@ export declare const OWASP_RULE_PRIORITIES: readonly number[];
56
64
  export declare const MCP_ARMOR_RULE: {
57
65
  readonly priority: 900;
58
66
  readonly description: "Caelo remote MCP: per-IP throttle sized for agent traffic; skips the OWASP packs";
59
- readonly expression: "request.path.matches('^/api/mcp/(?:chat|admin|oauth/[a-z-]+(?:/[a-z-]+)?)$')";
67
+ readonly expression: "request.path.matches('^/api/mcp/(?:chat|power|admin|oauth/[a-z-]+(?:/[a-z-]+)?)$')";
60
68
  readonly action: "throttle";
61
69
  /** Requests per {@link MCP_ARMOR_RULE.intervalSec} per source IP. */
62
70
  readonly count: 600;
@@ -72,7 +80,7 @@ export declare function mcpArmorRuleArgs(): {
72
80
  description: "Caelo remote MCP: per-IP throttle sized for agent traffic; skips the OWASP packs";
73
81
  match: {
74
82
  expr: {
75
- expression: "request.path.matches('^/api/mcp/(?:chat|admin|oauth/[a-z-]+(?:/[a-z-]+)?)$')";
83
+ expression: "request.path.matches('^/api/mcp/(?:chat|power|admin|oauth/[a-z-]+(?:/[a-z-]+)?)$')";
76
84
  };
77
85
  };
78
86
  rateLimitOptions: {
@@ -1 +1 @@
1
- {"version":3,"file":"remote-mcp-edge.d.ts","sourceRoot":"","sources":["../src/remote-mcp-edge.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,yDAAyD,CAAC;AAE7F,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAChD,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAAiB,CAAC;AAErE,0FAA0F;AAC1F,eAAO,MAAM,cAAc;;;;;IAKzB,qEAAqE;;;;;;CAM7D,CAAC;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AAqE;;;;;;CAM7D,CAAC;AAEX,qFAAqF;AACrF,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;EAc/B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAa5C;AAED,gGAAgG;AAChG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE;YAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACtE,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAC1B,QAAQ,CAAC,kBAAkB,CAAC,EAAE;YAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACzF,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;KAChC,CAAC;CACH;AAED,6DAA6D;AAC7D,wBAAgB,cAAc,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAa3D"}
@@ -37,8 +37,16 @@
37
37
  */
38
38
  /**
39
39
  * The paths the MCP rule covers, as an anchored RE2 pattern (Cloud Armor's
40
- * `matches`): the two MCP endpoints and the broker's `oauth/<name>` and
41
- * `oauth/<name>/<surface>` routes — lowercase letters and hyphens only.
40
+ * `matches`): the MCP endpoints (`chat`, `power`, and `admin`, the Power
41
+ * surface's address before #1636) and the broker's `oauth/<name>` and
42
+ * `oauth/<name>/<address>` routes — lowercase letters and hyphens only.
43
+ *
44
+ * A path the pattern does not name is still served: the proxy's policy has
45
+ * no other rule, so it falls to the default (allow) and meets the proxy's
46
+ * own rate limit (apps/mcp-auth-proxy rate-limit.ts), which is the same
47
+ * 600 a minute. That is why #1636 could add `power` without a contract
48
+ * bump: an install gets the edge throttle for it with its next converge,
49
+ * and nothing depends on it until then (epic #763, decision E3).
42
50
  *
43
51
  * Deliberately not a prefix match. A `startsWith('/api/mcp/')` rule also
44
52
  * matches `/api/mcp/../forms/submit` or `/api/mcp/%2e%2e/comments`, which
@@ -49,7 +57,7 @@
49
57
  * The dotted metadata aliases (`/.well-known/…`, `oauth/.well-known/…`) are
50
58
  * one-off GETs per connection and stay under the general rules.
51
59
  */
52
- export const MCP_ARMOR_PATH_PATTERN = "^/api/mcp/(?:chat|admin|oauth/[a-z-]+(?:/[a-z-]+)?)$";
60
+ export const MCP_ARMOR_PATH_PATTERN = "^/api/mcp/(?:chat|power|admin|oauth/[a-z-]+(?:/[a-z-]+)?)$";
53
61
  /** The general per-IP ban rule and the OWASP rule packs the MCP rule must precede. */
54
62
  export const GENERAL_RATE_LIMIT_PRIORITY = 1000;
55
63
  export const OWASP_RULE_PRIORITIES = [2000, 2001];
@@ -1 +1 @@
1
- {"version":3,"file":"remote-mcp-edge.js","sourceRoot":"","sources":["../src/remote-mcp-edge.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,sDAAsD,CAAC;AAE7F,sFAAsF;AACtF,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAErE,0FAA0F;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,QAAQ,EAAE,GAAG;IACb,WAAW,EAAE,kFAAkF;IAC/F,UAAU,EAAE,yBAAyB,sBAAsB,IAAI;IAC/D,MAAM,EAAE,UAAU;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K,CAAC,CAAC,UAAU;QAC7C,CAAC,EAAE,kBAAkB,EAAE,KAAK,KAAK,CAAC,CAAC,KAAK;QACxC,CAAC,EAAE,kBAAkB,EAAE,WAAW,KAAK,CAAC,CAAC,WAAW;QACpD,CAAC,EAAE,aAAa,KAAK,CAAC,CAAC,aAAa;QACpC,CAAC,EAAE,YAAY,KAAK,CAAC,CAAC,YAAY;QAClC,CAAC,CAAC,EAAE,YAAY,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,YAAY,CAC9C,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caelo-cms/provisioning",
3
- "version": "0.12.8",
3
+ "version": "0.12.10",
4
4
  "private": false,
5
5
  "license": "MPL-2.0",
6
6
  "description": "Pulumi-driven provisioning for Caelo CMS — `bunx @caelo-cms/provisioning --provider <self-hosted|gcp|aws|azure>` brings up a TLS-served install with Postgres + storage + secrets manager + the admin + the API gateway.",
@@ -40,7 +40,7 @@
40
40
  "prepublishOnly": "tsc -b --force && bun build ../platform-updater/src/agent-db.ts --target=bun --outfile=dist/agent-db.js && tsc --project stacks/gcp/tsconfig.json && tsc --project stacks/gcp-firebase/tsconfig.json"
41
41
  },
42
42
  "dependencies": {
43
- "@caelo-cms/shared": "^0.12.8",
43
+ "@caelo-cms/shared": "^0.12.10",
44
44
  "@clack/prompts": "1.9.0",
45
45
  "@pulumi/command": "^1",
46
46
  "@pulumi/gcp": "^10",
@@ -39,8 +39,16 @@
39
39
 
40
40
  /**
41
41
  * The paths the MCP rule covers, as an anchored RE2 pattern (Cloud Armor's
42
- * `matches`): the two MCP endpoints and the broker's `oauth/<name>` and
43
- * `oauth/<name>/<surface>` routes — lowercase letters and hyphens only.
42
+ * `matches`): the MCP endpoints (`chat`, `power`, and `admin`, the Power
43
+ * surface's address before #1636) and the broker's `oauth/<name>` and
44
+ * `oauth/<name>/<address>` routes — lowercase letters and hyphens only.
45
+ *
46
+ * A path the pattern does not name is still served: the proxy's policy has
47
+ * no other rule, so it falls to the default (allow) and meets the proxy's
48
+ * own rate limit (apps/mcp-auth-proxy rate-limit.ts), which is the same
49
+ * 600 a minute. That is why #1636 could add `power` without a contract
50
+ * bump: an install gets the edge throttle for it with its next converge,
51
+ * and nothing depends on it until then (epic #763, decision E3).
44
52
  *
45
53
  * Deliberately not a prefix match. A `startsWith('/api/mcp/')` rule also
46
54
  * matches `/api/mcp/../forms/submit` or `/api/mcp/%2e%2e/comments`, which
@@ -51,7 +59,7 @@
51
59
  * The dotted metadata aliases (`/.well-known/…`, `oauth/.well-known/…`) are
52
60
  * one-off GETs per connection and stay under the general rules.
53
61
  */
54
- export const MCP_ARMOR_PATH_PATTERN = "^/api/mcp/(?:chat|admin|oauth/[a-z-]+(?:/[a-z-]+)?)$";
62
+ export const MCP_ARMOR_PATH_PATTERN = "^/api/mcp/(?:chat|power|admin|oauth/[a-z-]+(?:/[a-z-]+)?)$";
55
63
 
56
64
  /** The general per-IP ban rule and the OWASP rule packs the MCP rule must precede. */
57
65
  export const GENERAL_RATE_LIMIT_PRIORITY = 1000;
@@ -649,6 +649,8 @@ describe("gcp load balancer (remote-mcp-edge)", () => {
649
649
  const re = new RegExp(MCP_ARMOR_PATH_PATTERN);
650
650
  for (const p of [
651
651
  "/api/mcp/chat",
652
+ "/api/mcp/power",
653
+ // The Power surface's address before #1636; connectors still use it.
652
654
  "/api/mcp/admin",
653
655
  "/api/mcp/oauth/authorize",
654
656
  "/api/mcp/oauth/google-callback",
@@ -678,7 +680,9 @@ describe("gcp load balancer (remote-mcp-edge)", () => {
678
680
  const documented = [...routes.matchAll(/^ \* {3}[A-Z|]+ +(\/api\/mcp\/[^\s]+)/gm)]
679
681
  .map((m) => m[1] as string)
680
682
  .flatMap((p) =>
681
- p.includes("{") ? ["chat", "admin"].map((s) => p.replace(/\{(chat,admin|s)\}/, s)) : [p],
683
+ p.includes("{")
684
+ ? ["chat", "power", "admin"].map((s) => p.replace(/\{(chat,power,admin|s)\}/, s))
685
+ : [p],
682
686
  );
683
687
  expect(documented).toContain("/api/mcp/oauth/authorize");
684
688
  expect(documented.length).toBeGreaterThanOrEqual(8);