@apilift/cli 1.5.11 → 1.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apilift-collector.js +42 -13
- package/dist/apilift-native-host.js +49 -13
- package/dist/apilift.js +8481 -1226
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/plugin/skills/discover/SKILL.md +2 -2
- package/dist/plugin/skills/discover/references/browser-capture.md +1 -1
- package/dist/plugin/skills/discover/references/documented-api.md +2 -0
- package/dist/plugin/skills/discover/references/operation-contract.md +10 -2
- package/package.json +3 -2
|
@@ -17,13 +17,13 @@ Public apps let others reuse interface definitions; they do not grant access to
|
|
|
17
17
|
|
|
18
18
|
If a new private app draft is refused because `private_apps` requires a paid plan, continue with `creation.visibility: "public"` in the retained draft, check and publish, unless the user required a private interface or the app itself is personal or company-internal. Announce that reusable definitions will be public; do not ask for confirmation merely because an earlier draft was private or abandon discovery for browser-only work on that basis. Preserve explicit private-only requirements and existing private apps; do not convert an existing app or weaken another entitlement boundary. For private-only work or an intrinsically private app, retain the draft and explain the upgrade prerequisite. If the user requests browser-only work without Apilift, use the browser without starting discovery.
|
|
19
19
|
|
|
20
|
-
For every requested action, assess current first-party operation and access documentation before browser preflight. `apilift discover api assess <entity.verb>` creates a focused editable finding; save a researched conclusion with `discover api save`. API documentation, authorization, and credential acquisition are separate questions. A missing local key or authentication failure does not prove the API route is absent. Use [documented-api.md](references/documented-api.md) for this decision. Use [browser-capture.md](references/browser-capture.md) only when the requested operation still needs observed UI behavior.
|
|
20
|
+
For every requested action, assess current first-party operation and access documentation before browser preflight. `apilift discover api assess <entity.verb>` creates a focused editable finding; save a researched conclusion with `discover api save`. API documentation, authorization, and credential acquisition are separate questions. A missing local key or authentication failure does not prove the API route is absent. HTML responses, URL-encoded forms and fresh CSRF preparation do not by themselves require browser fallback. Use [documented-api.md](references/documented-api.md) for this decision. Use [browser-capture.md](references/browser-capture.md) only when the requested operation still needs observed UI behavior.
|
|
21
21
|
|
|
22
22
|
## Author one resource at a time
|
|
23
23
|
|
|
24
24
|
Use `apilift discover draft <kind> [name]` for `app`, `entity`, `transport`, `browser-page`, or `action`. Its response gives a private JSONC path; edit that file. The file contains the published `definition` and local `dependencies`, `verification`, and `capture` settings. App origin is its primary UI location, not every request destination. Publish missing entity and connection resources before an action that depends on them; a browser connection also needs a published browser page. Keep credential values and recurring local context values out of every definition. Read [operation-contract.md](references/operation-contract.md) before defining an action.
|
|
25
25
|
|
|
26
|
-
Check the selected file with `apilift discover check`; it sends no app request and reports independent field errors. Before the existing `apilift discover run`, construct `verification.inputs` as a consumer using the public contract and published value sources. When choices vary, use a materially different selection from the captured or documented example, including its configuration, rather than only changing a label. Resolve missing configuration sources before accepting review; an unexplained JSON object is not usable coverage. Trace the requested consumer path through target lookup, configuration and the usable result. For updates, use relevant non-default state and confirm preservation of settings outside the requested change. Locally confirm that removing each essential result member from a disposable copy fails the response schema; preserve saved evidence. Publish verified prerequisites independently and require the complete path at task completion. A connection instead selects `verification.probeOrigin`. Inspect saved output against official documentation or observed app state and accept `verification.review` only when it confirms the selected behavior and configuration. For a mutation, assess its separate readback proof and never repeat the write merely to improve evidence. After repairing a failed response or proof, `apilift discover run --proof-only` checks
|
|
26
|
+
Check the selected file with `apilift discover check`; it sends no app request and reports independent field errors. Before the existing `apilift discover run`, construct `verification.inputs` as a consumer using the public contract and published value sources. When choices vary, use a materially different selection from the captured or documented example, including its configuration, rather than only changing a label. Resolve missing configuration sources before accepting review; an unexplained JSON object is not usable coverage. Trace the requested consumer path through target lookup, configuration and the usable result. For updates, use relevant non-default state and confirm preservation of settings outside the requested change. Locally confirm that removing each essential result member from a disposable copy fails the response schema; preserve saved evidence. Publish verified prerequisites independently and require the complete path at task completion. A connection instead selects `verification.probeOrigin`. Inspect saved output against official documentation or observed app state and accept `verification.review` only when it confirms the selected behavior and configuration. For a mutation, assess its separate readback proof and never repeat the write merely to improve evidence. After repairing a failed response or proof, `apilift discover run --proof-only` checks saved evidence and sends only context checks, remaining declared navigation reads and readback. Metadata resources need no app execution. `apilift discover publish` publishes the exact selected version after its gates; a configured browser identity check revalidates the account through a read.
|
|
27
27
|
|
|
28
28
|
## Recover and finish
|
|
29
29
|
|
|
@@ -6,7 +6,7 @@ Publish a `browser-page` definition with `pageOrigin` and `startUrl` for the sel
|
|
|
6
6
|
|
|
7
7
|
Before recording, select an action draft and describe the domain entity, verb, effect, successful result, input meanings and verification plan. Put caller-chosen representative values in `verification.inputs`, declare their schema in the definition, and select the tab in the file's `capture` settings. Arm with `apilift discover capture start` before entering the first caller value when a UI editor autosaves. Perform one authorized scenario in the selected tab and immediately run `apilift discover capture stop` after its causal request. If stop acknowledgement is lost, retry stop without replaying the app operation or changing tabs; if the scenario cannot proceed, use `discover capture cancel`.
|
|
8
8
|
|
|
9
|
-
Stop returns a bounded ranked candidate list. Use `discover capture list` for further candidate metadata and `discover capture show <candidate-id>` for selected evidence. Choose the causal exchange with `discover capture select <candidate-id>`; selection updates the owned draft from the retained observation. Preserve observed structure, review every binding and response field, and replace private samples with caller inputs, generated values, public literals or reachable source actions. An observed identifier is not automatically a caller choice. Do not export raw capture data to the repository.
|
|
9
|
+
Stop returns a bounded ranked candidate list. Use `discover capture list` for further candidate metadata and `discover capture show <candidate-id>` for selected evidence. For HTML, inspect bounded retained structure with `discover capture show <candidate-id> --selector <CSS-selector>`; selection creates an incomplete extraction contract to finish from observed markup. Choose the causal exchange with `discover capture select <candidate-id>`; selection updates the owned draft from the retained observation. Preserve observed structure, review every binding and response field, and replace private samples with caller inputs, generated values, public literals or reachable source actions. An observed identifier is not automatically a caller choice. Do not export raw capture data to the repository.
|
|
10
10
|
|
|
11
11
|
Only when the selected request contains an unexplained authentication header, run `discover capture auth <candidate-id>` while evidence is current; no field or storage scope is required for its bounded default search of retained non-browser-owned headers against localStorage and sessionStorage. `discover capture show <candidate-id> --part request` displays header names and eligible field pointers without values. Narrow the search through the draft's `capture.authField` or `capture.authScope` only when the observed evidence supports it. Map a supported value-free locator to the browser connection's `definition.inject[].from` and its destination header to `definition.inject[].to`, then validate a safe connection probe; `definition.credentials` is only for separately saved human-provided secrets. Browser-managed cookies are sent by browser replay and do not require a storage locator. Do not turn secret values, browser-owned headers, or account data into action inputs or constants. Evidence expiry calls for a safe read or explicit primer, never another mutation.
|
|
12
12
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Search current first-party documentation for the selected operation and its authorization path. Record both in the file returned by `apilift discover api assess <entity.verb>`, then run `apilift discover api save`. A prose operation guide can be enough to author a selected action; an OpenAPI document is useful evidence but is not an import command. Documentation silence, a missing local credential, and an auth error are different findings. Follow explicit current documentation the user supplies even if an earlier assessment was negative.
|
|
4
4
|
|
|
5
|
+
HTML responses, URL-encoded forms, fresh CSRF tokens from one read-only preparation request and declared read navigation are supported direct operations when authorization permits. These formats do not establish a missing API route. Read [operation-contract.md](operation-contract.md) for the extraction and preparation contracts before deciding that a documented operation needs browser fallback. Browser-managed authentication or missing request documentation can still require browser observation; JavaScript-only rendering, uploads and workflows containing multiple writes remain outside these contracts.
|
|
6
|
+
|
|
5
7
|
A direct connection is an independent `transport` draft. Give it a meaningful description, `mode: "direct"`, fixed `baseUrl`, explicit `allowedOrigins`, value-free `credentials` requirements and harmless read `probes` for its destinations. Research and write concrete HTTPS acquisition steps before testing an operation that needs a key. The app's `origin` is its primary UI location; it is not a substitute for a connection destination. A transport with several origins needs one successful, semantically reviewed `discover run` per origin by editing `verification.probeOrigin` between runs. For a read using POST or another non-GET method, declare its semantic read effect rather than deriving effect from method.
|
|
6
8
|
|
|
7
9
|
If verification reports a missing or changed credential, follow the returned `credentials add` setup link. The person enters the value through the secure form, and the agent then selects the intended saved entry for this session with the exact CLI continuation. Do not ask for a key in chat or store it in a draft, command, environment variable, or capture. Acquisition instructions are required even if a key is already saved; they let the next user provision access. Re-run the same selected transport verification after human setup and inspect its meaning before accepting review.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Name a precise domain `entity.verb` for the requested outcome. Before transport capture, define its entity, semantic effect, caller decisions, useful returned result, and independent proof of a mutation. Compare related published actions by effect and supported choices before drafting; extend the same operation rather than duplicate a selection, but do not merge distinct effects merely because they share an endpoint. Do not expand one read into general CRUD coverage. Check whether returned objects are the requested entities or containers requiring traversal and pagination. HTTP success and a matching title do not establish complete coverage.
|
|
4
4
|
|
|
5
|
-
An action's published `definition` describes its effect, JSON Schema `inputs`, request, response and, for a mutation, readback proof. `dependencies.transport` selects one published connection and is translated to the action's selected transport at publication. Request fields include method, URL, optional headers, query and JSON body
|
|
5
|
+
An action's published `definition` describes its effect, JSON Schema `inputs`, request, response and, for a mutation, readback proof. `dependencies.transport` selects one published connection and is translated to the action's selected transport at publication. Request fields include method, URL, optional headers, query and either JSON body or URL-encoded `form`. Use typed `{"$input":"name"}` and encoded `{input.name}` bindings for caller values. Constants must be invariant for the operation: a public catalog selection is still an input. Generalize the same action when selections vary instead of adding example-specific or generic duplicates. Captured account identifiers, credential values and local defaults are not protocol constants. Use generated bindings for fresh request identifiers, never a caller flag invented from a captured identifier.
|
|
6
6
|
|
|
7
7
|
Public action names and descriptions state actual behavior, consequences and limits. Review the affected actions and dependencies together: source and result instructions must match consumer-visible paths, app/entity prose must distinguish domain capabilities from available coverage, and transport instructions must describe supported access requirements. Author verification establishes publication evidence; published execution validates the response without automatic readback. Consumers decide whether their task needs state confirmation through a published read; do not prescribe routine browser inspection.
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Each visible input and response field needs a semantic description; caller input
|
|
|
10
10
|
|
|
11
11
|
Select the useful response subtree with `response.path` when needed and validate it with `response.schema`; projected fields use paths relative to the selected subtree or array member. Preserve meaningful variants and nullable fields observed in real results. If verification reports a mismatch, inspect the selected value and correct its type or projection rather than weakening the contract to pass. Keep identity and relationship fields needed for further discovery. Captured properties are provisional: require the identity, result container or acknowledgement that establishes this operation’s result. Validate the intact saved output locally, then remove each essential member independently in disposable copies and confirm schema rejection; preserve the saved evidence and send no additional app request. Preserve legitimate empty collections, optional fields, nullable values, dynamic maps and bodyless responses; do not require every observed field.
|
|
12
12
|
|
|
13
|
-
During discovery, a mutation needs a separate read-only proof request and meaningful comparisons to the intended state. An update changes only requested settings: omitted values preserve existing state unless the contract explicitly describes replacement or reset semantics. For the existing verification run, choose an object with relevant non-default settings, read its state before the write, and compare the readback for both the intended change and preservation of settings the request could overwrite. Full replacement requires a consumer-accessible complete state; do not copy create defaults or unrelated empty objects into a narrow update. A proof failure leaves the write possibly applied. Repair the proof and use `apilift discover run --proof-only` against the saved primary response; this sends only
|
|
13
|
+
During discovery, a mutation needs a separate read-only proof request and meaningful comparisons to the intended state. An update changes only requested settings: omitted values preserve existing state unless the contract explicitly describes replacement or reset semantics. For the existing verification run, choose an object with relevant non-default settings, read its state before the write, and compare the readback for both the intended change and preservation of settings the request could overwrite. Full replacement requires a consumer-accessible complete state; do not copy create defaults or unrelated empty objects into a narrow update. A proof failure leaves the write possibly applied. Repair the proof and use `apilift discover run --proof-only` against the saved primary response; this sends only context checks, remaining declared navigation reads and readback. Never repeat a possibly sent write just to get stronger proof. For a delete, an explicit absence proof may establish success. A readback or probe using POST may declare semantic `effect: "read"`; method alone is not the effect.
|
|
14
14
|
|
|
15
15
|
Bind a returned identifier in the proof URL with `{result./id}`, or in its JSON body/query with `{"$result":"/id"}`; result pointers refer to the projected primary result. For a nested array or object map, use `proof.select: {"path":"/ticket/fields","where":[{"path":"/id","result":"/id"}]}` and compare `equals` paths relative to its single matching member. The selector must match exactly one item. If a map stores identity only in its keys, use `select: {"path":"/items","key":{"result":"/id"}}` or `key: {"input":"item_id"}` instead of `where`; select by exactly one of key or member-field conditions. Check identity and the fields that establish the intended effect, not an entire server-maintained object or a fixed array position. For a dynamic object key, use `{"attributes":{"{input.attribute_id}":{"$input":"value"}}}` in the request body. A proof path such as `/attributes/{input.attribute_id}` or `/attributes/{result./id}` substitutes one complete pointer segment and escapes `/` and `~` in its value; other pointer segments remain literal. For deletion from an exhaustive array or map, use `absent: true` with `select: {"path":"/items","where":[{"path":"/id","input":"item_id"}],"complete":true}`. The selector may use `key` instead of `where` when only map keys carry identity. This requires zero matches in a successful read; missing collections or member identity fields fail. `complete: true` is the author’s declaration that the read is exhaustive, never a partial page. A targeted absence proof without a selector still requires HTTP 404. Prefer a targeted detail or search read; absence from a partial list does not prove deletion.
|
|
16
16
|
|
|
@@ -19,3 +19,11 @@ When the task needs a few records from a large collection, look for native searc
|
|
|
19
19
|
Before `apilift discover run`, construct `verification.inputs` from the consumer contract and published source actions, not private author knowledge. Trace the requested consumer path: locate an existing target when applicable, obtain its configuration, perform the operation and obtain the result needed for the next step. Publish each prerequisite when its own contract is usable and verified; require the complete path at task completion, not before publishing every source action. Resolve missing dependencies before claiming coverage; a successful isolated action is insufficient. When choices vary, select a materially different valid configuration from the captured or documented example for this existing test; changing only its label does not test generalization. Resolve missing value or configuration sources first. Judge the saved output and mutation readback against the selected behavior and configuration before accepting `verification.review`; otherwise reject it with notes. The general contract defines the supported choices; another successful example alone does not prove them all. After publication, inspect `actions show` as a fresh consumer and finish the originally authorized outcome. Do not send a second mutation merely to test publication.
|
|
20
20
|
|
|
21
21
|
A genuinely terminal, command-scoped unavailable boundary may be documented only with evidence. Authentication, account tier, local transport, missing permission and ambiguous UI are retryable or user-specific blockers, not proof of app-wide absence. Keep existing working actions intact and defer unresolved work.
|
|
22
|
+
|
|
23
|
+
For returned HTML, declare `response.format: "html"` and `response.html: {marker:"#observed-page",fields:{title:{selector:"h1",read:"text"}}}`. Replace selectors with observed structure. The marker must match exactly once and distinguish the signed-in page from login. Fields support `read` values `text`, `attribute` with `attribute`, `value`, `checked`, or `json` for embedded JSON; `fields` nests objects and `many:true` returns records. Use explicit `type` conversion for numbers or booleans, and `optional:true` only for observed optional fields. Extraction produces JSON before existing `path`, `fields` and `schema` validation. Declare `html.errors` for observed form-validation messages. Scripts never run; rendered-only data needs an observed structured request. Capture show accepts `--selector <CSS-selector>` for bounded retained HTML inspection; capture select writes an incomplete contract for review.
|
|
24
|
+
|
|
25
|
+
Use `request.form` for observed `application/x-www-form-urlencoded` submissions, excluding `body`. Arrays become repeated fields; empty strings remain present and absent optional inputs are omitted. Represent checkbox wire values, omitted controls and the selected submit button explicitly; do not map caller booleans to browser behavior by assumption. One optional `request.prepare: {request:{method:"GET",url:"/settings/edit"},response:{...}}` extracts fresh internal values. Bind them with `{"$prepared":"/csrf"}` or a preservation path. Prepared values are refreshed per submission and never caller inputs. Declare unrelated non-default fields that a complete-form replacement must preserve. Transport form authentication uses `to:{in:"form",name:"csrf"}` on form submissions; read requests omit that form-only injection. Uploads and multiple-write workflows are unsupported.
|
|
26
|
+
|
|
27
|
+
Follow app navigation only when observed and declared: `response.continue:[{statuses:[200],format:"json",path:"/next"}]`, or an HTML rule with `selector` and `attribute`. Rules perform GET on the selected origin, resolve against the actual response URL, and share a five-read/20-second budget. A read may declare a non-2xx continuation; a rejected write cannot. Final responses use the result contract above. Never guess semantics from names such as redirectUrl or execute navigation scripts. Failed navigation retains the primary and completed reads for proof-only recovery.
|
|
28
|
+
|
|
29
|
+
For recovery through another tab, configure a browser transport `identity` before the mutation: one read-only `request`, a JSON or HTML `response`, and `paths` selecting stable account and tenant identifiers. Apilift stores a private keyed fingerprint scoped to app, transport and browser profile. Recovery checks that identity and current ownership before reading proof; publication rechecks configured identity without repeating the action. Do not publish captured identity values. Old evidence without an unambiguous retained request/account/target comparison remains blocked; inspect the returned private evidence paths and reconcile through reads. Never delete replay guards or rerun a write to repair missing historical identity.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apilift/cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"@pydantic/genai-prices": "0.1.8",
|
|
21
21
|
"ajv": "8.20.0",
|
|
22
22
|
"ajv-formats": "3.0.1",
|
|
23
|
+
"cheerio": "1.1.2",
|
|
23
24
|
"gpt-tokenizer": "4.0.0",
|
|
24
25
|
"jsonc-parser": "3.3.1",
|
|
25
26
|
"tinyexec": "1.3.1"
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"engines": {
|
|
37
38
|
"node": ">=24.16.0 <27"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "84ce4c274a4fdf8ee176c950fee0294937a56a7a",
|
|
40
41
|
"repository": {
|
|
41
42
|
"type": "git",
|
|
42
43
|
"url": "git+https://github.com/egor-sergeev/apilift.git",
|