@loucompanion/forge-bridge 0.1.4-dev.e3697e9f5c98 → 0.1.4-dev.f22f5e3d01fe

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 (69) hide show
  1. package/README.md +13 -0
  2. package/dist/bridge/bridge-chat-provider-command.d.ts +16 -0
  3. package/dist/bridge/bridge-chat-provider-command.js +125 -0
  4. package/dist/bridge/bridge.service.d.ts +1 -1
  5. package/dist/bridge/bridge.service.js +4 -110
  6. package/dist/bridge/runner-host-capabilities.d.ts +3 -0
  7. package/dist/bridge/runner-host-capabilities.js +13 -0
  8. package/dist/runtime/host-facts.d.ts +2 -1
  9. package/dist/runtime/host-load-admission.d.ts +9 -2
  10. package/dist/runtime/host-load-child-environment.d.ts +11 -6
  11. package/dist/runtime/host-load-child-environment.js +19 -10
  12. package/dist/runtime/host-load-governor-config.d.ts +10 -1
  13. package/dist/runtime/host-load-governor-config.js +7 -0
  14. package/dist/runtime/host-load-governor.d.ts +10 -0
  15. package/dist/runtime/host-load-governor.js +125 -34
  16. package/dist/runtime/host-load-sampler.d.ts +26 -3
  17. package/dist/runtime/host-load-sampler.js +61 -2
  18. package/dist/runtime/host-load-step-class.d.ts +3 -1
  19. package/dist/runtime/host-load-step-class.js +60 -5
  20. package/dist/runtime/host-load-test-slot.d.ts +43 -0
  21. package/dist/runtime/host-load-test-slot.js +81 -0
  22. package/dist/runtime/host-load-token-ledger.d.ts +26 -0
  23. package/dist/runtime/host-load-token-ledger.js +93 -61
  24. package/dist/runtime/host-load-windows-cpu.d.ts +34 -0
  25. package/dist/runtime/host-load-windows-cpu.js +85 -0
  26. package/dist/runtime/host-runtime-lease.d.ts +1 -1
  27. package/dist/runtime/host-runtime-lease.js +1 -1
  28. package/dist/sandbox/host-capacity-broker.d.ts +7 -1
  29. package/dist/sandbox/host-capacity-broker.js +23 -4
  30. package/dist/session/architect-waits.d.ts +2 -0
  31. package/dist/session/architect-waits.js +138 -0
  32. package/dist/session/managed-attempt-tools.js +8 -9
  33. package/dist/session/managed-command-host-load.d.ts +2 -0
  34. package/dist/session/managed-command-host-load.js +2 -1
  35. package/dist/session/phase-completion.schemas.js +25 -23
  36. package/dist/session/phase-completion.validation.js +3 -1
  37. package/dist/session/pre-publication-pass.d.ts +2 -1
  38. package/dist/session/pre-publication-pass.js +8 -5
  39. package/dist/session/pre-publication-validation.d.ts +2 -0
  40. package/dist/session/pre-publication-validation.js +30 -4
  41. package/dist/session/provider-cli/claude-background-work.d.ts +66 -0
  42. package/dist/session/provider-cli/claude-background-work.js +180 -0
  43. package/dist/session/provider-cli/provider-cli.child-environment.d.ts +7 -0
  44. package/dist/session/provider-cli/provider-cli.child-environment.js +73 -0
  45. package/dist/session/provider-cli/provider-cli.codex-models-cache.d.ts +3 -0
  46. package/dist/session/provider-cli/provider-cli.codex-models-cache.js +37 -0
  47. package/dist/session/provider-cli/provider-cli.process.d.ts +13 -22
  48. package/dist/session/provider-cli/provider-cli.process.js +36 -337
  49. package/dist/session/provider-cli/provider-cli.prompts.d.ts +2 -0
  50. package/dist/session/provider-cli/provider-cli.prompts.js +45 -8
  51. package/dist/session/provider-cli/provider-cli.runtime.js +7 -0
  52. package/dist/session/provider-cli/provider-cli.service.js +2 -8
  53. package/dist/session/provider-cli/provider-cli.windows-environment.d.ts +10 -0
  54. package/dist/session/provider-cli/provider-cli.windows-environment.js +151 -0
  55. package/dist/session/provider-cli/provider-in-flight-work.d.ts +4 -0
  56. package/dist/session/provider-cli/provider-in-flight-work.js +45 -0
  57. package/dist/session/provider-cli/provider-output-pipes.d.ts +30 -0
  58. package/dist/session/provider-cli/provider-output-pipes.js +67 -0
  59. package/dist/session/provider-cli/provider-output-state.d.ts +2 -0
  60. package/dist/session/provider-cli/provider-output-state.js +6 -0
  61. package/dist/session/sandbox-host-capacity-gate.js +12 -3
  62. package/dist/session/session.types.js +1 -1
  63. package/dist/shared/process/windows-app-execution-alias.d.ts +19 -0
  64. package/dist/shared/process/windows-app-execution-alias.js +45 -0
  65. package/dist/shared/process/windows-launch.d.ts +18 -0
  66. package/dist/shared/process/windows-launch.js +68 -0
  67. package/dist/version.d.ts +1 -1
  68. package/dist/version.js +1 -1
  69. package/package.json +1 -1
@@ -6,3 +6,21 @@ export declare function buildWindowsCmdLaunch(command: string, args: readonly st
6
6
  export declare function buildWindowsLaunchCommand(commandPath: string, args: readonly string[]): LaunchCommand;
7
7
  export declare function windowsCommandLine(command: string, args: readonly string[]): string;
8
8
  export declare function quoteWindowsCommandLineArg(value: string): string;
9
+ export interface WindowsCommandPathOptions {
10
+ /**
11
+ * Skip candidates under a `WindowsApps` directory. Those are Microsoft Store app-execution
12
+ * aliases: the process they start is created outside the caller's Job Object, so it survives the
13
+ * job and keeps any inherited pipe open. Resolve the next real install on PATH instead.
14
+ */
15
+ readonly skipAppExecutionAliases?: boolean;
16
+ }
17
+ /**
18
+ * Resolves Windows commands without spawning where.exe. Runtime launches can
19
+ * happen while the machine is under enough process pressure for where.exe to
20
+ * miss its timeout; returning the unresolved package-manager name in that case
21
+ * makes Node fall back to a shell shim that cannot survive Job Object wrapping.
22
+ */
23
+ export declare function resolveWindowsCommandFromPath(command: string, pathValue?: string, pathExtValue?: string, options?: WindowsCommandPathOptions): string | null;
24
+ export declare function chooseWindowsCommandCandidate(candidates: readonly string[]): string | null;
25
+ /** True for a path inside a `WindowsApps` directory, where Store app-execution aliases live. */
26
+ export declare function isWindowsAppExecutionAliasPath(candidate: string): boolean;
@@ -1,3 +1,4 @@
1
+ import fs from "node:fs";
1
2
  import path from "node:path";
2
3
  export function buildWindowsCmdLaunch(command, args, comSpec = process.env.ComSpec) {
3
4
  const resolvedComSpec = comSpec?.trim();
@@ -39,3 +40,70 @@ function powershellExecutable() {
39
40
  ? path.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe")
40
41
  : "powershell.exe";
41
42
  }
43
+ /**
44
+ * Resolves Windows commands without spawning where.exe. Runtime launches can
45
+ * happen while the machine is under enough process pressure for where.exe to
46
+ * miss its timeout; returning the unresolved package-manager name in that case
47
+ * makes Node fall back to a shell shim that cannot survive Job Object wrapping.
48
+ */
49
+ export function resolveWindowsCommandFromPath(command, pathValue = process.env.PATH ?? "", pathExtValue = process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD", options = {}) {
50
+ if (!command || path.isAbsolute(command) || command.includes("/") || command.includes("\\")) {
51
+ return null;
52
+ }
53
+ const hasExtension = path.extname(command).length > 0;
54
+ const extensions = hasExtension
55
+ ? [""]
56
+ : [...new Set([
57
+ "",
58
+ ".exe",
59
+ ".ps1",
60
+ ".cmd",
61
+ ".bat",
62
+ ...pathExtValue.split(";").map(value => value.trim().toLowerCase()).filter(Boolean),
63
+ ])];
64
+ for (const rawDirectory of pathValue.split(path.delimiter)) {
65
+ const directory = rawDirectory.trim().replace(/^"|"$/gu, "");
66
+ if (!directory)
67
+ continue;
68
+ const candidates = [];
69
+ for (const extension of extensions) {
70
+ const candidate = path.join(directory, `${command}${extension}`);
71
+ if (options.skipAppExecutionAliases && isWindowsAppExecutionAliasPath(candidate))
72
+ continue;
73
+ if (pathEntryExists(candidate))
74
+ candidates.push(candidate);
75
+ }
76
+ const resolved = chooseWindowsCommandCandidate(candidates);
77
+ if (resolved)
78
+ return resolved;
79
+ }
80
+ return null;
81
+ }
82
+ export function chooseWindowsCommandCandidate(candidates) {
83
+ const normalized = candidates
84
+ .map((candidate) => candidate.trim())
85
+ .filter((candidate) => candidate.length > 0);
86
+ if (normalized.length === 0) {
87
+ return null;
88
+ }
89
+ const preferredExtensions = [".exe", ".ps1", ".cmd", ".bat", ""];
90
+ for (const extension of preferredExtensions) {
91
+ const candidate = normalized.find((entry) => path.extname(entry).toLowerCase() === extension);
92
+ if (candidate) {
93
+ return candidate;
94
+ }
95
+ }
96
+ return normalized[0];
97
+ }
98
+ /** True for a path inside a `WindowsApps` directory, where Store app-execution aliases live. */
99
+ export function isWindowsAppExecutionAliasPath(candidate) {
100
+ return candidate.split(/[\\/]+/u).some(segment => segment.toLowerCase() === "windowsapps");
101
+ }
102
+ // An app-execution alias is a reparse point that stat() may not open, so an
103
+ // alias is also accepted when only lstat() can see it.
104
+ function pathEntryExists(candidate) {
105
+ if (fs.existsSync(candidate))
106
+ return true;
107
+ return isWindowsAppExecutionAliasPath(candidate)
108
+ && fs.lstatSync(candidate, { throwIfNoEntry: false }) !== undefined;
109
+ }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const forgeBridgeVersion = "0.1.4-dev.e3697e9f5c98";
1
+ export declare const forgeBridgeVersion = "0.1.4-dev.f22f5e3d01fe";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const forgeBridgeVersion = "0.1.4-dev.e3697e9f5c98";
1
+ export const forgeBridgeVersion = "0.1.4-dev.f22f5e3d01fe";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loucompanion/forge-bridge",
3
- "version": "0.1.4-dev.e3697e9f5c98",
3
+ "version": "0.1.4-dev.f22f5e3d01fe",
4
4
  "description": "Forge runner bridge CLI for connecting local developer machines to Forge dispatch.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",