@lotics/cli 0.76.0 → 0.76.1

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/client.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { KnowledgeUpgradeEntry, KnowledgeUpgradeResolutions, ContentUpgradeResolutions, ModifiedArtifact, PackageContentBinding } from "@lotics/shared/schemas/packages";
1
2
  /**
2
3
  * The error message for a non-ok response. A genuine JSON error (a 4xx carrying
3
4
  * a `message`) surfaces verbatim; a non-JSON body (a gateway HTML page), any
@@ -89,12 +90,33 @@ export interface PackageBinding {
89
90
  roles: Record<string, string>;
90
91
  workflows: Record<string, string>;
91
92
  }
92
- /** One finding from a bespoke→package extraction (`extractAppPackage`). */
93
+ /** One finding from a bespoke→package extraction (`extractPackage`). */
93
94
  export interface ExtractFinding {
94
95
  severity: "error" | "warning" | "info";
95
96
  area: string;
96
97
  message: string;
97
98
  }
99
+ /** A package's kind — a full app blueprint, or a standalone content package. */
100
+ export type PackageKind = "app" | "content";
101
+ /** One workspace's installation of a package's content (the standalone anchor). */
102
+ export interface ContentInstallation {
103
+ id: string;
104
+ workspace_id: string;
105
+ package_id: string;
106
+ package_version: number;
107
+ /** Set when the content arrived bundled with an app install; null for a standalone content package. */
108
+ app_id: string | null;
109
+ /** The namespaced content binding: `knowledge` (alias → `kdc_` id) + `templates` (alias → `tmpl_` id). */
110
+ binding: PackageContentBinding;
111
+ installed_by: string | null;
112
+ created_at: string;
113
+ updated_at: string;
114
+ }
115
+ /** Advisory knowledge warnings surfaced by install/upgrade (never block). */
116
+ export interface KnowledgeWarnings {
117
+ /** `knowledge_expects` doc names with no matching workspace doc. */
118
+ missing_expected_docs: string[];
119
+ }
98
120
  export declare const API_BASE_URL: string;
99
121
  export declare class LoticsClient {
100
122
  private apiKey;
@@ -222,22 +244,92 @@ export declare class LoticsClient {
222
244
  current_version_id: string | null;
223
245
  }>;
224
246
  /**
225
- * Install an app package version into the current workspace — scaffolds the
226
- * data model, deploys the package bundle, materializes its
227
- * queries/workflows/agents, and pins the installation. Returns the resulting
228
- * installation app. `version` omitted installs the latest published version.
247
+ * Install a package version into the current workspace — ONE endpoint,
248
+ * kind-branched into a discriminated response (`kind`). An `app` package
249
+ * scaffolds the data model / deploys / materializes and returns the installation
250
+ * app (+ advisory knowledge warnings); a `content` package installs only its
251
+ * doc corpus and returns the installation row. `bind_to` (content only)
252
+ * resolves a name collision by adopting an existing same-named doc as
253
+ * package-managed. `version` omitted installs the latest published version.
229
254
  */
230
- installAppPackage(package_id: string, body: {
255
+ installPackage(package_id: string, body: {
231
256
  version?: number;
257
+ /** Content-kind only: consent to adopt a same-named workspace doc on a knowledge collision. */
258
+ bind_to?: Record<string, string>;
259
+ /** App-kind only: per-knob config overrides applied over the contract defaults at install. */
232
260
  config?: Record<string, string | number | boolean>;
233
261
  }): Promise<{
234
- id: string;
235
- name: string;
236
- workspace_id: string;
237
- package_id: string | null;
238
- package_version: number | null;
239
- current_version_id: string | null;
262
+ kind: "app";
263
+ app: {
264
+ id: string;
265
+ name: string;
266
+ workspace_id: string;
267
+ package_id: string | null;
268
+ package_version: number | null;
269
+ current_version_id: string | null;
270
+ };
271
+ knowledge_warnings: KnowledgeWarnings;
272
+ } | {
273
+ kind: "content";
274
+ installation: ContentInstallation;
275
+ warnings: KnowledgeWarnings;
276
+ }>;
277
+ /**
278
+ * Uninstall a standalone content package — delete the installation row. By
279
+ * default the package-bound docs are ARCHIVED; `keep_content` retains them as
280
+ * ordinary workspace docs. Admin-only. Backs `lotics package uninstall`.
281
+ */
282
+ uninstallContentPackage(installation_id: string, opts?: {
283
+ keep_content?: boolean;
284
+ }): Promise<{
285
+ installation_id: string;
286
+ archived_doc_ids: string[];
287
+ archived_template_ids: string[];
288
+ deleted: true;
289
+ }>;
290
+ /**
291
+ * Preview upgrading a standalone content installation — the knowledge namespace's
292
+ * per-alias `entries` (added/changed/removed/drifted + a `modified` flag) plus the
293
+ * consent-requiring `templates` (a template the target changed whose live content
294
+ * was locally edited; a clean one auto-updates and is absent). No writes.
295
+ * Admin-only.
296
+ */
297
+ previewContentInstallationUpgrade(installation_id: string, opts?: {
298
+ version?: number;
299
+ }): Promise<{
300
+ installation_id: string;
301
+ package_id: string;
302
+ from_version: number;
303
+ to_version: number;
304
+ changelog: string | null;
305
+ update_available: boolean;
306
+ entries: KnowledgeUpgradeEntry[];
307
+ templates: ModifiedArtifact[];
240
308
  }>;
309
+ /**
310
+ * Apply a standalone content upgrade — propagate the target version's content per
311
+ * the resolutions (`knowledge`: a modified change/removal or drift needs consent;
312
+ * `templates`: a locally-edited changed template takes revert|keep), then advance
313
+ * the pin + binding. Returns the updated installation row. Admin-only.
314
+ */
315
+ applyContentInstallationUpgrade(installation_id: string, body: {
316
+ version?: number;
317
+ resolutions?: ContentUpgradeResolutions;
318
+ }): Promise<ContentInstallation>;
319
+ /**
320
+ * List a workspace's package-managed knowledge installations, each folded with
321
+ * registry status (name, kind, official badge, latest version, update-available).
322
+ * Member-accessible (workspace-scoped); backs the settings "Managed by" badge.
323
+ */
324
+ listContentInstallations(workspace_id: string): Promise<Array<ContentInstallation & {
325
+ package_registry: {
326
+ name: string;
327
+ kind: PackageKind;
328
+ is_official: boolean;
329
+ latest_version: number;
330
+ update_available: boolean;
331
+ } | null;
332
+ }>>;
241
333
  /**
242
334
  * Uninstall a package installation (backs `lotics package uninstall`). Does
243
335
  * everything DELETE does plus archives the installation's lifecycle
@@ -268,7 +360,7 @@ export declare class LoticsClient {
268
360
  * non-owning orgs; existing installations keep working and may still upgrade.
269
361
  * Owner-org admin-only.
270
362
  */
271
- retireAppPackage(package_id: string, body: {
363
+ retirePackage(package_id: string, body: {
272
364
  undo: boolean;
273
365
  }): Promise<{
274
366
  id: string;
@@ -282,7 +374,7 @@ export declare class LoticsClient {
282
374
  * app becomes a normal bespoke app and can no longer be upgraded. Returns the
283
375
  * resulting app.
284
376
  */
285
- ejectAppPackage(app_id: string): Promise<{
377
+ ejectPackage(app_id: string): Promise<{
286
378
  id: string;
287
379
  name: string;
288
380
  workspace_id: string;
@@ -290,7 +382,7 @@ export declare class LoticsClient {
290
382
  }>;
291
383
  /**
292
384
  * Extract a DRAFT app package from an existing bespoke app — the promotion
293
- * read (docs/app_packages.md § Promotion). Pure: nothing is written. Returns
385
+ * read (docs/packages.md § Promotion). Pure: nothing is written. Returns
294
386
  * the alias-keyed draft `contract` (opaque to the CLI — the server is the
295
387
  * validating authority), the origin workspace's `binding` (which doubles as
296
388
  * the adopt binding), a findings `report` (any `error` ⇒ not publishable
@@ -298,7 +390,12 @@ export declare class LoticsClient {
298
390
  * project at their `bytes_ref` paths. Backs `lotics package extract`.
299
391
  * Admin-only.
300
392
  */
301
- extractAppPackage(app_id: string): Promise<{
393
+ extractPackage(app_id: string, opts?: {
394
+ knowledge?: Array<{
395
+ alias: string;
396
+ doc_id: string;
397
+ }>;
398
+ }): Promise<{
302
399
  contract: unknown;
303
400
  binding: PackageBinding;
304
401
  report: ExtractFinding[];
@@ -307,6 +404,13 @@ export declare class LoticsClient {
307
404
  file_id: string;
308
405
  filename: string;
309
406
  }>;
407
+ /** Knowledge doc content to write to `knowledge/<alias>.md` in the draft project. */
408
+ knowledge_files: Array<{
409
+ content_ref: string;
410
+ content: string;
411
+ }>;
412
+ /** alias → the origin workspace's kdc_ id (the adopt knowledge binding). */
413
+ knowledge_binding: Record<string, string>;
310
414
  }>;
311
415
  /**
312
416
  * Adopt a published package onto an EXISTING (bespoke or ejected) app — the
@@ -317,10 +421,12 @@ export declare class LoticsClient {
317
421
  * ConflictError names the aliases that diverge. `version` omitted adopts the
318
422
  * latest. Backs `lotics package adopt`. Admin-only.
319
423
  */
320
- adoptAppPackage(app_id: string, body: {
424
+ adoptPackage(app_id: string, body: {
321
425
  package_id: string;
322
426
  version?: number;
323
427
  binding: PackageBinding;
428
+ /** alias → this workspace's kdc_ id for the contract's knowledge docs (from extract). */
429
+ knowledge_binding?: Record<string, string>;
324
430
  }): Promise<{
325
431
  id: string;
326
432
  name: string;
@@ -340,13 +446,13 @@ export declare class LoticsClient {
340
446
  * adopts targeting it; pinned installations keep running. Owner-org
341
447
  * admin-only. Backs `lotics package yank`.
342
448
  */
343
- yankAppPackageVersion(package_id: string, version: number, yanked: boolean): Promise<{
449
+ yankPackageVersion(package_id: string, version: number, yanked: boolean): Promise<{
344
450
  package_id: string;
345
451
  version: number;
346
452
  yanked_at: string | null;
347
453
  latest_version: number;
348
454
  }>;
349
- fleetUpgradeAppPackage(package_id: string, body: {
455
+ fleetUpgradePackage(package_id: string, body: {
350
456
  version?: number;
351
457
  }): Promise<{
352
458
  package_id: string;
@@ -372,26 +478,30 @@ export declare class LoticsClient {
372
478
  * local manifest has no `package_id`), then publishes version 1 against the
373
479
  * returned id. Admin-only.
374
480
  */
375
- createAppPackage(body: {
481
+ createPackage(body: {
376
482
  name: string;
377
483
  description?: string | null;
484
+ /** 'app' (default) | 'content'. Immutable after create. */
485
+ kind?: PackageKind;
378
486
  }): Promise<{
379
487
  id: string;
380
488
  name: string;
381
489
  description: string | null;
490
+ kind: PackageKind;
382
491
  latest_version: number;
383
492
  is_official: boolean;
384
493
  created_at: string;
385
494
  updated_at: string;
386
495
  }>;
387
496
  /**
388
- * Fetch a registry app package's metadata (incl. `latest_version` and the
389
- * Lotics-backed `is_official` trust badge). Admin-only; cross-tenant by id.
497
+ * Fetch a registry app package's metadata (incl. `kind`, `latest_version` and
498
+ * the Lotics-backed `is_official` trust badge). Admin-only; cross-tenant by id.
390
499
  */
391
- getAppPackage(package_id: string): Promise<{
500
+ getPackage(package_id: string): Promise<{
392
501
  id: string;
393
502
  name: string;
394
503
  description: string | null;
504
+ kind: PackageKind;
395
505
  latest_version: number;
396
506
  is_official: boolean;
397
507
  retired_at: string | null;
@@ -401,7 +511,7 @@ export declare class LoticsClient {
401
511
  updated_at: string;
402
512
  }>;
403
513
  /** Version history newest-first (no contract payloads) — backs `lotics package show`. Admin-only. */
404
- listAppPackageVersions(package_id: string): Promise<{
514
+ listPackageVersions(package_id: string): Promise<{
405
515
  versions: Array<{
406
516
  version: number;
407
517
  changelog: string | null;
@@ -417,7 +527,7 @@ export declare class LoticsClient {
417
527
  * bundle, then allocates the next monotonic version. The `contract` is opaque
418
528
  * JSON to the transport (the server is the validating authority). Admin-only.
419
529
  */
420
- publishAppPackageVersion(package_id: string, args: {
530
+ publishPackageVersion(package_id: string, args: {
421
531
  contract: unknown;
422
532
  bundle: Buffer;
423
533
  changelog?: string | null;
@@ -438,7 +548,7 @@ export declare class LoticsClient {
438
548
  * package artifacts, and bumps the pin. `version` omitted upgrades to the
439
549
  * latest. Returns the resulting app. Admin-only.
440
550
  */
441
- upgradeAppPackage(app_id: string, body: {
551
+ upgradePackage(app_id: string, body: {
442
552
  version?: number;
443
553
  /**
444
554
  * Per preview finding: drifted binding entries (`<namespace>.<alias>`)
@@ -449,6 +559,13 @@ export declare class LoticsClient {
449
559
  resolutions?: Record<string, "recreate" | "revert" | "keep" | {
450
560
  bind_to: string;
451
561
  }>;
562
+ /**
563
+ * Per bundled-knowledge finding: a consent resolution
564
+ * (`apply`/`keep`/`archive`/`recreate`/`unbind`) per alias + `bind_to`
565
+ * consents for added-doc name collisions. Consent-requiring docs left
566
+ * unresolved refuse the upgrade; unmodified changes apply automatically.
567
+ */
568
+ knowledge_resolutions?: KnowledgeUpgradeResolutions;
452
569
  }): Promise<{
453
570
  id: string;
454
571
  name: string;
@@ -462,7 +579,7 @@ export declare class LoticsClient {
462
579
  * breaking contract changes, the binding drift report, and the modified-core
463
580
  * report — with no writes. Admin-only.
464
581
  */
465
- previewAppPackageUpgrade(app_id: string, opts?: {
582
+ previewPackageUpgrade(app_id: string, opts?: {
466
583
  version?: number;
467
584
  }): Promise<{
468
585
  app_id: string;
@@ -480,6 +597,9 @@ export declare class LoticsClient {
480
597
  from: string;
481
598
  to: string;
482
599
  }>;
600
+ changed: {
601
+ templates: string[];
602
+ };
483
603
  };
484
604
  drift: Array<{
485
605
  namespace: string;
@@ -489,14 +609,21 @@ export declare class LoticsClient {
489
609
  modified: Array<{
490
610
  kind: string;
491
611
  alias: string;
612
+ baseline_unknown?: boolean;
492
613
  }>;
614
+ /**
615
+ * Bundled package-managed knowledge docs the version bump adds/changes/
616
+ * removes/drifts — the app-install analogue of a standalone knowledge
617
+ * upgrade's `entries`. Consent-requiring docs resolve via `knowledge_resolutions`.
618
+ */
619
+ knowledge: KnowledgeUpgradeEntry[];
493
620
  }>;
494
621
  /**
495
622
  * Re-bind a package role to a different workspace group (the current group
496
623
  * still exists). Re-materializes at the pinned version; refuses over
497
624
  * modified-core findings. Admin-only.
498
625
  */
499
- rebindAppPackageRole(app_id: string, body: {
626
+ rebindPackageRole(app_id: string, body: {
500
627
  role_alias: string;
501
628
  group_id: string;
502
629
  }): Promise<{
@@ -524,7 +651,7 @@ export declare class LoticsClient {
524
651
  * binding drift, and locally modified core artifacts. Read-only; backs
525
652
  * `lotics package doctor`. Admin-only.
526
653
  */
527
- getAppPackageHealth(app_id: string): Promise<{
654
+ getPackageHealth(app_id: string): Promise<{
528
655
  app_id: string;
529
656
  package_id: string;
530
657
  package_name: string;
@@ -540,6 +667,20 @@ export declare class LoticsClient {
540
667
  kind: string;
541
668
  alias: string;
542
669
  }>;
670
+ /** Package-managed knowledge docs whose bound id no longer resolves (recreate/unbind at upgrade). */
671
+ knowledge_drift: Array<{
672
+ alias: string;
673
+ name: string;
674
+ doc_id: string | null;
675
+ }>;
676
+ /** Package-managed knowledge docs the workspace edited since install (apply/keep at upgrade). */
677
+ knowledge_modified: Array<{
678
+ alias: string;
679
+ name: string;
680
+ doc_id: string | null;
681
+ }>;
682
+ /** `knowledge_expects` names the package's agents route to but it does not own (advisory). */
683
+ missing_expected_docs: string[];
543
684
  }>;
544
685
  /**
545
686
  * Reset a package installation in a DEV workspace — drop the package-owned
@@ -547,7 +688,7 @@ export declare class LoticsClient {
547
688
  * workspaces (a non-dev workspace is refused). Returns the resulting app.
548
689
  * Admin-only.
549
690
  */
550
- resetAppPackage(app_id: string): Promise<{
691
+ resetPackage(app_id: string): Promise<{
551
692
  id: string;
552
693
  name: string;
553
694
  workspace_id: string;
package/dist/client.js CHANGED
@@ -204,13 +204,53 @@ export class LoticsClient {
204
204
  return this.request("POST", "/v1/apps", body);
205
205
  }
206
206
  /**
207
- * Install an app package version into the current workspace — scaffolds the
208
- * data model, deploys the package bundle, materializes its
209
- * queries/workflows/agents, and pins the installation. Returns the resulting
210
- * installation app. `version` omitted installs the latest published version.
207
+ * Install a package version into the current workspace — ONE endpoint,
208
+ * kind-branched into a discriminated response (`kind`). An `app` package
209
+ * scaffolds the data model / deploys / materializes and returns the installation
210
+ * app (+ advisory knowledge warnings); a `content` package installs only its
211
+ * doc corpus and returns the installation row. `bind_to` (content only)
212
+ * resolves a name collision by adopting an existing same-named doc as
213
+ * package-managed. `version` omitted installs the latest published version.
211
214
  */
212
- async installAppPackage(package_id, body) {
213
- return this.request("POST", `/v1/app-packages/${encodeURIComponent(package_id)}/installations`, body);
215
+ async installPackage(package_id, body) {
216
+ return this.request("POST", `/v1/packages/${encodeURIComponent(package_id)}/installations`, body);
217
+ }
218
+ /**
219
+ * Uninstall a standalone content package — delete the installation row. By
220
+ * default the package-bound docs are ARCHIVED; `keep_content` retains them as
221
+ * ordinary workspace docs. Admin-only. Backs `lotics package uninstall`.
222
+ */
223
+ async uninstallContentPackage(installation_id, opts = {}) {
224
+ const qs = opts.keep_content ? "?keep_content=true" : "";
225
+ return this.request("DELETE", `/v1/content-installations/${encodeURIComponent(installation_id)}${qs}`);
226
+ }
227
+ /**
228
+ * Preview upgrading a standalone content installation — the knowledge namespace's
229
+ * per-alias `entries` (added/changed/removed/drifted + a `modified` flag) plus the
230
+ * consent-requiring `templates` (a template the target changed whose live content
231
+ * was locally edited; a clean one auto-updates and is absent). No writes.
232
+ * Admin-only.
233
+ */
234
+ async previewContentInstallationUpgrade(installation_id, opts = {}) {
235
+ const qs = opts.version !== undefined ? `?version=${opts.version}` : "";
236
+ return this.request("GET", `/v1/content-installations/${encodeURIComponent(installation_id)}/upgrade${qs}`);
237
+ }
238
+ /**
239
+ * Apply a standalone content upgrade — propagate the target version's content per
240
+ * the resolutions (`knowledge`: a modified change/removal or drift needs consent;
241
+ * `templates`: a locally-edited changed template takes revert|keep), then advance
242
+ * the pin + binding. Returns the updated installation row. Admin-only.
243
+ */
244
+ async applyContentInstallationUpgrade(installation_id, body) {
245
+ return this.request("POST", `/v1/content-installations/${encodeURIComponent(installation_id)}/upgrade`, body);
246
+ }
247
+ /**
248
+ * List a workspace's package-managed knowledge installations, each folded with
249
+ * registry status (name, kind, official badge, latest version, update-available).
250
+ * Member-accessible (workspace-scoped); backs the settings "Managed by" badge.
251
+ */
252
+ async listContentInstallations(workspace_id) {
253
+ return this.request("GET", `/v1/workspaces/${encodeURIComponent(workspace_id)}/content-installations`);
214
254
  }
215
255
  /**
216
256
  * Uninstall a package installation (backs `lotics package uninstall`). Does
@@ -236,8 +276,8 @@ export class LoticsClient {
236
276
  * non-owning orgs; existing installations keep working and may still upgrade.
237
277
  * Owner-org admin-only.
238
278
  */
239
- async retireAppPackage(package_id, body) {
240
- return this.request("POST", `/v1/app-packages/${encodeURIComponent(package_id)}/retire`, body);
279
+ async retirePackage(package_id, body) {
280
+ return this.request("POST", `/v1/packages/${encodeURIComponent(package_id)}/retire`, body);
241
281
  }
242
282
  /**
243
283
  * Eject an installation from its package — re-deploy the pinned version's
@@ -246,12 +286,12 @@ export class LoticsClient {
246
286
  * app becomes a normal bespoke app and can no longer be upgraded. Returns the
247
287
  * resulting app.
248
288
  */
249
- async ejectAppPackage(app_id) {
289
+ async ejectPackage(app_id) {
250
290
  return this.request("POST", `/v1/apps/${encodeURIComponent(app_id)}/eject`);
251
291
  }
252
292
  /**
253
293
  * Extract a DRAFT app package from an existing bespoke app — the promotion
254
- * read (docs/app_packages.md § Promotion). Pure: nothing is written. Returns
294
+ * read (docs/packages.md § Promotion). Pure: nothing is written. Returns
255
295
  * the alias-keyed draft `contract` (opaque to the CLI — the server is the
256
296
  * validating authority), the origin workspace's `binding` (which doubles as
257
297
  * the adopt binding), a findings `report` (any `error` ⇒ not publishable
@@ -259,8 +299,13 @@ export class LoticsClient {
259
299
  * project at their `bytes_ref` paths. Backs `lotics package extract`.
260
300
  * Admin-only.
261
301
  */
262
- async extractAppPackage(app_id) {
263
- return this.request("GET", `/v1/apps/${encodeURIComponent(app_id)}/package-extract`);
302
+ async extractPackage(app_id, opts = {}) {
303
+ // The knowledge declaration ([{alias, doc_id}]) rides as a JSON-string query
304
+ // param — extract stays a GET (a pure read); the server validates it.
305
+ const qs = opts.knowledge && opts.knowledge.length > 0
306
+ ? `?knowledge=${encodeURIComponent(JSON.stringify(opts.knowledge))}`
307
+ : "";
308
+ return this.request("GET", `/v1/apps/${encodeURIComponent(app_id)}/package-extract${qs}`);
264
309
  }
265
310
  /**
266
311
  * Adopt a published package onto an EXISTING (bespoke or ejected) app — the
@@ -271,7 +316,7 @@ export class LoticsClient {
271
316
  * ConflictError names the aliases that diverge. `version` omitted adopts the
272
317
  * latest. Backs `lotics package adopt`. Admin-only.
273
318
  */
274
- async adoptAppPackage(app_id, body) {
319
+ async adoptPackage(app_id, body) {
275
320
  return this.request("POST", `/v1/apps/${encodeURIComponent(app_id)}/package-adopt`, body);
276
321
  }
277
322
  /**
@@ -287,11 +332,11 @@ export class LoticsClient {
287
332
  * adopts targeting it; pinned installations keep running. Owner-org
288
333
  * admin-only. Backs `lotics package yank`.
289
334
  */
290
- async yankAppPackageVersion(package_id, version, yanked) {
291
- return this.request("POST", `/v1/app-packages/${encodeURIComponent(package_id)}/versions/${version}/yank`, { yanked });
335
+ async yankPackageVersion(package_id, version, yanked) {
336
+ return this.request("POST", `/v1/packages/${encodeURIComponent(package_id)}/versions/${version}/yank`, { yanked });
292
337
  }
293
- async fleetUpgradeAppPackage(package_id, body) {
294
- return this.request("POST", `/v1/app-packages/${encodeURIComponent(package_id)}/fleet-upgrade`, body);
338
+ async fleetUpgradePackage(package_id, body) {
339
+ return this.request("POST", `/v1/packages/${encodeURIComponent(package_id)}/fleet-upgrade`, body);
295
340
  }
296
341
  // --- App packages (registry authoring + dev harness) ---
297
342
  /**
@@ -300,19 +345,19 @@ export class LoticsClient {
300
345
  * local manifest has no `package_id`), then publishes version 1 against the
301
346
  * returned id. Admin-only.
302
347
  */
303
- async createAppPackage(body) {
304
- return this.request("POST", "/v1/app-packages", body);
348
+ async createPackage(body) {
349
+ return this.request("POST", "/v1/packages", body);
305
350
  }
306
351
  /**
307
- * Fetch a registry app package's metadata (incl. `latest_version` and the
308
- * Lotics-backed `is_official` trust badge). Admin-only; cross-tenant by id.
352
+ * Fetch a registry app package's metadata (incl. `kind`, `latest_version` and
353
+ * the Lotics-backed `is_official` trust badge). Admin-only; cross-tenant by id.
309
354
  */
310
- async getAppPackage(package_id) {
311
- return this.request("GET", `/v1/app-packages/${encodeURIComponent(package_id)}`);
355
+ async getPackage(package_id) {
356
+ return this.request("GET", `/v1/packages/${encodeURIComponent(package_id)}`);
312
357
  }
313
358
  /** Version history newest-first (no contract payloads) — backs `lotics package show`. Admin-only. */
314
- async listAppPackageVersions(package_id) {
315
- return this.request("GET", `/v1/app-packages/${encodeURIComponent(package_id)}/versions`);
359
+ async listPackageVersions(package_id) {
360
+ return this.request("GET", `/v1/packages/${encodeURIComponent(package_id)}/versions`);
316
361
  }
317
362
  /**
318
363
  * Publish a new immutable package version — multipart upload of the alias-keyed
@@ -321,7 +366,7 @@ export class LoticsClient {
321
366
  * bundle, then allocates the next monotonic version. The `contract` is opaque
322
367
  * JSON to the transport (the server is the validating authority). Admin-only.
323
368
  */
324
- async publishAppPackageVersion(package_id, args) {
369
+ async publishPackageVersion(package_id, args) {
325
370
  const formData = new FormData();
326
371
  formData.append("contract", JSON.stringify(args.contract));
327
372
  formData.append("bundle", new Blob([new Uint8Array(args.bundle)], { type: "application/gzip" }), "bundle.tar.gz");
@@ -329,7 +374,7 @@ export class LoticsClient {
329
374
  formData.append("changelog", args.changelog);
330
375
  if (args.channel)
331
376
  formData.append("channel", args.channel);
332
- const url = `${this.baseUrl}/v1/app-packages/${encodeURIComponent(package_id)}/versions`;
377
+ const url = `${this.baseUrl}/v1/packages/${encodeURIComponent(package_id)}/versions`;
333
378
  const response = await fetch(url, {
334
379
  method: "POST",
335
380
  headers: this.buildHeaders(), // no Content-Type — fetch sets the multipart boundary
@@ -346,7 +391,7 @@ export class LoticsClient {
346
391
  * package artifacts, and bumps the pin. `version` omitted upgrades to the
347
392
  * latest. Returns the resulting app. Admin-only.
348
393
  */
349
- async upgradeAppPackage(app_id, body) {
394
+ async upgradePackage(app_id, body) {
350
395
  return this.request("POST", `/v1/apps/${encodeURIComponent(app_id)}/package-upgrade`, body);
351
396
  }
352
397
  /**
@@ -354,7 +399,7 @@ export class LoticsClient {
354
399
  * breaking contract changes, the binding drift report, and the modified-core
355
400
  * report — with no writes. Admin-only.
356
401
  */
357
- async previewAppPackageUpgrade(app_id, opts = {}) {
402
+ async previewPackageUpgrade(app_id, opts = {}) {
358
403
  const query = opts.version !== undefined ? `?version=${opts.version}` : "";
359
404
  return this.request("GET", `/v1/apps/${encodeURIComponent(app_id)}/package-upgrade${query}`);
360
405
  }
@@ -363,7 +408,7 @@ export class LoticsClient {
363
408
  * still exists). Re-materializes at the pinned version; refuses over
364
409
  * modified-core findings. Admin-only.
365
410
  */
366
- async rebindAppPackageRole(app_id, body) {
411
+ async rebindPackageRole(app_id, body) {
367
412
  return this.request("POST", `/v1/apps/${encodeURIComponent(app_id)}/package-rebind-role`, body);
368
413
  }
369
414
  /**
@@ -379,7 +424,7 @@ export class LoticsClient {
379
424
  * binding drift, and locally modified core artifacts. Read-only; backs
380
425
  * `lotics package doctor`. Admin-only.
381
426
  */
382
- async getAppPackageHealth(app_id) {
427
+ async getPackageHealth(app_id) {
383
428
  return this.request("GET", `/v1/apps/${encodeURIComponent(app_id)}/package-health`);
384
429
  }
385
430
  /**
@@ -388,7 +433,7 @@ export class LoticsClient {
388
433
  * workspaces (a non-dev workspace is refused). Returns the resulting app.
389
434
  * Admin-only.
390
435
  */
391
- async resetAppPackage(app_id) {
436
+ async resetPackage(app_id) {
392
437
  return this.request("POST", `/v1/apps/${encodeURIComponent(app_id)}/package-reset`);
393
438
  }
394
439
  /**