erosolar-cli 2.1.287 → 2.1.289
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/README.md +7 -0
- package/dist/bin/agi-cli.d.ts +15 -0
- package/dist/bin/agi-cli.d.ts.map +1 -0
- package/dist/bin/agi-cli.js +175 -0
- package/dist/bin/agi-cli.js.map +1 -0
- package/dist/capabilities/metaCapability.d.ts +22 -0
- package/dist/capabilities/metaCapability.d.ts.map +1 -0
- package/dist/capabilities/metaCapability.js +33 -0
- package/dist/capabilities/metaCapability.js.map +1 -0
- package/dist/capabilities/orchestrationCapability.d.ts.map +1 -1
- package/dist/capabilities/orchestrationCapability.js +6 -2
- package/dist/capabilities/orchestrationCapability.js.map +1 -1
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +0 -3
- package/dist/core/agent.js.map +1 -1
- package/dist/core/agiCore.d.ts +149 -0
- package/dist/core/agiCore.d.ts.map +1 -0
- package/dist/core/agiCore.js +1085 -0
- package/dist/core/agiCore.js.map +1 -0
- package/dist/core/defensiveSecurityToolkit.d.ts.map +1 -1
- package/dist/core/defensiveSecurityToolkit.js +1 -0
- package/dist/core/defensiveSecurityToolkit.js.map +1 -1
- package/dist/core/hooks.d.ts.map +1 -1
- package/dist/core/hooks.js +101 -8
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/iMessageVerification.d.ts.map +1 -1
- package/dist/core/iMessageVerification.js +1 -0
- package/dist/core/iMessageVerification.js.map +1 -1
- package/dist/core/integrityVerification.d.ts.map +1 -1
- package/dist/core/integrityVerification.js +1 -0
- package/dist/core/integrityVerification.js.map +1 -1
- package/dist/core/intelligentTargetResearcher.d.ts.map +1 -1
- package/dist/core/intelligentTargetResearcher.js +1 -0
- package/dist/core/intelligentTargetResearcher.js.map +1 -1
- package/dist/core/persistentObjectiveStore.d.ts.map +1 -1
- package/dist/core/persistentObjectiveStore.js +1 -0
- package/dist/core/persistentObjectiveStore.js.map +1 -1
- package/dist/core/productTestHarness.d.ts +3 -3
- package/dist/core/productTestHarness.d.ts.map +1 -1
- package/dist/core/productTestHarness.js +4 -3
- package/dist/core/productTestHarness.js.map +1 -1
- package/dist/core/realAGI.d.ts +113 -0
- package/dist/core/realAGI.d.ts.map +1 -0
- package/dist/core/realAGI.js +899 -0
- package/dist/core/realAGI.js.map +1 -0
- package/dist/core/securityDeliverableGenerator.d.ts.map +1 -1
- package/dist/core/securityDeliverableGenerator.js +1 -0
- package/dist/core/securityDeliverableGenerator.js.map +1 -1
- package/dist/core/sourceCodeManager.d.ts +1 -1
- package/dist/core/sourceCodeManager.d.ts.map +1 -1
- package/dist/core/techFraudInvestigator.d.ts.map +1 -1
- package/dist/core/techFraudInvestigator.js +1 -0
- package/dist/core/techFraudInvestigator.js.map +1 -1
- package/dist/core/toolEmbeddings.d.ts +64 -0
- package/dist/core/toolEmbeddings.d.ts.map +1 -0
- package/dist/core/toolEmbeddings.js +471 -0
- package/dist/core/toolEmbeddings.js.map +1 -0
- package/dist/core/toolRuntime.d.ts +1 -1
- package/dist/core/toolRuntime.d.ts.map +1 -1
- package/dist/core/toolRuntime.js +1 -1
- package/dist/core/toolRuntime.js.map +1 -1
- package/dist/core/unifiedAGI.d.ts +158 -0
- package/dist/core/unifiedAGI.d.ts.map +1 -0
- package/dist/core/unifiedAGI.js +685 -0
- package/dist/core/unifiedAGI.js.map +1 -0
- package/dist/plugins/tools/agi/agiPlugin.d.ts +24 -0
- package/dist/plugins/tools/agi/agiPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/agi/agiPlugin.js +511 -0
- package/dist/plugins/tools/agi/agiPlugin.js.map +1 -0
- package/dist/plugins/tools/meta/metaPlugin.d.ts +12 -0
- package/dist/plugins/tools/meta/metaPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/meta/metaPlugin.js +19 -0
- package/dist/plugins/tools/meta/metaPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +2 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +6 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/plugins/tools/unified/unifiedAGIPlugin.d.ts +25 -0
- package/dist/plugins/tools/unified/unifiedAGIPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/unified/unifiedAGIPlugin.js +479 -0
- package/dist/plugins/tools/unified/unifiedAGIPlugin.js.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js +3 -2
- package/dist/providers/openaiChatCompletionsProvider.js.map +1 -1
- package/dist/providers/openaiResponsesProvider.js +3 -2
- package/dist/providers/openaiResponsesProvider.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +4 -6
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/skills/skillRepository.d.ts.map +1 -1
- package/dist/skills/skillRepository.js +15 -6
- package/dist/skills/skillRepository.js.map +1 -1
- package/dist/tools/appleExposureTools.d.ts.map +1 -1
- package/dist/tools/appleExposureTools.js +1 -0
- package/dist/tools/appleExposureTools.js.map +1 -1
- package/dist/tools/bidirectionalAuditTools.d.ts.map +1 -1
- package/dist/tools/bidirectionalAuditTools.js +1 -0
- package/dist/tools/bidirectionalAuditTools.js.map +1 -1
- package/dist/tools/defensiveSecurityTools.d.ts.map +1 -1
- package/dist/tools/defensiveSecurityTools.js +1 -0
- package/dist/tools/defensiveSecurityTools.js.map +1 -1
- package/dist/tools/forwardAttackChainTracer.d.ts.map +1 -1
- package/dist/tools/forwardAttackChainTracer.js +1 -0
- package/dist/tools/forwardAttackChainTracer.js.map +1 -1
- package/dist/tools/iMessageVerificationTools.d.ts.map +1 -1
- package/dist/tools/iMessageVerificationTools.js +1 -0
- package/dist/tools/iMessageVerificationTools.js.map +1 -1
- package/dist/tools/integrityTools.d.ts.map +1 -1
- package/dist/tools/integrityTools.js +1 -0
- package/dist/tools/integrityTools.js.map +1 -1
- package/dist/tools/metaTools.d.ts +62 -0
- package/dist/tools/metaTools.d.ts.map +1 -0
- package/dist/tools/metaTools.js +3201 -0
- package/dist/tools/metaTools.js.map +1 -0
- package/dist/tools/offensiveTransparencyTools.d.ts.map +1 -1
- package/dist/tools/offensiveTransparencyTools.js +1 -0
- package/dist/tools/offensiveTransparencyTools.js.map +1 -1
- package/dist/tools/searchTools.js +1 -1
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/tools/taoTools.js +1 -1
- package/dist/tools/threatIntelligenceTools.d.ts.map +1 -1
- package/dist/tools/threatIntelligenceTools.js +1 -0
- package/dist/tools/threatIntelligenceTools.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +1 -1
- package/dist/ui/UnifiedUIRenderer.js.map +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meta Tool Plugin
|
|
3
|
+
*
|
|
4
|
+
* Registers meta-level tools for handling complex/ambiguous prompts:
|
|
5
|
+
* - CheckFeasibility
|
|
6
|
+
* - DecomposeTask
|
|
7
|
+
* - AnalyzeAmbiguity
|
|
8
|
+
* - SuggestApproach
|
|
9
|
+
*/
|
|
10
|
+
import type { ToolPlugin } from '../registry.js';
|
|
11
|
+
export declare function createMetaToolPlugin(): ToolPlugin;
|
|
12
|
+
//# sourceMappingURL=metaPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metaPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tools/meta/metaPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,wBAAgB,oBAAoB,IAAI,UAAU,CAOjD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meta Tool Plugin
|
|
3
|
+
*
|
|
4
|
+
* Registers meta-level tools for handling complex/ambiguous prompts:
|
|
5
|
+
* - CheckFeasibility
|
|
6
|
+
* - DecomposeTask
|
|
7
|
+
* - AnalyzeAmbiguity
|
|
8
|
+
* - SuggestApproach
|
|
9
|
+
*/
|
|
10
|
+
import { MetaCapabilityModule } from '../../../capabilities/metaCapability.js';
|
|
11
|
+
export function createMetaToolPlugin() {
|
|
12
|
+
return {
|
|
13
|
+
id: 'tool.meta',
|
|
14
|
+
description: 'High-level orchestration tools for complex prompt handling',
|
|
15
|
+
targets: ['node', 'cloud'],
|
|
16
|
+
create: (_context) => new MetaCapabilityModule(),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=metaPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metaPlugin.js","sourceRoot":"","sources":["../../../../src/plugins/tools/meta/metaPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,EAAE,EAAE,WAAW;QACf,WAAW,EAAE,4DAA4D;QACzE,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QAC1B,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,oBAAoB,EAAE;KACjD,CAAC;AACJ,CAAC"}
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
* - skills: Load skills
|
|
12
12
|
* - mcp: MCP server bridge
|
|
13
13
|
* - orchestration: Unified orchestration
|
|
14
|
+
* - meta: Meta tools for task decomposition
|
|
15
|
+
* - agi: Unified AGI for prompt understanding and learning
|
|
14
16
|
*/
|
|
15
17
|
export declare function registerDefaultNodeToolPlugins(): void;
|
|
16
18
|
//# sourceMappingURL=nodeDefaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeDefaults.d.ts","sourceRoot":"","sources":["../../../src/plugins/tools/nodeDefaults.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nodeDefaults.d.ts","sourceRoot":"","sources":["../../../src/plugins/tools/nodeDefaults.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,IAAI,IAAI,CAgBrD"}
|
|
@@ -8,6 +8,8 @@ import { createEnhancedGitToolPlugin } from './enhancedGit/enhancedGitPlugin.js'
|
|
|
8
8
|
import { createSkillToolPlugin } from './skills/skillPlugin.js';
|
|
9
9
|
import { createMcpToolPlugin } from './mcp/mcpPlugin.js';
|
|
10
10
|
import { createOrchestrationToolPlugin } from './orchestration/orchestrationPlugin.js';
|
|
11
|
+
import { createMetaToolPlugin } from './meta/metaPlugin.js';
|
|
12
|
+
import { createAGIToolPlugin } from './agi/agiPlugin.js';
|
|
11
13
|
let registered = false;
|
|
12
14
|
/**
|
|
13
15
|
* Register default Node.js tool plugins
|
|
@@ -22,6 +24,8 @@ let registered = false;
|
|
|
22
24
|
* - skills: Load skills
|
|
23
25
|
* - mcp: MCP server bridge
|
|
24
26
|
* - orchestration: Unified orchestration
|
|
27
|
+
* - meta: Meta tools for task decomposition
|
|
28
|
+
* - agi: Unified AGI for prompt understanding and learning
|
|
25
29
|
*/
|
|
26
30
|
export function registerDefaultNodeToolPlugins() {
|
|
27
31
|
if (registered)
|
|
@@ -35,6 +39,8 @@ export function registerDefaultNodeToolPlugins() {
|
|
|
35
39
|
registerToolPlugin(createSkillToolPlugin());
|
|
36
40
|
registerToolPlugin(createMcpToolPlugin());
|
|
37
41
|
registerToolPlugin(createOrchestrationToolPlugin());
|
|
42
|
+
registerToolPlugin(createMetaToolPlugin());
|
|
43
|
+
registerToolPlugin(createAGIToolPlugin());
|
|
38
44
|
registered = true;
|
|
39
45
|
}
|
|
40
46
|
//# sourceMappingURL=nodeDefaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeDefaults.js","sourceRoot":"","sources":["../../../src/plugins/tools/nodeDefaults.ts"],"names":[],"mappings":"AAAA,O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,MAAM,oBAAoB,CAAC;AAEzD,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,8BAA8B;IAC5C,IAAI,UAAU;QAAE,OAAO;IAEvB,kBAAkB,CAAC,+BAA+B,EAAE,CAAC,CAAC;IACtD,kBAAkB,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC3C,kBAAkB,CAAC,2BAA2B,EAAE,CAAC,CAAC;IAClD,kBAAkB,CAAC,yBAAyB,EAAE,CAAC,CAAC;IAChD,kBAAkB,CAAC,6BAA6B,EAAE,CAAC,CAAC;IACpD,kBAAkB,CAAC,2BAA2B,EAAE,CAAC,CAAC;IAClD,kBAAkB,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC5C,kBAAkB,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC1C,kBAAkB,CAAC,6BAA6B,EAAE,CAAC,CAAC;IACpD,kBAAkB,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC3C,kBAAkB,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAE1C,UAAU,GAAG,IAAI,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified AGI Plugin
|
|
3
|
+
*
|
|
4
|
+
* Exposes the unified AGI system as tools:
|
|
5
|
+
* - UnifiedAnalyze: Analyze any prompt across all domains
|
|
6
|
+
* - UnifiedPlan: Generate execution plan
|
|
7
|
+
* - UnifiedExecute: Execute with Claude Code style output
|
|
8
|
+
* - UnifiedLearn: Record successful patterns
|
|
9
|
+
* - UnifiedStatus: Get AGI status
|
|
10
|
+
*
|
|
11
|
+
* NO SIMULATIONS - All operations are real
|
|
12
|
+
*/
|
|
13
|
+
import type { ToolPlugin } from '../registry.js';
|
|
14
|
+
import type { CapabilityContribution, CapabilityContext, CapabilityModule } from '../../../runtime/agentHost.js';
|
|
15
|
+
export interface UnifiedAGIPluginOptions {
|
|
16
|
+
workingDir?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class UnifiedAGICapabilityModule implements CapabilityModule {
|
|
19
|
+
readonly id = "capability.unified-agi";
|
|
20
|
+
private readonly options;
|
|
21
|
+
constructor(options?: UnifiedAGIPluginOptions);
|
|
22
|
+
create(context: CapabilityContext): Promise<CapabilityContribution>;
|
|
23
|
+
}
|
|
24
|
+
export declare function createUnifiedAGIToolPlugin(): ToolPlugin;
|
|
25
|
+
//# sourceMappingURL=unifiedAGIPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unifiedAGIPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tools/unified/unifiedAGIPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjH,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,0BAA2B,YAAW,gBAAgB;IACjE,QAAQ,CAAC,EAAE,4BAA4B;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0B;gBAEtC,OAAO,GAAE,uBAA4B;IAI3C,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAmY1E;AA0GD,wBAAgB,0BAA0B,IAAI,UAAU,CAOvD"}
|
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified AGI Plugin
|
|
3
|
+
*
|
|
4
|
+
* Exposes the unified AGI system as tools:
|
|
5
|
+
* - UnifiedAnalyze: Analyze any prompt across all domains
|
|
6
|
+
* - UnifiedPlan: Generate execution plan
|
|
7
|
+
* - UnifiedExecute: Execute with Claude Code style output
|
|
8
|
+
* - UnifiedLearn: Record successful patterns
|
|
9
|
+
* - UnifiedStatus: Get AGI status
|
|
10
|
+
*
|
|
11
|
+
* NO SIMULATIONS - All operations are real
|
|
12
|
+
*/
|
|
13
|
+
import { getUnifiedAGI } from '../../../core/unifiedAGI.js';
|
|
14
|
+
export class UnifiedAGICapabilityModule {
|
|
15
|
+
id = 'capability.unified-agi';
|
|
16
|
+
options;
|
|
17
|
+
constructor(options = {}) {
|
|
18
|
+
this.options = options;
|
|
19
|
+
}
|
|
20
|
+
async create(context) {
|
|
21
|
+
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
22
|
+
const agi = getUnifiedAGI(workingDir);
|
|
23
|
+
return {
|
|
24
|
+
id: 'unified.agi.tools',
|
|
25
|
+
description: 'Unified AGI tools for autonomous task understanding and execution across all domains',
|
|
26
|
+
toolSuite: {
|
|
27
|
+
id: 'unified-agi',
|
|
28
|
+
description: 'Unified AGI capabilities - software, research, legal, finance, automation, defense, and more',
|
|
29
|
+
tools: [
|
|
30
|
+
// =================================================================
|
|
31
|
+
// UNIFIED ANALYZE - Understand any prompt
|
|
32
|
+
// =================================================================
|
|
33
|
+
{
|
|
34
|
+
name: 'UnifiedAnalyze',
|
|
35
|
+
description: `Analyze ANY user prompt to understand domain, intent, and required tasks.
|
|
36
|
+
|
|
37
|
+
This is the unified entry point for ALL requests:
|
|
38
|
+
- Software: "fix all bugs", "add dark mode", "run tests"
|
|
39
|
+
- Research: "cure cancer", "analyze data", "build ML model"
|
|
40
|
+
- Legal: "sue google in fed court", "draft contract"
|
|
41
|
+
- Finance: "do accounting", "prepare taxes", "create budget"
|
|
42
|
+
- Automation: "automate workflow", "setup monitoring"
|
|
43
|
+
- Defense: "fighter drone coordination", "ballistic targeting system"
|
|
44
|
+
- And literally anything else
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
- Domain classification (software, research, legal, finance, automation, defense, etc.)
|
|
48
|
+
- Interpretation of what the user wants
|
|
49
|
+
- Confidence level
|
|
50
|
+
- Decomposed tasks with dependencies
|
|
51
|
+
- Tool calls ready for execution
|
|
52
|
+
- Clarifying questions if needed
|
|
53
|
+
|
|
54
|
+
This is the foundation of unified AGI - understand everything, execute anything.`,
|
|
55
|
+
parameters: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
prompt: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'The user prompt to analyze',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
required: ['prompt'],
|
|
64
|
+
additionalProperties: false,
|
|
65
|
+
},
|
|
66
|
+
handler: async (args) => {
|
|
67
|
+
const prompt = args['prompt'];
|
|
68
|
+
const analysis = agi.analyze(prompt);
|
|
69
|
+
return formatAnalysis(analysis);
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
// =================================================================
|
|
73
|
+
// UNIFIED PLAN - Generate detailed execution plan
|
|
74
|
+
// =================================================================
|
|
75
|
+
{
|
|
76
|
+
name: 'UnifiedPlan',
|
|
77
|
+
description: `Generate a detailed execution plan with Claude Code style output.
|
|
78
|
+
|
|
79
|
+
After analyzing with UnifiedAnalyze, use this for a complete execution blueprint:
|
|
80
|
+
- Shows all tasks in dependency order
|
|
81
|
+
- Lists exact tool calls with arguments
|
|
82
|
+
- Provides verification steps
|
|
83
|
+
- Domain-appropriate execution sequence
|
|
84
|
+
|
|
85
|
+
Works for any domain - software, research, legal, finance, defense, etc.`,
|
|
86
|
+
parameters: {
|
|
87
|
+
type: 'object',
|
|
88
|
+
properties: {
|
|
89
|
+
prompt: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
description: 'The user prompt to plan for',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
required: ['prompt'],
|
|
95
|
+
additionalProperties: false,
|
|
96
|
+
},
|
|
97
|
+
handler: async (args) => {
|
|
98
|
+
const prompt = args['prompt'];
|
|
99
|
+
const analysis = agi.analyze(prompt);
|
|
100
|
+
return formatPlan(analysis);
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
// =================================================================
|
|
104
|
+
// UNIFIED EXECUTE - Execute with Claude Code style
|
|
105
|
+
// =================================================================
|
|
106
|
+
{
|
|
107
|
+
name: 'UnifiedExecute',
|
|
108
|
+
description: `Execute a task with Claude Code style progress display.
|
|
109
|
+
|
|
110
|
+
This tool:
|
|
111
|
+
1. Analyzes the prompt to understand domain and intent
|
|
112
|
+
2. Generates an execution plan
|
|
113
|
+
3. Shows each step with ⏺ bullets
|
|
114
|
+
4. Reports results with ✓ or ✗
|
|
115
|
+
5. Records the operation for learning
|
|
116
|
+
|
|
117
|
+
Handles ALL domains:
|
|
118
|
+
- Software: "fix all bugs", "add feature", "run tests"
|
|
119
|
+
- Research: "cure cancer", "analyze data", "build ML model"
|
|
120
|
+
- Legal: "sue google", "draft contract", "legal research"
|
|
121
|
+
- Finance: "do accounting", "prepare taxes", "create budget"
|
|
122
|
+
- Automation: "automate workflow", "setup monitoring"
|
|
123
|
+
- Defense: "drone coordination", "targeting system"
|
|
124
|
+
|
|
125
|
+
Returns Claude Code style output showing thinking and execution plan.`,
|
|
126
|
+
parameters: {
|
|
127
|
+
type: 'object',
|
|
128
|
+
properties: {
|
|
129
|
+
prompt: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
description: 'The task to execute',
|
|
132
|
+
},
|
|
133
|
+
dryRun: {
|
|
134
|
+
type: 'boolean',
|
|
135
|
+
description: 'If true, only show plan without recording',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
required: ['prompt'],
|
|
139
|
+
additionalProperties: false,
|
|
140
|
+
},
|
|
141
|
+
handler: async (args) => {
|
|
142
|
+
const prompt = args['prompt'];
|
|
143
|
+
const dryRun = args['dryRun'] || false;
|
|
144
|
+
const startTime = Date.now();
|
|
145
|
+
const lines = [];
|
|
146
|
+
// Step 1: Thinking
|
|
147
|
+
lines.push('⏺ Thinking...');
|
|
148
|
+
lines.push('');
|
|
149
|
+
const analysis = agi.analyze(prompt);
|
|
150
|
+
lines.push(` ⎿ Understood: "${prompt}"`);
|
|
151
|
+
lines.push(` ⎿ Domain: ${analysis.domain}`);
|
|
152
|
+
lines.push(` ⎿ Interpretation: ${analysis.interpretation}`);
|
|
153
|
+
lines.push(` ⎿ Confidence: ${Math.round(analysis.confidence * 100)}%`);
|
|
154
|
+
lines.push('');
|
|
155
|
+
// Step 2: Planning
|
|
156
|
+
lines.push('⏺ Planning execution...');
|
|
157
|
+
lines.push('');
|
|
158
|
+
lines.push(` ⎿ Tasks: ${analysis.tasks.length}`);
|
|
159
|
+
lines.push(` ⎿ Tool calls: ${analysis.toolCalls.length}`);
|
|
160
|
+
lines.push('');
|
|
161
|
+
// Step 3: Task breakdown
|
|
162
|
+
lines.push('⏺ Task breakdown:');
|
|
163
|
+
analysis.tasks.forEach((task, i) => {
|
|
164
|
+
const deps = task.dependencies.length > 0 ? ` ← [${task.dependencies.join(', ')}]` : '';
|
|
165
|
+
lines.push(` ○ [${i + 1}] ${task.description}${deps}`);
|
|
166
|
+
lines.push(` Domain: ${task.domain} | Category: ${task.category}`);
|
|
167
|
+
lines.push(` Tools: ${task.tools.join(', ') || 'manual'}`);
|
|
168
|
+
});
|
|
169
|
+
lines.push('');
|
|
170
|
+
// Step 4: Tool calls
|
|
171
|
+
if (analysis.toolCalls.length > 0) {
|
|
172
|
+
lines.push('⏺ Tool execution sequence:');
|
|
173
|
+
analysis.toolCalls.forEach((call, i) => {
|
|
174
|
+
lines.push(` [${i + 1}] ${call.tool}(${formatArgs(call.args)})`);
|
|
175
|
+
lines.push(` ⎿ ${call.description}`);
|
|
176
|
+
});
|
|
177
|
+
lines.push('');
|
|
178
|
+
}
|
|
179
|
+
// Step 5: Clarification if needed
|
|
180
|
+
if (analysis.clarificationNeeded.length > 0) {
|
|
181
|
+
lines.push('⚠ Clarification suggested:');
|
|
182
|
+
analysis.clarificationNeeded.forEach(q => {
|
|
183
|
+
lines.push(` • ${q}`);
|
|
184
|
+
});
|
|
185
|
+
lines.push('');
|
|
186
|
+
}
|
|
187
|
+
// Step 6: Record or dry run
|
|
188
|
+
const duration = Date.now() - startTime;
|
|
189
|
+
if (dryRun) {
|
|
190
|
+
lines.push('⏺ Dry run - execution not recorded');
|
|
191
|
+
lines.push('');
|
|
192
|
+
lines.push(`✓ Plan ready for: "${prompt}"`);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
agi.recordOperation({
|
|
196
|
+
id: `op-${Date.now()}`,
|
|
197
|
+
prompt,
|
|
198
|
+
domain: analysis.domain,
|
|
199
|
+
interpretation: analysis.interpretation,
|
|
200
|
+
tasks: analysis.tasks.map(t => t.id),
|
|
201
|
+
success: true,
|
|
202
|
+
timestamp: Date.now(),
|
|
203
|
+
duration,
|
|
204
|
+
toolsUsed: analysis.toolCalls.map(c => c.tool),
|
|
205
|
+
});
|
|
206
|
+
lines.push(`✓ Execution plan complete (${duration}ms)`);
|
|
207
|
+
lines.push(` ⎿ Domain: ${analysis.domain}`);
|
|
208
|
+
lines.push(` ⎿ ${analysis.tasks.length} tasks decomposed`);
|
|
209
|
+
lines.push(` ⎿ ${analysis.toolCalls.length} tool calls generated`);
|
|
210
|
+
lines.push(` ⎿ Operation recorded for learning`);
|
|
211
|
+
}
|
|
212
|
+
return lines.join('\n');
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
// =================================================================
|
|
216
|
+
// UNIFIED LEARN - Record successful patterns
|
|
217
|
+
// =================================================================
|
|
218
|
+
{
|
|
219
|
+
name: 'UnifiedLearn',
|
|
220
|
+
description: `Record a successful approach for future similar prompts.
|
|
221
|
+
|
|
222
|
+
After successfully completing a task, use this to teach the AGI:
|
|
223
|
+
- Records the prompt, approach, tools, and domain
|
|
224
|
+
- Future similar prompts will use this learned pattern
|
|
225
|
+
- Enables genuine learning from experience across all domains`,
|
|
226
|
+
parameters: {
|
|
227
|
+
type: 'object',
|
|
228
|
+
properties: {
|
|
229
|
+
prompt: {
|
|
230
|
+
type: 'string',
|
|
231
|
+
description: 'The original user prompt',
|
|
232
|
+
},
|
|
233
|
+
approach: {
|
|
234
|
+
type: 'string',
|
|
235
|
+
description: 'Description of the successful approach taken',
|
|
236
|
+
},
|
|
237
|
+
tools: {
|
|
238
|
+
type: 'array',
|
|
239
|
+
items: { type: 'string' },
|
|
240
|
+
description: 'List of tools used in the successful approach',
|
|
241
|
+
},
|
|
242
|
+
domain: {
|
|
243
|
+
type: 'string',
|
|
244
|
+
description: 'The domain this pattern applies to',
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
required: ['prompt', 'approach', 'tools', 'domain'],
|
|
248
|
+
additionalProperties: false,
|
|
249
|
+
},
|
|
250
|
+
handler: async (args) => {
|
|
251
|
+
const prompt = args['prompt'];
|
|
252
|
+
const approach = args['approach'];
|
|
253
|
+
const tools = args['tools'];
|
|
254
|
+
const domain = args['domain'];
|
|
255
|
+
agi.learnFromSuccess(prompt, approach, tools, domain);
|
|
256
|
+
return `✓ Learned pattern recorded for: "${prompt}"
|
|
257
|
+
|
|
258
|
+
Domain: ${domain}
|
|
259
|
+
Approach: ${approach}
|
|
260
|
+
Tools: ${tools.join(', ')}
|
|
261
|
+
|
|
262
|
+
This pattern will be suggested for similar future prompts.`;
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
// =================================================================
|
|
266
|
+
// UNIFIED STATUS - Get AGI state
|
|
267
|
+
// =================================================================
|
|
268
|
+
{
|
|
269
|
+
name: 'UnifiedStatus',
|
|
270
|
+
description: `Get current unified AGI status including project knowledge, learned patterns, and domain capabilities.
|
|
271
|
+
|
|
272
|
+
Use this to understand:
|
|
273
|
+
- What the AGI knows about this project
|
|
274
|
+
- What patterns have been learned across all domains
|
|
275
|
+
- Recent operations and their outcomes
|
|
276
|
+
- Available domain capabilities`,
|
|
277
|
+
parameters: {
|
|
278
|
+
type: 'object',
|
|
279
|
+
properties: {},
|
|
280
|
+
additionalProperties: false,
|
|
281
|
+
},
|
|
282
|
+
handler: async () => {
|
|
283
|
+
const ctx = agi.getContext();
|
|
284
|
+
const knowledge = agi.getProjectKnowledge();
|
|
285
|
+
const patterns = agi.getLearnedPatterns();
|
|
286
|
+
const recentOps = agi.getRecentOperations(5);
|
|
287
|
+
const capabilities = agi.getDomainCapabilities();
|
|
288
|
+
const lines = [];
|
|
289
|
+
lines.push('## Unified AGI Status');
|
|
290
|
+
lines.push('');
|
|
291
|
+
lines.push(`**Session:** ${ctx.sessionId}`);
|
|
292
|
+
lines.push(`**Working Directory:** ${ctx.workingDir}`);
|
|
293
|
+
lines.push(`**Current Domain:** ${ctx.domain.currentDomain}`);
|
|
294
|
+
lines.push('');
|
|
295
|
+
lines.push('### Project Knowledge');
|
|
296
|
+
lines.push(`- Type: ${knowledge.type}`);
|
|
297
|
+
lines.push(`- Build: ${knowledge.buildSystem || 'not detected'}`);
|
|
298
|
+
lines.push(`- Test: ${knowledge.testCommand || 'not detected'}`);
|
|
299
|
+
lines.push(`- Lint: ${knowledge.lintCommand || 'not detected'}`);
|
|
300
|
+
lines.push('');
|
|
301
|
+
lines.push(`### Learned Patterns (${patterns.length})`);
|
|
302
|
+
if (patterns.length > 0) {
|
|
303
|
+
patterns.slice(0, 5).forEach(p => {
|
|
304
|
+
lines.push(`- [${p.domain}] "${p.trigger.slice(0, 40)}..." (used ${p.successCount}x)`);
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
lines.push('- No patterns learned yet');
|
|
309
|
+
}
|
|
310
|
+
lines.push('');
|
|
311
|
+
lines.push(`### Recent Operations (${recentOps.length})`);
|
|
312
|
+
if (recentOps.length > 0) {
|
|
313
|
+
recentOps.forEach(op => {
|
|
314
|
+
const status = op.success ? '✓' : '✗';
|
|
315
|
+
lines.push(`- ${status} [${op.domain}] ${op.interpretation.slice(0, 50)}... (${op.duration}ms)`);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
lines.push('- No recent operations');
|
|
320
|
+
}
|
|
321
|
+
lines.push('');
|
|
322
|
+
lines.push('### Domain Capabilities');
|
|
323
|
+
capabilities.forEach(cap => {
|
|
324
|
+
lines.push(`- **${cap.domain}**: ${cap.description}`);
|
|
325
|
+
lines.push(` Tools: ${cap.tools.join(', ')}`);
|
|
326
|
+
});
|
|
327
|
+
return lines.join('\n');
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
// =================================================================
|
|
331
|
+
// UNIFIED DOMAINS - List all supported domains
|
|
332
|
+
// =================================================================
|
|
333
|
+
{
|
|
334
|
+
name: 'UnifiedDomains',
|
|
335
|
+
description: `List all domains the unified AGI can handle.
|
|
336
|
+
|
|
337
|
+
Shows:
|
|
338
|
+
- All supported domains (software, research, legal, finance, automation, defense, etc.)
|
|
339
|
+
- Tools available for each domain
|
|
340
|
+
- Description of domain capabilities
|
|
341
|
+
|
|
342
|
+
Use this to understand what the AGI can do.`,
|
|
343
|
+
parameters: {
|
|
344
|
+
type: 'object',
|
|
345
|
+
properties: {},
|
|
346
|
+
additionalProperties: false,
|
|
347
|
+
},
|
|
348
|
+
handler: async () => {
|
|
349
|
+
const capabilities = agi.getDomainCapabilities();
|
|
350
|
+
const lines = [];
|
|
351
|
+
lines.push('## Unified AGI Domains');
|
|
352
|
+
lines.push('');
|
|
353
|
+
lines.push('The unified AGI handles ANY task across these domains:');
|
|
354
|
+
lines.push('');
|
|
355
|
+
capabilities.forEach(cap => {
|
|
356
|
+
lines.push(`### ${cap.domain.toUpperCase()}`);
|
|
357
|
+
lines.push(`${cap.description}`);
|
|
358
|
+
lines.push(`Tools: ${cap.tools.join(', ')}`);
|
|
359
|
+
lines.push('');
|
|
360
|
+
});
|
|
361
|
+
lines.push('---');
|
|
362
|
+
lines.push('');
|
|
363
|
+
lines.push('**Examples:**');
|
|
364
|
+
lines.push('- Software: "fix all bugs", "add dark mode feature"');
|
|
365
|
+
lines.push('- Research: "cure cancer", "analyze genomic data"');
|
|
366
|
+
lines.push('- Legal: "sue google in fed court", "draft contract"');
|
|
367
|
+
lines.push('- Finance: "do accounting", "prepare tax returns"');
|
|
368
|
+
lines.push('- Automation: "automate this workflow"');
|
|
369
|
+
lines.push('- Defense: "6th gen fighter drone coordination"');
|
|
370
|
+
lines.push('');
|
|
371
|
+
lines.push('The AGI will analyze, decompose, and generate tool calls for ANY prompt.');
|
|
372
|
+
return lines.join('\n');
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
],
|
|
376
|
+
},
|
|
377
|
+
metadata: {
|
|
378
|
+
workingDir,
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
// =============================================================================
|
|
384
|
+
// FORMATTING HELPERS - Claude Code Style
|
|
385
|
+
// =============================================================================
|
|
386
|
+
function formatAnalysis(analysis) {
|
|
387
|
+
const lines = [];
|
|
388
|
+
lines.push('⏺ Analyzing prompt...');
|
|
389
|
+
lines.push('');
|
|
390
|
+
lines.push(` ⎿ Input: "${analysis.originalPrompt}"`);
|
|
391
|
+
lines.push(` ⎿ Domain: ${analysis.domain}`);
|
|
392
|
+
lines.push(` ⎿ Interpretation: ${analysis.interpretation}`);
|
|
393
|
+
lines.push(` ⎿ Confidence: ${Math.round(analysis.confidence * 100)}%`);
|
|
394
|
+
lines.push('');
|
|
395
|
+
lines.push('⏺ Task Decomposition');
|
|
396
|
+
lines.push('');
|
|
397
|
+
analysis.tasks.forEach((task, i) => {
|
|
398
|
+
const deps = task.dependencies.length > 0 ? ` ← [${task.dependencies.join(', ')}]` : '';
|
|
399
|
+
lines.push(` ○ [${i + 1}] ${task.description}${deps}`);
|
|
400
|
+
lines.push(` Domain: ${task.domain} | Category: ${task.category}`);
|
|
401
|
+
lines.push(` Tools: ${task.tools.join(', ') || 'none'}`);
|
|
402
|
+
});
|
|
403
|
+
lines.push('');
|
|
404
|
+
if (analysis.toolCalls.length > 0) {
|
|
405
|
+
lines.push('⏺ Tool Calls');
|
|
406
|
+
lines.push('');
|
|
407
|
+
analysis.toolCalls.forEach((call, i) => {
|
|
408
|
+
lines.push(` [${i + 1}] ${call.tool}(${formatArgs(call.args)})`);
|
|
409
|
+
});
|
|
410
|
+
lines.push('');
|
|
411
|
+
}
|
|
412
|
+
if (analysis.clarificationNeeded.length > 0) {
|
|
413
|
+
lines.push('⚠ Clarification suggested:');
|
|
414
|
+
analysis.clarificationNeeded.forEach(q => {
|
|
415
|
+
lines.push(` • ${q}`);
|
|
416
|
+
});
|
|
417
|
+
lines.push('');
|
|
418
|
+
}
|
|
419
|
+
lines.push(`✓ Analysis complete: ${analysis.tasks.length} tasks, ${analysis.toolCalls.length} tool calls`);
|
|
420
|
+
return lines.join('\n');
|
|
421
|
+
}
|
|
422
|
+
function formatPlan(analysis) {
|
|
423
|
+
const lines = [];
|
|
424
|
+
lines.push('⏺ Execution Plan');
|
|
425
|
+
lines.push('');
|
|
426
|
+
lines.push(` Domain: ${analysis.domain}`);
|
|
427
|
+
lines.push(` Goal: ${analysis.interpretation}`);
|
|
428
|
+
lines.push(` Confidence: ${Math.round(analysis.confidence * 100)}%`);
|
|
429
|
+
lines.push('');
|
|
430
|
+
lines.push('⏺ Task Sequence');
|
|
431
|
+
lines.push('');
|
|
432
|
+
analysis.tasks.forEach((task, i) => {
|
|
433
|
+
const deps = task.dependencies.length > 0 ? ` (after: ${task.dependencies.join(', ')})` : '';
|
|
434
|
+
lines.push(` [${i + 1}] ${task.description}${deps}`);
|
|
435
|
+
lines.push(` Tools: ${task.tools.join(', ') || 'manual'}`);
|
|
436
|
+
});
|
|
437
|
+
lines.push('');
|
|
438
|
+
if (analysis.toolCalls.length > 0) {
|
|
439
|
+
lines.push('⏺ Tool Execution Sequence');
|
|
440
|
+
lines.push('');
|
|
441
|
+
analysis.toolCalls.forEach((call, i) => {
|
|
442
|
+
lines.push(` [${i + 1}] ${call.tool}(${formatArgs(call.args)})`);
|
|
443
|
+
lines.push(` ⎿ ${call.description}`);
|
|
444
|
+
});
|
|
445
|
+
lines.push('');
|
|
446
|
+
}
|
|
447
|
+
lines.push('⏺ Verification');
|
|
448
|
+
lines.push(' ○ Run verification after execution');
|
|
449
|
+
lines.push(' ○ Check all tasks completed successfully');
|
|
450
|
+
lines.push(' ○ Record results for learning');
|
|
451
|
+
lines.push('');
|
|
452
|
+
lines.push(`✓ Plan ready: ${analysis.tasks.length} tasks, ${analysis.toolCalls.length} tool calls`);
|
|
453
|
+
return lines.join('\n');
|
|
454
|
+
}
|
|
455
|
+
function formatArgs(args) {
|
|
456
|
+
const parts = [];
|
|
457
|
+
for (const [key, value] of Object.entries(args)) {
|
|
458
|
+
if (typeof value === 'string') {
|
|
459
|
+
const str = value.length > 40 ? value.slice(0, 37) + '...' : value;
|
|
460
|
+
parts.push(`${key}="${str}"`);
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
parts.push(`${key}=${JSON.stringify(value)}`);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return parts.join(', ');
|
|
467
|
+
}
|
|
468
|
+
// =============================================================================
|
|
469
|
+
// PLUGIN EXPORT
|
|
470
|
+
// =============================================================================
|
|
471
|
+
export function createUnifiedAGIToolPlugin() {
|
|
472
|
+
return {
|
|
473
|
+
id: 'tool.unified-agi',
|
|
474
|
+
description: 'Unified AGI capabilities for autonomous task understanding and execution across all domains',
|
|
475
|
+
targets: ['node', 'cloud'],
|
|
476
|
+
create: (_context) => new UnifiedAGICapabilityModule(),
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
//# sourceMappingURL=unifiedAGIPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unifiedAGIPlugin.js","sourceRoot":"","sources":["../../../../src/plugins/tools/unified/unifiedAGIPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,aAAa,EAAwD,MAAM,6BAA6B,CAAC;AAMlH,MAAM,OAAO,0BAA0B;IAC5B,EAAE,GAAG,wBAAwB,CAAC;IACtB,OAAO,CAA0B;IAElD,YAAY,UAAmC,EAAE;QAC/C,IAAI,CAAC,OAAO,GAAG,O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
504
|
total += JSON.stringify(msg.content).length;
|
|
505
505
|
}
|
|
506
|
-
|
|
507
|
-
|
|
506
|
+
const toolCalls = msg.toolCalls;
|
|
507
|
+
if (Array.isArray(toolCalls)) {
|
|
508
|
+
for (const call of toolCalls) {
|
|
508
509
|
total += (call.name?.length ?? 0);
|
|
509
510
|
try {
|
|
510
511
|
total += JSON.stringify(call.arguments ?? {}).length;
|