Repository navigation
[wip] cf-os api: generate from upstream's API schema, and print its declarations - #23
Closed
Maximo-Guk wants to merge 3 commits into
Closed
Maximo-Guk wants to merge 3 commits into
Maximo-Guk wants to merge 3 commits into
Conversation
Pins cloudflare/cloudflare-os#860 at f6bf761 so `cf-os api` can be built on its generated schema. A preview pin, not for merging: it moves to the commit on upstream's main once #860 lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tions The generator reads the pin's packages/api-schema/generated/ workshop-api.schema.json (cloudflare/cloudflare-os#860) instead of extracting api.ts itself, so the extractor and typescript6 leave this repository; the CLI emitter and the runtime stay. A pin without the file, or a schema in another format, fails naming it. The stdout contract, --check and --since are unchanged, and the command table is the same. `cf-os api types [<service>]` prints upstream's agent declarations, whole or one service's fragment, from a copy generated beside the command table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
LGTM! |
`cf-os api create-account <username> [--display-name <name>]` creates a
user to act as with `--username`, on a local dev server or test harness
(real deployments usually sign users in through Access). The password
comes only from CFOS_API_PASSWORD, hashed as password sign-in hashes it,
and never reaches argv, output or --dry-run; createAccount stays out of
the generated commands, and `create-account` is a reserved root name.
`cf-os api --help` and `search` now find it ("create a test user") and the
sign-in line for a local instance ("log in as bob"), so an agent learns
both from the CLI alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
LGTM! |
Member
Author
|
Superseded: the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP
Stacked on #19. Builds on cloudflare/cloudflare-os#860, which moves the API schema extractor upstream into
packages/api-schema.cf-os apigenerator reads the pin'spackages/api-schema/generated/workshop-api.schema.jsoninstead of extractingapi.tsitself. That removesgenerator/extract.tsandtypescript6from this repository. The CLI emitter and the runtime stay here. A pin without that file, or a schema in a format other thancapnweb-schema/0, fails with an error naming it.cf-os updatereads--checkand--since, including against a commit whose schema is still in the old formatcommands.tsdiffers only in its header linemain.test.tsnow also checks that nothingcf-os apiloads can reach@gadgets/*.cf-os api types [<service>]: prints upstream's agent declarations, either the whole file or one service's fragment. It reads a copy generated beside the command table, so the declarations always match the commands. The copy adds about 78 KB to the gzipped tarball.Preview pin.
02a2860pins #860's branch withcf-os update --preview --to pull/860. Before this merges, the pin has to move to #860's commit on upstream'smain.Testing
pnpm lintandpnpm testpass.pnpm api:generatereports no added, removed or changed commands.pnpm cf-os api types AdminApimatches upstream's fragment. An unknown service exits 2 and lists the services.pnpm cf-os update --dry-run --upstreamstill runs.🤖 Generated with Claude Code