agency-lang 0.21.1 → 0.23.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/lib/agents/agency-agent/brains/coordinator/coordinator.agency +2 -0
- package/dist/lib/agents/agency-agent/brains/coordinator/coordinator.js +9 -7
- package/dist/lib/agents/agency-agent/brains/coordinator/learn.agency +1 -1
- package/dist/lib/agents/agency-agent/brains/coordinator/learn.js +4 -4
- package/dist/lib/agents/agency-agent/brains/coordinator/prompts/main-large.md +11 -1
- package/dist/lib/agents/agency-agent/brains/coordinator/prompts/main-small.md +4 -0
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency +4 -0
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/code.js +15 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.agency +2 -0
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.js +7 -3
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency +2 -1
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/research.js +7 -5
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/review.agency +2 -1
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/review.js +10 -4
- package/dist/lib/agents/agency-agent/lib/capabilitiesUi.js +3 -3
- package/dist/lib/agents/agency-agent/lib/header.js +2 -2
- package/dist/lib/agents/agency-agent/lib/learned.js +4 -4
- package/dist/lib/agents/agency-agent/lib/modelRequest.js +3 -3
- package/dist/lib/agents/agency-agent/lib/policy.js +14 -14
- package/dist/lib/agents/agency-agent/lib/presets.js +7 -7
- package/dist/lib/agents/agency-agent/lib/repl.js +3 -3
- package/dist/lib/agents/agency-agent/lib/resolution.js +2 -2
- package/dist/lib/agents/agency-agent/lib/search.js +3 -3
- package/dist/lib/agents/agency-agent/lib/session.js +3 -3
- package/dist/lib/agents/agency-agent/lib/sessions.js +2 -2
- package/dist/lib/agents/agency-agent/lib/settings.js +12 -12
- package/dist/lib/agents/agency-agent/lib/slashCommands/policy.js +3 -3
- package/dist/lib/agents/agency-agent/lib/toolLimits.js +2 -2
- package/dist/lib/agents/agency-agent/lib/turn.js +2 -2
- package/dist/lib/agents/agency-agent/shared.js +3 -3
- package/dist/lib/analysis/bodyFacts.d.ts +31 -0
- package/dist/lib/analysis/bodyFacts.js +57 -1
- package/dist/lib/analysis/effects.js +20 -12
- package/dist/lib/analysis/interrupts.d.ts +4 -0
- package/dist/lib/analysis/interrupts.js +28 -37
- package/dist/lib/backends/agencyGenerator.js +11 -2
- package/dist/lib/backends/typescriptBuilder/nodeWrapperParams.d.ts +14 -11
- package/dist/lib/backends/typescriptBuilder/nodeWrapperParams.js +40 -16
- package/dist/lib/backends/typescriptBuilder.d.ts +3 -0
- package/dist/lib/backends/typescriptBuilder.js +23 -7
- package/dist/lib/backends/typescriptGenerator/validationDescriptor.d.ts +5 -0
- package/dist/lib/backends/typescriptGenerator/validationDescriptor.js +7 -0
- package/dist/lib/cli/doc.js +4 -4
- package/dist/lib/cli/docLedger.d.ts +3 -0
- package/dist/lib/cli/docLedger.js +8 -3
- package/dist/lib/cli/interrupts.js +6 -0
- package/dist/lib/cli/localFlag.d.ts +1 -1
- package/dist/lib/cli/localFlag.js +19 -2
- package/dist/lib/cli/localServe.d.ts +71 -6
- package/dist/lib/cli/localServe.js +120 -24
- package/dist/lib/cli/logsView.d.ts +10 -4
- package/dist/lib/cli/logsView.js +26 -4
- package/dist/lib/cli/mlxChatServer.py +911 -0
- package/dist/lib/cli/mlxServer.d.ts +9 -2
- package/dist/lib/cli/mlxServer.js +26 -5
- package/dist/lib/cli/remote/commands/logs.js +5 -1
- package/dist/lib/compilationUnit.d.ts +3 -1
- package/dist/lib/compilationUnit.js +32 -25
- package/dist/lib/compiler/buildManifest.d.ts +18 -1
- package/dist/lib/compiler/buildManifest.js +58 -13
- package/dist/lib/compiler/compile.js +20 -67
- package/dist/lib/compiler/compileClosure.js +13 -0
- package/dist/lib/compiler/compileSandboxed.d.ts +3 -2
- package/dist/lib/compiler/compileValidatedClosure.d.ts +11 -2
- package/dist/lib/compiler/compileValidatedClosure.js +9 -7
- package/dist/lib/compiler/importCycle.d.ts +9 -0
- package/dist/lib/compiler/importCycle.js +57 -0
- package/dist/lib/compiler/initDepGraph.js +20 -1
- package/dist/lib/compiler/manifestTracker.d.ts +3 -0
- package/dist/lib/compiler/manifestTracker.js +10 -5
- package/dist/lib/compiler/prepareProgram.d.ts +90 -0
- package/dist/lib/compiler/prepareProgram.js +200 -0
- package/dist/lib/compiler/splice/eligibility.d.ts +11 -0
- package/dist/lib/compiler/splice/eligibility.js +11 -0
- package/dist/lib/compiler/splice/runGenerator.js +19 -11
- package/dist/lib/compiler/typecheck.d.ts +5 -0
- package/dist/lib/compiler/typecheck.js +46 -48
- package/dist/lib/config/config.d.ts +16 -2
- package/dist/lib/config/config.js +18 -0
- package/dist/lib/eval/extract.js +4 -1
- package/dist/lib/eval/types.d.ts +8 -1
- package/dist/lib/importResolutionError.d.ts +3 -0
- package/dist/lib/importResolutionError.js +7 -3
- package/dist/lib/logsViewer/detailTarget.d.ts +4 -0
- package/dist/lib/logsViewer/detailTarget.js +15 -0
- package/dist/lib/logsViewer/escLadder.d.ts +18 -0
- package/dist/lib/logsViewer/escLadder.js +25 -0
- package/dist/lib/logsViewer/forest.d.ts +22 -0
- package/dist/lib/logsViewer/forest.js +79 -0
- package/dist/lib/logsViewer/format.d.ts +4 -0
- package/dist/lib/logsViewer/format.js +36 -0
- package/dist/lib/logsViewer/keymap.d.ts +5 -0
- package/dist/lib/logsViewer/keymap.js +5 -0
- package/dist/lib/logsViewer/messageDelta.d.ts +17 -0
- package/dist/lib/logsViewer/messageDelta.js +45 -0
- package/dist/lib/logsViewer/overviewData.d.ts +10 -0
- package/dist/lib/logsViewer/overviewData.js +14 -0
- package/dist/lib/logsViewer/payload.d.ts +33 -0
- package/dist/lib/logsViewer/payload.js +212 -0
- package/dist/lib/logsViewer/roundInputPayload.d.ts +5 -0
- package/dist/lib/logsViewer/roundInputPayload.js +62 -0
- package/dist/lib/logsViewer/run.d.ts +16 -1
- package/dist/lib/logsViewer/run.js +353 -132
- package/dist/lib/logsViewer/screenHost.d.ts +35 -0
- package/dist/lib/logsViewer/screenHost.js +103 -0
- package/dist/lib/logsViewer/screens/charts.d.ts +12 -0
- package/dist/lib/logsViewer/screens/charts.js +54 -0
- package/dist/lib/logsViewer/screens/chrome.d.ts +19 -0
- package/dist/lib/logsViewer/screens/chrome.js +59 -0
- package/dist/lib/logsViewer/screens/lineNumbers.d.ts +7 -0
- package/dist/lib/logsViewer/screens/lineNumbers.js +26 -0
- package/dist/lib/logsViewer/screens/overviewCharts.d.ts +7 -0
- package/dist/lib/logsViewer/screens/overviewCharts.js +151 -0
- package/dist/lib/logsViewer/screens/overviewScreen.d.ts +48 -0
- package/dist/lib/logsViewer/screens/overviewScreen.js +338 -0
- package/dist/lib/logsViewer/screens/payloadPaint.d.ts +3 -0
- package/dist/lib/logsViewer/screens/payloadPaint.js +60 -0
- package/dist/lib/logsViewer/screens/screen.d.ts +12 -0
- package/dist/lib/logsViewer/screens/screen.js +6 -0
- package/dist/lib/logsViewer/{views/flameView.d.ts → screens/timelineScreen.d.ts} +34 -8
- package/dist/lib/logsViewer/screens/timelineScreen.js +586 -0
- package/dist/lib/logsViewer/screens/tracePicker.d.ts +43 -0
- package/dist/lib/logsViewer/screens/tracePicker.js +254 -0
- package/dist/lib/logsViewer/screens/traceScreen.d.ts +74 -0
- package/dist/lib/logsViewer/screens/traceScreen.js +697 -0
- package/dist/lib/logsViewer/screens/transcriptScreen.d.ts +49 -0
- package/dist/lib/logsViewer/screens/transcriptScreen.js +355 -0
- package/dist/lib/logsViewer/spanText.d.ts +4 -4
- package/dist/lib/logsViewer/spanText.js +24 -21
- package/dist/lib/logsViewer/story.d.ts +87 -0
- package/dist/lib/logsViewer/story.js +297 -0
- package/dist/lib/logsViewer/storyFixture.d.ts +5 -0
- package/dist/lib/logsViewer/storyFixture.js +65 -0
- package/dist/lib/logsViewer/structured.d.ts +7 -0
- package/dist/lib/logsViewer/structured.js +33 -0
- package/dist/lib/logsViewer/summary.d.ts +0 -3
- package/dist/lib/logsViewer/summary.js +3 -41
- package/dist/lib/logsViewer/theme.d.ts +28 -0
- package/dist/lib/logsViewer/theme.js +44 -0
- package/dist/lib/logsViewer/thresholds.js +4 -4
- package/dist/lib/logsViewer/timeline/groups.d.ts +9 -8
- package/dist/lib/logsViewer/timeline/groups.js +50 -53
- package/dist/lib/logsViewer/timeline/rounds.d.ts +37 -0
- package/dist/lib/logsViewer/timeline/rounds.js +82 -0
- package/dist/lib/logsViewer/timeline/rows.d.ts +19 -0
- package/dist/lib/logsViewer/timeline/rows.js +98 -0
- package/dist/lib/logsViewer/timeline/spans.d.ts +3 -0
- package/dist/lib/logsViewer/timeline/spans.js +40 -22
- package/dist/lib/logsViewer/traceFixture.d.ts +8 -0
- package/dist/lib/logsViewer/traceFixture.js +35 -0
- package/dist/lib/logsViewer/traceSearch.d.ts +22 -0
- package/dist/lib/logsViewer/traceSearch.js +60 -0
- package/dist/lib/logsViewer/traceSummaries.d.ts +13 -0
- package/dist/lib/logsViewer/traceSummaries.js +24 -0
- package/dist/lib/logsViewer/transcript.d.ts +41 -0
- package/dist/lib/logsViewer/transcript.js +227 -0
- package/dist/lib/logsViewer/transcriptPayload.d.ts +3 -0
- package/dist/lib/logsViewer/transcriptPayload.js +81 -0
- package/dist/lib/logsViewer/tree.js +6 -19
- package/dist/lib/logsViewer/types.d.ts +1 -15
- package/dist/lib/logsViewer/views/detailScreen.d.ts +13 -9
- package/dist/lib/logsViewer/views/detailScreen.js +82 -130
- package/dist/lib/logsViewer/views/occurrencesView.d.ts +6 -1
- package/dist/lib/logsViewer/views/occurrencesView.js +70 -58
- package/dist/lib/logsViewer/views/shared.d.ts +1 -5
- package/dist/lib/logsViewer/views/shared.js +7 -11
- package/dist/lib/logsViewer/views/view.d.ts +15 -13
- package/dist/lib/logsViewer/views/view.js +6 -5
- package/dist/lib/lsp/builtinHover.js +3 -0
- package/dist/lib/lsp/diagnostics.js +62 -180
- package/dist/lib/parser.js +32 -15
- package/dist/lib/parsers/messages.d.ts +7 -1
- package/dist/lib/parsers/messages.js +18 -1
- package/dist/lib/parsers/parsers.d.ts +15 -0
- package/dist/lib/parsers/parsers.js +185 -44
- package/dist/lib/parsers/reservedNames.cases.d.ts +6 -0
- package/dist/lib/parsers/reservedNames.cases.js +53 -0
- package/dist/lib/parsers/vitest.setup.js +2 -2
- package/dist/lib/preprocessors/expandSplices.js +26 -1
- package/dist/lib/preprocessors/hoistCalls.d.ts +7 -3
- package/dist/lib/preprocessors/hoistCalls.js +38 -20
- package/dist/lib/preprocessors/hoistPositions.d.ts +33 -0
- package/dist/lib/preprocessors/hoistPositions.js +93 -0
- package/dist/lib/preprocessors/importResolver.d.ts +1 -0
- package/dist/lib/preprocessors/importResolver.js +25 -4
- package/dist/lib/preprocessors/liftCallbacks.d.ts +16 -0
- package/dist/lib/preprocessors/liftCallbacks.js +63 -52
- package/dist/lib/preprocessors/typescriptPreprocessor.js +16 -1
- package/dist/lib/reservedNames.d.ts +10 -0
- package/dist/lib/reservedNames.js +22 -0
- package/dist/lib/runDirectory/annotations.d.ts +1 -1
- package/dist/lib/runsExplorer/run.d.ts +2 -0
- package/dist/lib/runsExplorer/run.js +1 -0
- package/dist/lib/runtime/abortedResult.d.ts +4 -0
- package/dist/lib/runtime/abortedResult.js +8 -0
- package/dist/lib/runtime/index.d.ts +1 -1
- package/dist/lib/runtime/localDefaults.d.ts +56 -0
- package/dist/lib/runtime/localDefaults.js +129 -0
- package/dist/lib/runtime/prompt.js +8 -3
- package/dist/lib/runtime/state/messageThread.d.ts +1 -0
- package/dist/lib/runtime/state/messageThread.js +4 -0
- package/dist/lib/runtime/state/schemas.d.ts +6 -0
- package/dist/lib/runtime/state/schemas.js +1 -0
- package/dist/lib/runtime/template/fill.js +6 -0
- package/dist/lib/runtime/template/hygiene.d.ts +2 -1
- package/dist/lib/runtime/template/hygiene.js +4 -2
- package/dist/lib/runtime/threadRepair.js +5 -0
- package/dist/lib/statelog/wireAccessors.d.ts +37 -4
- package/dist/lib/statelog/wireAccessors.js +130 -9
- package/dist/lib/statelogClient.d.ts +5 -1
- package/dist/lib/statelogClient.js +3 -1
- package/dist/lib/stdlib/agency.d.ts +2 -2
- package/dist/lib/stdlib/agency.js +59 -7
- package/dist/lib/stdlib/cli.d.ts +5 -1
- package/dist/lib/stdlib/cli.js +5 -3
- package/dist/lib/stdlib/llm.d.ts +6 -0
- package/dist/lib/stdlib/modelCatalog.js +80 -0
- package/dist/lib/stdlib/speech.d.ts +1 -1
- package/dist/lib/stdlib/speech.js +3 -1
- package/dist/lib/symbolTable.d.ts +6 -0
- package/dist/lib/symbolTable.js +12 -0
- package/dist/lib/templates/backends/typescriptGenerator/finalizeClosure.d.ts +1 -1
- package/dist/lib/templates/backends/typescriptGenerator/finalizeClosure.js +1 -1
- package/dist/lib/tui/index.d.ts +2 -0
- package/dist/lib/tui/index.js +2 -0
- package/dist/lib/tui/input/terminal.js +5 -0
- package/dist/lib/tui/keymap.d.ts +25 -0
- package/dist/lib/tui/keymap.js +45 -0
- package/dist/lib/tui/paint.d.ts +38 -0
- package/dist/lib/tui/paint.js +108 -0
- package/dist/lib/tui/table.d.ts +5 -4
- package/dist/lib/tui/table.js +15 -24
- package/dist/lib/typeChecker/castPositions.d.ts +2 -0
- package/dist/lib/typeChecker/castPositions.js +53 -0
- package/dist/lib/typeChecker/castTestUtils.d.ts +6 -0
- package/dist/lib/typeChecker/castTestUtils.js +10 -0
- package/dist/lib/typeChecker/checker.d.ts +0 -2
- package/dist/lib/typeChecker/checker.js +2 -9
- package/dist/lib/typeChecker/diagnosticExplanations.js +44 -1
- package/dist/lib/typeChecker/diagnostics.d.ts +56 -1
- package/dist/lib/typeChecker/diagnostics.js +56 -1
- package/dist/lib/typeChecker/flow.js +2 -42
- package/dist/lib/typeChecker/index.d.ts +1 -0
- package/dist/lib/typeChecker/index.js +5 -1
- package/dist/lib/typeChecker/interruptAnalysis.js +48 -23
- package/dist/lib/typeChecker/nameReferences.d.ts +5 -0
- package/dist/lib/typeChecker/nameReferences.js +5 -4
- package/dist/lib/typeChecker/narrowing.d.ts +6 -2
- package/dist/lib/typeChecker/narrowing.js +38 -15
- package/dist/lib/typeChecker/resolveCall.d.ts +5 -1
- package/dist/lib/typeChecker/resolveCall.js +4 -0
- package/dist/lib/typeChecker/resolvePath.d.ts +12 -0
- package/dist/lib/typeChecker/resolvePath.js +44 -0
- package/dist/lib/typeChecker/sandboxNameCheck.js +9 -0
- package/dist/lib/typeChecker/scope.d.ts +9 -0
- package/dist/lib/typeChecker/scope.js +22 -0
- package/dist/lib/typeChecker/scopes.js +18 -2
- package/dist/lib/typeChecker/staticInitRules.d.ts +19 -0
- package/dist/lib/typeChecker/staticInitRules.js +50 -5
- package/dist/lib/typeChecker/synthesizer.js +80 -7
- package/dist/lib/typeChecker/templateNames.js +9 -1
- package/dist/lib/typeChecker/toolBlockBinding.d.ts +12 -1
- package/dist/lib/typeChecker/toolBlockBinding.js +10 -6
- package/dist/lib/typeChecker/toolElementTypes.d.ts +4 -0
- package/dist/lib/typeChecker/toolElementTypes.js +55 -0
- package/dist/lib/typeChecker/undefinedVariableDiagnostic.d.ts +3 -0
- package/dist/lib/typeChecker/undefinedVariableDiagnostic.js +6 -0
- package/dist/lib/typeChecker/validateStaticInit.d.ts +2 -1
- package/dist/lib/typeChecker/validateStaticInit.js +4 -2
- package/dist/lib/typeChecker/valueArgReferences.js +2 -0
- package/dist/lib/types/binop.d.ts +3 -0
- package/dist/lib/types/binop.js +7 -0
- package/dist/lib/types/castExpression.d.ts +13 -0
- package/dist/lib/types/castExpression.js +1 -0
- package/dist/lib/types/function.d.ts +4 -1
- package/dist/lib/types.d.ts +4 -2
- package/dist/lib/types.js +2 -0
- package/dist/lib/utils/expressionSlots.js +4 -0
- package/dist/lib/utils/findReservedName.d.ts +5 -0
- package/dist/lib/utils/findReservedName.js +88 -0
- package/dist/lib/utils/identifierSlots.js +8 -5
- package/dist/lib/utils/moduleDoc.d.ts +12 -0
- package/dist/lib/utils/moduleDoc.js +22 -1
- package/dist/lib/utils/node.js +34 -0
- package/dist/lib/utils/topLevel.js +1 -0
- package/dist/scripts/agency.js +68 -24
- package/package.json +1 -1
- package/stdlib/agency.agency +10 -4
- package/stdlib/agency.js +44 -13
- package/stdlib/agent.agency +4 -1
- package/stdlib/agent.js +6 -3
- package/stdlib/agents/agency/coding.agency +40 -14
- package/stdlib/agents/agency/coding.js +238 -65
- package/stdlib/agents/agency/expert.js +2 -2
- package/stdlib/agents/agency/researcher.js +2 -2
- package/stdlib/agents/agency/review.agency +12 -5
- package/stdlib/agents/agency/review.js +89 -38
- package/stdlib/agents/agency/verifier.js +2 -2
- package/stdlib/agents/coding.agency +2 -1
- package/stdlib/agents/coding.js +6 -5
- package/stdlib/agents/data.agency +2 -2
- package/stdlib/agents/data.js +5 -4
- package/stdlib/agents/expert.js +2 -2
- package/stdlib/agents/explorer.agency +7 -5
- package/stdlib/agents/explorer.js +11 -9
- package/stdlib/agents/lib/toolkits.agency +15 -3
- package/stdlib/agents/lib/toolkits.js +19 -5
- package/stdlib/agents/oracle.js +2 -2
- package/stdlib/agents/planner.agency +2 -2
- package/stdlib/agents/planner.js +4 -3
- package/stdlib/agents/prompts/agency-tutorial.md +21 -1
- package/stdlib/agents/researcher.agency +3 -3
- package/stdlib/agents/researcher.js +6 -5
- package/stdlib/agents/review.agency +2 -2
- package/stdlib/agents/review.js +5 -4
- package/stdlib/agents/typescript/review.agency +2 -1
- package/stdlib/agents/typescript/review.js +6 -5
- package/stdlib/agents/verifier.agency +2 -2
- package/stdlib/agents/verifier.js +4 -3
- package/stdlib/agents/writing/review.agency +2 -1
- package/stdlib/agents/writing/review.js +6 -5
- package/stdlib/docs/cli/local.md +2 -2
- package/stdlib/docs/diagnostics/index.md +12 -1
- package/stdlib/docs/diagnostics/names.md +12 -0
- package/stdlib/docs/diagnostics/static-init.md +12 -0
- package/stdlib/docs/diagnostics/templates.md +16 -2
- package/stdlib/docs/diagnostics/tools.md +12 -0
- package/stdlib/docs/diagnostics/types-aliases.md +70 -0
- package/stdlib/docs/guide/observability.md +101 -49
- package/stdlib/docs/guide/using-local-models.md +160 -9
- package/stdlib/docs/stdlib/agency.md +51 -43
- package/stdlib/docs/stdlib/agent.md +4 -1
- package/stdlib/docs/stdlib/agents/agency/coding.md +21 -2
- package/stdlib/docs/stdlib/agents/agency/review.md +3 -0
- package/stdlib/docs/stdlib/agents/coding.md +2 -2
- package/stdlib/docs/stdlib/agents/explorer.md +4 -4
- package/stdlib/docs/stdlib/agents/lib/toolkits.md +30 -15
- package/stdlib/docs/stdlib/agents/oracle.md +2 -2
- package/stdlib/docs/stdlib/agents/typescript/review.md +3 -3
- package/stdlib/docs/stdlib/agents/writing/review.md +3 -3
- package/stdlib/docs/stdlib/agents/writing/rewrite.md +13 -13
- package/stdlib/docs/stdlib/fs.md +4 -4
- package/stdlib/docs/stdlib/llm.md +28 -17
- package/stdlib/docs/stdlib/math.md +9 -8
- package/stdlib/docs/stdlib/memory.md +24 -24
- package/stdlib/docs/stdlib/policy.md +228 -228
- package/stdlib/docs/stdlib/safeBash/actions.md +9 -9
- package/stdlib/docs/stdlib/safeBash.md +5 -5
- package/stdlib/docs/stdlib/shell.md +6 -6
- package/stdlib/docs/stdlib/speech.md +19 -15
- package/stdlib/docs/stdlib/statelog.md +14 -14
- package/stdlib/docs/stdlib/syntax.md +12 -12
- package/stdlib/docs/stdlib/thread.md +13 -13
- package/stdlib/docs/stdlib/toolbox.md +23 -20
- package/stdlib/docs/stdlib/ui/cli.md +7 -4
- package/stdlib/docs/stdlib/ui/layout.md +5 -5
- package/stdlib/docs/stdlib/ui/table.md +16 -16
- package/stdlib/docs/stdlib/ui.md +93 -93
- package/stdlib/llm.agency +7 -1
- package/stdlib/llm.js +3 -3
- package/stdlib/math.agency +4 -3
- package/stdlib/math.js +10 -8
- package/stdlib/policy.agency +36 -8
- package/stdlib/policy.js +267 -15
- package/stdlib/speech.agency +5 -0
- package/stdlib/speech.js +22 -7
- package/stdlib/toolbox.agency +220 -45
- package/stdlib/toolbox.js +1829 -693
- package/stdlib/ui/cli.agency +3 -1
- package/stdlib/ui/cli.js +21 -7
- package/dist/lib/logsViewer/conversation.d.ts +0 -22
- package/dist/lib/logsViewer/conversation.js +0 -147
- package/dist/lib/logsViewer/help.d.ts +0 -9
- package/dist/lib/logsViewer/help.js +0 -62
- package/dist/lib/logsViewer/search.d.ts +0 -8
- package/dist/lib/logsViewer/search.js +0 -167
- package/dist/lib/logsViewer/treeRows.d.ts +0 -23
- package/dist/lib/logsViewer/treeRows.js +0 -400
- package/dist/lib/logsViewer/views/byNameView.d.ts +0 -49
- package/dist/lib/logsViewer/views/byNameView.js +0 -284
- package/dist/lib/logsViewer/views/flameView.js +0 -389
- package/dist/lib/logsViewer/views/treeReducer.d.ts +0 -15
- package/dist/lib/logsViewer/views/treeReducer.js +0 -229
- package/dist/lib/logsViewer/views/treeView.d.ts +0 -50
- package/dist/lib/logsViewer/views/treeView.js +0 -292
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
and lib/) owns the CLI, the REPL, the policy handler, and the per-turn
|
|
5
5
|
guard; this module only answers turns.
|
|
6
6
|
*/
|
|
7
|
+
import { question } from "std::agent"
|
|
7
8
|
import { readOnlyFileTools, whatIAmDoing } from "std::agents/lib/toolkits"
|
|
8
9
|
import { now, elapsedTime } from "std::date"
|
|
9
10
|
import { edit } from "std::fs"
|
|
@@ -116,6 +117,7 @@ export def turnTools(turnStart: any): any[] {
|
|
|
116
117
|
...getMcpTools(),
|
|
117
118
|
...learnedExtras(),
|
|
118
119
|
whatIAmDoing,
|
|
120
|
+
question,
|
|
119
121
|
elapsedTime.partial(since: turnStart),
|
|
120
122
|
]
|
|
121
123
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { print, printJSON, input, sleep, saveDraft, _guard, _pairsOf, read, write, writeBinary, readBinary, range, callback, map, mapWithIndex, filter, exclude, find, findIndex, reduce, flatMap, every, some, count, sortBy, unique, groupBy, flatten, setAgentCwd, getAgentCwd, applyAgentCwd } from "agency-lang/stdlib/index.js";
|
|
2
|
+
import { question } from "agency-lang/stdlib/agent.js";
|
|
2
3
|
import { readOnlyFileTools, whatIAmDoing } from "agency-lang/stdlib/agents/lib/toolkits.js";
|
|
3
4
|
import { now, elapsedTime } from "agency-lang/stdlib/date.js";
|
|
4
5
|
import { edit } from "agency-lang/stdlib/fs.js";
|
|
@@ -184,7 +185,7 @@ function registerTools(tools) {
|
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
|
-
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency", "
|
|
188
|
+
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency", "637cbc310ff860e34bf311e1ea3d6b81eeea5234db92e0dbd3f114ce77a97de6", import.meta.url);
|
|
188
189
|
__registerTool(print);
|
|
189
190
|
__registerTool(printJSON);
|
|
190
191
|
__registerTool(input);
|
|
@@ -216,6 +217,7 @@ __registerTool(flatten);
|
|
|
216
217
|
__registerTool(setAgentCwd);
|
|
217
218
|
__registerTool(getAgentCwd);
|
|
218
219
|
__registerTool(applyAgentCwd);
|
|
220
|
+
__registerTool(question);
|
|
219
221
|
__registerTool(readOnlyFileTools);
|
|
220
222
|
__registerTool(whatIAmDoing);
|
|
221
223
|
__registerTool(now);
|
|
@@ -290,10 +292,10 @@ async function __initializeStatic(__ctx) {
|
|
|
290
292
|
} finally {
|
|
291
293
|
getRuntimeContext().ctx.popHandler();
|
|
292
294
|
}
|
|
293
|
-
mainAgentTools = __deepFreeze([__readStatic(researchAgent, "researchAgent", "/Users/
|
|
295
|
+
mainAgentTools = __deepFreeze([__readStatic(researchAgent, "researchAgent", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency"), __readStatic(codeAgent, "codeAgent", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency"), __readStatic(reviewAgent, "reviewAgent", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/review.agency"), __readStatic(oracleAgent, "oracleAgent", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.agency"), __readStatic(explorerAgent, "explorerAgent", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/explorer.agency"), __readStatic(writingAgent, "writingAgent", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/writing.agency"), __readStatic(rewriteAgent, "rewriteAgent", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/rewrite.agency"), __readStatic(generateImageFile, "generateImageFile", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/lib/images.agency"), __readStatic(viewImageFile, "viewImageFile", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/lib/images.agency"), __readStatic(learnSkill, "learnSkill", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/learn.agency"), __readStatic(writeToolFor, "writeToolFor", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/learn.agency"), __readStatic(coordinatorSkills, "coordinatorSkills", "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency"), __readStatic(listPresets, "listPresets", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/presetTools.agency"), __readStatic(savePreset, "savePreset", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/presetTools.agency"), __readStatic(deletePreset, "deletePreset", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/presetTools.agency"), __readStatic(setDefaultPreset, "setDefaultPreset", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/presetTools.agency"), ...await __call(readOnlyFileTools, {
|
|
294
296
|
type: "positional",
|
|
295
297
|
args: []
|
|
296
|
-
}), await __callMethod(__readStatic(edit, "edit", "/Users/
|
|
298
|
+
}), await __callMethod(__readStatic(edit, "edit", "/Users/adit/agency-lang/packages/agency-lang/stdlib/fs.agency"), "partial", {
|
|
297
299
|
type: "named",
|
|
298
300
|
positionalArgs: [],
|
|
299
301
|
namedArgs: {
|
|
@@ -635,7 +637,7 @@ async function __coordinatorInit_impl(context) {
|
|
|
635
637
|
await runner.step(5, async (runner2) => {
|
|
636
638
|
__stack.locals.__hoist_4 = await __call(checkBundledSkill, {
|
|
637
639
|
type: "positional",
|
|
638
|
-
args: [__readStatic(superpowersSkill, "superpowersSkill", "/Users/
|
|
640
|
+
args: [__readStatic(superpowersSkill, "superpowersSkill", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency"), `brainstorming`]
|
|
639
641
|
});
|
|
640
642
|
if (hasInterrupts(__stack.locals.__hoist_4)) {
|
|
641
643
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
@@ -852,7 +854,7 @@ async function __turnTools_impl(turnStart) {
|
|
|
852
854
|
}
|
|
853
855
|
});
|
|
854
856
|
await runner.step(3, async (runner2) => {
|
|
855
|
-
__stack.locals.__hoist_2 = await __callMethod(__readStatic(elapsedTime, "elapsedTime", "/Users/
|
|
857
|
+
__stack.locals.__hoist_2 = await __callMethod(__readStatic(elapsedTime, "elapsedTime", "/Users/adit/agency-lang/packages/agency-lang/stdlib/date.agency"), "partial", {
|
|
856
858
|
type: "named",
|
|
857
859
|
positionalArgs: [],
|
|
858
860
|
namedArgs: {
|
|
@@ -862,7 +864,7 @@ async function __turnTools_impl(turnStart) {
|
|
|
862
864
|
});
|
|
863
865
|
await runner.step(4, async (runner2) => {
|
|
864
866
|
__functionCompleted = true;
|
|
865
|
-
runner2.halt([...__readStatic(mainAgentTools, "mainAgentTools", "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency"), ...__stack.locals.__hoist_0, ...__stack.locals.__hoist_1, __readStatic(whatIAmDoing, "whatIAmDoing", "/Users/
|
|
867
|
+
runner2.halt([...__readStatic(mainAgentTools, "mainAgentTools", "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency"), ...__stack.locals.__hoist_0, ...__stack.locals.__hoist_1, __readStatic(whatIAmDoing, "whatIAmDoing", "/Users/adit/agency-lang/packages/agency-lang/stdlib/agents/lib/toolkits.agency"), __readStatic(question, "question", "/Users/adit/agency-lang/packages/agency-lang/stdlib/agent.agency"), __stack.locals.__hoist_2]);
|
|
866
868
|
return;
|
|
867
869
|
});
|
|
868
870
|
});
|
|
@@ -2482,7 +2484,7 @@ const coordinatorBrain = __AgencyFunction.create({
|
|
|
2482
2484
|
exported: true
|
|
2483
2485
|
}, __toolRegistry);
|
|
2484
2486
|
var stdin_default = graph;
|
|
2485
|
-
const __sourceMap = { "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:exitIfBroken": { "1": { "line":
|
|
2487
|
+
const __sourceMap = { "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:exitIfBroken": { "1": { "line": 79, "col": 2 }, "2": { "line": 80, "col": 4 }, "3": { "line": 79, "col": 2 }, "3.0": { "line": 79, "col": 2 }, "3.1": { "line": 81, "col": 12 }, "3.2": { "line": 81, "col": 6 }, "3.3": { "line": 82, "col": 6 }, "3.4": { "line": 84, "col": 9 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:coordinatorInit": { "1": { "line": 89, "col": 6 }, "2": { "line": 89, "col": 2 }, "3": { "line": 95, "col": 6 }, "4": { "line": 95, "col": 2 }, "5": { "line": 101, "col": 15 }, "6": { "line": 101, "col": 2 }, "7": { "line": 102, "col": 15 }, "8": { "line": 102, "col": 2 }, "9": { "line": 103, "col": 2 }, "10": { "line": 104, "col": 2 }, "11": { "line": 107, "col": 2 }, "2.0": { "line": 91, "col": 6 }, "2.1": { "line": 90, "col": 4 }, "2.2": { "line": 93, "col": 4 }, "4.0": { "line": 97, "col": 6 }, "4.1": { "line": 96, "col": 4 }, "4.2": { "line": 99, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:turnTools": { "1": { "line": 116, "col": 7 }, "2": { "line": 117, "col": 7 }, "3": { "line": 120, "col": 4 }, "4": { "line": 114, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:mainAgent": { "2": { "line": 128, "col": 2 }, "3": { "line": 129, "col": 2 }, "4": { "line": 155, "col": 2 }, "3.0": { "line": 130, "col": 4 }, "3.1.1": { "line": 132, "col": 6 }, "3.1.2": { "line": 133, "col": 24 }, "3.1.3": { "line": 133, "col": 6 }, "3.1.4": { "line": 137, "col": 6 }, "3.1.5": { "line": 138, "col": 6 }, "3.1": { "line": 131, "col": 4 }, "3.3": { "line": 146, "col": 13 }, "3.4": { "line": 144, "col": 4 }, "3.5": { "line": 148, "col": 4 }, "3.6.0": { "line": 150, "col": 6 }, "3.6.1": { "line": 151, "col": 6 }, "3.6": { "line": 149, "col": 4 }, "3.7": { "line": 153, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:promptText": { "1": { "line": 161, "col": 9 }, "2": { "line": 161, "col": 9 }, "3": { "line": 161, "col": 2 }, "2.0": { "line": 161, "col": 9 }, "2.1": { "line": 162, "col": 20 }, "2.2": { "line": 162, "col": 20 }, "2.3": { "line": 161, "col": 9 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:replyText": { "1": { "line": 169, "col": 6 }, "2": { "line": 169, "col": 2 }, "3": { "line": 172, "col": 2 }, "2.0": { "line": 170, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:researchTurn": { "1": { "line": 176, "col": 37 }, "2": { "line": 176, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:oracleTurn": { "1": { "line": 184, "col": 2 }, "2": { "line": 185, "col": 2 }, "3": { "line": 188, "col": 2 }, "2.0": { "line": 186, "col": 36 }, "2.1": { "line": 186, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:explorerTurn": { "1": { "line": 192, "col": 2 }, "2": { "line": 193, "col": 2 }, "3": { "line": 196, "col": 2 }, "2.0": { "line": 194, "col": 38 }, "2.1": { "line": 194, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:coordinatorRunTurn": { "1": { "line": 203, "col": 9 }, "2": { "line": 203, "col": 2 }, "1.0": { "line": 204, "col": 24 }, "1.1": { "line": 204, "col": 14 }, "1.2": { "line": 204, "col": 14 }, "1.3": { "line": 205, "col": 31 }, "1.4": { "line": 205, "col": 18 }, "1.5": { "line": 205, "col": 18 }, "1.6": { "line": 206, "col": 27 }, "1.7": { "line": 206, "col": 16 }, "1.8": { "line": 206, "col": 16 }, "1.9": { "line": 207, "col": 31 }, "1.10": { "line": 207, "col": 18 }, "1.11": { "line": 207, "col": 18 }, "1.12": { "line": 208, "col": 28 }, "1.13": { "line": 208, "col": 16 }, "1.14": { "line": 208, "col": 16 }, "1.15": { "line": 209, "col": 30 }, "1.16": { "line": 209, "col": 17 }, "1.17": { "line": 209, "col": 17 }, "1.18": { "line": 210, "col": 30 }, "1.19": { "line": 210, "col": 17 }, "1.20": { "line": 210, "col": 17 }, "1.21": { "line": 211, "col": 9 }, "1.22": { "line": 211, "col": 9 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:coordinatorBrain": { "1": { "line": 216, "col": 2 } } };
|
|
2486
2488
|
export {
|
|
2487
2489
|
__getCheckpoints,
|
|
2488
2490
|
__invokeFunction,
|
|
@@ -44,7 +44,7 @@ export def writeToolFor(name: string, purpose: string, request: string): string
|
|
|
44
44
|
model calls. In a one-shot run nothing is saved.
|
|
45
45
|
|
|
46
46
|
@param name - camelCase name: a lowercase letter, then letters and digits
|
|
47
|
-
@param purpose - What the tool should do, in plain language
|
|
47
|
+
@param purpose - What the tool should do, in plain language. State only what the user said; ask the user first for anything the tool needs that they have not told you
|
|
48
48
|
@param request - The tool's input type as Agency type text, such as { topics: string[]; maxItems: number }
|
|
49
49
|
"""
|
|
50
50
|
const cap = maxLearnedToolName()
|
|
@@ -154,7 +154,7 @@ function registerTools(tools) {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/learn.agency", "
|
|
157
|
+
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/learn.agency", "fc4168c2349369ee75d89a4b09c4d06e321b25f1a4f0ebb9a3f57443c0ce713d", import.meta.url);
|
|
158
158
|
__registerTool(print);
|
|
159
159
|
__registerTool(printJSON);
|
|
160
160
|
__registerTool(input);
|
|
@@ -484,7 +484,7 @@ async function __writeToolFor_impl(name, purpose, request) {
|
|
|
484
484
|
body: async (runner2) => {
|
|
485
485
|
await runner2.step(0, async (runner3) => {
|
|
486
486
|
__functionCompleted = true;
|
|
487
|
-
runner3.halt(`Not saved: the name must be at most ${__stack.locals.cap} characters, because the tool is offered as ${__readStatic(LEARNED_TOOL_PREFIX, "LEARNED_TOOL_PREFIX", "/Users/
|
|
487
|
+
runner3.halt(`Not saved: the name must be at most ${__stack.locals.cap} characters, because the tool is offered as ${__readStatic(LEARNED_TOOL_PREFIX, "LEARNED_TOOL_PREFIX", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/lib/learned.agency")}${__stack.args.name} and providers cap a tool name at ${__readStatic(MAX_TOOL_NAME_LEN, "MAX_TOOL_NAME_LEN", "/Users/adit/agency-lang/packages/agency-lang/stdlib/skills.agency")}`);
|
|
488
488
|
return;
|
|
489
489
|
});
|
|
490
490
|
}
|
|
@@ -552,7 +552,7 @@ async function __writeToolFor_impl(name, purpose, request) {
|
|
|
552
552
|
]);
|
|
553
553
|
await runner.step(7, async (runner2) => {
|
|
554
554
|
__functionCompleted = true;
|
|
555
|
-
runner2.halt(`Saved the '${__stack.locals.saved.value.name}' tool to the learned catalog as ${__readStatic(LEARNED_TOOL_PREFIX, "LEARNED_TOOL_PREFIX", "/Users/
|
|
555
|
+
runner2.halt(`Saved the '${__stack.locals.saved.value.name}' tool to the learned catalog as ${__readStatic(LEARNED_TOOL_PREFIX, "LEARNED_TOOL_PREFIX", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/lib/learned.agency")}${__stack.locals.saved.value.name}.`);
|
|
556
556
|
return;
|
|
557
557
|
});
|
|
558
558
|
});
|
|
@@ -634,7 +634,7 @@ const writeToolFor = __AgencyFunction.create({
|
|
|
634
634
|
model calls. In a one-shot run nothing is saved.
|
|
635
635
|
|
|
636
636
|
@param name - camelCase name: a lowercase letter, then letters and digits
|
|
637
|
-
@param purpose - What the tool should do, in plain language
|
|
637
|
+
@param purpose - What the tool should do, in plain language. State only what the user said; ask the user first for anything the tool needs that they have not told you
|
|
638
638
|
@param request - The tool's input type as Agency type text, such as { topics: string[]; maxItems: number }`,
|
|
639
639
|
schema: z.object({ "name": z.string(), "purpose": z.string(), "request": z.string() })
|
|
640
640
|
},
|
|
@@ -116,6 +116,13 @@ name, the purpose, and the request type. The user reviews the complete
|
|
|
116
116
|
draft before anything is saved and can send feedback for another draft.
|
|
117
117
|
Never claim a skill or tool was saved unless the reply said so.
|
|
118
118
|
|
|
119
|
+
Before you call `writeToolFor`, list what the tool needs that the user
|
|
120
|
+
has not told you: an address, an account, a provider, the name of an
|
|
121
|
+
environment variable. Ask the user for those first, and put the answers
|
|
122
|
+
in the purpose. In the purpose, state only what the user said. Do not
|
|
123
|
+
call something "configured" or "existing" unless the user said it is:
|
|
124
|
+
the author will go looking for it.
|
|
125
|
+
|
|
119
126
|
A saved tool is in your tools as `learned_<name>`, and `learned_skills`
|
|
120
127
|
reads your saved skills. Both appear from the next turn on. When the
|
|
121
128
|
user asks for something one of them covers, call it rather than doing
|
|
@@ -170,7 +177,9 @@ When the user asks you to look at, debug, or change a file or some
|
|
|
170
177
|
code, look at it — read it yourself, or delegate changes to
|
|
171
178
|
`codeAgent`. Don't ask the user to paste a file or describe code you
|
|
172
179
|
can read. Only ask the user for information you genuinely cannot
|
|
173
|
-
obtain yourself.
|
|
180
|
+
obtain yourself. A fact about the user that no file holds, such as which
|
|
181
|
+
address, account, or service they mean, is that kind of information:
|
|
182
|
+
ask for it and do not guess.
|
|
174
183
|
|
|
175
184
|
## Answer before action
|
|
176
185
|
|
|
@@ -184,6 +193,7 @@ with them — don't sprint to implementation.
|
|
|
184
193
|
## Communicating with the user
|
|
185
194
|
|
|
186
195
|
- Make sure the user is following what you're doing. Use the `whatIAmDoing` tool frequently to tell the user what you're doing. (Subagent dispatches are announced automatically — narrate everything else.)
|
|
196
|
+
- When the work turns on something only the user can tell you — which account they mean, which of two readings of the request, a value you cannot look up — ask with the `question` tool, and ask before you build on the guess rather than after. Do not ask for anything you could find yourself. When nobody can answer, your question comes back rejected; when that happens, pick the most reasonable reading, say which one you picked, and carry on.
|
|
187
197
|
- Also use the `elapsedTime` tool frequently to check how much time has elapsed since you started the task. If the user gave you a time constraint to work within, make sure you finish the task within that time constraint. For simple tasks, make sure you don't spend too long researching things before giving an answer.
|
|
188
198
|
|
|
189
199
|
## Budgets and subagents that stop early
|
|
@@ -52,6 +52,9 @@ short unless the task demands detail.
|
|
|
52
52
|
`learnSkill` saves a skill you write to your learned catalog; `writeToolFor`
|
|
53
53
|
has a tool written and saved there. The user reviews before anything
|
|
54
54
|
is saved. Never claim a save the reply did not confirm.
|
|
55
|
+
Before `writeToolFor`, ask the user for anything the tool needs that
|
|
56
|
+
they have not told you (an address, an account, a provider). In the
|
|
57
|
+
purpose, state only what the user said.
|
|
55
58
|
A saved tool is in your tools as `learned_<name>`, and `learned_skills`
|
|
56
59
|
reads your saved skills. Call them when they cover the request. A saved
|
|
57
60
|
tool's code is at `~/.agency-agent/tools/<name>/impl.agency`.
|
|
@@ -74,6 +77,7 @@ Only reference files that live in the user's own working directory. Never cite a
|
|
|
74
77
|
## Communicating with the user
|
|
75
78
|
|
|
76
79
|
- Make sure the user is following what you're doing. Use the `whatIAmDoing` tool frequently to tell the user what you're doing. (Subagent dispatches are announced automatically — narrate everything else.)
|
|
80
|
+
- When the work turns on something only the user can tell you — which account they mean, which of two readings of the request, a value you cannot look up — ask with the `question` tool, and ask before you build on the guess rather than after. Do not ask for anything you could find yourself. When nobody can answer, your question comes back rejected; when that happens, pick the most reasonable reading, say which one you picked, and carry on.
|
|
77
81
|
- Also use the `elapsedTime` tool frequently to check how much time has elapsed since you started the task. If the user gave you a time constraint to work within, make sure you finish the task within that time constraint. For simple tasks, make sure you don't spend too long researching things before giving an answer.
|
|
78
82
|
|
|
79
83
|
## Budgets and subagents that stop early
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* (`setAgentCwd`/`getAgentCwd`), which `agent.agency` pins to the user's
|
|
11
11
|
* cwd at startup.
|
|
12
12
|
*/
|
|
13
|
+
import { question } from "std::agent"
|
|
13
14
|
import { cli, cliHandles, CLI_NOT_AVAILABLE } from "std::agency"
|
|
14
15
|
import { filter } from "std::array"
|
|
15
16
|
import { agencyCodingAgent } from "std::agents/agency/coding"
|
|
@@ -203,6 +204,7 @@ def consultExpert(task: string, agencyTask: boolean): Result<ExpertGuidance> {
|
|
|
203
204
|
maxTime: 5m,
|
|
204
205
|
model: getSlowModel(),
|
|
205
206
|
provider: getSlowProvider(),
|
|
207
|
+
extraTools: [question],
|
|
206
208
|
)
|
|
207
209
|
}
|
|
208
210
|
return expertAgent(
|
|
@@ -211,6 +213,7 @@ def consultExpert(task: string, agencyTask: boolean): Result<ExpertGuidance> {
|
|
|
211
213
|
maxTime: 5m,
|
|
212
214
|
model: getSlowModel(),
|
|
213
215
|
provider: getSlowProvider(),
|
|
216
|
+
extraTools: [question],
|
|
214
217
|
)
|
|
215
218
|
}
|
|
216
219
|
|
|
@@ -260,6 +263,7 @@ Deliverable: ONLY the Agency module source that will be saved as ${target}. The
|
|
|
260
263
|
requireMain: target == "",
|
|
261
264
|
maxCost: ESCALATE_MAX_COST,
|
|
262
265
|
maxTime: ESCALATE_MAX_TIME,
|
|
266
|
+
extraTools: [question],
|
|
263
267
|
)
|
|
264
268
|
if (isFailure(written)) {
|
|
265
269
|
return failure("could not write valid Agency code: ${written.error}")
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { print, printJSON, input, sleep, saveDraft, _guard, _pairsOf, read, write, writeBinary, readBinary, range, callback, map, mapWithIndex, exclude, find, findIndex, reduce, flatMap, every, some, count, sortBy, unique, groupBy, flatten, applyAgentCwd } from "agency-lang/stdlib/index.js";
|
|
2
|
+
import { question } from "agency-lang/stdlib/agent.js";
|
|
2
3
|
import { cli, cliHandles, CLI_NOT_AVAILABLE } from "agency-lang/stdlib/agency.js";
|
|
3
4
|
import { filter } from "agency-lang/stdlib/array.js";
|
|
4
5
|
import { agencyCodingAgent } from "agency-lang/stdlib/agents/agency/coding.js";
|
|
@@ -188,7 +189,7 @@ function registerTools(tools) {
|
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
|
-
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency", "
|
|
192
|
+
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency", "cb00ad9a6c8e87ae29c8f9db7fc820ffecb84c108e574f59552a595e07fc8b3b", import.meta.url);
|
|
192
193
|
__registerTool(print);
|
|
193
194
|
__registerTool(printJSON);
|
|
194
195
|
__registerTool(input);
|
|
@@ -220,6 +221,7 @@ __registerTool(flatten);
|
|
|
220
221
|
__registerTool(setAgentCwd);
|
|
221
222
|
__registerTool(getAgentCwd);
|
|
222
223
|
__registerTool(applyAgentCwd);
|
|
224
|
+
__registerTool(question);
|
|
223
225
|
__registerTool(cli);
|
|
224
226
|
__registerTool(cliHandles);
|
|
225
227
|
__registerTool(CLI_NOT_AVAILABLE);
|
|
@@ -280,7 +282,7 @@ async function __initializeStatic(__ctx) {
|
|
|
280
282
|
type: "named",
|
|
281
283
|
positionalArgs: [await __callMethod(path, "join", {
|
|
282
284
|
type: "positional",
|
|
283
|
-
args: [__readStatic(AGENT_SOURCE_DIR, "AGENT_SOURCE_DIR", "/Users/
|
|
285
|
+
args: [__readStatic(AGENT_SOURCE_DIR, "AGENT_SOURCE_DIR", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/lib/agentSource.agency"), `skills/superpowers`]
|
|
284
286
|
}), `flat`],
|
|
285
287
|
namedArgs: {
|
|
286
288
|
name: `superpowersSkill`
|
|
@@ -296,7 +298,7 @@ async function __initializeStatic(__ctx) {
|
|
|
296
298
|
codeTools = __deepFreeze([...await __call(codingAgentTools, {
|
|
297
299
|
type: "positional",
|
|
298
300
|
args: []
|
|
299
|
-
}), agencyCli, __readStatic(superpowersSkill, "superpowersSkill", "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency"), __readStatic(oracleAgent, "oracleAgent", "/Users/
|
|
301
|
+
}), agencyCli, __readStatic(superpowersSkill, "superpowersSkill", "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency"), __readStatic(oracleAgent, "oracleAgent", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.agency")]);
|
|
300
302
|
WEB_SEARCH_NOTE = __deepFreeze(`
|
|
301
303
|
You have **web search**. Use it directly whenever a task needs current or
|
|
302
304
|
external information \u2014 a fact to verify, a library or API to check, a
|
|
@@ -491,7 +493,7 @@ async function __agencyCli_impl(args) {
|
|
|
491
493
|
__functionCompleted = true;
|
|
492
494
|
runner3.halt({
|
|
493
495
|
"stdout": ``,
|
|
494
|
-
"stderr": __readStatic(CLI_NOT_AVAILABLE, "CLI_NOT_AVAILABLE", "/Users/
|
|
496
|
+
"stderr": __readStatic(CLI_NOT_AVAILABLE, "CLI_NOT_AVAILABLE", "/Users/adit/agency-lang/packages/agency-lang/stdlib/agency.agency"),
|
|
495
497
|
"exitCode": __stack.locals.result.exitCode
|
|
496
498
|
});
|
|
497
499
|
return;
|
|
@@ -627,7 +629,7 @@ async function __promptFile_impl(filename) {
|
|
|
627
629
|
type: "positional",
|
|
628
630
|
args: [__stack.args.filename, await __callMethod(path, "join", {
|
|
629
631
|
type: "positional",
|
|
630
|
-
args: [__readStatic(AGENT_SOURCE_DIR, "AGENT_SOURCE_DIR", "/Users/
|
|
632
|
+
args: [__readStatic(AGENT_SOURCE_DIR, "AGENT_SOURCE_DIR", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/lib/agentSource.agency"), `brains/coordinator/prompts`]
|
|
631
633
|
})]
|
|
632
634
|
});
|
|
633
635
|
if (hasInterrupts(__stack.locals.contents)) {
|
|
@@ -1407,7 +1409,8 @@ async function __consultExpert_impl(task, agencyTask) {
|
|
|
1407
1409
|
maxCost: __readStatic(ESCALATE_MAX_COST, "ESCALATE_MAX_COST", "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency"),
|
|
1408
1410
|
maxTime: 3e5,
|
|
1409
1411
|
model: __stack.locals.__hoist_0,
|
|
1410
|
-
provider: __stack.locals.__hoist_1
|
|
1412
|
+
provider: __stack.locals.__hoist_1,
|
|
1413
|
+
extraTools: [__readStatic(question, "question", "/Users/adit/agency-lang/packages/agency-lang/stdlib/agent.agency")]
|
|
1411
1414
|
}
|
|
1412
1415
|
}));
|
|
1413
1416
|
return;
|
|
@@ -1455,7 +1458,8 @@ async function __consultExpert_impl(task, agencyTask) {
|
|
|
1455
1458
|
maxCost: __readStatic(ESCALATE_MAX_COST, "ESCALATE_MAX_COST", "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency"),
|
|
1456
1459
|
maxTime: 3e5,
|
|
1457
1460
|
model: __stack.locals.__hoist_2,
|
|
1458
|
-
provider: __stack.locals.__hoist_3
|
|
1461
|
+
provider: __stack.locals.__hoist_3,
|
|
1462
|
+
extraTools: [__readStatic(question, "question", "/Users/adit/agency-lang/packages/agency-lang/stdlib/agent.agency")]
|
|
1459
1463
|
}
|
|
1460
1464
|
}));
|
|
1461
1465
|
return;
|
|
@@ -1777,7 +1781,8 @@ Deliverable: ONLY the Agency module source that will be saved as ${__stack.local
|
|
|
1777
1781
|
context: __stack.args.context,
|
|
1778
1782
|
requireMain: __eq(__stack.locals.target, ``),
|
|
1779
1783
|
maxCost: __readStatic(ESCALATE_MAX_COST, "ESCALATE_MAX_COST", "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency"),
|
|
1780
|
-
maxTime: __readStatic(ESCALATE_MAX_TIME, "ESCALATE_MAX_TIME", "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency")
|
|
1784
|
+
maxTime: __readStatic(ESCALATE_MAX_TIME, "ESCALATE_MAX_TIME", "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency"),
|
|
1785
|
+
extraTools: [__readStatic(question, "question", "/Users/adit/agency-lang/packages/agency-lang/stdlib/agent.agency")]
|
|
1781
1786
|
}
|
|
1782
1787
|
});
|
|
1783
1788
|
if (hasInterrupts(__stack.locals.written)) {
|
|
@@ -2212,7 +2217,7 @@ async function __supervisedRun_impl(task, alternatives, work) {
|
|
|
2212
2217
|
}
|
|
2213
2218
|
});
|
|
2214
2219
|
await runner.step(2, async (runner2) => {
|
|
2215
|
-
__stack.locals.__hoist_0 = await __callMethod(__readStatic(progressCheck, "progressCheck", "/Users/
|
|
2220
|
+
__stack.locals.__hoist_0 = await __callMethod(__readStatic(progressCheck, "progressCheck", "/Users/adit/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/supervisor.agency"), "partial", {
|
|
2216
2221
|
type: "named",
|
|
2217
2222
|
positionalArgs: [],
|
|
2218
2223
|
namedArgs: {
|
|
@@ -4481,7 +4486,7 @@ const converse = __AgencyFunction.create({
|
|
|
4481
4486
|
exported: false
|
|
4482
4487
|
}, __toolRegistry);
|
|
4483
4488
|
var stdin_default = graph;
|
|
4484
|
-
const __sourceMap = { "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:agencyCli": { "1": { "line":
|
|
4489
|
+
const __sourceMap = { "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:agencyCli": { "1": { "line": 73, "col": 2 }, "2": { "line": 84, "col": 2 }, "3": { "line": 85, "col": 2 }, "4": { "line": 92, "col": 2 }, "1.0": { "line": 74, "col": 26 }, "1.1": { "line": 74, "col": 4 }, "1.2": { "line": 75, "col": 15 }, "1.3.0": { "line": 75, "col": 4 }, "1.3.1": { "line": 76, "col": 6 }, "1.3": { "line": 75, "col": 4 }, "1.4": { "line": 82, "col": 4 }, "3.0": { "line": 86, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:promptFile": { "1": { "line": 102, "col": 2 }, "2": { "line": 103, "col": 6 }, "3": { "line": 103, "col": 2 }, "4": { "line": 106, "col": 2 }, "1.0": { "line": 102, "col": 2 }, "3.0": { "line": 104, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:setCodeOneShot": { "1": { "line": 142, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:triage": { "1": { "line": 161, "col": 2 }, "2": { "line": 169, "col": 2 }, "3": { "line": 170, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:routeFor": { "1": { "line": 175, "col": 9 }, "2": { "line": 175, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:escalate": { "1": { "line": 189, "col": 2 }, "2": { "line": 190, "col": 6 }, "3": { "line": 190, "col": 2 }, "4": { "line": 193, "col": 2 }, "3.0": { "line": 191, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:consultExpert": { "1": { "line": 199, "col": 2 }, "2": { "line": 213, "col": 11 }, "3": { "line": 214, "col": 14 }, "4": { "line": 209, "col": 2 }, "1.0": { "line": 204, "col": 13 }, "1.1": { "line": 205, "col": 16 }, "1.2": { "line": 200, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:saveTargetFor": { "1": { "line": 226, "col": 2 }, "2": { "line": 234, "col": 2 }, "3": { "line": 235, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:solve": { "1": { "line": 244, "col": 2 }, "2": { "line": 281, "col": 2 }, "1.1": { "line": 250, "col": 4 }, "1.2": { "line": 251, "col": 4 }, "1.3.0": { "line": 253, "col": 6 }, "1.3": { "line": 252, "col": 4 }, "1.4": { "line": 259, "col": 4 }, "1.5": { "line": 267, "col": 8 }, "1.6.0": { "line": 268, "col": 6 }, "1.6": { "line": 267, "col": 4 }, "1.7.0": { "line": 271, "col": 6 }, "1.7.1": { "line": 272, "col": 10 }, "1.7.2.0": { "line": 273, "col": 8 }, "1.7.2": { "line": 272, "col": 6 }, "1.7.3": { "line": 277, "col": 6 }, "1.7": { "line": 270, "col": 4 }, "1.8": { "line": 279, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:flattenSolveOutcome": { "1": { "line": 305, "col": 6 }, "2": { "line": 305, "col": 2 }, "3": { "line": 308, "col": 2 }, "4": { "line": 309, "col": 2 }, "5": { "line": 314, "col": 2 }, "6": { "line": 317, "col": 2 }, "2.0": { "line": 306, "col": 4 }, "4.0": { "line": 310, "col": 4 }, "5.0": { "line": 315, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:supervisedRun": { "1": { "line": 325, "col": 2 }, "2": { "line": 329, "col": 11 }, "3": { "line": 326, "col": 2 }, "4": { "line": 343, "col": 2 }, "5": { "line": 344, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:__block_0": { "3.0": { "line": 331, "col": 4 }, "3.1": { "line": 332, "col": 8 }, "3.2.0": { "line": 333, "col": 6 }, "3.2": { "line": 332, "col": 4 }, "3.3": { "line": 338, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:supervisedSolve": { "1": { "line": 353, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:__block_1": {}, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:supervisedPlan": { "1": { "line": 367, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:__block_2": {}, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:codeAgent": { "1": { "line": 392, "col": 2 }, "2": { "line": 393, "col": 2 }, "3": { "line": 394, "col": 2 }, "4": { "line": 395, "col": 6 }, "5": { "line": 395, "col": 2 }, "6": { "line": 398, "col": 2 }, "7": { "line": 401, "col": 2 }, "5.0": { "line": 396, "col": 4 }, "6.0": { "line": 399, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:escalateToExpert": { "1": { "line": 412, "col": 35 }, "2": { "line": 412, "col": 2 }, "3": { "line": 413, "col": 59 }, "4": { "line": 413, "col": 2 }, "5": { "line": 414, "col": 2 }, "6": { "line": 420, "col": 5 }, "7": { "line": 420, "col": 31 }, "8": { "line": 419, "col": 2 }, "9": { "line": 425, "col": 13 }, "10": { "line": 423, "col": 2 }, "11": { "line": 429, "col": 2 }, "12": { "line": 430, "col": 2 }, "13": { "line": 431, "col": 6 }, "14": { "line": 431, "col": 2 }, "15": { "line": 441, "col": 2 }, "16": { "line": 447, "col": 6 }, "17": { "line": 447, "col": 2 }, "19": { "line": 475, "col": 2 }, "20": { "line": 478, "col": 2 }, "14.0": { "line": 432, "col": 4 }, "14.1": { "line": 434, "col": 4 }, "14.2": { "line": 435, "col": 4 }, "14.3": { "line": 439, "col": 4 }, "17.0": { "line": 453, "col": 2 }, "17.1": { "line": 448, "col": 4 }, "17.2": { "line": 457, "col": 4 }, "17.3": { "line": 458, "col": 8 }, "17.4.0": { "line": 459, "col": 6 }, "17.4": { "line": 458, "col": 4 }, "17.5": { "line": 461, "col": 4 }, "17.6": { "line": 462, "col": 4 }, "17.7": { "line": 464, "col": 4 }, "17.8": { "line": 470, "col": 4 }, "19.0": { "line": 476, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:__block_3": {}, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:withVerification": { "1": { "line": 488, "col": 2 }, "2": { "line": 489, "col": 2 }, "3": { "line": 492, "col": 6 }, "4": { "line": 492, "col": 2 }, "5": { "line": 495, "col": 2 }, "2.0": { "line": 490, "col": 4 }, "4.0": { "line": 493, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:solveUnattended": { "1": { "line": 503, "col": 2 }, "2": { "line": 504, "col": 6 }, "3": { "line": 504, "col": 2 }, "5": { "line": 509, "col": 2 }, "6": { "line": 510, "col": 2 }, "7": { "line": 511, "col": 7 }, "8": { "line": 511, "col": 2 }, "9": { "line": 519, "col": 2 }, "10": { "line": 514, "col": 2 }, "11": { "line": 523, "col": 2 }, "12": { "line": 524, "col": 6 }, "13": { "line": 524, "col": 2 }, "14": { "line": 527, "col": 2 }, "15": { "line": 529, "col": 2 }, "16": { "line": 530, "col": 2 }, "3.0": { "line": 505, "col": 4 }, "8.0": { "line": 512, "col": 4 }, "13.0": { "line": 525, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency:converse": { "1": { "line": 540, "col": 2 }, "2": { "line": 541, "col": 2 }, "3": { "line": 542, "col": 2 }, "4": { "line": 543, "col": 2 }, "5": { "line": 544, "col": 2 }, "6": { "line": 545, "col": 2 }, "7": { "line": 594, "col": 2 }, "6.0": { "line": 546, "col": 4 }, "6.1.1": { "line": 550, "col": 35 }, "6.1.2": { "line": 550, "col": 6 }, "6.1.3": { "line": 551, "col": 10 }, "6.1.4.0": { "line": 552, "col": 8 }, "6.1.4": { "line": 551, "col": 6 }, "6.1.5": { "line": 554, "col": 6 }, "6.1.6": { "line": 555, "col": 6 }, "6.1": { "line": 547, "col": 4 }, "6.2": { "line": 557, "col": 4 }, "6.3.0": { "line": 559, "col": 6 }, "6.3.1": { "line": 560, "col": 27 }, "6.3.2": { "line": 560, "col": 6 }, "6.3.3": { "line": 563, "col": 6 }, "6.3.4.0.0": { "line": 565, "col": 8 }, "6.3.4.0": { "line": 565, "col": 8 }, "6.3.4": { "line": 564, "col": 6 }, "6.3.5": { "line": 567, "col": 10 }, "6.3.6.0": { "line": 571, "col": 10 }, "6.3.6.1": { "line": 568, "col": 8 }, "6.3.6.2": { "line": 576, "col": 8 }, "6.3.6": { "line": 567, "col": 6 }, "6.3": { "line": 558, "col": 4 }, "6.4": { "line": 579, "col": 4 }, "6.5": { "line": 592, "col": 4 } } };
|
|
4485
4490
|
export {
|
|
4486
4491
|
__getCheckpoints,
|
|
4487
4492
|
__invokeFunction,
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* The docstring below is what the coordinator reads when deciding whether to
|
|
12
12
|
* call this, so it is written for routing, not for the agent's own behavior.
|
|
13
13
|
*/
|
|
14
|
+
import { question } from "std::agent"
|
|
14
15
|
import { oracleAgent as stdOracleAgent } from "std::agents/oracle"
|
|
15
16
|
|
|
16
17
|
import { getSlowModel, getSlowProvider } from "../../../shared.agency"
|
|
@@ -56,6 +57,7 @@ export handoff def oracleAgent(
|
|
|
56
57
|
maxTime: timeBudget(maxSeconds, 15m),
|
|
57
58
|
model: getSlowModel(),
|
|
58
59
|
provider: getSlowProvider(),
|
|
60
|
+
extraTools: [question],
|
|
59
61
|
)
|
|
60
62
|
}
|
|
61
63
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { print, printJSON, input, sleep, saveDraft, _guard, _pairsOf, read, write, writeBinary, readBinary, range, callback, map, mapWithIndex, filter, exclude, find, findIndex, reduce, flatMap, every, some, count, sortBy, unique, groupBy, flatten, setAgentCwd, getAgentCwd, applyAgentCwd } from "agency-lang/stdlib/index.js";
|
|
2
|
+
import { question } from "agency-lang/stdlib/agent.js";
|
|
2
3
|
import { oracleAgent as stdOracleAgent } from "agency-lang/stdlib/agents/oracle.js";
|
|
3
4
|
import { getSlowModel, getSlowProvider } from "../../../shared.js";
|
|
4
5
|
import { announce } from "../lib/announce.js";
|
|
@@ -36,6 +37,7 @@ import {
|
|
|
36
37
|
AgencyAbort,
|
|
37
38
|
AbortedResult,
|
|
38
39
|
isAborted,
|
|
40
|
+
__readStatic,
|
|
39
41
|
__registerGlobalsInit,
|
|
40
42
|
__registerCallbacksInit,
|
|
41
43
|
registerModuleFingerprint as __registerModuleFingerprint,
|
|
@@ -155,7 +157,7 @@ function registerTools(tools) {
|
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
|
-
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.agency", "
|
|
160
|
+
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.agency", "b93f1c4271dbd4a282554817a6c0366b9d764d61e39139cc0a0711aa342938b5", import.meta.url);
|
|
159
161
|
__registerTool(print);
|
|
160
162
|
__registerTool(printJSON);
|
|
161
163
|
__registerTool(input);
|
|
@@ -187,6 +189,7 @@ __registerTool(flatten);
|
|
|
187
189
|
__registerTool(setAgentCwd);
|
|
188
190
|
__registerTool(getAgentCwd);
|
|
189
191
|
__registerTool(applyAgentCwd);
|
|
192
|
+
__registerTool(question);
|
|
190
193
|
__registerTool(stdOracleAgent);
|
|
191
194
|
__registerTool(getSlowModel);
|
|
192
195
|
__registerTool(getSlowProvider);
|
|
@@ -359,7 +362,8 @@ async function __oracleAgent_impl(userMsg, maxSeconds = __UNSET, maxDollars = __
|
|
|
359
362
|
maxCost: __bstack.locals.__hoist_0,
|
|
360
363
|
maxTime: __bstack.locals.__hoist_1,
|
|
361
364
|
model: __bstack.locals.__hoist_2,
|
|
362
|
-
provider: __bstack.locals.__hoist_3
|
|
365
|
+
provider: __bstack.locals.__hoist_3,
|
|
366
|
+
extraTools: [__readStatic(question, "question", "/Users/adit/agency-lang/packages/agency-lang/stdlib/agent.agency")]
|
|
363
367
|
}
|
|
364
368
|
}));
|
|
365
369
|
return;
|
|
@@ -482,7 +486,7 @@ const oracleAgent = __AgencyFunction.create({
|
|
|
482
486
|
}
|
|
483
487
|
}, __toolRegistry);
|
|
484
488
|
var stdin_default = graph;
|
|
485
|
-
const __sourceMap = { "dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.agency:oracleAgent": { "1": { "line":
|
|
489
|
+
const __sourceMap = { "dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.agency:oracleAgent": { "1": { "line": 51, "col": 2 }, "2": { "line": 52, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.agency:__block_0": { "2.0": { "line": 55, "col": 15 }, "2.1": { "line": 56, "col": 15 }, "2.2": { "line": 57, "col": 13 }, "2.3": { "line": 58, "col": 16 }, "2.4": { "line": 53, "col": 4 } } };
|
|
486
490
|
export {
|
|
487
491
|
__getCheckpoints,
|
|
488
492
|
__invokeFunction,
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* user selected, a shared session, the REPL formatting rules, and the memory
|
|
16
16
|
* and todo tools the agent gives its specialists.
|
|
17
17
|
*/
|
|
18
|
+
import { question } from "std::agent"
|
|
18
19
|
import { agencyResearcherAgent } from "std::agents/agency/researcher"
|
|
19
20
|
import { memoryTools, planningTools } from "std::agents/lib/toolkits"
|
|
20
21
|
import { researcherAgent } from "std::agents/researcher"
|
|
@@ -65,7 +66,7 @@ export handoff def researchAgent(
|
|
|
65
66
|
maxCost: costBudget(maxDollars, $10.00),
|
|
66
67
|
maxTime: timeBudget(maxSeconds, 10m),
|
|
67
68
|
session: "research",
|
|
68
|
-
extraTools: researchTools,
|
|
69
|
+
extraTools: [...researchTools, question],
|
|
69
70
|
)
|
|
70
71
|
}
|
|
71
72
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { print, printJSON, input, sleep, saveDraft, _guard, _pairsOf, read, write, writeBinary, readBinary, range, callback, map, mapWithIndex, filter, exclude, find, findIndex, reduce, flatMap, every, some, count, sortBy, unique, groupBy, flatten, setAgentCwd, getAgentCwd, applyAgentCwd } from "agency-lang/stdlib/index.js";
|
|
2
|
+
import { question } from "agency-lang/stdlib/agent.js";
|
|
2
3
|
import { agencyResearcherAgent } from "agency-lang/stdlib/agents/agency/researcher.js";
|
|
3
4
|
import { memoryTools, planningTools } from "agency-lang/stdlib/agents/lib/toolkits.js";
|
|
4
5
|
import { researcherAgent } from "agency-lang/stdlib/agents/researcher.js";
|
|
@@ -163,7 +164,7 @@ function registerTools(tools) {
|
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency", "
|
|
167
|
+
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency", "4597389ae5a20de88a021056988afa57984b3a4ccf7df607cf6178bfefb912e8", import.meta.url);
|
|
167
168
|
__registerTool(print);
|
|
168
169
|
__registerTool(printJSON);
|
|
169
170
|
__registerTool(input);
|
|
@@ -195,6 +196,7 @@ __registerTool(flatten);
|
|
|
195
196
|
__registerTool(setAgentCwd);
|
|
196
197
|
__registerTool(getAgentCwd);
|
|
197
198
|
__registerTool(applyAgentCwd);
|
|
199
|
+
__registerTool(question);
|
|
198
200
|
__registerTool(agencyResearcherAgent);
|
|
199
201
|
__registerTool(memoryTools);
|
|
200
202
|
__registerTool(planningTools);
|
|
@@ -219,13 +221,13 @@ async function __initializeStatic(__ctx) {
|
|
|
219
221
|
}), ...await __call(planningTools, {
|
|
220
222
|
type: "positional",
|
|
221
223
|
args: []
|
|
222
|
-
}), await __callMethod(__readStatic(highlight, "highlight", "/Users/
|
|
224
|
+
}), await __callMethod(__readStatic(highlight, "highlight", "/Users/adit/agency-lang/packages/agency-lang/stdlib/syntax.agency"), "partial", {
|
|
223
225
|
type: "named",
|
|
224
226
|
positionalArgs: [],
|
|
225
227
|
namedArgs: {
|
|
226
228
|
language: `ts`
|
|
227
229
|
}
|
|
228
|
-
}), __readStatic(print, "print", "/Users/
|
|
230
|
+
}), __readStatic(print, "print", "/Users/adit/agency-lang/packages/agency-lang/stdlib/index.agency")]);
|
|
229
231
|
replStyle = __deepFreeze(`Reply for a terminal REPL that renders Markdown: use headings, bullets, bold, links, and fenced code blocks. Put a blank line between a heading and whatever follows it, or the renderer truncates the rest.
|
|
230
232
|
|
|
231
233
|
Show multi-line code with \`print(highlight(code))\`, which writes a colored block to the user's console. Skip that for a single identifier.
|
|
@@ -407,7 +409,7 @@ async function __researchAgent_impl(userMsg, agencyTopic = __UNSET, maxSeconds =
|
|
|
407
409
|
maxCost: __bstack.locals.__hoist_0,
|
|
408
410
|
maxTime: __bstack.locals.__hoist_1,
|
|
409
411
|
session: `research`,
|
|
410
|
-
extraTools: __readStatic(researchTools, "researchTools", "dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency")
|
|
412
|
+
extraTools: [...__readStatic(researchTools, "researchTools", "dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency"), __readStatic(question, "question", "/Users/adit/agency-lang/packages/agency-lang/stdlib/agent.agency")]
|
|
411
413
|
}
|
|
412
414
|
}));
|
|
413
415
|
return;
|
|
@@ -601,7 +603,7 @@ const researchAgent = __AgencyFunction.create({
|
|
|
601
603
|
}
|
|
602
604
|
}, __toolRegistry);
|
|
603
605
|
var stdin_default = graph;
|
|
604
|
-
const __sourceMap = { "dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency:researchAgent": { "1": { "line":
|
|
606
|
+
const __sourceMap = { "dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency:researchAgent": { "1": { "line": 58, "col": 2 }, "2": { "line": 59, "col": 2 }, "3": { "line": 60, "col": 2 }, "4": { "line": 72, "col": 2 }, "3.0": { "line": 61, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency:__block_0": { "3.0.0": { "line": 65, "col": 17 }, "3.0.1": { "line": 66, "col": 17 }, "3.0.2": { "line": 62, "col": 6 } }, "dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency:__block_1": { "4.0": { "line": 76, "col": 15 }, "4.1": { "line": 77, "col": 15 }, "4.2": { "line": 73, "col": 4 } } };
|
|
605
607
|
export {
|
|
606
608
|
__getCheckpoints,
|
|
607
609
|
__invokeFunction,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { question } from "std::agent"
|
|
1
2
|
import { agencyReviewAgent } from "std::agents/agency/review"
|
|
2
3
|
import { reviewAgent as generalReviewAgent } from "std::agents/review"
|
|
3
4
|
import { Feedback, mergeFeedback, renderFeedback } from "std::agents/lib/feedback"
|
|
@@ -45,7 +46,7 @@ export def review(userMsg: string): Result<Feedback[]> {
|
|
|
45
46
|
let feedback: Result<Feedback[]> = success([])
|
|
46
47
|
|
|
47
48
|
for (codeSnippet in snippets) {
|
|
48
|
-
feedback = mergeFeedback(feedback, agencyReviewAgent(codeSnippet.code))
|
|
49
|
+
feedback = mergeFeedback(feedback, agencyReviewAgent(codeSnippet.code, extraTools: [question]))
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
return feedback
|