@tonyclaw/agent-inspector 2.0.16 → 2.0.18

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 (37) hide show
  1. package/.output/cli.js +394 -55
  2. package/.output/nitro.json +1 -1
  3. package/.output/public/assets/{CompareDrawer-DPs4UHwd.js → CompareDrawer-CepU-dLW.js} +1 -1
  4. package/.output/public/assets/{ProxyViewerContainer-B1KylMPs.js → ProxyViewerContainer-BG7rc33d.js} +16 -16
  5. package/.output/public/assets/{ReplayDialog-8ISC28XF.js → ReplayDialog-DK6SPv8X.js} +1 -1
  6. package/.output/public/assets/{RequestAnatomy-BhbsgfBO.js → RequestAnatomy-C_C6ZU3T.js} +1 -1
  7. package/.output/public/assets/{ResponseView-CyM7JXeA.js → ResponseView-Bqpra4Zw.js} +1 -1
  8. package/.output/public/assets/{StreamingChunkSequence-BaX0x38n.js → StreamingChunkSequence-CdPbpprq.js} +1 -1
  9. package/.output/public/assets/_sessionId-CsNARHj5.js +1 -0
  10. package/.output/public/assets/index-37NfO0zx.js +1 -0
  11. package/.output/public/assets/{main-B2t-3SYj.js → main-BRXsrxtv.js} +2 -2
  12. package/.output/server/{_sessionId-CEbZTs68.mjs → _sessionId-B8Bbfs-v.mjs} +2 -2
  13. package/.output/server/_ssr/{CompareDrawer-CEo48Wsu.mjs → CompareDrawer-TgGZLf1J.mjs} +2 -2
  14. package/.output/server/_ssr/{ProxyViewerContainer-5ekIK_jx.mjs → ProxyViewerContainer-B_ppaNmQ.mjs} +41 -12
  15. package/.output/server/_ssr/{ReplayDialog-C0nEvbYo.mjs → ReplayDialog-BXlajnMC.mjs} +3 -3
  16. package/.output/server/_ssr/{RequestAnatomy-CT55prmM.mjs → RequestAnatomy-CCrx09-i.mjs} +2 -2
  17. package/.output/server/_ssr/{ResponseView-DBZSBCOD.mjs → ResponseView-BxtMJrov.mjs} +2 -2
  18. package/.output/server/_ssr/{StreamingChunkSequence-BuVT7Oke.mjs → StreamingChunkSequence-BlpdSPb8.mjs} +2 -2
  19. package/.output/server/_ssr/{index-Cw_zJVQv.mjs → index-BeTMNSJy.mjs} +2 -2
  20. package/.output/server/_ssr/index.mjs +2 -2
  21. package/.output/server/_ssr/{router-DxjqHipT.mjs → router-Ddl1tuU7.mjs} +27 -11
  22. package/.output/server/{_tanstack-start-manifest_v-xeOo5gW5.mjs → _tanstack-start-manifest_v-Bvdz_U0f.mjs} +1 -1
  23. package/.output/server/index.mjs +56 -56
  24. package/README.md +37 -5
  25. package/package.json +3 -3
  26. package/scripts/setup-agent-skills.mjs +64 -0
  27. package/src/cli/doctor.ts +12 -5
  28. package/src/cli/onboard.ts +407 -13
  29. package/src/cli/templates/codex-skill-onboard.ts +5 -0
  30. package/src/cli/templates/command-onboard.ts +12 -4
  31. package/src/cli/templates/skill-onboard.ts +17 -21
  32. package/src/components/OnboardingBanner.tsx +5 -0
  33. package/src/components/providers/SettingsDialog.tsx +22 -4
  34. package/src/proxy/dataDir.ts +35 -13
  35. package/.output/public/assets/_sessionId-CShO0OrR.js +0 -1
  36. package/.output/public/assets/index-BkdYiTpV.js +0 -1
  37. package/scripts/setup-codex-skill.mjs +0 -38
@@ -75,7 +75,7 @@ export function SettingsDialog(): JSX.Element {
75
75
  <TabsTrigger value="onboarding">Onboarding</TabsTrigger>
76
76
  </TabsList>
77
77
 
78
- <div className="mt-4 overflow-y-auto flex-1 pr-3">
78
+ <div className="mt-4 flex-1 overflow-x-hidden overflow-y-auto pr-3">
79
79
  <TabsContent value="providers">
80
80
  <ProvidersPanel
81
81
  externalProviders={providers}
@@ -119,7 +119,7 @@ function CopyableSetupValue({
119
119
  }): JSX.Element {
120
120
  const copied = copiedId === id;
121
121
  return (
122
- <div className="rounded-md border border-border bg-muted/20 px-3 py-2">
122
+ <div className="min-w-0 rounded-md border border-border bg-muted/20 px-3 py-2">
123
123
  <div className="mb-1 text-xs font-medium text-muted-foreground">{label}</div>
124
124
  <div className="flex min-w-0 items-center gap-2">
125
125
  <code className="min-w-0 flex-1 truncate font-mono text-xs text-foreground">{value}</code>
@@ -146,10 +146,28 @@ function OnboardingSettingsTab(): JSX.Element {
146
146
  }, []);
147
147
  const values = useMemo(
148
148
  () => [
149
- { id: "skill", label: "Codex skill", value: "agent-inspector onboard --force" },
149
+ { id: "status", label: "Check onboarding", value: "agent-inspector onboard --status" },
150
+ {
151
+ id: "status-json",
152
+ label: "Check onboarding JSON",
153
+ value: "agent-inspector onboard --status --json",
154
+ },
155
+ { id: "refresh", label: "Refresh generated files", value: "agent-inspector onboard --force" },
156
+ {
157
+ id: "uninstall",
158
+ label: "Remove matching generated files",
159
+ value: "agent-inspector onboard --uninstall",
160
+ },
161
+ { id: "claude", label: "Claude Code command", value: "/agent-inspector:onboard" },
162
+ {
163
+ id: "codex",
164
+ label: "Codex prompt",
165
+ value: "Use the agent-inspector-onboard skill",
166
+ },
150
167
  { id: "mcp", label: "MCP URL", value: `${origin}/api/mcp` },
151
168
  { id: "proxy", label: "Proxy URL", value: `${origin}/proxy` },
152
169
  { id: "anthropic", label: "Anthropic base", value: `ANTHROPIC_BASE_URL=${origin}/proxy` },
170
+ { id: "openai", label: "OpenAI base", value: `OPENAI_BASE_URL=${origin}/proxy` },
153
171
  ],
154
172
  [origin],
155
173
  );
@@ -162,7 +180,7 @@ function OnboardingSettingsTab(): JSX.Element {
162
180
  }, []);
163
181
 
164
182
  return (
165
- <div className="space-y-4">
183
+ <div className="min-w-0 space-y-4">
166
184
  <div className="flex items-center gap-2">
167
185
  <Terminal className="size-4 text-muted-foreground" />
168
186
  <h3 className="text-sm font-semibold">Agent onboarding</h3>
@@ -1,8 +1,8 @@
1
- import { existsSync } from "node:fs";
1
+ import { cpSync, existsSync, rmSync } from "node:fs";
2
2
  import { isAbsolute, join } from "node:path";
3
3
 
4
4
  const CURRENT_DATA_DIR_NAME = ".agent-inspector";
5
- const LEGACY_DATA_DIR_NAME = ".llm-inspector";
5
+ const LEGACY_DATA_DIR_NAMES = [".llm-inspector", ".llm-agent"];
6
6
 
7
7
  /**
8
8
  * Compute the directory where agent-inspector stores its on-disk state
@@ -16,8 +16,6 @@ const LEGACY_DATA_DIR_NAME = ".llm-inspector";
16
16
  * with the runtime config; treated as a directory *name* (relative
17
17
  * to the OS-specific base) when not absolute.
18
18
  * 3. OS-specific base + `.agent-inspector`.
19
- * 4. Backward compatibility: if `.agent-inspector` has no known state
20
- * files but `.llm-inspector` does, reuse `.llm-inspector`.
21
19
  *
22
20
  * Windows base is `%USERPROFILE%` (falling back to `%APPDATA%`, then `C:\`).
23
21
  * macOS / Linux base is `$HOME` (falling back to `/tmp`).
@@ -26,6 +24,7 @@ const LEGACY_DATA_DIR_NAME = ".llm-inspector";
26
24
  * directory after this module has been imported.
27
25
  */
28
26
  export function getDataDir(): string {
27
+ migrateLegacyDataDirs();
29
28
  return resolveDataDir(existsSync);
30
29
  }
31
30
 
@@ -41,15 +40,21 @@ function hasDataDirState(pathExists: PathExists, dir: string): boolean {
41
40
  );
42
41
  }
43
42
 
44
- export function resolveDataDir(
45
- pathExists: PathExists,
43
+ function defaultBaseDir(
46
44
  env: DataDirEnv = process.env,
47
45
  platform: typeof process.platform = process.platform,
48
46
  ): string {
49
- const isWindows = platform === "win32";
50
- const base = isWindows
47
+ return platform === "win32"
51
48
  ? (env["USERPROFILE"] ?? env["APPDATA"] ?? "C:\\")
52
49
  : (env["HOME"] ?? "/tmp");
50
+ }
51
+
52
+ export function resolveDataDir(
53
+ _pathExists: PathExists,
54
+ env: DataDirEnv = process.env,
55
+ platform: typeof process.platform = process.platform,
56
+ ): string {
57
+ const base = defaultBaseDir(env, platform);
53
58
 
54
59
  const dirEnv = env["AGENT_INSPECTOR_DATA_DIR"];
55
60
  if (dirEnv !== undefined && dirEnv !== "") {
@@ -64,11 +69,7 @@ export function resolveDataDir(
64
69
  return isAbsolute(legacyDirEnv) ? legacyDirEnv : join(base, legacyDirEnv);
65
70
  }
66
71
 
67
- const currentDir = join(base, CURRENT_DATA_DIR_NAME);
68
- const legacyDir = join(base, LEGACY_DATA_DIR_NAME);
69
- return !hasDataDirState(pathExists, currentDir) && hasDataDirState(pathExists, legacyDir)
70
- ? legacyDir
71
- : currentDir;
72
+ return join(base, CURRENT_DATA_DIR_NAME);
72
73
  }
73
74
 
74
75
  /**
@@ -84,3 +85,24 @@ export function hasExplicitDataDir(): boolean {
84
85
  process.env["AGENT_INSPECTOR_CONFIG_DIR"] !== "")
85
86
  );
86
87
  }
88
+
89
+ function migrateLegacyDataDirs(): void {
90
+ if (hasExplicitDataDir()) return;
91
+
92
+ const base = defaultBaseDir();
93
+ const currentDir = join(base, CURRENT_DATA_DIR_NAME);
94
+ if (hasDataDirState(existsSync, currentDir)) return;
95
+
96
+ for (const legacyName of LEGACY_DATA_DIR_NAMES) {
97
+ const legacyDir = join(base, legacyName);
98
+ if (!existsSync(legacyDir)) continue;
99
+
100
+ try {
101
+ cpSync(legacyDir, currentDir, { recursive: true, force: true });
102
+ rmSync(legacyDir, { recursive: true, force: true });
103
+ } catch {
104
+ // Best-effort migration: startup must continue even when the old
105
+ // directory is locked or partially unreadable. The next call can retry.
106
+ }
107
+ }
108
+ }
@@ -1 +0,0 @@
1
- import{R as s,j as e}from"./main-B2t-3SYj.js";import{P as i}from"./ProxyViewerContainer-B1KylMPs.js";function t(){const{sessionId:o}=s.useParams();return e.jsx(i,{initialSessionId:o},o)}export{t as component};
@@ -1 +0,0 @@
1
- import{P as o}from"./ProxyViewerContainer-B1KylMPs.js";import"./main-B2t-3SYj.js";const r=o;export{r as component};
@@ -1,38 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import { homedir } from "node:os";
3
- import { dirname, join } from "node:path";
4
- import { spawnSync } from "node:child_process";
5
- import { fileURLToPath } from "node:url";
6
-
7
- const scriptDir = dirname(fileURLToPath(import.meta.url));
8
- const packageRoot = dirname(scriptDir);
9
- const cliEntry = join(packageRoot, ".output", "cli.js");
10
- const codexHome = process.env["CODEX_HOME"] ?? join(homedir(), ".codex");
11
-
12
- function shouldSkip() {
13
- return (
14
- process.env["AGENT_INSPECTOR_SKIP_CODEX_SKILL"] === "1" ||
15
- !existsSync(cliEntry) ||
16
- (!existsSync(codexHome) && process.env["AGENT_INSPECTOR_INSTALL_CODEX_SKILL"] !== "1")
17
- );
18
- }
19
-
20
- function main() {
21
- if (shouldSkip()) return;
22
-
23
- const result = spawnSync(process.execPath, [cliEntry, "onboard", "--codex-only"], {
24
- stdio: "ignore",
25
- windowsHide: true,
26
- });
27
-
28
- if (result.status !== 0) {
29
- console.warn("Skipping Codex onboard skill installation.");
30
- }
31
- }
32
-
33
- try {
34
- main();
35
- } catch (error) {
36
- const message = error instanceof Error ? error.message : String(error);
37
- console.warn(`Skipping Codex onboard skill installation: ${message}`);
38
- }