agent-remnote 0.4.0 → 0.4.1

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
@@ -1,5 +1,11 @@
1
1
  # agent-remnote
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 53aad14: Fix Host API write endpoints so remote markdown and op writes no longer fail from a missing status-line runtime service.
8
+
3
9
  ## 0.4.0
4
10
 
5
11
  ### Minor Changes
package/dist/main.js CHANGED
@@ -48355,6 +48355,7 @@ var sleep4 = sleep3;
48355
48355
  var timeout2 = timeout;
48356
48356
  var timeoutOption2 = timeoutOption;
48357
48357
  var timeoutFail2 = timeoutFail;
48358
+ var timeoutTo2 = timeoutTo;
48358
48359
  var withConfigProvider2 = withConfigProvider;
48359
48360
  var context3 = context;
48360
48361
  var contextWithEffect2 = contextWithEffect;
@@ -90635,6 +90636,18 @@ function unsafeKillAny(child, signal) {
90635
90636
  child.kill(signal);
90636
90637
  } catch {}
90637
90638
  }
90639
+ function drainReadable(stream11) {
90640
+ if (!stream11 || typeof stream11.read !== "function")
90641
+ return "";
90642
+ let out = "";
90643
+ while (true) {
90644
+ const chunk4 = stream11.read();
90645
+ if (chunk4 === null)
90646
+ break;
90647
+ out += String(chunk4);
90648
+ }
90649
+ return out;
90650
+ }
90638
90651
  var SubprocessLive = succeed10(Subprocess, {
90639
90652
  run: ({ command, args: args2, timeoutMs, cwd, env: env2, killSignal }) => scoped2(acquireRelease2(gen2(function* () {
90640
90653
  const stdout2 = { text: "" };
@@ -90701,9 +90714,18 @@ var SubprocessLive = succeed10(Subprocess, {
90701
90714
  yield* sync3(() => unsafeKill(state.child, state.killSignal));
90702
90715
  }
90703
90716
  yield* sync3(state.cleanup);
90704
- })).pipe(flatMap9((state) => _await3(state.exit).pipe(timeoutFail2({
90717
+ })).pipe(flatMap9((state) => _await3(state.exit).pipe(timeoutTo2({
90705
90718
  duration: sanitizeTimeoutMs(timeoutMs),
90706
- onTimeout: () => timeoutCliError({
90719
+ onSuccess: (result) => right2(result),
90720
+ onTimeout: () => left2(undefined)
90721
+ }), flatMap9((result) => isRight2(result) ? succeed8(result.right) : gen2(function* () {
90722
+ yield* sync3(() => unsafeKill(state.child, state.killSignal));
90723
+ yield* sleep4(millis(50));
90724
+ yield* sync3(() => {
90725
+ state.stdout.text += drainReadable(state.child.stdout);
90726
+ state.stderr.text += drainReadable(state.child.stderr);
90727
+ });
90728
+ return yield* fail8(timeoutCliError({
90707
90729
  command,
90708
90730
  args: args2,
90709
90731
  timeoutMs: sanitizeTimeoutMs(timeoutMs),
@@ -90711,8 +90733,8 @@ var SubprocessLive = succeed10(Subprocess, {
90711
90733
  killSignal: state.killSignal,
90712
90734
  stdout: state.stdout.text,
90713
90735
  stderr: state.stderr.text
90714
- })
90715
- }))))),
90736
+ }));
90737
+ })))))),
90716
90738
  runInherit: ({ command, args: args2, cwd, env: env2, killSignal }) => scoped2(acquireRelease2(gen2(function* () {
90717
90739
  const done11 = { value: false };
90718
90740
  const exit3 = yield* make40();
@@ -91464,6 +91486,7 @@ var StatusLineControllerLive = scoped3(StatusLineController, gen2(function* () {
91464
91486
  const cfg = yield* AppConfig;
91465
91487
  const updater = yield* StatusLineUpdater;
91466
91488
  const state = yield* make25(INITIAL_STATE);
91489
+ const runLoopScope = yield* acquireRelease2(make38(), (scope5) => close(scope5, void_3));
91467
91490
  const runLoop2 = gen2(function* () {
91468
91491
  while (true) {
91469
91492
  const snapBefore = yield* get11(state);
@@ -91515,7 +91538,7 @@ var StatusLineControllerLive = scoped3(StatusLineController, gen2(function* () {
91515
91538
  return [s.scheduled === false, next4];
91516
91539
  });
91517
91540
  if (shouldStart) {
91518
- yield* fork3(runLoop2.pipe(catchAll2(() => _void)));
91541
+ yield* forkIn2(runLoopScope)(runLoop2.pipe(catchAll2(() => _void)));
91519
91542
  }
91520
91543
  yield* _await3(waiter);
91521
91544
  })
@@ -96173,11 +96196,12 @@ function runHttpApiRuntime(params3) {
96173
96196
  const refs = yield* RefResolver;
96174
96197
  const hostApi = yield* HostApiClient;
96175
96198
  const remDb = yield* RemDb;
96199
+ const statusLine = yield* StatusLineController;
96176
96200
  const host3 = params3?.host ?? cfg.apiHost ?? "0.0.0.0";
96177
96201
  const configuredPort = params3?.port ?? cfg.apiPort ?? 3000;
96178
96202
  const stateFilePath = params3?.stateFile ?? cfg.apiStateFile ?? apiFiles.defaultStateFile();
96179
96203
  const startedAt = Date.now();
96180
- const provide6 = (effect4) => effect4.pipe(provideService2(AppConfig, cfg), provideService2(ApiDaemonFiles, apiFiles), provideService2(WsClient, ws), provideService2(Queue, queue), provideService2(Payload, payload), provideService2(RefResolver, refs), provideService2(HostApiClient, hostApi), provideService2(RemDb, remDb));
96204
+ const provide6 = (effect4) => effect4.pipe(provideService2(AppConfig, cfg), provideService2(ApiDaemonFiles, apiFiles), provideService2(WsClient, ws), provideService2(Queue, queue), provideService2(Payload, payload), provideService2(RefResolver, refs), provideService2(HostApiClient, hostApi), provideService2(RemDb, remDb), provideService2(StatusLineController, statusLine));
96181
96205
  const server = createServer((req, res) => {
96182
96206
  const url2 = new URL(req.url || "/", `http://${req.headers.host || "localhost"}`);
96183
96207
  const method = req.method || "GET";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-remnote",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "agent-remnote": "./cli.js"