Skip to content

Commit 8506ded

Browse files
authored
chore: move npm packages to the @PyModel scope (#70)
## Related Issue No issue — follow-up to #66 (GitHub org migration). This PR moves the npm side to the new org. ## Problem The GitHub org moved to `PyModel` (#66), but every workspace package still carries the `@pythoughts` npm scope, and releases still publish to `@pythoughts/pythinker-code`. Newer versions must publish under the `pymodel` npm org. ## What changed - Renamed all 18 workspace packages from `@pythoughts/*` to `@pymodel/*`: package names, workspace dependencies, imports, and every tooling reference (changesets config, `flake.nix` workspace names, CI workflows, release/native/brew/CDN scripts, docs, README badges). - Fixed escaped-scope references a plain replace misses: the api-extractor specifier-rewrite regex in the SDK dts build, vitest/tsdown `alwaysBundle` regexes, and the Windows path marker in the postinstall reach script. - Regenerated `pnpm-lock.yaml`; the `flake.nix` `pnpmDeps` hash is unchanged (verified by rebuilding — workspace names do not affect the fetched dependency set). - Added a `minor` changeset so the next release publishes `@pymodel/pythinker-code`. Out of scope: the VS Code Marketplace publisher (`pythoughts.pythinker-code`), `api.pythoughts.com` platform URLs, and the `ai.pythoughts.pythinker-server` LaunchAgent label — these are separate identities, not npm scope. ## Merge order Merge #67, #68, #69 first — their changesets name `@pythoughts/pythinker-code` and would break `changeset version` if this PR lands before them. ## Before the first publish (npm side, manual) 1. On npmjs.com, add a Trusted Publishing (OIDC) connection for `@pymodel/pythinker-code`: repository `PyModel/pythinker-code`, workflow `release.yml`. 2. After the first successful `@pymodel` release: `npm deprecate @pythoughts/pythinker-code "Moved to @pymodel/pythinker-code"`. ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md) document. - [x] I have linked a related issue, or explained the problem above. - [x] I have added tests that prove my feature works. (Mechanical rename; existing suites cover it.) - [x] Ran `gen-changesets` skill, or this PR needs no changeset. - [x] Ran `gen-docs` skill, or this PR needs no doc update. (Docs updated in the sweep.) ## Additional commits - The sweep also caught encoded-scope references a plain replace misses: api-extractor/tsdown/vitest regexes (`@pythoughts\/`), release-tag parsing in `produce-manifest.mjs` and `install.sh`, `%40…%2F` release-download URLs in the CDN build, and split specifiers in tests. - One drive-along test-infra fix: `skill-session.test.ts` temp-dir cleanup now retries, because a late journal flush races the recursive delete under full-suite load and threw ENOTEMPTY twice while gating this push.
1 parent 9d46551 commit 8506ded

657 files changed

Lines changed: 1261 additions & 1256 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/gen-changesets/SKILL.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ description: Use when generating changesets in the pythinker-code repository, in
77

88
`pythinker-code` uses changesets to manage versions and changelogs. The current user-facing published package is:
99

10-
- `@pythoughts/pythinker-code`: the CLI
10+
- `@pymodel/pythinker-code`: the CLI
1111

12-
All other `@pythoughts/*` packages are treated as internal packages, including `@pythoughts/pythinker-code-sdk`, `agent-core`, `kosong`, `kaos`, `pythinker-code-oauth`, `pythinker-telemetry`, and `migration-legacy`.
12+
All other `@pymodel/*` packages are treated as internal packages, including `@pymodel/pythinker-code-sdk`, `agent-core`, `kosong`, `kaos`, `pythinker-code-oauth`, `pythinker-telemetry`, and `migration-legacy`.
1313

1414
## Core Rules
1515

1616
1. **Inspect the actual changes first.** Use `git status` / `git diff --name-only` to identify which packages were actually changed.
1717
2. **List packages that changesets can release.** If a changed package is ignored in `.changeset/config.json`, do not put that ignored package in frontmatter together with a non-ignored package; changesets rejects mixed ignored/non-ignored frontmatter.
18-
3. **Map ignored internal changes to the affected released package.** If an ignored internal package changes CLI output or behavior, list `@pythoughts/pythinker-code` and describe the actual user-visible or release-artifact change in the changelog text.
19-
4. **Internal package source changes that enter the CLI bundle must manually list the CLI.** `@pythoughts/pythinker-code` inline-bundles `@pythoughts/*` source, but those internal packages are devDependencies from the CLI's perspective, so changesets will not automatically propagate bumps. If a change enters the CLI output, list `@pythoughts/pythinker-code`.
20-
- **Web app (`@pythoughts/pythinker-web`) changes always enter the CLI bundle.** `@pythoughts/pythinker-web` is ignored by changesets (see `.changeset/config.json`) and cannot be mixed with `@pythoughts/pythinker-code` in one changeset frontmatter. Describe the web change in the changelog text, but list `@pythoughts/pythinker-code` so the CLI release carries the bundled `dist-web` output.
18+
3. **Map ignored internal changes to the affected released package.** If an ignored internal package changes CLI output or behavior, list `@pymodel/pythinker-code` and describe the actual user-visible or release-artifact change in the changelog text.
19+
4. **Internal package source changes that enter the CLI bundle must manually list the CLI.** `@pymodel/pythinker-code` inline-bundles `@pymodel/*` source, but those internal packages are devDependencies from the CLI's perspective, so changesets will not automatically propagate bumps. If a change enters the CLI output, list `@pymodel/pythinker-code`.
20+
- **Web app (`@pymodel/pythinker-web`) changes always enter the CLI bundle.** `@pymodel/pythinker-web` is ignored by changesets (see `.changeset/config.json`) and cannot be mixed with `@pymodel/pythinker-code` in one changeset frontmatter. Describe the web change in the changelog text, but list `@pymodel/pythinker-code` so the CLI release carries the bundled `dist-web` output.
2121
5. **Docs-only and tests-only changes usually do not need a changeset.** README, internal docs, and `test/` changes that do not enter package output do not trigger a CLI bump.
22-
6. `@pythoughts/dashboard` / `dashboard-server` / `dashboard-web` are ignored by changesets and should not be handled.
22+
6. `@pymodel/dashboard` / `dashboard-server` / `dashboard-web` are ignored by changesets and should not be handled.
2323

2424
## Workflow
2525

2626
1. List the changed packages and check whether each one is ignored by `.changeset/config.json`.
2727
2. Choose a bump level for each package.
28-
3. If an ignored internal package change enters the CLI bundle, put `@pythoughts/pythinker-code` in frontmatter instead of mixing the ignored package into the same changeset.
28+
3. If an ignored internal package change enters the CLI bundle, put `@pymodel/pythinker-code` in frontmatter instead of mixing the ignored package into the same changeset.
2929
4. Create a short kebab-case file under `.changeset/`.
3030
5. Split unrelated changes into separate changesets; keep one logical change in one file.
3131

@@ -70,7 +70,7 @@ An internal package fixes a bug visible to CLI users:
7070

7171
```markdown
7272
---
73-
"@pythoughts/pythinker-code": patch
73+
"@pymodel/pythinker-code": patch
7474
---
7575

7676
Fix occasional loss of tool call results in long conversations.
@@ -80,7 +80,7 @@ An internal package has an internal-only change, but it enters the CLI bundle:
8080

8181
```markdown
8282
---
83-
"@pythoughts/pythinker-code": patch
83+
"@pymodel/pythinker-code": patch
8484
---
8585

8686
Unify tool execution metadata handling.
@@ -90,15 +90,15 @@ Only SDK source changed, and the CLI does not use it:
9090

9191
```markdown
9292
---
93-
"@pythoughts/pythinker-code-sdk": patch
93+
"@pymodel/pythinker-code-sdk": patch
9494
---
9595

9696
Clarify session status typing for internal SDK callers.
9797
```
9898

9999
## Web app changes
100100

101-
`@pythoughts/pythinker-web` is ignored by changesets and must **never** appear in a changeset frontmatter. Because the web app is bundled into the CLI release artifact, any web change that ships must list `@pythoughts/pythinker-code` instead and describe the actual web-facing change in the text.
101+
`@pymodel/pythinker-web` is ignored by changesets and must **never** appear in a changeset frontmatter. Because the web app is bundled into the CLI release artifact, any web change that ships must list `@pymodel/pythinker-code` instead and describe the actual web-facing change in the text.
102102

103103
- If a PR contains both web UI changes and server API changes, split them into separate changesets so each entry has a focused description.
104104
- Do not enumerate every micro-tweak; keep it to one sentence that captures what the web user gets.
@@ -107,7 +107,7 @@ Web-only fix:
107107

108108
```markdown
109109
---
110-
"@pythoughts/pythinker-code": patch
110+
"@pymodel/pythinker-code": patch
111111
---
112112

113113
Fix the web chat not scrolling to the bottom after sending a message.
@@ -117,15 +117,15 @@ Web UI plus server APIs in the same PR (split into two changesets):
117117

118118
```markdown
119119
---
120-
"@pythoughts/pythinker-code": minor
120+
"@pymodel/pythinker-code": minor
121121
---
122122

123123
Add the server-hosted web UI, including chat layout and session list behaviors.
124124
```
125125

126126
```markdown
127127
---
128-
"@pythoughts/pythinker-code": minor
128+
"@pymodel/pythinker-code": minor
129129
---
130130

131131
Add the server REST and WebSocket APIs that power the web UI.
@@ -134,9 +134,9 @@ Add the server REST and WebSocket APIs that power the web UI.
134134
## Red Flags
135135

136136
- You are about to write `major` without asking the user.
137-
- Internal package source enters the CLI bundle, but `@pythoughts/pythinker-code` is missing.
137+
- Internal package source enters the CLI bundle, but `@pymodel/pythinker-code` is missing.
138138
- A changeset frontmatter mixes ignored internal packages with non-ignored packages.
139-
- `packages/node-sdk` was not changed, but `@pythoughts/pythinker-code-sdk` was listed for "internal package sync".
139+
- `packages/node-sdk` was not changed, but `@pymodel/pythinker-code-sdk` was listed for "internal package sync".
140140
- The changelog entry is in Chinese.
141141
- The wording claims more than the diff actually did.
142142
- The CLI wording mentions internal package names, class names, or PR numbers.

.agents/skills/sync-changelog/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Use after a release succeeds, when maintainers need to sync apps/py
77

88
## Overview
99

10-
`pythinker-code` uses changesets for versioning. Each package gets its own `CHANGELOG.md`. The user-facing CLI package, `@pythoughts/pythinker-code`, writes its changelog here:
10+
`pythinker-code` uses changesets for versioning. Each package gets its own `CHANGELOG.md`. The user-facing CLI package, `@pymodel/pythinker-code`, writes its changelog here:
1111

1212
```text
1313
apps/pythinker-code/CHANGELOG.md
@@ -38,7 +38,7 @@ Core rule: the English docs changelog is the source of truth for user-facing rel
3838

3939
Before editing, confirm:
4040

41-
- The released version exists on npm (`npm view @pythoughts/pythinker-code versions --json`) or has a matching GitHub Release tag on `PyModel/pythinker-code`.
41+
- The released version exists on npm (`npm view @pymodel/pythinker-code versions --json`) or has a matching GitHub Release tag on `PyModel/pythinker-code`.
4242
- The top of `apps/pythinker-code/CHANGELOG.md` is that new version.
4343
- The current branch is clean, or you are on a dedicated docs-sync branch.
4444

@@ -76,7 +76,7 @@ Keep:
7676

7777
Remove:
7878

79-
- The upstream H1 `# @pythoughts/pythinker-code` because the docs page already has `# Changelog`.
79+
- The upstream H1 `# @pymodel/pythinker-code` because the docs page already has `# Changelog`.
8080
- Changesets subheadings such as `### Patch Changes`, `### Minor Changes`, and `### Major Changes`.
8181
- PR links such as `[#317](...)`.
8282
- Commit hash links such as ``[`2f51db4`](...)``.
@@ -156,7 +156,7 @@ Every version heading must carry its release date in parentheses:
156156
Take the date from the version's published GitHub Release tag, not from when you run the sync:
157157

158158
```bash
159-
git log -1 --format=%cs "@pythoughts/pythinker-code@<version>"
159+
git log -1 --format=%cs "@pymodel/pythinker-code@<version>"
160160
```
161161

162162
Use the half-width parenthesis form ` (YYYY-MM-DD)` on the English page. Never invent or guess a date; if the tag is missing, stop and confirm with the user.

.agents/skills/write-tui/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ When a controller or `PythinkerTUI` section keeps growing, split pure functions,
3535
The feature type decides the landing spot:
3636

3737
- **CLI arguments**`src/cli/commands.ts` / `src/cli/options.ts`, passed into the TUI via `src/cli/run-shell.ts`. The CLI never operates on the session directly.
38-
- **CLI subcommands**`src/cli/sub/`, non-interactive only; reach core via `@pythoughts/pythinker-code-sdk`.
38+
- **CLI subcommands**`src/cli/sub/`, non-interactive only; reach core via `@pymodel/pythinker-code-sdk`.
3939
- **Slash commands** → declare/parse/type under `src/tui/commands/`; add the execution entry in `PythinkerTUI`'s slash-command handler section; sink complex logic into `utils` or a focused component.
4040
- **Skill-derived commands** → hook into `buildSkillSlashCommands` / the skill command map; do not hard-code a single skill.
4141
- **Transcript message types** → define the shape in `src/tui/types.ts`, add/extend a `components/messages/` component, register the renderer in the transcript builder.

.changeset/README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,41 @@ Current publishable packages:
1010

1111
| Package | Directory | Description |
1212
| --- | --- | --- |
13-
| `@pythoughts/pythinker-code` | `apps/pythinker-code` | CLI / TUI application — provides the `pythinker` command after install |
14-
| `@pythoughts/pythinker-code-sdk` | `packages/node-sdk` | Public TypeScript SDK |
13+
| `@pymodel/pythinker-code` | `apps/pythinker-code` | CLI / TUI application — provides the `pythinker` command after install |
14+
| `@pymodel/pythinker-code-sdk` | `packages/node-sdk` | Public TypeScript SDK |
1515

1616
All other workspace packages are private internal packages, are not published to npm, and are excluded via `ignore` in `.changeset/config.json`:
1717

18-
- `@pythoughts/acp-adapter`
19-
- `@pythoughts/agent-core`
20-
- `@pythoughts/kaos`
21-
- `@pythoughts/pythinker-code-oauth`
22-
- `@pythoughts/pythinker-telemetry`
23-
- `@pythoughts/pythinker-web`
24-
- `@pythoughts/kosong`
25-
- `@pythoughts/migration-legacy`
26-
- `@pythoughts/protocol`
27-
- `@pythoughts/server`
28-
- `@pythoughts/server-e2e`
29-
- `@pythoughts/dashboard`
30-
- `@pythoughts/dashboard-server`
31-
- `@pythoughts/dashboard-web`
18+
- `@pymodel/acp-adapter`
19+
- `@pymodel/agent-core`
20+
- `@pymodel/kaos`
21+
- `@pymodel/pythinker-code-oauth`
22+
- `@pymodel/pythinker-telemetry`
23+
- `@pymodel/pythinker-web`
24+
- `@pymodel/kosong`
25+
- `@pymodel/migration-legacy`
26+
- `@pymodel/protocol`
27+
- `@pymodel/server`
28+
- `@pymodel/server-e2e`
29+
- `@pymodel/dashboard`
30+
- `@pymodel/dashboard-server`
31+
- `@pymodel/dashboard-web`
3232
- `pythinker-migration-legacy`
3333

34-
Version impact from internal dependencies must be judged manually. The published artifacts for CLI and SDK bundle internal workspace packages into the artifact itself; runtime `dependencies` of published packages must not include any `@pythoughts/*` internal workspace packages.
34+
Version impact from internal dependencies must be judged manually. The published artifacts for CLI and SDK bundle internal workspace packages into the artifact itself; runtime `dependencies` of published packages must not include any `@pymodel/*` internal workspace packages.
3535

3636
The repository's `.changeset/config.json` sets `updateInternalDependencies: "patch"`. Because internal packages are not published, you still need to manually select all affected publishable packages in the changeset — do not rely solely on automatic dependency bumps to express user-visible changes.
3737

3838
Example scenarios:
3939

4040
| Change | Changeset selection |
4141
| --- | --- |
42-
| Only modifies TUI behavior in `@pythoughts/pythinker-code` | Add `patch` / `minor` / `major` to `@pythoughts/pythinker-code` |
42+
| Only modifies TUI behavior in `@pymodel/pythinker-code` | Add `patch` / `minor` / `major` to `@pymodel/pythinker-code` |
4343
| Only modifies internal packages, no user-visible change in SDK / CLI | Usually no changeset needed |
44-
| Internal package fix changes the CLI user experience | Add a changeset to `@pythoughts/pythinker-code` describing the user-visible fix |
45-
| Internal package adds a new capability exposed by the SDK | Add a changeset to `@pythoughts/pythinker-code-sdk` |
46-
| SDK behavior change affects CLI user experience | Add changesets to both `@pythoughts/pythinker-code-sdk` and `@pythoughts/pythinker-code` |
47-
| Provider abstraction change affects SDK / CLI | Add changesets to the affected `@pythoughts/pythinker-code-sdk` and/or `@pythoughts/pythinker-code` |
44+
| Internal package fix changes the CLI user experience | Add a changeset to `@pymodel/pythinker-code` describing the user-visible fix |
45+
| Internal package adds a new capability exposed by the SDK | Add a changeset to `@pymodel/pythinker-code-sdk` |
46+
| SDK behavior change affects CLI user experience | Add changesets to both `@pymodel/pythinker-code-sdk` and `@pymodel/pythinker-code` |
47+
| Provider abstraction change affects SDK / CLI | Add changesets to the affected `@pymodel/pythinker-code-sdk` and/or `@pymodel/pythinker-code` |
4848
| Test-only, internal refactor, docs, or private debug tooling changes | Usually no changeset needed |
4949
| Bundled official plugin change under `plugins/` (e.g. `pythinker-datasource`) | No changeset — the plugin is versioned via its own `pythinker.plugin.json` / `plugins/marketplace.json` and shipped through the marketplace CDN, not the npm package |
5050

@@ -54,7 +54,7 @@ This repository uses npm's **Trusted Publishing** (OIDC-based) for publishing
5454

5555
### Configuration steps
5656

57-
1. Open each publishable package's page on the npm website, e.g. `https://www.npmjs.com/package/@pythoughts/pythinker-code`.
57+
1. Open each publishable package's page on the npm website, e.g. `https://www.npmjs.com/package/@pymodel/pythinker-code`.
5858
2. Go to **Settings** -> **Publishing access**.
5959
3. Find **Automate publishing with GitHub Actions** or **Add trusted publisher**.
6060
4. Click **Add a new trusted publisher**.
@@ -146,12 +146,12 @@ The root-level `pnpm run publish` first runs typecheck, lint, sherif, test, buil
146146
## Notes
147147

148148
- Every PR that affects publishable-package behavior or public API should include a corresponding changeset.
149-
- Changes under `plugins/` (the bundled official plugins such as `pythinker-datasource`) do **not** need a changeset: each plugin carries its own version in `pythinker.plugin.json` and `plugins/marketplace.json` and is distributed via the marketplace CDN, separately from the `@pythoughts/pythinker-code` npm package.
149+
- Changes under `plugins/` (the bundled official plugins such as `pythinker-datasource`) do **not** need a changeset: each plugin carries its own version in `pythinker.plugin.json` and `plugins/marketplace.json` and is distributed via the marketplace CDN, separately from the `@pymodel/pythinker-code` npm package.
150150
- Changeset files must be committed to the repository — release PRs are only triggered after they're merged.
151151
- Release PRs require human review and merge; they will not publish automatically.
152-
- Do not add release changesets for private internal packages; only select `@pythoughts/pythinker-code` and `@pythoughts/pythinker-code-sdk`.
153-
- If a change in an underlying internal package alters user-visible behavior or public API of a publishable package, add a changeset to the affected publishable package. For example, when a bug fixed in `@pythoughts/agent-core` resolves an issue CLI users encounter, add a changeset to `@pythoughts/pythinker-code` describing the user-visible fix.
154-
- `@pythoughts/pythinker-code` is the official CLI package name; after a global install it provides the `pythinker` command.
152+
- Do not add release changesets for private internal packages; only select `@pymodel/pythinker-code` and `@pymodel/pythinker-code-sdk`.
153+
- If a change in an underlying internal package alters user-visible behavior or public API of a publishable package, add a changeset to the affected publishable package. For example, when a bug fixed in `@pymodel/agent-core` resolves an issue CLI users encounter, add a changeset to `@pymodel/pythinker-code` describing the user-visible fix.
154+
- `@pymodel/pythinker-code` is the official CLI package name; after a global install it provides the `pythinker` command.
155155
- Make sure each publishable package on npm has a Trusted Publisher configured.
156156

157157
## References

.changeset/config.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
"baseBranch": "main",
88
"updateInternalDependencies": "patch",
99
"ignore": [
10-
"@pythoughts/acp-adapter",
11-
"@pythoughts/agent-core",
12-
"@pythoughts/kaos",
13-
"@pythoughts/pythinker-code-oauth",
14-
"@pythoughts/pythinker-telemetry",
15-
"@pythoughts/pythinker-web",
16-
"@pythoughts/kosong",
17-
"@pythoughts/migration-legacy",
18-
"@pythoughts/protocol",
19-
"@pythoughts/server",
20-
"@pythoughts/server-e2e",
21-
"@pythoughts/dashboard",
22-
"@pythoughts/dashboard-server",
23-
"@pythoughts/dashboard-web",
10+
"@pymodel/acp-adapter",
11+
"@pymodel/agent-core",
12+
"@pymodel/kaos",
13+
"@pymodel/pythinker-code-oauth",
14+
"@pymodel/pythinker-telemetry",
15+
"@pymodel/pythinker-web",
16+
"@pymodel/kosong",
17+
"@pymodel/migration-legacy",
18+
"@pymodel/protocol",
19+
"@pymodel/server",
20+
"@pymodel/server-e2e",
21+
"@pymodel/dashboard",
22+
"@pymodel/dashboard-server",
23+
"@pymodel/dashboard-web",
2424
"pythinker-migration-legacy"
2525
],
2626
"snapshot": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"@pythoughts/pythinker-code": patch
2+
"@pymodel/pythinker-code": patch
33
---
44

55
Keep the current thinking effort when switching models in the model picker instead of silently saving the new model's lowest level as the default, and repair a stale thinking mode in the config when saving an effort.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"@pythoughts/pythinker-code": patch
2+
"@pymodel/pythinker-code": patch
33
---
44

55
Keep the thinking effort chosen with Ctrl-T/Shift-Tab as the default across restarts.

.changeset/pymodel-npm-scope.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": minor
3+
---
4+
5+
Publish the CLI under the @pymodel npm scope; install with `npm install -g @pymodel/pythinker-code`. The old @pythoughts scope is deprecated and no longer receives releases.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"@pythoughts/pythinker-code": patch
2+
"@pymodel/pythinker-code": patch
33
---
44

55
Show only the animated thinking indicator while the model thinks; the streamed thinking text no longer appears in the transcript unless expanded with Ctrl+O.

0 commit comments

Comments
 (0)