lane-sdk 0.2.1 → 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.
Potentially problematic release.
This version of lane-sdk might be problematic. Click here for more details.
- package/SKILL.md +24 -0
- 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 +214 -40
- package/dist/cli/index.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 -3
- package/dist/server/routes/export.d.cts +0 -10
- package/dist/server/routes/export.d.ts +0 -10
package/dist/cli/index.js
CHANGED
|
@@ -4726,8 +4726,8 @@ var init_token_store = __esm({
|
|
|
4726
4726
|
*/
|
|
4727
4727
|
async clear() {
|
|
4728
4728
|
try {
|
|
4729
|
-
const { unlink } = await import("fs/promises");
|
|
4730
|
-
await
|
|
4729
|
+
const { unlink: unlink2 } = await import("fs/promises");
|
|
4730
|
+
await unlink2(this.filePath);
|
|
4731
4731
|
} catch (err) {
|
|
4732
4732
|
if (isNodeError(err) && err.code === "ENOENT") {
|
|
4733
4733
|
return;
|
|
@@ -4774,7 +4774,37 @@ var init_token_store = __esm({
|
|
|
4774
4774
|
});
|
|
4775
4775
|
|
|
4776
4776
|
// src/config.ts
|
|
4777
|
+
import { readFile as readFile2 } from "fs/promises";
|
|
4778
|
+
import { join as join2 } from "path";
|
|
4779
|
+
import { homedir as homedir2 } from "os";
|
|
4780
|
+
async function readPersistentConfig() {
|
|
4781
|
+
try {
|
|
4782
|
+
const raw = await readFile2(join2(homedir2(), ".lane", "config.json"), "utf-8");
|
|
4783
|
+
return JSON.parse(raw);
|
|
4784
|
+
} catch {
|
|
4785
|
+
return null;
|
|
4786
|
+
}
|
|
4787
|
+
}
|
|
4777
4788
|
async function resolveConfig(options = {}, tokenStore) {
|
|
4789
|
+
const persistent = await readPersistentConfig();
|
|
4790
|
+
if (persistent?.demo && process.env["LANE_DEMO"] !== "false") {
|
|
4791
|
+
process.env["LANE_DEMO"] = "true";
|
|
4792
|
+
if (persistent.demoUrl && !process.env["LANE_DEMO_URL"]) {
|
|
4793
|
+
process.env["LANE_DEMO_URL"] = persistent.demoUrl;
|
|
4794
|
+
}
|
|
4795
|
+
}
|
|
4796
|
+
if (process.env["LANE_DEMO"] === "true") {
|
|
4797
|
+
const demoBaseUrl = process.env["LANE_DEMO_URL"] ?? "http://localhost:3020";
|
|
4798
|
+
return Object.freeze({
|
|
4799
|
+
apiKey: options.apiKey ?? process.env["LANE_API_KEY"] ?? "lane_sk_demo_000000000000",
|
|
4800
|
+
baseUrl: demoBaseUrl,
|
|
4801
|
+
apiUrl: demoBaseUrl,
|
|
4802
|
+
testMode: true,
|
|
4803
|
+
timeout: options.timeout ?? DEFAULT_TIMEOUT,
|
|
4804
|
+
maxRetries: options.maxRetries ?? DEFAULT_MAX_RETRIES,
|
|
4805
|
+
circuitBreaker: void 0
|
|
4806
|
+
});
|
|
4807
|
+
}
|
|
4778
4808
|
let apiKey = options.apiKey;
|
|
4779
4809
|
if (!apiKey) {
|
|
4780
4810
|
apiKey = process.env["LANE_API_KEY"];
|
|
@@ -6583,7 +6613,9 @@ var init_lane = __esm({
|
|
|
6583
6613
|
} catch {
|
|
6584
6614
|
_Lane._throwWaitlistError();
|
|
6585
6615
|
}
|
|
6586
|
-
|
|
6616
|
+
if (process.env["LANE_DEMO"] !== "true") {
|
|
6617
|
+
await _Lane._verifyAccess(config);
|
|
6618
|
+
}
|
|
6587
6619
|
return new _Lane(config);
|
|
6588
6620
|
}
|
|
6589
6621
|
/**
|
|
@@ -28037,6 +28069,22 @@ var loginCommand = new Command("login").alias("signup").description("Authenticat
|
|
|
28037
28069
|
const terse2 = getTerseFromOpts(globalOpts);
|
|
28038
28070
|
const outputOpts = toOutputOptions(globalOpts);
|
|
28039
28071
|
const store = new FileTokenStore();
|
|
28072
|
+
if (process.env["LANE_DEMO"] === "true") {
|
|
28073
|
+
if (terse2) {
|
|
28074
|
+
terseErr({ demo_mode: true });
|
|
28075
|
+
terseOut({
|
|
28076
|
+
ready: true,
|
|
28077
|
+
email: "demo@getonlane.com",
|
|
28078
|
+
developer_id: "dev_demo_001",
|
|
28079
|
+
environment: "test",
|
|
28080
|
+
wallet_id: "wallet_demo_001"
|
|
28081
|
+
});
|
|
28082
|
+
return;
|
|
28083
|
+
}
|
|
28084
|
+
outputSuccess("Demo mode \u2014 no authentication required.", outputOpts);
|
|
28085
|
+
console.log(source_default.dim(" Run `lane status` to confirm readiness."));
|
|
28086
|
+
return;
|
|
28087
|
+
}
|
|
28040
28088
|
const existing = await store.read();
|
|
28041
28089
|
if (existing) {
|
|
28042
28090
|
let sdkReady = true;
|
|
@@ -28149,13 +28197,13 @@ var loginCommand = new Command("login").alias("signup").description("Authenticat
|
|
|
28149
28197
|
succeedSpinner(spinner, "Authenticated successfully");
|
|
28150
28198
|
try {
|
|
28151
28199
|
const { existsSync: existsSync2, writeFileSync: writeFileSync4, mkdirSync: mkdirSync3 } = await import("fs");
|
|
28152
|
-
const { join:
|
|
28153
|
-
const { homedir:
|
|
28154
|
-
const sentinelPath =
|
|
28200
|
+
const { join: join10 } = await import("path");
|
|
28201
|
+
const { homedir: homedir9 } = await import("os");
|
|
28202
|
+
const sentinelPath = join10(homedir9(), ".lane", "onboarded");
|
|
28155
28203
|
if (!existsSync2(sentinelPath)) {
|
|
28156
28204
|
const { showOnboarding: showOnboarding2 } = await Promise.resolve().then(() => (init_onboarding(), onboarding_exports));
|
|
28157
28205
|
await showOnboarding2(developerId);
|
|
28158
|
-
mkdirSync3(
|
|
28206
|
+
mkdirSync3(join10(homedir9(), ".lane"), { recursive: true });
|
|
28159
28207
|
writeFileSync4(sentinelPath, (/* @__PURE__ */ new Date()).toISOString());
|
|
28160
28208
|
}
|
|
28161
28209
|
} catch {
|
|
@@ -28194,6 +28242,100 @@ ${laneBold.primary("Examples:")}
|
|
|
28194
28242
|
// src/cli/commands/logout.ts
|
|
28195
28243
|
init_source();
|
|
28196
28244
|
init_token_store();
|
|
28245
|
+
|
|
28246
|
+
// src/cli/commands/init.ts
|
|
28247
|
+
init_source();
|
|
28248
|
+
import { readFile as readFile4, writeFile as writeFile2, mkdir as mkdir2, unlink } from "fs/promises";
|
|
28249
|
+
import { join as join4 } from "path";
|
|
28250
|
+
import { homedir as homedir3 } from "os";
|
|
28251
|
+
init_colors();
|
|
28252
|
+
var LANE_DIR2 = join4(homedir3(), ".lane");
|
|
28253
|
+
var CONFIG_FILE = join4(LANE_DIR2, "config.json");
|
|
28254
|
+
var SECURE_FILE_MODE2 = 384;
|
|
28255
|
+
var SECURE_DIR_MODE2 = 448;
|
|
28256
|
+
var DEFAULT_DEMO_URL = "https://lane-vic-demo.onrender.com";
|
|
28257
|
+
async function writePersistentConfig(config) {
|
|
28258
|
+
await mkdir2(LANE_DIR2, { recursive: true, mode: SECURE_DIR_MODE2 });
|
|
28259
|
+
await writeFile2(CONFIG_FILE, JSON.stringify(config, null, 2) + "\n", { mode: SECURE_FILE_MODE2 });
|
|
28260
|
+
}
|
|
28261
|
+
async function clearPersistentConfig() {
|
|
28262
|
+
try {
|
|
28263
|
+
await unlink(CONFIG_FILE);
|
|
28264
|
+
} catch (err) {
|
|
28265
|
+
if (err instanceof Error && "code" in err && err.code === "ENOENT") {
|
|
28266
|
+
return;
|
|
28267
|
+
}
|
|
28268
|
+
throw err;
|
|
28269
|
+
}
|
|
28270
|
+
}
|
|
28271
|
+
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) => {
|
|
28272
|
+
const globalOpts = cmd.optsWithGlobals();
|
|
28273
|
+
const terse2 = getTerseFromOpts(globalOpts);
|
|
28274
|
+
const outputOpts = toOutputOptions(globalOpts);
|
|
28275
|
+
if (options.reset) {
|
|
28276
|
+
await clearPersistentConfig();
|
|
28277
|
+
if (terse2) {
|
|
28278
|
+
terseOut({ reset: true, config_path: CONFIG_FILE });
|
|
28279
|
+
return;
|
|
28280
|
+
}
|
|
28281
|
+
outputSuccess("Demo mode disabled. Config removed.", outputOpts);
|
|
28282
|
+
console.log(source_default.dim(` Config: ${CONFIG_FILE}
|
|
28283
|
+
`));
|
|
28284
|
+
return;
|
|
28285
|
+
}
|
|
28286
|
+
if (options.demo) {
|
|
28287
|
+
const demoUrl = options.url ?? DEFAULT_DEMO_URL;
|
|
28288
|
+
const spinner = await createSpinner("Checking demo server...", outputOpts);
|
|
28289
|
+
let healthy = false;
|
|
28290
|
+
try {
|
|
28291
|
+
const res = await fetch(`${demoUrl}/health`, {
|
|
28292
|
+
signal: AbortSignal.timeout(3e3)
|
|
28293
|
+
});
|
|
28294
|
+
healthy = res.ok;
|
|
28295
|
+
} catch {
|
|
28296
|
+
healthy = false;
|
|
28297
|
+
}
|
|
28298
|
+
if (healthy) {
|
|
28299
|
+
succeedSpinner(spinner, "Demo server reachable");
|
|
28300
|
+
} else {
|
|
28301
|
+
failSpinner(spinner, "Demo server unreachable");
|
|
28302
|
+
}
|
|
28303
|
+
await writePersistentConfig({ demo: true, demoUrl });
|
|
28304
|
+
process.env["LANE_DEMO"] = "true";
|
|
28305
|
+
process.env["LANE_DEMO_URL"] = demoUrl;
|
|
28306
|
+
if (terse2) {
|
|
28307
|
+
terseOut({
|
|
28308
|
+
demo: true,
|
|
28309
|
+
demo_url: demoUrl,
|
|
28310
|
+
config_path: CONFIG_FILE,
|
|
28311
|
+
server_healthy: healthy
|
|
28312
|
+
});
|
|
28313
|
+
return;
|
|
28314
|
+
}
|
|
28315
|
+
console.log();
|
|
28316
|
+
outputSuccess("Demo mode enabled", outputOpts);
|
|
28317
|
+
console.log(source_default.dim(` Server: ${demoUrl}`));
|
|
28318
|
+
console.log(source_default.dim(` Config: ${CONFIG_FILE}`));
|
|
28319
|
+
console.log();
|
|
28320
|
+
if (!healthy) {
|
|
28321
|
+
outputWarning("Demo server is not reachable. Commands may fail until the server is available.", outputOpts);
|
|
28322
|
+
console.log(source_default.dim(` Start locally: npm run dev:vic-demo`));
|
|
28323
|
+
console.log();
|
|
28324
|
+
}
|
|
28325
|
+
console.log(laneBold.primary(" Try: ") + source_default.white("lane status"));
|
|
28326
|
+
console.log(lane.info(" Reset: lane init --reset"));
|
|
28327
|
+
console.log();
|
|
28328
|
+
return;
|
|
28329
|
+
}
|
|
28330
|
+
cmd.help();
|
|
28331
|
+
}).addHelpText("after", `
|
|
28332
|
+
${laneBold.primary("Examples:")}
|
|
28333
|
+
${source_default.gray("$")} lane init --demo ${source_default.dim("# Enable demo mode")}
|
|
28334
|
+
${source_default.gray("$")} lane init --demo --url http://localhost:3020 ${source_default.dim("# Use local server")}
|
|
28335
|
+
${source_default.gray("$")} lane init --reset ${source_default.dim("# Disable demo mode")}
|
|
28336
|
+
`);
|
|
28337
|
+
|
|
28338
|
+
// src/cli/commands/logout.ts
|
|
28197
28339
|
init_colors();
|
|
28198
28340
|
var logoutCommand = new Command("logout").description("Clear local credentials").action(async (_options, cmd) => {
|
|
28199
28341
|
const globalOpts = cmd.optsWithGlobals();
|
|
@@ -28201,11 +28343,12 @@ var logoutCommand = new Command("logout").description("Clear local credentials")
|
|
|
28201
28343
|
const outputOpts = toOutputOptions(globalOpts);
|
|
28202
28344
|
const store = new FileTokenStore();
|
|
28203
28345
|
await store.clear();
|
|
28346
|
+
await clearPersistentConfig();
|
|
28204
28347
|
if (terse2) {
|
|
28205
28348
|
terseOut({ logged_out: true });
|
|
28206
28349
|
return;
|
|
28207
28350
|
}
|
|
28208
|
-
outputSuccess("Logged out. Credentials removed.", outputOpts);
|
|
28351
|
+
outputSuccess("Logged out. Credentials and config removed.", outputOpts);
|
|
28209
28352
|
}).addHelpText("after", `
|
|
28210
28353
|
${laneBold.primary("Examples:")}
|
|
28211
28354
|
${source_default.gray("$")} lane logout
|
|
@@ -28527,7 +28670,9 @@ var payCommand = new Command("pay").description("Execute a payment to a merchant
|
|
|
28527
28670
|
if (terse2) {
|
|
28528
28671
|
terseProgress(1, 4, "validating");
|
|
28529
28672
|
} else {
|
|
28530
|
-
if (
|
|
28673
|
+
if (process.env["LANE_DEMO"] === "true") {
|
|
28674
|
+
console.log(source_default.hex("#6B52FF")("[DEMO]"));
|
|
28675
|
+
} else if (testMode) {
|
|
28531
28676
|
console.log(source_default.dim("[TEST MODE]"));
|
|
28532
28677
|
}
|
|
28533
28678
|
}
|
|
@@ -28619,9 +28764,9 @@ ${laneBold.primary("Examples:")}
|
|
|
28619
28764
|
|
|
28620
28765
|
// src/cli/commands/setup-mcp.ts
|
|
28621
28766
|
init_source();
|
|
28622
|
-
import { readFile as
|
|
28623
|
-
import { join as
|
|
28624
|
-
import { homedir as
|
|
28767
|
+
import { readFile as readFile5, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
|
|
28768
|
+
import { join as join5 } from "path";
|
|
28769
|
+
import { homedir as homedir4 } from "os";
|
|
28625
28770
|
|
|
28626
28771
|
// src/resources/agent-instructions.ts
|
|
28627
28772
|
function getLaneInstructions() {
|
|
@@ -28701,8 +28846,8 @@ function getLaneInstructions() {
|
|
|
28701
28846
|
// src/cli/commands/setup-mcp.ts
|
|
28702
28847
|
init_colors();
|
|
28703
28848
|
var MCP_CONFIG_PATHS = {
|
|
28704
|
-
"claude-code":
|
|
28705
|
-
"cursor":
|
|
28849
|
+
"claude-code": join5(homedir4(), ".claude", "mcp_servers.json"),
|
|
28850
|
+
"cursor": join5(homedir4(), ".cursor", "mcp_servers.json")
|
|
28706
28851
|
};
|
|
28707
28852
|
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
28853
|
const globalOpts = cmd.optsWithGlobals();
|
|
@@ -28757,7 +28902,7 @@ var setupMcpCommand = new Command("setup-mcp").description("Auto-configure Lane
|
|
|
28757
28902
|
}
|
|
28758
28903
|
let config = {};
|
|
28759
28904
|
try {
|
|
28760
|
-
const existing = await
|
|
28905
|
+
const existing = await readFile5(configPath, "utf-8");
|
|
28761
28906
|
config = JSON.parse(existing);
|
|
28762
28907
|
} catch {
|
|
28763
28908
|
}
|
|
@@ -28771,9 +28916,9 @@ var setupMcpCommand = new Command("setup-mcp").description("Auto-configure Lane
|
|
|
28771
28916
|
}
|
|
28772
28917
|
};
|
|
28773
28918
|
config["mcpServers"] = mcpServers;
|
|
28774
|
-
const dir =
|
|
28775
|
-
await
|
|
28776
|
-
await
|
|
28919
|
+
const dir = join5(configPath, "..");
|
|
28920
|
+
await mkdir3(dir, { recursive: true });
|
|
28921
|
+
await writeFile3(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
28777
28922
|
if (terse2) {
|
|
28778
28923
|
terseOut({ configured: true, target, config_path: configPath });
|
|
28779
28924
|
return;
|
|
@@ -31266,16 +31411,16 @@ ${laneBold.primary("Examples:")}
|
|
|
31266
31411
|
// src/cli/commands/use.ts
|
|
31267
31412
|
init_source();
|
|
31268
31413
|
import { writeFileSync as writeFileSync2, mkdirSync } from "fs";
|
|
31269
|
-
import { join as
|
|
31270
|
-
import { homedir as
|
|
31414
|
+
import { join as join6 } from "path";
|
|
31415
|
+
import { homedir as homedir5 } from "os";
|
|
31271
31416
|
init_colors();
|
|
31272
31417
|
var useCommand = new Command("use").description("Set active wallet context").argument("<walletId>", "Wallet ID to set as active").action(async (walletId, _options, cmd) => {
|
|
31273
31418
|
const globalOpts = cmd.optsWithGlobals();
|
|
31274
31419
|
const terse2 = getTerseFromOpts(globalOpts);
|
|
31275
31420
|
const outputOpts = toOutputOptions(globalOpts);
|
|
31276
|
-
const configDir =
|
|
31421
|
+
const configDir = join6(homedir5(), ".lane");
|
|
31277
31422
|
mkdirSync(configDir, { recursive: true });
|
|
31278
|
-
const contextPath =
|
|
31423
|
+
const contextPath = join6(configDir, "context.json");
|
|
31279
31424
|
writeFileSync2(contextPath, JSON.stringify({ activeWalletId: walletId }, null, 2));
|
|
31280
31425
|
if (terse2) {
|
|
31281
31426
|
terseOut({ active_wallet: walletId });
|
|
@@ -31293,22 +31438,25 @@ init_source();
|
|
|
31293
31438
|
init_lane();
|
|
31294
31439
|
init_token_store();
|
|
31295
31440
|
import { readFileSync as readFileSync4 } from "fs";
|
|
31296
|
-
import { join as
|
|
31297
|
-
import { homedir as
|
|
31441
|
+
import { join as join7 } from "path";
|
|
31442
|
+
import { homedir as homedir6 } from "os";
|
|
31298
31443
|
init_colors();
|
|
31299
31444
|
var statusCommand = new Command("status").description("Show readiness status and active wallet summary").action(async (_options, cmd) => {
|
|
31300
31445
|
const globalOpts = cmd.optsWithGlobals();
|
|
31301
31446
|
const terse2 = getTerseFromOpts(globalOpts);
|
|
31302
31447
|
const outputOpts = toOutputOptions(globalOpts);
|
|
31303
|
-
const
|
|
31304
|
-
|
|
31305
|
-
|
|
31306
|
-
|
|
31307
|
-
|
|
31448
|
+
const demoMode = process.env["LANE_DEMO"] === "true";
|
|
31449
|
+
if (!demoMode) {
|
|
31450
|
+
const store = new FileTokenStore();
|
|
31451
|
+
const creds = await store.read();
|
|
31452
|
+
if (!creds) {
|
|
31453
|
+
if (terse2) {
|
|
31454
|
+
terseOut({ ready: false, step: "login" });
|
|
31455
|
+
process.exit(1);
|
|
31456
|
+
}
|
|
31457
|
+
outputWarning("Not authenticated. Run `lane login` to get started.", outputOpts);
|
|
31308
31458
|
process.exit(1);
|
|
31309
31459
|
}
|
|
31310
|
-
outputWarning("Not authenticated. Run `lane login` to get started.", outputOpts);
|
|
31311
|
-
process.exit(1);
|
|
31312
31460
|
}
|
|
31313
31461
|
let lane6;
|
|
31314
31462
|
let profile;
|
|
@@ -31425,14 +31573,14 @@ var statusCommand = new Command("status").description("Show readiness status and
|
|
|
31425
31573
|
}
|
|
31426
31574
|
let activeWalletId = null;
|
|
31427
31575
|
try {
|
|
31428
|
-
const ctx = JSON.parse(readFileSync4(
|
|
31576
|
+
const ctx = JSON.parse(readFileSync4(join7(homedir6(), ".lane", "context.json"), "utf8"));
|
|
31429
31577
|
activeWalletId = ctx.activeWalletId;
|
|
31430
31578
|
} catch {
|
|
31431
31579
|
}
|
|
31432
31580
|
const lines = [
|
|
31433
31581
|
`${source_default.white("Email:")} ${source_default.white(profile.email)}`,
|
|
31434
31582
|
`${source_default.white("Plan:")} ${source_default.white(profile.plan)}`,
|
|
31435
|
-
`${source_default.white("Mode:")} ${lane6.testMode ? lane.warning("TEST") : lane.success("LIVE")}`,
|
|
31583
|
+
`${source_default.white("Mode:")} ${process.env["LANE_DEMO"] === "true" ? source_default.hex("#6B52FF")("DEMO") : lane6.testMode ? lane.warning("TEST") : lane.success("LIVE")}`,
|
|
31436
31584
|
`${source_default.white("Wallet:")} ${source_default.white(activeWalletId ?? walletId ?? "(none)")}`,
|
|
31437
31585
|
`${source_default.white("Balance:")} ${money(balanceCents / 100)}`,
|
|
31438
31586
|
`${source_default.white("Card:")} ${hasCard ? `${cardBrand} ${maskCard(cardLast4)}` : lane.warning("none")}`
|
|
@@ -31692,8 +31840,8 @@ ${laneBold.primary("Examples:")}
|
|
|
31692
31840
|
// src/cli/commands/install-skill.ts
|
|
31693
31841
|
init_source();
|
|
31694
31842
|
import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, mkdirSync as mkdirSync2 } from "fs";
|
|
31695
|
-
import { join as
|
|
31696
|
-
import { homedir as
|
|
31843
|
+
import { join as join8, dirname as dirname2 } from "path";
|
|
31844
|
+
import { homedir as homedir7 } from "os";
|
|
31697
31845
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
31698
31846
|
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
31847
|
const globalOpts = cmd.optsWithGlobals();
|
|
@@ -31701,8 +31849,8 @@ var installSkillCommand = new Command("install-skill").description("Install Lane
|
|
|
31701
31849
|
const isGlobal = globalOpts.global === true;
|
|
31702
31850
|
try {
|
|
31703
31851
|
const __filename2 = fileURLToPath3(import.meta.url);
|
|
31704
|
-
const packageRoot =
|
|
31705
|
-
const skillSrc =
|
|
31852
|
+
const packageRoot = join8(dirname2(__filename2), "..", "..", "..");
|
|
31853
|
+
const skillSrc = join8(packageRoot, "SKILL.md");
|
|
31706
31854
|
let content;
|
|
31707
31855
|
try {
|
|
31708
31856
|
content = readFileSync5(skillSrc, "utf8");
|
|
@@ -31715,9 +31863,9 @@ var installSkillCommand = new Command("install-skill").description("Install Lane
|
|
|
31715
31863
|
console.error(source_default.red("SKILL.md not found in package. Try reinstalling lane."));
|
|
31716
31864
|
process.exit(1);
|
|
31717
31865
|
}
|
|
31718
|
-
const targetDir = isGlobal ?
|
|
31866
|
+
const targetDir = isGlobal ? join8(homedir7(), ".claude", "skills") : join8(process.cwd(), ".claude", "skills");
|
|
31719
31867
|
mkdirSync2(targetDir, { recursive: true });
|
|
31720
|
-
const targetPath =
|
|
31868
|
+
const targetPath = join8(targetDir, "lane.md");
|
|
31721
31869
|
writeFileSync3(targetPath, content);
|
|
31722
31870
|
if (terse2) {
|
|
31723
31871
|
terseOut({ installed: true, path: targetPath });
|
|
@@ -32016,7 +32164,21 @@ function figletText(text, font = "Small") {
|
|
|
32016
32164
|
|
|
32017
32165
|
// src/cli/index.ts
|
|
32018
32166
|
init_colors();
|
|
32167
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
32168
|
+
import { join as join9 } from "path";
|
|
32169
|
+
import { homedir as homedir8 } from "os";
|
|
32019
32170
|
setupTerseEnv();
|
|
32171
|
+
try {
|
|
32172
|
+
const raw = readFileSync6(join9(homedir8(), ".lane", "config.json"), "utf-8");
|
|
32173
|
+
const config = JSON.parse(raw);
|
|
32174
|
+
if (config.demo && process.env["LANE_DEMO"] !== "false") {
|
|
32175
|
+
process.env["LANE_DEMO"] ??= "true";
|
|
32176
|
+
if (config.demoUrl && !process.env["LANE_DEMO_URL"]) {
|
|
32177
|
+
process.env["LANE_DEMO_URL"] = config.demoUrl;
|
|
32178
|
+
}
|
|
32179
|
+
}
|
|
32180
|
+
} catch {
|
|
32181
|
+
}
|
|
32020
32182
|
var rawArgs = process.argv.slice(2);
|
|
32021
32183
|
var isBareInvocation = rawArgs.length === 0;
|
|
32022
32184
|
var isHelpRequest = rawArgs.includes("--help") || rawArgs.includes("-h");
|
|
@@ -32024,8 +32186,19 @@ var terse = isTerseMode();
|
|
|
32024
32186
|
if ((isBareInvocation || isHelpRequest) && !terse) {
|
|
32025
32187
|
await showBanner({ version: "0.2.0", animate: isBareInvocation });
|
|
32026
32188
|
}
|
|
32189
|
+
if ((process.env["LANE_DEMO"] === "true" || rawArgs.includes("--demo")) && !terse) {
|
|
32190
|
+
const demoUrl = process.env["LANE_DEMO_URL"] ?? "http://localhost:3020";
|
|
32191
|
+
console.log(source_default.bgHex("#6B52FF").white.bold(" DEMO ") + source_default.dim(` \u2192 ${demoUrl}`));
|
|
32192
|
+
console.log();
|
|
32193
|
+
}
|
|
32027
32194
|
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");
|
|
32195
|
+
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)");
|
|
32196
|
+
program2.hook("preAction", (thisCommand) => {
|
|
32197
|
+
const opts = thisCommand.optsWithGlobals();
|
|
32198
|
+
if (opts.demo) {
|
|
32199
|
+
process.env["LANE_DEMO"] = "true";
|
|
32200
|
+
}
|
|
32201
|
+
});
|
|
32029
32202
|
program2.addCommand(loginCommand);
|
|
32030
32203
|
program2.addCommand(logoutCommand);
|
|
32031
32204
|
program2.addCommand(whoamiCommand);
|
|
@@ -32048,6 +32221,7 @@ program2.addCommand(productCommand);
|
|
|
32048
32221
|
program2.addCommand(checkoutCommand);
|
|
32049
32222
|
program2.addCommand(vendorCommand);
|
|
32050
32223
|
program2.addCommand(schemaCommand);
|
|
32224
|
+
program2.addCommand(initCommand);
|
|
32051
32225
|
program2.addCommand(setupMcpCommand);
|
|
32052
32226
|
program2.addCommand(installSkillCommand);
|
|
32053
32227
|
program2.addCommand(payCommand);
|