@shadowob/shared 1.1.7 → 1.1.9
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/dist/{chunk-EXZEQO5X.js → chunk-KKRZTKE6.js} +12 -59
- package/dist/chunk-X6FS22AL.js +175 -0
- package/dist/index.cjs +198 -60
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +29 -4
- package/dist/{message.types-TGJmaffM.d.cts → message.types-D5IHsEOR.d.cts} +122 -1
- package/dist/{message.types-TGJmaffM.d.ts → message.types-D5IHsEOR.d.ts} +122 -1
- package/dist/play-catalog/index.cjs +12 -60
- package/dist/play-catalog/index.d.cts +1 -13
- package/dist/play-catalog/index.d.ts +1 -13
- package/dist/play-catalog/index.js +1 -3
- package/dist/types/index.cjs +195 -0
- package/dist/types/index.d.cts +66 -2
- package/dist/types/index.d.ts +66 -2
- package/dist/types/index.js +30 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-6H4LIJZC.js +0 -0
package/dist/types/index.cjs
CHANGED
|
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
6
10
|
var __copyProps = (to, from, except, desc) => {
|
|
7
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -15,4 +19,195 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
15
19
|
|
|
16
20
|
// src/types/index.ts
|
|
17
21
|
var types_exports = {};
|
|
22
|
+
__export(types_exports, {
|
|
23
|
+
BUDDY_INBOX_TOPIC_PREFIX: () => BUDDY_INBOX_TOPIC_PREFIX,
|
|
24
|
+
DEFAULT_BUDDY_INBOX_ADMISSION_POLICY: () => DEFAULT_BUDDY_INBOX_ADMISSION_POLICY,
|
|
25
|
+
TASK_MESSAGE_CARD_STATUSES: () => TASK_MESSAGE_CARD_STATUSES,
|
|
26
|
+
TASK_MESSAGE_CARD_STATUS_TRANSITIONS: () => TASK_MESSAGE_CARD_STATUS_TRANSITIONS,
|
|
27
|
+
TERMINAL_TASK_MESSAGE_CARD_STATUSES: () => TERMINAL_TASK_MESSAGE_CARD_STATUSES,
|
|
28
|
+
buddyInboxAdmissionRuleKey: () => buddyInboxAdmissionRuleKey,
|
|
29
|
+
buddyInboxTopic: () => buddyInboxTopic,
|
|
30
|
+
canTransitionTaskMessageCardStatus: () => canTransitionTaskMessageCardStatus,
|
|
31
|
+
isBuddyInboxTopic: () => isBuddyInboxTopic,
|
|
32
|
+
isTerminalTaskMessageCardStatus: () => isTerminalTaskMessageCardStatus,
|
|
33
|
+
normalizeBuddyInboxAdmissionPendingDeliveries: () => normalizeBuddyInboxAdmissionPendingDeliveries,
|
|
34
|
+
normalizeBuddyInboxAdmissionPolicy: () => normalizeBuddyInboxAdmissionPolicy,
|
|
35
|
+
parseBuddyInboxAgentId: () => parseBuddyInboxAgentId
|
|
36
|
+
});
|
|
18
37
|
module.exports = __toCommonJS(types_exports);
|
|
38
|
+
|
|
39
|
+
// src/types/inbox.types.ts
|
|
40
|
+
var BUDDY_INBOX_TOPIC_PREFIX = "shadow:buddy-inbox:";
|
|
41
|
+
function buddyInboxTopic(agentId) {
|
|
42
|
+
return `${BUDDY_INBOX_TOPIC_PREFIX}${agentId}`;
|
|
43
|
+
}
|
|
44
|
+
function parseBuddyInboxAgentId(topic) {
|
|
45
|
+
if (!topic?.startsWith(BUDDY_INBOX_TOPIC_PREFIX)) return null;
|
|
46
|
+
const agentId = topic.slice(BUDDY_INBOX_TOPIC_PREFIX.length).trim();
|
|
47
|
+
return agentId || null;
|
|
48
|
+
}
|
|
49
|
+
function isBuddyInboxTopic(topic) {
|
|
50
|
+
return parseBuddyInboxAgentId(topic) !== null;
|
|
51
|
+
}
|
|
52
|
+
var TASK_MESSAGE_CARD_STATUSES = [
|
|
53
|
+
"queued",
|
|
54
|
+
"claimed",
|
|
55
|
+
"running",
|
|
56
|
+
"completed",
|
|
57
|
+
"failed",
|
|
58
|
+
"canceled",
|
|
59
|
+
"transferred"
|
|
60
|
+
];
|
|
61
|
+
var TERMINAL_TASK_MESSAGE_CARD_STATUSES = [
|
|
62
|
+
"completed",
|
|
63
|
+
"failed",
|
|
64
|
+
"canceled",
|
|
65
|
+
"transferred"
|
|
66
|
+
];
|
|
67
|
+
var TASK_MESSAGE_CARD_STATUS_TRANSITIONS = {
|
|
68
|
+
queued: ["queued", "claimed", "running", "completed", "failed", "canceled"],
|
|
69
|
+
claimed: ["claimed", "running", "completed", "failed", "canceled"],
|
|
70
|
+
running: ["running", "completed", "failed", "canceled"],
|
|
71
|
+
completed: ["completed"],
|
|
72
|
+
failed: ["failed", "transferred"],
|
|
73
|
+
canceled: ["canceled"],
|
|
74
|
+
transferred: ["transferred"]
|
|
75
|
+
};
|
|
76
|
+
function isTerminalTaskMessageCardStatus(status) {
|
|
77
|
+
return TERMINAL_TASK_MESSAGE_CARD_STATUSES.includes(
|
|
78
|
+
status
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function canTransitionTaskMessageCardStatus(from, to) {
|
|
82
|
+
const allowed = TASK_MESSAGE_CARD_STATUS_TRANSITIONS[from];
|
|
83
|
+
return allowed.includes(to);
|
|
84
|
+
}
|
|
85
|
+
var DEFAULT_BUDDY_INBOX_ADMISSION_POLICY = {
|
|
86
|
+
defaultMode: "allow",
|
|
87
|
+
rules: []
|
|
88
|
+
};
|
|
89
|
+
function isRecord(value) {
|
|
90
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
91
|
+
}
|
|
92
|
+
function parseAdmissionMode(value, fallback) {
|
|
93
|
+
if (value === "allow" || value === "deny" || value === "first_time" || value === "every_time") {
|
|
94
|
+
return value;
|
|
95
|
+
}
|
|
96
|
+
if (value === void 0 || value === null) return fallback;
|
|
97
|
+
throw new Error("Invalid Buddy Inbox admission mode");
|
|
98
|
+
}
|
|
99
|
+
function parseSubjectKind(value) {
|
|
100
|
+
if (value === "user" || value === "agent" || value === "server_app" || value === "system") {
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
throw new Error("Invalid Buddy Inbox admission subject kind");
|
|
104
|
+
}
|
|
105
|
+
function parseOptionalString(value, field, maxLength) {
|
|
106
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
107
|
+
if (typeof value !== "string" || value.length > maxLength) {
|
|
108
|
+
throw new Error(`Invalid Buddy Inbox admission ${field}`);
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
function normalizeBuddyInboxAdmissionPolicy(value) {
|
|
113
|
+
if (value === void 0 || value === null) return { ...DEFAULT_BUDDY_INBOX_ADMISSION_POLICY };
|
|
114
|
+
if (!isRecord(value)) throw new Error("Invalid Buddy Inbox admission policy");
|
|
115
|
+
const defaultMode = parseAdmissionMode(value.defaultMode, "allow");
|
|
116
|
+
const rawRules = value.rules;
|
|
117
|
+
if (rawRules !== void 0 && !Array.isArray(rawRules)) {
|
|
118
|
+
throw new Error("Invalid Buddy Inbox admission rules");
|
|
119
|
+
}
|
|
120
|
+
const rules = (rawRules ?? []).slice(0, 100).map((entry) => {
|
|
121
|
+
if (!isRecord(entry)) throw new Error("Invalid Buddy Inbox admission rule");
|
|
122
|
+
return {
|
|
123
|
+
subjectKind: parseSubjectKind(entry.subjectKind),
|
|
124
|
+
subjectId: parseOptionalString(entry.subjectId, "subjectId", 160),
|
|
125
|
+
appKey: parseOptionalString(entry.appKey, "appKey", 120),
|
|
126
|
+
mode: parseAdmissionMode(entry.mode, defaultMode),
|
|
127
|
+
...entry.approved === true ? { approved: true } : {},
|
|
128
|
+
note: parseOptionalString(entry.note, "note", 500),
|
|
129
|
+
createdAt: parseOptionalString(entry.createdAt, "createdAt", 64),
|
|
130
|
+
updatedAt: parseOptionalString(entry.updatedAt, "updatedAt", 64)
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
return { defaultMode, rules };
|
|
134
|
+
}
|
|
135
|
+
function buddyInboxAdmissionRuleKey(rule) {
|
|
136
|
+
return [rule.subjectKind, rule.subjectId ?? "", rule.appKey ?? ""].join(":");
|
|
137
|
+
}
|
|
138
|
+
function parsePendingTask(value) {
|
|
139
|
+
if (!isRecord(value)) throw new Error("Invalid Buddy Inbox pending task");
|
|
140
|
+
const title = parseOptionalString(value.title, "task.title", 180);
|
|
141
|
+
if (!title) throw new Error("Invalid Buddy Inbox pending task title");
|
|
142
|
+
const body = parseOptionalString(value.body, "task.body", 8e3);
|
|
143
|
+
const priority = value.priority;
|
|
144
|
+
if (priority !== void 0 && priority !== "low" && priority !== "normal" && priority !== "high" && priority !== "urgent") {
|
|
145
|
+
throw new Error("Invalid Buddy Inbox pending task priority");
|
|
146
|
+
}
|
|
147
|
+
const idempotencyKey = parseOptionalString(value.idempotencyKey, "task.idempotencyKey", 240);
|
|
148
|
+
const source = isRecord(value.source) ? value.source : void 0;
|
|
149
|
+
const data = isRecord(value.data) ? value.data : void 0;
|
|
150
|
+
return {
|
|
151
|
+
title,
|
|
152
|
+
...body ? { body } : {},
|
|
153
|
+
...priority ? { priority } : {},
|
|
154
|
+
...idempotencyKey ? { idempotencyKey } : {},
|
|
155
|
+
...source ? { source } : {},
|
|
156
|
+
...data ? { data } : {}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function normalizeBuddyInboxAdmissionPendingDeliveries(value) {
|
|
160
|
+
if (value === void 0 || value === null) return [];
|
|
161
|
+
if (!Array.isArray(value)) throw new Error("Invalid Buddy Inbox pending deliveries");
|
|
162
|
+
return value.slice(0, 100).map((entry) => {
|
|
163
|
+
if (!isRecord(entry)) throw new Error("Invalid Buddy Inbox pending delivery");
|
|
164
|
+
const id = parseOptionalString(entry.id, "pending.id", 80);
|
|
165
|
+
const serverId = parseOptionalString(entry.serverId, "pending.serverId", 160);
|
|
166
|
+
const channelId = parseOptionalString(entry.channelId, "pending.channelId", 160);
|
|
167
|
+
const agentId = parseOptionalString(entry.agentId, "pending.agentId", 160);
|
|
168
|
+
const mode = parseAdmissionMode(entry.mode, "first_time");
|
|
169
|
+
if (mode !== "first_time" && mode !== "every_time") {
|
|
170
|
+
throw new Error("Invalid Buddy Inbox pending mode");
|
|
171
|
+
}
|
|
172
|
+
if (!isRecord(entry.subject)) throw new Error("Invalid Buddy Inbox pending subject");
|
|
173
|
+
if (!isRecord(entry.requestedBy)) throw new Error("Invalid Buddy Inbox pending requester");
|
|
174
|
+
if (!id || !serverId || !channelId || !agentId) {
|
|
175
|
+
throw new Error("Invalid Buddy Inbox pending delivery identifiers");
|
|
176
|
+
}
|
|
177
|
+
const requestedAt = parseOptionalString(entry.requestedAt, "pending.requestedAt", 64);
|
|
178
|
+
if (!requestedAt) throw new Error("Invalid Buddy Inbox pending requestedAt");
|
|
179
|
+
return {
|
|
180
|
+
id,
|
|
181
|
+
serverId,
|
|
182
|
+
channelId,
|
|
183
|
+
agentId,
|
|
184
|
+
mode,
|
|
185
|
+
subject: {
|
|
186
|
+
kind: parseSubjectKind(entry.subject.kind),
|
|
187
|
+
id: parseOptionalString(entry.subject.id, "subject.id", 160),
|
|
188
|
+
appKey: parseOptionalString(entry.subject.appKey, "subject.appKey", 120),
|
|
189
|
+
label: parseOptionalString(entry.subject.label, "subject.label", 160)
|
|
190
|
+
},
|
|
191
|
+
task: parsePendingTask(entry.task),
|
|
192
|
+
requestedBy: entry.requestedBy,
|
|
193
|
+
requestedAt,
|
|
194
|
+
updatedAt: parseOptionalString(entry.updatedAt, "pending.updatedAt", 64)
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
199
|
+
0 && (module.exports = {
|
|
200
|
+
BUDDY_INBOX_TOPIC_PREFIX,
|
|
201
|
+
DEFAULT_BUDDY_INBOX_ADMISSION_POLICY,
|
|
202
|
+
TASK_MESSAGE_CARD_STATUSES,
|
|
203
|
+
TASK_MESSAGE_CARD_STATUS_TRANSITIONS,
|
|
204
|
+
TERMINAL_TASK_MESSAGE_CARD_STATUSES,
|
|
205
|
+
buddyInboxAdmissionRuleKey,
|
|
206
|
+
buddyInboxTopic,
|
|
207
|
+
canTransitionTaskMessageCardStatus,
|
|
208
|
+
isBuddyInboxTopic,
|
|
209
|
+
isTerminalTaskMessageCardStatus,
|
|
210
|
+
normalizeBuddyInboxAdmissionPendingDeliveries,
|
|
211
|
+
normalizeBuddyInboxAdmissionPolicy,
|
|
212
|
+
parseBuddyInboxAgentId
|
|
213
|
+
});
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { h as MessageCardSource, i as MessageCardStatus } from '../message.types-D5IHsEOR.cjs';
|
|
2
|
+
export { A as Attachment, C as CommerceMessageCard, a as CommerceOfferCardInput, b as CommerceProductCard, G as GenericMessageCard, M as MentionSuggestion, c as MentionSuggestionTrigger, d as Message, e as MessageCard, f as MessageCardCapability, g as MessageCardClaim, j as MessageMention, k as MessageMentionKind, l as MessageMentionRange, m as MessageMetadata, N as Notification, n as NotificationType, O as OAuthLinkCard, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, o as ServerAppMessageCard, T as TaskMessageCard, p as Thread, U as UpdateMessageRequest } from '../message.types-D5IHsEOR.cjs';
|
|
2
3
|
|
|
3
4
|
type AgentStatus = 'running' | 'stopped' | 'error';
|
|
4
5
|
type AgentKernelType = 'claude-code' | 'cursor' | 'mcp-server' | 'custom';
|
|
@@ -144,6 +145,69 @@ interface FriendEntry {
|
|
|
144
145
|
createdAt: string;
|
|
145
146
|
}
|
|
146
147
|
|
|
148
|
+
declare const BUDDY_INBOX_TOPIC_PREFIX: "shadow:buddy-inbox:";
|
|
149
|
+
declare function buddyInboxTopic(agentId: string): string;
|
|
150
|
+
declare function parseBuddyInboxAgentId(topic: string | null | undefined): string | null;
|
|
151
|
+
declare function isBuddyInboxTopic(topic: string | null | undefined): boolean;
|
|
152
|
+
declare const TASK_MESSAGE_CARD_STATUSES: readonly ["queued", "claimed", "running", "completed", "failed", "canceled", "transferred"];
|
|
153
|
+
declare const TERMINAL_TASK_MESSAGE_CARD_STATUSES: readonly ["completed", "failed", "canceled", "transferred"];
|
|
154
|
+
declare const TASK_MESSAGE_CARD_STATUS_TRANSITIONS: {
|
|
155
|
+
readonly queued: readonly ["queued", "claimed", "running", "completed", "failed", "canceled"];
|
|
156
|
+
readonly claimed: readonly ["claimed", "running", "completed", "failed", "canceled"];
|
|
157
|
+
readonly running: readonly ["running", "completed", "failed", "canceled"];
|
|
158
|
+
readonly completed: readonly ["completed"];
|
|
159
|
+
readonly failed: readonly ["failed", "transferred"];
|
|
160
|
+
readonly canceled: readonly ["canceled"];
|
|
161
|
+
readonly transferred: readonly ["transferred"];
|
|
162
|
+
};
|
|
163
|
+
declare function isTerminalTaskMessageCardStatus(status: MessageCardStatus): boolean;
|
|
164
|
+
declare function canTransitionTaskMessageCardStatus(from: MessageCardStatus, to: MessageCardStatus): boolean;
|
|
165
|
+
type BuddyInboxAdmissionMode = 'allow' | 'deny' | 'first_time' | 'every_time';
|
|
166
|
+
type BuddyInboxAdmissionSubjectKind = 'user' | 'agent' | 'server_app' | 'system';
|
|
167
|
+
interface BuddyInboxAdmissionRule {
|
|
168
|
+
subjectKind: BuddyInboxAdmissionSubjectKind;
|
|
169
|
+
subjectId?: string;
|
|
170
|
+
appKey?: string;
|
|
171
|
+
mode: BuddyInboxAdmissionMode;
|
|
172
|
+
approved?: boolean;
|
|
173
|
+
note?: string;
|
|
174
|
+
createdAt?: string;
|
|
175
|
+
updatedAt?: string;
|
|
176
|
+
}
|
|
177
|
+
interface BuddyInboxAdmissionPolicy {
|
|
178
|
+
defaultMode: BuddyInboxAdmissionMode;
|
|
179
|
+
rules: BuddyInboxAdmissionRule[];
|
|
180
|
+
}
|
|
181
|
+
interface BuddyInboxAdmissionPendingTask {
|
|
182
|
+
title: string;
|
|
183
|
+
body?: string;
|
|
184
|
+
priority?: 'low' | 'normal' | 'high' | 'urgent';
|
|
185
|
+
idempotencyKey?: string;
|
|
186
|
+
source?: MessageCardSource;
|
|
187
|
+
data?: Record<string, unknown>;
|
|
188
|
+
}
|
|
189
|
+
interface BuddyInboxAdmissionPendingDelivery {
|
|
190
|
+
id: string;
|
|
191
|
+
serverId: string;
|
|
192
|
+
channelId: string;
|
|
193
|
+
agentId: string;
|
|
194
|
+
mode: Exclude<BuddyInboxAdmissionMode, 'allow' | 'deny'>;
|
|
195
|
+
subject: {
|
|
196
|
+
kind: BuddyInboxAdmissionSubjectKind;
|
|
197
|
+
id?: string;
|
|
198
|
+
appKey?: string;
|
|
199
|
+
label?: string;
|
|
200
|
+
};
|
|
201
|
+
task: BuddyInboxAdmissionPendingTask;
|
|
202
|
+
requestedBy: MessageCardSource;
|
|
203
|
+
requestedAt: string;
|
|
204
|
+
updatedAt?: string;
|
|
205
|
+
}
|
|
206
|
+
declare const DEFAULT_BUDDY_INBOX_ADMISSION_POLICY: BuddyInboxAdmissionPolicy;
|
|
207
|
+
declare function normalizeBuddyInboxAdmissionPolicy(value: unknown): BuddyInboxAdmissionPolicy;
|
|
208
|
+
declare function buddyInboxAdmissionRuleKey(rule: BuddyInboxAdmissionRule): string;
|
|
209
|
+
declare function normalizeBuddyInboxAdmissionPendingDeliveries(value: unknown): BuddyInboxAdmissionPendingDelivery[];
|
|
210
|
+
|
|
147
211
|
interface Server {
|
|
148
212
|
id: string;
|
|
149
213
|
name: string;
|
|
@@ -232,4 +296,4 @@ interface UserMembership {
|
|
|
232
296
|
capabilities: string[];
|
|
233
297
|
}
|
|
234
298
|
|
|
235
|
-
export type
|
|
299
|
+
export { type Agent, type AgentCapability, type AgentInfo, type AgentKernelType, type AgentStatus, type AuthResponse, BUDDY_INBOX_TOPIC_PREFIX, type BuddyInboxAdmissionMode, type BuddyInboxAdmissionPendingDelivery, type BuddyInboxAdmissionPendingTask, type BuddyInboxAdmissionPolicy, type BuddyInboxAdmissionRule, type BuddyInboxAdmissionSubjectKind, type Channel, type ChannelSortBy, type ChannelSortDirection, type ChannelSortOptions, type ChannelType, type CreateAgentRequest, type CreateChannelRequest, type CreateServerRequest, DEFAULT_BUDDY_INBOX_ADMISSION_POLICY, type FriendEntry, type FriendSource, type Friendship, type FriendshipStatus, type LoginRequest, type Member, type MemberRole, MessageCardSource, MessageCardStatus, type RegisterRequest, type Server, TASK_MESSAGE_CARD_STATUSES, TASK_MESSAGE_CARD_STATUS_TRANSITIONS, TERMINAL_TASK_MESSAGE_CARD_STATUSES, type UpdateChannelRequest, type UpdateServerRequest, type User, type UserMembership, type UserMembershipTier, type UserProfile, type UserStatus, type VoiceChannelCredentials, type VoiceChannelJoinResult, type VoiceChannelLeaveResult, type VoiceChannelPolicy, type VoiceChannelState, type VoiceParticipant, buddyInboxAdmissionRuleKey, buddyInboxTopic, canTransitionTaskMessageCardStatus, isBuddyInboxTopic, isTerminalTaskMessageCardStatus, normalizeBuddyInboxAdmissionPendingDeliveries, normalizeBuddyInboxAdmissionPolicy, parseBuddyInboxAgentId };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { h as MessageCardSource, i as MessageCardStatus } from '../message.types-D5IHsEOR.js';
|
|
2
|
+
export { A as Attachment, C as CommerceMessageCard, a as CommerceOfferCardInput, b as CommerceProductCard, G as GenericMessageCard, M as MentionSuggestion, c as MentionSuggestionTrigger, d as Message, e as MessageCard, f as MessageCardCapability, g as MessageCardClaim, j as MessageMention, k as MessageMentionKind, l as MessageMentionRange, m as MessageMetadata, N as Notification, n as NotificationType, O as OAuthLinkCard, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, o as ServerAppMessageCard, T as TaskMessageCard, p as Thread, U as UpdateMessageRequest } from '../message.types-D5IHsEOR.js';
|
|
2
3
|
|
|
3
4
|
type AgentStatus = 'running' | 'stopped' | 'error';
|
|
4
5
|
type AgentKernelType = 'claude-code' | 'cursor' | 'mcp-server' | 'custom';
|
|
@@ -144,6 +145,69 @@ interface FriendEntry {
|
|
|
144
145
|
createdAt: string;
|
|
145
146
|
}
|
|
146
147
|
|
|
148
|
+
declare const BUDDY_INBOX_TOPIC_PREFIX: "shadow:buddy-inbox:";
|
|
149
|
+
declare function buddyInboxTopic(agentId: string): string;
|
|
150
|
+
declare function parseBuddyInboxAgentId(topic: string | null | undefined): string | null;
|
|
151
|
+
declare function isBuddyInboxTopic(topic: string | null | undefined): boolean;
|
|
152
|
+
declare const TASK_MESSAGE_CARD_STATUSES: readonly ["queued", "claimed", "running", "completed", "failed", "canceled", "transferred"];
|
|
153
|
+
declare const TERMINAL_TASK_MESSAGE_CARD_STATUSES: readonly ["completed", "failed", "canceled", "transferred"];
|
|
154
|
+
declare const TASK_MESSAGE_CARD_STATUS_TRANSITIONS: {
|
|
155
|
+
readonly queued: readonly ["queued", "claimed", "running", "completed", "failed", "canceled"];
|
|
156
|
+
readonly claimed: readonly ["claimed", "running", "completed", "failed", "canceled"];
|
|
157
|
+
readonly running: readonly ["running", "completed", "failed", "canceled"];
|
|
158
|
+
readonly completed: readonly ["completed"];
|
|
159
|
+
readonly failed: readonly ["failed", "transferred"];
|
|
160
|
+
readonly canceled: readonly ["canceled"];
|
|
161
|
+
readonly transferred: readonly ["transferred"];
|
|
162
|
+
};
|
|
163
|
+
declare function isTerminalTaskMessageCardStatus(status: MessageCardStatus): boolean;
|
|
164
|
+
declare function canTransitionTaskMessageCardStatus(from: MessageCardStatus, to: MessageCardStatus): boolean;
|
|
165
|
+
type BuddyInboxAdmissionMode = 'allow' | 'deny' | 'first_time' | 'every_time';
|
|
166
|
+
type BuddyInboxAdmissionSubjectKind = 'user' | 'agent' | 'server_app' | 'system';
|
|
167
|
+
interface BuddyInboxAdmissionRule {
|
|
168
|
+
subjectKind: BuddyInboxAdmissionSubjectKind;
|
|
169
|
+
subjectId?: string;
|
|
170
|
+
appKey?: string;
|
|
171
|
+
mode: BuddyInboxAdmissionMode;
|
|
172
|
+
approved?: boolean;
|
|
173
|
+
note?: string;
|
|
174
|
+
createdAt?: string;
|
|
175
|
+
updatedAt?: string;
|
|
176
|
+
}
|
|
177
|
+
interface BuddyInboxAdmissionPolicy {
|
|
178
|
+
defaultMode: BuddyInboxAdmissionMode;
|
|
179
|
+
rules: BuddyInboxAdmissionRule[];
|
|
180
|
+
}
|
|
181
|
+
interface BuddyInboxAdmissionPendingTask {
|
|
182
|
+
title: string;
|
|
183
|
+
body?: string;
|
|
184
|
+
priority?: 'low' | 'normal' | 'high' | 'urgent';
|
|
185
|
+
idempotencyKey?: string;
|
|
186
|
+
source?: MessageCardSource;
|
|
187
|
+
data?: Record<string, unknown>;
|
|
188
|
+
}
|
|
189
|
+
interface BuddyInboxAdmissionPendingDelivery {
|
|
190
|
+
id: string;
|
|
191
|
+
serverId: string;
|
|
192
|
+
channelId: string;
|
|
193
|
+
agentId: string;
|
|
194
|
+
mode: Exclude<BuddyInboxAdmissionMode, 'allow' | 'deny'>;
|
|
195
|
+
subject: {
|
|
196
|
+
kind: BuddyInboxAdmissionSubjectKind;
|
|
197
|
+
id?: string;
|
|
198
|
+
appKey?: string;
|
|
199
|
+
label?: string;
|
|
200
|
+
};
|
|
201
|
+
task: BuddyInboxAdmissionPendingTask;
|
|
202
|
+
requestedBy: MessageCardSource;
|
|
203
|
+
requestedAt: string;
|
|
204
|
+
updatedAt?: string;
|
|
205
|
+
}
|
|
206
|
+
declare const DEFAULT_BUDDY_INBOX_ADMISSION_POLICY: BuddyInboxAdmissionPolicy;
|
|
207
|
+
declare function normalizeBuddyInboxAdmissionPolicy(value: unknown): BuddyInboxAdmissionPolicy;
|
|
208
|
+
declare function buddyInboxAdmissionRuleKey(rule: BuddyInboxAdmissionRule): string;
|
|
209
|
+
declare function normalizeBuddyInboxAdmissionPendingDeliveries(value: unknown): BuddyInboxAdmissionPendingDelivery[];
|
|
210
|
+
|
|
147
211
|
interface Server {
|
|
148
212
|
id: string;
|
|
149
213
|
name: string;
|
|
@@ -232,4 +296,4 @@ interface UserMembership {
|
|
|
232
296
|
capabilities: string[];
|
|
233
297
|
}
|
|
234
298
|
|
|
235
|
-
export type
|
|
299
|
+
export { type Agent, type AgentCapability, type AgentInfo, type AgentKernelType, type AgentStatus, type AuthResponse, BUDDY_INBOX_TOPIC_PREFIX, type BuddyInboxAdmissionMode, type BuddyInboxAdmissionPendingDelivery, type BuddyInboxAdmissionPendingTask, type BuddyInboxAdmissionPolicy, type BuddyInboxAdmissionRule, type BuddyInboxAdmissionSubjectKind, type Channel, type ChannelSortBy, type ChannelSortDirection, type ChannelSortOptions, type ChannelType, type CreateAgentRequest, type CreateChannelRequest, type CreateServerRequest, DEFAULT_BUDDY_INBOX_ADMISSION_POLICY, type FriendEntry, type FriendSource, type Friendship, type FriendshipStatus, type LoginRequest, type Member, type MemberRole, MessageCardSource, MessageCardStatus, type RegisterRequest, type Server, TASK_MESSAGE_CARD_STATUSES, TASK_MESSAGE_CARD_STATUS_TRANSITIONS, TERMINAL_TASK_MESSAGE_CARD_STATUSES, type UpdateChannelRequest, type UpdateServerRequest, type User, type UserMembership, type UserMembershipTier, type UserProfile, type UserStatus, type VoiceChannelCredentials, type VoiceChannelJoinResult, type VoiceChannelLeaveResult, type VoiceChannelPolicy, type VoiceChannelState, type VoiceParticipant, buddyInboxAdmissionRuleKey, buddyInboxTopic, canTransitionTaskMessageCardStatus, isBuddyInboxTopic, isTerminalTaskMessageCardStatus, normalizeBuddyInboxAdmissionPendingDeliveries, normalizeBuddyInboxAdmissionPolicy, parseBuddyInboxAgentId };
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
BUDDY_INBOX_TOPIC_PREFIX,
|
|
3
|
+
DEFAULT_BUDDY_INBOX_ADMISSION_POLICY,
|
|
4
|
+
TASK_MESSAGE_CARD_STATUSES,
|
|
5
|
+
TASK_MESSAGE_CARD_STATUS_TRANSITIONS,
|
|
6
|
+
TERMINAL_TASK_MESSAGE_CARD_STATUSES,
|
|
7
|
+
buddyInboxAdmissionRuleKey,
|
|
8
|
+
buddyInboxTopic,
|
|
9
|
+
canTransitionTaskMessageCardStatus,
|
|
10
|
+
isBuddyInboxTopic,
|
|
11
|
+
isTerminalTaskMessageCardStatus,
|
|
12
|
+
normalizeBuddyInboxAdmissionPendingDeliveries,
|
|
13
|
+
normalizeBuddyInboxAdmissionPolicy,
|
|
14
|
+
parseBuddyInboxAgentId
|
|
15
|
+
} from "../chunk-X6FS22AL.js";
|
|
16
|
+
export {
|
|
17
|
+
BUDDY_INBOX_TOPIC_PREFIX,
|
|
18
|
+
DEFAULT_BUDDY_INBOX_ADMISSION_POLICY,
|
|
19
|
+
TASK_MESSAGE_CARD_STATUSES,
|
|
20
|
+
TASK_MESSAGE_CARD_STATUS_TRANSITIONS,
|
|
21
|
+
TERMINAL_TASK_MESSAGE_CARD_STATUSES,
|
|
22
|
+
buddyInboxAdmissionRuleKey,
|
|
23
|
+
buddyInboxTopic,
|
|
24
|
+
canTransitionTaskMessageCardStatus,
|
|
25
|
+
isBuddyInboxTopic,
|
|
26
|
+
isTerminalTaskMessageCardStatus,
|
|
27
|
+
normalizeBuddyInboxAdmissionPendingDeliveries,
|
|
28
|
+
normalizeBuddyInboxAdmissionPolicy,
|
|
29
|
+
parseBuddyInboxAgentId
|
|
30
|
+
};
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as MessageMentionRange, j as MessageMention } from '../message.types-D5IHsEOR.cjs';
|
|
2
2
|
|
|
3
3
|
type CatPattern = 'none' | 'tabby' | 'tuxedo' | 'siamese' | 'calico' | 'bicolor';
|
|
4
4
|
type CatExpression = 'smile' | 'open' | 'flat' | 'sad' | 'surprised' | 'kawaii' | 'winking' | 'smirk';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as MessageMentionRange, j as MessageMention } from '../message.types-D5IHsEOR.js';
|
|
2
2
|
|
|
3
3
|
type CatPattern = 'none' | 'tabby' | 'tuxedo' | 'siamese' | 'calico' | 'bicolor';
|
|
4
4
|
type CatExpression = 'smile' | 'open' | 'flat' | 'sad' | 'surprised' | 'kawaii' | 'winking' | 'smirk';
|
package/package.json
CHANGED
package/dist/chunk-6H4LIJZC.js
DELETED
|
File without changes
|