@promptbook/cli 0.114.0-3 → 0.114.0-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -12
- package/apps/agents-server/{USE_TIMEOUT_CHIP_QA.md → TIMEOUT_CHIP_QA.md} +1 -1
- package/apps/agents-server/src/app/agents/[agentName]/api/chat/resolveAgentChatRouteContext.ts +5 -12
- package/apps/agents-server/src/app/agents/[agentName]/api/voice/route.ts +4 -9
- package/apps/agents-server/src/app/api/scrape/route.ts +1 -1
- package/apps/agents-server/src/app/layout.tsx +25 -0
- package/apps/agents-server/src/app/system/user-wallet/UserWalletDraft.ts +2 -2
- package/apps/agents-server/src/components/AgentProfile/AgentCapabilityChips.tsx +1 -24
- package/apps/agents-server/src/components/Header/Header.tsx +8 -0
- package/apps/agents-server/src/components/Header/HeaderTypes.ts +5 -0
- package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +118 -30
- package/apps/agents-server/src/components/Header/resolveHeaderSystemActivities.ts +86 -0
- package/apps/agents-server/src/components/Homepage/AgentCard.tsx +0 -3
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +8 -0
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizardState.ts +0 -12
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizardUseSetupStep.tsx +0 -58
- package/apps/agents-server/src/components/NewAgentDialog/newAgentWizardPresets.ts +0 -56
- package/apps/agents-server/src/components/WalletRecordDialog/useWalletRecordDialogState.ts +1 -1
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +0 -10
- package/apps/agents-server/src/languages/translations/czech.yaml +0 -10
- package/apps/agents-server/src/languages/translations/english.yaml +0 -10
- package/apps/agents-server/src/message-providers/email/smtp/SmtpMessageProvider.ts +1 -1
- package/apps/agents-server/src/tools/$provideOpenAiAgentKitExecutionToolsForServer.ts +0 -191
- package/apps/agents-server/src/tools/$provideOpenAiAssistantExecutionToolsForServer.ts +0 -3
- package/apps/agents-server/src/tools/run_browser.ts +1 -1
- package/apps/agents-server/src/tools/send_email.ts +3 -3
- package/apps/agents-server/src/utils/handleChatCompletion/createHandleChatCompletionPromptContext.ts +0 -1
- package/apps/agents-server/src/utils/handleChatCompletion/resolveHandleChatCompletionRuntime.ts +4 -12
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentBooks.ts +0 -1
- package/apps/agents-server/src/utils/messages/parseUseEmailSmtpCredential.ts +1 -1
- package/apps/agents-server/src/utils/resolveUseEmailSmtpCredential.ts +1 -1
- package/apps/agents-server/src/utils/useEmailSmtpWalletConstants.ts +5 -5
- package/apps/agents-server/src/utils/userChat/createRunUserChatJobExecutionContext.ts +5 -12
- package/apps/agents-server/src/utils/userWallet/UserWalletRecord.ts +1 -1
- package/apps/agents-server/src/utils/userWallet/resolveUseEmailSmtpCredentialFromWallet.ts +1 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate/deleteVpsSelfUpdateInstalledVersion.ts +2 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate/isVpsSelfUpdateJobRunning.ts +16 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/startVpsSelfUpdate.ts +2 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate.ts +1 -0
- package/esm/index.es.js +2885 -6344
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/common/createCoderRunStepTracker.d.ts +48 -0
- package/esm/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +43 -0
- package/esm/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
- package/esm/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
- package/esm/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/prompts/resolvePromptStatusLine.d.ts +19 -0
- package/esm/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/server/updatePromptSection.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +6 -0
- package/esm/scripts/verify-prompts/$orderPromptFiles.d.ts +9 -0
- package/esm/scripts/verify-prompts/VerifyPromptsOrder.d.ts +26 -0
- package/esm/scripts/verify-prompts/verify-prompts.d.ts +3 -2
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -3
- package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +3 -2
- package/esm/src/cli/cli-commands/coder/verify.d.ts +1 -1
- package/esm/src/commitments/{COMPONENT/COMPONENT.d.ts → META_FULLNAME/META_FULLNAME.d.ts} +8 -5
- package/esm/src/commitments/META_ID/META_ID.d.ts +32 -0
- package/esm/src/commitments/index.d.ts +4 -12
- package/esm/src/llm-providers/agent/Agent.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
- package/esm/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.d.ts +2 -3
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/_packages/components.readme.md +1 -1
- package/src/book-2.0/agent-source/AgentBasicInformation.ts +3 -9
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/filterCommitmentsForAgentModelRequirements.ts +0 -23
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.ts +0 -2
- package/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.ts +16 -31
- package/src/book-2.0/agent-source/parseAgentSource/createCapabilitiesFromCommitment.ts +0 -35
- package/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.ts +0 -25
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +2 -10
- package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +7 -32
- package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +6 -31
- package/src/book-components/BookEditor/useBookEditorMonacoLanguage.ts +1 -1
- package/src/cli/cli-commands/coder/boilerplateCount.ts +139 -0
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +52 -44
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +3 -1
- package/src/cli/cli-commands/coder/init.ts +2 -1
- package/src/cli/cli-commands/coder/verify.ts +29 -5
- package/src/commitments/ACTION/ACTION.ts +3 -3
- package/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.ts +1 -1
- package/src/commitments/META_FULLNAME/META_FULLNAME.ts +70 -0
- package/src/commitments/META_ID/META_ID.ts +78 -0
- package/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.ts +1 -49
- package/src/commitments/index.ts +6 -24
- package/src/llm-providers/agent/Agent.ts +1 -1
- package/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.ts +2 -2
- package/src/other/templates/getTemplatesPipelineCollection.ts +735 -693
- package/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.ts +8 -9
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -0
- package/umd/index.umd.js +2888 -6347
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/common/createCoderRunStepTracker.d.ts +48 -0
- package/umd/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +43 -0
- package/umd/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
- package/umd/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
- package/umd/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/prompts/resolvePromptStatusLine.d.ts +19 -0
- package/umd/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/server/updatePromptSection.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +6 -0
- package/umd/scripts/verify-prompts/$orderPromptFiles.d.ts +9 -0
- package/umd/scripts/verify-prompts/VerifyPromptsOrder.d.ts +26 -0
- package/umd/scripts/verify-prompts/verify-prompts.d.ts +3 -2
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -3
- package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +3 -2
- package/umd/src/cli/cli-commands/coder/verify.d.ts +1 -1
- package/umd/src/commitments/{COMPONENT/COMPONENT.d.ts → META_FULLNAME/META_FULLNAME.d.ts} +8 -5
- package/umd/src/commitments/META_ID/META_ID.d.ts +32 -0
- package/umd/src/commitments/index.d.ts +4 -12
- package/umd/src/llm-providers/agent/Agent.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
- package/umd/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.d.ts +2 -3
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/src/tools/configureTimeoutToolRuntimeAdapterForServer.ts +0 -381
- package/apps/agents-server/src/utils/emails/extractUseEmailConfigurationFromAgentSource.ts +0 -42
- package/esm/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +0 -7
- package/esm/src/commitments/MEMORY/MEMORY.d.ts +0 -48
- package/esm/src/commitments/MEMORY/MemoryToolNames.d.ts +0 -11
- package/esm/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +0 -149
- package/esm/src/commitments/MEMORY/createMemorySystemMessage.d.ts +0 -6
- package/esm/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +0 -8
- package/esm/src/commitments/MEMORY/createMemoryTools.d.ts +0 -14
- package/esm/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +0 -6
- package/esm/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/esm/src/commitments/MEMORY/getMemoryToolTitles.d.ts +0 -7
- package/esm/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +0 -61
- package/esm/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +0 -8
- package/esm/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +0 -13
- package/esm/src/commitments/META/META.d.ts +0 -65
- package/esm/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +0 -32
- package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -58
- package/esm/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +0 -13
- package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +0 -10
- package/esm/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +0 -47
- package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -38
- package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +0 -21
- package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +0 -1
- package/esm/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +0 -11
- package/esm/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +0 -13
- package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -46
- package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +0 -1
- package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -38
- package/esm/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +0 -1
- package/esm/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +0 -9
- package/esm/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +0 -12
- package/esm/src/commitments/USE_TIME/USE_TIME.d.ts +0 -43
- package/esm/src/commitments/USE_TIME/USE_TIME.test.d.ts +0 -1
- package/esm/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +0 -11
- package/esm/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +0 -212
- package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -38
- package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +0 -1
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +0 -6
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +0 -8
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +0 -7
- package/esm/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/esm/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +0 -78
- package/esm/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +0 -8
- package/esm/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +0 -13
- package/esm/src/commitments/WALLET/WALLET.d.ts +0 -21
- package/esm/src/commitments/WALLET/WALLET.test.d.ts +0 -1
- package/esm/src/commitments/WALLET/WalletToolNames.d.ts +0 -12
- package/esm/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +0 -163
- package/esm/src/commitments/WALLET/createWalletSystemMessage.d.ts +0 -6
- package/esm/src/commitments/WALLET/createWalletToolFunctions.d.ts +0 -8
- package/esm/src/commitments/WALLET/createWalletTools.d.ts +0 -7
- package/esm/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +0 -6
- package/esm/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +0 -16
- package/esm/src/commitments/WALLET/getWalletToolTitles.d.ts +0 -7
- package/esm/src/commitments/WALLET/parseWalletToolArgs.d.ts +0 -51
- package/esm/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +0 -8
- package/esm/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +0 -13
- package/esm/src/commitments/_common/createSerpSearchToolFunction.d.ts +0 -12
- package/src/commitments/COMPONENT/COMPONENT.ts +0 -70
- package/src/commitments/MEMORY/MEMORY.ts +0 -94
- package/src/commitments/MEMORY/MemoryToolNames.ts +0 -13
- package/src/commitments/MEMORY/MemoryToolRuntimeAdapter.ts +0 -180
- package/src/commitments/MEMORY/createMemorySystemMessage.ts +0 -27
- package/src/commitments/MEMORY/createMemoryToolFunctions.ts +0 -134
- package/src/commitments/MEMORY/createMemoryTools.ts +0 -115
- package/src/commitments/MEMORY/getMemoryCommitmentDocumentation.ts +0 -47
- package/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.ts +0 -104
- package/src/commitments/MEMORY/getMemoryToolTitles.ts +0 -16
- package/src/commitments/MEMORY/parseMemoryToolArgs.ts +0 -126
- package/src/commitments/MEMORY/resolveMemoryRuntimeContext.ts +0 -23
- package/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.ts +0 -26
- package/src/commitments/META/META.ts +0 -168
- package/src/commitments/USE/TODO.txt +0 -1
- package/src/commitments/USE/aggregateUseCommitmentSystemMessages.ts +0 -219
- package/src/commitments/USE_BROWSER/TODO.txt +0 -1
- package/src/commitments/USE_BROWSER/USE_BROWSER.ts +0 -257
- package/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.ts +0 -45
- package/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.ts +0 -83
- package/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.ts +0 -146
- package/src/commitments/USE_EMAIL/USE_EMAIL.ts +0 -201
- package/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.ts +0 -75
- package/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.ts +0 -44
- package/src/commitments/USE_EMAIL/sendEmailViaBrowser.ts +0 -47
- package/src/commitments/USE_SEARCH_ENGINE/TODO.txt +0 -1
- package/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.ts +0 -171
- package/src/commitments/USE_SPAWN/USE_SPAWN.ts +0 -150
- package/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.ts +0 -42
- package/src/commitments/USE_SPAWN/spawnAgentViaBrowser.ts +0 -50
- package/src/commitments/USE_TIME/USE_TIME.ts +0 -177
- package/src/commitments/USE_TIMEOUT/TimeoutToolNames.ts +0 -13
- package/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.ts +0 -255
- package/src/commitments/USE_TIMEOUT/USE_TIMEOUT.ts +0 -117
- package/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.ts +0 -22
- package/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.ts +0 -361
- package/src/commitments/USE_TIMEOUT/createTimeoutTools.ts +0 -127
- package/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.ts +0 -67
- package/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.ts +0 -460
- package/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.ts +0 -36
- package/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.ts +0 -26
- package/src/commitments/WALLET/WALLET.ts +0 -71
- package/src/commitments/WALLET/WalletToolNames.ts +0 -14
- package/src/commitments/WALLET/WalletToolRuntimeAdapter.ts +0 -180
- package/src/commitments/WALLET/createWalletSystemMessage.ts +0 -22
- package/src/commitments/WALLET/createWalletToolFunctions.ts +0 -145
- package/src/commitments/WALLET/createWalletTools.ts +0 -129
- package/src/commitments/WALLET/getWalletCommitmentDocumentation.ts +0 -14
- package/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.ts +0 -64
- package/src/commitments/WALLET/getWalletToolTitles.ts +0 -17
- package/src/commitments/WALLET/parseWalletToolArgs.ts +0 -231
- package/src/commitments/WALLET/resolveWalletRuntimeContext.ts +0 -23
- package/src/commitments/WALLET/setWalletToolRuntimeAdapter.ts +0 -26
- package/src/commitments/_common/createSerpSearchToolFunction.ts +0 -46
- package/umd/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +0 -7
- package/umd/src/book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts +0 -1
- package/umd/src/commitments/MEMORY/MEMORY.d.ts +0 -48
- package/umd/src/commitments/MEMORY/MEMORY.test.d.ts +0 -1
- package/umd/src/commitments/MEMORY/MemoryToolNames.d.ts +0 -11
- package/umd/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +0 -149
- package/umd/src/commitments/MEMORY/createMemorySystemMessage.d.ts +0 -6
- package/umd/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +0 -8
- package/umd/src/commitments/MEMORY/createMemoryTools.d.ts +0 -14
- package/umd/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +0 -6
- package/umd/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/umd/src/commitments/MEMORY/getMemoryToolTitles.d.ts +0 -7
- package/umd/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +0 -61
- package/umd/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +0 -8
- package/umd/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +0 -13
- package/umd/src/commitments/META/META.d.ts +0 -65
- package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +0 -32
- package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -58
- package/umd/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +0 -1
- package/umd/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +0 -13
- package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +0 -10
- package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts +0 -1
- package/umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +0 -47
- package/umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts +0 -1
- package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -38
- package/umd/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts +0 -1
- package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +0 -21
- package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +0 -1
- package/umd/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +0 -11
- package/umd/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +0 -13
- package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -46
- package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +0 -1
- package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -38
- package/umd/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +0 -1
- package/umd/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +0 -9
- package/umd/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +0 -12
- package/umd/src/commitments/USE_TIME/USE_TIME.d.ts +0 -43
- package/umd/src/commitments/USE_TIME/USE_TIME.test.d.ts +0 -1
- package/umd/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +0 -11
- package/umd/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +0 -212
- package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -38
- package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +0 -1
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +0 -6
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +0 -8
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +0 -7
- package/umd/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/umd/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +0 -78
- package/umd/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +0 -8
- package/umd/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +0 -13
- package/umd/src/commitments/WALLET/WALLET.d.ts +0 -21
- package/umd/src/commitments/WALLET/WALLET.test.d.ts +0 -1
- package/umd/src/commitments/WALLET/WalletToolNames.d.ts +0 -12
- package/umd/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +0 -163
- package/umd/src/commitments/WALLET/createWalletSystemMessage.d.ts +0 -6
- package/umd/src/commitments/WALLET/createWalletToolFunctions.d.ts +0 -8
- package/umd/src/commitments/WALLET/createWalletTools.d.ts +0 -7
- package/umd/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +0 -6
- package/umd/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +0 -16
- package/umd/src/commitments/WALLET/getWalletToolTitles.d.ts +0 -7
- package/umd/src/commitments/WALLET/parseWalletToolArgs.d.ts +0 -51
- package/umd/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +0 -8
- package/umd/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +0 -13
- package/umd/src/commitments/_common/createSerpSearchToolFunction.d.ts +0 -12
- /package/esm/src/book-2.0/agent-source/{createAgentModelRequirements.useCommitmentAggregation.test.d.ts → createAgentModelRequirements.commitmentAggregation.test.d.ts} +0 -0
- /package/esm/src/{commitments/MEMORY/MEMORY.test.d.ts → cli/cli-commands/coder/boilerplateCount.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_BROWSER/USE_BROWSER.test.d.ts → cli/cli-commands/coder/generate-boilerplates.test.d.ts} +0 -0
- /package/esm/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
- /package/{esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts → umd/src/book-2.0/agent-source/createAgentModelRequirements.commitmentAggregation.test.d.ts} +0 -0
- /package/{esm/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts → umd/src/cli/cli-commands/coder/boilerplateCount.test.d.ts} +0 -0
- /package/{esm/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts → umd/src/cli/cli-commands/coder/generate-boilerplates.test.d.ts} +0 -0
- /package/umd/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { spaceTrim } from 'spacetrim';
|
|
2
|
-
import { MemoryToolNames } from './MemoryToolNames';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Builds the MEMORY instruction block appended to the system message.
|
|
6
|
-
*
|
|
7
|
-
* @private function of MemoryCommitmentDefinition
|
|
8
|
-
*/
|
|
9
|
-
export function createMemorySystemMessage(extraInstructions: string): string {
|
|
10
|
-
return spaceTrim(
|
|
11
|
-
(block) => `
|
|
12
|
-
## Memory
|
|
13
|
-
|
|
14
|
-
- Prefer storing agent-scoped memories; only make them global when the fact should apply across all your agents.
|
|
15
|
-
- You can use persistent user memory tools.
|
|
16
|
-
- Use \`${MemoryToolNames.retrieve}\` to load relevant memory before answering.
|
|
17
|
-
- Use \`${MemoryToolNames.store}\` to save stable user-specific facts that improve future help.
|
|
18
|
-
- Use \`${MemoryToolNames.update}\` to refresh an existing memory when the content changes.
|
|
19
|
-
- Use \`${
|
|
20
|
-
MemoryToolNames.delete
|
|
21
|
-
}\` to delete memories that are no longer accurate (deletions are soft and hidden from future queries).
|
|
22
|
-
- Store concise memory items and avoid duplicates.
|
|
23
|
-
- Never claim memory was saved or loaded unless the tool confirms it.
|
|
24
|
-
${block(extraInstructions)}
|
|
25
|
-
`,
|
|
26
|
-
);
|
|
27
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
2
|
-
import type { string_javascript_name } from '../../types/string_person_fullname';
|
|
3
|
-
import { getMemoryToolRuntimeAdapterOrDisabledResult } from './getMemoryToolRuntimeAdapterOrDisabledResult';
|
|
4
|
-
import { MemoryToolNames } from './MemoryToolNames';
|
|
5
|
-
import type {
|
|
6
|
-
DeleteMemoryToolArgs,
|
|
7
|
-
DeleteMemoryToolResult,
|
|
8
|
-
RetrieveMemoryToolArgs,
|
|
9
|
-
RetrieveMemoryToolResult,
|
|
10
|
-
StoreMemoryToolArgs,
|
|
11
|
-
StoreMemoryToolResult,
|
|
12
|
-
UpdateMemoryToolArgs,
|
|
13
|
-
UpdateMemoryToolResult,
|
|
14
|
-
} from './MemoryToolRuntimeAdapter';
|
|
15
|
-
import { parseMemoryToolArgs } from './parseMemoryToolArgs';
|
|
16
|
-
import { resolveMemoryRuntimeContext } from './resolveMemoryRuntimeContext';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Gets MEMORY tool function implementations.
|
|
20
|
-
*
|
|
21
|
-
* @private function of MemoryCommitmentDefinition
|
|
22
|
-
*/
|
|
23
|
-
export function createMemoryToolFunctions(): Record<string_javascript_name, ToolFunction> {
|
|
24
|
-
return {
|
|
25
|
-
async [MemoryToolNames.retrieve](args: RetrieveMemoryToolArgs): Promise<string> {
|
|
26
|
-
const runtimeContext = resolveMemoryRuntimeContext(args);
|
|
27
|
-
const { adapter, disabledResult } = getMemoryToolRuntimeAdapterOrDisabledResult('retrieve', runtimeContext);
|
|
28
|
-
|
|
29
|
-
if (!adapter || disabledResult) {
|
|
30
|
-
return JSON.stringify(disabledResult);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const parsedArgs = parseMemoryToolArgs.retrieve(args);
|
|
34
|
-
|
|
35
|
-
try {
|
|
36
|
-
const memories = await adapter.retrieveMemories(parsedArgs, runtimeContext);
|
|
37
|
-
const result: RetrieveMemoryToolResult = {
|
|
38
|
-
action: 'retrieve',
|
|
39
|
-
status: 'ok',
|
|
40
|
-
query: parsedArgs.query,
|
|
41
|
-
memories,
|
|
42
|
-
};
|
|
43
|
-
return JSON.stringify(result);
|
|
44
|
-
} catch (error) {
|
|
45
|
-
const result: RetrieveMemoryToolResult = {
|
|
46
|
-
action: 'retrieve',
|
|
47
|
-
status: 'error',
|
|
48
|
-
query: parsedArgs.query,
|
|
49
|
-
memories: [],
|
|
50
|
-
message: error instanceof Error ? error.message : String(error),
|
|
51
|
-
};
|
|
52
|
-
return JSON.stringify(result);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
async [MemoryToolNames.store](args: StoreMemoryToolArgs): Promise<string> {
|
|
56
|
-
const runtimeContext = resolveMemoryRuntimeContext(args);
|
|
57
|
-
const { adapter, disabledResult } = getMemoryToolRuntimeAdapterOrDisabledResult('store', runtimeContext);
|
|
58
|
-
|
|
59
|
-
if (!adapter || disabledResult) {
|
|
60
|
-
return JSON.stringify(disabledResult);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
try {
|
|
64
|
-
const parsedArgs = parseMemoryToolArgs.store(args);
|
|
65
|
-
const memory = await adapter.storeMemory(parsedArgs, runtimeContext);
|
|
66
|
-
const result: StoreMemoryToolResult = {
|
|
67
|
-
action: 'store',
|
|
68
|
-
status: 'stored',
|
|
69
|
-
memory,
|
|
70
|
-
};
|
|
71
|
-
return JSON.stringify(result);
|
|
72
|
-
} catch (error) {
|
|
73
|
-
const result: StoreMemoryToolResult = {
|
|
74
|
-
action: 'store',
|
|
75
|
-
status: 'error',
|
|
76
|
-
message: error instanceof Error ? error.message : String(error),
|
|
77
|
-
};
|
|
78
|
-
return JSON.stringify(result);
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
async [MemoryToolNames.update](args: UpdateMemoryToolArgs): Promise<string> {
|
|
82
|
-
const runtimeContext = resolveMemoryRuntimeContext(args);
|
|
83
|
-
const { adapter, disabledResult } = getMemoryToolRuntimeAdapterOrDisabledResult('update', runtimeContext);
|
|
84
|
-
|
|
85
|
-
if (!adapter || disabledResult) {
|
|
86
|
-
return JSON.stringify(disabledResult);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
try {
|
|
90
|
-
const parsedArgs = parseMemoryToolArgs.update(args);
|
|
91
|
-
const memory = await adapter.updateMemory(parsedArgs, runtimeContext);
|
|
92
|
-
const result: UpdateMemoryToolResult = {
|
|
93
|
-
action: 'update',
|
|
94
|
-
status: 'updated',
|
|
95
|
-
memory,
|
|
96
|
-
};
|
|
97
|
-
return JSON.stringify(result);
|
|
98
|
-
} catch (error) {
|
|
99
|
-
const result: UpdateMemoryToolResult = {
|
|
100
|
-
action: 'update',
|
|
101
|
-
status: 'error',
|
|
102
|
-
message: error instanceof Error ? error.message : String(error),
|
|
103
|
-
};
|
|
104
|
-
return JSON.stringify(result);
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
async [MemoryToolNames.delete](args: DeleteMemoryToolArgs): Promise<string> {
|
|
108
|
-
const runtimeContext = resolveMemoryRuntimeContext(args);
|
|
109
|
-
const { adapter, disabledResult } = getMemoryToolRuntimeAdapterOrDisabledResult('delete', runtimeContext);
|
|
110
|
-
|
|
111
|
-
if (!adapter || disabledResult) {
|
|
112
|
-
return JSON.stringify(disabledResult);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
try {
|
|
116
|
-
const parsedArgs = parseMemoryToolArgs.delete(args);
|
|
117
|
-
const deleted = await adapter.deleteMemory(parsedArgs, runtimeContext);
|
|
118
|
-
const result: DeleteMemoryToolResult = {
|
|
119
|
-
action: 'delete',
|
|
120
|
-
status: 'deleted',
|
|
121
|
-
memoryId: deleted.id,
|
|
122
|
-
};
|
|
123
|
-
return JSON.stringify(result);
|
|
124
|
-
} catch (error) {
|
|
125
|
-
const result: DeleteMemoryToolResult = {
|
|
126
|
-
action: 'delete',
|
|
127
|
-
status: 'error',
|
|
128
|
-
message: error instanceof Error ? error.message : String(error),
|
|
129
|
-
};
|
|
130
|
-
return JSON.stringify(result);
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { spaceTrim } from 'spacetrim';
|
|
2
|
-
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
3
|
-
import { MemoryToolNames } from './MemoryToolNames';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Concrete type of tool definitions in `AgentModelRequirements`.
|
|
7
|
-
*
|
|
8
|
-
* @private type of MemoryCommitmentDefinition
|
|
9
|
-
*/
|
|
10
|
-
type AgentModelTools = NonNullable<AgentModelRequirements['tools']>;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Creates MEMORY tool definitions while preserving already-registered tools.
|
|
14
|
-
*
|
|
15
|
-
* @private function of MemoryCommitmentDefinition
|
|
16
|
-
*/
|
|
17
|
-
export function createMemoryTools(existingTools: AgentModelRequirements['tools']): AgentModelTools {
|
|
18
|
-
const tools = [...(existingTools || [])];
|
|
19
|
-
|
|
20
|
-
if (!tools.some((tool) => tool.name === MemoryToolNames.retrieve)) {
|
|
21
|
-
tools.push({
|
|
22
|
-
name: MemoryToolNames.retrieve,
|
|
23
|
-
description: spaceTrim(`
|
|
24
|
-
Retrieve previously stored user memories relevant to the current conversation.
|
|
25
|
-
Use this before responding when user context can improve the answer.
|
|
26
|
-
`),
|
|
27
|
-
parameters: {
|
|
28
|
-
type: 'object',
|
|
29
|
-
properties: {
|
|
30
|
-
query: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'Optional query used to filter relevant memories.',
|
|
33
|
-
},
|
|
34
|
-
limit: {
|
|
35
|
-
type: 'integer',
|
|
36
|
-
description: 'Optional maximum number of memories to return (default 5, max 20).',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!tools.some((tool) => tool.name === MemoryToolNames.store)) {
|
|
44
|
-
tools.push({
|
|
45
|
-
name: MemoryToolNames.store,
|
|
46
|
-
description: spaceTrim(`
|
|
47
|
-
Store a durable user memory that should be remembered in future conversations.
|
|
48
|
-
Store only stable and useful user-specific facts or preferences.
|
|
49
|
-
`),
|
|
50
|
-
parameters: {
|
|
51
|
-
type: 'object',
|
|
52
|
-
properties: {
|
|
53
|
-
content: {
|
|
54
|
-
type: 'string',
|
|
55
|
-
description: 'Memory text to store.',
|
|
56
|
-
},
|
|
57
|
-
isGlobal: {
|
|
58
|
-
type: 'boolean',
|
|
59
|
-
description: 'Set true to make this memory global across all user agents.',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
required: ['content'],
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (!tools.some((tool) => tool.name === MemoryToolNames.update)) {
|
|
68
|
-
tools.push({
|
|
69
|
-
name: MemoryToolNames.update,
|
|
70
|
-
description: spaceTrim(`
|
|
71
|
-
Update an existing user memory after retrieving it, so the stored fact stays accurate.
|
|
72
|
-
Always pass the memory id you retrieved along with the new content.
|
|
73
|
-
`),
|
|
74
|
-
parameters: {
|
|
75
|
-
type: 'object',
|
|
76
|
-
properties: {
|
|
77
|
-
memoryId: {
|
|
78
|
-
type: 'string',
|
|
79
|
-
description: 'Unique identifier of the memory entry to update.',
|
|
80
|
-
},
|
|
81
|
-
content: {
|
|
82
|
-
type: 'string',
|
|
83
|
-
description: 'Updated memory text.',
|
|
84
|
-
},
|
|
85
|
-
isGlobal: {
|
|
86
|
-
type: 'boolean',
|
|
87
|
-
description: 'Set true to keep the fact global; omit or false to keep it agent-scoped.',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
required: ['memoryId', 'content'],
|
|
91
|
-
},
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (!tools.some((tool) => tool.name === MemoryToolNames.delete)) {
|
|
96
|
-
tools.push({
|
|
97
|
-
name: MemoryToolNames.delete,
|
|
98
|
-
description: spaceTrim(`
|
|
99
|
-
Delete a user memory that is no longer relevant. Deletions are soft so the record is hidden from future queries.
|
|
100
|
-
`),
|
|
101
|
-
parameters: {
|
|
102
|
-
type: 'object',
|
|
103
|
-
properties: {
|
|
104
|
-
memoryId: {
|
|
105
|
-
type: 'string',
|
|
106
|
-
description: 'Unique identifier of the memory entry to delete.',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
required: ['memoryId'],
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return tools;
|
|
115
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { spaceTrim } from 'spacetrim';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Markdown documentation for MEMORY commitment.
|
|
5
|
-
*
|
|
6
|
-
* @private function of MemoryCommitmentDefinition
|
|
7
|
-
*/
|
|
8
|
-
export function getMemoryCommitmentDocumentation(type: 'MEMORY' | 'MEMORIES'): string {
|
|
9
|
-
return spaceTrim(`
|
|
10
|
-
# ${type}
|
|
11
|
-
|
|
12
|
-
Enables persistent user memory for the current agent. The memory is stored by the runtime and can be retrieved in future conversations.
|
|
13
|
-
|
|
14
|
-
## Key aspects
|
|
15
|
-
|
|
16
|
-
- Both \`MEMORY\` and \`MEMORIES\` work identically.
|
|
17
|
-
- Stores user-specific details through runtime tools.
|
|
18
|
-
- Retrieves relevant memories for personalized responses.
|
|
19
|
-
- Supports optional extra instructions in the commitment content.
|
|
20
|
-
|
|
21
|
-
## Examples
|
|
22
|
-
|
|
23
|
-
\`\`\`book
|
|
24
|
-
Personal Assistant
|
|
25
|
-
|
|
26
|
-
PERSONA You are a personal productivity assistant
|
|
27
|
-
MEMORY Remember user projects and long-term preferences.
|
|
28
|
-
GOAL Help optimize daily productivity and workflow
|
|
29
|
-
\`\`\`
|
|
30
|
-
|
|
31
|
-
\`\`\`book
|
|
32
|
-
Learning Companion
|
|
33
|
-
|
|
34
|
-
PERSONA You are an educational companion for programming students
|
|
35
|
-
MEMORY Remember only the student's learning progress and preferred study style.
|
|
36
|
-
GOAL Provide progressive learning experiences tailored to student's pace
|
|
37
|
-
\`\`\`
|
|
38
|
-
|
|
39
|
-
\`\`\`book
|
|
40
|
-
Customer Support Agent
|
|
41
|
-
|
|
42
|
-
PERSONA You are a customer support representative
|
|
43
|
-
MEMORY Remember only important support history and communication preferences.
|
|
44
|
-
GOAL Provide personalized support based on customer history
|
|
45
|
-
\`\`\`
|
|
46
|
-
`);
|
|
47
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
DeleteMemoryToolResult,
|
|
3
|
-
MemoryToolAction,
|
|
4
|
-
MemoryToolResult,
|
|
5
|
-
MemoryToolRuntimeAdapter,
|
|
6
|
-
MemoryToolRuntimeContext,
|
|
7
|
-
RetrieveMemoryToolResult,
|
|
8
|
-
StoreMemoryToolResult,
|
|
9
|
-
UpdateMemoryToolResult,
|
|
10
|
-
} from './MemoryToolRuntimeAdapter';
|
|
11
|
-
import { getMemoryToolRuntimeAdapter } from './setMemoryToolRuntimeAdapter';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Builds a disabled memory-tool response payload.
|
|
15
|
-
*
|
|
16
|
-
* @private function of MemoryCommitmentDefinition
|
|
17
|
-
*/
|
|
18
|
-
function createDisabledMemoryResult(action: MemoryToolAction, message: string): MemoryToolResult {
|
|
19
|
-
if (action === 'retrieve') {
|
|
20
|
-
return {
|
|
21
|
-
action,
|
|
22
|
-
status: 'disabled',
|
|
23
|
-
memories: [],
|
|
24
|
-
message,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (action === 'store') {
|
|
29
|
-
return {
|
|
30
|
-
action,
|
|
31
|
-
status: 'disabled',
|
|
32
|
-
message,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (action === 'update') {
|
|
37
|
-
return {
|
|
38
|
-
action,
|
|
39
|
-
status: 'disabled',
|
|
40
|
-
message,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (action === 'delete') {
|
|
45
|
-
return {
|
|
46
|
-
action,
|
|
47
|
-
status: 'disabled',
|
|
48
|
-
message,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
throw new Error(`Unsupported memory tool action: ${action}`);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Return type of MEMORY adapter resolution helper.
|
|
57
|
-
*
|
|
58
|
-
* @private type of MemoryCommitmentDefinition
|
|
59
|
-
*/
|
|
60
|
-
type MemoryToolRuntimeAdapterResolution = {
|
|
61
|
-
adapter: MemoryToolRuntimeAdapter | null;
|
|
62
|
-
disabledResult:
|
|
63
|
-
| RetrieveMemoryToolResult
|
|
64
|
-
| StoreMemoryToolResult
|
|
65
|
-
| UpdateMemoryToolResult
|
|
66
|
-
| DeleteMemoryToolResult
|
|
67
|
-
| null;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Gets the runtime adapter and returns a disabled result when unavailable.
|
|
72
|
-
*
|
|
73
|
-
* @private function of MemoryCommitmentDefinition
|
|
74
|
-
*/
|
|
75
|
-
export function getMemoryToolRuntimeAdapterOrDisabledResult(
|
|
76
|
-
action: MemoryToolAction,
|
|
77
|
-
runtimeContext: MemoryToolRuntimeContext,
|
|
78
|
-
): MemoryToolRuntimeAdapterResolution {
|
|
79
|
-
if (!runtimeContext.enabled || runtimeContext.isTeamConversation || runtimeContext.isPrivateMode) {
|
|
80
|
-
const message = runtimeContext.isPrivateMode
|
|
81
|
-
? 'Memory is disabled because private mode is active.'
|
|
82
|
-
: runtimeContext.isTeamConversation
|
|
83
|
-
? 'Memory is disabled for TEAM conversations.'
|
|
84
|
-
: 'Memory is disabled for unauthenticated users.';
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
adapter: null,
|
|
88
|
-
disabledResult: createDisabledMemoryResult(action, message),
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const memoryToolRuntimeAdapter = getMemoryToolRuntimeAdapter();
|
|
93
|
-
if (!memoryToolRuntimeAdapter) {
|
|
94
|
-
return {
|
|
95
|
-
adapter: null,
|
|
96
|
-
disabledResult: createDisabledMemoryResult(action, 'Memory runtime is not available in this environment.'),
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return {
|
|
101
|
-
adapter: memoryToolRuntimeAdapter,
|
|
102
|
-
disabledResult: null,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { string_javascript_name } from '../../types/string_person_fullname';
|
|
2
|
-
import { MemoryToolNames } from './MemoryToolNames';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Gets human-readable titles for MEMORY tool functions.
|
|
6
|
-
*
|
|
7
|
-
* @private function of MemoryCommitmentDefinition
|
|
8
|
-
*/
|
|
9
|
-
export function getMemoryToolTitles(): Record<string_javascript_name, string> {
|
|
10
|
-
return {
|
|
11
|
-
[MemoryToolNames.retrieve]: 'User memory',
|
|
12
|
-
[MemoryToolNames.store]: 'Store user memory',
|
|
13
|
-
[MemoryToolNames.update]: 'Update user memory',
|
|
14
|
-
[MemoryToolNames.delete]: 'Delete user memory',
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
DeleteMemoryToolArgs,
|
|
3
|
-
RetrieveMemoryToolArgs,
|
|
4
|
-
StoreMemoryToolArgs,
|
|
5
|
-
UpdateMemoryToolArgs,
|
|
6
|
-
} from './MemoryToolRuntimeAdapter';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Parsed retrieve memory arguments.
|
|
10
|
-
*
|
|
11
|
-
* @private type of MemoryCommitmentDefinition
|
|
12
|
-
*/
|
|
13
|
-
type ParsedRetrieveMemoryArgs = {
|
|
14
|
-
query?: string;
|
|
15
|
-
limit?: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Parsed store memory arguments.
|
|
20
|
-
*
|
|
21
|
-
* @private type of MemoryCommitmentDefinition
|
|
22
|
-
*/
|
|
23
|
-
type ParsedStoreMemoryArgs = {
|
|
24
|
-
content: string;
|
|
25
|
-
isGlobal: boolean;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Parsed update memory arguments.
|
|
30
|
-
*
|
|
31
|
-
* @private type of MemoryCommitmentDefinition
|
|
32
|
-
*/
|
|
33
|
-
type ParsedUpdateMemoryArgs = {
|
|
34
|
-
memoryId: string;
|
|
35
|
-
content: string;
|
|
36
|
-
isGlobal?: boolean;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Parsed delete memory arguments.
|
|
41
|
-
*
|
|
42
|
-
* @private type of MemoryCommitmentDefinition
|
|
43
|
-
*/
|
|
44
|
-
type ParsedDeleteMemoryArgs = {
|
|
45
|
-
memoryId: string;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Parses a memory identifier argument shared across MEMORY tools.
|
|
50
|
-
*
|
|
51
|
-
* @private function of MemoryCommitmentDefinition
|
|
52
|
-
*/
|
|
53
|
-
function parseMemoryIdArg(value: unknown): string {
|
|
54
|
-
const memoryId = typeof value === 'string' ? value.trim() : '';
|
|
55
|
-
if (!memoryId) {
|
|
56
|
-
throw new Error('Memory id is required.');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return memoryId;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Collection of MEMORY tool argument parsers.
|
|
64
|
-
*
|
|
65
|
-
* @private function of MemoryCommitmentDefinition
|
|
66
|
-
*/
|
|
67
|
-
export const parseMemoryToolArgs = {
|
|
68
|
-
/**
|
|
69
|
-
* Parses retrieve memory arguments.
|
|
70
|
-
*/
|
|
71
|
-
retrieve(args: RetrieveMemoryToolArgs): ParsedRetrieveMemoryArgs {
|
|
72
|
-
const query = typeof args.query === 'string' ? args.query.trim() : undefined;
|
|
73
|
-
const limit =
|
|
74
|
-
typeof args.limit === 'number' && Number.isFinite(args.limit) ? Math.floor(args.limit) : undefined;
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
query: query && query.length > 0 ? query : undefined,
|
|
78
|
-
limit: limit && limit > 0 ? Math.min(limit, 20) : undefined,
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Parses store memory arguments.
|
|
84
|
-
*/
|
|
85
|
-
store(args: StoreMemoryToolArgs): ParsedStoreMemoryArgs {
|
|
86
|
-
const content = typeof args.content === 'string' ? args.content.trim() : '';
|
|
87
|
-
|
|
88
|
-
if (!content) {
|
|
89
|
-
throw new Error('Memory content is required.');
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return {
|
|
93
|
-
content,
|
|
94
|
-
isGlobal: args.isGlobal === true,
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Parses update memory arguments.
|
|
100
|
-
*/
|
|
101
|
-
update(args: UpdateMemoryToolArgs): ParsedUpdateMemoryArgs {
|
|
102
|
-
const memoryId = parseMemoryIdArg(args.memoryId);
|
|
103
|
-
const content = typeof args.content === 'string' ? args.content.trim() : '';
|
|
104
|
-
|
|
105
|
-
if (!content) {
|
|
106
|
-
throw new Error('Memory content is required.');
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const isGlobal = typeof args.isGlobal === 'boolean' ? args.isGlobal : undefined;
|
|
110
|
-
|
|
111
|
-
return {
|
|
112
|
-
memoryId,
|
|
113
|
-
content,
|
|
114
|
-
isGlobal,
|
|
115
|
-
};
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Parses delete memory arguments.
|
|
120
|
-
*/
|
|
121
|
-
delete(args: DeleteMemoryToolArgs): ParsedDeleteMemoryArgs {
|
|
122
|
-
return {
|
|
123
|
-
memoryId: parseMemoryIdArg(args.memoryId),
|
|
124
|
-
};
|
|
125
|
-
},
|
|
126
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { TODO_any } from '../../utils/organization/TODO_any';
|
|
2
|
-
import { readToolRuntimeContextFromToolArgs } from '../_common/toolRuntimeContext';
|
|
3
|
-
import type { MemoryToolRuntimeContext } from './MemoryToolRuntimeAdapter';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Resolves runtime context from hidden tool arguments.
|
|
7
|
-
*
|
|
8
|
-
* @private function of MemoryCommitmentDefinition
|
|
9
|
-
*/
|
|
10
|
-
export function resolveMemoryRuntimeContext(args: Record<string, TODO_any>): MemoryToolRuntimeContext {
|
|
11
|
-
const runtimeContext = readToolRuntimeContextFromToolArgs(args);
|
|
12
|
-
const memoryContext = runtimeContext?.memory;
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
enabled: memoryContext?.enabled === true,
|
|
16
|
-
userId: memoryContext?.userId,
|
|
17
|
-
username: memoryContext?.username,
|
|
18
|
-
agentId: memoryContext?.agentId,
|
|
19
|
-
agentName: memoryContext?.agentName,
|
|
20
|
-
isTeamConversation: memoryContext?.isTeamConversation === true,
|
|
21
|
-
isPrivateMode: memoryContext?.isPrivateMode === true,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { MemoryToolRuntimeAdapter } from './MemoryToolRuntimeAdapter';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Runtime adapter used by MEMORY tool functions.
|
|
5
|
-
*
|
|
6
|
-
* @private function of MemoryCommitmentDefinition
|
|
7
|
-
*/
|
|
8
|
-
let memoryToolRuntimeAdapter: MemoryToolRuntimeAdapter | null = null;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Sets runtime adapter used by MEMORY commitment tools.
|
|
12
|
-
*
|
|
13
|
-
* @private function of MemoryCommitmentDefinition
|
|
14
|
-
*/
|
|
15
|
-
export function setMemoryToolRuntimeAdapter(adapter: MemoryToolRuntimeAdapter | null): void {
|
|
16
|
-
memoryToolRuntimeAdapter = adapter;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Gets runtime adapter used by MEMORY commitment tools.
|
|
21
|
-
*
|
|
22
|
-
* @private function of MemoryCommitmentDefinition
|
|
23
|
-
*/
|
|
24
|
-
export function getMemoryToolRuntimeAdapter(): MemoryToolRuntimeAdapter | null {
|
|
25
|
-
return memoryToolRuntimeAdapter;
|
|
26
|
-
}
|