@apilift/cli 1.5.1 → 1.5.2
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.js
CHANGED
|
@@ -30806,7 +30806,7 @@ function draftTemplate(kind) {
|
|
|
30806
30806
|
""
|
|
30807
30807
|
].join("\n") : "";
|
|
30808
30808
|
const tabGuidance = ["action", "transport"].includes(kind) ? "// capture.tab is a selector returned by browser tabs; it selects the same signed-in Chrome tab for capture and discover run, including connection probes. Leave other sessions' tabs untouched.\n" : "";
|
|
30809
|
-
const captureGuidance = kind === "action" ? '// Public descriptions explain behavior, consequences and limits; do not instruct consumers to repeat runtime proof or browser checks. Author verification is separate from consumer judgment.\n// Request JSON/query uses typed {"$input":"name"} bindings; URL segments use {input.name}. Resolve every {unresolved.N} marker from retained evidence before running.\n// A readback through POST requires proof.effect: "read" alongside proof.request; HTTP method alone does not determine semantic effect.\n// JSON object keys may use {input.name}, e.g. {"{input.attribute_id}":{"$input":"value"}}.\n// Discovery-only mutation proof compares a readback path with exactly one input, primary result path or internal JSON value: equals: [{"path":"/ready","value":true}]. Public literals require semantic review; fixed proof expectations are not caller flags.\n// Proof URLs bind returned identifiers with {result./id}; JSON bodies/query use {"$result":"/id"}. Readback pointers may use a complete {input.name} segment for a dynamic key; slashes and tildes in its value are escaped.\n// For one member of a nested list: select: {"path":"/ticket/fields","where":[{"path":"/id","result":"/id"}]}; equals paths then refer to the single matching member. Compare identity and meaningful changed fields, not entire objects.\n// Repair a failed response/proof with discover run --proof-only; it reuses the saved primary response and sends only the readback. Publication still needs a successful test and accepted semantic review.\n// For large collections, investigate native search/filter/detail routes before enumeration. Search saved results locally and inspect only matching records; preserve structured dynamic fields.\n// After selecting a captured request, discover capture auth runs a bounded default search without authField or authScope. Set either only to narrow an observed field or location; browser-managed cookies need no locator.\n' : "";
|
|
30809
|
+
const captureGuidance = kind === "action" ? '// Public descriptions explain behavior, consequences and limits; do not instruct consumers to repeat runtime proof or browser checks. Author verification is separate from consumer judgment.\n// Request JSON/query uses typed {"$input":"name"} bindings; URL segments use {input.name}. Resolve every {unresolved.N} marker from retained evidence before running.\n// Keep only invariant protocol values constant; selected app values are inputs, even when public. Generalize one action across its supported choices.\n// Before discover run, construct verification.inputs from the consumer contract and published value sources. Use a materially different selection and configuration from the captured or documented example, not just another label. Resolve missing configuration sources first; unexplained JSON is not a substitute.\n// Accept verification.review only when the result confirms that selection and configuration and consumers can obtain the required inputs.\n// A readback through POST requires proof.effect: "read" alongside proof.request; HTTP method alone does not determine semantic effect.\n// JSON object keys may use {input.name}, e.g. {"{input.attribute_id}":{"$input":"value"}}.\n// Discovery-only mutation proof compares a readback path with exactly one input, primary result path or internal JSON value: equals: [{"path":"/ready","value":true}]. Public literals require semantic review; fixed proof expectations are not caller flags.\n// Proof URLs bind returned identifiers with {result./id}; JSON bodies/query use {"$result":"/id"}. Readback pointers may use a complete {input.name} segment for a dynamic key; slashes and tildes in its value are escaped.\n// For one member of a nested list: select: {"path":"/ticket/fields","where":[{"path":"/id","result":"/id"}]}; equals paths then refer to the single matching member. Compare identity and meaningful changed fields, not entire objects.\n// Repair a failed response/proof with discover run --proof-only; it reuses the saved primary response and sends only the readback. Publication still needs a successful test and accepted semantic review.\n// For large collections, investigate native search/filter/detail routes before enumeration. Search saved results locally and inspect only matching records; preserve structured dynamic fields.\n// After selecting a captured request, discover capture auth runs a bounded default search without authField or authScope. Set either only to narrow an observed field or location; browser-managed cookies need no locator.\n' : "";
|
|
30810
30810
|
return `${head}${probeGuidance}${tabGuidance}${captureGuidance}${JSON.stringify(templates[kind], null, 2)}
|
|
30811
30811
|
`;
|
|
30812
30812
|
}
|
|
@@ -34162,7 +34162,7 @@ Edit these fields, then run ${command4(invocation, "discover check")} or ${comma
|
|
|
34162
34162
|
`, 2);
|
|
34163
34163
|
return ok4(`${label(checked.draft.kind)} draft ${checked.draft.name} is structurally valid. No app request was sent.
|
|
34164
34164
|
File: ${checked.draft.filePath}
|
|
34165
|
-
${checked.draft.kind === "action" && checked.definition && !("unavailable" in checked.definition) || checked.draft.kind === "transport" ?
|
|
34165
|
+
${checked.draft.kind === "action" && checked.definition && !("unavailable" in checked.definition) || checked.draft.kind === "transport" ? `${checked.draft.kind === "action" ? "Before testing, construct inputs from the consumer contract and published value sources. When choices vary, use a different selection and configuration from the example, not just another label. Resolve missing configuration sources first.\n" : ""}Test its configured request before publication: ${command4(invocation, "discover run")}
|
|
34166
34166
|
` : ""}Publish: ${command4(invocation, "discover publish")}
|
|
34167
34167
|
`);
|
|
34168
34168
|
}
|
|
@@ -34698,7 +34698,7 @@ File: ${checked.draft.filePath}
|
|
|
34698
34698
|
The file is structurally valid, but its configured request has no current successful test and accepted semantic review.
|
|
34699
34699
|
File: ${draft.filePath}
|
|
34700
34700
|
Test explicitly: ${command4(invocation, "discover run")}
|
|
34701
|
-
Inspect the saved output and set verification.review to accepted only if it has the intended meaning, then publish again.
|
|
34701
|
+
Inspect the saved output and set verification.review to accepted only if ${draft.kind === "action" ? "it confirms the selected behavior and configuration and consumers can obtain the required inputs from the contract and published sources" : "it has the intended meaning"}, then publish again.
|
|
34702
34702
|
`);
|
|
34703
34703
|
if (draft.kind === "action") verification = { executableHash: identity2.executable, closureHash: identity2.closure, outcome: "success", semanticConfirmed: true, proof: checked.definition.effect === "read" ? "not-applicable" : "passed", verifiedAt: evidence.verifiedAt, clientVersion: cliVersion };
|
|
34704
34704
|
else {
|
|
@@ -34784,7 +34784,7 @@ Inspect distribution: ${command4(invocation, `apps history ${draft.appSlug} --re
|
|
|
34784
34784
|
Inspect the finding: ${command4(invocation, `actions show ${draft.appSlug} ${draft.name}`)}
|
|
34785
34785
|
When finished authoring: ${command4(invocation, "discover close")}
|
|
34786
34786
|
`, true));
|
|
34787
|
-
if (draft.kind === "action") return complete(ok4(`Published ${draft.name}. Its reviewed test
|
|
34787
|
+
if (draft.kind === "action") return complete(ok4(`Published ${draft.name}. Its reviewed test completed. Temporary draft and verification files were cleared; do not repeat the test.
|
|
34788
34788
|
Inspect arguments for future use: ${command4(invocation, `actions show ${draft.appSlug} ${draft.name}`)}
|
|
34789
34789
|
When finished authoring: ${command4(invocation, "discover close")}
|
|
34790
34790
|
`, true));
|
|
@@ -34923,7 +34923,7 @@ ${responsePath ? `Saved primary response and test inputs: ${responsePath}
|
|
|
34923
34923
|
Saved output: ${resultPath}
|
|
34924
34924
|
|
|
34925
34925
|
Review the actual objects and field meanings against the official docs or UI.
|
|
34926
|
-
Edit ${draft.filePath}: set verification.review to accepted only if this result has the intended meaning; otherwise rejected with verification.notes.
|
|
34926
|
+
Edit ${draft.filePath}: set verification.review to accepted only if ${draft.kind === "action" ? "this result confirms the selected behavior and configuration and consumers can obtain the required inputs from the contract and published sources" : "this result has the intended meaning"}; otherwise rejected with verification.notes.
|
|
34927
34927
|
${draft.kind === "transport" && draft.baseVersion ? `If this task requires publishing connection changes or renewed verification, publish: ${command4(invocation, "discover publish")}. If you only checked the existing connection, discard this local draft: ${command4(invocation, "discover discard")}.` : `Then publish: ${command4(invocation, "discover publish")}`}
|
|
34928
34928
|
Publication does not send another app request.
|
|
34929
34929
|
`, exitCode: 0, stdoutJson: true, dispatched: true };
|
|
@@ -35152,7 +35152,7 @@ function selectCapture(invocation, draft, source, item) {
|
|
|
35152
35152
|
return ok4(`Filled the owned ${draft.name} draft with the captured request structure and available response variants from c${item.seq}.
|
|
35153
35153
|
Edit: ${draft.filePath}
|
|
35154
35154
|
|
|
35155
|
-
Review bindings, response fields and pagination against the observed UI. Captured values stay private; exact declared samples become typed inputs. ${unresolved.length ? `Resolve ${unresolved.length} wire positions (${unresolved.join(", ")}) marked {unresolved.N}: choose a declared input, generated binding or
|
|
35155
|
+
Review bindings, response fields and pagination against the observed UI. Captured values stay private; exact declared samples become typed inputs. ${unresolved.length ? `Resolve ${unresolved.length} wire positions (${unresolved.join(", ")}) marked {unresolved.N}: choose a declared input, generated binding or invariant protocol constant. Selected app values remain inputs even when public. ` : ""}${inferenceComplete ? "" : `Response inference reached its 20,000-node/depth budget; the schema is incomplete. Inspect the retained response and complete its contract. `} Resolve missing inputs, then ${command4(invocation, "discover check")}. Test explicitly when appropriate: ${command4(invocation, "discover run")}.
|
|
35156
35156
|
${authHint}`);
|
|
35157
35157
|
}
|
|
35158
35158
|
async function captureDraft(invocation, api, state, store, session, root) {
|
|
@@ -5,7 +5,7 @@ description: Create or extend a persistent Apilift interface from current docume
|
|
|
5
5
|
|
|
6
6
|
# Discover or extend an app
|
|
7
7
|
|
|
8
|
-
Turn the requested outcome into the smallest set of reliable actions. Remain one discovery owner for the app's semantic decisions, browser operation, verification, cleanup, and publication. Do not use source code, old capture files, another worker's drafts, browser storage, or secret values as an answer key. Follow the CLI's current response and the returned editable files for command details; this skill supplies decisions that must be made before those commands.
|
|
8
|
+
Turn the requested outcome into the smallest set of reliable actions. Model each operation across its supported caller choices; a selected example is an input, not a separate action or a fixed constant. Remain one discovery owner for the app's semantic decisions, browser operation, verification, cleanup, and publication. Do not use source code, old capture files, another worker's drafts, browser storage, or secret values as an answer key. Follow the CLI's current response and the returned editable files for command details; this skill supplies decisions that must be made before those commands.
|
|
9
9
|
|
|
10
10
|
## Select scope and route
|
|
11
11
|
|
|
@@ -17,7 +17,7 @@ For every requested action, assess current first-party operation and access docu
|
|
|
17
17
|
|
|
18
18
|
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.
|
|
19
19
|
|
|
20
|
-
Check the selected file with `apilift discover check`; it sends no app request and reports independent field errors.
|
|
20
|
+
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. 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 the saved response and sends only the readback. Metadata resources need no app execution. `apilift discover publish` publishes the exact selected version after its gates and sends no app request.
|
|
21
21
|
|
|
22
22
|
## Recover and finish
|
|
23
23
|
|
|
@@ -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. 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. Use typed `{"$input":"name"}` and encoded `{input.name}` bindings for caller values.
|
|
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. 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 descriptions state behavior, consequences and limits. 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
|
|
|
@@ -16,6 +16,6 @@ Bind a returned identifier in the proof URL with `{result./id}`, or in its JSON
|
|
|
16
16
|
|
|
17
17
|
When the task needs a few records from a large collection, look for native search, filters or a detail endpoint in documentation or observed UI requests before enumerating the list. Expose observed parameters and verify that they narrow the results. If only a full response is available, search its saved file and extract matching records or fields; do not load the entire catalog into context. Keep stable identity and summary fields in list results; inspect variable configuration only for the selected item. Preserve dynamic configuration as structured JSON with an appropriate schema, rather than enumerating catalog entries or removing validation to pass.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Before `apilift discover run`, construct `verification.inputs` from the consumer contract and published source actions, not private author knowledge. 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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apilift/cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=24.16.0 <27"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "9b4a54e01dc6675ecf959fc5a8b1090d54af0a9e",
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|
|
42
42
|
"url": "git+https://github.com/egor-sergeev/apilift.git",
|