litedbmodel-gen 0.6.0 → 0.6.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.
@@ -160,7 +160,8 @@ var auditLitedbmodelUsage = {
160
160
  "The riskLevel field reflects the highest-severity finding present.",
161
161
  "Each finding with severity >= warning includes a recommendation field referencing the correct litedbmodel API method."
162
162
  ],
163
- optional: false
163
+ optional: false,
164
+ model_class: "standard"
164
165
  };
165
166
  var implementLitedbmodelFeature = {
166
167
  id: "implement-litedbmodel-feature",
@@ -188,7 +189,8 @@ var implementLitedbmodelFeature = {
188
189
  "The changedFiles array lists every file that was created or updated.",
189
190
  "If schema context is insufficient, missing information is listed in the findings array and the agent stops."
190
191
  ],
191
- optional: false
192
+ optional: false,
193
+ model_class: "thinking"
192
194
  };
193
195
  var taskRegistry = {
194
196
  "audit-litedbmodel-usage": auditLitedbmodelUsage,
@@ -14727,7 +14729,7 @@ var LitedbmodelAuditResultSchema = external_exports.object({
14727
14729
  location: external_exports.string().optional(),
14728
14730
  message: external_exports.string(),
14729
14731
  recommendation: external_exports.string().optional(),
14730
- confidence: external_exports.number().optional(),
14732
+ confidence: external_exports.number().min(0).max(1).optional(),
14731
14733
  evidence: external_exports.array(external_exports.object({
14732
14734
  type: external_exports.string(),
14733
14735
  content: external_exports.string(),
@@ -14762,7 +14764,7 @@ var LitedbmodelImplementResultSchema = external_exports.object({
14762
14764
  location: external_exports.string().optional(),
14763
14765
  message: external_exports.string(),
14764
14766
  recommendation: external_exports.string().optional(),
14765
- confidence: external_exports.number().optional(),
14767
+ confidence: external_exports.number().min(0).max(1).optional(),
14766
14768
  evidence: external_exports.array(external_exports.object({
14767
14769
  type: external_exports.string(),
14768
14770
  content: external_exports.string(),
@@ -14832,11 +14834,653 @@ var handoffs = {
14832
14834
 
14833
14835
  // src/generated/dsl/workflows.ts
14834
14836
  var workflowRegistry = {};
14837
+
14838
+ // src/generated/dsl/dsl-data.ts
14839
+ var resolvedDsl = {
14840
+ "version": 1,
14841
+ "system": {
14842
+ "id": "litedbmodel-gen",
14843
+ "name": "litedbmodel-gen Agent System",
14844
+ "default_workflow_order": [
14845
+ "audit-workflow",
14846
+ "implement-workflow"
14847
+ ]
14848
+ },
14849
+ "agents": {
14850
+ "litedbmodel-auditor": {
14851
+ "role_name": "litedbmodel Audit Analyst",
14852
+ "purpose": "Audits TypeScript source code that uses the litedbmodel ORM to detect common anti-patterns that cause data-integrity problems, performance degradation, or correctness bugs. Reads project files using file tools to find all litedbmodel usage sites.\nThe eight canonical anti-patterns to detect:\n (1) LOOP_CREATE \u2014 Model.create() inside a loop; use createMany instead.\n (2) DELETE_REINSERT \u2014 full delete then re-insert; use upsert instead.\n (3) MISSING_IDEMPOTENCY \u2014 bare create() that throws on duplicate rows.\n (4) AGGREGATE_SKIP \u2014 inserting un-aggregated data that needs group-by first.\n (5) OVER_DELETE \u2014 delete with overly broad conditions.\n (6) MISSING_LOCK \u2014 concurrent-write path without forUpdate: true.\n (7) UNIQUE_MISSING \u2014 onConflict used without a DB UNIQUE constraint.\n (8) N_PLUS_ONE \u2014 find/findOne called inside a loop.\n\nlitedbmodel API reference (for remediation guidance):\n Model.create(cols, opts?) \u2014 opts: { returning, onConflict, onConflictIgnore, onConflictUpdate }\n Model.createMany(rows, opts?) \u2014 batch INSERT with same opts.\n Model.find(conds, opts?) \u2014 opts: { order, limit, offset, forUpdate }\n Model.findOne(conds, opts?) \u2014 single-row SELECT.\n Model.findById(pkeyResult) \u2014 find by PkeyResult object.\n Model.update(conds, vals, opts?) \u2014 UPDATE matching rows.\n Model.updateMany(rows, opts?) \u2014 bulk UPDATE; opts: { keyColumns }\n Model.delete(conds, opts?) \u2014 DELETE matching rows.\n DBModel.transaction(fn, opts?) \u2014 opts: { retryOnError, retryLimit }\n SKIP \u2014 exclude a condition or column dynamically.\n sql tagged template \u2014 operator-based conditions.\n forUpdate: true \u2014 SELECT FOR UPDATE (must be inside a transaction).\n onConflict + onConflictUpdate \u2014 upsert (target column must have UNIQUE/PK).\n onConflict + onConflictIgnore \u2014 insert-or-ignore.\n\nProduces structured findings (AgentAuditResult shape) with severity, category, location, message, and actionable remediation referencing the correct litedbmodel API.",
14853
+ "mode": "read-only",
14854
+ "can_read_artifacts": [],
14855
+ "can_write_artifacts": [],
14856
+ "can_invoke_agents": [],
14857
+ "can_execute_tools": [],
14858
+ "can_return_handoffs": [
14859
+ "litedbmodel-audit-result"
14860
+ ],
14861
+ "responsibilities": [
14862
+ "Read project source files using file tools to find all litedbmodel model import sites and usage.",
14863
+ "Classify each usage occurrence against the eight anti-pattern categories.",
14864
+ "Assign severity \u2014 info/warning/error/critical \u2014 based on data-integrity and performance impact.",
14865
+ "Provide specific remediation guidance referencing the correct litedbmodel API.",
14866
+ "Compute an overall riskLevel reflecting the most severe finding.",
14867
+ "Return a findings array even when it is empty (no issues found)."
14868
+ ],
14869
+ "constraints": [
14870
+ "Do not suggest API methods that are not part of the documented litedbmodel interface.",
14871
+ "Do not mutate, write, or propose direct file changes; only produce findings.",
14872
+ "Stop and escalate if the source exceeds 200 KB or contains no litedbmodel import statements."
14873
+ ],
14874
+ "rules": [
14875
+ {
14876
+ "id": "R-AUDIT-001",
14877
+ "description": "Always recommend Model.createMany() as the replacement for any loop body that contains a Model.create() call.",
14878
+ "severity": "mandatory"
14879
+ },
14880
+ {
14881
+ "id": "R-AUDIT-002",
14882
+ "description": "When a delete-then-reinsert pattern is detected, recommend Model.createMany() with onConflict + onConflictUpdate as the idiomatic upsert replacement.",
14883
+ "severity": "mandatory"
14884
+ },
14885
+ {
14886
+ "id": "R-AUDIT-003",
14887
+ "description": "Whenever onConflict / onConflictUpdate is recommended, note that the target column(s) must carry a UNIQUE or PRIMARY KEY constraint in the database schema.",
14888
+ "severity": "mandatory"
14889
+ },
14890
+ {
14891
+ "id": "R-AUDIT-004",
14892
+ "description": "N+1 findings must include the batch alternative: find() with an IN-equivalent condition, createMany(), or updateMany().",
14893
+ "severity": "mandatory"
14894
+ },
14895
+ {
14896
+ "id": "R-AUDIT-005",
14897
+ "description": "Race-condition findings in concurrent-write paths must recommend findOne/find with forUpdate: true inside DBModel.transaction().",
14898
+ "severity": "mandatory"
14899
+ }
14900
+ ],
14901
+ "escalation_criteria": [
14902
+ {
14903
+ "condition": "The provided source code exceeds 200 KB in total size.",
14904
+ "action": "stop_and_report"
14905
+ },
14906
+ {
14907
+ "condition": "The provided source code contains no litedbmodel import statements and cannot be meaningfully audited.",
14908
+ "action": "stop_and_report"
14909
+ }
14910
+ ]
14911
+ },
14912
+ "litedbmodel-implementer": {
14913
+ "role_name": "litedbmodel Implementation Engineer",
14914
+ "purpose": "Implements litedbmodel DBModel-based business logic directly in the user's project by reading model definitions and SQL schema from the filesystem, then writing TypeScript source files. Proactively applies all litedbmodel best-practice patterns from the start: Model.createMany() for batch inserts, onConflict+onConflictUpdate for idempotent upserts, forUpdate: true for concurrent-safe reads, and DBModel.transaction() for multi-step operations. Never produces code that contains any of the eight canonical anti-patterns.\nlitedbmodel API reference (use ONLY these \u2014 never invent methods):\n Model.create(cols, opts?) \u2014 single INSERT.\n opts: { returning, onConflict, onConflictIgnore, onConflictUpdate }\n Model.createMany(rows, opts?) \u2014 batch INSERT with same opts.\n Model.find(conds, opts?) \u2014 SELECT.\n opts: { order, limit, offset, forUpdate }\n Model.findOne(conds, opts?) \u2014 single-row SELECT.\n Model.findById(pkeyResult) \u2014 find by PkeyResult object.\n Model.update(conds, vals, opts?) \u2014 UPDATE matching rows.\n Model.updateMany(rows, opts?) \u2014 bulk UPDATE.\n opts: { keyColumns }\n Model.delete(conds, opts?) \u2014 DELETE matching rows.\n Model.query(sql, params) \u2014 raw SQL returning typed model instances.\n DBModel.execute(sql) \u2014 raw SQL for DDL/maintenance (no model instances).\n DBModel.transaction(fn, opts?) \u2014 transaction wrapper.\n opts: { retryOnError, retryLimit }\n SKIP \u2014 exclude a condition or column dynamically.\n sql tagged template \u2014 operator-based conditions.\n Column references: sql`${Model.col} > ${val}`\n IS NULL: sql`${Model.col} IS NULL`\n IN: [sql`${Model.col} IN (?)`, [...values]]\n forUpdate: true \u2014 SELECT FOR UPDATE (must be inside a transaction).\n onConflict + onConflictUpdate \u2014 upsert.\n Target column(s) must have UNIQUE or PRIMARY KEY constraint.\n onConflict + onConflictIgnore \u2014 insert-or-ignore.\n Same constraint requirement.\n Column references are symbol-based: Model.column_name (not strings).\n Conditions are type-safe tuples: [[Model.col, value], ...].",
14915
+ "mode": "read-write",
14916
+ "can_read_artifacts": [],
14917
+ "can_write_artifacts": [],
14918
+ "can_invoke_agents": [],
14919
+ "can_execute_tools": [],
14920
+ "can_return_handoffs": [
14921
+ "litedbmodel-implement-result"
14922
+ ],
14923
+ "responsibilities": [
14924
+ "Step 1: Use Glob to find model definition files matching the models glob pattern in the user request. Read each matched file to extract model classes, column definitions, and table names.",
14925
+ "Step 2: Read the target file specified in the user request. Examine its current content. If it contains only stubs, TODOs, or empty class bodies, you MUST write the full implementation.",
14926
+ "Step 3: Use Edit or Write tool to add the implementation directly to the target file. You MUST actually modify the file on disk. Never claim 'implementation is already present' unless the function body you just read contains real business logic \u2014 not stubs or TODOs.",
14927
+ "Apply correct patterns proactively \u2014 never generate loop-inside-create, delete-reinsert, bare non-idempotent create, or N+1 patterns.",
14928
+ "Surface design concerns (missing UNIQUE constraints, missing transactions, ambiguous schema) as findings with severity info or warning."
14929
+ ],
14930
+ "constraints": [
14931
+ "Only reference model classes and columns that exist in the project's model definition files.",
14932
+ "Never invent or fabricate litedbmodel API methods not listed in the API reference above.",
14933
+ "Keep all generated TypeScript strict-mode compliant.",
14934
+ "If the model/schema context is insufficient, list the missing information explicitly and stop."
14935
+ ],
14936
+ "rules": [
14937
+ {
14938
+ "id": "R-IMPL-001",
14939
+ "description": "Never generate a for/while loop body that calls Model.create(). Always use Model.createMany() for batch writes.",
14940
+ "severity": "mandatory"
14941
+ },
14942
+ {
14943
+ "id": "R-IMPL-002",
14944
+ "description": "Idempotent single-row writes must pass onConflict with either onConflictIgnore: true or onConflictUpdate: [...] to Model.create(). Bare Model.create() that can throw on duplicate keys is forbidden.",
14945
+ "severity": "mandatory"
14946
+ },
14947
+ {
14948
+ "id": "R-IMPL-003",
14949
+ "description": "Multi-step read-modify-write sequences must be wrapped in DBModel.transaction() to prevent partial updates.",
14950
+ "severity": "mandatory"
14951
+ },
14952
+ {
14953
+ "id": "R-IMPL-004",
14954
+ "description": "Any read that is immediately followed by a conditional write in a concurrent context must use findOne/find with forUpdate: true inside a transaction.",
14955
+ "severity": "mandatory"
14956
+ },
14957
+ {
14958
+ "id": "R-IMPL-005",
14959
+ "description": "Whenever onConflict is generated, add a code comment noting that the referenced column(s) must have a UNIQUE or PRIMARY KEY constraint.",
14960
+ "severity": "mandatory"
14961
+ }
14962
+ ],
14963
+ "escalation_criteria": [
14964
+ {
14965
+ "condition": "The feature description is too ambiguous to be mapped to any model class in the project.",
14966
+ "action": "stop_and_report"
14967
+ },
14968
+ {
14969
+ "condition": "No model definitions or SQL schema found in the project and the feature requires specific column knowledge.",
14970
+ "action": "stop_and_report"
14971
+ }
14972
+ ]
14973
+ }
14974
+ },
14975
+ "tasks": {
14976
+ "audit-litedbmodel-usage": {
14977
+ "description": "Audit TypeScript source files that import or use litedbmodel model classes. Detect the eight canonical anti-patterns (LOOP_CREATE, DELETE_REINSERT, MISSING_IDEMPOTENCY, AGGREGATE_SKIP, OVER_DELETE, MISSING_LOCK, UNIQUE_MISSING, N_PLUS_ONE) and return structured findings with severity ratings and remediation guidance referencing the correct litedbmodel API.",
14978
+ "target_agent": "litedbmodel-auditor",
14979
+ "model_class": "standard",
14980
+ "allowed_from_agents": [
14981
+ "litedbmodel-auditor"
14982
+ ],
14983
+ "workflow": "audit-workflow",
14984
+ "input_artifacts": [],
14985
+ "invocation_handoff": "litedbmodel-audit-request",
14986
+ "result_handoff": "litedbmodel-audit-result",
14987
+ "responsibilities": [
14988
+ "Parse the provided source code for litedbmodel model import sites and all subsequent usages.",
14989
+ "Classify each usage occurrence against the eight anti-pattern categories.",
14990
+ "Return findings conforming to the litedbmodel-audit-result schema."
14991
+ ],
14992
+ "completion_criteria": [
14993
+ "All litedbmodel usage sites in the provided code have been inspected.",
14994
+ "The findings array is populated (may be empty when no issues are found).",
14995
+ "The riskLevel field reflects the highest-severity finding present.",
14996
+ "Each finding with severity >= warning includes a recommendation field referencing the correct litedbmodel API method."
14997
+ ]
14998
+ },
14999
+ "implement-litedbmodel-feature": {
15000
+ "description": "Implement a litedbmodel-based business feature by reading model definitions and writing TypeScript code directly to the target file. The agent uses file tools (Glob, Read, Edit, Write) to operate on the user's project, proactively avoiding all eight litedbmodel anti-patterns.",
15001
+ "target_agent": "litedbmodel-implementer",
15002
+ "model_class": "thinking",
15003
+ "allowed_from_agents": [
15004
+ "litedbmodel-implementer"
15005
+ ],
15006
+ "workflow": "implement-workflow",
15007
+ "input_artifacts": [],
15008
+ "invocation_handoff": "litedbmodel-implement-request",
15009
+ "result_handoff": "litedbmodel-implement-result",
15010
+ "responsibilities": [
15011
+ "Parse the feature description to identify the required data operations.",
15012
+ "Read model definition files using Glob + Read to understand available models, columns, and constraints.",
15013
+ "Read the target file to understand its current state.",
15014
+ "Write the implementation to the target file using Edit or Write tools.",
15015
+ "Apply best-practice patterns proactively (createMany, upsert, forUpdate, transaction) so that no anti-pattern appears in the written code.",
15016
+ "Report what was changed in the changedFiles array."
15017
+ ],
15018
+ "completion_criteria": [
15019
+ "The target file has been modified on disk via file tools.",
15020
+ "Written code uses only documented litedbmodel API methods.",
15021
+ "None of the eight anti-patterns appear in the written code.",
15022
+ "The changedFiles array lists every file that was created or updated.",
15023
+ "If schema context is insufficient, missing information is listed in the findings array and the agent stops."
15024
+ ]
15025
+ }
15026
+ },
15027
+ "handoff_types": {
15028
+ "litedbmodel-audit-request": {
15029
+ "version": 1,
15030
+ "description": "Invocation handoff carrying the audit context passed to the litedbmodel-auditor agent. The userRequest field contains the structured prompt built by the context-builder (target path header, source code, and per-pattern instructions).",
15031
+ "schema": {
15032
+ "type": "object",
15033
+ "required": [
15034
+ "userRequest"
15035
+ ],
15036
+ "properties": {
15037
+ "userRequest": {
15038
+ "type": "string",
15039
+ "description": "Full audit prompt including target path, source code, and anti-pattern inspection instructions. Capped at 16 KB."
15040
+ }
15041
+ }
15042
+ }
15043
+ },
15044
+ "litedbmodel-implement-request": {
15045
+ "version": 1,
15046
+ "description": "Invocation handoff carrying the implementation context passed to the litedbmodel-implementer agent. The userRequest field contains the structured prompt built by the context-builder (feature description, model glob, target file path, and instructions to use file tools).",
15047
+ "schema": {
15048
+ "type": "object",
15049
+ "required": [
15050
+ "userRequest"
15051
+ ],
15052
+ "properties": {
15053
+ "userRequest": {
15054
+ "type": "string",
15055
+ "description": "Full implementation prompt including feature description, model glob pattern, target file path, and instructions to read models and write implementation using file tools. Capped at 16 KB."
15056
+ }
15057
+ }
15058
+ }
15059
+ },
15060
+ "litedbmodel-audit-result": {
15061
+ "version": 1,
15062
+ "description": "Structured audit result returned by the litedbmodel-auditor agent. Conforms to the AgentAuditResult base shape defined in cli-contract.yaml#/components/schemas/AgentAuditResult. Findings use litedbmodel-specific category vocabulary: LOOP_CREATE, DELETE_REINSERT, MISSING_IDEMPOTENCY, AGGREGATE_SKIP, OVER_DELETE, MISSING_LOCK, UNIQUE_MISSING, N_PLUS_ONE.",
15063
+ "schema": {
15064
+ "type": "object",
15065
+ "required": [
15066
+ "summary",
15067
+ "riskLevel",
15068
+ "findings"
15069
+ ],
15070
+ "properties": {
15071
+ "summary": {
15072
+ "type": "string",
15073
+ "description": "One-paragraph summary of the audit result."
15074
+ },
15075
+ "riskLevel": {
15076
+ "type": "string",
15077
+ "enum": [
15078
+ "low",
15079
+ "medium",
15080
+ "high",
15081
+ "critical"
15082
+ ],
15083
+ "description": "Overall risk level reflecting the highest-severity finding."
15084
+ },
15085
+ "findings": {
15086
+ "type": "array",
15087
+ "items": {
15088
+ "type": "object",
15089
+ "required": [
15090
+ "severity",
15091
+ "category",
15092
+ "message"
15093
+ ],
15094
+ "properties": {
15095
+ "id": {
15096
+ "type": "string"
15097
+ },
15098
+ "severity": {
15099
+ "type": "string",
15100
+ "enum": [
15101
+ "info",
15102
+ "warning",
15103
+ "error",
15104
+ "critical"
15105
+ ]
15106
+ },
15107
+ "category": {
15108
+ "type": "string",
15109
+ "description": "One of: LOOP_CREATE | DELETE_REINSERT | MISSING_IDEMPOTENCY | AGGREGATE_SKIP | OVER_DELETE | MISSING_LOCK | UNIQUE_MISSING | N_PLUS_ONE"
15110
+ },
15111
+ "target": {
15112
+ "type": "string",
15113
+ "description": "Class name or function where the issue occurs."
15114
+ },
15115
+ "location": {
15116
+ "type": "string",
15117
+ "description": "File path and optional line number."
15118
+ },
15119
+ "message": {
15120
+ "type": "string"
15121
+ },
15122
+ "recommendation": {
15123
+ "type": "string",
15124
+ "description": "Actionable fix referencing the correct litedbmodel API method."
15125
+ },
15126
+ "confidence": {
15127
+ "type": "number",
15128
+ "minimum": 0,
15129
+ "maximum": 1
15130
+ },
15131
+ "evidence": {
15132
+ "type": "array",
15133
+ "items": {
15134
+ "type": "object",
15135
+ "required": [
15136
+ "type",
15137
+ "content"
15138
+ ],
15139
+ "properties": {
15140
+ "type": {
15141
+ "type": "string"
15142
+ },
15143
+ "content": {
15144
+ "type": "string"
15145
+ },
15146
+ "source": {
15147
+ "type": "string"
15148
+ }
15149
+ }
15150
+ }
15151
+ },
15152
+ "details": {
15153
+ "type": "object",
15154
+ "description": "Arbitrary additional structured detail."
15155
+ }
15156
+ }
15157
+ }
15158
+ },
15159
+ "recommendedActions": {
15160
+ "type": "array",
15161
+ "items": {
15162
+ "type": "object",
15163
+ "required": [
15164
+ "kind",
15165
+ "title"
15166
+ ],
15167
+ "properties": {
15168
+ "kind": {
15169
+ "type": "string",
15170
+ "enum": [
15171
+ "run_command",
15172
+ "edit_file",
15173
+ "review",
15174
+ "confirm",
15175
+ "block",
15176
+ "ignore"
15177
+ ]
15178
+ },
15179
+ "title": {
15180
+ "type": "string"
15181
+ },
15182
+ "command": {
15183
+ "type": "string"
15184
+ },
15185
+ "target": {
15186
+ "type": "string"
15187
+ },
15188
+ "rationale": {
15189
+ "type": "string"
15190
+ }
15191
+ }
15192
+ }
15193
+ },
15194
+ "metadata": {
15195
+ "type": "object",
15196
+ "properties": {
15197
+ "tool": {
15198
+ "type": "string"
15199
+ },
15200
+ "command": {
15201
+ "type": "string"
15202
+ },
15203
+ "version": {
15204
+ "type": "string"
15205
+ },
15206
+ "generatedAt": {
15207
+ "type": "string"
15208
+ },
15209
+ "adapter": {
15210
+ "type": "string"
15211
+ },
15212
+ "model": {
15213
+ "type": "string"
15214
+ }
15215
+ }
15216
+ }
15217
+ }
15218
+ }
15219
+ },
15220
+ "litedbmodel-implement-result": {
15221
+ "version": 1,
15222
+ "description": "Structured implementation report returned by the litedbmodel-implementer agent after writing files directly. Extends the AgentAuditResult base shape with changedFiles (what was created/modified) and optional dependency/note fields. Findings contain design observations (e.g. UNIQUE_MISSING, missing transaction wrapper).",
15223
+ "schema": {
15224
+ "type": "object",
15225
+ "required": [
15226
+ "summary",
15227
+ "riskLevel",
15228
+ "findings",
15229
+ "changedFiles"
15230
+ ],
15231
+ "properties": {
15232
+ "summary": {
15233
+ "type": "string",
15234
+ "description": "One-paragraph summary of what was implemented."
15235
+ },
15236
+ "riskLevel": {
15237
+ "type": "string",
15238
+ "enum": [
15239
+ "low",
15240
+ "medium",
15241
+ "high",
15242
+ "critical"
15243
+ ],
15244
+ "description": "Overall risk level of the implementation."
15245
+ },
15246
+ "findings": {
15247
+ "type": "array",
15248
+ "description": "Design observations and caveats about the implementation.",
15249
+ "items": {
15250
+ "type": "object",
15251
+ "required": [
15252
+ "severity",
15253
+ "category",
15254
+ "message"
15255
+ ],
15256
+ "properties": {
15257
+ "id": {
15258
+ "type": "string"
15259
+ },
15260
+ "severity": {
15261
+ "type": "string",
15262
+ "enum": [
15263
+ "info",
15264
+ "warning",
15265
+ "error",
15266
+ "critical"
15267
+ ]
15268
+ },
15269
+ "category": {
15270
+ "type": "string"
15271
+ },
15272
+ "target": {
15273
+ "type": "string"
15274
+ },
15275
+ "location": {
15276
+ "type": "string"
15277
+ },
15278
+ "message": {
15279
+ "type": "string"
15280
+ },
15281
+ "recommendation": {
15282
+ "type": "string"
15283
+ },
15284
+ "confidence": {
15285
+ "type": "number",
15286
+ "minimum": 0,
15287
+ "maximum": 1
15288
+ },
15289
+ "evidence": {
15290
+ "type": "array",
15291
+ "items": {
15292
+ "type": "object",
15293
+ "required": [
15294
+ "type",
15295
+ "content"
15296
+ ],
15297
+ "properties": {
15298
+ "type": {
15299
+ "type": "string"
15300
+ },
15301
+ "content": {
15302
+ "type": "string"
15303
+ },
15304
+ "source": {
15305
+ "type": "string"
15306
+ }
15307
+ }
15308
+ }
15309
+ },
15310
+ "details": {
15311
+ "type": "object",
15312
+ "description": "Arbitrary additional structured detail."
15313
+ }
15314
+ }
15315
+ }
15316
+ },
15317
+ "recommendedActions": {
15318
+ "type": "array",
15319
+ "items": {
15320
+ "type": "object",
15321
+ "required": [
15322
+ "kind",
15323
+ "title"
15324
+ ],
15325
+ "properties": {
15326
+ "kind": {
15327
+ "type": "string",
15328
+ "enum": [
15329
+ "run_command",
15330
+ "edit_file",
15331
+ "review",
15332
+ "confirm",
15333
+ "block",
15334
+ "ignore"
15335
+ ]
15336
+ },
15337
+ "title": {
15338
+ "type": "string"
15339
+ },
15340
+ "command": {
15341
+ "type": "string"
15342
+ },
15343
+ "target": {
15344
+ "type": "string"
15345
+ },
15346
+ "rationale": {
15347
+ "type": "string"
15348
+ }
15349
+ }
15350
+ }
15351
+ },
15352
+ "changedFiles": {
15353
+ "type": "array",
15354
+ "description": "Files that the agent created or modified directly.",
15355
+ "items": {
15356
+ "type": "object",
15357
+ "required": [
15358
+ "path",
15359
+ "action"
15360
+ ],
15361
+ "properties": {
15362
+ "path": {
15363
+ "type": "string",
15364
+ "description": "Relative path of the created/modified file."
15365
+ },
15366
+ "action": {
15367
+ "type": "string",
15368
+ "enum": [
15369
+ "created",
15370
+ "updated"
15371
+ ]
15372
+ },
15373
+ "rationale": {
15374
+ "type": "string"
15375
+ }
15376
+ }
15377
+ }
15378
+ },
15379
+ "dependencies": {
15380
+ "type": "array",
15381
+ "description": "npm packages required but not yet in the project.",
15382
+ "items": {
15383
+ "type": "string"
15384
+ }
15385
+ },
15386
+ "notes": {
15387
+ "type": "string",
15388
+ "description": "Additional integration instructions."
15389
+ },
15390
+ "metadata": {
15391
+ "type": "object",
15392
+ "properties": {
15393
+ "tool": {
15394
+ "type": "string"
15395
+ },
15396
+ "command": {
15397
+ "type": "string"
15398
+ },
15399
+ "version": {
15400
+ "type": "string"
15401
+ },
15402
+ "generatedAt": {
15403
+ "type": "string"
15404
+ },
15405
+ "adapter": {
15406
+ "type": "string"
15407
+ },
15408
+ "model": {
15409
+ "type": "string"
15410
+ }
15411
+ }
15412
+ }
15413
+ }
15414
+ }
15415
+ }
15416
+ },
15417
+ "guardrails": {
15418
+ "output-schema-conformance": {
15419
+ "description": "All agent outputs must conform to the declared result handoff schema before being returned to the CLI formatter. Non-conformant output breaks exit-code mapping and structured reporting.",
15420
+ "scope": {
15421
+ "agents": [
15422
+ "litedbmodel-auditor",
15423
+ "litedbmodel-implementer"
15424
+ ],
15425
+ "tasks": [
15426
+ "audit-litedbmodel-usage",
15427
+ "implement-litedbmodel-feature"
15428
+ ]
15429
+ },
15430
+ "rationale": "Structured output (AgentAuditResult shape) is a hard contract for downstream CLI consumers. Validation must happen before the result reaches the formatter so that exit codes remain reliable."
15431
+ }
15432
+ },
15433
+ "guardrail_policies": {
15434
+ "litedbmodel-safety-policy": {
15435
+ "rules": [
15436
+ {
15437
+ "guardrail": "output-schema-conformance",
15438
+ "severity": "critical",
15439
+ "action": "block"
15440
+ }
15441
+ ]
15442
+ }
15443
+ },
15444
+ "workflows": {
15445
+ "audit-workflow": {
15446
+ "description": "Single-agent workflow that audits TypeScript source files for litedbmodel ORM anti-patterns and returns structured findings.",
15447
+ "trigger": "cli-command",
15448
+ "entry_conditions": [
15449
+ "User provides a TypeScript file or directory path to audit.",
15450
+ "Source code contains at least one litedbmodel model import."
15451
+ ],
15452
+ "steps": [
15453
+ {
15454
+ "type": "delegate",
15455
+ "task": "audit-litedbmodel-usage",
15456
+ "from_agent": "litedbmodel-auditor"
15457
+ }
15458
+ ]
15459
+ },
15460
+ "implement-workflow": {
15461
+ "description": "Single-agent workflow that generates TypeScript implementation code for a litedbmodel-based feature described by the user.",
15462
+ "trigger": "cli-command",
15463
+ "entry_conditions": [
15464
+ "User provides a natural-language feature description.",
15465
+ "At least model definitions or SQL schema context is available."
15466
+ ],
15467
+ "steps": [
15468
+ {
15469
+ "type": "delegate",
15470
+ "task": "implement-litedbmodel-feature",
15471
+ "from_agent": "litedbmodel-implementer"
15472
+ }
15473
+ ]
15474
+ }
15475
+ }
15476
+ };
15477
+
14835
15478
  export {
14836
15479
  agentRegistry,
15480
+ taskRegistry,
14837
15481
  handoffSchemas,
14838
15482
  handoffs,
14839
- taskRegistry,
14840
- workflowRegistry
15483
+ workflowRegistry,
15484
+ resolvedDsl
14841
15485
  };
14842
- //# sourceMappingURL=dsl-Y2OQL3GG.js.map
15486
+ //# sourceMappingURL=chunk-GERYNDPH.js.map