dacli-core 0.4.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.
- dacli/config/__init__.py +68 -0
- dacli/config/policy.yaml +100 -0
- dacli/config/settings.py +599 -0
- dacli/connectors/__init__.py +17 -0
- dacli/connectors/base.py +196 -0
- dacli/connectors/cli_base.py +174 -0
- dacli/connectors/dispatcher.py +301 -0
- dacli/connectors/dod.py +210 -0
- dacli/connectors/http_base.py +123 -0
- dacli/connectors/registry.py +466 -0
- dacli/connectors/shell/__init__.py +13 -0
- dacli/connectors/shell/connector.py +257 -0
- dacli/connectors/system/__init__.py +3 -0
- dacli/connectors/system/connector.py +692 -0
- dacli/connectors/templates/README.md +25 -0
- dacli/connectors/templates/cli_connector_template.py +77 -0
- dacli/connectors/templates/manifest_template.yaml +25 -0
- dacli/connectors/templates/rest_connector_template.py +124 -0
- dacli/context/__init__.py +16 -0
- dacli/context/assembler.py +322 -0
- dacli/context/budget.py +119 -0
- dacli/context/compaction.py +125 -0
- dacli/context/disclosure.py +101 -0
- dacli/context/pipeline.py +104 -0
- dacli/context/sources/__init__.py +13 -0
- dacli/context/sources/dbt_manifest.py +176 -0
- dacli/context/sources/terminal.py +185 -0
- dacli/context/spill.py +155 -0
- dacli/context/tokenizer.py +136 -0
- dacli/core/__init__.py +38 -0
- dacli/core/atomicio.py +71 -0
- dacli/core/connect_extension.py +201 -0
- dacli/core/connector_config.py +66 -0
- dacli/core/connector_generator.py +585 -0
- dacli/core/connector_index.py +184 -0
- dacli/core/context7.py +100 -0
- dacli/core/cost_advisor.py +196 -0
- dacli/core/crypto.py +323 -0
- dacli/core/datadiff.py +155 -0
- dacli/core/doctor.py +249 -0
- dacli/core/export_run.py +133 -0
- dacli/core/extensions.py +774 -0
- dacli/core/fastjson.py +46 -0
- dacli/core/generate.py +616 -0
- dacli/core/governance_wiring.py +120 -0
- dacli/core/headless.py +296 -0
- dacli/core/host.py +431 -0
- dacli/core/kernel.py +354 -0
- dacli/core/logging_setup.py +155 -0
- dacli/core/memory.py +475 -0
- dacli/core/onboarding.py +90 -0
- dacli/core/paths.py +300 -0
- dacli/core/quality.py +312 -0
- dacli/core/runbooks.py +209 -0
- dacli/core/runtime.py +37 -0
- dacli/core/secrets.py +115 -0
- dacli/core/skills.py +55 -0
- dacli/core/store.py +304 -0
- dacli/core/test_mode.py +107 -0
- dacli/core/timeutils.py +19 -0
- dacli/core/verify.py +477 -0
- dacli/core/why_failed.py +345 -0
- dacli/core/workspaces.py +48 -0
- dacli/governance/__init__.py +80 -0
- dacli/governance/audit.py +168 -0
- dacli/governance/classifier.py +312 -0
- dacli/governance/command_classifier.py +472 -0
- dacli/governance/governor.py +737 -0
- dacli/governance/permissions.py +177 -0
- dacli/governance/policy_engine.py +203 -0
- dacli/governance/rollback.py +367 -0
- dacli/governance/shadow.py +120 -0
- dacli/governance/vocab.py +88 -0
- dacli/memory/__init__.py +60 -0
- dacli/memory/catalog.py +289 -0
- dacli/memory/episodic.py +71 -0
- dacli/memory/graph/__init__.py +25 -0
- dacli/memory/graph/lineage.py +310 -0
- dacli/memory/priors.py +162 -0
- dacli/memory/procedural.py +48 -0
- dacli/memory/retrieval.py +125 -0
- dacli/memory/semantic.py +45 -0
- dacli/memory/store.py +251 -0
- dacli/memory/verify.py +160 -0
- dacli/prompts/GUIDELINES.md +27 -0
- dacli/prompts/__init__.py +15 -0
- dacli/prompts/fragments/core.md +57 -0
- dacli/prompts/system_prompt.py +112 -0
- dacli/sandbox/__init__.py +25 -0
- dacli/sandbox/_worker.py +148 -0
- dacli/sandbox/bridge.py +106 -0
- dacli/sandbox/connector.py +121 -0
- dacli/sandbox/docker/worker.py +184 -0
- dacli/sandbox/docker_runtime.py +281 -0
- dacli/sandbox/factory.py +63 -0
- dacli/sandbox/policy.py +120 -0
- dacli/sandbox/runtime.py +207 -0
- dacli/sandbox/sdk.py +182 -0
- dacli/sandbox/shells/__init__.py +42 -0
- dacli/sandbox/shells/base.py +159 -0
- dacli/sandbox/shells/powershell.py +41 -0
- dacli/sandbox/shells/transports.py +261 -0
- dacli/sandbox/shells/windows_cmd.py +20 -0
- dacli/sandbox/shells/wsl.py +22 -0
- dacli/sandbox/shells/zsh.py +20 -0
- dacli/sandbox/terminal.py +341 -0
- dacli/sandbox/workspace.py +124 -0
- dacli_core-0.4.0.dist-info/METADATA +30 -0
- dacli_core-0.4.0.dist-info/RECORD +111 -0
- dacli_core-0.4.0.dist-info/WHEEL +5 -0
- dacli_core-0.4.0.dist-info/top_level.txt +1 -0
dacli/config/__init__.py
ADDED
|
@@ -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
|
+
]
|
dacli/config/policy.yaml
ADDED
|
@@ -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: {}
|