fauna-api 0.0.0-stage → 1.0.679
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/brands.d.ts +2 -0
- package/dist/brands.js +2 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +121 -0
- package/dist/src/ant/chat.d.ts +130 -0
- package/dist/src/ant/chat.js +467 -0
- package/dist/src/ant/format.d.ts +40 -0
- package/dist/src/ant/format.js +143 -0
- package/dist/src/ant/graph.d.ts +130 -0
- package/dist/src/ant/graph.js +449 -0
- package/dist/src/ant/index.d.ts +16 -0
- package/dist/src/ant/index.js +61 -0
- package/dist/src/ant/persona.d.ts +151 -0
- package/dist/src/ant/persona.js +136 -0
- package/dist/src/ant/timeline.d.ts +283 -0
- package/dist/src/ant/timeline.js +1025 -0
- package/dist/src/authentification.d.ts +45 -0
- package/dist/src/authentification.js +194 -0
- package/dist/src/billing.d.ts +135 -0
- package/dist/src/billing.js +128 -0
- package/dist/src/calendar.d.ts +83 -0
- package/dist/src/calendar.js +133 -0
- package/dist/src/chats.d.ts +113 -0
- package/dist/src/chats.js +100 -0
- package/dist/src/cicada/contacts.d.ts +31 -0
- package/dist/src/cicada/contacts.js +28 -0
- package/dist/src/cicada/conversations.d.ts +73 -0
- package/dist/src/cicada/conversations.js +236 -0
- package/dist/src/cicada/inboxes.d.ts +48 -0
- package/dist/src/cicada/inboxes.js +82 -0
- package/dist/src/cicada/index.d.ts +16 -0
- package/dist/src/cicada/index.js +61 -0
- package/dist/src/cicada/phone.d.ts +48 -0
- package/dist/src/cicada/phone.js +306 -0
- package/dist/src/drive.d.ts +80 -0
- package/dist/src/drive.js +472 -0
- package/dist/src/extensions/index.d.ts +4 -0
- package/dist/src/extensions/index.js +5 -0
- package/dist/src/extensions/web/index.d.ts +6 -0
- package/dist/src/extensions/web/index.js +7 -0
- package/dist/src/extensions/web/session.d.ts +108 -0
- package/dist/src/extensions/web/session.js +470 -0
- package/dist/src/extensions/web/tools.d.ts +13 -0
- package/dist/src/extensions/web/tools.js +72 -0
- package/dist/src/friends.d.ts +39 -0
- package/dist/src/friends.js +119 -0
- package/dist/src/groups.d.ts +82 -0
- package/dist/src/groups.js +269 -0
- package/dist/src/inbox.d.ts +11 -0
- package/dist/src/inbox.js +35 -0
- package/dist/src/integrations.d.ts +52 -0
- package/dist/src/integrations.js +205 -0
- package/dist/src/magpie/explorer.d.ts +14 -0
- package/dist/src/magpie/explorer.js +36 -0
- package/dist/src/magpie/index.d.ts +16 -0
- package/dist/src/magpie/index.js +61 -0
- package/dist/src/magpie/portfolio.d.ts +52 -0
- package/dist/src/magpie/portfolio.js +179 -0
- package/dist/src/magpie/quotes.d.ts +35 -0
- package/dist/src/magpie/quotes.js +47 -0
- package/dist/src/magpie/room.d.ts +61 -0
- package/dist/src/magpie/room.js +238 -0
- package/dist/src/maps.d.ts +159 -0
- package/dist/src/maps.js +171 -0
- package/dist/src/marmot/browser.d.ts +139 -0
- package/dist/src/marmot/browser.js +389 -0
- package/dist/src/marmot/index.d.ts +20 -0
- package/dist/src/marmot/index.js +65 -0
- package/dist/src/marmot/media.d.ts +56 -0
- package/dist/src/marmot/media.js +265 -0
- package/dist/src/marmot/research.d.ts +337 -0
- package/dist/src/marmot/research.js +1138 -0
- package/dist/src/marmot/scraper.d.ts +59 -0
- package/dist/src/marmot/scraper.js +94 -0
- package/dist/src/marmot/web.d.ts +402 -0
- package/dist/src/marmot/web.js +2586 -0
- package/dist/src/marmot/workspace.d.ts +81 -0
- package/dist/src/marmot/workspace.js +263 -0
- package/dist/src/parrot/agent.d.ts +53 -0
- package/dist/src/parrot/agent.js +93 -0
- package/dist/src/parrot/chat.d.ts +84 -0
- package/dist/src/parrot/chat.js +237 -0
- package/dist/src/parrot/format.d.ts +128 -0
- package/dist/src/parrot/format.js +639 -0
- package/dist/src/parrot/generative.d.ts +261 -0
- package/dist/src/parrot/generative.js +185 -0
- package/dist/src/parrot/index.d.ts +22 -0
- package/dist/src/parrot/index.js +67 -0
- package/dist/src/parrot/room.d.ts +225 -0
- package/dist/src/parrot/room.js +466 -0
- package/dist/src/parrot/routing.d.ts +90 -0
- package/dist/src/parrot/routing.js +78 -0
- package/dist/src/parrot/share.d.ts +126 -0
- package/dist/src/parrot/share.js +261 -0
- package/dist/src/parrot/socket.d.ts +41 -0
- package/dist/src/parrot/socket.js +478 -0
- package/dist/src/payments.d.ts +73 -0
- package/dist/src/payments.js +107 -0
- package/dist/src/private/cards.css +75 -0
- package/dist/src/rooms.d.ts +76 -0
- package/dist/src/rooms.js +168 -0
- package/dist/src/shared/schema.d.ts +24 -0
- package/dist/src/shared/schema.js +1 -0
- package/dist/src/shared/server.d.ts +65 -0
- package/dist/src/shared/server.js +302 -0
- package/dist/src/termite/environment.d.ts +110 -0
- package/dist/src/termite/environment.js +263 -0
- package/dist/src/termite/index.d.ts +14 -0
- package/dist/src/termite/index.js +59 -0
- package/dist/src/termite/os.d.ts +326 -0
- package/dist/src/termite/os.js +572 -0
- package/dist/src/termite/versioning.d.ts +94 -0
- package/dist/src/termite/versioning.js +217 -0
- package/dist/src/tickets.d.ts +43 -0
- package/dist/src/tickets.js +138 -0
- package/dist/src/travel.d.ts +85 -0
- package/dist/src/travel.js +44 -0
- package/dist/src/ui/authentification.d.ts +24 -0
- package/dist/src/ui/authentification.js +177 -0
- package/dist/src/ui/brands.css +11 -0
- package/dist/src/ui/brands.d.ts +7 -0
- package/dist/src/ui/brands.js +14 -0
- package/dist/src/ui/browser.d.ts +74 -0
- package/dist/src/ui/browser.js +470 -0
- package/dist/src/ui/chat.d.ts +183 -0
- package/dist/src/ui/chat.js +2379 -0
- package/dist/src/ui/chatPanel.d.ts +109 -0
- package/dist/src/ui/chatPanel.js +768 -0
- package/dist/src/ui/chatSequence.d.ts +36 -0
- package/dist/src/ui/chatSequence.js +42 -0
- package/dist/src/ui/crown.d.ts +19 -0
- package/dist/src/ui/crown.js +199 -0
- package/dist/src/ui/cursor.d.ts +73 -0
- package/dist/src/ui/cursor.js +175 -0
- package/dist/src/ui/device.d.ts +33 -0
- package/dist/src/ui/device.js +49 -0
- package/dist/src/ui/drive.d.ts +69 -0
- package/dist/src/ui/drive.js +1243 -0
- package/dist/src/ui/generative.d.ts +39 -0
- package/dist/src/ui/generative.js +313 -0
- package/dist/src/ui/hover.d.ts +6 -0
- package/dist/src/ui/hover.js +210 -0
- package/dist/src/ui/index.d.ts +42 -0
- package/dist/src/ui/index.js +87 -0
- package/dist/src/ui/integrations.d.ts +13 -0
- package/dist/src/ui/integrations.js +175 -0
- package/dist/src/ui/maps.d.ts +87 -0
- package/dist/src/ui/maps.js +547 -0
- package/dist/src/ui/roster.d.ts +32 -0
- package/dist/src/ui/roster.js +163 -0
- package/dist/src/ui/talk.d.ts +12 -0
- package/dist/src/ui/talk.js +560 -0
- package/dist/src/ui/tickets.d.ts +13 -0
- package/dist/src/ui/tickets.js +966 -0
- package/dist/src/ui/toast.d.ts +7 -0
- package/dist/src/ui/toast.js +258 -0
- package/dist/src/ui/tokenText.d.ts +18 -0
- package/dist/src/ui/tokenText.js +96 -0
- package/dist/src/ui/tokenized.d.ts +42 -0
- package/dist/src/ui/tokenized.js +622 -0
- package/dist/src/ui/ui.css +4763 -0
- package/dist/src/ui/view.d.ts +23 -0
- package/dist/src/ui/view.js +584 -0
- package/dist/src/view.d.ts +113 -0
- package/dist/src/view.js +386 -0
- package/dist/src/webhooks.d.ts +66 -0
- package/dist/src/webhooks.js +78 -0
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +1 -0
- package/package.json +87 -4
- package/README.md +0 -3
package/dist/brands.d.ts
ADDED
package/dist/brands.js
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as AuthentificationAPI from "./src/authentification.js";
|
|
2
|
+
import * as IntegrationsAPI from "./src/integrations.js";
|
|
3
|
+
import * as DriveAPI from "./src/drive.js";
|
|
4
|
+
import * as GroupsAPI from "./src/groups.js";
|
|
5
|
+
import * as InboxAPI from "./src/inbox.js";
|
|
6
|
+
import * as BillingAPI from "./src/billing.js";
|
|
7
|
+
import * as WebhooksAPI from "./src/webhooks.js";
|
|
8
|
+
import * as MapsAPI from "./src/maps.js";
|
|
9
|
+
import * as TravelAPI from "./src/travel.js";
|
|
10
|
+
import * as PaymentsAPI from "./src/payments.js";
|
|
11
|
+
import * as FriendsAPI from "./src/friends.js";
|
|
12
|
+
import * as ChatsAPI from "./src/chats.js";
|
|
13
|
+
import * as CalendarAPI from "./src/calendar.js";
|
|
14
|
+
import { Ant as AntAPI } from "./src/ant/index.js";
|
|
15
|
+
import { Parrot as ParrotAPI } from "./src/parrot/index.js";
|
|
16
|
+
import { Marmot as MarmotAPI } from "./src/marmot/index.js";
|
|
17
|
+
import { Magpie as MagpieAPI } from "./src/magpie/index.js";
|
|
18
|
+
import { Cicada as CicadaAPI } from "./src/cicada/index.js";
|
|
19
|
+
import { Termite as TermiteAPI } from "./src/termite/index.js";
|
|
20
|
+
import { Extensions as ExtensionsAPI } from "./src/extensions/index.js";
|
|
21
|
+
import * as LiveAPI from "./src/shared/server.js";
|
|
22
|
+
import * as TicketsAPI from "./src/tickets.js";
|
|
23
|
+
import * as RoomsAPI from "./src/rooms.js";
|
|
24
|
+
import * as ViewAPI from "./src/view.js";
|
|
25
|
+
import type * as SchemaAPI from "./src/shared/schema.js";
|
|
26
|
+
export declare namespace Fauna {
|
|
27
|
+
function setRoute(route: string): void;
|
|
28
|
+
function getIP(): string;
|
|
29
|
+
function getPort(): number;
|
|
30
|
+
function getRoute(): string;
|
|
31
|
+
function getURL(): string;
|
|
32
|
+
function ping(): Promise<number>;
|
|
33
|
+
export import Authentification = AuthentificationAPI;
|
|
34
|
+
export import Integrations = IntegrationsAPI;
|
|
35
|
+
export import Drive = DriveAPI;
|
|
36
|
+
export import Groups = GroupsAPI;
|
|
37
|
+
export import Inbox = InboxAPI;
|
|
38
|
+
export import Billing = BillingAPI;
|
|
39
|
+
export import Webhooks = WebhooksAPI;
|
|
40
|
+
export import Maps = MapsAPI;
|
|
41
|
+
export import Travel = TravelAPI;
|
|
42
|
+
export import Payments = PaymentsAPI;
|
|
43
|
+
export import Friends = FriendsAPI;
|
|
44
|
+
export import Chats = ChatsAPI;
|
|
45
|
+
export import Calendar = CalendarAPI;
|
|
46
|
+
export import Ant = AntAPI;
|
|
47
|
+
export import Parrot = ParrotAPI;
|
|
48
|
+
export import Marmot = MarmotAPI;
|
|
49
|
+
export import Magpie = MagpieAPI;
|
|
50
|
+
export import Cicada = CicadaAPI;
|
|
51
|
+
export import Termite = TermiteAPI;
|
|
52
|
+
export import Extensions = ExtensionsAPI;
|
|
53
|
+
export import Live = LiveAPI;
|
|
54
|
+
export import Tickets = TicketsAPI;
|
|
55
|
+
export import Rooms = RoomsAPI;
|
|
56
|
+
export import View = ViewAPI;
|
|
57
|
+
type Schema = SchemaAPI.Schema;
|
|
58
|
+
namespace Schema {
|
|
59
|
+
type ObjectSchema = SchemaAPI.ObjectSchema;
|
|
60
|
+
type ArraySchema = SchemaAPI.ArraySchema;
|
|
61
|
+
type PrimitiveSchema = SchemaAPI.PrimitiveSchema;
|
|
62
|
+
}
|
|
63
|
+
function throttlingPromise<T>(tasks: (() => Promise<T>)[], max: number): Promise<T[]>;
|
|
64
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import * as AuthentificationAPI from "./src/authentification.js";
|
|
2
|
+
import * as IntegrationsAPI from "./src/integrations.js";
|
|
3
|
+
import * as DriveAPI from "./src/drive.js";
|
|
4
|
+
import * as GroupsAPI from "./src/groups.js";
|
|
5
|
+
import * as InboxAPI from "./src/inbox.js";
|
|
6
|
+
import * as BillingAPI from "./src/billing.js";
|
|
7
|
+
import * as WebhooksAPI from "./src/webhooks.js";
|
|
8
|
+
import * as MapsAPI from "./src/maps.js";
|
|
9
|
+
import * as TravelAPI from "./src/travel.js";
|
|
10
|
+
import * as PaymentsAPI from "./src/payments.js";
|
|
11
|
+
import * as FriendsAPI from "./src/friends.js";
|
|
12
|
+
import * as ChatsAPI from "./src/chats.js";
|
|
13
|
+
import * as CalendarAPI from "./src/calendar.js";
|
|
14
|
+
import { Ant as AntAPI } from "./src/ant/index.js";
|
|
15
|
+
import { Parrot as ParrotAPI } from "./src/parrot/index.js";
|
|
16
|
+
import { Marmot as MarmotAPI } from "./src/marmot/index.js";
|
|
17
|
+
import { Magpie as MagpieAPI } from "./src/magpie/index.js";
|
|
18
|
+
import { Cicada as CicadaAPI } from "./src/cicada/index.js";
|
|
19
|
+
import { Termite as TermiteAPI } from "./src/termite/index.js";
|
|
20
|
+
import { Extensions as ExtensionsAPI } from "./src/extensions/index.js";
|
|
21
|
+
import * as LiveAPI from "./src/shared/server.js";
|
|
22
|
+
import * as TicketsAPI from "./src/tickets.js";
|
|
23
|
+
import * as RoomsAPI from "./src/rooms.js";
|
|
24
|
+
import * as ViewAPI from "./src/view.js";
|
|
25
|
+
export var Fauna;
|
|
26
|
+
(function (Fauna) {
|
|
27
|
+
var PREFIX = 'https://';
|
|
28
|
+
var IP = 'api.faunakit.com';
|
|
29
|
+
var PORT = 443;
|
|
30
|
+
function setRoute(route) {
|
|
31
|
+
const parts_0 = route.split('//');
|
|
32
|
+
if (parts_0.length > 1) {
|
|
33
|
+
PREFIX = parts_0[0] + '//';
|
|
34
|
+
const parts_1 = parts_0[1].split(':');
|
|
35
|
+
if (parts_1.length > 1) {
|
|
36
|
+
IP = parts_1[0];
|
|
37
|
+
PORT = Number(parts_1[1]);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
IP = parts_1[0];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const parts_1 = parts_0[0].split(':');
|
|
45
|
+
if (parts_1.length > 1) {
|
|
46
|
+
IP = parts_1[0];
|
|
47
|
+
PORT = Number(parts_1[1]);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
IP = parts_1[0];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
Fauna.setRoute = setRoute;
|
|
55
|
+
function getIP() {
|
|
56
|
+
return IP;
|
|
57
|
+
}
|
|
58
|
+
Fauna.getIP = getIP;
|
|
59
|
+
function getPort() {
|
|
60
|
+
return PORT;
|
|
61
|
+
}
|
|
62
|
+
Fauna.getPort = getPort;
|
|
63
|
+
function getRoute() {
|
|
64
|
+
return IP + ':' + PORT;
|
|
65
|
+
}
|
|
66
|
+
Fauna.getRoute = getRoute;
|
|
67
|
+
function getURL() {
|
|
68
|
+
return PREFIX + IP + ':' + PORT;
|
|
69
|
+
}
|
|
70
|
+
Fauna.getURL = getURL;
|
|
71
|
+
async function ping() {
|
|
72
|
+
const start = Date.now();
|
|
73
|
+
await fetch(`${getURL()}/`);
|
|
74
|
+
return Date.now() - start;
|
|
75
|
+
}
|
|
76
|
+
Fauna.ping = ping;
|
|
77
|
+
Fauna.Authentification = AuthentificationAPI;
|
|
78
|
+
Fauna.Integrations = IntegrationsAPI;
|
|
79
|
+
Fauna.Drive = DriveAPI;
|
|
80
|
+
Fauna.Groups = GroupsAPI;
|
|
81
|
+
Fauna.Inbox = InboxAPI;
|
|
82
|
+
Fauna.Billing = BillingAPI;
|
|
83
|
+
Fauna.Webhooks = WebhooksAPI;
|
|
84
|
+
Fauna.Maps = MapsAPI;
|
|
85
|
+
Fauna.Travel = TravelAPI;
|
|
86
|
+
Fauna.Payments = PaymentsAPI;
|
|
87
|
+
Fauna.Friends = FriendsAPI;
|
|
88
|
+
Fauna.Chats = ChatsAPI;
|
|
89
|
+
Fauna.Calendar = CalendarAPI;
|
|
90
|
+
Fauna.Ant = AntAPI;
|
|
91
|
+
Fauna.Parrot = ParrotAPI;
|
|
92
|
+
Fauna.Marmot = MarmotAPI;
|
|
93
|
+
Fauna.Magpie = MagpieAPI;
|
|
94
|
+
Fauna.Cicada = CicadaAPI;
|
|
95
|
+
Fauna.Termite = TermiteAPI;
|
|
96
|
+
Fauna.Extensions = ExtensionsAPI;
|
|
97
|
+
Fauna.Live = LiveAPI;
|
|
98
|
+
Fauna.Tickets = TicketsAPI;
|
|
99
|
+
Fauna.Rooms = RoomsAPI;
|
|
100
|
+
Fauna.View = ViewAPI;
|
|
101
|
+
async function throttlingPromise(tasks, max) {
|
|
102
|
+
const results = [];
|
|
103
|
+
let index = 0;
|
|
104
|
+
let running = [];
|
|
105
|
+
async function run() {
|
|
106
|
+
if (index >= tasks.length)
|
|
107
|
+
return;
|
|
108
|
+
const i = index++;
|
|
109
|
+
const task = tasks[i];
|
|
110
|
+
const result = await task();
|
|
111
|
+
results[i] = result;
|
|
112
|
+
await run();
|
|
113
|
+
}
|
|
114
|
+
for (let i = 0; i < Math.min(max, tasks.length); i++) {
|
|
115
|
+
running.push(run());
|
|
116
|
+
}
|
|
117
|
+
await Promise.all(running);
|
|
118
|
+
return results;
|
|
119
|
+
}
|
|
120
|
+
Fauna.throttlingPromise = throttlingPromise;
|
|
121
|
+
})(Fauna || (Fauna = {}));
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Identity } from "./persona.js";
|
|
2
|
+
import { ApiKey, Credentials } from "../authentification.js";
|
|
3
|
+
import { Group } from "../groups.js";
|
|
4
|
+
import { Authorization, Presence, Room, Hooks as ServerHooks } from "../shared/server.js";
|
|
5
|
+
import { ChatRoom, RoomHooks } from "../parrot/room.js";
|
|
6
|
+
import { StreamEvent, type Content, type Tool } from "../parrot/generative.js";
|
|
7
|
+
import { Memory } from "../parrot/agent.js";
|
|
8
|
+
import type { Repository } from "../termite/versioning.js";
|
|
9
|
+
export type ChatLast = {
|
|
10
|
+
parts: unknown[];
|
|
11
|
+
role: string;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
position: number;
|
|
14
|
+
author?: {
|
|
15
|
+
email: string;
|
|
16
|
+
displayName?: string;
|
|
17
|
+
icon?: string;
|
|
18
|
+
};
|
|
19
|
+
model?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function listChats(authorization: Credentials | ApiKey, opts?: {
|
|
22
|
+
group?: Group;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
name: string;
|
|
25
|
+
id: string;
|
|
26
|
+
last: ChatLast | null;
|
|
27
|
+
}[]>;
|
|
28
|
+
/** Create a chat. `repository` (the owner's) is the computer its personas start from. */
|
|
29
|
+
export declare function createChat(authorization: Credentials | ApiKey, name: string, opts?: {
|
|
30
|
+
group?: Group;
|
|
31
|
+
audience?: string[];
|
|
32
|
+
repository?: Repository;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
name: string;
|
|
35
|
+
id: string;
|
|
36
|
+
}>;
|
|
37
|
+
export declare function deleteChat(authorization: Credentials | ApiKey, id: string, opts?: {
|
|
38
|
+
group?: Group;
|
|
39
|
+
}): Promise<void>;
|
|
40
|
+
export declare function moveChatToGroup(authorization: Credentials | ApiKey, id: string, groupId: string): Promise<{
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
groupId: string;
|
|
44
|
+
remapped: boolean;
|
|
45
|
+
}>;
|
|
46
|
+
export declare function renameChat(authorization: Credentials | ApiKey, id: string, name: string, opts?: {
|
|
47
|
+
group?: Group;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
export declare class Agent {
|
|
50
|
+
readonly parent: AntChatRoom;
|
|
51
|
+
readonly id: string;
|
|
52
|
+
persona: Identity;
|
|
53
|
+
/** A repository picked for this agent, used directly; null when it follows the chat's. */
|
|
54
|
+
repository: number | null;
|
|
55
|
+
constructor(parent: AntChatRoom, id: string, persona: Identity, repository?: number | null);
|
|
56
|
+
/** Pick a repository for this agent (used directly), or null to follow the chat's again. */
|
|
57
|
+
setRepository(repository: Repository | null): void;
|
|
58
|
+
observe(content: string): Promise<Memory>;
|
|
59
|
+
/** Stream a reply as this agent, under the room's own authorization. `tools` answer the persona's calls to them. */
|
|
60
|
+
generate(messages: Content[], opts?: {
|
|
61
|
+
signal?: AbortSignal;
|
|
62
|
+
tools?: Tool[];
|
|
63
|
+
}): AsyncGenerator<StreamEvent>;
|
|
64
|
+
toJSON(): {
|
|
65
|
+
id: string;
|
|
66
|
+
persona: Identity;
|
|
67
|
+
};
|
|
68
|
+
static fromJSON(json: any, parent: AntChatRoom): Agent;
|
|
69
|
+
}
|
|
70
|
+
export declare class AntChatRoom extends Room {
|
|
71
|
+
chatId: string;
|
|
72
|
+
name: string;
|
|
73
|
+
agents: Map<string, Agent>;
|
|
74
|
+
/** The owner's Termite repository personas start from, by id; null when it has none. */
|
|
75
|
+
repository: number | null;
|
|
76
|
+
/** Who owns the chat: `credentials:{id}` or `group:{id}`. */
|
|
77
|
+
owner: string;
|
|
78
|
+
private readonly repositoryWatchers;
|
|
79
|
+
constructor(endpoint: string, ws: WebSocket, authorization: Authorization, id: string);
|
|
80
|
+
/** The group that owns the chat, whose repositories it takes; undefined for a person's. */
|
|
81
|
+
get group(): Group | undefined;
|
|
82
|
+
/** Attach one of the owner's repositories, or null to detach. Personas' forks of the old one are deleted. */
|
|
83
|
+
setRepository(repository: Repository | null): Promise<void>;
|
|
84
|
+
/** Hear about every repository change, from anyone in the room. Returns a function that stops listening. */
|
|
85
|
+
watchRepository(listener: (repository: number | null) => void): () => void;
|
|
86
|
+
private applyRepository;
|
|
87
|
+
hydrate(state: any): void;
|
|
88
|
+
handleEvent(packet: any): boolean | Promise<void>;
|
|
89
|
+
upsertAgent(identity: Identity): Agent;
|
|
90
|
+
removeAgent(id: string): void;
|
|
91
|
+
/** Lazily mint/open the architect Parrot ChatRoom. */
|
|
92
|
+
getChat(hooks?: RoomHooks): Promise<{
|
|
93
|
+
room: ChatRoom;
|
|
94
|
+
self: Presence;
|
|
95
|
+
chatId: string;
|
|
96
|
+
}>;
|
|
97
|
+
static connect(authorization: Credentials | ApiKey, target: {
|
|
98
|
+
id: string;
|
|
99
|
+
}, opts?: {
|
|
100
|
+
group?: Group;
|
|
101
|
+
hooks?: ServerHooks;
|
|
102
|
+
server?: string;
|
|
103
|
+
}): Promise<{
|
|
104
|
+
room: AntChatRoom;
|
|
105
|
+
self: Presence;
|
|
106
|
+
}>;
|
|
107
|
+
static join(authorization: Credentials | ApiKey, target: {
|
|
108
|
+
accessCode: string;
|
|
109
|
+
}, hooks?: ServerHooks): Promise<{
|
|
110
|
+
room: AntChatRoom;
|
|
111
|
+
self: Presence;
|
|
112
|
+
}>;
|
|
113
|
+
}
|
|
114
|
+
/** Write a standalone fact onto this agent's Parrot graph (`ant/chats/…/memory`). */
|
|
115
|
+
export declare function observeAgent(authorization: Credentials | ApiKey, chatId: string, agentId: string, content: string, opts?: {
|
|
116
|
+
group?: Group;
|
|
117
|
+
accessCode?: string;
|
|
118
|
+
}): Promise<Memory>;
|
|
119
|
+
/**
|
|
120
|
+
* Stream a persona reply for one chat agent (memories under ant/chats/…), with
|
|
121
|
+
* `tool` and `tool-result` events for its own tools. `tools` are answered here
|
|
122
|
+
* when the persona calls them, like `use_desktop` asking for a computer.
|
|
123
|
+
*/
|
|
124
|
+
export declare function generateAgent(authorization: Credentials | ApiKey, chatId: string, agentId: string, messages: Content[], opts?: {
|
|
125
|
+
group?: Group;
|
|
126
|
+
accessCode?: string;
|
|
127
|
+
signal?: AbortSignal;
|
|
128
|
+
tools?: Tool[];
|
|
129
|
+
}): AsyncGenerator<StreamEvent>;
|
|
130
|
+
export { AntChatRoom as ChatRoom };
|