@sema-agent/core 1.444.0 → 1.446.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.
@@ -1,5 +1,5 @@
1
1
  import { type SessionRepo } from "../internal/harness.js";
2
- import { type AcquiredSession, type SessionStore, type SessionSummary } from "./session.js";
2
+ import { type AcquiredSession, type SessionStore, type SessionStoreSummary } from "./session.js";
3
3
  export declare const SESSION_DEFAULT_TTL_DAYS = 7;
4
4
  export type EvictPolicy = "delete" | "forget";
5
5
  export interface TtlSessionStoreOptions {
@@ -24,7 +24,7 @@ export declare class TtlSessionStore implements SessionStore {
24
24
  private createAndStore;
25
25
  touch(sessionId: string): void;
26
26
  noteTaskRun(sessionId: string, taskId: string): void;
27
- list(): Promise<SessionSummary[]>;
27
+ list(): Promise<SessionStoreSummary[]>;
28
28
  fork(sourceId: string, owner?: string | null): Promise<string | null>;
29
29
  release(sessionId: string): Promise<void>;
30
30
  forget(sessionId: string): void;
@@ -12,13 +12,14 @@ export interface AcquiredSession {
12
12
  session: Session;
13
13
  sessionId: string;
14
14
  }
15
- export interface SessionSummary {
15
+ export interface SessionStoreSummary {
16
16
  sessionId: string;
17
17
  createdAt?: string;
18
18
  lastActiveAt: number;
19
19
  lastTaskId?: string;
20
20
  forkedFrom?: string;
21
21
  }
22
+ export type SessionSummary = SessionStoreSummary;
22
23
  export interface SessionStore {
23
24
  acquire(sessionId?: string, opts?: {
24
25
  requireExisting?: boolean;
@@ -29,7 +30,7 @@ export interface SessionStore {
29
30
  pin?(sessionId: string): void | Promise<void>;
30
31
  unpin?(sessionId: string): void | Promise<void>;
31
32
  noteTaskRun?(sessionId: string, taskId: string): void | Promise<void>;
32
- list?(): Promise<SessionSummary[]>;
33
+ list?(): Promise<SessionStoreSummary[]>;
33
34
  fork?(sourceId: string, owner?: string | null): Promise<string | null>;
34
35
  readonly size: number;
35
36
  dispose(): void | Promise<void>;
package/dist/index.d.ts CHANGED
@@ -44,7 +44,7 @@ export { SAFETY_AXIS_VOCABULARY } from "./core/safety-axis-vocab.js";
44
44
  export { createSessionRulePolicy } from "./core/runner/session-rule-policy.js";
45
45
  export { TtlSessionStore, type TtlSessionStoreOptions, type EvictPolicy } from "./core/session-store.js";
46
46
  export { reconcileInterruptedSession, findOrphanToolCalls, type OrphanToolCall, type ReconcileReport, } from "./core/session-reconcile.js";
47
- export { StoredSession, InMemorySessionRepo, InMemorySessionStorage, BaseSessionStorage, leafIdAfterEntry, validateEntriesForImport, StreamingImportValidator, boundedTail, SessionError, isSessionConflict, hasSessionFork, uuidv7, type Session, type SessionStore, type AcquiredSession, type SessionSummary, type SessionStorage, type SessionRepo, type SessionMetadata, type SessionTreeEntry, type SessionWriteOptions, } from "./core/session.js";
47
+ export { StoredSession, InMemorySessionRepo, InMemorySessionStorage, BaseSessionStorage, leafIdAfterEntry, validateEntriesForImport, StreamingImportValidator, boundedTail, SessionError, isSessionConflict, hasSessionFork, uuidv7, type Session, type SessionStore, type AcquiredSession, type SessionStoreSummary, type SessionSummary, type SessionStorage, type SessionRepo, type SessionMetadata, type SessionTreeEntry, type SessionWriteOptions, } from "./core/session.js";
48
48
  export { warmResume } from "./core/warm-resume.js";
49
49
  export { StubExecutionEnv } from "./core/stub-env.js";
50
50
  export { NodeExecutionEnv, FileError, ExecutionError } from "./internal/harness.js";
@@ -1300,6 +1300,36 @@ export function classifyCompoundReadonly(command, allow) {
1300
1300
  const nonOption = toks.slice(1).filter((t) => !t.startsWith("-"));
1301
1301
  if (!(pipeFed[si] ?? false)) {
1302
1302
  const floor = STDIN_FILE_FLOOR[name];
1303
+ const restArgs = toks.slice(1);
1304
+ const grepPatternSuppliedByFlag = name === "grep" && restArgs.some((t) => t === "-e" || t.startsWith("-e") || t === "-f" || t.startsWith("--regexp") || t.startsWith("--file"));
1305
+ let sawNonFlagOperand = false;
1306
+ let hasStdinDash = false;
1307
+ if (name !== "tr") {
1308
+ for (let k = 0; k < restArgs.length; k++) {
1309
+ const t = restArgs[k];
1310
+ if (name === "cut" && (t === "-d" || t === "--delimiter")) {
1311
+ k++;
1312
+ continue;
1313
+ }
1314
+ if (name === "grep" && (t === "-f-" || t === "--file=-")) {
1315
+ hasStdinDash = true;
1316
+ break;
1317
+ }
1318
+ if (t.startsWith("-") && t !== "-")
1319
+ continue;
1320
+ const isGrepPatternPosition = name === "grep" && !grepPatternSuppliedByFlag && !sawNonFlagOperand;
1321
+ sawNonFlagOperand = true;
1322
+ if (isGrepPatternPosition)
1323
+ continue;
1324
+ if (t === "-") {
1325
+ hasStdinDash = true;
1326
+ break;
1327
+ }
1328
+ }
1329
+ }
1330
+ if (floor !== undefined && hasStdinDash) {
1331
+ return `"${name}" reads stdin via an explicit "-" argument and would block until the tool timeout — not auto-allowed`;
1332
+ }
1303
1333
  if (floor !== undefined && nonOption.length < floor) {
1304
1334
  return `"${name}" with no file argument reads stdin and would block until the tool timeout — not auto-allowed`;
1305
1335
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/core",
3
- "version": "1.444.0",
3
+ "version": "1.446.0",
4
4
  "description": "Stateless, task-oriented AI agent core",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",