@lotics/cli 0.86.2 → 0.87.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/cli",
3
- "version": "0.86.2",
3
+ "version": "0.87.0",
4
4
  "description": "Lotics SDK and CLI for AI agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,228 +0,0 @@
1
- import { LoticsClient, type ExtractFinding } from "./client.js";
2
- import { type ContractConfigEntry, type UpgradeResolutions } from "@lotics/shared/schemas/packages";
3
- /**
4
- * Read the local APP project's manifest (`package.json#lotics.app_id` +
5
- * `lotics.knowledge` + `lotics.config`) — what `lotics app pull` writes.
6
- * `lotics app publish` / `release` run from a pulled app project resolve the app
7
- * id from it and forward the package-managed knowledge declaration AND the config
8
- * knob declarations to the server — both are declarations extract cannot invert
9
- * from artifacts (agents reference docs by free text; a config knob has no concrete
10
- * artifact), so the author declares them. Each `lotics.config` entry is validated
11
- * against the shared `contractConfigEntrySchema` so a malformed knob fails LOUDLY
12
- * client-side naming the alias, never silently dropped. Returns null when the dir
13
- * has no package.json. `app_id` is null when the manifest is a package/non-app
14
- * project.
15
- */
16
- export declare function readLocalAppManifest(projectDir: string): {
17
- app_id: string | null;
18
- knowledge: Array<{
19
- alias: string;
20
- doc_id: string;
21
- }>;
22
- config: ContractConfigEntry[];
23
- } | null;
24
- /** Parse repeated `--rename old=new` flags into `{ from, to }[]` (first-publish alias fixes). */
25
- export declare function parseRenameFlags(renames: string[]): Array<{
26
- from: string;
27
- to: string;
28
- }>;
29
- /**
30
- * Render a package-extract report grouped by severity (errors, then warnings,
31
- * then info), one ` [<severity>] <area>: <message>` line each, and classify
32
- * whether any `error` finding is present. Shared by the release preview display.
33
- * Pure — the command prints `lines` to stderr and gates on `hasError`.
34
- */
35
- export declare function formatExtractReport(report: ExtractFinding[]): {
36
- lines: string[];
37
- hasError: boolean;
38
- };
39
- /**
40
- * Parse repeated `--resolve <key>=<value>` flags into the ONE namespaced
41
- * resolutions map every upgrade wire takes. Keys pass through verbatim — a
42
- * drifted binding entry (`<namespace>.<alias>`), a modified artifact
43
- * (`<kind>.<alias>`), a bundled/standalone knowledge doc (`knowledge.<alias>`),
44
- * or a live-role re-point (`roles.<alias>`). A value that is one of the
45
- * resolution verbs stays a verb; anything else is a `{ bind_to }` id. The
46
- * server validates value-kind against what each key resolves.
47
- */
48
- export declare function parseResolveFlags(resolve: string[]): UpgradeResolutions;
49
- /**
50
- * Health check: version pin vs. registry latest + binding drift. Exits
51
- * non-zero when drift is found so scripts can gate on it. An `apg_` PACKAGE id
52
- * resolves THIS workspace's standalone content installation — the same
53
- * package-id addressing `upgrade`/`uninstall` speak.
54
- */
55
- export declare function packageDoctor(client: LoticsClient, args: {
56
- app_id?: string;
57
- }): Promise<void>;
58
- /**
59
- * Preview-then-apply an app-installation upgrade. Prints the additive plan +
60
- * informational removals + any bundled-knowledge changes; refuses (exit 1, with
61
- * the exact --resolve syntax) while any binding drift, modified core artifact, or
62
- * consent-requiring bundled-knowledge doc lacks a resolution.
63
- *
64
- * `--resolve` speaks ONE namespaced grammar, passed to the server verbatim: a
65
- * drifted binding entry (`<namespace>.<alias>`), a modified artifact
66
- * (`<kind>.<alias>`), a bundled knowledge doc (`knowledge.<alias>` —
67
- * apply|keep|archive|recreate|unbind), or a live-role re-point
68
- * (`roles.<alias>=<grp_id>`). `--bind-to` consents an added-knowledge-doc name
69
- * collision; `--apply-all` accepts the package's version for every
70
- * consent-requiring knowledge doc (overwriting local edits).
71
- */
72
- export declare function packageUpgrade(client: LoticsClient, args: {
73
- app_id: string;
74
- version?: number;
75
- resolve: string[];
76
- bindTo: string[];
77
- applyAll: boolean;
78
- }): Promise<void>;
79
- /**
80
- * `lotics package show <package_id>` — registry metadata + version history
81
- * (trust badge, retirement, per-version channel/yank/changelog). The read
82
- * surface for "what is this package and what shipped when". Kind-agnostic — a
83
- * content package shows here the same way.
84
- */
85
- export declare function packageShow(client: LoticsClient, args: {
86
- package_id: string;
87
- }): Promise<void>;
88
- /**
89
- * CLEAN BREAK for an explicit `pci_` argument on `upgrade` / `uninstall`: the
90
- * `pci_` resource id is retired from human sight — content installs are addressed
91
- * by their PACKAGE id. Prints a loud redirect, best-effort resolving the `pci_`
92
- * back to its package id (via list-content) so the exact command is spelled out.
93
- * The header prints synchronously first, so the redirect is observable even when
94
- * the best-effort resolution can't reach the registry.
95
- */
96
- export declare function redirectContentPciForm(client: LoticsClient, pci_id: string, verb: "upgrade" | "uninstall"): Promise<never>;
97
- /**
98
- * `lotics upgrade <apg_>` — the package-id upgrade path, kind-branched. `kind` is a
99
- * DERIVED display hint (`contractHasAppSurface`): `'content'` means no app surface.
100
- * - a CONTENT package upgrades THIS workspace's standalone content installation
101
- * (resolved from the package id — the anchor is unique per workspace, so the
102
- * `pci_` never surfaces), through the same content review gate.
103
- * - an APP-surface package FLEET-upgrades every installation across the org
104
- * (unchanged) — the resolve/bind/apply-all flags don't apply to a fleet run.
105
- */
106
- export declare function packageUpgradeByPackageId(client: LoticsClient, args: {
107
- package_id: string;
108
- version?: number;
109
- resolve: string[];
110
- bindTo: string[];
111
- applyAll: boolean;
112
- }): Promise<void>;
113
- /** Parse repeated `--bind-to alias=kdc_id` flags into an alias → doc-id consent map. */
114
- export declare function parseBindToFlags(bindTo: string[]): Record<string, string>;
115
- export declare function packageInstall(client: LoticsClient, args: {
116
- package_id: string;
117
- version?: number;
118
- /** Content-kind only: adopt a same-named workspace doc on a knowledge collision. */
119
- bind_to?: Record<string, string>;
120
- /** App-kind only: per-knob config overrides applied over the contract defaults. */
121
- config?: Record<string, string | number | boolean>;
122
- }): Promise<void>;
123
- /**
124
- * `lotics uninstall <app_id|package_id>` — ONE top-level command over both
125
- * installation kinds, dispatched by the id form (mirrors `lotics upgrade`):
126
- * - a package id (`apg_`) → THIS workspace's STANDALONE CONTENT installation
127
- * (content installs are addressed by package id, UNIQUE per workspace, so the
128
- * `pci_` resource id never surfaces): deletes the row and (unless
129
- * `--keep-content`) archives its package-bound docs AND templates, listing each
130
- * archived id.
131
- * - anything else (an `app_id`) → an APP installation: archives its workflow
132
- * artifacts and — with `--archive-tables` — the scaffolded entity tables
133
- * (provenance- + reference-gated server-side).
134
- * A flag used on the wrong path is a loud error, never silently ignored.
135
- */
136
- export declare function packageUninstall(client: LoticsClient, args: {
137
- id: string;
138
- keep_content: boolean;
139
- archive_tables: boolean;
140
- }): Promise<void>;
141
- /**
142
- * `lotics package list-content` — list the selected workspace's STANDALONE
143
- * content installations (an app-bundled corpus rides its app's
144
- * `binding.knowledge` and shows on the Apps surface instead), each with its
145
- * registry status. The what-is-installed listing: each row leads with the PACKAGE
146
- * id — the address for `lotics upgrade <package_id>` / `lotics uninstall
147
- * <package_id>` (the `pci_` resource id stays hidden).
148
- */
149
- export declare function packageListContent(client: LoticsClient): Promise<void>;
150
- export declare function packageEject(client: LoticsClient, args: {
151
- app_id: string;
152
- }): Promise<void>;
153
- /** `--config key=value` (install): inferred types, server-validated. */
154
- export declare function parseInstallConfigFlags(config: string[]): Record<string, string | number | boolean>;
155
- /**
156
- * `lotics package config <app_id>` — show the installation's effective config;
157
- * with `--set key=value` (repeatable) partial-merge edits, each value parsed by
158
- * the knob's current type. No `--set` prints the values.
159
- */
160
- export declare function packageConfig(client: LoticsClient, args: {
161
- app_id: string;
162
- sets: string[];
163
- }): Promise<void>;
164
- /**
165
- * `lotics app unpublish <app_id|package_id> [--undo]` — take a published package
166
- * off the shelf (or `--undo` restore it): new installs refuse it and it hides
167
- * from other orgs, while existing installations keep working and may still
168
- * upgrade. Given an app id (an installation of the package) it resolves the
169
- * package from the app; a package id targets it directly. Owner-org admin-only.
170
- */
171
- export declare function appUnpublish(client: LoticsClient, args: {
172
- id: string;
173
- undo: boolean;
174
- }): Promise<void>;
175
- /**
176
- * `lotics app publish [app_id|.] [--rename old=new ...] [-m <changelog>] [--yes]` —
177
- * FIRST-RELEASE a bespoke app as a package (docs/packages.md § Promotion). Nothing
178
- * starts as a package. Mirrors `app release`'s preview→apply UX: it first shows the
179
- * dry-run preview (GET, no writes) — the package name, the auto-minted RENAMABLE
180
- * aliases (the exact `--rename` keys, so v1's frozen aliases are inspected first,
181
- * never a blind publish), and the extract findings — then APPLIES only with
182
- * `--yes` (else exits 1 with the re-run hint). On apply the server extracts the
183
- * contract, creates the registry package, publishes v1 from the DEPLOYED source +
184
- * dist, and pins the origin as installation #1. `--rename old=new` fixes an
185
- * auto-minted alias before v1 freezes it; an `error` finding blocks the apply. An
186
- * already-linked app releases with `lotics app release` instead. The app id is the
187
- * positional (`.`/omitted → resolved from the local app project manifest).
188
- */
189
- export declare function appPublish(client: LoticsClient, args: {
190
- app_id?: string;
191
- renames: string[];
192
- changelog?: string;
193
- yes: boolean;
194
- projectDir?: string;
195
- }): Promise<void>;
196
- /**
197
- * `lotics app release [app_id|.] -m <changelog> [--yes]` — snapshot an
198
- * adopted/installed origin app into its next registry version (docs/packages.md
199
- * § Promotion). The origin is the permanent working copy; a release binding-aware-
200
- * extracts it (stable aliases), repackages its DEPLOYED source + dist as the
201
- * bundle, publishes the next version, and re-pins the origin. Prints the preview
202
- * first (next version, new + changed aliases, the bundled-knowledge delta,
203
- * findings); applies only with `--yes`, else exits 1 so a review step can't be
204
- * skipped. An `error` finding blocks the apply.
205
- *
206
- * Run from the pulled app project, the manifest's `lotics.knowledge` (alias →
207
- * doc_id) is the bundle DECLARATION — it re-declares which docs the package owns
208
- * (add/drop/re-snapshot). Forwarded only when non-empty; empty (or a bare id from
209
- * elsewhere) sends nothing, so the current corpus is reconstructed from the pin
210
- * (never silently dropped).
211
- */
212
- export declare function appRelease(client: LoticsClient, args: {
213
- app_id?: string;
214
- changelog: string;
215
- yes: boolean;
216
- projectDir?: string;
217
- }): Promise<void>;
218
- /**
219
- * `lotics package yank <package_id> <version> [--undo]` — mark a published
220
- * version uninstallable (or restore it). New installs/upgrades/adopts refuse a
221
- * yanked version and "latest" skips it; installations already pinned keep
222
- * running. Owner-org admin-only.
223
- */
224
- export declare function packageYank(client: LoticsClient, args: {
225
- package_id: string;
226
- version: number;
227
- undo: boolean;
228
- }): Promise<void>;