stratonext 0.0.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.
@@ -0,0 +1,57 @@
1
+ *.swp
2
+ *.*~
3
+ .DS_Store
4
+ *.pyc
5
+ nupkg/
6
+ .claude/
7
+ .kiro/
8
+ _temp/
9
+
10
+ # Visual Studio Code
11
+ .vscode/*
12
+ !.vscode/settings.json
13
+
14
+ # Visual Studio
15
+ .vs/
16
+
17
+ # Code Rush
18
+ .cr/
19
+
20
+ # User-specific files
21
+ *.suo
22
+ *.user
23
+ *.userosscache
24
+ *.sln.docstates
25
+
26
+ # Build results
27
+ [Dd]ebug/
28
+ [Dd]ebugPublic/
29
+ [Rr]elease/
30
+ [Rr]eleases/
31
+ x64/
32
+ x86/
33
+ build/
34
+ bld/
35
+ [Bb]in/
36
+ [Oo]bj/
37
+ [Oo]ut/
38
+ msbuild.log
39
+ msbuild.err
40
+ msbuild.wrn
41
+
42
+ *.sh
43
+
44
+ # typescript
45
+ node_modules/
46
+
47
+ !**/*/scripts/*.sh
48
+
49
+ !.claude/
50
+ !.claude/skills/*
51
+ settings.local.json
52
+ appsettings.local.json
53
+
54
+ # cached M2M tokens from local dev/test scripts
55
+ .agent_caller_token.json
56
+ src/platform/tools/db-helper/scripts/query-db.sh
57
+ _AGENT
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.4
2
+ Name: stratonext
3
+ Version: 0.0.1
4
+ Summary: Command-line interface to the StratoNext platform, for coding agents (Claude Code, Kiro, OpenAI) and humans.
5
+ Requires-Python: >=3.14
6
+ Requires-Dist: httpx>=0.28
7
+ Requires-Dist: stratonext-core
8
+ Description-Content-Type: text/markdown
9
+
10
+ # StratoNext CLI
11
+
12
+ Command-line interface to [StratoNext](https://app.stratonext.com), for interactive
13
+ agents (Claude Code, Kiro, OpenAI) and humans.
14
+
15
+ StratoNext is an Agentic Operations Platform: it lets trusted AI operators
16
+ perform production work — projects, tasks, environments, assets, agents,
17
+ approvals — alongside human teams. This CLI drives those resources from your
18
+ terminal or from an agent's tool calls.
19
+
20
+ Learn more at [www.stratonext.com](https://www.stratonext.com).
@@ -0,0 +1,48 @@
1
+ # StratoNext agent setup
2
+
3
+ You are being configured to work with the StratoNext platform. Work through these
4
+ steps in order, then continue with the installed skill.
5
+
6
+ ## 1. Install the CLI
7
+
8
+ ```bash
9
+ pip install stratonext
10
+ ```
11
+
12
+ Confirm it is available: `stratonext --help`.
13
+
14
+ ## 2. Authenticate (requires a human)
15
+
16
+ Login is browser-based (OAuth2 + PKCE), so you cannot complete it yourself. Ask the
17
+ human to run:
18
+
19
+ ```bash
20
+ stratonext login
21
+ ```
22
+
23
+ This opens a browser, authenticates, and caches credentials in
24
+ `~/.stratonext/credentials`. Wait for them to confirm, then verify:
25
+
26
+ ```bash
27
+ stratonext whoami
28
+ ```
29
+
30
+ If `whoami` returns an identity, you are connected. The CLI targets **prod** by default.
31
+
32
+ ## 3. Install the skill
33
+
34
+ Fetch the StratoNext skill into the directory your agent loads skills from (for Claude
35
+ Code that is `.claude/skills/stratonext/SKILL.md`):
36
+
37
+ ```bash
38
+ mkdir -p .claude/skills/stratonext
39
+ curl -sSL https://app.stratonext.com/skill.md -o .claude/skills/stratonext/SKILL.md
40
+ ```
41
+
42
+ Then **read that file and follow it**. It defines how to work with StratoNext — the
43
+ core rule is that every piece of work is a task: claim it, move it to `WORKING`, do the
44
+ work, and report the outcome (`stratonext task complete` / `task fail`) with a result.
45
+
46
+ ## 4. You are ready
47
+
48
+ Use the `stratonext` CLI for all StratoNext work from here on, following `SKILL.md`.
@@ -0,0 +1,11 @@
1
+ # StratoNext CLI
2
+
3
+ Command-line interface to [StratoNext](https://app.stratonext.com), for interactive
4
+ agents (Claude Code, Kiro, OpenAI) and humans.
5
+
6
+ StratoNext is an Agentic Operations Platform: it lets trusted AI operators
7
+ perform production work — projects, tasks, environments, assets, agents,
8
+ approvals — alongside human teams. This CLI drives those resources from your
9
+ terminal or from an agent's tool calls.
10
+
11
+ Learn more at [www.stratonext.com](https://www.stratonext.com).
@@ -0,0 +1,228 @@
1
+ # Releasing the `stratonext` CLI
2
+
3
+ How the CLI gets built, versioned, and published to PyPI — and the one-time setup
4
+ you need to do first.
5
+
6
+ - **Repo:** `stratonext/artemis`
7
+ - **Workflows:** [`.github/workflows/cli-release.yml`](../../../../.github/workflows/cli-release.yml),
8
+ [`.github/workflows/cli-test.yml`](../../../../.github/workflows/cli-test.yml)
9
+
10
+ ---
11
+
12
+ ## TL;DR
13
+
14
+ ```bash
15
+ # pre-release / testing → TestPyPI + prerelease GitHub Release
16
+ git tag cli-v1.3.0rc1 && git push origin cli-v1.3.0rc1
17
+
18
+ # prod → PyPI + GitHub Release
19
+ git tag cli-v1.3.0 && git push origin cli-v1.3.0
20
+ ```
21
+
22
+ Nothing else. The version comes from the tag. Tests run first; publish only happens
23
+ if they pass. You do **not** publish on every commit — only when you push a tag.
24
+
25
+ ---
26
+
27
+ ## What gets published
28
+
29
+ `uv tool install stratonext` gives you the CLI, which pulls a chain of three packages —
30
+ all published together (same version, in lockstep):
31
+
32
+ ```
33
+ stratonext (the CLI) src/libs/skills/public-stratonext/
34
+ └── stratonext-core (skills library) src/agents/tools/stratonext_core/
35
+ └── stratonext-sdk (GraphQL SDK) src/libs/sdks/python/
36
+ ```
37
+
38
+ > **Why all three?** `stratonext` imports `stratonext-core`, which imports
39
+ > `stratonext-sdk`. A `uv tool install stratonext` resolves these from PyPI, so they must
40
+ > all exist there.
41
+
42
+ > **SKILL.md is not published.** The agent skill (`SKILL.md`) is a plain markdown
43
+ > prompt, hosted on a public website — not a pip package. It lives in this repo next
44
+ > to the CLI as the source of truth; copy it to the site when it changes.
45
+
46
+ ---
47
+
48
+ ## How a release flows (`cli-release.yml`)
49
+
50
+ Triggered by pushing a tag matching `cli-v*`:
51
+
52
+ | Job | What it does |
53
+ |-----|--------------|
54
+ | **test** | `python -m pytest` for the CLI. **Gate** — nothing publishes if this fails. |
55
+ | **build** | Parses the version from the tag; builds sdist+wheel for all three packages into `dist/<pkg>/` (`sdk`/`core`/`cli`). |
56
+ | **publish** | Matrix leg per package — each uploads its own files to PyPI (or TestPyPI for a pre-release tag) via OIDC, from its own environment. |
57
+ | **github-release** | Creates a GitHub Release with the CLI's wheel+sdist attached. |
58
+
59
+ **pre-release vs prod** is decided purely by the tag:
60
+
61
+ | Tag example | Track | Index | GitHub Release |
62
+ |-------------|-------|-------|----------------|
63
+ | `cli-v1.3.0` | prod | PyPI | normal |
64
+ | `cli-v1.3.0rc1` / `...b1` / `...a1` | pre-release | TestPyPI | prerelease |
65
+
66
+ ---
67
+
68
+ ## Versioning
69
+
70
+ Versions are **derived from the git tag** — you never edit a version in
71
+ `pyproject.toml`. Each of the three packages declares `dynamic = ["version"]` with
72
+ `hatch-vcs`:
73
+
74
+ ```toml
75
+ [build-system]
76
+ requires = ["hatchling", "hatch-vcs"]
77
+ build-backend = "hatchling.build"
78
+
79
+ [tool.hatch.version]
80
+ source = "vcs"
81
+ raw-options = { tag_regex = '^cli-v(?P<version>\d+\.\d+\.\d+([abrc]+\d+)?)$', fallback_version = "0.0.0" }
82
+ ```
83
+
84
+ - Tag `cli-v1.3.0` → version `1.3.0`. Tag `cli-v1.3.0rc1` → `1.3.0rc1`.
85
+ - **`fallback_version`** keeps local `uv sync` / `uv build` working when your checkout
86
+ has no release tag — you'll just get `0.0.0` locally, which is fine for dev.
87
+ - In CI, the workflow exports `SETUPTOOLS_SCM_PRETEND_VERSION` from the tag. This is
88
+ required because `uv build` runs in an isolated tree without `.git`, so `hatch-vcs`
89
+ can't read the tag on its own. The workflow handles this — you don't have to.
90
+
91
+ ---
92
+
93
+ ## One-time setup (before the first release)
94
+
95
+ Do this once. It has no code; it's account/settings config on PyPI, TestPyPI, and GitHub.
96
+
97
+ ### 1. Reserve the project names (6 total)
98
+
99
+ Create empty projects — or use "pending publishers" (step 2) which create them on first
100
+ publish — for all three names on **both** indexes:
101
+
102
+ | Name | https://pypi.org | https://test.pypi.org |
103
+ |------|------------------|------------------------|
104
+ | `stratonext-sdk` | ✅ | ✅ |
105
+ | `stratonext-core` | ✅ | ✅ |
106
+ | `stratonext` | ✅ | ✅ |
107
+
108
+ ### 2. Register Trusted Publishers (OIDC — no API tokens)
109
+
110
+ This lets GitHub Actions publish without any stored secret. For **each** of the 6
111
+ project/index combinations:
112
+
113
+ - **PyPI:** project → *Manage → Publishing → Add a new publisher* (or, before the project
114
+ exists, *Your account → Publishing → Add a pending publisher*).
115
+ - **TestPyPI:** same flow at https://test.pypi.org.
116
+
117
+ Owner `stratonext`, repository `artemis`, workflow `cli-release.yml` are the same every
118
+ time. **The environment name is per package** — each package gets its own, because a
119
+ *pending* publisher must be unique on `(owner, repo, workflow, environment)`. A shared
120
+ environment is what triggers *"a pending trusted publisher matching this configuration has
121
+ already been registered for a different project name."*
122
+
123
+ | PyPI project | Environment on pypi.org | Environment on test.pypi.org |
124
+ |--------------|-------------------------|------------------------------|
125
+ | `stratonext-sdk` | `pypi-sdk` | `testpypi-sdk` |
126
+ | `stratonext-core` | `pypi-core` | `testpypi-core` |
127
+ | `stratonext` | `pypi-cli` | `testpypi-cli` |
128
+
129
+ > Each environment name **must** match the one the matrix leg runs in (step 3), or PyPI
130
+ > rejects the upload.
131
+
132
+ ### 3. Create the GitHub Environments
133
+
134
+ Repo → *Settings → Environments → New environment*. Create all six:
135
+
136
+ - `pypi-sdk`, `pypi-core`, `pypi-cli` — prod releases.
137
+ - `testpypi-sdk`, `testpypi-core`, `testpypi-cli` — pre-release/test releases.
138
+
139
+ Optional but recommended: on the three `pypi-*` environments, add a **required reviewer**
140
+ (Deployment protection rules). That makes every prod publish pause for a human click — a
141
+ cheap prod gate.
142
+
143
+ ### 4. Confirm public exposure
144
+
145
+ `stratonext-sdk` and `stratonext-core` become **world-readable** on PyPI. Confirm that's
146
+ acceptable.
147
+
148
+ ---
149
+
150
+ ## Cutting a release
151
+
152
+ ### Pre-release (test the packaged CLI first)
153
+
154
+ ```bash
155
+ git tag cli-v1.3.0rc1
156
+ git push origin cli-v1.3.0rc1
157
+ ```
158
+
159
+ Watch the run in the repo's Actions tab. When it's green, install from TestPyPI and
160
+ smoke-test:
161
+
162
+ ```bash
163
+ # install the pre-release from TestPyPI (extra-index so runtime deps resolve from PyPI)
164
+ uv tool install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ stratonext
165
+
166
+ # copy credentials
167
+
168
+ stratonext --help
169
+ stratonext whoami # targets prod by default
170
+ ```
171
+
172
+ The CLI targets **prod** by default. To smoke-test against a non-prod backend, set the
173
+ `STRATONEXT_*` env vars (see `SKILL.md` → Authentication) before `stratonext login`.
174
+
175
+ Not happy? Fix, then bump the pre-release number (`rc2`, `rc3`, …) and re-tag.
176
+
177
+ ### Prod
178
+
179
+ Once the release candidate checks out:
180
+
181
+ ```bash
182
+ git tag cli-v1.3.0
183
+ git push origin cli-v1.3.0
184
+ ```
185
+
186
+ Then verify a clean install from real PyPI:
187
+
188
+ ```bash
189
+ uv tool install stratonext
190
+ stratonext --help
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Version numbering
196
+
197
+ Use [PEP 440](https://peps.python.org/pep-0440/) / semver:
198
+
199
+ - `cli-v1.3.0` — a normal prod release.
200
+ - `cli-v1.3.0rc1` — release candidate (pre-release → TestPyPI). Also valid: `a1` (alpha), `b1` (beta).
201
+ - Bump `MAJOR.MINOR.PATCH` as usual. Each release must use a **new** version — PyPI
202
+ refuses to overwrite an existing one.
203
+
204
+ ---
205
+
206
+ ## Troubleshooting
207
+
208
+ | Symptom | Cause / fix |
209
+ |---------|-------------|
210
+ | Publish job fails with `invalid-publisher` / 403 | Trusted Publisher not registered for that project/index, or the **Environment name** doesn't match. Recheck step 2 & 3. |
211
+ | `A pending trusted publisher matching this configuration has already been registered for a different project name` | You reused one environment across packages. Pending publishers must be unique on `(owner, repo, workflow, environment)` — give each package its own environment (`pypi-<pkg>` / `testpypi-<pkg>`), per step 2. |
212
+ | Wheel version is `0.0.0` | The build didn't get `SETUPTOOLS_SCM_PRETEND_VERSION`. In CI this is set from the tag automatically; locally it means no release tag is present (expected). |
213
+ | `File already exists` on upload | That version was already published. Bump the version and re-tag — you can't reuse one. |
214
+ | Went to PyPI when you wanted TestPyPI | The tag had no `aN`/`bN`/`rcN` suffix, so it's treated as prod. Use a pre-release tag (`rcN`) for TestPyPI. |
215
+ | Tests fail → nothing published | Working as designed. The `publish` job depends on `test`. |
216
+
217
+ ---
218
+
219
+ ## Notes for maintainers
220
+
221
+ - `src/agents/packages/stratonext_sdk/` is a **generated copy** of `src/libs/sdks/python/`
222
+ (via `task gen_sdk_python`). Releases build from the canonical `src/libs/sdks/python/`,
223
+ so the copy doesn't affect published artifacts; it re-syncs on the next codegen run.
224
+ - The CLI targets **prod by default** — there is no separate per-environment build.
225
+ A pre-release is just an earlier CLI version published to TestPyPI; running it against
226
+ a non-prod backend is done with the `STRATONEXT_*` env vars. See `SKILL.md` → *Installing*.
227
+ - Headless/CI machine auth for the CLI isn't supported yet; releases are published by
228
+ the workflow via OIDC, not by a human running the CLI.