@nextcommerce/campaigns-os 1.37.3 → 1.41.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.
Files changed (49) hide show
  1. package/AGENTS.md +114 -10
  2. package/CHANGELOG.md +530 -0
  3. package/README.md +38 -27
  4. package/contracts/agent-relevant-change-policy.v1.json +11 -1
  5. package/contracts/effects.v1.json +4794 -0
  6. package/contracts/release-ledger.json +789 -0
  7. package/contracts/supported-surface.json +25 -5
  8. package/docs/build-packet.md +27 -16
  9. package/docs/demo-preview.md +1 -1
  10. package/docs/diagnostics.md +7 -4
  11. package/docs/effects.md +281 -0
  12. package/docs/gateway-login.md +113 -0
  13. package/docs/orientation-contract-reference.md +4 -1
  14. package/docs/progress-snapshots.md +3 -3
  15. package/docs/qa-and-test-orders.md +3 -3
  16. package/docs/readback.md +523 -0
  17. package/docs/runtime-readiness.md +1 -1
  18. package/docs/sdk-storage-compatibility.md +1 -1
  19. package/docs/skills-revision.md +364 -0
  20. package/docs/supported-surface.md +11 -3
  21. package/docs/versioning.md +8 -4
  22. package/package.json +8 -3
  23. package/schemas/campaign-runtime-build-packet.v0.schema.json +5 -0
  24. package/schemas/campaigns-os-effects.v1.schema.json +211 -0
  25. package/schemas/campaigns-os-readback.v2.schema.json +267 -0
  26. package/skills/campaign-lifecycle-orientation/SKILL.md +174 -0
  27. package/skills/campaign-readback-classification/SKILL.md +230 -0
  28. package/skills/campaign-run-evidence/SKILL.md +140 -0
  29. package/skills/contribution-intake/SKILL.md +85 -0
  30. package/skills/next-campaigns-build/SKILL.md +33 -12
  31. package/skills/next-campaigns-os/SKILL.md +45 -21
  32. package/skills/next-campaigns-os-setup/SKILL.md +35 -14
  33. package/skills/next-campaigns-polish/SKILL.md +43 -17
  34. package/skills/next-campaigns-qa/SKILL.md +48 -24
  35. package/skills.json +39 -6
  36. package/src/admin-transport.mjs +123 -0
  37. package/src/cli.mjs +991 -200
  38. package/src/credential-store.mjs +183 -0
  39. package/src/deviation.mjs +3 -2
  40. package/src/diagnostic.mjs +4 -1
  41. package/src/gate-actions.mjs +2 -2
  42. package/src/install-mode.mjs +17 -9
  43. package/src/lifecycle.mjs +95 -0
  44. package/src/login.mjs +152 -0
  45. package/src/package-install-fixture.mjs +3 -2
  46. package/src/qa-node.mjs +56 -19
  47. package/src/qa-publish.mjs +108 -2
  48. package/src/readback.mjs +1936 -0
  49. package/src/remit.mjs +17 -3
package/src/remit.mjs CHANGED
@@ -81,6 +81,22 @@ export function assertSecureProxyBase(proxyBase, { label = "Remit", credential =
81
81
  throw new Error(`${label}: --proxy-base must be https (or a loopback host for local testing); declining to send ${subject} over ${url.protocol}//${url.host}.`);
82
82
  }
83
83
 
84
+ /**
85
+ * The transport's OTHER precondition, checked before the destination gate: a
86
+ * fetch to send with. Exported because a preview must make it too — `qa
87
+ * publish --dry-run` and `run-record --dry-run` call this exact function, so a
88
+ * runtime without a global fetch refuses the dry path by the same message the
89
+ * real send throws, instead of previewing a POST that cannot be made.
90
+ * Throws; returns nothing. There is no default: the caller passes the fetch it
91
+ * would actually send with, so `assertFetchAvailable(undefined)` is a refusal
92
+ * rather than a silent fallback to the global that may not be there either.
93
+ */
94
+ export function assertFetchAvailable(fetchImpl) {
95
+ if (typeof fetchImpl !== "function") {
96
+ throw new Error("Global fetch is not available. Upgrade to Node 18+ or pass fetchImpl.");
97
+ }
98
+ }
99
+
84
100
  function byteLength(value) {
85
101
  return Buffer.byteLength(String(value), "utf8");
86
102
  }
@@ -158,9 +174,7 @@ export async function remit(path, payload, proxyBase, {
158
174
  credential = undefined,
159
175
  onResponse = null,
160
176
  } = {}) {
161
- if (typeof fetchImpl !== "function") {
162
- throw new Error("Global fetch is not available. Upgrade to Node 18+ or pass fetchImpl.");
163
- }
177
+ assertFetchAvailable(fetchImpl);
164
178
  // What the gate says must match what this request actually carries. A caller
165
179
  // that names its credential wins; otherwise infer it from the headers this
166
180
  // module knows carry one (never from a bare Accept or Content-Type), so a