geniebox-shared-lib 2.3.0 → 2.4.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/dist/agent.client.d.ts +11 -0
- package/dist/agent.client.js +45 -0
- package/dist/agent.interface.d.ts +140 -0
- package/dist/agent.interface.js +568 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +85 -4
- package/dist/library.client.d.ts +12 -0
- package/dist/library.client.js +43 -0
- package/dist/library.interface.d.ts +233 -0
- package/dist/library.interface.js +928 -0
- package/dist/mcp.client.d.ts +12 -0
- package/dist/mcp.client.js +42 -0
- package/dist/mcp.interface.d.ts +203 -0
- package/dist/mcp.interface.js +959 -0
- package/dist/shared.module.d.ts +16 -0
- package/dist/shared.module.js +124 -0
- package/dist/workflow.client.d.ts +12 -0
- package/dist/workflow.client.js +43 -0
- package/dist/workflow.interface.d.ts +271 -0
- package/dist/workflow.interface.js +1231 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnModuleInit } from "@nestjs/common";
|
|
2
|
+
import { ClientGrpc } from "@nestjs/microservices";
|
|
3
|
+
import { AgentServiceClient } from "./agent.interface";
|
|
4
|
+
export declare class AgentClient implements OnModuleInit {
|
|
5
|
+
private readonly client;
|
|
6
|
+
private readonly logger;
|
|
7
|
+
private agentClient?;
|
|
8
|
+
constructor(client: ClientGrpc);
|
|
9
|
+
onModuleInit(): void;
|
|
10
|
+
get service(): AgentServiceClient;
|
|
11
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var AgentClient_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.AgentClient = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
let AgentClient = AgentClient_1 = class AgentClient {
|
|
19
|
+
constructor(client) {
|
|
20
|
+
this.client = client;
|
|
21
|
+
this.logger = new common_1.Logger(AgentClient_1.name);
|
|
22
|
+
}
|
|
23
|
+
onModuleInit() {
|
|
24
|
+
this.agentClient =
|
|
25
|
+
this.client.getService("AgentService");
|
|
26
|
+
if (!this.agentClient) {
|
|
27
|
+
this.logger.error("Failed to initialize AgentServiceClient");
|
|
28
|
+
throw new Error("AgentServiceClient initialization failed");
|
|
29
|
+
}
|
|
30
|
+
this.logger.log("AgentServiceClient initialized successfully");
|
|
31
|
+
}
|
|
32
|
+
get service() {
|
|
33
|
+
if (!this.agentClient) {
|
|
34
|
+
this.logger.error("Tried to access AgentService before initialization");
|
|
35
|
+
throw new Error("AgentServiceClient not initialized yet");
|
|
36
|
+
}
|
|
37
|
+
return this.agentClient;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.AgentClient = AgentClient;
|
|
41
|
+
exports.AgentClient = AgentClient = AgentClient_1 = __decorate([
|
|
42
|
+
(0, common_1.Injectable)(),
|
|
43
|
+
__param(0, (0, common_1.Inject)("AGENT_PACKAGE")),
|
|
44
|
+
__metadata("design:paramtypes", [Object])
|
|
45
|
+
], AgentClient);
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import type { handleUnaryCall, Metadata, UntypedServiceImplementation } from "@grpc/grpc-js";
|
|
3
|
+
import { Observable } from "rxjs";
|
|
4
|
+
import { Empty } from "./google/protobuf/empty.interface";
|
|
5
|
+
export declare const protobufPackage = "agent";
|
|
6
|
+
export interface Agent {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
/** JSON string */
|
|
11
|
+
icon: string;
|
|
12
|
+
userId: string;
|
|
13
|
+
/** JSON string */
|
|
14
|
+
instructions: string;
|
|
15
|
+
/** "public", "private", "readonly" */
|
|
16
|
+
visibility: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateAgentRequest {
|
|
21
|
+
userId: string;
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
icon: string;
|
|
25
|
+
instructions: string;
|
|
26
|
+
visibility: string;
|
|
27
|
+
}
|
|
28
|
+
export interface UpdateAgentRequest {
|
|
29
|
+
id: string;
|
|
30
|
+
/** For authorization check */
|
|
31
|
+
userId: string;
|
|
32
|
+
name?: string | undefined;
|
|
33
|
+
description?: string | undefined;
|
|
34
|
+
icon?: string | undefined;
|
|
35
|
+
instructions?: string | undefined;
|
|
36
|
+
visibility?: string | undefined;
|
|
37
|
+
}
|
|
38
|
+
export interface GetAgentRequest {
|
|
39
|
+
id: string;
|
|
40
|
+
/** For visibility check */
|
|
41
|
+
userId: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ListAgentsRequest {
|
|
44
|
+
userId: string;
|
|
45
|
+
limit: number;
|
|
46
|
+
offset: number;
|
|
47
|
+
/** Filter by visibility */
|
|
48
|
+
visibility?: string | undefined;
|
|
49
|
+
}
|
|
50
|
+
export interface DeleteAgentRequest {
|
|
51
|
+
id: string;
|
|
52
|
+
userId: string;
|
|
53
|
+
}
|
|
54
|
+
export interface AgentsResponse {
|
|
55
|
+
agents: Agent[];
|
|
56
|
+
total: number;
|
|
57
|
+
}
|
|
58
|
+
export declare const AGENT_PACKAGE_NAME = "agent";
|
|
59
|
+
export declare const Agent: MessageFns<Agent>;
|
|
60
|
+
export declare const CreateAgentRequest: MessageFns<CreateAgentRequest>;
|
|
61
|
+
export declare const UpdateAgentRequest: MessageFns<UpdateAgentRequest>;
|
|
62
|
+
export declare const GetAgentRequest: MessageFns<GetAgentRequest>;
|
|
63
|
+
export declare const ListAgentsRequest: MessageFns<ListAgentsRequest>;
|
|
64
|
+
export declare const DeleteAgentRequest: MessageFns<DeleteAgentRequest>;
|
|
65
|
+
export declare const AgentsResponse: MessageFns<AgentsResponse>;
|
|
66
|
+
export interface AgentServiceClient {
|
|
67
|
+
createAgent(request: CreateAgentRequest, metadata?: Metadata): Observable<Agent>;
|
|
68
|
+
getAgent(request: GetAgentRequest, metadata?: Metadata): Observable<Agent>;
|
|
69
|
+
updateAgent(request: UpdateAgentRequest, metadata?: Metadata): Observable<Agent>;
|
|
70
|
+
deleteAgent(request: DeleteAgentRequest, metadata?: Metadata): Observable<Empty>;
|
|
71
|
+
listAgents(request: ListAgentsRequest, metadata?: Metadata): Observable<AgentsResponse>;
|
|
72
|
+
}
|
|
73
|
+
export interface AgentServiceController {
|
|
74
|
+
createAgent(request: CreateAgentRequest, metadata?: Metadata): Promise<Agent> | Observable<Agent> | Agent;
|
|
75
|
+
getAgent(request: GetAgentRequest, metadata?: Metadata): Promise<Agent> | Observable<Agent> | Agent;
|
|
76
|
+
updateAgent(request: UpdateAgentRequest, metadata?: Metadata): Promise<Agent> | Observable<Agent> | Agent;
|
|
77
|
+
deleteAgent(request: DeleteAgentRequest, metadata?: Metadata): void;
|
|
78
|
+
listAgents(request: ListAgentsRequest, metadata?: Metadata): Promise<AgentsResponse> | Observable<AgentsResponse> | AgentsResponse;
|
|
79
|
+
}
|
|
80
|
+
export declare function AgentServiceControllerMethods(): (constructor: Function) => void;
|
|
81
|
+
export declare const AGENT_SERVICE_NAME = "AgentService";
|
|
82
|
+
export type AgentServiceService = typeof AgentServiceService;
|
|
83
|
+
export declare const AgentServiceService: {
|
|
84
|
+
readonly createAgent: {
|
|
85
|
+
readonly path: "/agent.AgentService/createAgent";
|
|
86
|
+
readonly requestStream: false;
|
|
87
|
+
readonly responseStream: false;
|
|
88
|
+
readonly requestSerialize: (value: CreateAgentRequest) => Buffer;
|
|
89
|
+
readonly requestDeserialize: (value: Buffer) => CreateAgentRequest;
|
|
90
|
+
readonly responseSerialize: (value: Agent) => Buffer;
|
|
91
|
+
readonly responseDeserialize: (value: Buffer) => Agent;
|
|
92
|
+
};
|
|
93
|
+
readonly getAgent: {
|
|
94
|
+
readonly path: "/agent.AgentService/getAgent";
|
|
95
|
+
readonly requestStream: false;
|
|
96
|
+
readonly responseStream: false;
|
|
97
|
+
readonly requestSerialize: (value: GetAgentRequest) => Buffer;
|
|
98
|
+
readonly requestDeserialize: (value: Buffer) => GetAgentRequest;
|
|
99
|
+
readonly responseSerialize: (value: Agent) => Buffer;
|
|
100
|
+
readonly responseDeserialize: (value: Buffer) => Agent;
|
|
101
|
+
};
|
|
102
|
+
readonly updateAgent: {
|
|
103
|
+
readonly path: "/agent.AgentService/updateAgent";
|
|
104
|
+
readonly requestStream: false;
|
|
105
|
+
readonly responseStream: false;
|
|
106
|
+
readonly requestSerialize: (value: UpdateAgentRequest) => Buffer;
|
|
107
|
+
readonly requestDeserialize: (value: Buffer) => UpdateAgentRequest;
|
|
108
|
+
readonly responseSerialize: (value: Agent) => Buffer;
|
|
109
|
+
readonly responseDeserialize: (value: Buffer) => Agent;
|
|
110
|
+
};
|
|
111
|
+
readonly deleteAgent: {
|
|
112
|
+
readonly path: "/agent.AgentService/deleteAgent";
|
|
113
|
+
readonly requestStream: false;
|
|
114
|
+
readonly responseStream: false;
|
|
115
|
+
readonly requestSerialize: (value: DeleteAgentRequest) => Buffer;
|
|
116
|
+
readonly requestDeserialize: (value: Buffer) => DeleteAgentRequest;
|
|
117
|
+
readonly responseSerialize: (value: Empty) => Buffer;
|
|
118
|
+
readonly responseDeserialize: (value: Buffer) => Empty;
|
|
119
|
+
};
|
|
120
|
+
readonly listAgents: {
|
|
121
|
+
readonly path: "/agent.AgentService/listAgents";
|
|
122
|
+
readonly requestStream: false;
|
|
123
|
+
readonly responseStream: false;
|
|
124
|
+
readonly requestSerialize: (value: ListAgentsRequest) => Buffer;
|
|
125
|
+
readonly requestDeserialize: (value: Buffer) => ListAgentsRequest;
|
|
126
|
+
readonly responseSerialize: (value: AgentsResponse) => Buffer;
|
|
127
|
+
readonly responseDeserialize: (value: Buffer) => AgentsResponse;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
export interface AgentServiceServer extends UntypedServiceImplementation {
|
|
131
|
+
createAgent: handleUnaryCall<CreateAgentRequest, Agent>;
|
|
132
|
+
getAgent: handleUnaryCall<GetAgentRequest, Agent>;
|
|
133
|
+
updateAgent: handleUnaryCall<UpdateAgentRequest, Agent>;
|
|
134
|
+
deleteAgent: handleUnaryCall<DeleteAgentRequest, Empty>;
|
|
135
|
+
listAgents: handleUnaryCall<ListAgentsRequest, AgentsResponse>;
|
|
136
|
+
}
|
|
137
|
+
export interface MessageFns<T> {
|
|
138
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
139
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
140
|
+
}
|