@arcforge/platform 2.0.175 → 2.0.176

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": "@arcforge/platform",
3
- "version": "2.0.175",
3
+ "version": "2.0.176",
4
4
  "description": "The Axon developer platform — headless project discovery, blueprint scanning, typegen, agent lifecycle, registry, benches and tests. Shared by the CLI/TUI and the Fleet extension.",
5
5
  "type": "module",
6
6
  "private": false,
@@ -44,20 +44,20 @@
44
44
  "deploy": "echo \"This package is published ONLY by apps/tui/scripts/release.ts, which pins workspace:* deps to concrete versions first. Publishing it directly ships an unresolvable dependency.\" && exit 1"
45
45
  },
46
46
  "dependencies": {
47
- "@arcforge/session": "2.0.175",
48
- "@arcforge/engines": "2.0.175",
49
- "@arcforge/err": "2.0.175",
50
- "@arcforge/types": "2.0.175",
51
- "@arcforge/cloud": "2.0.175",
52
- "@arcforge/capsule": "2.0.175",
53
- "@arcforge/core": "2.0.175",
54
- "@arcforge/vstr": "2.0.175",
47
+ "@arcforge/session": "2.0.176",
48
+ "@arcforge/engines": "2.0.176",
49
+ "@arcforge/err": "2.0.176",
50
+ "@arcforge/types": "2.0.176",
51
+ "@arcforge/cloud": "2.0.176",
52
+ "@arcforge/capsule": "2.0.176",
53
+ "@arcforge/core": "2.0.176",
54
+ "@arcforge/vstr": "2.0.176",
55
55
  "fft.js": "^4.0.4",
56
56
  "h3": "^1.15.11",
57
57
  "semver": "^7.7.4",
58
58
  "sharp": "^0.35.3",
59
59
  "typescript": "5.9.2",
60
- "@arcforge/link": "2.0.175"
60
+ "@arcforge/link": "2.0.176"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@arcforge/air": "2.0.167",
@@ -84,6 +84,7 @@ export async function main(): Promise<void> {
84
84
 
85
85
  const handlers = agentHandlers({
86
86
  stimulus: entry => serve().then(s => s.stimulus(entry)),
87
+ ingest: entry => serve().then(s => s.ingest(entry)),
87
88
  update: bp => serve().then(s => s.update(bp)),
88
89
  /**
89
90
  * Interrupt is sync and fire-and-forget — but it must not be LOST.
package/src/platform.ts CHANGED
@@ -92,7 +92,7 @@ export function Platform(opts: PlatformOpts) {
92
92
  return result
93
93
  },
94
94
  })
95
- const cloud = Cloud({ store: store, distribution: distribution })
95
+ const cloud = Cloud({ store: store, distribution: distribution, release: opts.version })
96
96
 
97
97
  const ollama = Ollama() // local models via the Ollama daemon
98
98
  const mic = Mic() // mic capture + visualizer service
@@ -17,6 +17,8 @@ type CloudOpts = {
17
17
  * credentials — that is this leaf's own policy.
18
18
  */
19
19
  distribution: Distribution
20
+ /** Shipped host version stamped onto every crash report. */
21
+ release: string
20
22
  }
21
23
 
22
24
  export type Distribution = "production" | "development"
@@ -138,6 +140,7 @@ export function Cloud(opts: CloudOpts) {
138
140
  ...(profile?.record.auth.apiKey ? { key: profile.record.auth.apiKey } : {}),
139
141
  ...(session ? { session } : {}),
140
142
  environmentCredentials: policy.environmentCredentials,
143
+ release: opts.release,
141
144
  onUnauthorized: () => { void onSessionExpired() },
142
145
  })
143
146
  }
@@ -24,42 +24,67 @@ export type CaptureOpts = {
24
24
  windowSamples: number
25
25
  }
26
26
 
27
- /** Priority order per platform — first one found on $PATH wins. Windows has no reliable always-present CLI capture tool, so sox/ffmpeg only. */
28
- function detectBackend(): CaptureBackend | null {
29
- const candidates: CaptureBackend[] =
30
- process.platform === "darwin" ? ["sox", "ffmpeg"]
31
- : process.platform === "win32" ? ["sox", "ffmpeg"]
32
- : ["arecord", "sox", "ffmpeg"] // linux and other unix
27
+ /**
28
+ * Capture backends worth trying, in priority order, for one platform.
29
+ *
30
+ * Split from the $PATH probe and given the platform as a PARAMETER so all
31
+ * three orders are assertable from one machine. The darwin and win32 lists
32
+ * cannot execute on Linux CI otherwise, which is how a wrong argv ships: the
33
+ * failure is a silent "voice unavailable", indistinguishable from a machine
34
+ * that genuinely has no capture tool installed.
35
+ */
36
+ export function backendsFor(platform: NodeJS.Platform = process.platform): CaptureBackend[] {
37
+ // Windows has no reliable always-present CLI capture tool, so sox/ffmpeg
38
+ // only. macOS likewise — arecord is ALSA, which is Linux's.
39
+ if (platform === "darwin" || platform === "win32") return ["sox", "ffmpeg"]
40
+ return ["arecord", "sox", "ffmpeg"] // linux and other unix
41
+ }
33
42
 
34
- for (const cmd of candidates) {
43
+ /** First backend actually present on $PATH, or null when none is. */
44
+ function detectBackend(): CaptureBackend | null {
45
+ for (const cmd of backendsFor()) {
35
46
  if (Bun.which(cmd)) return cmd
36
47
  }
37
48
  return null
38
49
  }
39
50
 
40
- /** Spawn args per backend — all produce raw signed 16-bit LE PCM, mono, at opts.sampleRate, on stdout. */
41
- function buildArgs(backend: CaptureBackend, sampleRate: number): string[] {
51
+ /**
52
+ * Spawn args per backend — all produce raw signed 16-bit LE PCM, mono, at
53
+ * `sampleRate`, on stdout. Every branch ends in that same format, which is the
54
+ * invariant the reader downstream depends on.
55
+ *
56
+ * The platform is a PARAMETER, not a `process.platform` read, so the six
57
+ * OS-specific argv shapes can be asserted on any machine. Each names a
58
+ * different audio subsystem — avfoundation on macOS, dshow on Windows, ALSA on
59
+ * Linux — and getting one wrong yields a backend that spawns and then produces
60
+ * nothing, which reads to the user as a microphone that does not work.
61
+ */
62
+ export function buildArgs(
63
+ backend: CaptureBackend,
64
+ sampleRate: number,
65
+ platform: NodeJS.Platform = process.platform,
66
+ ): string[] {
42
67
  const rate = String(sampleRate)
43
68
 
44
69
  if (backend === "arecord") {
70
+ // ALSA only — never selected on darwin or win32 (see backendsFor).
45
71
  return ["-t", "raw", "-f", "S16_LE", "-r", rate, "-c", "1", "-"]
46
72
  }
47
73
 
48
74
  if (backend === "sox") {
49
- if (process.platform === "darwin") {
50
- return ["-d", "-r", rate, "-c", "1", "-e", "signed-integer", "-b", "16", "-t", "raw", "-"]
51
- }
52
- if (process.platform === "win32") {
75
+ // `-d` is sox's default input device, which both macOS and Windows
76
+ // resolve themselves. Linux needs the ALSA device named explicitly.
77
+ if (platform === "darwin" || platform === "win32") {
53
78
  return ["-d", "-r", rate, "-c", "1", "-e", "signed-integer", "-b", "16", "-t", "raw", "-"]
54
79
  }
55
80
  return ["-t", "alsa", "default", "-r", rate, "-c", "1", "-e", "signed-integer", "-b", "16", "-t", "raw", "-"]
56
81
  }
57
82
 
58
- // ffmpeg
59
- if (process.platform === "darwin") {
83
+ // ffmpeg — one flag per platform's capture subsystem.
84
+ if (platform === "darwin") {
60
85
  return ["-f", "avfoundation", "-i", ":0", "-ac", "1", "-ar", rate, "-f", "s16le", "-"]
61
86
  }
62
- if (process.platform === "win32") {
87
+ if (platform === "win32") {
63
88
  return ["-f", "dshow", "-i", "audio=default", "-ac", "1", "-ar", rate, "-f", "s16le", "-"]
64
89
  }
65
90
  return ["-f", "alsa", "-i", "default", "-ac", "1", "-ar", rate, "-f", "s16le", "-"]