@crewx/sdk 0.9.0-rc.100 → 0.9.0-rc.102

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.
@@ -32,6 +32,13 @@ export interface FinalizeTaskStopOptions {
32
32
  terminalReason?: TaskTerminalReason;
33
33
  durationMs?: number | null;
34
34
  }
35
+ export interface FinalizeTaskForHostShutdownOptions {
36
+ id: string;
37
+ expectedRunEpoch: number;
38
+ workspaceId?: string | null;
39
+ completedAt?: string;
40
+ }
41
+ export type FinalizeTaskForHostShutdownOutcome = 'settled' | 'not_running' | 'epoch_mismatch' | 'workspace_mismatch';
35
42
  export type TaskListRow = Pick<TaskRow, 'id' | 'thread_id' | 'agent_id' | 'status' | 'parent_task_id' | 'started_at' | 'completed_at' | 'duration_ms' | 'input_tokens' | 'output_tokens' | 'cost_usd' | 'error'>;
36
43
  export type TaskActivityLogRow = Pick<TaskRow, 'id' | 'thread_id' | 'agent_id' | 'parent_task_id' | 'started_at' | 'completed_at'>;
37
44
  export type FindTasksByThreadOptions = {
@@ -140,6 +147,7 @@ export interface ThreadChain {
140
147
  targetAgentTurnCount: number;
141
148
  turns: ThreadChainTurn[];
142
149
  }
150
+ export declare const HOST_SHUTDOWN_TERMINAL_ERROR = "Stopped by app shutdown";
143
151
  type TaskUsageColumns = Pick<TaskRow, 'input_tokens' | 'output_tokens' | 'cached_input_tokens' | 'cost_usd'>;
144
152
  export declare function mergeTerminalReason(metadataJson: string | null | undefined, reason: TaskTerminalReason): string;
145
153
  export declare function hasRecordedUsage(task: TaskUsageColumns): boolean;
@@ -172,6 +180,7 @@ export declare class TaskRepository extends BaseSqliteRepository {
172
180
  }): TaskStopRequestResult;
173
181
  private requestTaskStopForInstruction;
174
182
  finalizeTaskStop(opts: FinalizeTaskStopOptions): boolean;
183
+ finalizeTaskForHostShutdown(opts: FinalizeTaskForHostShutdownOptions): FinalizeTaskForHostShutdownOutcome;
175
184
  stopTask(id: string, options?: StopTaskOptions): Promise<StopTaskResult>;
176
185
  stopTaskGenerationForInstruction(options: StopTaskGenerationForInstructionOptions): Promise<StopTaskResult>;
177
186
  startTask(opts: {
@@ -8,7 +8,7 @@ export declare function isAllowed(_command: string, _policy: ExecPolicy): boolea
8
8
  export declare function setAuditVerbose(_enabled: boolean): void;
9
9
  export declare function logExecAudit(_entry: {
10
10
  command: string;
11
- status: 'allowed' | 'denied' | 'error' | 'reused';
11
+ status: 'allowed' | 'denied' | 'error' | 'reused' | 'in-process';
12
12
  allowed_by?: string;
13
13
  reason?: string;
14
14
  duration_ms?: number;
@@ -8,7 +8,7 @@ export declare function isAllowed(command: string, policy: ExecPolicy): boolean;
8
8
  export declare function setAuditVerbose(enabled: boolean): void;
9
9
  export declare function logExecAudit(entry: {
10
10
  command: string;
11
- status: 'allowed' | 'denied' | 'error' | 'reused';
11
+ status: 'allowed' | 'denied' | 'error' | 'reused' | 'in-process';
12
12
  allowed_by?: string;
13
13
  reason?: string;
14
14
  duration_ms?: number;
@@ -24,10 +24,17 @@ export interface ExecReuseMetrics {
24
24
  reusedCalls: number;
25
25
  actualMs: number;
26
26
  reusedMs: number;
27
+ inProcessCalls: number;
28
+ inProcessMs: number;
27
29
  }
30
+ export type PromptListResolver = (argv: readonly string[], ctx: {
31
+ cwd: string;
32
+ env: Record<string, string>;
33
+ }) => string | undefined;
28
34
  export interface ExecReuseScope {
29
35
  readonly cache: Map<string, string>;
30
36
  readonly metrics: ExecReuseMetrics;
37
+ readonly listResolver?: PromptListResolver;
31
38
  }
32
39
  export interface TemplateRenderOptions {
33
40
  execReuseScope?: ExecReuseScope;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewx/sdk",
3
- "version": "0.9.0-rc.100",
3
+ "version": "0.9.0-rc.102",
4
4
  "license": "UNLICENSED",
5
5
  "engines": {
6
6
  "node": ">=20.19.0"