@jsm-mit/agent-platform-canister-package 0.0.2 → 0.2.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/declarations/agent-platform-canister/agent-platform-canister.did +19 -10
- package/declarations/agent-platform-canister/agent-platform-canister.did.d.ts +88 -73
- package/declarations/agent-platform-canister/agent-platform-canister.did.js +104 -94
- package/dist/actors/admin-actor.d.ts +25 -0
- package/dist/actors/admin-actor.d.ts.map +1 -1
- package/dist/actors/admin-actor.js +32 -0
- package/dist/actors/agent-configs-actor.d.ts +13 -3
- package/dist/actors/agent-configs-actor.d.ts.map +1 -1
- package/dist/actors/agent-configs-actor.js +19 -5
- package/dist/interfaces.d.ts +14 -10
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/mappers.d.ts +3 -5
- package/dist/mappers.d.ts.map +1 -1
- package/dist/mappers.js +2 -10
- package/package.json +10 -6
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
type UpsertAgentConfigArgs =
|
|
2
2
|
record {
|
|
3
|
-
channelType: ChannelType;
|
|
4
3
|
customConfigJson: opt text;
|
|
5
4
|
disclosesAsAi: bool;
|
|
6
5
|
id: AgentId;
|
|
7
6
|
name: text;
|
|
7
|
+
owner: opt principal;
|
|
8
8
|
persona: text;
|
|
9
9
|
tools: vec ToolBinding;
|
|
10
10
|
};
|
|
@@ -13,6 +13,11 @@ type ToolBinding =
|
|
|
13
13
|
paramsJson: text;
|
|
14
14
|
tool: text;
|
|
15
15
|
};
|
|
16
|
+
type SetAgentPersonaArgs =
|
|
17
|
+
record {
|
|
18
|
+
agentId: AgentId;
|
|
19
|
+
persona: text;
|
|
20
|
+
};
|
|
16
21
|
type Result_6 =
|
|
17
22
|
variant {
|
|
18
23
|
err: Error;
|
|
@@ -31,7 +36,7 @@ type Result_4 =
|
|
|
31
36
|
type Result_3 =
|
|
32
37
|
variant {
|
|
33
38
|
err: Error;
|
|
34
|
-
ok: vec
|
|
39
|
+
ok: vec AgentConfigView;
|
|
35
40
|
};
|
|
36
41
|
type Result_2 =
|
|
37
42
|
variant {
|
|
@@ -46,7 +51,7 @@ type Result_1 =
|
|
|
46
51
|
type Result =
|
|
47
52
|
variant {
|
|
48
53
|
err: Error;
|
|
49
|
-
ok:
|
|
54
|
+
ok: AgentConfigView;
|
|
50
55
|
};
|
|
51
56
|
type MessageBatchEntry =
|
|
52
57
|
record {
|
|
@@ -89,38 +94,42 @@ type ChatMessage =
|
|
|
89
94
|
toolCallId: opt text;
|
|
90
95
|
toolName: opt text;
|
|
91
96
|
};
|
|
92
|
-
type ChannelType =
|
|
93
|
-
variant {
|
|
94
|
-
chat;
|
|
95
|
-
whatsapp;
|
|
96
|
-
};
|
|
97
97
|
type AppendMessageBatchArgs = record {entries: vec MessageBatchEntry;};
|
|
98
|
+
type AppArgs = record {"principal": principal;};
|
|
98
99
|
type AgentId = text;
|
|
99
|
-
type
|
|
100
|
+
type AgentConfigView =
|
|
100
101
|
record {
|
|
101
|
-
channelType: opt ChannelType;
|
|
102
102
|
createdAt: int;
|
|
103
|
+
createdBy: opt principal;
|
|
103
104
|
customConfigJson: opt text;
|
|
104
105
|
disclosesAsAi: bool;
|
|
105
106
|
id: AgentId;
|
|
106
107
|
name: text;
|
|
108
|
+
owner: opt principal;
|
|
107
109
|
persona: text;
|
|
108
110
|
tools: vec ToolBinding;
|
|
109
111
|
updatedAt: int;
|
|
110
112
|
};
|
|
111
113
|
service : {
|
|
112
114
|
addAdmin: ("principal": principal) -> (Result_1);
|
|
115
|
+
/// Trusts another app's canister with agents of its own (Sultana's core). Admin only.
|
|
116
|
+
addApp: (args: AppArgs) -> (Result_1);
|
|
113
117
|
appendMessageBatch: (args: AppendMessageBatchArgs) -> (Result_6);
|
|
114
118
|
clearLogs: () -> ();
|
|
115
119
|
deleteAgentConfig: (id: AgentId) -> (Result_6);
|
|
116
120
|
getAdmins: () -> (Result_5) query;
|
|
117
121
|
getAgentConfig: (id: AgentId) -> (Result) query;
|
|
122
|
+
getApps: () -> (Result_5) query;
|
|
118
123
|
getConversationHistory: (args: GetConversationHistoryArgs) ->
|
|
119
124
|
(Result_4) query;
|
|
120
125
|
getLogs: () -> (text) query;
|
|
121
126
|
listAgentConfigs: (limit: nat) -> (Result_3) query;
|
|
122
127
|
registerAsAdmin: () -> (Result_2);
|
|
123
128
|
removeAdmin: ("principal": principal) -> (Result_1);
|
|
129
|
+
removeApp: (args: AppArgs) -> (Result_1);
|
|
130
|
+
/// The one field an agent's owner may change — the salon owner editing what their
|
|
131
|
+
/// receptionist says. Admins and the creating app may use it too.
|
|
132
|
+
setAgentPersona: (args: SetAgentPersonaArgs) -> (Result);
|
|
124
133
|
setLoggingEnabled: (enabled: bool) -> (Result_1);
|
|
125
134
|
upsertAgentConfig: (args: UpsertAgentConfigArgs) -> (Result);
|
|
126
135
|
whoAmI: () -> (principal) query;
|
|
@@ -1,89 +1,104 @@
|
|
|
1
|
-
import type { Principal } from
|
|
2
|
-
import type { ActorMethod } from
|
|
3
|
-
import type { IDL } from
|
|
1
|
+
import type { Principal } from '@icp-sdk/core/principal';
|
|
2
|
+
import type { ActorMethod } from '@icp-sdk/core/agent';
|
|
3
|
+
import type { IDL } from '@icp-sdk/core/candid';
|
|
4
4
|
|
|
5
|
-
export interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
export interface AgentConfigView {
|
|
6
|
+
'id' : AgentId,
|
|
7
|
+
'tools' : Array<ToolBinding>,
|
|
8
|
+
'owner' : [] | [Principal],
|
|
9
|
+
'name' : string,
|
|
10
|
+
'createdAt' : bigint,
|
|
11
|
+
'createdBy' : [] | [Principal],
|
|
12
|
+
'updatedAt' : bigint,
|
|
13
|
+
'persona' : string,
|
|
14
|
+
'disclosesAsAi' : boolean,
|
|
15
|
+
'customConfigJson' : [] | [string],
|
|
15
16
|
}
|
|
16
17
|
export type AgentId = string;
|
|
17
|
-
export interface
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
export type ChannelType = { chat: null } | { whatsapp: null };
|
|
18
|
+
export interface AppArgs { 'principal' : Principal }
|
|
19
|
+
export interface AppendMessageBatchArgs { 'entries' : Array<MessageBatchEntry> }
|
|
21
20
|
export interface ChatMessage {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
'content' : string,
|
|
22
|
+
'role' : ChatMessageRole,
|
|
23
|
+
'timestamp' : bigint,
|
|
24
|
+
'toolName' : [] | [string],
|
|
25
|
+
'toolCallId' : [] | [string],
|
|
27
26
|
}
|
|
28
|
-
export type ChatMessageRole =
|
|
29
|
-
|
|
27
|
+
export type ChatMessageRole = { 'tool' : null } |
|
|
28
|
+
{ 'user' : null } |
|
|
29
|
+
{ 'assistant' : null };
|
|
30
30
|
export type ConversationId = string;
|
|
31
|
-
export interface Error {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
| { NotAuthorized: string }
|
|
40
|
-
| { InvalidData: string }
|
|
41
|
-
| { AlreadyExists: null }
|
|
42
|
-
| { ReturnsNull: null };
|
|
31
|
+
export interface Error { 'details' : ErrorDetails, 'logsJson' : string }
|
|
32
|
+
export type ErrorDetails = { 'InterCanisterConnectionError' : null } |
|
|
33
|
+
{ 'RemoteCanisterError' : string } |
|
|
34
|
+
{ 'NotFound' : null } |
|
|
35
|
+
{ 'NotAuthorized' : string } |
|
|
36
|
+
{ 'InvalidData' : string } |
|
|
37
|
+
{ 'AlreadyExists' : null } |
|
|
38
|
+
{ 'ReturnsNull' : null };
|
|
43
39
|
export interface GetConversationHistoryArgs {
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
'limit' : bigint,
|
|
41
|
+
'conversationId' : ConversationId,
|
|
46
42
|
}
|
|
47
43
|
export interface MessageBatchEntry {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
export type Result = { ok: AgentConfig } | { err: Error };
|
|
53
|
-
export type Result_1 = { ok: boolean } | { err: Error };
|
|
54
|
-
export type Result_2 = { ok: Principal } | { err: Error };
|
|
55
|
-
export type Result_3 = { ok: Array<AgentConfig> } | { err: Error };
|
|
56
|
-
export type Result_4 = { ok: Array<ChatMessage> } | { err: Error };
|
|
57
|
-
export type Result_5 = { ok: Array<Principal> } | { err: Error };
|
|
58
|
-
export type Result_6 = { ok: null } | { err: Error };
|
|
59
|
-
export interface ToolBinding {
|
|
60
|
-
paramsJson: string;
|
|
61
|
-
tool: string;
|
|
44
|
+
'agentId' : AgentId,
|
|
45
|
+
'conversationId' : ConversationId,
|
|
46
|
+
'message' : ChatMessage,
|
|
62
47
|
}
|
|
48
|
+
export type Result = { 'ok' : AgentConfigView } |
|
|
49
|
+
{ 'err' : Error };
|
|
50
|
+
export type Result_1 = { 'ok' : boolean } |
|
|
51
|
+
{ 'err' : Error };
|
|
52
|
+
export type Result_2 = { 'ok' : Principal } |
|
|
53
|
+
{ 'err' : Error };
|
|
54
|
+
export type Result_3 = { 'ok' : Array<AgentConfigView> } |
|
|
55
|
+
{ 'err' : Error };
|
|
56
|
+
export type Result_4 = { 'ok' : Array<ChatMessage> } |
|
|
57
|
+
{ 'err' : Error };
|
|
58
|
+
export type Result_5 = { 'ok' : Array<Principal> } |
|
|
59
|
+
{ 'err' : Error };
|
|
60
|
+
export type Result_6 = { 'ok' : null } |
|
|
61
|
+
{ 'err' : Error };
|
|
62
|
+
export interface SetAgentPersonaArgs { 'agentId' : AgentId, 'persona' : string }
|
|
63
|
+
export interface ToolBinding { 'paramsJson' : string, 'tool' : string }
|
|
63
64
|
export interface UpsertAgentConfigArgs {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
'id' : AgentId,
|
|
66
|
+
'tools' : Array<ToolBinding>,
|
|
67
|
+
'owner' : [] | [Principal],
|
|
68
|
+
'name' : string,
|
|
69
|
+
'persona' : string,
|
|
70
|
+
'disclosesAsAi' : boolean,
|
|
71
|
+
'customConfigJson' : [] | [string],
|
|
71
72
|
}
|
|
72
73
|
export interface _SERVICE {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
'addAdmin' : ActorMethod<[Principal], Result_1>,
|
|
75
|
+
/**
|
|
76
|
+
* / Trusts another app's canister with agents of its own (Sultana's core). Admin only.
|
|
77
|
+
*/
|
|
78
|
+
'addApp' : ActorMethod<[AppArgs], Result_1>,
|
|
79
|
+
'appendMessageBatch' : ActorMethod<[AppendMessageBatchArgs], Result_6>,
|
|
80
|
+
'clearLogs' : ActorMethod<[], undefined>,
|
|
81
|
+
'deleteAgentConfig' : ActorMethod<[AgentId], Result_6>,
|
|
82
|
+
'getAdmins' : ActorMethod<[], Result_5>,
|
|
83
|
+
'getAgentConfig' : ActorMethod<[AgentId], Result>,
|
|
84
|
+
'getApps' : ActorMethod<[], Result_5>,
|
|
85
|
+
'getConversationHistory' : ActorMethod<
|
|
86
|
+
[GetConversationHistoryArgs],
|
|
87
|
+
Result_4
|
|
88
|
+
>,
|
|
89
|
+
'getLogs' : ActorMethod<[], string>,
|
|
90
|
+
'listAgentConfigs' : ActorMethod<[bigint], Result_3>,
|
|
91
|
+
'registerAsAdmin' : ActorMethod<[], Result_2>,
|
|
92
|
+
'removeAdmin' : ActorMethod<[Principal], Result_1>,
|
|
93
|
+
'removeApp' : ActorMethod<[AppArgs], Result_1>,
|
|
94
|
+
/**
|
|
95
|
+
* / The one field an agent's owner may change — the salon owner editing what their
|
|
96
|
+
* / receptionist says. Admins and the creating app may use it too.
|
|
97
|
+
*/
|
|
98
|
+
'setAgentPersona' : ActorMethod<[SetAgentPersonaArgs], Result>,
|
|
99
|
+
'setLoggingEnabled' : ActorMethod<[boolean], Result_1>,
|
|
100
|
+
'upsertAgentConfig' : ActorMethod<[UpsertAgentConfigArgs], Result>,
|
|
101
|
+
'whoAmI' : ActorMethod<[], Principal>,
|
|
87
102
|
}
|
|
88
103
|
export declare const idlFactory: IDL.InterfaceFactory;
|
|
89
104
|
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -1,96 +1,106 @@
|
|
|
1
1
|
export const idlFactory = ({ IDL }) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
2
|
+
const ErrorDetails = IDL.Variant({
|
|
3
|
+
'InterCanisterConnectionError' : IDL.Null,
|
|
4
|
+
'RemoteCanisterError' : IDL.Text,
|
|
5
|
+
'NotFound' : IDL.Null,
|
|
6
|
+
'NotAuthorized' : IDL.Text,
|
|
7
|
+
'InvalidData' : IDL.Text,
|
|
8
|
+
'AlreadyExists' : IDL.Null,
|
|
9
|
+
'ReturnsNull' : IDL.Null,
|
|
10
|
+
});
|
|
11
|
+
const Error = IDL.Record({ 'details' : ErrorDetails, 'logsJson' : IDL.Text });
|
|
12
|
+
const Result_1 = IDL.Variant({ 'ok' : IDL.Bool, 'err' : Error });
|
|
13
|
+
const AppArgs = IDL.Record({ 'principal' : IDL.Principal });
|
|
14
|
+
const AgentId = IDL.Text;
|
|
15
|
+
const ConversationId = IDL.Text;
|
|
16
|
+
const ChatMessageRole = IDL.Variant({
|
|
17
|
+
'tool' : IDL.Null,
|
|
18
|
+
'user' : IDL.Null,
|
|
19
|
+
'assistant' : IDL.Null,
|
|
20
|
+
});
|
|
21
|
+
const ChatMessage = IDL.Record({
|
|
22
|
+
'content' : IDL.Text,
|
|
23
|
+
'role' : ChatMessageRole,
|
|
24
|
+
'timestamp' : IDL.Int,
|
|
25
|
+
'toolName' : IDL.Opt(IDL.Text),
|
|
26
|
+
'toolCallId' : IDL.Opt(IDL.Text),
|
|
27
|
+
});
|
|
28
|
+
const MessageBatchEntry = IDL.Record({
|
|
29
|
+
'agentId' : AgentId,
|
|
30
|
+
'conversationId' : ConversationId,
|
|
31
|
+
'message' : ChatMessage,
|
|
32
|
+
});
|
|
33
|
+
const AppendMessageBatchArgs = IDL.Record({
|
|
34
|
+
'entries' : IDL.Vec(MessageBatchEntry),
|
|
35
|
+
});
|
|
36
|
+
const Result_6 = IDL.Variant({ 'ok' : IDL.Null, 'err' : Error });
|
|
37
|
+
const Result_5 = IDL.Variant({
|
|
38
|
+
'ok' : IDL.Vec(IDL.Principal),
|
|
39
|
+
'err' : Error,
|
|
40
|
+
});
|
|
41
|
+
const ToolBinding = IDL.Record({
|
|
42
|
+
'paramsJson' : IDL.Text,
|
|
43
|
+
'tool' : IDL.Text,
|
|
44
|
+
});
|
|
45
|
+
const AgentConfigView = IDL.Record({
|
|
46
|
+
'id' : AgentId,
|
|
47
|
+
'tools' : IDL.Vec(ToolBinding),
|
|
48
|
+
'owner' : IDL.Opt(IDL.Principal),
|
|
49
|
+
'name' : IDL.Text,
|
|
50
|
+
'createdAt' : IDL.Int,
|
|
51
|
+
'createdBy' : IDL.Opt(IDL.Principal),
|
|
52
|
+
'updatedAt' : IDL.Int,
|
|
53
|
+
'persona' : IDL.Text,
|
|
54
|
+
'disclosesAsAi' : IDL.Bool,
|
|
55
|
+
'customConfigJson' : IDL.Opt(IDL.Text),
|
|
56
|
+
});
|
|
57
|
+
const Result = IDL.Variant({ 'ok' : AgentConfigView, 'err' : Error });
|
|
58
|
+
const GetConversationHistoryArgs = IDL.Record({
|
|
59
|
+
'limit' : IDL.Nat,
|
|
60
|
+
'conversationId' : ConversationId,
|
|
61
|
+
});
|
|
62
|
+
const Result_4 = IDL.Variant({ 'ok' : IDL.Vec(ChatMessage), 'err' : Error });
|
|
63
|
+
const Result_3 = IDL.Variant({
|
|
64
|
+
'ok' : IDL.Vec(AgentConfigView),
|
|
65
|
+
'err' : Error,
|
|
66
|
+
});
|
|
67
|
+
const Result_2 = IDL.Variant({ 'ok' : IDL.Principal, 'err' : Error });
|
|
68
|
+
const SetAgentPersonaArgs = IDL.Record({
|
|
69
|
+
'agentId' : AgentId,
|
|
70
|
+
'persona' : IDL.Text,
|
|
71
|
+
});
|
|
72
|
+
const UpsertAgentConfigArgs = IDL.Record({
|
|
73
|
+
'id' : AgentId,
|
|
74
|
+
'tools' : IDL.Vec(ToolBinding),
|
|
75
|
+
'owner' : IDL.Opt(IDL.Principal),
|
|
76
|
+
'name' : IDL.Text,
|
|
77
|
+
'persona' : IDL.Text,
|
|
78
|
+
'disclosesAsAi' : IDL.Bool,
|
|
79
|
+
'customConfigJson' : IDL.Opt(IDL.Text),
|
|
80
|
+
});
|
|
81
|
+
return IDL.Service({
|
|
82
|
+
'addAdmin' : IDL.Func([IDL.Principal], [Result_1], []),
|
|
83
|
+
'addApp' : IDL.Func([AppArgs], [Result_1], []),
|
|
84
|
+
'appendMessageBatch' : IDL.Func([AppendMessageBatchArgs], [Result_6], []),
|
|
85
|
+
'clearLogs' : IDL.Func([], [], []),
|
|
86
|
+
'deleteAgentConfig' : IDL.Func([AgentId], [Result_6], []),
|
|
87
|
+
'getAdmins' : IDL.Func([], [Result_5], ['query']),
|
|
88
|
+
'getAgentConfig' : IDL.Func([AgentId], [Result], ['query']),
|
|
89
|
+
'getApps' : IDL.Func([], [Result_5], ['query']),
|
|
90
|
+
'getConversationHistory' : IDL.Func(
|
|
91
|
+
[GetConversationHistoryArgs],
|
|
92
|
+
[Result_4],
|
|
93
|
+
['query'],
|
|
94
|
+
),
|
|
95
|
+
'getLogs' : IDL.Func([], [IDL.Text], ['query']),
|
|
96
|
+
'listAgentConfigs' : IDL.Func([IDL.Nat], [Result_3], ['query']),
|
|
97
|
+
'registerAsAdmin' : IDL.Func([], [Result_2], []),
|
|
98
|
+
'removeAdmin' : IDL.Func([IDL.Principal], [Result_1], []),
|
|
99
|
+
'removeApp' : IDL.Func([AppArgs], [Result_1], []),
|
|
100
|
+
'setAgentPersona' : IDL.Func([SetAgentPersonaArgs], [Result], []),
|
|
101
|
+
'setLoggingEnabled' : IDL.Func([IDL.Bool], [Result_1], []),
|
|
102
|
+
'upsertAgentConfig' : IDL.Func([UpsertAgentConfigArgs], [Result], []),
|
|
103
|
+
'whoAmI' : IDL.Func([], [IDL.Principal], ['query']),
|
|
104
|
+
});
|
|
96
105
|
};
|
|
106
|
+
export const init = ({ IDL }) => { return []; };
|
|
@@ -71,5 +71,30 @@ export declare class AdminActor extends ActorBase {
|
|
|
71
71
|
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
72
72
|
*/
|
|
73
73
|
setLoggingEnabledAsyncUnsafe(enabled: boolean): Promise<boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* Trusts another app's canister with agents of its own (Sultana's core creating an
|
|
76
|
+
* agent per salon). An app is NOT an admin: it may create agents and afterwards
|
|
77
|
+
* change only what it created, which is what keeps one app out of another's agents.
|
|
78
|
+
* Admin only; adding a principal twice is a no-op.
|
|
79
|
+
* @throws Error with message `CanisterError` when the caller is not the admin, the principal is anonymous, or the allowlist is full. Examine "cause" for {errorKey, errorMessage, logs}.
|
|
80
|
+
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
81
|
+
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
82
|
+
*/
|
|
83
|
+
addAppAsyncUnsafe(principalText: string): Promise<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Takes that right away. Agents the app already created keep working; from then on
|
|
86
|
+
* only a canister admin can change them. Admin only.
|
|
87
|
+
* @throws Error with message `CanisterError` when the caller is not the admin. Examine "cause" for {errorKey, errorMessage, logs}.
|
|
88
|
+
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
89
|
+
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
90
|
+
*/
|
|
91
|
+
removeAppAsyncUnsafe(principalText: string): Promise<boolean>;
|
|
92
|
+
/**
|
|
93
|
+
* The apps trusted with agents of their own. Admin only.
|
|
94
|
+
* @throws Error with message `CanisterError` when the caller is not the admin. Examine "cause" for {errorKey, errorMessage, logs}.
|
|
95
|
+
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
96
|
+
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
97
|
+
*/
|
|
98
|
+
getAppsAsyncUnsafe(): Promise<string[]>;
|
|
74
99
|
}
|
|
75
100
|
//# sourceMappingURL=admin-actor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-actor.d.ts","sourceRoot":"","sources":["../../src/actors/admin-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5D;mCACmC;AACnC,qBAAa,UAAW,SAAQ,SAAS;gBACzB,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAInD;;;;;;OAMG;IACU,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IAOjD;;;;;;;OAOG;IACU,kBAAkB,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAOtD;;;;OAIG;IACU,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlD;;;;;;OAMG;IACU,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMzE;;;;;;;OAOG;IACU,sBAAsB,CAC/B,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,OAAO,CAAC;IAMnB;;;;;;OAMG;IACU,oBAAoB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAOtD;;;;;;;;OAQG;IACU,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC;IAO1D;;;;;;;OAOG;IACU,4BAA4B,CACrC,OAAO,EAAE,OAAO,GACjB,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"admin-actor.d.ts","sourceRoot":"","sources":["../../src/actors/admin-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5D;mCACmC;AACnC,qBAAa,UAAW,SAAQ,SAAS;gBACzB,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAInD;;;;;;OAMG;IACU,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IAOjD;;;;;;;OAOG;IACU,kBAAkB,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAOtD;;;;OAIG;IACU,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlD;;;;;;OAMG;IACU,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMzE;;;;;;;OAOG;IACU,sBAAsB,CAC/B,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,OAAO,CAAC;IAMnB;;;;;;OAMG;IACU,oBAAoB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAOtD;;;;;;;;OAQG;IACU,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC;IAO1D;;;;;;;OAOG;IACU,4BAA4B,CACrC,OAAO,EAAE,OAAO,GACjB,OAAO,CAAC,OAAO,CAAC;IAMnB;;;;;;;;OAQG;IACU,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMvE;;;;;;OAMG;IACU,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAM1E;;;;;OAKG;IACU,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAIvD"}
|
|
@@ -95,4 +95,36 @@ export class AdminActor extends ActorBase {
|
|
|
95
95
|
async setLoggingEnabledAsyncUnsafe(enabled) {
|
|
96
96
|
return this.executeFunctionAsyncUnsafe(() => this.actor.setLoggingEnabled(enabled));
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Trusts another app's canister with agents of its own (Sultana's core creating an
|
|
100
|
+
* agent per salon). An app is NOT an admin: it may create agents and afterwards
|
|
101
|
+
* change only what it created, which is what keeps one app out of another's agents.
|
|
102
|
+
* Admin only; adding a principal twice is a no-op.
|
|
103
|
+
* @throws Error with message `CanisterError` when the caller is not the admin, the principal is anonymous, or the allowlist is full. Examine "cause" for {errorKey, errorMessage, logs}.
|
|
104
|
+
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
105
|
+
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
106
|
+
*/
|
|
107
|
+
async addAppAsyncUnsafe(principalText) {
|
|
108
|
+
return this.executeFunctionAsyncUnsafe(() => this.actor.addApp({ principal: Principal.fromText(principalText) }));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Takes that right away. Agents the app already created keep working; from then on
|
|
112
|
+
* only a canister admin can change them. Admin only.
|
|
113
|
+
* @throws Error with message `CanisterError` when the caller is not the admin. Examine "cause" for {errorKey, errorMessage, logs}.
|
|
114
|
+
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
115
|
+
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
116
|
+
*/
|
|
117
|
+
async removeAppAsyncUnsafe(principalText) {
|
|
118
|
+
return this.executeFunctionAsyncUnsafe(() => this.actor.removeApp({ principal: Principal.fromText(principalText) }));
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The apps trusted with agents of their own. Admin only.
|
|
122
|
+
* @throws Error with message `CanisterError` when the caller is not the admin. Examine "cause" for {errorKey, errorMessage, logs}.
|
|
123
|
+
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
124
|
+
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
125
|
+
*/
|
|
126
|
+
async getAppsAsyncUnsafe() {
|
|
127
|
+
const apps = await this.executeFunctionAsyncUnsafe(() => this.actor.getApps());
|
|
128
|
+
return apps.map((principal) => principal.toString());
|
|
129
|
+
}
|
|
98
130
|
}
|
|
@@ -8,8 +8,7 @@ export declare class AgentConfigsActor extends ActorBase {
|
|
|
8
8
|
* Creates the config on first write, otherwise updates it in place —
|
|
9
9
|
* `createdAt` is preserved across an update. Admin only.
|
|
10
10
|
* @param input - The full desired config; `id` decides create-vs-update. `tools`
|
|
11
|
-
* defaults to [] (a tool-less agent) when omitted.
|
|
12
|
-
* every agent must declare which outbound channel it uses.
|
|
11
|
+
* defaults to [] (a tool-less agent) when omitted.
|
|
13
12
|
* @returns The stored config as it now stands.
|
|
14
13
|
* @throws Error with message `CanisterError` when the canister returns a business error (not authorized, or `InvalidData` — a bounded field was too long/too many entries). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
15
14
|
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
@@ -17,7 +16,18 @@ export declare class AgentConfigsActor extends ActorBase {
|
|
|
17
16
|
*/
|
|
18
17
|
upsertAgentConfigAsyncUnsafe(input: UpsertAgentConfigInput): Promise<AgentConfigView>;
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
19
|
+
* Changes what the agent says it is — the one field its owner may touch. A full
|
|
20
|
+
* upsert belongs to the app that created the agent, because it would also re-point
|
|
21
|
+
* the agent's channel.
|
|
22
|
+
*
|
|
23
|
+
* Allowed for the agent's owner, the app that created it and canister admins.
|
|
24
|
+
* @throws Error with message `CanisterError` when the canister returns a business error (`NotAuthorized` for anybody else, `NotFound`, `InvalidData` for an empty or oversized persona). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
25
|
+
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
26
|
+
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
27
|
+
*/
|
|
28
|
+
setAgentPersonaAsyncUnsafe(agentId: string, persona: string): Promise<AgentConfigView>;
|
|
29
|
+
/**
|
|
30
|
+
* Fetches one agent's config. Its owner, the app that created it, and canister admins.
|
|
21
31
|
* @param id - The agent id.
|
|
22
32
|
* @throws Error with message `CanisterError` when the canister returns a business error (not authorized, errorKey `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
23
33
|
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-configs-actor.d.ts","sourceRoot":"","sources":["../../src/actors/agent-configs-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-configs-actor.d.ts","sourceRoot":"","sources":["../../src/actors/agent-configs-actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAGhF,6DAA6D;AAC7D,qBAAa,iBAAkB,SAAQ,SAAS;gBAChC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAInD;;;;;;;;;OASG;IACU,4BAA4B,CACrC,KAAK,EAAE,sBAAsB,GAC9B,OAAO,CAAC,eAAe,CAAC;IAe3B;;;;;;;;;OASG;IACU,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAOnG;;;;;;OAMG;IACU,yBAAyB,CAClC,EAAE,EAAE,MAAM,GACX,OAAO,CAAC,eAAe,CAAC;IAO3B;;;;;;;OAOG;IACU,2BAA2B,CACpC,KAAK,EAAE,MAAM,GACd,OAAO,CAAC,eAAe,EAAE,CAAC;IAO7B;;;;;;OAMG;IACU,4BAA4B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAKvE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {} from "@icp-sdk/core/agent";
|
|
2
2
|
import { ActorBase } from "../actor-base.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Principal } from "@icp-sdk/core/principal";
|
|
4
|
+
import { mapAgentConfigView, toOpt } from "../mappers.js";
|
|
4
5
|
/** 1:1 wrapper for the canister's AgentConfigsController. */
|
|
5
6
|
export class AgentConfigsActor extends ActorBase {
|
|
6
7
|
constructor(canisterId, identity) {
|
|
@@ -10,8 +11,7 @@ export class AgentConfigsActor extends ActorBase {
|
|
|
10
11
|
* Creates the config on first write, otherwise updates it in place —
|
|
11
12
|
* `createdAt` is preserved across an update. Admin only.
|
|
12
13
|
* @param input - The full desired config; `id` decides create-vs-update. `tools`
|
|
13
|
-
* defaults to [] (a tool-less agent) when omitted.
|
|
14
|
-
* every agent must declare which outbound channel it uses.
|
|
14
|
+
* defaults to [] (a tool-less agent) when omitted.
|
|
15
15
|
* @returns The stored config as it now stands.
|
|
16
16
|
* @throws Error with message `CanisterError` when the canister returns a business error (not authorized, or `InvalidData` — a bounded field was too long/too many entries). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
17
17
|
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
@@ -25,12 +25,26 @@ export class AgentConfigsActor extends ActorBase {
|
|
|
25
25
|
disclosesAsAi: input.disclosesAsAi,
|
|
26
26
|
tools: input.tools ?? [],
|
|
27
27
|
customConfigJson: toOpt(input.customConfigJson),
|
|
28
|
-
|
|
28
|
+
owner: toOpt(input.owner ? Principal.fromText(input.owner) : undefined),
|
|
29
29
|
}));
|
|
30
30
|
return mapAgentConfigView(config);
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Changes what the agent says it is — the one field its owner may touch. A full
|
|
34
|
+
* upsert belongs to the app that created the agent, because it would also re-point
|
|
35
|
+
* the agent's channel.
|
|
36
|
+
*
|
|
37
|
+
* Allowed for the agent's owner, the app that created it and canister admins.
|
|
38
|
+
* @throws Error with message `CanisterError` when the canister returns a business error (`NotAuthorized` for anybody else, `NotFound`, `InvalidData` for an empty or oversized persona). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
39
|
+
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
|
40
|
+
* @throws Error with message `CallRefusedAtInspectionStage` when the canister's `inspect` rejects the call before execution.
|
|
41
|
+
*/
|
|
42
|
+
async setAgentPersonaAsyncUnsafe(agentId, persona) {
|
|
43
|
+
const config = await this.executeFunctionAsyncUnsafe(() => this.actor.setAgentPersona({ agentId, persona }));
|
|
44
|
+
return mapAgentConfigView(config);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Fetches one agent's config. Its owner, the app that created it, and canister admins.
|
|
34
48
|
* @param id - The agent id.
|
|
35
49
|
* @throws Error with message `CanisterError` when the canister returns a business error (not authorized, errorKey `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
36
50
|
* @throws Error with message `CriticalCanisterError` when there is no communication with the canister or the canister code traps during execution.
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export type ChatMessageRoleView = "user" | "assistant" | "tool";
|
|
2
|
-
/** Which outbound channel an agent's replies go out on — decided once at creation,
|
|
3
|
-
* per AGENT-PLATFORM decision 2026-08-19. "chat" is accepted/stored but nothing
|
|
4
|
-
* downstream acts on it yet — only "whatsapp" is implemented (agents-village). */
|
|
5
|
-
export type ChannelTypeView = "whatsapp" | "chat";
|
|
6
2
|
/** Candid `ChatMessage` with the role variant as a string union and opts flattened —
|
|
7
3
|
* matches chat-agent-package's own ChatMessage shape so history round-trips without
|
|
8
4
|
* further translation on the consumer side. */
|
|
@@ -37,10 +33,18 @@ export interface AgentConfigView {
|
|
|
37
33
|
tool: string;
|
|
38
34
|
paramsJson: string;
|
|
39
35
|
}[];
|
|
36
|
+
/** Escape hatch for whatever doesn't fit the schema yet — JSON-encoded object,
|
|
37
|
+
* interpreted only by whatever agent-specific code reads it. As of AGENT-PLATFORM
|
|
38
|
+
* decision 2026-08-19, an agent's outbound channel config lives here too (e.g.
|
|
39
|
+
* {"type":"whatsapp","number":...,"peers":[...]}) — this package stays agnostic
|
|
40
|
+
* to its shape; agents-village is the one that parses it. */
|
|
40
41
|
customConfigJson?: string;
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
|
|
42
|
+
/** The app that created this agent — another canister's principal. Undefined for a
|
|
43
|
+
* configuration written before agents had an owner; only a canister admin may touch
|
|
44
|
+
* one of those. */
|
|
45
|
+
createdBy?: string;
|
|
46
|
+
/** The person allowed to change the agent's words (and nothing else). */
|
|
47
|
+
owner?: string;
|
|
44
48
|
/** Nanoseconds since epoch */
|
|
45
49
|
createdAt: bigint;
|
|
46
50
|
/** Nanoseconds since epoch */
|
|
@@ -50,8 +54,7 @@ export interface AgentConfigView {
|
|
|
50
54
|
* plain optional (candid `opt` shaping done by the wrapper); tools is optional here
|
|
51
55
|
* even though the canister's own UpsertAgentConfigArgs requires it — the wrapper
|
|
52
56
|
* defaults a missing tools to [] for a tool-less agent, so callers don't have to
|
|
53
|
-
* spell out `tools: []` every time.
|
|
54
|
-
* UpsertAgentConfigArgs requires it too, per AGENT-PLATFORM decision 2026-08-19. */
|
|
57
|
+
* spell out `tools: []` every time. */
|
|
55
58
|
export interface UpsertAgentConfigInput {
|
|
56
59
|
id: string;
|
|
57
60
|
name: string;
|
|
@@ -62,6 +65,7 @@ export interface UpsertAgentConfigInput {
|
|
|
62
65
|
paramsJson: string;
|
|
63
66
|
}[];
|
|
64
67
|
customConfigJson?: string;
|
|
65
|
-
|
|
68
|
+
/** Read only when the agent is CREATED: the person who may change its words later. */
|
|
69
|
+
owner?: string;
|
|
66
70
|
}
|
|
67
71
|
//# sourceMappingURL=interfaces.d.ts.map
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAEhE
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAEhE;;+CAE+C;AAC/C,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;wEACwE;AACxE,MAAM,WAAW,sBAAsB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACL,IAAI,EAAE,mBAAmB,CAAC;QAC1B,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACrB,CAAC;CACL;AAED,mDAAmD;AACnD,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9C;;;;iEAI6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;uBAEmB;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;;uCAIuC;AACvC,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/mappers.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { AgentConfigView as CandidAgentConfig, ChatMessage, ChatMessageRole } from "../declarations/agent-platform-canister/agent-platform-canister.did.js";
|
|
2
|
+
import type { ChatMessageRoleView, ChatMessageView, AgentConfigView } from "./interfaces.js";
|
|
3
3
|
declare function toOpt<T>(value: T | undefined): [] | [T];
|
|
4
4
|
export declare function mapChatMessageRoleView(role: ChatMessageRole): ChatMessageRoleView;
|
|
5
5
|
export declare function toChatMessageRoleVariant(role: ChatMessageRoleView): ChatMessageRole;
|
|
6
6
|
export declare function mapChatMessageView(message: ChatMessage): ChatMessageView;
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function toChannelTypeVariant(channelType: ChannelTypeView): ChannelType;
|
|
9
|
-
export declare function mapAgentConfigView(config: AgentConfig): AgentConfigView;
|
|
7
|
+
export declare function mapAgentConfigView(config: CandidAgentConfig): AgentConfigView;
|
|
10
8
|
export { toOpt };
|
|
11
9
|
//# sourceMappingURL=mappers.d.ts.map
|
package/dist/mappers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../src/mappers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,
|
|
1
|
+
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../src/mappers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,eAAe,IAAI,iBAAiB,EACpC,WAAW,EACX,eAAe,EAClB,MAAM,wEAAwE,CAAC;AAChF,OAAO,KAAK,EACR,mBAAmB,EACnB,eAAe,EACf,eAAe,EAClB,MAAM,iBAAiB,CAAC;AAMzB,iBAAS,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAEhD;AAED,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,eAAe,GACtB,mBAAmB,CAErB;AAED,wBAAgB,wBAAwB,CACpC,IAAI,EAAE,mBAAmB,GAC1B,eAAe,CAEjB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,eAAe,CAQxE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,eAAe,CAa7E;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/mappers.js
CHANGED
|
@@ -19,14 +19,7 @@ export function mapChatMessageView(message) {
|
|
|
19
19
|
timestamp: message.timestamp,
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
export function mapChannelTypeView(channelType) {
|
|
23
|
-
return Object.keys(channelType)[0];
|
|
24
|
-
}
|
|
25
|
-
export function toChannelTypeVariant(channelType) {
|
|
26
|
-
return { [channelType]: null };
|
|
27
|
-
}
|
|
28
22
|
export function mapAgentConfigView(config) {
|
|
29
|
-
const channelType = fromOpt(config.channelType);
|
|
30
23
|
return {
|
|
31
24
|
id: config.id,
|
|
32
25
|
name: config.name,
|
|
@@ -34,9 +27,8 @@ export function mapAgentConfigView(config) {
|
|
|
34
27
|
disclosesAsAi: config.disclosesAsAi,
|
|
35
28
|
tools: config.tools,
|
|
36
29
|
customConfigJson: fromOpt(config.customConfigJson),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
: undefined,
|
|
30
|
+
createdBy: fromOpt(config.createdBy)?.toString(),
|
|
31
|
+
owner: fromOpt(config.owner)?.toString(),
|
|
40
32
|
createdAt: config.createdAt,
|
|
41
33
|
updatedAt: config.updatedAt,
|
|
42
34
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsm-mit/agent-platform-canister-package",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Wrapper TypeScript package for the agent-platform-canister canister.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -22,15 +22,14 @@
|
|
|
22
22
|
"build": "tsc",
|
|
23
23
|
"clean": "rm -rf dist",
|
|
24
24
|
"prepare": "npm run build",
|
|
25
|
-
"publish-public": "
|
|
25
|
+
"publish-public": "bash scripts/publish-public.sh",
|
|
26
26
|
"typecheck": "tsc --noEmit -p tsconfig.tests.json",
|
|
27
27
|
"sync-declarations": "bash scripts/sync-declarations.sh",
|
|
28
28
|
"test-suite": "bash scripts/run-tests.sh tests/test-suite.ts",
|
|
29
29
|
"sandbox": "npx tsx sandbox/main.ts",
|
|
30
30
|
"format": "prettier --write .",
|
|
31
31
|
"format:check": "prettier --check .",
|
|
32
|
-
"
|
|
33
|
-
"prepublishOnly": "npm run guard:clean"
|
|
32
|
+
"stamp-canister": "bash scripts/stamp-canister-commit.sh"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
35
|
"@jsm-mit/utils-package": "^0.5.0"
|
|
@@ -39,12 +38,17 @@
|
|
|
39
38
|
"@icp-sdk/core": "^6.0.0"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
41
|
+
"@icp-sdk/core": "^6.1.0",
|
|
42
42
|
"@jsm-mit/cli-game-helpers": "^0.1.0",
|
|
43
43
|
"@types/node": "^22.0.0",
|
|
44
44
|
"dotenv": "^16.4.0",
|
|
45
45
|
"prettier": "^3.3.0",
|
|
46
46
|
"tsx": "^4.19.0",
|
|
47
|
-
"typescript": "^5.6.0"
|
|
48
|
-
|
|
47
|
+
"typescript": "^5.6.0"
|
|
48
|
+
},
|
|
49
|
+
"agentPlatformCanister": {
|
|
50
|
+
"repo": "agent-platform-canister",
|
|
51
|
+
"repoUrl": "https://github.com/JSM-Agent-Platform/agent-platform-canister",
|
|
52
|
+
"commit": "2d302e673013d54083babbbb9aa79eb718d7bf74"
|
|
49
53
|
}
|
|
50
54
|
}
|