@octo-cyber/ai 0.5.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/ai.module.d.ts +3 -0
- package/dist/ai.module.d.ts.map +1 -0
- package/dist/ai.module.js +40 -0
- package/dist/ai.module.js.map +1 -0
- package/dist/cli/adapters/antigravity.adapter.d.ts +29 -0
- package/dist/cli/adapters/antigravity.adapter.d.ts.map +1 -0
- package/dist/cli/adapters/antigravity.adapter.js +170 -0
- package/dist/cli/adapters/antigravity.adapter.js.map +1 -0
- package/dist/cli/adapters/claude-cli.adapter.d.ts +23 -0
- package/dist/cli/adapters/claude-cli.adapter.d.ts.map +1 -0
- package/dist/cli/adapters/claude-cli.adapter.js +79 -0
- package/dist/cli/adapters/claude-cli.adapter.js.map +1 -0
- package/dist/cli/adapters/codex-cli.adapter.d.ts +22 -0
- package/dist/cli/adapters/codex-cli.adapter.d.ts.map +1 -0
- package/dist/cli/adapters/codex-cli.adapter.js +76 -0
- package/dist/cli/adapters/codex-cli.adapter.js.map +1 -0
- package/dist/cli/adapters/detect-cli.d.ts +11 -0
- package/dist/cli/adapters/detect-cli.d.ts.map +1 -0
- package/dist/cli/adapters/detect-cli.js +40 -0
- package/dist/cli/adapters/detect-cli.js.map +1 -0
- package/dist/cli/adapters/gemini-cli.adapter.d.ts +21 -0
- package/dist/cli/adapters/gemini-cli.adapter.d.ts.map +1 -0
- package/dist/cli/adapters/gemini-cli.adapter.js +72 -0
- package/dist/cli/adapters/gemini-cli.adapter.js.map +1 -0
- package/dist/cli/adapters/index.d.ts +4 -0
- package/dist/cli/adapters/index.d.ts.map +1 -0
- package/dist/cli/adapters/index.js +10 -0
- package/dist/cli/adapters/index.js.map +1 -0
- package/dist/cli/cli-executor.service.d.ts +23 -0
- package/dist/cli/cli-executor.service.d.ts.map +1 -0
- package/dist/cli/cli-executor.service.js +150 -0
- package/dist/cli/cli-executor.service.js.map +1 -0
- package/dist/cli/cli-registry.service.d.ts +38 -0
- package/dist/cli/cli-registry.service.d.ts.map +1 -0
- package/dist/cli/cli-registry.service.js +112 -0
- package/dist/cli/cli-registry.service.js.map +1 -0
- package/dist/cli/controllers/ai-cli.controller.d.ts +36 -0
- package/dist/cli/controllers/ai-cli.controller.d.ts.map +1 -0
- package/dist/cli/controllers/ai-cli.controller.js +179 -0
- package/dist/cli/controllers/ai-cli.controller.js.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +17 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/types.d.ts +131 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +9 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/workspace.service.d.ts +34 -0
- package/dist/cli/workspace.service.d.ts.map +1 -0
- package/dist/cli/workspace.service.js +194 -0
- package/dist/cli/workspace.service.js.map +1 -0
- package/dist/controllers/agent.controller.d.ts +13 -0
- package/dist/controllers/agent.controller.d.ts.map +1 -0
- package/dist/controllers/agent.controller.js +117 -0
- package/dist/controllers/agent.controller.js.map +1 -0
- package/dist/controllers/capability.controller.d.ts +16 -0
- package/dist/controllers/capability.controller.d.ts.map +1 -0
- package/dist/controllers/capability.controller.js +108 -0
- package/dist/controllers/capability.controller.js.map +1 -0
- package/dist/controllers/client.controller.d.ts +10 -0
- package/dist/controllers/client.controller.d.ts.map +1 -0
- package/dist/controllers/client.controller.js +79 -0
- package/dist/controllers/client.controller.js.map +1 -0
- package/dist/controllers/execution.controller.d.ts +11 -0
- package/dist/controllers/execution.controller.d.ts.map +1 -0
- package/dist/controllers/execution.controller.js +50 -0
- package/dist/controllers/execution.controller.js.map +1 -0
- package/dist/controllers/index.d.ts +5 -0
- package/dist/controllers/index.d.ts.map +1 -0
- package/dist/controllers/index.js +12 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/entities/agent-binding.entity.d.ts +17 -0
- package/dist/entities/agent-binding.entity.d.ts.map +1 -0
- package/dist/entities/agent-binding.entity.js +64 -0
- package/dist/entities/agent-binding.entity.js.map +1 -0
- package/dist/entities/agent-definition.entity.d.ts +17 -0
- package/dist/entities/agent-definition.entity.d.ts.map +1 -0
- package/dist/entities/agent-definition.entity.js +70 -0
- package/dist/entities/agent-definition.entity.js.map +1 -0
- package/dist/entities/agent-execution.entity.d.ts +23 -0
- package/dist/entities/agent-execution.entity.d.ts.map +1 -0
- package/dist/entities/agent-execution.entity.js +93 -0
- package/dist/entities/agent-execution.entity.js.map +1 -0
- package/dist/entities/agent-instance.entity.d.ts +19 -0
- package/dist/entities/agent-instance.entity.d.ts.map +1 -0
- package/dist/entities/agent-instance.entity.js +76 -0
- package/dist/entities/agent-instance.entity.js.map +1 -0
- package/dist/entities/capability-definition.entity.d.ts +20 -0
- package/dist/entities/capability-definition.entity.d.ts.map +1 -0
- package/dist/entities/capability-definition.entity.js +77 -0
- package/dist/entities/capability-definition.entity.js.map +1 -0
- package/dist/entities/client-registration.entity.d.ts +19 -0
- package/dist/entities/client-registration.entity.d.ts.map +1 -0
- package/dist/entities/client-registration.entity.js +79 -0
- package/dist/entities/client-registration.entity.js.map +1 -0
- package/dist/entities/index.d.ts +7 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +16 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/services/agent.service.d.ts +23 -0
- package/dist/services/agent.service.d.ts.map +1 -0
- package/dist/services/agent.service.js +76 -0
- package/dist/services/agent.service.js.map +1 -0
- package/dist/services/capability-router.service.d.ts +45 -0
- package/dist/services/capability-router.service.d.ts.map +1 -0
- package/dist/services/capability-router.service.js +120 -0
- package/dist/services/capability-router.service.js.map +1 -0
- package/dist/services/client-registration.service.d.ts +27 -0
- package/dist/services/client-registration.service.d.ts.map +1 -0
- package/dist/services/client-registration.service.js +83 -0
- package/dist/services/client-registration.service.js.map +1 -0
- package/dist/services/index.d.ts +5 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +12 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/sync-bridge.service.d.ts +41 -0
- package/dist/services/sync-bridge.service.d.ts.map +1 -0
- package/dist/services/sync-bridge.service.js +118 -0
- package/dist/services/sync-bridge.service.js.map +1 -0
- package/package.json +94 -0
- package/web/components/CliTestDialog.tsx +158 -0
- package/web/index.ts +19 -0
- package/web/manifest.ts +14 -0
- package/web/messages/en-US.json +81 -0
- package/web/messages/zh-CN.json +81 -0
- package/web/pages/AiCliToolsPage.tsx +223 -0
- package/web/pages/WorkspaceSection.tsx +260 -0
- package/web/pages/WorkspacesPage.tsx +397 -0
- package/web/services/ai-cli-service.ts +129 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AgentDefinition } from './agent-definition.entity.js';
|
|
2
|
+
export type AgentInstanceStatus = 'IDLE' | 'BUSY' | 'OFFLINE' | 'ERROR';
|
|
3
|
+
/**
|
|
4
|
+
* Agent instance — a running instance of an agent definition,
|
|
5
|
+
* bound to a specific client.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AgentInstance {
|
|
8
|
+
id: number;
|
|
9
|
+
definitionId: number;
|
|
10
|
+
definition: AgentDefinition;
|
|
11
|
+
clientId: string;
|
|
12
|
+
status: AgentInstanceStatus;
|
|
13
|
+
runtimeConfig: Record<string, unknown> | null;
|
|
14
|
+
lastHeartbeat: Date | null;
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=agent-instance.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-instance.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-instance.entity.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAExE;;;GAGG;AACH,qBACa,aAAa;IAExB,EAAE,EAAG,MAAM,CAAC;IAGZ,YAAY,EAAG,MAAM,CAAC;IAItB,UAAU,EAAG,eAAe,CAAC;IAG7B,QAAQ,EAAG,MAAM,CAAC;IAGlB,MAAM,EAAG,mBAAmB,CAAC;IAG7B,aAAa,EAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAG/C,aAAa,EAAG,IAAI,GAAG,IAAI,CAAC;IAG5B,OAAO,EAAG,OAAO,CAAC;IAGlB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentInstance = void 0;
|
|
13
|
+
const core_1 = require("@octo/core");
|
|
14
|
+
const agent_definition_entity_js_1 = require("./agent-definition.entity.js");
|
|
15
|
+
/**
|
|
16
|
+
* Agent instance — a running instance of an agent definition,
|
|
17
|
+
* bound to a specific client.
|
|
18
|
+
*/
|
|
19
|
+
let AgentInstance = class AgentInstance {
|
|
20
|
+
id;
|
|
21
|
+
definitionId;
|
|
22
|
+
definition;
|
|
23
|
+
clientId;
|
|
24
|
+
status;
|
|
25
|
+
runtimeConfig;
|
|
26
|
+
lastHeartbeat;
|
|
27
|
+
enabled;
|
|
28
|
+
createdAt;
|
|
29
|
+
updatedAt;
|
|
30
|
+
};
|
|
31
|
+
exports.AgentInstance = AgentInstance;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, core_1.PrimaryGeneratedColumn)(),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], AgentInstance.prototype, "id", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, core_1.Column)({ type: 'integer' }),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], AgentInstance.prototype, "definitionId", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, core_1.ManyToOne)(() => agent_definition_entity_js_1.AgentDefinition),
|
|
42
|
+
(0, core_1.JoinColumn)({ name: 'definitionId' }),
|
|
43
|
+
__metadata("design:type", agent_definition_entity_js_1.AgentDefinition)
|
|
44
|
+
], AgentInstance.prototype, "definition", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, core_1.Column)({ type: 'varchar' }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], AgentInstance.prototype, "clientId", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, core_1.Column)({ type: 'varchar', default: 'IDLE' }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], AgentInstance.prototype, "status", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, core_1.Column)({ type: 'simple-json', nullable: true }),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], AgentInstance.prototype, "runtimeConfig", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, core_1.Column)({ type: 'datetime', nullable: true }),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], AgentInstance.prototype, "lastHeartbeat", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, core_1.Column)({ type: 'boolean', default: true }),
|
|
63
|
+
__metadata("design:type", Boolean)
|
|
64
|
+
], AgentInstance.prototype, "enabled", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, core_1.CreateDateColumn)(),
|
|
67
|
+
__metadata("design:type", Date)
|
|
68
|
+
], AgentInstance.prototype, "createdAt", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, core_1.UpdateDateColumn)(),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], AgentInstance.prototype, "updatedAt", void 0);
|
|
73
|
+
exports.AgentInstance = AgentInstance = __decorate([
|
|
74
|
+
(0, core_1.Entity)('agent_instances')
|
|
75
|
+
], AgentInstance);
|
|
76
|
+
//# sourceMappingURL=agent-instance.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-instance.entity.js","sourceRoot":"","sources":["../../src/entities/agent-instance.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAQoB;AACpB,6EAA+D;AAI/D;;;GAGG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAa;IAExB,EAAE,CAAU;IAGZ,YAAY,CAAU;IAItB,UAAU,CAAmB;IAG7B,QAAQ,CAAU;IAGlB,MAAM,CAAuB;IAG7B,aAAa,CAAkC;IAG/C,aAAa,CAAe;IAG5B,OAAO,CAAW;IAGlB,SAAS,CAAQ;IAGjB,SAAS,CAAQ;CAClB,CAAA;AA/BY,sCAAa;AAExB;IADC,IAAA,6BAAsB,GAAE;;yCACb;AAGZ;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;mDACN;AAItB;IAFC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,4CAAe,CAAC;IAChC,IAAA,iBAAU,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;8BACxB,4CAAe;iDAAC;AAG7B;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;+CACV;AAGlB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;6CAChB;AAG7B;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACD;AAG/C;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACjB;AAG5B;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;8CACzB;AAGlB;IADC,IAAA,uBAAgB,GAAE;8BACP,IAAI;gDAAC;AAGjB;IADC,IAAA,uBAAgB,GAAE;8BACP,IAAI;gDAAC;wBA9BN,aAAa;IADzB,IAAA,aAAM,EAAC,iBAAiB,CAAC;GACb,aAAa,CA+BzB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability definition — describes an execution capability
|
|
3
|
+
* (e.g., gemini-cli, claude-cli, notebooklm-py, shadow-window).
|
|
4
|
+
*
|
|
5
|
+
* Capabilities are the bridge between what an agent can do
|
|
6
|
+
* and which client can execute it.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CapabilityDefinition {
|
|
9
|
+
id: number;
|
|
10
|
+
code: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string | null;
|
|
13
|
+
category: string | null;
|
|
14
|
+
inputSchema: Record<string, unknown> | null;
|
|
15
|
+
outputSchema: Record<string, unknown> | null;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=capability-definition.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-definition.entity.d.ts","sourceRoot":"","sources":["../../src/entities/capability-definition.entity.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,qBACa,oBAAoB;IAE/B,EAAE,EAAG,MAAM,CAAC;IAGZ,IAAI,EAAG,MAAM,CAAC;IAGd,IAAI,EAAG,MAAM,CAAC;IAGd,WAAW,EAAG,MAAM,GAAG,IAAI,CAAC;IAG5B,QAAQ,EAAG,MAAM,GAAG,IAAI,CAAC;IAGzB,WAAW,EAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAG7C,YAAY,EAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAG9C,OAAO,EAAG,OAAO,CAAC;IAGlB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CapabilityDefinition = void 0;
|
|
13
|
+
const core_1 = require("@octo/core");
|
|
14
|
+
/**
|
|
15
|
+
* Capability definition — describes an execution capability
|
|
16
|
+
* (e.g., gemini-cli, claude-cli, notebooklm-py, shadow-window).
|
|
17
|
+
*
|
|
18
|
+
* Capabilities are the bridge between what an agent can do
|
|
19
|
+
* and which client can execute it.
|
|
20
|
+
*/
|
|
21
|
+
let CapabilityDefinition = class CapabilityDefinition {
|
|
22
|
+
id;
|
|
23
|
+
code;
|
|
24
|
+
name;
|
|
25
|
+
description;
|
|
26
|
+
category;
|
|
27
|
+
inputSchema;
|
|
28
|
+
outputSchema;
|
|
29
|
+
enabled;
|
|
30
|
+
createdAt;
|
|
31
|
+
updatedAt;
|
|
32
|
+
};
|
|
33
|
+
exports.CapabilityDefinition = CapabilityDefinition;
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, core_1.PrimaryGeneratedColumn)(),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], CapabilityDefinition.prototype, "id", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, core_1.Column)({ type: 'varchar', unique: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], CapabilityDefinition.prototype, "code", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, core_1.Column)({ type: 'varchar' }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], CapabilityDefinition.prototype, "name", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, core_1.Column)({ type: 'text', nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], CapabilityDefinition.prototype, "description", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, core_1.Column)({ type: 'text', nullable: true }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], CapabilityDefinition.prototype, "category", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, core_1.Column)({ type: 'simple-json', nullable: true }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], CapabilityDefinition.prototype, "inputSchema", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, core_1.Column)({ type: 'simple-json', nullable: true }),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], CapabilityDefinition.prototype, "outputSchema", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, core_1.Column)({ type: 'boolean', default: true }),
|
|
64
|
+
__metadata("design:type", Boolean)
|
|
65
|
+
], CapabilityDefinition.prototype, "enabled", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, core_1.CreateDateColumn)(),
|
|
68
|
+
__metadata("design:type", Date)
|
|
69
|
+
], CapabilityDefinition.prototype, "createdAt", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, core_1.UpdateDateColumn)(),
|
|
72
|
+
__metadata("design:type", Date)
|
|
73
|
+
], CapabilityDefinition.prototype, "updatedAt", void 0);
|
|
74
|
+
exports.CapabilityDefinition = CapabilityDefinition = __decorate([
|
|
75
|
+
(0, core_1.Entity)('capability_definitions')
|
|
76
|
+
], CapabilityDefinition);
|
|
77
|
+
//# sourceMappingURL=capability-definition.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-definition.entity.js","sourceRoot":"","sources":["../../src/entities/capability-definition.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMoB;AAEpB;;;;;;GAMG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAE/B,EAAE,CAAU;IAGZ,IAAI,CAAU;IAGd,IAAI,CAAU;IAGd,WAAW,CAAiB;IAG5B,QAAQ,CAAiB;IAGzB,WAAW,CAAkC;IAG7C,YAAY,CAAkC;IAG9C,OAAO,CAAW;IAGlB,SAAS,CAAQ;IAGjB,SAAS,CAAQ;CAClB,CAAA;AA9BY,oDAAoB;AAE/B;IADC,IAAA,6BAAsB,GAAE;;gDACb;AAGZ;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;kDAC5B;AAGd;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;kDACd;AAGd;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACb;AAG5B;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDAChB;AAGzB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACH;AAG7C;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACF;AAG9C;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qDACzB;AAGlB;IADC,IAAA,uBAAgB,GAAE;8BACP,IAAI;uDAAC;AAGjB;IADC,IAAA,uBAAgB,GAAE;8BACP,IAAI;uDAAC;+BA7BN,oBAAoB;IADhC,IAAA,aAAM,EAAC,wBAAwB,CAAC;GACpB,oBAAoB,CA8BhC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ClientStatus = 'ONLINE' | 'OFFLINE' | 'UNKNOWN';
|
|
2
|
+
/**
|
|
3
|
+
* Client registration — tracks connected clients
|
|
4
|
+
* (desktop apps, remote agents, etc.) and their capabilities.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ClientRegistration {
|
|
7
|
+
id: number;
|
|
8
|
+
clientId: string;
|
|
9
|
+
clientName: string | null;
|
|
10
|
+
platform: string | null;
|
|
11
|
+
enabledCapabilities: string[] | null;
|
|
12
|
+
status: ClientStatus;
|
|
13
|
+
userId: number | null;
|
|
14
|
+
lastHeartbeat: Date | null;
|
|
15
|
+
metadata: string | null;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=client-registration.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-registration.entity.d.ts","sourceRoot":"","sources":["../../src/entities/client-registration.entity.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5D;;;GAGG;AACH,qBACa,kBAAkB;IAE7B,EAAE,EAAG,MAAM,CAAC;IAGZ,QAAQ,EAAG,MAAM,CAAC;IAGlB,UAAU,EAAG,MAAM,GAAG,IAAI,CAAC;IAG3B,QAAQ,EAAG,MAAM,GAAG,IAAI,CAAC;IAGzB,mBAAmB,EAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAGtC,MAAM,EAAG,YAAY,CAAC;IAGtB,MAAM,EAAG,MAAM,GAAG,IAAI,CAAC;IAGvB,aAAa,EAAG,IAAI,GAAG,IAAI,CAAC;IAG5B,QAAQ,EAAG,MAAM,GAAG,IAAI,CAAC;IAGzB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ClientRegistration = void 0;
|
|
13
|
+
const core_1 = require("@octo/core");
|
|
14
|
+
/**
|
|
15
|
+
* Client registration — tracks connected clients
|
|
16
|
+
* (desktop apps, remote agents, etc.) and their capabilities.
|
|
17
|
+
*/
|
|
18
|
+
let ClientRegistration = class ClientRegistration {
|
|
19
|
+
id;
|
|
20
|
+
clientId;
|
|
21
|
+
clientName;
|
|
22
|
+
platform;
|
|
23
|
+
enabledCapabilities;
|
|
24
|
+
status;
|
|
25
|
+
userId;
|
|
26
|
+
lastHeartbeat;
|
|
27
|
+
metadata;
|
|
28
|
+
createdAt;
|
|
29
|
+
updatedAt;
|
|
30
|
+
};
|
|
31
|
+
exports.ClientRegistration = ClientRegistration;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, core_1.PrimaryGeneratedColumn)(),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], ClientRegistration.prototype, "id", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, core_1.Column)({ type: 'varchar', unique: true }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], ClientRegistration.prototype, "clientId", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, core_1.Column)({ type: 'varchar', nullable: true }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], ClientRegistration.prototype, "clientName", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, core_1.Column)({ type: 'varchar', nullable: true }),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], ClientRegistration.prototype, "platform", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, core_1.Column)({ type: 'simple-json', nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], ClientRegistration.prototype, "enabledCapabilities", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, core_1.Column)({ type: 'varchar', default: 'UNKNOWN' }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], ClientRegistration.prototype, "status", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, core_1.Column)({ type: 'integer', nullable: true }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], ClientRegistration.prototype, "userId", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, core_1.Column)({ type: 'datetime', nullable: true }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], ClientRegistration.prototype, "lastHeartbeat", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, core_1.Column)({ type: 'text', nullable: true }),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], ClientRegistration.prototype, "metadata", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, core_1.CreateDateColumn)(),
|
|
70
|
+
__metadata("design:type", Date)
|
|
71
|
+
], ClientRegistration.prototype, "createdAt", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, core_1.UpdateDateColumn)(),
|
|
74
|
+
__metadata("design:type", Date)
|
|
75
|
+
], ClientRegistration.prototype, "updatedAt", void 0);
|
|
76
|
+
exports.ClientRegistration = ClientRegistration = __decorate([
|
|
77
|
+
(0, core_1.Entity)('client_registrations')
|
|
78
|
+
], ClientRegistration);
|
|
79
|
+
//# sourceMappingURL=client-registration.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-registration.entity.js","sourceRoot":"","sources":["../../src/entities/client-registration.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMoB;AAIpB;;;GAGG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAE7B,EAAE,CAAU;IAGZ,QAAQ,CAAU;IAGlB,UAAU,CAAiB;IAG3B,QAAQ,CAAiB;IAGzB,mBAAmB,CAAmB;IAGtC,MAAM,CAAgB;IAGtB,MAAM,CAAiB;IAGvB,aAAa,CAAe;IAG5B,QAAQ,CAAiB;IAGzB,SAAS,CAAQ;IAGjB,SAAS,CAAQ;CAClB,CAAA;AAjCY,gDAAkB;AAE7B;IADC,IAAA,6BAAsB,GAAE;;8CACb;AAGZ;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;oDACxB;AAGlB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACjB;AAG3B;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACnB;AAGzB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+DACV;AAGtC;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;;kDAC1B;AAGtB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACrB;AAGvB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACjB;AAG5B;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDAChB;AAGzB;IADC,IAAA,uBAAgB,GAAE;8BACP,IAAI;qDAAC;AAGjB;IADC,IAAA,uBAAgB,GAAE;8BACP,IAAI;qDAAC;6BAhCN,kBAAkB;IAD9B,IAAA,aAAM,EAAC,sBAAsB,CAAC;GAClB,kBAAkB,CAiC9B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { AgentDefinition } from './agent-definition.entity.js';
|
|
2
|
+
export { AgentInstance, type AgentInstanceStatus } from './agent-instance.entity.js';
|
|
3
|
+
export { CapabilityDefinition } from './capability-definition.entity.js';
|
|
4
|
+
export { AgentBinding } from './agent-binding.entity.js';
|
|
5
|
+
export { AgentExecution, type AgentExecutionStatus } from './agent-execution.entity.js';
|
|
6
|
+
export { ClientRegistration, type ClientStatus } from './client-registration.entity.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientRegistration = exports.AgentExecution = exports.AgentBinding = exports.CapabilityDefinition = exports.AgentInstance = exports.AgentDefinition = void 0;
|
|
4
|
+
var agent_definition_entity_js_1 = require("./agent-definition.entity.js");
|
|
5
|
+
Object.defineProperty(exports, "AgentDefinition", { enumerable: true, get: function () { return agent_definition_entity_js_1.AgentDefinition; } });
|
|
6
|
+
var agent_instance_entity_js_1 = require("./agent-instance.entity.js");
|
|
7
|
+
Object.defineProperty(exports, "AgentInstance", { enumerable: true, get: function () { return agent_instance_entity_js_1.AgentInstance; } });
|
|
8
|
+
var capability_definition_entity_js_1 = require("./capability-definition.entity.js");
|
|
9
|
+
Object.defineProperty(exports, "CapabilityDefinition", { enumerable: true, get: function () { return capability_definition_entity_js_1.CapabilityDefinition; } });
|
|
10
|
+
var agent_binding_entity_js_1 = require("./agent-binding.entity.js");
|
|
11
|
+
Object.defineProperty(exports, "AgentBinding", { enumerable: true, get: function () { return agent_binding_entity_js_1.AgentBinding; } });
|
|
12
|
+
var agent_execution_entity_js_1 = require("./agent-execution.entity.js");
|
|
13
|
+
Object.defineProperty(exports, "AgentExecution", { enumerable: true, get: function () { return agent_execution_entity_js_1.AgentExecution; } });
|
|
14
|
+
var client_registration_entity_js_1 = require("./client-registration.entity.js");
|
|
15
|
+
Object.defineProperty(exports, "ClientRegistration", { enumerable: true, get: function () { return client_registration_entity_js_1.ClientRegistration; } });
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;AAAA,2EAA+D;AAAtD,6HAAA,eAAe,OAAA;AACxB,uEAAqF;AAA5E,yHAAA,aAAa,OAAA;AACtB,qFAAyE;AAAhE,uIAAA,oBAAoB,OAAA;AAC7B,qEAAyD;AAAhD,uHAAA,YAAY,OAAA;AACrB,yEAAwF;AAA/E,2HAAA,cAAc,OAAA;AACvB,iFAAwF;AAA/E,mIAAA,kBAAkB,OAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { AiModule } from './ai.module.js';
|
|
2
|
+
export { CliRegistryService, CliExecutorService, WorkspaceService, ClaudeCliAdapter, GeminiCliAdapter, CodexCliAdapter, type CliToolName, type CliToolInfo, type CliExecuteOptions, type CliExecuteResult, type ICliAdapter, type FileInput, type FileOutput, type WorkspaceType, type Workspace, } from './cli/index.js';
|
|
3
|
+
export { AiCliController } from './cli/controllers/ai-cli.controller.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AiCliController = exports.CodexCliAdapter = exports.GeminiCliAdapter = exports.ClaudeCliAdapter = exports.WorkspaceService = exports.CliExecutorService = exports.CliRegistryService = exports.AiModule = void 0;
|
|
4
|
+
var ai_module_js_1 = require("./ai.module.js");
|
|
5
|
+
Object.defineProperty(exports, "AiModule", { enumerable: true, get: function () { return ai_module_js_1.AiModule; } });
|
|
6
|
+
// CLI
|
|
7
|
+
var index_js_1 = require("./cli/index.js");
|
|
8
|
+
Object.defineProperty(exports, "CliRegistryService", { enumerable: true, get: function () { return index_js_1.CliRegistryService; } });
|
|
9
|
+
Object.defineProperty(exports, "CliExecutorService", { enumerable: true, get: function () { return index_js_1.CliExecutorService; } });
|
|
10
|
+
Object.defineProperty(exports, "WorkspaceService", { enumerable: true, get: function () { return index_js_1.WorkspaceService; } });
|
|
11
|
+
Object.defineProperty(exports, "ClaudeCliAdapter", { enumerable: true, get: function () { return index_js_1.ClaudeCliAdapter; } });
|
|
12
|
+
Object.defineProperty(exports, "GeminiCliAdapter", { enumerable: true, get: function () { return index_js_1.GeminiCliAdapter; } });
|
|
13
|
+
Object.defineProperty(exports, "CodexCliAdapter", { enumerable: true, get: function () { return index_js_1.CodexCliAdapter; } });
|
|
14
|
+
var ai_cli_controller_js_1 = require("./cli/controllers/ai-cli.controller.js");
|
|
15
|
+
Object.defineProperty(exports, "AiCliController", { enumerable: true, get: function () { return ai_cli_controller_js_1.AiCliController; } });
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAAjC,wGAAA,QAAQ,OAAA;AAEjB,MAAM;AACN,2CAgBwB;AAftB,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAClB,4GAAA,gBAAgB,OAAA;AAChB,4GAAA,gBAAgB,OAAA;AAChB,4GAAA,gBAAgB,OAAA;AAChB,2GAAA,eAAe,OAAA;AAYjB,+EAAyE;AAAhE,uHAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Repository } from '@octo/core';
|
|
2
|
+
import { AgentDefinition } from '../entities/agent-definition.entity.js';
|
|
3
|
+
import { AgentInstance } from '../entities/agent-instance.entity.js';
|
|
4
|
+
import type { AgentInstanceStatus } from '../entities/agent-instance.entity.js';
|
|
5
|
+
export declare class AgentService {
|
|
6
|
+
private definitionRepo;
|
|
7
|
+
private instanceRepo;
|
|
8
|
+
private logger;
|
|
9
|
+
setRepositories(definitionRepo: Repository<AgentDefinition>, instanceRepo: Repository<AgentInstance>): void;
|
|
10
|
+
createDefinition(data: Partial<AgentDefinition>): Promise<AgentDefinition>;
|
|
11
|
+
findAllDefinitions(): Promise<AgentDefinition[]>;
|
|
12
|
+
findDefinitionByCode(code: string): Promise<AgentDefinition | null>;
|
|
13
|
+
findDefinitionById(id: number): Promise<AgentDefinition | null>;
|
|
14
|
+
updateDefinition(id: number, data: Partial<AgentDefinition>): Promise<AgentDefinition | null>;
|
|
15
|
+
deleteDefinition(id: number): Promise<boolean>;
|
|
16
|
+
createInstance(data: Partial<AgentInstance>): Promise<AgentInstance>;
|
|
17
|
+
findInstancesByClient(clientId: string): Promise<AgentInstance[]>;
|
|
18
|
+
findInstanceById(id: number): Promise<AgentInstance | null>;
|
|
19
|
+
updateInstanceStatus(id: number, status: AgentInstanceStatus): Promise<void>;
|
|
20
|
+
heartbeat(clientId: string): Promise<void>;
|
|
21
|
+
findOnlineInstances(): Promise<AgentInstance[]>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=agent.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.service.d.ts","sourceRoot":"","sources":["../../src/services/agent.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,qBACa,YAAY;IACvB,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,MAAM,CAAsD;IAEpE,eAAe,CACb,cAAc,EAAE,UAAU,CAAC,eAAe,CAAC,EAC3C,YAAY,EAAE,UAAU,CAAC,aAAa,CAAC,GACtC,IAAI;IAOD,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;IAK1E,kBAAkB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAIhD,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAInE,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAI/D,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAK7F,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAO9C,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAKpE,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAOjE,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAO3D,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5E,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ1C,mBAAmB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;CAMtD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AgentService = void 0;
|
|
10
|
+
const core_1 = require("@octo/core");
|
|
11
|
+
let AgentService = class AgentService {
|
|
12
|
+
definitionRepo;
|
|
13
|
+
instanceRepo;
|
|
14
|
+
logger = core_1.Container.get(core_1.LoggerService).child('AgentService');
|
|
15
|
+
setRepositories(definitionRepo, instanceRepo) {
|
|
16
|
+
this.definitionRepo = definitionRepo;
|
|
17
|
+
this.instanceRepo = instanceRepo;
|
|
18
|
+
}
|
|
19
|
+
// --- Agent Definitions ---
|
|
20
|
+
async createDefinition(data) {
|
|
21
|
+
const def = this.definitionRepo.create(data);
|
|
22
|
+
return this.definitionRepo.save(def);
|
|
23
|
+
}
|
|
24
|
+
async findAllDefinitions() {
|
|
25
|
+
return this.definitionRepo.find({ order: { createdAt: 'DESC' } });
|
|
26
|
+
}
|
|
27
|
+
async findDefinitionByCode(code) {
|
|
28
|
+
return this.definitionRepo.findOne({ where: { code } });
|
|
29
|
+
}
|
|
30
|
+
async findDefinitionById(id) {
|
|
31
|
+
return this.definitionRepo.findOne({ where: { id } });
|
|
32
|
+
}
|
|
33
|
+
async updateDefinition(id, data) {
|
|
34
|
+
await this.definitionRepo.update(id, data);
|
|
35
|
+
return this.findDefinitionById(id);
|
|
36
|
+
}
|
|
37
|
+
async deleteDefinition(id) {
|
|
38
|
+
const result = await this.definitionRepo.delete(id);
|
|
39
|
+
return (result.affected ?? 0) > 0;
|
|
40
|
+
}
|
|
41
|
+
// --- Agent Instances ---
|
|
42
|
+
async createInstance(data) {
|
|
43
|
+
const instance = this.instanceRepo.create(data);
|
|
44
|
+
return this.instanceRepo.save(instance);
|
|
45
|
+
}
|
|
46
|
+
async findInstancesByClient(clientId) {
|
|
47
|
+
return this.instanceRepo.find({
|
|
48
|
+
where: { clientId },
|
|
49
|
+
relations: ['definition'],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async findInstanceById(id) {
|
|
53
|
+
return this.instanceRepo.findOne({
|
|
54
|
+
where: { id },
|
|
55
|
+
relations: ['definition'],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async updateInstanceStatus(id, status) {
|
|
59
|
+
await this.instanceRepo.update(id, { status });
|
|
60
|
+
}
|
|
61
|
+
async heartbeat(clientId) {
|
|
62
|
+
await this.instanceRepo.update({ clientId }, { lastHeartbeat: new Date() });
|
|
63
|
+
this.logger.debug(`Heartbeat from client: ${clientId}`);
|
|
64
|
+
}
|
|
65
|
+
async findOnlineInstances() {
|
|
66
|
+
return this.instanceRepo.find({
|
|
67
|
+
where: { status: 'IDLE', enabled: true },
|
|
68
|
+
relations: ['definition'],
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.AgentService = AgentService;
|
|
73
|
+
exports.AgentService = AgentService = __decorate([
|
|
74
|
+
(0, core_1.Service)()
|
|
75
|
+
], AgentService);
|
|
76
|
+
//# sourceMappingURL=agent.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.service.js","sourceRoot":"","sources":["../../src/services/agent.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Repository } from '@octo/core';
|
|
2
|
+
import { CapabilityDefinition } from '../entities/capability-definition.entity.js';
|
|
3
|
+
import { AgentBinding } from '../entities/agent-binding.entity.js';
|
|
4
|
+
import { AgentInstance } from '../entities/agent-instance.entity.js';
|
|
5
|
+
import { ClientRegistration } from '../entities/client-registration.entity.js';
|
|
6
|
+
export interface CapabilityExecutionRequest {
|
|
7
|
+
capabilityCode: string;
|
|
8
|
+
input: Record<string, unknown>;
|
|
9
|
+
preferredClientId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CapabilityExecutionTarget {
|
|
12
|
+
capability: CapabilityDefinition;
|
|
13
|
+
agentInstance: AgentInstance;
|
|
14
|
+
client: ClientRegistration;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Routes capability execution requests to the appropriate
|
|
18
|
+
* agent instance running on a capable client.
|
|
19
|
+
*/
|
|
20
|
+
export declare class CapabilityRouterService {
|
|
21
|
+
private capabilityRepo;
|
|
22
|
+
private bindingRepo;
|
|
23
|
+
private instanceRepo;
|
|
24
|
+
private clientRepo;
|
|
25
|
+
private logger;
|
|
26
|
+
setRepositories(capabilityRepo: Repository<CapabilityDefinition>, bindingRepo: Repository<AgentBinding>, instanceRepo: Repository<AgentInstance>, clientRepo: Repository<ClientRegistration>): void;
|
|
27
|
+
/**
|
|
28
|
+
* Find the best execution target for a capability request.
|
|
29
|
+
*
|
|
30
|
+
* Resolution order:
|
|
31
|
+
* 1. Find capability definition by code
|
|
32
|
+
* 2. Find agent bindings for this capability (ordered by priority)
|
|
33
|
+
* 3. Find online agent instances for the bound agents
|
|
34
|
+
* 4. Match with clients that have the capability enabled
|
|
35
|
+
* 5. Prefer the requested clientId if specified
|
|
36
|
+
*/
|
|
37
|
+
resolve(request: CapabilityExecutionRequest): Promise<CapabilityExecutionTarget>;
|
|
38
|
+
createCapability(data: Partial<CapabilityDefinition>): Promise<CapabilityDefinition>;
|
|
39
|
+
findAllCapabilities(): Promise<CapabilityDefinition[]>;
|
|
40
|
+
findCapabilityByCode(code: string): Promise<CapabilityDefinition | null>;
|
|
41
|
+
updateCapability(id: number, data: Partial<CapabilityDefinition>): Promise<CapabilityDefinition | null>;
|
|
42
|
+
bindCapabilityToAgent(capabilityId: number, agentDefinitionId: number, priority?: number): Promise<AgentBinding>;
|
|
43
|
+
unbindCapabilityFromAgent(capabilityId: number, agentDefinitionId: number): Promise<boolean>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=capability-router.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-router.service.d.ts","sourceRoot":"","sources":["../../src/services/capability-router.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE/E,MAAM,WAAW,0BAA0B;IACzC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,oBAAoB,CAAC;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED;;;GAGG;AACH,qBACa,uBAAuB;IAClC,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,MAAM,CAA0D;IAExE,eAAe,CACb,cAAc,EAAE,UAAU,CAAC,oBAAoB,CAAC,EAChD,WAAW,EAAE,UAAU,CAAC,YAAY,CAAC,EACrC,YAAY,EAAE,UAAU,CAAC,aAAa,CAAC,EACvC,UAAU,EAAE,UAAU,CAAC,kBAAkB,CAAC,GACzC,IAAI;IAOP;;;;;;;;;OASG;IACG,OAAO,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAiEhF,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAKpF,mBAAmB,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAItD,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAIxE,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAOvG,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,OAAO,CAAC,YAAY,CAAC;IAK3G,yBAAyB,CAAC,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAInG"}
|