@promptowl/contextnest-community 1.24.0 → 1.26.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.
Files changed (125) hide show
  1. package/API.md +177 -14
  2. package/CONFIGURATION.md +577 -116
  3. package/README.md +4 -3
  4. package/STEWARDSHIP.md +24 -0
  5. package/dist/{chunk-XUIWAWDO.js → chunk-2QOJE7A5.js} +4 -4
  6. package/dist/{chunk-2TPQTN4Y.js → chunk-DGPTJXIV.js} +47 -15
  7. package/dist/chunk-I5EDEZBQ.js +523 -0
  8. package/dist/{chunk-ZTT4U4NE.js → chunk-IEAWRHMV.js} +99 -12
  9. package/dist/{chunk-YVMSM7LS.js → chunk-LHWOJPFE.js} +7 -0
  10. package/dist/{chunk-5EZOPA47.js → chunk-M6PGYMBD.js} +20 -11
  11. package/dist/{chunk-F66VCBLA.js → chunk-PICUHQEM.js} +51 -2
  12. package/dist/{chunk-I3CSD6CK.js → chunk-RPGFHESR.js} +2 -2
  13. package/dist/{chunk-KIAAEHWL.js → chunk-SWA5M5XX.js} +88 -546
  14. package/dist/{chunk-LA3VTQ22.js → chunk-TRSGPS27.js} +81 -14
  15. package/dist/{engine-S3QBQ7LH.js → engine-QNMFDIBV.js} +4 -3
  16. package/dist/{external-edit-service-6FNFPOJJ.js → external-edit-service-4MEGPT4D.js} +5 -4
  17. package/dist/{grants-service-UT3EQ3R7.js → grants-service-24GLUBY4.js} +3 -3
  18. package/dist/index.js +1739 -583
  19. package/dist/invited-user-AM6A3WGO.js +12 -0
  20. package/dist/{migrations.postgres-AIQ7WSU7.js → migrations.postgres-HGSQ7IA5.js} +16 -2
  21. package/dist/{review-service-HHGOTO6P.js → review-service-2EWN7WWO.js} +8 -7
  22. package/dist/{stewardship-service-4DHNRULG.js → stewardship-service-TDZUC2Q6.js} +7 -4
  23. package/dist/{version-service-KIOQME6U.js → version-service-C3JTZLJH.js} +5 -4
  24. package/dist/web3/assets/ActivityTracePage-DzwWIjjx.js +1 -0
  25. package/dist/web3/assets/{AgentDocsPage-CIiaBqMy.js → AgentDocsPage-ixP2UdAE.js} +1 -1
  26. package/dist/web3/assets/CollaboratorManager-C9VAXZ0h.js +1 -0
  27. package/dist/web3/assets/CollaboratorsTab-tq4ZTexH.js +1 -0
  28. package/dist/web3/assets/DocumentEditor-C2CP2fiE.js +36 -0
  29. package/dist/web3/assets/DocumentsTab-Mh7KxUoB.js +6 -0
  30. package/dist/web3/assets/ExternalEditsTab-B_CWKXZ_.js +1 -0
  31. package/dist/web3/assets/MarkdownEditor-CKh4WSn-.js +653 -0
  32. package/dist/web3/assets/MarkdownEditor-ndtIx5x0.css +1 -0
  33. package/dist/web3/assets/NestPageHeader-Cizo8nUi.js +1 -0
  34. package/dist/web3/assets/NestView-EW-sraEb.js +73 -0
  35. package/dist/web3/assets/OverviewTab-CjidsMX_.js +6 -0
  36. package/dist/web3/assets/PersonCombobox-BKI7dff4.js +1 -0
  37. package/dist/web3/assets/{ReviewActions-OfOdqzCn.js → ReviewActions-CS8JXgXF.js} +2 -2
  38. package/dist/web3/assets/ReviewTab-CwVrXzw5.js +1 -0
  39. package/dist/web3/assets/StewardsTab-C-iP6gnh.js +1 -0
  40. package/dist/web3/assets/SubmitForReviewModal-Biq3m79i.js +1 -0
  41. package/dist/web3/assets/{alert-dialog-DTozKlmV.js → alert-dialog-BvF3NFr7.js} +2 -2
  42. package/dist/web3/assets/{arrow-left-BCKt4CwQ.js → arrow-left-CWIsv-sG.js} +1 -1
  43. package/dist/web3/assets/backlinks-Cqcn7n1J.js +19 -0
  44. package/dist/web3/assets/boxes-ClbgQqG2.js +6 -0
  45. package/dist/web3/assets/{chevron-left-BPwUT9DS.js → chevron-left-CK_ZPFm9.js} +1 -1
  46. package/dist/web3/assets/{circle-check-DI8IBGeo.js → circle-check-Bw_aTXiH.js} +1 -1
  47. package/dist/web3/assets/{circle-x-VKVhC88W.js → circle-x-DkIG68H7.js} +1 -1
  48. package/dist/web3/assets/client-attribution-BraarYaP.js +1 -0
  49. package/dist/web3/assets/{code-xml-CMabYZvH.js → code-xml-BlR7EN6l.js} +1 -1
  50. package/dist/web3/assets/{corner-down-right-BGxwK6wH.js → corner-down-right-DSVxK3tf.js} +1 -1
  51. package/dist/web3/assets/count-skeleton-DToLM74B.js +1 -0
  52. package/dist/web3/assets/{earth-BEp1EKTo.js → earth-BXhVPvCR.js} +1 -1
  53. package/dist/web3/assets/{file-exclamation-point-r8qZGIjP.js → file-exclamation-point-BevGZgtj.js} +1 -1
  54. package/dist/web3/assets/{folder-input-Cmtx1Jhk.js → folder-input-m8UBV4fA.js} +1 -1
  55. package/dist/web3/assets/{index-C1wTSjfP.js → index-BOVYgMvj.js} +1 -1
  56. package/dist/web3/assets/index-DVnaYqj9.css +1 -0
  57. package/dist/web3/assets/index-WYDmEOfO.js +404 -0
  58. package/dist/web3/assets/page-B6pkc9cd.js +2 -0
  59. package/dist/web3/assets/page-BJrFCKXB.js +1 -0
  60. package/dist/web3/assets/page-Bgy9Ng9p.js +1 -0
  61. package/dist/web3/assets/page-C2zoxumw.js +1 -0
  62. package/dist/web3/assets/page-CJWO06dN.js +1 -0
  63. package/dist/web3/assets/page-CptuAPJc.js +6 -0
  64. package/dist/web3/assets/page-DPY01SOj.js +1 -0
  65. package/dist/web3/assets/page-Dea2SblF.js +9 -0
  66. package/dist/web3/assets/page-Deq6IKiN.js +6 -0
  67. package/dist/web3/assets/page-Dfjg8p7Z.js +1 -0
  68. package/dist/web3/assets/{page-ByyVLDVo.js → page-Dh57L0RG.js} +5 -5
  69. package/dist/web3/assets/page-Dwbp4Seu.js +6 -0
  70. package/dist/web3/assets/{page-CHb0F5hV.js → page-DzKwP5Ds.js} +3 -3
  71. package/dist/web3/assets/page-YxjrE5b5.js +45 -0
  72. package/dist/web3/assets/{page-title-ClvvBsIo.js → page-title-DVq4qvMR.js} +1 -1
  73. package/dist/web3/assets/{play-C5YNKpAH.js → play-CXhS6Pgq.js} +1 -1
  74. package/dist/web3/assets/{send-0CHvmluT.js → send-DdfwnIrj.js} +1 -1
  75. package/dist/web3/assets/{settings-CeeF4LEb.js → settings-DKX0Q4gO.js} +1 -1
  76. package/dist/web3/assets/{share-2-CMnOlOt-.js → share-2-CxmXRt58.js} +1 -1
  77. package/dist/web3/assets/{tag-DQ_6J5Gv.js → tag-DeYC_mRv.js} +1 -1
  78. package/dist/web3/assets/{trash-2-HBi-Pslz.js → trash-2-B0HyPTnI.js} +1 -1
  79. package/dist/web3/assets/{user-plus-CvBNcpn4.js → user-plus-Ckm_Isyc.js} +1 -1
  80. package/dist/web3/assets/{x-By7piikG.js → x-mNtADYHc.js} +1 -1
  81. package/dist/web3/assets/zap-D2ifcnYb.js +16 -0
  82. package/dist/web3/index.html +2 -2
  83. package/package.json +3 -2
  84. package/dist/client-KEY4PYJH.js +0 -11
  85. package/dist/keys-CTOGAG3W.js +0 -20
  86. package/dist/web3/assets/ActivityTracePage-BOZHgJ8S.js +0 -1
  87. package/dist/web3/assets/CollaboratorManager-By91wrIr.js +0 -1
  88. package/dist/web3/assets/CollaboratorsTab-D1EE64Fs.js +0 -1
  89. package/dist/web3/assets/DocumentEditor-DrQfrW3d.js +0 -36
  90. package/dist/web3/assets/DocumentsTab-Vba-AzBv.js +0 -6
  91. package/dist/web3/assets/ExternalEditsTab-BSzAQIGM.js +0 -1
  92. package/dist/web3/assets/MarkdownEditor-74N_naNQ.css +0 -1
  93. package/dist/web3/assets/MarkdownEditor-C9zqZjC5.js +0 -643
  94. package/dist/web3/assets/NestPageHeader-CoLUV1Oz.js +0 -1
  95. package/dist/web3/assets/NestView-CTZ55tXD.js +0 -63
  96. package/dist/web3/assets/OverviewTab-Dxi-Hu-N.js +0 -1
  97. package/dist/web3/assets/PersonCombobox-CPOlNs6G.js +0 -1
  98. package/dist/web3/assets/ReasonDialog-DgLxfRWv.js +0 -1
  99. package/dist/web3/assets/ReviewTab-CyX8yxd3.js +0 -1
  100. package/dist/web3/assets/StewardsTab-DBEEfAQI.js +0 -1
  101. package/dist/web3/assets/SubmitForReviewModal-Ci2DdWs0.js +0 -1
  102. package/dist/web3/assets/backlinks-CYd4xENL.js +0 -24
  103. package/dist/web3/assets/card-XG2dP5Xf.js +0 -1
  104. package/dist/web3/assets/count-skeleton-DMbdpscX.js +0 -1
  105. package/dist/web3/assets/dates-BCxbm4_q.js +0 -1
  106. package/dist/web3/assets/index-BM-h3DwI.css +0 -1
  107. package/dist/web3/assets/index-EaX2yql0.js +0 -389
  108. package/dist/web3/assets/page-B3yvQvHy.js +0 -1
  109. package/dist/web3/assets/page-BExMvttJ.js +0 -1
  110. package/dist/web3/assets/page-BUOADv2X.js +0 -1
  111. package/dist/web3/assets/page-BYUFhYWZ.js +0 -1
  112. package/dist/web3/assets/page-Bicf02Cz.js +0 -1
  113. package/dist/web3/assets/page-BsPMDm5d.js +0 -45
  114. package/dist/web3/assets/page-CC0NJi8v.js +0 -1
  115. package/dist/web3/assets/page-CPjWQNKx.js +0 -11
  116. package/dist/web3/assets/page-CQt3ZGbf.js +0 -2
  117. package/dist/web3/assets/page-Cj1NetQ-.js +0 -1
  118. package/dist/web3/assets/page-CtaW65El.js +0 -1
  119. package/dist/web3/assets/page-DGOL9l8i.js +0 -6
  120. package/dist/web3/assets/refresh-cw-BhHzSH9m.js +0 -6
  121. package/dist/web3/assets/scroll-area-dRWncRqa.css +0 -1
  122. package/dist/web3/assets/scroll-area-hz-xtayP.js +0 -1
  123. package/dist/web3/assets/select-DBFTrUmI.js +0 -6
  124. package/dist/web3/assets/triangle-alert-CDy8-7sv.js +0 -6
  125. package/dist/web3/assets/zap-C2T8riBp.js +0 -11
@@ -2,11 +2,6 @@ import {
2
2
  ANON_USER_ID
3
3
  } from "./chunk-YB3LKF7U.js";
4
4
 
5
- // src/db/client.ts
6
- import Database from "better-sqlite3";
7
- import { mkdirSync, readFileSync } from "fs";
8
- import { dirname as dirname2 } from "path";
9
-
10
5
  // src/config.ts
11
6
  import { join, dirname } from "path";
12
7
  import { existsSync } from "fs";
@@ -356,6 +351,30 @@ var config = {
356
351
  get PEOPLE_SUGGEST_ALL_USERS() {
357
352
  return process.env.PEOPLE_SUGGEST_ALL_USERS === "true";
358
353
  },
354
+ /**
355
+ * Who may create nests. "admins" (default): server admins only, until the
356
+ * server is on a paid plan. "everyone": any signed-in user. Open mode is
357
+ * unaffected (everyone is admin there).
358
+ */
359
+ get NEST_CREATION() {
360
+ return process.env.NEST_CREATION?.trim().toLowerCase() === "everyone" ? "everyone" : "admins";
361
+ },
362
+ /**
363
+ * This server hosts several unrelated organizations (the PromptOwl-hosted
364
+ * deployment) rather than one company (a self-hosted install).
365
+ *
366
+ * OFF BY DEFAULT. Nest visibility 'org' means "every authenticated account
367
+ * on this deployment" (src/shared/access.ts) — on a single-company server
368
+ * that IS the organization, so the tier is safe to flip in one click. On a
369
+ * shared server it is every customer, so with this on: flipping a nest to
370
+ * 'org' needs the same explicit acknowledgement 'public' always needs
371
+ * (PATCH /nests/:id/visibility 409s without it — the server enforces it, not only the UI), and
372
+ * the UI words both tiers to say so. Exposed on /health as
373
+ * `shared_deployment`. Superadmin-togglable at runtime via /admin/settings.
374
+ */
375
+ get SHARED_DEPLOYMENT() {
376
+ return process.env.SHARED_DEPLOYMENT === "true";
377
+ },
359
378
  /**
360
379
  * Path to the .env file the server reads its config from and the license
361
380
  * install flow persists PROMPTOWL_KEY into. Defaults UNDER DATA_ROOT (not
@@ -537,6 +556,27 @@ var config = {
537
556
  }
538
557
  return raw;
539
558
  },
559
+ /**
560
+ * Email transport: "smtp" (SMTP_URL, default) or "ses" (AWS SES via the SDK,
561
+ * for deployments that can't use SMTP). Anything else falls back to smtp.
562
+ */
563
+ get EMAIL_PROVIDER() {
564
+ return process.env.EMAIL_PROVIDER?.trim().toLowerCase() === "ses" ? "ses" : "smtp";
565
+ },
566
+ /** AWS region for SES, e.g. us-east-1. Required when EMAIL_PROVIDER=ses. */
567
+ get SES_REGION() {
568
+ return process.env.SES_REGION?.trim() || null;
569
+ },
570
+ /**
571
+ * Optional static SES credentials. Both unset → the AWS default credential
572
+ * chain (IAM role, AWS_* env, shared profile). The secret is write-only.
573
+ */
574
+ get SES_ACCESS_KEY_ID() {
575
+ return process.env.SES_ACCESS_KEY_ID?.trim() || null;
576
+ },
577
+ get SES_SECRET_ACCESS_KEY() {
578
+ return process.env.SES_SECRET_ACCESS_KEY?.trim() || null;
579
+ },
540
580
  /**
541
581
  * From address for notification emails. Shape-validated here (not only in
542
582
  * the /admin/settings PATCH) so a value set directly via env/Docker can't
@@ -640,9 +680,25 @@ var config = {
640
680
  get VIDEO_MAX_BYTES() {
641
681
  const mb = parseInt(process.env.VIDEO_MAX_MB || "30", 10);
642
682
  return (Number.isFinite(mb) && mb > 0 ? mb : 30) * 1024 * 1024;
683
+ },
684
+ /**
685
+ * Max PDF upload size in bytes (POST /nests/:id/nodes/pdf). Default 25 MB —
686
+ * under Cloud Run's 32 MiB HTTP/1 request-body limit, with room for the
687
+ * multipart framing, so an oversized PDF is refused by our own check (413
688
+ * with a clear message) rather than by the platform. Read per request, so a
689
+ * change takes effect without a restart. Override via PDF_MAX_MB.
690
+ */
691
+ get PDF_MAX_BYTES() {
692
+ const mb = parseInt(process.env.PDF_MAX_MB || "25", 10);
693
+ return (Number.isFinite(mb) && mb > 0 ? mb : 25) * 1024 * 1024;
643
694
  }
644
695
  };
645
696
 
697
+ // src/db/client.ts
698
+ import Database from "better-sqlite3";
699
+ import { mkdirSync, readFileSync } from "fs";
700
+ import { dirname as dirname2 } from "path";
701
+
646
702
  // src/db/migrations.ts
647
703
  function runMigrations(db) {
648
704
  db.exec(`
@@ -828,6 +884,9 @@ function runMigrations(db) {
828
884
  if (!nestCols.includes("prime_tags")) {
829
885
  db.exec("ALTER TABLE nests ADD COLUMN prime_tags TEXT NOT NULL DEFAULT 'prime-document'");
830
886
  }
887
+ if (!nestCols.includes("creator_is_reviewer")) {
888
+ db.exec("ALTER TABLE nests ADD COLUMN creator_is_reviewer INTEGER NOT NULL DEFAULT 0");
889
+ }
831
890
  if (!nestCols.includes("index_synced_at")) {
832
891
  db.exec("ALTER TABLE nests ADD COLUMN index_synced_at TEXT");
833
892
  }
@@ -837,6 +896,9 @@ function runMigrations(db) {
837
896
  if (!nestCols.includes("reader_home_node")) {
838
897
  db.exec("ALTER TABLE nests ADD COLUMN reader_home_node TEXT");
839
898
  }
899
+ if (!nestCols.includes("branding_json")) {
900
+ db.exec("ALTER TABLE nests ADD COLUMN branding_json TEXT");
901
+ }
840
902
  const userCols = db.prepare("PRAGMA table_info(users)").all().map((c) => c.name);
841
903
  if (!userCols.includes("is_admin")) {
842
904
  db.exec("ALTER TABLE users ADD COLUMN is_admin INTEGER NOT NULL DEFAULT 0");
@@ -1781,6 +1843,18 @@ function runMigrations(db) {
1781
1843
  recordMigration("043_node_suggestion_details");
1782
1844
  })();
1783
1845
  }
1846
+ if (!hasMigration("044_client_attribution")) {
1847
+ for (const [table, col] of [
1848
+ ["node_versions", "client_json"],
1849
+ ["api_events", "client_json"]
1850
+ ]) {
1851
+ const cols = db.prepare(`PRAGMA table_info(${table})`).all().map((c) => c.name);
1852
+ if (cols.length && !cols.includes(col)) {
1853
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${col} TEXT`);
1854
+ }
1855
+ }
1856
+ recordMigration("044_client_attribution");
1857
+ }
1784
1858
  }
1785
1859
  function fkViolationCounts(db) {
1786
1860
  const rows = db.pragma("foreign_key_check");
@@ -2055,7 +2129,7 @@ async function initDb() {
2055
2129
  if (config.DB_DRIVER === "postgres") {
2056
2130
  const { Pool } = await import("pg");
2057
2131
  const { PostgresAdapter } = await import("./adapter.postgres-6VZCMPQL.js");
2058
- const { runPostgresMigrations } = await import("./migrations.postgres-AIQ7WSU7.js");
2132
+ const { runPostgresMigrations } = await import("./migrations.postgres-HGSQ7IA5.js");
2059
2133
  const pool = new Pool(buildPgConfig());
2060
2134
  adapter = new PostgresAdapter(pool);
2061
2135
  await runPostgresMigrations(adapter);
@@ -2075,18 +2149,11 @@ function getDb() {
2075
2149
  }
2076
2150
  return adapter;
2077
2151
  }
2078
- async function resetDb() {
2079
- if (adapter) {
2080
- await adapter.close();
2081
- adapter = null;
2082
- }
2083
- }
2084
2152
 
2085
2153
  export {
2086
2154
  isEmailish,
2087
2155
  isEmailListish,
2088
2156
  config,
2089
2157
  initDb,
2090
- getDb,
2091
- resetDb
2158
+ getDb
2092
2159
  };
@@ -2,9 +2,10 @@ import {
2
2
  engineApi,
3
3
  engineCache,
4
4
  opContext
5
- } from "./chunk-KIAAEHWL.js";
6
- import "./chunk-YVMSM7LS.js";
7
- import "./chunk-LA3VTQ22.js";
5
+ } from "./chunk-SWA5M5XX.js";
6
+ import "./chunk-LHWOJPFE.js";
7
+ import "./chunk-I5EDEZBQ.js";
8
+ import "./chunk-TRSGPS27.js";
8
9
  import "./chunk-YB3LKF7U.js";
9
10
  import "./chunk-FRQJWGN3.js";
10
11
  export {
@@ -11,10 +11,11 @@ import {
11
11
  scanNestForDrift,
12
12
  startDriftScanner,
13
13
  stopDriftScanner
14
- } from "./chunk-XUIWAWDO.js";
15
- import "./chunk-KIAAEHWL.js";
16
- import "./chunk-YVMSM7LS.js";
17
- import "./chunk-LA3VTQ22.js";
14
+ } from "./chunk-2QOJE7A5.js";
15
+ import "./chunk-SWA5M5XX.js";
16
+ import "./chunk-LHWOJPFE.js";
17
+ import "./chunk-I5EDEZBQ.js";
18
+ import "./chunk-TRSGPS27.js";
18
19
  import "./chunk-YB3LKF7U.js";
19
20
  import "./chunk-FRQJWGN3.js";
20
21
  export {
@@ -6,9 +6,9 @@ import {
6
6
  listGrants,
7
7
  listUserGrants,
8
8
  resolveNodeGrant
9
- } from "./chunk-I3CSD6CK.js";
10
- import "./chunk-YVMSM7LS.js";
11
- import "./chunk-LA3VTQ22.js";
9
+ } from "./chunk-RPGFHESR.js";
10
+ import "./chunk-LHWOJPFE.js";
11
+ import "./chunk-TRSGPS27.js";
12
12
  import "./chunk-YB3LKF7U.js";
13
13
  export {
14
14
  createGrant,