@inkeep/agents-core 0.37.0 → 0.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth-schema.js +1 -1
- package/dist/auth/auth-validation-schemas.js +18 -18
- package/dist/auth/auth.d.ts +3 -3
- package/dist/auth/auth.js +5 -4
- package/dist/{auth-detection-CGqhPDnj.d.ts → auth-detection-7G0Dxt55.d.ts} +11 -0
- package/dist/{chunk-SSRRHYU4.js → chunk-7GZHUB4J.js} +4 -5
- package/dist/chunk-CMNLBV2A.js +39 -0
- package/dist/{chunk-MB2ZIPZS.js → chunk-FOK3JSQN.js} +5 -5
- package/dist/{chunk-SG75RA63.js → chunk-I6IF7ZTL.js} +2 -2
- package/dist/{chunk-VQXQOGJU.js → chunk-K6GMXJPW.js} +313 -315
- package/dist/{chunk-Q5U2SVA6.js → chunk-LL6F3EAR.js} +11 -7
- package/dist/{chunk-TGESM3JG.js → chunk-MQMMFK2K.js} +14 -3
- package/dist/{chunk-NFYCSHD3.js → chunk-PVRIMF6N.js} +2 -1
- package/dist/{chunk-ICZLNCX7.js → chunk-ROXPFQAM.js} +367 -69
- package/dist/{chunk-32YRH2S7.js → chunk-W3QDM7WH.js} +63 -67
- package/dist/{chunk-SLQW43IV.js → chunk-ZEZCCHV7.js} +4 -5
- package/dist/{client-CnpNkGsH.d.ts → client-B_3j-V4-.d.ts} +1 -1
- package/dist/client-exports.d.ts +6 -3
- package/dist/client-exports.js +126 -127
- package/dist/constants/schema-validation/index.js +1 -1
- package/dist/credential-stores/index.d.ts +3 -3
- package/dist/credential-stores/index.js +1 -1
- package/dist/db/schema.d.ts +2 -2
- package/dist/db/schema.js +2 -2
- package/dist/db/test-client.d.ts +3 -3
- package/dist/db/test-client.js +1 -1
- package/dist/index.d.ts +126 -9
- package/dist/index.js +284 -73
- package/dist/{schema-Cgkp_geg.d.ts → schema-DKbG39on.d.ts} +24 -1
- package/dist/server-BXoUiBMg.d.ts +127 -0
- package/dist/types/index.d.ts +33 -113
- package/dist/types/index.js +1 -1
- package/dist/{utility-C_tTZ7-k.d.ts → utility-Lo5NoRHK.d.ts} +141 -11
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/drizzle/{0001_fair_malice.sql → 0001_calm_sheva_callister.sql} +1 -16
- package/drizzle/meta/0001_snapshot.json +7 -1
- package/drizzle/meta/_journal.json +2 -2
- package/package.json +14 -4
- package/dist/chunk-CUM6BY2Y.js +0 -320
- package/dist/chunk-H2F72PDA.js +0 -15
- package/dist/chunk-OUXC23J7.js +0 -12534
- /package/dist/{chunk-NOPEANIU.js → chunk-NFTJ5JBY.js} +0 -0
package/dist/auth/auth-schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { account, invitation, member, organization, session, ssoProvider, user, verification } from '../chunk-
|
|
1
|
+
export { account, invitation, member, organization, session, ssoProvider, user, verification } from '../chunk-NFTJ5JBY.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { user, session, account, organization, member, invitation, verification } from '../chunk-
|
|
2
|
-
import { external_exports } from '../chunk-OUXC23J7.js';
|
|
1
|
+
import { user, session, account, organization, member, invitation, verification } from '../chunk-NFTJ5JBY.js';
|
|
3
2
|
import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
|
|
3
|
+
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
var UserSelectSchema = createSelectSchema(user);
|
|
6
6
|
var UserInsertSchema = createInsertSchema(user);
|
|
@@ -16,24 +16,24 @@ var InvitationSelectSchema = createSelectSchema(invitation);
|
|
|
16
16
|
var InvitationInsertSchema = createInsertSchema(invitation);
|
|
17
17
|
var VerificationSelectSchema = createSelectSchema(verification);
|
|
18
18
|
var VerificationInsertSchema = createInsertSchema(verification);
|
|
19
|
-
var UserOrganizationSchema =
|
|
20
|
-
id:
|
|
21
|
-
userId:
|
|
22
|
-
organizationId:
|
|
23
|
-
role:
|
|
24
|
-
createdAt:
|
|
25
|
-
organizationName:
|
|
26
|
-
organizationSlug:
|
|
19
|
+
var UserOrganizationSchema = z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
userId: z.string(),
|
|
22
|
+
organizationId: z.string(),
|
|
23
|
+
role: z.string(),
|
|
24
|
+
createdAt: z.union([z.string(), z.date()]).transform((val) => val instanceof Date ? val.toISOString() : val),
|
|
25
|
+
organizationName: z.string().nullable(),
|
|
26
|
+
organizationSlug: z.string().nullable()
|
|
27
27
|
});
|
|
28
|
-
var UserOrganizationsResponseSchema =
|
|
29
|
-
var AddUserToOrganizationRequestSchema =
|
|
30
|
-
organizationId:
|
|
31
|
-
role:
|
|
28
|
+
var UserOrganizationsResponseSchema = z.array(UserOrganizationSchema);
|
|
29
|
+
var AddUserToOrganizationRequestSchema = z.object({
|
|
30
|
+
organizationId: z.string(),
|
|
31
|
+
role: z.string().default("member")
|
|
32
32
|
});
|
|
33
|
-
var AddUserToOrganizationResponseSchema =
|
|
34
|
-
organizationId:
|
|
35
|
-
role:
|
|
36
|
-
createdAt:
|
|
33
|
+
var AddUserToOrganizationResponseSchema = z.object({
|
|
34
|
+
organizationId: z.string(),
|
|
35
|
+
role: z.string(),
|
|
36
|
+
createdAt: z.string()
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
export { AccountInsertSchema, AccountSelectSchema, AddUserToOrganizationRequestSchema, AddUserToOrganizationResponseSchema, InvitationInsertSchema, InvitationSelectSchema, MemberInsertSchema, MemberSelectSchema, OrganizationInsertSchema, OrganizationSelectSchema, SessionInsertSchema, SessionSelectSchema, UserInsertSchema, UserOrganizationSchema, UserOrganizationsResponseSchema, UserSelectSchema, VerificationInsertSchema, VerificationSelectSchema };
|
package/dist/auth/auth.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ import * as zod from 'zod';
|
|
|
4
4
|
import * as better_auth from 'better-auth';
|
|
5
5
|
import { BetterAuthAdvancedOptions } from 'better-auth';
|
|
6
6
|
import { GoogleOptions } from 'better-auth/social-providers';
|
|
7
|
-
import { D as DatabaseClient } from '../client-
|
|
7
|
+
import { D as DatabaseClient } from '../client-B_3j-V4-.js';
|
|
8
8
|
import 'drizzle-orm/node-postgres';
|
|
9
9
|
import 'drizzle-orm/pglite';
|
|
10
|
-
import '../schema-
|
|
10
|
+
import '../schema-DKbG39on.js';
|
|
11
11
|
import 'drizzle-orm';
|
|
12
12
|
import 'drizzle-orm/pg-core';
|
|
13
|
-
import '../utility-
|
|
13
|
+
import '../utility-Lo5NoRHK.js';
|
|
14
14
|
import 'drizzle-zod';
|
|
15
15
|
import '@hono/zod-openapi';
|
|
16
16
|
import './auth-schema.js';
|
package/dist/auth/auth.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { generateId } from '../chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { generateId } from '../chunk-ROXPFQAM.js';
|
|
2
|
+
import { env } from '../chunk-LL6F3EAR.js';
|
|
3
|
+
import { ssoProvider } from '../chunk-NFTJ5JBY.js';
|
|
3
4
|
import { ownerRole, adminRole, memberRole, ac } from '../chunk-VMSYBWFH.js';
|
|
4
5
|
import { sso } from '@better-auth/sso';
|
|
5
|
-
import { betterAuth
|
|
6
|
+
import { betterAuth } from 'better-auth';
|
|
6
7
|
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
|
|
7
8
|
import { organization } from 'better-auth/plugins';
|
|
8
9
|
import { eq } from 'drizzle-orm';
|
|
@@ -88,7 +89,7 @@ function createAuth(config) {
|
|
|
88
89
|
"http://localhost:3002",
|
|
89
90
|
env.INKEEP_AGENTS_MANAGE_UI_URL,
|
|
90
91
|
env.INKEEP_AGENTS_MANAGE_API_URL
|
|
91
|
-
],
|
|
92
|
+
].filter((origin) => typeof origin === "string" && origin.length > 0),
|
|
92
93
|
plugins: [
|
|
93
94
|
sso(),
|
|
94
95
|
organization({
|
|
@@ -12,6 +12,9 @@ declare const SPAN_NAMES: {
|
|
|
12
12
|
readonly AGENT_GENERATION: "agent.generate";
|
|
13
13
|
readonly CONTEXT_FETCHER: "context-fetcher.http-request";
|
|
14
14
|
readonly ARTIFACT_PROCESSING: "agent_session.process_artifact";
|
|
15
|
+
readonly TOOL_APPROVAL_REQUESTED: "tool.approval_requested";
|
|
16
|
+
readonly TOOL_APPROVAL_APPROVED: "tool.approval_approved";
|
|
17
|
+
readonly TOOL_APPROVAL_DENIED: "tool.approval_denied";
|
|
15
18
|
};
|
|
16
19
|
declare const AI_OPERATIONS: {
|
|
17
20
|
readonly GENERATE_TEXT: "ai.generateText.doGenerate";
|
|
@@ -53,6 +56,8 @@ declare const SPAN_KEYS: {
|
|
|
53
56
|
readonly AI_TOOL_CALL_ID: "ai.toolCall.id";
|
|
54
57
|
readonly AI_TOOL_TYPE: "ai.toolType";
|
|
55
58
|
readonly TOOL_PURPOSE: "tool.purpose";
|
|
59
|
+
readonly TOOL_NAME: "tool.name";
|
|
60
|
+
readonly TOOL_CALL_ID: "tool.callId";
|
|
56
61
|
readonly GEN_AI_USAGE_INPUT_TOKENS: "gen_ai.usage.input_tokens";
|
|
57
62
|
readonly GEN_AI_USAGE_OUTPUT_TOKENS: "gen_ai.usage.output_tokens";
|
|
58
63
|
readonly CONTEXT_URL: "context.url";
|
|
@@ -92,6 +97,9 @@ declare const ACTIVITY_TYPES: {
|
|
|
92
97
|
readonly AI_ASSISTANT_MESSAGE: "ai_assistant_message";
|
|
93
98
|
readonly AI_MODEL_STREAMED_TEXT: "ai_model_streamed_text";
|
|
94
99
|
readonly AI_MODEL_STREAMED_OBJECT: "ai_model_streamed_object";
|
|
100
|
+
readonly TOOL_APPROVAL_REQUESTED: "tool_approval_requested";
|
|
101
|
+
readonly TOOL_APPROVAL_APPROVED: "tool_approval_approved";
|
|
102
|
+
readonly TOOL_APPROVAL_DENIED: "tool_approval_denied";
|
|
95
103
|
};
|
|
96
104
|
/** Activity Status Values */
|
|
97
105
|
declare const ACTIVITY_STATUS: {
|
|
@@ -223,6 +231,9 @@ declare const QUERY_EXPRESSIONS: {
|
|
|
223
231
|
readonly AGENT_GENERATIONS: "agentGenerations";
|
|
224
232
|
readonly SPANS_WITH_ERRORS: "spansWithErrors";
|
|
225
233
|
readonly ARTIFACT_PROCESSING: "artifactProcessing";
|
|
234
|
+
readonly TOOL_APPROVAL_REQUESTED: "toolApprovalRequested";
|
|
235
|
+
readonly TOOL_APPROVAL_APPROVED: "toolApprovalApproved";
|
|
236
|
+
readonly TOOL_APPROVAL_DENIED: "toolApprovalDenied";
|
|
226
237
|
};
|
|
227
238
|
/** Query Reduce Operations */
|
|
228
239
|
declare const REDUCE_OPERATIONS: {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { getLogger } from './chunk-DN4B564Y.js';
|
|
2
|
-
import {
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
// src/utils/schema-conversion.ts
|
|
5
4
|
var logger = getLogger("schema-conversion");
|
|
6
5
|
function convertZodToJsonSchema(zodSchema) {
|
|
7
6
|
try {
|
|
8
|
-
const jsonSchema =
|
|
7
|
+
const jsonSchema = z.toJSONSchema(zodSchema);
|
|
9
8
|
if (jsonSchema.$schema) {
|
|
10
9
|
delete jsonSchema.$schema;
|
|
11
10
|
}
|
|
@@ -27,7 +26,7 @@ var preview = (schema) => {
|
|
|
27
26
|
};
|
|
28
27
|
function convertZodToJsonSchemaWithPreview(zodSchema) {
|
|
29
28
|
const jsonSchema = convertZodToJsonSchema(zodSchema);
|
|
30
|
-
if (zodSchema instanceof
|
|
29
|
+
if (zodSchema instanceof z.ZodObject && jsonSchema.properties) {
|
|
31
30
|
const shape = zodSchema.shape;
|
|
32
31
|
for (const [key, fieldSchema] of Object.entries(shape)) {
|
|
33
32
|
if (fieldSchema?._def?.inPreview === true) {
|
|
@@ -42,7 +41,7 @@ function isZodSchema(value) {
|
|
|
42
41
|
}
|
|
43
42
|
function extractPreviewFields(schema) {
|
|
44
43
|
const previewFields = [];
|
|
45
|
-
if (schema instanceof
|
|
44
|
+
if (schema instanceof z.ZodObject) {
|
|
46
45
|
const shape = schema.shape;
|
|
47
46
|
for (const [key, fieldSchema] of Object.entries(shape)) {
|
|
48
47
|
if (fieldSchema?._def?.inPreview === true) {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/types/a2a.ts
|
|
2
|
+
var TaskState = /* @__PURE__ */ ((TaskState2) => {
|
|
3
|
+
TaskState2["Submitted"] = "submitted";
|
|
4
|
+
TaskState2["Working"] = "working";
|
|
5
|
+
TaskState2["InputRequired"] = "input-required";
|
|
6
|
+
TaskState2["Completed"] = "completed";
|
|
7
|
+
TaskState2["Canceled"] = "canceled";
|
|
8
|
+
TaskState2["Failed"] = "failed";
|
|
9
|
+
TaskState2["Rejected"] = "rejected";
|
|
10
|
+
TaskState2["AuthRequired"] = "auth-required";
|
|
11
|
+
TaskState2["Unknown"] = "unknown";
|
|
12
|
+
return TaskState2;
|
|
13
|
+
})(TaskState || {});
|
|
14
|
+
|
|
15
|
+
// src/types/tool-policies.ts
|
|
16
|
+
function normalizeToolSelections(selections) {
|
|
17
|
+
if (!selections || selections.length === 0) {
|
|
18
|
+
return { selectedTools: [], toolPolicies: {} };
|
|
19
|
+
}
|
|
20
|
+
const selectedTools = [];
|
|
21
|
+
const toolPolicies = {};
|
|
22
|
+
for (const selection of selections) {
|
|
23
|
+
if (typeof selection === "string") {
|
|
24
|
+
selectedTools.push(selection);
|
|
25
|
+
} else {
|
|
26
|
+
selectedTools.push(selection.name);
|
|
27
|
+
const policy = {};
|
|
28
|
+
if (selection.needsApproval !== void 0) {
|
|
29
|
+
policy.needsApproval = selection.needsApproval;
|
|
30
|
+
}
|
|
31
|
+
if (Object.keys(policy).length > 0) {
|
|
32
|
+
toolPolicies[selection.name] = policy;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return { selectedTools, toolPolicies };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { TaskState, normalizeToolSelections };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getLogger } from './chunk-DN4B564Y.js';
|
|
2
2
|
import { CredentialStoreType } from './chunk-YFHT5M2R.js';
|
|
3
|
-
import { external_exports } from './chunk-OUXC23J7.js';
|
|
4
3
|
import { Nango } from '@nangohq/node';
|
|
4
|
+
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
// src/credential-stores/CredentialStoreRegistry.ts
|
|
7
7
|
var CredentialStoreRegistry = class {
|
|
@@ -349,10 +349,10 @@ var InMemoryCredentialStore = class {
|
|
|
349
349
|
}
|
|
350
350
|
};
|
|
351
351
|
var logger = getLogger("nango-credential-store");
|
|
352
|
-
var CredentialKeySchema =
|
|
353
|
-
connectionId:
|
|
354
|
-
providerConfigKey:
|
|
355
|
-
integrationDisplayName:
|
|
352
|
+
var CredentialKeySchema = z.object({
|
|
353
|
+
connectionId: z.string().min(1, "connectionId must be a non-empty string"),
|
|
354
|
+
providerConfigKey: z.string().min(1, "providerConfigKey must be a non-empty string"),
|
|
355
|
+
integrationDisplayName: z.string().nullish()
|
|
356
356
|
});
|
|
357
357
|
function parseCredentialKey(key) {
|
|
358
358
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { schema_exports, projects } from './chunk-
|
|
2
|
-
import { organization } from './chunk-
|
|
1
|
+
import { schema_exports, projects } from './chunk-PVRIMF6N.js';
|
|
2
|
+
import { organization } from './chunk-NFTJ5JBY.js';
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { PGlite } from '@electric-sql/pglite';
|