lane-sdk 0.2.3 → 0.2.9
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.
Potentially problematic release.
This version of lane-sdk might be problematic. Click here for more details.
- package/SKILL.md +148 -20
- package/dist/adapters/crewai/index.cjs +36 -4
- package/dist/adapters/crewai/index.cjs.map +1 -1
- package/dist/adapters/crewai/index.js +36 -4
- package/dist/adapters/crewai/index.js.map +1 -1
- package/dist/adapters/langchain/index.cjs +36 -4
- package/dist/adapters/langchain/index.cjs.map +1 -1
- package/dist/adapters/langchain/index.js +36 -4
- package/dist/adapters/langchain/index.js.map +1 -1
- package/dist/adapters/openai/index.cjs +36 -4
- package/dist/adapters/openai/index.cjs.map +1 -1
- package/dist/adapters/openai/index.js +36 -4
- package/dist/adapters/openai/index.js.map +1 -1
- package/dist/adapters/vercel-ai/index.cjs +36 -4
- package/dist/adapters/vercel-ai/index.cjs.map +1 -1
- package/dist/adapters/vercel-ai/index.js +36 -4
- package/dist/adapters/vercel-ai/index.js.map +1 -1
- package/dist/cli/index.js +264 -40
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/postinstall.js +2 -0
- package/dist/cli/postinstall.js.map +1 -1
- package/dist/index.cjs +36 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -4
- package/dist/index.js.map +1 -1
- package/dist/server/vic-demo.js +1052 -0
- package/dist/server/vic-demo.js.map +1 -0
- package/dist/server-http.cjs +36 -4
- package/dist/server-http.cjs.map +1 -1
- package/dist/server-http.js +36 -4
- package/dist/server-http.js.map +1 -1
- package/dist/server-stdio.cjs +36 -4
- package/dist/server-stdio.cjs.map +1 -1
- package/dist/server-stdio.js +36 -4
- package/dist/server-stdio.js.map +1 -1
- package/package.json +6 -2
package/dist/cli/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from "module";
|
|
3
|
+
const require = __createRequire(import.meta.url);
|
|
2
4
|
var __create = Object.create;
|
|
3
5
|
var __defProp = Object.defineProperty;
|
|
4
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -4726,8 +4728,8 @@ var init_token_store = __esm({
|
|
|
4726
4728
|
*/
|
|
4727
4729
|
async clear() {
|
|
4728
4730
|
try {
|
|
4729
|
-
const { unlink } = await import("fs/promises");
|
|
4730
|
-
await
|
|
4731
|
+
const { unlink: unlink2 } = await import("fs/promises");
|
|
4732
|
+
await unlink2(this.filePath);
|
|
4731
4733
|
} catch (err) {
|
|
4732
4734
|
if (isNodeError(err) && err.code === "ENOENT") {
|
|
4733
4735
|
return;
|
|
@@ -4774,7 +4776,37 @@ var init_token_store = __esm({
|
|
|
4774
4776
|
});
|
|
4775
4777
|
|
|
4776
4778
|
// src/config.ts
|
|
4779
|
+
import { readFile as readFile2 } from "fs/promises";
|
|
4780
|
+
import { join as join2 } from "path";
|
|
4781
|
+
import { homedir as homedir2 } from "os";
|
|
4782
|
+
async function readPersistentConfig() {
|
|
4783
|
+
try {
|
|
4784
|
+
const raw = await readFile2(join2(homedir2(), ".lane", "config.json"), "utf-8");
|
|
4785
|
+
return JSON.parse(raw);
|
|
4786
|
+
} catch {
|
|
4787
|
+
return null;
|
|
4788
|
+
}
|
|
4789
|
+
}
|
|
4777
4790
|
async function resolveConfig(options = {}, tokenStore) {
|
|
4791
|
+
const persistent = await readPersistentConfig();
|
|
4792
|
+
if (persistent?.demo && process.env["LANE_DEMO"] !== "false") {
|
|
4793
|
+
process.env["LANE_DEMO"] = "true";
|
|
4794
|
+
if (persistent.demoUrl && !process.env["LANE_DEMO_URL"]) {
|
|
4795
|
+
process.env["LANE_DEMO_URL"] = persistent.demoUrl;
|
|
4796
|
+
}
|
|
4797
|
+
}
|
|
4798
|
+
if (process.env["LANE_DEMO"] === "true") {
|
|
4799
|
+
const demoBaseUrl = process.env["LANE_DEMO_URL"] ?? "http://localhost:3020";
|
|
4800
|
+
return Object.freeze({
|
|
4801
|
+
apiKey: options.apiKey ?? process.env["LANE_API_KEY"] ?? "lane_sk_demo_000000000000",
|
|
4802
|
+
baseUrl: demoBaseUrl,
|
|
4803
|
+
apiUrl: demoBaseUrl,
|
|
4804
|
+
testMode: true,
|
|
4805
|
+
timeout: options.timeout ?? DEFAULT_TIMEOUT,
|
|
4806
|
+
maxRetries: options.maxRetries ?? DEFAULT_MAX_RETRIES,
|
|
4807
|
+
circuitBreaker: void 0
|
|
4808
|
+
});
|
|
4809
|
+
}
|
|
4778
4810
|
let apiKey = options.apiKey;
|
|
4779
4811
|
if (!apiKey) {
|
|
4780
4812
|
apiKey = process.env["LANE_API_KEY"];
|
|
@@ -6583,7 +6615,9 @@ var init_lane = __esm({
|
|
|
6583
6615
|
} catch {
|
|
6584
6616
|
_Lane._throwWaitlistError();
|
|
6585
6617
|
}
|
|
6586
|
-
|
|
6618
|
+
if (process.env["LANE_DEMO"] !== "true") {
|
|
6619
|
+
await _Lane._verifyAccess(config);
|
|
6620
|
+
}
|
|
6587
6621
|
return new _Lane(config);
|
|
6588
6622
|
}
|
|
6589
6623
|
/**
|
|
@@ -12113,6 +12147,7 @@ var init_node_figlet = __esm({
|
|
|
12113
12147
|
// src/cli/onboarding.ts
|
|
12114
12148
|
var onboarding_exports = {};
|
|
12115
12149
|
__export(onboarding_exports, {
|
|
12150
|
+
showDemoOnboarding: () => showDemoOnboarding,
|
|
12116
12151
|
showOnboarding: () => showOnboarding
|
|
12117
12152
|
});
|
|
12118
12153
|
function sleep2(ms) {
|
|
@@ -12169,6 +12204,32 @@ async function showOnboarding(email) {
|
|
|
12169
12204
|
console.log(source_default.white(' Welcome to Lane. Try: lane product search "headphones"'));
|
|
12170
12205
|
}
|
|
12171
12206
|
}
|
|
12207
|
+
async function showDemoOnboarding() {
|
|
12208
|
+
const env2 = detectEnvironment();
|
|
12209
|
+
const tier = getTier(env2);
|
|
12210
|
+
const success3 = source_default.hex("#22C55E");
|
|
12211
|
+
if (tier === 1 && env2.isTTY) {
|
|
12212
|
+
console.log(brand(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"));
|
|
12213
|
+
console.log(brand(" \u2551") + source_default.white(" ") + brand("\u2551"));
|
|
12214
|
+
console.log(brand(" \u2551") + " " + success3("\u2713") + source_default.white(" Demo server connected".padEnd(33)) + brand("\u2551"));
|
|
12215
|
+
console.log(brand(" \u2551") + " " + success3("\u2713") + source_default.white(" Wallet: $1,000.00 balance".padEnd(33)) + brand("\u2551"));
|
|
12216
|
+
console.log(brand(" \u2551") + " " + success3("\u2713") + source_default.white(" Card: Visa ****4242".padEnd(33)) + brand("\u2551"));
|
|
12217
|
+
console.log(brand(" \u2551") + " " + success3("\u2713") + source_default.white(" Ready to make payments".padEnd(33)) + brand("\u2551"));
|
|
12218
|
+
console.log(brand(" \u2551") + source_default.white(" ") + brand("\u2551"));
|
|
12219
|
+
console.log(brand(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
|
|
12220
|
+
console.log();
|
|
12221
|
+
console.log(laneBold.primary(" Try these:"));
|
|
12222
|
+
console.log(source_default.white(" lane pay --amount 10 --recipient anthropic.com -t"));
|
|
12223
|
+
console.log(source_default.white(" lane wallet status"));
|
|
12224
|
+
console.log(source_default.white(" lane card list"));
|
|
12225
|
+
console.log(source_default.white(" lane budget get"));
|
|
12226
|
+
console.log();
|
|
12227
|
+
} else {
|
|
12228
|
+
console.log(success3(" \u2713 Demo ready \u2014 wallet $1,000, card Visa ****4242"));
|
|
12229
|
+
console.log(source_default.white(" Try: lane pay --amount 10 --recipient anthropic.com -t"));
|
|
12230
|
+
console.log();
|
|
12231
|
+
}
|
|
12232
|
+
}
|
|
12172
12233
|
var brand, muted, THEN_DIAGRAM, NOW_DIAGRAM, FUTURE_DIAGRAM, PHASES;
|
|
12173
12234
|
var init_onboarding = __esm({
|
|
12174
12235
|
"src/cli/onboarding.ts"() {
|
|
@@ -28037,6 +28098,22 @@ var loginCommand = new Command("login").alias("signup").description("Authenticat
|
|
|
28037
28098
|
const terse2 = getTerseFromOpts(globalOpts);
|
|
28038
28099
|
const outputOpts = toOutputOptions(globalOpts);
|
|
28039
28100
|
const store = new FileTokenStore();
|
|
28101
|
+
if (process.env["LANE_DEMO"] === "true") {
|
|
28102
|
+
if (terse2) {
|
|
28103
|
+
terseErr({ demo_mode: true });
|
|
28104
|
+
terseOut({
|
|
28105
|
+
ready: true,
|
|
28106
|
+
email: "demo@getonlane.com",
|
|
28107
|
+
developer_id: "dev_demo_001",
|
|
28108
|
+
environment: "test",
|
|
28109
|
+
wallet_id: "wallet_demo_001"
|
|
28110
|
+
});
|
|
28111
|
+
return;
|
|
28112
|
+
}
|
|
28113
|
+
outputSuccess("Demo mode \u2014 no authentication required.", outputOpts);
|
|
28114
|
+
console.log(source_default.dim(" Run `lane status` to confirm readiness."));
|
|
28115
|
+
return;
|
|
28116
|
+
}
|
|
28040
28117
|
const existing = await store.read();
|
|
28041
28118
|
if (existing) {
|
|
28042
28119
|
let sdkReady = true;
|
|
@@ -28149,13 +28226,13 @@ var loginCommand = new Command("login").alias("signup").description("Authenticat
|
|
|
28149
28226
|
succeedSpinner(spinner, "Authenticated successfully");
|
|
28150
28227
|
try {
|
|
28151
28228
|
const { existsSync: existsSync2, writeFileSync: writeFileSync4, mkdirSync: mkdirSync3 } = await import("fs");
|
|
28152
|
-
const { join:
|
|
28153
|
-
const { homedir:
|
|
28154
|
-
const sentinelPath =
|
|
28229
|
+
const { join: join10 } = await import("path");
|
|
28230
|
+
const { homedir: homedir9 } = await import("os");
|
|
28231
|
+
const sentinelPath = join10(homedir9(), ".lane", "onboarded");
|
|
28155
28232
|
if (!existsSync2(sentinelPath)) {
|
|
28156
28233
|
const { showOnboarding: showOnboarding2 } = await Promise.resolve().then(() => (init_onboarding(), onboarding_exports));
|
|
28157
28234
|
await showOnboarding2(developerId);
|
|
28158
|
-
mkdirSync3(
|
|
28235
|
+
mkdirSync3(join10(homedir9(), ".lane"), { recursive: true });
|
|
28159
28236
|
writeFileSync4(sentinelPath, (/* @__PURE__ */ new Date()).toISOString());
|
|
28160
28237
|
}
|
|
28161
28238
|
} catch {
|
|
@@ -28194,6 +28271,121 @@ ${laneBold.primary("Examples:")}
|
|
|
28194
28271
|
// src/cli/commands/logout.ts
|
|
28195
28272
|
init_source();
|
|
28196
28273
|
init_token_store();
|
|
28274
|
+
|
|
28275
|
+
// src/cli/commands/init.ts
|
|
28276
|
+
init_source();
|
|
28277
|
+
init_lane();
|
|
28278
|
+
import { readFile as readFile4, writeFile as writeFile2, mkdir as mkdir2, unlink } from "fs/promises";
|
|
28279
|
+
import { join as join4 } from "path";
|
|
28280
|
+
import { homedir as homedir3 } from "os";
|
|
28281
|
+
init_colors();
|
|
28282
|
+
var LANE_DIR2 = join4(homedir3(), ".lane");
|
|
28283
|
+
var CONFIG_FILE = join4(LANE_DIR2, "config.json");
|
|
28284
|
+
var SECURE_FILE_MODE2 = 384;
|
|
28285
|
+
var SECURE_DIR_MODE2 = 448;
|
|
28286
|
+
var DEFAULT_DEMO_URL = "https://lane-vic-demo.onrender.com";
|
|
28287
|
+
async function writePersistentConfig(config) {
|
|
28288
|
+
await mkdir2(LANE_DIR2, { recursive: true, mode: SECURE_DIR_MODE2 });
|
|
28289
|
+
await writeFile2(CONFIG_FILE, JSON.stringify(config, null, 2) + "\n", { mode: SECURE_FILE_MODE2 });
|
|
28290
|
+
}
|
|
28291
|
+
async function clearPersistentConfig() {
|
|
28292
|
+
try {
|
|
28293
|
+
await unlink(CONFIG_FILE);
|
|
28294
|
+
} catch (err) {
|
|
28295
|
+
if (err instanceof Error && "code" in err && err.code === "ENOENT") {
|
|
28296
|
+
return;
|
|
28297
|
+
}
|
|
28298
|
+
throw err;
|
|
28299
|
+
}
|
|
28300
|
+
}
|
|
28301
|
+
var initCommand = new Command("init").description("Initialize Lane CLI configuration").option("--demo", "Enable persistent demo mode (VIC demo server)").option("--url <url>", "Demo server URL (default: Render deployment)").option("--reset", "Remove persistent config and exit demo mode").action(async (options, cmd) => {
|
|
28302
|
+
const globalOpts = cmd.optsWithGlobals();
|
|
28303
|
+
const terse2 = getTerseFromOpts(globalOpts);
|
|
28304
|
+
const outputOpts = toOutputOptions(globalOpts);
|
|
28305
|
+
if (options.reset) {
|
|
28306
|
+
await clearPersistentConfig();
|
|
28307
|
+
if (terse2) {
|
|
28308
|
+
terseOut({ reset: true, config_path: CONFIG_FILE });
|
|
28309
|
+
return;
|
|
28310
|
+
}
|
|
28311
|
+
outputSuccess("Demo mode disabled. Config removed.", outputOpts);
|
|
28312
|
+
console.log(source_default.dim(` Config: ${CONFIG_FILE}
|
|
28313
|
+
`));
|
|
28314
|
+
return;
|
|
28315
|
+
}
|
|
28316
|
+
if (options.demo || globalOpts.demo) {
|
|
28317
|
+
const demoUrl = options.url ?? globalOpts.url ?? DEFAULT_DEMO_URL;
|
|
28318
|
+
const spinner = await createSpinner("Checking demo server...", outputOpts);
|
|
28319
|
+
let healthy = false;
|
|
28320
|
+
try {
|
|
28321
|
+
const res = await fetch(`${demoUrl}/health`, {
|
|
28322
|
+
signal: AbortSignal.timeout(3e3)
|
|
28323
|
+
});
|
|
28324
|
+
healthy = res.ok;
|
|
28325
|
+
} catch {
|
|
28326
|
+
healthy = false;
|
|
28327
|
+
}
|
|
28328
|
+
if (healthy) {
|
|
28329
|
+
succeedSpinner(spinner, "Demo server reachable");
|
|
28330
|
+
} else {
|
|
28331
|
+
failSpinner(spinner, "Demo server unreachable");
|
|
28332
|
+
}
|
|
28333
|
+
await writePersistentConfig({ demo: true, demoUrl });
|
|
28334
|
+
process.env["LANE_DEMO"] = "true";
|
|
28335
|
+
process.env["LANE_DEMO_URL"] = demoUrl;
|
|
28336
|
+
let readyStatus = { email: "demo@getonlane.com", walletId: "wallet_demo_001", hasCard: true };
|
|
28337
|
+
if (healthy) {
|
|
28338
|
+
try {
|
|
28339
|
+
const lane6 = await Lane.create();
|
|
28340
|
+
const profile = await lane6.auth.whoami();
|
|
28341
|
+
const wallets = await lane6.wallets.list({ limit: 1 });
|
|
28342
|
+
const cards = await lane6.cards.list();
|
|
28343
|
+
readyStatus = {
|
|
28344
|
+
email: profile.email,
|
|
28345
|
+
walletId: wallets.data[0]?.id ?? "wallet_demo_001",
|
|
28346
|
+
hasCard: cards.data.length > 0
|
|
28347
|
+
};
|
|
28348
|
+
} catch {
|
|
28349
|
+
}
|
|
28350
|
+
}
|
|
28351
|
+
if (terse2) {
|
|
28352
|
+
terseOut({
|
|
28353
|
+
demo: true,
|
|
28354
|
+
demo_url: demoUrl,
|
|
28355
|
+
config_path: CONFIG_FILE,
|
|
28356
|
+
server_healthy: healthy,
|
|
28357
|
+
ready: true,
|
|
28358
|
+
email: readyStatus.email,
|
|
28359
|
+
wallet_id: readyStatus.walletId,
|
|
28360
|
+
has_card: readyStatus.hasCard,
|
|
28361
|
+
mode: "test",
|
|
28362
|
+
next_step: "make_payment"
|
|
28363
|
+
});
|
|
28364
|
+
return;
|
|
28365
|
+
}
|
|
28366
|
+
console.log();
|
|
28367
|
+
outputSuccess("Demo mode enabled", outputOpts);
|
|
28368
|
+
console.log(source_default.dim(` Server: ${demoUrl}`));
|
|
28369
|
+
console.log(source_default.dim(` Config: ${CONFIG_FILE}`));
|
|
28370
|
+
console.log();
|
|
28371
|
+
if (!healthy) {
|
|
28372
|
+
outputWarning("Demo server is not reachable. Commands may fail until the server is available.", outputOpts);
|
|
28373
|
+
console.log(source_default.dim(` Start locally: npm run dev:vic-demo`));
|
|
28374
|
+
console.log();
|
|
28375
|
+
}
|
|
28376
|
+
const { showDemoOnboarding: showDemoOnboarding2 } = await Promise.resolve().then(() => (init_onboarding(), onboarding_exports));
|
|
28377
|
+
await showDemoOnboarding2();
|
|
28378
|
+
return;
|
|
28379
|
+
}
|
|
28380
|
+
cmd.help();
|
|
28381
|
+
}).addHelpText("after", `
|
|
28382
|
+
${laneBold.primary("Examples:")}
|
|
28383
|
+
${source_default.gray("$")} lane init --demo ${source_default.dim("# Enable demo mode")}
|
|
28384
|
+
${source_default.gray("$")} lane init --demo --url http://localhost:3020 ${source_default.dim("# Use local server")}
|
|
28385
|
+
${source_default.gray("$")} lane init --reset ${source_default.dim("# Disable demo mode")}
|
|
28386
|
+
`);
|
|
28387
|
+
|
|
28388
|
+
// src/cli/commands/logout.ts
|
|
28197
28389
|
init_colors();
|
|
28198
28390
|
var logoutCommand = new Command("logout").description("Clear local credentials").action(async (_options, cmd) => {
|
|
28199
28391
|
const globalOpts = cmd.optsWithGlobals();
|
|
@@ -28201,11 +28393,12 @@ var logoutCommand = new Command("logout").description("Clear local credentials")
|
|
|
28201
28393
|
const outputOpts = toOutputOptions(globalOpts);
|
|
28202
28394
|
const store = new FileTokenStore();
|
|
28203
28395
|
await store.clear();
|
|
28396
|
+
await clearPersistentConfig();
|
|
28204
28397
|
if (terse2) {
|
|
28205
28398
|
terseOut({ logged_out: true });
|
|
28206
28399
|
return;
|
|
28207
28400
|
}
|
|
28208
|
-
outputSuccess("Logged out. Credentials removed.", outputOpts);
|
|
28401
|
+
outputSuccess("Logged out. Credentials and config removed.", outputOpts);
|
|
28209
28402
|
}).addHelpText("after", `
|
|
28210
28403
|
${laneBold.primary("Examples:")}
|
|
28211
28404
|
${source_default.gray("$")} lane logout
|
|
@@ -28527,7 +28720,9 @@ var payCommand = new Command("pay").description("Execute a payment to a merchant
|
|
|
28527
28720
|
if (terse2) {
|
|
28528
28721
|
terseProgress(1, 4, "validating");
|
|
28529
28722
|
} else {
|
|
28530
|
-
if (
|
|
28723
|
+
if (process.env["LANE_DEMO"] === "true") {
|
|
28724
|
+
console.log(source_default.hex("#6B52FF")("[DEMO]"));
|
|
28725
|
+
} else if (testMode) {
|
|
28531
28726
|
console.log(source_default.dim("[TEST MODE]"));
|
|
28532
28727
|
}
|
|
28533
28728
|
}
|
|
@@ -28619,9 +28814,9 @@ ${laneBold.primary("Examples:")}
|
|
|
28619
28814
|
|
|
28620
28815
|
// src/cli/commands/setup-mcp.ts
|
|
28621
28816
|
init_source();
|
|
28622
|
-
import { readFile as
|
|
28623
|
-
import { join as
|
|
28624
|
-
import { homedir as
|
|
28817
|
+
import { readFile as readFile5, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
|
|
28818
|
+
import { join as join5 } from "path";
|
|
28819
|
+
import { homedir as homedir4 } from "os";
|
|
28625
28820
|
|
|
28626
28821
|
// src/resources/agent-instructions.ts
|
|
28627
28822
|
function getLaneInstructions() {
|
|
@@ -28701,8 +28896,8 @@ function getLaneInstructions() {
|
|
|
28701
28896
|
// src/cli/commands/setup-mcp.ts
|
|
28702
28897
|
init_colors();
|
|
28703
28898
|
var MCP_CONFIG_PATHS = {
|
|
28704
|
-
"claude-code":
|
|
28705
|
-
"cursor":
|
|
28899
|
+
"claude-code": join5(homedir4(), ".claude", "mcp_servers.json"),
|
|
28900
|
+
"cursor": join5(homedir4(), ".cursor", "mcp_servers.json")
|
|
28706
28901
|
};
|
|
28707
28902
|
var setupMcpCommand = new Command("setup-mcp").description("Auto-configure Lane MCP server for Claude Code / Cursor").option("--target <editor>", "Target editor (claude-code, cursor)", "claude-code").option("--with-instructions", "Print a system prompt snippet for Lane-aware agents").action(async (options, cmd) => {
|
|
28708
28903
|
const globalOpts = cmd.optsWithGlobals();
|
|
@@ -28757,7 +28952,7 @@ var setupMcpCommand = new Command("setup-mcp").description("Auto-configure Lane
|
|
|
28757
28952
|
}
|
|
28758
28953
|
let config = {};
|
|
28759
28954
|
try {
|
|
28760
|
-
const existing = await
|
|
28955
|
+
const existing = await readFile5(configPath, "utf-8");
|
|
28761
28956
|
config = JSON.parse(existing);
|
|
28762
28957
|
} catch {
|
|
28763
28958
|
}
|
|
@@ -28771,9 +28966,9 @@ var setupMcpCommand = new Command("setup-mcp").description("Auto-configure Lane
|
|
|
28771
28966
|
}
|
|
28772
28967
|
};
|
|
28773
28968
|
config["mcpServers"] = mcpServers;
|
|
28774
|
-
const dir =
|
|
28775
|
-
await
|
|
28776
|
-
await
|
|
28969
|
+
const dir = join5(configPath, "..");
|
|
28970
|
+
await mkdir3(dir, { recursive: true });
|
|
28971
|
+
await writeFile3(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
28777
28972
|
if (terse2) {
|
|
28778
28973
|
terseOut({ configured: true, target, config_path: configPath });
|
|
28779
28974
|
return;
|
|
@@ -31266,16 +31461,16 @@ ${laneBold.primary("Examples:")}
|
|
|
31266
31461
|
// src/cli/commands/use.ts
|
|
31267
31462
|
init_source();
|
|
31268
31463
|
import { writeFileSync as writeFileSync2, mkdirSync } from "fs";
|
|
31269
|
-
import { join as
|
|
31270
|
-
import { homedir as
|
|
31464
|
+
import { join as join6 } from "path";
|
|
31465
|
+
import { homedir as homedir5 } from "os";
|
|
31271
31466
|
init_colors();
|
|
31272
31467
|
var useCommand = new Command("use").description("Set active wallet context").argument("<walletId>", "Wallet ID to set as active").action(async (walletId, _options, cmd) => {
|
|
31273
31468
|
const globalOpts = cmd.optsWithGlobals();
|
|
31274
31469
|
const terse2 = getTerseFromOpts(globalOpts);
|
|
31275
31470
|
const outputOpts = toOutputOptions(globalOpts);
|
|
31276
|
-
const configDir =
|
|
31471
|
+
const configDir = join6(homedir5(), ".lane");
|
|
31277
31472
|
mkdirSync(configDir, { recursive: true });
|
|
31278
|
-
const contextPath =
|
|
31473
|
+
const contextPath = join6(configDir, "context.json");
|
|
31279
31474
|
writeFileSync2(contextPath, JSON.stringify({ activeWalletId: walletId }, null, 2));
|
|
31280
31475
|
if (terse2) {
|
|
31281
31476
|
terseOut({ active_wallet: walletId });
|
|
@@ -31293,22 +31488,25 @@ init_source();
|
|
|
31293
31488
|
init_lane();
|
|
31294
31489
|
init_token_store();
|
|
31295
31490
|
import { readFileSync as readFileSync4 } from "fs";
|
|
31296
|
-
import { join as
|
|
31297
|
-
import { homedir as
|
|
31491
|
+
import { join as join7 } from "path";
|
|
31492
|
+
import { homedir as homedir6 } from "os";
|
|
31298
31493
|
init_colors();
|
|
31299
31494
|
var statusCommand = new Command("status").description("Show readiness status and active wallet summary").action(async (_options, cmd) => {
|
|
31300
31495
|
const globalOpts = cmd.optsWithGlobals();
|
|
31301
31496
|
const terse2 = getTerseFromOpts(globalOpts);
|
|
31302
31497
|
const outputOpts = toOutputOptions(globalOpts);
|
|
31303
|
-
const
|
|
31304
|
-
|
|
31305
|
-
|
|
31306
|
-
|
|
31307
|
-
|
|
31498
|
+
const demoMode = process.env["LANE_DEMO"] === "true";
|
|
31499
|
+
if (!demoMode) {
|
|
31500
|
+
const store = new FileTokenStore();
|
|
31501
|
+
const creds = await store.read();
|
|
31502
|
+
if (!creds) {
|
|
31503
|
+
if (terse2) {
|
|
31504
|
+
terseOut({ ready: false, step: "login" });
|
|
31505
|
+
process.exit(1);
|
|
31506
|
+
}
|
|
31507
|
+
outputWarning("Not authenticated. Run `lane login` to get started.", outputOpts);
|
|
31308
31508
|
process.exit(1);
|
|
31309
31509
|
}
|
|
31310
|
-
outputWarning("Not authenticated. Run `lane login` to get started.", outputOpts);
|
|
31311
|
-
process.exit(1);
|
|
31312
31510
|
}
|
|
31313
31511
|
let lane6;
|
|
31314
31512
|
let profile;
|
|
@@ -31425,14 +31623,14 @@ var statusCommand = new Command("status").description("Show readiness status and
|
|
|
31425
31623
|
}
|
|
31426
31624
|
let activeWalletId = null;
|
|
31427
31625
|
try {
|
|
31428
|
-
const ctx = JSON.parse(readFileSync4(
|
|
31626
|
+
const ctx = JSON.parse(readFileSync4(join7(homedir6(), ".lane", "context.json"), "utf8"));
|
|
31429
31627
|
activeWalletId = ctx.activeWalletId;
|
|
31430
31628
|
} catch {
|
|
31431
31629
|
}
|
|
31432
31630
|
const lines = [
|
|
31433
31631
|
`${source_default.white("Email:")} ${source_default.white(profile.email)}`,
|
|
31434
31632
|
`${source_default.white("Plan:")} ${source_default.white(profile.plan)}`,
|
|
31435
|
-
`${source_default.white("Mode:")} ${lane6.testMode ? lane.warning("TEST") : lane.success("LIVE")}`,
|
|
31633
|
+
`${source_default.white("Mode:")} ${process.env["LANE_DEMO"] === "true" ? source_default.hex("#6B52FF")("DEMO") : lane6.testMode ? lane.warning("TEST") : lane.success("LIVE")}`,
|
|
31436
31634
|
`${source_default.white("Wallet:")} ${source_default.white(activeWalletId ?? walletId ?? "(none)")}`,
|
|
31437
31635
|
`${source_default.white("Balance:")} ${money(balanceCents / 100)}`,
|
|
31438
31636
|
`${source_default.white("Card:")} ${hasCard ? `${cardBrand} ${maskCard(cardLast4)}` : lane.warning("none")}`
|
|
@@ -31692,8 +31890,8 @@ ${laneBold.primary("Examples:")}
|
|
|
31692
31890
|
// src/cli/commands/install-skill.ts
|
|
31693
31891
|
init_source();
|
|
31694
31892
|
import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, mkdirSync as mkdirSync2 } from "fs";
|
|
31695
|
-
import { join as
|
|
31696
|
-
import { homedir as
|
|
31893
|
+
import { join as join8, dirname as dirname2 } from "path";
|
|
31894
|
+
import { homedir as homedir7 } from "os";
|
|
31697
31895
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
31698
31896
|
var installSkillCommand = new Command("install-skill").description("Install Lane skill for Claude Code (.claude/skills/lane.md)").option("--global", "Install globally to ~/.claude/skills/ instead of project-local").action(async (_options, cmd) => {
|
|
31699
31897
|
const globalOpts = cmd.optsWithGlobals();
|
|
@@ -31701,8 +31899,8 @@ var installSkillCommand = new Command("install-skill").description("Install Lane
|
|
|
31701
31899
|
const isGlobal = globalOpts.global === true;
|
|
31702
31900
|
try {
|
|
31703
31901
|
const __filename2 = fileURLToPath3(import.meta.url);
|
|
31704
|
-
const packageRoot =
|
|
31705
|
-
const skillSrc =
|
|
31902
|
+
const packageRoot = join8(dirname2(__filename2), "..", "..", "..");
|
|
31903
|
+
const skillSrc = join8(packageRoot, "SKILL.md");
|
|
31706
31904
|
let content;
|
|
31707
31905
|
try {
|
|
31708
31906
|
content = readFileSync5(skillSrc, "utf8");
|
|
@@ -31715,9 +31913,9 @@ var installSkillCommand = new Command("install-skill").description("Install Lane
|
|
|
31715
31913
|
console.error(source_default.red("SKILL.md not found in package. Try reinstalling lane."));
|
|
31716
31914
|
process.exit(1);
|
|
31717
31915
|
}
|
|
31718
|
-
const targetDir = isGlobal ?
|
|
31916
|
+
const targetDir = isGlobal ? join8(homedir7(), ".claude", "skills") : join8(process.cwd(), ".claude", "skills");
|
|
31719
31917
|
mkdirSync2(targetDir, { recursive: true });
|
|
31720
|
-
const targetPath =
|
|
31918
|
+
const targetPath = join8(targetDir, "lane.md");
|
|
31721
31919
|
writeFileSync3(targetPath, content);
|
|
31722
31920
|
if (terse2) {
|
|
31723
31921
|
terseOut({ installed: true, path: targetPath });
|
|
@@ -32016,7 +32214,21 @@ function figletText(text, font = "Small") {
|
|
|
32016
32214
|
|
|
32017
32215
|
// src/cli/index.ts
|
|
32018
32216
|
init_colors();
|
|
32217
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
32218
|
+
import { join as join9 } from "path";
|
|
32219
|
+
import { homedir as homedir8 } from "os";
|
|
32019
32220
|
setupTerseEnv();
|
|
32221
|
+
try {
|
|
32222
|
+
const raw = readFileSync6(join9(homedir8(), ".lane", "config.json"), "utf-8");
|
|
32223
|
+
const config = JSON.parse(raw);
|
|
32224
|
+
if (config.demo && process.env["LANE_DEMO"] !== "false") {
|
|
32225
|
+
process.env["LANE_DEMO"] ??= "true";
|
|
32226
|
+
if (config.demoUrl && !process.env["LANE_DEMO_URL"]) {
|
|
32227
|
+
process.env["LANE_DEMO_URL"] = config.demoUrl;
|
|
32228
|
+
}
|
|
32229
|
+
}
|
|
32230
|
+
} catch {
|
|
32231
|
+
}
|
|
32020
32232
|
var rawArgs = process.argv.slice(2);
|
|
32021
32233
|
var isBareInvocation = rawArgs.length === 0;
|
|
32022
32234
|
var isHelpRequest = rawArgs.includes("--help") || rawArgs.includes("-h");
|
|
@@ -32024,8 +32236,19 @@ var terse = isTerseMode();
|
|
|
32024
32236
|
if ((isBareInvocation || isHelpRequest) && !terse) {
|
|
32025
32237
|
await showBanner({ version: "0.2.0", animate: isBareInvocation });
|
|
32026
32238
|
}
|
|
32239
|
+
if ((process.env["LANE_DEMO"] === "true" || rawArgs.includes("--demo")) && !terse) {
|
|
32240
|
+
const demoUrl = process.env["LANE_DEMO_URL"] ?? "http://localhost:3020";
|
|
32241
|
+
console.log(source_default.bgHex("#6B52FF").white.bold(" DEMO ") + source_default.dim(` \u2192 ${demoUrl}`));
|
|
32242
|
+
console.log();
|
|
32243
|
+
}
|
|
32027
32244
|
var program2 = new Command();
|
|
32028
|
-
program2.name("lane").description("Add wallets and payments to your AI agents").version("0.2.0").option("-w, --wallet <id>", "Wallet override (id or label)").option("-f, --format <fmt>", "Output format: table, json, plain").option("--json", "Shorthand for --format json").option("-q, --quiet", "Suppress non-essential output").option("-t, --terse", "Agent mode: key=value stdout, no colors, no banner").option("--no-input", "Never prompt; fail if input needed").option("-v, --verbose", "Show request/response details").option("--test", "Force test mode");
|
|
32245
|
+
program2.name("lane").description("Add wallets and payments to your AI agents").version("0.2.0").option("-w, --wallet <id>", "Wallet override (id or label)").option("-f, --format <fmt>", "Output format: table, json, plain").option("--json", "Shorthand for --format json").option("-q, --quiet", "Suppress non-essential output").option("-t, --terse", "Agent mode: key=value stdout, no colors, no banner").option("--no-input", "Never prompt; fail if input needed").option("-v, --verbose", "Show request/response details").option("--test", "Force test mode").option("--demo", "Use VIC demo server (no auth required)");
|
|
32246
|
+
program2.hook("preAction", (thisCommand) => {
|
|
32247
|
+
const opts = thisCommand.optsWithGlobals();
|
|
32248
|
+
if (opts.demo) {
|
|
32249
|
+
process.env["LANE_DEMO"] = "true";
|
|
32250
|
+
}
|
|
32251
|
+
});
|
|
32029
32252
|
program2.addCommand(loginCommand);
|
|
32030
32253
|
program2.addCommand(logoutCommand);
|
|
32031
32254
|
program2.addCommand(whoamiCommand);
|
|
@@ -32048,6 +32271,7 @@ program2.addCommand(productCommand);
|
|
|
32048
32271
|
program2.addCommand(checkoutCommand);
|
|
32049
32272
|
program2.addCommand(vendorCommand);
|
|
32050
32273
|
program2.addCommand(schemaCommand);
|
|
32274
|
+
program2.addCommand(initCommand);
|
|
32051
32275
|
program2.addCommand(setupMcpCommand);
|
|
32052
32276
|
program2.addCommand(installSkillCommand);
|
|
32053
32277
|
program2.addCommand(payCommand);
|