dacli 0.2.0__py3-none-any.whl

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 (207) hide show
  1. dacli/__init__.py +7 -0
  2. dacli/config/__init__.py +34 -0
  3. dacli/config/policy.yaml +120 -0
  4. dacli/config/settings.py +765 -0
  5. dacli/connectors/__init__.py +17 -0
  6. dacli/connectors/airflow/SKILL.md +31 -0
  7. dacli/connectors/airflow/__init__.py +0 -0
  8. dacli/connectors/airflow/connector.py +270 -0
  9. dacli/connectors/airflow/manifest.yaml +13 -0
  10. dacli/connectors/base.py +196 -0
  11. dacli/connectors/bigquery/SKILL.md +31 -0
  12. dacli/connectors/bigquery/__init__.py +0 -0
  13. dacli/connectors/bigquery/connector.py +306 -0
  14. dacli/connectors/bigquery/manifest.yaml +13 -0
  15. dacli/connectors/cli_base.py +174 -0
  16. dacli/connectors/dagster/SKILL.md +28 -0
  17. dacli/connectors/dagster/__init__.py +0 -0
  18. dacli/connectors/dagster/connector.py +216 -0
  19. dacli/connectors/dagster/manifest.yaml +13 -0
  20. dacli/connectors/databricks/SKILL.md +28 -0
  21. dacli/connectors/databricks/__init__.py +0 -0
  22. dacli/connectors/databricks/connector.py +221 -0
  23. dacli/connectors/databricks/manifest.yaml +13 -0
  24. dacli/connectors/dbt/SKILL.md +39 -0
  25. dacli/connectors/dbt/__init__.py +0 -0
  26. dacli/connectors/dbt/connector.py +260 -0
  27. dacli/connectors/dbt/manifest.yaml +13 -0
  28. dacli/connectors/dispatcher.py +301 -0
  29. dacli/connectors/dod.py +210 -0
  30. dacli/connectors/dynamodb/SKILL.md +34 -0
  31. dacli/connectors/dynamodb/__init__.py +0 -0
  32. dacli/connectors/dynamodb/connector.py +301 -0
  33. dacli/connectors/dynamodb/manifest.yaml +13 -0
  34. dacli/connectors/gcs/SKILL.md +30 -0
  35. dacli/connectors/gcs/__init__.py +0 -0
  36. dacli/connectors/gcs/connector.py +242 -0
  37. dacli/connectors/gcs/manifest.yaml +13 -0
  38. dacli/connectors/github/SKILL.md +30 -0
  39. dacli/connectors/github/__init__.py +3 -0
  40. dacli/connectors/github/connector.py +1032 -0
  41. dacli/connectors/github/manifest.yaml +13 -0
  42. dacli/connectors/http_base.py +123 -0
  43. dacli/connectors/mcp_bridge/SKILL.md +39 -0
  44. dacli/connectors/mcp_bridge/__init__.py +0 -0
  45. dacli/connectors/mcp_bridge/connector.py +295 -0
  46. dacli/connectors/mcp_bridge/manifest.yaml +15 -0
  47. dacli/connectors/mongodb/SKILL.md +34 -0
  48. dacli/connectors/mongodb/__init__.py +0 -0
  49. dacli/connectors/mongodb/connector.py +300 -0
  50. dacli/connectors/mongodb/manifest.yaml +13 -0
  51. dacli/connectors/mysql/SKILL.md +30 -0
  52. dacli/connectors/mysql/__init__.py +0 -0
  53. dacli/connectors/mysql/connector.py +275 -0
  54. dacli/connectors/mysql/manifest.yaml +13 -0
  55. dacli/connectors/pinecone/SKILL.md +26 -0
  56. dacli/connectors/pinecone/__init__.py +3 -0
  57. dacli/connectors/pinecone/connector.py +257 -0
  58. dacli/connectors/pinecone/manifest.yaml +13 -0
  59. dacli/connectors/postgres/SKILL.md +30 -0
  60. dacli/connectors/postgres/__init__.py +0 -0
  61. dacli/connectors/postgres/connector.py +279 -0
  62. dacli/connectors/postgres/manifest.yaml +13 -0
  63. dacli/connectors/registry.py +493 -0
  64. dacli/connectors/s3/SKILL.md +31 -0
  65. dacli/connectors/s3/__init__.py +0 -0
  66. dacli/connectors/s3/connector.py +245 -0
  67. dacli/connectors/s3/manifest.yaml +13 -0
  68. dacli/connectors/shell/__init__.py +13 -0
  69. dacli/connectors/shell/connector.py +257 -0
  70. dacli/connectors/snowflake/SKILL.md +32 -0
  71. dacli/connectors/snowflake/__init__.py +3 -0
  72. dacli/connectors/snowflake/connector.py +627 -0
  73. dacli/connectors/snowflake/manifest.yaml +15 -0
  74. dacli/connectors/system/__init__.py +3 -0
  75. dacli/connectors/system/connector.py +510 -0
  76. dacli/connectors/templates/README.md +25 -0
  77. dacli/connectors/templates/cli_connector_template.py +77 -0
  78. dacli/connectors/templates/manifest_template.yaml +25 -0
  79. dacli/connectors/templates/rest_connector_template.py +124 -0
  80. dacli/context/__init__.py +16 -0
  81. dacli/context/assembler.py +303 -0
  82. dacli/context/budget.py +119 -0
  83. dacli/context/compaction.py +125 -0
  84. dacli/context/disclosure.py +101 -0
  85. dacli/context/pipeline.py +102 -0
  86. dacli/context/sources/__init__.py +13 -0
  87. dacli/context/sources/dbt_manifest.py +176 -0
  88. dacli/context/sources/terminal.py +185 -0
  89. dacli/context/spill.py +155 -0
  90. dacli/context/tokenizer.py +136 -0
  91. dacli/core/__init__.py +38 -0
  92. dacli/core/agent.py +723 -0
  93. dacli/core/atomicio.py +71 -0
  94. dacli/core/blackboard.py +274 -0
  95. dacli/core/connect_flow.py +241 -0
  96. dacli/core/connector_config.py +66 -0
  97. dacli/core/connector_generator.py +585 -0
  98. dacli/core/connector_index.py +184 -0
  99. dacli/core/connector_workflow.py +336 -0
  100. dacli/core/crypto.py +196 -0
  101. dacli/core/export_run.py +133 -0
  102. dacli/core/fastjson.py +46 -0
  103. dacli/core/headless.py +287 -0
  104. dacli/core/kernel.py +354 -0
  105. dacli/core/logging_setup.py +132 -0
  106. dacli/core/loop.py +316 -0
  107. dacli/core/memory.py +475 -0
  108. dacli/core/plan_preview.py +185 -0
  109. dacli/core/planner.py +324 -0
  110. dacli/core/pricing.py +309 -0
  111. dacli/core/router.py +335 -0
  112. dacli/core/setup_wizard.py +473 -0
  113. dacli/core/store.py +273 -0
  114. dacli/core/subagent.py +262 -0
  115. dacli/core/test_mode.py +107 -0
  116. dacli/core/timeutils.py +19 -0
  117. dacli/core/verify.py +477 -0
  118. dacli/eval/__init__.py +41 -0
  119. dacli/eval/__main__.py +95 -0
  120. dacli/eval/calibration.py +112 -0
  121. dacli/eval/dashboard.py +109 -0
  122. dacli/eval/golden/__init__.py +34 -0
  123. dacli/eval/golden/connectors.py +211 -0
  124. dacli/eval/golden/spine.py +218 -0
  125. dacli/eval/golden/terminal.py +346 -0
  126. dacli/eval/harness.py +147 -0
  127. dacli/eval/passk.py +153 -0
  128. dacli/eval/regression.py +145 -0
  129. dacli/eval/report.py +194 -0
  130. dacli/eval/selfimprove.py +146 -0
  131. dacli/eval/sim/__init__.py +36 -0
  132. dacli/eval/sim/cli.py +69 -0
  133. dacli/eval/sim/platforms.py +102 -0
  134. dacli/eval/sim/shell.py +321 -0
  135. dacli/eval/types.py +125 -0
  136. dacli/governance/__init__.py +68 -0
  137. dacli/governance/audit.py +168 -0
  138. dacli/governance/classifier.py +312 -0
  139. dacli/governance/command_classifier.py +472 -0
  140. dacli/governance/governor.py +409 -0
  141. dacli/governance/permissions.py +133 -0
  142. dacli/governance/policy_engine.py +203 -0
  143. dacli/governance/rollback.py +367 -0
  144. dacli/governance/shadow.py +120 -0
  145. dacli/governance/vocab.py +88 -0
  146. dacli/memory/__init__.py +60 -0
  147. dacli/memory/catalog.py +289 -0
  148. dacli/memory/episodic.py +71 -0
  149. dacli/memory/priors.py +162 -0
  150. dacli/memory/procedural.py +48 -0
  151. dacli/memory/retrieval.py +125 -0
  152. dacli/memory/semantic.py +45 -0
  153. dacli/memory/store.py +251 -0
  154. dacli/memory/verify.py +160 -0
  155. dacli/prompts/GUIDELINES.md +27 -0
  156. dacli/prompts/__init__.py +15 -0
  157. dacli/prompts/fragments/core.md +97 -0
  158. dacli/prompts/fragments/github.md +7 -0
  159. dacli/prompts/fragments/snowflake.md +11 -0
  160. dacli/prompts/system_prompt.py +91 -0
  161. dacli/reasoning/__init__.py +16 -0
  162. dacli/reasoning/llm.py +207 -0
  163. dacli/reasoning/model_router.py +234 -0
  164. dacli/reasoning/providers.py +376 -0
  165. dacli/reasoning/scripted.py +79 -0
  166. dacli/sandbox/__init__.py +25 -0
  167. dacli/sandbox/_worker.py +148 -0
  168. dacli/sandbox/bridge.py +102 -0
  169. dacli/sandbox/connector.py +121 -0
  170. dacli/sandbox/docker/worker.py +184 -0
  171. dacli/sandbox/docker_runtime.py +277 -0
  172. dacli/sandbox/factory.py +63 -0
  173. dacli/sandbox/policy.py +116 -0
  174. dacli/sandbox/runtime.py +203 -0
  175. dacli/sandbox/sdk.py +182 -0
  176. dacli/sandbox/shells/__init__.py +42 -0
  177. dacli/sandbox/shells/base.py +159 -0
  178. dacli/sandbox/shells/powershell.py +41 -0
  179. dacli/sandbox/shells/transports.py +257 -0
  180. dacli/sandbox/shells/windows_cmd.py +20 -0
  181. dacli/sandbox/shells/wsl.py +22 -0
  182. dacli/sandbox/shells/zsh.py +20 -0
  183. dacli/sandbox/terminal.py +341 -0
  184. dacli/sandbox/workspace.py +124 -0
  185. dacli/scripts/__init__.py +1 -0
  186. dacli/scripts/clean.py +73 -0
  187. dacli/scripts/cli.py +1556 -0
  188. dacli/scripts/smoke_connector_lifecycle.py +295 -0
  189. dacli/skills/__init__.py +12 -0
  190. dacli/skills/connector.py +73 -0
  191. dacli/skills/data_diff/SKILL.md +57 -0
  192. dacli/skills/data_diff/__init__.py +0 -0
  193. dacli/skills/data_diff/skill.py +270 -0
  194. dacli/skills/diagram_mermaid/SKILL.md +41 -0
  195. dacli/skills/diagram_mermaid/__init__.py +5 -0
  196. dacli/skills/diagram_mermaid/skill.py +203 -0
  197. dacli/skills/registry.py +141 -0
  198. dacli/skills/spec.py +85 -0
  199. dacli/tui/__init__.py +21 -0
  200. dacli/tui/design.py +153 -0
  201. dacli/tui/theme.py +329 -0
  202. dacli/tui/ui.py +1718 -0
  203. dacli-0.2.0.dist-info/METADATA +515 -0
  204. dacli-0.2.0.dist-info/RECORD +207 -0
  205. dacli-0.2.0.dist-info/WHEEL +5 -0
  206. dacli-0.2.0.dist-info/entry_points.txt +2 -0
  207. dacli-0.2.0.dist-info/top_level.txt +1 -0
dacli/__init__.py ADDED
@@ -0,0 +1,7 @@
1
+ """dacli — your autonomous data engineering CLI agent.
2
+
3
+ All first-party packages live under this namespace (``dacli.core``,
4
+ ``dacli.connectors``, …) thanks to the ``src/`` layout. See ``pyproject.toml``.
5
+ """
6
+
7
+ __version__ = "0.2.0"
@@ -0,0 +1,34 @@
1
+ from dacli.config.settings import Settings, is_llm_configured, load_config
2
+
3
+ CLI_COMMANDS = [
4
+ ("/help", "Show this help message"),
5
+ ("/keys", "Show keyboard shortcuts"),
6
+ ("/init", "Generate a DACLI.md priors draft from your config"),
7
+ ("/status", "Show current progress and state"),
8
+ ("/usage", "Show token usage and cost (overall, by model, this session)"),
9
+ ("/context", "Explain the assembled context (sources, tokens, budget)"),
10
+ ("/audit", "Show governance decisions for this session (why the agent acted)"),
11
+ ("/tools", "Show enabled tools and capabilities"),
12
+ ("/connect [tool]", "Configure a connector — interactive, or pass a name"),
13
+ ("/new-connector", "Generate a new connector from natural language description"),
14
+ ("/testmode [tool]", "Toggle staging test mode (health-gated, side-effect-free) for new connectors"),
15
+ ("/import-connector", "Import a tested connector from sandbox to local"),
16
+ ("/push-connector", "Git commit and push a new connector"),
17
+ ("/debug-connector <name>", "Debug a failing connector with LLM assistance"),
18
+ ("/setup", "Run the tool configuration wizard"),
19
+ ("/history", "Show conversation history"),
20
+ ("/sessions", "List available sessions"),
21
+ ("/catalog [connector]", "List known data objects from the catalog cache"),
22
+ ("/schema <object>", "Show cached columns/row-count for one object"),
23
+ ("/load <id>", "Load a previous session"),
24
+ ("/export", "Export current state to JSON"),
25
+ ("/config", "Show current configuration"),
26
+ ("/theme <name>", "Switch UI theme (dark, light, ocean, mono)"),
27
+ ("/prompt", "View/edit the system prompt"),
28
+ ("/clear", "Clear conversation history"),
29
+ ("/cls", "Clear the screen (keeps conversation history)"),
30
+ ("/reset", "Reset agent state"),
31
+ ("/exit", "Exit the CLI"),
32
+ ]
33
+
34
+ __all__ = ["CLI_COMMANDS", "Settings", "is_llm_configured", "load_config"]
@@ -0,0 +1,120 @@
1
+ # DACLI governance policy.
2
+ #
3
+ # Maps blast-radius tiers to enforcement decisions. This file lets a team tune
4
+ # velocity vs. caution per connector / environment WITHOUT code changes. Absent
5
+ # any override, the locked posture applies:
6
+ #
7
+ # safe -> auto (run immediately)
8
+ # write -> verify (run + mandatory post-condition)
9
+ # risky -> confirm (human confirm + rollback plan)
10
+ # irreversible -> dry_run+approve (dry-run + verified rollback + approval)
11
+ #
12
+ # Resolution is most-specific-wins:
13
+ # connectors.<id>.environments.<env> > connectors.<id>.tiers > defaults
14
+ #
15
+ # Valid decisions: auto | verify | confirm | dry_run+approve
16
+
17
+ # Global tier -> decision overrides (apply to every connector unless a more
18
+ # specific rule below matches). Leave empty to keep the locked posture.
19
+ defaults: {}
20
+
21
+ # Identifier tokens that mark an action's target as production. A prod target
22
+ # promotes the classifier tier one step (write->risky, risky->irreversible).
23
+ prod_markers:
24
+ - PROD
25
+ - PRODUCTION
26
+ - GOLD
27
+ - PRD
28
+
29
+ # Least-privilege scope per connector (the connection-profile opt-in). The code
30
+ # default is `read_only` (an action above the scope is refused even if the model
31
+ # asks). Widen here to enable writes/destructive ops:
32
+ # read_only -> safe only | write -> +create/insert | risky -> +update/delete |
33
+ # admin -> +drop/truncate. Tighten any connector to read_only to make it
34
+ # strictly observe-only.
35
+ connectors:
36
+ snowflake:
37
+ scope: admin # full SQL; set to read_only to make Snowflake observe-only
38
+ # Connector-wide rules (any environment).
39
+ tiers: {}
40
+ environments:
41
+ # Example: a dev warehouse is low-stakes — let writes through without a
42
+ # post-condition gate, but still confirm genuinely risky DML.
43
+ dev:
44
+ write: auto
45
+ # Production stays strict (this is the default, shown for clarity).
46
+ prod:
47
+ write: verify
48
+ risky: confirm
49
+ irreversible: dry_run+approve
50
+
51
+ github:
52
+ scope: admin # allows push + delete; set to write to forbid deletes
53
+ tiers: {}
54
+ environments: {}
55
+
56
+ # --- Era 2: the governed shell tier --------------------------------------
57
+ # The shell tier (run_shell_command) flows through this SAME policy table: the
58
+ # *command* is blast-radius-classified (an `ls` is safe; `rm -rf` / `git push
59
+ # --force` are irreversible and refused for want of a verifiable undo). Its
60
+ # least-privilege ceiling is set by `terminal.scope` in settings (default
61
+ # 'write'), which is authoritative over any `scope:` here. The tiers/
62
+ # environments overrides below still apply — e.g. require approval for every
63
+ # shell write, or auto-run writes on a throwaway box.
64
+ shell:
65
+ tiers: {} # e.g. {write: confirm} to gate even mkdir/touch
66
+ environments: {}
67
+
68
+ # --- Wave 1 platforms ---------------------------------------------
69
+ # All ship read-only (the code default). Widen the grant per deployment:
70
+ # write -> +create/insert/put | risky -> +update/delete | admin -> +drop.
71
+ # A platform left at read_only is strictly observe-only even if the model asks
72
+ # to write — the capability simply isn't there to misuse.
73
+ dbt:
74
+ scope: read_only # widen to `risky` to allow `dbt run` / `dbt build`
75
+ tiers: {}
76
+ environments: {}
77
+ bigquery:
78
+ scope: read_only # native dry_run gives an exact cost/effect preview first
79
+ tiers: {}
80
+ environments: {}
81
+ databricks:
82
+ scope: read_only # Delta time travel backs RESTORE-based rollback
83
+ tiers: {}
84
+ environments: {}
85
+ s3:
86
+ scope: read_only # enable bucket versioning before granting delete (admin)
87
+ tiers: {}
88
+ environments: {}
89
+ gcs:
90
+ scope: read_only # enable object versioning before granting delete (admin)
91
+ tiers: {}
92
+ environments: {}
93
+
94
+ # --- Wave 2 operational databases ---------------------------------
95
+ postgres:
96
+ scope: read_only # fully transactional — BEGIN/ROLLBACK is a true undo
97
+ tiers: {}
98
+ environments: {}
99
+ mysql:
100
+ scope: read_only # DML transactional (InnoDB); DDL needs mysqldump snapshots
101
+ tiers: {}
102
+ environments: {}
103
+ mongodb:
104
+ scope: read_only # no native undo — deletes rely on mongodump copy-aside
105
+ tiers: {}
106
+ environments: {}
107
+ dynamodb:
108
+ scope: read_only # enable PITR before granting destructive ops (admin)
109
+ tiers: {}
110
+ environments: {}
111
+
112
+ # --- Wave 3 orchestration ---------------------------------------------------
113
+ airflow:
114
+ scope: read_only # grant `risky` to trigger/pause; delete is gated hard
115
+ tiers: {}
116
+ environments: {}
117
+ dagster:
118
+ scope: read_only # grant `risky` to launch runs
119
+ tiers: {}
120
+ environments: {}