@crewx/sdk 0.9.0-rc.98 → 0.9.0-rc.99
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/desktop/index.js +3 -3
- package/dist/esm/desktop/index.js +3 -3
- package/dist/esm/index.js +147 -147
- package/dist/esm/plugins/index.js +125 -125
- package/dist/esm/process/index.js +1 -1
- package/dist/esm/repository/index.js +85 -85
- package/dist/index.d.ts +2 -2
- package/dist/index.js +147 -147
- package/dist/lifecycle/task-stop.d.ts +31 -1
- package/dist/plugins/index.js +125 -125
- package/dist/process/index.js +1 -1
- package/dist/process/process-control.d.ts +1 -0
- package/dist/repository/index.d.ts +2 -2
- package/dist/repository/index.js +84 -84
- package/dist/repository/task.repository.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TaskRepository } from '../repository/task.repository.js';
|
|
1
|
+
import type { FinalizeTaskStopOptions, TaskRepository, TaskRow, TaskStopRequestResult } from '../repository/task.repository.js';
|
|
2
2
|
import { checkProcessOwnershipAsync as defaultCheckProcessOwnershipAsync, terminateProcessTree as defaultTerminateProcessTree, type ProcessControlOptions } from '../process/process-control.js';
|
|
3
3
|
export declare const TASK_STOP_DEFAULT_GRACE_MS = 5000;
|
|
4
4
|
export declare const TASK_STOP_DEFAULT_POLL_MS = 250;
|
|
@@ -24,7 +24,37 @@ export interface StopTaskOptions {
|
|
|
24
24
|
processControl?: StopTaskProcessControl;
|
|
25
25
|
processControlOptions?: ProcessControlOptions;
|
|
26
26
|
}
|
|
27
|
+
export interface StopTaskGenerationForInstructionOptions {
|
|
28
|
+
taskId: string;
|
|
29
|
+
targetPid: number | null | undefined;
|
|
30
|
+
sourceRunEpoch: number;
|
|
31
|
+
settleRunEpoch: number;
|
|
32
|
+
workspaceId?: string | null;
|
|
33
|
+
platform?: NodeJS.Platform;
|
|
34
|
+
ownershipMarkers?: readonly string[];
|
|
35
|
+
processControl?: StopTaskProcessControl;
|
|
36
|
+
processControlOptions?: ProcessControlOptions;
|
|
37
|
+
}
|
|
38
|
+
export declare const INSTRUCTION_STOP_TARGET_PID_MISSING = "INSTRUCTION_STOP_TARGET_PID_MISSING";
|
|
39
|
+
export declare const INSTRUCTION_STOP_EPOCH_MISMATCH = "INSTRUCTION_STOP_EPOCH_MISMATCH";
|
|
40
|
+
export declare const INSTRUCTION_STOP_WORKSPACE_MISMATCH = "INSTRUCTION_STOP_WORKSPACE_MISMATCH";
|
|
41
|
+
export declare const INSTRUCTION_STOP_GENERATION_ALREADY_SETTLED = "INSTRUCTION_STOP_GENERATION_ALREADY_SETTLED";
|
|
42
|
+
export declare const INSTRUCTION_STOP_PROCESS_TERMINATION_FAILED = "INSTRUCTION_STOP_PROCESS_TERMINATION_FAILED";
|
|
43
|
+
export declare const INSTRUCTION_STOP_SETTLE_CAS_FAILED = "INSTRUCTION_STOP_SETTLE_CAS_FAILED";
|
|
44
|
+
export declare const INSTRUCTION_STOP_REQUEST_FAILED = "INSTRUCTION_STOP_REQUEST_FAILED";
|
|
27
45
|
type StopTaskRepository = Pick<TaskRepository, 'requestTaskStop' | 'stopPendingTask' | 'getTask' | 'finalizeTaskStop'>;
|
|
46
|
+
interface InstructionStopRepository {
|
|
47
|
+
requestTaskStop: (options: {
|
|
48
|
+
id: string;
|
|
49
|
+
requestedAt: string;
|
|
50
|
+
sourceRunEpoch: number;
|
|
51
|
+
settleRunEpoch: number;
|
|
52
|
+
workspaceId?: string | null;
|
|
53
|
+
}) => TaskStopRequestResult;
|
|
54
|
+
getTask: (taskId: string) => TaskRow | undefined;
|
|
55
|
+
finalizeTaskStop: (options: FinalizeTaskStopOptions) => boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare function stopTaskGenerationForInstruction(repo: InstructionStopRepository, options: StopTaskGenerationForInstructionOptions): Promise<StopTaskResult>;
|
|
28
58
|
export declare function stopTask(taskId: string, options?: StopTaskOptions): Promise<StopTaskResult>;
|
|
29
59
|
export declare function stopTask(repo: StopTaskRepository, taskId: string, options?: StopTaskOptions): Promise<StopTaskResult>;
|
|
30
60
|
export {};
|