@respan/cli 0.14.2 → 0.15.0

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.
@@ -5,11 +5,11 @@ export default class SetupGateway extends SetupBaseCommand {
5
5
  static flags: {
6
6
  agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  'no-instrument': import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
- csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
8
  'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
9
  'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
13
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
14
  };
15
15
  run(): Promise<void>;
@@ -10,11 +10,7 @@ class SetupGateway extends SetupBaseCommand {
10
10
  });
11
11
  }
12
12
  }
13
- SetupGateway.description = `Set up Respan gateway routing in this project.
14
-
15
- Runs the gateway setup flow directly (skips the "Tracing or Gateway?"
16
- question). Sets up your API key, installs the Respan skill, and optionally
17
- opens your coding agent to route the detected framework through the gateway.`;
13
+ SetupGateway.description = 'Deprecated gateway setup entry point. Prints the official gateway setup prompt.';
18
14
  SetupGateway.examples = [
19
15
  'respan setup gateway',
20
16
  'respan setup gateway --agent claude-code',
@@ -23,10 +19,10 @@ SetupGateway.examples = [
23
19
  SetupGateway.flags = {
24
20
  ...SetupBaseCommand.baseFlags,
25
21
  agent: Flags.string({
26
- description: 'Agent to configure (claude-code, cursor, codex-cli, gemini-cli, opencode)',
22
+ description: 'Deprecated compatibility flag; no agent is launched',
27
23
  }),
28
24
  'no-instrument': Flags.boolean({
29
- description: 'Skip agent selection and opening after setup',
25
+ description: 'Deprecated compatibility flag; setup only prints a prompt',
30
26
  default: false,
31
27
  }),
32
28
  };
@@ -5,11 +5,11 @@ export default class Setup extends SetupBaseCommand {
5
5
  static flags: {
6
6
  agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  'no-instrument': import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
- csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
8
  'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
9
  'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
13
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
14
  };
15
15
  run(): Promise<void>;
@@ -4,20 +4,14 @@ class Setup extends SetupBaseCommand {
4
4
  async run() {
5
5
  const { flags } = await this.parse(Setup);
6
6
  this.globalFlags = flags;
7
- // No mode → runSetup asks "Tracing or Gateway?"
7
+ // No mode: print both prompts without an interactive question.
8
8
  await this.runSetup(undefined, {
9
9
  agent: flags.agent,
10
10
  noInstrument: flags['no-instrument'],
11
11
  });
12
12
  }
13
13
  }
14
- Setup.description = `Interactive setup wizard for Respan.
15
-
16
- Sets up your API key, installs skills and SDK docs for your preferred
17
- coding agents, and optionally runs a setup agent. Asks whether you want
18
- to set up tracing or gateway routing.
19
-
20
- This is the recommended way to get started with Respan.`;
14
+ Setup.description = 'Deprecated setup entry point. Prints tracing and gateway setup prompts.';
21
15
  Setup.examples = [
22
16
  'npx @respan/cli setup',
23
17
  'respan setup',
@@ -29,10 +23,10 @@ Setup.examples = [
29
23
  Setup.flags = {
30
24
  ...SetupBaseCommand.baseFlags,
31
25
  agent: Flags.string({
32
- description: 'Agent to configure (claude-code, cursor, codex-cli, gemini-cli, opencode)',
26
+ description: 'Deprecated compatibility flag; no agent is launched',
33
27
  }),
34
28
  'no-instrument': Flags.boolean({
35
- description: 'Skip agent selection and opening after setup',
29
+ description: 'Deprecated compatibility flag; setup only prints a prompt',
36
30
  default: false,
37
31
  }),
38
32
  };
@@ -5,11 +5,11 @@ export default class SetupTracing extends SetupBaseCommand {
5
5
  static flags: {
6
6
  agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  'no-instrument': import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
- csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
8
  'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
9
  'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
13
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
14
  };
15
15
  run(): Promise<void>;
@@ -10,11 +10,7 @@ class SetupTracing extends SetupBaseCommand {
10
10
  });
11
11
  }
12
12
  }
13
- SetupTracing.description = `Set up Respan SDK tracing in this project.
14
-
15
- Runs the tracing setup flow directly (skips the "Tracing or Gateway?"
16
- question). Sets up your API key, installs the Respan skill, and optionally
17
- opens your coding agent to instrument the project.`;
13
+ SetupTracing.description = 'Deprecated tracing setup entry point. Prints the official tracing setup prompt.';
18
14
  SetupTracing.examples = [
19
15
  'respan setup tracing',
20
16
  'respan setup tracing --agent claude-code',
@@ -23,10 +19,10 @@ SetupTracing.examples = [
23
19
  SetupTracing.flags = {
24
20
  ...SetupBaseCommand.baseFlags,
25
21
  agent: Flags.string({
26
- description: 'Agent to configure (claude-code, cursor, codex-cli, gemini-cli, opencode)',
22
+ description: 'Deprecated compatibility flag; no agent is launched',
27
23
  }),
28
24
  'no-instrument': Flags.boolean({
29
- description: 'Skip agent selection and opening after setup',
25
+ description: 'Deprecated compatibility flag; setup only prints a prompt',
30
26
  default: false,
31
27
  }),
32
28
  };
@@ -1,117 +1,11 @@
1
1
  import { BaseCommand } from './base-command.js';
2
- import { CliTool, DetectionSignal } from './agents.js';
3
2
  export type SetupMode = 'tracing' | 'gateway';
4
3
  interface RunSetupOptions {
5
4
  agent?: string;
6
5
  noInstrument?: boolean;
7
6
  }
8
- /**
9
- * Intermediate base class for the `respan setup` family of commands
10
- * (`setup`, `setup tracing`, `setup gateway`).
11
- *
12
- * It deliberately sits between the concrete commands and {@link BaseCommand}
13
- * so that setup-only concerns (interactive prompts, the agent registry, and
14
- * multi-kilobyte skill content) never leak onto the root command class that
15
- * every other command extends.
16
- */
7
+ /** Compatibility entry point. Setup instructions are maintained in the docs. */
17
8
  export declare abstract class SetupBaseCommand extends BaseCommand {
18
- static baseFlags: {
19
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
- csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
- 'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
- 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
- profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
25
- };
26
- /**
27
- * Shared setup flow for all three entry points.
28
- *
29
- * 1. askEndpoint() // saved endpoint (confirm reuse) → environment prompt
30
- * 2. askApiKey() // .env → global credential → prompt
31
- * 3. if mode is undefined → ask "Tracing or Gateway?" (interactive only)
32
- * 4. verifyApiKey(mode) // both re-prompt on a rejected key; can pause setup
33
- * 5. selectAgent() // drives only the launch
34
- * 6. installSkill() // full bundle, for all agents, regardless of selection
35
- * 7. launchAgent(mode) // only if an agent was selected
36
- */
37
- protected runSetup(mode?: SetupMode, opts?: RunSetupOptions): Promise<void>;
38
- /**
39
- * Resolve which Respan endpoint this project should target, mirroring the
40
- * environment prompt in `respan auth login`.
41
- *
42
- * First run: ask "Respan Platform or Enterprise?" and remember the choice.
43
- * Later runs: offer the saved endpoint and confirm before reusing it, so a
44
- * user who switched environments isn't silently pinned to the old one. An
45
- * explicit `--base-url` flag wins and skips the prompt for scripted flows.
46
- */
47
- protected askEndpoint(projectRoot: string): Promise<string>;
48
- /**
49
- * Persist the chosen endpoint onto the existing saved credential — the same
50
- * `~/.respan/credentials.json` store `auth login` uses. Only updates a
51
- * credential that already exists; a first-time key is saved (with this
52
- * baseUrl) later in {@link askApiKey}, so we never create a second store.
53
- */
54
- private rememberEndpoint;
55
- /** Friendly name for the known endpoints; falls back to the raw URL. */
56
- protected endpointLabel(baseUrl: string): string;
57
- /** Dashboard origin that pairs with an ingest endpoint. */
58
- protected dashboardUrl(baseUrl: string): string;
59
- /**
60
- * Pin the SDK's RESPAN_BASE_URL in `.env` when the endpoint isn't the
61
- * default. The SDK already targets the Respan Platform out of the box, so we
62
- * leave `.env` untouched for that choice and only write the override that a
63
- * non-default endpoint actually needs (with the `/api` suffix the SDK wants).
64
- */
65
- protected persistBaseUrlToEnv(projectRoot: string, baseUrl: string): void;
66
- /** Resolve the OTLP traces ingest URL for a base URL (with/without /api). */
67
- protected resolveTracesEndpoint(baseUrl: string): string;
68
- /** Resolve the gateway chat-completions URL for a base URL (with/without /api). */
69
- protected resolveCompletionsEndpoint(baseUrl: string): string;
70
- protected askMode(step: number): Promise<SetupMode>;
71
- protected askApiKey(projectRoot: string, baseUrl?: string): Promise<string>;
72
- /**
73
- * Verify the key for the chosen mode. Both paths re-prompt on a rejected key
74
- * and return false if the user abandons the check, so the caller can pause
75
- * setup instead of reporting success with a key that doesn't work.
76
- */
77
- protected verifyApiKey(apiKey: string, mode: SetupMode, projectRoot: string, baseUrl: string): Promise<boolean>;
78
- /** Prompt for a replacement key and persist it to the project .env. */
79
- private reenterApiKey;
80
- private verifyTracingKey;
81
- /**
82
- * Gateway verification gates on a real request succeeding: there is no
83
- * credit-balance endpoint, so a 200 is the only proof of a valid key with a
84
- * positive balance. A rejected key (401/403) re-prompts; any other failure
85
- * loops on the user's say-so. Returns true on success, false if abandoned.
86
- */
87
- private verifyGatewayKey;
88
- /**
89
- * Build a rich demo OTLP trace that mimics a customer support agent workflow:
90
- * workflow: customer_support_pipeline
91
- * └── agent: support_agent
92
- * ├── tool: lookup_order
93
- * ├── chat: openai.chat (classify intent)
94
- * ├── tool: process_refund
95
- * ├── chat: openai.chat (generate response)
96
- * └── task: log_resolution
97
- */
98
- protected buildDemoTrace(email?: string): Record<string, unknown>;
99
- /**
100
- * Minimal chat completion sent through the gateway to prove auth + routing
101
- * and drop a real logged request into the user's account.
102
- */
103
- protected buildDemoCompletion(): Record<string, unknown>;
104
- protected selectAgent(flagAgent: CliTool | undefined, detected: DetectionSignal[]): Promise<CliTool | null>;
105
- protected installSkill(): Promise<void>;
106
- protected launchAgent(tool: CliTool, projectRoot: string, mode: SetupMode): Promise<void>;
107
- protected logStep(num: number, label: string): void;
108
- protected saveToEnv(envPath: string, existingContent: string, key: string, value: string): void;
109
- protected getGitEmail(): string | undefined;
110
- /**
111
- * Send a lightweight setup notification (email only).
112
- * This helps the team know when new users set up Respan so we can
113
- * reach out and help with onboarding.
114
- */
115
- protected notifySetup(email?: string): Promise<void>;
9
+ protected runSetup(mode?: SetupMode, _opts?: RunSetupOptions): Promise<void>;
116
10
  }
117
11
  export {};