rhachet-roles-bhrain 0.3.0 → 0.5.1
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/access/sdk/sdkOpenAi.d.ts +25 -0
- package/dist/access/sdk/sdkOpenAi.js +122 -0
- package/dist/access/sdk/sdkOpenAi.js.map +1 -1
- package/dist/access/sdks/anthropic/sdkAnthropic.d.ts +31 -0
- package/dist/access/sdks/anthropic/sdkAnthropic.js +151 -0
- package/dist/access/sdks/anthropic/sdkAnthropic.js.map +1 -0
- package/dist/access/sdks/qwen/sdkQwen.d.ts +31 -0
- package/dist/access/sdks/qwen/sdkQwen.js +134 -0
- package/dist/access/sdks/qwen/sdkQwen.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Actor.d.ts +67 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Actor.js +12 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Actor.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Atom.d.ts +40 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Atom.js +3 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Atom.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Context.d.ts +30 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Context.js +3 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Context.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.d.ts +34 -0
- package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.js +8 -0
- package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.d.ts +23 -0
- package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.js +9 -0
- package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.d.ts +49 -0
- package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.js +8 -0
- package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.d.ts +31 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.js +9 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.d.ts +27 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.js +8 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.d.ts +45 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.js +3 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.d.ts +29 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.js +8 -0
- package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.d.ts +22 -0
- package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.js +8 -0
- package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.d.ts +30 -0
- package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.js +3 -0
- package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Session.d.ts +47 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Session.js +17 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Session.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.d.ts +34 -0
- package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.js +12 -0
- package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.d.ts +21 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.js +8 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.d.ts +54 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.js +20 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.d.ts +36 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.js +9 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.d.ts +25 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.js +8 -0
- package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.js.map +1 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.d.ts +31 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.js +3 -0
- package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.js.map +1 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectManifest.d.ts +44 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectManifest.js +8 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectManifest.js.map +1 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.d.ts +30 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.js +35 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.js.map +1 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.d.ts +89 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.js +8 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.js.map +1 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.d.ts +43 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.js +8 -0
- package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.js.map +1 -0
- package/dist/domain.operations/artifact/genLoopFeedback.js +1 -1
- package/dist/domain.operations/artifact/genLoopFeedback.js.map +1 -1
- package/dist/domain.operations/artifact/genStepGrabCallerFeedbackToArtifact.d.ts +1 -1
- package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.d.ts +13 -0
- package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.js +106 -0
- package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.d.ts +18 -0
- package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.js +16 -0
- package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.d.ts +30 -0
- package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.js +71 -0
- package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.d.ts +20 -0
- package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.js +90 -0
- package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.d.ts +8 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.js +31 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.d.ts +3 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.js +10 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.d.ts +8 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.js +31 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.d.ts +8 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.js +32 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.d.ts +6 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.js +80 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.d.ts +6 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.js +14 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.d.ts +8 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.js +52 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.d.ts +8 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.js +38 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.d.ts +33 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.js +100 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.d.ts +6 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.js +26 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.d.ts +41 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.js +107 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.d.ts +33 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.js +68 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.d.ts +41 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.js +97 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.d.ts +6 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.js +65 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.d.ts +37 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.js +96 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.d.ts +33 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.js +81 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.d.ts +33 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.js +113 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.d.ts +6 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.js +36 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.d.ts +36 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.js +101 -0
- package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.d.ts +14 -0
- package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.js +45 -0
- package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.js.map +1 -0
- package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.d.ts +19 -0
- package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.js +35 -0
- package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.js.map +1 -0
- package/dist/domain.operations/git/genGitHubFileUrl.d.ts +9 -0
- package/dist/domain.operations/git/genGitHubFileUrl.js +55 -0
- package/dist/domain.operations/git/genGitHubFileUrl.js.map +1 -0
- package/dist/domain.operations/git/getGitRemoteUrl.d.ts +7 -0
- package/dist/domain.operations/git/getGitRemoteUrl.js +40 -0
- package/dist/domain.operations/git/getGitRemoteUrl.js.map +1 -0
- package/dist/domain.operations/hooks/getInvokeHooks.js +1 -1
- package/dist/domain.operations/hooks/getInvokeHooks.js.map +1 -1
- package/dist/domain.operations/reflect/createDraftDirectory.d.ts +11 -0
- package/dist/domain.operations/reflect/createDraftDirectory.js +46 -0
- package/dist/domain.operations/reflect/createDraftDirectory.js.map +1 -0
- package/dist/domain.operations/reflect/enumFeedbackFiles.d.ts +7 -0
- package/dist/domain.operations/reflect/enumFeedbackFiles.js +69 -0
- package/dist/domain.operations/reflect/enumFeedbackFiles.js.map +1 -0
- package/dist/domain.operations/reflect/extractJsonFromResultText.d.ts +7 -0
- package/dist/domain.operations/reflect/extractJsonFromResultText.js +19 -0
- package/dist/domain.operations/reflect/extractJsonFromResultText.js.map +1 -0
- package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.d.ts +46 -0
- package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.js +120 -0
- package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.js.map +1 -0
- package/dist/domain.operations/reflect/metrics/computeMetricsExpected.d.ts +12 -0
- package/dist/domain.operations/reflect/metrics/computeMetricsExpected.js +28 -0
- package/dist/domain.operations/reflect/metrics/computeMetricsExpected.js.map +1 -0
- package/dist/domain.operations/reflect/metrics/computeMetricsRealized.d.ts +26 -0
- package/dist/domain.operations/reflect/metrics/computeMetricsRealized.js +66 -0
- package/dist/domain.operations/reflect/metrics/computeMetricsRealized.js.map +1 -0
- package/dist/domain.operations/reflect/metrics/writeLogArtifact.d.ts +17 -0
- package/dist/domain.operations/reflect/metrics/writeLogArtifact.js +93 -0
- package/dist/domain.operations/reflect/metrics/writeLogArtifact.js.map +1 -0
- package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.d.ts +8 -0
- package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.js +28 -0
- package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.js.map +1 -0
- package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.d.ts +14 -0
- package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.js +93 -0
- package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.js.map +1 -0
- package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.d.ts +18 -0
- package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.js +208 -0
- package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.js.map +1 -0
- package/dist/domain.operations/reflect/step2/executeManifestOperations.d.ts +17 -0
- package/dist/domain.operations/reflect/step2/executeManifestOperations.js +189 -0
- package/dist/domain.operations/reflect/step2/executeManifestOperations.js.map +1 -0
- package/dist/domain.operations/reflect/step2/parseManifestOperations.d.ts +8 -0
- package/dist/domain.operations/reflect/step2/parseManifestOperations.js +73 -0
- package/dist/domain.operations/reflect/step2/parseManifestOperations.js.map +1 -0
- package/dist/domain.operations/reflect/validateSourceDirectory.d.ts +9 -0
- package/dist/domain.operations/reflect/validateSourceDirectory.js +63 -0
- package/dist/domain.operations/reflect/validateSourceDirectory.js.map +1 -0
- package/dist/domain.operations/reflect/validateTargetDirectory.d.ts +10 -0
- package/dist/domain.operations/reflect/validateTargetDirectory.js +59 -0
- package/dist/domain.operations/reflect/validateTargetDirectory.js.map +1 -0
- package/dist/index.js.map +1 -1
- package/dist/roles/architect/getArchitectRole.d.ts +6 -0
- package/dist/roles/architect/getArchitectRole.js +31 -0
- package/dist/roles/architect/getArchitectRole.js.map +1 -0
- package/dist/roles/brain/getBrainRole.d.ts +6 -0
- package/dist/roles/brain/getBrainRole.js +28 -0
- package/dist/roles/brain/getBrainRole.js.map +1 -0
- package/dist/roles/brain/skills/act/skillAct.d.ts +5 -0
- package/dist/roles/brain/skills/act/skillAct.js +147 -0
- package/dist/roles/brain/skills/act/skillAct.js.map +1 -0
- package/dist/roles/brain/skills/act/skillAct.ts +186 -0
- package/dist/roles/brain/skills/act/stepAct.d.ts +27 -0
- package/dist/roles/brain/skills/act/stepAct.js +95 -0
- package/dist/roles/brain/skills/act/stepAct.js.map +1 -0
- package/dist/roles/brain/skills/act/stepAct.ts +123 -0
- package/dist/roles/getRoleRegistry.js +5 -4
- package/dist/roles/getRoleRegistry.js.map +1 -1
- package/dist/roles/reviewer/briefs/on.rules/rules101.[article].md +41 -0
- package/dist/roles/reviewer/briefs/on.rules/rules101.citations.[article].md +88 -0
- package/dist/roles/reviewer/briefs/on.rules/rules101.collocated.[article].md +97 -0
- package/dist/roles/reviewer/briefs/on.rules/rules101.content.[article].md +228 -0
- package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].forbid.failhide.md +87 -0
- package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].forbid.gerunds.md +85 -0
- package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].require.failfast.md +73 -0
- package/dist/roles/reviewer/briefs/on.rules/rules101.structure.[article].md +70 -0
- package/dist/roles/reviewer/skills/reflect/reflect.d.ts +30 -0
- package/dist/roles/reviewer/skills/reflect/reflect.js +305 -0
- package/dist/roles/reviewer/skills/reflect/reflect.js.map +1 -0
- package/dist/roles/reviewer/skills/reflect/reflect.sh +38 -0
- package/dist/roles/reviewer/skills/reflect/reflect.ts +356 -0
- package/dist/roles/thinker/getThinkerBrief.d.ts +1 -1
- package/dist/roles/thinker/getThinkerRole.js +8 -8
- package/dist/roles/thinker/getThinkerRole.js.map +1 -1
- package/package.json +5 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.validateTargetDirectory = void 0;
|
|
27
|
+
const fs = __importStar(require("fs/promises"));
|
|
28
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
29
|
+
/**
|
|
30
|
+
* .what = validates target directory exists or creates with --force
|
|
31
|
+
* .why = fail fast on invalid target before expensive operations
|
|
32
|
+
*/
|
|
33
|
+
const validateTargetDirectory = async (input) => {
|
|
34
|
+
// check if directory exists
|
|
35
|
+
try {
|
|
36
|
+
const stat = await fs.stat(input.target);
|
|
37
|
+
if (!stat.isDirectory())
|
|
38
|
+
throw new helpful_errors_1.BadRequestError('target path exists but is not a directory', {
|
|
39
|
+
target: input.target,
|
|
40
|
+
});
|
|
41
|
+
return { created: false };
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
// if not a BadRequestError, directory doesn't exist
|
|
45
|
+
if (error instanceof helpful_errors_1.BadRequestError)
|
|
46
|
+
throw error;
|
|
47
|
+
// directory doesn't exist - check if we should create it
|
|
48
|
+
if (!input.force)
|
|
49
|
+
throw new helpful_errors_1.BadRequestError('target directory does not exist. use --force to create it.', {
|
|
50
|
+
target: input.target,
|
|
51
|
+
hint: 'add --force flag to create the target directory',
|
|
52
|
+
});
|
|
53
|
+
// create directory with --force
|
|
54
|
+
await fs.mkdir(input.target, { recursive: true });
|
|
55
|
+
return { created: true };
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.validateTargetDirectory = validateTargetDirectory;
|
|
59
|
+
//# sourceMappingURL=validateTargetDirectory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateTargetDirectory.js","sourceRoot":"","sources":["../../../src/domain.operations/reflect/validateTargetDirectory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,mDAAiD;AAEjD;;;GAGG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAAE,KAG7C,EAEE,EAAE;IACH,4BAA4B;IAC5B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACrB,MAAM,IAAI,gCAAe,CAAC,2CAA2C,EAAE;gBACrE,MAAM,EAAE,KAAK,CAAC,MAAM;aACrB,CAAC,CAAC;QACL,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,oDAAoD;QACpD,IAAI,KAAK,YAAY,gCAAe;YAAE,MAAM,KAAK,CAAC;QAElD,yDAAyD;QACzD,IAAI,CAAC,KAAK,CAAC,KAAK;YACd,MAAM,IAAI,gCAAe,CACvB,4DAA4D,EAC5D;gBACE,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,iDAAiD;aACxD,CACF,CAAC;QAEJ,gCAAgC;QAChC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;AACH,CAAC,CAAC;AAhCW,QAAA,uBAAuB,2BAgClC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ROLE_ARCHITECT = void 0;
|
|
4
|
+
const rhachet_1 = require("rhachet");
|
|
5
|
+
/**
|
|
6
|
+
* .what = role definition for the architect
|
|
7
|
+
* .why = documents and compares architectures of replic brains (LLMs behind REPLs)
|
|
8
|
+
*/
|
|
9
|
+
exports.ROLE_ARCHITECT = rhachet_1.Role.build({
|
|
10
|
+
slug: 'architect',
|
|
11
|
+
name: 'Architect',
|
|
12
|
+
purpose: 'brain architecture patterns',
|
|
13
|
+
readme: `
|
|
14
|
+
## 🏗️ Architect
|
|
15
|
+
|
|
16
|
+
- **scale**: conceptual, architectural
|
|
17
|
+
- **focus**: brain architecture patterns
|
|
18
|
+
- **maximizes**: understanding of how artificial brains are constructed
|
|
19
|
+
|
|
20
|
+
used to document and compare architectures of replic brains (LLMs behind REPLs).
|
|
21
|
+
`.trim(),
|
|
22
|
+
traits: [],
|
|
23
|
+
skills: {
|
|
24
|
+
dirs: [],
|
|
25
|
+
refs: [],
|
|
26
|
+
},
|
|
27
|
+
briefs: {
|
|
28
|
+
dirs: [{ uri: __dirname + '/briefs' }],
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=getArchitectRole.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getArchitectRole.js","sourceRoot":"","sources":["../../../src/roles/architect/getArchitectRole.ts"],"names":[],"mappings":";;;AAAA,qCAA+B;AAE/B;;;GAGG;AACU,QAAA,cAAc,GAAS,cAAI,CAAC,KAAK,CAAC;IAC7C,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE;;;;;;;;GAQP,CAAC,IAAI,EAAE;IACR,MAAM,EAAE,EAAE;IACV,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;KACT;IACD,MAAM,EAAE;QACN,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;KACvC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ROLE_BRAIN = void 0;
|
|
4
|
+
const rhachet_1 = require("rhachet");
|
|
5
|
+
const skillAct_1 = require("../../roles/brain/skills/act/skillAct");
|
|
6
|
+
/**
|
|
7
|
+
* .what = role definition for the brain
|
|
8
|
+
* .why = exposes agentic capabilities as rhachet skills for tool-using llm workflows
|
|
9
|
+
*/
|
|
10
|
+
exports.ROLE_BRAIN = rhachet_1.Role.build({
|
|
11
|
+
slug: 'brain',
|
|
12
|
+
name: 'Brain',
|
|
13
|
+
purpose: 'agentic entooled brain',
|
|
14
|
+
readme: `
|
|
15
|
+
## 🧠 Brain
|
|
16
|
+
|
|
17
|
+
a brain.repl available for agentic tooluse
|
|
18
|
+
`.trim(),
|
|
19
|
+
traits: [],
|
|
20
|
+
skills: {
|
|
21
|
+
dirs: [],
|
|
22
|
+
refs: [skillAct_1.SKILL_ACT],
|
|
23
|
+
},
|
|
24
|
+
briefs: {
|
|
25
|
+
dirs: [],
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=getBrainRole.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBrainRole.js","sourceRoot":"","sources":["../../../src/roles/brain/getBrainRole.ts"],"names":[],"mappings":";;;AAAA,qCAA+B;AAE/B,mEAAiE;AAEjE;;;GAGG;AACU,QAAA,UAAU,GAAS,cAAI,CAAC,KAAK,CAAC;IACzC,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,wBAAwB;IACjC,MAAM,EAAE;;;;GAIP,CAAC,IAAI,EAAE;IACR,MAAM,EAAE,EAAE;IACV,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,CAAC,oBAAS,CAAC;KAClB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;KACT;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SKILL_ACT = void 0;
|
|
4
|
+
const rhachet_1 = require("rhachet");
|
|
5
|
+
const rhachet_artifact_git_1 = require("rhachet-artifact-git");
|
|
6
|
+
const genContextLogTrail_1 = require("../../../../.test/genContextLogTrail");
|
|
7
|
+
const BrainArch1Actor_1 = require("../../../../domain.objects/BrainArch1/BrainArch1Actor");
|
|
8
|
+
const anthropic_1 = require("../../../../domain.operations/brain.replic.arch1/plugins/atoms/anthropic");
|
|
9
|
+
const openai_1 = require("../../../../domain.operations/brain.replic.arch1/plugins/atoms/openai");
|
|
10
|
+
const qwen_1 = require("../../../../domain.operations/brain.replic.arch1/plugins/atoms/qwen");
|
|
11
|
+
const readOnly_1 = require("../../../../domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly");
|
|
12
|
+
const files_1 = require("../../../../domain.operations/brain.replic.arch1/plugins/toolboxes/files");
|
|
13
|
+
const stepAct_1 = require("./stepAct");
|
|
14
|
+
/**
|
|
15
|
+
* .what = skill definition for agentic task completion
|
|
16
|
+
* .why = enables rhachet roles to leverage brain capabilities for autonomous task execution
|
|
17
|
+
*/
|
|
18
|
+
exports.SKILL_ACT = (0, rhachet_1.genRoleSkill)({
|
|
19
|
+
slug: 'act',
|
|
20
|
+
route: stepAct_1.stepAct,
|
|
21
|
+
threads: {
|
|
22
|
+
lookup: {
|
|
23
|
+
target: {
|
|
24
|
+
source: 'process.argv',
|
|
25
|
+
char: 't',
|
|
26
|
+
desc: 'the target file to write the result to',
|
|
27
|
+
type: 'string',
|
|
28
|
+
},
|
|
29
|
+
provider: {
|
|
30
|
+
source: 'process.argv',
|
|
31
|
+
char: 'p',
|
|
32
|
+
desc: 'the llm provider to use (anthropic, openai, qwen)',
|
|
33
|
+
type: '?string',
|
|
34
|
+
},
|
|
35
|
+
model: {
|
|
36
|
+
source: 'process.argv',
|
|
37
|
+
char: 'm',
|
|
38
|
+
desc: 'the model to use',
|
|
39
|
+
type: '?string',
|
|
40
|
+
},
|
|
41
|
+
system: {
|
|
42
|
+
source: 'process.argv',
|
|
43
|
+
char: 's',
|
|
44
|
+
desc: 'path to system prompt file',
|
|
45
|
+
type: '?string',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
assess: (input) => typeof input.target === 'string',
|
|
49
|
+
instantiate: async (input) => {
|
|
50
|
+
const obsDir = (0, rhachet_artifact_git_1.getArtifactObsDir)({ uri: input.target });
|
|
51
|
+
// build brain actor from inputs
|
|
52
|
+
const provider = (input.provider ?? 'anthropic');
|
|
53
|
+
const model = input.model ?? 'claude-3-5-sonnet-latest';
|
|
54
|
+
// create atom based on provider
|
|
55
|
+
const atom = provider === 'anthropic'
|
|
56
|
+
? (0, anthropic_1.genAtomAnthropic)({ model })
|
|
57
|
+
: provider === 'openai'
|
|
58
|
+
? (0, openai_1.genAtomOpenai)({ model })
|
|
59
|
+
: (0, qwen_1.genAtomQwen)({ model });
|
|
60
|
+
const actor = new BrainArch1Actor_1.BrainArch1Actor({
|
|
61
|
+
atom,
|
|
62
|
+
toolboxes: [files_1.toolboxFiles],
|
|
63
|
+
memory: null,
|
|
64
|
+
permission: readOnly_1.permissionGuardReadOnly,
|
|
65
|
+
constraints: {
|
|
66
|
+
maxIterations: 100,
|
|
67
|
+
maxTokens: 8192,
|
|
68
|
+
},
|
|
69
|
+
role: {
|
|
70
|
+
systemPrompt: null,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
caller: await (0, rhachet_1.enrollThread)({
|
|
75
|
+
role: 'caller',
|
|
76
|
+
stash: {
|
|
77
|
+
ask: input.ask,
|
|
78
|
+
art: {
|
|
79
|
+
result: (0, rhachet_artifact_git_1.genArtifactGitFile)({ uri: input.target }, { versions: true }),
|
|
80
|
+
log: (0, rhachet_artifact_git_1.genArtifactGitFile)({ uri: obsDir + '.log.md' }, { versions: true }),
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
}),
|
|
84
|
+
brain: await (0, rhachet_1.enrollThread)({
|
|
85
|
+
role: 'brain',
|
|
86
|
+
stash: {
|
|
87
|
+
actor,
|
|
88
|
+
systemPromptPath: input.system ?? null,
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
context: {
|
|
95
|
+
lookup: {
|
|
96
|
+
apiKeyAnthropic: {
|
|
97
|
+
source: 'process.env',
|
|
98
|
+
envar: 'ANTHROPIC_API_KEY',
|
|
99
|
+
desc: 'the anthropic api key',
|
|
100
|
+
type: '?string',
|
|
101
|
+
},
|
|
102
|
+
apiKeyOpenai: {
|
|
103
|
+
source: 'process.env',
|
|
104
|
+
envar: 'OPENAI_API_KEY',
|
|
105
|
+
desc: 'the openai api key',
|
|
106
|
+
type: '?string',
|
|
107
|
+
},
|
|
108
|
+
apiKeyQwen: {
|
|
109
|
+
source: 'process.env',
|
|
110
|
+
envar: 'QWEN_API_KEY',
|
|
111
|
+
desc: 'the qwen api key',
|
|
112
|
+
type: '?string',
|
|
113
|
+
},
|
|
114
|
+
apiKeyTavily: {
|
|
115
|
+
source: 'process.env',
|
|
116
|
+
envar: 'TAVILY_API_KEY',
|
|
117
|
+
desc: 'the tavily api key for web search',
|
|
118
|
+
type: '?string',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
assess: (input) => true,
|
|
122
|
+
instantiate: (input) => {
|
|
123
|
+
return {
|
|
124
|
+
creds: {
|
|
125
|
+
anthropic: { apiKey: input.apiKeyAnthropic ?? '', url: null },
|
|
126
|
+
openai: { apiKey: input.apiKeyOpenai ?? '', url: null },
|
|
127
|
+
qwen: { apiKey: input.apiKeyQwen ?? '', url: null },
|
|
128
|
+
tavily: { apiKey: input.apiKeyTavily ?? '' },
|
|
129
|
+
},
|
|
130
|
+
...(0, genContextLogTrail_1.genContextLogTrail)(),
|
|
131
|
+
...(0, rhachet_1.genContextStitchTrail)(),
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
readme: `
|
|
136
|
+
# act
|
|
137
|
+
|
|
138
|
+
invokes the agentic brain loop to complete a task
|
|
139
|
+
|
|
140
|
+
## usage
|
|
141
|
+
|
|
142
|
+
\`\`\`bash
|
|
143
|
+
npx rhachet skills run act -t ./output.md "your task here"
|
|
144
|
+
\`\`\`
|
|
145
|
+
`.trim(),
|
|
146
|
+
});
|
|
147
|
+
//# sourceMappingURL=skillAct.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skillAct.js","sourceRoot":"","sources":["../../../../../src/roles/brain/skills/act/skillAct.ts"],"names":[],"mappings":";;;AAAA,qCAA4E;AAC5E,+DAA6E;AAE7E,sEAAmE;AACnE,oFAAiF;AACjF,iGAAqG;AACrG,2FAA+F;AAC/F,uFAA2F;AAC3F,0GAAsH;AACtH,6FAAiG;AAEjG,uCAAoC;AAEpC;;;GAGG;AACU,QAAA,SAAS,GAAG,IAAA,sBAAY,EAAC;IACpC,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,iBAAO;IACd,OAAO,EAAE;QACP,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,wCAAwC;gBAC9C,IAAI,EAAE,QAAQ;aACf;YACD,QAAQ,EAAE;gBACR,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,mDAAmD;gBACzD,IAAI,EAAE,SAAS;aAChB;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gB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,EAAE,MAAM,EAAE,KAAK,CAAC,eAAe,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;oBAC7D,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,YAAY,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;oBACvD,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,UAAU,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;oBACnD,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,YAAY,IAAI,EAAE,EAAE;iBAC7C;gBACD,GAAG,IAAA,uCAAkB,GAAE;gBACvB,GAAG,IAAA,+BAAqB,GAAE;aAC3B,CAAC;QACJ,CAAC;KACF;IACD,MAAM,EAAE;;;;;;;;;;GAUP,CAAC,IAAI,EAAE;CACT,CAAC,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { enrollThread, genContextStitchTrail, genRoleSkill } from 'rhachet';
|
|
2
|
+
import { genArtifactGitFile, getArtifactObsDir } from 'rhachet-artifact-git';
|
|
3
|
+
|
|
4
|
+
import { genContextLogTrail } from '@src/.test/genContextLogTrail';
|
|
5
|
+
import { BrainArch1Actor } from '@src/domain.objects/BrainArch1/BrainArch1Actor';
|
|
6
|
+
import { genAtomAnthropic } from '@src/domain.operations/brain.replic.arch1/plugins/atoms/anthropic';
|
|
7
|
+
import { genAtomOpenai } from '@src/domain.operations/brain.replic.arch1/plugins/atoms/openai';
|
|
8
|
+
import { genAtomQwen } from '@src/domain.operations/brain.replic.arch1/plugins/atoms/qwen';
|
|
9
|
+
import { permissionGuardReadOnly } from '@src/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly';
|
|
10
|
+
import { toolboxFiles } from '@src/domain.operations/brain.replic.arch1/plugins/toolboxes/files';
|
|
11
|
+
|
|
12
|
+
import { stepAct } from './stepAct';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* .what = skill definition for agentic task completion
|
|
16
|
+
* .why = enables rhachet roles to leverage brain capabilities for autonomous task execution
|
|
17
|
+
*/
|
|
18
|
+
export const SKILL_ACT = genRoleSkill({
|
|
19
|
+
slug: 'act',
|
|
20
|
+
route: stepAct,
|
|
21
|
+
threads: {
|
|
22
|
+
lookup: {
|
|
23
|
+
target: {
|
|
24
|
+
source: 'process.argv',
|
|
25
|
+
char: 't',
|
|
26
|
+
desc: 'the target file to write the result to',
|
|
27
|
+
type: 'string',
|
|
28
|
+
},
|
|
29
|
+
provider: {
|
|
30
|
+
source: 'process.argv',
|
|
31
|
+
char: 'p',
|
|
32
|
+
desc: 'the llm provider to use (anthropic, openai, qwen)',
|
|
33
|
+
type: '?string',
|
|
34
|
+
},
|
|
35
|
+
model: {
|
|
36
|
+
source: 'process.argv',
|
|
37
|
+
char: 'm',
|
|
38
|
+
desc: 'the model to use',
|
|
39
|
+
type: '?string',
|
|
40
|
+
},
|
|
41
|
+
system: {
|
|
42
|
+
source: 'process.argv',
|
|
43
|
+
char: 's',
|
|
44
|
+
desc: 'path to system prompt file',
|
|
45
|
+
type: '?string',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
assess: (
|
|
49
|
+
input,
|
|
50
|
+
): input is {
|
|
51
|
+
target: string;
|
|
52
|
+
provider: string;
|
|
53
|
+
model: string;
|
|
54
|
+
system: string;
|
|
55
|
+
ask: string;
|
|
56
|
+
} => typeof input.target === 'string',
|
|
57
|
+
instantiate: async (input: {
|
|
58
|
+
target: string;
|
|
59
|
+
provider: string;
|
|
60
|
+
model: string;
|
|
61
|
+
system: string;
|
|
62
|
+
ask: string;
|
|
63
|
+
}) => {
|
|
64
|
+
const obsDir = getArtifactObsDir({ uri: input.target });
|
|
65
|
+
|
|
66
|
+
// build brain actor from inputs
|
|
67
|
+
const provider = (input.provider ?? 'anthropic') as
|
|
68
|
+
| 'anthropic'
|
|
69
|
+
| 'openai'
|
|
70
|
+
| 'qwen';
|
|
71
|
+
const model = input.model ?? 'claude-3-5-sonnet-latest';
|
|
72
|
+
|
|
73
|
+
// create atom based on provider
|
|
74
|
+
const atom =
|
|
75
|
+
provider === 'anthropic'
|
|
76
|
+
? genAtomAnthropic({ model })
|
|
77
|
+
: provider === 'openai'
|
|
78
|
+
? genAtomOpenai({ model })
|
|
79
|
+
: genAtomQwen({ model });
|
|
80
|
+
|
|
81
|
+
const actor = new BrainArch1Actor({
|
|
82
|
+
atom,
|
|
83
|
+
toolboxes: [toolboxFiles],
|
|
84
|
+
memory: null,
|
|
85
|
+
permission: permissionGuardReadOnly,
|
|
86
|
+
constraints: {
|
|
87
|
+
maxIterations: 100,
|
|
88
|
+
maxTokens: 8192,
|
|
89
|
+
},
|
|
90
|
+
role: {
|
|
91
|
+
systemPrompt: null,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
caller: await enrollThread({
|
|
97
|
+
role: 'caller',
|
|
98
|
+
stash: {
|
|
99
|
+
ask: input.ask,
|
|
100
|
+
art: {
|
|
101
|
+
result: genArtifactGitFile(
|
|
102
|
+
{ uri: input.target },
|
|
103
|
+
{ versions: true },
|
|
104
|
+
),
|
|
105
|
+
log: genArtifactGitFile(
|
|
106
|
+
{ uri: obsDir + '.log.md' },
|
|
107
|
+
{ versions: true },
|
|
108
|
+
),
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
}),
|
|
112
|
+
brain: await enrollThread({
|
|
113
|
+
role: 'brain',
|
|
114
|
+
stash: {
|
|
115
|
+
actor,
|
|
116
|
+
systemPromptPath: input.system ?? null,
|
|
117
|
+
},
|
|
118
|
+
}),
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
context: {
|
|
123
|
+
lookup: {
|
|
124
|
+
apiKeyAnthropic: {
|
|
125
|
+
source: 'process.env',
|
|
126
|
+
envar: 'ANTHROPIC_API_KEY',
|
|
127
|
+
desc: 'the anthropic api key',
|
|
128
|
+
type: '?string',
|
|
129
|
+
},
|
|
130
|
+
apiKeyOpenai: {
|
|
131
|
+
source: 'process.env',
|
|
132
|
+
envar: 'OPENAI_API_KEY',
|
|
133
|
+
desc: 'the openai api key',
|
|
134
|
+
type: '?string',
|
|
135
|
+
},
|
|
136
|
+
apiKeyQwen: {
|
|
137
|
+
source: 'process.env',
|
|
138
|
+
envar: 'QWEN_API_KEY',
|
|
139
|
+
desc: 'the qwen api key',
|
|
140
|
+
type: '?string',
|
|
141
|
+
},
|
|
142
|
+
apiKeyTavily: {
|
|
143
|
+
source: 'process.env',
|
|
144
|
+
envar: 'TAVILY_API_KEY',
|
|
145
|
+
desc: 'the tavily api key for web search',
|
|
146
|
+
type: '?string',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
assess: (
|
|
150
|
+
input,
|
|
151
|
+
): input is {
|
|
152
|
+
apiKeyAnthropic: string;
|
|
153
|
+
apiKeyOpenai: string;
|
|
154
|
+
apiKeyQwen: string;
|
|
155
|
+
apiKeyTavily: string;
|
|
156
|
+
} => true,
|
|
157
|
+
instantiate: (input: {
|
|
158
|
+
apiKeyAnthropic: string;
|
|
159
|
+
apiKeyOpenai: string;
|
|
160
|
+
apiKeyQwen: string;
|
|
161
|
+
apiKeyTavily: string;
|
|
162
|
+
}) => {
|
|
163
|
+
return {
|
|
164
|
+
creds: {
|
|
165
|
+
anthropic: { apiKey: input.apiKeyAnthropic ?? '', url: null },
|
|
166
|
+
openai: { apiKey: input.apiKeyOpenai ?? '', url: null },
|
|
167
|
+
qwen: { apiKey: input.apiKeyQwen ?? '', url: null },
|
|
168
|
+
tavily: { apiKey: input.apiKeyTavily ?? '' },
|
|
169
|
+
},
|
|
170
|
+
...genContextLogTrail(),
|
|
171
|
+
...genContextStitchTrail(),
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
readme: `
|
|
176
|
+
# act
|
|
177
|
+
|
|
178
|
+
invokes the agentic brain loop to complete a task
|
|
179
|
+
|
|
180
|
+
## usage
|
|
181
|
+
|
|
182
|
+
\`\`\`bash
|
|
183
|
+
npx rhachet skills run act -t ./output.md "your task here"
|
|
184
|
+
\`\`\`
|
|
185
|
+
`.trim(),
|
|
186
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type GStitcher, type RoleContext, type Threads } from 'rhachet';
|
|
2
|
+
import type { Artifact } from 'rhachet-artifact';
|
|
3
|
+
import type { GitFile } from 'rhachet-artifact-git';
|
|
4
|
+
import type { BrainArch1Actor } from '../../../../domain.objects/BrainArch1/BrainArch1Actor';
|
|
5
|
+
import type { BrainArch1Context } from '../../../../domain.objects/BrainArch1/BrainArch1Context';
|
|
6
|
+
/**
|
|
7
|
+
* .what = stitcher type for the act skill
|
|
8
|
+
* .why = defines the input/output contract for agentic task completion
|
|
9
|
+
*/
|
|
10
|
+
export type StitcherAct = GStitcher<Threads<{
|
|
11
|
+
caller: RoleContext<'caller', {
|
|
12
|
+
ask: string;
|
|
13
|
+
art: {
|
|
14
|
+
result: Artifact<typeof GitFile>;
|
|
15
|
+
log: Artifact<typeof GitFile>;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
brain: RoleContext<'brain', {
|
|
19
|
+
actor: BrainArch1Actor;
|
|
20
|
+
systemPromptPath: string | null;
|
|
21
|
+
}>;
|
|
22
|
+
}>, BrainArch1Context & GStitcher['context']>;
|
|
23
|
+
/**
|
|
24
|
+
* .what = executes agentic task completion via brain invocation
|
|
25
|
+
* .why = enables llm with tools to autonomously complete tasks
|
|
26
|
+
*/
|
|
27
|
+
export declare const stepAct: import("rhachet").Stitcher<StitcherAct>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.stepAct = void 0;
|
|
27
|
+
const fs = __importStar(require("fs/promises"));
|
|
28
|
+
const rhachet_1 = require("rhachet");
|
|
29
|
+
const invokeBrainArch1_1 = require("../../../../domain.operations/brain.replic.arch1/core/invokeBrainArch1");
|
|
30
|
+
/**
|
|
31
|
+
* .what = step to invoke brain and persist results
|
|
32
|
+
* .why = core step for agentic task completion
|
|
33
|
+
*/
|
|
34
|
+
const stepInvokeBrain = new rhachet_1.StitchStepCompute({
|
|
35
|
+
form: 'COMPUTE',
|
|
36
|
+
readme: 'invokes brain agentic loop and persists results',
|
|
37
|
+
slug: '@[brain]<act>',
|
|
38
|
+
stitchee: 'brain',
|
|
39
|
+
invoke: async ({ threads }, context) => {
|
|
40
|
+
const { caller, brain } = threads;
|
|
41
|
+
// load custom system prompt if specified
|
|
42
|
+
let systemPrompt = brain.context.stash.actor.role.systemPrompt;
|
|
43
|
+
if (brain.context.stash.systemPromptPath) {
|
|
44
|
+
systemPrompt = await fs.readFile(brain.context.stash.systemPromptPath, 'utf-8');
|
|
45
|
+
}
|
|
46
|
+
// invoke the brain
|
|
47
|
+
const result = await (0, invokeBrainArch1_1.invokeBrainArch1)({
|
|
48
|
+
actor: {
|
|
49
|
+
...brain.context.stash.actor,
|
|
50
|
+
role: {
|
|
51
|
+
...brain.context.stash.actor.role,
|
|
52
|
+
systemPrompt,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
userInput: caller.context.stash.ask,
|
|
56
|
+
}, context);
|
|
57
|
+
// write result to output artifact
|
|
58
|
+
await caller.context.stash.art.result.set({
|
|
59
|
+
content: result.finalResponse ?? '',
|
|
60
|
+
});
|
|
61
|
+
// write execution log to log artifact
|
|
62
|
+
const logContent = [
|
|
63
|
+
`# brain act execution log`,
|
|
64
|
+
'',
|
|
65
|
+
`## summary`,
|
|
66
|
+
`- termination: ${result.terminationReason}`,
|
|
67
|
+
`- iterations: ${result.iterationCount}`,
|
|
68
|
+
`- tokens: ${result.totalTokenUsage.totalTokens}`,
|
|
69
|
+
'',
|
|
70
|
+
`## final response`,
|
|
71
|
+
'```',
|
|
72
|
+
result.finalResponse ?? '(no response)',
|
|
73
|
+
'```',
|
|
74
|
+
'',
|
|
75
|
+
result.error ? `## error\n${result.error}` : '',
|
|
76
|
+
]
|
|
77
|
+
.filter(Boolean)
|
|
78
|
+
.join('\n');
|
|
79
|
+
await caller.context.stash.art.log.set({ content: logContent });
|
|
80
|
+
return {
|
|
81
|
+
input: { ask: caller.context.stash.ask },
|
|
82
|
+
output: { content: result.finalResponse ?? '' },
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
/**
|
|
87
|
+
* .what = executes agentic task completion via brain invocation
|
|
88
|
+
* .why = enables llm with tools to autonomously complete tasks
|
|
89
|
+
*/
|
|
90
|
+
exports.stepAct = (0, rhachet_1.asStitcherFlat)((0, rhachet_1.genStitchRoute)({
|
|
91
|
+
slug: '@[brain]<act>',
|
|
92
|
+
readme: '@[brain]<act> -> agentic task completion',
|
|
93
|
+
sequence: [stepInvokeBrain],
|
|
94
|
+
}));
|
|
95
|
+
//# sourceMappingURL=stepAct.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepAct.js","sourceRoot":"","sources":["../../../../../src/roles/brain/skills/act/stepAct.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,qCAOiB;AAMjB,sGAAmG;AA6BnG;;;GAGG;AACH,MAAM,eAAe,GAAG,IAAI,2BAAiB,CAAc;IACzD,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,iDAAiD;IACzD,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE;QACrC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAElC,yCAAyC;QACzC,IAAI,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC;QAC/D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;YACzC,YAAY,GAAG,MAAM,EAAE,CAAC,QAAQ,CAC9B,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,EACpC,OAAO,CACR,CAAC;QACJ,CAAC;QAED,mBAAmB;QACnB,MAAM,MAAM,GAAG,MAAM,IAAA,mCAAgB,EACnC;YACE,KAAK,EAAE;gBACL,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK;gBAC5B,IAAI,EAAE;oBACJ,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI;oBACjC,YAAY;iBACb;aACF;YACD,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG;SAC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