@oked/sdk 0.6.13 → 0.6.14
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/dist/classify.js +20 -11
- package/package.json +2 -2
package/dist/classify.js
CHANGED
|
@@ -363,24 +363,32 @@ const MKTEMP_ASSIGN_RE = /^(?:export\s+|declare\s+|local\s+|readonly\s+)?(\w+)=[
|
|
|
363
363
|
// Process names and command lines of local dev servers and dev tooling: Node
|
|
364
364
|
// and Python app servers, bundlers, package-manager scripts, and Node scripts.
|
|
365
365
|
const DEV_PROCESS_RE = /\b(?:node|nodemon|tsx|ts-node|vite|next|nuxt|astro|remix|webpack(?:-dev-server)?|esbuild|parcel|turbo|npm|pnpm|yarn|bun|deno|wrangler|miniflare|uvicorn|gunicorn|flask|runserver|rails|puma|http\.server|http-server|live-server|serve|hugo|jekyll|storybook|expo|metro)\b|\.(?:[cm]?js|tsx?)\b/;
|
|
366
|
+
// Command lines of read-only watchers: a CI watcher (`gh pr checks 136 --watch`,
|
|
367
|
+
// `gh run watch`), a log tail, or a sleep. Stopping one loses nothing, and the
|
|
368
|
+
// agent can start it again.
|
|
369
|
+
const WATCHER_PROCESS_RE = /^(?:gh\s+(?:pr\s+checks|run\s+watch)\b|tail(?:\s+-\w*[fF]\b|$)|sleep\b|watch\b)/;
|
|
370
|
+
function isRestartableProcess(pattern) {
|
|
371
|
+
return DEV_PROCESS_RE.test(pattern) || WATCHER_PROCESS_RE.test(pattern);
|
|
372
|
+
}
|
|
366
373
|
/**
|
|
367
|
-
* A kill of a local dev server: `pkill -f "tsx src/main.ts"`,
|
|
368
|
-
* `kill $(pgrep -f vite)`, or a
|
|
369
|
-
* (`kill $(lsof -t -iTCP:3000 -sTCP:LISTEN)`).
|
|
370
|
-
* ID) for
|
|
371
|
-
*
|
|
374
|
+
* A kill of a local dev server or a read-only watcher: `pkill -f "tsx src/main.ts"`,
|
|
375
|
+
* `pkill -f "gh pr checks 136"`, `killall node`, `kill $(pgrep -f vite)`, or a
|
|
376
|
+
* kill of whatever listens on a port (`kill $(lsof -t -iTCP:3000 -sTCP:LISTEN)`).
|
|
377
|
+
* Oren chose `review` (no Face ID) for dev servers on 2026-10-18 and for
|
|
378
|
+
* watchers on 2026-10-21. A bare `kill <pid>` names no process, so it stays
|
|
379
|
+
* high stakes.
|
|
372
380
|
*/
|
|
373
|
-
function
|
|
381
|
+
function isRestartableKill(stage) {
|
|
374
382
|
const pkill = stage.match(/^pkill\s+(.+)$/);
|
|
375
383
|
if (pkill) {
|
|
376
384
|
const args = splitArgs(pkill[1]).filter((a) => !a.startsWith("-") || a === "-f");
|
|
377
385
|
const pattern = unquote(args[args.indexOf("-f") + 1] ?? args[args.length - 1] ?? "");
|
|
378
|
-
return
|
|
386
|
+
return isRestartableProcess(pattern);
|
|
379
387
|
}
|
|
380
388
|
const killall = stage.match(/^killall\s+(.+)$/);
|
|
381
389
|
if (killall) {
|
|
382
390
|
const names = splitArgs(killall[1]).filter((a) => !a.startsWith("-")).map(unquote);
|
|
383
|
-
return names.length > 0 && names.every((n) =>
|
|
391
|
+
return names.length > 0 && names.every((n) => isRestartableProcess(n));
|
|
384
392
|
}
|
|
385
393
|
const kill = stage.match(/^kill\s+(?:-\w+\s+)*\$\((.+)\)\s*(?:2>\/dev\/null)?$/);
|
|
386
394
|
if (kill) {
|
|
@@ -389,7 +397,7 @@ function isDevServerKill(stage) {
|
|
|
389
397
|
return true;
|
|
390
398
|
const pg = inner.match(/^pgrep\s+(?:-\w+\s+)*(?:-f\s+)?(.+)$/);
|
|
391
399
|
if (pg)
|
|
392
|
-
return
|
|
400
|
+
return isRestartableProcess(unquote(pg[1].trim()));
|
|
393
401
|
}
|
|
394
402
|
return false;
|
|
395
403
|
}
|
|
@@ -1041,8 +1049,9 @@ function classifyStageShellEffects(stage, ephemeralVars = new Set()) {
|
|
|
1041
1049
|
if (/(?:^|\/)scratchpad\//.test(pattern) || EPHEMERAL_PATH_RE.test(pattern))
|
|
1042
1050
|
return "warning";
|
|
1043
1051
|
}
|
|
1044
|
-
// Stopping a local dev server is review: it asks,
|
|
1045
|
-
|
|
1052
|
+
// Stopping a local dev server or a read-only watcher is review: it asks,
|
|
1053
|
+
// without Face ID.
|
|
1054
|
+
if (isRestartableKill(bareStage))
|
|
1046
1055
|
return "review";
|
|
1047
1056
|
for (const pattern of HIGH_STAKES_STAGE) {
|
|
1048
1057
|
if (pattern.test(bareStage))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oked/sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.14",
|
|
4
4
|
"description": "OKed SDK - human approval layer for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@oked/receipt-core": "0.6.
|
|
48
|
+
"@oked/receipt-core": "0.6.14"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^22.13.10",
|