openloops 0.10.2 → 0.11.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/CHANGELOG.md +25 -2
- package/README.md +14 -20
- package/dist/clients/llm/llm-client.d.ts +2 -2
- package/dist/clients/llm/llm-client.js +17 -18
- package/dist/clients/llm/llm-client.mjs +12 -13
- package/dist/clients/llm/llm-types.d.ts +2 -2
- package/dist/clients/llm/model-resolution.js +4 -5
- package/dist/clients/llm/model-resolution.mjs +1 -2
- package/dist/clients/serper/serper-client.js +3 -4
- package/dist/clients/serper/serper-client.mjs +1 -2
- package/dist/clients/slack/slack-client.js +2 -2
- package/dist/clients/slack/slack-client.mjs +1 -1
- package/dist/common/utils/number-setting.js +2 -2
- package/dist/common/utils/number-setting.mjs +1 -1
- package/dist/db/indexes/index.js +1 -5
- package/dist/db/indexes/index.mjs +1 -5
- package/dist/guardrails/guard.d.ts +4 -4
- package/dist/harness/actor-profile.d.ts +2 -0
- package/dist/{common/error/error-reporter.js → harness/actor-profile.js} +10 -13
- package/dist/harness/actor-profile.mjs +9 -0
- package/dist/harness/agent-loop.d.ts +4 -5
- package/dist/harness/agent.d.ts +7 -7
- package/dist/harness/agent.js +46 -46
- package/dist/harness/agent.mjs +44 -44
- package/dist/harness/default-model.d.ts +20 -0
- package/dist/harness/default-model.js +72 -0
- package/dist/harness/default-model.mjs +46 -0
- package/dist/harness/index.d.ts +2 -0
- package/dist/harness/index.js +8 -1
- package/dist/harness/index.mjs +5 -1
- package/dist/harness/tool-pipeline.d.ts +1 -1
- package/dist/harness/tool-pipeline.js +3 -3
- package/dist/harness/tool-pipeline.mjs +1 -1
- package/dist/harness/usage-limit.d.ts +2 -2
- package/dist/harness/usage-limit.js +5 -3
- package/dist/harness/usage-limit.mjs +5 -3
- package/dist/harness/workspace.d.ts +3 -3
- package/dist/harness/workspace.js +8 -8
- package/dist/harness/workspace.mjs +8 -8
- package/dist/loops/agi/loop.js +2 -2
- package/dist/loops/agi/loop.mjs +2 -2
- package/dist/services/automations/entities/automation-run.entity.d.ts +1 -1
- package/dist/services/automations/entities/automation-run.entity.js +4 -4
- package/dist/services/automations/entities/automation-run.entity.mjs +1 -1
- package/dist/services/automations/entities/automation.entity.d.ts +1 -1
- package/dist/services/automations/entities/automation.entity.js +3 -3
- package/dist/services/automations/entities/automation.entity.mjs +1 -1
- package/dist/services/automations/repositories/automation-run.repository.d.ts +1 -1
- package/dist/services/automations/repositories/automation-run.repository.js +5 -6
- package/dist/services/automations/repositories/automation-run.repository.mjs +2 -3
- package/dist/services/automations/repositories/automation.repository.d.ts +1 -1
- package/dist/services/automations/repositories/automation.repository.js +5 -6
- package/dist/services/automations/repositories/automation.repository.mjs +2 -3
- package/dist/services/automations/runner/automation-runner.d.ts +4 -4
- package/dist/services/automations/runner/automation-runner.js +16 -15
- package/dist/services/automations/runner/automation-runner.mjs +11 -10
- package/dist/services/automations/use-cases/attach-automation-run-chat.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/attach-automation-run-chat.use-case.js +2 -2
- package/dist/services/automations/use-cases/attach-automation-run-chat.use-case.mjs +1 -1
- package/dist/services/automations/use-cases/claim-due-automations.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/claim-due-automations.use-case.js +3 -4
- package/dist/services/automations/use-cases/claim-due-automations.use-case.mjs +1 -2
- package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.js +2 -2
- package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.mjs +1 -1
- package/dist/services/automations/use-cases/create-automation.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/create-automation.use-case.js +8 -8
- package/dist/services/automations/use-cases/create-automation.use-case.mjs +5 -5
- package/dist/services/automations/use-cases/delete-automation.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/delete-automation.use-case.js +8 -8
- package/dist/services/automations/use-cases/delete-automation.use-case.mjs +5 -5
- package/dist/services/automations/use-cases/finish-automation-run.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/finish-automation-run.use-case.js +2 -2
- package/dist/services/automations/use-cases/finish-automation-run.use-case.mjs +1 -1
- package/dist/services/automations/use-cases/get-automation-by-id.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/get-automation-by-id.use-case.js +7 -7
- package/dist/services/automations/use-cases/get-automation-by-id.use-case.mjs +4 -4
- package/dist/services/automations/use-cases/issue-automation-event-token.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/issue-automation-event-token.use-case.js +7 -7
- package/dist/services/automations/use-cases/issue-automation-event-token.use-case.mjs +4 -4
- package/dist/services/automations/use-cases/list-automation-runs-by-automation.use-case.d.ts +2 -2
- package/dist/services/automations/use-cases/list-automation-runs-by-automation.use-case.js +7 -7
- package/dist/services/automations/use-cases/list-automation-runs-by-automation.use-case.mjs +4 -4
- package/dist/services/automations/use-cases/list-automation-runs-by-user.use-case.d.ts +2 -2
- package/dist/services/automations/use-cases/list-automation-runs-by-user.use-case.js +9 -9
- package/dist/services/automations/use-cases/list-automation-runs-by-user.use-case.mjs +6 -6
- package/dist/services/automations/use-cases/list-automations-by-user.use-case.d.ts +2 -2
- package/dist/services/automations/use-cases/list-automations-by-user.use-case.js +9 -9
- package/dist/services/automations/use-cases/list-automations-by-user.use-case.mjs +6 -6
- package/dist/services/automations/use-cases/preview-automation-runs.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/preview-automation-runs.use-case.js +2 -2
- package/dist/services/automations/use-cases/preview-automation-runs.use-case.mjs +1 -1
- package/dist/services/automations/use-cases/receive-automation-event.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/receive-automation-event.use-case.js +3 -3
- package/dist/services/automations/use-cases/receive-automation-event.use-case.mjs +2 -2
- package/dist/services/automations/use-cases/renew-automation-lease.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/renew-automation-lease.use-case.js +2 -2
- package/dist/services/automations/use-cases/renew-automation-lease.use-case.mjs +1 -1
- package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.js +10 -11
- package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.mjs +7 -8
- package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.js +7 -7
- package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.mjs +4 -4
- package/dist/services/automations/use-cases/start-automation-run.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/start-automation-run.use-case.js +5 -5
- package/dist/services/automations/use-cases/start-automation-run.use-case.mjs +4 -4
- package/dist/services/automations/use-cases/sync-automation-run.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/sync-automation-run.use-case.js +2 -2
- package/dist/services/automations/use-cases/sync-automation-run.use-case.mjs +1 -1
- package/dist/services/automations/use-cases/sync-automation-runs.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/sync-automation-runs.use-case.js +2 -2
- package/dist/services/automations/use-cases/sync-automation-runs.use-case.mjs +1 -1
- package/dist/services/automations/use-cases/update-automation.use-case.d.ts +1 -1
- package/dist/services/automations/use-cases/update-automation.use-case.js +8 -9
- package/dist/services/automations/use-cases/update-automation.use-case.mjs +4 -5
- package/dist/services/automations/utils/event-token.d.ts +1 -0
- package/dist/services/automations/utils/event-token.js +9 -6
- package/dist/services/automations/utils/event-token.mjs +3 -1
- package/dist/services/automations/utils/open-run.d.ts +1 -1
- package/dist/services/automations/utils/runner-scope.d.ts +1 -1
- package/dist/services/automations/utils/runner-scope.js +3 -3
- package/dist/services/automations/utils/runner-scope.mjs +1 -1
- package/dist/services/chats/entities/chat-message.entity.d.ts +1 -1
- package/dist/services/chats/entities/chat-message.entity.js +3 -3
- package/dist/services/chats/entities/chat-message.entity.mjs +1 -1
- package/dist/services/chats/entities/chat.entity.d.ts +1 -1
- package/dist/services/chats/entities/chat.entity.js +4 -4
- package/dist/services/chats/entities/chat.entity.mjs +1 -1
- package/dist/services/chats/repositories/chat.repository.d.ts +1 -1
- package/dist/services/chats/repositories/chat.repository.js +5 -6
- package/dist/services/chats/repositories/chat.repository.mjs +2 -3
- package/dist/services/chats/use-cases/create-chat.use-case.d.ts +1 -1
- package/dist/services/chats/use-cases/create-chat.use-case.js +7 -7
- package/dist/services/chats/use-cases/create-chat.use-case.mjs +4 -4
- package/dist/services/chats/use-cases/delete-chat.use-case.d.ts +1 -1
- package/dist/services/chats/use-cases/delete-chat.use-case.js +8 -8
- package/dist/services/chats/use-cases/delete-chat.use-case.mjs +5 -5
- package/dist/services/chats/use-cases/get-chat-by-id.use-case.d.ts +2 -2
- package/dist/services/chats/use-cases/get-chat-by-id.use-case.js +7 -7
- package/dist/services/chats/use-cases/get-chat-by-id.use-case.mjs +4 -4
- package/dist/services/chats/use-cases/interrupt-execution.use-case.d.ts +1 -1
- package/dist/services/chats/use-cases/interrupt-execution.use-case.js +7 -7
- package/dist/services/chats/use-cases/interrupt-execution.use-case.mjs +4 -4
- package/dist/services/chats/use-cases/list-chats-by-props.use-case.d.ts +2 -2
- package/dist/services/chats/use-cases/list-chats-by-props.use-case.js +7 -7
- package/dist/services/chats/use-cases/list-chats-by-props.use-case.mjs +4 -4
- package/dist/services/chats/use-cases/list-chats-by-user.use-case.d.ts +2 -2
- package/dist/services/chats/use-cases/list-chats-by-user.use-case.js +8 -8
- package/dist/services/chats/use-cases/list-chats-by-user.use-case.mjs +5 -5
- package/dist/services/chats/use-cases/update-chat.use-case.d.ts +1 -1
- package/dist/services/chats/use-cases/update-chat.use-case.js +7 -7
- package/dist/services/chats/use-cases/update-chat.use-case.mjs +4 -4
- package/dist/services/llmcalls/entities/llmcall.entity.d.ts +1 -1
- package/dist/services/llmcalls/entities/llmcall.entity.js +4 -4
- package/dist/services/llmcalls/entities/llmcall.entity.mjs +1 -1
- package/dist/services/llmcalls/repositories/llmcall.repository.d.ts +1 -1
- package/dist/services/llmcalls/repositories/llmcall.repository.js +5 -6
- package/dist/services/llmcalls/repositories/llmcall.repository.mjs +2 -3
- package/dist/services/llmcalls/use-cases/create-llmcall.use-case.d.ts +1 -1
- package/dist/services/llmcalls/use-cases/create-llmcall.use-case.js +7 -7
- package/dist/services/llmcalls/use-cases/create-llmcall.use-case.mjs +4 -4
- package/dist/services/llmcalls/use-cases/delete-llmcall.use-case.d.ts +1 -1
- package/dist/services/llmcalls/use-cases/delete-llmcall.use-case.js +8 -8
- package/dist/services/llmcalls/use-cases/delete-llmcall.use-case.mjs +5 -5
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.d.ts +1 -1
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.js +9 -9
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.mjs +6 -6
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.d.ts +1 -1
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.js +9 -9
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.mjs +6 -6
- package/dist/services/llmcalls/use-cases/get-llm-usage-stats.use-case.d.ts +2 -2
- package/dist/services/llmcalls/use-cases/get-llm-usage-stats.use-case.js +12 -10
- package/dist/services/llmcalls/use-cases/get-llm-usage-stats.use-case.mjs +9 -7
- package/dist/services/llmcalls/use-cases/get-llmcall-by-id.use-case.d.ts +1 -1
- package/dist/services/llmcalls/use-cases/get-llmcall-by-id.use-case.js +7 -7
- package/dist/services/llmcalls/use-cases/get-llmcall-by-id.use-case.mjs +4 -4
- package/dist/services/llmcalls/use-cases/list-llmcalls-by-props.use-case.d.ts +2 -2
- package/dist/services/llmcalls/use-cases/list-llmcalls-by-props.use-case.js +5 -5
- package/dist/services/llmcalls/use-cases/list-llmcalls-by-props.use-case.mjs +4 -4
- package/dist/services/llmcalls/use-cases/update-llmcall.use-case.d.ts +1 -1
- package/dist/services/llmcalls/use-cases/update-llmcall.use-case.js +7 -7
- package/dist/services/llmcalls/use-cases/update-llmcall.use-case.mjs +4 -4
- package/dist/services/mcp-servers/admin/admin-params.d.ts +5 -0
- package/dist/{common/logger/index.js → services/mcp-servers/admin/admin-params.js} +2 -8
- package/dist/services/mcp-servers/admin/admin-params.mjs +0 -0
- package/dist/services/mcp-servers/admin/use-cases/create-internal-mcp.use-case.d.ts +3 -2
- package/dist/services/mcp-servers/admin/use-cases/create-internal-mcp.use-case.js +7 -7
- package/dist/services/mcp-servers/admin/use-cases/create-internal-mcp.use-case.mjs +4 -4
- package/dist/services/mcp-servers/admin/use-cases/delete-internal-mcp.use-case.d.ts +3 -2
- package/dist/services/mcp-servers/admin/use-cases/delete-internal-mcp.use-case.js +7 -7
- package/dist/services/mcp-servers/admin/use-cases/delete-internal-mcp.use-case.mjs +4 -4
- package/dist/services/mcp-servers/admin/use-cases/get-internal-mcp-by-id.use-case.d.ts +3 -2
- package/dist/services/mcp-servers/admin/use-cases/get-internal-mcp-by-id.use-case.js +7 -7
- package/dist/services/mcp-servers/admin/use-cases/get-internal-mcp-by-id.use-case.mjs +4 -4
- package/dist/services/mcp-servers/admin/use-cases/list-internal-mcps.use-case.d.ts +4 -3
- package/dist/services/mcp-servers/admin/use-cases/list-internal-mcps.use-case.js +7 -7
- package/dist/services/mcp-servers/admin/use-cases/list-internal-mcps.use-case.mjs +4 -4
- package/dist/services/mcp-servers/admin/use-cases/update-internal-mcp.use-case.d.ts +3 -2
- package/dist/services/mcp-servers/admin/use-cases/update-internal-mcp.use-case.js +8 -9
- package/dist/services/mcp-servers/admin/use-cases/update-internal-mcp.use-case.mjs +4 -5
- package/dist/services/mcp-servers/entities/mcpserver.entity.d.ts +1 -1
- package/dist/services/mcp-servers/entities/mcpserver.entity.js +2 -2
- package/dist/services/mcp-servers/entities/mcpserver.entity.mjs +1 -1
- package/dist/services/mcp-servers/repositories/mcpserver.repository.d.ts +1 -1
- package/dist/services/mcp-servers/repositories/mcpserver.repository.js +6 -7
- package/dist/services/mcp-servers/repositories/mcpserver.repository.mjs +2 -3
- package/dist/services/mcp-servers/use-cases/create-mcpserver.use-case.d.ts +1 -1
- package/dist/services/mcp-servers/use-cases/create-mcpserver.use-case.js +8 -8
- package/dist/services/mcp-servers/use-cases/create-mcpserver.use-case.mjs +5 -5
- package/dist/services/mcp-servers/use-cases/decide-mcpserver-trust.use-case.d.ts +1 -1
- package/dist/services/mcp-servers/use-cases/decide-mcpserver-trust.use-case.js +7 -7
- package/dist/services/mcp-servers/use-cases/decide-mcpserver-trust.use-case.mjs +4 -4
- package/dist/services/mcp-servers/use-cases/delete-mcpserver.use-case.d.ts +1 -1
- package/dist/services/mcp-servers/use-cases/delete-mcpserver.use-case.js +8 -8
- package/dist/services/mcp-servers/use-cases/delete-mcpserver.use-case.mjs +5 -5
- package/dist/services/mcp-servers/use-cases/get-mcpserver-by-id.use-case.d.ts +1 -1
- package/dist/services/mcp-servers/use-cases/get-mcpserver-by-id.use-case.js +7 -7
- package/dist/services/mcp-servers/use-cases/get-mcpserver-by-id.use-case.mjs +4 -4
- package/dist/services/mcp-servers/use-cases/list-all-mcpservers-by-user.use-case.d.ts +1 -1
- package/dist/services/mcp-servers/use-cases/list-all-mcpservers-by-user.use-case.js +8 -8
- package/dist/services/mcp-servers/use-cases/list-all-mcpservers-by-user.use-case.mjs +5 -5
- package/dist/services/mcp-servers/use-cases/list-mcpservers-by-user.use-case.d.ts +2 -2
- package/dist/services/mcp-servers/use-cases/list-mcpservers-by-user.use-case.js +8 -8
- package/dist/services/mcp-servers/use-cases/list-mcpservers-by-user.use-case.mjs +5 -5
- package/dist/services/mcp-servers/use-cases/update-mcpserver.use-case.d.ts +1 -1
- package/dist/services/mcp-servers/use-cases/update-mcpserver.use-case.js +9 -10
- package/dist/services/mcp-servers/use-cases/update-mcpserver.use-case.mjs +5 -6
- package/dist/services/mcp-servers/use-cases/verify-mcpserver-connection.use-case.d.ts +1 -1
- package/dist/services/mcp-servers/use-cases/verify-mcpserver-connection.use-case.js +9 -10
- package/dist/services/mcp-servers/use-cases/verify-mcpserver-connection.use-case.mjs +4 -5
- package/dist/services/tasks/entities/agent-action.entity.d.ts +1 -1
- package/dist/services/tasks/entities/agent-action.entity.js +6 -7
- package/dist/services/tasks/entities/agent-action.entity.mjs +1 -2
- package/dist/services/tasks/entities/agent-task.entity.d.ts +1 -1
- package/dist/services/tasks/entities/agent-task.entity.js +4 -4
- package/dist/services/tasks/entities/agent-task.entity.mjs +1 -1
- package/dist/services/tasks/repositories/agent-action.repository.d.ts +1 -1
- package/dist/services/tasks/repositories/agent-action.repository.js +5 -6
- package/dist/services/tasks/repositories/agent-action.repository.mjs +2 -3
- package/dist/services/tasks/repositories/agent-task.repository.d.ts +1 -1
- package/dist/services/tasks/repositories/agent-task.repository.js +5 -6
- package/dist/services/tasks/repositories/agent-task.repository.mjs +2 -3
- package/dist/services/tasks/use-cases/create-agent-action.use-case.d.ts +1 -1
- package/dist/services/tasks/use-cases/create-agent-action.use-case.js +7 -7
- package/dist/services/tasks/use-cases/create-agent-action.use-case.mjs +4 -4
- package/dist/services/tasks/use-cases/create-agent-task.use-case.d.ts +1 -1
- package/dist/services/tasks/use-cases/create-agent-task.use-case.js +7 -7
- package/dist/services/tasks/use-cases/create-agent-task.use-case.mjs +4 -4
- package/dist/services/tasks/use-cases/get-agent-task-by-id.use-case.d.ts +1 -1
- package/dist/services/tasks/use-cases/get-agent-task-by-id.use-case.js +7 -7
- package/dist/services/tasks/use-cases/get-agent-task-by-id.use-case.mjs +4 -4
- package/dist/services/tasks/use-cases/list-agent-actions-by-task.use-case.d.ts +2 -2
- package/dist/services/tasks/use-cases/list-agent-actions-by-task.use-case.js +9 -10
- package/dist/services/tasks/use-cases/list-agent-actions-by-task.use-case.mjs +6 -7
- package/dist/services/tasks/use-cases/list-agent-tasks-by-chat.use-case.d.ts +2 -2
- package/dist/services/tasks/use-cases/list-agent-tasks-by-chat.use-case.js +9 -10
- package/dist/services/tasks/use-cases/list-agent-tasks-by-chat.use-case.mjs +6 -7
- package/dist/services/tasks/use-cases/update-agent-action.use-case.d.ts +1 -1
- package/dist/services/tasks/use-cases/update-agent-action.use-case.js +7 -7
- package/dist/services/tasks/use-cases/update-agent-action.use-case.mjs +4 -4
- package/dist/services/tasks/use-cases/update-agent-task.use-case.d.ts +1 -1
- package/dist/services/tasks/use-cases/update-agent-task.use-case.js +7 -7
- package/dist/services/tasks/use-cases/update-agent-task.use-case.mjs +4 -4
- package/dist/services/traces/entities/agent-trace-entry.entity.d.ts +1 -1
- package/dist/services/traces/entities/agent-trace-entry.entity.js +6 -6
- package/dist/services/traces/entities/agent-trace-entry.entity.mjs +1 -1
- package/dist/services/traces/repositories/agent-trace.repository.d.ts +1 -1
- package/dist/services/traces/repositories/agent-trace.repository.js +4 -4
- package/dist/services/traces/repositories/agent-trace.repository.mjs +2 -2
- package/dist/services/traces/use-cases/create-agent-traces.use-case.d.ts +1 -1
- package/dist/services/traces/use-cases/create-agent-traces.use-case.js +7 -7
- package/dist/services/traces/use-cases/create-agent-traces.use-case.mjs +4 -4
- package/dist/services/traces/use-cases/list-agent-traces-by-chat.use-case.d.ts +2 -2
- package/dist/services/traces/use-cases/list-agent-traces-by-chat.use-case.js +12 -13
- package/dist/services/traces/use-cases/list-agent-traces-by-chat.use-case.mjs +6 -7
- package/dist/services/workspaces/entities/workspace-item.entity.d.ts +1 -1
- package/dist/services/workspaces/entities/workspace-item.entity.js +5 -5
- package/dist/services/workspaces/entities/workspace-item.entity.mjs +1 -1
- package/dist/services/workspaces/repositories/workspace-item.repository.d.ts +1 -1
- package/dist/services/workspaces/repositories/workspace-item.repository.js +5 -6
- package/dist/services/workspaces/repositories/workspace-item.repository.mjs +2 -3
- package/dist/services/workspaces/use-cases/delete-workspace-item.use-case.d.ts +1 -1
- package/dist/services/workspaces/use-cases/delete-workspace-item.use-case.js +11 -12
- package/dist/services/workspaces/use-cases/delete-workspace-item.use-case.mjs +6 -7
- package/dist/services/workspaces/use-cases/get-workspace-item.use-case.d.ts +1 -1
- package/dist/services/workspaces/use-cases/get-workspace-item.use-case.js +11 -12
- package/dist/services/workspaces/use-cases/get-workspace-item.use-case.mjs +6 -7
- package/dist/services/workspaces/use-cases/list-workspace-items.use-case.d.ts +2 -2
- package/dist/services/workspaces/use-cases/list-workspace-items.use-case.js +11 -12
- package/dist/services/workspaces/use-cases/list-workspace-items.use-case.mjs +6 -7
- package/dist/services/workspaces/use-cases/save-workspace-item.use-case.d.ts +1 -1
- package/dist/services/workspaces/use-cases/save-workspace-item.use-case.js +10 -11
- package/dist/services/workspaces/use-cases/save-workspace-item.use-case.mjs +6 -7
- package/dist/services/workspaces/use-cases/search-workspace-items.use-case.d.ts +2 -2
- package/dist/services/workspaces/use-cases/search-workspace-items.use-case.js +11 -12
- package/dist/services/workspaces/use-cases/search-workspace-items.use-case.mjs +6 -7
- package/dist/skills/runtime-context.d.ts +3 -3
- package/dist/skills/runtime-context.js +24 -21
- package/dist/skills/runtime-context.mjs +24 -21
- package/dist/skills/skill.d.ts +3 -3
- package/dist/skills/skill.js +5 -5
- package/dist/skills/skill.mjs +4 -4
- package/dist/tools/core/call-ai/call-ai.tool.js +2 -2
- package/dist/tools/core/call-ai/call-ai.tool.mjs +2 -2
- package/dist/tools/core/web-search/web-search.tool.js +1 -1
- package/dist/tools/core/web-search/web-search.tool.mjs +1 -1
- package/dist/tools/tool.d.ts +2 -2
- package/dist/tools/tool.js +1 -1
- package/dist/tools/tool.mjs +1 -1
- package/docs/README.md +1 -1
- package/docs/agent.md +10 -10
- package/docs/authentication.md +15 -114
- package/docs/authorization.md +18 -18
- package/docs/automations.md +30 -28
- package/docs/chats.md +14 -14
- package/docs/configuration.md +14 -15
- package/docs/error-reporting.md +6 -6
- package/docs/guardrails.md +1 -1
- package/docs/integration-guide.md +12 -12
- package/docs/loops.md +2 -2
- package/docs/mcp-servers.md +15 -15
- package/docs/skills.md +1 -1
- package/docs/tools.md +2 -2
- package/docs/usage.md +5 -5
- package/docs/users.md +18 -91
- package/examples/automations/create-automation.ts +4 -4
- package/examples/automations/create-event-automation.ts +5 -5
- package/examples/automations/list-automation-runs.ts +7 -7
- package/examples/automations/list-automations.ts +4 -4
- package/examples/automations/preview-automation-runs.ts +1 -1
- package/examples/automations/receive-automation-event.ts +1 -1
- package/examples/automations/revoke-automation-event-token.ts +6 -6
- package/examples/automations/run-automation-now.ts +4 -4
- package/examples/automations/run-automation-worker.ts +1 -1
- package/examples/automations/update-automation.ts +6 -6
- package/examples/chats/delete-chat.ts +6 -6
- package/examples/chats/get-chat-by-id.ts +6 -6
- package/examples/chats/list-autonomous-chats.ts +4 -4
- package/examples/chats/list-chats.ts +4 -4
- package/examples/chats/search-chats.ts +5 -5
- package/examples/errors/error-reporting.ts +6 -6
- package/examples/loops/custom-loop.ts +5 -5
- package/examples/mcps/create-mcp.ts +4 -4
- package/examples/mcps/decide-mcp.ts +7 -7
- package/examples/mcps/delete-mcp.ts +6 -6
- package/examples/mcps/get-mcp-by-id.ts +4 -4
- package/examples/mcps/internal-mcp-admin.ts +8 -8
- package/examples/mcps/internal-mcp.ts +5 -5
- package/examples/mcps/list-all-mcps.ts +4 -4
- package/examples/mcps/list-user-mcps.ts +4 -4
- package/examples/mcps/update-mcp.ts +4 -4
- package/examples/mcps/verify-mcp.ts +4 -4
- package/examples/run-agent/interrupt-agent.ts +5 -5
- package/examples/run-agent/run-agent-autonomous.ts +5 -5
- package/examples/run-agent/run-agent-multi-tenant.ts +10 -11
- package/examples/run-agent/run-agent-strict-mode.ts +5 -5
- package/examples/run-agent/run-agent-with-confirmation.ts +6 -6
- package/examples/run-agent/run-agent-with-fallback-model.ts +5 -5
- package/examples/run-agent/run-agent-with-fetch-url.ts +5 -5
- package/examples/run-agent/run-agent-with-guards.ts +5 -5
- package/examples/run-agent/run-agent-with-hooks.ts +5 -5
- package/examples/run-agent/run-agent-with-identity.ts +5 -5
- package/examples/run-agent/run-agent-with-model.ts +5 -5
- package/examples/run-agent/run-agent-with-slack.ts +5 -5
- package/examples/run-agent/run-agent-with-tools.ts +5 -5
- package/examples/run-agent/run-agent-with-usage-limit-stop.ts +5 -5
- package/examples/run-agent/run-agent-with-usage-limit.ts +5 -5
- package/examples/tools/basic-tool.ts +1 -1
- package/examples/tools/web-search-tool.ts +1 -1
- package/examples/usage/get-chat-usage.ts +4 -4
- package/examples/usage/get-message-usage.ts +4 -4
- package/examples/usage/get-usage-stats-by-range.ts +4 -4
- package/examples/usage/get-usage-stats.ts +4 -4
- package/examples/users/set-default-model.ts +12 -21
- package/package.json +7 -22
- package/dist/common/base/base.app.d.ts +0 -12
- package/dist/common/base/base.app.js +0 -57
- package/dist/common/base/base.app.mjs +0 -33
- package/dist/common/base/base.entity.d.ts +0 -38
- package/dist/common/base/base.entity.js +0 -100
- package/dist/common/base/base.entity.mjs +0 -76
- package/dist/common/base/base.use-case.d.ts +0 -11
- package/dist/common/base/base.use-case.js +0 -30
- package/dist/common/base/base.use-case.mjs +0 -6
- package/dist/common/base/current-session.d.ts +0 -129
- package/dist/common/base/current-session.js +0 -123
- package/dist/common/base/current-session.mjs +0 -98
- package/dist/common/base/current-user.d.ts +0 -16
- package/dist/common/base/current-user.js +0 -85
- package/dist/common/base/current-user.mjs +0 -61
- package/dist/common/base/index.d.ts +0 -3
- package/dist/common/base/index.js +0 -26
- package/dist/common/base/index.mjs +0 -3
- package/dist/common/base/share.d.ts +0 -12
- package/dist/common/base/share.js +0 -45
- package/dist/common/base/share.mjs +0 -20
- package/dist/common/base/utils/index.d.ts +0 -2
- package/dist/common/base/utils/index.js +0 -24
- package/dist/common/base/utils/index.mjs +0 -2
- package/dist/common/base/utils/is-plain-object.d.ts +0 -1
- package/dist/common/base/utils/is-plain-object.js +0 -32
- package/dist/common/base/utils/is-plain-object.mjs +0 -8
- package/dist/common/base/utils/to-patch.d.ts +0 -9
- package/dist/common/base/utils/to-patch.js +0 -46
- package/dist/common/base/utils/to-patch.mjs +0 -21
- package/dist/common/error/error-reporter.d.ts +0 -11
- package/dist/common/error/error-reporter.mjs +0 -11
- package/dist/common/error/http-error.d.ts +0 -11
- package/dist/common/error/http-error.js +0 -37
- package/dist/common/error/http-error.mjs +0 -13
- package/dist/common/error/index.d.ts +0 -3
- package/dist/common/error/index.js +0 -26
- package/dist/common/error/index.mjs +0 -3
- package/dist/common/error/reportError.d.ts +0 -2
- package/dist/common/error/reportError.js +0 -61
- package/dist/common/error/reportError.mjs +0 -37
- package/dist/common/error/sentry-client.d.ts +0 -10
- package/dist/common/error/sentry-client.js +0 -82
- package/dist/common/error/sentry-client.mjs +0 -57
- package/dist/common/index.d.ts +0 -6
- package/dist/common/index.js +0 -37
- package/dist/common/index.mjs +0 -9
- package/dist/common/logger/index.d.ts +0 -1
- package/dist/common/logger/index.mjs +0 -1
- package/dist/common/logger/pino.d.ts +0 -12
- package/dist/common/logger/pino.js +0 -79
- package/dist/common/logger/pino.mjs +0 -44
- package/dist/common/repositories/index.d.ts +0 -3
- package/dist/common/repositories/index.js +0 -26
- package/dist/common/repositories/index.mjs +0 -3
- package/dist/common/repositories/mongo-db.client.d.ts +0 -11
- package/dist/common/repositories/mongo-db.client.js +0 -83
- package/dist/common/repositories/mongo-db.client.mjs +0 -60
- package/dist/common/repositories/mongo-db.repository.d.ts +0 -130
- package/dist/common/repositories/mongo-db.repository.js +0 -357
- package/dist/common/repositories/mongo-db.repository.mjs +0 -332
- package/dist/common/repositories/scope.d.ts +0 -19
- package/dist/common/repositories/scope.js +0 -63
- package/dist/common/repositories/scope.mjs +0 -39
- package/dist/common/utils/config-context.d.ts +0 -3
- package/dist/common/utils/config-context.js +0 -33
- package/dist/common/utils/config-context.mjs +0 -8
- package/dist/common/utils/database-name.d.ts +0 -2
- package/dist/common/utils/database-name.js +0 -32
- package/dist/common/utils/database-name.mjs +0 -7
- package/dist/common/utils/secret-manager.d.ts +0 -17
- package/dist/common/utils/secret-manager.js +0 -124
- package/dist/common/utils/secret-manager.mjs +0 -89
- package/dist/db/indexes/refresh-tokens.d.ts +0 -2
- package/dist/db/indexes/refresh-tokens.js +0 -33
- package/dist/db/indexes/refresh-tokens.mjs +0 -9
- package/dist/db/indexes/revoked-tokens.d.ts +0 -2
- package/dist/db/indexes/revoked-tokens.js +0 -31
- package/dist/db/indexes/revoked-tokens.mjs +0 -7
- package/dist/services/authentication/entities/index.d.ts +0 -2
- package/dist/services/authentication/entities/index.js +0 -24
- package/dist/services/authentication/entities/index.mjs +0 -2
- package/dist/services/authentication/entities/refresh-token.entity.d.ts +0 -25
- package/dist/services/authentication/entities/refresh-token.entity.js +0 -75
- package/dist/services/authentication/entities/refresh-token.entity.mjs +0 -51
- package/dist/services/authentication/entities/revoked-token.entity.d.ts +0 -17
- package/dist/services/authentication/entities/revoked-token.entity.js +0 -67
- package/dist/services/authentication/entities/revoked-token.entity.mjs +0 -43
- package/dist/services/authentication/helpers/auth-config.d.ts +0 -9
- package/dist/services/authentication/helpers/auth-config.js +0 -36
- package/dist/services/authentication/helpers/auth-config.mjs +0 -12
- package/dist/services/authentication/helpers/session-tokens.d.ts +0 -16
- package/dist/services/authentication/helpers/session-tokens.js +0 -60
- package/dist/services/authentication/helpers/session-tokens.mjs +0 -35
- package/dist/services/authentication/helpers/tokens.d.ts +0 -43
- package/dist/services/authentication/helpers/tokens.js +0 -113
- package/dist/services/authentication/helpers/tokens.mjs +0 -71
- package/dist/services/authentication/index.d.ts +0 -5
- package/dist/services/authentication/index.js +0 -47
- package/dist/services/authentication/index.mjs +0 -13
- package/dist/services/authentication/module.d.ts +0 -16
- package/dist/services/authentication/module.js +0 -81
- package/dist/services/authentication/module.mjs +0 -50
- package/dist/services/authentication/repositories/index.d.ts +0 -2
- package/dist/services/authentication/repositories/index.js +0 -24
- package/dist/services/authentication/repositories/index.mjs +0 -2
- package/dist/services/authentication/repositories/refresh-token.repository.d.ts +0 -10
- package/dist/services/authentication/repositories/refresh-token.repository.js +0 -60
- package/dist/services/authentication/repositories/refresh-token.repository.mjs +0 -36
- package/dist/services/authentication/repositories/revoked-token.repository.d.ts +0 -7
- package/dist/services/authentication/repositories/revoked-token.repository.js +0 -44
- package/dist/services/authentication/repositories/revoked-token.repository.mjs +0 -20
- package/dist/services/authentication/use-cases/claim-refresh-token.use-case.d.ts +0 -12
- package/dist/services/authentication/use-cases/claim-refresh-token.use-case.js +0 -40
- package/dist/services/authentication/use-cases/claim-refresh-token.use-case.mjs +0 -16
- package/dist/services/authentication/use-cases/create-refresh-token.use-case.d.ts +0 -11
- package/dist/services/authentication/use-cases/create-refresh-token.use-case.js +0 -43
- package/dist/services/authentication/use-cases/create-refresh-token.use-case.mjs +0 -19
- package/dist/services/authentication/use-cases/find-refresh-token-by-hash.use-case.d.ts +0 -11
- package/dist/services/authentication/use-cases/find-refresh-token-by-hash.use-case.js +0 -40
- package/dist/services/authentication/use-cases/find-refresh-token-by-hash.use-case.mjs +0 -16
- package/dist/services/authentication/use-cases/is-token-revoked.use-case.d.ts +0 -13
- package/dist/services/authentication/use-cases/is-token-revoked.use-case.js +0 -42
- package/dist/services/authentication/use-cases/is-token-revoked.use-case.mjs +0 -18
- package/dist/services/authentication/use-cases/issue-password-reset-token.use-case.d.ts +0 -18
- package/dist/services/authentication/use-cases/issue-password-reset-token.use-case.js +0 -49
- package/dist/services/authentication/use-cases/issue-password-reset-token.use-case.mjs +0 -25
- package/dist/services/authentication/use-cases/issue-session.use-case.d.ts +0 -13
- package/dist/services/authentication/use-cases/issue-session.use-case.js +0 -48
- package/dist/services/authentication/use-cases/issue-session.use-case.mjs +0 -24
- package/dist/services/authentication/use-cases/login.use-case.d.ts +0 -20
- package/dist/services/authentication/use-cases/login.use-case.js +0 -54
- package/dist/services/authentication/use-cases/login.use-case.mjs +0 -30
- package/dist/services/authentication/use-cases/logout.use-case.d.ts +0 -14
- package/dist/services/authentication/use-cases/logout.use-case.js +0 -48
- package/dist/services/authentication/use-cases/logout.use-case.mjs +0 -24
- package/dist/services/authentication/use-cases/refresh.use-case.d.ts +0 -23
- package/dist/services/authentication/use-cases/refresh.use-case.js +0 -84
- package/dist/services/authentication/use-cases/refresh.use-case.mjs +0 -60
- package/dist/services/authentication/use-cases/reset-password.use-case.d.ts +0 -15
- package/dist/services/authentication/use-cases/reset-password.use-case.js +0 -61
- package/dist/services/authentication/use-cases/reset-password.use-case.mjs +0 -37
- package/dist/services/authentication/use-cases/revoke-refresh-token-family.use-case.d.ts +0 -11
- package/dist/services/authentication/use-cases/revoke-refresh-token-family.use-case.js +0 -40
- package/dist/services/authentication/use-cases/revoke-refresh-token-family.use-case.mjs +0 -16
- package/dist/services/authentication/use-cases/revoke-token.use-case.d.ts +0 -12
- package/dist/services/authentication/use-cases/revoke-token.use-case.js +0 -52
- package/dist/services/authentication/use-cases/revoke-token.use-case.mjs +0 -28
- package/dist/services/authentication/use-cases/revoke-user-refresh-tokens.use-case.d.ts +0 -13
- package/dist/services/authentication/use-cases/revoke-user-refresh-tokens.use-case.js +0 -40
- package/dist/services/authentication/use-cases/revoke-user-refresh-tokens.use-case.mjs +0 -16
- package/dist/services/users/entities/index.d.ts +0 -1
- package/dist/services/users/entities/index.js +0 -22
- package/dist/services/users/entities/index.mjs +0 -1
- package/dist/services/users/entities/user-acquisition.d.ts +0 -12
- package/dist/services/users/entities/user-acquisition.js +0 -42
- package/dist/services/users/entities/user-acquisition.mjs +0 -18
- package/dist/services/users/entities/user-country.d.ts +0 -11
- package/dist/services/users/entities/user-country.js +0 -44
- package/dist/services/users/entities/user-country.mjs +0 -20
- package/dist/services/users/entities/user-currency.d.ts +0 -13
- package/dist/services/users/entities/user-currency.js +0 -44
- package/dist/services/users/entities/user-currency.mjs +0 -20
- package/dist/services/users/entities/user-default-model.d.ts +0 -11
- package/dist/services/users/entities/user-default-model.js +0 -42
- package/dist/services/users/entities/user-default-model.mjs +0 -18
- package/dist/services/users/entities/user-email.value-object.d.ts +0 -6
- package/dist/services/users/entities/user-email.value-object.js +0 -43
- package/dist/services/users/entities/user-email.value-object.mjs +0 -19
- package/dist/services/users/entities/user-language.d.ts +0 -11
- package/dist/services/users/entities/user-language.js +0 -44
- package/dist/services/users/entities/user-language.mjs +0 -20
- package/dist/services/users/entities/user-marketing.d.ts +0 -9
- package/dist/services/users/entities/user-marketing.js +0 -40
- package/dist/services/users/entities/user-marketing.mjs +0 -16
- package/dist/services/users/entities/user-notification-preferences.d.ts +0 -11
- package/dist/services/users/entities/user-notification-preferences.js +0 -41
- package/dist/services/users/entities/user-notification-preferences.mjs +0 -17
- package/dist/services/users/entities/user-password.value-object.d.ts +0 -8
- package/dist/services/users/entities/user-password.value-object.js +0 -69
- package/dist/services/users/entities/user-password.value-object.mjs +0 -35
- package/dist/services/users/entities/user-permissions.d.ts +0 -21
- package/dist/services/users/entities/user-permissions.js +0 -59
- package/dist/services/users/entities/user-permissions.mjs +0 -35
- package/dist/services/users/entities/user-preferences.d.ts +0 -28
- package/dist/services/users/entities/user-preferences.js +0 -74
- package/dist/services/users/entities/user-preferences.mjs +0 -50
- package/dist/services/users/entities/user-report-preferences.d.ts +0 -16
- package/dist/services/users/entities/user-report-preferences.js +0 -56
- package/dist/services/users/entities/user-report-preferences.mjs +0 -32
- package/dist/services/users/entities/user-report-schedule.d.ts +0 -11
- package/dist/services/users/entities/user-report-schedule.js +0 -41
- package/dist/services/users/entities/user-report-schedule.mjs +0 -17
- package/dist/services/users/entities/user-timezone.d.ts +0 -11
- package/dist/services/users/entities/user-timezone.js +0 -44
- package/dist/services/users/entities/user-timezone.mjs +0 -20
- package/dist/services/users/entities/user.entity.d.ts +0 -42
- package/dist/services/users/entities/user.entity.js +0 -117
- package/dist/services/users/entities/user.entity.mjs +0 -92
- package/dist/services/users/index.d.ts +0 -3
- package/dist/services/users/index.js +0 -26
- package/dist/services/users/index.mjs +0 -3
- package/dist/services/users/module.d.ts +0 -12
- package/dist/services/users/module.js +0 -67
- package/dist/services/users/module.mjs +0 -38
- package/dist/services/users/repositories/index.d.ts +0 -1
- package/dist/services/users/repositories/index.js +0 -22
- package/dist/services/users/repositories/index.mjs +0 -1
- package/dist/services/users/repositories/user.repository.d.ts +0 -18
- package/dist/services/users/repositories/user.repository.js +0 -88
- package/dist/services/users/repositories/user.repository.mjs +0 -64
- package/dist/services/users/use-cases/change-password.use-case.d.ts +0 -15
- package/dist/services/users/use-cases/change-password.use-case.js +0 -52
- package/dist/services/users/use-cases/change-password.use-case.mjs +0 -28
- package/dist/services/users/use-cases/create-user.use-case.d.ts +0 -12
- package/dist/services/users/use-cases/create-user.use-case.js +0 -49
- package/dist/services/users/use-cases/create-user.use-case.mjs +0 -25
- package/dist/services/users/use-cases/delete-user.use-case.d.ts +0 -16
- package/dist/services/users/use-cases/delete-user.use-case.js +0 -48
- package/dist/services/users/use-cases/delete-user.use-case.mjs +0 -24
- package/dist/services/users/use-cases/get-user-by-id.use-case.d.ts +0 -12
- package/dist/services/users/use-cases/get-user-by-id.use-case.js +0 -43
- package/dist/services/users/use-cases/get-user-by-id.use-case.mjs +0 -19
- package/dist/services/users/use-cases/list-users-by-props.use-case.d.ts +0 -17
- package/dist/services/users/use-cases/list-users-by-props.use-case.js +0 -42
- package/dist/services/users/use-cases/list-users-by-props.use-case.mjs +0 -18
- package/dist/services/users/use-cases/update-user.use-case.d.ts +0 -13
- package/dist/services/users/use-cases/update-user.use-case.js +0 -53
- package/dist/services/users/use-cases/update-user.use-case.mjs +0 -29
- package/dist/services/users/utils/default-model.d.ts +0 -6
- package/dist/services/users/utils/default-model.js +0 -38
- package/dist/services/users/utils/default-model.mjs +0 -14
- package/examples/authentication/login.ts +0 -22
- package/examples/users/create-user.ts +0 -25
- package/examples/users/delete-user.ts +0 -42
- package/examples/users/get-user-by-id.ts +0 -21
- package/examples/users/list-users.ts +0 -22
- package/examples/users/update-user.ts +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `openloops` are written here, newest first. The format follows [Keep a Changelog](https://keepachangelog.com) and the versions follow [semantic versioning](https://semver.org), where a minor version can still break the API while the package is in beta. Changes before 0.4.0 are not recorded here, see the commits and the tags.
|
|
4
4
|
|
|
5
|
-
## 0.
|
|
5
|
+
## 0.11.0
|
|
6
|
+
|
|
7
|
+
**Breaking.** `openloops` no longer ships its own users, authentication, repository base or secrets. They come from [`nanosaas`](https://www.npmjs.com/package/nanosaas), which is now a peer dependency at an exact version: install it next to `openloops` and call `configure({ appName: 'openloops' })` once when your process starts (the package never calls it for you).
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- `currentUser` is `actor` and `currentSession` is `requestContext` in every function. The `actor` is built from the claims of the token with `Actor.fromClaims({ userId })` and does no read of the database; the agent reads the stored profile of the user once per run (`profileOf`).
|
|
12
|
+
- The context that skills hand to the model separates where the person lives (the stored preferences) from where they are now (the situation of the request), and says when they are away from home.
|
|
13
|
+
- The internal MCP admin functions (`openloops/mcps/admin`) take the actor of a delegated token as `actor`.
|
|
14
|
+
- The subpaths `openloops/base`, `openloops/common`, `openloops/authentication` and `openloops/users` are gone. Import `Actor`, `RequestContext`, `Logger`, `HttpError`, `runWithConfigs` and the rest from `nanosaas/common`, `Scope` and `MongoRepository` from `nanosaas/db`, and the users and authentication functions from `nanosaas/users` and `nanosaas/authentication`.
|
|
15
|
+
- Encrypted values use one format, `ENC:v2:<key id>:<data>`, with the master key in `<PREFIX>_ENCRYPTION_KEY_V<N>` (`OPENLOOPS_ENCRYPTION_KEY_V1` with `appName: 'openloops'`). `SECRET_MANAGER_KEY` and `SECRET_MANAGER_KEY_V<N>` are no longer read and `SecretManager.encrypt` is gone. The earlier formats are not read: before you update, migrate the `ENC:` values that you store with `reencrypt` of `nanosaas/common` (see the encryption page of `nanosaas`), decrypting the old ones with the `SecretManager` of 0.10.
|
|
16
|
+
- The tokens of the sessions no longer carry `email`, `firstName` and `lastName`, and the issuer is the one you set with `configure` (`openloops` by default of `appName`). Tokens issued before the update stay valid only if the issuer and the key are the same.
|
|
17
|
+
- The indexes of `refresh_tokens` and `revoked_tokens` are `AUTH_INDEXES` of `nanosaas/authentication`, and `ensureIndexes` of `openloops/db` no longer creates them.
|
|
18
|
+
- Variables with the prefix of your `appName` (`OPENLOOPS_DB_URI`, `OPENLOOPS_DB_NAME`, `OPENLOOPS_MONGO_MAX_POOL_SIZE`) are read through `nanosaas`.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- `registerDefaultModelExtension()` and `setDefaultModel` (`openloops/core`): the default model of a user is a preference that `openloops` adds to the user, checked against the catalog of providers. It is no longer written with `updateUser`.
|
|
23
|
+
|
|
24
|
+
### Removed
|
|
25
|
+
|
|
26
|
+
- `cryptr` and `dotenv` are no longer dependencies.
|
|
27
|
+
|
|
28
|
+
## 0.10.2
|
|
6
29
|
|
|
7
30
|
### Added
|
|
8
31
|
|
|
@@ -53,7 +76,7 @@ All notable changes to `openloops` are written here, newest first. The format fo
|
|
|
53
76
|
|
|
54
77
|
- The fast responder (2.6.0) now knows it is the front layer of an agent, adopts `identity` like the reasoning engine does, and delegates to the engine every message about the product, the agent or its capabilities, and the data or advice that belong to the domain described in `productInfo.about`. It no longer lists what the agent can or cannot do, and it delegates when in doubt. Keep `identity.role` short.
|
|
55
78
|
- The reasoning engine (2.5.6) states more firmly that the final answer goes inside the `respond` action and that text written outside the JSON is never delivered, which reduces the plain text answers that were rejected as `invalid_response` and cost an extra call. The message sent back after a response that is not JSON now says that text meant for the user belongs in the `answer` of a `respond` action. It also reads `productInfo` when the user asks about the product or the company.
|
|
56
|
-
- The description of the package, the README and the docs index present `openloops` as the harness for building multitenant AI agents for your SaaS, where the model is the engine, `openloops` the chassis and your interface the body. The README no longer shows the `CustomerSupportLoop` and `CodeSpecialistLoop` examples, which the package does not ship, and links to the live demo at
|
|
79
|
+
- The description of the package, the README and the docs index present `openloops` as the harness for building multitenant AI agents for your SaaS, where the model is the engine, `openloops` the chassis and your interface the body. The README no longer shows the `CustomerSupportLoop` and `CodeSpecialistLoop` examples, which the package does not ship, and links to the live demo at openloopsai.co.
|
|
57
80
|
|
|
58
81
|
## 0.8.1
|
|
59
82
|
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Openloops
|
|
2
2
|
|
|
3
|
-
**Build production-ready, multitenant AI agents for your SaaS in minutes, not days, weeks, or months.** · [
|
|
3
|
+
**Build production-ready, multitenant AI agents for your SaaS in minutes, not days, weeks, or months.** · [openloopsai.co](https://openloopsai.co)
|
|
4
4
|
|
|
5
5
|
Openloops is an open source **harness** for building AI agents. An agent is three things: a **model** that thinks (the engine), a **harness** that gives it hands, memory and rules (the chassis), and the **interface** you build on top, with your tools and MCP servers (the body). Anthropic and OpenAI give you the engine. Openloops gives you the chassis, with the AGI loop, the tools and everything an agent needs in production. You build the body: a customer support agent, a financial auditor, a meeting copilot. Change the model, or the product, and the rest stays the same.
|
|
6
6
|
|
|
7
|
-
**Want to see it working?** [Try the live demo](https://
|
|
7
|
+
**Want to see it working?** [Try the live demo](https://openloopsai.co/#demo), a real agent running on Openloops, with nothing to install.
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
10
|
<img src="https://raw.githubusercontent.com/jbarcosdev/openloops/main/docs/assets/harness-car.svg" alt="A car made of an engine (the AI model), a chassis (Openloops) and a body (your interface). The body changes between a personal assistant, customer support, a meeting copilot and your own idea, while the engine and the chassis stay the same." width="560">
|
|
@@ -12,20 +12,19 @@ Openloops is an open source **harness** for building AI agents. An agent is thre
|
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { Agent } from 'openloops/core'
|
|
15
|
-
import { Logger } from '
|
|
16
|
-
import { CurrentUser } from 'openloops/base'
|
|
15
|
+
import { Actor, Logger } from 'nanosaas/common'
|
|
17
16
|
import { AgiLoop } from 'openloops/loops'
|
|
18
17
|
import { fetchUrlTool } from 'openloops/tools'
|
|
19
18
|
|
|
20
19
|
const logger = new Logger()
|
|
21
|
-
const
|
|
20
|
+
const actor = Actor.fromClaims({ userId })
|
|
22
21
|
const agent = new Agent({ loop: new AgiLoop() })
|
|
23
22
|
|
|
24
23
|
agent.addTool(fetchUrlTool) // reads web pages as text, it needs no key
|
|
25
24
|
|
|
26
25
|
const result = await agent.run({
|
|
27
26
|
input: { message: 'what is the current price of Bitcoin?' },
|
|
28
|
-
|
|
27
|
+
actor,
|
|
29
28
|
})
|
|
30
29
|
|
|
31
30
|
logger.info(result.data.lastAnswer, '[Demo] Result')
|
|
@@ -73,7 +72,7 @@ The package has no controllers: the authorization of every endpoint is the respo
|
|
|
73
72
|
|
|
74
73
|
If you've stood up [OpenClaw](https://github.com/openclaw/openclaw), [Hermes Agent](https://github.com/NousResearch/hermes-agent), or [ZeroClaw](https://github.com/zeroclaw-labs/zeroclaw), you already know how good a single, always-on personal agent can feel. You also know what happens the moment you try to make it serve every customer of a product: there's no clean boundary between "my agent" and "your agent." Conversations, memory, and connected tools were never designed to be scoped per user in the first place.
|
|
75
74
|
|
|
76
|
-
`openloops` starts from the opposite assumption. Every chat, every task, every piece of context, and every connected MCP server is scoped to a `
|
|
75
|
+
`openloops` starts from the opposite assumption. Every chat, every task, every piece of context, and every connected MCP server is scoped to a `actor` from the ground up, not bolted on later. Two users, same deployment, completely separate agents, with zero risk of one seeing the other's history or tools.
|
|
77
76
|
|
|
78
77
|
## If you've already tried LangGraph or CrewAI
|
|
79
78
|
|
|
@@ -91,7 +90,7 @@ You know the pattern: before you write a single line of what your agent actually
|
|
|
91
90
|
- **Automations.** Tasks that the agent runs by itself, on a schedule (daily, weekly, monthly or once, in the timezone of the user) or when another system sends an event, with signed tokens that can be revoked and a queue per automation. A worker runs what is due, safely across several instances, and keeps a history of every run with its chat. See [automations](docs/automations.md).
|
|
92
91
|
- **Guardrails.** Input guards block messages with card numbers, emails, code or anything you define, before the model sees them. See [guardrails](docs/guardrails.md).
|
|
93
92
|
- **Usage and cost tracking.** Every LLM call is recorded. Get the tokens and cost of a chat or an answer, and per-user statistics by model and by period. Cap what a user can spend in a day, a week or a month with `usageLimit`. See [usage](docs/usage.md) and [usage limit](docs/agent.md#usage-limit).
|
|
94
|
-
- **Users and
|
|
93
|
+
- **Identity from `nanosaas`.** Users, login and tokens come from `nanosaas`, a peer dependency, so you don't need a parallel system just to have an identity to hand the `Agent`.
|
|
95
94
|
- **Any LLM provider, including local ones.** Built on [`@earendil-works/pi-ai`](https://www.npmjs.com/package/@earendil-works/pi-ai), so OpenAI, Anthropic, Google, and self-hosted models (e.g. via Ollama) all work the same way, chosen per chat.
|
|
96
95
|
- **Observability without ceremony.** Langfuse is built in: set the environment variables and every LLM call is traced. Errors go to one function that you register, so you report them to Sentry or to whatever tool you use. Every node, skill and guard also writes a trace you can read back.
|
|
97
96
|
|
|
@@ -128,7 +127,7 @@ import { createMcpServer } from 'openloops/mcps'
|
|
|
128
127
|
|
|
129
128
|
await createMcpServer({
|
|
130
129
|
payload: { name: 'my-mcp', type: 'http', url: 'https://example.dev/api/mcp' },
|
|
131
|
-
|
|
130
|
+
actor,
|
|
132
131
|
})
|
|
133
132
|
```
|
|
134
133
|
|
|
@@ -155,7 +154,7 @@ This is a comparison against the self-hosted, open-source versions of LangGraph
|
|
|
155
154
|
| Multi-user scoping | Built in: chats, tasks, context, and MCP servers are per-user from the start | Conversations are scoped by a `thread_id`. Mapping them to users, and scoping memory and tools per user, is up to you | Not a concept of the framework, you build it |
|
|
156
155
|
| Tool execution & retries | Validation, confirmation of destructive tools, duplicate and invented-id protection, and LLM and MCP connection retries are built into the harness. A failed step goes back to the model, which decides how to continue | Per-node `RetryPolicy` and error handling that you configure | Retry limits are configured per agent or task |
|
|
157
156
|
| MCP support | Native: servers are a per-user record, tools load on demand, and every server goes through an approval flow | A separate package (`langchain-mcp-adapters`) with a client that you wire into the graph | Native `mcps` field on agents, or `MCPServerAdapter`. Servers are declared in code, not loaded per user |
|
|
158
|
-
| User management |
|
|
157
|
+
| User management | Through `nanosaas` (peer dependency) | Not included, you build your own | Not included, you build your own |
|
|
159
158
|
| LLM usage/cost tracking | Included (`openloops/llmcalls`): per answer, per chat, and per-user statistics | Not included in OSS, available via paid LangSmith | Third-party integrations such as OpenLIT report token usage and cost |
|
|
160
159
|
| Observability | Langfuse via env vars, a hook to report errors to the tool you use, and traces stored per chat | Your own tracing setup, or paid LangSmith | Third-party integrations (Langfuse, OpenLIT, Arize Phoenix, Opik, Weave) that you set up |
|
|
161
160
|
| What you write | Your interface, your tools and MCP servers. The loop is included, and you can write your own | Nodes and the graph's edges, explicitly | Agents, tasks, and crew orchestration, declared per role |
|
|
@@ -166,9 +165,9 @@ Neither approach is "wrong." LangGraph's explicit graph declaration is a deliber
|
|
|
166
165
|
## Quick start (local)
|
|
167
166
|
|
|
168
167
|
```bash
|
|
169
|
-
npm install openloops
|
|
168
|
+
npm install openloops nanosaas
|
|
170
169
|
# or
|
|
171
|
-
yarn add openloops
|
|
170
|
+
yarn add openloops nanosaas
|
|
172
171
|
```
|
|
173
172
|
|
|
174
173
|
Spin up a local MongoDB with the included `docker-compose.yml`:
|
|
@@ -186,9 +185,8 @@ NODE_ENV=development
|
|
|
186
185
|
OPENLOOPS_DB_URI="mongodb://localhost:27017/"
|
|
187
186
|
OPENLOOPS_DB_NAME='openloops'
|
|
188
187
|
|
|
189
|
-
|
|
190
|
-
#
|
|
191
|
-
# SECRET_MANAGER_KEY_V1=
|
|
188
|
+
# Only for ENC:v2: values, see docs/configuration.md
|
|
189
|
+
# OPENLOOPS_ENCRYPTION_KEY_V1=
|
|
192
190
|
|
|
193
191
|
# Default model provider (anthropic, claude-haiku-5-5)
|
|
194
192
|
ANTHROPIC_API_KEY=
|
|
@@ -269,11 +267,7 @@ Every pattern above, and a lot more, lives as a runnable example in [`examples/`
|
|
|
269
267
|
| `openloops/mcps` | MCP server management, connection check and trust decisions |
|
|
270
268
|
| `openloops/automations` | Scheduled and event tasks, their runs and the runner that executes them |
|
|
271
269
|
| `openloops/chats` | Chats and their messages: list, read, update, delete |
|
|
272
|
-
| `openloops/users` | User management |
|
|
273
|
-
| `openloops/authentication` | Login and token issuing |
|
|
274
270
|
| `openloops/llmcalls` | LLM usage and cost tracking |
|
|
275
|
-
| `openloops/base` | `CurrentUser`, `CurrentSession`, `Scope` |
|
|
276
|
-
| `openloops/common` | `Logger` and shared utilities |
|
|
277
271
|
| `openloops/clients` | `LLMClient` and the HTTP clients used by built-in tools (e.g. Serper) |
|
|
278
272
|
|
|
279
273
|
## Learn more
|
|
@@ -300,4 +294,4 @@ Every pattern above, and a lot more, lives as a runnable example in [`examples/`
|
|
|
300
294
|
|
|
301
295
|
Apache-2.0, free and open source, including for commercial and enterprise use.
|
|
302
296
|
|
|
303
|
-
Questions? Reach out at jose@
|
|
297
|
+
Questions? Reach out at jose@endeavourai.co.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AssistantMessage } from '@earendil-works/pi-ai';
|
|
2
|
-
import {
|
|
2
|
+
import { ActorLike } from 'nanosaas/common';
|
|
3
3
|
import { LLMChatParams, LLMResponse } from './llm-types';
|
|
4
4
|
export declare class LLMClient {
|
|
5
5
|
private static readonly modelsWithoutTemperature;
|
|
@@ -26,6 +26,6 @@ export interface LLMPostResponseParams {
|
|
|
26
26
|
origin: string;
|
|
27
27
|
sessionId: string;
|
|
28
28
|
answerId: string;
|
|
29
|
-
|
|
29
|
+
actor?: ActorLike;
|
|
30
30
|
response: AssistantMessage;
|
|
31
31
|
}
|
|
@@ -32,12 +32,11 @@ __export(llm_client_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(llm_client_exports);
|
|
34
34
|
var import_langfuse = require("langfuse");
|
|
35
|
-
var
|
|
36
|
-
var
|
|
35
|
+
var import_common = require("nanosaas/common");
|
|
36
|
+
var import_number_setting = require("../../common/utils/number-setting.js");
|
|
37
37
|
var import_helpers = require("../../common/helpers/index.js");
|
|
38
38
|
var import_llmcalls = require("../../services/llmcalls/index.js");
|
|
39
39
|
var import_pi_ai_adapter = require("./pi-ai-adapter");
|
|
40
|
-
var import_number_setting = require("../../common/utils/number-setting.js");
|
|
41
40
|
var import_model_resolution = require("./model-resolution");
|
|
42
41
|
var import_sampling_rules = require("./sampling-rules");
|
|
43
42
|
var import_llm_error = require("./llm-error");
|
|
@@ -61,15 +60,15 @@ const REQUIRED_TOOL_CHOICE = {
|
|
|
61
60
|
};
|
|
62
61
|
class LLMClient {
|
|
63
62
|
static modelsWithoutTemperature = /* @__PURE__ */ new Set();
|
|
64
|
-
logger = new
|
|
63
|
+
logger = new import_common.Logger();
|
|
65
64
|
langfuse;
|
|
66
65
|
langfuseEnabled;
|
|
67
66
|
callTimeoutMs;
|
|
68
67
|
constructor() {
|
|
69
68
|
this.callTimeoutMs = (0, import_number_setting.numberSetting)("LLM_CALL_TIMEOUT_MS", DEFAULT_CALL_TIMEOUT_MS);
|
|
70
|
-
const publicKey =
|
|
71
|
-
const secretKey =
|
|
72
|
-
const baseUrl =
|
|
69
|
+
const publicKey = import_common.secretManager.get("LANGFUSE_PUBLIC_KEY");
|
|
70
|
+
const secretKey = import_common.secretManager.get("LANGFUSE_SECRET_KEY");
|
|
71
|
+
const baseUrl = import_common.secretManager.get("LANGFUSE_BASE_URL");
|
|
73
72
|
this.langfuseEnabled = Boolean(publicKey && secretKey && baseUrl);
|
|
74
73
|
if (this.langfuseEnabled) {
|
|
75
74
|
this.langfuse = new import_langfuse.Langfuse({ publicKey, secretKey, baseUrl });
|
|
@@ -83,7 +82,7 @@ class LLMClient {
|
|
|
83
82
|
origin,
|
|
84
83
|
sessionId,
|
|
85
84
|
answerId,
|
|
86
|
-
|
|
85
|
+
actor,
|
|
87
86
|
messages,
|
|
88
87
|
tools,
|
|
89
88
|
toolChoice,
|
|
@@ -106,7 +105,7 @@ class LLMClient {
|
|
|
106
105
|
return resolvedChoice || thinking ? models.completeSimple(model, context, { ...options, ...resolvedChoice ? { toolChoice: resolvedChoice } : {}, ...reasoning ? { reasoning } : {} }) : models.complete(model, context, options);
|
|
107
106
|
});
|
|
108
107
|
const raw = await this.traced(
|
|
109
|
-
{ origin, sessionId, answerId,
|
|
108
|
+
{ origin, sessionId, answerId, actor, modelName, provider, temperature },
|
|
110
109
|
context,
|
|
111
110
|
() => this.withoutRejectedTemperature({ provider, model: modelName, thinking: Boolean(reasoning) }, send)
|
|
112
111
|
);
|
|
@@ -117,14 +116,14 @@ class LLMClient {
|
|
|
117
116
|
}
|
|
118
117
|
apiKeyOf(provider) {
|
|
119
118
|
const name = provider === "google" ? "GEMINI_API_KEY" : `${provider.toUpperCase().replace(/-/g, "_")}_API_KEY`;
|
|
120
|
-
return
|
|
119
|
+
return import_common.secretManager.get(name) || void 0;
|
|
121
120
|
}
|
|
122
121
|
chooseModel(params) {
|
|
123
|
-
const { provider, modelName,
|
|
122
|
+
const { provider, modelName, actor } = params ?? {};
|
|
124
123
|
if (Boolean(provider) !== Boolean(modelName)) throw new Error("[LLM Client] provider and modelName must be given together");
|
|
125
124
|
return (0, import_model_resolution.resolveModel)({
|
|
126
125
|
run: (0, import_model_resolution.toModelRef)({ provider, model: modelName }),
|
|
127
|
-
user: (0, import_model_resolution.toModelRef)(
|
|
126
|
+
user: (0, import_model_resolution.toModelRef)(actor?.profile?.preferences?.defaultModel)
|
|
128
127
|
});
|
|
129
128
|
}
|
|
130
129
|
async withDeadline(timeoutMs, call) {
|
|
@@ -181,7 +180,7 @@ class LLMClient {
|
|
|
181
180
|
return response;
|
|
182
181
|
}
|
|
183
182
|
async traced(call, context, run) {
|
|
184
|
-
const { origin, sessionId, answerId,
|
|
183
|
+
const { origin, sessionId, answerId, actor, modelName, provider, temperature } = call;
|
|
185
184
|
this.logger.debug({
|
|
186
185
|
origin,
|
|
187
186
|
context: {
|
|
@@ -193,10 +192,10 @@ class LLMClient {
|
|
|
193
192
|
const trace = this.langfuseEnabled ? this.langfuse.trace({
|
|
194
193
|
sessionId,
|
|
195
194
|
name: origin,
|
|
196
|
-
userId:
|
|
195
|
+
userId: actor?.userId,
|
|
197
196
|
metadata: {
|
|
198
197
|
origin,
|
|
199
|
-
email:
|
|
198
|
+
email: actor?.profile?.email,
|
|
200
199
|
sessionId
|
|
201
200
|
}
|
|
202
201
|
}) : void 0;
|
|
@@ -224,7 +223,7 @@ class LLMClient {
|
|
|
224
223
|
content: this.formatContentForLog(response?.content)
|
|
225
224
|
}
|
|
226
225
|
}, "[LLM Service] Response");
|
|
227
|
-
await this.postResponse({ origin, sessionId, answerId,
|
|
226
|
+
await this.postResponse({ origin, sessionId, answerId, actor, response });
|
|
228
227
|
return response;
|
|
229
228
|
} catch (error) {
|
|
230
229
|
generation?.end({
|
|
@@ -236,7 +235,7 @@ class LLMClient {
|
|
|
236
235
|
}
|
|
237
236
|
}
|
|
238
237
|
async postResponse(params) {
|
|
239
|
-
const { origin, sessionId, answerId,
|
|
238
|
+
const { origin, sessionId, answerId, actor, response } = params ?? {};
|
|
240
239
|
await (0, import_llmcalls.createLLMCall)({
|
|
241
240
|
payload: {
|
|
242
241
|
origin,
|
|
@@ -245,7 +244,7 @@ class LLMClient {
|
|
|
245
244
|
response,
|
|
246
245
|
costInUsd: response?.usage?.cost?.total
|
|
247
246
|
},
|
|
248
|
-
|
|
247
|
+
actor
|
|
249
248
|
});
|
|
250
249
|
}
|
|
251
250
|
formatContentForLog(records) {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Langfuse } from "langfuse";
|
|
2
|
-
import { secretManager } from "
|
|
3
|
-
import {
|
|
2
|
+
import { secretManager, Logger } from "nanosaas/common";
|
|
3
|
+
import { numberSetting } from "../../common/utils/number-setting.js";
|
|
4
4
|
import { extractJSON } from "../../common/helpers/index.js";
|
|
5
5
|
import { createLLMCall } from "../../services/llmcalls/index.js";
|
|
6
6
|
import { toPiContext, fromPiMessage } from "./pi-ai-adapter";
|
|
7
|
-
import { numberSetting } from "../../common/utils/number-setting.js";
|
|
8
7
|
import { resolveModel, toModelRef } from "./model-resolution";
|
|
9
8
|
import { omitsTemperature } from "./sampling-rules";
|
|
10
9
|
import { LLMError, retryDelayMs, rejectsSamplingParameter } from "./llm-error";
|
|
@@ -50,7 +49,7 @@ class LLMClient {
|
|
|
50
49
|
origin,
|
|
51
50
|
sessionId,
|
|
52
51
|
answerId,
|
|
53
|
-
|
|
52
|
+
actor,
|
|
54
53
|
messages,
|
|
55
54
|
tools,
|
|
56
55
|
toolChoice,
|
|
@@ -73,7 +72,7 @@ class LLMClient {
|
|
|
73
72
|
return resolvedChoice || thinking ? models.completeSimple(model, context, { ...options, ...resolvedChoice ? { toolChoice: resolvedChoice } : {}, ...reasoning ? { reasoning } : {} }) : models.complete(model, context, options);
|
|
74
73
|
});
|
|
75
74
|
const raw = await this.traced(
|
|
76
|
-
{ origin, sessionId, answerId,
|
|
75
|
+
{ origin, sessionId, answerId, actor, modelName, provider, temperature },
|
|
77
76
|
context,
|
|
78
77
|
() => this.withoutRejectedTemperature({ provider, model: modelName, thinking: Boolean(reasoning) }, send)
|
|
79
78
|
);
|
|
@@ -87,11 +86,11 @@ class LLMClient {
|
|
|
87
86
|
return secretManager.get(name) || void 0;
|
|
88
87
|
}
|
|
89
88
|
chooseModel(params) {
|
|
90
|
-
const { provider, modelName,
|
|
89
|
+
const { provider, modelName, actor } = params ?? {};
|
|
91
90
|
if (Boolean(provider) !== Boolean(modelName)) throw new Error("[LLM Client] provider and modelName must be given together");
|
|
92
91
|
return resolveModel({
|
|
93
92
|
run: toModelRef({ provider, model: modelName }),
|
|
94
|
-
user: toModelRef(
|
|
93
|
+
user: toModelRef(actor?.profile?.preferences?.defaultModel)
|
|
95
94
|
});
|
|
96
95
|
}
|
|
97
96
|
async withDeadline(timeoutMs, call) {
|
|
@@ -148,7 +147,7 @@ class LLMClient {
|
|
|
148
147
|
return response;
|
|
149
148
|
}
|
|
150
149
|
async traced(call, context, run) {
|
|
151
|
-
const { origin, sessionId, answerId,
|
|
150
|
+
const { origin, sessionId, answerId, actor, modelName, provider, temperature } = call;
|
|
152
151
|
this.logger.debug({
|
|
153
152
|
origin,
|
|
154
153
|
context: {
|
|
@@ -160,10 +159,10 @@ class LLMClient {
|
|
|
160
159
|
const trace = this.langfuseEnabled ? this.langfuse.trace({
|
|
161
160
|
sessionId,
|
|
162
161
|
name: origin,
|
|
163
|
-
userId:
|
|
162
|
+
userId: actor?.userId,
|
|
164
163
|
metadata: {
|
|
165
164
|
origin,
|
|
166
|
-
email:
|
|
165
|
+
email: actor?.profile?.email,
|
|
167
166
|
sessionId
|
|
168
167
|
}
|
|
169
168
|
}) : void 0;
|
|
@@ -191,7 +190,7 @@ class LLMClient {
|
|
|
191
190
|
content: this.formatContentForLog(response?.content)
|
|
192
191
|
}
|
|
193
192
|
}, "[LLM Service] Response");
|
|
194
|
-
await this.postResponse({ origin, sessionId, answerId,
|
|
193
|
+
await this.postResponse({ origin, sessionId, answerId, actor, response });
|
|
195
194
|
return response;
|
|
196
195
|
} catch (error) {
|
|
197
196
|
generation?.end({
|
|
@@ -203,7 +202,7 @@ class LLMClient {
|
|
|
203
202
|
}
|
|
204
203
|
}
|
|
205
204
|
async postResponse(params) {
|
|
206
|
-
const { origin, sessionId, answerId,
|
|
205
|
+
const { origin, sessionId, answerId, actor, response } = params ?? {};
|
|
207
206
|
await createLLMCall({
|
|
208
207
|
payload: {
|
|
209
208
|
origin,
|
|
@@ -212,7 +211,7 @@ class LLMClient {
|
|
|
212
211
|
response,
|
|
213
212
|
costInUsd: response?.usage?.cost?.total
|
|
214
213
|
},
|
|
215
|
-
|
|
214
|
+
actor
|
|
216
215
|
});
|
|
217
216
|
}
|
|
218
217
|
formatContentForLog(records) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ActorLike } from 'nanosaas/common';
|
|
2
2
|
export interface LLMToolCall {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
@@ -58,7 +58,7 @@ export interface LLMChatParams {
|
|
|
58
58
|
origin: string;
|
|
59
59
|
sessionId: string;
|
|
60
60
|
answerId: string;
|
|
61
|
-
|
|
61
|
+
actor?: ActorLike;
|
|
62
62
|
messages: LLMMessage[];
|
|
63
63
|
tools?: LLMToolDefinition[];
|
|
64
64
|
toolChoice?: LLMToolChoice;
|
|
@@ -35,8 +35,7 @@ __export(model_resolution_exports, {
|
|
|
35
35
|
toModelRef: () => toModelRef
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(model_resolution_exports);
|
|
38
|
-
var
|
|
39
|
-
var import_logger = require("../../common/logger/index.js");
|
|
38
|
+
var import_common = require("nanosaas/common");
|
|
40
39
|
const CLIENT_FALLBACK_MODEL = { provider: "anthropic", model: "claude-haiku-5-5" };
|
|
41
40
|
let warnedAboutBackendFallback = false;
|
|
42
41
|
function toModelRef(value) {
|
|
@@ -45,12 +44,12 @@ function toModelRef(value) {
|
|
|
45
44
|
return provider && model ? { provider, model } : void 0;
|
|
46
45
|
}
|
|
47
46
|
function backendFallbackModel() {
|
|
48
|
-
const provider =
|
|
49
|
-
const model =
|
|
47
|
+
const provider = import_common.secretManager.get("LLM_FALLBACK_PROVIDER");
|
|
48
|
+
const model = import_common.secretManager.get("LLM_FALLBACK_MODEL");
|
|
50
49
|
if (Boolean(provider) !== Boolean(model)) {
|
|
51
50
|
if (!warnedAboutBackendFallback) {
|
|
52
51
|
warnedAboutBackendFallback = true;
|
|
53
|
-
|
|
52
|
+
import_common.logger.warn("[LLM Client] LLM_FALLBACK_PROVIDER and LLM_FALLBACK_MODEL must be set together, so they are ignored");
|
|
54
53
|
}
|
|
55
54
|
return void 0;
|
|
56
55
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { secretManager } from "
|
|
2
|
-
import { logger } from "../../common/logger/index.js";
|
|
1
|
+
import { secretManager, logger } from "nanosaas/common";
|
|
3
2
|
const CLIENT_FALLBACK_MODEL = { provider: "anthropic", model: "claude-haiku-5-5" };
|
|
4
3
|
let warnedAboutBackendFallback = false;
|
|
5
4
|
function toModelRef(value) {
|
|
@@ -21,13 +21,12 @@ __export(serper_client_exports, {
|
|
|
21
21
|
SerperClient: () => SerperClient
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(serper_client_exports);
|
|
24
|
-
var
|
|
25
|
-
var import_secret_manager = require("../../common/utils/secret-manager.js");
|
|
24
|
+
var import_common = require("nanosaas/common");
|
|
26
25
|
class SerperClient {
|
|
27
|
-
logger = new
|
|
26
|
+
logger = new import_common.Logger();
|
|
28
27
|
async searchOnGoogle(params) {
|
|
29
28
|
const { query, type, page, num, countryCode, languageCode } = params;
|
|
30
|
-
const apiKey =
|
|
29
|
+
const apiKey = import_common.secretManager.get("SERPER_API_KEY");
|
|
31
30
|
const inputData = {
|
|
32
31
|
q: query,
|
|
33
32
|
type,
|
|
@@ -21,10 +21,10 @@ __export(slack_client_exports, {
|
|
|
21
21
|
SlackClient: () => SlackClient
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(slack_client_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_common = require("nanosaas/common");
|
|
25
25
|
class SlackClient {
|
|
26
26
|
async sendMessage({ channel, text }) {
|
|
27
|
-
const token =
|
|
27
|
+
const token = import_common.secretManager.get("SLACK_BOT_TOKEN");
|
|
28
28
|
if (!token) throw new Error("[Slack Client] SLACK_BOT_TOKEN is not set");
|
|
29
29
|
const response = await fetch("https://slack.com/api/chat.postMessage", {
|
|
30
30
|
method: "POST",
|
|
@@ -21,9 +21,9 @@ __export(number_setting_exports, {
|
|
|
21
21
|
numberSetting: () => numberSetting
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(number_setting_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_common = require("nanosaas/common");
|
|
25
25
|
const numberSetting = (key, fallback) => {
|
|
26
|
-
const value = Number(
|
|
26
|
+
const value = Number(import_common.secretManager.get(key));
|
|
27
27
|
return Number.isInteger(value) && value > 0 ? value : fallback;
|
|
28
28
|
};
|
|
29
29
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/db/indexes/index.js
CHANGED
|
@@ -31,8 +31,6 @@ var import_workspace_items = require("./workspace-items");
|
|
|
31
31
|
var import_mcp_servers = require("./mcp-servers");
|
|
32
32
|
var import_automations = require("./automations");
|
|
33
33
|
var import_automation_runs = require("./automation-runs");
|
|
34
|
-
var import_revoked_tokens = require("./revoked-tokens");
|
|
35
|
-
var import_refresh_tokens = require("./refresh-tokens");
|
|
36
34
|
const indexes = {
|
|
37
35
|
llm_calls: import_llm_calls.llmCalls,
|
|
38
36
|
chats: import_chats.chats,
|
|
@@ -42,9 +40,7 @@ const indexes = {
|
|
|
42
40
|
workspace_items: import_workspace_items.workspaceItems,
|
|
43
41
|
mcp_servers: import_mcp_servers.mcpServers,
|
|
44
42
|
automations: import_automations.automations,
|
|
45
|
-
automation_runs: import_automation_runs.automationRuns
|
|
46
|
-
revoked_tokens: import_revoked_tokens.revokedTokens,
|
|
47
|
-
refresh_tokens: import_refresh_tokens.refreshTokens
|
|
43
|
+
automation_runs: import_automation_runs.automationRuns
|
|
48
44
|
};
|
|
49
45
|
async function ensureIndexes(db) {
|
|
50
46
|
const created = {};
|
|
@@ -7,8 +7,6 @@ import { workspaceItems } from "./workspace-items";
|
|
|
7
7
|
import { mcpServers } from "./mcp-servers";
|
|
8
8
|
import { automations } from "./automations";
|
|
9
9
|
import { automationRuns } from "./automation-runs";
|
|
10
|
-
import { revokedTokens } from "./revoked-tokens";
|
|
11
|
-
import { refreshTokens } from "./refresh-tokens";
|
|
12
10
|
const indexes = {
|
|
13
11
|
llm_calls: llmCalls,
|
|
14
12
|
chats,
|
|
@@ -18,9 +16,7 @@ const indexes = {
|
|
|
18
16
|
workspace_items: workspaceItems,
|
|
19
17
|
mcp_servers: mcpServers,
|
|
20
18
|
automations,
|
|
21
|
-
automation_runs: automationRuns
|
|
22
|
-
revoked_tokens: revokedTokens,
|
|
23
|
-
refresh_tokens: refreshTokens
|
|
19
|
+
automation_runs: automationRuns
|
|
24
20
|
};
|
|
25
21
|
async function ensureIndexes(db) {
|
|
26
22
|
const created = {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Logger } from '
|
|
1
|
+
import type { ActorLike, RequestContext } from 'nanosaas/common';
|
|
2
|
+
import type { Logger } from 'nanosaas/common';
|
|
3
3
|
import type { Chat } from '../services/chats/entities/chat.entity.js';
|
|
4
4
|
import type { RunContext } from '../harness/agent-loop.js';
|
|
5
5
|
export type GuardType = 'input';
|
|
6
6
|
export interface InputGuardContext {
|
|
7
7
|
message: string;
|
|
8
8
|
chat: Chat;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
actor: ActorLike;
|
|
10
|
+
requestContext?: RequestContext;
|
|
11
11
|
skillParams: RunContext['skillParams'];
|
|
12
12
|
logger: Logger;
|
|
13
13
|
}
|
|
@@ -16,21 +16,18 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
|
|
22
|
-
setErrorReporter: () => setErrorReporter
|
|
19
|
+
var actor_profile_exports = {};
|
|
20
|
+
__export(actor_profile_exports, {
|
|
21
|
+
withProfile: () => withProfile
|
|
23
22
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return reporter;
|
|
23
|
+
module.exports = __toCommonJS(actor_profile_exports);
|
|
24
|
+
var import_common = require("nanosaas/common");
|
|
25
|
+
var import_users = require("nanosaas/users");
|
|
26
|
+
async function withProfile(actor) {
|
|
27
|
+
if (actor.profile) return actor;
|
|
28
|
+
return import_common.Actor.from(actor).withProfile(await (0, import_users.profileOf)(actor));
|
|
31
29
|
}
|
|
32
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
31
|
0 && (module.exports = {
|
|
34
|
-
|
|
35
|
-
setErrorReporter
|
|
32
|
+
withProfile
|
|
36
33
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Logger } from '../common/logger/index.js';
|
|
1
|
+
import { ActorLike, RequestContext, Logger } from 'nanosaas/common';
|
|
3
2
|
import { Chat } from '../services/chats/entities/chat.entity.js';
|
|
4
3
|
import { ChatSettingsProps, ExecutionMode } from '../services/chats/entities/chat-settings.entity.js';
|
|
5
4
|
import { AgentTask } from '../services/tasks/entities/agent-task.entity.js';
|
|
@@ -18,13 +17,13 @@ export interface RunContext {
|
|
|
18
17
|
chat: Chat;
|
|
19
18
|
chatOptions?: ChatSettingsProps;
|
|
20
19
|
thinkingEffort?: SelectableThinkingEffort;
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
actor: ActorLike;
|
|
21
|
+
requestContext?: RequestContext;
|
|
23
22
|
currentMessage: string;
|
|
24
23
|
answerId: string;
|
|
25
24
|
tools: Tool[];
|
|
26
25
|
baseParams: BaseParams;
|
|
27
|
-
skillParams: Pick<SkillRunOptions, 'provider' | 'modelName' | 'sessionId' | 'answerId' | 'userMessage' | '
|
|
26
|
+
skillParams: Pick<SkillRunOptions, 'provider' | 'modelName' | 'sessionId' | 'answerId' | 'userMessage' | 'actor' | 'requestContext' | 'chat'>;
|
|
28
27
|
logger: Logger;
|
|
29
28
|
}
|
|
30
29
|
export interface Harness {
|