stitchkit 0.109.2 → 0.109.4

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
@@ -15,6 +15,24 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.109.4] - 2026-10-13
19
+
20
+ ### Fixed
21
+
22
+ - `stitchkit/process` — stopping a command's process group no longer passes a negative delay to a
23
+ timer on a loaded host. The grace wait and the Darwin permission retry read the clock once for both
24
+ the decision to wait and the length of the wait, so Node no longer prints `TimeoutNegativeWarning`
25
+ to the application's stderr when the deadline passes between two reads.
26
+
27
+ ## [0.109.3] - 2026-10-13
28
+
29
+ ### Added
30
+
31
+ - `stitchkit/application` — `createApplicationOpenTelemetry` reports
32
+ `stitchkit.application.schedule.runs_woken` and `.wakes_coalesced` beside the existing schedule
33
+ counters, so a dashboard shows how many runs came from `wake()` and how many came from the
34
+ period.
35
+
18
36
  ## [0.109.2] - 2026-10-13
19
37
 
20
38
  ### Added
@@ -1 +1 @@
1
- {"version":3,"file":"opentelemetry.d.ts","sourceRoot":"","sources":["../../src/application/opentelemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EAEb,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAY3D,MAAM,WAAW,yBAAyB;IACxC,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;CAC3F;AAED,MAAM,WAAW,uCAAuC;IACtD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B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M,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,KAAK,EAAE,yBAAyB,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;IAC7D,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC;IACjF,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE,CAAC;IAChE,iBAAiB,CAAC,CAAC,OAAO,EAAE,uCAAuC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5F;AAED,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,KAAK,IAAI,IAAI,CAAC;CACf;AAkPD,iFAAiF;AACjF,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,8BAA8B,GACrC,+BAA+B,CAwJjC"}
@@ -6,11 +6,11 @@ import {
6
6
  AgentCodingToolAuthorizationSchema2,
7
7
  AgentCodingToolPathAuthorizationSchema2,
8
8
  createAgentCodingTools2
9
- } from "../../index-sjntc4az.js";
9
+ } from "../../index-kc3jqqew.js";
10
10
  import"../../index-2kbysk9s.js";
11
11
  import"../../index-dj1aycxw.js";
12
12
  import"../../index-8ks9b85e.js";
13
- import"../../index-dasy32c8.js";
13
+ import"../../index-k3ty2b88.js";
14
14
  import"../../index-zrtrjkbf.js";
15
15
  import"../../index-636mggad.js";
16
16
  export {
@@ -8,7 +8,7 @@ import"../../index-q6crhe1n.js";
8
8
  import"../../index-fynr93w4.js";
9
9
  import {
10
10
  createAgentCodingTools2
11
- } from "../../index-sjntc4az.js";
11
+ } from "../../index-kc3jqqew.js";
12
12
  import"../../index-2kbysk9s.js";
13
13
  import {
14
14
  COMMAND_CLEANUP_TIMEOUT_MS,
@@ -19,7 +19,7 @@ import {
19
19
  nativeCommandOwner,
20
20
  terminateOwnedGroup,
21
21
  startNativeCommand
22
- } from "../../index-dasy32c8.js";
22
+ } from "../../index-k3ty2b88.js";
23
23
  import"../../index-zrtrjkbf.js";
24
24
  import {
25
25
  MAX_TIMER_MS
@@ -103,6 +103,8 @@ var scheduleMetrics = [
103
103
  scheduleMetric("stitchkit.application.schedule.runs_started", "Absolute schedule runs started.", (value) => value.runsStarted),
104
104
  scheduleMetric("stitchkit.application.schedule.runs_completed", "Absolute schedule runs completed.", (value) => value.runsCompleted),
105
105
  scheduleMetric("stitchkit.application.schedule.runs_failed", "Absolute schedule runs failed.", (value) => value.runsFailed),
106
+ scheduleMetric("stitchkit.application.schedule.runs_woken", "Absolute schedule runs started by a wake request.", (value) => value.runsWoken),
107
+ scheduleMetric("stitchkit.application.schedule.wakes_coalesced", "Absolute wake requests folded into a run that was already pending.", (value) => value.wakesCoalesced),
106
108
  scheduleMetric("stitchkit.application.schedule.ticks_skipped", "Absolute schedule ticks skipped.", (value) => value.ticksSkipped)
107
109
  ];
108
110
  var activityMetric = (name, description, value) => ({
@@ -9,7 +9,7 @@ import {
9
9
  } from "../index-dj1aycxw.js";
10
10
  import {
11
11
  startNativeCommand
12
- } from "../index-dasy32c8.js";
12
+ } from "../index-k3ty2b88.js";
13
13
  // src/process/command.ts
14
14
  function runNativeCommand(input) {
15
15
  return startNativeCommand(input).result;
@@ -82,9 +82,10 @@ async function signalUntilSettled(pid, signal, deadline) {
82
82
  try {
83
83
  return signalGroup(pid, signal);
84
84
  } catch (error) {
85
- if (!deniedOnDarwin(error) || performance.now() >= deadline)
85
+ const remaining = deadline - performance.now();
86
+ if (!deniedOnDarwin(error) || remaining <= 0)
86
87
  throw error;
87
- await new Promise((resolve) => setTimeout(resolve, Math.min(10, deadline - performance.now())));
88
+ await new Promise((resolve) => setTimeout(resolve, Math.min(10, remaining)));
88
89
  }
89
90
  }
90
91
  }
@@ -98,8 +99,11 @@ async function stopCommandGroup(stop) {
98
99
  const until = performance.now() + policy.graceMs;
99
100
  let interval = 10;
100
101
  let present = exists(pid);
101
- while (present && !policy.killOn?.aborted && performance.now() < until) {
102
- await sleep(Math.min(interval, until - performance.now()), policy.killOn).catch(() => {
102
+ while (present && !policy.killOn?.aborted) {
103
+ const remaining = until - performance.now();
104
+ if (remaining <= 0)
105
+ break;
106
+ await sleep(Math.min(interval, remaining), policy.killOn).catch(() => {
103
107
  return;
104
108
  });
105
109
  interval = Math.min(interval * 2, 250);
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  CommandStopped,
16
16
  startNativeCommand
17
- } from "./index-dasy32c8.js";
17
+ } from "./index-k3ty2b88.js";
18
18
  import {
19
19
  NumericFileHandle,
20
20
  descriptorPath,
@@ -1 +1 @@
1
- {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../src/process/group.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,KAAK,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAEpF,+FAA+F;AAC/F,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAYpE,MAAM;IACN,MAAM;EAIT;AAeD,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CASpF;AAmCD,sGAAsG;AACtG,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,6BAA6B,CAAC;IAC/C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,gBA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C,CAAC,CAAC,CAMxF"}
@@ -349,7 +349,7 @@ Every instrument uses unit `1` and reports an absolute current/lifetime value:
349
349
  | `stitchkit.application.lifecycle`, `.ready` | current lifecycle/health fact and readiness |
350
350
  | `stitchkit.application.admission.accepting`, `.accepted`, `.completed`, `.pending` | current gate and absolute lifetime admission counts |
351
351
  | `stitchkit.application.resource.ready` | readiness for each declared resource with required/state/health attributes |
352
- | `stitchkit.application.schedule.accepting`, `.active`, `.queued`, `.runs_started`, `.runs_completed`, `.runs_failed`, `.ticks_skipped` | current schedule state and absolute run/tick counts |
352
+ | `stitchkit.application.schedule.accepting`, `.active`, `.queued`, `.runs_started`, `.runs_completed`, `.runs_failed`, `.runs_woken`, `.wakes_coalesced`, `.ticks_skipped` | current schedule state and absolute run, wake and tick counts |
353
353
  | `stitchkit.application.activity.active`, `.queued`, `.completed`, `.failed` | absolute stage projections for declared activity sources |
354
354
 
355
355
  ## Replacing part of the graph without stopping the process
package/llms-full.txt CHANGED
@@ -7228,7 +7228,7 @@ Every instrument uses unit `1` and reports an absolute current/lifetime value:
7228
7228
  | `stitchkit.application.lifecycle`, `.ready` | current lifecycle/health fact and readiness |
7229
7229
  | `stitchkit.application.admission.accepting`, `.accepted`, `.completed`, `.pending` | current gate and absolute lifetime admission counts |
7230
7230
  | `stitchkit.application.resource.ready` | readiness for each declared resource with required/state/health attributes |
7231
- | `stitchkit.application.schedule.accepting`, `.active`, `.queued`, `.runs_started`, `.runs_completed`, `.runs_failed`, `.ticks_skipped` | current schedule state and absolute run/tick counts |
7231
+ | `stitchkit.application.schedule.accepting`, `.active`, `.queued`, `.runs_started`, `.runs_completed`, `.runs_failed`, `.runs_woken`, `.wakes_coalesced`, `.ticks_skipped` | current schedule state and absolute run, wake and tick counts |
7232
7232
  | `stitchkit.application.activity.active`, `.queued`, `.completed`, `.failed` | absolute stage projections for declared activity sources |
7233
7233
 
7234
7234
  ## Replacing part of the graph without stopping the process
package/llms.txt CHANGED
@@ -33,7 +33,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
33
33
  - **stitchkit/agent-runtime/openrouter**: [llms/agent-runtime-openrouter.txt](llms/agent-runtime-openrouter.txt) 1.1 KB
34
34
  - **stitchkit/agent-runtime/sqlite/bun**: [llms/agent-runtime-sqlite-bun.txt](llms/agent-runtime-sqlite-bun.txt) 1.8 KB
35
35
  - **stitchkit/agent-runtime/sqlite/node**: [llms/agent-runtime-sqlite-node.txt](llms/agent-runtime-sqlite-node.txt) 1.7 KB
36
- - **stitchkit/application**: [llms/application.txt](llms/application.txt) 40.7 KB → [llms/application.2.txt](llms/application.2.txt) 30.7 KB → [llms/application.3.txt](llms/application.3.txt) 29.4 KB
36
+ - **stitchkit/application**: [llms/application.txt](llms/application.txt) 40.8 KB → [llms/application.2.txt](llms/application.2.txt) 30.7 KB → [llms/application.3.txt](llms/application.3.txt) 29.4 KB
37
37
  - **stitchkit/application/grammy**: [llms/application-grammy.txt](llms/application-grammy.txt) 2.3 KB
38
38
  - **stitchkit/application/opentelemetry**: [llms/application-opentelemetry.txt](llms/application-opentelemetry.txt) 1.6 KB
39
39
  - **stitchkit/application/directory-inbox**: [llms/application-directory-inbox.txt](llms/application-directory-inbox.txt) 0.3 KB
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.109.2",
3
+ "version": "0.109.4",
4
4
  "description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
5
5
  "keywords": [
6
6
  "bun",