@oddington/sdk 0.1.76 → 0.1.78
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 +15 -0
- package/dist/browser.js +386 -88
- package/dist/index.js +3 -3
- package/dist/types/packages/sdk/src/public.d.ts +1 -1
- package/dist/types/packages/sdk/src/routine-definition-types.d.ts +7 -1
- package/dist/types/shared/inbox-contract.d.ts +1 -0
- package/dist/types/shared/inbox-live.d.ts +11 -0
- package/dist/types/shared/inbox-member-contract.d.ts +3 -2
- package/dist/types/shared/inbox-member-types.d.ts +15 -0
- package/dist/types/shared/inbox-records.d.ts +4 -2
- package/package.json +1 -1
|
@@ -64,7 +64,7 @@ export { FileOperationError } from '../../../shared/files-contract.js';
|
|
|
64
64
|
export { source } from './source.js';
|
|
65
65
|
export type { SourceLocation, OsSourceLocation, GmailSourceLocation, DropboxSourceLocation, OutlookSourceLocation, SharePointSourceLocation } from './source.js';
|
|
66
66
|
export { InboxOperationError } from '../../../shared/inbox-member-contract.js';
|
|
67
|
-
export type { InboxMember, InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ActionStatus, QuestionSnapshot, QuestionAvailability, QuestionUnavailableReason, ResponseConsequence, LinkedAskSnapshot, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxRecordOptionsInput } from '../../../shared/inbox-member-types.js';
|
|
67
|
+
export type { InboxMember, InboxBootstrap, InboxItemHydration, InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ActionStatus, QuestionSnapshot, QuestionAvailability, QuestionUnavailableReason, ResponseConsequence, LinkedAskSnapshot, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxRecordOptionsInput } from '../../../shared/inbox-member-types.js';
|
|
68
68
|
export type { RecordOptionCatalogue } from '../../../shared/record-selection.js';
|
|
69
69
|
export declare const inbox: import('../../../shared/inbox-member-types.js').InboxMember;
|
|
70
70
|
export type { File, FileInput, FileStorage, FileCreateInput, FileCreateOptions, FileUpdate, FileEnrichment, FileEnrichOptions, FileEnrichResult, FileErrorCode, FileErrorDetail } from '../../../shared/files-contract.js';
|
|
@@ -102,7 +102,13 @@ export type ResponseCapabilities = SharedRoutineCapabilities<{
|
|
|
102
102
|
connections: readonly string[];
|
|
103
103
|
ai: true;
|
|
104
104
|
publish: readonly ('asks' | 'digests')[];
|
|
105
|
-
}
|
|
105
|
+
}> & {
|
|
106
|
+
readonly action: {
|
|
107
|
+
progress(value: {
|
|
108
|
+
label: string;
|
|
109
|
+
}): Promise<void>;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
106
112
|
export type ResponseAction<Input extends JsonValue = JsonValue> = Omit<Handler<Input>, 'run'> & {
|
|
107
113
|
run(context: HandlerRuntime<Input>, os: ResponseCapabilities): Promise<HandlerTransition>;
|
|
108
114
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Private transport setup; never a package-root application API. */
|
|
2
|
+
export interface InboxLiveSetup {
|
|
3
|
+
url: string;
|
|
4
|
+
key: string;
|
|
5
|
+
token: string;
|
|
6
|
+
topic: string;
|
|
7
|
+
expiresAt: number;
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
viewerId: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function parseInboxLiveSetup(value: unknown): InboxLiveSetup;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ResponseAcceptance, QuestionAvailability, QuestionUnavailableReason } from './inbox-member-types.js';
|
|
1
|
+
import type { InboxBootstrap, InboxCurrent, InboxItem, QuestionWork, QuestionStatus, ResponseAcceptance, QuestionAvailability, QuestionUnavailableReason } from './inbox-member-types.js';
|
|
2
2
|
export declare class InboxOperationError extends Error {
|
|
3
3
|
readonly status: number;
|
|
4
4
|
readonly reason: 'invalid_input' | 'access_denied' | 'authority_unavailable' | 'conflict' | 'unavailable' | 'client_update_required' | 'action_processing' | 'action_failed' | QuestionUnavailableReason;
|
|
@@ -22,7 +22,7 @@ export declare const INBOX_LOCAL_INPUT_BYTES: number;
|
|
|
22
22
|
export declare const INBOX_QUESTION_CONTRACT: 'question-work-v2';
|
|
23
23
|
export type InboxQuestionContract = 'question-work-v1' | typeof INBOX_QUESTION_CONTRACT;
|
|
24
24
|
export declare const INBOX_UUID: RegExp;
|
|
25
|
-
export type InboxOperation = 'current' | 'items.list' | 'items.read' | 'items.readRecords' | 'items.see' | 'items.markDigestRead' | 'items.rename' | 'items.setLifecycle' | 'items.listRecipientCandidates' | 'items.addRecipient' | 'questions.list' | 'questions.answer' | 'questions.listRecordOptions';
|
|
25
|
+
export type InboxOperation = 'current' | 'bootstrap' | 'live.connect' | 'items.list' | 'items.read' | 'items.readRecords' | 'items.see' | 'items.markDigestRead' | 'items.rename' | 'items.setLifecycle' | 'items.listRecipientCandidates' | 'items.addRecipient' | 'questions.list' | 'questions.answer' | 'questions.listRecordOptions';
|
|
26
26
|
export declare function isAppQuestionOperation(operation: InboxOperation): boolean;
|
|
27
27
|
/** Closed wire vocabulary; both placements require an explicit relevance filter. */
|
|
28
28
|
export declare function parseInboxRequest(value: unknown): {
|
|
@@ -38,3 +38,4 @@ export declare function parseQuestionWork(value: unknown, contract?: InboxQuesti
|
|
|
38
38
|
export declare function parseQuestionStatus(value: unknown): QuestionStatus;
|
|
39
39
|
export declare function parseInboxAcceptance(value: unknown): ResponseAcceptance;
|
|
40
40
|
export declare function parseInboxResult(operation: InboxOperation, value: unknown, contract?: InboxQuestionContract): unknown;
|
|
41
|
+
export declare function parseInboxBootstrap(value: unknown): InboxBootstrap;
|
|
@@ -40,6 +40,7 @@ export type QuestionStatus = {
|
|
|
40
40
|
} | ActionStatus;
|
|
41
41
|
export interface ResponseConsequence {
|
|
42
42
|
phase: 'loading' | 'invoking' | 'committing' | null;
|
|
43
|
+
progressLabel?: string | null;
|
|
43
44
|
updatedAt: string;
|
|
44
45
|
evidence: Array<RepositoryReceipt | AirtableReceipt>;
|
|
45
46
|
}
|
|
@@ -209,12 +210,26 @@ export type InboxRecordOptionsInput = ItemRevision & {
|
|
|
209
210
|
questionId: string;
|
|
210
211
|
option?: number;
|
|
211
212
|
};
|
|
213
|
+
export type InboxItemHydration = ItemRevision & ({
|
|
214
|
+
status: 'ready';
|
|
215
|
+
result: import('./inbox-records.js').InboxRecords;
|
|
216
|
+
} | {
|
|
217
|
+
status: 'unavailable';
|
|
218
|
+
});
|
|
219
|
+
export interface InboxBootstrap {
|
|
220
|
+
current: InboxCurrent;
|
|
221
|
+
items: InboxItem[];
|
|
222
|
+
hydrations: InboxItemHydration[];
|
|
223
|
+
}
|
|
212
224
|
/** Hosted listing relevance only; local listing uses its bound declaration. */
|
|
213
225
|
export type InboxQuestionListInput = {
|
|
214
226
|
routines: readonly string[];
|
|
215
227
|
};
|
|
216
228
|
export interface InboxMember {
|
|
217
229
|
current(): Promise<InboxCurrent>;
|
|
230
|
+
bootstrap(): Promise<InboxBootstrap>;
|
|
231
|
+
/** Opaque wake-ups only. Cleanup is idempotent; connected includes reconnects. */
|
|
232
|
+
subscribe(onDirty: () => void, onState?: (state: 'connected' | 'unavailable' | 'denied') => void): () => void;
|
|
218
233
|
items: {
|
|
219
234
|
list(): Promise<InboxItem[]>;
|
|
220
235
|
read(itemId: string): Promise<InboxItem>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type QualifiedRecordRef } from './inbox-contract.js';
|
|
1
|
+
import { type QualifiedRecordRef, type InboxBlock } from './inbox-contract.js';
|
|
2
2
|
import type { CollectionSchema, SelectedRecord } from './data-contract.js';
|
|
3
3
|
export type InboxRecord = QualifiedRecordRef & {
|
|
4
4
|
record: SelectedRecord | null;
|
|
@@ -23,6 +23,8 @@ export type InboxRecordsOutcome<Result = InboxRecords> = {
|
|
|
23
23
|
};
|
|
24
24
|
export declare function parseInboxRecordRefs(value: unknown): QualifiedRecordRef[];
|
|
25
25
|
export declare const recordKey: ({ repository, ref }: QualifiedRecordRef) => string;
|
|
26
|
+
/** Only authored Record blocks disclose bootstrap hydration destinations. */
|
|
27
|
+
export declare function authoredInboxRecordRefs(body: InboxBlock[]): QualifiedRecordRef[];
|
|
26
28
|
/** Inbox's existing title policy, shared by full Records and immediate summaries. */
|
|
27
29
|
export declare function inboxRecordTitle(entry: InboxRecord): string;
|
|
28
|
-
export declare function parseInboxRecords(value: unknown): InboxRecords;
|
|
30
|
+
export declare function parseInboxRecords(value: unknown, maximumRecords?: number): InboxRecords;
|