ticlawk 0.1.16-dev.12 → 0.1.16-dev.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ticlawk",
3
- "version": "0.1.16-dev.12",
3
+ "version": "0.1.16-dev.13",
4
4
  "description": "Local connector that links agent harnesses (Claude Code, Codex, OpenClaw, opencode, Pi) to the Ticlawk mobile app.",
5
5
  "type": "module",
6
6
  "main": "ticlawk.mjs",
@@ -804,6 +804,27 @@ export function createTiclawkAdapter(ctx) {
804
804
  error: err?.message || 'unknown error',
805
805
  });
806
806
  }
807
+
808
+ // Agents created from the App via POST /me/agents land here in
809
+ // status='unpaired'. Once we've successfully registered the
810
+ // binding locally, flip them to 'connected' — same end state the
811
+ // legacy QR pairing flow leaves agents in. spawn itself stays
812
+ // lazy (happens on first delivery via deliverTurn).
813
+ if (agent.status === 'unpaired' && agentHostId === hostId) {
814
+ try {
815
+ await api.updateAgent(agent.id, {
816
+ status: 'connected',
817
+ runtime_host_id: hostId,
818
+ runtime_host_label: getHostLabel(),
819
+ });
820
+ debugLog('ticlawk', 'binding.unpaired-claimed', { agentId: agent.id });
821
+ } catch (err) {
822
+ debugError('ticlawk', 'binding.unpaired-claim-failed', {
823
+ agentId: agent.id,
824
+ error: err?.message || 'unknown error',
825
+ });
826
+ }
827
+ }
807
828
  }
808
829
  const pruned = await pruneDeletedBindings(channels, reason);
809
830
  debugLog('ticlawk', 'binding.refresh-ok', {