opensteer 0.4.12 → 0.4.14
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/README.md +5 -0
- package/bin/opensteer.mjs +42 -6
- package/dist/{chunk-QTGJO7RC.js → chunk-QHZFY3ZK.js} +9 -0
- package/dist/{chunk-V4OOJO4S.js → chunk-SPHS6YWD.js} +1 -1
- package/dist/{chunk-HQLFJFJM.js → chunk-WXUXG76V.js} +405 -48
- package/dist/{chunk-UIUDSWZV.js → chunk-YIQDOALV.js} +1 -1
- package/dist/cli/server.cjs +498 -68
- package/dist/cli/server.js +90 -24
- package/dist/{extractor-I6TJPTXV.js → extractor-CZFCFUME.js} +2 -2
- package/dist/index.cjs +411 -46
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +4 -4
- package/dist/{resolver-HVZJQZ32.js → resolver-ZREUOOTV.js} +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -18,8 +18,13 @@ clean HTML snapshots, and first-class local or cloud runtime support.
|
|
|
18
18
|
npm install opensteer
|
|
19
19
|
# pnpm
|
|
20
20
|
pnpm add opensteer
|
|
21
|
+
# bun
|
|
22
|
+
bun add opensteer
|
|
21
23
|
```
|
|
22
24
|
|
|
25
|
+
Repo maintenance defaults to `pnpm`, with compatibility checks for `npm` and
|
|
26
|
+
`bun` in CI.
|
|
27
|
+
|
|
23
28
|
If your environment skips Playwright browser downloads, run:
|
|
24
29
|
|
|
25
30
|
```bash
|
package/bin/opensteer.mjs
CHANGED
|
@@ -624,7 +624,7 @@ async function ensureServer(session) {
|
|
|
624
624
|
}
|
|
625
625
|
|
|
626
626
|
throw new Error(
|
|
627
|
-
`Failed to start server for session '${session}'
|
|
627
|
+
`Failed to start server for session '${session}' within ${CONNECT_TIMEOUT}ms.`
|
|
628
628
|
)
|
|
629
629
|
}
|
|
630
630
|
|
|
@@ -702,6 +702,39 @@ function error(msg) {
|
|
|
702
702
|
process.exit(1)
|
|
703
703
|
}
|
|
704
704
|
|
|
705
|
+
function normalizeFailedResponse(response) {
|
|
706
|
+
const info = toObject(response?.errorInfo)
|
|
707
|
+
|
|
708
|
+
let message = 'Request failed.'
|
|
709
|
+
if (typeof info?.message === 'string' && info.message.trim()) {
|
|
710
|
+
message = info.message.trim()
|
|
711
|
+
} else if (typeof response?.error === 'string' && response.error.trim()) {
|
|
712
|
+
message = response.error.trim()
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
return {
|
|
716
|
+
ok: false,
|
|
717
|
+
error: message,
|
|
718
|
+
...(info && typeof info.code === 'string' && info.code.trim()
|
|
719
|
+
? { code: info.code.trim() }
|
|
720
|
+
: {}),
|
|
721
|
+
...(toObject(info?.details)
|
|
722
|
+
? { details: info.details }
|
|
723
|
+
: {}),
|
|
724
|
+
...(info ? { errorInfo: info } : {}),
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
function formatTransportFailure(error, context) {
|
|
729
|
+
const message = error instanceof Error ? error.message : String(error)
|
|
730
|
+
return `${context}: ${message}`
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
function toObject(value) {
|
|
734
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) return null
|
|
735
|
+
return value
|
|
736
|
+
}
|
|
737
|
+
|
|
705
738
|
function printHelp() {
|
|
706
739
|
console.log(`Usage: opensteer <command> [options]
|
|
707
740
|
|
|
@@ -855,7 +888,7 @@ async function main() {
|
|
|
855
888
|
error(
|
|
856
889
|
err instanceof Error
|
|
857
890
|
? err.message
|
|
858
|
-
:
|
|
891
|
+
: `Failed to start server for session '${session}'.`
|
|
859
892
|
)
|
|
860
893
|
}
|
|
861
894
|
}
|
|
@@ -866,13 +899,16 @@ async function main() {
|
|
|
866
899
|
if (response.ok) {
|
|
867
900
|
output({ ok: true, ...response.result })
|
|
868
901
|
} else {
|
|
869
|
-
process.stderr.write(
|
|
870
|
-
JSON.stringify({ ok: false, error: response.error }) + '\n'
|
|
871
|
-
)
|
|
902
|
+
process.stderr.write(JSON.stringify(normalizeFailedResponse(response)) + '\n')
|
|
872
903
|
process.exit(1)
|
|
873
904
|
}
|
|
874
905
|
} catch (err) {
|
|
875
|
-
error(
|
|
906
|
+
error(
|
|
907
|
+
formatTransportFailure(
|
|
908
|
+
err,
|
|
909
|
+
`Failed to run '${command}' for session '${session}'`
|
|
910
|
+
)
|
|
911
|
+
)
|
|
876
912
|
}
|
|
877
913
|
}
|
|
878
914
|
|
|
@@ -19,6 +19,15 @@ function resolveProviderInfo(modelStr) {
|
|
|
19
19
|
return info;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
const slash = modelStr.indexOf("/");
|
|
23
|
+
if (slash > 0) {
|
|
24
|
+
const provider = modelStr.slice(0, slash).trim().toLowerCase();
|
|
25
|
+
if (provider) {
|
|
26
|
+
throw new Error(
|
|
27
|
+
`Unsupported model provider prefix "${provider}" in model "${modelStr}". Use one of: openai, anthropic, google, xai, groq.`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
22
31
|
return { pkg: "@ai-sdk/openai", providerFn: "openai" };
|
|
23
32
|
}
|
|
24
33
|
function stripProviderPrefix(modelStr) {
|