@lesscap/baton-cli 0.7.0 → 0.7.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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/dist/baton.mjs +3 -6
  3. package/package.json +11 -12
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 bencode
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/baton.mjs CHANGED
@@ -7096,6 +7096,7 @@ var runTurn = async (config, worker2, msg, resuming, queryFn, log = (m) => conso
7096
7096
  };
7097
7097
 
7098
7098
  // src/session/runner.ts
7099
+ var isAgentConversationResumable = (config, transcriptPath = findTranscriptPath) => config.agentKind === "codex" ? !config.agentSessionId.startsWith("pending:") : transcriptPath(config.agentSessionId) !== null;
7099
7100
  var subscribeStream = (url, ESCtor, seen, log, onUserMessage, onInterrupt, onReady) => {
7100
7101
  const es = new ESCtor(url);
7101
7102
  es.onopen = onReady;
@@ -7132,10 +7133,7 @@ var runDaemon = async (config, deps, signal) => {
7132
7133
  const ESCtor = deps.eventSourceImpl ?? EventSource;
7133
7134
  log(`bin: ${claudeExecutable() ?? "(sdk bundled)"} cwd: ${config.worktreePath}`);
7134
7135
  log(`runtime env keys: ${maskedEnvKeys(deps.env)}`);
7135
- const state = {
7136
- firstSpawnDone: config.agentKind === "codex" ? !config.agentSessionId.startsWith("pending:") : findTranscriptPath(config.agentSessionId) !== null,
7137
- seen: /* @__PURE__ */ new Set()
7138
- };
7136
+ const state = { seen: /* @__PURE__ */ new Set() };
7139
7137
  const pendingQueue = [];
7140
7138
  let busy = false;
7141
7139
  let reconciling = false;
@@ -7148,7 +7146,7 @@ var runDaemon = async (config, deps, signal) => {
7148
7146
  while (pendingQueue.length > 0 && !signal.aborted) {
7149
7147
  const msg = pendingQueue.shift();
7150
7148
  if (!msg) break;
7151
- const resuming = state.firstSpawnDone;
7149
+ const resuming = isAgentConversationResumable(config);
7152
7150
  log(`\u25B6 msg #${msg.sequence} (${resuming ? "resume" : "first"})`);
7153
7151
  const turnAbort = new AbortController();
7154
7152
  currentTurn = turnAbort;
@@ -7164,7 +7162,6 @@ var runDaemon = async (config, deps, signal) => {
7164
7162
  turnAbort.signal
7165
7163
  );
7166
7164
  currentTurn = void 0;
7167
- state.firstSpawnDone = true;
7168
7165
  lastActivity = Date.now();
7169
7166
  log(`\u2714 msg #${msg.sequence}${code === 0 ? "" : ` (exit ${code})`}`);
7170
7167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lesscap/baton-cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -14,28 +14,27 @@
14
14
  "dist",
15
15
  "scripts"
16
16
  ],
17
- "scripts": {
18
- "baton": "tsx src/index.ts",
19
- "build": "node build.mjs && chmod +x dist/baton.mjs",
20
- "postinstall": "node scripts/postinstall.mjs",
21
- "prepublishOnly": "pnpm build",
22
- "typecheck": "tsc --noEmit -p tsconfig.json",
23
- "test": "tsx --test 'src/**/*.test.ts'"
24
- },
25
17
  "devDependencies": {
26
- "@baton/shared": "workspace:*",
27
18
  "@types/node": "^25.9.1",
28
19
  "@types/ws": "^8.18.1",
29
20
  "citty": "^0.2.2",
30
21
  "esbuild": "^0.28.0",
31
22
  "eventsource": "^4.1.0",
32
23
  "tsx": "^4.22.4",
33
- "typescript": "^6.0.3"
24
+ "typescript": "^6.0.3",
25
+ "@baton/shared": "0.0.0"
34
26
  },
35
27
  "dependencies": {
36
28
  "@anthropic-ai/claude-agent-sdk": "^0.3.209",
37
29
  "@openai/codex-sdk": "^0.144.4",
38
30
  "node-pty": "^1.1.0",
39
31
  "ws": "^8.21.0"
32
+ },
33
+ "scripts": {
34
+ "baton": "tsx src/index.ts",
35
+ "build": "node build.mjs && chmod +x dist/baton.mjs",
36
+ "postinstall": "node scripts/postinstall.mjs",
37
+ "typecheck": "tsc --noEmit -p tsconfig.json",
38
+ "test": "tsx --test 'src/**/*.test.ts'"
40
39
  }
41
- }
40
+ }