@tjamescouch/niki 0.3.0 → 0.5.0

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 (3) hide show
  1. package/bin/niki +5 -2
  2. package/package.json +1 -1
  3. package/LICENSE +0 -21
package/bin/niki CHANGED
@@ -38,7 +38,7 @@ Options:
38
38
  --max-sends <n> Max agentchat_send calls per minute (default: 10)
39
39
  --max-tool-calls <n> Max total tool calls per minute (default: 30)
40
40
  --stall-timeout <secs> Kill after N seconds of no output (default: 60, 0=disabled)
41
- --startup-timeout <s> Longer stall timeout until first output (default: 180, 0=use stall-timeout)
41
+ --startup-timeout <s> Longer stall timeout until first output (default: 180, 0=no stall until first output)
42
42
  --dead-air-timeout <m> Minutes of zero CPU + zero output before kill (default: 5, 0=disabled)
43
43
  --max-nudges <n> Max stdin nudge attempts before kill on stall (default: 3)
44
44
  --log <file> Write diagnostics log to file
@@ -409,6 +409,8 @@ function currentStallTimeout() {
409
409
 
410
410
  function resetStallTimer() {
411
411
  if (stallTimer) clearTimeout(stallTimer);
412
+ // startup-timeout=0 means "wait indefinitely for first output"
413
+ if (!gotFirstOutput && STARTUP_TIMEOUT_S === 0) return;
412
414
  const timeout = currentStallTimeout();
413
415
  if (killed || timeout <= 0) return;
414
416
  stallTimer = setTimeout(onStallDetected, timeout * 1000);
@@ -518,7 +520,8 @@ child.stderr.on('data', (chunk) => {
518
520
 
519
521
  // Start stall detection
520
522
  if (STALL_TIMEOUT_S > 0 || STARTUP_TIMEOUT_S > 0) {
521
- log(`Stall detection: startup-timeout=${STARTUP_TIMEOUT_S}s, stall-timeout=${STALL_TIMEOUT_S}s, max-nudges=${MAX_NUDGES}`);
523
+ const startupMsg = STARTUP_TIMEOUT_S === 0 ? 'disabled (waiting for first output)' : `${STARTUP_TIMEOUT_S}s`;
524
+ log(`Stall detection: startup-timeout=${startupMsg}, stall-timeout=${STALL_TIMEOUT_S}s, max-nudges=${MAX_NUDGES}`);
522
525
  resetStallTimer();
523
526
  }
524
527
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tjamescouch/niki",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Deterministic process supervisor for AI agents — token budgets, rate limits, and abort control",
5
5
  "bin": {
6
6
  "niki": "./bin/niki"
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 James Couch
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.