@runtypelabs/cli 1.0.0 → 1.1.3

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/dist/index.js CHANGED
@@ -127,7 +127,7 @@ var init_credential_store = __esm({
127
127
  // src/index.ts
128
128
  import { Command as Command20 } from "commander";
129
129
  import chalk21 from "chalk";
130
- import { config as config2 } from "dotenv";
130
+ import { config as loadEnv } from "dotenv";
131
131
  import { readFileSync as readFileSync6 } from "fs";
132
132
  import { dirname as dirname2, join as join2 } from "path";
133
133
  import { fileURLToPath } from "url";
@@ -452,9 +452,9 @@ var CallbackServer = class {
452
452
  var OAuthManager = class {
453
453
  clerkPublishableKey;
454
454
  dashboardUrl;
455
- constructor(config3) {
456
- this.clerkPublishableKey = config3.clerkPublishableKey;
457
- this.dashboardUrl = config3.dashboardUrl;
455
+ constructor(config2) {
456
+ this.clerkPublishableKey = config2.clerkPublishableKey;
457
+ this.dashboardUrl = config2.dashboardUrl;
458
458
  }
459
459
  async authenticate(mode) {
460
460
  const state = crypto.randomBytes(32).toString("base64url");
@@ -608,7 +608,7 @@ function isTTY(options) {
608
608
 
609
609
  // src/ink/shared/EntityCard.tsx
610
610
  import { Box, Text } from "ink";
611
- import { theme } from "@runtypelabs/ink";
611
+ import { theme } from "@runtypelabs/ink-components";
612
612
  import { jsx, jsxs } from "react/jsx-runtime";
613
613
  function EntityCard({ fields, title }) {
614
614
  const visibleFields = fields.filter(
@@ -631,7 +631,7 @@ function EntityCard({ fields, title }) {
631
631
  // src/ink/shared/ConfirmPrompt.tsx
632
632
  import { useState } from "react";
633
633
  import { Text as Text2, useInput } from "ink";
634
- import { theme as theme2 } from "@runtypelabs/ink";
634
+ import { theme as theme2 } from "@runtypelabs/ink-components";
635
635
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
636
636
  function ConfirmPrompt({
637
637
  message,
@@ -682,7 +682,7 @@ function ConfirmPrompt({
682
682
  // src/ink/shared/DataList.tsx
683
683
  import { useEffect, useRef } from "react";
684
684
  import { Box as Box2, Text as Text3, useApp, useInput as useInput2 } from "ink";
685
- import { Spinner, ErrorDisplay, theme as theme3 } from "@runtypelabs/ink";
685
+ import { Spinner, ErrorDisplay, theme as theme3 } from "@runtypelabs/ink-components";
686
686
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
687
687
  function DataList({
688
688
  title,
@@ -751,7 +751,7 @@ function DataList({
751
751
  // src/ink/shared/MutationResult.tsx
752
752
  import { useEffect as useEffect2, useRef as useRef2 } from "react";
753
753
  import { Box as Box3, Text as Text4, useApp as useApp2, useInput as useInput3 } from "ink";
754
- import { Spinner as Spinner2, ErrorDisplay as ErrorDisplay2, theme as theme4 } from "@runtypelabs/ink";
754
+ import { Spinner as Spinner2, ErrorDisplay as ErrorDisplay2, theme as theme4 } from "@runtypelabs/ink-components";
755
755
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
756
756
  function MutationResult({
757
757
  loading,
@@ -1743,7 +1743,7 @@ flowsCommand.command("run <id>").description("Execute a flow via dispatch").opti
1743
1743
  try {
1744
1744
  const response = await client.stream("/dispatch", payload);
1745
1745
  const callbacks = {
1746
- onStepChunk: (chunk) => {
1746
+ onStepDelta: (chunk) => {
1747
1747
  process.stdout.write(chunk);
1748
1748
  },
1749
1749
  onFlowComplete: (event) => {
@@ -2378,7 +2378,7 @@ promptsCommand.command("test <id>").description("Test a prompt with input").opti
2378
2378
  try {
2379
2379
  const response = await client.stream("/dispatch", payload);
2380
2380
  const callbacks = {
2381
- onStepChunk: (chunk) => {
2381
+ onStepDelta: (chunk) => {
2382
2382
  process.stdout.write(chunk);
2383
2383
  },
2384
2384
  onError: (err) => {
@@ -2796,7 +2796,7 @@ import { useState as useState10, useEffect as useEffect9, useRef as useRef4 } fr
2796
2796
  import fs3 from "fs";
2797
2797
  import path3 from "path";
2798
2798
  import { Box as Box10, useApp as useApp3, useInput as useInput7, useStdout } from "ink";
2799
- import { StatusBar, ErrorDisplay as ErrorDisplay3 } from "@runtypelabs/ink";
2799
+ import { StatusBar, ErrorDisplay as ErrorDisplay3 } from "@runtypelabs/ink-components";
2800
2800
 
2801
2801
  // src/ink/talk/useTalkStream.ts
2802
2802
  import { useState as useState7, useRef as useRef3, useMemo, useCallback } from "react";
@@ -2814,7 +2814,7 @@ function useTalkStream() {
2814
2814
  contentRef.current = "";
2815
2815
  setState({ phase: "thinking", content: "", error: null });
2816
2816
  },
2817
- onStepChunk(chunk) {
2817
+ onStepDelta(chunk) {
2818
2818
  contentRef.current += chunk;
2819
2819
  setState((prev) => ({
2820
2820
  ...prev,
@@ -2845,12 +2845,12 @@ function useTalkStream() {
2845
2845
  // src/ink/talk/MessageHistory.tsx
2846
2846
  import React7 from "react";
2847
2847
  import { Box as Box5, Text as Text6 } from "ink";
2848
- import { theme as theme6 } from "@runtypelabs/ink";
2848
+ import { theme as theme6 } from "@runtypelabs/ink-components";
2849
2849
 
2850
2850
  // src/ink/talk/MessageBubble.tsx
2851
2851
  import React6 from "react";
2852
2852
  import { Box as Box4, Text as Text5 } from "ink";
2853
- import { StreamOutput, theme as theme5 } from "@runtypelabs/ink";
2853
+ import { StreamOutput, theme as theme5 } from "@runtypelabs/ink-components";
2854
2854
 
2855
2855
  // src/ink/talk/useRelativeTime.ts
2856
2856
  import { useState as useState8, useEffect as useEffect8 } from "react";
@@ -2949,7 +2949,7 @@ var MessageHistory = React7.memo(MessageHistoryInner);
2949
2949
 
2950
2950
  // src/ink/talk/StreamingBubble.tsx
2951
2951
  import { Box as Box6, Text as Text7 } from "ink";
2952
- import { StreamOutput as StreamOutput2, Spinner as Spinner3, theme as theme7 } from "@runtypelabs/ink";
2952
+ import { StreamOutput as StreamOutput2, Spinner as Spinner3, theme as theme7 } from "@runtypelabs/ink-components";
2953
2953
  import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
2954
2954
  function StreamingBubble({ content, phase, enableMarkdown }) {
2955
2955
  return /* @__PURE__ */ jsxs6(
@@ -2983,12 +2983,12 @@ function StreamingBubble({ content, phase, enableMarkdown }) {
2983
2983
  import { useState as useState9, useCallback as useCallback2 } from "react";
2984
2984
  import { Box as Box8, Text as Text9, useInput as useInput5 } from "ink";
2985
2985
  import TextInput from "ink-text-input";
2986
- import { theme as theme9 } from "@runtypelabs/ink";
2986
+ import { theme as theme9 } from "@runtypelabs/ink-components";
2987
2987
 
2988
2988
  // src/ink/talk/SlashCommandMenu.tsx
2989
2989
  import { Box as Box7, Text as Text8, useInput as useInput4 } from "ink";
2990
2990
  import SelectInput from "ink-select-input";
2991
- import { theme as theme8 } from "@runtypelabs/ink";
2991
+ import { theme as theme8 } from "@runtypelabs/ink-components";
2992
2992
 
2993
2993
  // src/ink/talk/types.ts
2994
2994
  var TALK_COMMANDS = [
@@ -3176,7 +3176,7 @@ function ChatInput({
3176
3176
  // src/ink/talk/ModelPicker.tsx
3177
3177
  import { Box as Box9, Text as Text10, useInput as useInput6 } from "ink";
3178
3178
  import SelectInput2 from "ink-select-input";
3179
- import { theme as theme10 } from "@runtypelabs/ink";
3179
+ import { theme as theme10 } from "@runtypelabs/ink-components";
3180
3180
  import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
3181
3181
  var MODELS = [
3182
3182
  { label: "Claude Sonnet 4.5", value: "claude-sonnet-4-5" },
@@ -3903,11 +3903,11 @@ import { useState as useState12, useEffect as useEffect11, useCallback as useCal
3903
3903
  import { Box as Box13, Text as Text13, useApp as useApp4, useInput as useInput8 } from "ink";
3904
3904
  import TextInput2 from "ink-text-input";
3905
3905
  import SelectInput3 from "ink-select-input";
3906
- import { Spinner as Spinner4, theme as theme13 } from "@runtypelabs/ink";
3906
+ import { Spinner as Spinner4, theme as theme13 } from "@runtypelabs/ink-components";
3907
3907
 
3908
3908
  // src/ink/init/WizardStep.tsx
3909
3909
  import { Box as Box11, Text as Text11 } from "ink";
3910
- import { theme as theme11 } from "@runtypelabs/ink";
3910
+ import { theme as theme11 } from "@runtypelabs/ink-components";
3911
3911
  import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
3912
3912
  function WizardStep({
3913
3913
  stepNumber,
@@ -3933,7 +3933,7 @@ function WizardStep({
3933
3933
 
3934
3934
  // src/ink/init/StepSummary.tsx
3935
3935
  import { Box as Box12, Text as Text12 } from "ink";
3936
- import { theme as theme12 } from "@runtypelabs/ink";
3936
+ import { theme as theme12 } from "@runtypelabs/ink-components";
3937
3937
  import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
3938
3938
  function StepSummary({ answers }) {
3939
3939
  if (answers.length === 0) {
@@ -4796,7 +4796,7 @@ async function handleStreaming(client, payload, options) {
4796
4796
  [${event.name}] Running...`));
4797
4797
  }
4798
4798
  },
4799
- onStepChunk: (chunk) => {
4799
+ onStepDelta: (chunk) => {
4800
4800
  process.stdout.write(chunk);
4801
4801
  },
4802
4802
  onStepComplete: (_result, event) => {
@@ -4922,8 +4922,9 @@ import React12 from "react";
4922
4922
  // src/ink/marathon/MarathonApp.tsx
4923
4923
  import { useState as useState18, useEffect as useEffect16, useRef as useRef7, useCallback as useCallback5 } from "react";
4924
4924
  import { execSync } from "child_process";
4925
+ import open3 from "open";
4925
4926
  import { Box as Box20, useApp as useApp5, useInput as useInput9, useStdout as useStdout2 } from "ink";
4926
- import { StreamOutput as StreamOutput3, StatusBar as StatusBar2, ErrorDisplay as ErrorDisplay4, theme as theme21 } from "@runtypelabs/ink";
4927
+ import { StreamOutput as StreamOutput3, StatusBar as StatusBar2, ErrorDisplay as ErrorDisplay4, theme as theme21 } from "@runtypelabs/ink-components";
4927
4928
 
4928
4929
  // src/ink/marathon/useMarathonStream.ts
4929
4930
  import { useState as useState14, useRef as useRef5, useMemo as useMemo2, useCallback as useCallback4 } from "react";
@@ -5042,7 +5043,7 @@ function useMarathonStream() {
5042
5043
  tools: prev.tools.map(
5043
5044
  (t) => t.status === "running" ? { ...t, status: "complete", executionTime: Date.now() - t.startedAt } : t
5044
5045
  ),
5045
- rawEvents: pushRawEvent(prev, "agent_paused", {})
5046
+ rawEvents: pushRawEvent(prev, "agent_await", {})
5046
5047
  }));
5047
5048
  },
5048
5049
  onAgentComplete(event) {
@@ -5087,7 +5088,7 @@ function useMarathonStream() {
5087
5088
 
5088
5089
  // src/ink/marathon/SessionHeader.tsx
5089
5090
  import { Box as Box14, Text as Text14 } from "ink";
5090
- import { theme as theme14 } from "@runtypelabs/ink";
5091
+ import { theme as theme14 } from "@runtypelabs/ink-components";
5091
5092
  import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
5092
5093
  function SessionHeader({
5093
5094
  sessionName,
@@ -5119,7 +5120,7 @@ function SessionHeader({
5119
5120
 
5120
5121
  // src/ink/marathon/ThinkingIndicator.tsx
5121
5122
  import { useState as useState15, useEffect as useEffect13 } from "react";
5122
- import { Spinner as Spinner5, theme as theme15 } from "@runtypelabs/ink";
5123
+ import { Spinner as Spinner5, theme as theme15 } from "@runtypelabs/ink-components";
5123
5124
  import { jsx as jsx16 } from "react/jsx-runtime";
5124
5125
  function ThinkingIndicator({ startedAt }) {
5125
5126
  const [elapsed, setElapsed] = useState15(
@@ -5139,11 +5140,11 @@ function ThinkingIndicator({ startedAt }) {
5139
5140
  // src/ink/marathon/ToolPanel.tsx
5140
5141
  import { useState as useState16, useEffect as useEffect14, useMemo as useMemo3 } from "react";
5141
5142
  import { Box as Box16, Text as Text16 } from "ink";
5142
- import { theme as theme17 } from "@runtypelabs/ink";
5143
+ import { theme as theme17 } from "@runtypelabs/ink-components";
5143
5144
 
5144
5145
  // src/ink/marathon/ToolEntry.tsx
5145
5146
  import { Box as Box15, Text as Text15 } from "ink";
5146
- import { Spinner as Spinner6, theme as theme16 } from "@runtypelabs/ink";
5147
+ import { Spinner as Spinner6, theme as theme16 } from "@runtypelabs/ink-components";
5147
5148
  import { Fragment, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
5148
5149
  function ToolEntry({ tool, now }) {
5149
5150
  const elapsedLive = ((now - tool.startedAt) / 1e3).toFixed(1);
@@ -5230,13 +5231,13 @@ function ToolPanel({ tools, maxHeight }) {
5230
5231
  // src/ink/marathon/EventStreamPanel.tsx
5231
5232
  import { useMemo as useMemo4 } from "react";
5232
5233
  import { Box as Box17, Text as Text17 } from "ink";
5233
- import { theme as theme18 } from "@runtypelabs/ink";
5234
+ import { theme as theme18 } from "@runtypelabs/ink-components";
5234
5235
  import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
5235
5236
  var EVENT_COLORS = {
5236
5237
  agent_start: theme18.success,
5237
5238
  agent_complete: theme18.success,
5238
5239
  agent_error: theme18.error,
5239
- agent_paused: theme18.warning,
5240
+ agent_await: theme18.warning,
5240
5241
  agent_iteration_start: theme18.info,
5241
5242
  agent_iteration_complete: theme18.info,
5242
5243
  agent_turn_delta: theme18.muted,
@@ -5374,11 +5375,11 @@ function EventStreamPanel({
5374
5375
  import { useState as useState17, useEffect as useEffect15, useRef as useRef6 } from "react";
5375
5376
  import { Box as Box19, Text as Text19 } from "ink";
5376
5377
  import TextInput3 from "ink-text-input";
5377
- import { theme as theme20 } from "@runtypelabs/ink";
5378
+ import { theme as theme20 } from "@runtypelabs/ink-components";
5378
5379
 
5379
5380
  // src/ink/marathon/SteeringRecap.tsx
5380
5381
  import { Box as Box18, Text as Text18 } from "ink";
5381
- import { theme as theme19 } from "@runtypelabs/ink";
5382
+ import { theme as theme19 } from "@runtypelabs/ink-components";
5382
5383
  import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
5383
5384
  function SteeringRecap({
5384
5385
  sessionNumber,
@@ -5582,7 +5583,7 @@ function copyToClipboard(text) {
5582
5583
  }
5583
5584
  function MarathonApp({
5584
5585
  taskName,
5585
- agentId: _agentId,
5586
+ agentId,
5586
5587
  model,
5587
5588
  sandbox,
5588
5589
  goal,
@@ -5592,6 +5593,7 @@ function MarathonApp({
5592
5593
  plainText,
5593
5594
  noSteer: _noSteer,
5594
5595
  steeringTimeout,
5596
+ dashboardUrl,
5595
5597
  onSaveState,
5596
5598
  onComplete: _onComplete,
5597
5599
  streamRef
@@ -5684,7 +5686,12 @@ function MarathonApp({
5684
5686
  setEventCursor(state.rawEvents.length - 1);
5685
5687
  }
5686
5688
  }, [showEventStream, eventCursor, state.rawEvents.length]);
5689
+ const agentPageUrl = agentId && dashboardUrl ? `${dashboardUrl.replace(/\/$/, "")}/agents/${agentId}` : null;
5687
5690
  useInput9((_input, key) => {
5691
+ if (_input === "o" && agentPageUrl && !(state.phase === "steering" && steeringRecap)) {
5692
+ void open3(agentPageUrl);
5693
+ return;
5694
+ }
5688
5695
  if (key.ctrl && _input === "c") {
5689
5696
  if (ctrlCPressed) {
5690
5697
  if (ctrlCTimeout.current) {
@@ -5801,7 +5808,8 @@ function MarathonApp({
5801
5808
  if (showEventStream && detailEvent) return "c: copy | \u2190\u2192: prev/next | Esc: back | Tab: chat";
5802
5809
  if (showEventStream) return "Enter: detail | c: copy | Tab: chat | Ctrl+C";
5803
5810
  const scrollHint = scrollOffset > 0 ? ` | +${scrollOffset}` : "";
5804
- return `Tab: events | Ctrl+C${scrollHint}`;
5811
+ const dashboardHint = agentPageUrl ? "o: dashboard | " : "";
5812
+ return `${dashboardHint}Tab: events | Ctrl+C${scrollHint}`;
5805
5813
  })();
5806
5814
  const detailCenter = detailEvent ? `EVENT DETAIL (${eventCursor + 1}/${state.rawEvents.length})` : "EVENT STREAM";
5807
5815
  const goalText = goal || "";
@@ -6343,6 +6351,7 @@ ${sandboxPrompt}` : baseMessage;
6343
6351
  plainText: options.plainText ?? false,
6344
6352
  noSteer: options.noSteer ?? false,
6345
6353
  steeringTimeout: parseInt(options.steerTimeout || "10", 10),
6354
+ dashboardUrl: getDashboardUrl(),
6346
6355
  onSaveState: (content, _tools) => {
6347
6356
  const partialState = {
6348
6357
  agentId,
@@ -6562,6 +6571,8 @@ Saving state... done. Session saved to ${filePath}`);
6562
6571
  console.log(`Sessions: ${finalState.sessionCount}`);
6563
6572
  console.log(`Total cost: ${chalk12.yellow(`$${finalState.totalCost.toFixed(4)}`)}`);
6564
6573
  console.log(`State: ${chalk12.gray(filePath)}`);
6574
+ const dashboardBaseUrl = getDashboardUrl();
6575
+ console.log(`Dashboard: ${chalk12.cyan(`${dashboardBaseUrl}/agents/${agentId}`)}`);
6565
6576
  if (result.recordId) {
6566
6577
  console.log(`Record: ${chalk12.gray(result.recordId)}`);
6567
6578
  }
@@ -6876,7 +6887,7 @@ agentsCommand.command("execute <id>").description("Execute an agent").requiredOp
6876
6887
  try {
6877
6888
  const response = await client.stream(`/agents/${id}/execute`, payload);
6878
6889
  const callbacks = {
6879
- onStepChunk: (chunk) => {
6890
+ onStepDelta: (chunk) => {
6880
6891
  process.stdout.write(chunk);
6881
6892
  },
6882
6893
  onError: (err) => {
@@ -8418,7 +8429,7 @@ import chalk19 from "chalk";
8418
8429
  import React19 from "react";
8419
8430
  import { render as render17 } from "ink";
8420
8431
  import { useState as useState25, useEffect as useEffect23 } from "react";
8421
- import open3 from "open";
8432
+ import open4 from "open";
8422
8433
  var billingCommand = new Command18("billing").description("View billing and subscription info");
8423
8434
  billingCommand.command("status").description("Show current plan and usage").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
8424
8435
  const apiKey = await ensureAuth();
@@ -8521,7 +8532,7 @@ billingCommand.command("portal").description("Open the billing portal in your br
8521
8532
  if (data.url) {
8522
8533
  console.log("Opening billing portal...");
8523
8534
  console.log(data.url);
8524
- await open3(data.url);
8535
+ await open4(data.url);
8525
8536
  } else {
8526
8537
  console.log("No portal URL returned. You may need to set up billing first.");
8527
8538
  }
@@ -8543,7 +8554,7 @@ billingCommand.command("portal").description("Open the billing portal in your br
8543
8554
  try {
8544
8555
  const data = await client.post("/billing/portal");
8545
8556
  if (data.url) {
8546
- await open3(data.url);
8557
+ await open4(data.url);
8547
8558
  setMsg("Billing portal opened in browser");
8548
8559
  setSuccess(true);
8549
8560
  } else {
@@ -8875,7 +8886,7 @@ flowVersionsCommand.command("publish <flowId>").description("Publish a version")
8875
8886
 
8876
8887
  // src/index.ts
8877
8888
  init_credential_store();
8878
- config2();
8889
+ loadEnv();
8879
8890
  function getPackageVersion() {
8880
8891
  try {
8881
8892
  const pkgPath = join2(dirname2(fileURLToPath(import.meta.url)), "..", "package.json");