toolroll 0.9.53 → 0.9.54
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/CHANGELOG.md +8 -0
- package/dist/chat-ask.js +8 -8
- package/dist/chat-core.d.ts +171 -0
- package/dist/chat-core.js +288 -0
- package/dist/chat-decide.d.ts +10 -8
- package/dist/chat-decide.js +26 -21
- package/dist/chat-delivery-state.d.ts +51 -75
- package/dist/chat-delivery-state.js +140 -170
- package/dist/chat-delivery.d.ts +21 -2
- package/dist/chat-delivery.js +313 -194
- package/dist/chat-flow.d.ts +29 -1
- package/dist/chat-flow.js +24 -50
- package/dist/chat-messages.d.ts +319 -0
- package/dist/chat-messages.js +841 -0
- package/dist/chat-migration.d.ts +30 -0
- package/dist/chat-migration.js +802 -0
- package/dist/chat-quiet.d.ts +3 -0
- package/dist/chat-quiet.js +5 -0
- package/dist/contracts/chat-content.d.ts +71 -2
- package/dist/contracts/chat-content.js +22 -3
- package/dist/contracts/chat-tables.d.ts +11 -4
- package/dist/contracts/chat-tables.js +165 -87
- package/dist/contracts/discord-callback.js +2 -1
- package/dist/contracts/slack-callback.js +3 -2
- package/dist/contracts/store-json.d.ts +1 -5
- package/dist/contracts/store-json.js +1 -4
- package/dist/contracts/teams-callback.js +2 -1
- package/dist/discord-chat.js +19 -38
- package/dist/discord-settings.js +4 -13
- package/dist/discord.js +4 -14
- package/dist/export.js +4 -4
- package/dist/mate-tools.js +3 -2
- package/dist/modes.d.ts +13 -1
- package/dist/modes.js +17 -1
- package/dist/notification-rows.d.ts +30 -0
- package/dist/notification-rows.js +102 -0
- package/dist/operate.js +5 -2
- package/dist/plane-review.js +5 -11
- package/dist/project-delete.js +21 -26
- package/dist/result-shots.js +2 -2
- package/dist/retention.js +1 -1
- package/dist/server/settings.js +5 -4
- package/dist/slack-api.d.ts +5 -1
- package/dist/slack-api.js +2 -2
- package/dist/slack-chat.d.ts +9 -4
- package/dist/slack-chat.js +29 -52
- package/dist/slack-settings.js +6 -15
- package/dist/slack.js +6 -16
- package/dist/store.d.ts +97 -364
- package/dist/store.js +207 -1531
- package/dist/teammate-question.js +12 -12
- package/dist/teams-chat.js +12 -9
- package/dist/teams-settings.js +2 -2
- package/dist/teams.js +4 -5
- package/dist/telegram-flow.js +5 -5
- package/dist/telegram.js +4 -4
- package/dist/toolroll-update.d.ts +10 -0
- package/dist/toolroll-update.js +50 -3
- package/dist/workspace-revision.js +3 -1
- package/package.json +1 -1
- package/dist/slack-state.d.ts +0 -13
- package/dist/slack-state.js +0 -10
package/dist/store.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { type ChatBinding } from "./chat-core.js";
|
|
2
|
+
import { ChatMessages, TELEGRAM_HOLD_REASONS, TELEGRAM_SKIPPED_ELSEWHERE, TELEGRAM_SKIPPED_OTHER_CHAT, TELEGRAM_SKIPPED_QUIET } from "./chat-messages.js";
|
|
3
|
+
import { isLifecycleNotification, isTelegramProgressNotification, LIFECYCLE_KEY_PREFIX, LIFECYCLE_KINDS, proposalTaskOf, type LifecycleKind } from "./notification-rows.js";
|
|
1
4
|
import { ServerTelemetry } from "./server-telemetry.js";
|
|
2
5
|
import type { DecisionOption } from "./contracts/decision.js";
|
|
3
6
|
import { type SavedToolAction, type SavedToolRule } from "./contracts/store-json.js";
|
|
@@ -67,7 +70,7 @@ export declare const MATE_ASK_SCHEMA = "\nCREATE TABLE IF NOT EXISTS mate_ask (\
|
|
|
67
70
|
* person (shown on the card, and read again by every chat app that delivers it); telegram_flow_choice is one opaque button
|
|
68
71
|
* per option for one visit of one card, placed on the message it rides. A reply to that message is the note
|
|
69
72
|
* (telegram_flow_prompt, mode send-back). The chat apps keep their buttons beside their messages (chat-delivery-state.ts). */
|
|
70
|
-
export declare const FLOW_SEND_SCHEMA = "\nCREATE TABLE IF NOT EXISTS flow_send (\n card INTEGER NOT NULL REFERENCES flow_card(id),\n entry INTEGER NOT NULL,\n stage TEXT NOT NULL,\n person TEXT NOT NULL,\n content_json TEXT NOT NULL,\n created_at TEXT NOT NULL,\n PRIMARY KEY (card, entry)\n);\
|
|
73
|
+
export declare const FLOW_SEND_SCHEMA = "\nCREATE TABLE IF NOT EXISTS flow_send (\n card INTEGER NOT NULL REFERENCES flow_card(id),\n entry INTEGER NOT NULL,\n stage TEXT NOT NULL,\n person TEXT NOT NULL,\n content_json TEXT NOT NULL,\n created_at TEXT NOT NULL,\n PRIMARY KEY (card, entry)\n);\n";
|
|
71
74
|
/** An owner's lasting choice to approve plans and merges from their paired chat (chat-approval.ts), for all their
|
|
72
75
|
* projects (scope '*') or one (its path), with the limits they agreed to. Off unless a row says on; a project's own row
|
|
73
76
|
* outranks the all-projects one. `generation` is the account's at the change: a reset password ends it. */
|
|
@@ -76,9 +79,6 @@ export declare const FLOW_SEND_SCHEMA = "\nCREATE TABLE IF NOT EXISTS flow_send
|
|
|
76
79
|
* a finished run's row goes with the live log's own retention (sweepRunActivity). */
|
|
77
80
|
export declare const RUN_ACTIVITY_SCHEMA = "\nCREATE TABLE IF NOT EXISTS run_activity (\n run INTEGER PRIMARY KEY REFERENCES run(id) ON DELETE CASCADE,\n kind TEXT NOT NULL CHECK (kind IN ('session','message','edit','command','read','search','lookup','plan','delegate','tool')),\n at TEXT NOT NULL\n);\n";
|
|
78
81
|
export declare const CHAT_APPROVAL_SCHEMA = "\nCREATE TABLE IF NOT EXISTS chat_approval_setting (\n approver TEXT NOT NULL,\n scope TEXT NOT NULL,\n enabled INTEGER NOT NULL CHECK (enabled IN (0,1)),\n full_access INTEGER NOT NULL DEFAULT 0 CHECK (full_access IN (0,1)),\n attempt_cap_microusd INTEGER CHECK (attempt_cap_microusd IS NULL OR attempt_cap_microusd >= 0),\n generation INTEGER NOT NULL,\n digest TEXT NOT NULL,\n updated_by TEXT NOT NULL,\n updated_at TEXT NOT NULL,\n PRIMARY KEY (approver, scope)\n);\n";
|
|
79
|
-
/** The second tap on a flow decision in Telegram (telegram-flow.ts): Approve arms Yes and Cancel, bound to the binding,
|
|
80
|
-
* chat, message and exact visit of the card; Yes decides it once. */
|
|
81
|
-
export declare const TELEGRAM_FLOW_CONFIRM_SCHEMA = "\nCREATE TABLE IF NOT EXISTS telegram_flow_confirm (\n token TEXT PRIMARY KEY,\n binding INTEGER NOT NULL,\n chat_id TEXT NOT NULL,\n message_id TEXT NOT NULL,\n card INTEGER NOT NULL,\n entry INTEGER NOT NULL,\n phase TEXT NOT NULL CHECK (phase IN ('yes','cancel')),\n created_at TEXT NOT NULL,\n expires_at TEXT NOT NULL,\n consumed_at TEXT\n);\nCREATE INDEX IF NOT EXISTS telegram_flow_confirm_visit ON telegram_flow_confirm (card, entry);\n";
|
|
82
82
|
export declare const CHAT_DECIDE_SCHEMA = "\nCREATE TABLE IF NOT EXISTS chat_decide_action (\n token TEXT PRIMARY KEY,\n channel TEXT NOT NULL,\n binding INTEGER NOT NULL,\n chat TEXT NOT NULL,\n message TEXT,\n act TEXT NOT NULL CHECK (act IN ('accept','changes','retry','approve','not-now','merge')),\n phase TEXT NOT NULL CHECK (phase IN ('offer','yes','cancel')),\n task_id TEXT NOT NULL,\n run INTEGER,\n digest TEXT NOT NULL,\n created_at TEXT NOT NULL,\n expires_at TEXT NOT NULL,\n consumed_at TEXT\n);\nCREATE INDEX IF NOT EXISTS chat_decide_action_message ON chat_decide_action (channel, chat, message);\nCREATE TABLE IF NOT EXISTS chat_decide_prompt (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n channel TEXT NOT NULL,\n binding INTEGER NOT NULL,\n chat TEXT NOT NULL,\n task_id TEXT NOT NULL,\n run INTEGER NOT NULL,\n digest TEXT NOT NULL,\n message TEXT,\n created_at TEXT NOT NULL,\n expires_at TEXT NOT NULL,\n consumed_at TEXT\n);\nCREATE INDEX IF NOT EXISTS chat_decide_prompt_open ON chat_decide_prompt (channel, binding, consumed_at);\n";
|
|
83
83
|
export type MateAsk = {
|
|
84
84
|
turn: number;
|
|
@@ -152,7 +152,7 @@ export type SealedLedgerEntry = LedgerEntry & {
|
|
|
152
152
|
hash: string;
|
|
153
153
|
} | null;
|
|
154
154
|
};
|
|
155
|
-
export declare const SCHEMA_VERSION =
|
|
155
|
+
export declare const SCHEMA_VERSION = 116;
|
|
156
156
|
/** v115: the tables migrateToV115 drops. */
|
|
157
157
|
export declare const V115_DROPPED_TABLES: readonly string[];
|
|
158
158
|
/**
|
|
@@ -180,7 +180,10 @@ export declare const V115_DROPPED_TABLES: readonly string[];
|
|
|
180
180
|
* the routine was approved and running). Its other changes add a column or
|
|
181
181
|
* settle rows in place; a database whose removed features still held a hold
|
|
182
182
|
* to lift or place changes that table's rows and is refused, so it takes the
|
|
183
|
-
* separate procedure.
|
|
183
|
+
* separate procedure. v116 is the next declared exception: every row of the 70 old
|
|
184
|
+
* per-app chat tables moves into the shared chat tables keyed by provider, in one
|
|
185
|
+
* transaction that checks each count before the old tables are dropped; the
|
|
186
|
+
* rehearsal checks each moved table's rows arrived (HISTORY_RULES).
|
|
184
187
|
*/
|
|
185
188
|
export declare const UPDATE_SAFE_MIGRATIONS: readonly number[];
|
|
186
189
|
/** Whether a database settled at `version` reaches this build's schema through update-safe migrations alone. */
|
|
@@ -778,14 +781,6 @@ export type FlowTriggerRow = {
|
|
|
778
781
|
updatedAt: string;
|
|
779
782
|
};
|
|
780
783
|
export type FlowEventOutcome = "created" | "ok" | "fail" | "moved" | "approved" | "sent-back" | "cancelled";
|
|
781
|
-
/** The one task a card is about: a task its confirmation created (a new
|
|
782
|
-
* task, a revision), else the task it names (and, for feedback on a result,
|
|
783
|
-
* that result). Null for a card about no single task. A pointer for
|
|
784
|
-
* replies, never an authority. */
|
|
785
|
-
export declare function proposalTaskOf(proposal: MateProposal | null): {
|
|
786
|
-
task: string;
|
|
787
|
-
run: number | null;
|
|
788
|
-
} | null;
|
|
789
784
|
export type MateTurn = {
|
|
790
785
|
id: number;
|
|
791
786
|
approver: string;
|
|
@@ -862,23 +857,6 @@ type NotificationInput = {
|
|
|
862
857
|
/** v83: one person's notification — only their own phone, chats and browsers get it; no channel-wide webhook does. */
|
|
863
858
|
recipient?: string;
|
|
864
859
|
};
|
|
865
|
-
/**
|
|
866
|
-
* Task lifecycle updates (Telegram task updates, 2026-09-16): the CLOSED
|
|
867
|
-
* vocabulary of routine progress facts the shared mutations record beside
|
|
868
|
-
* the change that made them true. None carries a push class — they are
|
|
869
|
-
* digest-eligible progress, never a page — and every one is project-bound
|
|
870
|
-
* through the task it names. A decision, incident, gap, stall, publication
|
|
871
|
-
* or merge page keeps its own producer; nothing here repeats one.
|
|
872
|
-
*/
|
|
873
|
-
export declare const LIFECYCLE_KINDS: readonly ["task-filed", "scope-approved", "approval-withdrawn", "task-held", "task-released", "task-queued", "task-requeued", "task-cancelled", "run-started", "run-phase", "check-progress", "run-finished", "run-stopping", "run-stopped", "run-resumed", "review-requested", "review-finished", "acceptance-evidence", "acceptance-ready"];
|
|
874
|
-
export type LifecycleKind = (typeof LIFECYCLE_KINDS)[number];
|
|
875
|
-
/** Every lifecycle dedupe key starts here: `life:<kind>:<identity>:<ordinal>`. */
|
|
876
|
-
export declare const LIFECYCLE_KEY_PREFIX = "life:";
|
|
877
|
-
/** A progress fact, told apart by its durable key — never by display text. */
|
|
878
|
-
export declare function isLifecycleNotification(row: Pick<Notification, "dedupeKey">): boolean;
|
|
879
|
-
/** Only known progress producers can repaint a card. Decisions and urgent
|
|
880
|
-
* incidents keep their own alerts; a routine retry updates its saved attempt. */
|
|
881
|
-
export declare function isTelegramProgressNotification(row: Pick<Notification, "dedupeKey" | "kind" | "pushClass" | "run">): boolean;
|
|
882
860
|
/** A fact that wants a person, durably. */
|
|
883
861
|
export type Notification = {
|
|
884
862
|
id: number;
|
|
@@ -3985,6 +3963,8 @@ export declare class Store {
|
|
|
3985
3963
|
resolveEpisodes(prefix: string, now: Date): number;
|
|
3986
3964
|
notificationById(id: number): Notification | null;
|
|
3987
3965
|
notificationsAfter(id: number, limit?: number): Notification[];
|
|
3966
|
+
/** What landed before a pairing (and at or before `through`) and still wants that person (WANTED_BEFORE_PAIRING). */
|
|
3967
|
+
notificationsWantedBefore(created: string, through: number, limit?: number): Notification[];
|
|
3988
3968
|
listNotifications(only?: "pending" | "all"): Notification[];
|
|
3989
3969
|
/**
|
|
3990
3970
|
* Close a gap's notification episode. Called when its capability verifies:
|
|
@@ -4791,7 +4771,9 @@ export declare class Store {
|
|
|
4791
4771
|
resolveIncident(id: number, by: string, now: Date): boolean;
|
|
4792
4772
|
/** The body, for callers already holding the transaction (requeueTask). */
|
|
4793
4773
|
private resolveIncidentLocked;
|
|
4794
|
-
/**
|
|
4774
|
+
/** The shared chat core, bound to Telegram: the same pairing, rooms and worker rules every chat app keeps. */
|
|
4775
|
+
telegramChat(): ChatMessages;
|
|
4776
|
+
/** Mint a pairing code's record. The code itself was shown once; this is its hash. A Telegram code works on its bot. */
|
|
4795
4777
|
createTelegramPairing(pairing: {
|
|
4796
4778
|
codeHash: string;
|
|
4797
4779
|
approver: string;
|
|
@@ -4799,14 +4781,15 @@ export declare class Store {
|
|
|
4799
4781
|
ttlMs: number;
|
|
4800
4782
|
}, now: Date): void;
|
|
4801
4783
|
/**
|
|
4802
|
-
* Consume a pairing code and create the binding, as one transaction
|
|
4784
|
+
* Consume a pairing code and create the binding, as one transaction, by the rules every chat app shares
|
|
4785
|
+
* (ChatCore.consumePairing): a replay of the very update that paired finds its finished binding.
|
|
4803
4786
|
*
|
|
4804
|
-
*
|
|
4805
|
-
*
|
|
4806
|
-
* that
|
|
4807
|
-
*
|
|
4808
|
-
*
|
|
4809
|
-
* the
|
|
4787
|
+
* A person's FIRST pairing starts from now (Telegram task updates): every ROUTINE fact already in the outbox is
|
|
4788
|
+
* history for this destination — settled here, in the pairing's own transaction, with a receipt that says it was
|
|
4789
|
+
* skipped, never sent as a backlog to a phone that just arrived. The skip is explicit: no delivered_at, no attempt,
|
|
4790
|
+
* only the `skipped:` receipt — a message no phone received is never reported as delivered (see TELEGRAM_UNSETTLED).
|
|
4791
|
+
* An open decision or an attention-class fact still wants a person and stays pending. A re-pairing after a
|
|
4792
|
+
* revocation keeps the older promise instead: what no phone ever received still waits for whenever pairing happens.
|
|
4810
4793
|
*/
|
|
4811
4794
|
consumeTelegramPairing(attempt: {
|
|
4812
4795
|
codeHash: string;
|
|
@@ -4825,13 +4808,7 @@ export declare class Store {
|
|
|
4825
4808
|
/** The live team-conversation row for one chat, group or private. */
|
|
4826
4809
|
telegramTeamChat(botId: string, chatId: string): TelegramTeamChat | null;
|
|
4827
4810
|
listTelegramTeamChats(botId: string): TelegramTeamChat[];
|
|
4828
|
-
/**
|
|
4829
|
-
* Point a chat at a team conversation: an earlier choice for the same chat
|
|
4830
|
-
* is revoked in the same transaction, and delivery starts from now — the
|
|
4831
|
-
* conversation's history is read in the console, never replayed into a
|
|
4832
|
-
* chat that just arrived. A group already following another conversation
|
|
4833
|
-
* elsewhere, or a conversation already followed by another group, refuses.
|
|
4834
|
-
*/
|
|
4811
|
+
/** Point a chat at a team conversation (ChatCore.bindRoom: the same rule in every chat app). */
|
|
4835
4812
|
bindTelegramTeamChat(args: {
|
|
4836
4813
|
botId: string;
|
|
4837
4814
|
chatId: string;
|
|
@@ -4850,11 +4827,9 @@ export declare class Store {
|
|
|
4850
4827
|
/** Forward only: a cursor never moves back, and a revoked row keeps its last position. */
|
|
4851
4828
|
advanceTelegramTeamCursor(id: number, messageId: number): boolean;
|
|
4852
4829
|
/**
|
|
4853
|
-
* Every live binding for a bot, oldest first — and only while each
|
|
4854
|
-
*
|
|
4855
|
-
*
|
|
4856
|
-
* failure direction that fails closed. Several teammates may each hold
|
|
4857
|
-
* one (v72); nothing here ranks them.
|
|
4830
|
+
* Every live binding for a bot, oldest first — and only while each approver's credential generation still matches.
|
|
4831
|
+
* A rotation that somehow missed the sweep reads as no binding at all, which is the failure direction that fails
|
|
4832
|
+
* closed. Several teammates may each hold one (v72); nothing here ranks them.
|
|
4858
4833
|
*/
|
|
4859
4834
|
liveTelegramBindings(botId: string): TelegramBinding[];
|
|
4860
4835
|
/** The live binding one Telegram user holds with a bot, if any. */
|
|
@@ -4868,130 +4843,41 @@ export declare class Store {
|
|
|
4868
4843
|
/** Revoke every live binding one person holds with a bot, and everything
|
|
4869
4844
|
* those chats could still do. Teammates' bindings are untouched. */
|
|
4870
4845
|
unpairTelegram(botId: string, by: string, now: Date): boolean;
|
|
4871
|
-
createTelegramAction(
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
/** Which decision an outbound Telegram message carried. Recorded after the
|
|
4884
|
-
* send returns its id; a send whose record was lost routes nothing. */
|
|
4885
|
-
recordTelegramDecisionMessage(binding: number, chatId: string, messageId: string, decision: number, now: Date): void;
|
|
4886
|
-
/** The decision behind an exact replied-to message, or nothing. Never "the latest". */
|
|
4887
|
-
decisionForTelegramMessage(binding: number, chatId: string, messageId: string): number | null;
|
|
4888
|
-
/** The one live, unexpired draft for a decision, if any. */
|
|
4889
|
-
liveNoteDraft(binding: number, decision: number, now: Date): {
|
|
4890
|
-
id: number;
|
|
4891
|
-
note: string;
|
|
4892
|
-
updateId: number;
|
|
4893
|
-
state: string;
|
|
4894
|
-
} | null;
|
|
4895
|
-
/**
|
|
4896
|
-
* Persist a validated note as the live draft. A newer update SUPERSEDES
|
|
4897
|
-
* the old draft — drafts are immutable, and only a GREATER update_id may
|
|
4898
|
-
* replace one, so out-of-order delivery cannot resurrect an older note
|
|
4899
|
-
* (Codex free-text review, state machine). Returns false when an older
|
|
4900
|
-
* or equal update tried.
|
|
4901
|
-
*/
|
|
4902
|
-
saveNoteDraft(draft: {
|
|
4903
|
-
binding: number;
|
|
4904
|
-
decision: number;
|
|
4905
|
-
updateId: number;
|
|
4906
|
-
messageId: string;
|
|
4907
|
-
replyTo: string;
|
|
4908
|
-
note: string;
|
|
4909
|
-
}, now: Date, ttlMs?: number): boolean;
|
|
4910
|
-
/** Move a draft between states; the caller owns the transaction story. */
|
|
4911
|
-
setNoteDraftState(id: number, state: "pending" | "armed" | "superseded" | "consumed" | "discarded"): void;
|
|
4912
|
-
createTelegramFlowActions(at: {
|
|
4913
|
-
binding: number;
|
|
4914
|
-
chatId: string;
|
|
4915
|
-
card: number;
|
|
4916
|
-
entry: number;
|
|
4917
|
-
}, actions: readonly {
|
|
4918
|
-
token: string;
|
|
4919
|
-
action: TelegramFlowAction["action"];
|
|
4920
|
-
}[], now: Date, days?: number): void;
|
|
4921
|
-
getTelegramFlowAction(token: string): TelegramFlowAction | null;
|
|
4922
|
-
placeTelegramFlowActions(tokens: readonly string[], messageId: string): void;
|
|
4923
|
-
/** Retire every button (and prompt) for one visit of a card: it was decided, or its draft replaced. */
|
|
4924
|
-
retireTelegramFlowVisit(card: number, entry: number, now: Date): void;
|
|
4925
|
-
recordTelegramFlowPrompt(prompt: TelegramFlowPrompt, now: Date, hours?: number): void;
|
|
4926
|
-
/** The live prompt a message replies to, if any. */
|
|
4927
|
-
telegramFlowPrompt(chatId: string, messageId: string, now: Date): TelegramFlowPrompt | null;
|
|
4846
|
+
createTelegramAction(...args: Parameters<ChatMessages["createDecisionAction"]>): ReturnType<ChatMessages["createDecisionAction"]>;
|
|
4847
|
+
recordTelegramDecisionMessage(...args: Parameters<ChatMessages["recordDecisionMessage"]>): ReturnType<ChatMessages["recordDecisionMessage"]>;
|
|
4848
|
+
decisionForTelegramMessage(...args: Parameters<ChatMessages["decisionForMessage"]>): ReturnType<ChatMessages["decisionForMessage"]>;
|
|
4849
|
+
liveNoteDraft(...args: Parameters<ChatMessages["liveNoteDraft"]>): ReturnType<ChatMessages["liveNoteDraft"]>;
|
|
4850
|
+
saveNoteDraft(...args: Parameters<ChatMessages["saveNoteDraft"]>): ReturnType<ChatMessages["saveNoteDraft"]>;
|
|
4851
|
+
setNoteDraftState(...args: Parameters<ChatMessages["setNoteDraftState"]>): ReturnType<ChatMessages["setNoteDraftState"]>;
|
|
4852
|
+
createTelegramFlowActions(...args: Parameters<ChatMessages["createFlowActions"]>): ReturnType<ChatMessages["createFlowActions"]>;
|
|
4853
|
+
getTelegramFlowAction(...args: Parameters<ChatMessages["flowAction"]>): ReturnType<ChatMessages["flowAction"]>;
|
|
4854
|
+
placeTelegramFlowActions(...args: Parameters<ChatMessages["placeFlowActions"]>): ReturnType<ChatMessages["placeFlowActions"]>;
|
|
4855
|
+
retireTelegramFlowVisit(...args: Parameters<ChatMessages["retireFlowVisit"]>): ReturnType<ChatMessages["retireFlowVisit"]>;
|
|
4856
|
+
recordTelegramFlowPrompt(...args: Parameters<ChatMessages["recordFlowPrompt"]>): ReturnType<ChatMessages["recordFlowPrompt"]>;
|
|
4857
|
+
telegramFlowPrompt(...args: Parameters<ChatMessages["flowPrompt"]>): ReturnType<ChatMessages["flowPrompt"]>;
|
|
4928
4858
|
/** What one visit sent: recorded once, the first time (a later pass finds it kept). */
|
|
4929
4859
|
recordFlowSend(row: Omit<FlowSendRow, "createdAt">, now: Date): boolean;
|
|
4930
4860
|
flowSend(card: number, entry: number): FlowSendRow | null;
|
|
4931
4861
|
/** Every visit's send for a card, newest first: what the card shows it sent. */
|
|
4932
4862
|
flowSends(card: number): FlowSendRow[];
|
|
4933
|
-
createTelegramFlowChoices(
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
card: number;
|
|
4937
|
-
entry: number;
|
|
4938
|
-
}, choices: readonly {
|
|
4939
|
-
token: string;
|
|
4940
|
-
choice: number;
|
|
4941
|
-
label: string;
|
|
4942
|
-
}[], now: Date, days?: number): void;
|
|
4943
|
-
getTelegramFlowChoice(token: string): TelegramFlowChoice | null;
|
|
4944
|
-
placeTelegramFlowChoices(tokens: readonly string[], messageId: string): void;
|
|
4945
|
-
/** Retire every choice button for one visit of a card (and its reply prompt): it was chosen, or the card moved on. */
|
|
4863
|
+
createTelegramFlowChoices(...args: Parameters<ChatMessages["createFlowChoices"]>): ReturnType<ChatMessages["createFlowChoices"]>;
|
|
4864
|
+
getTelegramFlowChoice(...args: Parameters<ChatMessages["flowChoice"]>): ReturnType<ChatMessages["flowChoice"]>;
|
|
4865
|
+
placeTelegramFlowChoices(...args: Parameters<ChatMessages["placeFlowChoices"]>): ReturnType<ChatMessages["placeFlowChoices"]>;
|
|
4946
4866
|
/** A choice was made (or the card moved on): every option button, reply prompt and "Use this as your note?" for that
|
|
4947
|
-
* visit is spent, in
|
|
4867
|
+
* visit is spent, in every chat app, whichever place it was made in. */
|
|
4948
4868
|
retireFlowChoices(card: number, entry: number, now: Date): void;
|
|
4949
|
-
createTelegramQuestionActions(
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
choice: string | null;
|
|
4962
|
-
chatId: string;
|
|
4963
|
-
messageId: string | null;
|
|
4964
|
-
expiresAt: string;
|
|
4965
|
-
consumedAt: string | null;
|
|
4966
|
-
} | null;
|
|
4967
|
-
placeTelegramQuestionActions(tokens: readonly string[], messageId: string): void;
|
|
4968
|
-
/** Retire every button and prompt for a question: it was answered (anywhere). */
|
|
4969
|
-
retireTelegramQuestion(question: number, now: Date): void;
|
|
4970
|
-
recordTelegramQuestionPrompt(prompt: {
|
|
4971
|
-
chatId: string;
|
|
4972
|
-
messageId: string;
|
|
4973
|
-
binding: number;
|
|
4974
|
-
question: number;
|
|
4975
|
-
}, now: Date, hours?: number): void;
|
|
4976
|
-
telegramQuestionPrompt(chatId: string, messageId: string, now: Date): {
|
|
4977
|
-
chatId: string;
|
|
4978
|
-
messageId: string;
|
|
4979
|
-
binding: number;
|
|
4980
|
-
question: number;
|
|
4981
|
-
} | null;
|
|
4982
|
-
getTelegramAction(token: string): TelegramAction | null;
|
|
4983
|
-
/**
|
|
4984
|
-
* Kill every live confirm/cancel challenge on a decision. Cancel means
|
|
4985
|
-
* cancelled: a confirm that survived its own cancellation would be an
|
|
4986
|
-
* irreversible choice still armed after the person said stop.
|
|
4987
|
-
*/
|
|
4988
|
-
consumeTelegramChallenges(decision: number, now: Date): void;
|
|
4989
|
-
/** Consume once. False means somebody already did, or it expired — either way, no. */
|
|
4990
|
-
consumeTelegramAction(token: string, now: Date): boolean;
|
|
4991
|
-
/** Stamp the message a choose-action's keyboard actually landed on. */
|
|
4992
|
-
placeTelegramActions(tokens: readonly string[], messageId: string): void;
|
|
4993
|
-
/**
|
|
4994
|
-
* Take or renew the bridge's poll lease. One live poller per bot: cron
|
|
4869
|
+
createTelegramQuestionActions(...args: Parameters<ChatMessages["createQuestionActions"]>): ReturnType<ChatMessages["createQuestionActions"]>;
|
|
4870
|
+
getTelegramQuestionAction(...args: Parameters<ChatMessages["questionAction"]>): ReturnType<ChatMessages["questionAction"]>;
|
|
4871
|
+
placeTelegramQuestionActions(...args: Parameters<ChatMessages["placeQuestionActions"]>): ReturnType<ChatMessages["placeQuestionActions"]>;
|
|
4872
|
+
retireTelegramQuestion(...args: Parameters<ChatMessages["retireQuestion"]>): ReturnType<ChatMessages["retireQuestion"]>;
|
|
4873
|
+
recordTelegramQuestionPrompt(...args: Parameters<ChatMessages["recordQuestionPrompt"]>): ReturnType<ChatMessages["recordQuestionPrompt"]>;
|
|
4874
|
+
telegramQuestionPrompt(...args: Parameters<ChatMessages["questionPrompt"]>): ReturnType<ChatMessages["questionPrompt"]>;
|
|
4875
|
+
getTelegramAction(...args: Parameters<ChatMessages["decisionAction"]>): ReturnType<ChatMessages["decisionAction"]>;
|
|
4876
|
+
consumeTelegramChallenges(...args: Parameters<ChatMessages["consumeChallenges"]>): ReturnType<ChatMessages["consumeChallenges"]>;
|
|
4877
|
+
consumeTelegramAction(...args: Parameters<ChatMessages["consumeDecisionAction"]>): ReturnType<ChatMessages["consumeDecisionAction"]>;
|
|
4878
|
+
placeTelegramActions(...args: Parameters<ChatMessages["placeDecisionActions"]>): ReturnType<ChatMessages["placeDecisionActions"]>;
|
|
4879
|
+
/**
|
|
4880
|
+
* Take or renew the bridge's poll lease (ChatCore.acquire). One live poller per bot: cron
|
|
4995
4881
|
* overlapping a follower gets `bridge-busy`, an expired holder is taken
|
|
4996
4882
|
* over at the next generation, and the cursor rides the lease so a stale
|
|
4997
4883
|
* generation can neither poll nor move it.
|
|
@@ -5731,10 +5617,7 @@ export declare class Store {
|
|
|
5731
5617
|
reason: string;
|
|
5732
5618
|
}[];
|
|
5733
5619
|
} | null;
|
|
5734
|
-
|
|
5735
|
-
* it is about that task (and that result, when it showed one). A message
|
|
5736
|
-
* edited to show something else forgets it. */
|
|
5737
|
-
recordTelegramTaskMessage(binding: TelegramBinding, messageId: string, taskId: string | null, run: number | null, now: Date): void;
|
|
5620
|
+
recordTelegramTaskMessage(...args: Parameters<ChatMessages["recordTaskMessage"]>): ReturnType<ChatMessages["recordTaskMessage"]>;
|
|
5738
5621
|
/** The approver's live personal threads that have messages, most recent
|
|
5739
5622
|
* first — the chat list. Team conversations list themselves. */
|
|
5740
5623
|
listMateThreads(approver: string, limit?: number): MateThreadSummary[];
|
|
@@ -6379,15 +6262,9 @@ export declare class Store {
|
|
|
6379
6262
|
recordProjectConcurrency(by: string, repo: string, before: number, after: number, now: Date): void;
|
|
6380
6263
|
/** Review 827: a project's demo URL changed (`off` when it has none). */
|
|
6381
6264
|
recordProjectDemo(by: string, repo: string, before: string | null, after: string | null, now: Date): void;
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
/** v98: pushed updates waiting for the bridge, oldest first. */
|
|
6386
|
-
telegramInbox(botId: string, limit: number): {
|
|
6387
|
-
updateId: number;
|
|
6388
|
-
payload: string;
|
|
6389
|
-
}[];
|
|
6390
|
-
dropTelegramInbox(updateId: number): void;
|
|
6265
|
+
queueTelegramUpdate(...args: Parameters<ChatMessages["queueUpdate"]>): ReturnType<ChatMessages["queueUpdate"]>;
|
|
6266
|
+
telegramInbox(...args: Parameters<ChatMessages["inbox"]>): ReturnType<ChatMessages["inbox"]>;
|
|
6267
|
+
dropTelegramInbox(...args: Parameters<ChatMessages["dropInbox"]>): ReturnType<ChatMessages["dropInbox"]>;
|
|
6391
6268
|
/** v98: where Telegram pushes this bot's updates (null: the bridge asks for them), and what's wrong, if anything. */
|
|
6392
6269
|
setTelegramPush(botId: string, state: {
|
|
6393
6270
|
url: string | null;
|
|
@@ -6398,164 +6275,43 @@ export declare class Store {
|
|
|
6398
6275
|
problem: string | null;
|
|
6399
6276
|
at: string | null;
|
|
6400
6277
|
} | null;
|
|
6278
|
+
/** Forward only, and only under the live generation. A stale poller moves nothing. */
|
|
6401
6279
|
advanceBridgeCursor(botId: string, owner: string, generation: number, cursor: number, now: Date): boolean;
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
/**
|
|
6429
|
-
* Bind the session a turn is about to be dispatched under, BEFORE the
|
|
6430
|
-
* dispatch: the engine receipts the request inside that session, so a
|
|
6431
|
-
* later attempt — after a crash, even after the session was ended and
|
|
6432
|
-
* replaced from the console — reads the receipt where it was written
|
|
6433
|
-
* instead of resolving today's session and finding nothing there.
|
|
6434
|
-
*/
|
|
6435
|
-
bindTelegramConversationSession(id: number, owner: string, session: number): boolean;
|
|
6436
|
-
/** Bind the admitted turn to its row as soon as the engine's receipt names it. */
|
|
6437
|
-
bindTelegramConversationTurn(id: number, owner: string, session: number, turn: number): boolean;
|
|
6438
|
-
/**
|
|
6439
|
-
* Settle a claimed row: done or failed with its outcome word, or back to
|
|
6440
|
-
* queued for a later attempt (a busy engine). Only the claim holder may;
|
|
6441
|
-
* a lapsed claim settles nothing, so a reclaimer's outcome stands.
|
|
6442
|
-
*/
|
|
6443
|
-
finishTelegramConversation(id: number, owner: string, result: {
|
|
6444
|
-
state: "done" | "failed";
|
|
6445
|
-
outcome: string;
|
|
6446
|
-
replyMessageId?: string | null;
|
|
6447
|
-
} | {
|
|
6448
|
-
state: "queued";
|
|
6449
|
-
outcome: string;
|
|
6450
|
-
nextAttemptAt: string;
|
|
6451
|
-
}, now: Date): boolean;
|
|
6452
|
-
/**
|
|
6453
|
-
* Replies the assistant wrote that still have not reached the person
|
|
6454
|
-
* `since` ago or longer (status and the console show them with a Retry):
|
|
6455
|
-
* the message's row, whose it is, when the oldest unsent part was
|
|
6456
|
-
* written, and the last send error.
|
|
6457
|
-
*/
|
|
6458
|
-
unsentTelegramReplies(botId: string | null, approver: string | null, since: Date): {
|
|
6459
|
-
conversation: number;
|
|
6460
|
-
approver: string;
|
|
6461
|
-
since: string;
|
|
6462
|
-
error: string | null;
|
|
6463
|
-
}[];
|
|
6464
|
-
/** Send unsent replies on the next bridge pass instead of waiting out their backoff; returns how many. */
|
|
6465
|
-
retryTelegramReplies(approver: string | null, now: Date): number;
|
|
6466
|
-
/**
|
|
6467
|
-
* Persist the whole outbound half of a turn — every reply part and every
|
|
6468
|
-
* card, with the cards' tokens already minted — in one transaction, BEFORE
|
|
6469
|
-
* any send. Only the claim holder may, and only once: a row that already
|
|
6470
|
-
* has parts keeps them (a retry resumes, never re-plans). The turn's
|
|
6471
|
-
* identity rides the row too, so the parts answer to exactly that turn.
|
|
6472
|
-
*/
|
|
6473
|
-
planTelegramConversationParts(id: number, owner: string, turn: {
|
|
6474
|
-
session: number;
|
|
6475
|
-
turn: number;
|
|
6476
|
-
}, parts: readonly TelegramConversationPartPlan[], now: Date): boolean;
|
|
6477
|
-
listTelegramConversationParts(conversation: number): TelegramConversationPart[];
|
|
6478
|
-
/**
|
|
6479
|
-
* Settle one send attempt under the row's claim. A confirmed message id
|
|
6480
|
-
* is the only success: the part is sent, and a reply part's id becomes
|
|
6481
|
-
* the row's reply id. Anything else leaves the part pending with its
|
|
6482
|
-
* attempt counted, its error named, its next attempt scheduled, and —
|
|
6483
|
-
* when the answer was lost rather than refused — its uncertainty counted.
|
|
6484
|
-
* A lapsed claim settles nothing, so a reclaimer's outcome stands.
|
|
6485
|
-
*/
|
|
6486
|
-
settleTelegramConversationPart(conversation: number, ordinal: number, owner: string, outcome: {
|
|
6487
|
-
ok: true;
|
|
6488
|
-
messageId: string;
|
|
6489
|
-
} | {
|
|
6490
|
-
ok: false;
|
|
6491
|
-
error: string;
|
|
6492
|
-
uncertain: boolean;
|
|
6493
|
-
retryAt: string;
|
|
6494
|
-
}, now: Date): boolean;
|
|
6495
|
-
/** A card whose proposal no longer waits (confirmed or dismissed from another surface, or gone) is moot: dropped with the reason, never sent. */
|
|
6496
|
-
dropTelegramConversationPart(conversation: number, ordinal: number, owner: string, reason: string, now: Date): boolean;
|
|
6497
|
-
/** The exact task/run bindings of one outbound message this bot sent: a
|
|
6498
|
-
* plain fact names one, a digest part may name several, (v64) a confirmed
|
|
6499
|
-
* result image names its exact task and run, the lead's reply names the
|
|
6500
|
-
* task its turn was about, a card names its task, and (v79) a status
|
|
6501
|
-
* message names the task it showed. */
|
|
6502
|
-
telegramMessageBindings(binding: TelegramBinding, messageId: string): {
|
|
6503
|
-
taskId: string | null;
|
|
6504
|
-
taskRef: number | null;
|
|
6505
|
-
run: number | null;
|
|
6506
|
-
project: string | null;
|
|
6507
|
-
}[];
|
|
6508
|
-
createTelegramProposalAction(action: {
|
|
6509
|
-
token: string;
|
|
6510
|
-
binding: number;
|
|
6511
|
-
proposal: number;
|
|
6512
|
-
phase: TelegramProposalAction["phase"];
|
|
6513
|
-
chatId: string;
|
|
6514
|
-
messageId?: string;
|
|
6515
|
-
ttlMs?: number;
|
|
6516
|
-
}, now: Date): void;
|
|
6517
|
-
getTelegramProposalAction(token: string): TelegramProposalAction | null;
|
|
6518
|
-
/** Consume once. False means somebody already did, or it expired. */
|
|
6519
|
-
consumeTelegramProposalAction(token: string, now: Date): boolean;
|
|
6520
|
-
/** Kill every live token on a proposal — after it resolves, or when a challenge is cancelled. */
|
|
6521
|
-
consumeTelegramProposalActions(proposal: number, now: Date, phases?: readonly TelegramProposalAction["phase"][]): void;
|
|
6522
|
-
/** Stamp the message a card's keyboard actually landed on. */
|
|
6523
|
-
placeTelegramProposalActions(tokens: readonly string[], messageId: string): void;
|
|
6524
|
-
telegramDestination(binding: TelegramBinding): string;
|
|
6525
|
-
/** A progress card belongs to one builder result, including its root review.
|
|
6526
|
-
* Do not combine planners, correction children, or separate build attempts. */
|
|
6527
|
-
telegramProgressRun(row: Pick<Notification, "taskRef" | "run">): Run | null;
|
|
6528
|
-
/** Reuse a confirmed message in this exact destination. A mixed digest,
|
|
6529
|
-
* decision, image, or message naming another attempt is never editable. The
|
|
6530
|
-
* outbound history survives a restart even if the final receipt was lost. */
|
|
6531
|
-
telegramProgressMessage(binding: TelegramBinding, result: Run): string | null;
|
|
6532
|
-
/** The existing outbox, with a separate receipt for this exact pairing. */
|
|
6533
|
-
claimTelegramDeliveries(binding: TelegramBinding, owner: string, ttlMs: number, now: Date, only?: "all" | "urgent"): TelegramDelivery[];
|
|
6280
|
+
markTelegramUpdateApplied(...args: Parameters<ChatMessages["markUpdateApplied"]>): ReturnType<ChatMessages["markUpdateApplied"]>;
|
|
6281
|
+
enqueueTelegramConversation(...args: Parameters<ChatMessages["enqueueMessage"]>): ReturnType<ChatMessages["enqueueMessage"]>;
|
|
6282
|
+
telegramConversationWaitingOn(...args: Parameters<ChatMessages["messageWaitingOn"]>): ReturnType<ChatMessages["messageWaitingOn"]>;
|
|
6283
|
+
getTelegramConversation(...args: Parameters<ChatMessages["getMessage"]>): ReturnType<ChatMessages["getMessage"]>;
|
|
6284
|
+
listTelegramConversations(...args: Parameters<ChatMessages["listMessages"]>): ReturnType<ChatMessages["listMessages"]>;
|
|
6285
|
+
claimTelegramConversation(...args: Parameters<ChatMessages["claimMessage"]>): ReturnType<ChatMessages["claimMessage"]>;
|
|
6286
|
+
renewTelegramConversation(...args: Parameters<ChatMessages["renewMessage"]>): ReturnType<ChatMessages["renewMessage"]>;
|
|
6287
|
+
bindTelegramConversationSession(...args: Parameters<ChatMessages["bindMessageSession"]>): ReturnType<ChatMessages["bindMessageSession"]>;
|
|
6288
|
+
bindTelegramConversationTurn(...args: Parameters<ChatMessages["bindMessageTurn"]>): ReturnType<ChatMessages["bindMessageTurn"]>;
|
|
6289
|
+
finishTelegramConversation(...args: Parameters<ChatMessages["finishMessage"]>): ReturnType<ChatMessages["finishMessage"]>;
|
|
6290
|
+
unsentTelegramReplies(...args: Parameters<ChatMessages["unsentReplies"]>): ReturnType<ChatMessages["unsentReplies"]>;
|
|
6291
|
+
retryTelegramReplies(...args: Parameters<ChatMessages["retryReplies"]>): ReturnType<ChatMessages["retryReplies"]>;
|
|
6292
|
+
planTelegramConversationParts(...args: Parameters<ChatMessages["planReplyParts"]>): ReturnType<ChatMessages["planReplyParts"]>;
|
|
6293
|
+
listTelegramConversationParts(...args: Parameters<ChatMessages["replyParts"]>): ReturnType<ChatMessages["replyParts"]>;
|
|
6294
|
+
settleTelegramConversationPart(...args: Parameters<ChatMessages["settleReplyPart"]>): ReturnType<ChatMessages["settleReplyPart"]>;
|
|
6295
|
+
dropTelegramConversationPart(...args: Parameters<ChatMessages["dropReplyPart"]>): ReturnType<ChatMessages["dropReplyPart"]>;
|
|
6296
|
+
telegramMessageBindings(...args: Parameters<ChatMessages["messageBindings"]>): ReturnType<ChatMessages["messageBindings"]>;
|
|
6297
|
+
createTelegramProposalAction(...args: Parameters<ChatMessages["createProposalAction"]>): ReturnType<ChatMessages["createProposalAction"]>;
|
|
6298
|
+
getTelegramProposalAction(...args: Parameters<ChatMessages["proposalAction"]>): ReturnType<ChatMessages["proposalAction"]>;
|
|
6299
|
+
consumeTelegramProposalAction(...args: Parameters<ChatMessages["consumeProposalAction"]>): ReturnType<ChatMessages["consumeProposalAction"]>;
|
|
6300
|
+
consumeTelegramProposalActions(...args: Parameters<ChatMessages["consumeProposalActions"]>): ReturnType<ChatMessages["consumeProposalActions"]>;
|
|
6301
|
+
placeTelegramProposalActions(...args: Parameters<ChatMessages["placeProposalActions"]>): ReturnType<ChatMessages["placeProposalActions"]>;
|
|
6302
|
+
telegramDestination(...args: Parameters<ChatMessages["destination"]>): ReturnType<ChatMessages["destination"]>;
|
|
6303
|
+
telegramProgressRun(...args: Parameters<ChatMessages["progressRun"]>): ReturnType<ChatMessages["progressRun"]>;
|
|
6304
|
+
telegramProgressMessage(...args: Parameters<ChatMessages["progressMessage"]>): ReturnType<ChatMessages["progressMessage"]>;
|
|
6305
|
+
claimTelegramDeliveries(...args: Parameters<ChatMessages["claimDeliveries"]>): ReturnType<ChatMessages["claimDeliveries"]>;
|
|
6534
6306
|
telegramRetryAt(botId: string): string;
|
|
6535
6307
|
deferTelegram(botId: string, until: string): void;
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
telegramMessageOf(notification: number, destination: string): string | null;
|
|
6544
|
-
finalizeTelegramDelivery(row: TelegramDelivery, binding: TelegramBinding, owner: string, outcome: {
|
|
6545
|
-
ok: true;
|
|
6546
|
-
receipt: string | null;
|
|
6547
|
-
} | {
|
|
6548
|
-
ok: false;
|
|
6549
|
-
error: string;
|
|
6550
|
-
retryAt?: string;
|
|
6551
|
-
}, now: Date): boolean;
|
|
6552
|
-
/** The notifications this pairing holds, each with its delivery state there. */
|
|
6553
|
-
telegramDeliveries(binding: TelegramBinding): NotificationReceipt[];
|
|
6554
|
-
/** The digest cadence: null everyMs = off. */
|
|
6555
|
-
telegramDigest(): TelegramDigest;
|
|
6556
|
-
/** Set (or clear, with null) the cadence. Turning it on starts the
|
|
6557
|
-
* window NOW — nothing held before the choice is dumped at once. */
|
|
6558
|
-
setTelegramDigest(everyMs: number | null, by: string, now: Date): void;
|
|
6308
|
+
telegramDeliveryProblem(...args: Parameters<ChatMessages["deliveryProblem"]>): ReturnType<ChatMessages["deliveryProblem"]>;
|
|
6309
|
+
recordTelegramMessage(...args: Parameters<ChatMessages["recordMessage"]>): ReturnType<ChatMessages["recordMessage"]>;
|
|
6310
|
+
telegramMessageOf(...args: Parameters<ChatMessages["messageOf"]>): ReturnType<ChatMessages["messageOf"]>;
|
|
6311
|
+
finalizeTelegramDelivery(...args: Parameters<ChatMessages["finalizeDelivery"]>): ReturnType<ChatMessages["finalizeDelivery"]>;
|
|
6312
|
+
telegramDeliveries(...args: Parameters<ChatMessages["deliveries"]>): ReturnType<ChatMessages["deliveries"]>;
|
|
6313
|
+
telegramDigest(...args: Parameters<ChatMessages["digest"]>): ReturnType<ChatMessages["digest"]>;
|
|
6314
|
+
setTelegramDigest(...args: Parameters<ChatMessages["setDigest"]>): ReturnType<ChatMessages["setDigest"]>;
|
|
6559
6315
|
/** How chats reach this person: only when they are needed unless they chose every step. */
|
|
6560
6316
|
notificationPreference(account: string): NotificationPreference;
|
|
6561
6317
|
/** Change one person's choice; a digest time is a local HH:MM, or null for no evening digest. */
|
|
@@ -6672,7 +6428,7 @@ export declare class Store {
|
|
|
6672
6428
|
chatBatchMessageFor(destination: string, taskRef: number, run: number): string | null;
|
|
6673
6429
|
/** The message now showing this card, and what it shows. */
|
|
6674
6430
|
setChatCardMessage(id: number, message: string, digest: string): void;
|
|
6675
|
-
markTelegramDigestSent(
|
|
6431
|
+
markTelegramDigestSent(...args: Parameters<ChatMessages["markDigestSent"]>): ReturnType<ChatMessages["markDigestSent"]>;
|
|
6676
6432
|
/** Routine rows waiting for the next digest: pending, and not urgent.
|
|
6677
6433
|
* A row the live pairing delivered, or skipped as pre-pairing history,
|
|
6678
6434
|
* is settled and not waiting. */
|
|
@@ -6797,33 +6553,10 @@ export declare class Store {
|
|
|
6797
6553
|
* explicit skip, with no delivered timestamp and no attempt, so suppressed
|
|
6798
6554
|
* history is never reported as a send that happened. */
|
|
6799
6555
|
export declare const TELEGRAM_SKIPPED_RECEIPT = "skipped:before-pairing";
|
|
6800
|
-
|
|
6801
|
-
export
|
|
6802
|
-
/** A
|
|
6803
|
-
export declare
|
|
6804
|
-
/** A fact this person is not messaged about: the lead's work, their own act, or a project they muted. */
|
|
6805
|
-
export declare const TELEGRAM_SKIPPED_QUIET = "skipped:quiet";
|
|
6806
|
-
/**
|
|
6807
|
-
* Why the store itself holds a Telegram delivery back: authority,
|
|
6808
|
-
* provenance, ordering, a switched-off channel, or a wait it imposed. A
|
|
6809
|
-
* row held for one of these is waiting on policy, not failing on the wire.
|
|
6810
|
-
* Every other error recorded on a receipt came from an actual send, and
|
|
6811
|
-
* THAT is delivery trouble (`pendingForAttention`). One table, so the
|
|
6812
|
-
* fences and the tally can never disagree about the words.
|
|
6813
|
-
*/
|
|
6814
|
-
export declare const TELEGRAM_HOLD_REASONS: Readonly<{
|
|
6815
|
-
authority: "Telegram pairing or actor authorization changed";
|
|
6816
|
-
destination: "Telegram destination changed";
|
|
6817
|
-
claim: "Telegram delivery claim expired or changed";
|
|
6818
|
-
rateLimit: "Telegram rate limit is still active";
|
|
6819
|
-
resolved: "Notification no longer needs delivery";
|
|
6820
|
-
provenance: "Notification has no trusted project provenance";
|
|
6821
|
-
installation: "Installation notification requires instance access";
|
|
6822
|
-
project: "Notification project is not currently authorized and enrolled";
|
|
6823
|
-
task: "Notification task provenance changed";
|
|
6824
|
-
order: "Earlier task notification is still undelivered";
|
|
6825
|
-
disabled: "Telegram delivery is disabled";
|
|
6826
|
-
}>;
|
|
6556
|
+
export { TELEGRAM_HOLD_REASONS, TELEGRAM_SKIPPED_ELSEWHERE, TELEGRAM_SKIPPED_OTHER_CHAT, TELEGRAM_SKIPPED_QUIET };
|
|
6557
|
+
export { isLifecycleNotification, isTelegramProgressNotification, LIFECYCLE_KEY_PREFIX, LIFECYCLE_KINDS, proposalTaskOf, type LifecycleKind };
|
|
6558
|
+
/** A Telegram pairing, in the Telegram adapter's names: the bot is the installation, the user the member, the private chat the channel. */
|
|
6559
|
+
export declare function telegramBindingOf(binding: ChatBinding): TelegramBinding;
|
|
6827
6560
|
export type WorktreeRow = {
|
|
6828
6561
|
path: string;
|
|
6829
6562
|
repo: string;
|