pi-revit 0.2.17 → 0.2.18

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/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ Format follows [Keep a Changelog](https://keepachangelog.com/); version headers
7
7
  Every published version gets an entry with **Added** / **Changed** / **Fixed** sections
8
8
  describing what the user will notice — not internal refactors.
9
9
 
10
+ ## [0.2.18] - 2026-08-21
11
+
12
+ ### Fixed
13
+ - When pi starts before Revit and the background rediscovery timer (rather than a `ping`
14
+ call) registers the bridge tools, the session is now told — the same announcement the
15
+ ping path has always given. Previously the tools appeared silently in the next system
16
+ prompt while nothing contradicted the session's earlier "Revit is not running", so the
17
+ agent could stay needlessly pessimistic. The note is queued for the next user prompt
18
+ and never interrupts. Extension-only change; the Revit add-in is unchanged (the
19
+ standard installer keeps both versions aligned).
20
+
10
21
  ## [0.2.17] - 2026-08-21
11
22
 
12
23
  ### Fixed
@@ -372,7 +372,28 @@ export default async function revitConnector(pi: ExtensionAPI) {
372
372
  // Never block pi startup on Revit: keep retrying quietly in the background
373
373
  // and stop the moment discovery succeeds.
374
374
  const timer = setInterval(async () => {
375
- if (await discoverAndRegister()) clearInterval(timer);
375
+ if (!(await discoverAndRegister())) return;
376
+ clearInterval(timer);
377
+ // The ping path announces newly registered tools in its result text; this path
378
+ // must speak too. Without it the tools appear silently in the next system
379
+ // prompt while nothing in the conversation contradicts an earlier "Revit is
380
+ // not running" — the session's belief goes stale. Custom messages participate
381
+ // in LLM context; deliverAs "nextTurn" queues it for the next user prompt
382
+ // without interrupting or triggering anything.
383
+ try {
384
+ pi.sendMessage(
385
+ {
386
+ customType: "pi-revit",
387
+ content:
388
+ "Revit is now reachable: the Revit bridge tools (get_elements, set_parameters, execute_csharp, ...) were just registered in this session and are available from now on.",
389
+ display: true,
390
+ },
391
+ { deliverAs: "nextTurn" },
392
+ );
393
+ } catch {
394
+ // An older pi without sendMessage, or a torn-down session: the
395
+ // registration itself succeeded and must never be undone by the announcer.
396
+ }
376
397
  }, REDISCOVERY_INTERVAL_MS);
377
398
  timer.unref?.();
378
399
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-revit",
3
- "version": "0.2.17",
3
+ "version": "0.2.18",
4
4
  "description": "Native Pi connector for Autodesk Revit. Run npx.cmd -y pi-revit for the full Windows install.",
5
5
  "author": "Ahmad Altahlawi",
6
6
  "license": "MIT",