@apilift/cli 1.5.8 → 1.5.9

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
@@ -30477,6 +30477,7 @@ function draftTemplate(kind) {
30477
30477
  transport: { definition: { title: "", description: "", mode: "direct", baseUrl: "", allowedOrigins: [], credentials: [], probes: {} }, dependencies: {}, verification: { inputs: {}, probeOrigin: "", review: "pending", notes: "" }, capture: { tab: "" } },
30478
30478
  "browser-page": { definition: { title: "", description: "", pageOrigin: "", startUrl: "" } }
30479
30479
  };
30480
+ const visibilityGuidance = kind === "app" ? "// creation.visibility controls sharing of interface definitions, not account access or local responses. Public consumers use their own authorized connection.\n// If private_apps requires a paid plan and the user did not require privacy, continue this draft with visibility public; announce the scope. Keep account-specific text and literals out of definitions.\n" : "";
30480
30481
  const probeGuidance = kind === "transport" ? [
30481
30482
  "// probes maps every exact allowedOrigins origin to a harmless documented read request and response contract.",
30482
30483
  '// Shape for each origin: { "request": { "method": "GET", "url": "<documented read URL>" }, "response": {} }',
@@ -30493,7 +30494,7 @@ function draftTemplate(kind) {
30493
30494
  ].join("\n") : "";
30494
30495
  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" : "";
30495
30496
  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// App-owned input source annotation: {"x-source":{"action":"ticket.list","path":"/*/id"}}. Run the source explicitly; it never runs implicitly.\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// Trace the requested consumer path through existing-target lookup, configuration and the result needed next; publish verified prerequisites independently and require the complete path at task completion. Compare related actions by effect and choices, not endpoint.\n// For updates, read relevant non-default state before the existing test; confirm the requested change and preservation of settings outside it. Omitted inputs preserve state unless replacement/reset is explicit.\n// Require essential identity/result members in response.schema. Validate intact saved output, then remove each essential member independently in disposable copies and confirm rejection; preserve saved evidence and preserve valid empty collections, optional fields and bodyless results.\n// Accept verification.review only when the result confirms that selection and configuration, preservation, and this action\u2019s usable step in the consumer path. Review affected descriptions and source/result paths together.\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// For valid readback variants, keep identity equals and add proof.response: {path:"/state",schema:{enum:["ready","empty"]}}, relative to the selected member. Exclude pending states; use proof-only reads after completion.\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' : "";
30496
- return `${head}${probeGuidance}${tabGuidance}${captureGuidance}${JSON.stringify(templates[kind], null, 2)}
30497
+ return `${head}${visibilityGuidance}${probeGuidance}${tabGuidance}${captureGuidance}${JSON.stringify(templates[kind], null, 2)}
30497
30498
  `;
30498
30499
  }
30499
30500
  var browserLocatorExample, names, object3, pointer;
@@ -34817,6 +34818,13 @@ File: ${draft.filePath}
34817
34818
  store.clearPublication(draft.id);
34818
34819
  const issue2 = parsed.data.error;
34819
34820
  if (issue2.code === "app-not-found") return fail5(`${issue2.code} \u2014 The published app is no longer accessible. Recheck its current registry identity with ${command4(invocation, `apps new ${draft.appSlug}`)}. Local drafts are preserved.
34821
+ `, cliExitForError(issue2), true);
34822
+ if (!draft.appId && issue2.code === "feature-required" && issue2.details.feature === "private_apps") return fail5(`${issue2.code} \u2014 ${issue2.message}
34823
+ Public apps share reusable interface definitions, not account access. Publication does not upload local captures, verification inputs, raw responses or credential values; each consumer uses their own authorized connection.
34824
+ Review definition text, field names, literals and examples for account-specific data; custom fields are not automatically all redacted. Keep variable identifiers and custom-field values in inputs, and use synthetic examples.
34825
+ Unless the user required a private interface, continue this draft as public: set creation.visibility to "public" in ${draft.filePath}, then ${command4(invocation, "discover check")} and ${command4(invocation, "discover publish")}. Announce the public scope; this rejection alone is not a reason to abandon discovery for browser-only work.
34826
+ If the user required privacy, retain the private draft and use the upgrade route: ${issue2.hint}
34827
+ If the user requested browser-only work without Apilift, honor that choice.
34820
34828
  `, cliExitForError(issue2), true);
34821
34829
  if (issue2.code === "version-conflict") return fail5(`The published resource changed after this draft was opened. Your edits are retained. Reconcile with ${command4(invocation, "discover rebase")}. No new version was published.
34822
34830
  `, 8, true);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apilift",
3
- "version": "1.5.8",
3
+ "version": "1.5.9",
4
4
  "description": "Use logged-in apps and discover missing actions with Apilift.",
5
5
  "author": {
6
6
  "name": "Apilift"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apilift",
3
- "version": "1.5.8",
3
+ "version": "1.5.9",
4
4
  "description": "Use logged-in apps and discover missing actions with Apilift.",
5
5
  "author": {
6
6
  "name": "Apilift"
@@ -11,6 +11,10 @@ Turn the requested outcome into the smallest set of reliable actions. Model each
11
11
 
12
12
  Find existing coverage with `apilift apps search <query>` and focused `actions search` or `actions show`. Begin a new app with `apilift apps new <slug>` or extend the selected existing app with `apilift apps update <app>`. Use the native worker identity. If the runtime cannot distinguish workers, bind a unique `APILIFT_SESSION` once in each worker’s launch environment or wrapper; a stable root `--session <worker-label>` remains an explicit override. Report the authoritative app and visibility before accessing its UI. One session owns at most one selected draft; leave another worker's draft alone.
13
13
 
14
+ Public apps let others reuse interface definitions; they do not grant access to the user's account. Publication excludes local captures, verification inputs, raw responses and credential values. Each consumer supplies their own authorized connection. Definitions themselves are shared: review descriptions, field names, literals and examples for account-specific data, bind variable identifiers and custom-field values as inputs, and use synthetic examples. Redaction does not automatically remove every custom field.
15
+
16
+ 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. Announce that reusable definitions will be public; do not ask for confirmation merely because the template started 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, retain the draft and explain the upgrade prerequisite. If the user requests browser-only work without Apilift, use the browser without starting discovery.
17
+
14
18
  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.
15
19
 
16
20
  ## Author one resource at a time
@@ -5,7 +5,7 @@ description: Use Apilift to read, create, update, rename, or export data in logg
5
5
 
6
6
  # Use an indexed app
7
7
 
8
- Use Apilift when a more direct installed capability does not cover the requested outcome. For a task in a logged-in app, check Apilift coverage before opening or operating its browser UI. Treat the CLI's current output as the navigation and execution contract. Do not read discovery drafts, captures, registry internals, browser storage, or implementation code to learn how to call a published action.
8
+ If the user explicitly requests browser-only work without Apilift, honor that choice without checking coverage or starting discovery. Otherwise, use Apilift when a more direct installed capability does not cover the requested outcome. For a task in a logged-in app, check Apilift coverage before opening or operating its browser UI. Treat the CLI's current output as the navigation and execution contract. Do not read discovery drafts, captures, registry internals, browser storage, or implementation code to learn how to call a published action.
9
9
 
10
10
  Start with `apilift` if the next command is unknown. Search by app name or domain with `apilift apps search <query>`, then select the intended app with `apilift apps use <app>`. Search unknown task vocabulary with `apilift actions search <app> <query>`; use the displayed `actions list` or `actions show` command for focused documentation. An action’s `actions show` includes compact documentation for its direct input-source actions; inspect that response before requesting separate source help, and use the included source contract when sufficient. Read the selected action's effects, inputs, result, limits, and source instructions before `apilift run <app> <entity.verb> [input flags]`. Native runtime identity isolates workers automatically. If it is unavailable, bind a unique `APILIFT_SESSION` in each worker’s launch environment or wrapper; keep that binding across requests and never share it between independent workers. Explicit `--session` remains an override. A selected app is a use-session choice, not proof that any action was verified or authorized. Cached documentation is last-known; execution still requires current online authorization.
11
11
 
@@ -13,6 +13,6 @@ Use explicit flags for ambiguous values. `apilift context set <name> <scalar> --
13
13
 
14
14
  For a direct connection requiring a saved credential, use the exact `credentials list`, `use`, or `add` continuation printed for that app and connection. Selection belongs to this agent session and does not switch browser login. Only the person uses the secure credential form; never ask for a secret in chat, shell arguments, environment variables, files, or a generic dashboard field. `credentials unbound` and `attach` are explicit recovery paths after a registry reset, never an invitation to match a secret by app name or origin. Run published browser actions directly: Apilift manages its browser connection and selected tab internally. Do not run browser preflight or use agent browser tools during covered app work unless the user requests browser work or a CLI failure explicitly requires it. Follow returned CLI tab-selection commands when needed; ask the user to sign in only on the returned authentication recovery. An unusable Chrome connection is a local blocker, not evidence that the app lacks an action.
15
15
 
16
- Respect policy, entitlement, effect, cost, and unavailable boundaries before dispatch. A refusal does not authorize direct HTTP or a new interface around it. Do not automatically retry a mutation that may have reached the app, including one whose result was lost. Follow the retained invocation's recovery instruction and inspect state through a documented CLI read. Published execution checks the response without automatic readback. Decide whether the user's outcome needs state confirmation through a published read; do not routinely inspect the UI. Check returned objects against the requested domain meaning, traverse pagination and containers where needed, and do not claim completion from a title or status code alone. Prefer published search, filter and detail actions when only a few records are needed. Read only the selected result fields needed for the decision; oversized output is saved to the path printed by the CLI. Search that file for relevant names or identifiers and extract matching records with ordinary file tools instead of loading the whole file into context. A saved response contains only fetched data, not unfetched upstream pages.
16
+ Respect policy, entitlement, effect, cost, and unavailable boundaries before dispatch. A refusal does not authorize direct HTTP or a new interface around it. A private-app plan requirement during new-app discovery is different: public reusable definitions do not share account access, credentials, local captures or raw responses. Follow the discovery skill and CLI continuation to publish public definitions when the user did not require privacy; this alone is not a reason to fall back to browser-only work. Do not automatically retry a mutation that may have reached the app, including one whose result was lost. Follow the retained invocation's recovery instruction and inspect state through a documented CLI read. Published execution checks the response without automatic readback. Decide whether the user's outcome needs state confirmation through a published read; do not routinely inspect the UI. Check returned objects against the requested domain meaning, traverse pagination and containers where needed, and do not claim completion from a title or status code alone. Prefer published search, filter and detail actions when only a few records are needed. Read only the selected result fields needed for the decision; oversized output is saved to the path printed by the CLI. Search that file for relevant names or identifiers and extract matching records with ordinary file tools instead of loading the whole file into context. A saved response contains only fetched data, not unfetched upstream pages.
17
17
 
18
18
  If the app, action, required input source, or result field is absent, tell the discovery owner the user outcome, the precise missing consumer capability, semantic input sources, required result, official documentation supplied by the user, and which published actions must remain intact. One owner should extend the app with the `discover` skill, then the consumer should read the newly published action help and complete the original task. Ask about test-state effects only when they are outside existing authorization. `apilift apps release <app>` ends this use session and clears its local selections and defaults when the work is done.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apilift/cli",
3
- "version": "1.5.8",
3
+ "version": "1.5.9",
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": "371aa6fdc44dfb35b65960678ad8567917746591",
39
+ "gitHead": "6e3521e8a46d5457d9f24398874230e99d419960",
40
40
  "repository": {
41
41
  "type": "git",
42
42
  "url": "git+https://github.com/egor-sergeev/apilift.git",