Repository navigation
@versionone/agility-sdk 1.0.0-alpha.6 becomes master - #58
Conversation
The digital.ai Agility (formerly VersionOne) Javascript SDK is do for an update to modern Javascript tooling practices and idioms. We can also leverage TypeScript's type safety and modern module system to improve developer experience. We have almost a decade of API improvements and new capabilities that need to be integrated into the SDK.
wire/rest1: list, get and history over rest-1.v1 with the Attributes wrapper flattened, relations as Refs, display columns folded onto them, AssetState codes translated to names (ASSET_STATE_CODES from Core's enum), and every Data read required to carry a page. Schema-driven translation (spec 000-layers section 2a): api/asset and query.v1 render every scalar as a string and a sub-selected single relation as a one-element list, so a row cannot be put into the model's shape without the attribute's definition. services/schema loads asset types from meta.v1 one at a time as queries need them (in-flight requests shared, a missing type remembered, seedable from a metamodel document); wire/select resolves select paths (dotted, :Downcast, [filter], @count) against it; assetApi.fromWireRow translates numbers, booleans, single relations, aggregates and nested sub-select rows by type, and leaves unknown keys as sent. The client runs schema.ensureFor before every api/asset read. types/oid holds the one momentless/parseOid/isOidToken. test/integration/customFields: a driver for the classic UI's custom-field gadget (no API creates a definition), replaying the page's own pending record, recycling the app domain after each add; the suite proves custom Numeric and Boolean values translate through the client. Transport passes a FormData body through to fetch; live suites run one file at a time.
Surveys how k6i-agility-slack-bot and agility-rooms call Agility today, lists the SDK gaps they expose (browser credentials, auth-failure hook, cancellation, command-failure errors, loc2/queryV1, rest-1 writes, services port, CI/publishing), and sequences four tracks: the SDK itself, the slack bot (riding its Bolt Phase 2 seam rewrite), gh-v1 (blocked on access), and a strangler adoption for rooms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
gh-v1 (CommonJS Node, no dependencies, 99 tests on stubbed fetch) already implements in JS what the SDK plans: structured command failures by sourceCommandIndex, loc-2, flattened rest-1 reads, number resolution, and the ChangeDate compare-and-set guard and receipt pipeline in batch.js. Track C is now concrete (seam swap, delete string-boolean decodes, invert the services), the order puts gh-v1 first, and the CJS build is a named requirement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
…t-migration Track B now targets k6i-agility-slack-bot's bolt-migration branch, where services/v1.js (createV1Client on fetch, AuthFailureError on 401) is the seam the SDK swaps into; B no longer needs A1. New section: migrations each consumer adopts in its own session before the SDK arrives. gh-v1: CommonJS to ESM, checkJs typing, one paging policy. Slack bot: finish ESM tooling (jsconfig still says commonJS), query.v1 reads to api/asset (removing the SDK's need for a queryV1 module), close Bolt Phase 2 (drop botkit and axios), fixtures from real responses. plans/handoffs/ holds a paste-ready prompt for each session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
The gh-v1 bin is committed as 100644, so installing the extension fails on macOS and Linux, and its config comes only from a file the cloud environment's setup script cannot write (it cannot read secrets). G0 fixes the mode and accepts V1_URL + V1_ACCESS_TOKEN from the environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
api/asset answers 200 and commits per command, so failed commands live inside the envelope. send keeps returning them there by default and, with throwOnFailure, throws a CommandFailureError: an ApiError (status 200, code "CommandFailure") carrying each failure by sourceCommandIndex and the whole translated response, so what did commit is still known. Modelled on gh-v1's lib/api.js, which the C1 swap will replace with it. query/queries now always throw on a failed command: a query the server rejected used to come back as [] — a silent empty. Spec 000 §6 records the rule. README lists the current public names and links the now-public API documentation; the plan records it as a reference and ticks A2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
The now-public docs (docs.digital.ai/agility-api, asset-bulk/errors) confirm A2's model and add two facts, now in the code comments and a test: sourceCommandIndex is the original payload's index and a cascade from one failed create shares it (root cause first), and commandFailures.commands is the resubmittable retry list, verbatim. stackTrace appears only on internal development builds. Gap 6 closed: api/asset updates carry ChangeComment inside the update node (creates at the root; executes cannot), so the slack bot's rest-1 update-with-comment moves to api/asset and the SDK needs no rest-1 write path. Plan, B3 and both handoffs updated, with the docs URL and its llms-full.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
The harness reads V1_URL + V1_ACCESS_TOKEN (the names gh-v1 and the cloud
environment use) after SDK_TEST_*. Where it may write fixtures is now a
list: local instances, or hosted ones in API_TEST_INSTANCES (today
www14.v1host.com/v1sdktesting); other v1host.com URLs and V1Production
are still refused. The custom-fields suite recycles the app domain, so it
runs on local instances only. The launcher sets NODE_USE_ENV_PROXY when a
proxy is configured; Node's fetch otherwise ignores HTTPS_PROXY.
First live run there, now green (10 pass, 2 skip):
- api/asset now answers an unparseable body with 400 and { Exceptions:
[message] } (per the updated docs); the transport reads that shape into
ApiError.message, with a unit test copied from the live response and a
live test that it is a 400 and not retried.
- A2 live: a rejected query throws CommandFailureError by index beside a
real empty result.
- The schema suite brings its own StoryStatus (RollupState is required),
Story and Task, since the instance had no statuses; deletes by OID.
- Found: an em dash in a filter literal or where fails to parse, while a
with-variable works. Recorded in the plan for services that build
filters from user text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
loc-2.v1 takes its whole raw query string as LSON. Every tag is sent double-quoted in one JSON array, which survives tics, spaces, commas, `]`, escapes and non-ASCII (each round-tripped on the API-testing instance). A list too long for a URL is POSTed as the same payload, form-encoded, and marked idempotent since it is a read. The culture goes as Accept-Language; an empty list sends nothing; duplicates go once. An unmatched tag resolves to itself on the server, and the module does not invent a "missing". Unit tests use a live response; a live suite checks keys-as-sent, the unmatched-tag control, and GET/POST agreement. Both gh-v1's localize and the slack bot's fetchLocalizations map onto this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
gh-v1 loads packages with require. test/unit/cjs.test.ts builds the CJS bundle with tsup (no prior build needed), installs it with the real package.json under node_modules/@versionone/sdk in a temp dir, and runs a plain .cjs consumer that requires the package by name and uses it: the client's localize, a send with throwOnFailure (CommandFailureError is still an ApiError and an Error across the bundle), momentless. Checked that it fails when the exports map points at a missing file. Fixed while there: exports gave one "types": "./dist/index.d.ts" for both conditions. The package is "type": "module", so TypeScript reads that as ESM types, which mistypes a require() caller under NodeNext (gh-v1 after its checkJs migration). Each condition now names its own: .d.cts for require (tsup already emits it), .d.ts for import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
…query Live finding: when a query in a batch fails, api/asset omits its slot from queryResult.results and later results shift up (three queries, middle one failing: two arrays). send translated slot i by query i's type and handed callers results[i], so after a partial failure later rows were translated against the wrong type and read under the wrong query. send now realigns by sourceCommandIndex: one slot per query in request order, null where the query failed ([] still means it matched nothing), and an error rather than a guess when the counts disagree. Previews skip it (they answer with the projection). The unit fake from A2 that gave the failed query an empty slot was wrong, and now sends what the server sends; a live test pins the behaviour. Spec 000 §6 and the plan's findings record it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
Ported from gh-v1's lib/resolve.js, without the prompting. One api/asset
request asks every "number root" for all the numbers (100 per request):
the types whose Number is their own definition, recomputed from
metamodel.json by a unit test so the list cannot drift. That corrects
gh-v1's hand list (Epic, Theme, TestSet are Workitems now; Milestone,
Okr, OkrSession, Environment, Grant, ExternalActionInvocation were
missing) and replaces its second, rest-1 round trip. Each root selects
only what it has: the first live run failed on Grant.Name and
ExternalActionInvocation.Name, which the metamodel confirms do not exist.
Numbers go as a `with` list, never spliced into filter text. A root an
instance lacks fails alone ("Unknown AssetType"); it is remembered per
transport and the request asked once more without it. Any other failure
is thrown. Not found is `missing`, not an error. resolveRef takes an OID
token as is (no request) or resolves a number. On the client as
client.resolve.numbers / client.resolve.ref.
Unit tests use live-shaped rows; a live suite creates its own Story and
Issue, resolves them (mixed case, plus a bogus number) and deletes them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
services/guard ports gh-v1's guarded(): preview the batch, read each touched asset's ChangeDate, send each projected per-asset update/execute scoped to its ID and that ChangeDate, and report as skipped every touched asset the response did not modify or operate on. On the client as assets.sendGuarded. Shapes it cannot cover (aliased updates/executes, bare ones from an alias, inline creates, the Ideas product's types) throw UnguardableError before any request, instead of going out unguarded. A guarded batch with no creates is sent idempotent; send now takes that flag explicitly. The stamp was settled live, the hard way. A first version guarded on Moment because ChangeDate as a `with` variable never matched; the live race test then showed a stale Moment still matching: a filter on an earlier Moment selects the asset as it was then (as-of), so a Moment guard guards nothing. ChangeDate as a filter literal is a true compare-and-set (stale: no write; current: write; resend: no write), so the guard splices it as a literal after a strict timestamp check, the one exception to values-as-variables. The as-of behaviour stays pinned by a live test. Live suite: two Stories, one raced by another writer between the read and the send (skipped, keeps the other change), one updated; a resend writes nothing; deleted by OID. Spec 000 §6 and the plan record it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
services/batch ports gh-v1's preview-snapshot-send-receipt pipeline as data, leaving file I/O, console output, permalinks and the prompt to the CLI (confirm is a callback between the snapshot and the send). runBatch: refuse what cannot be guarded (unless guard: false; a bare update/execute from an alias always), preview, describe, name the touched assets (each type asked only for the Name/Number it has, per the schema), snapshot exactly what the batch overwrites plus ChangeDate, send guarded on those ChangeDates, then a receipt: outcome, created with aliases and numbers, touched, skipped, after-stamps and the reverse batch. dryRun stops after the snapshot. A send that fails outright throws BatchSendError carrying the receipt so far: whether it applied is unknown. reversible() drops from a receipt's reverse the assets changed since (their ChangeDate is no longer the after-stamp) unless forced. Services now read results through assetApi.outcomeOf (created, modified, operated, failures, query rows) and never the envelope; the layers test enforces that for services, as spec 000 §1 already said. Live: a guarded batch updating two Stories (scalar and multi-relation) and creating a Task, its receipt, and its reverse sent back through runBatch restore both Stories and delete the Task; a reverse skips an asset another writer changed unless forced. Plan C3 now maps gh-v1's resolve.js/batch.js onto these. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj65GY2KaXwFjZ9Jzyb
- Transport: credentials mode, onUnauthorized (resends an idempotent request once; a plain write never), per-request signal and client.withSignal. Spec 000 §6 updated. - CI: verify on Node 20/22/24 and an npm pack artifact; a prepare script so consumers can pin a git commit before a registry release. - plans/002 (gh-v1, Track C) and plans/003 (slack bot, Track B). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
The runner itself refuses V1Production and any hosted instance not set aside for API testing (spec 000 §5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
This reverts commit 3acd126. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
This reverts commit 5452f52. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
SDK: transport for real callers, CI, and consumer adoption briefs
gh installs a script extension with git clone alone, so the SDK ships in gh-v1's vendor/ with the commit it came from, pinned as a devDependency. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
api/asset can run every query query.v1 can, but query.v1 cannot write and answers with rows alone, so it is the safe, simple place to explore a query. Rows are spelled as api/asset spells them (probed 2026-11-06), so they translate through the same schema. - wire/queryV1: query/queries; a page required; POSTs marked idempotent (the endpoint cannot write); a refused query throws QUERY_REJECTED with the server's exception messages, never an empty result. - client.queryV1.query/queries, translated through the client's schema. - Integration (read-only): query.v1 and api/asset give the same rows; a miss is []; an unknown attribute fails the request. - Plans: A4 done; the slack bot keeps query.v1 reads (S2 is now "page every read", B1 maps query to client.queryV1). Spec §6 and README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
…ount error When a failure carried no sourceCommandIndex and the query results did not line up, send threw "cannot tell which result belongs to which query" and the real failure was lost. Now every query slot is null (no row is placed when any query may be the one that failed) and the failures are the answer: a CommandFailureError with the server's messages for reads and with throwOnFailure, or in the envelope otherwise. A count mismatch with no unattributed failure is still its own error. Spec 000 §6 updated. Found adopting the SDK in gh-v1 (C1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
queryV1 read module; plans for the vendored SDK and query.v1 reads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
- batch.run sends a batch of only aliased updates/executes (with guard
off) instead of treating it as nothing to do; Described.deferred lists
them, and the receipt notes they are unsnapshotted and not reversed.
- A failure reading back after the send throws BatchRecordError carrying
the receipt (sent, outcome, created, touched, reverse); only `after` is
incomplete. The record is built from the response before any read-back.
- confirm sees receipt.names: the touched assets' numbers and names, looked
up once (no second lookup after the send).
- namesOf takes an onFailure callback; runBatch turns failed lookups into
receipt.notes instead of swallowing them.
- An unset single relation, sent as { _oid: "NULL" }, translates to null
(with or without a schema; dropped from a multi-value list).
- Rank translates to a number (32-bit integers sent as strings); generated
types follow.
Live (v1sdktesting): an aliased QuickClose batch runs and is named; the
full integration tier passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NSWj9gL1oCubj5e2anVkb
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
meta.v1 sends one strong ETag for the whole schema and honours
If-None-Match with a 304 (live 2026-11-14). client.meta.read and
readType take ifNoneMatch and answer { value, etag } or null without a
download; client.meta.etag() reads the tag from the smallest resource;
TypeCache remembers the tag its types came with and
client.schema.revalidate() drops them only when it moved — what
agility-rooms' metamodel store does by hand today. The transport
resolves a 304 to undefined when a request says acceptNotModified.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
…choed off serialisation
The three leftovers from the adoption reports:
- Idempotent requests are resent once by default (`retries` 1, was 0),
after a network failure, a 5xx or a 429 — the instance throttles per
token and sends no Retry-After; one is honoured when present, up to
30 s. A plain write is never resent.
- A rejected query's `details` are the exceptions alone
({ type, message }[], QueryRejection), not query.v1's error document.
- CommandFailureDetail.echoed is readable but not enumerable, so a
serialised failure carries index, message and violation only.
Unit tier green (168). The live tier could not complete on 2026-11-14:
the testing instance was throttling the token (429) after a day of
adoption smokes; rerun when the window clears.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
… and the view-context gap Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
Every CI and publish run now ends with a runner warning: "Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4, actions/setup-node@v4, actions/upload-artifact@v4." The v4 majors declare `runs.using: node20`; the current majors (checkout v5+, setup-node v5+, upload-artifact v6+) declare node24, and all three are at v7. Both workflows move to v7. What changed between the majors crossed, checked against each action's action.yml and release notes: - checkout: inputs identical; v7 refuses a fork checkout under pull_request_target/workflow_run unless allow-unsafe-pr-checkout is set. CI runs on pull_request, so nothing changes. - setup-node: `cache: npm` is unchanged. v5 added automatic caching when package.json names a packageManager (it does not here); v7 no longer exports a dummy NODE_AUTH_TOKEN. npm 11.19 `npm ci` with the action's .npmrc and no NODE_AUTH_TOKEN was tested and works, and the stage step sets the variable itself as before, so trusted publishing is unaffected. publish.yml now sets package-manager-cache: false, as the action's trusted-publishing guide asks. - upload-artifact: v5 only bumped @actions/artifact, v6 moved to node24, v7 added an `archive` input that defaults to true. name/path are the same; the artifact is a zip as before. All three need runner 2.327.1 or later; the hosted runners are on 2.338.2. Node 24 has shipped npm 11.16 or later since 24.18.0, so `npm stage`'s floor (11.15) is met by setup-node alone; the explicit npm install stays as a guard against a lagging toolcache. Node floor: engines.node is now >=22 (was >=18). Node 18 reached end of life in April 2025 and Node 20 in April 2026. The matrix tests the maintained LTS lines, 22, 24 and 26, instead of 20, 22, 24. CHANGELOG records it as a breaking change for the next alpha. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj8b7T4dcswUnPdzYuv
tsup's target follows engines.node (node22, was node18), so the emitted syntax floor matches the claim; CHANGELOG's breaking line says so. 1.0.0-alpha.5 was published and tagged latest on 2026-11-14, so its heading loses "(unreleased)". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj8b7T4dcswUnPdzYuv
CI: actions on the Node 24 runtime; Node 22 or later
The consumer projects that drove the SDK's design are private; so are the product's source and the API-testing instance. Comments, test names and the changelog now say "a CLI consumer", "a chat-bot consumer", "a browser app consumer", "the server" and "the API-testing instance" instead. Unit-test fixtures copied from live responses keep their shape but carry fictitious identities (a made-up member, a neutral example base URL and the default dev-instance path). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6JhfcwPfucX8mr1jH
…ance meta.v1 spells each href from the instance's own path, so the committed metamodel carried the API-testing instance's name 19,196 times. The download script now rewrites hrefs to start at /meta.v1/ (raw pulls are left alone), the committed file is rewritten the same way, and a unit test checks both the rewrite and the committed file. Nothing in the SDK reads an href, and the generated types are byte-for-byte unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6JhfcwPfucX8mr1jH
The hosted instance set aside for API testing was named in test/integration/instance.ts and in spec 000. Its URL is the instance's name, and this repository is public, so the list now comes from SDK_TEST_ALLOWED_INSTANCES (comma-separated base URLs), set beside the credential by whoever runs the tier against a hosted instance. The rule is unchanged: local always, hosted only when allowed, V1Production never; it lives in test/integration/instanceGuard.ts, pure, with a unit test. Without the variable a hosted URL is refused with a message that says what to set. Live tier run with it: 40 passed, 3 skipped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6JhfcwPfucX8mr1jH
…it goes instead The repository is public and its history permanent, so working plans and consumer hand-offs no longer live here: plans go to a private planning repository, hand-offs to the consumer's own repository or to a message between sessions, and findings come back as public-worded issues, pull requests, tests and changelog lines. CONTRIBUTING.md says so and how to refer to consumers, the server, instances and people. Spec 000 gains the invariant, and test/unit/publicTree.test.ts enforces its mechanical parts by shape (a session id, a repository slug under the product's organisations other than this one, a hosted instance URL other than the documentation's example) without listing any name. plans/ is skipped by the test until it leaves the tree. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6JhfcwPfucX8mr1jH
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6JhfcwPfucX8mr1jH
The example base URL in the README, the client config doc, the metamodel script's usage and the unit-test fixtures was the product documentation's production example; an instance URL is an instance's name, so it is now a fictitious domain. The public-tree test loses its one exception and refuses any hosted instance URL. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6JhfcwPfucX8mr1jH
Public tree: no private repositories, sessions, people or instances; plans move out
The working plans and hand-offs have moved, with their history, to the private planning repository CONTRIBUTING.md describes. The public-tree test no longer skips plans/ and asserts the directory stays gone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
Plans leave the tree; the public-tree test scans everything
The current release's metamodel, pulled with the normalising script: 168 types kept, the instance's own definitions stripped. No type, attribute, flag or operation changed from 26.3.1.13; only the version stamp moved, so the generated files differ in their header alone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
…meric id Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NSWj6mJotpoJ4FontE4Kg
master's only change since the branch was cut is the 2.x eslint bump (#40); package.json keeps the branch's version, since the 2.x tooling is removed with the 2.x code. The tree is unchanged.
|
A reviewer's guide to this PR The diff adds about 190,000 lines, but about 7,400 of them need a person.
Reading order
Four short examples These type-check against A paged, typed read, with user text passed as a variable: import { AgilityApiClient } from "@versionone/agility-sdk";
const client = new AgilityApiClient({ baseUrl: "https://agility.example.com/MyInstance", accessToken: process.env.V1_ACCESS_TOKEN });
const stories = await client.query({
from: "Story",
select: ["Name", "Estimate"],
filter: ["Name=$name"],
with: { name: userText },
page: { size: 25, start: 0 },
});
// stories[0].Estimate is typed as a number, not the string "5"; a typo in select doesn't compile
const { rows, total, more } = await client.queryPage({ from: "Story", select: ["Name"], page: { size: 25, start: 0 } });A batch with a receipt, and undoing it later: const receipt = await client.batch.run(
[{ from: "Story:1234", update: { Estimate: 5 } }],
{ confirm: (r) => askUser(r.names) }, // guarded by default today
);
const { commands, drifted } = await client.batch.reversible(receipt);
if (drifted.length === 0) await client.assets.send(commands);An attachment, sent inline when it's small and in two steps when it's large: const info = await client.attachments.add("Story:1234", bytes, { filename: "notes.txt", contentType: "text/plain" });
const href = client.urls.attachment(info.id);In the browser with the session cookie, and handling errors by kind: import { AgilityApiClient, ApiError } from "@versionone/agility-sdk";
const client = new AgilityApiClient({
baseUrl: `${location.origin}/MyInstance`,
credentials: "same-origin",
onUnauthorized: async ({ retryable }) => {
await openLoginPopup();
return retryable ? "retry" : "fail"; // a plain write is never resent
},
});
try {
await client.get("Story:1234", ["Name"]);
} catch (e) {
if (e instanceof ApiError && e.kind === "transient") scheduleRetry();
else throw e;
}Planned changes that touch what you're reviewing |
|
@s-zimm @dgilbertdigital heads-up: I plan to merge this into
|
This merges
proposed_type_script_api_versionintomaster. The TypeScript SDK, published on npm as@versionone/agility-sdk(now1.0.0-alpha.6), becomes what the repository's front page shows. Until nowmasterhas shown the 2.x JavaScript SDK (v1sdk2.3.0), even though npm'slatestfor the new package installs the TypeScript one.What changes on master
v1sdkon npm is untouched.src/), with types generated from meta.v1 26.3.2.13;specs/000-layers.md;publish.yml, which publishes av*tag through npm trusted publishing behind an approval;CHANGELOG.md, with a migration line for every breaking change since alpha.0.README.mdandCONTRIBUTING.mdare replaced.Where 2.x lives afterwards
v2.3.0keeps the last 2.x release, andv1sdkstays on npm as published.One conflict to resolve before merging
mastergained a 2.x dependency bump after the branch was cut (versionone/VersionOne.SDK.JavaScript#40, eslint 1.10.3 → 6.8.0). It conflicts inpackage.json.package.jsonwhole, because 2.x's eslint setup is removed along with the 2.x code. It goes in as a merge commit on the branch, so this PR's diff stays the SDK and nothing else.What doesn't change
v*tag; merging publishes nothing.To review