@matuto-ai/claude-code-broker-connector 0.3.0 → 0.3.1

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.
@@ -8,7 +8,7 @@
8
8
  "name": "psst",
9
9
  "source": "./",
10
10
  "description": "Psst messaging for Claude Code",
11
- "version": "0.3.0"
11
+ "version": "0.3.1"
12
12
  }
13
13
  ],
14
14
  "metadata": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "psst",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Session-bound Psst agent messaging with explicit receive and acknowledgment. Bounded opt-in native notices; no permission relay.",
5
5
  "author": { "name": "Bruno Orsolon" },
6
6
  "repository": "https://github.com/matuto-ai/claude-code-broker-connector",
@@ -8,7 +8,7 @@ import { readPrivateJson, writePrivateJson, privateDirectory } from '../src/laun
8
8
  import { verifyReference } from '../src/reference-pin.mjs';
9
9
  import { readPluginConfig, nativeStateConfig, hostDirectory, readBinding, verifyBinding, bindingModel, journalName, refreshEnrollment } from '../src/plugin-state.mjs';
10
10
 
11
- let server,runtime,inbox,timer,live=true,expected,directory,host,tools,connected=false,connecting=false,disabled=false,generation=0;
11
+ let server,runtime,inbox,timer,live=true,expected,directory,host,tools,connected=false,connecting=false,disabled=false,generation=0,autoAttempted=false;
12
12
  let legacyConfig=null,connectedConfig=null,lastNotice=null,lastNoticeAt=0;
13
13
  const failure=(code,effect='not_applied')=>({error:{code,retryable:true,effect}});
14
14
  const bound=()=>live&&expected&&verifyBinding(directory,expected);
@@ -70,6 +70,8 @@ try {
70
70
  }]));
71
71
  let pairing=false;
72
72
  guarded.broker_connect=async({connection_file})=>{
73
+ // Explicit user intent supersedes deferred startup resume, including failed attempts.
74
+ autoAttempted=true;
73
75
  if(pairing||connecting)return failure('connection_busy');
74
76
  if(!confirm())return failure('session_binding_unavailable');
75
77
  try{
@@ -85,10 +87,9 @@ try {
85
87
  }catch(error){return failure(error.effect==='unknown'?'enrollment_or_connection_uncertain':'invalid_connection_file',error.effect==='unknown'?'unknown':'not_applied');}
86
88
  finally{pairing=false;}
87
89
  };
88
- guarded.broker_disconnect=async()=>{generation++;disabled=true;connected=false;if(expected)writePrivateJson(join(directory,'activation.json'),{sessionId:expected.sessionId,lifetime:expected.lifetime,disabled:true});status();if(connecting)void runtime?.stop({closeSession:false}).catch(()=>{});else await stop(false);return{connected:false,pending_connection_cancelled:connecting||pairing,pending_retained:true,native_acceptance_recorded:false};};
90
+ guarded.broker_disconnect=async()=>{autoAttempted=true;generation++;disabled=true;connected=false;if(expected)writePrivateJson(join(directory,'activation.json'),{sessionId:expected.sessionId,lifetime:expected.lifetime,disabled:true});status();if(connecting)void runtime?.stop({closeSession:false}).catch(()=>{});else await stop(false);return{connected:false,pending_connection_cancelled:connecting||pairing,pending_retained:true,native_acceptance_recorded:false};};
89
91
  server=serveStdio({tools:guarded,onClose:async()=>{const closeSession=!bound();generation++;live=false;await stop(closeSession);},onDiagnostic:()=>{}});
90
92
  // Stay available while disconnected. Never retry failed enrollment/auth indefinitely.
91
- let autoAttempted=false;
92
93
  timer=setInterval(()=>{void(async()=>{
93
94
  if(expected&&!bound()){live=false;await server.close();return;}
94
95
  if(!expected)confirm();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matuto-ai/claude-code-broker-connector",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {