galaxy-opc-plugin 0.2.0 → 0.2.2
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/index.ts +244 -8
- package/package.json +17 -3
- package/skills/acquisition-management/SKILL.md +83 -0
- package/skills/ai-staff/SKILL.md +89 -0
- package/skills/asset-package/SKILL.md +142 -0
- package/skills/opb-canvas/SKILL.md +88 -0
- package/src/__tests__/e2e/company-lifecycle.test.ts +399 -0
- package/src/__tests__/integration/business-workflows.test.ts +366 -0
- package/src/__tests__/test-utils.ts +316 -0
- package/src/commands/opc-command.ts +422 -0
- package/src/db/index.ts +3 -0
- package/src/db/migrations.test.ts +324 -0
- package/src/db/migrations.ts +131 -0
- package/src/db/schema.ts +211 -0
- package/src/db/sqlite-adapter.ts +5 -0
- package/src/opc/autonomy-rules.ts +132 -0
- package/src/opc/briefing-builder.ts +1331 -0
- package/src/opc/business-workflows.test.ts +535 -0
- package/src/opc/business-workflows.ts +325 -0
- package/src/opc/context-injector.ts +366 -28
- package/src/opc/event-triggers.ts +472 -0
- package/src/opc/intelligence-engine.ts +702 -0
- package/src/opc/milestone-detector.ts +251 -0
- package/src/opc/proactive-service.ts +179 -0
- package/src/opc/reminder-service.ts +4 -43
- package/src/opc/session-task-tracker.ts +60 -0
- package/src/opc/stage-detector.ts +168 -0
- package/src/opc/task-executor.ts +332 -0
- package/src/opc/task-templates.ts +179 -0
- package/src/tools/acquisition-tool.ts +8 -5
- package/src/tools/document-tool.ts +1176 -0
- package/src/tools/finance-tool.test.ts +238 -0
- package/src/tools/finance-tool.ts +922 -14
- package/src/tools/hr-tool.ts +10 -1
- package/src/tools/legal-tool.test.ts +251 -0
- package/src/tools/legal-tool.ts +26 -4
- package/src/tools/lifecycle-tool.test.ts +231 -0
- package/src/tools/media-tool.ts +156 -1
- package/src/tools/monitoring-tool.ts +135 -2
- package/src/tools/opc-tool.test.ts +250 -0
- package/src/tools/opc-tool.ts +251 -28
- package/src/tools/project-tool.test.ts +218 -0
- package/src/tools/schemas.ts +80 -0
- package/src/tools/search-tool.ts +227 -0
- package/src/tools/staff-tool.ts +395 -2
- package/src/web/config-ui.ts +299 -45
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { Type, type Static } from "@sinclair/typebox";
|
|
9
9
|
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
10
10
|
import type { OpcDatabase } from "../db/index.js";
|
|
11
|
+
import { CompanyManager } from "../opc/company-manager.js";
|
|
11
12
|
import { json, toolError } from "../utils/tool-helper.js";
|
|
12
13
|
|
|
13
14
|
const AcquisitionSchema = Type.Union([
|
|
@@ -43,6 +44,8 @@ const AcquisitionSchema = Type.Union([
|
|
|
43
44
|
type AcquisitionParams = Static<typeof AcquisitionSchema>;
|
|
44
45
|
|
|
45
46
|
export function registerAcquisitionTool(api: OpenClawPluginApi, db: OpcDatabase): void {
|
|
47
|
+
const manager = new CompanyManager(db);
|
|
48
|
+
|
|
46
49
|
api.registerTool(
|
|
47
50
|
{
|
|
48
51
|
name: "opc_acquisition",
|
|
@@ -75,11 +78,11 @@ export function registerAcquisitionTool(api: OpenClawPluginApi, db: OpcDatabase)
|
|
|
75
78
|
p.notes ?? "", now, now,
|
|
76
79
|
);
|
|
77
80
|
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
// 通过状态机将公司标记为 acquired
|
|
82
|
+
const transitioned = manager.transitionStatus(p.company_id, "acquired");
|
|
83
|
+
if (!transitioned) {
|
|
84
|
+
return toolError(`公司 ${p.company_id} 不存在或当前状态不允许收购`, "INVALID_STATUS");
|
|
85
|
+
}
|
|
83
86
|
|
|
84
87
|
const row = db.queryOne(
|
|
85
88
|
`SELECT a.*, c.name as company_name FROM opc_acquisition_cases a
|