handoff-relay 0.1.0
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/LICENSE +21 -0
- package/README.md +434 -0
- package/dist/api/server.d.ts +16 -0
- package/dist/api/server.js +2578 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.js +5502 -0
- package/dist/client-CjWEJ02H.d.ts +144 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.js +2623 -0
- package/dist/mcp/server.d.ts +84 -0
- package/dist/mcp/server.js +2950 -0
- package/dist/relay-service-BjF5HNvN.d.ts +712 -0
- package/docs/advanced-manual-setup.md +196 -0
- package/docs/claude-code-setup.md +143 -0
- package/docs/codex-setup.md +135 -0
- package/docs/demo-video-script.md +49 -0
- package/docs/generic-mcp-setup.md +163 -0
- package/docs/launch-copy.md +70 -0
- package/docs/local-self-hosting.md +170 -0
- package/docs/packet-schema.md +116 -0
- package/docs/security-privacy.md +90 -0
- package/docs/troubleshooting.md +180 -0
- package/examples/hydration-receipts/reply-hydration.json +14 -0
- package/examples/packets/ask.json +73 -0
- package/examples/packets/reply.json +62 -0
- package/examples/packets/share.json +52 -0
- package/fixtures/clarification.json +7 -0
- package/fixtures/declined-packet.json +6 -0
- package/fixtures/normal-ask.json +72 -0
- package/fixtures/normal-share.json +51 -0
- package/fixtures/revoked-member.json +7 -0
- package/fixtures/secret-redaction.json +10 -0
- package/fixtures/stale-handoff.json +16 -0
- package/fixtures/superseded-packet.json +6 -0
- package/package.json +103 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { A as ApprovalAction, q as PacketQueryFilters, H as HistoryFilter } from './relay-service-BjF5HNvN.js';
|
|
2
|
+
|
|
3
|
+
interface RelayApiClientOptions {
|
|
4
|
+
serverUrl: string;
|
|
5
|
+
}
|
|
6
|
+
type JsonObject = Record<string, unknown>;
|
|
7
|
+
declare class RelayApiClient {
|
|
8
|
+
private readonly serverUrl;
|
|
9
|
+
constructor(options: RelayApiClientOptions);
|
|
10
|
+
createWorkspace(input: {
|
|
11
|
+
name: string;
|
|
12
|
+
adminHandle: string;
|
|
13
|
+
adminName: string;
|
|
14
|
+
adminBodyAccess?: boolean;
|
|
15
|
+
}): Promise<any>;
|
|
16
|
+
inviteMember(input: {
|
|
17
|
+
adminToken: string;
|
|
18
|
+
workspaceId: string;
|
|
19
|
+
handle: string;
|
|
20
|
+
}): Promise<any>;
|
|
21
|
+
acceptInvite(input: {
|
|
22
|
+
inviteToken: string;
|
|
23
|
+
displayName: string;
|
|
24
|
+
}): Promise<any>;
|
|
25
|
+
listMembers(input: {
|
|
26
|
+
authToken: string;
|
|
27
|
+
workspaceId: string;
|
|
28
|
+
}): Promise<any>;
|
|
29
|
+
configureProjectAlias(input: {
|
|
30
|
+
authToken: string;
|
|
31
|
+
workspaceId: string;
|
|
32
|
+
canonicalProject: string;
|
|
33
|
+
alias: string;
|
|
34
|
+
}): Promise<any>;
|
|
35
|
+
listProjectAliases(input: {
|
|
36
|
+
authToken: string;
|
|
37
|
+
workspaceId: string;
|
|
38
|
+
}): Promise<any>;
|
|
39
|
+
revokeMember(input: {
|
|
40
|
+
adminToken: string;
|
|
41
|
+
workspaceId: string;
|
|
42
|
+
memberId: string;
|
|
43
|
+
}): Promise<any>;
|
|
44
|
+
rotateMemberToken(input: {
|
|
45
|
+
authToken: string;
|
|
46
|
+
}): Promise<any>;
|
|
47
|
+
rotateApprovalSecret(input: {
|
|
48
|
+
authToken: string;
|
|
49
|
+
approvalSecret?: string;
|
|
50
|
+
}): Promise<any>;
|
|
51
|
+
createApprovalToken(input: {
|
|
52
|
+
authToken: string;
|
|
53
|
+
approvalSecret?: string;
|
|
54
|
+
packetId: string;
|
|
55
|
+
action: ApprovalAction;
|
|
56
|
+
}): Promise<any>;
|
|
57
|
+
createAskDraft(input: JsonObject & {
|
|
58
|
+
authToken: string;
|
|
59
|
+
}): Promise<any>;
|
|
60
|
+
createShareDraft(input: JsonObject & {
|
|
61
|
+
authToken: string;
|
|
62
|
+
}): Promise<any>;
|
|
63
|
+
updateDraft(input: JsonObject & {
|
|
64
|
+
authToken: string;
|
|
65
|
+
packetId: string;
|
|
66
|
+
}): Promise<any>;
|
|
67
|
+
approveAndSend(input: {
|
|
68
|
+
authToken: string;
|
|
69
|
+
packetId: string;
|
|
70
|
+
approvalToken?: string;
|
|
71
|
+
allowSecretOverride?: boolean;
|
|
72
|
+
}): Promise<any>;
|
|
73
|
+
listInbox(input: {
|
|
74
|
+
authToken: string;
|
|
75
|
+
workspaceId: string;
|
|
76
|
+
}): Promise<any>;
|
|
77
|
+
viewPacket(input: {
|
|
78
|
+
authToken: string;
|
|
79
|
+
packetId: string;
|
|
80
|
+
}): Promise<any>;
|
|
81
|
+
getPacketForMember(input: {
|
|
82
|
+
authToken: string;
|
|
83
|
+
packetId: string;
|
|
84
|
+
}): Promise<any>;
|
|
85
|
+
acceptPacket(input: {
|
|
86
|
+
authToken: string;
|
|
87
|
+
packetId: string;
|
|
88
|
+
}): Promise<any>;
|
|
89
|
+
hydratePacket(input: {
|
|
90
|
+
authToken: string;
|
|
91
|
+
packetId: string;
|
|
92
|
+
client: string;
|
|
93
|
+
sessionId?: string;
|
|
94
|
+
approvalToken?: string;
|
|
95
|
+
}): Promise<any>;
|
|
96
|
+
createReplyDraft(input: JsonObject & {
|
|
97
|
+
authToken: string;
|
|
98
|
+
packetId: string;
|
|
99
|
+
}): Promise<any>;
|
|
100
|
+
requestClarification(input: {
|
|
101
|
+
authToken: string;
|
|
102
|
+
packetId: string;
|
|
103
|
+
question: string;
|
|
104
|
+
requestedEvidence?: string[];
|
|
105
|
+
}): Promise<any>;
|
|
106
|
+
approveReply(input: {
|
|
107
|
+
authToken: string;
|
|
108
|
+
replyPacketId: string;
|
|
109
|
+
approvalToken?: string;
|
|
110
|
+
}): Promise<any>;
|
|
111
|
+
declinePacket(input: {
|
|
112
|
+
authToken: string;
|
|
113
|
+
packetId: string;
|
|
114
|
+
reason?: string;
|
|
115
|
+
}): Promise<any>;
|
|
116
|
+
archivePacket(input: {
|
|
117
|
+
authToken: string;
|
|
118
|
+
packetId: string;
|
|
119
|
+
}): Promise<any>;
|
|
120
|
+
closePacket(input: {
|
|
121
|
+
authToken: string;
|
|
122
|
+
packetId: string;
|
|
123
|
+
resolution: 'resolved' | 'unresolved';
|
|
124
|
+
}): Promise<any>;
|
|
125
|
+
searchPackets(input: {
|
|
126
|
+
authToken: string;
|
|
127
|
+
workspaceId: string;
|
|
128
|
+
query?: string;
|
|
129
|
+
} & PacketQueryFilters): Promise<any>;
|
|
130
|
+
listHistory(input: {
|
|
131
|
+
authToken: string;
|
|
132
|
+
workspaceId: string;
|
|
133
|
+
filter?: HistoryFilter;
|
|
134
|
+
query?: string;
|
|
135
|
+
} & PacketQueryFilters): Promise<any>;
|
|
136
|
+
listAuditReceipts(input: {
|
|
137
|
+
authToken: string;
|
|
138
|
+
workspaceId: string;
|
|
139
|
+
packetId?: string;
|
|
140
|
+
}): Promise<any>;
|
|
141
|
+
private request;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { RelayApiClient as R, type RelayApiClientOptions as a };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export { R as RelayApiClient, a as RelayApiClientOptions } from './client-CjWEJ02H.js';
|
|
2
|
+
import { A as ApprovalAction, P as PacketStatus, a as PacketType, b as RelayPacket, c as RedactionReport } from './relay-service-BjF5HNvN.js';
|
|
3
|
+
export { d as ApprovalTokenResult, e as AskDraftInput, f as AuditAction, g as AuditReceipt, B as BuildPacketDraftInput, C as ContextBudgetLimits, h as ContextBudgetResult, i as CreateReceiptInput, j as CreateWorkspaceInput, H as HistoryFilter, k as HydrationInput, l as HydrationPolicy, m as HydrationResult, I as InviteRecord, M as MemberRecord, n as MemberRole, o as MemberStatus, p as PacketDraftOptions, q as PacketQueryFilters, r as PacketResult, s as PacketSearchResult, t as ProjectAliasRecord, u as ProjectIdentity, v as RedactionFinding, w as RelayClaim, x as RelayDatabase, y as RelayEvidence, R as RelayService, z as ReplyDraftInput, S as ShareDraftInput, U as UpdateDraftInput, W as WorkspaceRecord, D as auditReceiptSchema, E as buildPacketDraft, F as claimSchema, G as compressPacketToBudget, J as confidenceLevels, K as createAuditReceipt, L as createId, N as createRelayDatabase, O as createToken, Q as defaultContextBudget, T as evidenceSchema, V as formatHydrationContext, X as hashToken, Y as hydrationPolicySchema, Z as normalizeClaim, _ as normalizeEvidence, $ as normalizeHandle, a0 as packetSchema, a1 as packetStatuses, a2 as packetTypes, a3 as projectIdentitySchema, a4 as redactionFindingSchema, a5 as redactionReportSchema, a6 as validateContextBudget } from './relay-service-BjF5HNvN.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import 'better-sqlite3';
|
|
6
|
+
|
|
7
|
+
interface LocalApprovalRequest {
|
|
8
|
+
action: ApprovalAction;
|
|
9
|
+
packetId: string;
|
|
10
|
+
}
|
|
11
|
+
declare function confirmLocalApproval(input: LocalApprovalRequest): Promise<void>;
|
|
12
|
+
|
|
13
|
+
type RelayErrorCode = 'AUTH_REQUIRED' | 'FORBIDDEN' | 'INVALID_INPUT' | 'INVALID_RECIPIENT' | 'INVALID_STATE_TRANSITION' | 'NOT_FOUND' | 'PACKET_TOO_LARGE' | 'REDACTION_BLOCKED' | 'SERVER_UNAVAILABLE' | 'TOKEN_REVOKED' | 'UNSUPPORTED_CLIENT';
|
|
14
|
+
declare class RelayError extends Error {
|
|
15
|
+
readonly code: RelayErrorCode;
|
|
16
|
+
readonly statusCode: number;
|
|
17
|
+
readonly details?: unknown;
|
|
18
|
+
constructor(code: RelayErrorCode, message: string, statusCode?: number, details?: unknown);
|
|
19
|
+
}
|
|
20
|
+
declare function relayError(code: RelayErrorCode, message: string, statusCode?: number, details?: unknown): RelayError;
|
|
21
|
+
declare function isRelayError(error: unknown): error is RelayError;
|
|
22
|
+
|
|
23
|
+
interface NotificationSummary {
|
|
24
|
+
packet_id: string;
|
|
25
|
+
packet_type: 'ask' | 'share' | 'reply' | 'clarification';
|
|
26
|
+
title: string;
|
|
27
|
+
summary: string;
|
|
28
|
+
sender_handle: string;
|
|
29
|
+
project: string;
|
|
30
|
+
}
|
|
31
|
+
interface PollingWatcher {
|
|
32
|
+
start(): void;
|
|
33
|
+
stop(): void;
|
|
34
|
+
tick(): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
type NativeNotificationRunner = (command: string, args: string[]) => Promise<void>;
|
|
37
|
+
interface NotificationDispatcherOptions {
|
|
38
|
+
writeTerminal?: (message: string, summary: NotificationSummary) => void;
|
|
39
|
+
desktop?: boolean;
|
|
40
|
+
webhookUrl?: string;
|
|
41
|
+
webhookHeaders?: Record<string, string>;
|
|
42
|
+
fetchImpl?: typeof fetch;
|
|
43
|
+
platform?: NodeJS.Platform;
|
|
44
|
+
runNativeNotification?: NativeNotificationRunner;
|
|
45
|
+
onError?: (error: Error, channel: 'desktop' | 'webhook') => void;
|
|
46
|
+
}
|
|
47
|
+
declare function formatNotification(summary: NotificationSummary): string;
|
|
48
|
+
declare function createNotificationDispatcher(input?: NotificationDispatcherOptions): (message: string, summary: NotificationSummary) => Promise<void>;
|
|
49
|
+
declare function sendDesktopNotification(summary: NotificationSummary, input?: Pick<NotificationDispatcherOptions, 'platform' | 'runNativeNotification'>): Promise<void>;
|
|
50
|
+
declare function sendWebhookNotification(summary: NotificationSummary, input: Pick<NotificationDispatcherOptions, 'webhookUrl' | 'webhookHeaders' | 'fetchImpl'>): Promise<void>;
|
|
51
|
+
declare function createPollingWatcher(input: {
|
|
52
|
+
poll: () => NotificationSummary[] | Promise<NotificationSummary[]>;
|
|
53
|
+
notify: (message: string, summary: NotificationSummary) => void | Promise<void>;
|
|
54
|
+
intervalMs?: number;
|
|
55
|
+
}): PollingWatcher;
|
|
56
|
+
|
|
57
|
+
type ActorRole = 'admin' | 'recipient' | 'sender' | 'system';
|
|
58
|
+
interface AssertTransitionInput {
|
|
59
|
+
from: PacketStatus;
|
|
60
|
+
to: PacketStatus;
|
|
61
|
+
actorRole: ActorRole;
|
|
62
|
+
packetType?: PacketType;
|
|
63
|
+
}
|
|
64
|
+
declare function assertTransition(input: AssertTransitionInput): void;
|
|
65
|
+
declare function transitionStatus(from: PacketStatus, to: PacketStatus, actorRole: ActorRole, packetType?: PacketType): PacketStatus;
|
|
66
|
+
declare function allowedTransitions(from: PacketStatus, actorRole: ActorRole, packetType?: PacketType): PacketStatus[];
|
|
67
|
+
|
|
68
|
+
interface RedactionOptions {
|
|
69
|
+
maxExcerptCharacters?: number;
|
|
70
|
+
userPatterns?: RegExp[];
|
|
71
|
+
}
|
|
72
|
+
declare function scanPacketForRedactions(packet: RelayPacket, options?: RedactionOptions): RedactionReport;
|
|
73
|
+
|
|
74
|
+
export { type ActorRole, ApprovalAction, type AssertTransitionInput, type LocalApprovalRequest, type NativeNotificationRunner, type NotificationDispatcherOptions, type NotificationSummary, PacketStatus, PacketType, type PollingWatcher, type RedactionOptions, RedactionReport, RelayError, type RelayErrorCode, RelayPacket, allowedTransitions, assertTransition, confirmLocalApproval, createNotificationDispatcher, createPollingWatcher, formatNotification, isRelayError, relayError, scanPacketForRedactions, sendDesktopNotification, sendWebhookNotification, transitionStatus };
|