@agent-os-sdk/client 0.9.25 → 0.9.26
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/package.json +15 -8
- package/src/generated/openapi.ts +82 -0
- package/src/generated/swagger.json +163 -0
- package/src/modules/templates.ts +35 -0
- package/dist/client/AgentOsClient.d.ts +0 -141
- package/dist/client/AgentOsClient.d.ts.map +0 -1
- package/dist/client/AgentOsClient.js +0 -250
- package/dist/client/HttpRequestBuilder.d.ts +0 -50
- package/dist/client/HttpRequestBuilder.d.ts.map +0 -1
- package/dist/client/HttpRequestBuilder.js +0 -83
- package/dist/client/OperationContext.d.ts +0 -19
- package/dist/client/OperationContext.d.ts.map +0 -1
- package/dist/client/OperationContext.js +0 -13
- package/dist/client/OperationContextProvider.d.ts +0 -54
- package/dist/client/OperationContextProvider.d.ts.map +0 -1
- package/dist/client/OperationContextProvider.js +0 -71
- package/dist/client/auth.d.ts +0 -100
- package/dist/client/auth.d.ts.map +0 -1
- package/dist/client/auth.js +0 -38
- package/dist/client/config.d.ts +0 -49
- package/dist/client/config.d.ts.map +0 -1
- package/dist/client/config.js +0 -62
- package/dist/client/helpers.d.ts +0 -63
- package/dist/client/helpers.d.ts.map +0 -1
- package/dist/client/helpers.js +0 -55
- package/dist/client/pagination.d.ts +0 -105
- package/dist/client/pagination.d.ts.map +0 -1
- package/dist/client/pagination.js +0 -117
- package/dist/client/raw.d.ts +0 -277
- package/dist/client/raw.d.ts.map +0 -1
- package/dist/client/raw.js +0 -337
- package/dist/client/retry.d.ts +0 -37
- package/dist/client/retry.d.ts.map +0 -1
- package/dist/client/retry.js +0 -108
- package/dist/client/sanitize.d.ts +0 -19
- package/dist/client/sanitize.d.ts.map +0 -1
- package/dist/client/sanitize.js +0 -28
- package/dist/client/timeout.d.ts +0 -26
- package/dist/client/timeout.d.ts.map +0 -1
- package/dist/client/timeout.js +0 -51
- package/dist/errors/factory.d.ts +0 -22
- package/dist/errors/factory.d.ts.map +0 -1
- package/dist/errors/factory.js +0 -101
- package/dist/errors/index.d.ts +0 -210
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js +0 -283
- package/dist/generated/client.d.ts +0 -20
- package/dist/generated/client.d.ts.map +0 -1
- package/dist/generated/client.js +0 -15
- package/dist/generated/index.d.ts +0 -2
- package/dist/generated/index.d.ts.map +0 -1
- package/dist/generated/index.js +0 -1
- package/dist/generated/openapi.d.ts +0 -12302
- package/dist/generated/openapi.d.ts.map +0 -1
- package/dist/generated/openapi.js +0 -5
- package/dist/index.d.ts +0 -69
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -81
- package/dist/modules/a2a.d.ts +0 -48
- package/dist/modules/a2a.d.ts.map +0 -1
- package/dist/modules/a2a.js +0 -37
- package/dist/modules/agents.d.ts +0 -346
- package/dist/modules/agents.d.ts.map +0 -1
- package/dist/modules/agents.js +0 -296
- package/dist/modules/apiTokens.d.ts +0 -62
- package/dist/modules/apiTokens.d.ts.map +0 -1
- package/dist/modules/apiTokens.js +0 -56
- package/dist/modules/approvals.d.ts +0 -75
- package/dist/modules/approvals.d.ts.map +0 -1
- package/dist/modules/approvals.js +0 -91
- package/dist/modules/audit.d.ts +0 -78
- package/dist/modules/audit.d.ts.map +0 -1
- package/dist/modules/audit.js +0 -94
- package/dist/modules/auth.d.ts +0 -28
- package/dist/modules/auth.d.ts.map +0 -1
- package/dist/modules/auth.js +0 -22
- package/dist/modules/builder.d.ts +0 -242
- package/dist/modules/builder.d.ts.map +0 -1
- package/dist/modules/builder.js +0 -248
- package/dist/modules/catalog.d.ts +0 -142
- package/dist/modules/catalog.d.ts.map +0 -1
- package/dist/modules/catalog.js +0 -136
- package/dist/modules/chatwoot.d.ts +0 -59
- package/dist/modules/chatwoot.d.ts.map +0 -1
- package/dist/modules/chatwoot.js +0 -200
- package/dist/modules/checkpoints.d.ts +0 -62
- package/dist/modules/checkpoints.d.ts.map +0 -1
- package/dist/modules/checkpoints.js +0 -48
- package/dist/modules/contracts.d.ts +0 -48
- package/dist/modules/contracts.d.ts.map +0 -1
- package/dist/modules/contracts.js +0 -25
- package/dist/modules/credentials.d.ts +0 -105
- package/dist/modules/credentials.d.ts.map +0 -1
- package/dist/modules/credentials.js +0 -135
- package/dist/modules/crons.d.ts +0 -73
- package/dist/modules/crons.d.ts.map +0 -1
- package/dist/modules/crons.js +0 -67
- package/dist/modules/datasets.d.ts +0 -80
- package/dist/modules/datasets.d.ts.map +0 -1
- package/dist/modules/datasets.js +0 -91
- package/dist/modules/evaluation.d.ts +0 -183
- package/dist/modules/evaluation.d.ts.map +0 -1
- package/dist/modules/evaluation.js +0 -108
- package/dist/modules/files.d.ts +0 -89
- package/dist/modules/files.d.ts.map +0 -1
- package/dist/modules/files.js +0 -133
- package/dist/modules/graphs.d.ts +0 -120
- package/dist/modules/graphs.d.ts.map +0 -1
- package/dist/modules/graphs.js +0 -69
- package/dist/modules/improvements.d.ts +0 -52
- package/dist/modules/improvements.d.ts.map +0 -1
- package/dist/modules/improvements.js +0 -27
- package/dist/modules/info.d.ts +0 -76
- package/dist/modules/info.d.ts.map +0 -1
- package/dist/modules/info.js +0 -93
- package/dist/modules/knowledge.d.ts +0 -91
- package/dist/modules/knowledge.d.ts.map +0 -1
- package/dist/modules/knowledge.js +0 -80
- package/dist/modules/me.d.ts +0 -58
- package/dist/modules/me.d.ts.map +0 -1
- package/dist/modules/me.js +0 -28
- package/dist/modules/members.d.ts +0 -124
- package/dist/modules/members.d.ts.map +0 -1
- package/dist/modules/members.js +0 -142
- package/dist/modules/memberships.d.ts +0 -25
- package/dist/modules/memberships.d.ts.map +0 -1
- package/dist/modules/memberships.js +0 -20
- package/dist/modules/metaAgent.d.ts +0 -95
- package/dist/modules/metaAgent.d.ts.map +0 -1
- package/dist/modules/metaAgent.js +0 -32
- package/dist/modules/metrics.d.ts +0 -20
- package/dist/modules/metrics.d.ts.map +0 -1
- package/dist/modules/metrics.js +0 -27
- package/dist/modules/observability.d.ts +0 -19
- package/dist/modules/observability.d.ts.map +0 -1
- package/dist/modules/observability.js +0 -14
- package/dist/modules/playground.d.ts +0 -42
- package/dist/modules/playground.d.ts.map +0 -1
- package/dist/modules/playground.js +0 -48
- package/dist/modules/presets.d.ts +0 -32
- package/dist/modules/presets.d.ts.map +0 -1
- package/dist/modules/presets.js +0 -199
- package/dist/modules/prompts.d.ts +0 -87
- package/dist/modules/prompts.d.ts.map +0 -1
- package/dist/modules/prompts.js +0 -87
- package/dist/modules/roles.d.ts +0 -64
- package/dist/modules/roles.d.ts.map +0 -1
- package/dist/modules/roles.js +0 -79
- package/dist/modules/runs.d.ts +0 -451
- package/dist/modules/runs.d.ts.map +0 -1
- package/dist/modules/runs.js +0 -536
- package/dist/modules/store.d.ts +0 -37
- package/dist/modules/store.d.ts.map +0 -1
- package/dist/modules/store.js +0 -48
- package/dist/modules/templates.d.ts +0 -28
- package/dist/modules/templates.d.ts.map +0 -1
- package/dist/modules/templates.js +0 -19
- package/dist/modules/tenants.d.ts +0 -49
- package/dist/modules/tenants.d.ts.map +0 -1
- package/dist/modules/tenants.js +0 -56
- package/dist/modules/threads.d.ts +0 -205
- package/dist/modules/threads.d.ts.map +0 -1
- package/dist/modules/threads.js +0 -225
- package/dist/modules/tools.d.ts +0 -62
- package/dist/modules/tools.d.ts.map +0 -1
- package/dist/modules/tools.js +0 -45
- package/dist/modules/traces.d.ts +0 -89
- package/dist/modules/traces.d.ts.map +0 -1
- package/dist/modules/traces.js +0 -65
- package/dist/modules/triggers.d.ts +0 -228
- package/dist/modules/triggers.d.ts.map +0 -1
- package/dist/modules/triggers.js +0 -176
- package/dist/modules/usage.d.ts +0 -85
- package/dist/modules/usage.d.ts.map +0 -1
- package/dist/modules/usage.js +0 -43
- package/dist/modules/vectorStores.d.ts +0 -100
- package/dist/modules/vectorStores.d.ts.map +0 -1
- package/dist/modules/vectorStores.js +0 -159
- package/dist/modules/workspaces.d.ts +0 -138
- package/dist/modules/workspaces.d.ts.map +0 -1
- package/dist/modules/workspaces.js +0 -121
- package/dist/sse/client.d.ts +0 -140
- package/dist/sse/client.d.ts.map +0 -1
- package/dist/sse/client.js +0 -103
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Catalog Module - Canonical Catalog Access
|
|
3
|
-
*
|
|
4
|
-
* Provides access to versioned catalogs:
|
|
5
|
-
* - Node Catalog (node types, config schemas)
|
|
6
|
-
* - Tool Catalog (tool definitions)
|
|
7
|
-
* - Trigger Templates (trigger configurations)
|
|
8
|
-
*
|
|
9
|
-
* All responses include:
|
|
10
|
-
* - ETag header for caching
|
|
11
|
-
* - X-Content-Hash header for integrity verification
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* const client = new AgentOsClient({ ... })
|
|
16
|
-
*
|
|
17
|
-
* // Get all catalogs
|
|
18
|
-
* const nodes = await unwrap(client.catalog.getNodes())
|
|
19
|
-
* const tools = await unwrap(client.catalog.getTools())
|
|
20
|
-
* const triggers = await unwrap(client.catalog.getTriggers())
|
|
21
|
-
*
|
|
22
|
-
* // Use returned metadata for caching
|
|
23
|
-
* console.log(nodes.etag, nodes.contentHash)
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
27
|
-
export interface CatalogVersions {
|
|
28
|
-
nodes: string;
|
|
29
|
-
tools: string;
|
|
30
|
-
triggers: string;
|
|
31
|
-
}
|
|
32
|
-
export interface CatalogMetadata {
|
|
33
|
-
version: string;
|
|
34
|
-
etag?: string;
|
|
35
|
-
contentHash?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface PaletteCatalogResponse extends CatalogMetadata {
|
|
38
|
-
nodes: NodeDefinition[];
|
|
39
|
-
tools: ToolDefinition[];
|
|
40
|
-
triggers: TriggerTemplate[];
|
|
41
|
-
presets: PresetDefinition[];
|
|
42
|
-
}
|
|
43
|
-
export interface NodeCatalogResponse extends CatalogMetadata {
|
|
44
|
-
nodes: NodeDefinition[];
|
|
45
|
-
}
|
|
46
|
-
export interface NodeDefinition {
|
|
47
|
-
capability_ref: string;
|
|
48
|
-
capability_version: string;
|
|
49
|
-
execution_binding: string;
|
|
50
|
-
required_credentials: string[];
|
|
51
|
-
kind: string;
|
|
52
|
-
title: string;
|
|
53
|
-
category: string;
|
|
54
|
-
description?: string;
|
|
55
|
-
inputs?: string[];
|
|
56
|
-
outputs?: string[];
|
|
57
|
-
config_schema?: Record<string, unknown>;
|
|
58
|
-
default_config?: Record<string, unknown>;
|
|
59
|
-
}
|
|
60
|
-
export interface ToolCatalogResponse extends CatalogMetadata {
|
|
61
|
-
tools: ToolDefinition[];
|
|
62
|
-
}
|
|
63
|
-
export interface ToolDefinition {
|
|
64
|
-
capability_ref: string;
|
|
65
|
-
capability_version: string;
|
|
66
|
-
execution_binding: string;
|
|
67
|
-
slug?: string;
|
|
68
|
-
required_credentials: string[];
|
|
69
|
-
name: string;
|
|
70
|
-
description?: string;
|
|
71
|
-
type: string;
|
|
72
|
-
version?: number;
|
|
73
|
-
input_schema?: Record<string, unknown>;
|
|
74
|
-
output_schema?: Record<string, unknown>;
|
|
75
|
-
}
|
|
76
|
-
export interface TriggerCatalogResponse extends CatalogMetadata {
|
|
77
|
-
templates: TriggerTemplate[];
|
|
78
|
-
}
|
|
79
|
-
export interface TriggerTemplate {
|
|
80
|
-
capability_ref: string;
|
|
81
|
-
capability_version: string;
|
|
82
|
-
slug?: string;
|
|
83
|
-
kind: string;
|
|
84
|
-
description?: string;
|
|
85
|
-
run_input_schema?: Record<string, unknown>;
|
|
86
|
-
}
|
|
87
|
-
export interface PresetCatalogResponse extends CatalogMetadata {
|
|
88
|
-
presets: PresetDefinition[];
|
|
89
|
-
}
|
|
90
|
-
export interface PresetDefinition {
|
|
91
|
-
preset_slug: string;
|
|
92
|
-
base_capability_ref: string;
|
|
93
|
-
title: string;
|
|
94
|
-
description?: string;
|
|
95
|
-
default_config?: Record<string, unknown>;
|
|
96
|
-
locked_fields?: string[];
|
|
97
|
-
ui_variant?: string;
|
|
98
|
-
}
|
|
99
|
-
export declare class CatalogModule {
|
|
100
|
-
private client;
|
|
101
|
-
constructor(client: RawClient);
|
|
102
|
-
getPalette(version?: string): Promise<APIResponse<PaletteCatalogResponse>>;
|
|
103
|
-
/**
|
|
104
|
-
* Get the Node Catalog.
|
|
105
|
-
* Returns node types with their configuration schemas.
|
|
106
|
-
*/
|
|
107
|
-
getNodes(version?: string): Promise<APIResponse<NodeCatalogResponse>>;
|
|
108
|
-
/**
|
|
109
|
-
* Get the Tool Catalog.
|
|
110
|
-
* Returns tool definitions with input/output schemas.
|
|
111
|
-
*/
|
|
112
|
-
getTools(version?: string): Promise<APIResponse<ToolCatalogResponse>>;
|
|
113
|
-
/**
|
|
114
|
-
* Get the Trigger Templates Catalog.
|
|
115
|
-
* Returns trigger configurations and input schemas.
|
|
116
|
-
*/
|
|
117
|
-
getTriggers(version?: string): Promise<APIResponse<TriggerCatalogResponse>>;
|
|
118
|
-
/**
|
|
119
|
-
* Get the Node Presets Catalog.
|
|
120
|
-
* Returns pre-configured node variants with locked fields.
|
|
121
|
-
*/
|
|
122
|
-
getPresets(version?: string): Promise<APIResponse<PresetCatalogResponse>>;
|
|
123
|
-
/**
|
|
124
|
-
* Get all catalogs at once for convenience.
|
|
125
|
-
* Returns combined catalog data with versions.
|
|
126
|
-
*/
|
|
127
|
-
getAll(version?: string): Promise<{
|
|
128
|
-
data?: {
|
|
129
|
-
nodes: NodeCatalogResponse;
|
|
130
|
-
tools: ToolCatalogResponse;
|
|
131
|
-
triggers: TriggerCatalogResponse;
|
|
132
|
-
presets: PresetCatalogResponse;
|
|
133
|
-
catalog_versions: CatalogVersions;
|
|
134
|
-
};
|
|
135
|
-
error?: {
|
|
136
|
-
code: string;
|
|
137
|
-
message: string;
|
|
138
|
-
details?: unknown;
|
|
139
|
-
};
|
|
140
|
-
}>;
|
|
141
|
-
}
|
|
142
|
-
//# sourceMappingURL=catalog.d.ts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types, config schemas)
|
|
6
|
-
* - Tool Catalog (tool definitions)
|
|
7
|
-
* - Trigger Templates (trigger configurations)
|
|
8
|
-
*
|
|
9
|
-
* All responses include:
|
|
10
|
-
* - ETag header for caching
|
|
11
|
-
* - X-Content-Hash header for integrity verification
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* const client = new AgentOsClient({ ... })
|
|
16
|
-
*
|
|
17
|
-
* // Get all catalogs
|
|
18
|
-
* const nodes = await unwrap(client.catalog.getNodes())
|
|
19
|
-
* const tools = await unwrap(client.catalog.getTools())
|
|
20
|
-
* const triggers = await unwrap(client.catalog.getTriggers())
|
|
21
|
-
*
|
|
22
|
-
* // Use returned metadata for caching
|
|
23
|
-
* console.log(nodes.etag, nodes.contentHash)
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export class CatalogModule {
|
|
27
|
-
client;
|
|
28
|
-
constructor(client) {
|
|
29
|
-
this.client = client;
|
|
30
|
-
}
|
|
31
|
-
async getPalette(version = "1") {
|
|
32
|
-
const [nodesRes, toolsRes, triggersRes, presetsRes] = await Promise.all([
|
|
33
|
-
this.getNodes(version),
|
|
34
|
-
this.getTools(version),
|
|
35
|
-
this.getTriggers(version),
|
|
36
|
-
this.getPresets(version),
|
|
37
|
-
]);
|
|
38
|
-
const fallbackResponse = nodesRes.response || toolsRes.response || triggersRes.response || presetsRes.response;
|
|
39
|
-
if (nodesRes.error || toolsRes.error || triggersRes.error || presetsRes.error) {
|
|
40
|
-
return {
|
|
41
|
-
data: undefined,
|
|
42
|
-
error: nodesRes.error ||
|
|
43
|
-
toolsRes.error ||
|
|
44
|
-
triggersRes.error ||
|
|
45
|
-
presetsRes.error || { code: "NOT_FOUND", message: "Palette catalog is unavailable" },
|
|
46
|
-
response: fallbackResponse,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
data: {
|
|
51
|
-
version,
|
|
52
|
-
nodes: nodesRes.data?.nodes || [],
|
|
53
|
-
tools: toolsRes.data?.tools || [],
|
|
54
|
-
triggers: triggersRes.data?.templates || [],
|
|
55
|
-
presets: presetsRes.data?.presets || [],
|
|
56
|
-
},
|
|
57
|
-
error: undefined,
|
|
58
|
-
response: fallbackResponse,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get the Node Catalog.
|
|
63
|
-
* Returns node types with their configuration schemas.
|
|
64
|
-
*/
|
|
65
|
-
async getNodes(version = "1") {
|
|
66
|
-
const response = await this.client.GET("/v1/api/catalog/nodes", {
|
|
67
|
-
params: { query: { version } },
|
|
68
|
-
});
|
|
69
|
-
// Extract headers for metadata (if available from raw response)
|
|
70
|
-
return response;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Get the Tool Catalog.
|
|
74
|
-
* Returns tool definitions with input/output schemas.
|
|
75
|
-
*/
|
|
76
|
-
async getTools(version = "1") {
|
|
77
|
-
const response = await this.client.GET("/v1/api/tools/definitions", {
|
|
78
|
-
params: { query: { version } },
|
|
79
|
-
});
|
|
80
|
-
return response;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Get the Trigger Templates Catalog.
|
|
84
|
-
* Returns trigger configurations and input schemas.
|
|
85
|
-
*/
|
|
86
|
-
async getTriggers(version = "1") {
|
|
87
|
-
const response = await this.client.GET("/v1/api/triggers/templates", {
|
|
88
|
-
params: { query: { version } },
|
|
89
|
-
});
|
|
90
|
-
return response;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Get the Node Presets Catalog.
|
|
94
|
-
* Returns pre-configured node variants with locked fields.
|
|
95
|
-
*/
|
|
96
|
-
async getPresets(version = "1") {
|
|
97
|
-
const response = await this.client.GET("/v1/api/catalog/presets", {
|
|
98
|
-
params: { query: { version } },
|
|
99
|
-
});
|
|
100
|
-
return response;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Get all catalogs at once for convenience.
|
|
104
|
-
* Returns combined catalog data with versions.
|
|
105
|
-
*/
|
|
106
|
-
async getAll(version = "1") {
|
|
107
|
-
const [nodesRes, toolsRes, triggersRes, presetsRes] = await Promise.all([
|
|
108
|
-
this.getNodes(version),
|
|
109
|
-
this.getTools(version),
|
|
110
|
-
this.getTriggers(version),
|
|
111
|
-
this.getPresets(version),
|
|
112
|
-
]);
|
|
113
|
-
if (nodesRes.error)
|
|
114
|
-
return { data: undefined, error: nodesRes.error };
|
|
115
|
-
if (toolsRes.error)
|
|
116
|
-
return { data: undefined, error: toolsRes.error };
|
|
117
|
-
if (triggersRes.error)
|
|
118
|
-
return { data: undefined, error: triggersRes.error };
|
|
119
|
-
if (presetsRes.error)
|
|
120
|
-
return { data: undefined, error: presetsRes.error };
|
|
121
|
-
return {
|
|
122
|
-
data: {
|
|
123
|
-
nodes: nodesRes.data,
|
|
124
|
-
tools: toolsRes.data,
|
|
125
|
-
triggers: triggersRes.data,
|
|
126
|
-
presets: presetsRes.data,
|
|
127
|
-
catalog_versions: {
|
|
128
|
-
nodes: version,
|
|
129
|
-
tools: version,
|
|
130
|
-
triggers: version,
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
error: undefined,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chatwoot Module
|
|
3
|
-
*/
|
|
4
|
-
import type { APIResponse, RawClient } from "../client/raw.js";
|
|
5
|
-
export interface ChatwootInboxUrlResponse {
|
|
6
|
-
url: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ChatwootConfig {
|
|
9
|
-
baseUrl: string;
|
|
10
|
-
accountId: string;
|
|
11
|
-
apiAccessToken: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class ChatwootModule {
|
|
14
|
-
private client;
|
|
15
|
-
private headers;
|
|
16
|
-
constructor(client: RawClient, headers: () => Record<string, string>);
|
|
17
|
-
/**
|
|
18
|
-
* Internal helper to resolve Chatwoot configuration from AgentOS credentials
|
|
19
|
-
*/
|
|
20
|
-
private _getChatwootConfig;
|
|
21
|
-
/**
|
|
22
|
-
* Direct call to Chatwoot API
|
|
23
|
-
*/
|
|
24
|
-
private _chatwootRequest;
|
|
25
|
-
/**
|
|
26
|
-
* Get the inbox URL for a specific credential.
|
|
27
|
-
* Use this to open the Chatwoot inbox directly.
|
|
28
|
-
*/
|
|
29
|
-
getInboxUrl(credentialId: string): Promise<APIResponse<ChatwootInboxUrlResponse>>;
|
|
30
|
-
/**
|
|
31
|
-
* List all inboxes
|
|
32
|
-
*/
|
|
33
|
-
listInboxes(credentialId: string): Promise<APIResponse<any[]>>;
|
|
34
|
-
/**
|
|
35
|
-
* Create a new inbox
|
|
36
|
-
*/
|
|
37
|
-
createInbox(credentialId: string, data: any): Promise<APIResponse<any>>;
|
|
38
|
-
/**
|
|
39
|
-
* Get a specific inbox
|
|
40
|
-
*/
|
|
41
|
-
getInbox(credentialId: string, inboxId: string | number): Promise<APIResponse<any>>;
|
|
42
|
-
/**
|
|
43
|
-
* Update an inbox
|
|
44
|
-
*/
|
|
45
|
-
updateInbox(credentialId: string, inboxId: string | number, data: any): Promise<APIResponse<any>>;
|
|
46
|
-
/**
|
|
47
|
-
* Delete an inbox
|
|
48
|
-
*/
|
|
49
|
-
deleteInbox(credentialId: string, inboxId: string | number): Promise<APIResponse<any>>;
|
|
50
|
-
/**
|
|
51
|
-
* Get inbox metrics
|
|
52
|
-
*/
|
|
53
|
-
getInboxMetrics(credentialId: string, inboxId: string | number): Promise<APIResponse<any>>;
|
|
54
|
-
/**
|
|
55
|
-
* Get the inbox URL for a specific agent.
|
|
56
|
-
*/
|
|
57
|
-
getAgentInboxUrl(agentId: string): Promise<APIResponse<ChatwootInboxUrlResponse>>;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=chatwoot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatwoot.d.ts","sourceRoot":"","sources":["../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W,CAAC,GAAG,CAAC,CAAC;IAO5F;;OAEG;IACG,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAOhG;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;CA4BxF"}
|
package/dist/modules/chatwoot.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chatwoot Module
|
|
3
|
-
*/
|
|
4
|
-
export class ChatwootModule {
|
|
5
|
-
client;
|
|
6
|
-
headers;
|
|
7
|
-
constructor(client, headers) {
|
|
8
|
-
this.client = client;
|
|
9
|
-
this.headers = headers;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Internal helper to resolve Chatwoot configuration from AgentOS credentials
|
|
13
|
-
*/
|
|
14
|
-
async _getChatwootConfig(credentialId) {
|
|
15
|
-
const { data: credential, error } = await this.client.GET("/v1/api/credentials/{id}", {
|
|
16
|
-
params: {
|
|
17
|
-
path: { id: credentialId },
|
|
18
|
-
query: { includeValues: true }
|
|
19
|
-
},
|
|
20
|
-
headers: this.headers(),
|
|
21
|
-
});
|
|
22
|
-
if (error || !credential) {
|
|
23
|
-
return { error: error || { message: "Credential not found", code: "CREDENTIAL_NOT_FOUND" }, data: undefined };
|
|
24
|
-
}
|
|
25
|
-
// Backend now returns 'values' when includeValues=true
|
|
26
|
-
const values = credential.values || credential.Values || {};
|
|
27
|
-
const publicConfig = credential.publicConfig || credential.PublicConfig || {};
|
|
28
|
-
const data = credential.data || {};
|
|
29
|
-
const url = publicConfig.url || data.url || values.url || publicConfig.endpoint || data.endpoint || values.endpoint || values.base_url;
|
|
30
|
-
let accountId = publicConfig.account_id || data.account_id || values.account_id || publicConfig.accountId || data.accountId || values.accountId;
|
|
31
|
-
const apiAccessToken = values.api_access_token || data.api_access_token || values.api_key || data.api_key || values.apiKey || data.apiKey || values.api_token;
|
|
32
|
-
if (!url || !apiAccessToken) {
|
|
33
|
-
return { error: { message: "Invalid Chatwoot credential: missing URL/Endpoint or API Access Token/Key", code: "INVALID_CREDENTIAL" }, data: undefined };
|
|
34
|
-
}
|
|
35
|
-
const baseUrl = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
36
|
-
// Auto-discover accountId if missing
|
|
37
|
-
if (!accountId) {
|
|
38
|
-
try {
|
|
39
|
-
const profileRes = await fetch(`${baseUrl}/api/v1/profile`, {
|
|
40
|
-
headers: { "api_access_token": apiAccessToken }
|
|
41
|
-
});
|
|
42
|
-
if (profileRes.ok) {
|
|
43
|
-
const profile = await profileRes.json();
|
|
44
|
-
// Use the first available account
|
|
45
|
-
if (profile.accounts && profile.accounts.length > 0) {
|
|
46
|
-
accountId = profile.accounts[0].id;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
catch (err) {
|
|
51
|
-
console.warn("Failed to auto-discover Chatwoot account ID:", err);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (!accountId) {
|
|
55
|
-
return { error: { message: "Invalid Chatwoot credential: missing Account ID and auto-discovery failed.", code: "ACCOUNT_ID_MISSING" }, data: undefined };
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
data: {
|
|
59
|
-
baseUrl,
|
|
60
|
-
accountId: String(accountId),
|
|
61
|
-
apiAccessToken
|
|
62
|
-
},
|
|
63
|
-
error: null
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Direct call to Chatwoot API
|
|
68
|
-
*/
|
|
69
|
-
async _chatwootRequest(config, method, path, body) {
|
|
70
|
-
const url = `${config.baseUrl}${path}`;
|
|
71
|
-
const headers = {
|
|
72
|
-
"api_access_token": config.apiAccessToken,
|
|
73
|
-
"Content-Type": "application/json",
|
|
74
|
-
};
|
|
75
|
-
try {
|
|
76
|
-
const response = await fetch(url, {
|
|
77
|
-
method,
|
|
78
|
-
headers,
|
|
79
|
-
body: body ? JSON.stringify(body) : undefined,
|
|
80
|
-
});
|
|
81
|
-
let data = null;
|
|
82
|
-
const contentType = response.headers.get("content-type");
|
|
83
|
-
if (contentType && contentType.includes("application/json")) {
|
|
84
|
-
try {
|
|
85
|
-
const text = await response.text();
|
|
86
|
-
if (text)
|
|
87
|
-
data = JSON.parse(text);
|
|
88
|
-
}
|
|
89
|
-
catch (e) {
|
|
90
|
-
// Ignore JSON parse errors for empty bodies
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if (!response.ok) {
|
|
94
|
-
return { error: data || { message: `Chatwoot API error: ${response.statusText}`, code: "API_ERROR" }, data: undefined, response };
|
|
95
|
-
}
|
|
96
|
-
return { data, error: undefined, response };
|
|
97
|
-
}
|
|
98
|
-
catch (err) {
|
|
99
|
-
return { error: { message: err.message, code: "UNKNOWN_ERROR" }, data: undefined, response: new Response() };
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Get the inbox URL for a specific credential.
|
|
104
|
-
* Use this to open the Chatwoot inbox directly.
|
|
105
|
-
*/
|
|
106
|
-
async getInboxUrl(credentialId) {
|
|
107
|
-
const { data: config, error } = await this._getChatwootConfig(credentialId);
|
|
108
|
-
if (error || !config) {
|
|
109
|
-
return { error: error || { message: "Config not found", code: "CONFIG_MISSING" }, data: undefined, response: new Response() };
|
|
110
|
-
}
|
|
111
|
-
const inboxUrl = `${config.baseUrl}/app/accounts/${config.accountId}/inbox`;
|
|
112
|
-
return {
|
|
113
|
-
data: { url: inboxUrl },
|
|
114
|
-
error: undefined,
|
|
115
|
-
response: new Response(),
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* List all inboxes
|
|
120
|
-
*/
|
|
121
|
-
async listInboxes(credentialId) {
|
|
122
|
-
const { data: config, error } = await this._getChatwootConfig(credentialId);
|
|
123
|
-
if (error || !config)
|
|
124
|
-
return { error: error || { message: "Config not found", code: "CONFIG_MISSING" }, data: undefined, response: new Response() };
|
|
125
|
-
const res = await this._chatwootRequest(config, "GET", `/api/v1/accounts/${config.accountId}/inboxes`);
|
|
126
|
-
// Chatwoot API returns { payload: [...] }
|
|
127
|
-
if (res.data && Array.isArray(res.data.payload)) {
|
|
128
|
-
return { data: res.data.payload, error: undefined, response: res.response };
|
|
129
|
-
}
|
|
130
|
-
return res;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Create a new inbox
|
|
134
|
-
*/
|
|
135
|
-
async createInbox(credentialId, data) {
|
|
136
|
-
const { data: config, error } = await this._getChatwootConfig(credentialId);
|
|
137
|
-
if (error || !config)
|
|
138
|
-
return { error: error || { message: "Config not found", code: "CONFIG_MISSING" }, data: undefined, response: new Response() };
|
|
139
|
-
return this._chatwootRequest(config, "POST", `/api/v1/accounts/${config.accountId}/inboxes`, data);
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Get a specific inbox
|
|
143
|
-
*/
|
|
144
|
-
async getInbox(credentialId, inboxId) {
|
|
145
|
-
const { data: config, error } = await this._getChatwootConfig(credentialId);
|
|
146
|
-
if (error || !config)
|
|
147
|
-
return { error: error || { message: "Config not found", code: "CONFIG_MISSING" }, data: undefined, response: new Response() };
|
|
148
|
-
return this._chatwootRequest(config, "GET", `/api/v1/accounts/${config.accountId}/inboxes/${inboxId}`);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Update an inbox
|
|
152
|
-
*/
|
|
153
|
-
async updateInbox(credentialId, inboxId, data) {
|
|
154
|
-
const { data: config, error } = await this._getChatwootConfig(credentialId);
|
|
155
|
-
if (error || !config)
|
|
156
|
-
return { error: error || { message: "Config not found", code: "CONFIG_MISSING" }, data: undefined, response: new Response() };
|
|
157
|
-
return this._chatwootRequest(config, "PATCH", `/api/v1/accounts/${config.accountId}/inboxes/${inboxId}`, data);
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Delete an inbox
|
|
161
|
-
*/
|
|
162
|
-
async deleteInbox(credentialId, inboxId) {
|
|
163
|
-
const { data: config, error } = await this._getChatwootConfig(credentialId);
|
|
164
|
-
if (error || !config)
|
|
165
|
-
return { error: error || { message: "Config not found", code: "CONFIG_MISSING" }, data: undefined, response: new Response() };
|
|
166
|
-
return this._chatwootRequest(config, "DELETE", `/api/v1/accounts/${config.accountId}/inboxes/${inboxId}`);
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Get inbox metrics
|
|
170
|
-
*/
|
|
171
|
-
async getInboxMetrics(credentialId, inboxId) {
|
|
172
|
-
const { data: config, error } = await this._getChatwootConfig(credentialId);
|
|
173
|
-
if (error || !config)
|
|
174
|
-
return { error: error || { message: "Config not found", code: "CONFIG_MISSING" }, data: undefined, response: new Response() };
|
|
175
|
-
return this._chatwootRequest(config, "GET", `/api/v1/accounts/${config.accountId}/inboxes/${inboxId}/metrics`);
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Get the inbox URL for a specific agent.
|
|
179
|
-
*/
|
|
180
|
-
async getAgentInboxUrl(agentId) {
|
|
181
|
-
const { data: triggers, error: triggerError } = await this.client.GET("/v1/api/triggers", {
|
|
182
|
-
params: { query: { agent_id: agentId } },
|
|
183
|
-
headers: this.headers(),
|
|
184
|
-
});
|
|
185
|
-
if (triggerError || !triggers) {
|
|
186
|
-
return { error: triggerError || { message: "Failed to fetch triggers", code: "TRIGGER_FETCH_FAILED" }, data: undefined, response: new Response() };
|
|
187
|
-
}
|
|
188
|
-
const chatwootTrigger = triggers.items?.find((t) => t.type === "chatwoot" ||
|
|
189
|
-
(t.type === "evolution_whatsapp" && t.config?.chat_platform === "chatwoot") ||
|
|
190
|
-
(t.config?.credential_id && (t.type === "chatwoot" || t.type.includes("whatsapp"))));
|
|
191
|
-
if (!chatwootTrigger) {
|
|
192
|
-
return { error: { message: "No compatible trigger found for this agent", code: "NO_TRIGGER" }, data: undefined, response: new Response() };
|
|
193
|
-
}
|
|
194
|
-
const credentialId = chatwootTrigger.config?.credential_id;
|
|
195
|
-
if (!credentialId) {
|
|
196
|
-
return { error: { message: "Trigger configuration missing credential_id", code: "MISSING_CREDENTIAL_ID" }, data: undefined, response: new Response() };
|
|
197
|
-
}
|
|
198
|
-
return this.getInboxUrl(credentialId);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checkpoints Module - Fully Typed
|
|
3
|
-
*/
|
|
4
|
-
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
5
|
-
export interface Checkpoint {
|
|
6
|
-
id: string;
|
|
7
|
-
run_id: string;
|
|
8
|
-
thread_id: string;
|
|
9
|
-
step_name: string;
|
|
10
|
-
checkpoint_id: string;
|
|
11
|
-
parent_checkpoint_id?: string;
|
|
12
|
-
has_state_snapshot: boolean;
|
|
13
|
-
created_at: string;
|
|
14
|
-
}
|
|
15
|
-
export interface CheckpointNode {
|
|
16
|
-
id: string;
|
|
17
|
-
step_name: string;
|
|
18
|
-
checkpoint_id: string;
|
|
19
|
-
parent_checkpoint_id?: string;
|
|
20
|
-
created_at: string;
|
|
21
|
-
children?: CheckpointNode[];
|
|
22
|
-
}
|
|
23
|
-
export interface CheckpointsResponse {
|
|
24
|
-
run_id: string;
|
|
25
|
-
total_checkpoints: number;
|
|
26
|
-
checkpoints: CheckpointNode[];
|
|
27
|
-
}
|
|
28
|
-
export interface ReplayResponse {
|
|
29
|
-
run_id: string;
|
|
30
|
-
status: string;
|
|
31
|
-
replayed_from_checkpoint_id: string;
|
|
32
|
-
}
|
|
33
|
-
export declare class CheckpointsModule {
|
|
34
|
-
private client;
|
|
35
|
-
private headers;
|
|
36
|
-
constructor(client: RawClient, headers: () => Record<string, string>);
|
|
37
|
-
/**
|
|
38
|
-
* List checkpoints for a run.
|
|
39
|
-
* @param workspaceId - Workspace ID
|
|
40
|
-
* @param runId - Run ID
|
|
41
|
-
*/
|
|
42
|
-
list(workspaceId: string, runId: string): Promise<APIResponse<CheckpointsResponse>>;
|
|
43
|
-
/**
|
|
44
|
-
* Get a specific checkpoint.
|
|
45
|
-
* @param workspaceId - Workspace ID
|
|
46
|
-
* @param runId - Run ID
|
|
47
|
-
* @param checkpointId - Checkpoint ID
|
|
48
|
-
*/
|
|
49
|
-
get(workspaceId: string, runId: string, checkpointId: string): Promise<APIResponse<Checkpoint>>;
|
|
50
|
-
/**
|
|
51
|
-
* Replay from a checkpoint.
|
|
52
|
-
* @param workspaceId - Workspace ID
|
|
53
|
-
* @param runId - Run ID
|
|
54
|
-
* @param checkpointId - Checkpoint ID
|
|
55
|
-
* @param options - Replay options
|
|
56
|
-
*/
|
|
57
|
-
replay(workspaceId: string, runId: string, checkpointId: string, options?: {
|
|
58
|
-
create_new_thread?: boolean;
|
|
59
|
-
modified_input?: string;
|
|
60
|
-
}): Promise<APIResponse<ReplayResponse>>;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=checkpoints.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoints.d.ts","sourceRoot":"","sources":["../../src/modules/checkpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAK3E,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACt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, headers) {
|
|
8
|
-
this.client = client;
|
|
9
|
-
this.headers = headers;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* List checkpoints for a run.
|
|
13
|
-
* @param workspaceId - Workspace ID
|
|
14
|
-
* @param runId - Run ID
|
|
15
|
-
*/
|
|
16
|
-
async list(workspaceId, runId) {
|
|
17
|
-
return this.client.GET("/v1/api/workspaces/{workspaceId}/runs/{runId}/checkpoints", {
|
|
18
|
-
params: { path: { workspaceId, runId } },
|
|
19
|
-
headers: this.headers(),
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Get a specific checkpoint.
|
|
24
|
-
* @param workspaceId - Workspace ID
|
|
25
|
-
* @param runId - Run ID
|
|
26
|
-
* @param checkpointId - Checkpoint ID
|
|
27
|
-
*/
|
|
28
|
-
async get(workspaceId, runId, checkpointId) {
|
|
29
|
-
return this.client.GET("/v1/api/workspaces/{workspaceId}/runs/{runId}/checkpoints/{checkpointId}", {
|
|
30
|
-
params: { path: { workspaceId, runId, checkpointId } },
|
|
31
|
-
headers: this.headers(),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Replay from a checkpoint.
|
|
36
|
-
* @param workspaceId - Workspace ID
|
|
37
|
-
* @param runId - Run ID
|
|
38
|
-
* @param checkpointId - Checkpoint ID
|
|
39
|
-
* @param options - Replay options
|
|
40
|
-
*/
|
|
41
|
-
async replay(workspaceId, runId, checkpointId, options) {
|
|
42
|
-
return this.client.POST("/v1/api/workspaces/{workspaceId}/runs/{runId}/checkpoints/{checkpointId}/replay", {
|
|
43
|
-
params: { path: { workspaceId, runId, checkpointId } },
|
|
44
|
-
body: options ?? {},
|
|
45
|
-
headers: this.headers(),
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|