@jsm-mit/agent-platform-canister-package 0.1.0 → 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 -3
- package/declarations/agent-platform-canister/agent-platform-canister.did.d.ts +88 -70
- package/declarations/agent-platform-canister/agent-platform-canister.did.js +104 -91
- 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 +12 -1
- package/dist/actors/agent-configs-actor.d.ts.map +1 -1
- package/dist/actors/agent-configs-actor.js +17 -1
- package/dist/interfaces.d.ts +8 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/mappers.d.ts +2 -2
- package/dist/mappers.d.ts.map +1 -1
- package/dist/mappers.js +2 -0
- package/package.json +10 -6
|
@@ -4,6 +4,7 @@ type UpsertAgentConfigArgs =
|
|
|
4
4
|
disclosesAsAi: bool;
|
|
5
5
|
id: AgentId;
|
|
6
6
|
name: text;
|
|
7
|
+
owner: opt principal;
|
|
7
8
|
persona: text;
|
|
8
9
|
tools: vec ToolBinding;
|
|
9
10
|
};
|
|
@@ -12,6 +13,11 @@ type ToolBinding =
|
|
|
12
13
|
paramsJson: text;
|
|
13
14
|
tool: text;
|
|
14
15
|
};
|
|
16
|
+
type SetAgentPersonaArgs =
|
|
17
|
+
record {
|
|
18
|
+
agentId: AgentId;
|
|
19
|
+
persona: text;
|
|
20
|
+
};
|
|
15
21
|
type Result_6 =
|
|
16
22
|
variant {
|
|
17
23
|
err: Error;
|
|
@@ -30,7 +36,7 @@ type Result_4 =
|
|
|
30
36
|
type Result_3 =
|
|
31
37
|
variant {
|
|
32
38
|
err: Error;
|
|
33
|
-
ok: vec
|
|
39
|
+
ok: vec AgentConfigView;
|
|
34
40
|
};
|
|
35
41
|
type Result_2 =
|
|
36
42
|
variant {
|
|
@@ -45,7 +51,7 @@ type Result_1 =
|
|
|
45
51
|
type Result =
|
|
46
52
|
variant {
|
|
47
53
|
err: Error;
|
|
48
|
-
ok:
|
|
54
|
+
ok: AgentConfigView;
|
|
49
55
|
};
|
|
50
56
|
type MessageBatchEntry =
|
|
51
57
|
record {
|
|
@@ -89,31 +95,41 @@ type ChatMessage =
|
|
|
89
95
|
toolName: opt text;
|
|
90
96
|
};
|
|
91
97
|
type AppendMessageBatchArgs = record {entries: vec MessageBatchEntry;};
|
|
98
|
+
type AppArgs = record {"principal": principal;};
|
|
92
99
|
type AgentId = text;
|
|
93
|
-
type
|
|
100
|
+
type AgentConfigView =
|
|
94
101
|
record {
|
|
95
102
|
createdAt: int;
|
|
103
|
+
createdBy: opt principal;
|
|
96
104
|
customConfigJson: opt text;
|
|
97
105
|
disclosesAsAi: bool;
|
|
98
106
|
id: AgentId;
|
|
99
107
|
name: text;
|
|
108
|
+
owner: opt principal;
|
|
100
109
|
persona: text;
|
|
101
110
|
tools: vec ToolBinding;
|
|
102
111
|
updatedAt: int;
|
|
103
112
|
};
|
|
104
113
|
service : {
|
|
105
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);
|
|
106
117
|
appendMessageBatch: (args: AppendMessageBatchArgs) -> (Result_6);
|
|
107
118
|
clearLogs: () -> ();
|
|
108
119
|
deleteAgentConfig: (id: AgentId) -> (Result_6);
|
|
109
120
|
getAdmins: () -> (Result_5) query;
|
|
110
121
|
getAgentConfig: (id: AgentId) -> (Result) query;
|
|
122
|
+
getApps: () -> (Result_5) query;
|
|
111
123
|
getConversationHistory: (args: GetConversationHistoryArgs) ->
|
|
112
124
|
(Result_4) query;
|
|
113
125
|
getLogs: () -> (text) query;
|
|
114
126
|
listAgentConfigs: (limit: nat) -> (Result_3) query;
|
|
115
127
|
registerAsAdmin: () -> (Result_2);
|
|
116
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);
|
|
117
133
|
setLoggingEnabled: (enabled: bool) -> (Result_1);
|
|
118
134
|
upsertAgentConfig: (args: UpsertAgentConfigArgs) -> (Result);
|
|
119
135
|
whoAmI: () -> (principal) query;
|
|
@@ -1,86 +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
|
-
|
|
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],
|
|
14
16
|
}
|
|
15
17
|
export type AgentId = string;
|
|
16
|
-
export interface
|
|
17
|
-
|
|
18
|
-
}
|
|
18
|
+
export interface AppArgs { 'principal' : Principal }
|
|
19
|
+
export interface AppendMessageBatchArgs { 'entries' : Array<MessageBatchEntry> }
|
|
19
20
|
export interface ChatMessage {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
'content' : string,
|
|
22
|
+
'role' : ChatMessageRole,
|
|
23
|
+
'timestamp' : bigint,
|
|
24
|
+
'toolName' : [] | [string],
|
|
25
|
+
'toolCallId' : [] | [string],
|
|
25
26
|
}
|
|
26
|
-
export type ChatMessageRole =
|
|
27
|
-
|
|
27
|
+
export type ChatMessageRole = { 'tool' : null } |
|
|
28
|
+
{ 'user' : null } |
|
|
29
|
+
{ 'assistant' : null };
|
|
28
30
|
export type ConversationId = string;
|
|
29
|
-
export interface Error {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
| { NotAuthorized: string }
|
|
38
|
-
| { InvalidData: string }
|
|
39
|
-
| { AlreadyExists: null }
|
|
40
|
-
| { 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 };
|
|
41
39
|
export interface GetConversationHistoryArgs {
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
'limit' : bigint,
|
|
41
|
+
'conversationId' : ConversationId,
|
|
44
42
|
}
|
|
45
43
|
export interface MessageBatchEntry {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
export type Result = { ok: AgentConfig } | { err: Error };
|
|
51
|
-
export type Result_1 = { ok: boolean } | { err: Error };
|
|
52
|
-
export type Result_2 = { ok: Principal } | { err: Error };
|
|
53
|
-
export type Result_3 = { ok: Array<AgentConfig> } | { err: Error };
|
|
54
|
-
export type Result_4 = { ok: Array<ChatMessage> } | { err: Error };
|
|
55
|
-
export type Result_5 = { ok: Array<Principal> } | { err: Error };
|
|
56
|
-
export type Result_6 = { ok: null } | { err: Error };
|
|
57
|
-
export interface ToolBinding {
|
|
58
|
-
paramsJson: string;
|
|
59
|
-
tool: string;
|
|
44
|
+
'agentId' : AgentId,
|
|
45
|
+
'conversationId' : ConversationId,
|
|
46
|
+
'message' : ChatMessage,
|
|
60
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 }
|
|
61
64
|
export interface UpsertAgentConfigArgs {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
'id' : AgentId,
|
|
66
|
+
'tools' : Array<ToolBinding>,
|
|
67
|
+
'owner' : [] | [Principal],
|
|
68
|
+
'name' : string,
|
|
69
|
+
'persona' : string,
|
|
70
|
+
'disclosesAsAi' : boolean,
|
|
71
|
+
'customConfigJson' : [] | [string],
|
|
68
72
|
}
|
|
69
73
|
export interface _SERVICE {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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>,
|
|
84
102
|
}
|
|
85
103
|
export declare const idlFactory: IDL.InterfaceFactory;
|
|
86
104
|
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -1,93 +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
|
-
|
|
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
|
+
});
|
|
93
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
|
}
|
|
@@ -16,7 +16,18 @@ export declare class AgentConfigsActor extends ActorBase {
|
|
|
16
16
|
*/
|
|
17
17
|
upsertAgentConfigAsyncUnsafe(input: UpsertAgentConfigInput): Promise<AgentConfigView>;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
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.
|
|
20
31
|
* @param id - The agent id.
|
|
21
32
|
* @throws Error with message `CanisterError` when the canister returns a business error (not authorized, errorKey `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
22
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,5 +1,6 @@
|
|
|
1
1
|
import {} from "@icp-sdk/core/agent";
|
|
2
2
|
import { ActorBase } from "../actor-base.js";
|
|
3
|
+
import { Principal } from "@icp-sdk/core/principal";
|
|
3
4
|
import { mapAgentConfigView, toOpt } from "../mappers.js";
|
|
4
5
|
/** 1:1 wrapper for the canister's AgentConfigsController. */
|
|
5
6
|
export class AgentConfigsActor extends ActorBase {
|
|
@@ -24,11 +25,26 @@ export class AgentConfigsActor extends ActorBase {
|
|
|
24
25
|
disclosesAsAi: input.disclosesAsAi,
|
|
25
26
|
tools: input.tools ?? [],
|
|
26
27
|
customConfigJson: toOpt(input.customConfigJson),
|
|
28
|
+
owner: toOpt(input.owner ? Principal.fromText(input.owner) : undefined),
|
|
27
29
|
}));
|
|
28
30
|
return mapAgentConfigView(config);
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
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.
|
|
32
48
|
* @param id - The agent id.
|
|
33
49
|
* @throws Error with message `CanisterError` when the canister returns a business error (not authorized, errorKey `NotFound`). Examine "cause" for {errorKey, errorMessage, logs}.
|
|
34
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
|
@@ -39,6 +39,12 @@ export interface AgentConfigView {
|
|
|
39
39
|
* {"type":"whatsapp","number":...,"peers":[...]}) — this package stays agnostic
|
|
40
40
|
* to its shape; agents-village is the one that parses it. */
|
|
41
41
|
customConfigJson?: string;
|
|
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;
|
|
42
48
|
/** Nanoseconds since epoch */
|
|
43
49
|
createdAt: bigint;
|
|
44
50
|
/** Nanoseconds since epoch */
|
|
@@ -59,5 +65,7 @@ export interface UpsertAgentConfigInput {
|
|
|
59
65
|
paramsJson: string;
|
|
60
66
|
}[];
|
|
61
67
|
customConfigJson?: string;
|
|
68
|
+
/** Read only when the agent is CREATED: the person who may change its words later. */
|
|
69
|
+
owner?: string;
|
|
62
70
|
}
|
|
63
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;;+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,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;
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AgentConfigView as CandidAgentConfig, ChatMessage, ChatMessageRole } from "../declarations/agent-platform-canister/agent-platform-canister.did.js";
|
|
2
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 mapAgentConfigView(config:
|
|
7
|
+
export declare function mapAgentConfigView(config: CandidAgentConfig): AgentConfigView;
|
|
8
8
|
export { toOpt };
|
|
9
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
|
@@ -27,6 +27,8 @@ export function mapAgentConfigView(config) {
|
|
|
27
27
|
disclosesAsAi: config.disclosesAsAi,
|
|
28
28
|
tools: config.tools,
|
|
29
29
|
customConfigJson: fromOpt(config.customConfigJson),
|
|
30
|
+
createdBy: fromOpt(config.createdBy)?.toString(),
|
|
31
|
+
owner: fromOpt(config.owner)?.toString(),
|
|
30
32
|
createdAt: config.createdAt,
|
|
31
33
|
updatedAt: config.updatedAt,
|
|
32
34
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsm-mit/agent-platform-canister-package",
|
|
3
|
-
"version": "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
|
}
|