@commonlyai/cli 0.1.297 → 0.1.299
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 +2 -2
- package/package.json +1 -1
- package/src/commands/agent.js +9 -0
- package/src/lib/adapters/pi.js +16 -4
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Commonly CLI
|
|
2
2
|
|
|
3
|
-
Developer CLI for Commonly — log in,
|
|
3
|
+
Developer CLI for Commonly — log in, connect your computer so your own AI agents can join pods, scaffold a custom bot, tail pod messages, manage a local dev environment.
|
|
4
4
|
|
|
5
5
|
**User guide with every subcommand + config format + troubleshooting:** [`/docs/cli/README.md`](../docs/cli/README.md)
|
|
6
6
|
|
|
7
7
|
**Deep dives:**
|
|
8
|
-
- [Local CLI wrapper](../docs/agents/LOCAL_CLI_WRAPPER.md) — `attach` / `run` / `detach` lifecycle
|
|
8
|
+
- [Local CLI wrapper](../docs/agents/LOCAL_CLI_WRAPPER.md) — connecting a computer (`daemon register` / `install`), and the older `attach` / `run` / `detach` lifecycle
|
|
9
9
|
- [Webhook SDK](../docs/agents/WEBHOOK_SDK.md) — `init` + Python reference bot
|
|
10
10
|
|
|
11
11
|
## Run from source
|
package/package.json
CHANGED
package/src/commands/agent.js
CHANGED
|
@@ -3058,6 +3058,15 @@ export const performRun = ({
|
|
|
3058
3058
|
throw spawnError;
|
|
3059
3059
|
}
|
|
3060
3060
|
spawnDurationMs = Date.now() - spawnStartedAt;
|
|
3061
|
+
// F336: an adapter that saw the turn fail after tool-only output can't
|
|
3062
|
+
// tell whether a tool posted. With no post of its own in the pod, the
|
|
3063
|
+
// failure is thrown here, before the session is kept, exactly as a spawn
|
|
3064
|
+
// failure would be. With one, the turn delivered, and a retry would post twice.
|
|
3065
|
+
if (result?.failure) {
|
|
3066
|
+
const postSpawn = preSpawnIds ? await snapshotMessages() : null;
|
|
3067
|
+
if (!(postSpawn && findOwnPost(postSpawn, preSpawnIds))) throw result.failure;
|
|
3068
|
+
log(`[${event.type}] the turn failed after a post of its own, so it is not retried: ${result.failure.message}`);
|
|
3069
|
+
}
|
|
3061
3070
|
spawnCompleted = true;
|
|
3062
3071
|
} finally {
|
|
3063
3072
|
try {
|
package/src/lib/adapters/pi.js
CHANGED
|
@@ -690,10 +690,17 @@ const runPi = ({
|
|
|
690
690
|
// A refused turn exits 0 too, so here the stream is what says the text was
|
|
691
691
|
// interim. Posting it would answer with half a turn (F258). The last stop
|
|
692
692
|
// decides, not `reply.upstream`, which outlives a refusal pi recovered from.
|
|
693
|
-
|
|
694
|
-
|
|
693
|
+
// With no text it is a failure too when no status names it (F336): a tool-only
|
|
694
|
+
// message, then "fetch failed", is a fault to retry, not a silent turn. But
|
|
695
|
+
// that tool may have posted, which only the run loop can see, so the failure
|
|
696
|
+
// rides on the reply and the run loop throws it only when nothing was posted.
|
|
697
|
+
// A refusal pi kept still resolves plainly, so the run loop names it (TASK-096).
|
|
698
|
+
if (code === 0 && !reply.finished && reply.lastStop === 'error' && (reply.sawAssistant || !reply.upstream)) {
|
|
699
|
+
const failure = stoppedTurnFailure(reply, {
|
|
695
700
|
code, signal, stderr, credentials,
|
|
696
|
-
})
|
|
701
|
+
});
|
|
702
|
+
if (reply.sawAssistant) return reject(failure);
|
|
703
|
+
reply.failure = failure;
|
|
697
704
|
}
|
|
698
705
|
return resolve(reply);
|
|
699
706
|
});
|
|
@@ -961,7 +968,12 @@ export default {
|
|
|
961
968
|
// Empty text with a clean exit is a silent turn; the run loop treats it
|
|
962
969
|
// as NO_REPLY-shaped and re-delivers on its own rules. Empty text that
|
|
963
970
|
// came with a refusal is named instead — see upstream-refusal.js.
|
|
964
|
-
return {
|
|
971
|
+
return {
|
|
972
|
+
text: reply.text,
|
|
973
|
+
newSessionId: sessionId,
|
|
974
|
+
upstream: reply.upstream ?? null,
|
|
975
|
+
...(reply.failure ? { failure: reply.failure } : {}),
|
|
976
|
+
};
|
|
965
977
|
} finally {
|
|
966
978
|
// Best effort: the bridge has already read what it needs by the time the
|
|
967
979
|
// turn ends, and a token file that outlives its turn is a token file that
|