@sema-agent/core 5.22.0 → 5.23.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.
- package/CHANGELOG.md +47 -0
- package/dist/agents/subagent.js +3 -2
- package/dist/core/governance-codes.js +3 -0
- package/dist/core/hooks.d.ts +62 -1
- package/dist/core/hooks.js +90 -12
- package/dist/core/memory-engine/engine.d.ts +28 -1
- package/dist/core/memory-engine/engine.js +62 -3
- package/dist/core/memory-engine/index.d.ts +1 -1
- package/dist/core/memory-engine/index.js +1 -1
- package/dist/core/memory-engine/layout.d.ts +69 -3
- package/dist/core/memory-engine/layout.js +75 -6
- package/dist/core/permission-rule-consent.js +2 -1
- package/dist/core/permission-rule-org.d.ts +36 -2
- package/dist/core/permission-rule-org.js +23 -0
- package/dist/core/permission-rule-store.js +2 -1
- package/dist/core/permission-rule-sync.d.ts +8 -0
- package/dist/core/permission-rule-sync.js +35 -6
- package/dist/core/runner/prepare-task.d.ts +10 -2
- package/dist/core/runner/prepare-task.js +111 -5
- package/dist/core/runner/runtask.js +19 -0
- package/dist/core/tool-policy.d.ts +37 -4
- package/dist/core/tool-policy.js +32 -4
- package/dist/core/tool-result-store.d.ts +9 -1
- package/dist/core/tool-result-store.js +2 -1
- package/dist/core/trace.d.ts +47 -0
- package/dist/core/types.d.ts +38 -0
- package/dist/core/wiring-manifest.d.ts +16 -1
- package/dist/core/wiring-manifest.js +7 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -2
- package/dist/orchestration/goal.d.ts +10 -0
- package/dist/orchestration/goal.js +6 -5
- package/dist/stores/file/adoption/adopt.d.ts +146 -0
- package/dist/stores/file/adoption/adopt.js +616 -0
- package/dist/stores/file/adoption/marker.d.ts +194 -0
- package/dist/stores/file/adoption/marker.js +198 -0
- package/dist/stores/file/background-agent-store.js +2 -0
- package/dist/stores/file/checkpoint-store.js +2 -0
- package/dist/stores/file/file-snapshot-store.js +2 -0
- package/dist/stores/file/index.d.ts +2 -0
- package/dist/stores/file/index.js +4 -0
- package/dist/stores/file/mailbox-store.js +2 -0
- package/dist/stores/file/memory-store.js +2 -0
- package/dist/stores/file/session-policy-store.js +2 -0
- package/dist/stores/file/session-store.js +2 -0
- package/dist/stores/file/task-list-store.js +2 -0
- package/dist/stores/file/tool-result-store.js +2 -0
- package/dist/stores/file/usage-window-store.js +2 -0
- package/dist/stores/file/workflow-journal-store.js +2 -0
- package/dist/stores/file/workflow-run-store.js +2 -0
- package/dist/tools/fs/bash-readonly-classifier.js +59 -10
- package/package.json +3 -2
|
@@ -238,11 +238,51 @@ function isGrepClusterFileStdin(tok) {
|
|
|
238
238
|
}
|
|
239
239
|
return false;
|
|
240
240
|
}
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
const SEPARATED_VALUE_OPTIONS = {
|
|
242
|
+
head: { short: "cn", long: ["bytes", "lines"] },
|
|
243
|
+
tail: { short: "cns", long: ["bytes", "lines", "sleep-interval", "pid", "max-unchanged-stats"] },
|
|
244
|
+
cut: { short: "bcdf", long: ["bytes", "characters", "delimiter", "fields", "output-delimiter"] },
|
|
245
|
+
grep: {
|
|
246
|
+
ownsValueButNotSkippable: "ef",
|
|
247
|
+
short: "mABCdD",
|
|
248
|
+
long: [
|
|
249
|
+
"max-count",
|
|
250
|
+
"after-context",
|
|
251
|
+
"before-context",
|
|
252
|
+
"context",
|
|
253
|
+
"devices",
|
|
254
|
+
"directories",
|
|
255
|
+
"label",
|
|
256
|
+
"binary-files",
|
|
257
|
+
"group-separator",
|
|
258
|
+
"include",
|
|
259
|
+
"exclude",
|
|
260
|
+
"exclude-dir",
|
|
261
|
+
],
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
function takesSeparatedValue(name, tok) {
|
|
265
|
+
const model = SEPARATED_VALUE_OPTIONS[name];
|
|
266
|
+
if (model === undefined)
|
|
243
267
|
return false;
|
|
244
|
-
|
|
245
|
-
|
|
268
|
+
if (tok.startsWith("--")) {
|
|
269
|
+
if (tok.includes("="))
|
|
270
|
+
return false;
|
|
271
|
+
const long = longOptionNameOf(tok);
|
|
272
|
+
return long !== undefined && model.long.some((full) => isLongOptionAbbrevOf(long, full));
|
|
273
|
+
}
|
|
274
|
+
if (!/^-[A-Za-z0-9]/.test(tok))
|
|
275
|
+
return false;
|
|
276
|
+
for (let i = 1; i < tok.length; i++) {
|
|
277
|
+
const ch = tok[i];
|
|
278
|
+
if ((model.ownsValueButNotSkippable ?? "").includes(ch))
|
|
279
|
+
return false;
|
|
280
|
+
if (model.short.includes(ch))
|
|
281
|
+
return i === tok.length - 1;
|
|
282
|
+
if (!/[A-Za-z0-9]/.test(ch))
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
return false;
|
|
246
286
|
}
|
|
247
287
|
function isGrepFileStdinLongOption(tok) {
|
|
248
288
|
const eq = tok.indexOf("=");
|
|
@@ -478,19 +518,28 @@ export function classifyCompoundReadonlyDetailed(command, allow, boundary) {
|
|
|
478
518
|
let sawNonFlagOperand = false;
|
|
479
519
|
let hasStdinDash = false;
|
|
480
520
|
let operandCount = 0;
|
|
521
|
+
let endOfOptions = false;
|
|
481
522
|
if (name !== "tr") {
|
|
482
523
|
for (let k = 0; k < restArgs.length; k++) {
|
|
483
524
|
const t = restArgs[k];
|
|
484
|
-
if (
|
|
525
|
+
if (endOfOptions) {
|
|
526
|
+
}
|
|
527
|
+
else if (t === "--") {
|
|
528
|
+
endOfOptions = true;
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
else if (takesSeparatedValue(name, t)) {
|
|
485
532
|
k++;
|
|
486
533
|
continue;
|
|
487
534
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
535
|
+
else {
|
|
536
|
+
if (name === "grep" && (isGrepClusterFileStdin(t) || isGrepFileStdinLongOption(t))) {
|
|
537
|
+
hasStdinDash = true;
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
if (t.startsWith("-") && t !== "-")
|
|
541
|
+
continue;
|
|
491
542
|
}
|
|
492
|
-
if (t.startsWith("-") && t !== "-")
|
|
493
|
-
continue;
|
|
494
543
|
const isGrepPatternPosition = name === "grep" && !grepPatternSuppliedByFlag && !sawNonFlagOperand;
|
|
495
544
|
sawNonFlagOperand = true;
|
|
496
545
|
operandCount++;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.23.0",
|
|
4
4
|
"description": "Stateless, task-oriented AI agent core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
"gate:domain-lexicon": "node scripts/verify-domain-lexicon.mjs",
|
|
64
64
|
"gate:single-mint": "node scripts/verify-single-mint.mjs",
|
|
65
65
|
"gate:nuia": "node scripts/verify-nuia-baseline.mjs",
|
|
66
|
-
"gate:field-liveness": "node scripts/verify-field-liveness.mjs"
|
|
66
|
+
"gate:field-liveness": "node scripts/verify-field-liveness.mjs",
|
|
67
|
+
"gate:error-surface": "node scripts/verify-error-surface.mjs"
|
|
67
68
|
},
|
|
68
69
|
"dependencies": {
|
|
69
70
|
"@modelcontextprotocol/sdk": "1.30.0",
|