akernel-runtime 0.1.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 (40) hide show
  1. akernel_runtime-0.1.0.dist-info/METADATA +270 -0
  2. akernel_runtime-0.1.0.dist-info/RECORD +40 -0
  3. akernel_runtime-0.1.0.dist-info/WHEEL +5 -0
  4. akernel_runtime-0.1.0.dist-info/entry_points.txt +2 -0
  5. akernel_runtime-0.1.0.dist-info/licenses/LICENSE +201 -0
  6. akernel_runtime-0.1.0.dist-info/licenses/NOTICE +4 -0
  7. akernel_runtime-0.1.0.dist-info/top_level.txt +1 -0
  8. context_kernel/__init__.py +4 -0
  9. context_kernel/__main__.py +5 -0
  10. context_kernel/agent_reports.py +188 -0
  11. context_kernel/benchmarks.py +493 -0
  12. context_kernel/budget.py +72 -0
  13. context_kernel/cli.py +2953 -0
  14. context_kernel/context.py +161 -0
  15. context_kernel/evals.py +347 -0
  16. context_kernel/global_memory.py +126 -0
  17. context_kernel/loop.py +1617 -0
  18. context_kernel/marketplace.py +194 -0
  19. context_kernel/marketplace_data/skills/context_budget.json +27 -0
  20. context_kernel/marketplace_data/skills/context_compaction.json +27 -0
  21. context_kernel/marketplace_data/skills/edit_file.json +27 -0
  22. context_kernel/marketplace_data/skills/index.json +66 -0
  23. context_kernel/marketplace_data/skills/long_task_planning.json +27 -0
  24. context_kernel/marketplace_data/skills/multi_file_bugfix.json +28 -0
  25. context_kernel/memory.py +515 -0
  26. context_kernel/models.py +144 -0
  27. context_kernel/planner.py +155 -0
  28. context_kernel/policy.py +271 -0
  29. context_kernel/project.py +317 -0
  30. context_kernel/providers.py +1264 -0
  31. context_kernel/report_costs.py +375 -0
  32. context_kernel/runner.py +78 -0
  33. context_kernel/skills.py +318 -0
  34. context_kernel/state_writer.py +108 -0
  35. context_kernel/storage.py +171 -0
  36. context_kernel/tasks.py +549 -0
  37. context_kernel/text.py +42 -0
  38. context_kernel/tokenizer.py +22 -0
  39. context_kernel/tools.py +544 -0
  40. context_kernel/verifier.py +77 -0
@@ -0,0 +1,270 @@
1
+ Metadata-Version: 2.4
2
+ Name: akernel-runtime
3
+ Version: 0.1.0
4
+ Summary: A CLI-first context-native agent runtime prototype.
5
+ Author: Context Kernel contributors
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/huanxin0825-ctrl/context-kernel
8
+ Project-URL: Repository, https://github.com/huanxin0825-ctrl/context-kernel
9
+ Project-URL: Issues, https://github.com/huanxin0825-ctrl/context-kernel/issues
10
+ Project-URL: Changelog, https://github.com/huanxin0825-ctrl/context-kernel/blob/main/CHANGELOG.md
11
+ Keywords: agent,cli,context,llm,token-budget
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ License-File: NOTICE
23
+ Provides-Extra: dev
24
+ Requires-Dist: build>=1.2; extra == "dev"
25
+ Requires-Dist: twine>=5.0; extra == "dev"
26
+ Dynamic: license-file
27
+
28
+ # Context Kernel
29
+
30
+ Context Kernel is a CLI-first agent runtime for reducing prompt bloat, memory drift, and unnecessary token spending.
31
+
32
+ Most agent systems treat the prompt as the runtime. Context Kernel treats the prompt as a small working set assembled from structured state, scoped skill contracts, explicit policy checks, and measurable token budgets.
33
+
34
+ The project is currently an alpha CLI release. It is ready for local experimentation, benchmark-driven iteration, and early contributor feedback.
35
+
36
+ ## Why This Exists
37
+
38
+ Modern agent workflows often become expensive for reasons that are hard to see:
39
+
40
+ - large skill packs are loaded even when a task is simple
41
+ - long conversation history is repeatedly compressed and replayed
42
+ - memory is mixed with chat transcript instead of stored as typed state
43
+ - tool instructions and safety rules are duplicated across every call
44
+ - token regressions are noticed only after costs have already climbed
45
+
46
+ Context Kernel is an experiment in moving those responsibilities into a runtime layer that can be inspected, tested, and improved.
47
+
48
+ ## Core Capabilities
49
+
50
+ - Structured memory: typed records backed by local SQLite and JSONL state.
51
+ - Progressive skill contracts: load only the level of a skill that the task needs.
52
+ - Token budgets: estimate and report context pressure before provider calls.
53
+ - Resumable task planning: keep long work in structured milestones and compact checkpoints instead of replaying chat history.
54
+ - Bounded agent loop: support `read_file`, `write_file`, `patch_file`, `batch_patch`, `run_command`, and `respond` actions.
55
+ - Policy-gated tools: keep file and command execution behind explicit runtime checks.
56
+ - Traceability: write run traces, tool traces, compact agent reports, and token cost reports.
57
+ - Regression gates: compare evals and benchmarks, including behavior and token cost regressions.
58
+ - OpenAI-compatible provider: use project-local `.env` config with any compatible `/v1` endpoint.
59
+
60
+ ## Architecture
61
+
62
+ ```text
63
+ request
64
+ -> router
65
+ -> budgeter
66
+ -> memory retriever
67
+ -> skill contract loader
68
+ -> provider adapter
69
+ -> verifier
70
+ -> state writer
71
+ -> trace and cost reports
72
+ ```
73
+
74
+ The guiding rule is simple: every context inclusion should be explainable before the model runs, and every optimization should have a trace or benchmark behind it.
75
+
76
+ ## Install
77
+
78
+ ### Windows One-Command Setup
79
+
80
+ ```powershell
81
+ git clone <repository-url>
82
+ cd context-kernel
83
+ .\setup.cmd
84
+ akernel setup
85
+ akernel
86
+ ```
87
+
88
+ `setup.cmd` creates `.venv`, installs the local CLI in editable mode, and prepares project-local `.env` if needed. `wake.cmd` activates the environment, loads `.env`, and prints common commands. The `.cmd` wrappers avoid local PowerShell execution-policy friction.
89
+
90
+ `setup.cmd` also installs user-level launchers in `%USERPROFILE%\.context-kernel\bin` and adds that directory to the user PATH. After opening a new terminal, `akernel` works from any directory, starts the interactive agent session by default, and uses that current directory as the workspace location. Environment lookup prefers the current project `.env`, then falls back to the installed Context Kernel project `.env`. `akernel-chat` remains as a compatibility shortcut.
91
+
92
+ ### Manual Python Install
93
+
94
+ ```powershell
95
+ python -m pip install -e .[dev]
96
+ akernel --help
97
+ ```
98
+
99
+ Python 3.10 or newer is required.
100
+
101
+ ### Remote Install
102
+
103
+ After the package is published, users can install from PyPI:
104
+
105
+ ```powershell
106
+ python -m pip install --user akernel-runtime
107
+ akernel setup
108
+ akernel
109
+ ```
110
+
111
+ Windows users can also install directly from GitHub:
112
+
113
+ ```powershell
114
+ irm https://raw.githubusercontent.com/huanxin0825-ctrl/context-kernel/main/scripts/install_remote.ps1 | iex
115
+ akernel setup
116
+ akernel
117
+ ```
118
+
119
+ The npm launcher provides a Node-style entrypoint and can bootstrap the Python package if it is missing:
120
+
121
+ ```powershell
122
+ npm install -g @context-kernel/akernel
123
+ akernel setup
124
+ akernel
125
+ ```
126
+
127
+ Set `AKERNEL_PIP_SOURCE=git+https://github.com/huanxin0825-ctrl/context-kernel.git` to make the npm launcher bootstrap from GitHub before the PyPI package is available.
128
+
129
+ ## Quick Start
130
+
131
+ ```powershell
132
+ akernel setup
133
+ akernel init . --scan
134
+ akernel
135
+ akernel --ui tui
136
+ akernel --provider mock
137
+ ```
138
+
139
+ Inside the interactive session, type a task and press Enter. Bare `akernel` accepts chat flags such as `--provider mock`, `--model`, `--aux-model`, `--max-steps`, and `--ui tui` without requiring the explicit `chat` subcommand. `--ui auto` uses the full-screen terminal UI on real terminals and falls back to classic output for CI, pipes, and tests. `akernel init . --scan` or `akernel project scan` writes a compact `.akernel/project.json` profile with detected languages, package managers, key files, project instruction files such as `AGENTS.md`, and test/build commands; this profile enters future context packets without loading the whole repository. If you ask to `run tests` or `verify` without naming a command, the agent prefers the scanned project test command. If you ask it to fix failing tests, the agent can run that profile test command, inspect one or more failing files from the command output, apply a bounded patch or rollback-safe batch patch when the failure is simple enough, and rerun verification. Use `/status` for the live workspace view, `/model` for primary and auxiliary model roles, `/cost` for the last run's token report, `/task` to inspect the current task session, and `/exit` to leave. The shell UI renders a cockpit-style dashboard with a status header, command strip, transcript, mission panel, model stack, workspace summary, task progress, run timeline, diagnostics, and assistant responses. In `--model-routing auto` mode, low/medium first-step planning can run on the auxiliary model while high-risk, deep, warning-heavy, or synthesis steps stay on the primary model. In `--aux-review auto` mode, auxiliary review runs before primary-model steps and is included in token cost reports.
140
+
141
+ If you want to prepare the benchmark workspace manually:
142
+
143
+ ```powershell
144
+ akernel --workspace .sandbox skill register examples\skills\edit_file.json
145
+ akernel --workspace .sandbox skill register examples\skills\context_budget.json
146
+ akernel --workspace .sandbox memory add --kind preference --text "Prefer CLI-first context budget prototypes." --tags cli
147
+ akernel --workspace .sandbox plan "Plan a CLI context budget prototype"
148
+ ```
149
+
150
+ Run the benchmark suite and gate it against the latest matching baseline:
151
+
152
+ ```powershell
153
+ akernel --workspace .sandbox bench run examples\benchmarks\phase2
154
+ akernel --workspace .sandbox bench gate examples\benchmarks\phase2 --require-baseline
155
+ akernel --workspace .sandbox bench run examples\benchmarks\scale
156
+ akernel --workspace .sandbox bench evidence --limit 3 --fail-under 30 --output .sandbox\benchmark-evidence.md
157
+ ```
158
+
159
+ `bench gate` requires the current benchmark checks to pass, then compares behavior and token cost against a saved baseline.
160
+ `bench evidence` turns saved benchmark reports into a Markdown proof page with total kernel tokens, baseline tokens, token savings, pass rate, strongest savings, and weakest savings.
161
+ The current deterministic scale snapshot is documented in [Benchmark Evidence](docs/10-benchmark-evidence.md).
162
+
163
+ ## OpenAI-Compatible Provider
164
+
165
+ Provider configuration is project-local. Copy `.env.example` to `.env` or use `setup.cmd -ForceEnv`.
166
+
167
+ ```env
168
+ CONTEXT_KERNEL_OPENAI_API_KEY=replace-with-your-key
169
+ CONTEXT_KERNEL_OPENAI_BASE_URL=https://clarmy.cloud/v1
170
+ CONTEXT_KERNEL_OPENAI_MODEL=gpt-5.5
171
+ CONTEXT_KERNEL_OPENAI_AUX_MODEL=gpt-5.3-codex
172
+ ```
173
+
174
+ Useful checks:
175
+
176
+ ```powershell
177
+ akernel doctor
178
+ akernel models --provider openai
179
+ akernel --workspace .sandbox run "Reply with exactly OK." --provider openai --model gpt-5.5 --profile lean
180
+ akernel --workspace .sandbox run "Reply with exactly OK." --provider openai --model gpt-5.3-codex --profile lean
181
+ ```
182
+
183
+ The base URL should include `/v1`.
184
+
185
+ ## CLI Highlights
186
+
187
+ ```powershell
188
+ akernel
189
+ akernel --workspace .sandbox chat
190
+ akernel context "Continue this task" --task <task-id> --resume
191
+ akernel task start "Ship a complex feature" --goal "Plan, implement, verify, and document the feature" --plan
192
+ akernel task next <task-id>
193
+ akernel task checkpoint <task-id> --milestone M1 --status completed --note "Investigation complete"
194
+ akernel project scan
195
+ akernel project show
196
+ akernel memory audit
197
+ akernel memory prune --max-records 100 --dry-run
198
+ akernel memory global-push
199
+ akernel memory global-pull --limit 20
200
+ akernel memory global-push --namespace team-runtime --tag shared --dry-run
201
+ akernel memory global-pull --namespace team-runtime --source-project my-project --dry-run
202
+ akernel skill market-list
203
+ akernel skill market-list --index examples\marketplace\skills\index.json
204
+ akernel skill market-install multi_file_bugfix
205
+ akernel skill market-install remote_skill --index https://example.com/context-kernel/skills/index.json --trust-remote
206
+ akernel compare "Summarize the project goal"
207
+ akernel eval run examples\evals\phase2.json
208
+ akernel eval cost <report-id>
209
+ akernel eval diff <before-id> <after-id> --fail-on-regression
210
+ akernel bench cost <report-id>
211
+ akernel bench diff <before-id> <after-id> --fail-on-regression
212
+ akernel bench evidence --limit 3 --fail-under 30 --output benchmark-evidence.md
213
+ akernel agent run "Patch notes/plan.txt and run tests" --provider openai --max-steps 4
214
+ akernel agent cost <agent-run-id>
215
+ ```
216
+
217
+ Inside `akernel`, type a natural-language task and press Enter. Use `/cost` for the last run's token report, `/task` to inspect the current task session, and `/exit` to leave.
218
+
219
+ When an agent run cannot continue, the CLI prints a compact diagnostic with a category, reason, and suggested next step. Common categories include provider configuration, provider auth/network/protocol errors, context budget blocks, policy blocks, command failures, malformed provider actions, and loop guards.
220
+
221
+ See [docs/03-cli-mvp.md](docs/03-cli-mvp.md) for the full command surface.
222
+
223
+ ## Development
224
+
225
+ ```powershell
226
+ python -m pip install -e .[dev]
227
+ python -m unittest discover -s tests -p test_runtime.py
228
+ python -m build
229
+ ```
230
+
231
+ The repository CI runs unit tests, package build checks, CLI smoke tests, benchmark regression gates, and the Windows setup/wake flow. See [docs/07-release-and-ci.md](docs/07-release-and-ci.md).
232
+
233
+ ## Documentation
234
+
235
+ - [Vision](docs/00-vision.md)
236
+ - [Architecture](docs/01-architecture.md)
237
+ - [Execution Plan](docs/02-execution-plan.md)
238
+ - [CLI MVP](docs/03-cli-mvp.md)
239
+ - [Evaluation Strategy](docs/04-evaluation.md)
240
+ - [Local Wake Workflow](docs/05-local-wake.md)
241
+ - [Skill Compiler](docs/06-skill-compiler.md)
242
+ - [Release And CI](docs/07-release-and-ci.md)
243
+ - [Open Source Plan](docs/08-open-source-plan.md)
244
+ - [Product Roadmap](docs/09-product-roadmap.md)
245
+ - [Benchmark Evidence](docs/10-benchmark-evidence.md)
246
+ - [Publishing Setup](docs/11-publishing-setup.md)
247
+
248
+ ## Project Status
249
+
250
+ Context Kernel is alpha software. The CLI is functional, tested, and benchmarked locally, but the public API and file formats may still change as the runtime model matures.
251
+
252
+ Good first contribution areas:
253
+
254
+ - new eval fixtures for real coding and research workflows
255
+ - better routing and scoring strategies
256
+ - richer token cost visualization
257
+ - provider adapters for more OpenAI-compatible endpoints
258
+ - documentation improvements from fresh-user setup attempts
259
+
260
+ ## Contributing
261
+
262
+ Contributions are welcome. Start with [CONTRIBUTING.md](CONTRIBUTING.md), keep changes small and benchmarkable, and include tests for behavior that affects routing, budgeting, policy, tools, or reports.
263
+
264
+ ## Security
265
+
266
+ Do not commit `.env`, API keys, provider responses containing secrets, or local `.akernel` state. See [SECURITY.md](SECURITY.md) for reporting guidance.
267
+
268
+ ## License
269
+
270
+ Apache License 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,40 @@
1
+ akernel_runtime-0.1.0.dist-info/licenses/LICENSE,sha256=KDlSlGMvKNmPNJD-Rt74OysvbaG4yj5GEpgFHUwFy3M,10255
2
+ akernel_runtime-0.1.0.dist-info/licenses/NOTICE,sha256=TTRI2NleMXZkYkY7-3Rw7w6cTYil0t06pnRZc2sHcPk,123
3
+ context_kernel/__init__.py,sha256=Fgo4ycNpd0ERP_dgK46VQS4No-dcwpPjQzIewtG1BQ4,80
4
+ context_kernel/__main__.py,sha256=GfB949F2WmgD1DMqseZzRjgSNvd2n0dkDnOEmSI5R5A,62
5
+ context_kernel/agent_reports.py,sha256=759w1L3D6Ut0mLX1MK4lg5XAQyltycSXj9El6fb-fws,7661
6
+ context_kernel/benchmarks.py,sha256=7YO7oNIGyjGGzaJU2v0isvEDR46T1QGVPzr4oMelfV8,21215
7
+ context_kernel/budget.py,sha256=hguDlJ5whPJBxlbwWYW4lhilO-1p9Ny5qkGHEyEqt68,2064
8
+ context_kernel/cli.py,sha256=E7wjD_Ps1hsZC7ROk_gCE6FXHbq_8OAMl-KdaFWxyV4,127893
9
+ context_kernel/context.py,sha256=Up-xJBGYSrhl4-620vThk5JUobTfsultCQkQ7sT0vOQ,6483
10
+ context_kernel/evals.py,sha256=cc1wro3DKSvArNFh7F23SOmHYoC40v5I93vb_4lq99o,13655
11
+ context_kernel/global_memory.py,sha256=aHhZn5yAus7pgI_500YxBAohlDqB3vRnCON6poGYTxk,3941
12
+ context_kernel/loop.py,sha256=RTwbsGf0IwW8XeY1HDCzm5Zav5_qLmTQeFYcJq-9lYI,65313
13
+ context_kernel/marketplace.py,sha256=TbH0qckz_nJwpCxKX6FubF8p2O-LOI18B6r7zfQ4t4Q,7552
14
+ context_kernel/memory.py,sha256=iBGjaqTQqAuJ7-WS7DmfetykMdzrmd9zSCdaE2QDCps,18871
15
+ context_kernel/models.py,sha256=l95aOs9Btq-qNom7Ugn87IWfkZDodQ4A9wqbcuv-lJ0,4307
16
+ context_kernel/planner.py,sha256=taTFTbR-2deM6NGUkv_hznNJpat2YPXSsk4Jc9PB0wA,4783
17
+ context_kernel/policy.py,sha256=m3asXFsT-m8aD4HFqlVtlIWAI4Ac_U4RBFH75OxJhaw,8923
18
+ context_kernel/project.py,sha256=_ahjfopOjBjljKo4RpiuUQmOIdPaeB-ug7VTi4a27JI,11313
19
+ context_kernel/providers.py,sha256=kcfc0chiVKnRW_VDjTpSSJkZRwKRbELE0Vu3dc9vhHg,50512
20
+ context_kernel/report_costs.py,sha256=7A5sh81jis8F0gwAFe8QqYLjRz-pnCY05Haq_VN9ZEA,15256
21
+ context_kernel/runner.py,sha256=Axgm4uy_bur55VzgfiHDbWsjiNFkcKQBOozCzMerJHo,2836
22
+ context_kernel/skills.py,sha256=tcFvE-hpDzTQAl_bTLV70tfY3YzvTs90FzpEWZdZATU,10799
23
+ context_kernel/state_writer.py,sha256=sEeHINdYXDcx8T83TAe3BovI2stRqwnVS2vWTFyZldg,3565
24
+ context_kernel/storage.py,sha256=fkYNiTXw5CpNSQUUUKWlgLeUn33FVMrciikpsjF2d7o,6104
25
+ context_kernel/tasks.py,sha256=KRHORS4yWjr_Fg9GNCHJjPLpAcdulFAOnZGBt7XLoHQ,21426
26
+ context_kernel/text.py,sha256=8C8-hI33IKBVUwpQJWxwwq9VY_b3GpkcdgX4kNkhBGw,704
27
+ context_kernel/tokenizer.py,sha256=dARle2Po95aDHxUMIzU8YAimlaguZbNHIC1KaydHPp0,635
28
+ context_kernel/tools.py,sha256=gNIkcNSgHSnaRXDsxV650Px10aGDHBNhtXDg2qeWkoY,20543
29
+ context_kernel/verifier.py,sha256=ca-wrmpOkxlJ-MfzgkVVF14ZFeNQ39SwfK8FmYHJyUI,2878
30
+ context_kernel/marketplace_data/skills/context_budget.json,sha256=nJ0YpycvpfyeaDQ0omXYAPkXUHBPsa4DvZjcvK_1KEY,986
31
+ context_kernel/marketplace_data/skills/context_compaction.json,sha256=WJWWZRRsirIynMovYcqBydQJ5k59puAsfM1h2UleTSc,1213
32
+ context_kernel/marketplace_data/skills/edit_file.json,sha256=AN1OYO6_lO1j0BKlAEa-P0Kuup7s1DnOKelT0EYKhqE,890
33
+ context_kernel/marketplace_data/skills/index.json,sha256=4ZUiNKMfqTmQRrpof-oLLO10kHXm2ohSTc_q4A_LcVw,1870
34
+ context_kernel/marketplace_data/skills/long_task_planning.json,sha256=EAZ4Kstctq8ozgJouxWSy_BzUyn0BdhbK22zI0ZrP2k,1148
35
+ context_kernel/marketplace_data/skills/multi_file_bugfix.json,sha256=57Q6v4JHxKVBq9J-EzEzwVHxgVafwNaisimLMLBlWx8,1315
36
+ akernel_runtime-0.1.0.dist-info/METADATA,sha256=XdQjVxeiGAF1brIWEna6na89mF6paadcHGJ8gbbKWj4,12831
37
+ akernel_runtime-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
38
+ akernel_runtime-0.1.0.dist-info/entry_points.txt,sha256=Oa21kq-EWO5Fo1noZWJXntxsb8fg2CnGMk35OaAQ2Fs,52
39
+ akernel_runtime-0.1.0.dist-info/top_level.txt,sha256=kKZWcLvUFY0O5Otxmxj3zhmtmc5sAKxiv6K2eqej36g,15
40
+ akernel_runtime-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ akernel = context_kernel.cli:main
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ https://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. Do not include
183
+ the brackets. The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Context Kernel contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ https://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,4 @@
1
+ Context Kernel
2
+ Copyright 2026 Context Kernel contributors
3
+
4
+ This product is licensed under the Apache License, Version 2.0.
@@ -0,0 +1 @@
1
+ context_kernel
@@ -0,0 +1,4 @@
1
+ """Context Kernel CLI-first agent runtime prototype."""
2
+
3
+ __version__ = "0.1.0"
4
+
@@ -0,0 +1,5 @@
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ main()
5
+