@orlan-maker/cli 0.2.0 → 0.2.2
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/.claude-plugin/plugin.json +1 -1
- package/dist/commands.js +4 -2
- package/dist/http.js +4 -2
- package/package.json +1 -1
package/dist/commands.js
CHANGED
|
@@ -418,7 +418,7 @@ async function disconnect(agent, io) {
|
|
|
418
418
|
await writeConfig(config);
|
|
419
419
|
const parts = { "claude-code": "plugin", codex: "hooks", cursor: "hooks", opencode: "plugin", other: "" }[agent];
|
|
420
420
|
io.out(`Disconnected ${agentLabels[agent]}: its token is revoked` +
|
|
421
|
-
`${parts ? `, and its Orlan ${parts} ${removed ? "and the old Orlan server entry are" : "is"} gone` : ""}. The skills stay.`);
|
|
421
|
+
`${parts ? `, and its Orlan ${parts} ${removed ? "and the old Orlan server entry are" : parts === "hooks" ? "are" : "is"} gone` : ""}. The skills stay.`);
|
|
422
422
|
io.out(`next_step: orlan connect --agent ${agent} (to connect it again)`);
|
|
423
423
|
return 0;
|
|
424
424
|
}
|
|
@@ -482,7 +482,9 @@ export const commands = {
|
|
|
482
482
|
return 0;
|
|
483
483
|
}
|
|
484
484
|
catch (error) {
|
|
485
|
-
|
|
485
|
+
// A short outage of the server, for example a deploy, does not end the wait (found on orlan.app).
|
|
486
|
+
const waiting = error instanceof OrlanError && (error.code === "login_pending" || error.code === "unreachable");
|
|
487
|
+
if (!waiting)
|
|
486
488
|
throw error;
|
|
487
489
|
if (Date.now() > until)
|
|
488
490
|
throw new OrlanError("The code expired.", "login_expired");
|
package/dist/http.js
CHANGED
|
@@ -86,11 +86,13 @@ export async function apiCall(server, pathname, init = {}) {
|
|
|
86
86
|
}
|
|
87
87
|
/** The error of a server that did not answer. */
|
|
88
88
|
export function unreachable(server, error) {
|
|
89
|
-
return new OrlanError(`Orlan at ${server} did not answer: ${error.message}.`,
|
|
89
|
+
return new OrlanError(`Orlan at ${server} did not answer: ${error.message}.`, "unreachable", "check the network and the server (orlan status), then run the command again");
|
|
90
90
|
}
|
|
91
91
|
/** The error of a refused API call, explained when the code has an explanation. */
|
|
92
92
|
export function apiError(status, code) {
|
|
93
|
-
|
|
93
|
+
// A gateway that answers 502, 503 or 504 has no Orlan behind it for a moment, for example in a deploy.
|
|
94
|
+
const gateway = !code && [502, 503, 504].includes(status) ? "unreachable" : code;
|
|
95
|
+
return new OrlanError((code && explained[code]) ?? `Orlan answered ${status}${code ? ` (${code})` : ""}.`, gateway);
|
|
94
96
|
}
|
|
95
97
|
/** The error of an agent token that Orlan did not accept: revoked or replaced. */
|
|
96
98
|
export const agentTokenRefused = () => new OrlanError("Orlan did not accept the agent token. It was revoked or replaced.", "not_signed_in", "orlan connect --agent <id>");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orlan-maker/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "The orlan command: connect Claude Code, Codex, Cursor or OpenCode to Orlan, and work with its topics, files and comments from the terminal.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|