Skip to content

Commit 290a655

Browse files
committed
Getting ready for 2.0.0 release
1 parent 79db731 commit 290a655

File tree

520 files changed

+4311
-6376
lines changed

Some content is hidden

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

520 files changed

+4311
-6376
lines changed

ADDING-PACKAGE.md

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This monorepo treats each package as a first-class split package.
44

55
Use this checklist when adding a new package.
66

7+
This is the sequence that actually works.
8+
79
## 1. Create The Package
810

911
Create the package directory under `packages/<name>` with:
@@ -21,6 +23,8 @@ For docs, keep the initial structure small:
2123
- `docs/overview.md`
2224
- `docs/quickstart.md`
2325

26+
The package must have a valid `composer.json` before it can be published to Packagist.
27+
2428
## 2. Register It In The Monorepo
2529

2630
Add the package to [packages.json](/Users/ddebowczyk/projects/instructor-php/packages.json):
@@ -41,6 +45,8 @@ Then update:
4145
- [CONTENTS.md](/Users/ddebowczyk/projects/instructor-php/CONTENTS.md)
4246
- [CONTRIBUTOR_GUIDE.md](/Users/ddebowczyk/projects/instructor-php/CONTRIBUTOR_GUIDE.md)
4347
- any docs registries under `packages/*/resources/config/docs.yaml` or `.yml`
48+
- docs landing pages if the package should appear there
49+
- examples/docs pointers if this package splits functionality out of another package
4450

4551
If the package adds public docs, give it:
4652

@@ -57,6 +63,8 @@ Run:
5763

5864
This regenerates the package matrix in `.github/workflows/split.yml` from `packages.json`.
5965

66+
Do not edit the split matrix by hand unless the generator is broken.
67+
6068
## 4. Create The GitHub Repo
6169

6270
Create the split repository with `gh`:
@@ -73,35 +81,81 @@ Verify it exists:
7381
gh repo view cognesy/instructor-http-pool --json name,url,visibility
7482
```
7583

76-
## 5. Add The Package To Packagist
84+
## 5. Make Sure The Split Repo Has Real Package Contents
85+
86+
Packagist will reject a new repo if `main` does not contain `composer.json`.
87+
88+
Before submitting to Packagist:
89+
90+
- push the monorepo changes that introduce the package, then let the split workflow publish it
91+
- or bootstrap the split repo manually with the package contents if you need it immediately
92+
93+
The important check is:
94+
95+
```bash
96+
gh repo view cognesy/instructor-http-pool --web
97+
```
98+
99+
Then confirm the repo `main` branch already contains:
100+
101+
- `composer.json`
102+
- `src/`
103+
- `README.md`
104+
105+
## 6. Add The Package To Packagist
106+
107+
Preferred path in this repo: Packagist API token from `.env`.
108+
109+
```bash
110+
PACKAGIST_API_USERNAME=$(sed -n "s/^PACKAGIST_API_USERNAME='\\(.*\\)'$/\\1/p" .env)
111+
PACKAGIST_API_TOKEN=$(sed -n "s/^PACKAGIST_API_TOKEN='\\(.*\\)'$/\\1/p" .env)
112+
113+
curl -X POST \
114+
-H 'content-type: application/json' \
115+
"https://packagist.org/api/create-package?username=${PACKAGIST_API_USERNAME}&apiToken=${PACKAGIST_API_TOKEN}" \
116+
-d '{"repository":{"url":"https://github.com/cognesy/instructor-http-pool"}}'
117+
```
118+
119+
Expected response:
77120

78-
Default path: manual.
121+
```json
122+
{"status":"success"}
123+
```
124+
125+
Then verify:
126+
127+
```bash
128+
curl -I https://packagist.org/packages/cognesy/instructor-http-pool
129+
curl -I https://repo.packagist.org/p2/cognesy/instructor-http-pool.json
130+
```
131+
132+
Manual fallback:
79133

80134
1. Open `https://packagist.org/packages/submit`
81-
2. Submit the split repository URL, for example:
82-
`https://github.com/cognesy/instructor-http-pool`
135+
2. Submit the split repository URL
83136
3. Confirm the package name from `composer.json`
84-
4. In Packagist package settings, enable the GitHub hook or auto-update
85-
86-
If you want to automate this later, use a Packagist token and their API. That is not part of the current default workflow.
137+
4. Enable the GitHub hook or auto-update
87138

88-
## 6. Verify The Package Is Discoverable
139+
## 7. Verify The Package Is Discoverable
89140

90141
Check:
91142

92143
- docs autodiscovery sees `packages/<name>/docs`
93144
- split workflow contains the package
94145
- root Composer autoload includes the namespace
95146
- package `composer.json` is valid
147+
- Packagist can resolve the package
148+
- the split repository exists and is public
96149

97150
Useful checks:
98151

99152
```bash
100153
composer validate packages/http-pool/composer.json
101154
rg "http-pool" packages.json .github/workflows/split.yml packages/*/resources/config
155+
gh repo view cognesy/instructor-http-pool --json url,defaultBranchRef
102156
```
103157

104-
## 7. Run Focused QA
158+
## 8. Run Focused QA
105159

106160
At minimum:
107161

@@ -120,4 +174,5 @@ composer test
120174

121175
- `packages.json` is the source of truth for split-package registration.
122176
- `update-split-yml.sh` should be used instead of editing `.github/workflows/split.yml` by hand.
177+
- Packagist submission depends on the split repo, not the monorepo. If the split repo is empty, submission fails.
123178
- Keep package docs minimal at first. Add more only when the API stabilizes.

builds/docs-build/packages/agent-ctrl/10-opencode-bridge.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $result = SandboxCommandExecutor::forOpenCode()->execute($spec);
2525
$response = (new ResponseParser())->parse($result, OutputFormat::Json);
2626

2727
echo $response->messageText();
28-
// @doctest id="5913"
28+
// @doctest id="85e6"
2929
```
3030

3131
## Session Handling

builds/docs-build/packages/agent-ctrl/2-getting-started.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: 'Run your first prompt with AgentCtrl.'
77

88
```bash
99
composer require cognesy/agent-ctrl
10-
# @doctest id="4be1"
10+
# @doctest id="4014"
1111
```
1212

1313
You need at least one CLI binary installed and authenticated (`claude`, `codex`, or `opencode`).
@@ -20,7 +20,7 @@ use Cognesy\AgentCtrl\AgentCtrl;
2020
$response = AgentCtrl::codex()->execute('Summarize this repository.');
2121

2222
echo $response->text();
23-
// @doctest id="6a9a"
23+
// @doctest id="a8b5"
2424
```
2525

2626
## Runtime Agent Selection
@@ -31,5 +31,5 @@ use Cognesy\AgentCtrl\Enum\AgentType;
3131

3232
$agent = AgentType::from('codex');
3333
$response = AgentCtrl::make($agent)->execute('List top risks in this code.');
34-
// @doctest id="1033"
34+
// @doctest id="0841"
3535
```

builds/docs-build/packages/agent-ctrl/3-streaming.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $response = AgentCtrl::openCode()
1515
->onComplete(fn(AgentResponse $response) => print("\n[done]\n"))
1616
->onError(fn(string $message, ?string $code) => print("\n[error:$message]\n"))
1717
->executeStreaming('Explain this package architecture.');
18-
// @doctest id="846c"
18+
// @doctest id="2e88"
1919
```
2020

2121
`execute()` is a non-streaming convenience method.

builds/docs-build/packages/agent-ctrl/4-session-management.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use Cognesy\AgentCtrl\AgentCtrl;
1313
$response = AgentCtrl::codex()
1414
->continueSession()
1515
->execute('Continue from the previous plan and apply step 2.');
16-
// @doctest id="2c93"
16+
// @doctest id="2e32"
1717
```
1818

1919
## Resume Specific Session
@@ -29,7 +29,7 @@ if ($sessionId !== null) {
2929
->resumeSession((string) $sessionId)
3030
->execute('Now implement the first migration.');
3131
}
32-
// @doctest id="800c"
32+
// @doctest id="6cdc"
3333
```
3434

3535
`sessionId()` returns `AgentSessionId|null`.

builds/docs-build/packages/agent-ctrl/5-agent-options.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $response = AgentCtrl::claudeCode()
3131
->withPermissionMode(PermissionMode::BypassPermissions)
3232
->withMaxTurns(10)
3333
->execute('Refactor this service to remove duplication.');
34-
// @doctest id="6fa5"
34+
// @doctest id="4802"
3535
```
3636

3737
## Codex
@@ -56,7 +56,7 @@ $response = AgentCtrl::codex()
5656
->withSandbox(SandboxMode::WorkspaceWrite)
5757
->fullAuto()
5858
->execute('Write tests for this controller.');
59-
// @doctest id="a8e7"
59+
// @doctest id="65a9"
6060
```
6161

6262
## OpenCode
@@ -77,5 +77,5 @@ $response = AgentCtrl::openCode()
7777
->withAgent('coder')
7878
->withTitle('Repository cleanup')
7979
->execute('Find dead code and propose removals.');
80-
// @doctest id="3b70"
80+
// @doctest id="40d1"
8181
```

builds/docs-build/packages/agent-ctrl/6-response-object.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ if ($response->isSuccess()) {
3838

3939
echo $response->exitCode;
4040
echo $response->sessionId() !== null ? 'has session' : 'no session';
41-
// @doctest id="e4bd"
41+
// @doctest id="f4c2"
4242
```

builds/docs-build/packages/agent-ctrl/7-troubleshooting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ When using `inDirectory('/path')`, the directory must exist.
2121
$response = AgentCtrl::claudeCode()
2222
->inDirectory('/existing/path')
2323
->execute('List top 3 refactors.');
24-
// @doctest id="4e6d"
24+
// @doctest id="1b6d"
2525
```
2626

2727
## Stream Parse Failures

builds/docs-build/packages/agent-ctrl/8-claude-code-bridge.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $result = SandboxCommandExecutor::forClaudeCode()->execute($spec);
2525
$response = (new ResponseParser())->parse($result, OutputFormat::Json);
2626

2727
echo $response->messageText();
28-
// @doctest id="7191"
28+
// @doctest id="f314"
2929
```
3030

3131
## Streaming
@@ -38,7 +38,7 @@ $request = new ClaudeRequest(
3838
outputFormat: OutputFormat::StreamJson,
3939
includePartialMessages: true,
4040
);
41-
// @doctest id="319a"
41+
// @doctest id="f8d6"
4242
```
4343

4444
## Key Types

builds/docs-build/packages/agent-ctrl/9-codex-bridge.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $result = SandboxCommandExecutor::forCodex()->execute($spec);
2727
$response = (new ResponseParser())->parse($result, OutputFormat::Json);
2828

2929
echo $response->messageText();
30-
// @doctest id="9a99"
30+
// @doctest id="8f4d"
3131
```
3232

3333
## Streaming

0 commit comments

Comments
 (0)