@codetreker/daynight 0.21.9 → 0.21.13
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/README.md +359 -27
- package/dist/api/client.d.ts +4 -1
- package/dist/api/client.js +18 -1
- package/dist/api/client.js.map +1 -1
- package/dist/api/parse.d.ts +3 -1
- package/dist/api/parse.js +27 -0
- package/dist/api/parse.js.map +1 -1
- package/dist/api/types.d.ts +18 -3
- package/dist/cli/commands.js +2 -0
- package/dist/cli/commands.js.map +1 -1
- package/dist/commands/skill/skills/using-daynight/references/handoff.md +3 -3
- package/dist/commands/worker/cleanup.d.ts +6 -0
- package/dist/commands/worker/cleanup.js +173 -0
- package/dist/commands/worker/cleanup.js.map +1 -0
- package/dist/commands/worker/config.d.ts +21 -0
- package/dist/commands/worker/config.js +144 -0
- package/dist/commands/worker/config.js.map +1 -0
- package/dist/commands/worker/control.d.ts +55 -0
- package/dist/commands/worker/control.js +151 -0
- package/dist/commands/worker/control.js.map +1 -0
- package/dist/commands/worker/coordinator.d.ts +35 -0
- package/dist/commands/worker/coordinator.js +548 -0
- package/dist/commands/worker/coordinator.js.map +1 -0
- package/dist/commands/worker/definition.d.ts +2 -0
- package/dist/commands/worker/definition.js +50 -0
- package/dist/commands/worker/definition.js.map +1 -0
- package/dist/commands/worker/diagnostics.d.ts +20 -0
- package/dist/commands/worker/diagnostics.js +56 -0
- package/dist/commands/worker/diagnostics.js.map +1 -0
- package/dist/commands/worker/execution.d.ts +41 -0
- package/dist/commands/worker/execution.js +318 -0
- package/dist/commands/worker/execution.js.map +1 -0
- package/dist/commands/worker/herdr/agents.d.ts +186 -0
- package/dist/commands/worker/herdr/agents.js +726 -0
- package/dist/commands/worker/herdr/agents.js.map +1 -0
- package/dist/commands/worker/herdr/arguments.d.ts +8 -0
- package/dist/commands/worker/herdr/arguments.js +58 -0
- package/dist/commands/worker/herdr/arguments.js.map +1 -0
- package/dist/commands/worker/herdr/codex-input.d.ts +2 -0
- package/dist/commands/worker/herdr/codex-input.js +35 -0
- package/dist/commands/worker/herdr/codex-input.js.map +1 -0
- package/dist/commands/worker/herdr/command.d.ts +22 -0
- package/dist/commands/worker/herdr/command.js +115 -0
- package/dist/commands/worker/herdr/command.js.map +1 -0
- package/dist/commands/worker/herdr/instance.d.ts +56 -0
- package/dist/commands/worker/herdr/instance.js +322 -0
- package/dist/commands/worker/herdr/instance.js.map +1 -0
- package/dist/commands/worker/herdr/preflight.d.ts +40 -0
- package/dist/commands/worker/herdr/preflight.js +251 -0
- package/dist/commands/worker/herdr/preflight.js.map +1 -0
- package/dist/commands/worker/herdr/rpc.d.ts +29 -0
- package/dist/commands/worker/herdr/rpc.js +186 -0
- package/dist/commands/worker/herdr/rpc.js.map +1 -0
- package/dist/commands/worker/herdr.d.ts +95 -0
- package/dist/commands/worker/herdr.js +35 -0
- package/dist/commands/worker/herdr.js.map +1 -0
- package/dist/commands/worker/index.d.ts +18 -0
- package/dist/commands/worker/index.js +58 -0
- package/dist/commands/worker/index.js.map +1 -0
- package/dist/commands/worker/instance-lock.d.ts +5 -0
- package/dist/commands/worker/instance-lock.js +11 -1
- package/dist/commands/worker/instance-lock.js.map +1 -1
- package/dist/commands/worker/prompts.d.ts +4 -0
- package/dist/commands/worker/prompts.js +64 -0
- package/dist/commands/worker/prompts.js.map +1 -0
- package/dist/commands/worker/remote.d.ts +23 -0
- package/dist/commands/worker/remote.js +146 -0
- package/dist/commands/worker/remote.js.map +1 -0
- package/dist/commands/worker/runtime.d.ts +16 -0
- package/dist/commands/worker/runtime.js +384 -0
- package/dist/commands/worker/runtime.js.map +1 -0
- package/dist/commands/worker/store.d.ts +73 -5
- package/dist/commands/worker/store.js +475 -36
- package/dist/commands/worker/store.js.map +1 -1
- package/dist/commands/worker/types.d.ts +37 -1
- package/dist/commands/worker/worktrees.d.ts +1 -0
- package/dist/commands/worker/worktrees.js +9 -0
- package/dist/commands/worker/worktrees.js.map +1 -1
- package/dist/config/document.d.ts +1 -1
- package/dist/config/document.js +1 -0
- package/dist/config/document.js.map +1 -1
- package/dist/platform/instance-lock.d.ts +4 -0
- package/dist/platform/instance-lock.js +9 -1
- package/dist/platform/instance-lock.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,28 +1,74 @@
|
|
|
1
1
|
import type { WorkerHerdr } from "../../api/types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { HerdrLaunchEvidence, HerdrStopObservation, HerdrTaskBinding, HerdrWorkspaceEvidence } from "./herdr/agents.js";
|
|
3
|
+
import type { ClaimAttempt, ClaimIdentity, CleanupState, ControlIntent, ExecutionSummary, FrozenExecutionConfiguration, LocalTask, NativeExecutionState, NativeSessionReference, PendingClaim, PendingConfiguration, ProjectIdentity, WorkerProject, WorkerProjectRecord, WorktreeBinding } from "./types.js";
|
|
4
|
+
export declare const isUnstartedPendingSource: (task: LocalTask) => boolean;
|
|
5
|
+
export declare const isUnstartedPending: (task: LocalTask) => boolean;
|
|
3
6
|
export declare const openWorkerStore: (databaseFile: string, options?: {
|
|
4
7
|
busyTimeoutMs?: number;
|
|
5
8
|
}) => {
|
|
6
9
|
close: () => void;
|
|
7
|
-
getProject: (identity: ProjectIdentity) =>
|
|
8
|
-
listProjects: () =>
|
|
9
|
-
registerProject: (project: WorkerProject) =>
|
|
10
|
+
getProject: (identity: ProjectIdentity) => WorkerProjectRecord | null;
|
|
11
|
+
listProjects: () => WorkerProjectRecord[];
|
|
12
|
+
registerProject: (project: WorkerProject) => WorkerProjectRecord;
|
|
13
|
+
getClaimAttempt: (identity: ProjectIdentity) => ClaimAttempt | null;
|
|
14
|
+
listClaimAttempts: () => (ProjectIdentity & {
|
|
15
|
+
attempt: ClaimAttempt;
|
|
16
|
+
})[];
|
|
17
|
+
beginClaimAttempt: (identity: ProjectIdentity, input: ClaimAttempt) => ClaimAttempt;
|
|
18
|
+
rejectClaimAttempt: (identity: ProjectIdentity, expectedClaimId: string, proof: {
|
|
19
|
+
definiteRejection: true;
|
|
20
|
+
} | {
|
|
21
|
+
notSubmitted: true;
|
|
22
|
+
}) => void;
|
|
10
23
|
getTask: (identity: ClaimIdentity) => LocalTask | null;
|
|
11
24
|
listTasks: () => LocalTask[];
|
|
12
25
|
listUnfinishedTasks: () => LocalTask[];
|
|
13
|
-
|
|
26
|
+
recordObservedUnattemptedWorkspace: (owner: PendingClaim, now: number) => LocalTask | null;
|
|
27
|
+
registerPending: (claim: PendingClaim, input: PendingConfiguration, now: number, verifiedUserId?: string | null) => LocalTask;
|
|
28
|
+
bindUserScope: (identity: ClaimIdentity, userId: string, now: number) => LocalTask;
|
|
14
29
|
restoreOriginalConfiguration: (identity: ClaimIdentity, configuration: FrozenExecutionConfiguration, now: number) => LocalTask;
|
|
15
30
|
activateTask: (identity: ClaimIdentity, now: number) => LocalTask;
|
|
31
|
+
activatePausedRecovery: (identity: ClaimIdentity, reason: string, now: number) => LocalTask;
|
|
16
32
|
bindWorktree: (identity: ClaimIdentity, binding: WorktreeBinding, now: number) => LocalTask;
|
|
17
33
|
bindHerdr: (identity: ClaimIdentity, binding: WorkerHerdr, now: number) => LocalTask;
|
|
34
|
+
bindHerdrExecution: (identity: ClaimIdentity, binding: HerdrTaskBinding, workspaceEvidence: HerdrWorkspaceEvidence | null, now: number) => LocalTask;
|
|
35
|
+
markWorkspaceSubmitting: (identity: ClaimIdentity, now: number) => LocalTask;
|
|
36
|
+
recordWorkspaceNotSubmitted: (identity: ClaimIdentity, proof: {
|
|
37
|
+
notSubmitted: true;
|
|
38
|
+
} | {
|
|
39
|
+
definiteRejection: true;
|
|
40
|
+
}, now: number) => LocalTask;
|
|
41
|
+
markNativeLaunchSubmitting: (identity: ClaimIdentity, now: number) => LocalTask;
|
|
42
|
+
recordNativeLaunchNotSubmitted: (identity: ClaimIdentity, proof: {
|
|
43
|
+
notSubmitted: true;
|
|
44
|
+
} | {
|
|
45
|
+
definiteRejection: true;
|
|
46
|
+
}, now: number) => LocalTask;
|
|
47
|
+
markNativePromptSubmitting: (identity: ClaimIdentity, now: number) => LocalTask;
|
|
48
|
+
recordNativeStartOutcome: (identity: ClaimIdentity, input: {
|
|
49
|
+
launchEvidence?: HerdrLaunchEvidence;
|
|
50
|
+
promptSubmission: NativeExecutionState["promptSubmission"];
|
|
51
|
+
}, now: number) => LocalTask;
|
|
52
|
+
recordStopObservation: (identity: ClaimIdentity, observation: HerdrStopObservation, now: number) => LocalTask;
|
|
53
|
+
markExecutionSummarySubmitting: (identity: ClaimIdentity, input: Omit<ExecutionSummary, "submission">, now: number) => LocalTask;
|
|
54
|
+
recordExecutionSummaryOutcome: (identity: ClaimIdentity, expectedVersion: string, submission: "confirmed" | "rejected", now: number) => LocalTask;
|
|
55
|
+
recordExecutionSummaryNotSubmitted: (identity: ClaimIdentity, expectedVersion: string, proof: {
|
|
56
|
+
notSubmitted: true;
|
|
57
|
+
}, now: number) => LocalTask;
|
|
58
|
+
reconcileExecutionSummary: (identity: ClaimIdentity, input: Omit<ExecutionSummary, "submission">, now: number) => LocalTask;
|
|
18
59
|
rebindHerdr: (identity: ClaimIdentity, expectedPrevious: WorkerHerdr, next: WorkerHerdr, proof: {
|
|
19
60
|
originalAgentStopped: true;
|
|
20
61
|
oldWorkspaceClosed: true;
|
|
21
62
|
}, now: number) => LocalTask;
|
|
63
|
+
rebindHerdrExecution: (identity: ClaimIdentity, expectedPrevious: HerdrTaskBinding, next: HerdrTaskBinding, workspaceEvidence: HerdrWorkspaceEvidence | null, proof: {
|
|
64
|
+
originalAgentStopped: true;
|
|
65
|
+
oldWorkspaceClosed: true;
|
|
66
|
+
}, now: number) => LocalTask;
|
|
22
67
|
bindNativeSession: (identity: ClaimIdentity, reference: NativeSessionReference, now: number) => LocalTask;
|
|
23
68
|
pauseTask: (identity: ClaimIdentity, reason: string, now: number) => LocalTask;
|
|
24
69
|
clearPause: (identity: ClaimIdentity, now: number) => LocalTask;
|
|
25
70
|
authorizeRecoveryRetry: (identity: ClaimIdentity, now: number) => LocalTask;
|
|
71
|
+
authorizeRecoveryRetryAtCount: (identity: ClaimIdentity, expectedCount: number, now: number) => LocalTask;
|
|
26
72
|
beginRecovery: (identity: ClaimIdentity, now: number) => LocalTask;
|
|
27
73
|
beginCleanup: (identity: ClaimIdentity, input: {
|
|
28
74
|
kind: CleanupState["kind"];
|
|
@@ -30,6 +76,7 @@ export declare const openWorkerStore: (databaseFile: string, options?: {
|
|
|
30
76
|
}, now: number) => LocalTask;
|
|
31
77
|
markCleanupInputSubmitting: (identity: ClaimIdentity, now: number) => LocalTask;
|
|
32
78
|
recordCleanupInputOutcome: (identity: ClaimIdentity, input: "submitted" | "rejected" | "unavailable", now: number) => LocalTask;
|
|
79
|
+
recordCleanupInputEvidence: (identity: ClaimIdentity, baseline: NonNullable<CleanupState["baseline"]>, now: number) => LocalTask;
|
|
33
80
|
recordCleanupResult: (identity: ClaimIdentity, result: NonNullable<CleanupState["result"]>, error: string | null, now: number) => LocalTask;
|
|
34
81
|
recordCleanupError: (identity: ClaimIdentity, error: string, now: number) => LocalTask;
|
|
35
82
|
confirmAgentStopped: (identity: ClaimIdentity, proof: {
|
|
@@ -43,13 +90,34 @@ export declare const openWorkerStore: (databaseFile: string, options?: {
|
|
|
43
90
|
}, now: number) => LocalTask;
|
|
44
91
|
resumeAfterShutdown: (identity: ClaimIdentity, now: number) => LocalTask;
|
|
45
92
|
recordControlIntent: (identity: ClaimIdentity, input: ControlIntent, now: number) => LocalTask;
|
|
93
|
+
replaceRejectedControlIntent: (identity: ClaimIdentity, input: ControlIntent, proof: {
|
|
94
|
+
observedVersion: bigint;
|
|
95
|
+
}, now: number) => LocalTask;
|
|
96
|
+
confirmUnstartedControlCleanup: (identity: ClaimIdentity, proof: {
|
|
97
|
+
completeHerdrInventory: true;
|
|
98
|
+
noOwnedResources: true;
|
|
99
|
+
}, deadline: number, now: number) => LocalTask;
|
|
46
100
|
markControlSubmitting: (identity: ClaimIdentity, expectedVersion: bigint, now: number) => LocalTask;
|
|
47
101
|
confirmControlApplied: (identity: ClaimIdentity, resultVersion: bigint, now: number) => LocalTask;
|
|
48
102
|
confirmControlOwnershipEnded: (identity: ClaimIdentity, proof: {
|
|
49
103
|
completeOwnClaimInventory: true;
|
|
50
104
|
claimAbsent: true;
|
|
51
105
|
}, now: number) => LocalTask;
|
|
106
|
+
confirmControlOwnershipEndedByTask: (identity: ClaimIdentity, proof: {
|
|
107
|
+
observedClaimId: string | null;
|
|
108
|
+
observedState: "active" | "released" | "completed" | null;
|
|
109
|
+
}, now: number) => LocalTask;
|
|
110
|
+
completeAppliedControl: (identity: ClaimIdentity, expectedIntent: ControlIntent, resultVersion: bigint, now: number) => LocalTask;
|
|
111
|
+
completeEndedControl: (identity: ClaimIdentity, expectedIntent: ControlIntent, proof: {
|
|
112
|
+
observedClaimId: string | null;
|
|
113
|
+
observedState: "active" | "released" | "completed" | null;
|
|
114
|
+
}, now: number) => LocalTask;
|
|
52
115
|
rejectControlSubmission: (identity: ClaimIdentity, error: string, now: number) => LocalTask;
|
|
53
116
|
completeTask: (identity: ClaimIdentity, now: number) => LocalTask;
|
|
117
|
+
completeUnstartedPending: (identity: ClaimIdentity, proof: {
|
|
118
|
+
completeOwnClaimInventory: true;
|
|
119
|
+
claimAbsent: true;
|
|
120
|
+
authenticatedUserId: string;
|
|
121
|
+
}, now: number) => LocalTask;
|
|
54
122
|
};
|
|
55
123
|
export type WorkerStore = ReturnType<typeof openWorkerStore>;
|