ko-tasks-sdk 1.0.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 (175) hide show
  1. ko_tasks_sdk-1.0.0.dist-info/METADATA +164 -0
  2. ko_tasks_sdk-1.0.0.dist-info/RECORD +175 -0
  3. ko_tasks_sdk-1.0.0.dist-info/WHEEL +4 -0
  4. ko_tasks_sdk-1.0.0.dist-info/entry_points.txt +3 -0
  5. komus_tasks/__init__.py +16 -0
  6. komus_tasks/agent/__init__.py +20 -0
  7. komus_tasks/agent/__main__.py +114 -0
  8. komus_tasks/agent/client.py +385 -0
  9. komus_tasks/agent/provisioner.py +261 -0
  10. komus_tasks/cli/__init__.py +14 -0
  11. komus_tasks/cli/__main__.py +5 -0
  12. komus_tasks/cli/ai/__init__.py +0 -0
  13. komus_tasks/cli/ai/llm.py +268 -0
  14. komus_tasks/cli/ai/prompts/system_prompt.md +20 -0
  15. komus_tasks/cli/app.py +143 -0
  16. komus_tasks/cli/commands/__init__.py +70 -0
  17. komus_tasks/cli/commands/activate.py +63 -0
  18. komus_tasks/cli/commands/agents.py +114 -0
  19. komus_tasks/cli/commands/artifacts.py +201 -0
  20. komus_tasks/cli/commands/completion.py +40 -0
  21. komus_tasks/cli/commands/config.py +193 -0
  22. komus_tasks/cli/commands/config_remote.py +215 -0
  23. komus_tasks/cli/commands/credentials.py +224 -0
  24. komus_tasks/cli/commands/deactivate.py +55 -0
  25. komus_tasks/cli/commands/delete.py +57 -0
  26. komus_tasks/cli/commands/deploy.py +135 -0
  27. komus_tasks/cli/commands/download.py +55 -0
  28. komus_tasks/cli/commands/environments.py +333 -0
  29. komus_tasks/cli/commands/files.py +89 -0
  30. komus_tasks/cli/commands/generate.py +557 -0
  31. komus_tasks/cli/commands/init.py +98 -0
  32. komus_tasks/cli/commands/list.py +42 -0
  33. komus_tasks/cli/commands/local.py +78 -0
  34. komus_tasks/cli/commands/logs.py +81 -0
  35. komus_tasks/cli/commands/long_running.py +114 -0
  36. komus_tasks/cli/commands/package.py +42 -0
  37. komus_tasks/cli/commands/profile.py +78 -0
  38. komus_tasks/cli/commands/promote.py +50 -0
  39. komus_tasks/cli/commands/rollback.py +46 -0
  40. komus_tasks/cli/commands/run.py +231 -0
  41. komus_tasks/cli/commands/schedules.py +271 -0
  42. komus_tasks/cli/commands/schema_cmd.py +30 -0
  43. komus_tasks/cli/commands/skills.py +288 -0
  44. komus_tasks/cli/commands/status.py +50 -0
  45. komus_tasks/cli/commands/threads.py +221 -0
  46. komus_tasks/cli/commands/webhooks.py +399 -0
  47. komus_tasks/cli/permissions/agents.md +19 -0
  48. komus_tasks/cli/permissions/claude.md +31 -0
  49. komus_tasks/cli/permissions/codex.md +22 -0
  50. komus_tasks/cli/permissions/cursor.md +16 -0
  51. komus_tasks/cli/runtime/__init__.py +1 -0
  52. komus_tasks/cli/runtime/context.py +102 -0
  53. komus_tasks/cli/runtime/discovery.py +54 -0
  54. komus_tasks/cli/runtime/errors.py +55 -0
  55. komus_tasks/cli/runtime/http.py +200 -0
  56. komus_tasks/cli/runtime/inputs.py +51 -0
  57. komus_tasks/cli/runtime/metadata.py +124 -0
  58. komus_tasks/cli/runtime/output.py +106 -0
  59. komus_tasks/cli/runtime/profile.py +189 -0
  60. komus_tasks/cli/runtime/remote.py +61 -0
  61. komus_tasks/cli/runtime/resolver.py +82 -0
  62. komus_tasks/cli/runtime/tty.py +31 -0
  63. komus_tasks/cli/runtime/validation.py +479 -0
  64. komus_tasks/cli/scaffolding/__init__.py +1 -0
  65. komus_tasks/cli/scaffolding/gitignore.py +45 -0
  66. komus_tasks/cli/scaffolding/node.py +150 -0
  67. komus_tasks/cli/scaffolding/python.py +214 -0
  68. komus_tasks/cli/schema.py +52 -0
  69. komus_tasks/cli/schemas/__init__.py +1 -0
  70. komus_tasks/cli/schemas/activate.py +11 -0
  71. komus_tasks/cli/schemas/agents.py +40 -0
  72. komus_tasks/cli/schemas/artifact.py +41 -0
  73. komus_tasks/cli/schemas/common.py +13 -0
  74. komus_tasks/cli/schemas/config.py +17 -0
  75. komus_tasks/cli/schemas/config_remote.py +19 -0
  76. komus_tasks/cli/schemas/credentials.py +30 -0
  77. komus_tasks/cli/schemas/deploy.py +16 -0
  78. komus_tasks/cli/schemas/environments.py +43 -0
  79. komus_tasks/cli/schemas/files.py +26 -0
  80. komus_tasks/cli/schemas/generate.py +42 -0
  81. komus_tasks/cli/schemas/init.py +10 -0
  82. komus_tasks/cli/schemas/local_result.py +14 -0
  83. komus_tasks/cli/schemas/log_event.py +15 -0
  84. komus_tasks/cli/schemas/long_running.py +28 -0
  85. komus_tasks/cli/schemas/package.py +8 -0
  86. komus_tasks/cli/schemas/page.py +23 -0
  87. komus_tasks/cli/schemas/profile.py +11 -0
  88. komus_tasks/cli/schemas/promote.py +11 -0
  89. komus_tasks/cli/schemas/run.py +9 -0
  90. komus_tasks/cli/schemas/schedule.py +47 -0
  91. komus_tasks/cli/schemas/skills.py +27 -0
  92. komus_tasks/cli/schemas/status.py +47 -0
  93. komus_tasks/cli/schemas/task_list.py +12 -0
  94. komus_tasks/cli/schemas/tasks_admin.py +20 -0
  95. komus_tasks/cli/schemas/webhooks.py +50 -0
  96. komus_tasks/cli/ui/__init__.py +1 -0
  97. komus_tasks/cli/ui/prompts.py +153 -0
  98. komus_tasks/cli/ui/theme.py +31 -0
  99. komus_tasks/cli/ui/widgets.py +40 -0
  100. komus_tasks/cli/ui/writer.py +68 -0
  101. komus_tasks/cli/ui_commands/__init__.py +1 -0
  102. komus_tasks/cli/ui_commands/dashboard.py +578 -0
  103. komus_tasks/cli/ui_commands/generate.py +153 -0
  104. komus_tasks/cli/ui_commands/monitor.py +170 -0
  105. komus_tasks/context.py +409 -0
  106. komus_tasks/decorators.py +136 -0
  107. komus_tasks/errors.py +74 -0
  108. komus_tasks/exceptions.py +20 -0
  109. komus_tasks/logging.py +196 -0
  110. komus_tasks/models/__init__.py +64 -0
  111. komus_tasks/models/artifact.py +106 -0
  112. komus_tasks/models/artifact_download_response.py +13 -0
  113. komus_tasks/models/artifact_list_response.py +16 -0
  114. komus_tasks/models/artifact_query_filters.py +18 -0
  115. komus_tasks/models/artifact_schema.py +198 -0
  116. komus_tasks/models/credential.py +141 -0
  117. komus_tasks/models/environment.py +230 -0
  118. komus_tasks/models/file_upload.py +56 -0
  119. komus_tasks/models/log_models.py +213 -0
  120. komus_tasks/models/pagination.py +22 -0
  121. komus_tasks/models/schedule.py +252 -0
  122. komus_tasks/models/settings.py +80 -0
  123. komus_tasks/models/task_definition.py +216 -0
  124. komus_tasks/models/thread.py +107 -0
  125. komus_tasks/models/thread_create_request.py +65 -0
  126. komus_tasks/models/thread_error.py +16 -0
  127. komus_tasks/models/thread_list_response.py +21 -0
  128. komus_tasks/models/thread_query_filters.py +83 -0
  129. komus_tasks/models/thread_retry_request.py +12 -0
  130. komus_tasks/models/webhook.py +287 -0
  131. komus_tasks/models/webhook_scoping.py +39 -0
  132. komus_tasks/observability.py +110 -0
  133. komus_tasks/observability_otlp.py +10 -0
  134. komus_tasks/protocols/__init__.py +19 -0
  135. komus_tasks/protocols/artifact_publisher.py +58 -0
  136. komus_tasks/protocols/log_configurator.py +56 -0
  137. komus_tasks/skills/manage-komus-server/SKILL.md +146 -0
  138. komus_tasks/skills/manage-komus-server/references/commands.md +121 -0
  139. komus_tasks/skills/manage-komus-server/references/permissions/agents.md +27 -0
  140. komus_tasks/skills/manage-komus-server/references/permissions/claude.md +16 -0
  141. komus_tasks/skills/manage-komus-server/references/permissions/codex.md +30 -0
  142. komus_tasks/skills/manage-komus-server/references/permissions/cursor.md +26 -0
  143. komus_tasks/skills/manage-komus-server/references/workflows.md +210 -0
  144. komus_tasks/skills/write-komus-task/SKILL.md +94 -0
  145. komus_tasks/skills/write-komus-task/references/configuration.md +39 -0
  146. komus_tasks/skills/write-komus-task/references/example-node/input.json +1 -0
  147. komus_tasks/skills/write-komus-task/references/example-node/task.ts +62 -0
  148. komus_tasks/skills/write-komus-task/references/example-node/task.yaml +20 -0
  149. komus_tasks/skills/write-komus-task/references/example-python/input.json +1 -0
  150. komus_tasks/skills/write-komus-task/references/example-python/task.py +57 -0
  151. komus_tasks/skills/write-komus-task/references/example-python/task.yaml +20 -0
  152. komus_tasks/skills/write-komus-task/references/inputs-and-outputs.md +47 -0
  153. komus_tasks/skills/write-komus-task/references/long-running.md +38 -0
  154. komus_tasks/skills/write-komus-task/references/packaging.md +52 -0
  155. komus_tasks/skills/write-komus-task/references/spans.md +56 -0
  156. komus_tasks/skills/write-komus-task/references/task-contract.md +263 -0
  157. komus_tasks/testing/__init__.py +21 -0
  158. komus_tasks/testing/local_context.py +205 -0
  159. komus_tasks/testing/local_runner.py +436 -0
  160. komus_tasks/testing/run_result.py +58 -0
  161. komus_tasks/thread_state.py +17 -0
  162. komus_tasks/utils/__init__.py +2 -0
  163. komus_tasks/utils/artifact_validation.py +157 -0
  164. komus_tasks/utils/id_generator.py +66 -0
  165. komus_tasks/utils/ref_filtering.py +34 -0
  166. komus_tasks/utils/sha256.py +55 -0
  167. komus_tasks/utils/task_packaging.py +909 -0
  168. komus_tasks/version.py +52 -0
  169. komus_tasks/worker/__init__.py +8 -0
  170. komus_tasks/worker/__main__.py +49 -0
  171. komus_tasks/worker/context.py +247 -0
  172. komus_tasks/worker/node-runner.js +542 -0
  173. komus_tasks/worker/protocol.py +269 -0
  174. komus_tasks/worker/runner.py +689 -0
  175. komus_tasks/worker/worker-context.js +152 -0
@@ -0,0 +1,164 @@
1
+ Metadata-Version: 2.5
2
+ Name: ko-tasks-sdk
3
+ Version: 1.0.0
4
+ Summary: Python SDK for Komus Tasks — define, test, and deploy task workflows
5
+ Project-URL: Documentation, https://github.com/Komus-ai/ko-tasks-platform#readme
6
+ Project-URL: Repository, https://github.com/Komus-ai/ko-tasks-platform
7
+ Project-URL: Issues, https://github.com/Komus-ai/ko-tasks-platform/issues
8
+ Project-URL: Changelog, https://github.com/Komus-ai/ko-tasks-platform/blob/main/CHANGELOG.md
9
+ Author-email: "Komus.ai" <codir@komus.ai>
10
+ License: MIT
11
+ Keywords: async,automation,framework,sdk,task,workflow
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Classifier: Topic :: System :: Distributed Computing
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.13
22
+ Requires-Dist: aiofiles>=24.1.0
23
+ Requires-Dist: click>=8.1.0
24
+ Requires-Dist: httpx>=0.27.0
25
+ Requires-Dist: inquirerpy>=0.3.4
26
+ Requires-Dist: ko-observability<0.3,>=0.2.0
27
+ Requires-Dist: opentelemetry-api>=1.27.0
28
+ Requires-Dist: opentelemetry-sdk>=1.27.0
29
+ Requires-Dist: pydantic>=2.10.0
30
+ Requires-Dist: pyyaml>=6.0.3
31
+ Requires-Dist: rich>=14.0.0
32
+ Requires-Dist: structlog>=24.4.0
33
+ Provides-Extra: agent
34
+ Requires-Dist: websockets>=12; extra == 'agent'
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
37
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
38
+ Requires-Dist: pytest>=8.3.0; extra == 'dev'
39
+ Requires-Dist: ruff>=0.8.0; extra == 'dev'
40
+ Description-Content-Type: text/markdown
41
+
42
+ # Komus Tasks SDK (Python)
43
+
44
+ Python SDK for building, testing, and deploying tasks with the Komus Tasks.
45
+
46
+ ## Installation
47
+
48
+ First public PyPI release: **1.0.0** (`ko-tasks` CLI and bundled agent skills).
49
+
50
+ ```bash
51
+ pip install ko-tasks-sdk
52
+ ```
53
+
54
+ ## Quick Start
55
+
56
+ ### 1. Create a new task
57
+
58
+ ```bash
59
+ ko-tasks init my-task --runtime python
60
+ cd my-task
61
+ ```
62
+
63
+ ### 2. Edit `task.py`
64
+
65
+ ```python
66
+ async def run(context):
67
+ context.report_progress(0.0, "Starting...")
68
+
69
+ inputs = context.get_inputs()
70
+ # ... your logic ...
71
+
72
+ context.report_progress(1.0, "Done")
73
+ return [{"kind": "text", "text": "Result"}]
74
+ ```
75
+
76
+ ### 3. Run locally
77
+
78
+ ```bash
79
+ ko-tasks run
80
+ ```
81
+
82
+ ### 4. Deploy
83
+
84
+ ```bash
85
+ ko-tasks deploy --server https://tasks.example.com --admin-key YOUR_ADMIN_KEY
86
+ ```
87
+
88
+ ## CLI Commands
89
+
90
+ | Command | Description |
91
+ |---------|-------------|
92
+ | `ko-tasks init <name>` | Scaffold a new task project |
93
+ | `ko-tasks run` | Start a local dev server |
94
+ | `ko-tasks package --task-dir . -o task.zip` | Package task for deployment |
95
+ | `ko-tasks deploy -s URL --admin-key KEY` | Deploy to remote server |
96
+ | `ko-tasks status <thread_id> -s URL --api-key KEY` | Check thread status |
97
+ | `ko-tasks list -s URL --admin-key KEY` | List deployed tasks |
98
+
99
+ ## TaskContext API
100
+
101
+ The `context` object passed to your task function provides:
102
+
103
+ ### Inputs & Outputs
104
+ - `context.get_inputs()` — Returns list of input artifacts
105
+ - Return a list of output artifacts from your function
106
+
107
+ ### Progress Reporting
108
+ - `context.report_progress(fraction, message)` — Report progress (0.0 to 1.0)
109
+
110
+ ### Cooperative Control
111
+ - `context.check_pause()` — Blocks if task is paused, raises if cancelled
112
+ - `context.is_paused()` — Returns True if pause requested
113
+ - `context.is_cancelled()` — Returns True if cancellation requested
114
+
115
+ ### Artifacts
116
+ - `context.store_artifact(data, filename, media_type)` — Store output artifact
117
+ - `context.get_artifact(artifact_id)` — Retrieve an artifact
118
+
119
+ ### Configuration
120
+ - `context.get_config(key)` — Get a configuration/credential value
121
+
122
+ ## Task Definition (task.yaml)
123
+
124
+ ```yaml
125
+ name: my-task
126
+ version: 1.0.0
127
+ description: "What the task does"
128
+ entry_point: task:run
129
+ runtime: python # python | node
130
+
131
+ input_schemas:
132
+ - ref: input_data
133
+ kind: text
134
+ required: true
135
+ description: "Input description"
136
+
137
+ output_schemas:
138
+ - kind: file
139
+ media_type: application/pdf
140
+ description: "Output description"
141
+
142
+ requirements:
143
+ - name: API_KEY
144
+ required: true
145
+ description: "External API key"
146
+ ```
147
+
148
+ ## Development
149
+
150
+ ```bash
151
+ # Clone the monorepo
152
+ git clone https://github.com/Komus-ai/ko-tasks-platform.git
153
+ cd ko-tasks-platform
154
+
155
+ # Install in development mode
156
+ uv sync
157
+
158
+ # Run SDK tests
159
+ uv run --package ko-tasks-sdk pytest packages/sdk-python/tests/ -v
160
+ ```
161
+
162
+ ## License
163
+
164
+ MIT
@@ -0,0 +1,175 @@
1
+ komus_tasks/__init__.py,sha256=nVJ4KQHjFNLskPYURDEMizJjWKpbyBlcT_zy-TAC754,468
2
+ komus_tasks/context.py,sha256=AGF2NnDMaRsEDCkyFJj651ZIXemJoZdv8khFiEnCwYI,15909
3
+ komus_tasks/decorators.py,sha256=JZy7FtzN1wLFwoadb4OLCE8zNOAO_vjAG2jETx9c528,4394
4
+ komus_tasks/errors.py,sha256=ao23zUruWHsq2LYQm5oUcY-9bAKk_Ou5J3uFC7-jVjk,2365
5
+ komus_tasks/exceptions.py,sha256=qVQO9oSNoLqYG_98jIykYKlnMWlP_P0nYFTRdqXG2xQ,355
6
+ komus_tasks/logging.py,sha256=jOZqBMTRyOCIX0hq9lts9GJTWWHngiB-GSwOXWIJ7Cw,7904
7
+ komus_tasks/observability.py,sha256=psUa-WSmlGxrIBaLylABYf6C74bNu_KlcnFfYt0EMxg,3408
8
+ komus_tasks/observability_otlp.py,sha256=jW47LLK1uqlneO40ATLv4bi9MjLQqvy36Xd5vNMh21A,320
9
+ komus_tasks/thread_state.py,sha256=lvoFWz4tvAsZMXh8yURpaI7N-0ZkANEt6F9qQQaA_OM,358
10
+ komus_tasks/version.py,sha256=OXvkvoaJ4cWvUDpWGguabuiNCbMao7L5e2RRTen_Dzw,1308
11
+ komus_tasks/agent/__init__.py,sha256=sCwg9HeQPpLTQz_leLhkP9TA8BvFVB_7KE91vRWUReg,979
12
+ komus_tasks/agent/__main__.py,sha256=lAmzNsmigdC4tdJO1VoE-9WBjjxxGfPvAo4aureH9O4,3493
13
+ komus_tasks/agent/client.py,sha256=qbTSkeEoXVUdpkORzS_lYExfdLVeGqlhlevgp3vtO5M,16122
14
+ komus_tasks/agent/provisioner.py,sha256=hV4M3lyeddfqqToAeuTRCUzirdiCCZJZC40_QtC-GA8,9286
15
+ komus_tasks/cli/__init__.py,sha256=t0aIoPI0cX9auV9pcmz-sbjdb3NlgVjzSM-x0DnJmZg,318
16
+ komus_tasks/cli/__main__.py,sha256=MUXIBgZ0mD7nNsmDrTj-Sv02mZ9qcTQnKwgwEd1sMgk,113
17
+ komus_tasks/cli/app.py,sha256=qvUkgvifScfKi3xaBvmZH157rtCsWBP0dPTRApXS3xE,4944
18
+ komus_tasks/cli/schema.py,sha256=VDRv0MhC4um07TuioD0d618PwAIMCRpFq17mMPyQs0k,1853
19
+ komus_tasks/cli/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
+ komus_tasks/cli/ai/llm.py,sha256=ylKI9UGFdizT1IU9rcQ0p0_LorUTdD-Hom1rUoXX85w,8635
21
+ komus_tasks/cli/ai/prompts/system_prompt.md,sha256=HpAPd-id1XaM2WG_CpGhHXEBy96bbMbu4vo1bjJKmn4,1503
22
+ komus_tasks/cli/commands/__init__.py,sha256=T_lLMCQAwgYrcFUGZYzZkzgv-_6x6E5xsapze882NzU,1229
23
+ komus_tasks/cli/commands/activate.py,sha256=ZQAUmHNAKi4GG0TaM-u99rldM9R9uMcEDMnHNtP4rns,2273
24
+ komus_tasks/cli/commands/agents.py,sha256=yWOWBW66tTQRjmq6pARbADfEJJ_-eGLNAgkCmE_WIVg,3566
25
+ komus_tasks/cli/commands/artifacts.py,sha256=ov1gEUaXlIoExOl59Nm4YPnpJvCmlAGGE96Rsb_eGiY,8002
26
+ komus_tasks/cli/commands/completion.py,sha256=7PjmHwtfYjWw9Mu0Ds5akb6_e9442mLBJlKMdH8q1gA,1194
27
+ komus_tasks/cli/commands/config.py,sha256=XfDAa80D_RbZZp66h-muXgMwJUynLLGWqCKzeebzhh0,6429
28
+ komus_tasks/cli/commands/config_remote.py,sha256=aEbv8evwTm3hmePnSVSuEpOZLCf582NrFeZrJt0uT4s,7538
29
+ komus_tasks/cli/commands/credentials.py,sha256=8UtylbnizFFGlg2OXE7U3Wv7KN3E7VY0qeq0bqimEMs,7206
30
+ komus_tasks/cli/commands/deactivate.py,sha256=2LpZh_SRgvvS866I6hjQUNM14BSHCMBS9-6GdZx_uis,1819
31
+ komus_tasks/cli/commands/delete.py,sha256=i-YdhLPBWC9l-MiLNFaMybUgRNn0b1kxL5c-4V7tHTI,1882
32
+ komus_tasks/cli/commands/deploy.py,sha256=toYSIl4kBFYHm4BvsX5lTKslZ4OlszES5DVXfUp0_Vg,5038
33
+ komus_tasks/cli/commands/download.py,sha256=3tOSqoRPKIKkEHuyjiBGcF6B07wGY3_wYnp5ofNLG8A,2006
34
+ komus_tasks/cli/commands/environments.py,sha256=A2OZRNJuzlvfYBViuzULBT1BdeRl_VAvxcuWcQk1L1g,11118
35
+ komus_tasks/cli/commands/files.py,sha256=U_HmD7rmTVCZelDs9x0P6ypOF3EEdtAhKlzeCmdkbp8,3743
36
+ komus_tasks/cli/commands/generate.py,sha256=8A_f5fjDvaAyiX0wP3GEndnzbyYZTXlJb9UR9C9NSZ8,21343
37
+ komus_tasks/cli/commands/init.py,sha256=hIDEaCK0Dqp_gZEBlhjeRuuxrAH3LqKdg6LgpMJcNA8,3649
38
+ komus_tasks/cli/commands/list.py,sha256=4RxqECDAa_fvXnIvnrAxQqDF-eJ_fe_MiTF483coteY,1637
39
+ komus_tasks/cli/commands/local.py,sha256=thE9lm_84BQJlPLGY6z1Jkaa-BSLO2g9kqyy13CSdIQ,2853
40
+ komus_tasks/cli/commands/logs.py,sha256=nQwvUW3uzpz47cv7PPFBZctmoNmR-d3P8T656XDdM2o,2834
41
+ komus_tasks/cli/commands/long_running.py,sha256=tRfaFEX6xjnmPNOmHB6_3z5bpLok7Cb0lyb3kT1tjU0,3592
42
+ komus_tasks/cli/commands/package.py,sha256=hFuDJjqZej9iwwb6FXgMe_YoyRu7H3AqFmW3rUkcwFQ,1524
43
+ komus_tasks/cli/commands/profile.py,sha256=Vj1QcZ0QcFFGtaD5UYAC3JOyFtejfkzRnQ1gffF-rd8,2564
44
+ komus_tasks/cli/commands/promote.py,sha256=vgm0CJ_UwYLK-pAjVmz1SpMd_BkdTKfZymHTSwkGU-Y,2216
45
+ komus_tasks/cli/commands/rollback.py,sha256=M3dug6oe_Pdr08CuwLBxh31sT4f8cPlWFwXj9RSt9zc,1756
46
+ komus_tasks/cli/commands/run.py,sha256=xc0TLeN_pjyu1l7RxJt8KUM776VWeAYHDorB0BFhMS4,8307
47
+ komus_tasks/cli/commands/schedules.py,sha256=-oRvtXGCCaAf0WVHPIqHBCctoULM9SrnhGXKZMFO58I,10518
48
+ komus_tasks/cli/commands/schema_cmd.py,sha256=LQ-rAHmyhxqa_GLkEGSVUUvtA1gttzZjaSCe4Bl3iz4,841
49
+ komus_tasks/cli/commands/skills.py,sha256=iAAyfNyVk_I95MxL0if_4Xa3PzeRvDoJ3_I4WBawylg,10166
50
+ komus_tasks/cli/commands/status.py,sha256=S2wpWqKY7rKn6zH21IbYlGbtGqnLU0zsrq_eug1Ual0,1500
51
+ komus_tasks/cli/commands/threads.py,sha256=-PF-sKhbMTcnuvOaosgnD6PMIIMQTKFhfO1u_GTmg88,8458
52
+ komus_tasks/cli/commands/webhooks.py,sha256=p_yiUdvfkNlwz1SGlcQWp49ouL6WepVHnkadL5CQlPE,12964
53
+ komus_tasks/cli/permissions/agents.md,sha256=CMT6R1fZjqXQ8m0902GJAtMPxw_z05J-0vOXID3-H6s,837
54
+ komus_tasks/cli/permissions/claude.md,sha256=EBL2OdD3diSTTIZg0wOtrTeW49gUz2-0NVOzFwvFzpc,1138
55
+ komus_tasks/cli/permissions/codex.md,sha256=MQywokQ7Lz0KqtWpJN5QO_qlsr0L8y27vnX7Gr6p4os,914
56
+ komus_tasks/cli/permissions/cursor.md,sha256=23xbVImLmB7SO30LOX3xPWjbkmEQ0u-UnIT0Xmheg2A,836
57
+ komus_tasks/cli/runtime/__init__.py,sha256=DTRbwb2o1gpjUL-LW5Ob_T7og9ZoioJB84b9NdlSuf8,69
58
+ komus_tasks/cli/runtime/context.py,sha256=h0HQjskNURL65BIXCFN-E5lujjsV1OK_8fmYqSYWIHQ,3108
59
+ komus_tasks/cli/runtime/discovery.py,sha256=MEdZOuppMKGX0pJL4x4DruIfcNxJoE9JfzZMDV0tB-U,1710
60
+ komus_tasks/cli/runtime/errors.py,sha256=hL53JprTBxwSlqQub39YoGI6O3Gv-d6nkRREK7am5lM,1504
61
+ komus_tasks/cli/runtime/http.py,sha256=SB7zgn5WQXsU8dTpvYYVIvfeoJdkSWEXt0Jfx_BDsec,8081
62
+ komus_tasks/cli/runtime/inputs.py,sha256=ZRACtU3pWw9JkGN40hr2k2w61CYiNdaxZeWyaBbXQNc,1864
63
+ komus_tasks/cli/runtime/metadata.py,sha256=8n0FqPXk74TZeiasowsLsRY6ACVc13OSL_0UNq2UECk,4041
64
+ komus_tasks/cli/runtime/output.py,sha256=-ceToKhE6u3OkKR2qNoUSfJ4Hfvhrf8bcWW2AXgb1ko,3437
65
+ komus_tasks/cli/runtime/profile.py,sha256=DVWWVC_m3JODiWyt_DKitCvI3i9PGKtG22pxzMZ45-U,5682
66
+ komus_tasks/cli/runtime/remote.py,sha256=2E3bveVcXzDbh1SgwfUaBk-inoTqAV_UkNaaRmd2Jr8,2178
67
+ komus_tasks/cli/runtime/resolver.py,sha256=RaJpyCsWn9XEZpIGp0bplpQRjxGI9EHhmveSL8PB_9k,2777
68
+ komus_tasks/cli/runtime/tty.py,sha256=ZNinUZOpctSoJnSfeAZUBKJQpk0aKJCSMB52Nc8knx4,893
69
+ komus_tasks/cli/runtime/validation.py,sha256=T1RaJHVIidmO4ye9PEFAQvZghGlVBD1H8F1yhzqnTog,16649
70
+ komus_tasks/cli/scaffolding/__init__.py,sha256=LIYnvR0pmeOcnYWPtV3NyucIUUSpt2zCnltPOwHr8NI,49
71
+ komus_tasks/cli/scaffolding/gitignore.py,sha256=hVCydYLjUF6FHBwL-bLGzJkAhftmokayCkYmzr2wrDs,765
72
+ komus_tasks/cli/scaffolding/node.py,sha256=Z1Q83vzx_jaPzMhUbvlk2cNny-ssSE14LMIsQ-ztYYA,4598
73
+ komus_tasks/cli/scaffolding/python.py,sha256=rjFkfhoax6aBixHP6ds2G6VTJeWJeaaUhKUG2p2hCeM,7106
74
+ komus_tasks/cli/schemas/__init__.py,sha256=AVGoU2s4wo_TmGNr_yIuKzgWKKeKukfE3tHKFiEPxGE,77
75
+ komus_tasks/cli/schemas/activate.py,sha256=qJykTRy4_YWSB9LggiWU56zIf_XermyNKBcD9rls-7Q,268
76
+ komus_tasks/cli/schemas/agents.py,sha256=dm2wHQLE-w3de5y5Nvei6d9E-DXvs-1ABXh6xj_b61Y,957
77
+ komus_tasks/cli/schemas/artifact.py,sha256=lCWilzU0of_s7cM78NkM9v2ANslq-L6HThMXvucKUUc,1059
78
+ komus_tasks/cli/schemas/common.py,sha256=OugqQ-KochmtYh9Buo2koOARMWlCOduj_pYd1XBwOpE,278
79
+ komus_tasks/cli/schemas/config.py,sha256=0Cg4ahG3MmrF_MWaQkUc2OP2LfwYIirNU81juo1fxgA,292
80
+ komus_tasks/cli/schemas/config_remote.py,sha256=MnGXa3FnsTbR-mJW6tL-opSc1BElvuLw9kn-6gTgYNg,470
81
+ komus_tasks/cli/schemas/credentials.py,sha256=cQIZhgfcNSVjnqCRzPHsnxTH5cGx9S_CxNm1zEMvzIs,642
82
+ komus_tasks/cli/schemas/deploy.py,sha256=NvfqmcffJhzjP86N63lK0Cu8F2sELv04XswWV40Y1sI,358
83
+ komus_tasks/cli/schemas/environments.py,sha256=R4vqSowp58Yo7sI4hxjI38qoD6PilHxrgKICreyFG44,864
84
+ komus_tasks/cli/schemas/files.py,sha256=xvpUjDewCp4wyo7-McWlozrkZOFbq4fO_a5ldVZ8dd8,630
85
+ komus_tasks/cli/schemas/generate.py,sha256=LbvzCOZT2AJ2SVCMLScd1WVz63DdDQcniQgN1WlioKo,1161
86
+ komus_tasks/cli/schemas/init.py,sha256=Lnkq4PA6tHt_NoobQ8Ffq50Z5TQ_39yA4wkI3W7u7jU,216
87
+ komus_tasks/cli/schemas/local_result.py,sha256=fXGYzAbTO8A562F1TaFGDwrcocqaKpF-nI12R__cnGI,311
88
+ komus_tasks/cli/schemas/log_event.py,sha256=f_1Z0e6QaM-gghr6aAzcO_AVxhx4K_cHjZ2wXisf6II,324
89
+ komus_tasks/cli/schemas/long_running.py,sha256=hTl6dE7iTiilwgQIp6w3Pd8-7_gRwPYRGjIE8MXyC9A,675
90
+ komus_tasks/cli/schemas/package.py,sha256=q778BujXgFP0G_t4RGqdoTdreoL0VFdsiPA29MpOkpU,192
91
+ komus_tasks/cli/schemas/page.py,sha256=ym24Cht18dpi0CzsyrRah-IylTzJC24WN525ijNQKD0,507
92
+ komus_tasks/cli/schemas/profile.py,sha256=IxOx-tzNahtciMmxjy1_879zzNie423PNMpeheXXi5s,259
93
+ komus_tasks/cli/schemas/promote.py,sha256=7aJvXlFF0PAWJI7Dwn8hOZOrTpC7Q7ULPwi1KvCI56I,254
94
+ komus_tasks/cli/schemas/run.py,sha256=dHFsG1uvUTeFYtC1FK32ERBdkB0oPctf6rWWZda-7i8,221
95
+ komus_tasks/cli/schemas/schedule.py,sha256=w9yfauSI_Egj2XjbK1OCCgkzY6g9DzW3geurkScg0f8,1326
96
+ komus_tasks/cli/schemas/skills.py,sha256=xc7sMaE60ij8cfYqRblBlSqdJ91y5DniDLOGFTCnqQo,580
97
+ komus_tasks/cli/schemas/status.py,sha256=Zw8UFGvrWqKzy_fkK5ef4KG8x7T5qJO8MlWyTzpzau4,1560
98
+ komus_tasks/cli/schemas/task_list.py,sha256=5XuPkAr2sbhv_LpCsv6YFIZuf9H-DdcAhYZUiDned_A,302
99
+ komus_tasks/cli/schemas/tasks_admin.py,sha256=K-2vYXswFARXijXFg05n3FnxlrFwe-DldSsi94zKpsE,388
100
+ komus_tasks/cli/schemas/webhooks.py,sha256=MfUPM7y8p42tABwX_KXEYKtFpgM7_3YvNQ394iauEaE,1274
101
+ komus_tasks/cli/ui/__init__.py,sha256=HrYiTlv0CdAh_5byHV7hWbxS-cxvn1nRN2HJ8gEQU6A,65
102
+ komus_tasks/cli/ui/prompts.py,sha256=cOu4U4pk5ylKrWp_QiF5xSrF_BlEHIfh5onMOSQP9H0,4325
103
+ komus_tasks/cli/ui/theme.py,sha256=0rYSg2zZ4qyBq76I3u_N81BmTruc7NHlgLeYlSsAAXI,727
104
+ komus_tasks/cli/ui/widgets.py,sha256=t77fghYfI6ID5QTPZ_jeBtMNcOeILjz4v1j3pRYrb-4,1168
105
+ komus_tasks/cli/ui/writer.py,sha256=3vXNc94CbekjwrrErulo2eRcORkneruOrrn6pkXrB10,2285
106
+ komus_tasks/cli/ui_commands/__init__.py,sha256=9w-m-SBFEyVcU09iiKPWkLcP1a_23Hon_ioXkq54jlE,70
107
+ komus_tasks/cli/ui_commands/dashboard.py,sha256=x3-E0YHIfCWpTBcph9X3PORGEIae9CzX9vJGUBCXVK0,20186
108
+ komus_tasks/cli/ui_commands/generate.py,sha256=RAb0YgJpmFUbVDxpdxihWEt0J9vTTuVmJAhX6RX9AxQ,5265
109
+ komus_tasks/cli/ui_commands/monitor.py,sha256=xjDAwYu0RsL0P0bKmIKXtpTLSXjMRjoVmN2kfM3vVLg,5672
110
+ komus_tasks/models/__init__.py,sha256=r0zEMxLn_X0NIafu4sPrSDWoOCrlPFYud_ooaumbl1o,1745
111
+ komus_tasks/models/artifact.py,sha256=x3e1FZGls7GNBlUQDjT9iW2UGHXqg5-l2xrmWfipS4U,5049
112
+ komus_tasks/models/artifact_download_response.py,sha256=fQXg5vIzwR0-A8Nmeu4GUGEg6aIyWZZBCM9sspohplE,421
113
+ komus_tasks/models/artifact_list_response.py,sha256=yVFbRtqEDAaLoR-5uXFqkVugLPIMKtXmOhqUt5AQZDI,447
114
+ komus_tasks/models/artifact_query_filters.py,sha256=11DnTZ5WKg51lMk6GZLQYB63jlvvw-rYaE5sIv-fJRI,816
115
+ komus_tasks/models/artifact_schema.py,sha256=whYp5eP9OyhnVQ49dFvayqXFVCk_6HvGVVHP1VYs6wc,7834
116
+ komus_tasks/models/credential.py,sha256=F2fVpExcZhVspVk7fuRzPKBx6W3u3QiIwdRqbrenzRQ,4829
117
+ komus_tasks/models/environment.py,sha256=Iofyslwm1dLCubLO6UeH5vyIZJ526_qri-ifElk_R8k,8474
118
+ komus_tasks/models/file_upload.py,sha256=b8Jj2pE2MsnAg2B0tj-uDVbs7n0gQYr9iIQshP1xcNc,2339
119
+ komus_tasks/models/log_models.py,sha256=RpuSM-EVK4SqHy1E_EcycZxxW8Mhc5TDlzHnObde23w,10492
120
+ komus_tasks/models/pagination.py,sha256=ulAGyTUocdigpHOnrLwDH7vS7r2cAEvXl5wtFHPzEtw,823
121
+ komus_tasks/models/schedule.py,sha256=-MN4CZUSL3sXCIt53fu46pdDhIc6ySczeSK4QGSHVZc,9732
122
+ komus_tasks/models/settings.py,sha256=AzmuDBi_WM-QWQIUghTsm1OyXKydm-Emr0S64s0crgA,2232
123
+ komus_tasks/models/task_definition.py,sha256=jwSWpwaSM1nclzyx6wgpif2i_3iPOpudSO8xhhmrQNw,7875
124
+ komus_tasks/models/thread.py,sha256=X0etX0YK2zD41yX2PMcjNqG5s0ehdD-YHWCif5lhkCk,4713
125
+ komus_tasks/models/thread_create_request.py,sha256=6B1JfOGwE_14BA6qw2LH5q31UOIYj1c5cSy53HUlXeE,3236
126
+ komus_tasks/models/thread_error.py,sha256=9WNx52arHi75eoBZCB_1e5pKj_zjXrwsgrGcTLHQyNg,606
127
+ komus_tasks/models/thread_list_response.py,sha256=AsbiRyQ69PvQSb1KOFlFxLkK7DmBTVNSRUDQShnkqb0,617
128
+ komus_tasks/models/thread_query_filters.py,sha256=2em_eWQ-gHbQKiIMl-XSZpZptboXsaAbgj9NkAWfjjI,4318
129
+ komus_tasks/models/thread_retry_request.py,sha256=Gqp_GlqnujZDuePnCBvVARdq7e4UgTI2dJ-WWrTKdnk,422
130
+ komus_tasks/models/webhook.py,sha256=1t50BrrYk0fDMwRM0Eh8hHWsq8CYMo5g0-oF-jO0IVg,12288
131
+ komus_tasks/models/webhook_scoping.py,sha256=ziS-nk4zYjw_ihOGozpdtV_-sLX-Hj04yFyjLBgR1gI,1193
132
+ komus_tasks/protocols/__init__.py,sha256=6Ikde1uHULpvOOw3fZOBS0BuqUl7HcvP3Ur35X3dt1s,634
133
+ komus_tasks/protocols/artifact_publisher.py,sha256=XHOr-64BxEZeltcqKZ9BzNguluWm1tLrmkVbT600NTY,2458
134
+ komus_tasks/protocols/log_configurator.py,sha256=bq8r0No5k_7hBy5PWggnsYG6OxXZckw3jLbOzkb5OIc,2331
135
+ komus_tasks/skills/manage-komus-server/SKILL.md,sha256=M6sv403BHVZTX16WP26ndh_hOHQgmYj1ONsGRObhNPM,8173
136
+ komus_tasks/skills/manage-komus-server/references/commands.md,sha256=Lqiy2OZsu09dCUTttG5IEl08XmG-BO39vXtgywxauec,7629
137
+ komus_tasks/skills/manage-komus-server/references/workflows.md,sha256=D0b8Cn7t-fFAGepWsdlsPbSUt-273LKaMUD_UF2gCfs,10009
138
+ komus_tasks/skills/manage-komus-server/references/permissions/agents.md,sha256=HqYXyyn31X8nTZU-LG8ZU10ZoVj9DMsJbRS1ceAhyCY,1149
139
+ komus_tasks/skills/manage-komus-server/references/permissions/claude.md,sha256=Bz3cMVDJGm1GowwkroqQRxIfX7Z7q1EIhS3axQQ6oWM,1117
140
+ komus_tasks/skills/manage-komus-server/references/permissions/codex.md,sha256=QOBpnV66dtkrpnwBsFmIFE3d94Ixcvd7HOIfY4HCoKM,1338
141
+ komus_tasks/skills/manage-komus-server/references/permissions/cursor.md,sha256=OGoEn5X3O2oigNvjAQk7F_cVMJAMrYgq4orswbLuQMQ,1357
142
+ komus_tasks/skills/write-komus-task/SKILL.md,sha256=cJxWfySKrLK7-ax2tE3O6zmWDb8_fs3PxjkYo4hUGUg,7298
143
+ komus_tasks/skills/write-komus-task/references/configuration.md,sha256=z6kN630yUYoH10d_rDyDdZ2K_T4ReW7d2HPh2fhAGvU,1831
144
+ komus_tasks/skills/write-komus-task/references/inputs-and-outputs.md,sha256=kSS-uYWkJDn9WCVpnSHhehUtb-NwqlO6_ElSiqPFdh8,1755
145
+ komus_tasks/skills/write-komus-task/references/long-running.md,sha256=-K9uIEY74VFVTodCDbJDM8ntuj7EkzcDtdWhQfkRIkc,1438
146
+ komus_tasks/skills/write-komus-task/references/packaging.md,sha256=6ygcrfktT1VNVm-jKEy1NOs6wQG_D6HOmztixbY8csA,2434
147
+ komus_tasks/skills/write-komus-task/references/spans.md,sha256=qe3xz9oPbpIT2YFSByZUvw9nwptW7LBnZMXD044aaag,2429
148
+ komus_tasks/skills/write-komus-task/references/task-contract.md,sha256=hIbbBPFu9LkcpA9aHyiuxY07VAUGy3N2Xr6b6JqR6Xs,11017
149
+ komus_tasks/skills/write-komus-task/references/example-node/input.json,sha256=EWNt3nZpsrHtjSrEu_2y1Qpd__wqBivIuiMjmAzlmn0,116
150
+ komus_tasks/skills/write-komus-task/references/example-node/task.ts,sha256=L9RtoGUZ8kGoIeTEo-Xpm0YVyc43QLzAaBdtZaIW-DM,1902
151
+ komus_tasks/skills/write-komus-task/references/example-node/task.yaml,sha256=CMwv9RyTHe_kpjMPEjFQp3hn5gChgcfyLiEw8PKvGls,492
152
+ komus_tasks/skills/write-komus-task/references/example-python/input.json,sha256=EWNt3nZpsrHtjSrEu_2y1Qpd__wqBivIuiMjmAzlmn0,116
153
+ komus_tasks/skills/write-komus-task/references/example-python/task.py,sha256=qnSQvh6Hs9eyTR84RjmFU4kwd0wPnYJ2fieyxVEA2Uk,2017
154
+ komus_tasks/skills/write-komus-task/references/example-python/task.yaml,sha256=uK_hYJ4-kuEUU0GRwtroG5cONVXIyMZ_-WCwbuiBxUw,486
155
+ komus_tasks/testing/__init__.py,sha256=E56kWhALT6tu8Yqzk-WP_lIwxKdKLQYd_5pJMan7EZ4,761
156
+ komus_tasks/testing/local_context.py,sha256=CPF-ggVC9VnWdYOUUhVEsD6dJzAxxOw2hZHM80PR4dE,6516
157
+ komus_tasks/testing/local_runner.py,sha256=TLk2xcP6yyyqhalIn7v7dqIAUjRq3NdAVWu6Q2frw5k,16143
158
+ komus_tasks/testing/run_result.py,sha256=KB4PdFMmg6KXeDWmMDkzZQQHHL-zvgSnU9j5YL9TVj8,2027
159
+ komus_tasks/utils/__init__.py,sha256=kfK2V-eEjMwBiFziQyTAO-E5g00rRZJFFD9Z2wqKZbM,45
160
+ komus_tasks/utils/artifact_validation.py,sha256=9yNd2IAfX1t_rEuN_25JPEDvanWd8NwFscrCTTTkDg0,4418
161
+ komus_tasks/utils/id_generator.py,sha256=TGf1uU-wwPkNZfQ402Fk5bw6HNjQ2m_Yfw5CuVn-pig,1520
162
+ komus_tasks/utils/ref_filtering.py,sha256=aBiJZt4Ddyu__NmEx56T0JjYJHGHX-Ffw-KF2UmCrOM,916
163
+ komus_tasks/utils/sha256.py,sha256=fZicLQJNhvyxlw79K5c6xVtg7vJzzYqW9PW4tEoL_rs,1337
164
+ komus_tasks/utils/task_packaging.py,sha256=D5MeG58EWdo3fKrbDYsFhC3esYv4q9Aeiv0TeMImAHU,33929
165
+ komus_tasks/worker/__init__.py,sha256=SxqIQ0kuYiJSfqBi9uhNXjVMhfkmLBBjX66qU_TEyzI,290
166
+ komus_tasks/worker/__main__.py,sha256=KNU-jKzHv_AWe3ZAWYz0z4pce6C-MG41LTMZq1kemFA,1102
167
+ komus_tasks/worker/context.py,sha256=mFsaOzX8Q9K87V6zmo6YmyTykE2O0NwSNYK8cytZxfM,8978
168
+ komus_tasks/worker/node-runner.js,sha256=NBqTDQn358a2zigMg98s1Ix2NQSoQQg4b0azdcaJuVU,19792
169
+ komus_tasks/worker/protocol.py,sha256=lOCuaw9ANomSFJTsCRef7NN-pPIaaBEl3mHKBkZYkJc,8002
170
+ komus_tasks/worker/runner.py,sha256=kVFD9R7yVCTVSP2YRRFTmTIhKSV4xwjyRNlEqmSSZ0A,26671
171
+ komus_tasks/worker/worker-context.js,sha256=RSH7IavyqvPY2LpxhiaBivwKk1hL3hJOlUHOVTHUlp4,4980
172
+ ko_tasks_sdk-1.0.0.dist-info/METADATA,sha256=0fvPSozbxX0C83vId1pK8Pd15UglQ_6O_T3d_n4aHjA,4489
173
+ ko_tasks_sdk-1.0.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
174
+ ko_tasks_sdk-1.0.0.dist-info/entry_points.txt,sha256=XTXSjy7QZTnKc_FsFZYawe2fXIbsM379ibrQfE5eNgE,99
175
+ ko_tasks_sdk-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ ko-tasks = komus_tasks.cli:main
3
+ ko-tasks-agent = komus_tasks.agent.__main__:main
@@ -0,0 +1,16 @@
1
+ """Komus Tasks Python SDK — Build and run tasks with ease."""
2
+
3
+ from komus_tasks.context import TaskContext
4
+ from komus_tasks.decorators import task, get_task_registry, discover_tasks_in_module
5
+ from komus_tasks.thread_state import ThreadState
6
+ from komus_tasks.version import __version__, get_sdk_version
7
+
8
+ __all__ = [
9
+ "TaskContext",
10
+ "ThreadState",
11
+ "task",
12
+ "get_task_registry",
13
+ "discover_tasks_in_module",
14
+ "__version__",
15
+ "get_sdk_version",
16
+ ]
@@ -0,0 +1,20 @@
1
+ """Remote worker agent (client side).
2
+
3
+ The agent dials *into* the Komus Tasks server over a WebSocket (outbound-only —
4
+ the VM running the agent needs no inbound ports / public IP), registers its
5
+ runtimes and slot capacity, and on demand provisions task bundles and spawns the
6
+ **existing local worker runner** (``python -m komus_tasks.worker`` /
7
+ ``node node-runner.js``). The worker's NDJSON protocol frames are tunnelled over
8
+ the connection; the server's ``NetworkTransport`` is the other end of that pipe.
9
+
10
+ Ships inside ``ko-tasks-sdk`` so ``pip install ko-tasks-sdk[agent]``
11
+ provides the ``ko-tasks-agent`` console script.
12
+
13
+ This package is importable **without** the optional ``websockets`` dependency:
14
+ the import is performed lazily inside :class:`~komus_tasks.agent.client.AgentClient`
15
+ so the SDK keeps importing cleanly when the ``agent`` extra is not installed.
16
+ """
17
+
18
+ from komus_tasks.agent.client import AgentClient, AgentConfig
19
+
20
+ __all__ = ["AgentClient", "AgentConfig"]
@@ -0,0 +1,114 @@
1
+ """``ko-tasks-agent`` CLI — run a remote worker agent.
2
+
3
+ Dials into a Komus Tasks server over WebSocket, registers this host's runtimes
4
+ and slot capacity, then provisions task bundles and runs local workers on demand,
5
+ tunnelling their protocol frames back to the server.
6
+
7
+ Usage:
8
+ python -m komus_tasks.agent \\
9
+ --server-url wss://tasks.example.com/agent/connect \\
10
+ --token "$KO_TASKS_AGENT_TOKEN" \\
11
+ --labels python,node \\
12
+ --max-slots 8 \\
13
+ --work-dir /var/lib/ko-tasks-agent
14
+
15
+ Environment fallbacks:
16
+ KO_TASKS_AGENT_SERVER_URL → --server-url
17
+ KO_TASKS_AGENT_TOKEN → --token
18
+ """
19
+
20
+ import argparse
21
+ import asyncio
22
+ import os
23
+ import sys
24
+ from pathlib import Path
25
+
26
+ from komus_tasks.agent.client import AgentClient, AgentConfig, HelloRejected
27
+ from komus_tasks.logging import configure_logging, logger
28
+
29
+
30
+ def _build_parser() -> argparse.ArgumentParser:
31
+ parser = argparse.ArgumentParser(
32
+ prog="ko-tasks-agent",
33
+ description=(
34
+ "Run a Komus Tasks remote worker agent. The agent dials into the "
35
+ "server (outbound-only), registers its runtimes/slots, and runs "
36
+ "task workers on this host on demand."
37
+ ),
38
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
39
+ )
40
+ parser.add_argument(
41
+ "--server-url",
42
+ default=os.environ.get("KO_TASKS_AGENT_SERVER_URL"),
43
+ help="WebSocket URL of the server agent gateway "
44
+ "(e.g. wss://host/agent/connect). Env: KO_TASKS_AGENT_SERVER_URL.",
45
+ )
46
+ parser.add_argument(
47
+ "--token",
48
+ default=os.environ.get("KO_TASKS_AGENT_TOKEN"),
49
+ help="Shared agent auth token presented in `hello`. Env: KO_TASKS_AGENT_TOKEN.",
50
+ )
51
+ parser.add_argument(
52
+ "--labels",
53
+ default="python",
54
+ help="Comma-separated runtimes this agent can run (e.g. python,node).",
55
+ )
56
+ parser.add_argument(
57
+ "--max-slots",
58
+ type=int,
59
+ default=4,
60
+ help="Maximum concurrent worker leases this agent will accept.",
61
+ )
62
+ parser.add_argument(
63
+ "--work-dir",
64
+ type=Path,
65
+ default=Path.home() / ".ko-tasks-agent" / "work",
66
+ help="Directory for unpacked task bundles and per-lease venvs.",
67
+ )
68
+ parser.add_argument(
69
+ "--agent-id",
70
+ default=None,
71
+ help="Stable agent identifier (defaults to host-pid).",
72
+ )
73
+ return parser
74
+
75
+
76
+ def main() -> None:
77
+ configure_logging()
78
+ parser = _build_parser()
79
+ args = parser.parse_args()
80
+
81
+ if not args.server_url:
82
+ parser.error("--server-url is required (or set KO_TASKS_AGENT_SERVER_URL)")
83
+ if not args.token:
84
+ parser.error("--token is required (or set KO_TASKS_AGENT_TOKEN)")
85
+
86
+ runtimes = [r.strip() for r in args.labels.split(",") if r.strip()]
87
+ if not runtimes:
88
+ runtimes = ["python"]
89
+
90
+ config_kwargs: dict = {
91
+ "server_url": args.server_url,
92
+ "token": args.token,
93
+ "runtimes": runtimes,
94
+ "max_slots": args.max_slots,
95
+ "work_dir": args.work_dir,
96
+ }
97
+ if args.agent_id:
98
+ config_kwargs["agent_id"] = args.agent_id
99
+
100
+ config = AgentConfig(**config_kwargs)
101
+ client = AgentClient(config)
102
+
103
+ try:
104
+ asyncio.run(client.run_forever())
105
+ except HelloRejected as exc:
106
+ logger.error("agent.rejected", reason=str(exc))
107
+ sys.exit(2)
108
+ except KeyboardInterrupt:
109
+ logger.info("agent.shutdown")
110
+ sys.exit(0)
111
+
112
+
113
+ if __name__ == "__main__":
114
+ main()