@solidxai/core 0.1.20-beta.0 → 0.1.20-beta.2

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.
Files changed (63) hide show
  1. package/.agents/skills/agenthub-agent-configuration/SKILL.md +41 -0
  2. package/.agents/skills/agenthub-agent-configuration/references/data-model.md +34 -0
  3. package/.agents/skills/agenthub-agent-configuration/references/runtime.md +28 -0
  4. package/CHANGELOG.md +17 -0
  5. package/dist/dtos/create-email-template.dto.d.ts +2 -0
  6. package/dist/dtos/create-email-template.dto.d.ts.map +1 -1
  7. package/dist/dtos/create-email-template.dto.js +13 -1
  8. package/dist/dtos/create-email-template.dto.js.map +1 -1
  9. package/dist/dtos/create-sms-template.dto.d.ts +2 -0
  10. package/dist/dtos/create-sms-template.dto.d.ts.map +1 -1
  11. package/dist/dtos/create-sms-template.dto.js +13 -1
  12. package/dist/dtos/create-sms-template.dto.js.map +1 -1
  13. package/dist/entities/agent-human-request.entity.d.ts.map +1 -1
  14. package/dist/entities/agent-human-request.entity.js +2 -1
  15. package/dist/entities/agent-human-request.entity.js.map +1 -1
  16. package/dist/entities/agent-job.entity.d.ts.map +1 -1
  17. package/dist/entities/agent-job.entity.js +5 -4
  18. package/dist/entities/agent-job.entity.js.map +1 -1
  19. package/dist/entities/agent-process.entity.d.ts.map +1 -1
  20. package/dist/entities/agent-process.entity.js +4 -3
  21. package/dist/entities/agent-process.entity.js.map +1 -1
  22. package/dist/entities/agent-session.entity.d.ts.map +1 -1
  23. package/dist/entities/agent-session.entity.js +4 -3
  24. package/dist/entities/agent-session.entity.js.map +1 -1
  25. package/dist/entities/agent-skill.entity.d.ts.map +1 -1
  26. package/dist/entities/agent-skill.entity.js +2 -1
  27. package/dist/entities/agent-skill.entity.js.map +1 -1
  28. package/dist/entities/agent-tool.entity.d.ts.map +1 -1
  29. package/dist/entities/agent-tool.entity.js +2 -1
  30. package/dist/entities/agent-tool.entity.js.map +1 -1
  31. package/dist/entities/email-template.entity.d.ts +2 -0
  32. package/dist/entities/email-template.entity.d.ts.map +1 -1
  33. package/dist/entities/email-template.entity.js +8 -1
  34. package/dist/entities/email-template.entity.js.map +1 -1
  35. package/dist/entities/secret.entity.js +1 -1
  36. package/dist/entities/secret.entity.js.map +1 -1
  37. package/dist/entities/sms-template.entity.d.ts +2 -0
  38. package/dist/entities/sms-template.entity.d.ts.map +1 -1
  39. package/dist/entities/sms-template.entity.js +8 -1
  40. package/dist/entities/sms-template.entity.js.map +1 -1
  41. package/dist/helpers/typeorm-db-helper.d.ts +1 -0
  42. package/dist/helpers/typeorm-db-helper.d.ts.map +1 -1
  43. package/dist/helpers/typeorm-db-helper.js +30 -0
  44. package/dist/helpers/typeorm-db-helper.js.map +1 -1
  45. package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
  46. package/dist/seeders/module-metadata-seeder.service.js +2 -0
  47. package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
  48. package/dist/seeders/seed-data/solid-core-metadata.json +72 -8
  49. package/package.json +1 -1
  50. package/src/dtos/create-email-template.dto.ts +11 -1
  51. package/src/dtos/create-sms-template.dto.ts +11 -1
  52. package/src/entities/agent-human-request.entity.ts +2 -1
  53. package/src/entities/agent-job.entity.ts +5 -4
  54. package/src/entities/agent-process.entity.ts +4 -3
  55. package/src/entities/agent-session.entity.ts +4 -3
  56. package/src/entities/agent-skill.entity.ts +2 -1
  57. package/src/entities/agent-tool.entity.ts +2 -1
  58. package/src/entities/email-template.entity.ts +8 -2
  59. package/src/entities/secret.entity.ts +1 -1
  60. package/src/entities/sms-template.entity.ts +8 -2
  61. package/src/helpers/typeorm-db-helper.ts +34 -0
  62. package/src/seeders/module-metadata-seeder.service.ts +6 -0
  63. package/src/seeders/seed-data/solid-core-metadata.json +72 -8
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: agenthub-agent-configuration
3
+ description: Design, configure, and review bespoke domain agents in SolidX AgentHub using AgentRegistry, linked skill/tool catalogs, roles, secrets, and runtime validation. Use for AgentHub agent setup in solid-core-module, solid-core-ui, and consuming projects; not for standalone Codex skills or the separate SolidX agent runtime.
4
+ ---
5
+
6
+ # Configure a SolidX AgentHub agent
7
+
8
+ Treat an AgentHub agent as a **configured, runnable `AgentRegistry` row** whose behavior comes from its system prompt, linked skills, linked tools, model selections, access roles, required inputs, and limits. The registry and link tables are the source of truth. A Markdown skill in this repository is guidance for the builder; an `AgentSkillRegistry.body` is guidance loaded by a *running AgentHub agent*. Do not confuse them.
9
+
10
+ Before editing a real agent, read [references/data-model.md](references/data-model.md). For execution, activation, and verification, read [references/runtime.md](references/runtime.md). The references name the implementation files to recheck when code has changed.
11
+
12
+ ## Work with the human
13
+
14
+ Translate the domain request into a small configuration brief:
15
+
16
+ - **Job and boundary:** who will invoke it, what outcome it owns, what it must escalate, and what evidence it must cite or return.
17
+ - **Inputs:** initial facts the caller must supply, with names, descriptions, and data types. Keep optional conversational context out of `requiredInputs`.
18
+ - **Knowledge and actions:** reusable instructions belong in skills; executable capabilities belong in tools. Identify the exact data source or API behind any requested capability. A tag only aids discovery; it does not grant a capability.
19
+ - **Authority:** select caller roles, per-tool approval gates, and only the secrets actually needed. A system prompt is behavioral guidance, not an access control boundary.
20
+ - **Operation:** choose enabled reasoning and fast models, initial step/cost budgets, and a few representative success and failure scenarios.
21
+
22
+ Ask only for genuinely missing domain decisions. When live workspace access is available, inspect existing agents, catalog entries, roles, settings, and secrets before proposing duplicates or identifiers. Do not invent IDs, provider keys, secret names, working integrations, or runtime results.
23
+
24
+ ## Configuration sequence
25
+
26
+ 1. Reuse suitable catalog skills and tools; create `custom` or `thirdparty` catalog rows only when necessary. Keep a skill focused on a repeatable method and a tool focused on one callable operation. A tool needs Python source conforming to the AgentHub SDK; a URL, model instruction, or tag alone is not executable.
27
+ 2. Draft `AgentRegistry`: stable unique `name`, human `title` and `description`, specific `systemPrompt`, JSON `requiredInputs`, configured `reasoningModelKey` and `fastModelKey`, positive `stepLimit` and `turnStepLimit`, nonnegative `costLimit`, and initially `draft` status. Use the current UI/API contract for field names and payload shape.
28
+ 3. Create separate `AgentSkill`, `AgentTool`, `AgentRole`, and `AgentSecret` links. Set `alwaysInclude`, `requiresApproval`, and `envVarName` on the links. A catalog row without a link is unavailable to that agent. Avoid broad roles, unnecessary secrets, and action tools with approval off unless the domain case justifies them.
29
+ 4. For custom or third-party tools, save the source, run configuration and initialization checks, then activate. Resolve required secrets and load errors. The source checksum and status matter; linking an inactive tool is insufficient.
30
+ 5. Save and inspect all links, then activate the agent. The editor saves the registry and links in separate calls, so a partial save can leave missing associations. Test through the embedded AgentHub chat as an allowed user, with realistic `requiredInputs`; exercise success, missing/invalid input, denied access, tool failure, and approval paths relevant to the agent. Inspect process load reports, sessions, and events when a run disagrees with the design. Report observed behavior separately from configuration intent.
31
+ 6. After changing the agent or a linked catalog item, check `configVersion` and process freshness. Restart or allow a new process where needed, then retest the updated configuration. Do not infer that an already running session adopted new instructions.
32
+
33
+ ## Prompt and resource design
34
+
35
+ Write the `systemPrompt` as a concise contract: role, supported tasks, decision rules, evidence standard, tool-use criteria, escalation conditions, and completion criteria. Put long reusable domain procedures in linked skills. `alwaysInclude=true` injects the full skill body into the initial prompt; `false` leaves it indexed for on-demand loading through a linked `load_skill` tool. If on-demand skills are desired, ensure `load_skill` is linked and test retrieval. Do not duplicate the runtime's mandatory widget/JSON response instructions in the persona prompt.
36
+
37
+ Describe each tool in operational terms: what it reads or changes, arguments, expected result, required credentials, and whether a human must approve calls. For tools that mutate external state, explicitly define when the agent should ask for approval or stop. Link `AgentSecret` to an existing SolidX `Secret` with a valid, unique environment variable name; never place credential values in a prompt, skill body, or tool source.
38
+
39
+ ## Handoff
40
+
41
+ Leave the human with a configuration map: registry fields; linked skills/tools and their link settings; roles; secret *names* and environment bindings; model keys; status; and tests performed. Mark any unverified runtime dependency or missing integration explicitly. If asked only to design, provide this map without creating or activating live records.
@@ -0,0 +1,34 @@
1
+ # AgentHub configuration data model
2
+
3
+ Use this when creating or reviewing records. Recheck `solid-core-module/src/entities/agent-*.entity.ts`, create/update DTOs, and `src/seeders/seed-data/solid-core-metadata.json` before relying on a field in a changed checkout.
4
+
5
+ ## Definition and associations
6
+
7
+ | Model / table | Configuration meaning | Important fields |
8
+ | --- | --- | --- |
9
+ | `AgentRegistry` / `ss_agent_registry` | One runnable agent definition | unique `name`, `title`, `description`, `iconName`, `systemPrompt`, `requiredInputs`, `reasoningModelKey`, `fastModelKey`, `status`, `stepLimit`, `turnStepLimit`, `costLimit`, `configVersion` |
10
+ | `AgentSkillRegistry` / `ss_agent_skill_registry` | Shared Markdown skill catalog | unique `name`, `type`, `description`, `body`, tags |
11
+ | `AgentToolRegistry` / `ss_agent_tool_registry` | Shared Python tool catalog | unique `name`, `type`, `description`, `sourceCode`, `checksum`, `status`, `lastLoadError`, tags |
12
+ | `AgentSkill` / `ss_agent_skill` | Agent-to-skill link | required agent and catalog relations; `alwaysInclude` (default true) |
13
+ | `AgentTool` / `ss_agent_tool` | Agent-to-tool link | required agent and catalog relations; `requiresApproval` (default false) |
14
+ | `AgentRole` / `ss_agent_role` | Agent-to-`RoleMetadata` link | allowed caller role |
15
+ | `AgentSecret` / `ss_agent_secret` | Agent-to-`Secret` link | `envVarName` in worker environment |
16
+ | `AgentHubTag` / `ss_agent_hub_tag` | Discovery label on agents, skill catalog, tool catalog | unique `name` |
17
+
18
+ `AgentProcess`, `AgentSession`, `AgentJob`, `AgentEvent`, `AgentSessionCheckpoint`, and `AgentHumanRequest` are runtime/observability records. They are not resources to precreate as part of an agent definition. `AgentRegistry` exposes one-to-many relations to several of them because the generic CRUD metadata represents all entity relations; do not fill runtime collections when creating an agent. The current implementation has no separate AgentHub knowledge-base, policy, or output-schema entity. Those ideas appear in older vision notes, but should not be promised as live configuration fields.
19
+
20
+ ## Exact contracts that affect decisions
21
+
22
+ - `status` is a string at the entity/DTO layer. The editor presents `draft`, `active`, `disabled`; the DB runtime loads only `active` agents. Start in `draft`, validate, then activate.
23
+ - `requiredInputs` is stored as a JSON **string**. Core normalizes an array of `{name, description, dataType}` (and accepts historical name-keyed objects and `variableName`/`type` aliases). Types are `string`, `number`, `integer`, `boolean`, `date`, `datetime`, `object`, `array`; names must be nonempty, case-insensitively unique, and cannot be `__proto__`, `constructor`, or `prototype`. See `src/helpers/agent-required-inputs.ts` and runtime `src/agenthub/inputs.py`.
24
+ - Both model keys use `<provider-id>:<provider-model-id>`, resolved from the SolidX AI setting `solidXGenAiCodeBuilderConfig` by the runtime. The editor lists enabled provider/model pairs. A syntactically plausible key without configured credentials can leave the runtime model unavailable.
25
+ - `configVersion` is set to 1 on registry create and bumped on registry edits and linked skill/tool/role/secret edits. Changes to a shared skill/tool catalog bump linked agents. Treat version as a process freshness signal, not a user-controlled version field. See `src/services/agent-config-version.service.ts`.
26
+ - `type='solidx'` skill/tool catalog rows are runtime-seeded and Core blocks their update/delete. Use a new `custom` or `thirdparty` entry for domain-specific resources; do not overwrite a built-in.
27
+ - Catalog `name` is globally unique. Link rows also have computed unique keys for each agent/resource pair in seeded metadata; avoid duplicate links.
28
+ - Delete behavior: definition links cascade with deleted agent/catalog records; process/session/job references to an agent may be set null. Deleting a definition is not a safe way to clear runtime history.
29
+
30
+ ## Where configuration is edited
31
+
32
+ The Solid UI custom editors are `solid-core-ui/src/routes/pages/admin/core/AgentRegistryEditorPage.tsx`, `AgentSkillRegistryEditorPage.tsx`, and `AgentToolRegistryEditorPage.tsx`. The agent editor has Basics, Persona, Skills, Tools, Policies, Secrets, Processes, Sessions, and test/embedding affordances. It saves the agent scalar record first and then synchronizes link rows through the entity APIs. Check the saved result for partial link failures. Core controllers expose corresponding CRUD routes under `agent-registry`, `agent-skill-registry`, `agent-tool-registry`, `agent-skill`, `agent-tool`, `agent-role`, and `agent-secret`; tool checks use `agent-tool-registry/:id/check`.
33
+
34
+ The consuming `agent-hub-core` project currently wires the shared Core API/UI packages. Most behavior lives in `solid-core-module`, `solid-core-ui`, and the separate `agent-hub-runtime` repository. Read deployed package versions before assuming local source changes are present in the running app.
@@ -0,0 +1,28 @@
1
+ # AgentHub runtime and verification
2
+
3
+ Use this when choosing links, activating tools, diagnosing access, or testing a configured agent. Implementation: `agent-hub-runtime/src/agenthub/` plus Core's `src/services/agent-tool-registry.service.ts` and `src/services/agent-hub-process-manager.service.ts`.
4
+
5
+ ## What the runtime actually loads
6
+
7
+ `config/source_db.py` reads an active, nondeleted `AgentRegistry` row and builds `AgentSpec`. It reads linked skills, linked roles, and linked tools whose catalog status is `active` or `load_failed`. A `load_failed` tool is retried when a new process loads; an `inactive` tool is omitted. Secret links are read separately by the manager when it spawns a worker. The manager resolves secret values and injects them under each link's `envVarName`; it rejects invalid or reserved names. Do not confuse a tool's declared `required_secrets` with an agent's `AgentSecret` link: custom tool lifecycle checks verify active SolidX secrets, while process links determine which values the worker receives.
8
+
9
+ The manager admits callers by intersection of their SolidX role IDs and the agent's `AgentRole` IDs (`identity.authorized`). An agent with no role links does not grant ordinary users access. AgentHub administrator checks are separate. A tool's `requiresApproval` causes a pending human approval request before execution. The agent's system prompt cannot override either control.
10
+
11
+ `skills/__init__.py` places every linked skill name and description in the prompt; bodies with `alwaysInclude=true` are also inserted. `load_skill` can fetch another linked body on demand **only if the `load_skill` tool is linked and loaded**. Tags are exposed in the skill index but are not a retrieval or authorization mechanism.
12
+
13
+ The runtime appends its own prompt for widget choice and JSON reply envelope. It enforces `stepLimit`, `turnStepLimit`, and `costLimit` in the loop. The fast model supports auxiliary tasks; both selected models should resolve. Required inputs are validated by type at session start. Interactive tests pass them through the embedded chat; jobs accept them in the job payload.
14
+
15
+ ## Tool lifecycle
16
+
17
+ `AgentToolRegistry.sourceCode` must contain one matching `@tool(name=...)` declaration with a Pydantic argument model and `(args, ctx) -> ToolResponse` behavior. The source is checksum verified. Custom and third-party source passes the import guard; SolidX built-ins are bundled and seeded by the manager. Custom/third-party activation also requires exactly one `@tool_config` and one `@tool_init` hook: the first declares required secret names, the second performs a bounded, non-destructive functional check. The UI saves these tools inactive, runs `config` and `init` checks against the saved checksum, then activates only after both pass. Source/name/type changes reset them to inactive. A linked tool can still fail at process load; inspect `lastLoadError` and the process `loadReport`.
18
+
19
+ Current built-ins are listed in `agent-hub-runtime/src/agenthub/builtin_catalog.json`; examples include `load_skill`, `request_human_input`, `web_search`, `filesystem`, `bash`, and read-only PostgreSQL/MSSQL tools. Their availability still requires a link to the agent and any environment dependencies. Do not infer database write ability from a read-only query tool.
20
+
21
+ ## Practical verification
22
+
23
+ 1. Read back the agent and its links; confirm statuses, model keys, required-input JSON, role IDs, secret environment names, and tool catalog state.
24
+ 2. Activate the agent and use **Test Agent** in the Solid UI (embedded `agentHub` chat) as a user in an allowed role. Provide typed required inputs. Run a representative happy path and one important failure/approval path.
25
+ 3. Inspect process readiness and `loadReport`; inspect session/event and human-request records when needed. A saved configuration or a successful tool check alone does not prove a working run.
26
+ 4. After edits, compare process and agent `configVersion`. The manager uses a ready process with matching version or spawns a fresh one for new sessions; existing sessions may remain on their current process. The UI also offers process restart. Retest with a fresh session when validating changed instructions or tools.
27
+
28
+ For API jobs, `AgentJob` and `AgentSession` hold execution state; `AgentEvent` is the detailed trace and `AgentHumanRequest` holds pending input/approval. Treat these as diagnostics and audit data, not definition fields.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.20-beta.2] - 2026-10-09
4
+
5
+ ### Added
6
+
7
+ - add documentation for AgentHub agent configuration, data model, and runtime verification
8
+
9
+ ### Fixed
10
+
11
+ - update defaultValue type from integer to string for consistency (#187)
12
+
13
+ ## [0.1.20-beta.1] - 2026-10-08
14
+
15
+ ### Added
16
+
17
+ - enhance boolean column type handling in entities and update rel… (#186)
18
+ - add module relation to email and SMS templates; update DTOs and seed data
19
+
3
20
  ## [0.1.20-beta.0] - 2026-10-08
4
21
 
5
22
  ### Added
@@ -8,5 +8,7 @@ export declare class CreateEmailTemplateDto {
8
8
  active: boolean;
9
9
  attachments: CreateEmailAttachmentDto[];
10
10
  type: string;
11
+ moduleId?: number;
12
+ moduleUserKey?: string;
11
13
  }
12
14
  //# sourceMappingURL=create-email-template.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-email-template.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-email-template.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAIzE,qBAAa,sBAAsB;IAK/B,IAAI,EAAE,MAAM,CAAC;IAKb,WAAW,EAAE,MAAM,CAAC;IAKpB,IAAI,EAAE,MAAM,CAAC;IAKb,OAAO,EAAE,MAAM,CAAQ;IAKvB,WAAW,EAAE,MAAM,CAAC;IAKpB,MAAM,EAAE,OAAO,CAAQ;IAMvB,WAAW,EAAE,wBAAwB,EAAE,CAAC;IAKxC,IAAI,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"create-email-template.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-email-template.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAIzE,qBAAa,sBAAsB;IAK/B,IAAI,EAAE,MAAM,CAAC;IAKb,WAAW,EAAE,MAAM,CAAC;IAKpB,IAAI,EAAE,MAAM,CAAC;IAKb,OAAO,EAAE,MAAM,CAAQ;IAKvB,WAAW,EAAE,MAAM,CAAC;IAKpB,MAAM,EAAE,OAAO,CAAQ;IAMvB,WAAW,EAAE,wBAAwB,EAAE,CAAC;IAKxC,IAAI,EAAE,MAAM,CAAC;IAKb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -21,7 +21,7 @@ class CreateEmailTemplateDto {
21
21
  this.active = true;
22
22
  }
23
23
  static _OPENAPI_METADATA_FACTORY() {
24
- return { name: { required: true, type: () => String, pattern: "/[a-z]+(-[a-z]+)*/" }, displayName: { required: true, type: () => String }, body: { required: true, type: () => String }, subject: { required: true, type: () => String, default: "{}" }, description: { required: true, type: () => String }, active: { required: true, type: () => Boolean, default: true }, attachments: { required: true, type: () => [require("./create-email-attachment.dto").CreateEmailAttachmentDto] }, type: { required: true, type: () => String } };
24
+ return { name: { required: true, type: () => String, pattern: "/[a-z]+(-[a-z]+)*/" }, displayName: { required: true, type: () => String }, body: { required: true, type: () => String }, subject: { required: true, type: () => String, default: "{}" }, description: { required: true, type: () => String }, active: { required: true, type: () => Boolean, default: true }, attachments: { required: true, type: () => [require("./create-email-attachment.dto").CreateEmailAttachmentDto] }, type: { required: true, type: () => String }, moduleId: { required: false, type: () => Number }, moduleUserKey: { required: false, type: () => String } };
25
25
  }
26
26
  }
27
27
  exports.CreateEmailTemplateDto = CreateEmailTemplateDto;
@@ -75,4 +75,16 @@ __decorate([
75
75
  (0, swagger_1.ApiProperty)(),
76
76
  __metadata("design:type", String)
77
77
  ], CreateEmailTemplateDto.prototype, "type", void 0);
78
+ __decorate([
79
+ (0, class_validator_1.IsOptional)(),
80
+ (0, class_validator_1.IsInt)(),
81
+ (0, swagger_1.ApiProperty)({ required: false, description: 'Related module id' }),
82
+ __metadata("design:type", Number)
83
+ ], CreateEmailTemplateDto.prototype, "moduleId", void 0);
84
+ __decorate([
85
+ (0, class_validator_1.IsOptional)(),
86
+ (0, class_validator_1.IsString)(),
87
+ (0, swagger_1.ApiProperty)({ required: false, description: 'Related module user key' }),
88
+ __metadata("design:type", String)
89
+ ], CreateEmailTemplateDto.prototype, "moduleUserKey", void 0);
78
90
  //# sourceMappingURL=create-email-template.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-email-template.dto.js","sourceRoot":"","sources":["../../src/dtos/create-email-template.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAA+I;AAC/I,+EAAyE;AACzE,yDAAyC;AACzC,6CAA8C;AAE9C,MAAa,sBAAsB;IAAnC;QAoBI,YAAO,GAAW,IAAI,CAAC;QAUvB,WAAM,GAAY,IAAI,CAAC;KAY1B;;8WAZqB,IAAI;;CAYzB;AA1CD,wDA0CC;AArCG;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,kBAAkB,CAAC;IAC3B,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;oDACD;AAKb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;2DACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;oDACD;AAKb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;uDACS;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;2DACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,qBAAW,GAAE;;sDACS;AAMvB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,sDAAwB,CAAC;;2DACG;AAKxC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;oDACD","sourcesContent":["import { IsArray, IsBoolean, IsEmail, IsNotEmpty, IsOptional, MaxLength, MinLength, ValidateNested, Matches, IsString } from 'class-validator';\nimport { CreateEmailAttachmentDto } from './create-email-attachment.dto';\nimport { Type } from 'class-transformer';\nimport { ApiProperty } from '@nestjs/swagger';\n\nexport class CreateEmailTemplateDto {\n @IsNotEmpty()\n @Matches(/[a-z]+(-[a-z]+)*/)\n @IsString()\n @ApiProperty()\n name: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n displayName: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n body: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n subject: string = \"{}\";\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n description: string;\n\n @IsOptional()\n @IsBoolean()\n @ApiProperty()\n active: boolean = true;\n\n @IsOptional()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => CreateEmailAttachmentDto)\n attachments: CreateEmailAttachmentDto[];\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n type: string;\n}\n"]}
1
+ {"version":3,"file":"create-email-template.dto.js","sourceRoot":"","sources":["../../src/dtos/create-email-template.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAAsJ;AACtJ,+EAAyE;AACzE,yDAAyC;AACzC,6CAA8C;AAE9C,MAAa,sBAAsB;IAAnC;QAoBI,YAAO,GAAW,IAAI,CAAC;QAUvB,WAAM,GAAY,IAAI,CAAC;KAsB1B;;8WAtBqB,IAAI;;CAsBzB;AApDD,wDAoDC;AA/CG;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,kBAAkB,CAAC;IAC3B,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;oDACD;AAKb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;2DACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;oDACD;AAKb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;uDACS;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;2DACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,qBAAW,GAAE;;sDACS;AAMvB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,sDAAwB,CAAC;;2DACG;AAKxC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;oDACD;AAKb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;wDACjD;AAKlB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;6DAClD","sourcesContent":["import { IsArray, IsBoolean, IsEmail, IsNotEmpty, IsOptional, MaxLength, MinLength, ValidateNested, Matches, IsString, IsInt } from 'class-validator';\nimport { CreateEmailAttachmentDto } from './create-email-attachment.dto';\nimport { Type } from 'class-transformer';\nimport { ApiProperty } from '@nestjs/swagger';\n\nexport class CreateEmailTemplateDto {\n @IsNotEmpty()\n @Matches(/[a-z]+(-[a-z]+)*/)\n @IsString()\n @ApiProperty()\n name: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n displayName: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n body: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n subject: string = \"{}\";\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n description: string;\n\n @IsOptional()\n @IsBoolean()\n @ApiProperty()\n active: boolean = true;\n\n @IsOptional()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => CreateEmailAttachmentDto)\n attachments: CreateEmailAttachmentDto[];\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n type: string;\n\n @IsOptional()\n @IsInt()\n @ApiProperty({ required: false, description: 'Related module id' })\n moduleId?: number;\n\n @IsOptional()\n @IsString()\n @ApiProperty({ required: false, description: 'Related module user key' })\n moduleUserKey?: string;\n}\n"]}
@@ -6,5 +6,7 @@ export declare class CreateSmsTemplateDto {
6
6
  description: string;
7
7
  active: boolean;
8
8
  type: string;
9
+ moduleId?: number;
10
+ moduleUserKey?: string;
9
11
  }
10
12
  //# sourceMappingURL=create-sms-template.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-sms-template.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-sms-template.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,oBAAoB;IAK7B,IAAI,EAAE,MAAM,CAAC;IAKb,WAAW,EAAE,MAAM,CAAC;IAKpB,IAAI,EAAE,MAAM,CAAC;IAKb,qBAAqB,EAAE,MAAM,CAAC;IAK9B,WAAW,EAAE,MAAM,CAAC;IAKpB,MAAM,EAAE,OAAO,CAAQ;IAKvB,IAAI,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"create-sms-template.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-sms-template.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,oBAAoB;IAK7B,IAAI,EAAE,MAAM,CAAC;IAKb,WAAW,EAAE,MAAM,CAAC;IAKpB,IAAI,EAAE,MAAM,CAAC;IAKb,qBAAqB,EAAE,MAAM,CAAC;IAK9B,WAAW,EAAE,MAAM,CAAC;IAKpB,MAAM,EAAE,OAAO,CAAQ;IAKvB,IAAI,EAAE,MAAM,CAAC;IAKb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -18,7 +18,7 @@ class CreateSmsTemplateDto {
18
18
  this.active = true;
19
19
  }
20
20
  static _OPENAPI_METADATA_FACTORY() {
21
- return { name: { required: true, type: () => String, pattern: "/[a-z]+(-[a-z]+)*/" }, displayName: { required: true, type: () => String }, body: { required: true, type: () => String }, smsProviderTemplateId: { required: true, type: () => String }, description: { required: true, type: () => String }, active: { required: true, type: () => Boolean, default: true }, type: { required: true, type: () => String } };
21
+ return { name: { required: true, type: () => String, pattern: "/[a-z]+(-[a-z]+)*/" }, displayName: { required: true, type: () => String }, body: { required: true, type: () => String }, smsProviderTemplateId: { required: true, type: () => String }, description: { required: true, type: () => String }, active: { required: true, type: () => Boolean, default: true }, type: { required: true, type: () => String }, moduleId: { required: false, type: () => Number }, moduleUserKey: { required: false, type: () => String } };
22
22
  }
23
23
  }
24
24
  exports.CreateSmsTemplateDto = CreateSmsTemplateDto;
@@ -65,4 +65,16 @@ __decorate([
65
65
  (0, swagger_1.ApiProperty)(),
66
66
  __metadata("design:type", String)
67
67
  ], CreateSmsTemplateDto.prototype, "type", void 0);
68
+ __decorate([
69
+ (0, class_validator_1.IsOptional)(),
70
+ (0, class_validator_1.IsInt)(),
71
+ (0, swagger_1.ApiProperty)({ required: false, description: 'Related module id' }),
72
+ __metadata("design:type", Number)
73
+ ], CreateSmsTemplateDto.prototype, "moduleId", void 0);
74
+ __decorate([
75
+ (0, class_validator_1.IsOptional)(),
76
+ (0, class_validator_1.IsString)(),
77
+ (0, swagger_1.ApiProperty)({ required: false, description: 'Related module user key' }),
78
+ __metadata("design:type", String)
79
+ ], CreateSmsTemplateDto.prototype, "moduleUserKey", void 0);
68
80
  //# sourceMappingURL=create-sms-template.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-sms-template.dto.js","sourceRoot":"","sources":["../../src/dtos/create-sms-template.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAAsH;AACtH,6CAA8C;AAE9C,MAAa,oBAAoB;IAAjC;QA8BI,WAAM,GAAY,IAAI,CAAC;KAM1B;;6WANqB,IAAI;;CAMzB;AApCD,oDAoCC;AA/BG;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,kBAAkB,CAAC;IAC3B,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;kDACD;AAKb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;yDACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;kDACD;AAKb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;mEACgB;AAK9B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;yDACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,qBAAW,GAAE;;oDACS;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;kDACD","sourcesContent":["import { IsEmail, IsNotEmpty, IsOptional, MaxLength, MinLength, IsString, Matches, IsBoolean } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\n\nexport class CreateSmsTemplateDto {\n @IsNotEmpty()\n @Matches(/[a-z]+(-[a-z]+)*/)\n @IsString()\n @ApiProperty()\n name: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n displayName: string;\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n body: string;\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n smsProviderTemplateId: string;\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n description: string;\n\n @IsOptional()\n @IsBoolean()\n @ApiProperty()\n active: boolean = true;\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n type: string;\n}\n"]}
1
+ {"version":3,"file":"create-sms-template.dto.js","sourceRoot":"","sources":["../../src/dtos/create-sms-template.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAA6H;AAC7H,6CAA8C;AAE9C,MAAa,oBAAoB;IAAjC;QA8BI,WAAM,GAAY,IAAI,CAAC;KAgB1B;;6WAhBqB,IAAI;;CAgBzB;AA9CD,oDA8CC;AAzCG;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,kBAAkB,CAAC;IAC3B,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;kDACD;AAKb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;yDACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;kDACD;AAKb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;mEACgB;AAK9B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;yDACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,qBAAW,GAAE;;oDACS;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;kDACD;AAKb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;sDACjD;AAKlB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;2DAClD","sourcesContent":["import { IsEmail, IsNotEmpty, IsOptional, MaxLength, MinLength, IsString, Matches, IsBoolean, IsInt } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\n\nexport class CreateSmsTemplateDto {\n @IsNotEmpty()\n @Matches(/[a-z]+(-[a-z]+)*/)\n @IsString()\n @ApiProperty()\n name: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n displayName: string;\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n body: string;\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n smsProviderTemplateId: string;\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n description: string;\n\n @IsOptional()\n @IsBoolean()\n @ApiProperty()\n active: boolean = true;\n\n @IsOptional()\n @IsString()\n @ApiProperty()\n type: string;\n\n @IsOptional()\n @IsInt()\n @ApiProperty({ required: false, description: 'Related module id' })\n moduleId?: number;\n\n @IsOptional()\n @IsString()\n @ApiProperty({ required: false, description: 'Related module user key' })\n moduleUserKey?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-human-request.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-human-request.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,qBACa,iBAAkB,SAAQ,YAAY;IAG/C,OAAO,EAAE,YAAY,CAAC;IAItB,GAAG,EAAE,QAAQ,CAAC;IAGd,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,MAAM,CAAC;IAGjB,OAAO,EAAE,MAAM,CAAC;IAGhB,OAAO,EAAE,MAAM,CAAC;IAGhB,UAAU,EAAE,MAAM,CAAC;IAGnB,QAAQ,EAAE,MAAM,CAAC;IAGjB,aAAa,EAAE,MAAM,CAAC;IAGtB,MAAM,EAAE,MAAM,CAAa;IAG3B,MAAM,EAAE,MAAM,CAAC;IAGf,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,IAAI,CAAC;CACpB"}
1
+ {"version":3,"file":"agent-human-request.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-human-request.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAG7C,qBACa,iBAAkB,SAAQ,YAAY;IAG/C,OAAO,EAAE,YAAY,CAAC;IAItB,GAAG,EAAE,QAAQ,CAAC;IAGd,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,MAAM,CAAC;IAGjB,OAAO,EAAE,MAAM,CAAC;IAGhB,OAAO,EAAE,MAAM,CAAC;IAGhB,UAAU,EAAE,MAAM,CAAC;IAGnB,QAAQ,EAAE,MAAM,CAAC;IAGjB,aAAa,EAAE,MAAM,CAAC;IAGtB,MAAM,EAAE,MAAM,CAAa;IAG3B,MAAM,EAAE,MAAM,CAAC;IAGf,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,IAAI,CAAC;CACpB"}
@@ -15,6 +15,7 @@ const common_entity_1 = require("./common.entity");
15
15
  const typeorm_1 = require("typeorm");
16
16
  const agent_session_entity_1 = require("./agent-session.entity");
17
17
  const agent_job_entity_1 = require("./agent-job.entity");
18
+ const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
18
19
  let AgentHumanRequest = class AgentHumanRequest extends common_entity_1.CommonEntity {
19
20
  constructor() {
20
21
  super(...arguments);
@@ -76,7 +77,7 @@ __decorate([
76
77
  __metadata("design:type", String)
77
78
  ], AgentHumanRequest.prototype, "answeredBy", void 0);
78
79
  __decorate([
79
- (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
80
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), nullable: true }),
80
81
  __metadata("design:type", Date)
81
82
  ], AgentHumanRequest.prototype, "answeredAt", void 0);
82
83
  exports.AgentHumanRequest = AgentHumanRequest = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"agent-human-request.entity.js","sourceRoot":"","sources":["../../src/entities/agent-human-request.entity.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AAC;;iDACrB;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAC1B;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACzB;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACpC,IAAI;qDAAC;4BAxCR,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,wBAAwB,CAAC;GACpB,iBAAiB,CAyC7B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Column } from 'typeorm';\nimport { AgentSession } from './agent-session.entity';\nimport { AgentJob } from './agent-job.entity'\n\n@Entity('ss_agent_human_request')\nexport class AgentHumanRequest extends CommonEntity {\n @ManyToOne(() => AgentSession, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n session: AgentSession;\n\n @ManyToOne(() => AgentJob, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n job: AgentJob;\n\n @Column({ type: \"varchar\" })\n kind: string;\n\n @Column({ type: \"text\" })\n question: string;\n\n @Column({ type: \"text\", nullable: true })\n options: string;\n\n @Column({ type: \"text\", nullable: true })\n context: string;\n\n @Column({ type: \"text\" })\n toolCallId: string;\n\n @Column({ type: \"text\" })\n toolName: string;\n\n @Column({ type: \"text\" })\n toolArguments: string;\n\n @Column({ type: \"varchar\", default: \"pending\" })\n status: string = \"pending\";\n\n @Column({ type: \"text\", nullable: true })\n answer: string;\n\n @Column({ type: \"varchar\", nullable: true })\n answeredBy: string;\n\n @Column({ type: \"timestamptz\", nullable: true })\n answeredAt: Date;\n}\n"]}
1
+ {"version":3,"file":"agent-human-request.entity.js","sourceRoot":"","sources":["../../src/entities/agent-human-request.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;A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3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAC1B;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACzB;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,GAAG,IAAA,iCAAa,EAAC,sBAAsB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACzD,IAAI;qDAAC;4BAxCR,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,wBAAwB,CAAC;GACpB,iBAAiB,CAyC7B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Column } from 'typeorm';\nimport { AgentSession } from './agent-session.entity';\nimport { AgentJob } from './agent-job.entity'\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_agent_human_request')\nexport class AgentHumanRequest extends CommonEntity {\n @ManyToOne(() => AgentSession, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n session: AgentSession;\n\n @ManyToOne(() => AgentJob, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n job: AgentJob;\n\n @Column({ type: \"varchar\" })\n kind: string;\n\n @Column({ type: \"text\" })\n question: string;\n\n @Column({ type: \"text\", nullable: true })\n options: string;\n\n @Column({ type: \"text\", nullable: true })\n context: string;\n\n @Column({ type: \"text\" })\n toolCallId: string;\n\n @Column({ type: \"text\" })\n toolName: string;\n\n @Column({ type: \"text\" })\n toolArguments: string;\n\n @Column({ type: \"varchar\", default: \"pending\" })\n status: string = \"pending\";\n\n @Column({ type: \"text\", nullable: true })\n answer: string;\n\n @Column({ type: \"varchar\", nullable: true })\n answeredBy: string;\n\n @Column({ ...getColumnType('datetimeWithTimezone'), nullable: true })\n answeredAt: Date;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-job.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-job.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,qBACa,QAAS,SAAQ,YAAY;IAGtC,OAAO,EAAE,YAAY,CAAC;IAItB,KAAK,EAAE,aAAa,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAW;IAGvB,KAAK,EAAE,MAAM,CAAC;IAGd,cAAc,EAAE,MAAM,CAAC;IAGvB,MAAM,EAAE,MAAM,CAAY;IAG1B,UAAU,EAAE,MAAM,CAAC;IAGnB,cAAc,EAAE,IAAI,CAAC;IAGrB,QAAQ,EAAE,MAAM,CAAK;IAGrB,cAAc,EAAE,MAAM,CAAC;IAGvB,UAAU,EAAE,MAAM,CAAC;IAGnB,aAAa,EAAE,MAAM,CAAC;IAGtB,cAAc,EAAE,MAAM,CAAC;IAGvB,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,MAAM,CAAC;IAGf,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,IAAI,CAAc;IAG5B,SAAS,EAAE,IAAI,CAAC;IAGhB,UAAU,EAAE,IAAI,CAAC;IAGjB,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CAC3C"}
1
+ {"version":3,"file":"agent-job.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-job.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,qBACa,QAAS,SAAQ,YAAY;IAGtC,OAAO,EAAE,YAAY,CAAC;IAItB,KAAK,EAAE,aAAa,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAW;IAGvB,KAAK,EAAE,MAAM,CAAC;IAGd,cAAc,EAAE,MAAM,CAAC;IAGvB,MAAM,EAAE,MAAM,CAAY;IAG1B,UAAU,EAAE,MAAM,CAAC;IAGnB,cAAc,EAAE,IAAI,CAAC;IAGrB,QAAQ,EAAE,MAAM,CAAK;IAGrB,cAAc,EAAE,MAAM,CAAC;IAGvB,UAAU,EAAE,MAAM,CAAC;IAGnB,aAAa,EAAE,MAAM,CAAC;IAGtB,cAAc,EAAE,MAAM,CAAC;IAGvB,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,MAAM,CAAC;IAGf,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,IAAI,CAAc;IAG5B,SAAS,EAAE,IAAI,CAAC;IAGhB,UAAU,EAAE,IAAI,CAAC;IAGjB,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CAC3C"}
@@ -16,6 +16,7 @@ const typeorm_1 = require("typeorm");
16
16
  const agent_session_entity_1 = require("./agent-session.entity");
17
17
  const agent_registry_entity_1 = require("./agent-registry.entity");
18
18
  const agent_human_request_entity_1 = require("./agent-human-request.entity");
19
+ const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
19
20
  let AgentJob = class AgentJob extends common_entity_1.CommonEntity {
20
21
  constructor() {
21
22
  super(...arguments);
@@ -60,7 +61,7 @@ __decorate([
60
61
  __metadata("design:type", String)
61
62
  ], AgentJob.prototype, "leaseToken", void 0);
62
63
  __decorate([
63
- (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
64
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), nullable: true }),
64
65
  __metadata("design:type", Date)
65
66
  ], AgentJob.prototype, "leaseExpiresAt", void 0);
66
67
  __decorate([
@@ -96,15 +97,15 @@ __decorate([
96
97
  __metadata("design:type", String)
97
98
  ], AgentJob.prototype, "error", void 0);
98
99
  __decorate([
99
- (0, typeorm_1.Column)({ type: "timestamptz", default: () => "now()" }),
100
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), default: () => (0, typeorm_db_helper_1.getCurrentTimestampDefault)() }),
100
101
  __metadata("design:type", Date)
101
102
  ], AgentJob.prototype, "queuedAt", void 0);
102
103
  __decorate([
103
- (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
104
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), nullable: true }),
104
105
  __metadata("design:type", Date)
105
106
  ], AgentJob.prototype, "startedAt", void 0);
106
107
  __decorate([
107
- (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
108
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), nullable: true }),
108
109
  __metadata("design:type", Date)
109
110
  ], AgentJob.prototype, "finishedAt", void 0);
110
111
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"agent-job.entity.js","sourceRoot":"","sources":["../../src/entities/agent-job.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAA2E;AAC3E,iEAAsD;AACtD,mEAAwD;AACxD,6EAAiE;AAG1D,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,4BAAY;IAAnC;;QAUH,SAAI,GAAW,OAAO,CAAC;QASvB,WAAM,GAAW,QAAQ,CAAC;QAS1B,aAAQ,GAAW,CAAC,CAAC;QAwBrB,aAAQ,GAAS,IAAI,IAAI,EAAE,CAAC;KAU/B;;w/BAVoB,IAAI,IAAI,EAAE;;CAU9B,CAAA;AA9DY,4BAAQ;AAGjB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAY,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EA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;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACrB;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC3B;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC1B;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCAC3B;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;8BAC9C,IAAI;0CAAc;AAG5B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACrC,IAAI;2CAAC;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACpC,IAAI;4CAAC;AAGjB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8CAAiB,EAAE,iBAAiB,CAAC,EAAE,CAAC,iBAAiB,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;oDAC1D;mBA7D/B,QAAQ;IADpB,IAAA,gBAAM,EAAC,cAAc,CAAC;GACV,QAAQ,CA8DpB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Column, OneToMany } from 'typeorm';\nimport { AgentSession } from './agent-session.entity';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentHumanRequest } from './agent-human-request.entity';\n\n@Entity('ss_agent_job')\nexport class AgentJob extends CommonEntity {\n @ManyToOne(() => AgentSession, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n session: AgentSession;\n\n @ManyToOne(() => AgentRegistry, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n agent: AgentRegistry;\n\n @Column({ type: \"varchar\", default: \"start\" })\n kind: string = \"start\";\n\n @Column({ type: \"text\", nullable: true })\n input: string;\n\n @Column({ type: \"text\" })\n callerSnapshot: string;\n\n @Column({ type: \"varchar\", default: \"queued\" })\n status: string = \"queued\";\n\n @Column({ type: \"varchar\", nullable: true })\n leaseToken: string;\n\n @Column({ type: \"timestamptz\", nullable: true })\n leaseExpiresAt: Date;\n\n @Column({ type: \"integer\", default: 0 })\n attempts: number = 0;\n\n @Column({ type: \"text\", nullable: true })\n idempotencyKey: string;\n\n @Column({ type: \"text\", nullable: true })\n webhookUrl: string;\n\n @Column({ type: \"text\", nullable: true })\n webhookSecret: string;\n\n @Column({ type: \"integer\", nullable: true })\n timeoutSeconds: number;\n\n @Column({ type: \"integer\", nullable: true })\n maxSteps: number;\n\n @Column({ type: \"text\", nullable: true })\n result: string;\n\n @Column({ type: \"text\", nullable: true })\n error: string;\n\n @Column({ type: \"timestamptz\", default: () => \"now()\" })\n queuedAt: Date = new Date();\n\n @Column({ type: \"timestamptz\", nullable: true })\n startedAt: Date;\n\n @Column({ type: \"timestamptz\", nullable: true })\n finishedAt: Date;\n\n @OneToMany(() => AgentHumanRequest, agentHumanRequest => agentHumanRequest.job, { cascade: true })\n agentHumanRequests: AgentHumanRequest[];\n}\n"]}
1
+ {"version":3,"file":"agent-job.entity.js","sourceRoot":"","sources":["../../src/entities/agent-job.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAA2E;AAC3E,iEAAsD;AACtD,mEAAwD;AACxD,6EAAiE;AACjE,oEAA0F;AAGnF,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,4BAAY;IAAnC;;QAUH,SAAI,GAAW,OAAO,CAAC;QASvB,WAAM,GAAW,Q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AAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;oDAC1D;mBA7D/B,QAAQ;IADpB,IAAA,gBAAM,EAAC,cAAc,CAAC;GACV,QAAQ,CA8DpB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Column, OneToMany } from 'typeorm';\nimport { AgentSession } from './agent-session.entity';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentHumanRequest } from './agent-human-request.entity';\nimport { getColumnType, getCurrentTimestampDefault } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_agent_job')\nexport class AgentJob extends CommonEntity {\n @ManyToOne(() => AgentSession, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n session: AgentSession;\n\n @ManyToOne(() => AgentRegistry, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n agent: AgentRegistry;\n\n @Column({ type: \"varchar\", default: \"start\" })\n kind: string = \"start\";\n\n @Column({ type: \"text\", nullable: true })\n input: string;\n\n @Column({ type: \"text\" })\n callerSnapshot: string;\n\n @Column({ type: \"varchar\", default: \"queued\" })\n status: string = \"queued\";\n\n @Column({ type: \"varchar\", nullable: true })\n leaseToken: string;\n\n @Column({ ...getColumnType('datetimeWithTimezone'), nullable: true })\n leaseExpiresAt: Date;\n\n @Column({ type: \"integer\", default: 0 })\n attempts: number = 0;\n\n @Column({ type: \"text\", nullable: true })\n idempotencyKey: string;\n\n @Column({ type: \"text\", nullable: true })\n webhookUrl: string;\n\n @Column({ type: \"text\", nullable: true })\n webhookSecret: string;\n\n @Column({ type: \"integer\", nullable: true })\n timeoutSeconds: number;\n\n @Column({ type: \"integer\", nullable: true })\n maxSteps: number;\n\n @Column({ type: \"text\", nullable: true })\n result: string;\n\n @Column({ type: \"text\", nullable: true })\n error: string;\n\n @Column({ ...getColumnType('datetimeWithTimezone'), default: () => getCurrentTimestampDefault() })\n queuedAt: Date = new Date();\n\n @Column({ ...getColumnType('datetimeWithTimezone'), nullable: true })\n startedAt: Date;\n\n @Column({ ...getColumnType('datetimeWithTimezone'), nullable: true })\n finishedAt: Date;\n\n @OneToMany(() => AgentHumanRequest, agentHumanRequest => agentHumanRequest.job, { cascade: true })\n agentHumanRequests: AgentHumanRequest[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-process.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-process.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,qBACa,YAAa,SAAQ,YAAY;IAG1C,KAAK,EAAE,aAAa,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IAGb,GAAG,EAAE,MAAM,CAAC;IAGZ,KAAK,EAAE,MAAM,CAAM;IAGnB,MAAM,EAAE,MAAM,CAAc;IAG5B,aAAa,EAAE,MAAM,CAAK;IAG1B,YAAY,EAAE,MAAM,CAAK;IAGzB,YAAY,EAAE,MAAM,CAAK;IAGzB,WAAW,EAAE,MAAM,CAAM;IAGzB,eAAe,EAAE,MAAM,CAAK;IAG5B,UAAU,EAAE,MAAM,CAAQ;IAG1B,SAAS,EAAE,IAAI,CAAc;IAG7B,WAAW,EAAE,IAAI,CAAC;IAGlB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;IAGlB,aAAa,EAAE,YAAY,EAAE,CAAC;CACjC"}
1
+ {"version":3,"file":"agent-process.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-process.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAGrD,qBACa,YAAa,SAAQ,YAAY;IAG1C,KAAK,EAAE,aAAa,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IAGb,GAAG,EAAE,MAAM,CAAC;IAGZ,KAAK,EAAE,MAAM,CAAM;IAGnB,MAAM,EAAE,MAAM,CAAc;IAG5B,aAAa,EAAE,MAAM,CAAK;IAG1B,YAAY,EAAE,MAAM,CAAK;IAGzB,YAAY,EAAE,MAAM,CAAK;IAGzB,WAAW,EAAE,MAAM,CAAM;IAGzB,eAAe,EAAE,MAAM,CAAK;IAG5B,UAAU,EAAE,MAAM,CAAQ;IAG1B,SAAS,EAAE,IAAI,CAAc;IAG7B,WAAW,EAAE,IAAI,CAAC;IAGlB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;IAGlB,aAAa,EAAE,YAAY,EAAE,CAAC;CACjC"}
@@ -15,6 +15,7 @@ const common_entity_1 = require("./common.entity");
15
15
  const typeorm_1 = require("typeorm");
16
16
  const agent_registry_entity_1 = require("./agent-registry.entity");
17
17
  const agent_session_entity_1 = require("./agent-session.entity");
18
+ const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
18
19
  let AgentProcess = class AgentProcess extends common_entity_1.CommonEntity {
19
20
  constructor() {
20
21
  super(...arguments);
@@ -83,15 +84,15 @@ __decorate([
83
84
  __metadata("design:type", String)
84
85
  ], AgentProcess.prototype, "loadReport", void 0);
85
86
  __decorate([
86
- (0, typeorm_1.Column)({ type: "timestamptz", default: () => "now()" }),
87
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), default: () => (0, typeorm_db_helper_1.getCurrentTimestampDefault)() }),
87
88
  __metadata("design:type", Date)
88
89
  ], AgentProcess.prototype, "startedAt", void 0);
89
90
  __decorate([
90
- (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
91
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), nullable: true }),
91
92
  __metadata("design:type", Date)
92
93
  ], AgentProcess.prototype, "heartbeatAt", void 0);
93
94
  __decorate([
94
- (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
95
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), nullable: true }),
95
96
  __metadata("design:type", Date)
96
97
  ], AgentProcess.prototype, "stoppedAt", void 0);
97
98
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"agent-process.entity.js","sourceRoot":"","sources":["../../src/entities/agent-process.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAkF;AAClF,mEAAwD;AACxD,iEAAqD;AAG9C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAY;IAAvC;;QAeH,UAAK,GAAW,EAAE,CAAC;QAGnB,WAAM,GAAW,UAAU,CAAC;QAG5B,kBAAa,GAAW,CAAC,CAAC;QAG1B,iBAAY,GAAW,CAAC,CAAC;QAGzB,iBAAY,GAAW,CAAC,CAAC;QAGzB,gBAAW,GAAW,EAAE,CAAC;QAGzB,oBAAe,GAAW,CAAC,CAAC;QAG5B,eAAU,GAAW,IAAI,CAAC;QAG1B,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;KAchC;;6zBAdqB,IAAI,IAAI,EAAE;;CAc/B,CAAA;AArDY,oCAAY;AAGrB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxE,IAAA,oBAAU,GAAE;8BACN,qCAAa;2CAAC;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;0CACf;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;0CACf;AAGb;IADC,IAAA,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E,CAAC;;+CAC1B;AAGlB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAY,EAAE,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDACzD;uBApDrB,YAAY;IADxB,IAAA,gBAAM,EAAC,kBAAkB,CAAC;GACd,YAAY,CAqDxB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Column, Index, OneToMany } from 'typeorm';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentSession } from './agent-session.entity'\n\n@Entity('ss_agent_process')\nexport class AgentProcess extends CommonEntity {\n @ManyToOne(() => AgentRegistry, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n agent: AgentRegistry;\n\n @Column({ type: \"varchar\" })\n host: string;\n\n @Column({ type: \"integer\" })\n port: number;\n\n @Column({ type: \"integer\", nullable: true })\n pid: number;\n\n @Column({ type: \"varchar\" })\n wsUrl: string = \"\";\n\n @Column({ type: \"varchar\", default: \"starting\" })\n status: string = \"starting\";\n\n @Column({ type: \"integer\" })\n configVersion: number = 0;\n\n @Column({ type: \"integer\" })\n openSessions: number = 0;\n\n @Column({ type: \"integer\" })\n runningTurns: number = 0;\n\n @Column({ type: \"integer\" })\n maxSessions: number = 50;\n\n @Column({ type: \"integer\" })\n maxRunningTurns: number = 8;\n\n @Column({ type: \"text\", default: \"{}\" })\n loadReport: string = \"{}\";\n\n @Column({ type: \"timestamptz\", default: () => \"now()\" })\n startedAt: Date = new Date();\n\n @Column({ type: \"timestamptz\", nullable: true })\n heartbeatAt: Date;\n\n @Column({ type: \"timestamptz\", nullable: true })\n stoppedAt: Date;\n\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n processId: string;\n\n @OneToMany(() => AgentSession, agentSession => agentSession.process, { cascade: true })\n agentSessions: AgentSession[];\n}\n"]}
1
+ {"version":3,"file":"agent-process.entity.js","sour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import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Column, Index, OneToMany } from 'typeorm';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentSession } from './agent-session.entity'\nimport { getColumnType, getCurrentTimestampDefault } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_agent_process')\nexport class AgentProcess extends CommonEntity {\n @ManyToOne(() => AgentRegistry, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n agent: AgentRegistry;\n\n @Column({ type: \"varchar\" })\n host: string;\n\n @Column({ type: \"integer\" })\n port: number;\n\n @Column({ type: \"integer\", nullable: true })\n pid: number;\n\n @Column({ type: \"varchar\" })\n wsUrl: string = \"\";\n\n @Column({ type: \"varchar\", default: \"starting\" })\n status: string = \"starting\";\n\n @Column({ type: \"integer\" })\n configVersion: number = 0;\n\n @Column({ type: \"integer\" })\n openSessions: number = 0;\n\n @Column({ type: \"integer\" })\n runningTurns: number = 0;\n\n @Column({ type: \"integer\" })\n maxSessions: number = 50;\n\n @Column({ type: \"integer\" })\n maxRunningTurns: number = 8;\n\n @Column({ type: \"text\", default: \"{}\" })\n loadReport: string = \"{}\";\n\n @Column({ ...getColumnType('datetimeWithTimezone'), default: () => getCurrentTimestampDefault() })\n startedAt: Date = new Date();\n\n @Column({ ...getColumnType('datetimeWithTimezone'), nullable: true })\n heartbeatAt: Date;\n\n @Column({ ...getColumnType('datetimeWithTimezone'), nullable: true })\n stoppedAt: Date;\n\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n processId: string;\n\n @OneToMany(() => AgentSession, agentSession => agentSession.process, { cascade: true })\n agentSessions: AgentSession[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-session.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,C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B,EAAE,CAAC;IAGlD,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CAC3C"}
@@ -20,6 +20,7 @@ const agent_job_entity_1 = require("./agent-job.entity");
20
20
  const agent_event_entity_1 = require("./agent-event.entity");
21
21
  const agent_session_checkpoint_entity_1 = require("./agent-session-checkpoint.entity");
22
22
  const agent_human_request_entity_1 = require("./agent-human-request.entity");
23
+ const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
23
24
  let AgentSession = class AgentSession extends common_entity_1.CommonEntity {
24
25
  constructor() {
25
26
  super(...arguments);
@@ -103,15 +104,15 @@ __decorate([
103
104
  __metadata("design:type", String)
104
105
  ], AgentSession.prototype, "error", void 0);
105
106
  __decorate([
106
- (0, typeorm_1.Column)({ type: "timestamptz", default: () => "now()" }),
107
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), default: () => (0, typeorm_db_helper_1.getCurrentTimestampDefault)() }),
107
108
  __metadata("design:type", Date)
108
109
  ], AgentSession.prototype, "startedAt", void 0);
109
110
  __decorate([
110
- (0, typeorm_1.Column)({ type: "timestamptz", default: () => "now()" }),
111
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), default: () => (0, typeorm_db_helper_1.getCurrentTimestampDefault)() }),
111
112
  __metadata("design:type", Date)
112
113
  ], AgentSession.prototype, "lastActiveAt", void 0);
113
114
  __decorate([
114
- (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
115
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetimeWithTimezone'), nullable: true }),
115
116
  __metadata("design:type", Date)
116
117
  ], AgentSession.prototype, "endedAt", void 0);
117
118
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session.entity.js","sourceRoot":"","sources":["../../src/entities/agent-session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,+CAAgD;AAChD,qCAAkF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,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;8BAC1C,IAAI;kDAAc;AAGhC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACvC,IAAI;6CAAC;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDAClB;AAG1B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACvB;AAGrB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,2BAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACrD;AAGtB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,+BAAU,EAAE,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACvD;AAG1B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wDAAsB,EAAE,sBAAsB,CAAC,EAAE,CAAC,sBAAsB,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;6DACnE;AAGlD;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8CAAiB,EAAE,iBAAiB,CAAC,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;wDAC9D;uBA7E/B,YAAY;IADxB,IAAA,gBAAM,EAAC,kBAAkB,CAAC;GACd,YAAY,CA8ExB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { User } from 'src/entities/user.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne, OneToMany } from 'typeorm';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentProcess } from './agent-process.entity';\nimport { AgentJob } from './agent-job.entity';\nimport { AgentEvent } from './agent-event.entity';\nimport { AgentSessionCheckpoint } from './agent-session-checkpoint.entity';\nimport { AgentHumanRequest } from './agent-human-request.entity';\n\n@Entity('ss_agent_session')\nexport class AgentSession extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n sessionId: string;\n\n @ManyToOne(() => AgentRegistry, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n agent: AgentRegistry;\n\n // The most recent process that hosted this session; it remains linked after shutdown.\n @ManyToOne(() => AgentProcess, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n process: AgentProcess;\n\n @Column({ type: \"varchar\" })\n trigger: string;\n\n // Runtime that created/hosted this session; nullable for legacy rows where it is unknown.\n @Column({ type: \"varchar\", nullable: true })\n runtime: \"solidx\" | \"agentHub\" | null;\n\n @ManyToOne(() => User, { onDelete: \"RESTRICT\", nullable: false })\n @JoinColumn()\n user: User;\n\n @Column({ type: \"varchar\", default: \"queued\" })\n status: string = \"queued\";\n\n @Column({ type: \"text\", default: \"{}\" })\n inputs: string = \"{}\";\n\n @Column({ type: \"integer\" })\n configVersion: number;\n\n @Column({ type: \"integer\", default: 0 })\n turnCount: number = 0;\n\n @Column({ type: \"integer\", default: 0 })\n totalSteps: number = 0;\n\n @Column({ type: \"integer\", default: 0 })\n totalInputTokens: number = 0;\n\n @Column({ type: \"integer\", default: 0 })\n totalOutputTokens: number = 0;\n\n @Column({ type: \"decimal\" })\n totalCost: number = 0;\n\n @Column({ type: \"text\", nullable: true })\n error: string;\n\n @Column({ type: \"timestamptz\", default: () => \"now()\" })\n startedAt: Date = new Date();\n\n @Column({ type: \"timestamptz\", default: () => \"now()\" })\n lastActiveAt: Date = new Date();\n\n @Column({ type: \"timestamptz\", nullable: true })\n endedAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n reasoningModelKey: string;\n\n @Column({ type: \"varchar\", nullable: true })\n fastModelKey: string;\n\n @OneToMany(() => AgentJob, agentJob => agentJob.session, { cascade: true })\n agentJobs: AgentJob[];\n\n @OneToMany(() => AgentEvent, agentEvent => agentEvent.session, { cascade: true })\n agentEvents: AgentEvent[];\n\n @OneToMany(() => AgentSessionCheckpoint, agentSessionCheckpoint => agentSessionCheckpoint.session, { cascade: true })\n agentSessionCheckpoints: AgentSessionCheckpoint[];\n\n @OneToMany(() => AgentHumanRequest, agentHumanRequest => agentHumanRequest.session, { cascade: true })\n agentHumanRequests: AgentHumanRequest[];\n}\n"]}
1
+ {"version":3,"file":"agent-session.entity.js","sourceRoot":"","sources":["../../src/entities/agent-session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,+CAAgD;AAChD,qCAAkF;AAClF,mEAAwD;AACxD,iEAAsD;AACtD,yDAA8C;AAC9C,6DAAkD;AAClD,uFAA2E;AAC3E,6EAAiE;AACjE,oEAA0F;AAGnF,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAY;IAAvC;;QA0BH,WAAM,GAAW,QAAQ,CAAC;QAG1B,WAAM,GAAW,IAAI,CAAC;QAMtB,cAAS,GAAW,CAAC,CAAC;QAGtB,eAAU,GAAW,CAAC,CAAC;QAGvB,qBAAgB,GAAW,CAAC,CAAC;QAG7B,sBAAiB,GAAW,CAAC,CAAC;QAG9B,cAAS,GAAW,CAAC,CAAC;QAMtB,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;QAG7B,iBAAY,GAAS,IAAI,IAAI,EAAE,CAAC;KAsBnC;;wgCAzBqB,IAAI,IAAI,EAAE,+DAGP,IAAI,IAAI,EAAE;;CAsBlC,CAAA;AA9EY,oCAAY;AAGrB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CAC1B;AAIlB;IAFC,IA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AE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACvD;AAG1B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wDAAsB,EAAE,sBAAsB,CAAC,EAAE,CAAC,sBAAsB,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;6DACnE;AAGlD;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8CAAiB,EAAE,iBAAiB,CAAC,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;wDAC9D;uBA7E/B,YAAY;IADxB,IAAA,gBAAM,EAAC,kBAAkB,CAAC;GACd,YAAY,CA8ExB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { User } from 'src/entities/user.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne, OneToMany } from 'typeorm';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentProcess } from './agent-process.entity';\nimport { AgentJob } from './agent-job.entity';\nimport { AgentEvent } from './agent-event.entity';\nimport { AgentSessionCheckpoint } from './agent-session-checkpoint.entity';\nimport { AgentHumanRequest } from './agent-human-request.entity';\nimport { getColumnType, getCurrentTimestampDefault } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_agent_session')\nexport class AgentSession extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n sessionId: string;\n\n @ManyToOne(() => AgentRegistry, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n agent: AgentRegistry;\n\n // The most recent process that hosted this session; it remains linked after shutdown.\n @ManyToOne(() => AgentProcess, { onDelete: \"SET NULL\", nullable: true })\n @JoinColumn()\n process: AgentProcess;\n\n @Column({ type: \"varchar\" })\n trigger: string;\n\n // Runtime that created/hosted this session; nullable for legacy rows where it is unknown.\n @Column({ type: \"varchar\", nullable: true })\n runtime: \"solidx\" | \"agentHub\" | null;\n\n @ManyToOne(() => User, { onDelete: \"RESTRICT\", nullable: false })\n @JoinColumn()\n user: User;\n\n @Column({ type: \"varchar\", default: \"queued\" })\n status: string = \"queued\";\n\n @Column({ type: \"text\", default: \"{}\" })\n inputs: string = \"{}\";\n\n @Column({ type: \"integer\" })\n configVersion: number;\n\n @Column({ type: \"integer\", default: 0 })\n turnCount: number = 0;\n\n @Column({ type: \"integer\", default: 0 })\n totalSteps: number = 0;\n\n @Column({ type: \"integer\", default: 0 })\n totalInputTokens: number = 0;\n\n @Column({ type: \"integer\", default: 0 })\n totalOutputTokens: number = 0;\n\n @Column({ type: \"decimal\" })\n totalCost: number = 0;\n\n @Column({ type: \"text\", nullable: true })\n error: string;\n\n @Column({ ...getColumnType('datetimeWithTimezone'), default: () => getCurrentTimestampDefault() })\n startedAt: Date = new Date();\n\n @Column({ ...getColumnType('datetimeWithTimezone'), default: () => getCurrentTimestampDefault() })\n lastActiveAt: Date = new Date();\n\n @Column({ ...getColumnType('datetimeWithTimezone'), nullable: true })\n endedAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n reasoningModelKey: string;\n\n @Column({ type: \"varchar\", nullable: true })\n fastModelKey: string;\n\n @OneToMany(() => AgentJob, agentJob => agentJob.session, { cascade: true })\n agentJobs: AgentJob[];\n\n @OneToMany(() => AgentEvent, agentEvent => agentEvent.session, { cascade: true })\n agentEvents: AgentEvent[];\n\n @OneToMany(() => AgentSessionCheckpoint, agentSessionCheckpoint => agentSessionCheckpoint.session, { cascade: true })\n agentSessionCheckpoints: AgentSessionCheckpoint[];\n\n @OneToMany(() => AgentHumanRequest, agentHumanRequest => agentHumanRequest.session, { cascade: true })\n agentHumanRequests: AgentHumanRequest[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-skill.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-skill.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAElE,qBACa,UAAW,SAAQ,YAAY;IAGxC,aAAa,EAAE,aAAa,CAAC;IAI7B,kBAAkB,EAAE,kBAAkB,CAAC;IAGvC,aAAa,EAAE,OAAO,CAAQ;IAI9B,aAAa,EAAE,MAAM,CAAC;CACzB"}
1
+ {"version":3,"file":"agent-skill.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-skill.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE,qBACa,UAAW,SAAQ,YAAY;IAGxC,aAAa,EAAE,aAAa,CAAC;IAI7B,kBAAkB,EAAE,kBAAkB,CAAC;IAGvC,aAAa,EAAE,OAAO,CAAQ;IAI9B,aAAa,EAAE,MAAM,CAAC;CACzB"}
@@ -15,6 +15,7 @@ const common_entity_1 = require("./common.entity");
15
15
  const typeorm_1 = require("typeorm");
16
16
  const agent_registry_entity_1 = require("./agent-registry.entity");
17
17
  const agent_skill_registry_entity_1 = require("./agent-skill-registry.entity");
18
+ const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
18
19
  let AgentSkill = class AgentSkill extends common_entity_1.CommonEntity {
19
20
  constructor() {
20
21
  super(...arguments);
@@ -36,7 +37,7 @@ __decorate([
36
37
  __metadata("design:type", agent_skill_registry_entity_1.AgentSkillRegistry)
37
38
  ], AgentSkill.prototype, "agentSkillRegistry", void 0);
38
39
  __decorate([
39
- (0, typeorm_1.Column)({ type: "boolean", default: true }),
40
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('boolean'), default: true }),
40
41
  __metadata("design:type", Boolean)
41
42
  ], AgentSkill.prototype, "alwaysInclude", void 0);
42
43
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"agent-skill.entity.js","sourceRoot":"","sources":["../../src/entities/agent-skill.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,mEAAwD;AACxD,+EAAkE;AAG3D,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,4BAAY;IAArC;;QAUH,kBAAa,GAAY,IAAI,CAAC;KAKjC;;kSAL4B,IAAI;;CAKhC,CAAA;AAfY,gCAAU;AAGnB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACxE,IAAA,oBAAU,GAAE;8BACE,qCAAa;iDAAC;AAI7B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gDAAkB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC7E,IAAA,oBAAU,GAAE;8BACO,gDAAkB;sDAAC;AAGvC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACb;AAI9B;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACtB;qBAdb,UAAU;IADtB,IAAA,gBAAM,EAAC,gBAAgB,CAAC;GACZ,UAAU,CAetB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Column, Index } from 'typeorm';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentSkillRegistry } from './agent-skill-registry.entity'\n\n@Entity('ss_agent_skill')\nexport class AgentSkill extends CommonEntity {\n @ManyToOne(() => AgentRegistry, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n agentRegistry: AgentRegistry;\n\n @ManyToOne(() => AgentSkillRegistry, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n agentSkillRegistry: AgentSkillRegistry;\n\n @Column({ type: \"boolean\", default: true })\n alwaysInclude: boolean = true;\n\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n agentSkillKey: string;\n}\n"]}
1
+ {"version":3,"file":"agent-skill.entity.js","sourceRoot":"","sources":["../../src/entities/agent-skill.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,mEAAwD;AACxD,+EAAkE;AAClE,oEAA8D;AAGvD,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,4BAAY;IAArC;;QAUH,kBAAa,GAAY,IAAI,CAAC;KAKjC;;kSAL4B,IAAI;;CAKhC,CAAA;AAfY,gCAAU;AAGnB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACxE,IAAA,oBAAU,GAAE;8BACE,qCAAa;iDAAC;AAI7B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gDAAkB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC7E,IAAA,oBAAU,GAAE;8BACO,gDAAkB;sDAAC;AAGvC;IADC,IAAA,gBAAM,EAAC,EAAE,GAAG,IAAA,iCAAa,EAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACzB;AAI9B;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACtB;qBAdb,UAAU;IADtB,IAAA,gBAAM,EAAC,gBAAgB,CAAC;GACZ,UAAU,CAetB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Column, Index } from 'typeorm';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentSkillRegistry } from './agent-skill-registry.entity'\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_agent_skill')\nexport class AgentSkill extends CommonEntity {\n @ManyToOne(() => AgentRegistry, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n agentRegistry: AgentRegistry;\n\n @ManyToOne(() => AgentSkillRegistry, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n agentSkillRegistry: AgentSkillRegistry;\n\n @Column({ ...getColumnType('boolean'), default: true })\n alwaysInclude: boolean = true;\n\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n agentSkillKey: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-tool.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-tool.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,qBACa,SAAU,SAAQ,YAAY;IAGvC,aAAa,EAAE,aAAa,CAAC;IAI7B,iBAAiB,EAAE,iBAAiB,CAAC;IAGrC,gBAAgB,EAAE,OAAO,CAAS;IAIlC,YAAY,EAAE,MAAM,CAAC;CACxB"}
1
+ {"version":3,"file":"agent-tool.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-tool.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAGhE,qBACa,SAAU,SAAQ,YAAY;IAGvC,aAAa,EAAE,aAAa,CAAC;IAI7B,iBAAiB,EAAE,iBAAiB,CAAC;IAGrC,gBAAgB,EAAE,OAAO,CAAS;IAIlC,YAAY,EAAE,MAAM,CAAC;CACxB"}
@@ -15,6 +15,7 @@ const common_entity_1 = require("./common.entity");
15
15
  const typeorm_1 = require("typeorm");
16
16
  const agent_registry_entity_1 = require("./agent-registry.entity");
17
17
  const agent_tool_registry_entity_1 = require("./agent-tool-registry.entity");
18
+ const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
18
19
  let AgentTool = class AgentTool extends common_entity_1.CommonEntity {
19
20
  constructor() {
20
21
  super(...arguments);
@@ -36,7 +37,7 @@ __decorate([
36
37
  __metadata("design:type", agent_tool_registry_entity_1.AgentToolRegistry)
37
38
  ], AgentTool.prototype, "agentToolRegistry", void 0);
38
39
  __decorate([
39
- (0, typeorm_1.Column)({ type: "boolean", default: false }),
40
+ (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('boolean'), default: false }),
40
41
  __metadata("design:type", Boolean)
41
42
  ], AgentTool.prototype, "requiresApproval", void 0);
42
43
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"agent-tool.entity.js","sourceRoot":"","sources":["../../src/entities/agent-tool.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,mEAAwD;AACxD,6EAAgE;AAGzD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,4BAAY;IAApC;;QAUH,qBAAgB,GAAY,KAAK,CAAC;KAKrC;;kSAL+B,KAAK;;CAKpC,CAAA;AAfY,8BAAS;AAGlB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACxE,IAAA,oBAAU,GAAE;8BACE,qCAAa;gDAAC;AAI7B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC5E,IAAA,oBAAU,GAAE;8BACM,8CAAiB;oDAAC;AAGrC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;mDACV;AAIlC;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACvB;oBAdZ,SAAS;IADrB,IAAA,gBAAM,EAAC,eAAe,CAAC;GACX,SAAS,CAerB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Column, Index } from 'typeorm';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentToolRegistry } from './agent-tool-registry.entity'\n\n@Entity('ss_agent_tool')\nexport class AgentTool extends CommonEntity {\n @ManyToOne(() => AgentRegistry, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n agentRegistry: AgentRegistry;\n\n @ManyToOne(() => AgentToolRegistry, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n agentToolRegistry: AgentToolRegistry;\n\n @Column({ type: \"boolean\", default: false })\n requiresApproval: boolean = false;\n\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n agentToolKey: string;\n}\n"]}
1
+ {"version":3,"file":"agent-tool.entity.js","sourceRoot":"","sources":["../../src/entities/agent-tool.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,mEAAwD;AACxD,6EAAgE;AAChE,oEAA8D;AAGvD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,4BAAY;IAApC;;QAUH,qBAAgB,GAAY,KAAK,CAAC;KAKrC;;kSAL+B,KAAK;;CAKpC,CAAA;AAfY,8BAAS;AAGlB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACxE,IAAA,oBAAU,GAAE;8BACE,qCAAa;gDAAC;AAI7B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC5E,IAAA,oBAAU,GAAE;8BACM,8CAAiB;oDAAC;AAGrC;IADC,IAAA,gBAAM,EAAC,EAAE,GAAG,IAAA,iCAAa,EAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;mDACtB;AAIlC;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACvB;oBAdZ,SAAS;IADrB,IAAA,gBAAM,EAAC,eAAe,CAAC;GACX,SAAS,CAerB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Column, Index } from 'typeorm';\nimport { AgentRegistry } from './agent-registry.entity';\nimport { AgentToolRegistry } from './agent-tool-registry.entity'\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_agent_tool')\nexport class AgentTool extends CommonEntity {\n @ManyToOne(() => AgentRegistry, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n agentRegistry: AgentRegistry;\n\n @ManyToOne(() => AgentToolRegistry, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n agentToolRegistry: AgentToolRegistry;\n\n @Column({ ...getColumnType('boolean'), default: false })\n requiresApproval: boolean = false;\n\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n agentToolKey: string;\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import { CommonEntity } from '../entities/common.entity';
2
2
  import { EmailAttachment } from './email-attachment.entity';
3
+ import { ModuleMetadata } from './module-metadata.entity';
3
4
  export declare class EmailTemplate extends CommonEntity {
4
5
  name: string;
5
6
  displayName: string;
@@ -9,5 +10,6 @@ export declare class EmailTemplate extends CommonEntity {
9
10
  active: boolean;
10
11
  attachments: EmailAttachment[];
11
12
  type: string;
13
+ module: ModuleMetadata;
12
14
  }
13
15
  //# sourceMappingURL=email-template.entity.d.ts.map