Commit Graph

4 Commits

Author SHA1 Message Date
Matthieu Sieben 952354c1dd Improve performances of lexParseJsonBytes function (#4836)
* Improve performances of `lexParseJsonBytes` function

* tidy

* tidy

* Add test for repeated keys; fix import order in bench file

Agent-Logs-Url: https://github.com/bluesky-social/atproto/sessions/3cb30e99-4d11-4396-82a3-79c2eb5ca6cf

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* Fix `lexParseJsonBytes` strict mode to match `lexParse` behavior (#4843)

* Initial plan

* Fix lexParseJsonBytes strict mode to match lexParse behavior

- Fix parseNull/parseTrue/parseFalse to throw SyntaxError with 'Unexpected token' (matching JSON.parse)
- Fix parseNumber to compute full value before validating, throw TypeError('Invalid non-integer number: ${value}') in strict mode (matching lexParse)
- Fix parseObject to throw TypeError (not SyntaxError) for invalid $bytes, $link, and blob objects
- Use parseTypedBlobRef instead of isBlobRef for blob validation
- Add $type empty string check and improve $type error messages
- Update incorrect test: 1e10 is a safe integer and should not throw in strict mode
- Add comprehensive strict vs non-strict mode parity tests for lexParseJsonBytes vs lexParse

Agent-Logs-Url: https://github.com/bluesky-social/atproto/sessions/c72e3862-277f-4f61-b4eb-b5a334e42647

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* Improve code comment in parseNumber

Agent-Logs-Url: https://github.com/bluesky-social/atproto/sessions/c72e3862-277f-4f61-b4eb-b5a334e42647

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* tidy

* tidy

* tests

* tidy

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>
2026-04-14 17:04:14 +02:00
Matthieu Sieben 9af7a2d122 Password based agent implementation (#4443)
* Password based agent implementation

* tidy

* tidy

* wip

* tidy

* wip

* tidy

* wip

* tests

* tidy

* websocket

* tidy

* tidy

* tidy

* tidy

* tidy

* tidy

* tidy

* tidy

* changeset

* codegen

* tidy

* tidy

* tidy

* tidy

* tests

* tidy

* tidy

* tests

* tidy

* tidy

* tidy

* wip

* tidy

* memoize

* tidy

* tests

* tidy

* files reorg

* Ensure that default values match constraints

* wip

* use vitest to test lex

* Add readme

* fix lint

* add vitest workspace config

* vitest config

* vitest-cfg

* tests

* ignore coverage

* tidy
2026-01-01 13:28:29 +01:00
Matthieu Sieben e6b6107e02 Lex SDK improvements (#4457)
* Lex SDK improvements

* changeset

* tidy

* tidy

* Fix `include` option in `tsconfig.test.json` files

* tidy

* ignore "require" in cjs files

* tidy

* tidy

* Improve error management

* rename xrpc-error file

* tests

* fix lint

* lint

* tidy

* puppeteer cache busting

* fix oauth tests

* tidy

* wip

* tidy

* tidy

* tidy

* Forbid use of unsafe integers
2025-12-17 16:14:15 +01:00
Matthieu Sieben 261968fd65 New TS SDK (#4366)
* lex

* packaging

* moke packaging

* revert test changes

* do not build temp

* tidy

* automatically build the list of `@atproto/lex/com` lexicons

* fix build

* Remove "com" export

* ridy

* remove manifest option

* tidy

* rename

* tidy

* tidy

* tidy

* tests

* add procedure params

* stricter tests

* tidy

* Improve ui8 parsing

* tidy

* tidy

* code split

* code split

* fix reserved keywords conflict

* exclude packages/lex/src/tests/lexicons from lint

* reserved keywords

* safe identifier

* fix build

* move lib.js to src/lib.ts

* Move tests dir

* fix ci ?

* increast lint size

* Remove `Record` type alias for recordsz

* fix package json exports

* Add support for unsafe characters in defs and nsids

* tidy

* token tests

* tidy

* name consistency

* remove unused `unknownKeys` params option

* Fix "moving" keys in `DictSchema` (remove `IntersectionSchema`)

* REview comments

* adapt shebang in `env`

* Make sure union object have their $type property set in typings

* fix

* Improve typing of `UnknownTypedObject`

* lex improvements

* code reorg

* split lex-builder

* tidy

* improve packaging

* rename lex-validation to lex-schema

* lex client

* rename prettifier option

* add lex-client as dependency to "lex"

* Export client as part of main export

* re-write example app using @atproto/lex

* add missing lex-client to tsconfig

* tidy

* add "null" schema type

* Smaller bundle code footprint

* tidy

* correctness

* tidy

* code split and improved testing

* tidy

* refactor common utils

* test all implementations

* improve tests

* tidy

* fix build

* fixes

* tidy

* lint

* tests

* tidy

* fix oauth-example app

* tidy

* tidy

* tests

* tidy

* Return an actual `Uint8Array` from `fromBase64Node`

* tidy

* adapt xrpc-server

* Rename `Lex` to `LexValue`

* minor fixes

* fix tests

* fix tests

* tidy

* fix

* tidy

* tidy

* fix `verifyCidForBytes` implementation

* fix imports

* tidy

* split lex-json in own package

* make base64 tests faster

* Add interop tests

* lint error

* tidy

* tidy

* changeset

* implement lex-resolver and lex-install

* remove need for polyfill

* readme

* more details

* tidy

* allow specifying `service` header on a per request basis

* tidy

* tidy

* tidy

* tidy

* add custom/intersection validation schemas

* tidy

* tidy

* remive un-necessary util

* improve typing of `l.object` output

* make "name" required in lexicon method errors

* fix tests

* tidy

* tidy

* add error responses

* update readme

* add "like " to example

* readme improvements

* tidy

* error management improvements

* Improve error results

* tidy

* refactor

* tidy

* lock

* Update binary to `ts-lex`

* tidy

* tidy

* Add "Overview" section

* fix build

* update bin

* readme-improvements

* paul's feedback

* Update packages/lex/lex/README.md

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>

* Update packages/lex/lex/README.md

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>

* Update packages/lex/lex/README.md

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>

* Update packages/lex/lex/README.md

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>

* Update packages/lex/lex/README.md

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>

* Initial plan

* Address README review comments

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* Clarify client configuration inheritance behavior

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* Document allowLegacyBlobs default and compatibility implications (#15)

* Initial plan

* Add notes about default setting and compatibility for allowLegacyBlobs

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* Rename `Json` to `JsonValue` in lex-json package (#14)

* Initial plan

* Rename Json to JsonValue in lex-json package and dependent packages

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* Remove import alias for JsonValue in ipld.ts

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* Update packages/lex/lex/README.md

Co-authored-by: Paul Frazee <pfrazee@gmail.com>

* Update packages/lex/lex/README.md

Co-authored-by: Paul Frazee <pfrazee@gmail.com>

* Update packages/lex/lex/README.md

Co-authored-by: Paul Frazee <pfrazee@gmail.com>

* Update packages/lex/lex/README.md

Co-authored-by: Paul Frazee <pfrazee@gmail.com>

* Update packages/lex/lex/README.md

Co-authored-by: Paul Frazee <pfrazee@gmail.com>

* Update packages/lex/lex/README.md

Co-authored-by: Paul Frazee <pfrazee@gmail.com>

* review comments and fixes

* Add lex to the dockerfiles

* tidy

* changeset for lex packages

* tidy

* Tidy

* tidy

* tidy

* Move language parsing to lex-data

* tidy

* doctoc

* error handling

* tidy

* tidy

* tidy

* fix

---------

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>
Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2025-11-24 21:01:16 +01:00