wepscli 0.1.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.
Files changed (130) hide show
  1. package/README.md +293 -0
  2. package/dist/WEPSCLI-shell/agent-runtime.js +824 -0
  3. package/dist/WEPSCLI-shell/agent-runtime.js.map +1 -0
  4. package/dist/WEPSCLI-shell/approval-overlay.js +275 -0
  5. package/dist/WEPSCLI-shell/approval-overlay.js.map +1 -0
  6. package/dist/WEPSCLI-shell/chat-components.js +760 -0
  7. package/dist/WEPSCLI-shell/chat-components.js.map +1 -0
  8. package/dist/WEPSCLI-shell/components.js +850 -0
  9. package/dist/WEPSCLI-shell/components.js.map +1 -0
  10. package/dist/WEPSCLI-shell/config-overlays.js +205 -0
  11. package/dist/WEPSCLI-shell/config-overlays.js.map +1 -0
  12. package/dist/WEPSCLI-shell/debug-log.js +16 -0
  13. package/dist/WEPSCLI-shell/debug-log.js.map +1 -0
  14. package/dist/WEPSCLI-shell/file-change-preview.js +261 -0
  15. package/dist/WEPSCLI-shell/file-change-preview.js.map +1 -0
  16. package/dist/WEPSCLI-shell/helpers.js +112 -0
  17. package/dist/WEPSCLI-shell/helpers.js.map +1 -0
  18. package/dist/WEPSCLI-shell/index.js +3 -0
  19. package/dist/WEPSCLI-shell/index.js.map +1 -0
  20. package/dist/WEPSCLI-shell/provider-add-flow.js +406 -0
  21. package/dist/WEPSCLI-shell/provider-add-flow.js.map +1 -0
  22. package/dist/WEPSCLI-shell/run-wepscli-shell.js +21 -0
  23. package/dist/WEPSCLI-shell/run-wepscli-shell.js.map +1 -0
  24. package/dist/WEPSCLI-shell/runtime-recovery.js +37 -0
  25. package/dist/WEPSCLI-shell/runtime-recovery.js.map +1 -0
  26. package/dist/WEPSCLI-shell/runtime-status.js +66 -0
  27. package/dist/WEPSCLI-shell/runtime-status.js.map +1 -0
  28. package/dist/WEPSCLI-shell/shell-app.js +1047 -0
  29. package/dist/WEPSCLI-shell/shell-app.js.map +1 -0
  30. package/dist/WEPSCLI-shell/shell-modes.js +77 -0
  31. package/dist/WEPSCLI-shell/shell-modes.js.map +1 -0
  32. package/dist/WEPSCLI-shell/slash-commands.js +135 -0
  33. package/dist/WEPSCLI-shell/slash-commands.js.map +1 -0
  34. package/dist/WEPSCLI-shell/theme.js +19 -0
  35. package/dist/WEPSCLI-shell/theme.js.map +1 -0
  36. package/dist/WEPSCLI-shell/tool-approval.js +85 -0
  37. package/dist/WEPSCLI-shell/tool-approval.js.map +1 -0
  38. package/dist/WEPSCLI-shell/tool-diff.js +76 -0
  39. package/dist/WEPSCLI-shell/tool-diff.js.map +1 -0
  40. package/dist/WEPSCLI-shell/tool-file-changes.js +268 -0
  41. package/dist/WEPSCLI-shell/tool-file-changes.js.map +1 -0
  42. package/dist/WEPSCLI-shell/tool-message-detail.js +138 -0
  43. package/dist/WEPSCLI-shell/tool-message-detail.js.map +1 -0
  44. package/dist/WEPSCLI-shell/tool-messages.js +145 -0
  45. package/dist/WEPSCLI-shell/tool-messages.js.map +1 -0
  46. package/dist/WEPSCLI-shell/transcript-panel.js +372 -0
  47. package/dist/WEPSCLI-shell/transcript-panel.js.map +1 -0
  48. package/dist/WEPSCLI-shell/transcript-state.js +62 -0
  49. package/dist/WEPSCLI-shell/transcript-state.js.map +1 -0
  50. package/dist/WEPSCLI-shell/types.js +1 -0
  51. package/dist/WEPSCLI-shell/types.js.map +1 -0
  52. package/dist/cli.js +11 -0
  53. package/dist/cli.js.map +1 -0
  54. package/dist/config.js +40 -0
  55. package/dist/config.js.map +1 -0
  56. package/dist/index.js +4 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/main.js +140 -0
  59. package/dist/main.js.map +1 -0
  60. package/dist/onboarding/action-screen.js +90 -0
  61. package/dist/onboarding/action-screen.js.map +1 -0
  62. package/dist/onboarding/framed-screen.js +35 -0
  63. package/dist/onboarding/framed-screen.js.map +1 -0
  64. package/dist/onboarding/onboarding-app.js +312 -0
  65. package/dist/onboarding/onboarding-app.js.map +1 -0
  66. package/dist/onboarding/run-onboarding.js +23 -0
  67. package/dist/onboarding/run-onboarding.js.map +1 -0
  68. package/dist/onboarding/select-screen.js +21 -0
  69. package/dist/onboarding/select-screen.js.map +1 -0
  70. package/dist/onboarding/summary-screen.js +23 -0
  71. package/dist/onboarding/summary-screen.js.map +1 -0
  72. package/dist/onboarding/text-input-screen.js +55 -0
  73. package/dist/onboarding/text-input-screen.js.map +1 -0
  74. package/dist/onboarding/theme.js +26 -0
  75. package/dist/onboarding/theme.js.map +1 -0
  76. package/dist/provider-profiles/api-key-store.js +51 -0
  77. package/dist/provider-profiles/api-key-store.js.map +1 -0
  78. package/dist/provider-profiles/defaults.js +18 -0
  79. package/dist/provider-profiles/defaults.js.map +1 -0
  80. package/dist/provider-profiles/fetch-models.js +53 -0
  81. package/dist/provider-profiles/fetch-models.js.map +1 -0
  82. package/dist/provider-profiles/index.js +6 -0
  83. package/dist/provider-profiles/index.js.map +1 -0
  84. package/dist/provider-profiles/provider-profile-service.js +223 -0
  85. package/dist/provider-profiles/provider-profile-service.js.map +1 -0
  86. package/dist/provider-profiles/providers-config-store.js +17 -0
  87. package/dist/provider-profiles/providers-config-store.js.map +1 -0
  88. package/dist/provider-profiles/types.js +1 -0
  89. package/dist/provider-profiles/types.js.map +1 -0
  90. package/dist/session-history/session-history-service.js +142 -0
  91. package/dist/session-history/session-history-service.js.map +1 -0
  92. package/dist/shell/animator.js +30 -0
  93. package/dist/shell/animator.js.map +1 -0
  94. package/dist/shell/clickables.js +101 -0
  95. package/dist/shell/clickables.js.map +1 -0
  96. package/dist/shell/dashboard-shell.js +292 -0
  97. package/dist/shell/dashboard-shell.js.map +1 -0
  98. package/dist/shell/index.js +5 -0
  99. package/dist/shell/index.js.map +1 -0
  100. package/dist/shell/keymap.js +14 -0
  101. package/dist/shell/keymap.js.map +1 -0
  102. package/dist/shell/mouse.js +39 -0
  103. package/dist/shell/mouse.js.map +1 -0
  104. package/dist/shell/render.js +122 -0
  105. package/dist/shell/render.js.map +1 -0
  106. package/dist/shell/run-shell.js +36 -0
  107. package/dist/shell/run-shell.js.map +1 -0
  108. package/dist/shell/theme.js +56 -0
  109. package/dist/shell/theme.js.map +1 -0
  110. package/dist/storage/locked-json-file.js +88 -0
  111. package/dist/storage/locked-json-file.js.map +1 -0
  112. package/dist/workbench/animator.js +30 -0
  113. package/dist/workbench/animator.js.map +1 -0
  114. package/dist/workbench/index.js +6 -0
  115. package/dist/workbench/index.js.map +1 -0
  116. package/dist/workbench/mouse.js +39 -0
  117. package/dist/workbench/mouse.js.map +1 -0
  118. package/dist/workbench/render.js +82 -0
  119. package/dist/workbench/render.js.map +1 -0
  120. package/dist/workbench/renderer.js +364 -0
  121. package/dist/workbench/renderer.js.map +1 -0
  122. package/dist/workbench/run-workbench.js +36 -0
  123. package/dist/workbench/run-workbench.js.map +1 -0
  124. package/dist/workbench/theme.js +63 -0
  125. package/dist/workbench/theme.js.map +1 -0
  126. package/dist/workbench/types.js +1 -0
  127. package/dist/workbench/types.js.map +1 -0
  128. package/dist/workbench/workbench-shell.js +649 -0
  129. package/dist/workbench/workbench-shell.js.map +1 -0
  130. package/package.json +65 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["For","Show","formatToolDiffStats","toolFileChangeLocation","wepscliShellTheme","theme","MAX_DIFF_LINES","MAX_PREVIEW_LINES","diffLineColor","line","kind","success","danger","text","muted","formatDiffLine","rawText","prefix","lineNumber","padStart","content","sliceMultiline","maxLines","lines","replace","split","visibleLines","slice","hiddenLineCount","Math","max","length","previewLabel","change","changeTone","warning","accent","DiffPreview","props","_el$","_$createElement","_$setProp","_$insert","_$createComponent","each","children","_el$5","_$effect","_$p","when","_el$2","_el$3","_$createTextNode","_el$4","_$insertNode","_p$","_v$","panelMuted","_v$2","border","e","t","undefined","WritePreview","preview","previewText","_el$6","_el$0","_el$7","_el$8","_el$9","_v$3","_v$4","FileChangeCard","_el$1","_el$10","_el$11","_el$12","_el$13","toUpperCase","summary","diffLines","_el$14","_el$15","_el$16","diffStats","_v$5","_v$6","_$memo","_el$17","_v$7","panelAlt","_v$8","_v$9","accentStrong","_v$0","_v$1","a","o","i","FileChangeCardList","_el$18","_c$","title","_el$19","changes"],"sources":["file-change-preview.tsx"],"sourcesContent":["import { For, Show } from \"solid-js\";\nimport { formatToolDiffStats, toolFileChangeLocation, type ToolDiffLine, type ToolFileChange } from \"./tool-file-changes.js\";\nimport { wepscliShellTheme as theme } from \"./theme.js\";\n\nconst MAX_DIFF_LINES = 48;\nconst MAX_PREVIEW_LINES = 16;\n\nfunction diffLineColor(line: ToolDiffLine): string {\n\tswitch (line.kind) {\n\t\tcase \"added\":\n\t\t\treturn theme.success;\n\t\tcase \"removed\":\n\t\t\treturn theme.danger;\n\t\tcase \"context\":\n\t\t\treturn theme.text;\n\t\tcase \"meta\":\n\t\t\treturn theme.muted;\n\t}\n}\n\nfunction formatDiffLine(line: ToolDiffLine): string {\n\tif (line.kind === \"meta\") {\n\t\treturn line.rawText;\n\t}\n\tconst prefix = line.kind === \"added\" ? \"+\" : line.kind === \"removed\" ? \"-\" : \" \";\n\tconst lineNumber = line.lineNumber?.padStart(4, \" \") ?? \" \";\n\treturn `${prefix}${lineNumber} ${line.content}`;\n}\n\nfunction sliceMultiline(text: string, maxLines: number): { visibleLines: string[]; hiddenLineCount: number } {\n\tconst lines = text.replace(/\\r/g, \"\").split(\"\\n\");\n\treturn {\n\t\tvisibleLines: lines.slice(0, maxLines),\n\t\thiddenLineCount: Math.max(0, lines.length - maxLines),\n\t};\n}\n\nfunction previewLabel(change: ToolFileChange): string {\n\treturn change.kind === \"edit\" ? \"Diff\" : \"Preview\";\n}\n\nfunction changeTone(change: ToolFileChange): string {\n\treturn change.kind === \"edit\" ? theme.warning : theme.accent;\n}\n\nfunction DiffPreview(props: { lines: ToolDiffLine[] }) {\n\tconst visibleLines = () => props.lines.slice(0, MAX_DIFF_LINES);\n\tconst hiddenLineCount = () => Math.max(0, props.lines.length - MAX_DIFF_LINES);\n\n\treturn (\n\t\t<box backgroundColor={theme.panelMuted} border={[\"left\"]} borderColor={theme.border} paddingLeft={1} flexDirection=\"column\" gap={0}>\n\t\t\t<For each={visibleLines()}>{(line) => <text fg={diffLineColor(line)}>{formatDiffLine(line)}</text>}</For>\n\t\t\t<Show when={hiddenLineCount() > 0}>\n\t\t\t\t<text fg={theme.muted}>... {hiddenLineCount()} more diff lines</text>\n\t\t\t</Show>\n\t\t</box>\n\t);\n}\n\nfunction WritePreview(props: { previewText: string }) {\n\tconst preview = () => sliceMultiline(props.previewText, MAX_PREVIEW_LINES);\n\n\treturn (\n\t\t<box backgroundColor={theme.panelMuted} border={[\"left\"]} borderColor={theme.border} paddingLeft={1} flexDirection=\"column\" gap={0}>\n\t\t\t<For each={preview().visibleLines}>{(line) => <text fg={theme.text}>{line || \" \"}</text>}</For>\n\t\t\t<Show when={preview().hiddenLineCount > 0}>\n\t\t\t\t<text fg={theme.muted}>... {preview().hiddenLineCount} more preview lines</text>\n\t\t\t</Show>\n\t\t</box>\n\t);\n}\n\nexport function FileChangeCard(props: { change: ToolFileChange }) {\n\treturn (\n\t\t<box\n\t\t\tbackgroundColor={theme.panelAlt}\n\t\t\tborder={[\"top\", \"right\", \"bottom\", \"left\"]}\n\t\t\tborderColor={changeTone(props.change)}\n\t\t\tpadding={1}\n\t\t\tflexDirection=\"column\"\n\t\t\tgap={1}\n\t\t>\n\t\t\t<box flexDirection=\"row\" justifyContent=\"space-between\" gap={1}>\n\t\t\t\t<text fg={theme.accentStrong}>{toolFileChangeLocation(props.change)}</text>\n\t\t\t\t<text fg={changeTone(props.change)}>{props.change.kind.toUpperCase()}</text>\n\t\t\t</box>\n\t\t\t<text fg={theme.muted} wrapMode=\"word\">{props.change.summary}</text>\n\t\t\t<Show when={props.change.diffLines?.length}>\n\t\t\t\t<box flexDirection=\"row\" justifyContent=\"space-between\" gap={1}>\n\t\t\t\t\t<text fg={theme.accent}>{previewLabel(props.change)}</text>\n\t\t\t\t\t<text fg={theme.muted}>{formatToolDiffStats(props.change.diffStats) ?? \"\"}</text>\n\t\t\t\t</box>\n\t\t\t\t<DiffPreview lines={props.change.diffLines!} />\n\t\t\t</Show>\n\t\t\t<Show when={!props.change.diffLines?.length && props.change.previewText}>\n\t\t\t\t<text fg={theme.accent}>{previewLabel(props.change)}</text>\n\t\t\t\t<WritePreview previewText={props.change.previewText!} />\n\t\t\t</Show>\n\t\t</box>\n\t);\n}\n\nexport function FileChangeCardList(props: { changes: ToolFileChange[]; title?: string }) {\n\treturn (\n\t\t<box flexDirection=\"column\" gap={1}>\n\t\t\t{props.title ? <text fg={theme.accent}>{props.title}</text> : null}\n\t\t\t<For each={props.changes}>{(change) => <FileChangeCard change={change} />}</For>\n\t\t</box>\n\t);\n}\n"],"mappings":";;;;;;;;AAAA,SAASA,GAAG,EAAEC,IAAI,QAAQ,UAAU;AACpC,SAASC,mBAAmB,EAAEC,sBAAsB,QAAgD,wBAAwB;AAC5H,SAASC,iBAAiB,IAAIC,KAAK,QAAQ,YAAY;AAEvD,MAAMC,cAAc,GAAG,EAAE;AACzB,MAAMC,iBAAiB,GAAG,EAAE;AAE5B,SAASC,aAAaA,CAACC,IAAkB,EAAU;EAClD,QAAQA,IAAI,CAACC,IAAI;IAChB,KAAK,OAAO;MACX,OAAOL,KAAK,CAACM,OAAO;IACrB,KAAK,SAAS;MACb,OAAON,KAAK,CAACO,MAAM;IACpB,KAAK,SAAS;MACb,OAAOP,KAAK,CAACQ,IAAI;IAClB,KAAK,MAAM;MACV,OAAOR,KAAK,CAACS,KAAK;EACpB;AACD;AAEA,SAASC,cAAcA,CAACN,IAAkB,EAAU;EACnD,IAAIA,IAAI,CAACC,IAAI,KAAK,MAAM,EAAE;IACzB,OAAOD,IAAI,CAACO,OAAO;EACpB;EACA,MAAMC,MAAM,GAAGR,IAAI,CAACC,IAAI,KAAK,OAAO,GAAG,GAAG,GAAGD,IAAI,CAACC,IAAI,KAAK,SAAS,GAAG,GAAG,GAAG,GAAG;EAChF,MAA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AA5D,SAAA,CAAA4D,MAAA,SAAM,CAAC;IAAA3D,QAAA,CAAA2D,MAAA;MAAA,IAAAC,GAAA,GAAAd,MAAA,SAChClD,KAAK,CAACiE,KAAK;MAAA,aAAXD,GAAA;QAAA,IAAAE,MAAA,GAAAhE,eAAA;QAAAE,QAAA,CAAA8D,MAAA,QAAuClE,KAAK,CAACiE,KAAK;QAAAxD,QAAA,CAAAC,GAAA,IAAAP,SAAA,CAAA+D,MAAA,QAA1BnG,KAAK,CAAC+B,MAAM,EAAAY,GAAA;QAAA,OAAAwD,MAAA;MAAA,OAAyB,IAAI;IAAA;IAAA9D,QAAA,CAAA2D,MAAA,EAAA1D,iBAAA,CACjE3C,GAAG;MAAA,IAAC4C,IAAIA,CAAA;QAAA,OAAEN,KAAK,CAACmE,OAAO;MAAA;MAAA5D,QAAA,EAAIZ,MAAM,IAAAU,iBAAA,CAAM8B,cAAc;QAACxC,MAAM,EAAEA;MAAM;IAAI;IAAA,OAAAoE,MAAA;EAAA;AAG5E","ignoreList":[]}
@@ -0,0 +1,112 @@
1
+ export const INITIAL_SESSIONS = [{
2
+ id: "shell-rebuild",
3
+ title: "Continue WEPSCLI shell rebuild",
4
+ summary: "Use the new OpenTUI shell layer as the replacement path for the old workbench scaffold.",
5
+ state: "active"
6
+ }, {
7
+ id: "provider-sync",
8
+ title: "Provider state sync pass",
9
+ summary: "Keep onboarding and provider-profile storage as the backend contract for the new shell.",
10
+ state: "recent"
11
+ }, {
12
+ id: "visual-pass",
13
+ title: "Affordance pass",
14
+ summary: "Replace vague click regions with visible controls, cards, and dialogs.",
15
+ state: "ready"
16
+ }];
17
+ export function seedTimeline(profiles) {
18
+ return ["OpenTUI/Solid shell scaffold loaded under src/WEPSCLI-shell.", "Provider profiles and onboarding remain owned by the existing storage/runtime layer.", profiles[0] ? `Current provider loaded from config: ${profiles[0].label}.` : "No provider profile was found in storage."];
19
+ }
20
+ export function labelForView(view) {
21
+ switch (view) {
22
+ case "home":
23
+ return "Home";
24
+ case "providers":
25
+ return "Providers";
26
+ case "history":
27
+ return "History";
28
+ }
29
+ }
30
+ export function labelForFocus(focus) {
31
+ switch (focus) {
32
+ case "rail":
33
+ return "Left Rail";
34
+ case "main":
35
+ return "Main Workbench";
36
+ case "composer":
37
+ return "Composer";
38
+ case "overlay":
39
+ return "Overlay";
40
+ }
41
+ }
42
+ export function overlayTitle(kind) {
43
+ switch (kind) {
44
+ case "provider":
45
+ return "Provider Picker";
46
+ case "model-provider":
47
+ return "Model Provider Picker";
48
+ case "model":
49
+ return "Model Picker";
50
+ case "session":
51
+ return "Session Picker";
52
+ case undefined:
53
+ return "Picker";
54
+ }
55
+ }
56
+ export function overlayDescription(kind) {
57
+ switch (kind) {
58
+ case "provider":
59
+ return "Pick the active provider profile from existing WEPSCLI config storage.";
60
+ case "model-provider":
61
+ return "Pick which provider you want to browse models for.";
62
+ case "model":
63
+ return "Pick the active model for the chosen provider.";
64
+ case "session":
65
+ return "Pick a staged placeholder session while runtime history integration is still pending.";
66
+ case undefined:
67
+ return "";
68
+ }
69
+ }
70
+ export function wrapIndex(current, delta, length) {
71
+ if (length === 0) return 0;
72
+ return (current + delta + length) % length;
73
+ }
74
+ export function truncate(value, maxLength) {
75
+ return value.length <= maxLength ? value : `${value.slice(0, Math.max(0, maxLength - 3))}...`;
76
+ }
77
+ export function statusTone(status) {
78
+ switch (status) {
79
+ case "ok":
80
+ return "success";
81
+ case "error":
82
+ return "danger";
83
+ case "unknown":
84
+ return "warning";
85
+ }
86
+ }
87
+ export function mapHistoryRecordToCard(record) {
88
+ return {
89
+ id: record.id,
90
+ title: record.title,
91
+ summary: record.summary,
92
+ state: record.state,
93
+ updatedAt: record.updatedAt,
94
+ providerLabel: record.providerLabel,
95
+ modelId: record.modelId
96
+ };
97
+ }
98
+ export function formatTimestamp(timestamp) {
99
+ if (!timestamp) {
100
+ return "just now";
101
+ }
102
+ const date = new Date(timestamp);
103
+ if (Number.isNaN(date.getTime())) {
104
+ return "unknown time";
105
+ }
106
+ return date.toLocaleString("en-US", {
107
+ month: "short",
108
+ day: "numeric",
109
+ hour: "2-digit",
110
+ minute: "2-digit"
111
+ });
112
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"names":["INITIAL_SESSIONS","id","title","summary","state","seedTimeline","profiles","label","labelForView","view","labelForFocus","focus","overlayTitle","kind","undefined","overlayDescription","wrapIndex","current","delta","length","truncate","value","maxLength","slice","Math","max","statusTone","status","mapHistoryRecordToCard","record","updatedAt","providerLabel","modelId","formatTimestamp","timestamp","date","Date","Number","isNaN","getTime","toLocaleString","month","day","hour","minute"],"sources":["helpers.ts"],"sourcesContent":["import type { ProviderProfile } from \"../provider-profiles/index.js\";\r\nimport type { SessionCard } from \"./types.js\";\r\nimport type { CardTag, OverlayKind, ShellFocus, ShellView } from \"./types.js\";\r\n\r\nexport const INITIAL_SESSIONS: SessionCard[] = [\r\n\t{\r\n\t\tid: \"shell-rebuild\",\r\n\t\ttitle: \"Continue WEPSCLI shell rebuild\",\r\n\t\tsummary: \"Use the new OpenTUI shell layer as the replacement path for the old workbench scaffold.\",\r\n\t\tstate: \"active\",\r\n\t},\r\n\t{\r\n\t\tid: \"provider-sync\",\r\n\t\ttitle: \"Provider state sync pass\",\r\n\t\tsummary: \"Keep onboarding and provider-profile storage as the backend contract for the new shell.\",\r\n\t\tstate: \"recent\",\r\n\t},\r\n\t{\r\n\t\tid: \"visual-pass\",\r\n\t\ttitle: \"Affordance pass\",\r\n\t\tsummary: \"Replace vague click regions with visible controls, cards, and dialogs.\",\r\n\t\tstate: \"ready\",\r\n\t},\r\n];\r\n\r\nexport function seedTimeline(profiles: ProviderProfile[]): string[] {\r\n\treturn [\r\n\t\t\"OpenTUI/Solid shell scaffold loaded under src/WEPSCLI-shell.\",\r\n\t\t\"Provider profiles and onboarding remain owned by the existing storage/runtime layer.\",\r\n\t\tprofiles[0] ? `Current provider loaded from config: ${profiles[0].label}.` : \"No provider profile was found in storage.\",\r\n\t];\r\n}\r\n\r\nexport function labelForView(view: ShellView): string {\r\n\tswitch (view) {\r\n\t\tcase \"home\":\r\n\t\t\treturn \"Home\";\r\n\t\tcase \"providers\":\r\n\t\t\treturn \"Providers\";\r\n\t\tcase \"history\":\r\n\t\t\treturn \"History\";\r\n\t}\r\n}\r\n\r\nexport function labelForFocus(focus: ShellFocus): string {\r\n\tswitch (focus) {\r\n\t\tcase \"rail\":\r\n\t\t\treturn \"Left Rail\";\r\n\t\tcase \"main\":\r\n\t\t\treturn \"Main Workbench\";\r\n\t\tcase \"composer\":\r\n\t\t\treturn \"Composer\";\r\n\t\tcase \"overlay\":\r\n\t\t\treturn \"Overlay\";\r\n\t}\r\n}\r\n\r\nexport function overlayTitle(kind: OverlayKind | undefined): string {\r\n\tswitch (kind) {\r\n\t\tcase \"provider\":\r\n\t\t\treturn \"Provider Picker\";\r\n\t\tcase \"model-provider\":\r\n\t\t\treturn \"Model Provider Picker\";\r\n\t\tcase \"model\":\r\n\t\t\treturn \"Model Picker\";\r\n\t\tcase \"session\":\r\n\t\t\treturn \"Session Picker\";\r\n\t\tcase undefined:\r\n\t\t\treturn \"Picker\";\r\n\t}\r\n}\r\n\r\nexport function overlayDescription(kind: OverlayKind | undefined): string {\r\n\tswitch (kind) {\r\n\t\tcase \"provider\":\r\n\t\t\treturn \"Pick the active provider profile from existing WEPSCLI config storage.\";\r\n\t\tcase \"model-provider\":\r\n\t\t\treturn \"Pick which provider you want to browse models for.\";\r\n\t\tcase \"model\":\r\n\t\t\treturn \"Pick the active model for the chosen provider.\";\r\n\t\tcase \"session\":\r\n\t\t\treturn \"Pick a staged placeholder session while runtime history integration is still pending.\";\r\n\t\tcase undefined:\r\n\t\t\treturn \"\";\r\n\t}\r\n}\r\n\r\nexport function wrapIndex(current: number, delta: number, length: number): number {\r\n\tif (length === 0) return 0;\r\n\treturn (current + delta + length) % length;\r\n}\r\n\r\nexport function truncate(value: string, maxLength: number): string {\r\n\treturn value.length <= maxLength ? value : `${value.slice(0, Math.max(0, maxLength - 3))}...`;\r\n}\r\n\r\nexport function statusTone(status: ProviderProfile[\"lastValidationStatus\"]): CardTag[\"tone\"] {\r\n\tswitch (status) {\r\n\t\tcase \"ok\":\r\n\t\t\treturn \"success\";\r\n\t\tcase \"error\":\r\n\t\t\treturn \"danger\";\r\n\t\tcase \"unknown\":\r\n\t\t\treturn \"warning\";\r\n\t}\r\n}\r\n\r\nexport function mapHistoryRecordToCard(record: {\r\n\tid: string;\r\n\ttitle: string;\r\n\tsummary: string;\r\n\tstate: SessionCard[\"state\"];\r\n\tupdatedAt?: string;\r\n\tproviderLabel?: string;\r\n\tmodelId?: string;\r\n}): SessionCard {\r\n\treturn {\r\n\t\tid: record.id,\r\n\t\ttitle: record.title,\r\n\t\tsummary: record.summary,\r\n\t\tstate: record.state,\r\n\t\tupdatedAt: record.updatedAt,\r\n\t\tproviderLabel: record.providerLabel,\r\n\t\tmodelId: record.modelId,\r\n\t};\r\n}\r\n\r\nexport function formatTimestamp(timestamp?: string): string {\r\n\tif (!timestamp) {\r\n\t\treturn \"just now\";\r\n\t}\r\n\r\n\tconst date = new Date(timestamp);\r\n\tif (Number.isNaN(date.getTime())) {\r\n\t\treturn \"unknown time\";\r\n\t}\r\n\r\n\treturn date.toLocaleString(\"en-US\", {\r\n\t\tmonth: \"short\",\r\n\t\tday: \"numeric\",\r\n\t\thour: \"2-digit\",\r\n\t\tminute: \"2-digit\",\r\n\t});\r\n}\r\n"],"mappings":"AAIA,OAAO,MAAMA,gBAA+B,GAAG,CAC9C;EACCC,EAAE,EAAE,eAAe;EACnBC,KAAK,EAAE,gCAAgC;EACvCC,OAAO,EAAE,yFAAyF;EAClGC,KAAK,EAAE;AACR,CAAC,EACD;EACCH,EAAE,EAAE,eAAe;EACnBC,KAAK,EAAE,0BAA0B;EACjCC,OAAO,EAAE,yFAAyF;EAClGC,KAAK,EAAE;AACR,CAAC,EACD;EACCH,EAAE,EAAE,aAAa;EACjBC,KAAK,EAAE,iBAAiB;EACxBC,OAAO,EAAE,wE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O;IACdC,GAAG,EAAE,SAAS;IACdC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACT,CAAC,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ export * from "./run-wepscli-shell.js";
2
+ export * from "./shell-app.js";
3
+ export * from "./theme.js";
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./run-wepscli-shell.js\";\r\nexport * from \"./shell-app.js\";\r\nexport * from \"./theme.js\";\r\n"],"mappings":"AAAA,cAAc,wBAAwB;AACtC,cAAc,gBAAgB;AAC9B,cAAc,YAAY","ignoreList":[]}
@@ -0,0 +1,406 @@
1
+ import { createComponent as _$createComponent } from "@opentui/solid";
2
+ import { memo as _$memo } from "@opentui/solid";
3
+ import { createEffect, createSignal } from "solid-js";
4
+ import { OverlayNotice, OverlayTextInput } from "./config-overlays.js";
5
+ import { OverlayPicker } from "./chat-components.js";
6
+ import { wrapIndex } from "./helpers.js";
7
+ import { fetchModelsForProfile } from "../provider-profiles/index.js";
8
+ function createEmptyProviderAddDraft() {
9
+ return {
10
+ label: "",
11
+ baseUrl: "",
12
+ apiKey: "",
13
+ models: [],
14
+ manualModel: ""
15
+ };
16
+ }
17
+ function defaultBaseUrlForFamily(family) {
18
+ return family === "anthropic" ? "https://api.anthropic.com" : "https://api.openai.com/v1";
19
+ }
20
+ export function createProviderAddFlow(options) {
21
+ const [step, setStep] = createSignal(undefined);
22
+ const [draft, setDraft] = createSignal(createEmptyProviderAddDraft());
23
+ const [selectedIndex, setSelectedIndex] = createSignal(0);
24
+ const [requestId, setRequestId] = createSignal(0);
25
+ let inputRef;
26
+ createEffect(() => {
27
+ const currentStep = step();
28
+ if (currentStep === "label" || currentStep === "baseUrl" || currentStep === "apiKey" || currentStep === "manualModel") {
29
+ setTimeout(() => inputRef?.focus(), 0);
30
+ }
31
+ });
32
+ function updateDraft(patch) {
33
+ setDraft(current => ({
34
+ ...current,
35
+ ...patch
36
+ }));
37
+ }
38
+ function pickerOptions() {
39
+ switch (step()) {
40
+ case "family":
41
+ return [{
42
+ id: "provider-add-family:openai",
43
+ label: "OpenAI-style",
44
+ description: "For OpenAI-compatible and proxy endpoints.",
45
+ badge: draft().family === "openai" ? "SELECTED" : undefined
46
+ }, {
47
+ id: "provider-add-family:anthropic",
48
+ label: "Anthropic-style",
49
+ description: "For Anthropic-compatible and proxy endpoints.",
50
+ badge: draft().family === "anthropic" ? "SELECTED" : undefined
51
+ }];
52
+ case "model":
53
+ return draft().models.map(model => ({
54
+ id: `provider-add-model:${model.id}`,
55
+ label: model.id,
56
+ description: `${model.family} | ${model.name}`
57
+ }));
58
+ default:
59
+ return [];
60
+ }
61
+ }
62
+ function close() {
63
+ setStep(undefined);
64
+ setDraft(createEmptyProviderAddDraft());
65
+ setSelectedIndex(0);
66
+ options.onClose();
67
+ }
68
+ function open() {
69
+ setDraft(createEmptyProviderAddDraft());
70
+ setSelectedIndex(0);
71
+ setStep("family");
72
+ }
73
+ function back() {
74
+ switch (step()) {
75
+ case "family":
76
+ close();
77
+ return;
78
+ case "label":
79
+ setStep("family");
80
+ setSelectedIndex(draft().family === "anthropic" ? 1 : 0);
81
+ return;
82
+ case "baseUrl":
83
+ setStep("label");
84
+ return;
85
+ case "apiKey":
86
+ setStep("baseUrl");
87
+ return;
88
+ case "model":
89
+ case "manualModel":
90
+ setStep("apiKey");
91
+ return;
92
+ case "loading":
93
+ return;
94
+ case undefined:
95
+ return;
96
+ }
97
+ }
98
+ function submitLabel(value) {
99
+ const trimmed = value.trim();
100
+ if (!trimmed) {
101
+ updateDraft({
102
+ error: "Provider label is required."
103
+ });
104
+ return;
105
+ }
106
+ updateDraft({
107
+ label: trimmed,
108
+ error: undefined
109
+ });
110
+ setStep("baseUrl");
111
+ }
112
+ function submitBaseUrl(value) {
113
+ const trimmed = value.trim();
114
+ if (!trimmed) {
115
+ updateDraft({
116
+ error: "Base URL is required."
117
+ });
118
+ return;
119
+ }
120
+ try {
121
+ const parsed = new URL(trimmed);
122
+ if (!parsed.protocol.startsWith("http")) {
123
+ updateDraft({
124
+ error: "Base URL must start with http:// or https://"
125
+ });
126
+ return;
127
+ }
128
+ } catch {
129
+ updateDraft({
130
+ error: "Enter a valid absolute URL."
131
+ });
132
+ return;
133
+ }
134
+ updateDraft({
135
+ baseUrl: trimmed,
136
+ error: undefined
137
+ });
138
+ setStep("apiKey");
139
+ }
140
+ async function fetchModels(apiKeyValue) {
141
+ const currentDraft = draft();
142
+ if (!currentDraft.family) {
143
+ updateDraft({
144
+ error: "Choose a provider family first."
145
+ });
146
+ setStep("family");
147
+ return;
148
+ }
149
+ const trimmedKey = apiKeyValue.trim();
150
+ if (!trimmedKey) {
151
+ updateDraft({
152
+ error: "API key is required."
153
+ });
154
+ return;
155
+ }
156
+ updateDraft({
157
+ apiKey: trimmedKey,
158
+ error: undefined
159
+ });
160
+ setStep("loading");
161
+ const currentRequestId = requestId() + 1;
162
+ setRequestId(currentRequestId);
163
+ try {
164
+ const models = await fetchModelsForProfile({
165
+ id: "draft",
166
+ label: currentDraft.label || "Draft provider",
167
+ family: currentDraft.family,
168
+ apiDialect: currentDraft.family === "anthropic" ? "anthropic-messages" : "openai-responses",
169
+ baseUrl: currentDraft.baseUrl,
170
+ enabled: true,
171
+ models: [],
172
+ createdAt: new Date().toISOString(),
173
+ updatedAt: new Date().toISOString(),
174
+ lastValidationStatus: "unknown"
175
+ }, trimmedKey);
176
+ if (requestId() !== currentRequestId) {
177
+ return;
178
+ }
179
+ updateDraft({
180
+ models,
181
+ error: undefined,
182
+ manualModel: ""
183
+ });
184
+ setSelectedIndex(0);
185
+ setStep("model");
186
+ } catch (error) {
187
+ if (requestId() !== currentRequestId) {
188
+ return;
189
+ }
190
+ updateDraft({
191
+ models: [],
192
+ error: error instanceof Error ? error.message : String(error)
193
+ });
194
+ setStep("manualModel");
195
+ }
196
+ }
197
+ function finalize(modelId, source) {
198
+ const currentDraft = draft();
199
+ if (!currentDraft.family) {
200
+ updateDraft({
201
+ error: "Choose a provider family first."
202
+ });
203
+ setStep("family");
204
+ return;
205
+ }
206
+ const normalizedModelId = modelId.trim();
207
+ if (!normalizedModelId) {
208
+ updateDraft({
209
+ error: "Model id is required."
210
+ });
211
+ return;
212
+ }
213
+ const profile = options.profileService.createProfile({
214
+ label: currentDraft.label,
215
+ family: currentDraft.family,
216
+ baseUrl: currentDraft.baseUrl,
217
+ apiKey: currentDraft.apiKey
218
+ });
219
+ const models = source === "fetched" ? currentDraft.models : [{
220
+ id: normalizedModelId,
221
+ name: normalizedModelId,
222
+ family: currentDraft.family
223
+ }];
224
+ options.profileService.replaceModels(profile.id, models, source === "fetched" ? {
225
+ status: "ok"
226
+ } : {
227
+ status: "unknown",
228
+ message: "Added with manual model entry."
229
+ });
230
+ options.profileService.setActiveSelection(profile.id, normalizedModelId);
231
+ options.onCreated({
232
+ profile,
233
+ modelId: normalizedModelId
234
+ });
235
+ close();
236
+ }
237
+ function confirmSelection() {
238
+ const target = pickerOptions()[selectedIndex()];
239
+ if (!target) {
240
+ return;
241
+ }
242
+ if (target.id.startsWith("provider-add-family:")) {
243
+ const family = target.id.slice("provider-add-family:".length);
244
+ updateDraft({
245
+ family,
246
+ baseUrl: draft().baseUrl || defaultBaseUrlForFamily(family),
247
+ error: undefined
248
+ });
249
+ setStep("label");
250
+ return;
251
+ }
252
+ if (target.id.startsWith("provider-add-model:")) {
253
+ finalize(target.id.slice("provider-add-model:".length), "fetched");
254
+ }
255
+ }
256
+ function moveSelection(delta) {
257
+ setSelectedIndex(current => wrapIndex(current, delta, pickerOptions().length));
258
+ }
259
+ function render() {
260
+ switch (step()) {
261
+ case "family":
262
+ case "model":
263
+ return _$createComponent(OverlayPicker, {
264
+ get title() {
265
+ return step() === "family" ? "Add Provider: Family" : "Add Provider: Model";
266
+ },
267
+ get description() {
268
+ return step() === "family" ? "Choose the provider family to start the guided setup." : "Choose one of the discovered models for the new provider.";
269
+ },
270
+ get options() {
271
+ return pickerOptions();
272
+ },
273
+ get selectedIndex() {
274
+ return selectedIndex();
275
+ },
276
+ onClose: back,
277
+ onSelect: (_id, index) => {
278
+ setSelectedIndex(index);
279
+ confirmSelection();
280
+ }
281
+ });
282
+ case "label":
283
+ return _$createComponent(OverlayTextInput, {
284
+ title: "Add Provider: Label",
285
+ description: "Choose the friendly name shown in provider and model pickers.",
286
+ label: "Provider label",
287
+ get value() {
288
+ return draft().label;
289
+ },
290
+ placeholder: "Example: My OpenAI Proxy",
291
+ get error() {
292
+ return draft().error;
293
+ },
294
+ inputRef: ref => {
295
+ inputRef = ref;
296
+ },
297
+ onInput: value => updateDraft({
298
+ label: value,
299
+ error: undefined
300
+ }),
301
+ onSubmit: submitLabel,
302
+ onClose: back
303
+ });
304
+ case "baseUrl":
305
+ return _$createComponent(OverlayTextInput, {
306
+ title: "Add Provider: Base URL",
307
+ description: "WEPSCLI will use this URL exactly as entered. No silent normalization.",
308
+ label: "Base URL",
309
+ get value() {
310
+ return draft().baseUrl;
311
+ },
312
+ placeholder: "Example: https://your-provider.example.com/v1",
313
+ get error() {
314
+ return draft().error;
315
+ },
316
+ inputRef: ref => {
317
+ inputRef = ref;
318
+ },
319
+ onInput: value => updateDraft({
320
+ baseUrl: value,
321
+ error: undefined
322
+ }),
323
+ onSubmit: submitBaseUrl,
324
+ onClose: back
325
+ });
326
+ case "apiKey":
327
+ return _$createComponent(OverlayTextInput, {
328
+ title: "Add Provider: API Key",
329
+ description: "The key is stored under ~/.wepscli/agent/auth.json and used only for this provider profile.",
330
+ label: "API key",
331
+ get value() {
332
+ return draft().apiKey;
333
+ },
334
+ placeholder: "Paste the API key for this provider",
335
+ get error() {
336
+ return draft().error;
337
+ },
338
+ hint: "Enter fetch models | Esc back",
339
+ inputRef: ref => {
340
+ inputRef = ref;
341
+ },
342
+ onInput: value => updateDraft({
343
+ apiKey: value,
344
+ error: undefined
345
+ }),
346
+ onSubmit: value => {
347
+ void fetchModels(value);
348
+ },
349
+ onClose: back
350
+ });
351
+ case "manualModel":
352
+ return _$createComponent(OverlayTextInput, {
353
+ title: "Add Provider: Manual Model",
354
+ description: "Model listing failed. Enter the model id manually to finish creating this provider.",
355
+ label: "Model id",
356
+ get value() {
357
+ return draft().manualModel;
358
+ },
359
+ placeholder: "Example: gpt-4.1 or claude-sonnet-4",
360
+ get error() {
361
+ return draft().error;
362
+ },
363
+ hint: "Enter create provider | Esc back",
364
+ inputRef: ref => {
365
+ inputRef = ref;
366
+ },
367
+ onInput: value => updateDraft({
368
+ manualModel: value,
369
+ error: undefined
370
+ }),
371
+ onSubmit: value => {
372
+ updateDraft({
373
+ manualModel: value,
374
+ error: undefined
375
+ });
376
+ finalize(value, "manual");
377
+ },
378
+ onClose: back
379
+ });
380
+ case "loading":
381
+ return _$createComponent(OverlayNotice, {
382
+ title: "Add Provider: Fetching Models",
383
+ description: "WEPSCLI is probing the endpoint and loading available models for this provider.",
384
+ get status() {
385
+ return `Checking ${draft().label || "provider"} at ${draft().baseUrl}`;
386
+ },
387
+ onClose: () => {}
388
+ });
389
+ case undefined:
390
+ return null;
391
+ }
392
+ }
393
+ return {
394
+ step,
395
+ draft,
396
+ selectedIndex,
397
+ open,
398
+ close,
399
+ back,
400
+ isActive: () => step() !== undefined,
401
+ isPickerStep: () => step() === "family" || step() === "model",
402
+ moveSelection,
403
+ confirmSelection,
404
+ render
405
+ };
406
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEffect","createSignal","OverlayNotice","OverlayTextInput","OverlayPicker","wrapIndex","fetchModelsForProfile","createEmptyProviderAddDraft","label","baseUrl","apiKey","models","manualModel","defaultBaseUrlForFamily","family","createProviderAddFlow","options","step","setStep","undefined","draft","setDraft","selectedIndex","setSelectedIndex","requestId","setRequestId","inputRef","currentStep","setTimeout","focus","updateDraft","patch","current","pickerOptions","id","description","badge","map","model","name","close","onClose","open","back","submitLabel","value","trimmed","trim","error","submitBaseUrl","parsed","URL","protocol","startsWith","fetchModels","apiKeyValue","currentDraft","trimmedKey","currentRequestId","apiDialect","enabled","createdAt","Date","toISOString","updatedAt","lastValidationStatus","Error","message","String","finalize","modelId","source","normalizedModelId","profile","profileService","createProfile","replaceModels","status","setActiveSelection","onCreated","confirmSelection","target","slice","length","moveSelection","delta","render","_$createComponent","title","onSelect","_id","index","placeholder","ref","onInput","onSubmit","hint","isActive","isPickerStep"],"sources":["provider-add-flow.tsx"],"sourcesContent":["import { createEffect, createSignal } from \"solid-js\";\r\nimport { OverlayNotice, OverlayTextInput } from \"./config-overlays.js\";\r\nimport { OverlayPicker, type ComposerInputRef } from \"./chat-components.js\";\r\nimport { wrapIndex } from \"./helpers.js\";\r\nimport { fetchModelsForProfile, type DiscoveredModel, type ProviderFamily, type ProviderProfile, type ProviderProfileService } from \"../provider-profiles/index.js\";\r\nimport type { OverlayOption } from \"./types.js\";\r\n\r\nexport type ProviderAddStep = \"family\" | \"label\" | \"baseUrl\" | \"apiKey\" | \"loading\" | \"model\" | \"manualModel\";\r\n\r\nexport interface ProviderAddDraft {\r\n\tfamily?: ProviderFamily;\r\n\tlabel: string;\r\n\tbaseUrl: string;\r\n\tapiKey: string;\r\n\tmodels: DiscoveredModel[];\r\n\tmanualModel: string;\r\n\terror?: string;\r\n}\r\n\r\nexport interface ProviderAddFlow {\r\n\tstep: () => ProviderAddStep | undefined;\r\n\tdraft: () => ProviderAddDraft;\r\n\tselectedIndex: () => number;\r\n\topen: () => void;\r\n\tclose: () => void;\r\n\tback: () => void;\r\n\tisActive: () => boolean;\r\n\tisPickerStep: () => boolean;\r\n\tmoveSelection: (delta: number) => void;\r\n\tconfirmSelection: () => void;\r\n\trender: () => any;\r\n}\r\n\r\nfunction createEmptyProviderAddDraft(): ProviderAddDraft {\r\n\treturn {\r\n\t\tlabel: \"\",\r\n\t\tbaseUrl: \"\",\r\n\t\tapiKey: \"\",\r\n\t\tmodels: [],\r\n\t\tmanualModel: \"\",\r\n\t};\r\n}\r\n\r\nfunction defaultBaseUrlForFamily(family: ProviderFamily): string {\r\n\treturn family === \"anthropic\" ? \"https://api.anthropic.com\" : \"https://api.openai.com/v1\";\r\n}\r\n\r\nexport function createProviderAddFlow(options: {\r\n\tprofileService: ProviderProfileService;\r\n\tonCreated: (info: { profile: ProviderProfile; modelId: string }) => void;\r\n\tonClose: () => void;\r\n}): ProviderAddFlow {\r\n\tconst [step, setStep] = createSignal<ProviderAddStep | undefined>(undefined);\r\n\tconst [draft, setDraft] = createSignal<ProviderAddDraft>(createEmptyProviderAddDraft());\r\n\tconst [selectedIndex, setSelectedIndex] = createSignal(0);\r\n\tconst [requestId, setRequestId] = createSignal(0);\r\n\tlet inputRef: ComposerInputRef | undefined;\r\n\r\n\tcreateEffect(() => {\r\n\t\tconst currentStep = step();\r\n\t\tif (currentStep === \"label\" || currentStep === \"baseUrl\" || currentStep === \"apiKey\" || currentStep === \"manualModel\") {\r\n\t\t\tsetTimeout(() => inputRef?.focus(), 0);\r\n\t\t}\r\n\t});\r\n\r\n\tfunction updateDraft(patch: Partial<ProviderAddDraft>): void {\r\n\t\tsetDraft((current) => ({ ...current, ...patch }));\r\n\t}\r\n\r\n\tfunction pickerOptions(): OverlayOption[] {\r\n\t\tswitch (step()) {\r\n\t\t\tcase \"family\":\r\n\t\t\t\treturn [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tid: \"provider-add-family:openai\",\r\n\t\t\t\t\t\tlabel: \"OpenAI-style\",\r\n\t\t\t\t\t\tdescription: \"For OpenAI-compatible and proxy endpoints.\",\r\n\t\t\t\t\t\tbadge: draft().family === \"openai\" ? \"SELECTED\" : undefined,\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tid: \"provider-add-family:anthropic\",\r\n\t\t\t\t\t\tlabel: \"Anthropic-style\",\r\n\t\t\t\t\t\tdescription: \"For Anthropic-compatible and proxy endpoints.\",\r\n\t\t\t\t\t\tbadge: draft().family === \"anthropic\" ? \"SELECTED\" : undefined,\r\n\t\t\t\t\t},\r\n\t\t\t\t];\r\n\t\t\tcase \"model\":\r\n\t\t\t\treturn draft().models.map((model) => ({\r\n\t\t\t\t\tid: `provider-add-model:${model.id}`,\r\n\t\t\t\t\tlabel: model.id,\r\n\t\t\t\t\tdescription: `${model.family} | ${model.name}`,\r\n\t\t\t\t}));\r\n\t\t\tdefault:\r\n\t\t\t\treturn [];\r\n\t\t}\r\n\t}\r\n\r\n\tfunction close(): void {\r\n\t\tsetStep(undefined);\r\n\t\tsetDraft(createEmptyProviderAddDraft());\r\n\t\tsetSelectedIndex(0);\r\n\t\toptions.onClose();\r\n\t}\r\n\r\n\tfunction open(): void {\r\n\t\tsetDraft(createEmptyProviderAddDraft());\r\n\t\tsetSelectedIndex(0);\r\n\t\tsetStep(\"family\");\r\n\t}\r\n\r\n\tfunction back(): void {\r\n\t\tswitch (step()) {\r\n\t\t\tcase \"family\":\r\n\t\t\t\tclose();\r\n\t\t\t\treturn;\r\n\t\t\tcase \"label\":\r\n\t\t\t\tsetStep(\"family\");\r\n\t\t\t\tsetSelectedIndex(draft().family === \"anthropic\" ? 1 : 0);\r\n\t\t\t\treturn;\r\n\t\t\tcase \"baseUrl\":\r\n\t\t\t\tsetStep(\"label\");\r\n\t\t\t\treturn;\r\n\t\t\tcase \"apiKey\":\r\n\t\t\t\tsetStep(\"baseUrl\");\r\n\t\t\t\treturn;\r\n\t\t\tcase \"model\":\r\n\t\t\tcase \"manualModel\":\r\n\t\t\t\tsetStep(\"apiKey\");\r\n\t\t\t\treturn;\r\n\t\t\tcase \"loading\":\r\n\t\t\t\treturn;\r\n\t\t\tcase undefined:\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction submitLabel(value: string): void {\r\n\t\tconst trimmed = value.trim();\r\n\t\tif (!trimmed) {\r\n\t\t\tupdateDraft({ error: \"Provider label is required.\" });\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tupdateDraft({ label: trimmed, error: undefined });\r\n\t\tsetStep(\"baseUrl\");\r\n\t}\r\n\r\n\tfunction submitBaseUrl(value: string): void {\r\n\t\tconst trimmed = value.trim();\r\n\t\tif (!trimmed) {\r\n\t\t\tupdateDraft({ error: \"Base URL is required.\" });\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tconst parsed = new URL(trimmed);\r\n\t\t\tif (!parsed.protocol.startsWith(\"http\")) {\r\n\t\t\t\tupdateDraft({ error: \"Base URL must start with http:// or https://\" });\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t} catch {\r\n\t\t\tupdateDraft({ error: \"Enter a valid absolute URL.\" });\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tupdateDraft({ baseUrl: trimmed, error: undefined });\r\n\t\tsetStep(\"apiKey\");\r\n\t}\r\n\r\n\tasync function fetchModels(apiKeyValue: string): Promise<void> {\r\n\t\tconst currentDraft = draft();\r\n\t\tif (!currentDraft.family) {\r\n\t\t\tupdateDraft({ error: \"Choose a provider family first.\" });\r\n\t\t\tsetStep(\"family\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst trimmedKey = apiKeyValue.trim();\r\n\t\tif (!trimmedKey) {\r\n\t\t\tupdateDraft({ error: \"API key is required.\" });\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tupdateDraft({ apiKey: trimmedKey, error: undefined });\r\n\t\tsetStep(\"loading\");\r\n\t\tconst currentRequestId = requestId() + 1;\r\n\t\tsetRequestId(currentRequestId);\r\n\r\n\t\ttry {\r\n\t\t\tconst models = await fetchModelsForProfile(\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"draft\",\r\n\t\t\t\t\tlabel: currentDraft.label || \"Draft provider\",\r\n\t\t\t\t\tfamily: currentDraft.family,\r\n\t\t\t\t\tapiDialect: currentDraft.family === \"anthropic\" ? \"anthropic-messages\" : \"openai-responses\",\r\n\t\t\t\t\tbaseUrl: currentDraft.baseUrl,\r\n\t\t\t\t\tenabled: true,\r\n\t\t\t\t\tmodels: [],\r\n\t\t\t\t\tcreatedAt: new Date().toISOString(),\r\n\t\t\t\t\tupdatedAt: new Date().toISOString(),\r\n\t\t\t\t\tlastValidationStatus: \"unknown\",\r\n\t\t\t\t},\r\n\t\t\t\ttrimmedKey,\r\n\t\t\t);\r\n\r\n\t\t\tif (requestId() !== currentRequestId) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateDraft({ models, error: undefined, manualModel: \"\" });\r\n\t\t\tsetSelectedIndex(0);\r\n\t\t\tsetStep(\"model\");\r\n\t\t} catch (error) {\r\n\t\t\tif (requestId() !== currentRequestId) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateDraft({\r\n\t\t\t\tmodels: [],\r\n\t\t\t\terror: error instanceof Error ? error.message : String(error),\r\n\t\t\t});\r\n\t\t\tsetStep(\"manualModel\");\r\n\t\t}\r\n\t}\r\n\r\n\tfunction finalize(modelId: string, source: \"fetched\" | \"manual\"): void {\r\n\t\tconst currentDraft = draft();\r\n\t\tif (!currentDraft.family) {\r\n\t\t\tupdateDraft({ error: \"Choose a provider family first.\" });\r\n\t\t\tsetStep(\"family\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst normalizedModelId = modelId.trim();\r\n\t\tif (!normalizedModelId) {\r\n\t\t\tupdateDraft({ error: \"Model id is required.\" });\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst profile = options.profileService.createProfile({\r\n\t\t\tlabel: currentDraft.label,\r\n\t\t\tfamily: currentDraft.family,\r\n\t\t\tbaseUrl: currentDraft.baseUrl,\r\n\t\t\tapiKey: currentDraft.apiKey,\r\n\t\t});\r\n\r\n\t\tconst models =\r\n\t\t\tsource === \"fetched\"\r\n\t\t\t\t? currentDraft.models\r\n\t\t\t\t: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tid: normalizedModelId,\r\n\t\t\t\t\t\t\tname: normalizedModelId,\r\n\t\t\t\t\t\t\tfamily: currentDraft.family,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t];\r\n\r\n\t\toptions.profileService.replaceModels(\r\n\t\t\tprofile.id,\r\n\t\t\tmodels,\r\n\t\t\tsource === \"fetched\" ? { status: \"ok\" } : { status: \"unknown\", message: \"Added with manual model entry.\" },\r\n\t\t);\r\n\t\toptions.profileService.setActiveSelection(profile.id, normalizedModelId);\r\n\t\toptions.onCreated({ profile, modelId: normalizedModelId });\r\n\t\tclose();\r\n\t}\r\n\r\n\tfunction confirmSelection(): void {\r\n\t\tconst target = pickerOptions()[selectedIndex()];\r\n\t\tif (!target) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (target.id.startsWith(\"provider-add-family:\")) {\r\n\t\t\tconst family = target.id.slice(\"provider-add-family:\".length) as ProviderFamily;\r\n\t\t\tupdateDraft({\r\n\t\t\t\tfamily,\r\n\t\t\t\tbaseUrl: draft().baseUrl || defaultBaseUrlForFamily(family),\r\n\t\t\t\terror: undefined,\r\n\t\t\t});\r\n\t\t\tsetStep(\"label\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (target.id.startsWith(\"provider-add-model:\")) {\r\n\t\t\tfinalize(target.id.slice(\"provider-add-model:\".length), \"fetched\");\r\n\t\t}\r\n\t}\r\n\r\n\tfunction moveSelection(delta: number): void {\r\n\t\tsetSelectedIndex((current) => wrapIndex(current, delta, pickerOptions().length));\r\n\t}\r\n\r\n\tfunction render() {\r\n\t\tswitch (step()) {\r\n\t\t\tcase \"family\":\r\n\t\t\tcase \"model\":\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<OverlayPicker\r\n\t\t\t\t\t\ttitle={step() === \"family\" ? \"Add Provider: Family\" : \"Add Provider: Model\"}\r\n\t\t\t\t\t\tdescription={\r\n\t\t\t\t\t\t\tstep() === \"family\"\r\n\t\t\t\t\t\t\t\t? \"Choose the provider family to start the guided setup.\"\r\n\t\t\t\t\t\t\t\t: \"Choose one of the discovered models for the new provider.\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\toptions={pickerOptions()}\r\n\t\t\t\t\t\tselectedIndex={selectedIndex()}\r\n\t\t\t\t\t\tonClose={back}\r\n\t\t\t\t\t\tonSelect={(_id, index) => {\r\n\t\t\t\t\t\t\tsetSelectedIndex(index);\r\n\t\t\t\t\t\t\tconfirmSelection();\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\tcase \"label\":\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<OverlayTextInput\r\n\t\t\t\t\t\ttitle=\"Add Provider: Label\"\r\n\t\t\t\t\t\tdescription=\"Choose the friendly name shown in provider and model pickers.\"\r\n\t\t\t\t\t\tlabel=\"Provider label\"\r\n\t\t\t\t\t\tvalue={draft().label}\r\n\t\t\t\t\t\tplaceholder=\"Example: My OpenAI Proxy\"\r\n\t\t\t\t\t\terror={draft().error}\r\n\t\t\t\t\t\tinputRef={(ref) => {\r\n\t\t\t\t\t\t\tinputRef = ref;\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tonInput={(value) => updateDraft({ label: value, error: undefined })}\r\n\t\t\t\t\t\tonSubmit={submitLabel}\r\n\t\t\t\t\t\tonClose={back}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\tcase \"baseUrl\":\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<OverlayTextInput\r\n\t\t\t\t\t\ttitle=\"Add Provider: Base URL\"\r\n\t\t\t\t\t\tdescription=\"WEPSCLI will use this URL exactly as entered. No silent normalization.\"\r\n\t\t\t\t\t\tlabel=\"Base URL\"\r\n\t\t\t\t\t\tvalue={draft().baseUrl}\r\n\t\t\t\t\t\tplaceholder=\"Example: https://your-provider.example.com/v1\"\r\n\t\t\t\t\t\terror={draft().error}\r\n\t\t\t\t\t\tinputRef={(ref) => {\r\n\t\t\t\t\t\t\tinputRef = ref;\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tonInput={(value) => updateDraft({ baseUrl: value, error: undefined })}\r\n\t\t\t\t\t\tonSubmit={submitBaseUrl}\r\n\t\t\t\t\t\tonClose={back}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\tcase \"apiKey\":\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<OverlayTextInput\r\n\t\t\t\t\t\ttitle=\"Add Provider: API Key\"\r\n\t\t\t\t\t\tdescription=\"The key is stored under ~/.wepscli/agent/auth.json and used only for this provider profile.\"\r\n\t\t\t\t\t\tlabel=\"API key\"\r\n\t\t\t\t\t\tvalue={draft().apiKey}\r\n\t\t\t\t\t\tplaceholder=\"Paste the API key for this provider\"\r\n\t\t\t\t\t\terror={draft().error}\r\n\t\t\t\t\t\thint=\"Enter fetch models | Esc back\"\r\n\t\t\t\t\t\tinputRef={(ref) => {\r\n\t\t\t\t\t\t\tinputRef = ref;\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tonInput={(value) => updateDraft({ apiKey: value, error: undefined })}\r\n\t\t\t\t\t\tonSubmit={(value) => {\r\n\t\t\t\t\t\t\tvoid fetchModels(value);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tonClose={back}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\tcase \"manualModel\":\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<OverlayTextInput\r\n\t\t\t\t\t\ttitle=\"Add Provider: Manual Model\"\r\n\t\t\t\t\t\tdescription=\"Model listing failed. Enter the model id manually to finish creating this provider.\"\r\n\t\t\t\t\t\tlabel=\"Model id\"\r\n\t\t\t\t\t\tvalue={draft().manualModel}\r\n\t\t\t\t\t\tplaceholder=\"Example: gpt-4.1 or claude-sonnet-4\"\r\n\t\t\t\t\t\terror={draft().error}\r\n\t\t\t\t\t\thint=\"Enter create provider | Esc back\"\r\n\t\t\t\t\t\tinputRef={(ref) => {\r\n\t\t\t\t\t\t\tinputRef = ref;\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tonInput={(value) => updateDraft({ manualModel: value, error: undefined })}\r\n\t\t\t\t\t\tonSubmit={(value) => {\r\n\t\t\t\t\t\t\tupdateDraft({ manualModel: value, error: undefined });\r\n\t\t\t\t\t\t\tfinalize(value, \"manual\");\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tonClose={back}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\tcase \"loading\":\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<OverlayNotice\r\n\t\t\t\t\t\ttitle=\"Add Provider: Fetching Models\"\r\n\t\t\t\t\t\tdescription=\"WEPSCLI is probing the endpoint and loading available models for this provider.\"\r\n\t\t\t\t\t\tstatus={`Checking ${draft().label || \"provider\"} at ${draft().baseUrl}`}\r\n\t\t\t\t\t\tonClose={() => {}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\tcase undefined:\r\n\t\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tstep,\r\n\t\tdraft,\r\n\t\tselectedIndex,\r\n\t\topen,\r\n\t\tclose,\r\n\t\tback,\r\n\t\tisActive: () => step() !== undefined,\r\n\t\tisPickerStep: () => step() === \"family\" || step() === \"model\",\r\n\t\tmoveSelection,\r\n\t\tconfirmSelection,\r\n\t\trender,\r\n\t};\r\n}\r\n"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,YAAY,QAAQ,UAAU;AACrD,SAASC,aAAa,EAAEC,gBAAgB,QAAQ,sBAAsB;AACtE,SAASC,aAAa,QAA+B,sBAAsB;AAC3E,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,qBAAqB,QAAsG,+BAA+B;AA6BnK,SAASC,2BAA2BA,CAAA,EAAqB;EACxD,OAAO;IACNC,KAAK,EAAE,EAAE;IACTC,OAAO,EAAE,EAAE;IACXC,MAAM,EAAE,EAAE;IACVC,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE;EACd,CAAC;AACF;AAEA,SAASC,uBAAuBA,CAACC,MAAsB,EAAU;EAChE,OAAOA,MAAM,KAAK,WAAW,GAAG,2BA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,EAAGmE,GAAG,IAAK;YAClBnE,QAAQ,GAAGmE,GAAG;UACf,CAAC;UACDC,OAAO,EAAGjD,KAAK,IAAKf,WAAW,CAAC;YAAElB,WAAW,EAAEiC,KAAK;YAAEG,KAAK,EAAE7B;UAAU,CAAC,CAAC;UACzE4E,QAAQ,EAAGlD,KAAK,IAAK;YACpBf,WAAW,CAAC;cAAElB,WAAW,EAAEiC,KAAK;cAAEG,KAAK,EAAE7B;YAAU,CAAC,CAAC;YACrDkD,QAAQ,CAACxB,KAAK,EAAE,QAAQ,CAAC;UAC1B,CAAC;UACDJ,OAAO,EAAEE;QAAI;MAGhB,KAAK,SAAS;QACb,OAAA4C,iBAAA,CACErF,aAAa;UACbsF,KAAK;UACLrD,WAAW;UAAA,IACX0C,MAAMA,CAAA;YAAA,OAAE,YAAYzD,KAAK,CAAC,CAAC,CAACZ,KAAK,IAAI,UAAU,OAAOY,KAAK,CAAC,CAAC,CAACX,OAAO,EAAE;UAAA;UACvEgC,OAAO,EAAEA,CAAA,KAAM,CAAC;QAAC;MAGpB,KAAKtB,SAAS;QACb,OAAO,IAAI;IACb;EACD;EAEA,OAAO;IACNF,IAAI;IACJG,KAAK;IACLE,aAAa;IACboB,IAAI;IACJF,KAAK;IACLG,IAAI;IACJsD,QAAQ,EAAEA,CAAA,KAAMhF,IAAI,CAAC,CAAC,KAAKE,SAAS;IACpC+E,YAAY,EAAEA,CAAA,KAAMjF,IAAI,CAAC,CAAC,KAAK,QAAQ,IAAIA,IAAI,CAAC,CAAC,KAAK,OAAO;IAC7DmE,aAAa;IACbJ,gBAAgB;IAChBM;EACD,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ import { createComponent as _$createComponent } from "@opentui/solid";
2
+ import { render } from "@opentui/solid";
3
+ import { WEPSCLIShellApp } from "./shell-app.js";
4
+ export async function runWepscliShell(profileService) {
5
+ if (!process.stdin.isTTY || !process.stdout.isTTY) {
6
+ return;
7
+ }
8
+ return new Promise((resolve, reject) => {
9
+ render(() => _$createComponent(WEPSCLIShellApp, {
10
+ profileService: profileService,
11
+ onExit: resolve
12
+ }), {
13
+ targetFps: 60,
14
+ gatherStats: false,
15
+ exitOnCtrlC: false,
16
+ useKittyKeyboard: {},
17
+ autoFocus: true,
18
+ openConsoleOnError: true
19
+ }).catch(reject);
20
+ });
21
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"names":["render","WEPSCLIShellApp","runWepscliShell","profileService","process","stdin","isTTY","stdout","Promise","resolve","reject","_$createComponent","onExit","targetFps","gatherStats","exitOnCtrlC","useKittyKeyboard","autoFocus","openConsoleOnError","catch"],"sources":["run-wepscli-shell.tsx"],"sourcesContent":["import { render } from \"@opentui/solid\";\r\nimport type { ProviderProfileService } from \"../provider-profiles/index.js\";\r\nimport { WEPSCLIShellApp } from \"./shell-app.js\";\r\n\r\nexport async function runWepscliShell(profileService: ProviderProfileService): Promise<void> {\r\n\tif (!process.stdin.isTTY || !process.stdout.isTTY) {\r\n\t\treturn;\r\n\t}\r\n\r\n\treturn new Promise<void>((resolve, reject) => {\r\n\t\trender(\r\n\t\t\t() => <WEPSCLIShellApp profileService={profileService} onExit={resolve} />,\r\n\t\t\t{\r\n\t\t\t\ttargetFps: 60,\r\n\t\t\t\tgatherStats: false,\r\n\t\t\t\texitOnCtrlC: false,\r\n\t\t\t\tuseKittyKeyboard: {},\r\n\t\t\t\tautoFocus: true,\r\n\t\t\t\topenConsoleOnError: true,\r\n\t\t\t},\r\n\t\t).catch(reject);\r\n\t});\r\n}\r\n"],"mappings":";AAAA,SAASA,MAAM,QAAQ,gBAAgB;AAEvC,SAASC,eAAe,QAAQ,gBAAgB;AAEhD,OAAO,eAAeC,eAAeA,CAACC,cAAsC,EAAiB;EAC5F,IAAI,CAACC,OAAO,CAACC,KAAK,CAACC,KAAK,IAAI,CAACF,OAAO,CAACG,MAAM,CAACD,KAAK,EAAE;IAClD;EACD;EAEA,OAAO,IAAIE,OAAO,CAAO,CAACC,OAAO,EAAEC,MAAM,KAAK;IAC7CV,MAAM,CACL,MAAAW,iBAAA,CAAOV,eAAe;MAACE,cAAc,EAAEA,cAAc;MAAES,MAAM,EAAEH;IAAO,EAAI,EAC1E;MACCI,SAAS,EAAE,EAAE;MACbC,WAAW,EAAE,KAAK;MAClBC,WAAW,EAAE,KAAK;MAClBC,gBAAgB,EAAE,CAAC,CAAC;MACpBC,SAAS,EAAE,IAAI;MACfC,kBAAkB,EAAE;IACrB,CACD,CAAC,CAACC,KAAK,CAACT,MAAM,CAAC;EAChB,CAAC,CAAC;AACH","ignoreList":[]}