claude-org-runtime 0.1.1__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.
- claude_org_runtime-0.1.1/LICENSE +21 -0
- claude_org_runtime-0.1.1/PKG-INFO +107 -0
- claude_org_runtime-0.1.1/README.md +85 -0
- claude_org_runtime-0.1.1/pyproject.toml +44 -0
- claude_org_runtime-0.1.1/setup.cfg +4 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/__about__.py +2 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/__init__.py +18 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/cli.py +96 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/dispatcher/__init__.py +23 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/dispatcher/runner.py +826 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/migrate/__init__.py +22 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/migrate/v1_to_v2.py +298 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/prompts/__init__.py +82 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/prompts/templates/curator.md +77 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/prompts/templates/dispatcher.md +538 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/prompts/templates/secretary.md +63 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/schema/__init__.py +30 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/schema/enums.py +122 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/schema/journal_event.py +173 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/schema/json_schema/__init__.py +33 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/schema/json_schema/journal_event.schema.json +106 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/schema/json_schema/worker_dir_entry.schema.json +44 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/schema/org_state.py +160 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/settings/__init__.py +20 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/settings/generator.py +176 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime/settings/role_configs_schema.json +448 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime.egg-info/PKG-INFO +107 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime.egg-info/SOURCES.txt +36 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime.egg-info/dependency_links.txt +1 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime.egg-info/entry_points.txt +2 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime.egg-info/requires.txt +4 -0
- claude_org_runtime-0.1.1/src/claude_org_runtime.egg-info/top_level.txt +1 -0
- claude_org_runtime-0.1.1/tests/test_dispatcher_runner.py +633 -0
- claude_org_runtime-0.1.1/tests/test_migrate.py +159 -0
- claude_org_runtime-0.1.1/tests/test_prompts.py +44 -0
- claude_org_runtime-0.1.1/tests/test_schema.py +117 -0
- claude_org_runtime-0.1.1/tests/test_settings_generator.py +133 -0
- claude_org_runtime-0.1.1/tests/test_smoke.py +5 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 suisya-systems
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: claude-org-runtime
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Python runtime for claude-org-ja: dispatcher, state schema, and reference role prompts.
|
|
5
|
+
Author-email: suisya-systems <iwama.ryo.0731@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/suisya-systems/claude-org-runtime
|
|
8
|
+
Project-URL: Issues, https://github.com/suisya-systems/claude-org-runtime/issues
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: jsonschema>=4.18
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: pytest; extra == "dev"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# claude-org-runtime
|
|
24
|
+
|
|
25
|
+
Python runtime extracted from [claude-org-ja](https://github.com/suisya-systems/claude-org-ja)
|
|
26
|
+
for Claude Code orchestrator setups using renga panes. Sibling of
|
|
27
|
+
[core-harness](https://github.com/suisya-systems/core-harness); provides a
|
|
28
|
+
dispatcher runner, state schema, and reference role prompts (secretary /
|
|
29
|
+
dispatcher / curator).
|
|
30
|
+
|
|
31
|
+
Not an AI agent framework — this is plumbing for human-driven Claude Code
|
|
32
|
+
orchestrator workflows, not an autonomous-agent toolkit.
|
|
33
|
+
|
|
34
|
+
## Status
|
|
35
|
+
|
|
36
|
+
**0.1.0**: dispatcher runner + settings generator + reference role
|
|
37
|
+
prompts + state schema + `v1->v2` polymorphic migrate. This is the first
|
|
38
|
+
release that consumers (notably `claude-org-ja`) can `pip install` to
|
|
39
|
+
replace their in-tree `tools/dispatcher_runner.py` /
|
|
40
|
+
`tools/generate_worker_settings.py` / `tools/role_configs_schema.json`.
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
pip install claude-org-runtime==0.1.0
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For local development:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
git clone https://github.com/suisya-systems/claude-org-runtime
|
|
52
|
+
cd claude-org-runtime
|
|
53
|
+
python -m pip install -e .[dev]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
# Render a per-role settings.local.json:
|
|
60
|
+
claude-org-runtime settings generate \
|
|
61
|
+
--role default \
|
|
62
|
+
--worker-dir /path/to/worker \
|
|
63
|
+
--claude-org-path /path/to/claude-org \
|
|
64
|
+
--out /path/to/worker/.claude/settings.local.json
|
|
65
|
+
|
|
66
|
+
# Compute a Dispatcher delegation action plan:
|
|
67
|
+
claude-org-runtime dispatcher delegate-plan \
|
|
68
|
+
--task-json .state/dispatcher/inbox/<task_id>.json \
|
|
69
|
+
--panes-json panes.json \
|
|
70
|
+
--state-dir .state
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
See [`docs/cli.md`](docs/cli.md) for the full CLI reference and the
|
|
74
|
+
migration recipe for `claude-org-ja` consumers.
|
|
75
|
+
|
|
76
|
+
## Reference role prompts
|
|
77
|
+
|
|
78
|
+
The runtime ships English reference prompts for the three roles used in
|
|
79
|
+
the `claude-org-ja` reference organization (`secretary`, `dispatcher`,
|
|
80
|
+
`curator`):
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
from claude_org_runtime.prompts import load, load_meta
|
|
84
|
+
|
|
85
|
+
prompt = load("dispatcher") # raw markdown, frontmatter included
|
|
86
|
+
meta = load_meta("dispatcher") # {'role': 'dispatcher', 'source': ..., 'status': ...}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
These are **reference**, not prescriptive. They capture one working
|
|
90
|
+
configuration from `claude-org-ja`, not an "agent framework" opinion.
|
|
91
|
+
Consumers are expected to load them as a starting point and then override
|
|
92
|
+
or rewrite sections from their own project-root `CLAUDE.md` (or skill
|
|
93
|
+
files) to match their organization's conventions, terminology, and slash
|
|
94
|
+
commands.
|
|
95
|
+
|
|
96
|
+
## Related
|
|
97
|
+
|
|
98
|
+
- [core-harness](https://github.com/suisya-systems/core-harness) — sibling
|
|
99
|
+
repo with reusable safety primitives for Claude Code harnesses.
|
|
100
|
+
- [claude-org-ja#129](https://github.com/suisya-systems/claude-org-ja/issues/129)
|
|
101
|
+
— Phase 4 epic that motivated extracting this runtime.
|
|
102
|
+
- [Issues](https://github.com/suisya-systems/claude-org-runtime/issues) for
|
|
103
|
+
this repo.
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# claude-org-runtime
|
|
2
|
+
|
|
3
|
+
Python runtime extracted from [claude-org-ja](https://github.com/suisya-systems/claude-org-ja)
|
|
4
|
+
for Claude Code orchestrator setups using renga panes. Sibling of
|
|
5
|
+
[core-harness](https://github.com/suisya-systems/core-harness); provides a
|
|
6
|
+
dispatcher runner, state schema, and reference role prompts (secretary /
|
|
7
|
+
dispatcher / curator).
|
|
8
|
+
|
|
9
|
+
Not an AI agent framework — this is plumbing for human-driven Claude Code
|
|
10
|
+
orchestrator workflows, not an autonomous-agent toolkit.
|
|
11
|
+
|
|
12
|
+
## Status
|
|
13
|
+
|
|
14
|
+
**0.1.0**: dispatcher runner + settings generator + reference role
|
|
15
|
+
prompts + state schema + `v1->v2` polymorphic migrate. This is the first
|
|
16
|
+
release that consumers (notably `claude-org-ja`) can `pip install` to
|
|
17
|
+
replace their in-tree `tools/dispatcher_runner.py` /
|
|
18
|
+
`tools/generate_worker_settings.py` / `tools/role_configs_schema.json`.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
pip install claude-org-runtime==0.1.0
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
For local development:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
git clone https://github.com/suisya-systems/claude-org-runtime
|
|
30
|
+
cd claude-org-runtime
|
|
31
|
+
python -m pip install -e .[dev]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Quick start
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
# Render a per-role settings.local.json:
|
|
38
|
+
claude-org-runtime settings generate \
|
|
39
|
+
--role default \
|
|
40
|
+
--worker-dir /path/to/worker \
|
|
41
|
+
--claude-org-path /path/to/claude-org \
|
|
42
|
+
--out /path/to/worker/.claude/settings.local.json
|
|
43
|
+
|
|
44
|
+
# Compute a Dispatcher delegation action plan:
|
|
45
|
+
claude-org-runtime dispatcher delegate-plan \
|
|
46
|
+
--task-json .state/dispatcher/inbox/<task_id>.json \
|
|
47
|
+
--panes-json panes.json \
|
|
48
|
+
--state-dir .state
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
See [`docs/cli.md`](docs/cli.md) for the full CLI reference and the
|
|
52
|
+
migration recipe for `claude-org-ja` consumers.
|
|
53
|
+
|
|
54
|
+
## Reference role prompts
|
|
55
|
+
|
|
56
|
+
The runtime ships English reference prompts for the three roles used in
|
|
57
|
+
the `claude-org-ja` reference organization (`secretary`, `dispatcher`,
|
|
58
|
+
`curator`):
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
from claude_org_runtime.prompts import load, load_meta
|
|
62
|
+
|
|
63
|
+
prompt = load("dispatcher") # raw markdown, frontmatter included
|
|
64
|
+
meta = load_meta("dispatcher") # {'role': 'dispatcher', 'source': ..., 'status': ...}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
These are **reference**, not prescriptive. They capture one working
|
|
68
|
+
configuration from `claude-org-ja`, not an "agent framework" opinion.
|
|
69
|
+
Consumers are expected to load them as a starting point and then override
|
|
70
|
+
or rewrite sections from their own project-root `CLAUDE.md` (or skill
|
|
71
|
+
files) to match their organization's conventions, terminology, and slash
|
|
72
|
+
commands.
|
|
73
|
+
|
|
74
|
+
## Related
|
|
75
|
+
|
|
76
|
+
- [core-harness](https://github.com/suisya-systems/core-harness) — sibling
|
|
77
|
+
repo with reusable safety primitives for Claude Code harnesses.
|
|
78
|
+
- [claude-org-ja#129](https://github.com/suisya-systems/claude-org-ja/issues/129)
|
|
79
|
+
— Phase 4 epic that motivated extracting this runtime.
|
|
80
|
+
- [Issues](https://github.com/suisya-systems/claude-org-runtime/issues) for
|
|
81
|
+
this repo.
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "claude-org-runtime"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
description = "Python runtime for claude-org-ja: dispatcher, state schema, and reference role prompts."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
license = { text = "MIT" }
|
|
8
|
+
authors = [{ name = "suisya-systems", email = "iwama.ryo.0731@gmail.com" }]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Development Status :: 4 - Beta",
|
|
11
|
+
"Programming Language :: Python :: 3",
|
|
12
|
+
"Programming Language :: Python :: 3.10",
|
|
13
|
+
"Programming Language :: Python :: 3.11",
|
|
14
|
+
"Programming Language :: Python :: 3.12",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
]
|
|
17
|
+
dependencies = [
|
|
18
|
+
"jsonschema>=4.18",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.optional-dependencies]
|
|
22
|
+
dev = ["pytest"]
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Repository = "https://github.com/suisya-systems/claude-org-runtime"
|
|
26
|
+
Issues = "https://github.com/suisya-systems/claude-org-runtime/issues"
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
claude-org-runtime = "claude_org_runtime.cli:main"
|
|
30
|
+
|
|
31
|
+
[build-system]
|
|
32
|
+
requires = ["setuptools>=64", "wheel"]
|
|
33
|
+
build-backend = "setuptools.build_meta"
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.dynamic]
|
|
36
|
+
version = { attr = "claude_org_runtime.__about__.__version__" }
|
|
37
|
+
|
|
38
|
+
[tool.setuptools.packages.find]
|
|
39
|
+
where = ["src"]
|
|
40
|
+
|
|
41
|
+
[tool.setuptools.package-data]
|
|
42
|
+
"claude_org_runtime.schema.json_schema" = ["*.json"]
|
|
43
|
+
"claude_org_runtime.prompts.templates" = ["*.md"]
|
|
44
|
+
"claude_org_runtime.settings" = ["*.json"]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Public surface of the ``claude-org-runtime`` package.
|
|
2
|
+
|
|
3
|
+
Importing the top-level package exposes the per-feature subpackages
|
|
4
|
+
(:mod:`dispatcher`, :mod:`settings`, :mod:`prompts`, :mod:`schema`,
|
|
5
|
+
:mod:`migrate`) and the package version SoT (:data:`__version__`).
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .__about__ import __version__
|
|
9
|
+
from . import dispatcher, migrate, prompts, schema, settings
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"__version__",
|
|
13
|
+
"dispatcher",
|
|
14
|
+
"migrate",
|
|
15
|
+
"prompts",
|
|
16
|
+
"schema",
|
|
17
|
+
"settings",
|
|
18
|
+
]
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"""Unified ``claude-org-runtime`` CLI.
|
|
2
|
+
|
|
3
|
+
Subcommands:
|
|
4
|
+
|
|
5
|
+
- ``dispatcher delegate-plan ...`` -> :mod:`claude_org_runtime.dispatcher.runner`
|
|
6
|
+
- ``settings generate ...`` -> :mod:`claude_org_runtime.settings.generator`
|
|
7
|
+
- ``migrate ...`` -> :mod:`claude_org_runtime.migrate.v1_to_v2`
|
|
8
|
+
|
|
9
|
+
The subcommands re-use the same parser builders the per-module CLIs
|
|
10
|
+
expose, so flags stay in lock-step.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import argparse
|
|
16
|
+
import sys
|
|
17
|
+
from typing import Optional
|
|
18
|
+
|
|
19
|
+
from . import __version__
|
|
20
|
+
from .dispatcher import runner as dispatcher_runner
|
|
21
|
+
from .migrate import v1_to_v2 as migrate_v1_to_v2
|
|
22
|
+
from .settings import generator as settings_generator
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _run_settings_generate(args: argparse.Namespace) -> int:
|
|
26
|
+
return settings_generator.run(args)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _run_migrate_v1_to_v2(args: argparse.Namespace) -> int:
|
|
30
|
+
return migrate_v1_to_v2.run(args)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
34
|
+
parser = argparse.ArgumentParser(
|
|
35
|
+
prog="claude-org-runtime",
|
|
36
|
+
description=(
|
|
37
|
+
"Python runtime for claude-org-ja: dispatcher runner, "
|
|
38
|
+
"settings generator, state-schema migrate."
|
|
39
|
+
),
|
|
40
|
+
)
|
|
41
|
+
parser.add_argument(
|
|
42
|
+
"--version", action="version", version=f"claude-org-runtime {__version__}",
|
|
43
|
+
)
|
|
44
|
+
sub = parser.add_subparsers(dest="group", required=True)
|
|
45
|
+
|
|
46
|
+
# dispatcher
|
|
47
|
+
dispatcher_p = sub.add_parser(
|
|
48
|
+
"dispatcher",
|
|
49
|
+
help="Dispatcher state-machine helpers (delegate-plan ...)",
|
|
50
|
+
)
|
|
51
|
+
dispatcher_sub = dispatcher_p.add_subparsers(dest="cmd", required=True)
|
|
52
|
+
dispatcher_runner.add_subparsers(dispatcher_sub)
|
|
53
|
+
|
|
54
|
+
# settings
|
|
55
|
+
settings_p = sub.add_parser(
|
|
56
|
+
"settings",
|
|
57
|
+
help="Worker settings.local.json generator",
|
|
58
|
+
)
|
|
59
|
+
settings_sub = settings_p.add_subparsers(dest="cmd", required=True)
|
|
60
|
+
gen_p = settings_sub.add_parser(
|
|
61
|
+
"generate",
|
|
62
|
+
help=(
|
|
63
|
+
"Render a per-role settings.local.json from the bundled "
|
|
64
|
+
"role_configs_schema.json"
|
|
65
|
+
),
|
|
66
|
+
)
|
|
67
|
+
settings_generator.add_arguments(gen_p)
|
|
68
|
+
gen_p.set_defaults(func=_run_settings_generate)
|
|
69
|
+
|
|
70
|
+
# migrate
|
|
71
|
+
migrate_p = sub.add_parser(
|
|
72
|
+
"migrate",
|
|
73
|
+
help="State-schema migration helpers (v1 -> v2)",
|
|
74
|
+
)
|
|
75
|
+
migrate_sub = migrate_p.add_subparsers(dest="cmd", required=True)
|
|
76
|
+
v1v2_p = migrate_sub.add_parser(
|
|
77
|
+
"v1-to-v2",
|
|
78
|
+
help=(
|
|
79
|
+
"Migrate a v1 .state/ artefact (journal.jsonl or org-state.md) "
|
|
80
|
+
"to the v2 polymorphic schema."
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
migrate_v1_to_v2.add_arguments(v1v2_p)
|
|
84
|
+
v1v2_p.set_defaults(func=_run_migrate_v1_to_v2)
|
|
85
|
+
|
|
86
|
+
return parser
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def main(argv: Optional[list[str]] = None) -> int:
|
|
90
|
+
parser = build_parser()
|
|
91
|
+
args = parser.parse_args(argv)
|
|
92
|
+
return args.func(args)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
if __name__ == "__main__":
|
|
96
|
+
sys.exit(main())
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Dispatcher state-machine helpers ported from claude-org-ja ``tools/dispatcher_runner.py``.
|
|
2
|
+
|
|
3
|
+
Public surface (``runner`` is lazy-imported to avoid ``runpy``
|
|
4
|
+
double-load warnings when invoked as
|
|
5
|
+
``python -m claude_org_runtime.dispatcher.runner``):
|
|
6
|
+
|
|
7
|
+
- :mod:`runner` -- :func:`runner.build_plan`, :func:`runner.choose_split`,
|
|
8
|
+
:class:`runner.LocaleConfig`, :func:`runner.main`.
|
|
9
|
+
- :class:`LocaleConfig` -- re-exported here for ergonomic
|
|
10
|
+
``from claude_org_runtime.dispatcher import LocaleConfig``.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
__all__ = ["LocaleConfig", "runner"]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def __getattr__(name: str): # pragma: no cover - thin lazy bridge
|
|
17
|
+
if name == "runner":
|
|
18
|
+
import importlib
|
|
19
|
+
return importlib.import_module(f"{__name__}.runner")
|
|
20
|
+
if name == "LocaleConfig":
|
|
21
|
+
import importlib
|
|
22
|
+
return importlib.import_module(f"{__name__}.runner").LocaleConfig
|
|
23
|
+
raise AttributeError(name)
|