@deliverd/sdk 0.42.0 → 0.42.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deliverd/sdk",
3
- "version": "0.42.0",
3
+ "version": "0.42.1",
4
4
  "description": "Add human approval to any AI agent. Ask a person, wait for the answer, act on it. Start free at deliverd.dev.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/dev.ts CHANGED
@@ -73,6 +73,33 @@ export interface DevelopmentOptions {
73
73
 
74
74
  const DEFAULT_QUESTION = "Has this been through staging?";
75
75
 
76
+ /**
77
+ * Where development mode points when you want a real person to answer: a
78
+ * free account. Tagged so the site can count sign-ups that came from here.
79
+ */
80
+ export const DEVELOPMENT_SIGN_UP_URL =
81
+ "https://deliverd.dev/sign-up?utm_source=devmode&utm_medium=sdk&utm_campaign=typescript";
82
+
83
+ let hinted = false;
84
+
85
+ /**
86
+ * One line, once per process, after the first simulated approval: how to
87
+ * have a real person answer. Not in CI (nobody reads it there) and off with
88
+ * `DELIVERD_DEV_HINT=0`.
89
+ */
90
+ function hintOnce(): void {
91
+ if (hinted) return;
92
+ hinted = true;
93
+ const env = typeof process !== "undefined" ? process.env : {};
94
+ if (env.DELIVERD_DEV_HINT === "0" || env.CI) return;
95
+ console.log(` Ready for a real person to answer on their phone? Free account, no card: ${DEVELOPMENT_SIGN_UP_URL}\n`);
96
+ }
97
+
98
+ /** For tests: show the hint again. */
99
+ export function resetDevelopmentHint(): void {
100
+ hinted = false;
101
+ }
102
+
76
103
  let counter = 0;
77
104
 
78
105
  interface Stored {
@@ -176,7 +203,10 @@ export function developmentFetch(options: DevelopmentOptions = {}): typeof globa
176
203
  outcome,
177
204
  options,
178
205
  });
179
- if (options.log !== false) announce(data, outcome);
206
+ if (options.log !== false) {
207
+ announce(data, outcome);
208
+ hintOnce();
209
+ }
180
210
  return json(data, 201);
181
211
  }
182
212