lane-sdk 0.2.2 → 0.2.8

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 (40) hide show
  1. package/SKILL.md +24 -0
  2. package/dist/adapters/crewai/index.cjs +36 -4
  3. package/dist/adapters/crewai/index.cjs.map +1 -1
  4. package/dist/adapters/crewai/index.js +36 -4
  5. package/dist/adapters/crewai/index.js.map +1 -1
  6. package/dist/adapters/langchain/index.cjs +36 -4
  7. package/dist/adapters/langchain/index.cjs.map +1 -1
  8. package/dist/adapters/langchain/index.js +36 -4
  9. package/dist/adapters/langchain/index.js.map +1 -1
  10. package/dist/adapters/openai/index.cjs +36 -4
  11. package/dist/adapters/openai/index.cjs.map +1 -1
  12. package/dist/adapters/openai/index.js +36 -4
  13. package/dist/adapters/openai/index.js.map +1 -1
  14. package/dist/adapters/vercel-ai/index.cjs +36 -4
  15. package/dist/adapters/vercel-ai/index.cjs.map +1 -1
  16. package/dist/adapters/vercel-ai/index.js +36 -4
  17. package/dist/adapters/vercel-ai/index.js.map +1 -1
  18. package/dist/cli/index.js +214 -40
  19. package/dist/cli/index.js.map +1 -1
  20. package/dist/index.cjs +36 -4
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.js +36 -4
  23. package/dist/index.js.map +1 -1
  24. package/dist/server/routes/export.cjs +2 -4
  25. package/dist/server/routes/export.cjs.map +1 -1
  26. package/dist/server/routes/export.js +2 -4
  27. package/dist/server/routes/export.js.map +1 -1
  28. package/dist/server/vic-demo.js +1052 -0
  29. package/dist/server/vic-demo.js.map +1 -0
  30. package/dist/server-http.cjs +36 -4
  31. package/dist/server-http.cjs.map +1 -1
  32. package/dist/server-http.js +36 -4
  33. package/dist/server-http.js.map +1 -1
  34. package/dist/server-stdio.cjs +36 -4
  35. package/dist/server-stdio.cjs.map +1 -1
  36. package/dist/server-stdio.js +36 -4
  37. package/dist/server-stdio.js.map +1 -1
  38. package/package.json +6 -3
  39. package/dist/server/routes/export.d.cts +0 -10
  40. package/dist/server/routes/export.d.ts +0 -10
package/SKILL.md CHANGED
@@ -54,6 +54,28 @@ Lane is a **card-on-file** platform. No prepaid wallets, no deposits, no balance
54
54
 
55
55
  Complete these steps before using any Lane commands.
56
56
 
57
+ ### Choose Mode
58
+
59
+ Before setup, determine which mode to use. **Ask the user:**
60
+
61
+ > Would you like to use **demo mode** (no real card required, mock payments) or **production mode** (real payments with a real card)?
62
+
63
+ **Demo mode** — For trying out Lane without real credentials:
64
+
65
+ ```bash
66
+ npx lane init --demo
67
+ npx lane login -t
68
+ npx lane status -t
69
+ ```
70
+
71
+ In demo mode:
72
+ - No real card or wallet setup needed — payments are simulated against the demo server
73
+ - **Use web search** to find merchants and products (not `lane merchant list` or `lane product search`)
74
+ - All `lane pay` commands work and return mock transaction receipts
75
+ - After running `lane init --demo`, skip Steps 1–4 below and go straight to **Make Payments**
76
+
77
+ **Production mode** — For real transactions with a real card, continue with Steps 1–4 below.
78
+
57
79
  ### Step 1: Verify Node.js
58
80
 
59
81
  ```bash
@@ -118,6 +140,8 @@ If `ready=false` or `authenticated=false`, guide the user through setup above be
118
140
 
119
141
  ## Discover Merchants & Products
120
142
 
143
+ > **Demo mode note:** In demo mode, merchant and product discovery commands are not available. Instead, search the web to find merchants and products, then use `lane pay` with the merchant domain as the recipient.
144
+
121
145
  ### List Lane-Onboarded Merchants (Instant Checkout)
122
146
 
123
147
  ```bash
@@ -1127,13 +1127,38 @@ var FileTokenStore = class {
1127
1127
  function isNodeError(err) {
1128
1128
  return err instanceof Error && "code" in err;
1129
1129
  }
1130
-
1131
- // src/config.ts
1132
1130
  var DEFAULT_BASE_URL = "https://api.getonlane.com";
1133
1131
  var DEFAULT_API_URL = "https://api.getonlane.com";
1134
1132
  var DEFAULT_TIMEOUT = 3e4;
1135
1133
  var DEFAULT_MAX_RETRIES = 2;
1134
+ async function readPersistentConfig() {
1135
+ try {
1136
+ const raw = await promises.readFile(path.join(os.homedir(), ".lane", "config.json"), "utf-8");
1137
+ return JSON.parse(raw);
1138
+ } catch {
1139
+ return null;
1140
+ }
1141
+ }
1136
1142
  async function resolveConfig(options = {}, tokenStore) {
1143
+ const persistent = await readPersistentConfig();
1144
+ if (persistent?.demo && process.env["LANE_DEMO"] !== "false") {
1145
+ process.env["LANE_DEMO"] = "true";
1146
+ if (persistent.demoUrl && !process.env["LANE_DEMO_URL"]) {
1147
+ process.env["LANE_DEMO_URL"] = persistent.demoUrl;
1148
+ }
1149
+ }
1150
+ if (process.env["LANE_DEMO"] === "true") {
1151
+ const demoBaseUrl = process.env["LANE_DEMO_URL"] ?? "http://localhost:3020";
1152
+ return Object.freeze({
1153
+ apiKey: options.apiKey ?? process.env["LANE_API_KEY"] ?? "lane_sk_demo_000000000000",
1154
+ baseUrl: demoBaseUrl,
1155
+ apiUrl: demoBaseUrl,
1156
+ testMode: true,
1157
+ timeout: options.timeout ?? DEFAULT_TIMEOUT,
1158
+ maxRetries: options.maxRetries ?? DEFAULT_MAX_RETRIES,
1159
+ circuitBreaker: void 0
1160
+ });
1161
+ }
1137
1162
  let apiKey = options.apiKey;
1138
1163
  if (!apiKey) {
1139
1164
  apiKey = process.env["LANE_API_KEY"];
@@ -2716,7 +2741,9 @@ var Lane = class _Lane {
2716
2741
  } catch {
2717
2742
  _Lane._throwWaitlistError();
2718
2743
  }
2719
- await _Lane._verifyAccess(config);
2744
+ if (process.env["LANE_DEMO"] !== "true") {
2745
+ await _Lane._verifyAccess(config);
2746
+ }
2720
2747
  return new _Lane(config);
2721
2748
  }
2722
2749
  /**
@@ -3190,6 +3217,7 @@ var BiometricVerifier = class {
3190
3217
  async tryWebAuthn(reason, instructionId) {
3191
3218
  const { createServer } = await import('http');
3192
3219
  const open = (await import('open')).default;
3220
+ const { hostname } = await import('os');
3193
3221
  return new Promise((resolve, reject) => {
3194
3222
  const server = createServer((req, res) => {
3195
3223
  const url = new URL(req.url ?? "/", "http://localhost");
@@ -3201,7 +3229,11 @@ var BiometricVerifier = class {
3201
3229
  '<!DOCTYPE html><html><body style="font-family:sans-serif;display:flex;justify-content:center;align-items:center;height:100vh"><h1 style="color:#10b981">Verified</h1></body></html>'
3202
3230
  );
3203
3231
  cleanup();
3204
- resolve({ method: "webauthn_passkey", timestamp: (/* @__PURE__ */ new Date()).toISOString() });
3232
+ resolve({
3233
+ method: "webauthn_passkey",
3234
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
3235
+ machineId: `webauthn_${hostname()}`
3236
+ });
3205
3237
  return;
3206
3238
  }
3207
3239
  res.writeHead(200, { "Content-Type": "text/html" });