dacli-core 0.4.0__tar.gz

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 (116) hide show
  1. dacli_core-0.4.0/PKG-INFO +30 -0
  2. dacli_core-0.4.0/README.md +7 -0
  3. dacli_core-0.4.0/pyproject.toml +53 -0
  4. dacli_core-0.4.0/setup.cfg +4 -0
  5. dacli_core-0.4.0/src/dacli/config/__init__.py +68 -0
  6. dacli_core-0.4.0/src/dacli/config/policy.yaml +100 -0
  7. dacli_core-0.4.0/src/dacli/config/settings.py +599 -0
  8. dacli_core-0.4.0/src/dacli/connectors/__init__.py +17 -0
  9. dacli_core-0.4.0/src/dacli/connectors/base.py +196 -0
  10. dacli_core-0.4.0/src/dacli/connectors/cli_base.py +174 -0
  11. dacli_core-0.4.0/src/dacli/connectors/dispatcher.py +301 -0
  12. dacli_core-0.4.0/src/dacli/connectors/dod.py +210 -0
  13. dacli_core-0.4.0/src/dacli/connectors/http_base.py +123 -0
  14. dacli_core-0.4.0/src/dacli/connectors/registry.py +466 -0
  15. dacli_core-0.4.0/src/dacli/connectors/shell/__init__.py +13 -0
  16. dacli_core-0.4.0/src/dacli/connectors/shell/connector.py +257 -0
  17. dacli_core-0.4.0/src/dacli/connectors/system/__init__.py +3 -0
  18. dacli_core-0.4.0/src/dacli/connectors/system/connector.py +692 -0
  19. dacli_core-0.4.0/src/dacli/connectors/templates/README.md +25 -0
  20. dacli_core-0.4.0/src/dacli/connectors/templates/cli_connector_template.py +77 -0
  21. dacli_core-0.4.0/src/dacli/connectors/templates/manifest_template.yaml +25 -0
  22. dacli_core-0.4.0/src/dacli/connectors/templates/rest_connector_template.py +124 -0
  23. dacli_core-0.4.0/src/dacli/context/__init__.py +16 -0
  24. dacli_core-0.4.0/src/dacli/context/assembler.py +322 -0
  25. dacli_core-0.4.0/src/dacli/context/budget.py +119 -0
  26. dacli_core-0.4.0/src/dacli/context/compaction.py +125 -0
  27. dacli_core-0.4.0/src/dacli/context/disclosure.py +101 -0
  28. dacli_core-0.4.0/src/dacli/context/pipeline.py +104 -0
  29. dacli_core-0.4.0/src/dacli/context/sources/__init__.py +13 -0
  30. dacli_core-0.4.0/src/dacli/context/sources/dbt_manifest.py +176 -0
  31. dacli_core-0.4.0/src/dacli/context/sources/terminal.py +185 -0
  32. dacli_core-0.4.0/src/dacli/context/spill.py +155 -0
  33. dacli_core-0.4.0/src/dacli/context/tokenizer.py +136 -0
  34. dacli_core-0.4.0/src/dacli/core/__init__.py +38 -0
  35. dacli_core-0.4.0/src/dacli/core/atomicio.py +71 -0
  36. dacli_core-0.4.0/src/dacli/core/connect_extension.py +201 -0
  37. dacli_core-0.4.0/src/dacli/core/connector_config.py +66 -0
  38. dacli_core-0.4.0/src/dacli/core/connector_generator.py +585 -0
  39. dacli_core-0.4.0/src/dacli/core/connector_index.py +184 -0
  40. dacli_core-0.4.0/src/dacli/core/context7.py +100 -0
  41. dacli_core-0.4.0/src/dacli/core/cost_advisor.py +196 -0
  42. dacli_core-0.4.0/src/dacli/core/crypto.py +323 -0
  43. dacli_core-0.4.0/src/dacli/core/datadiff.py +155 -0
  44. dacli_core-0.4.0/src/dacli/core/doctor.py +249 -0
  45. dacli_core-0.4.0/src/dacli/core/export_run.py +133 -0
  46. dacli_core-0.4.0/src/dacli/core/extensions.py +774 -0
  47. dacli_core-0.4.0/src/dacli/core/fastjson.py +46 -0
  48. dacli_core-0.4.0/src/dacli/core/generate.py +616 -0
  49. dacli_core-0.4.0/src/dacli/core/governance_wiring.py +120 -0
  50. dacli_core-0.4.0/src/dacli/core/headless.py +296 -0
  51. dacli_core-0.4.0/src/dacli/core/host.py +431 -0
  52. dacli_core-0.4.0/src/dacli/core/kernel.py +354 -0
  53. dacli_core-0.4.0/src/dacli/core/logging_setup.py +155 -0
  54. dacli_core-0.4.0/src/dacli/core/memory.py +475 -0
  55. dacli_core-0.4.0/src/dacli/core/onboarding.py +90 -0
  56. dacli_core-0.4.0/src/dacli/core/paths.py +300 -0
  57. dacli_core-0.4.0/src/dacli/core/quality.py +312 -0
  58. dacli_core-0.4.0/src/dacli/core/runbooks.py +209 -0
  59. dacli_core-0.4.0/src/dacli/core/runtime.py +37 -0
  60. dacli_core-0.4.0/src/dacli/core/secrets.py +115 -0
  61. dacli_core-0.4.0/src/dacli/core/skills.py +55 -0
  62. dacli_core-0.4.0/src/dacli/core/store.py +304 -0
  63. dacli_core-0.4.0/src/dacli/core/test_mode.py +107 -0
  64. dacli_core-0.4.0/src/dacli/core/timeutils.py +19 -0
  65. dacli_core-0.4.0/src/dacli/core/verify.py +477 -0
  66. dacli_core-0.4.0/src/dacli/core/why_failed.py +345 -0
  67. dacli_core-0.4.0/src/dacli/core/workspaces.py +48 -0
  68. dacli_core-0.4.0/src/dacli/governance/__init__.py +80 -0
  69. dacli_core-0.4.0/src/dacli/governance/audit.py +168 -0
  70. dacli_core-0.4.0/src/dacli/governance/classifier.py +312 -0
  71. dacli_core-0.4.0/src/dacli/governance/command_classifier.py +472 -0
  72. dacli_core-0.4.0/src/dacli/governance/governor.py +737 -0
  73. dacli_core-0.4.0/src/dacli/governance/permissions.py +177 -0
  74. dacli_core-0.4.0/src/dacli/governance/policy_engine.py +203 -0
  75. dacli_core-0.4.0/src/dacli/governance/rollback.py +367 -0
  76. dacli_core-0.4.0/src/dacli/governance/shadow.py +120 -0
  77. dacli_core-0.4.0/src/dacli/governance/vocab.py +88 -0
  78. dacli_core-0.4.0/src/dacli/memory/__init__.py +60 -0
  79. dacli_core-0.4.0/src/dacli/memory/catalog.py +289 -0
  80. dacli_core-0.4.0/src/dacli/memory/episodic.py +71 -0
  81. dacli_core-0.4.0/src/dacli/memory/graph/__init__.py +25 -0
  82. dacli_core-0.4.0/src/dacli/memory/graph/lineage.py +310 -0
  83. dacli_core-0.4.0/src/dacli/memory/priors.py +162 -0
  84. dacli_core-0.4.0/src/dacli/memory/procedural.py +48 -0
  85. dacli_core-0.4.0/src/dacli/memory/retrieval.py +125 -0
  86. dacli_core-0.4.0/src/dacli/memory/semantic.py +45 -0
  87. dacli_core-0.4.0/src/dacli/memory/store.py +251 -0
  88. dacli_core-0.4.0/src/dacli/memory/verify.py +160 -0
  89. dacli_core-0.4.0/src/dacli/prompts/GUIDELINES.md +27 -0
  90. dacli_core-0.4.0/src/dacli/prompts/__init__.py +15 -0
  91. dacli_core-0.4.0/src/dacli/prompts/fragments/core.md +57 -0
  92. dacli_core-0.4.0/src/dacli/prompts/system_prompt.py +112 -0
  93. dacli_core-0.4.0/src/dacli/sandbox/__init__.py +25 -0
  94. dacli_core-0.4.0/src/dacli/sandbox/_worker.py +148 -0
  95. dacli_core-0.4.0/src/dacli/sandbox/bridge.py +106 -0
  96. dacli_core-0.4.0/src/dacli/sandbox/connector.py +121 -0
  97. dacli_core-0.4.0/src/dacli/sandbox/docker/worker.py +184 -0
  98. dacli_core-0.4.0/src/dacli/sandbox/docker_runtime.py +281 -0
  99. dacli_core-0.4.0/src/dacli/sandbox/factory.py +63 -0
  100. dacli_core-0.4.0/src/dacli/sandbox/policy.py +120 -0
  101. dacli_core-0.4.0/src/dacli/sandbox/runtime.py +207 -0
  102. dacli_core-0.4.0/src/dacli/sandbox/sdk.py +182 -0
  103. dacli_core-0.4.0/src/dacli/sandbox/shells/__init__.py +42 -0
  104. dacli_core-0.4.0/src/dacli/sandbox/shells/base.py +159 -0
  105. dacli_core-0.4.0/src/dacli/sandbox/shells/powershell.py +41 -0
  106. dacli_core-0.4.0/src/dacli/sandbox/shells/transports.py +261 -0
  107. dacli_core-0.4.0/src/dacli/sandbox/shells/windows_cmd.py +20 -0
  108. dacli_core-0.4.0/src/dacli/sandbox/shells/wsl.py +22 -0
  109. dacli_core-0.4.0/src/dacli/sandbox/shells/zsh.py +20 -0
  110. dacli_core-0.4.0/src/dacli/sandbox/terminal.py +341 -0
  111. dacli_core-0.4.0/src/dacli/sandbox/workspace.py +124 -0
  112. dacli_core-0.4.0/src/dacli_core.egg-info/PKG-INFO +30 -0
  113. dacli_core-0.4.0/src/dacli_core.egg-info/SOURCES.txt +114 -0
  114. dacli_core-0.4.0/src/dacli_core.egg-info/dependency_links.txt +1 -0
  115. dacli_core-0.4.0/src/dacli_core.egg-info/requires.txt +19 -0
  116. dacli_core-0.4.0/src/dacli_core.egg-info/top_level.txt +1 -0
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: dacli-core
3
+ Version: 0.4.0
4
+ Summary: Headless governed extension host for dacli — runs with no TUI installed
5
+ Author-email: Mouad Jaouhari <github@mj-dev.net>
6
+ Project-URL: Homepage, https://github.com/mouadja02/dacli
7
+ Keywords: agent,governance,extension host,data engineering
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: dacli-ai==0.3.0
11
+ Requires-Dist: pydantic<3,>=2.5
12
+ Requires-Dist: pyyaml<7,>=6
13
+ Requires-Dist: python-dotenv<2,>=1
14
+ Requires-Dist: httpx<1,>=0.27
15
+ Requires-Dist: cryptography<49,>=42
16
+ Requires-Dist: tiktoken<1,>=0.7
17
+ Requires-Dist: rich<16,>=13
18
+ Provides-Extra: pty
19
+ Requires-Dist: pywinpty<3,>=2; sys_platform == "win32" and extra == "pty"
20
+ Requires-Dist: ptyprocess<1,>=0.7; sys_platform != "win32" and extra == "pty"
21
+ Provides-Extra: keyring
22
+ Requires-Dist: keyring<26,>=24; extra == "keyring"
23
+
24
+ # dacli-core
25
+
26
+ The governed extension host: agent loop, extension registry, governance gate,
27
+ secrets, post-condition verify, context economy, dispatcher, and the `~/.dacli/`
28
+ resolver. Runs headless (`--mode json`) with no TUI installed.
29
+
30
+ Part of [dacli](https://github.com/mouadja02/dacli). Depends on `dacli-ai`.
@@ -0,0 +1,7 @@
1
+ # dacli-core
2
+
3
+ The governed extension host: agent loop, extension registry, governance gate,
4
+ secrets, post-condition verify, context economy, dispatcher, and the `~/.dacli/`
5
+ resolver. Runs headless (`--mode json`) with no TUI installed.
6
+
7
+ Part of [dacli](https://github.com/mouadja02/dacli). Depends on `dacli-ai`.
@@ -0,0 +1,53 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "dacli-core"
7
+ dynamic = ["version"]
8
+ description = "Headless governed extension host for dacli — runs with no TUI installed"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ authors = [{ name = "Mouad Jaouhari", email = "github@mj-dev.net" }]
12
+ keywords = ["agent", "governance", "extension host", "data engineering"]
13
+ # The host, kernel, extension registry, governance gate, secrets, verify, context
14
+ # economy, dispatcher, paths resolver, audit ledger. Depends on dacli-ai. Runs
15
+ # headless (--mode json) with dacli-tui NOT installed: rich is here for console
16
+ # output, but the TUI (textual/prompt-toolkit, the dacli-tui wheel) is not pulled.
17
+ dependencies = [
18
+ "dacli-ai==0.3.0",
19
+ "pydantic>=2.5,<3",
20
+ "pyyaml>=6,<7",
21
+ "python-dotenv>=1,<2",
22
+ "httpx>=0.27,<1",
23
+ "cryptography>=42,<49",
24
+ "tiktoken>=0.7,<1",
25
+ "rich>=13,<16",
26
+ ]
27
+
28
+ [project.optional-dependencies]
29
+ # Faithful TTY for the governed terminal. The shell path works over stdlib pipes;
30
+ # install only for ANSI/interactive fidelity. Lazy-imported in sandbox.shells.
31
+ pty = [
32
+ "pywinpty>=2,<3 ; sys_platform == 'win32'",
33
+ "ptyprocess>=0.7,<1 ; sys_platform != 'win32'",
34
+ ]
35
+ # Store the Fernet key in the OS keyring instead of the .key file. Selected with
36
+ # DACLI_KEY_BACKEND=keyring; lazy-imported in core.crypto.
37
+ keyring = ["keyring>=24,<26"]
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/mouadja02/dacli"
41
+
42
+ [tool.setuptools.dynamic]
43
+ version = { attr = "dacli.core.__version__" }
44
+
45
+ [tool.setuptools.packages.find]
46
+ where = ["src"]
47
+ include = ["dacli*"]
48
+ namespaces = true
49
+
50
+ [tool.setuptools.package-data]
51
+ "dacli.prompts" = ["*.md", "fragments/*.md"]
52
+ "dacli.config" = ["*.yaml"]
53
+ "dacli.connectors" = ["templates/*", "**/manifest.yaml", "**/SKILL.md"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,68 @@
1
+ from dacli.config.settings import (
2
+ ConnectorConfig,
3
+ Settings,
4
+ is_llm_configured,
5
+ load_config,
6
+ )
7
+
8
+ CLI_COMMANDS = [
9
+ ("/help", "Show this help message"),
10
+ ("/keys", "Show keyboard shortcuts"),
11
+ ("/init", "Generate a DACLI.md priors draft from your config"),
12
+ ("/status", "Show current progress and state"),
13
+ (
14
+ "/doctor",
15
+ "Diagnose config/state/LLM/connectors (where things resolve, what's live)",
16
+ ),
17
+ ("/usage", "Show token usage and cost (overall, by model, this session)"),
18
+ ("/context", "Explain the assembled context (sources, tokens, budget)"),
19
+ ("/audit", "Show governance decisions for this session (why the agent acted)"),
20
+ ("/why-failed [dag]", "Explain the most recent pipeline failure + a governed fix"),
21
+ ("/tools", "Show enabled tools and capabilities"),
22
+ (
23
+ "/connect [ext]",
24
+ "Configure an extension's credentials — interactive, or pass a name",
25
+ ),
26
+ ("/new-extension", "Generate a new extension from a natural-language description"),
27
+ ("/reload", "Reload extensions from disk without restarting"),
28
+ ("/extensions", "List loaded extensions, status, and config state"),
29
+ (
30
+ "/scope [ext] [level]",
31
+ "View or set permission scope (read_only|write|risky|admin)",
32
+ ),
33
+ ("/creds [ext] [--delete]", "View stored credentials (masked) or delete them"),
34
+ (
35
+ "/workspace [name]",
36
+ "List or switch workspaces (own extensions, secrets, history, audit)",
37
+ ),
38
+ (
39
+ "/testmode [tool]",
40
+ "Toggle staging test mode (health-gated, side-effect-free) for new connectors",
41
+ ),
42
+ ("/setup", "Walk through a first connection (conversational onboarding)"),
43
+ ("/history", "Show conversation history"),
44
+ ("/find <text>", "Search history and tool results for matching turns"),
45
+ ("/last-error", "Re-show the most recent failed tool result"),
46
+ ("/expand <id>", "Re-render a tool result in full from the off-context spill"),
47
+ ("/transcript", "Open the full-screen transcript viewer (needs dacli[tui])"),
48
+ ("/sessions", "List available sessions"),
49
+ ("/catalog [connector]", "List known data objects from the catalog cache"),
50
+ ("/schema <object>", "Show cached columns/row-count for one object"),
51
+ ("/load <id>", "Load a previous session"),
52
+ ("/export", "Export current state to JSON"),
53
+ ("/config", "Show current configuration"),
54
+ ("/theme <name>", "Switch UI theme (dark, light, ocean, mono)"),
55
+ ("/prompt", "View/edit the system prompt"),
56
+ ("/clear", "Clear conversation history"),
57
+ ("/cls", "Clear the screen (keeps conversation history)"),
58
+ ("/reset", "Reset agent state"),
59
+ ("/exit", "Exit the CLI"),
60
+ ]
61
+
62
+ __all__ = [
63
+ "CLI_COMMANDS",
64
+ "ConnectorConfig",
65
+ "Settings",
66
+ "is_llm_configured",
67
+ "load_config",
68
+ ]
@@ -0,0 +1,100 @@
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
+ # --- Era 2: the governed shell tier --------------------------------------
37
+ # The shell tier (run_shell_command) flows through this SAME policy table: the
38
+ # *command* is blast-radius-classified (an `ls` is safe; `rm -rf` / `git push
39
+ # --force` are irreversible and refused for want of a verifiable undo). Its
40
+ # least-privilege ceiling is set by `terminal.scope` in settings (default
41
+ # 'write'), which is authoritative over any `scope:` here. The tiers/
42
+ # environments overrides below still apply — e.g. require approval for every
43
+ # shell write, or auto-run writes on a throwaway box.
44
+ shell:
45
+ tiers: {} # e.g. {write: confirm} to gate even mkdir/touch
46
+ environments: {}
47
+
48
+ # --- Wave 1 platforms ---------------------------------------------
49
+ # All ship read-only (the code default). Widen the grant per deployment:
50
+ # write -> +create/insert/put | risky -> +update/delete | admin -> +drop.
51
+ # A platform left at read_only is strictly observe-only even if the model asks
52
+ # to write — the capability simply isn't there to misuse.
53
+ dbt:
54
+ scope: read_only # widen to `risky` to allow `dbt run` / `dbt build`
55
+ tiers: {}
56
+ environments: {}
57
+ bigquery:
58
+ scope: read_only # native dry_run gives an exact cost/effect preview first
59
+ tiers: {}
60
+ environments: {}
61
+ databricks:
62
+ scope: read_only # Delta time travel backs RESTORE-based rollback
63
+ tiers: {}
64
+ environments: {}
65
+ s3:
66
+ scope: read_only # enable bucket versioning before granting delete (admin)
67
+ tiers: {}
68
+ environments: {}
69
+ gcs:
70
+ scope: read_only # enable object versioning before granting delete (admin)
71
+ tiers: {}
72
+ environments: {}
73
+
74
+ # --- Wave 2 operational databases ---------------------------------
75
+ postgres:
76
+ scope: read_only # fully transactional — BEGIN/ROLLBACK is a true undo
77
+ tiers: {}
78
+ environments: {}
79
+ mysql:
80
+ scope: read_only # DML transactional (InnoDB); DDL needs mysqldump snapshots
81
+ tiers: {}
82
+ environments: {}
83
+ mongodb:
84
+ scope: read_only # no native undo — deletes rely on mongodump copy-aside
85
+ tiers: {}
86
+ environments: {}
87
+ dynamodb:
88
+ scope: read_only # enable PITR before granting destructive ops (admin)
89
+ tiers: {}
90
+ environments: {}
91
+
92
+ # --- Wave 3 orchestration ---------------------------------------------------
93
+ airflow:
94
+ scope: read_only # grant `risky` to trigger/pause; delete is gated hard
95
+ tiers: {}
96
+ environments: {}
97
+ dagster:
98
+ scope: read_only # grant `risky` to launch runs
99
+ tiers: {}
100
+ environments: {}