openloops 0.1.38 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -5
- package/dist/clients/index.d.ts +2 -2
- package/dist/clients/index.js +4 -4
- package/dist/clients/index.mjs +2 -2
- package/dist/clients/llm/index.d.ts +1 -0
- package/dist/{loops/plan-execute → clients/llm}/index.js +4 -4
- package/dist/clients/llm/index.mjs +1 -0
- package/dist/clients/{llm-client.d.ts → llm/llm-client.d.ts} +3 -14
- package/dist/clients/{llm-client.js → llm/llm-client.js} +14 -37
- package/dist/clients/{llm-client.mjs → llm/llm-client.mjs} +15 -38
- package/dist/clients/{llm-error.mjs → llm/llm-error.mjs} +1 -1
- package/dist/clients/{llm-types.d.ts → llm/llm-types.d.ts} +1 -1
- package/dist/clients/llm/model-resolution.d.ts +20 -0
- package/dist/clients/llm/model-resolution.js +83 -0
- package/dist/clients/llm/model-resolution.mjs +46 -0
- package/dist/clients/{pi-ai-adapter.mjs → llm/pi-ai-adapter.mjs} +1 -1
- package/dist/clients/serper/index.d.ts +1 -0
- package/dist/clients/serper/index.js +22 -0
- package/dist/clients/serper/index.mjs +1 -0
- package/dist/clients/{serper-client.js → serper/serper-client.js} +2 -2
- package/dist/clients/{serper-client.mjs → serper/serper-client.mjs} +3 -3
- package/dist/harness/agent-loop.d.ts +0 -1
- package/dist/harness/agent.d.ts +6 -1
- package/dist/harness/agent.js +21 -13
- package/dist/harness/agent.mjs +21 -13
- package/dist/harness/native-tools.d.ts +1 -1
- package/dist/{loops/shared → harness}/skills/approval-request.d.ts +1 -1
- package/dist/{loops/shared → harness}/skills/approval-request.js +1 -1
- package/dist/{loops/shared → harness}/skills/approval-request.mjs +2 -2
- package/dist/{loops/shared → harness}/skills/autonomous-answer.d.ts +1 -1
- package/dist/{loops/shared → harness}/skills/autonomous-answer.js +1 -1
- package/dist/{loops/shared → harness}/skills/autonomous-answer.mjs +2 -2
- package/dist/{loops/shared → harness}/skills/confirmation-gate.d.ts +1 -1
- package/dist/{loops/shared → harness}/skills/confirmation-gate.js +1 -1
- package/dist/{loops/shared → harness}/skills/confirmation-gate.mjs +2 -2
- package/dist/harness/skills/index.d.ts +4 -0
- package/dist/{loops/plan-execute → harness}/skills/index.js +8 -8
- package/dist/harness/skills/index.mjs +4 -0
- package/dist/{loops/shared → harness}/skills/mcp-change-review.d.ts +1 -1
- package/dist/{loops/shared → harness}/skills/mcp-change-review.js +1 -1
- package/dist/{loops/shared → harness}/skills/mcp-change-review.mjs +2 -2
- package/dist/harness/tool-catalog.d.ts +1 -1
- package/dist/loops/index.d.ts +0 -1
- package/dist/loops/index.js +0 -2
- package/dist/loops/index.mjs +0 -1
- package/dist/loops/shared/skills/index.d.ts +0 -4
- package/dist/loops/shared/skills/index.js +1 -9
- package/dist/loops/shared/skills/index.mjs +0 -4
- package/dist/services/agentic-jobs/entities/agentic-job-run.entity.d.ts +42 -0
- package/dist/services/agentic-jobs/entities/agentic-job-run.entity.js +103 -0
- package/dist/services/agentic-jobs/entities/agentic-job-run.entity.mjs +80 -0
- package/dist/services/agentic-jobs/entities/agentic-job.entity.d.ts +39 -0
- package/dist/services/agentic-jobs/entities/agentic-job.entity.js +113 -0
- package/dist/services/agentic-jobs/entities/agentic-job.entity.mjs +90 -0
- package/dist/services/agentic-jobs/entities/index.d.ts +3 -0
- package/dist/services/agentic-jobs/entities/index.js +26 -0
- package/dist/services/agentic-jobs/entities/index.mjs +3 -0
- package/dist/services/agentic-jobs/entities/recurrence.d.ts +18 -0
- package/dist/services/agentic-jobs/entities/recurrence.js +84 -0
- package/dist/services/agentic-jobs/entities/recurrence.mjs +59 -0
- package/dist/services/agentic-jobs/index.d.ts +4 -0
- package/dist/services/agentic-jobs/index.js +28 -0
- package/dist/services/agentic-jobs/index.mjs +4 -0
- package/dist/services/agentic-jobs/module.d.ts +31 -0
- package/dist/services/agentic-jobs/module.js +132 -0
- package/dist/services/agentic-jobs/module.mjs +95 -0
- package/dist/services/agentic-jobs/repositories/agentic-job-run.repository.d.ts +11 -0
- package/dist/services/agentic-jobs/repositories/agentic-job-run.repository.js +71 -0
- package/dist/services/agentic-jobs/repositories/agentic-job-run.repository.mjs +42 -0
- package/dist/services/agentic-jobs/repositories/agentic-job.repository.d.ts +27 -0
- package/dist/services/agentic-jobs/repositories/agentic-job.repository.js +127 -0
- package/dist/services/agentic-jobs/repositories/agentic-job.repository.mjs +98 -0
- package/dist/services/agentic-jobs/repositories/index.d.ts +2 -0
- package/dist/services/agentic-jobs/repositories/index.js +24 -0
- package/dist/services/agentic-jobs/repositories/index.mjs +2 -0
- package/dist/services/agentic-jobs/runner/agentic-job-runner.d.ts +48 -0
- package/dist/services/agentic-jobs/runner/agentic-job-runner.js +181 -0
- package/dist/services/agentic-jobs/runner/agentic-job-runner.mjs +157 -0
- package/dist/services/agentic-jobs/use-cases/attach-agentic-job-run-chat.use-case.d.ts +15 -0
- package/dist/services/agentic-jobs/use-cases/attach-agentic-job-run-chat.use-case.js +58 -0
- package/dist/services/agentic-jobs/use-cases/attach-agentic-job-run-chat.use-case.mjs +29 -0
- package/dist/services/agentic-jobs/use-cases/claim-due-agentic-jobs.use-case.d.ts +29 -0
- package/dist/services/agentic-jobs/use-cases/claim-due-agentic-jobs.use-case.js +110 -0
- package/dist/services/agentic-jobs/use-cases/claim-due-agentic-jobs.use-case.mjs +81 -0
- package/dist/services/agentic-jobs/use-cases/create-agentic-job.use-case.d.ts +14 -0
- package/dist/services/agentic-jobs/use-cases/create-agentic-job.use-case.js +73 -0
- package/dist/services/agentic-jobs/use-cases/create-agentic-job.use-case.mjs +44 -0
- package/dist/services/agentic-jobs/use-cases/delete-agentic-job.use-case.d.ts +15 -0
- package/dist/services/agentic-jobs/use-cases/delete-agentic-job.use-case.js +65 -0
- package/dist/services/agentic-jobs/use-cases/delete-agentic-job.use-case.mjs +36 -0
- package/dist/services/agentic-jobs/use-cases/finish-agentic-job-run.use-case.d.ts +19 -0
- package/dist/services/agentic-jobs/use-cases/finish-agentic-job-run.use-case.js +75 -0
- package/dist/services/agentic-jobs/use-cases/finish-agentic-job-run.use-case.mjs +46 -0
- package/dist/services/agentic-jobs/use-cases/get-agentic-job-by-id.use-case.d.ts +14 -0
- package/dist/services/agentic-jobs/use-cases/get-agentic-job-by-id.use-case.js +55 -0
- package/dist/services/agentic-jobs/use-cases/get-agentic-job-by-id.use-case.mjs +26 -0
- package/dist/services/agentic-jobs/use-cases/list-agentic-job-runs-by-job.use-case.d.ts +16 -0
- package/dist/services/agentic-jobs/use-cases/list-agentic-job-runs-by-job.use-case.js +57 -0
- package/dist/services/agentic-jobs/use-cases/list-agentic-job-runs-by-job.use-case.mjs +28 -0
- package/dist/services/agentic-jobs/use-cases/list-agentic-job-runs-by-user.use-case.d.ts +16 -0
- package/dist/services/agentic-jobs/use-cases/list-agentic-job-runs-by-user.use-case.js +57 -0
- package/dist/services/agentic-jobs/use-cases/list-agentic-job-runs-by-user.use-case.mjs +28 -0
- package/dist/services/agentic-jobs/use-cases/list-agentic-jobs-by-user.use-case.d.ts +15 -0
- package/dist/services/agentic-jobs/use-cases/list-agentic-jobs-by-user.use-case.js +57 -0
- package/dist/services/agentic-jobs/use-cases/list-agentic-jobs-by-user.use-case.mjs +28 -0
- package/dist/services/agentic-jobs/use-cases/preview-agentic-job-runs.use-case.d.ts +15 -0
- package/dist/services/agentic-jobs/use-cases/preview-agentic-job-runs.use-case.js +52 -0
- package/dist/services/agentic-jobs/use-cases/preview-agentic-job-runs.use-case.mjs +23 -0
- package/dist/services/agentic-jobs/use-cases/renew-agentic-job-lease.use-case.d.ts +18 -0
- package/dist/services/agentic-jobs/use-cases/renew-agentic-job-lease.use-case.js +58 -0
- package/dist/services/agentic-jobs/use-cases/renew-agentic-job-lease.use-case.mjs +29 -0
- package/dist/services/agentic-jobs/use-cases/start-agentic-job-run.use-case.d.ts +21 -0
- package/dist/services/agentic-jobs/use-cases/start-agentic-job-run.use-case.js +67 -0
- package/dist/services/agentic-jobs/use-cases/start-agentic-job-run.use-case.mjs +38 -0
- package/dist/services/agentic-jobs/use-cases/sync-agentic-job-run.use-case.d.ts +20 -0
- package/dist/services/agentic-jobs/use-cases/sync-agentic-job-run.use-case.js +86 -0
- package/dist/services/agentic-jobs/use-cases/sync-agentic-job-run.use-case.mjs +56 -0
- package/dist/services/agentic-jobs/use-cases/sync-agentic-job-runs.use-case.d.ts +19 -0
- package/dist/services/agentic-jobs/use-cases/sync-agentic-job-runs.use-case.js +68 -0
- package/dist/services/agentic-jobs/use-cases/sync-agentic-job-runs.use-case.mjs +39 -0
- package/dist/services/agentic-jobs/use-cases/update-agentic-job.use-case.d.ts +15 -0
- package/dist/services/agentic-jobs/use-cases/update-agentic-job.use-case.js +83 -0
- package/dist/services/agentic-jobs/use-cases/update-agentic-job.use-case.mjs +54 -0
- package/dist/services/agentic-jobs/utils/job-fields.d.ts +14 -0
- package/dist/services/agentic-jobs/utils/job-fields.js +61 -0
- package/dist/services/agentic-jobs/utils/job-fields.mjs +37 -0
- package/dist/services/agentic-jobs/utils/next-run.d.ts +4 -0
- package/dist/services/agentic-jobs/utils/next-run.js +62 -0
- package/dist/services/agentic-jobs/utils/next-run.mjs +37 -0
- package/dist/services/agentic-jobs/utils/open-run.d.ts +12 -0
- package/dist/services/agentic-jobs/utils/open-run.js +47 -0
- package/dist/services/agentic-jobs/utils/open-run.mjs +24 -0
- package/dist/services/agentic-jobs/utils/settings.d.ts +2 -0
- package/dist/services/agentic-jobs/utils/settings.js +34 -0
- package/dist/services/agentic-jobs/utils/settings.mjs +10 -0
- package/dist/services/chats/entities/chat.entity.d.ts +0 -5
- package/dist/services/chats/entities/chat.entity.js +0 -10
- package/dist/services/chats/entities/chat.entity.mjs +0 -10
- package/dist/services/llmcalls/module.d.ts +4 -2
- package/dist/services/llmcalls/module.js +13 -6
- package/dist/services/llmcalls/module.mjs +11 -5
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.d.ts +14 -0
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.js +62 -0
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.mjs +33 -0
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.d.ts +14 -0
- package/dist/services/llmcalls/use-cases/{get-llm-usage.use-case.js → get-llm-usage-by-message.use-case.js} +18 -37
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.mjs +33 -0
- package/dist/services/llmcalls/utils/usage-totals.d.ts +20 -0
- package/dist/services/llmcalls/utils/usage-totals.js +31 -0
- package/dist/services/llmcalls/utils/usage-totals.mjs +29 -0
- package/dist/services/tasks/entities/agent-task.entity.d.ts +2 -24
- package/dist/services/tasks/entities/agent-task.entity.js +2 -75
- package/dist/services/tasks/entities/agent-task.entity.mjs +2 -75
- package/dist/services/users/entities/user-default-model.d.ts +11 -0
- package/dist/services/users/entities/user-default-model.js +42 -0
- package/dist/services/users/entities/user-default-model.mjs +19 -0
- package/dist/services/users/entities/user-preferences.d.ts +4 -1
- package/dist/services/users/entities/user-preferences.js +8 -3
- package/dist/services/users/entities/user-preferences.mjs +8 -3
- package/dist/services/users/use-cases/create-user.use-case.js +3 -1
- package/dist/services/users/use-cases/create-user.use-case.mjs +3 -1
- package/dist/services/users/use-cases/update-user.use-case.js +4 -1
- package/dist/services/users/use-cases/update-user.use-case.mjs +4 -1
- package/dist/services/users/utils/default-model.d.ts +6 -0
- package/dist/services/users/utils/default-model.js +38 -0
- package/dist/services/users/utils/default-model.mjs +15 -0
- package/dist/skills/call-modes.d.ts +1 -1
- package/dist/skills/skill.d.ts +1 -1
- package/dist/skills/skill.js +1 -1
- package/dist/skills/skill.mjs +1 -1
- 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/docs/README.md +46 -0
- package/docs/agent.md +202 -0
- package/docs/agentic-jobs.md +207 -0
- package/docs/assets/harness-car.svg +79 -0
- package/docs/authentication.md +40 -0
- package/docs/chats.md +88 -0
- package/docs/configuration.md +83 -0
- package/docs/guardrails.md +71 -0
- package/docs/harness.md +92 -0
- package/docs/integration-guide.md +138 -0
- package/docs/llms.txt +35 -0
- package/docs/loops.md +136 -0
- package/docs/mcp-servers.md +148 -0
- package/docs/skills.md +104 -0
- package/docs/tools.md +90 -0
- package/docs/usage.md +91 -0
- package/docs/users.md +108 -0
- package/examples/agentic-jobs/create-agentic-job.ts +24 -0
- package/examples/agentic-jobs/list-agentic-job-runs.ts +28 -0
- package/examples/agentic-jobs/list-agentic-jobs.ts +25 -0
- package/examples/agentic-jobs/preview-agentic-job-runs.ts +16 -0
- package/examples/agentic-jobs/run-agentic-job-now.ts +19 -0
- package/examples/agentic-jobs/run-agentic-job-worker.ts +29 -0
- package/examples/agentic-jobs/update-agentic-job.ts +36 -0
- package/examples/authentication/login.ts +17 -0
- package/examples/chats/delete-chat.ts +32 -0
- package/examples/chats/get-chat-by-id.ts +32 -0
- package/examples/chats/list-autonomous-chats.ts +23 -0
- package/examples/chats/list-chats.ts +20 -0
- package/examples/guardrails/custom-guard.ts +11 -0
- package/examples/loops/custom-loop.ts +50 -0
- package/examples/mcps/create-mcp.ts +24 -0
- package/examples/mcps/decide-mcp.ts +40 -0
- package/examples/mcps/delete-mcp.ts +32 -0
- package/examples/mcps/get-mcp-by-id.ts +17 -0
- package/examples/mcps/list-all-mcps.ts +14 -0
- package/examples/mcps/list-user-mcps.ts +23 -0
- package/examples/mcps/update-mcp.ts +23 -0
- package/examples/mcps/verify-mcp.ts +17 -0
- package/examples/run-agent/interrupt-agent.ts +16 -0
- package/examples/run-agent/run-agent-autonomous.ts +34 -0
- package/examples/run-agent/run-agent-strict-mode.ts +30 -0
- package/examples/run-agent/run-agent-with-confirmation.ts +49 -0
- package/examples/run-agent/run-agent-with-fallback-model.ts +25 -0
- package/examples/run-agent/run-agent-with-guards.ts +33 -0
- package/examples/run-agent/run-agent-with-hooks.ts +55 -0
- package/examples/run-agent/run-agent-with-identity.ts +36 -0
- package/examples/run-agent/run-agent-with-model.ts +33 -0
- package/examples/run-agent/run-agent-with-tools.ts +31 -0
- package/examples/tools/basic-tool.ts +35 -0
- package/examples/tools/destructive-tool.ts +34 -0
- package/examples/tools/web-search-tool.ts +37 -0
- package/examples/usage/get-chat-usage.ts +20 -0
- package/examples/usage/get-message-usage.ts +20 -0
- package/examples/usage/get-usage-stats-by-range.ts +23 -0
- package/examples/usage/get-usage-stats.ts +18 -0
- package/examples/users/create-user.ts +19 -0
- package/examples/users/delete-user.ts +36 -0
- package/examples/users/get-user-by-id.ts +18 -0
- package/examples/users/list-users.ts +18 -0
- package/examples/users/set-default-model.ts +36 -0
- package/examples/users/update-user.ts +22 -0
- package/package.json +9 -5
- package/dist/loops/plan-execute/index.d.ts +0 -1
- package/dist/loops/plan-execute/index.mjs +0 -1
- package/dist/loops/plan-execute/loop.d.ts +0 -26
- package/dist/loops/plan-execute/loop.js +0 -267
- package/dist/loops/plan-execute/loop.mjs +0 -249
- package/dist/loops/plan-execute/skills/action-planner.d.ts +0 -35
- package/dist/loops/plan-execute/skills/action-planner.js +0 -71
- package/dist/loops/plan-execute/skills/action-planner.mjs +0 -48
- package/dist/loops/plan-execute/skills/final-responder.d.ts +0 -7
- package/dist/loops/plan-execute/skills/final-responder.js +0 -58
- package/dist/loops/plan-execute/skills/final-responder.mjs +0 -35
- package/dist/loops/plan-execute/skills/index.d.ts +0 -4
- package/dist/loops/plan-execute/skills/index.mjs +0 -4
- package/dist/loops/plan-execute/skills/state-observer.d.ts +0 -10
- package/dist/loops/plan-execute/skills/state-observer.js +0 -61
- package/dist/loops/plan-execute/skills/state-observer.mjs +0 -38
- package/dist/loops/plan-execute/skills/strategy-engine.d.ts +0 -11
- package/dist/loops/plan-execute/skills/strategy-engine.js +0 -61
- package/dist/loops/plan-execute/skills/strategy-engine.mjs +0 -38
- package/dist/services/llmcalls/use-cases/get-llm-usage.use-case.d.ts +0 -24
- package/dist/services/llmcalls/use-cases/get-llm-usage.use-case.mjs +0 -51
- package/dist/skills/skill-runner.d.ts +0 -30
- package/dist/skills/skill-runner.js +0 -121
- package/dist/skills/skill-runner.mjs +0 -92
- /package/dist/clients/{llm-error.d.ts → llm/llm-error.d.ts} +0 -0
- /package/dist/clients/{llm-error.js → llm/llm-error.js} +0 -0
- /package/dist/clients/{llm-types.js → llm/llm-types.js} +0 -0
- /package/dist/clients/{llm-types.mjs → llm/llm-types.mjs} +0 -0
- /package/dist/clients/{pi-ai-adapter.d.ts → llm/pi-ai-adapter.d.ts} +0 -0
- /package/dist/clients/{pi-ai-adapter.js → llm/pi-ai-adapter.js} +0 -0
- /package/dist/clients/{serper-client.d.ts → serper/serper-client.d.ts} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ObjectId } from 'mongodb';
|
|
2
|
+
import { BaseEntity, BaseEntityProps } from '../../../common/base/base.entity.js';
|
|
3
|
+
import { Recurrence } from './recurrence';
|
|
4
|
+
import type { AgenticJobRunStatus } from './agentic-job-run.entity';
|
|
5
|
+
export interface AgenticJobProps extends BaseEntityProps {
|
|
6
|
+
name?: string;
|
|
7
|
+
instructions?: string;
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
recurrence?: Recurrence;
|
|
10
|
+
timezone?: string;
|
|
11
|
+
modelProvider?: string;
|
|
12
|
+
modelName?: string;
|
|
13
|
+
nextRunAt?: string | Date | null;
|
|
14
|
+
lastRunAt?: string | Date | null;
|
|
15
|
+
lastRunStatus?: AgenticJobRunStatus;
|
|
16
|
+
lockedBy?: string | null;
|
|
17
|
+
lockedUntil?: string | Date | null;
|
|
18
|
+
activeRunId?: string | ObjectId | null;
|
|
19
|
+
}
|
|
20
|
+
export declare class AgenticJob extends BaseEntity {
|
|
21
|
+
private readonly props;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
instructions?: string | undefined;
|
|
24
|
+
enabled?: boolean | undefined;
|
|
25
|
+
recurrence?: Recurrence | undefined;
|
|
26
|
+
timezone?: string | undefined;
|
|
27
|
+
modelProvider?: string | undefined;
|
|
28
|
+
modelName?: string | undefined;
|
|
29
|
+
nextRunAt?: Date | undefined;
|
|
30
|
+
lastRunAt?: Date | undefined;
|
|
31
|
+
lastRunStatus?: AgenticJobRunStatus | undefined;
|
|
32
|
+
lockedBy?: string | undefined;
|
|
33
|
+
lockedUntil?: Date | undefined;
|
|
34
|
+
activeRunId?: ObjectId | undefined;
|
|
35
|
+
static fromJSON(props: AgenticJobProps): AgenticJob;
|
|
36
|
+
constructor(props: AgenticJobProps, name?: string | undefined, instructions?: string | undefined, enabled?: boolean | undefined, recurrence?: Recurrence | undefined, timezone?: string | undefined, modelProvider?: string | undefined, modelName?: string | undefined, nextRunAt?: Date | undefined, lastRunAt?: Date | undefined, lastRunStatus?: AgenticJobRunStatus | undefined, lockedBy?: string | undefined, lockedUntil?: Date | undefined, activeRunId?: ObjectId | undefined);
|
|
37
|
+
toJSON(): AgenticJobProps;
|
|
38
|
+
scheduleNextRun(from?: Date): this;
|
|
39
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var agentic_job_entity_exports = {};
|
|
20
|
+
__export(agentic_job_entity_exports, {
|
|
21
|
+
AgenticJob: () => AgenticJob
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(agentic_job_entity_exports);
|
|
24
|
+
var import_base = require("../../../common/base/base.entity.js");
|
|
25
|
+
var import_next_run = require("../utils/next-run");
|
|
26
|
+
const toDate = (value) => {
|
|
27
|
+
if (!value) return void 0;
|
|
28
|
+
const date = new Date(value);
|
|
29
|
+
if (Number.isNaN(date.getTime())) throw new Error("{{value_must_be_a_date}}");
|
|
30
|
+
return date;
|
|
31
|
+
};
|
|
32
|
+
class AgenticJob extends import_base.BaseEntity {
|
|
33
|
+
constructor(props, name, instructions, enabled, recurrence, timezone, modelProvider, modelName, nextRunAt, lastRunAt, lastRunStatus, lockedBy, lockedUntil, activeRunId) {
|
|
34
|
+
super(props);
|
|
35
|
+
this.props = props;
|
|
36
|
+
this.name = name;
|
|
37
|
+
this.instructions = instructions;
|
|
38
|
+
this.enabled = enabled;
|
|
39
|
+
this.recurrence = recurrence;
|
|
40
|
+
this.timezone = timezone;
|
|
41
|
+
this.modelProvider = modelProvider;
|
|
42
|
+
this.modelName = modelName;
|
|
43
|
+
this.nextRunAt = nextRunAt;
|
|
44
|
+
this.lastRunAt = lastRunAt;
|
|
45
|
+
this.lastRunStatus = lastRunStatus;
|
|
46
|
+
this.lockedBy = lockedBy;
|
|
47
|
+
this.lockedUntil = lockedUntil;
|
|
48
|
+
this.activeRunId = activeRunId;
|
|
49
|
+
}
|
|
50
|
+
props;
|
|
51
|
+
name;
|
|
52
|
+
instructions;
|
|
53
|
+
enabled;
|
|
54
|
+
recurrence;
|
|
55
|
+
timezone;
|
|
56
|
+
modelProvider;
|
|
57
|
+
modelName;
|
|
58
|
+
nextRunAt;
|
|
59
|
+
lastRunAt;
|
|
60
|
+
lastRunStatus;
|
|
61
|
+
lockedBy;
|
|
62
|
+
lockedUntil;
|
|
63
|
+
activeRunId;
|
|
64
|
+
static fromJSON(props) {
|
|
65
|
+
return new AgenticJob(
|
|
66
|
+
props,
|
|
67
|
+
props.name || void 0,
|
|
68
|
+
props.instructions || void 0,
|
|
69
|
+
props.enabled,
|
|
70
|
+
props.recurrence,
|
|
71
|
+
props.timezone || void 0,
|
|
72
|
+
props.modelProvider || void 0,
|
|
73
|
+
props.modelName || void 0,
|
|
74
|
+
toDate(props.nextRunAt),
|
|
75
|
+
toDate(props.lastRunAt),
|
|
76
|
+
props.lastRunStatus,
|
|
77
|
+
props.lockedBy || void 0,
|
|
78
|
+
toDate(props.lockedUntil),
|
|
79
|
+
props.activeRunId ? import_base.BaseEntity.toObjectId(props.activeRunId) : void 0
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
toJSON() {
|
|
83
|
+
return {
|
|
84
|
+
...super.toJSON(),
|
|
85
|
+
name: this.name,
|
|
86
|
+
instructions: this.instructions,
|
|
87
|
+
enabled: this.enabled,
|
|
88
|
+
recurrence: this.recurrence,
|
|
89
|
+
timezone: this.timezone,
|
|
90
|
+
modelProvider: this.modelProvider,
|
|
91
|
+
modelName: this.modelName,
|
|
92
|
+
nextRunAt: this.nextRunAt,
|
|
93
|
+
lastRunAt: this.lastRunAt,
|
|
94
|
+
lastRunStatus: this.lastRunStatus,
|
|
95
|
+
lockedBy: this.lockedBy,
|
|
96
|
+
lockedUntil: this.lockedUntil,
|
|
97
|
+
activeRunId: this.activeRunId
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
scheduleNextRun(from = /* @__PURE__ */ new Date()) {
|
|
101
|
+
const next = this.enabled && this.recurrence && this.timezone ? (0, import_next_run.computeNextRun)(this.recurrence, this.timezone, from) : null;
|
|
102
|
+
if (next) {
|
|
103
|
+
this.nextRunAt = next;
|
|
104
|
+
} else {
|
|
105
|
+
this.unset(["nextRunAt"]);
|
|
106
|
+
}
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
111
|
+
0 && (module.exports = {
|
|
112
|
+
AgenticJob
|
|
113
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import "../../../chunk-CF3WOMB3.mjs";
|
|
2
|
+
import { BaseEntity } from "../../../common/base/base.entity.js";
|
|
3
|
+
import { computeNextRun } from "../utils/next-run";
|
|
4
|
+
const toDate = (value) => {
|
|
5
|
+
if (!value) return void 0;
|
|
6
|
+
const date = new Date(value);
|
|
7
|
+
if (Number.isNaN(date.getTime())) throw new Error("{{value_must_be_a_date}}");
|
|
8
|
+
return date;
|
|
9
|
+
};
|
|
10
|
+
class AgenticJob extends BaseEntity {
|
|
11
|
+
constructor(props, name, instructions, enabled, recurrence, timezone, modelProvider, modelName, nextRunAt, lastRunAt, lastRunStatus, lockedBy, lockedUntil, activeRunId) {
|
|
12
|
+
super(props);
|
|
13
|
+
this.props = props;
|
|
14
|
+
this.name = name;
|
|
15
|
+
this.instructions = instructions;
|
|
16
|
+
this.enabled = enabled;
|
|
17
|
+
this.recurrence = recurrence;
|
|
18
|
+
this.timezone = timezone;
|
|
19
|
+
this.modelProvider = modelProvider;
|
|
20
|
+
this.modelName = modelName;
|
|
21
|
+
this.nextRunAt = nextRunAt;
|
|
22
|
+
this.lastRunAt = lastRunAt;
|
|
23
|
+
this.lastRunStatus = lastRunStatus;
|
|
24
|
+
this.lockedBy = lockedBy;
|
|
25
|
+
this.lockedUntil = lockedUntil;
|
|
26
|
+
this.activeRunId = activeRunId;
|
|
27
|
+
}
|
|
28
|
+
props;
|
|
29
|
+
name;
|
|
30
|
+
instructions;
|
|
31
|
+
enabled;
|
|
32
|
+
recurrence;
|
|
33
|
+
timezone;
|
|
34
|
+
modelProvider;
|
|
35
|
+
modelName;
|
|
36
|
+
nextRunAt;
|
|
37
|
+
lastRunAt;
|
|
38
|
+
lastRunStatus;
|
|
39
|
+
lockedBy;
|
|
40
|
+
lockedUntil;
|
|
41
|
+
activeRunId;
|
|
42
|
+
static fromJSON(props) {
|
|
43
|
+
return new AgenticJob(
|
|
44
|
+
props,
|
|
45
|
+
props.name || void 0,
|
|
46
|
+
props.instructions || void 0,
|
|
47
|
+
props.enabled,
|
|
48
|
+
props.recurrence,
|
|
49
|
+
props.timezone || void 0,
|
|
50
|
+
props.modelProvider || void 0,
|
|
51
|
+
props.modelName || void 0,
|
|
52
|
+
toDate(props.nextRunAt),
|
|
53
|
+
toDate(props.lastRunAt),
|
|
54
|
+
props.lastRunStatus,
|
|
55
|
+
props.lockedBy || void 0,
|
|
56
|
+
toDate(props.lockedUntil),
|
|
57
|
+
props.activeRunId ? BaseEntity.toObjectId(props.activeRunId) : void 0
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
toJSON() {
|
|
61
|
+
return {
|
|
62
|
+
...super.toJSON(),
|
|
63
|
+
name: this.name,
|
|
64
|
+
instructions: this.instructions,
|
|
65
|
+
enabled: this.enabled,
|
|
66
|
+
recurrence: this.recurrence,
|
|
67
|
+
timezone: this.timezone,
|
|
68
|
+
modelProvider: this.modelProvider,
|
|
69
|
+
modelName: this.modelName,
|
|
70
|
+
nextRunAt: this.nextRunAt,
|
|
71
|
+
lastRunAt: this.lastRunAt,
|
|
72
|
+
lastRunStatus: this.lastRunStatus,
|
|
73
|
+
lockedBy: this.lockedBy,
|
|
74
|
+
lockedUntil: this.lockedUntil,
|
|
75
|
+
activeRunId: this.activeRunId
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
scheduleNextRun(from = /* @__PURE__ */ new Date()) {
|
|
79
|
+
const next = this.enabled && this.recurrence && this.timezone ? computeNextRun(this.recurrence, this.timezone, from) : null;
|
|
80
|
+
if (next) {
|
|
81
|
+
this.nextRunAt = next;
|
|
82
|
+
} else {
|
|
83
|
+
this.unset(["nextRunAt"]);
|
|
84
|
+
}
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
AgenticJob
|
|
90
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var entities_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(entities_exports);
|
|
18
|
+
__reExport(entities_exports, require("./recurrence"), module.exports);
|
|
19
|
+
__reExport(entities_exports, require("./agentic-job.entity"), module.exports);
|
|
20
|
+
__reExport(entities_exports, require("./agentic-job-run.entity"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("./recurrence"),
|
|
24
|
+
...require("./agentic-job.entity"),
|
|
25
|
+
...require("./agentic-job-run.entity")
|
|
26
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const WEEKDAYS: readonly ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"];
|
|
2
|
+
export type Recurrence = {
|
|
3
|
+
type: 'daily';
|
|
4
|
+
time: string;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'weekly';
|
|
7
|
+
days: number[];
|
|
8
|
+
time: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'monthly';
|
|
11
|
+
day: number | 'last';
|
|
12
|
+
time: string;
|
|
13
|
+
} | {
|
|
14
|
+
type: 'once';
|
|
15
|
+
at: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function validateRecurrence(value: unknown): Recurrence;
|
|
18
|
+
export declare function toCronPattern(recurrence: Recurrence): string | undefined;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var recurrence_exports = {};
|
|
20
|
+
__export(recurrence_exports, {
|
|
21
|
+
WEEKDAYS: () => WEEKDAYS,
|
|
22
|
+
toCronPattern: () => toCronPattern,
|
|
23
|
+
validateRecurrence: () => validateRecurrence
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(recurrence_exports);
|
|
26
|
+
const WEEKDAYS = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"];
|
|
27
|
+
const TIME = /^([01]\d|2[0-3]):([0-5]\d)$/;
|
|
28
|
+
const LOCAL_DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})T([01]\d|2[0-3]):([0-5]\d)$/;
|
|
29
|
+
const isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
30
|
+
const assertTime = (value) => {
|
|
31
|
+
if (typeof value !== "string" || !TIME.test(value)) throw new Error("The time must be written as HH:mm, in 24 hours");
|
|
32
|
+
return value;
|
|
33
|
+
};
|
|
34
|
+
const assertLocalDateTime = (value) => {
|
|
35
|
+
const match = typeof value === "string" ? LOCAL_DATE_TIME.exec(value) : null;
|
|
36
|
+
if (!match) throw new Error("The date of a recurrence of type once must be written as YYYY-MM-DDTHH:mm");
|
|
37
|
+
const [, year, month, day] = match;
|
|
38
|
+
const parsed = new Date(Date.UTC(Number(year), Number(month) - 1, Number(day)));
|
|
39
|
+
if (parsed.getUTCFullYear() !== Number(year) || parsed.getUTCMonth() !== Number(month) - 1 || parsed.getUTCDate() !== Number(day)) {
|
|
40
|
+
throw new Error("The date of a recurrence of type once does not exist");
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
};
|
|
44
|
+
function validateRecurrence(value) {
|
|
45
|
+
if (!isRecord(value)) throw new Error("The recurrence is required");
|
|
46
|
+
switch (value.type) {
|
|
47
|
+
case "daily":
|
|
48
|
+
return { type: "daily", time: assertTime(value.time) };
|
|
49
|
+
case "weekly": {
|
|
50
|
+
const days = value.days;
|
|
51
|
+
const valid = Array.isArray(days) && days.length > 0 && days.every((day) => Number.isInteger(day) && day >= 1 && day <= 7);
|
|
52
|
+
if (!valid) throw new Error("The days of a weekly recurrence must be a list of numbers from 1 (Monday) to 7 (Sunday)");
|
|
53
|
+
return { type: "weekly", days: Array.from(new Set(days)).sort((a, b) => a - b), time: assertTime(value.time) };
|
|
54
|
+
}
|
|
55
|
+
case "monthly": {
|
|
56
|
+
const day = value.day;
|
|
57
|
+
const valid = day === "last" || Number.isInteger(day) && day >= 1 && day <= 31;
|
|
58
|
+
if (!valid) throw new Error('The day of a monthly recurrence must be a number from 1 to 31 or "last"');
|
|
59
|
+
return { type: "monthly", day, time: assertTime(value.time) };
|
|
60
|
+
}
|
|
61
|
+
case "once":
|
|
62
|
+
return { type: "once", at: assertLocalDateTime(value.at) };
|
|
63
|
+
default:
|
|
64
|
+
throw new Error("The type of the recurrence must be daily, weekly, monthly or once");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function toCronPattern(recurrence) {
|
|
68
|
+
if (recurrence.type === "once") return void 0;
|
|
69
|
+
const [hour, minute] = recurrence.time.split(":").map(Number);
|
|
70
|
+
switch (recurrence.type) {
|
|
71
|
+
case "daily":
|
|
72
|
+
return `${minute} ${hour} * * *`;
|
|
73
|
+
case "weekly":
|
|
74
|
+
return `${minute} ${hour} * * ${recurrence.days.map((day) => WEEKDAYS[day - 1]).join(",")}`;
|
|
75
|
+
case "monthly":
|
|
76
|
+
return `${minute} ${hour} ${recurrence.day === "last" ? "L" : recurrence.day} * *`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {
|
|
81
|
+
WEEKDAYS,
|
|
82
|
+
toCronPattern,
|
|
83
|
+
validateRecurrence
|
|
84
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import "../../../chunk-CF3WOMB3.mjs";
|
|
2
|
+
const WEEKDAYS = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"];
|
|
3
|
+
const TIME = /^([01]\d|2[0-3]):([0-5]\d)$/;
|
|
4
|
+
const LOCAL_DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})T([01]\d|2[0-3]):([0-5]\d)$/;
|
|
5
|
+
const isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
6
|
+
const assertTime = (value) => {
|
|
7
|
+
if (typeof value !== "string" || !TIME.test(value)) throw new Error("The time must be written as HH:mm, in 24 hours");
|
|
8
|
+
return value;
|
|
9
|
+
};
|
|
10
|
+
const assertLocalDateTime = (value) => {
|
|
11
|
+
const match = typeof value === "string" ? LOCAL_DATE_TIME.exec(value) : null;
|
|
12
|
+
if (!match) throw new Error("The date of a recurrence of type once must be written as YYYY-MM-DDTHH:mm");
|
|
13
|
+
const [, year, month, day] = match;
|
|
14
|
+
const parsed = new Date(Date.UTC(Number(year), Number(month) - 1, Number(day)));
|
|
15
|
+
if (parsed.getUTCFullYear() !== Number(year) || parsed.getUTCMonth() !== Number(month) - 1 || parsed.getUTCDate() !== Number(day)) {
|
|
16
|
+
throw new Error("The date of a recurrence of type once does not exist");
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
};
|
|
20
|
+
function validateRecurrence(value) {
|
|
21
|
+
if (!isRecord(value)) throw new Error("The recurrence is required");
|
|
22
|
+
switch (value.type) {
|
|
23
|
+
case "daily":
|
|
24
|
+
return { type: "daily", time: assertTime(value.time) };
|
|
25
|
+
case "weekly": {
|
|
26
|
+
const days = value.days;
|
|
27
|
+
const valid = Array.isArray(days) && days.length > 0 && days.every((day) => Number.isInteger(day) && day >= 1 && day <= 7);
|
|
28
|
+
if (!valid) throw new Error("The days of a weekly recurrence must be a list of numbers from 1 (Monday) to 7 (Sunday)");
|
|
29
|
+
return { type: "weekly", days: Array.from(new Set(days)).sort((a, b) => a - b), time: assertTime(value.time) };
|
|
30
|
+
}
|
|
31
|
+
case "monthly": {
|
|
32
|
+
const day = value.day;
|
|
33
|
+
const valid = day === "last" || Number.isInteger(day) && day >= 1 && day <= 31;
|
|
34
|
+
if (!valid) throw new Error('The day of a monthly recurrence must be a number from 1 to 31 or "last"');
|
|
35
|
+
return { type: "monthly", day, time: assertTime(value.time) };
|
|
36
|
+
}
|
|
37
|
+
case "once":
|
|
38
|
+
return { type: "once", at: assertLocalDateTime(value.at) };
|
|
39
|
+
default:
|
|
40
|
+
throw new Error("The type of the recurrence must be daily, weekly, monthly or once");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function toCronPattern(recurrence) {
|
|
44
|
+
if (recurrence.type === "once") return void 0;
|
|
45
|
+
const [hour, minute] = recurrence.time.split(":").map(Number);
|
|
46
|
+
switch (recurrence.type) {
|
|
47
|
+
case "daily":
|
|
48
|
+
return `${minute} ${hour} * * *`;
|
|
49
|
+
case "weekly":
|
|
50
|
+
return `${minute} ${hour} * * ${recurrence.days.map((day) => WEEKDAYS[day - 1]).join(",")}`;
|
|
51
|
+
case "monthly":
|
|
52
|
+
return `${minute} ${hour} ${recurrence.day === "last" ? "L" : recurrence.day} * *`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
WEEKDAYS,
|
|
57
|
+
toCronPattern,
|
|
58
|
+
validateRecurrence
|
|
59
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var agentic_jobs_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(agentic_jobs_exports);
|
|
18
|
+
__reExport(agentic_jobs_exports, require("./module"), module.exports);
|
|
19
|
+
__reExport(agentic_jobs_exports, require("./entities"), module.exports);
|
|
20
|
+
__reExport(agentic_jobs_exports, require("./repositories"), module.exports);
|
|
21
|
+
__reExport(agentic_jobs_exports, require("./runner/agentic-job-runner"), module.exports);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
...require("./module"),
|
|
25
|
+
...require("./entities"),
|
|
26
|
+
...require("./repositories"),
|
|
27
|
+
...require("./runner/agentic-job-runner")
|
|
28
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { Params as CParams, Output as COutput } from './use-cases/create-agentic-job.use-case';
|
|
3
|
+
import { Params as UParams, Output as UOutput } from './use-cases/update-agentic-job.use-case';
|
|
4
|
+
import { Params as GParams, Output as GOutput } from './use-cases/get-agentic-job-by-id.use-case';
|
|
5
|
+
import { Params as LParams, Output as LOutput } from './use-cases/list-agentic-jobs-by-user.use-case';
|
|
6
|
+
import { Params as DParams, Output as DOutput } from './use-cases/delete-agentic-job.use-case';
|
|
7
|
+
import { Params as PParams, Output as POutput } from './use-cases/preview-agentic-job-runs.use-case';
|
|
8
|
+
import { Params as RJParams, Output as RJOutput } from './use-cases/list-agentic-job-runs-by-job.use-case';
|
|
9
|
+
import { Params as RUParams, Output as RUOutput } from './use-cases/list-agentic-job-runs-by-user.use-case';
|
|
10
|
+
import { Params as CDParams, Output as CDOutput } from './use-cases/claim-due-agentic-jobs.use-case';
|
|
11
|
+
import { Params as SRParams, Output as SROutput } from './use-cases/start-agentic-job-run.use-case';
|
|
12
|
+
import { Params as FRParams, Output as FROutput } from './use-cases/finish-agentic-job-run.use-case';
|
|
13
|
+
import { Params as SYParams, Output as SYOutput } from './use-cases/sync-agentic-job-run.use-case';
|
|
14
|
+
import { Params as SYSParams, Output as SYSOutput } from './use-cases/sync-agentic-job-runs.use-case';
|
|
15
|
+
import { Params as ACParams, Output as ACOutput } from './use-cases/attach-agentic-job-run-chat.use-case';
|
|
16
|
+
import { Params as RLParams, Output as RLOutput } from './use-cases/renew-agentic-job-lease.use-case';
|
|
17
|
+
export declare function createAgenticJob(props: CParams): Promise<COutput>;
|
|
18
|
+
export declare function updateAgenticJob(props: UParams): Promise<UOutput>;
|
|
19
|
+
export declare function getAgenticJobById(props: GParams): Promise<GOutput>;
|
|
20
|
+
export declare function listAgenticJobsByUser(props: LParams): Promise<LOutput>;
|
|
21
|
+
export declare function deleteAgenticJob(props: DParams): Promise<DOutput>;
|
|
22
|
+
export declare function previewAgenticJobRuns(props: PParams): Promise<POutput>;
|
|
23
|
+
export declare function listAgenticJobRunsByJob(props: RJParams): Promise<RJOutput>;
|
|
24
|
+
export declare function listAgenticJobRunsByUser(props: RUParams): Promise<RUOutput>;
|
|
25
|
+
export declare function claimDueAgenticJobs(props: CDParams): Promise<CDOutput>;
|
|
26
|
+
export declare function startAgenticJobRun(props: SRParams): Promise<SROutput>;
|
|
27
|
+
export declare function finishAgenticJobRun(props: FRParams): Promise<FROutput>;
|
|
28
|
+
export declare function syncAgenticJobRun(props: SYParams): Promise<SYOutput>;
|
|
29
|
+
export declare function syncAgenticJobRuns(props?: SYSParams): Promise<SYSOutput>;
|
|
30
|
+
export declare function attachAgenticJobRunChat(props: ACParams): Promise<ACOutput>;
|
|
31
|
+
export declare function renewAgenticJobLease(props: RLParams): Promise<RLOutput>;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var module_exports = {};
|
|
20
|
+
__export(module_exports, {
|
|
21
|
+
attachAgenticJobRunChat: () => attachAgenticJobRunChat,
|
|
22
|
+
claimDueAgenticJobs: () => claimDueAgenticJobs,
|
|
23
|
+
createAgenticJob: () => createAgenticJob,
|
|
24
|
+
deleteAgenticJob: () => deleteAgenticJob,
|
|
25
|
+
finishAgenticJobRun: () => finishAgenticJobRun,
|
|
26
|
+
getAgenticJobById: () => getAgenticJobById,
|
|
27
|
+
listAgenticJobRunsByJob: () => listAgenticJobRunsByJob,
|
|
28
|
+
listAgenticJobRunsByUser: () => listAgenticJobRunsByUser,
|
|
29
|
+
listAgenticJobsByUser: () => listAgenticJobsByUser,
|
|
30
|
+
previewAgenticJobRuns: () => previewAgenticJobRuns,
|
|
31
|
+
renewAgenticJobLease: () => renewAgenticJobLease,
|
|
32
|
+
startAgenticJobRun: () => startAgenticJobRun,
|
|
33
|
+
syncAgenticJobRun: () => syncAgenticJobRun,
|
|
34
|
+
syncAgenticJobRuns: () => syncAgenticJobRuns,
|
|
35
|
+
updateAgenticJob: () => updateAgenticJob
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(module_exports);
|
|
38
|
+
var import_reflect_metadata = require("reflect-metadata");
|
|
39
|
+
var import_tsyringe = require("tsyringe");
|
|
40
|
+
var import_create_agentic_job = require("./use-cases/create-agentic-job.use-case");
|
|
41
|
+
var import_update_agentic_job = require("./use-cases/update-agentic-job.use-case");
|
|
42
|
+
var import_get_agentic_job_by_id = require("./use-cases/get-agentic-job-by-id.use-case");
|
|
43
|
+
var import_list_agentic_jobs_by_user = require("./use-cases/list-agentic-jobs-by-user.use-case");
|
|
44
|
+
var import_delete_agentic_job = require("./use-cases/delete-agentic-job.use-case");
|
|
45
|
+
var import_preview_agentic_job_runs = require("./use-cases/preview-agentic-job-runs.use-case");
|
|
46
|
+
var import_list_agentic_job_runs_by_job = require("./use-cases/list-agentic-job-runs-by-job.use-case");
|
|
47
|
+
var import_list_agentic_job_runs_by_user = require("./use-cases/list-agentic-job-runs-by-user.use-case");
|
|
48
|
+
var import_claim_due_agentic_jobs = require("./use-cases/claim-due-agentic-jobs.use-case");
|
|
49
|
+
var import_start_agentic_job_run = require("./use-cases/start-agentic-job-run.use-case");
|
|
50
|
+
var import_finish_agentic_job_run = require("./use-cases/finish-agentic-job-run.use-case");
|
|
51
|
+
var import_sync_agentic_job_run = require("./use-cases/sync-agentic-job-run.use-case");
|
|
52
|
+
var import_sync_agentic_job_runs = require("./use-cases/sync-agentic-job-runs.use-case");
|
|
53
|
+
var import_attach_agentic_job_run_chat = require("./use-cases/attach-agentic-job-run-chat.use-case");
|
|
54
|
+
var import_renew_agentic_job_lease = require("./use-cases/renew-agentic-job-lease.use-case");
|
|
55
|
+
async function createAgenticJob(props) {
|
|
56
|
+
const createAgenticJobUseCase = import_tsyringe.container.resolve(import_create_agentic_job.CreateAgenticJobUseCase);
|
|
57
|
+
return createAgenticJobUseCase.execute(props);
|
|
58
|
+
}
|
|
59
|
+
async function updateAgenticJob(props) {
|
|
60
|
+
const updateAgenticJobUseCase = import_tsyringe.container.resolve(import_update_agentic_job.UpdateAgenticJobUseCase);
|
|
61
|
+
return updateAgenticJobUseCase.execute(props);
|
|
62
|
+
}
|
|
63
|
+
async function getAgenticJobById(props) {
|
|
64
|
+
const getAgenticJobByIdUseCase = import_tsyringe.container.resolve(import_get_agentic_job_by_id.GetAgenticJobByIdUseCase);
|
|
65
|
+
return getAgenticJobByIdUseCase.execute(props);
|
|
66
|
+
}
|
|
67
|
+
async function listAgenticJobsByUser(props) {
|
|
68
|
+
const listAgenticJobsByUserUseCase = import_tsyringe.container.resolve(import_list_agentic_jobs_by_user.ListAgenticJobsByUserUseCase);
|
|
69
|
+
return listAgenticJobsByUserUseCase.execute(props);
|
|
70
|
+
}
|
|
71
|
+
async function deleteAgenticJob(props) {
|
|
72
|
+
const deleteAgenticJobUseCase = import_tsyringe.container.resolve(import_delete_agentic_job.DeleteAgenticJobUseCase);
|
|
73
|
+
return deleteAgenticJobUseCase.execute(props);
|
|
74
|
+
}
|
|
75
|
+
async function previewAgenticJobRuns(props) {
|
|
76
|
+
const previewAgenticJobRunsUseCase = import_tsyringe.container.resolve(import_preview_agentic_job_runs.PreviewAgenticJobRunsUseCase);
|
|
77
|
+
return previewAgenticJobRunsUseCase.execute(props);
|
|
78
|
+
}
|
|
79
|
+
async function listAgenticJobRunsByJob(props) {
|
|
80
|
+
const listAgenticJobRunsByJobUseCase = import_tsyringe.container.resolve(import_list_agentic_job_runs_by_job.ListAgenticJobRunsByJobUseCase);
|
|
81
|
+
return listAgenticJobRunsByJobUseCase.execute(props);
|
|
82
|
+
}
|
|
83
|
+
async function listAgenticJobRunsByUser(props) {
|
|
84
|
+
const listAgenticJobRunsByUserUseCase = import_tsyringe.container.resolve(import_list_agentic_job_runs_by_user.ListAgenticJobRunsByUserUseCase);
|
|
85
|
+
return listAgenticJobRunsByUserUseCase.execute(props);
|
|
86
|
+
}
|
|
87
|
+
async function claimDueAgenticJobs(props) {
|
|
88
|
+
const claimDueAgenticJobsUseCase = import_tsyringe.container.resolve(import_claim_due_agentic_jobs.ClaimDueAgenticJobsUseCase);
|
|
89
|
+
return claimDueAgenticJobsUseCase.execute(props);
|
|
90
|
+
}
|
|
91
|
+
async function startAgenticJobRun(props) {
|
|
92
|
+
const startAgenticJobRunUseCase = import_tsyringe.container.resolve(import_start_agentic_job_run.StartAgenticJobRunUseCase);
|
|
93
|
+
return startAgenticJobRunUseCase.execute(props);
|
|
94
|
+
}
|
|
95
|
+
async function finishAgenticJobRun(props) {
|
|
96
|
+
const finishAgenticJobRunUseCase = import_tsyringe.container.resolve(import_finish_agentic_job_run.FinishAgenticJobRunUseCase);
|
|
97
|
+
return finishAgenticJobRunUseCase.execute(props);
|
|
98
|
+
}
|
|
99
|
+
async function syncAgenticJobRun(props) {
|
|
100
|
+
const syncAgenticJobRunUseCase = import_tsyringe.container.resolve(import_sync_agentic_job_run.SyncAgenticJobRunUseCase);
|
|
101
|
+
return syncAgenticJobRunUseCase.execute(props);
|
|
102
|
+
}
|
|
103
|
+
async function syncAgenticJobRuns(props = {}) {
|
|
104
|
+
const syncAgenticJobRunsUseCase = import_tsyringe.container.resolve(import_sync_agentic_job_runs.SyncAgenticJobRunsUseCase);
|
|
105
|
+
return syncAgenticJobRunsUseCase.execute(props);
|
|
106
|
+
}
|
|
107
|
+
async function attachAgenticJobRunChat(props) {
|
|
108
|
+
const attachAgenticJobRunChatUseCase = import_tsyringe.container.resolve(import_attach_agentic_job_run_chat.AttachAgenticJobRunChatUseCase);
|
|
109
|
+
return attachAgenticJobRunChatUseCase.execute(props);
|
|
110
|
+
}
|
|
111
|
+
async function renewAgenticJobLease(props) {
|
|
112
|
+
const renewAgenticJobLeaseUseCase = import_tsyringe.container.resolve(import_renew_agentic_job_lease.RenewAgenticJobLeaseUseCase);
|
|
113
|
+
return renewAgenticJobLeaseUseCase.execute(props);
|
|
114
|
+
}
|
|
115
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
+
0 && (module.exports = {
|
|
117
|
+
attachAgenticJobRunChat,
|
|
118
|
+
claimDueAgenticJobs,
|
|
119
|
+
createAgenticJob,
|
|
120
|
+
deleteAgenticJob,
|
|
121
|
+
finishAgenticJobRun,
|
|
122
|
+
getAgenticJobById,
|
|
123
|
+
listAgenticJobRunsByJob,
|
|
124
|
+
listAgenticJobRunsByUser,
|
|
125
|
+
listAgenticJobsByUser,
|
|
126
|
+
previewAgenticJobRuns,
|
|
127
|
+
renewAgenticJobLease,
|
|
128
|
+
startAgenticJobRun,
|
|
129
|
+
syncAgenticJobRun,
|
|
130
|
+
syncAgenticJobRuns,
|
|
131
|
+
updateAgenticJob
|
|
132
|
+
});
|