mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-21 01:51:39 -06:00
e2ec8283c4
* refactor(deadcode): trim auto-reply and CLI exports * refactor(deadcode): trim cron and task exports * refactor(deadcode): trim fleet and process exports * test(deadcode): exercise live task and process seams * test(fleet): cover stream redaction through owner module * refactor(security): trim dead internal exports * refactor(secrets): trim dead internal exports * refactor(deadcode): trim remaining src exports * refactor(deadcode): remove test-only runtime exports * refactor(deadcode): trim pairing test exports * refactor(deadcode): reconcile refreshed baseline * test(auto-reply): deduplicate queue state imports
94 lines
2.3 KiB
TypeScript
94 lines
2.3 KiB
TypeScript
// Defines commitment records, kinds, and scheduling state.
|
|
export type CommitmentKind = "event_check_in" | "deadline_check" | "care_check_in" | "open_loop";
|
|
|
|
export type CommitmentSensitivity = "routine" | "personal" | "care";
|
|
|
|
export type CommitmentStatus = "pending" | "sent" | "dismissed" | "snoozed" | "expired";
|
|
|
|
export type CommitmentSource = "inferred_user_context" | "agent_promise";
|
|
|
|
export type CommitmentScope = {
|
|
agentId: string;
|
|
sessionKey: string;
|
|
channel: string;
|
|
accountId?: string;
|
|
to?: string;
|
|
threadId?: string;
|
|
senderId?: string;
|
|
};
|
|
|
|
type CommitmentDueWindow = {
|
|
earliestMs: number;
|
|
latestMs: number;
|
|
timezone: string;
|
|
};
|
|
|
|
export type CommitmentRecord = CommitmentScope & {
|
|
id: string;
|
|
kind: CommitmentKind;
|
|
sensitivity: CommitmentSensitivity;
|
|
source: CommitmentSource;
|
|
status: CommitmentStatus;
|
|
reason: string;
|
|
suggestedText: string;
|
|
dedupeKey: string;
|
|
confidence: number;
|
|
dueWindow: CommitmentDueWindow;
|
|
sourceMessageId?: string;
|
|
sourceRunId?: string;
|
|
/** @deprecated Legacy-only field from early stores. Do not replay this into delivery prompts. */
|
|
sourceUserText?: string;
|
|
/** @deprecated Legacy-only field from early stores. Do not replay this into delivery prompts. */
|
|
sourceAssistantText?: string;
|
|
createdAtMs: number;
|
|
updatedAtMs: number;
|
|
attempts: number;
|
|
lastAttemptAtMs?: number;
|
|
sentAtMs?: number;
|
|
dismissedAtMs?: number;
|
|
snoozedUntilMs?: number;
|
|
expiredAtMs?: number;
|
|
};
|
|
|
|
export type CommitmentStoreFile = {
|
|
version: 1;
|
|
commitments: CommitmentRecord[];
|
|
};
|
|
|
|
export type CommitmentCandidate = {
|
|
itemId: string;
|
|
kind: CommitmentKind;
|
|
sensitivity: CommitmentSensitivity;
|
|
source: CommitmentSource;
|
|
reason: string;
|
|
suggestedText: string;
|
|
dedupeKey: string;
|
|
confidence: number;
|
|
dueWindow: {
|
|
earliest: string;
|
|
latest?: string;
|
|
timezone?: string;
|
|
};
|
|
};
|
|
|
|
export type CommitmentExtractionItem = CommitmentScope & {
|
|
itemId: string;
|
|
nowMs: number;
|
|
timezone: string;
|
|
userText: string;
|
|
assistantText?: string;
|
|
sourceMessageId?: string;
|
|
sourceRunId?: string;
|
|
existingPending: Array<{
|
|
kind: CommitmentKind;
|
|
reason: string;
|
|
dedupeKey: string;
|
|
earliestMs: number;
|
|
latestMs: number;
|
|
}>;
|
|
};
|
|
|
|
export type CommitmentExtractionBatchResult = {
|
|
candidates: CommitmentCandidate[];
|
|
};
|