agent-protocols 0.3.1 → 0.4.1
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 +7 -3
- package/dist/delegation.d.ts +106 -0
- package/dist/delegation.d.ts.map +1 -0
- package/dist/delegation.js +111 -0
- package/dist/delegation.js.map +1 -0
- package/dist/discourse.d.ts +45 -3
- package/dist/discourse.d.ts.map +1 -1
- package/dist/discourse.js +72 -17
- package/dist/discourse.js.map +1 -1
- package/dist/http-client.d.ts +36 -3
- package/dist/http-client.d.ts.map +1 -1
- package/dist/http-client.js +87 -8
- package/dist/http-client.js.map +1 -1
- package/dist/identity.d.ts +6 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +26 -0
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/local-connector.d.ts +235 -0
- package/dist/local-connector.d.ts.map +1 -0
- package/dist/local-connector.js +252 -0
- package/dist/local-connector.js.map +1 -0
- package/dist/profile.d.ts +11 -0
- package/dist/profile.d.ts.map +1 -1
- package/dist/profile.js +1 -0
- package/dist/profile.js.map +1 -1
- package/package.json +10 -2
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { AgentId } from "./identity.js";
|
|
2
|
+
import { AgentStatus, Role, RoomPolicy, RoomResponse, RoomState, ServerRecord, TypeDef, Visibility } from "./discourse.js";
|
|
3
|
+
export declare const TOOL_IDENTITY_CURRENT = "agent_protocols_identity_current";
|
|
4
|
+
export declare const TOOL_HOSTS_LIST = "agent_protocols_hosts_list";
|
|
5
|
+
export declare const TOOL_HOST_ADD = "agent_protocols_host_add";
|
|
6
|
+
export declare const TOOL_ROOMS_SEARCH = "agent_protocols_rooms_search";
|
|
7
|
+
export declare const TOOL_ROOMS_LIST = "agent_protocols_rooms_list";
|
|
8
|
+
export declare const TOOL_ROOM_OPEN = "agent_protocols_room_open";
|
|
9
|
+
export declare const TOOL_ROOM_STATE = "agent_protocols_room_state";
|
|
10
|
+
export declare const TOOL_ROOM_MEMBERS_LIST = "agent_protocols_room_members_list";
|
|
11
|
+
export declare const TOOL_ROOM_MEMBER_GET = "agent_protocols_room_member_get";
|
|
12
|
+
export declare const TOOL_AGENT_STATUS_LIST = "agent_protocols_agent_status_list";
|
|
13
|
+
export declare const TOOL_AGENT_STATUS_GET = "agent_protocols_agent_status_get";
|
|
14
|
+
export declare const TOOL_AGENT_STATUS_SET = "agent_protocols_agent_status_set";
|
|
15
|
+
export declare const TOOL_AGENT_STATUS_CLEAR = "agent_protocols_agent_status_clear";
|
|
16
|
+
export declare const TOOL_ROOM_TIMELINE = "agent_protocols_room_timeline";
|
|
17
|
+
export declare const TOOL_ROOM_UNREAD = "agent_protocols_room_unread";
|
|
18
|
+
export declare const TOOL_ROOM_MARK_READ = "agent_protocols_room_mark_read";
|
|
19
|
+
export declare const TOOL_INBOX_NEXT = "agent_protocols_inbox_next";
|
|
20
|
+
export declare const TOOL_INBOX_ACK = "agent_protocols_inbox_ack";
|
|
21
|
+
export declare const TOOL_DRAFTS_LIST = "agent_protocols_drafts_list";
|
|
22
|
+
export declare const TOOL_DRAFT_GET = "agent_protocols_draft_get";
|
|
23
|
+
export declare const TOOL_DRAFT_COMMIT = "agent_protocols_draft_commit";
|
|
24
|
+
export declare const TOOL_DRAFT_DROP = "agent_protocols_draft_drop";
|
|
25
|
+
export declare const TOOL_PROFILE_UPDATE = "agent_protocols_profile_update";
|
|
26
|
+
export declare const TOOL_ROOM_CREATE = "agent_protocols_room_create";
|
|
27
|
+
export declare const TOOL_ROOM_JOIN = "agent_protocols_room_join";
|
|
28
|
+
/** @deprecated Use `agent_protocols_room_join`. */
|
|
29
|
+
export declare const TOOL_ROOM_JOIN_REQUEST = "agent_protocols_room_join_request";
|
|
30
|
+
/** @deprecated Use `agent_protocols_room_join`. */
|
|
31
|
+
export declare const TOOL_ROOM_JOIN_WHEN_APPROVED = "agent_protocols_room_join_when_approved";
|
|
32
|
+
export declare const TOOL_ROOM_LEAVE = "agent_protocols_room_leave";
|
|
33
|
+
export declare const TOOL_ROOM_SEND_MESSAGE = "agent_protocols_room_send_message";
|
|
34
|
+
export declare const TOOL_ROOM_SUBMIT_EVENT = "agent_protocols_room_submit_event";
|
|
35
|
+
export declare const TOOL_JOIN_REQUESTS_LIST = "agent_protocols_join_requests_list";
|
|
36
|
+
export declare const TOOL_JOIN_REQUEST_REVIEW = "agent_protocols_join_request_review";
|
|
37
|
+
export declare const RESOURCE_IDENTITY_CURRENT = "agent-protocols://identity/current";
|
|
38
|
+
export declare const RESOURCE_HOSTS = "agent-protocols://hosts";
|
|
39
|
+
export declare const RESOURCE_ROOMS = "agent-protocols://rooms";
|
|
40
|
+
export declare const RESOURCE_INBOX_PENDING = "agent-protocols://inbox/pending";
|
|
41
|
+
export declare const RESOURCE_DRAFTS_HELD = "agent-protocols://drafts/held";
|
|
42
|
+
export declare const RESOURCE_ROOM_AGENT_STATUS_SUFFIX = "/agent-status";
|
|
43
|
+
export type LocalConnectorToolName = typeof TOOL_IDENTITY_CURRENT | typeof TOOL_HOSTS_LIST | typeof TOOL_HOST_ADD | typeof TOOL_ROOMS_SEARCH | typeof TOOL_ROOMS_LIST | typeof TOOL_ROOM_OPEN | typeof TOOL_ROOM_STATE | typeof TOOL_ROOM_MEMBERS_LIST | typeof TOOL_ROOM_MEMBER_GET | typeof TOOL_AGENT_STATUS_LIST | typeof TOOL_AGENT_STATUS_GET | typeof TOOL_AGENT_STATUS_SET | typeof TOOL_AGENT_STATUS_CLEAR | typeof TOOL_ROOM_TIMELINE | typeof TOOL_ROOM_UNREAD | typeof TOOL_ROOM_MARK_READ | typeof TOOL_INBOX_NEXT | typeof TOOL_INBOX_ACK | typeof TOOL_DRAFTS_LIST | typeof TOOL_DRAFT_GET | typeof TOOL_DRAFT_COMMIT | typeof TOOL_DRAFT_DROP | typeof TOOL_PROFILE_UPDATE | typeof TOOL_ROOM_CREATE | typeof TOOL_ROOM_JOIN | typeof TOOL_ROOM_JOIN_REQUEST | typeof TOOL_ROOM_JOIN_WHEN_APPROVED | typeof TOOL_ROOM_LEAVE | typeof TOOL_ROOM_SEND_MESSAGE | typeof TOOL_ROOM_SUBMIT_EVENT | typeof TOOL_JOIN_REQUESTS_LIST | typeof TOOL_JOIN_REQUEST_REVIEW;
|
|
44
|
+
export interface LocalConnectorToolAnnotations {
|
|
45
|
+
readOnlyHint: boolean;
|
|
46
|
+
idempotentHint: boolean;
|
|
47
|
+
destructiveHint: boolean;
|
|
48
|
+
openWorldHint: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface LocalConnectorToolDefinition {
|
|
51
|
+
name: LocalConnectorToolName;
|
|
52
|
+
description: string;
|
|
53
|
+
input_schema: Record<string, unknown>;
|
|
54
|
+
output_schema: Record<string, unknown>;
|
|
55
|
+
annotations: LocalConnectorToolAnnotations;
|
|
56
|
+
}
|
|
57
|
+
export declare function standardToolDefinitions(): LocalConnectorToolDefinition[];
|
|
58
|
+
export interface SyncState {
|
|
59
|
+
host: string;
|
|
60
|
+
room_id: string;
|
|
61
|
+
head_seq: number;
|
|
62
|
+
head_hash: string;
|
|
63
|
+
synced_seq: number;
|
|
64
|
+
remote_seq: number;
|
|
65
|
+
subscribed: boolean;
|
|
66
|
+
unread_count: number;
|
|
67
|
+
pending_inbox_count: number;
|
|
68
|
+
}
|
|
69
|
+
export interface AgentProtocolsHost {
|
|
70
|
+
host: string;
|
|
71
|
+
label?: string;
|
|
72
|
+
allowed: boolean;
|
|
73
|
+
features?: string[];
|
|
74
|
+
profile_service?: string;
|
|
75
|
+
last_checked_at?: number;
|
|
76
|
+
}
|
|
77
|
+
export type RoomMemberStatus = "active" | "left" | "removed" | "unknown";
|
|
78
|
+
export interface RoomMemberProfile {
|
|
79
|
+
name?: string;
|
|
80
|
+
username?: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
avatar_url?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface RoomMemberView {
|
|
85
|
+
agent_id: AgentId;
|
|
86
|
+
role: Role;
|
|
87
|
+
status: RoomMemberStatus;
|
|
88
|
+
is_creator: boolean;
|
|
89
|
+
perspective?: string;
|
|
90
|
+
joined_seq?: number;
|
|
91
|
+
left_seq?: number | null;
|
|
92
|
+
last_event_seq?: number;
|
|
93
|
+
profile?: RoomMemberProfile;
|
|
94
|
+
extra?: Record<string, unknown>;
|
|
95
|
+
}
|
|
96
|
+
export interface TimelineItem {
|
|
97
|
+
room_id: string;
|
|
98
|
+
seq: number;
|
|
99
|
+
event_id: string;
|
|
100
|
+
type: string;
|
|
101
|
+
kind: string;
|
|
102
|
+
actor: AgentId;
|
|
103
|
+
created_at: number;
|
|
104
|
+
received_at: number;
|
|
105
|
+
summary: string;
|
|
106
|
+
content_type?: string;
|
|
107
|
+
content?: unknown;
|
|
108
|
+
mentions?: AgentId[];
|
|
109
|
+
references?: string[];
|
|
110
|
+
payload: unknown;
|
|
111
|
+
}
|
|
112
|
+
export type InboxKind = "room.message.new" | "room.mention" | "room.turn.assigned" | "room.steer" | "room.join.requested" | "room.join.approved" | "room.role.changed" | "room.state.changed" | "room.event.custom";
|
|
113
|
+
export type InboxPriority = "low" | "normal" | "high";
|
|
114
|
+
export interface InboxItem {
|
|
115
|
+
id: string;
|
|
116
|
+
kind: InboxKind;
|
|
117
|
+
priority: InboxPriority;
|
|
118
|
+
room_id?: string;
|
|
119
|
+
seq?: number;
|
|
120
|
+
event_id?: string;
|
|
121
|
+
actor?: AgentId;
|
|
122
|
+
created_at: number;
|
|
123
|
+
requires_response: boolean;
|
|
124
|
+
deadline?: number | null;
|
|
125
|
+
reason: string;
|
|
126
|
+
suggested_tools?: LocalConnectorToolName[];
|
|
127
|
+
message?: unknown;
|
|
128
|
+
}
|
|
129
|
+
export type HeadMismatchPolicy = "hold" | "reject" | "send_anyway";
|
|
130
|
+
export type HeldDraftKind = "message" | "event";
|
|
131
|
+
export type DraftAction = "revise" | "send_as_is" | "stay_silent" | "send_anyway";
|
|
132
|
+
export interface HeldDraft {
|
|
133
|
+
id: string;
|
|
134
|
+
room_id: string;
|
|
135
|
+
kind: HeldDraftKind;
|
|
136
|
+
created_at: number;
|
|
137
|
+
base_seq?: number;
|
|
138
|
+
base_hash?: string;
|
|
139
|
+
current_sync: SyncState;
|
|
140
|
+
draft: unknown;
|
|
141
|
+
reason: string;
|
|
142
|
+
options?: DraftAction[];
|
|
143
|
+
}
|
|
144
|
+
export interface ActiveTurn {
|
|
145
|
+
turn_id: string;
|
|
146
|
+
speaker: AgentId;
|
|
147
|
+
assigned_seq: number;
|
|
148
|
+
expires_at?: number | null;
|
|
149
|
+
instruction?: string;
|
|
150
|
+
source_event_id: string;
|
|
151
|
+
}
|
|
152
|
+
export interface RoomSummary {
|
|
153
|
+
room_id: string;
|
|
154
|
+
host: string;
|
|
155
|
+
topic?: string;
|
|
156
|
+
status: RoomState;
|
|
157
|
+
visibility?: Visibility;
|
|
158
|
+
start_time?: number;
|
|
159
|
+
end_time?: number;
|
|
160
|
+
tags?: string[];
|
|
161
|
+
language?: string;
|
|
162
|
+
role?: Role;
|
|
163
|
+
unread_count: number;
|
|
164
|
+
pending_inbox_count: number;
|
|
165
|
+
}
|
|
166
|
+
export interface RoomStateView {
|
|
167
|
+
host: string;
|
|
168
|
+
room_id: string;
|
|
169
|
+
status: RoomState;
|
|
170
|
+
visibility?: Visibility;
|
|
171
|
+
topic?: string;
|
|
172
|
+
agenda?: string;
|
|
173
|
+
guidance?: string;
|
|
174
|
+
creator?: AgentId;
|
|
175
|
+
created_at?: number;
|
|
176
|
+
start_time?: number;
|
|
177
|
+
end_time?: number;
|
|
178
|
+
tags?: string[];
|
|
179
|
+
language?: string;
|
|
180
|
+
policy?: RoomPolicy;
|
|
181
|
+
types?: TypeDef[];
|
|
182
|
+
self_member?: RoomMemberView;
|
|
183
|
+
members_count: number;
|
|
184
|
+
active_turn?: ActiveTurn;
|
|
185
|
+
unread_count: number;
|
|
186
|
+
pending_inbox_count: number;
|
|
187
|
+
}
|
|
188
|
+
export type RoomsListMembership = "member" | "creator" | "moderator" | "pending" | "all";
|
|
189
|
+
export interface RoomSendMessageInput {
|
|
190
|
+
room_id: string;
|
|
191
|
+
content: string;
|
|
192
|
+
content_type?: string;
|
|
193
|
+
mentions?: AgentId[];
|
|
194
|
+
references?: string[];
|
|
195
|
+
extra?: Record<string, unknown>;
|
|
196
|
+
base_seq?: number;
|
|
197
|
+
base_hash?: string;
|
|
198
|
+
on_head_mismatch?: HeadMismatchPolicy;
|
|
199
|
+
}
|
|
200
|
+
export interface RoomSubmitEventInput {
|
|
201
|
+
room_id: string;
|
|
202
|
+
type: string;
|
|
203
|
+
payload: Record<string, unknown>;
|
|
204
|
+
mentions?: AgentId[];
|
|
205
|
+
references?: string[];
|
|
206
|
+
base_seq?: number;
|
|
207
|
+
base_hash?: string;
|
|
208
|
+
on_head_mismatch?: HeadMismatchPolicy;
|
|
209
|
+
}
|
|
210
|
+
export interface RoomWriteResult {
|
|
211
|
+
status: "sent" | "held" | "rejected";
|
|
212
|
+
record?: ServerRecord;
|
|
213
|
+
item?: TimelineItem;
|
|
214
|
+
draft?: HeldDraft;
|
|
215
|
+
changes?: TimelineItem[];
|
|
216
|
+
sync: SyncState;
|
|
217
|
+
}
|
|
218
|
+
export interface AgentStatusToolResult {
|
|
219
|
+
statuses?: AgentStatus[];
|
|
220
|
+
status?: AgentStatus;
|
|
221
|
+
sync?: SyncState;
|
|
222
|
+
}
|
|
223
|
+
export declare function syncStateFromRoomResponse(host: string, room: RoomResponse, options?: {
|
|
224
|
+
subscribed?: boolean;
|
|
225
|
+
unreadCount?: number;
|
|
226
|
+
pendingInboxCount?: number;
|
|
227
|
+
remoteSeq?: number;
|
|
228
|
+
}): SyncState;
|
|
229
|
+
export declare function roomSummaryFromResponse(host: string, room: RoomResponse, options?: {
|
|
230
|
+
role?: Role;
|
|
231
|
+
unreadCount?: number;
|
|
232
|
+
pendingInboxCount?: number;
|
|
233
|
+
}): RoomSummary;
|
|
234
|
+
export declare function timelineItemFromRecord(record: ServerRecord): TimelineItem;
|
|
235
|
+
//# sourceMappingURL=local-connector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-connector.d.ts","sourceRoot":"","sources":["../src/local-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,WAAW,EAEX,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,OAAO,EACP,UAAU,EAEX,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,qBAAqB,qCAAqC,CAAC;AACxE,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAC5D,eAAO,MAAM,aAAa,6BAA6B,CAAC;AACxD,eAAO,MAAM,iBAAiB,iCAAiC,CAAC;AAChE,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAC5D,eAAO,MAAM,cAAc,8BAA8B,CAAC;AAC1D,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAC5D,eAAO,MAAM,sBAAsB,sCAAsC,CAAC;AAC1E,eAAO,MAAM,oBAAoB,oCAAoC,CAAC;AACtE,eAAO,MAAM,sBAAsB,sCAAsC,CAAC;AAC1E,eAAO,MAAM,qBAAqB,qCAAqC,CAAC;AACxE,eAAO,MAAM,qBAAqB,qCAAqC,CAAC;AACxE,eAAO,MAAM,uBAAuB,uCAAuC,CAAC;AAC5E,eAAO,MAAM,kBAAkB,kCAAkC,CAAC;AAClE,eAAO,MAAM,gBAAgB,gCAAgC,CAAC;AAC9D,eAAO,MAAM,mBAAmB,mCAAmC,CAAC;AACpE,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAC5D,eAAO,MAAM,cAAc,8BAA8B,CAAC;AAC1D,eAAO,MAAM,gBAAgB,gCAAgC,CAAC;AAC9D,eAAO,MAAM,cAAc,8BAA8B,CAAC;AAC1D,eAAO,MAAM,iBAAiB,iCA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,EAAE,WAAW,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,EAClB,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,SAAS,CAaX;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,EAClB,OAAO,GAAE;IACP,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACvB,GACL,WAAW,CAgBb;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAoBzE"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { eventType, } from "./discourse.js";
|
|
2
|
+
export const TOOL_IDENTITY_CURRENT = "agent_protocols_identity_current";
|
|
3
|
+
export const TOOL_HOSTS_LIST = "agent_protocols_hosts_list";
|
|
4
|
+
export const TOOL_HOST_ADD = "agent_protocols_host_add";
|
|
5
|
+
export const TOOL_ROOMS_SEARCH = "agent_protocols_rooms_search";
|
|
6
|
+
export const TOOL_ROOMS_LIST = "agent_protocols_rooms_list";
|
|
7
|
+
export const TOOL_ROOM_OPEN = "agent_protocols_room_open";
|
|
8
|
+
export const TOOL_ROOM_STATE = "agent_protocols_room_state";
|
|
9
|
+
export const TOOL_ROOM_MEMBERS_LIST = "agent_protocols_room_members_list";
|
|
10
|
+
export const TOOL_ROOM_MEMBER_GET = "agent_protocols_room_member_get";
|
|
11
|
+
export const TOOL_AGENT_STATUS_LIST = "agent_protocols_agent_status_list";
|
|
12
|
+
export const TOOL_AGENT_STATUS_GET = "agent_protocols_agent_status_get";
|
|
13
|
+
export const TOOL_AGENT_STATUS_SET = "agent_protocols_agent_status_set";
|
|
14
|
+
export const TOOL_AGENT_STATUS_CLEAR = "agent_protocols_agent_status_clear";
|
|
15
|
+
export const TOOL_ROOM_TIMELINE = "agent_protocols_room_timeline";
|
|
16
|
+
export const TOOL_ROOM_UNREAD = "agent_protocols_room_unread";
|
|
17
|
+
export const TOOL_ROOM_MARK_READ = "agent_protocols_room_mark_read";
|
|
18
|
+
export const TOOL_INBOX_NEXT = "agent_protocols_inbox_next";
|
|
19
|
+
export const TOOL_INBOX_ACK = "agent_protocols_inbox_ack";
|
|
20
|
+
export const TOOL_DRAFTS_LIST = "agent_protocols_drafts_list";
|
|
21
|
+
export const TOOL_DRAFT_GET = "agent_protocols_draft_get";
|
|
22
|
+
export const TOOL_DRAFT_COMMIT = "agent_protocols_draft_commit";
|
|
23
|
+
export const TOOL_DRAFT_DROP = "agent_protocols_draft_drop";
|
|
24
|
+
export const TOOL_PROFILE_UPDATE = "agent_protocols_profile_update";
|
|
25
|
+
export const TOOL_ROOM_CREATE = "agent_protocols_room_create";
|
|
26
|
+
export const TOOL_ROOM_JOIN = "agent_protocols_room_join";
|
|
27
|
+
/** @deprecated Use `agent_protocols_room_join`. */
|
|
28
|
+
export const TOOL_ROOM_JOIN_REQUEST = "agent_protocols_room_join_request";
|
|
29
|
+
/** @deprecated Use `agent_protocols_room_join`. */
|
|
30
|
+
export const TOOL_ROOM_JOIN_WHEN_APPROVED = "agent_protocols_room_join_when_approved";
|
|
31
|
+
export const TOOL_ROOM_LEAVE = "agent_protocols_room_leave";
|
|
32
|
+
export const TOOL_ROOM_SEND_MESSAGE = "agent_protocols_room_send_message";
|
|
33
|
+
export const TOOL_ROOM_SUBMIT_EVENT = "agent_protocols_room_submit_event";
|
|
34
|
+
export const TOOL_JOIN_REQUESTS_LIST = "agent_protocols_join_requests_list";
|
|
35
|
+
export const TOOL_JOIN_REQUEST_REVIEW = "agent_protocols_join_request_review";
|
|
36
|
+
export const RESOURCE_IDENTITY_CURRENT = "agent-protocols://identity/current";
|
|
37
|
+
export const RESOURCE_HOSTS = "agent-protocols://hosts";
|
|
38
|
+
export const RESOURCE_ROOMS = "agent-protocols://rooms";
|
|
39
|
+
export const RESOURCE_INBOX_PENDING = "agent-protocols://inbox/pending";
|
|
40
|
+
export const RESOURCE_DRAFTS_HELD = "agent-protocols://drafts/held";
|
|
41
|
+
export const RESOURCE_ROOM_AGENT_STATUS_SUFFIX = "/agent-status";
|
|
42
|
+
export function standardToolDefinitions() {
|
|
43
|
+
const rows = [
|
|
44
|
+
[
|
|
45
|
+
TOOL_IDENTITY_CURRENT,
|
|
46
|
+
"Return the active local Agent ID and non-secret connector configuration.",
|
|
47
|
+
true,
|
|
48
|
+
true,
|
|
49
|
+
false,
|
|
50
|
+
],
|
|
51
|
+
[TOOL_HOSTS_LIST, "List configured Agent Discourse hosts.", true, true, false],
|
|
52
|
+
[
|
|
53
|
+
TOOL_HOST_ADD,
|
|
54
|
+
"Add an allowed Agent Discourse host after discovery.",
|
|
55
|
+
false,
|
|
56
|
+
true,
|
|
57
|
+
true,
|
|
58
|
+
],
|
|
59
|
+
[TOOL_ROOMS_SEARCH, "Search public rooms on an allowed host.", true, false, true],
|
|
60
|
+
[TOOL_ROOMS_LIST, "List locally known rooms and unread summaries.", true, true, false],
|
|
61
|
+
[
|
|
62
|
+
TOOL_ROOM_OPEN,
|
|
63
|
+
"Open a room, refresh local state, and optionally mark it subscribed.",
|
|
64
|
+
false,
|
|
65
|
+
true,
|
|
66
|
+
true,
|
|
67
|
+
],
|
|
68
|
+
[TOOL_ROOM_STATE, "Read the local materialized room state.", true, true, false],
|
|
69
|
+
[TOOL_ROOM_MEMBERS_LIST, "List materialized room members.", true, true, false],
|
|
70
|
+
[TOOL_ROOM_MEMBER_GET, "Read one materialized room member.", true, true, false],
|
|
71
|
+
[
|
|
72
|
+
TOOL_AGENT_STATUS_LIST,
|
|
73
|
+
"Read current transient agent statuses for a room.",
|
|
74
|
+
true,
|
|
75
|
+
false,
|
|
76
|
+
true,
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
TOOL_AGENT_STATUS_GET,
|
|
80
|
+
"Read one agent's current transient status in a room.",
|
|
81
|
+
true,
|
|
82
|
+
false,
|
|
83
|
+
true,
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
TOOL_AGENT_STATUS_SET,
|
|
87
|
+
"Update the active local agent's transient status in a room.",
|
|
88
|
+
false,
|
|
89
|
+
false,
|
|
90
|
+
true,
|
|
91
|
+
],
|
|
92
|
+
[
|
|
93
|
+
TOOL_AGENT_STATUS_CLEAR,
|
|
94
|
+
"Clear the active local agent's transient status in a room.",
|
|
95
|
+
false,
|
|
96
|
+
true,
|
|
97
|
+
true,
|
|
98
|
+
],
|
|
99
|
+
[TOOL_ROOM_TIMELINE, "Read simplified timeline items from the local cache.", true, true, false],
|
|
100
|
+
[
|
|
101
|
+
TOOL_ROOM_UNREAD,
|
|
102
|
+
"Read unread timeline items, optionally marking them read.",
|
|
103
|
+
false,
|
|
104
|
+
true,
|
|
105
|
+
false,
|
|
106
|
+
],
|
|
107
|
+
[TOOL_ROOM_MARK_READ, "Mark a room timeline read through a sequence number.", false, true, false],
|
|
108
|
+
[TOOL_INBOX_NEXT, "Read or claim pending actionable inbox items.", false, true, false],
|
|
109
|
+
[TOOL_INBOX_ACK, "Acknowledge, dismiss, or defer inbox items.", false, true, false],
|
|
110
|
+
[
|
|
111
|
+
TOOL_DRAFTS_LIST,
|
|
112
|
+
"List local held drafts that need explicit agent action.",
|
|
113
|
+
true,
|
|
114
|
+
true,
|
|
115
|
+
false,
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
TOOL_DRAFT_GET,
|
|
119
|
+
"Read one local held draft with room changes since it was held.",
|
|
120
|
+
true,
|
|
121
|
+
true,
|
|
122
|
+
false,
|
|
123
|
+
],
|
|
124
|
+
[TOOL_DRAFT_COMMIT, "Revise, send, or silence a local held draft.", false, false, true],
|
|
125
|
+
[TOOL_DRAFT_DROP, "Drop a local held draft without submitting it.", false, true, false],
|
|
126
|
+
[TOOL_PROFILE_UPDATE, "Sign and submit a profile.update envelope.", false, false, true],
|
|
127
|
+
[TOOL_ROOM_CREATE, "Sign and submit a room.create envelope.", false, false, true],
|
|
128
|
+
[
|
|
129
|
+
TOOL_ROOM_JOIN,
|
|
130
|
+
"Create a join request when needed or sign and submit room.join.",
|
|
131
|
+
false,
|
|
132
|
+
false,
|
|
133
|
+
true,
|
|
134
|
+
],
|
|
135
|
+
[TOOL_ROOM_LEAVE, "Sign and submit room.leave.", false, false, true],
|
|
136
|
+
[TOOL_ROOM_SEND_MESSAGE, "Sign and submit message.create.", false, false, true],
|
|
137
|
+
[TOOL_ROOM_SUBMIT_EVENT, "Sign and submit a room-defined event.", false, false, true],
|
|
138
|
+
[TOOL_JOIN_REQUESTS_LIST, "List visible join requests for a room.", true, false, true],
|
|
139
|
+
[TOOL_JOIN_REQUEST_REVIEW, "Sign and submit room.join.review.", false, false, true],
|
|
140
|
+
];
|
|
141
|
+
return rows.map(([name, description, readOnly, idempotent, openWorld]) => ({
|
|
142
|
+
name,
|
|
143
|
+
description,
|
|
144
|
+
input_schema: { type: "object" },
|
|
145
|
+
output_schema: { type: "object" },
|
|
146
|
+
annotations: {
|
|
147
|
+
readOnlyHint: readOnly,
|
|
148
|
+
idempotentHint: idempotent,
|
|
149
|
+
destructiveHint: false,
|
|
150
|
+
openWorldHint: openWorld,
|
|
151
|
+
},
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
export function syncStateFromRoomResponse(host, room, options = {}) {
|
|
155
|
+
const head = room.head ?? { seq: room.seq, hash: room.hash };
|
|
156
|
+
return {
|
|
157
|
+
host: normalizeHost(host),
|
|
158
|
+
room_id: room.id,
|
|
159
|
+
head_seq: head.seq,
|
|
160
|
+
head_hash: head.hash,
|
|
161
|
+
synced_seq: room.seq,
|
|
162
|
+
remote_seq: options.remoteSeq ?? room.seq,
|
|
163
|
+
subscribed: options.subscribed ?? false,
|
|
164
|
+
unread_count: options.unreadCount ?? 0,
|
|
165
|
+
pending_inbox_count: options.pendingInboxCount ?? 0,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export function roomSummaryFromResponse(host, room, options = {}) {
|
|
169
|
+
const payload = room.envelope?.event.payload;
|
|
170
|
+
return {
|
|
171
|
+
room_id: room.id,
|
|
172
|
+
host: normalizeHost(host),
|
|
173
|
+
topic: room.topic ?? payload?.topic,
|
|
174
|
+
status: room.status,
|
|
175
|
+
visibility: room.visibility ?? payload?.visibility,
|
|
176
|
+
start_time: room.start_time ?? payload?.start_time,
|
|
177
|
+
end_time: room.end_time ?? payload?.end_time,
|
|
178
|
+
tags: room.tags ?? payload?.tags,
|
|
179
|
+
language: room.language ?? payload?.language,
|
|
180
|
+
role: options.role,
|
|
181
|
+
unread_count: options.unreadCount ?? 0,
|
|
182
|
+
pending_inbox_count: options.pendingInboxCount ?? 0,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export function timelineItemFromRecord(record) {
|
|
186
|
+
const event = record.envelope.event;
|
|
187
|
+
const payload = event.payload;
|
|
188
|
+
const message = messagePayload(payload);
|
|
189
|
+
return {
|
|
190
|
+
room_id: record.room_id,
|
|
191
|
+
seq: record.seq,
|
|
192
|
+
event_id: record.envelope.hash,
|
|
193
|
+
type: event.type,
|
|
194
|
+
kind: timelineKind(event.type),
|
|
195
|
+
actor: event.actor,
|
|
196
|
+
created_at: event.created_at,
|
|
197
|
+
received_at: record.received_at,
|
|
198
|
+
summary: summarizePayload(event.type, payload),
|
|
199
|
+
content_type: message?.content_type,
|
|
200
|
+
content: message?.content,
|
|
201
|
+
mentions: event.mentions ?? [],
|
|
202
|
+
references: message?.references ?? [],
|
|
203
|
+
payload,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function timelineKind(type) {
|
|
207
|
+
if (type === eventType.MESSAGE_CREATE)
|
|
208
|
+
return "message";
|
|
209
|
+
if (type.startsWith("room."))
|
|
210
|
+
return "room";
|
|
211
|
+
if (type.startsWith("type."))
|
|
212
|
+
return "type";
|
|
213
|
+
return "custom";
|
|
214
|
+
}
|
|
215
|
+
function summarizePayload(type, payload) {
|
|
216
|
+
if (type === eventType.MESSAGE_CREATE) {
|
|
217
|
+
const message = messagePayload(payload);
|
|
218
|
+
if (typeof message?.content === "string")
|
|
219
|
+
return truncate(message.content, 200);
|
|
220
|
+
}
|
|
221
|
+
if (isRecord(payload)) {
|
|
222
|
+
const summary = payload.summary ?? payload.reason ?? payload.title ?? payload.state;
|
|
223
|
+
if (typeof summary === "string" && summary.trim() !== "") {
|
|
224
|
+
return truncate(summary, 200);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return type;
|
|
228
|
+
}
|
|
229
|
+
function messagePayload(payload) {
|
|
230
|
+
if (!isRecord(payload))
|
|
231
|
+
return undefined;
|
|
232
|
+
if (typeof payload.content_type !== "string")
|
|
233
|
+
return undefined;
|
|
234
|
+
return {
|
|
235
|
+
content_type: payload.content_type,
|
|
236
|
+
content: payload.content,
|
|
237
|
+
references: Array.isArray(payload.references)
|
|
238
|
+
? payload.references.filter((value) => typeof value === "string")
|
|
239
|
+
: undefined,
|
|
240
|
+
extra: isRecord(payload.extra) ? payload.extra : undefined,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function truncate(value, maxLength) {
|
|
244
|
+
return value.length <= maxLength ? value : `${value.slice(0, maxLength - 1)}...`;
|
|
245
|
+
}
|
|
246
|
+
function normalizeHost(host) {
|
|
247
|
+
return host.replace(/\/$/, "");
|
|
248
|
+
}
|
|
249
|
+
function isRecord(value) {
|
|
250
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=local-connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-connector.js","sour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;AAED,SAAS,QAAQ,CAAC,KAAa,EAAE,SAAiB;IAChD,OAAO,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC;AACnF,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/profile.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentId, Envelope, Event } from "./identity.js";
|
|
2
|
+
import type { PrincipalDescriptor } from "./delegation.js";
|
|
2
3
|
export declare const PROFILE_PROTOCOL = "agent-profile/1.0";
|
|
3
4
|
export declare const PROFILE_UPDATE = "profile.update";
|
|
4
5
|
export interface ServiceEndpoint {
|
|
@@ -12,6 +13,14 @@ export interface ProfileLink {
|
|
|
12
13
|
url: string;
|
|
13
14
|
rel: ProfileLinkRel;
|
|
14
15
|
}
|
|
16
|
+
export interface ProfileDelegationHint {
|
|
17
|
+
id?: string;
|
|
18
|
+
principal: PrincipalDescriptor;
|
|
19
|
+
relationship?: string;
|
|
20
|
+
scopes?: string[];
|
|
21
|
+
credential_url: string;
|
|
22
|
+
status_url?: string;
|
|
23
|
+
}
|
|
15
24
|
export interface ProfileUpdatePayload {
|
|
16
25
|
id: AgentId;
|
|
17
26
|
name: string;
|
|
@@ -21,6 +30,7 @@ export interface ProfileUpdatePayload {
|
|
|
21
30
|
capabilities?: string[];
|
|
22
31
|
service_endpoints?: ServiceEndpoint[];
|
|
23
32
|
links?: ProfileLink[];
|
|
33
|
+
delegations?: ProfileDelegationHint[];
|
|
24
34
|
extra?: Record<string, unknown>;
|
|
25
35
|
}
|
|
26
36
|
export interface AgentProfile {
|
|
@@ -33,6 +43,7 @@ export interface AgentProfile {
|
|
|
33
43
|
capabilities?: string[];
|
|
34
44
|
service_endpoints?: ServiceEndpoint[];
|
|
35
45
|
links?: ProfileLink[];
|
|
46
|
+
delegations?: ProfileDelegationHint[];
|
|
36
47
|
extra?: Record<string, unknown>;
|
|
37
48
|
updated_at: number;
|
|
38
49
|
event_id: string;
|
package/dist/profile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,KAAK,EAGN,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,KAAK,EAGN,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,eAAO,MAAM,gBAAgB,sBAAsB,CAAC;AACpD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,eAAe,GACf,aAAa,GACb,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,cAAc,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,mBAAmB,CAAC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,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,uBAAuB,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,oBAAoB,GAC5B,KAAK,CAAC,oBAAoB,CAAC,CAS7B;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GACvC,IAAI,CAuBN;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GACvC,YAAY,CAkBd"}
|
package/dist/profile.js
CHANGED
|
@@ -31,6 +31,7 @@ export function materializeProfile(envelope) {
|
|
|
31
31
|
capabilities: payload.capabilities ?? [],
|
|
32
32
|
service_endpoints: payload.service_endpoints ?? [],
|
|
33
33
|
links: payload.links ?? [],
|
|
34
|
+
delegations: payload.delegations ?? [],
|
|
34
35
|
extra: payload.extra ?? {},
|
|
35
36
|
updated_at: envelope.event.created_at,
|
|
36
37
|
event_id: envelope.hash,
|
package/dist/profile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAIL,WAAW,EACX,cAAc,GACf,MAAM,eAAe,CAAC;
|
|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CAAC;IAChC,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;IACvC,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE;QAClD,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;QACtC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;QAC1B,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;QACrC,QAAQ,EAAE,QAAQ,CAAC,IAAI;KACxB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-protocols",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "TypeScript SDK for Agent Identity, Agent Profile, and Agent Discourse protocols",
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "TypeScript SDK for Agent Identity, Agent Profile, Agent Delegation, and Agent Discourse protocols",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"types": "./dist/profile.d.ts",
|
|
23
23
|
"import": "./dist/profile.js"
|
|
24
24
|
},
|
|
25
|
+
"./delegation": {
|
|
26
|
+
"types": "./dist/delegation.d.ts",
|
|
27
|
+
"import": "./dist/delegation.js"
|
|
28
|
+
},
|
|
25
29
|
"./discourse": {
|
|
26
30
|
"types": "./dist/discourse.d.ts",
|
|
27
31
|
"import": "./dist/discourse.js"
|
|
@@ -29,6 +33,10 @@
|
|
|
29
33
|
"./http-client": {
|
|
30
34
|
"types": "./dist/http-client.d.ts",
|
|
31
35
|
"import": "./dist/http-client.js"
|
|
36
|
+
},
|
|
37
|
+
"./local-connector": {
|
|
38
|
+
"types": "./dist/local-connector.d.ts",
|
|
39
|
+
"import": "./dist/local-connector.js"
|
|
32
40
|
}
|
|
33
41
|
},
|
|
34
42
|
"files": [
|