@inkeep/agents-core 0.0.0-dev-20260122182448 → 0.0.0-dev-20260122191720
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/auth/auth-validation-schemas.d.ts +17 -17
- package/dist/credential-stores/keychain-store.d.ts +20 -8
- package/dist/credential-stores/keychain-store.js +109 -43
- package/dist/data-access/manage/agents.d.ts +21 -21
- package/dist/data-access/manage/artifactComponents.d.ts +10 -10
- package/dist/data-access/manage/contextConfigs.d.ts +12 -12
- package/dist/data-access/manage/dataComponents.d.ts +6 -6
- package/dist/data-access/manage/functionTools.d.ts +14 -14
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +30 -30
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +15 -15
- package/dist/data-access/manage/tools.d.ts +36 -36
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/conversations.d.ts +31 -31
- package/dist/data-access/runtime/messages.d.ts +18 -18
- package/dist/data-access/runtime/tasks.d.ts +6 -6
- package/dist/db/manage/manage-schema.d.ts +375 -375
- package/dist/db/runtime/runtime-schema.d.ts +181 -181
- package/dist/types/@napi-rs__keyring/index.d.ts +14 -0
- package/dist/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1486 -1486
- package/package.json +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
2
|
import * as drizzle_orm_pg_core80 from "drizzle-orm/pg-core";
|
|
3
|
-
import * as
|
|
3
|
+
import * as drizzle_zod3 from "drizzle-zod";
|
|
4
4
|
|
|
5
5
|
//#region src/auth/auth-validation-schemas.d.ts
|
|
6
|
-
declare const UserSelectSchema:
|
|
6
|
+
declare const UserSelectSchema: drizzle_zod3.BuildSchema<"select", {
|
|
7
7
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
8
8
|
name: "id";
|
|
9
9
|
tableName: "user";
|
|
@@ -124,7 +124,7 @@ declare const UserSelectSchema: drizzle_zod0.BuildSchema<"select", {
|
|
|
124
124
|
generated: undefined;
|
|
125
125
|
}, {}, {}>;
|
|
126
126
|
}, undefined, undefined>;
|
|
127
|
-
declare const UserInsertSchema:
|
|
127
|
+
declare const UserInsertSchema: drizzle_zod3.BuildSchema<"insert", {
|
|
128
128
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
129
129
|
name: "id";
|
|
130
130
|
tableName: "user";
|
|
@@ -245,7 +245,7 @@ declare const UserInsertSchema: drizzle_zod0.BuildSchema<"insert", {
|
|
|
245
245
|
generated: undefined;
|
|
246
246
|
}, {}, {}>;
|
|
247
247
|
}, undefined, undefined>;
|
|
248
|
-
declare const SessionSelectSchema:
|
|
248
|
+
declare const SessionSelectSchema: drizzle_zod3.BuildSchema<"select", {
|
|
249
249
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
250
250
|
name: "id";
|
|
251
251
|
tableName: "session";
|
|
@@ -400,7 +400,7 @@ declare const SessionSelectSchema: drizzle_zod0.BuildSchema<"select", {
|
|
|
400
400
|
generated: undefined;
|
|
401
401
|
}, {}, {}>;
|
|
402
402
|
}, undefined, undefined>;
|
|
403
|
-
declare const SessionInsertSchema:
|
|
403
|
+
declare const SessionInsertSchema: drizzle_zod3.BuildSchema<"insert", {
|
|
404
404
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
405
405
|
name: "id";
|
|
406
406
|
tableName: "session";
|
|
@@ -555,7 +555,7 @@ declare const SessionInsertSchema: drizzle_zod0.BuildSchema<"insert", {
|
|
|
555
555
|
generated: undefined;
|
|
556
556
|
}, {}, {}>;
|
|
557
557
|
}, undefined, undefined>;
|
|
558
|
-
declare const AccountSelectSchema:
|
|
558
|
+
declare const AccountSelectSchema: drizzle_zod3.BuildSchema<"select", {
|
|
559
559
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
560
560
|
name: "id";
|
|
561
561
|
tableName: "account";
|
|
@@ -778,7 +778,7 @@ declare const AccountSelectSchema: drizzle_zod0.BuildSchema<"select", {
|
|
|
778
778
|
generated: undefined;
|
|
779
779
|
}, {}, {}>;
|
|
780
780
|
}, undefined, undefined>;
|
|
781
|
-
declare const AccountInsertSchema:
|
|
781
|
+
declare const AccountInsertSchema: drizzle_zod3.BuildSchema<"insert", {
|
|
782
782
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
783
783
|
name: "id";
|
|
784
784
|
tableName: "account";
|
|
@@ -1001,7 +1001,7 @@ declare const AccountInsertSchema: drizzle_zod0.BuildSchema<"insert", {
|
|
|
1001
1001
|
generated: undefined;
|
|
1002
1002
|
}, {}, {}>;
|
|
1003
1003
|
}, undefined, undefined>;
|
|
1004
|
-
declare const OrganizationSelectSchema:
|
|
1004
|
+
declare const OrganizationSelectSchema: drizzle_zod3.BuildSchema<"select", {
|
|
1005
1005
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
1006
1006
|
name: "id";
|
|
1007
1007
|
tableName: "organization";
|
|
@@ -1105,7 +1105,7 @@ declare const OrganizationSelectSchema: drizzle_zod0.BuildSchema<"select", {
|
|
|
1105
1105
|
generated: undefined;
|
|
1106
1106
|
}, {}, {}>;
|
|
1107
1107
|
}, undefined, undefined>;
|
|
1108
|
-
declare const OrganizationInsertSchema:
|
|
1108
|
+
declare const OrganizationInsertSchema: drizzle_zod3.BuildSchema<"insert", {
|
|
1109
1109
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
1110
1110
|
name: "id";
|
|
1111
1111
|
tableName: "organization";
|
|
@@ -1209,7 +1209,7 @@ declare const OrganizationInsertSchema: drizzle_zod0.BuildSchema<"insert", {
|
|
|
1209
1209
|
generated: undefined;
|
|
1210
1210
|
}, {}, {}>;
|
|
1211
1211
|
}, undefined, undefined>;
|
|
1212
|
-
declare const MemberSelectSchema:
|
|
1212
|
+
declare const MemberSelectSchema: drizzle_zod3.BuildSchema<"select", {
|
|
1213
1213
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
1214
1214
|
name: "id";
|
|
1215
1215
|
tableName: "member";
|
|
@@ -1296,7 +1296,7 @@ declare const MemberSelectSchema: drizzle_zod0.BuildSchema<"select", {
|
|
|
1296
1296
|
generated: undefined;
|
|
1297
1297
|
}, {}, {}>;
|
|
1298
1298
|
}, undefined, undefined>;
|
|
1299
|
-
declare const MemberInsertSchema:
|
|
1299
|
+
declare const MemberInsertSchema: drizzle_zod3.BuildSchema<"insert", {
|
|
1300
1300
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
1301
1301
|
name: "id";
|
|
1302
1302
|
tableName: "member";
|
|
@@ -1383,7 +1383,7 @@ declare const MemberInsertSchema: drizzle_zod0.BuildSchema<"insert", {
|
|
|
1383
1383
|
generated: undefined;
|
|
1384
1384
|
}, {}, {}>;
|
|
1385
1385
|
}, undefined, undefined>;
|
|
1386
|
-
declare const InvitationSelectSchema:
|
|
1386
|
+
declare const InvitationSelectSchema: drizzle_zod3.BuildSchema<"select", {
|
|
1387
1387
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
1388
1388
|
name: "id";
|
|
1389
1389
|
tableName: "invitation";
|
|
@@ -1521,7 +1521,7 @@ declare const InvitationSelectSchema: drizzle_zod0.BuildSchema<"select", {
|
|
|
1521
1521
|
generated: undefined;
|
|
1522
1522
|
}, {}, {}>;
|
|
1523
1523
|
}, undefined, undefined>;
|
|
1524
|
-
declare const InvitationInsertSchema:
|
|
1524
|
+
declare const InvitationInsertSchema: drizzle_zod3.BuildSchema<"insert", {
|
|
1525
1525
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
1526
1526
|
name: "id";
|
|
1527
1527
|
tableName: "invitation";
|
|
@@ -1659,7 +1659,7 @@ declare const InvitationInsertSchema: drizzle_zod0.BuildSchema<"insert", {
|
|
|
1659
1659
|
generated: undefined;
|
|
1660
1660
|
}, {}, {}>;
|
|
1661
1661
|
}, undefined, undefined>;
|
|
1662
|
-
declare const DeviceCodeSelectSchema:
|
|
1662
|
+
declare const DeviceCodeSelectSchema: drizzle_zod3.BuildSchema<"select", {
|
|
1663
1663
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
1664
1664
|
name: "id";
|
|
1665
1665
|
tableName: "device_code";
|
|
@@ -1831,7 +1831,7 @@ declare const DeviceCodeSelectSchema: drizzle_zod0.BuildSchema<"select", {
|
|
|
1831
1831
|
generated: undefined;
|
|
1832
1832
|
}, {}, {}>;
|
|
1833
1833
|
}, undefined, undefined>;
|
|
1834
|
-
declare const DeviceCodeInsertSchema:
|
|
1834
|
+
declare const DeviceCodeInsertSchema: drizzle_zod3.BuildSchema<"insert", {
|
|
1835
1835
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
1836
1836
|
name: "id";
|
|
1837
1837
|
tableName: "device_code";
|
|
@@ -2003,7 +2003,7 @@ declare const DeviceCodeInsertSchema: drizzle_zod0.BuildSchema<"insert", {
|
|
|
2003
2003
|
generated: undefined;
|
|
2004
2004
|
}, {}, {}>;
|
|
2005
2005
|
}, undefined, undefined>;
|
|
2006
|
-
declare const VerificationSelectSchema:
|
|
2006
|
+
declare const VerificationSelectSchema: drizzle_zod3.BuildSchema<"select", {
|
|
2007
2007
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
2008
2008
|
name: "id";
|
|
2009
2009
|
tableName: "verification";
|
|
@@ -2107,7 +2107,7 @@ declare const VerificationSelectSchema: drizzle_zod0.BuildSchema<"select", {
|
|
|
2107
2107
|
generated: undefined;
|
|
2108
2108
|
}, {}, {}>;
|
|
2109
2109
|
}, undefined, undefined>;
|
|
2110
|
-
declare const VerificationInsertSchema:
|
|
2110
|
+
declare const VerificationInsertSchema: drizzle_zod3.BuildSchema<"insert", {
|
|
2111
2111
|
id: drizzle_orm_pg_core80.PgColumn<{
|
|
2112
2112
|
name: "id";
|
|
2113
2113
|
tableName: "verification";
|
|
@@ -10,16 +10,16 @@ import { CredentialStore } from "../types/server.js";
|
|
|
10
10
|
* - Windows: Credential Vault
|
|
11
11
|
* - Linux: Secret Service API/libsecret
|
|
12
12
|
*
|
|
13
|
-
* Requires the '
|
|
14
|
-
* Falls back gracefully if
|
|
13
|
+
* Requires the '@napi-rs/keyring' npm package to be installed.
|
|
14
|
+
* Falls back gracefully if keyring is not available.
|
|
15
15
|
*
|
|
16
16
|
* ## macOS Permission Handling
|
|
17
17
|
*
|
|
18
|
-
* On macOS, when your Node.js app first calls
|
|
18
|
+
* On macOS, when your Node.js app first calls keyring operations:
|
|
19
19
|
* - `setPassword()` creates a new Keychain item (no prompt required)
|
|
20
20
|
* - `getPassword()` may prompt the user for permission on first access
|
|
21
21
|
* - Users can click "Allow", "Always Allow", or "Deny"
|
|
22
|
-
* - If denied,
|
|
22
|
+
* - If denied, keyring returns `null` which this implementation handles gracefully
|
|
23
23
|
* - The calling binary (usually `node`) will be shown in the permission prompt
|
|
24
24
|
* - For better UX in packaged apps, consider code signing and app bundling
|
|
25
25
|
*
|
|
@@ -33,14 +33,22 @@ declare class KeyChainStore implements CredentialStore {
|
|
|
33
33
|
readonly type: "keychain";
|
|
34
34
|
private readonly service;
|
|
35
35
|
private readonly logger;
|
|
36
|
-
private
|
|
37
|
-
private
|
|
36
|
+
private keyringAvailable;
|
|
37
|
+
private EntryClass;
|
|
38
38
|
private initializationPromise;
|
|
39
39
|
constructor(id: string, servicePrefix?: string);
|
|
40
40
|
/**
|
|
41
|
-
* Initialize
|
|
41
|
+
* Initialize keyring dynamically to handle optional availability
|
|
42
42
|
*/
|
|
43
|
-
private
|
|
43
|
+
private initializeKeyring;
|
|
44
|
+
/**
|
|
45
|
+
* Add a key to the index
|
|
46
|
+
*/
|
|
47
|
+
private addKeyToIndex;
|
|
48
|
+
/**
|
|
49
|
+
* Remove a key from the index
|
|
50
|
+
*/
|
|
51
|
+
private removeKeyFromIndex;
|
|
44
52
|
/**
|
|
45
53
|
* Get a credential from the keychain
|
|
46
54
|
*/
|
|
@@ -68,6 +76,10 @@ declare class KeyChainStore implements CredentialStore {
|
|
|
68
76
|
/**
|
|
69
77
|
* Find all credentials for this service
|
|
70
78
|
* Useful for debugging and listing stored credentials
|
|
79
|
+
*
|
|
80
|
+
* NOTE: @napi-rs/keyring does not have a findCredentials equivalent.
|
|
81
|
+
* This implementation uses a key index to track all stored keys.
|
|
82
|
+
* The index is maintained separately and updated during set/delete operations.
|
|
71
83
|
*/
|
|
72
84
|
findAllCredentials(): Promise<Array<{
|
|
73
85
|
account: string;
|
|
@@ -10,16 +10,16 @@ import { getLogger } from "../utils/logger.js";
|
|
|
10
10
|
* - Windows: Credential Vault
|
|
11
11
|
* - Linux: Secret Service API/libsecret
|
|
12
12
|
*
|
|
13
|
-
* Requires the '
|
|
14
|
-
* Falls back gracefully if
|
|
13
|
+
* Requires the '@napi-rs/keyring' npm package to be installed.
|
|
14
|
+
* Falls back gracefully if keyring is not available.
|
|
15
15
|
*
|
|
16
16
|
* ## macOS Permission Handling
|
|
17
17
|
*
|
|
18
|
-
* On macOS, when your Node.js app first calls
|
|
18
|
+
* On macOS, when your Node.js app first calls keyring operations:
|
|
19
19
|
* - `setPassword()` creates a new Keychain item (no prompt required)
|
|
20
20
|
* - `getPassword()` may prompt the user for permission on first access
|
|
21
21
|
* - Users can click "Allow", "Always Allow", or "Deny"
|
|
22
|
-
* - If denied,
|
|
22
|
+
* - If denied, keyring returns `null` which this implementation handles gracefully
|
|
23
23
|
* - The calling binary (usually `node`) will be shown in the permission prompt
|
|
24
24
|
* - For better UX in packaged apps, consider code signing and app bundling
|
|
25
25
|
*
|
|
@@ -33,34 +33,75 @@ var KeyChainStore = class {
|
|
|
33
33
|
type = CredentialStoreType.keychain;
|
|
34
34
|
service;
|
|
35
35
|
logger = getLogger("KeyChainStore");
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
keyringAvailable = false;
|
|
37
|
+
EntryClass = null;
|
|
38
38
|
initializationPromise;
|
|
39
39
|
constructor(id, servicePrefix = "inkeep-agent-framework") {
|
|
40
40
|
this.id = id;
|
|
41
41
|
this.service = `${servicePrefix}-${id}`;
|
|
42
|
-
this.initializationPromise = this.
|
|
42
|
+
this.initializationPromise = this.initializeKeyring();
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* Initialize
|
|
45
|
+
* Initialize keyring dynamically to handle optional availability
|
|
46
46
|
*/
|
|
47
|
-
async
|
|
48
|
-
if (this.
|
|
49
|
-
this.
|
|
47
|
+
async initializeKeyring() {
|
|
48
|
+
if (this.EntryClass) {
|
|
49
|
+
this.keyringAvailable = true;
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
try {
|
|
53
|
-
this.
|
|
53
|
+
this.EntryClass = (await import(
|
|
54
54
|
/* webpackIgnore: true */
|
|
55
|
-
"
|
|
56
|
-
)).
|
|
57
|
-
this.
|
|
55
|
+
"@napi-rs/keyring"
|
|
56
|
+
)).Entry;
|
|
57
|
+
this.keyringAvailable = true;
|
|
58
58
|
} catch (error) {
|
|
59
59
|
this.logger.warn({
|
|
60
60
|
storeId: this.id,
|
|
61
61
|
error: error instanceof Error ? error.message : "Unknown error"
|
|
62
|
-
}, "
|
|
63
|
-
this.
|
|
62
|
+
}, "Keyring not available - KeyChainStore will return null for all operations");
|
|
63
|
+
this.keyringAvailable = false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Add a key to the index
|
|
68
|
+
*/
|
|
69
|
+
addKeyToIndex(key) {
|
|
70
|
+
if (!this.EntryClass) return;
|
|
71
|
+
try {
|
|
72
|
+
const indexEntry = new this.EntryClass(this.service, "__key_index__");
|
|
73
|
+
const indexJson = indexEntry.getPassword();
|
|
74
|
+
const keys = indexJson ? JSON.parse(indexJson) : [];
|
|
75
|
+
if (!keys.includes(key)) {
|
|
76
|
+
keys.push(key);
|
|
77
|
+
indexEntry.setPassword(JSON.stringify(keys));
|
|
78
|
+
}
|
|
79
|
+
} catch (error) {
|
|
80
|
+
this.logger.warn({
|
|
81
|
+
storeId: this.id,
|
|
82
|
+
key,
|
|
83
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
84
|
+
}, "Failed to update key index");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Remove a key from the index
|
|
89
|
+
*/
|
|
90
|
+
removeKeyFromIndex(key) {
|
|
91
|
+
if (!this.EntryClass) return;
|
|
92
|
+
try {
|
|
93
|
+
const indexEntry = new this.EntryClass(this.service, "__key_index__");
|
|
94
|
+
const indexJson = indexEntry.getPassword();
|
|
95
|
+
if (!indexJson) return;
|
|
96
|
+
const keys = JSON.parse(indexJson);
|
|
97
|
+
const filteredKeys = keys.filter((k) => k !== key);
|
|
98
|
+
if (filteredKeys.length !== keys.length) indexEntry.setPassword(JSON.stringify(filteredKeys));
|
|
99
|
+
} catch (error) {
|
|
100
|
+
this.logger.warn({
|
|
101
|
+
storeId: this.id,
|
|
102
|
+
key,
|
|
103
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
104
|
+
}, "Failed to update key index");
|
|
64
105
|
}
|
|
65
106
|
}
|
|
66
107
|
/**
|
|
@@ -68,20 +109,23 @@ var KeyChainStore = class {
|
|
|
68
109
|
*/
|
|
69
110
|
async get(key) {
|
|
70
111
|
await this.initializationPromise;
|
|
71
|
-
if (!this.
|
|
112
|
+
if (!this.keyringAvailable || !this.EntryClass) {
|
|
72
113
|
this.logger.debug({
|
|
73
114
|
storeId: this.id,
|
|
74
115
|
key
|
|
75
|
-
}, "
|
|
116
|
+
}, "Keyring not available, returning null");
|
|
76
117
|
return null;
|
|
77
118
|
}
|
|
78
119
|
try {
|
|
79
|
-
const password =
|
|
80
|
-
if (password === null)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
120
|
+
const password = new this.EntryClass(this.service, key).getPassword();
|
|
121
|
+
if (password === null || password === void 0) {
|
|
122
|
+
this.logger.debug({
|
|
123
|
+
storeId: this.id,
|
|
124
|
+
service: this.service,
|
|
125
|
+
account: key
|
|
126
|
+
}, "No credential found in keychain");
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
85
129
|
return password;
|
|
86
130
|
} catch (error) {
|
|
87
131
|
this.logger.error({
|
|
@@ -98,15 +142,16 @@ var KeyChainStore = class {
|
|
|
98
142
|
*/
|
|
99
143
|
async set(key, value, _metadata) {
|
|
100
144
|
await this.initializationPromise;
|
|
101
|
-
if (!this.
|
|
145
|
+
if (!this.keyringAvailable || !this.EntryClass) {
|
|
102
146
|
this.logger.warn({
|
|
103
147
|
storeId: this.id,
|
|
104
148
|
key
|
|
105
|
-
}, "
|
|
106
|
-
throw new Error("
|
|
149
|
+
}, "Keyring not available, cannot set credential");
|
|
150
|
+
throw new Error("Keyring not available - cannot store credentials in system keychain");
|
|
107
151
|
}
|
|
108
152
|
try {
|
|
109
|
-
|
|
153
|
+
new this.EntryClass(this.service, key).setPassword(value);
|
|
154
|
+
this.addKeyToIndex(key);
|
|
110
155
|
this.logger.debug({
|
|
111
156
|
storeId: this.id,
|
|
112
157
|
service: this.service,
|
|
@@ -133,9 +178,9 @@ var KeyChainStore = class {
|
|
|
133
178
|
*/
|
|
134
179
|
async checkAvailability() {
|
|
135
180
|
await this.initializationPromise;
|
|
136
|
-
if (!this.
|
|
181
|
+
if (!this.keyringAvailable || !this.EntryClass) return {
|
|
137
182
|
available: false,
|
|
138
|
-
reason: "
|
|
183
|
+
reason: "Keyring not available - cannot store credentials in system keychain"
|
|
139
184
|
};
|
|
140
185
|
return { available: true };
|
|
141
186
|
}
|
|
@@ -144,26 +189,22 @@ var KeyChainStore = class {
|
|
|
144
189
|
*/
|
|
145
190
|
async delete(key) {
|
|
146
191
|
await this.initializationPromise;
|
|
147
|
-
if (!this.
|
|
192
|
+
if (!this.keyringAvailable || !this.EntryClass) {
|
|
148
193
|
this.logger.warn({
|
|
149
194
|
storeId: this.id,
|
|
150
195
|
key
|
|
151
|
-
}, "
|
|
196
|
+
}, "Keyring not available, cannot delete credential");
|
|
152
197
|
return false;
|
|
153
198
|
}
|
|
154
199
|
try {
|
|
155
|
-
|
|
156
|
-
|
|
200
|
+
new this.EntryClass(this.service, key).deletePassword();
|
|
201
|
+
this.removeKeyFromIndex(key);
|
|
202
|
+
this.logger.debug({
|
|
157
203
|
storeId: this.id,
|
|
158
204
|
service: this.service,
|
|
159
205
|
account: key
|
|
160
206
|
}, "Credential deleted from keychain");
|
|
161
|
-
|
|
162
|
-
storeId: this.id,
|
|
163
|
-
service: this.service,
|
|
164
|
-
account: key
|
|
165
|
-
}, "Credential not found in keychain for deletion");
|
|
166
|
-
return result;
|
|
207
|
+
return true;
|
|
167
208
|
} catch (error) {
|
|
168
209
|
this.logger.error({
|
|
169
210
|
storeId: this.id,
|
|
@@ -177,12 +218,29 @@ var KeyChainStore = class {
|
|
|
177
218
|
/**
|
|
178
219
|
* Find all credentials for this service
|
|
179
220
|
* Useful for debugging and listing stored credentials
|
|
221
|
+
*
|
|
222
|
+
* NOTE: @napi-rs/keyring does not have a findCredentials equivalent.
|
|
223
|
+
* This implementation uses a key index to track all stored keys.
|
|
224
|
+
* The index is maintained separately and updated during set/delete operations.
|
|
180
225
|
*/
|
|
181
226
|
async findAllCredentials() {
|
|
182
227
|
await this.initializationPromise;
|
|
183
|
-
if (!this.
|
|
228
|
+
if (!this.keyringAvailable || !this.EntryClass) return [];
|
|
184
229
|
try {
|
|
185
|
-
|
|
230
|
+
const indexJson = new this.EntryClass(this.service, "__key_index__").getPassword();
|
|
231
|
+
if (!indexJson) return [];
|
|
232
|
+
const keys = JSON.parse(indexJson);
|
|
233
|
+
const credentials = [];
|
|
234
|
+
for (const key of keys) try {
|
|
235
|
+
const password = new this.EntryClass(this.service, key).getPassword();
|
|
236
|
+
if (password) credentials.push({
|
|
237
|
+
account: key,
|
|
238
|
+
password
|
|
239
|
+
});
|
|
240
|
+
} catch {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
return credentials;
|
|
186
244
|
} catch (error) {
|
|
187
245
|
this.logger.error({
|
|
188
246
|
storeId: this.id,
|
|
@@ -200,6 +258,14 @@ var KeyChainStore = class {
|
|
|
200
258
|
const credentials = await this.findAllCredentials();
|
|
201
259
|
let deletedCount = 0;
|
|
202
260
|
for (const cred of credentials) if (await this.delete(cred.account)) deletedCount++;
|
|
261
|
+
if (this.EntryClass && deletedCount > 0) try {
|
|
262
|
+
new this.EntryClass(this.service, "__key_index__").deletePassword();
|
|
263
|
+
} catch (error) {
|
|
264
|
+
this.logger.warn({
|
|
265
|
+
storeId: this.id,
|
|
266
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
267
|
+
}, "Failed to delete key index");
|
|
268
|
+
}
|
|
203
269
|
if (deletedCount > 0) this.logger.info({
|
|
204
270
|
storeId: this.id,
|
|
205
271
|
service: this.service,
|
|
@@ -8,11 +8,14 @@ import { PgTable } from "drizzle-orm/pg-core";
|
|
|
8
8
|
declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
9
9
|
scopes: AgentScopeConfig;
|
|
10
10
|
}) => Promise<{
|
|
11
|
+
tenantId: string;
|
|
12
|
+
projectId: string;
|
|
11
13
|
id: string;
|
|
12
14
|
name: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
prompt: string | null;
|
|
13
17
|
createdAt: string;
|
|
14
18
|
updatedAt: string;
|
|
15
|
-
description: string | null;
|
|
16
19
|
models: {
|
|
17
20
|
base?: {
|
|
18
21
|
model?: string | undefined;
|
|
@@ -30,10 +33,8 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
30
33
|
stopWhen: {
|
|
31
34
|
transferCountIs?: number | undefined;
|
|
32
35
|
} | null;
|
|
33
|
-
tenantId: string;
|
|
34
36
|
defaultSubAgentId: string | null;
|
|
35
37
|
contextConfigId: string | null;
|
|
36
|
-
prompt: string | null;
|
|
37
38
|
statusUpdates: {
|
|
38
39
|
enabled?: boolean | undefined;
|
|
39
40
|
numEvents?: number | undefined;
|
|
@@ -49,16 +50,18 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
49
50
|
} | undefined;
|
|
50
51
|
}[] | undefined;
|
|
51
52
|
} | null;
|
|
52
|
-
projectId: string;
|
|
53
53
|
} | null>;
|
|
54
54
|
declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
56
56
|
}) => Promise<{
|
|
57
|
+
tenantId: string;
|
|
58
|
+
projectId: string;
|
|
57
59
|
id: string;
|
|
58
60
|
name: string;
|
|
61
|
+
description: string | null;
|
|
62
|
+
prompt: string | null;
|
|
59
63
|
createdAt: string;
|
|
60
64
|
updatedAt: string;
|
|
61
|
-
description: string | null;
|
|
62
65
|
models: {
|
|
63
66
|
base?: {
|
|
64
67
|
model?: string | undefined;
|
|
@@ -76,10 +79,8 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
76
79
|
stopWhen: {
|
|
77
80
|
transferCountIs?: number | undefined;
|
|
78
81
|
} | null;
|
|
79
|
-
tenantId: string;
|
|
80
82
|
defaultSubAgentId: string | null;
|
|
81
83
|
contextConfigId: string | null;
|
|
82
|
-
prompt: string | null;
|
|
83
84
|
statusUpdates: {
|
|
84
85
|
enabled?: boolean | undefined;
|
|
85
86
|
numEvents?: number | undefined;
|
|
@@ -95,13 +96,16 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
95
96
|
} | undefined;
|
|
96
97
|
}[] | undefined;
|
|
97
98
|
} | null;
|
|
98
|
-
projectId: string;
|
|
99
99
|
defaultSubAgent: {
|
|
100
|
+
tenantId: string;
|
|
101
|
+
projectId: string;
|
|
100
102
|
id: string;
|
|
101
103
|
name: string;
|
|
104
|
+
description: string | null;
|
|
105
|
+
prompt: string | null;
|
|
106
|
+
agentId: string;
|
|
102
107
|
createdAt: string;
|
|
103
108
|
updatedAt: string;
|
|
104
|
-
description: string | null;
|
|
105
109
|
models: {
|
|
106
110
|
base?: {
|
|
107
111
|
model?: string | undefined;
|
|
@@ -119,21 +123,20 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
119
123
|
stopWhen: {
|
|
120
124
|
stepCountIs?: number | undefined;
|
|
121
125
|
} | null;
|
|
122
|
-
tenantId: string;
|
|
123
|
-
prompt: string | null;
|
|
124
|
-
projectId: string;
|
|
125
|
-
agentId: string;
|
|
126
126
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
127
127
|
} | null;
|
|
128
128
|
} | null>;
|
|
129
129
|
declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
130
130
|
scopes: ProjectScopeConfig;
|
|
131
131
|
}) => Promise<{
|
|
132
|
+
tenantId: string;
|
|
133
|
+
projectId: string;
|
|
132
134
|
id: string;
|
|
133
135
|
name: string;
|
|
136
|
+
description: string | null;
|
|
137
|
+
prompt: string | null;
|
|
134
138
|
createdAt: string;
|
|
135
139
|
updatedAt: string;
|
|
136
|
-
description: string | null;
|
|
137
140
|
models: {
|
|
138
141
|
base?: {
|
|
139
142
|
model?: string | undefined;
|
|
@@ -151,10 +154,8 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
151
154
|
stopWhen: {
|
|
152
155
|
transferCountIs?: number | undefined;
|
|
153
156
|
} | null;
|
|
154
|
-
tenantId: string;
|
|
155
157
|
defaultSubAgentId: string | null;
|
|
156
158
|
contextConfigId: string | null;
|
|
157
|
-
prompt: string | null;
|
|
158
159
|
statusUpdates: {
|
|
159
160
|
enabled?: boolean | undefined;
|
|
160
161
|
numEvents?: number | undefined;
|
|
@@ -170,7 +171,6 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
170
171
|
} | undefined;
|
|
171
172
|
}[] | undefined;
|
|
172
173
|
} | null;
|
|
173
|
-
projectId: string;
|
|
174
174
|
}[]>;
|
|
175
175
|
declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
176
176
|
scopes: ProjectScopeConfig;
|
|
@@ -228,11 +228,14 @@ declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params:
|
|
|
228
228
|
};
|
|
229
229
|
}>;
|
|
230
230
|
declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
|
|
231
|
+
tenantId: string;
|
|
232
|
+
projectId: string;
|
|
231
233
|
id: string;
|
|
232
234
|
name: string;
|
|
235
|
+
description: string | null;
|
|
236
|
+
prompt: string | null;
|
|
233
237
|
createdAt: string;
|
|
234
238
|
updatedAt: string;
|
|
235
|
-
description: string | null;
|
|
236
239
|
models: {
|
|
237
240
|
base?: {
|
|
238
241
|
model?: string | undefined;
|
|
@@ -250,10 +253,8 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
250
253
|
stopWhen: {
|
|
251
254
|
transferCountIs?: number | undefined;
|
|
252
255
|
} | null;
|
|
253
|
-
tenantId: string;
|
|
254
256
|
defaultSubAgentId: string | null;
|
|
255
257
|
contextConfigId: string | null;
|
|
256
|
-
prompt: string | null;
|
|
257
258
|
statusUpdates: {
|
|
258
259
|
enabled?: boolean | undefined;
|
|
259
260
|
numEvents?: number | undefined;
|
|
@@ -269,7 +270,6 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
269
270
|
} | undefined;
|
|
270
271
|
}[] | undefined;
|
|
271
272
|
} | null;
|
|
272
|
-
projectId: string;
|
|
273
273
|
}>;
|
|
274
274
|
declare const updateAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
275
275
|
scopes: AgentScopeConfig;
|
|
@@ -7,13 +7,13 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
7
7
|
scopes: ProjectScopeConfig;
|
|
8
8
|
id: string;
|
|
9
9
|
}) => Promise<{
|
|
10
|
+
tenantId: string;
|
|
11
|
+
projectId: string;
|
|
10
12
|
id: string;
|
|
11
13
|
name: string;
|
|
14
|
+
description: string | null;
|
|
12
15
|
createdAt: string;
|
|
13
16
|
updatedAt: string;
|
|
14
|
-
description: string | null;
|
|
15
|
-
tenantId: string;
|
|
16
|
-
projectId: string;
|
|
17
17
|
props: Record<string, unknown> | null;
|
|
18
18
|
render: {
|
|
19
19
|
component: string;
|
|
@@ -49,13 +49,13 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
49
49
|
};
|
|
50
50
|
}>;
|
|
51
51
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
52
|
+
tenantId: string;
|
|
53
|
+
projectId: string;
|
|
52
54
|
id: string;
|
|
53
55
|
name: string;
|
|
56
|
+
description: string | null;
|
|
54
57
|
createdAt: string;
|
|
55
58
|
updatedAt: string;
|
|
56
|
-
description: string | null;
|
|
57
|
-
tenantId: string;
|
|
58
|
-
projectId: string;
|
|
59
59
|
props: Record<string, unknown> | null;
|
|
60
60
|
render: {
|
|
61
61
|
component: string;
|
|
@@ -104,11 +104,11 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
|
|
|
104
104
|
scopes: SubAgentScopeConfig;
|
|
105
105
|
artifactComponentId: string;
|
|
106
106
|
}) => Promise<{
|
|
107
|
-
id: string;
|
|
108
|
-
createdAt: string;
|
|
109
107
|
tenantId: string;
|
|
110
108
|
projectId: string;
|
|
109
|
+
id: string;
|
|
111
110
|
agentId: string;
|
|
111
|
+
createdAt: string;
|
|
112
112
|
subAgentId: string;
|
|
113
113
|
artifactComponentId: string;
|
|
114
114
|
}>;
|
|
@@ -147,11 +147,11 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
|
|
|
147
147
|
scopes: SubAgentScopeConfig;
|
|
148
148
|
artifactComponentId: string;
|
|
149
149
|
}) => Promise<{
|
|
150
|
-
id: string;
|
|
151
|
-
createdAt: string;
|
|
152
150
|
tenantId: string;
|
|
153
151
|
projectId: string;
|
|
152
|
+
id: string;
|
|
154
153
|
agentId: string;
|
|
154
|
+
createdAt: string;
|
|
155
155
|
subAgentId: string;
|
|
156
156
|
artifactComponentId: string;
|
|
157
157
|
} | null>;
|