@loucompanion/forge-bridge 0.2.1-dev.17ad6c965e41 → 0.2.1-dev.1a5cf93b48a1

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 (45) hide show
  1. package/dist/bridge/bridge-chat-giphy-look.d.ts +48 -0
  2. package/dist/bridge/bridge-chat-giphy-look.js +55 -0
  3. package/dist/bridge/bridge-chat-provider-command.d.ts +22 -1
  4. package/dist/bridge/bridge-chat-provider-command.js +102 -4
  5. package/dist/bridge/bridge-chat.types.d.ts +10 -0
  6. package/dist/bridge/bridge-chat.types.js +12 -0
  7. package/dist/bridge/bridge.service.d.ts +2 -0
  8. package/dist/bridge/bridge.service.js +11 -31
  9. package/dist/runtime/attempt-node-runtime-launcher.d.ts +36 -0
  10. package/dist/runtime/attempt-node-runtime-launcher.js +160 -0
  11. package/dist/runtime/host-listener-inspector.d.ts +26 -0
  12. package/dist/runtime/host-listener-inspector.js +84 -3
  13. package/dist/runtime/host-runtime-lease.d.ts +25 -2
  14. package/dist/runtime/host-runtime-lease.js +105 -137
  15. package/dist/runtime/host-runtime-promotion.d.ts +78 -2
  16. package/dist/runtime/host-runtime-promotion.js +307 -14
  17. package/dist/runtime/prepared-runtime-identity.d.ts +4 -0
  18. package/dist/runtime/prepared-runtime-identity.js +130 -9
  19. package/dist/runtime/prepared-runtime-readiness.d.ts +13 -1
  20. package/dist/runtime/prepared-runtime-readiness.js +63 -16
  21. package/dist/session/provider-cli/provider-cli.merge-integrity.d.ts +6 -3
  22. package/dist/session/provider-cli/provider-cli.merge-integrity.js +28 -8
  23. package/dist/session/session.service.d.ts +4 -0
  24. package/dist/session/session.service.js +62 -24
  25. package/dist/session/session.types.d.ts +1 -0
  26. package/dist/session/session.types.js +2 -2
  27. package/dist/version.d.ts +1 -1
  28. package/dist/version.js +1 -1
  29. package/dist/worktree/wip-git.d.ts +9 -0
  30. package/dist/worktree/wip-git.js +21 -4
  31. package/dist/worktree/wip-refs.d.ts +15 -0
  32. package/dist/worktree/wip-refs.js +29 -2
  33. package/dist/worktree/wip-restore.d.ts +8 -0
  34. package/dist/worktree/wip-restore.js +115 -25
  35. package/dist/worktree/wip-snapshot.d.ts +5 -2
  36. package/dist/worktree/wip-snapshot.js +15 -13
  37. package/dist/worktree/worktree-origin-sync.d.ts +1 -0
  38. package/dist/worktree/worktree-origin-sync.js +1 -0
  39. package/dist/worktree/worktree-wip-events.js +19 -2
  40. package/dist/worktree/worktree-wip.d.ts +1 -0
  41. package/dist/worktree/worktree-wip.js +6 -1
  42. package/dist/worktree/worktree.service.js +2 -0
  43. package/dist/worktree/worktree.types.d.ts +4 -0
  44. package/package.json +1 -1
  45. package/runtime/windows-listener-owner.ps1 +12 -1
@@ -105,6 +105,7 @@ export class GitWorktreeService {
105
105
  hydratedPriorPhaseArtifactCount,
106
106
  sessionId: request.sessionId ?? null,
107
107
  lane: request.lane,
108
+ wipAttempt: request.wipAttempt ?? null,
108
109
  ...preparedState,
109
110
  };
110
111
  }
@@ -168,6 +169,7 @@ export class GitWorktreeService {
168
169
  branchName,
169
170
  sessionId: request.sessionId,
170
171
  lane: request.lane,
172
+ wipAttempt: request.wipAttempt,
171
173
  log: this.log,
172
174
  });
173
175
  }
@@ -26,6 +26,8 @@ export interface WorktreePrepareRequest {
26
26
  readonly preserveExistingState?: boolean;
27
27
  /** The session this worktree is prepared for; names its WIP snapshots and enables restoring one. */
28
28
  readonly sessionId?: string | null;
29
+ /** Forge's issued attempt for this dispatch (sandbox.wipAttempt), stamped on its WIP refs: newest work wins. */
30
+ readonly wipAttempt?: number | null;
29
31
  /** The attempt dependency installs reserve host capacity for (decision 0013). */
30
32
  readonly hostLoadOwner?: {
31
33
  readonly dispatchAttemptId: string | null;
@@ -45,6 +47,8 @@ export interface WorktreeHandle {
45
47
  readonly hydratedPriorPhaseArtifactCount?: number;
46
48
  readonly sessionId?: string | null;
47
49
  readonly lane?: string;
50
+ /** Forge's issued attempt for the dispatch the worktree was prepared for; null from older servers. */
51
+ readonly wipAttempt?: number | null;
48
52
  /** What happened to the story's saved WIP when this worktree was prepared. */
49
53
  readonly wipRestore?: WipRestoreOutcome;
50
54
  /** Set when prepare moved a stale local branch or reused worktree up to origin's head. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loucompanion/forge-bridge",
3
- "version": "0.2.1-dev.17ad6c965e41",
3
+ "version": "0.2.1-dev.1a5cf93b48a1",
4
4
  "description": "Forge runner bridge CLI for connecting local developer machines to Forge dispatch.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -7,8 +7,10 @@ param(
7
7
 
8
8
  $ErrorActionPreference = "Stop"
9
9
  $parents = @{}
10
+ $created = @{}
10
11
  Get-CimInstance Win32_Process | ForEach-Object {
11
12
  $parents[[int]$_.ProcessId] = [int]$_.ParentProcessId
13
+ $created[[int]$_.ProcessId] = $_.CreationDate
12
14
  }
13
15
 
14
16
  $results = @()
@@ -25,7 +27,16 @@ foreach ($listenerText in $ListenerProcessIds.Split(',')) {
25
27
  if (-not $parents.ContainsKey($current)) {
26
28
  break
27
29
  }
28
- $current = [int]$parents[$current]
30
+ $parent = [int]$parents[$current]
31
+ # Windows keeps a child's ParentProcessId after the parent exits, and PIDs are reused. A
32
+ # "parent" created after the child is a different process that took the dead parent's PID,
33
+ # so the chain ends here; following it could attribute a foreign listener to the root.
34
+ if ($created.ContainsKey($parent) -and $created.ContainsKey($current) `
35
+ -and $null -ne $created[$parent] -and $null -ne $created[$current] `
36
+ -and $created[$parent] -gt $created[$current]) {
37
+ break
38
+ }
39
+ $current = $parent
29
40
  }
30
41
  $results += $owned
31
42
  }