usedryft 0.1.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 (70) hide show
  1. usedryft-0.1.0/LICENSE +202 -0
  2. usedryft-0.1.0/PKG-INFO +88 -0
  3. usedryft-0.1.0/README.md +74 -0
  4. usedryft-0.1.0/pyproject.toml +31 -0
  5. usedryft-0.1.0/setup.cfg +4 -0
  6. usedryft-0.1.0/src/dryft/__init__.py +3 -0
  7. usedryft-0.1.0/src/dryft/__main__.py +3 -0
  8. usedryft-0.1.0/src/dryft/agents.py +167 -0
  9. usedryft-0.1.0/src/dryft/bootstrap.py +360 -0
  10. usedryft-0.1.0/src/dryft/brain.py +298 -0
  11. usedryft-0.1.0/src/dryft/capabilities.py +273 -0
  12. usedryft-0.1.0/src/dryft/capture.py +78 -0
  13. usedryft-0.1.0/src/dryft/cli.py +269 -0
  14. usedryft-0.1.0/src/dryft/constitution.py +153 -0
  15. usedryft-0.1.0/src/dryft/history.py +147 -0
  16. usedryft-0.1.0/src/dryft/hosts.py +71 -0
  17. usedryft-0.1.0/src/dryft/marketplace.py +360 -0
  18. usedryft-0.1.0/src/dryft/projects.py +152 -0
  19. usedryft-0.1.0/src/dryft/resources/docs/README.md +46 -0
  20. usedryft-0.1.0/src/dryft/resources/docs/agent-bootstrap.md +114 -0
  21. usedryft-0.1.0/src/dryft/resources/docs/authoring.md +109 -0
  22. usedryft-0.1.0/src/dryft/resources/docs/brain.md +129 -0
  23. usedryft-0.1.0/src/dryft/resources/docs/commands.md +49 -0
  24. usedryft-0.1.0/src/dryft/resources/docs/constitution.md +73 -0
  25. usedryft-0.1.0/src/dryft/resources/docs/core-skills.md +17 -0
  26. usedryft-0.1.0/src/dryft/resources/docs/getting-started.md +134 -0
  27. usedryft-0.1.0/src/dryft/resources/docs/projects.md +55 -0
  28. usedryft-0.1.0/src/dryft/resources/docs/skills.md +187 -0
  29. usedryft-0.1.0/src/dryft/resources/docs/stacks.md +217 -0
  30. usedryft-0.1.0/src/dryft/resources/docs/troubleshooting.md +60 -0
  31. usedryft-0.1.0/src/dryft/resources/docs/ui.md +103 -0
  32. usedryft-0.1.0/src/dryft/resources/docs/workspace-care.md +64 -0
  33. usedryft-0.1.0/src/dryft/resources/harness/context.md +48 -0
  34. usedryft-0.1.0/src/dryft/resources/harness/contracts/capture-event.md +38 -0
  35. usedryft-0.1.0/src/dryft/resources/harness/contracts/stack.md +234 -0
  36. usedryft-0.1.0/src/dryft/resources/harness/contracts/ui.md +122 -0
  37. usedryft-0.1.0/src/dryft/resources/harness/hooks/capture.py +6 -0
  38. usedryft-0.1.0/src/dryft/resources/harness/hooks/constitution.py +6 -0
  39. usedryft-0.1.0/src/dryft/resources/harness/hooks/session-start.py +6 -0
  40. usedryft-0.1.0/src/dryft/resources/harness/skills/dryft-add-project/SKILL.md +32 -0
  41. usedryft-0.1.0/src/dryft/resources/harness/skills/dryft-constitution/SKILL.md +60 -0
  42. usedryft-0.1.0/src/dryft/resources/harness/skills/dryft-find-skills/SKILL.md +39 -0
  43. usedryft-0.1.0/src/dryft/resources/harness/skills/dryft-install-stack/SKILL.md +63 -0
  44. usedryft-0.1.0/src/dryft/resources/harness/skills/dryft-remove-stack/SKILL.md +23 -0
  45. usedryft-0.1.0/src/dryft/resources/harness/skills/dryft-review-brain/SKILL.md +27 -0
  46. usedryft-0.1.0/src/dryft/resources/harness/skills/dryft-search/SKILL.md +27 -0
  47. usedryft-0.1.0/src/dryft/resources/harness/skills/dryft-ui/SKILL.md +54 -0
  48. usedryft-0.1.0/src/dryft/resources/harness/skills/dryft-update-stack/SKILL.md +37 -0
  49. usedryft-0.1.0/src/dryft/resources/harness/skills/dryft-workspace/SKILL.md +20 -0
  50. usedryft-0.1.0/src/dryft/resources/marketplace/registry.schema.json +579 -0
  51. usedryft-0.1.0/src/dryft/resources/ui/bridge.js +3 -0
  52. usedryft-0.1.0/src/dryft/resources/ui/icon.png +0 -0
  53. usedryft-0.1.0/src/dryft/resources/ui/shell.html +1 -0
  54. usedryft-0.1.0/src/dryft/resources/ui/shell.js +161 -0
  55. usedryft-0.1.0/src/dryft/resources/ui/tokens.css +26 -0
  56. usedryft-0.1.0/src/dryft/resources/ui/wordmark.svg +13 -0
  57. usedryft-0.1.0/src/dryft/resources/workspace/README.md +30 -0
  58. usedryft-0.1.0/src/dryft/resources/workspace/index.md +12 -0
  59. usedryft-0.1.0/src/dryft/skills.py +279 -0
  60. usedryft-0.1.0/src/dryft/stack_docs.py +97 -0
  61. usedryft-0.1.0/src/dryft/stack_updates.py +108 -0
  62. usedryft-0.1.0/src/dryft/stacks.py +440 -0
  63. usedryft-0.1.0/src/dryft/ui.py +473 -0
  64. usedryft-0.1.0/src/dryft/ui_resources.py +40 -0
  65. usedryft-0.1.0/src/dryft/workspace.py +214 -0
  66. usedryft-0.1.0/src/usedryft.egg-info/PKG-INFO +88 -0
  67. usedryft-0.1.0/src/usedryft.egg-info/SOURCES.txt +68 -0
  68. usedryft-0.1.0/src/usedryft.egg-info/dependency_links.txt +1 -0
  69. usedryft-0.1.0/src/usedryft.egg-info/entry_points.txt +2 -0
  70. usedryft-0.1.0/src/usedryft.egg-info/top_level.txt +1 -0
usedryft-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 1one8 (Pty) Ltd
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,88 @@
1
+ Metadata-Version: 2.4
2
+ Name: usedryft
3
+ Version: 0.1.0
4
+ Summary: A local knowledge workspace with optional stacks
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://usedryft.com
7
+ Project-URL: Documentation, https://usedryft.com/docs
8
+ Project-URL: Repository, https://github.com/1one8/dryft
9
+ Project-URL: Issues, https://github.com/1one8/dryft/issues
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Dynamic: license-file
14
+
15
+ ![Dryft — Agentic Workspace](https://raw.githubusercontent.com/1one8/dryft/HEAD/docs/assets/banner.png)
16
+
17
+ # Dryft
18
+
19
+ A local workspace for Claude Code and Codex, with a knowledge brain that grows
20
+ with your work and stacks that extend what your agents can do.
21
+
22
+ > [!NOTE]
23
+ > **Version 0.1.0** has only been tested on Linux. Windows and macOS testing is
24
+ > underway. You're welcome to try installing it on either platform and report
25
+ > what works or any issues you encounter through [GitHub Issues](https://github.com/1one8/dryft/issues).
26
+
27
+ ## Make your workspace your own
28
+
29
+ | Feature | What you can do |
30
+ | --- | --- |
31
+ | **Build your brain** | Keep useful facts and decisions as linked Markdown notes. Choose what to remember through review. |
32
+ | **Find answers with sources** | Ask your brain questions and get references to approved knowledge. |
33
+ | **Give your agents rules** | Set working preferences and boundaries with a workspace Constitution. |
34
+ | **Use DUI (Dryft UI)** | Say “use dui” to answer questions and work through choices in a local browser. |
35
+ | **Bring your projects** | Link existing project folders and get oriented without moving their source. |
36
+ | **Extend with Stacks** | Add skills, workflows and capabilities when you need them. |
37
+
38
+ ## Install and create a workspace
39
+
40
+ You need Python 3.11+ and pipx. Install Claude Code or Codex separately if you
41
+ want an agent integration.
42
+
43
+ The commands below describe the planned public installation. PyPI publication
44
+ and installation from the public registry are still awaiting release verification.
45
+
46
+ Ask your agent:
47
+
48
+ > Install and set up Dryft via pipx, create a workspace at [my chosen directory],
49
+ > and check it.
50
+
51
+ Replace the bracketed directory with your preferred location. Setup has no
52
+ Dryft skill before installation. Open the created workspace in your agent,
53
+ review its workspace and hook trust prompts, and use `/dryft-workspace` in
54
+ Claude or `$dryft-workspace` in Codex, or select it from the skill picker.
55
+
56
+ For terminal setup, run these examples from a parent directory outside your
57
+ projects and the Dryft source checkout. Paths are relative to that directory.
58
+
59
+ ```sh
60
+ pipx install usedryft
61
+ dryft init "./my workspace"
62
+ dryft --workspace "./my workspace" doctor
63
+ ```
64
+
65
+ You can also `cd` into your chosen folder and run `dryft init` without a path
66
+ to initialize the current directory, then run `dryft doctor`.
67
+
68
+ Choose a workspace folder outside your existing projects. If pipx asks you to
69
+ update PATH, follow its instructions and reopen your shell. Dryft starts with
70
+ zero stacks and detects Claude and Codex on PATH. Add `--agent claude`,
71
+ `--agent codex`, `--agent both` or `--agent none` to `init` to choose explicitly.
72
+ Existing unrelated files are preserved; conflicting files are refused.
73
+
74
+ Read the [usage guides](https://usedryft.com/docs), or open the local guides in
75
+ your workspace's `docs/` folder.
76
+
77
+ ---
78
+
79
+ ## Developing Dryft
80
+
81
+ Working on Dryft itself? Start with the [developer documentation](https://github.com/1one8/dryft/blob/HEAD/docs/README.md)
82
+ for setup, architecture and development practices. Open this source checkout in
83
+ your agent and say **“onboard me”** for guided development setup.
84
+
85
+ [Development setup](https://github.com/1one8/dryft/blob/HEAD/docs/development.md) · [Architecture](https://github.com/1one8/dryft/blob/HEAD/docs/architecture.md) ·
86
+ [Making a change](https://github.com/1one8/dryft/blob/HEAD/docs/contributing.md)
87
+
88
+ Licensed under [Apache-2.0](https://github.com/1one8/dryft/blob/HEAD/LICENSE).
@@ -0,0 +1,74 @@
1
+ ![Dryft — Agentic Workspace](https://raw.githubusercontent.com/1one8/dryft/HEAD/docs/assets/banner.png)
2
+
3
+ # Dryft
4
+
5
+ A local workspace for Claude Code and Codex, with a knowledge brain that grows
6
+ with your work and stacks that extend what your agents can do.
7
+
8
+ > [!NOTE]
9
+ > **Version 0.1.0** has only been tested on Linux. Windows and macOS testing is
10
+ > underway. You're welcome to try installing it on either platform and report
11
+ > what works or any issues you encounter through [GitHub Issues](https://github.com/1one8/dryft/issues).
12
+
13
+ ## Make your workspace your own
14
+
15
+ | Feature | What you can do |
16
+ | --- | --- |
17
+ | **Build your brain** | Keep useful facts and decisions as linked Markdown notes. Choose what to remember through review. |
18
+ | **Find answers with sources** | Ask your brain questions and get references to approved knowledge. |
19
+ | **Give your agents rules** | Set working preferences and boundaries with a workspace Constitution. |
20
+ | **Use DUI (Dryft UI)** | Say “use dui” to answer questions and work through choices in a local browser. |
21
+ | **Bring your projects** | Link existing project folders and get oriented without moving their source. |
22
+ | **Extend with Stacks** | Add skills, workflows and capabilities when you need them. |
23
+
24
+ ## Install and create a workspace
25
+
26
+ You need Python 3.11+ and pipx. Install Claude Code or Codex separately if you
27
+ want an agent integration.
28
+
29
+ The commands below describe the planned public installation. PyPI publication
30
+ and installation from the public registry are still awaiting release verification.
31
+
32
+ Ask your agent:
33
+
34
+ > Install and set up Dryft via pipx, create a workspace at [my chosen directory],
35
+ > and check it.
36
+
37
+ Replace the bracketed directory with your preferred location. Setup has no
38
+ Dryft skill before installation. Open the created workspace in your agent,
39
+ review its workspace and hook trust prompts, and use `/dryft-workspace` in
40
+ Claude or `$dryft-workspace` in Codex, or select it from the skill picker.
41
+
42
+ For terminal setup, run these examples from a parent directory outside your
43
+ projects and the Dryft source checkout. Paths are relative to that directory.
44
+
45
+ ```sh
46
+ pipx install usedryft
47
+ dryft init "./my workspace"
48
+ dryft --workspace "./my workspace" doctor
49
+ ```
50
+
51
+ You can also `cd` into your chosen folder and run `dryft init` without a path
52
+ to initialize the current directory, then run `dryft doctor`.
53
+
54
+ Choose a workspace folder outside your existing projects. If pipx asks you to
55
+ update PATH, follow its instructions and reopen your shell. Dryft starts with
56
+ zero stacks and detects Claude and Codex on PATH. Add `--agent claude`,
57
+ `--agent codex`, `--agent both` or `--agent none` to `init` to choose explicitly.
58
+ Existing unrelated files are preserved; conflicting files are refused.
59
+
60
+ Read the [usage guides](https://usedryft.com/docs), or open the local guides in
61
+ your workspace's `docs/` folder.
62
+
63
+ ---
64
+
65
+ ## Developing Dryft
66
+
67
+ Working on Dryft itself? Start with the [developer documentation](https://github.com/1one8/dryft/blob/HEAD/docs/README.md)
68
+ for setup, architecture and development practices. Open this source checkout in
69
+ your agent and say **“onboard me”** for guided development setup.
70
+
71
+ [Development setup](https://github.com/1one8/dryft/blob/HEAD/docs/development.md) · [Architecture](https://github.com/1one8/dryft/blob/HEAD/docs/architecture.md) ·
72
+ [Making a change](https://github.com/1one8/dryft/blob/HEAD/docs/contributing.md)
73
+
74
+ Licensed under [Apache-2.0](https://github.com/1one8/dryft/blob/HEAD/LICENSE).
@@ -0,0 +1,31 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0.3"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "usedryft"
7
+ version = "0.1.0"
8
+ description = "A local knowledge workspace with optional stacks"
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.11"
13
+ dependencies = []
14
+
15
+ [project.urls]
16
+ Homepage = "https://usedryft.com"
17
+ Documentation = "https://usedryft.com/docs"
18
+ Repository = "https://github.com/1one8/dryft"
19
+ Issues = "https://github.com/1one8/dryft/issues"
20
+
21
+ [project.scripts]
22
+ dryft = "dryft.cli:main"
23
+
24
+ [tool.setuptools.packages.find]
25
+ where = ["src"]
26
+ include = ["dryft*"]
27
+
28
+ [tool.setuptools.package-data]
29
+ dryft = ["resources/workspace/*.md", "resources/docs/*.md", "resources/harness/*.md",
30
+ "resources/harness/hooks/*.py", "resources/harness/contracts/*.md",
31
+ "resources/harness/skills/*/SKILL.md", "resources/ui/*", "resources/marketplace/*.json"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """Dryft's agent-neutral workspace core."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())
@@ -0,0 +1,167 @@
1
+ """Workspace-local host selection and owner-preserving skill enablement."""
2
+ import shutil
3
+ from pathlib import Path
4
+
5
+ from .workspace import WorkspaceError, read_config, managed_path
6
+ from .bootstrap import PROVIDERS, digest, encode, existing_text, load_manifest
7
+
8
+
9
+ def detected():
10
+ """Only executable discovery; never launch a host or inspect global settings."""
11
+ return [host for host in PROVIDERS if shutil.which(host)]
12
+
13
+
14
+ def enabled(root, config=None):
15
+ config = read_config(root) if config is None else config
16
+ selected = config.get('enabled_agents')
17
+ if selected is not None:
18
+ if (not isinstance(selected, list) or any(not isinstance(h, str) or h not in PROVIDERS for h in selected)
19
+ or len(set(selected)) != len(selected)):
20
+ raise WorkspaceError('Invalid enabled_agents in workspace config')
21
+ return selected
22
+ # Legacy consent comes only from ownership records, never from host folders.
23
+ from . import stacks, skills
24
+ manifest = load_manifest(root)
25
+ records = [manifest['files'], *(e['files'] for e in stacks.registry(root)),
26
+ *skills.state(root)['skills'].values()]
27
+ return [host for host, (instruction, folder, settings) in PROVIDERS.items()
28
+ if host in config['adapters'] or instruction in manifest['instructions']
29
+ or settings in manifest['hooks']
30
+ or any(any(p.startswith(folder + '/') for p in record) for record in records)]
31
+
32
+
33
+ def folders(root):
34
+ return ['.dryft/skills', *(PROVIDERS[h][1] for h in enabled(root))]
35
+
36
+
37
+ def plan_skills(root, hosts):
38
+ """Add bridges to each original owner's record; preflight before any write."""
39
+ from . import stacks, skills
40
+ skills.ready(root)
41
+ entries = stacks.available(root)
42
+ users = skills.state(root)
43
+ changes = {}
44
+
45
+ def add(name, record, content):
46
+ for host in hosts:
47
+ target = f'{PROVIDERS[host][1]}/{name}/SKILL.md'
48
+ if host == 'claude' and managed_path(root, f'.claude/commands/{name}.md').exists():
49
+ raise WorkspaceError(f'Claude command collision: {name}')
50
+ if target in record:
51
+ continue
52
+ if managed_path(root, str(Path(target).parent)).exists():
53
+ raise WorkspaceError(f'Skill directory collision: {target}')
54
+ if target in changes:
55
+ raise WorkspaceError(f'Duplicate skill ownership: {name}')
56
+ changes[target] = content
57
+ record[target] = digest(content)
58
+
59
+ for entry in entries:
60
+ stacks.check_owned(root, entry)
61
+ for relative in entry['manifest']['skills']:
62
+ name = relative.split('/')[1]
63
+ add(name, entry['files'], stacks.bridge(name))
64
+ for name, record in users['skills'].items():
65
+ for path, expected in record.items():
66
+ current = existing_text(root, path)
67
+ if current is None or digest(current) != expected:
68
+ raise WorkspaceError(f'Owned skill file edited or missing: {path}')
69
+ # Preserve the approved description exactly, including older serialized YAML.
70
+ canonical = existing_text(root, f'.dryft/skills/{name}/SKILL.md')
71
+ if canonical is None or '\n---\n' not in canonical[4:]:
72
+ raise WorkspaceError(f'Missing user skill front matter: {name}')
73
+ head = canonical[:canonical.index('\n---\n', 4) + 5]
74
+ add(name, record, head + '\n' +
75
+ f'Read and follow .dryft/skills/{name}/SKILL.md from the workspace root.\n')
76
+ if entries:
77
+ changes[stacks.REGISTRY] = encode(entries)
78
+ if users['skills']:
79
+ changes[skills.STATE] = encode(users)
80
+ return changes
81
+
82
+
83
+ def enable(root, host):
84
+ from .workspace import initialize
85
+ initialize(root, host)
86
+ return f'Enabled {host} for all owned workspace skills. Start a new host session and review project trust and /hooks.'
87
+
88
+
89
+ def disable(root, host):
90
+ """Remove only recorded host integrations, preserving canonical resources."""
91
+ from . import stacks, skills
92
+ from .brain import locked
93
+ from .bootstrap import BEGIN, END, MANIFEST, parse_settings
94
+ from .workspace import read_json
95
+ if host not in PROVIDERS:
96
+ raise WorkspaceError('Unknown agent selection')
97
+ with locked(root):
98
+ skills.ready(root)
99
+ entries = stacks.available(root)
100
+ users = skills.state(root)
101
+ config = read_config(root)
102
+ selected = enabled(root, config)
103
+ if host not in selected:
104
+ return f'{host.capitalize()} integration already disabled.'
105
+ state = load_manifest(root)
106
+ instruction, folder, settings = PROVIDERS[host]
107
+ changes = {}
108
+ records = [state['files'], *(e['files'] for e in entries), *users['skills'].values()]
109
+ for record in records:
110
+ for path, expected in list(record.items()):
111
+ if not path.startswith(folder + '/'):
112
+ continue
113
+ current = existing_text(root, path)
114
+ if current is None or digest(current) != expected:
115
+ raise WorkspaceError(f'Owned agent bridge edited or missing: {path}')
116
+ if path in changes:
117
+ raise WorkspaceError(f'Duplicate agent bridge ownership: {path}')
118
+ changes[path] = None
119
+ del record[path]
120
+ previous = state['instructions'].get(instruction)
121
+ if previous is not None:
122
+ current = existing_text(root, instruction)
123
+ if (not isinstance(previous, str) or current is None
124
+ or current.count(BEGIN) != 1 or current.count(END) != 1
125
+ or previous not in current):
126
+ raise WorkspaceError(f'Owned instruction block changed or missing: {instruction}')
127
+ remaining = current.replace(previous, '', 1)
128
+ changes[instruction] = remaining if remaining.strip() else None
129
+ del state['instructions'][instruction]
130
+ hook_records = (('SessionStart', 'hooks'), ('Stop', 'capture_hooks'),
131
+ ('UserPromptSubmit', 'policy_hooks'))
132
+ if any(settings in state[key] for _, key in hook_records):
133
+ raw = existing_text(root, settings)
134
+ data = parse_settings(raw) if raw is not None else None
135
+ if not isinstance(data, dict) or not isinstance(data.get('hooks'), dict):
136
+ raise WorkspaceError(f'Owned hook settings missing or invalid: {settings}')
137
+ for event, key in hook_records:
138
+ previous = state[key].get(settings)
139
+ if previous is None:
140
+ continue
141
+ values = data['hooks'].get(event)
142
+ if not isinstance(values, list) or values.count(previous) != 1:
143
+ raise WorkspaceError(f'Owned {event} hook changed, duplicated or missing: {settings}')
144
+ values.remove(previous)
145
+ if not values:
146
+ del data['hooks'][event]
147
+ del state[key][settings]
148
+ if not data['hooks']:
149
+ del data['hooks']
150
+ # Settings have entry ownership, never whole-file ownership.
151
+ changes[settings] = encode(data)
152
+ config['enabled_agents'] = [h for h in selected if h != host]
153
+ config['adapters'].pop(host, None)
154
+ owned = read_json(root, '.dryft/state/owned-files.json')
155
+ if not isinstance(owned, list) or any(not isinstance(p, str) for p in owned):
156
+ raise WorkspaceError('Invalid owned-files list')
157
+ changes[MANIFEST] = encode(state)
158
+ changes['.dryft/config.json'] = encode(config)
159
+ changes['.dryft/state/owned-files.json'] = encode(sorted(set(owned) -
160
+ {p for p, value in changes.items() if value is None}))
161
+ if entries:
162
+ changes[stacks.REGISTRY] = encode(entries)
163
+ if users['skills']:
164
+ changes[skills.STATE] = encode(users)
165
+ stacks.transaction(root, changes)
166
+ stacks.prune(root, [p for p, value in changes.items() if value is None])
167
+ return f'Disabled {host} workspace integration. Start a new host session; canonical skills and brain are preserved.'