@usenaive-sdk/cli 0.12.5 โ†’ 0.13.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.
Files changed (164) hide show
  1. package/README.md +69 -6
  2. package/dist/client.d.ts +48 -0
  3. package/dist/client.js +199 -27
  4. package/dist/client.js.map +1 -1
  5. package/dist/commands/aeo.js +58 -23
  6. package/dist/commands/aeo.js.map +1 -1
  7. package/dist/commands/app-data.js +29 -11
  8. package/dist/commands/app-data.js.map +1 -1
  9. package/dist/commands/approvals.js +142 -9
  10. package/dist/commands/approvals.js.map +1 -1
  11. package/dist/commands/apps.d.ts +7 -0
  12. package/dist/commands/apps.js +255 -18
  13. package/dist/commands/apps.js.map +1 -1
  14. package/dist/commands/audio.d.ts +9 -0
  15. package/dist/commands/audio.js +391 -0
  16. package/dist/commands/audio.js.map +1 -0
  17. package/dist/commands/auth.d.ts +1 -0
  18. package/dist/commands/auth.js +47 -19
  19. package/dist/commands/auth.js.map +1 -1
  20. package/dist/commands/billing.js +9 -9
  21. package/dist/commands/billing.js.map +1 -1
  22. package/dist/commands/brain.js +813 -54
  23. package/dist/commands/brain.js.map +1 -1
  24. package/dist/commands/browser.js +8 -8
  25. package/dist/commands/browser.js.map +1 -1
  26. package/dist/commands/business.js +117 -16
  27. package/dist/commands/business.js.map +1 -1
  28. package/dist/commands/clone.js +8 -4
  29. package/dist/commands/clone.js.map +1 -1
  30. package/dist/commands/companies.d.ts +8 -0
  31. package/dist/commands/companies.js +137 -47
  32. package/dist/commands/companies.js.map +1 -1
  33. package/dist/commands/company-data.d.ts +2 -0
  34. package/dist/commands/company-data.js +168 -0
  35. package/dist/commands/company-data.js.map +1 -0
  36. package/dist/commands/compute.js +295 -18
  37. package/dist/commands/compute.js.map +1 -1
  38. package/dist/commands/connections.d.ts +6 -0
  39. package/dist/commands/connections.js +42 -2
  40. package/dist/commands/connections.js.map +1 -1
  41. package/dist/commands/domains.js +63 -19
  42. package/dist/commands/domains.js.map +1 -1
  43. package/dist/commands/ecommerce.js +19 -9
  44. package/dist/commands/ecommerce.js.map +1 -1
  45. package/dist/commands/email.js +56 -9
  46. package/dist/commands/email.js.map +1 -1
  47. package/dist/commands/formation.js +5 -5
  48. package/dist/commands/formation.js.map +1 -1
  49. package/dist/commands/identity.js +4 -3
  50. package/dist/commands/identity.js.map +1 -1
  51. package/dist/commands/images.js +86 -12
  52. package/dist/commands/images.js.map +1 -1
  53. package/dist/commands/init.d.ts +3 -0
  54. package/dist/commands/init.js +44 -36
  55. package/dist/commands/init.js.map +1 -1
  56. package/dist/commands/jobs.js +1 -0
  57. package/dist/commands/jobs.js.map +1 -1
  58. package/dist/commands/legacy-auth.d.ts +27 -0
  59. package/dist/commands/legacy-auth.js +64 -0
  60. package/dist/commands/legacy-auth.js.map +1 -0
  61. package/dist/commands/llm.js +14 -1
  62. package/dist/commands/llm.js.map +1 -1
  63. package/dist/commands/login.js +2 -0
  64. package/dist/commands/login.js.map +1 -1
  65. package/dist/commands/logout.d.ts +7 -0
  66. package/dist/commands/logout.js +55 -0
  67. package/dist/commands/logout.js.map +1 -0
  68. package/dist/commands/media.js +3 -3
  69. package/dist/commands/media.js.map +1 -1
  70. package/dist/commands/mobile.d.ts +2 -0
  71. package/dist/commands/mobile.js +42 -1
  72. package/dist/commands/mobile.js.map +1 -1
  73. package/dist/commands/payments.js +1 -1
  74. package/dist/commands/people.d.ts +2 -0
  75. package/dist/commands/people.js +197 -0
  76. package/dist/commands/people.js.map +1 -0
  77. package/dist/commands/phone.js +40 -83
  78. package/dist/commands/phone.js.map +1 -1
  79. package/dist/commands/projects.d.ts +13 -0
  80. package/dist/commands/projects.js +220 -0
  81. package/dist/commands/projects.js.map +1 -0
  82. package/dist/commands/register.js +13 -5
  83. package/dist/commands/register.js.map +1 -1
  84. package/dist/commands/sandbox.d.ts +2 -0
  85. package/dist/commands/sandbox.js +558 -0
  86. package/dist/commands/sandbox.js.map +1 -0
  87. package/dist/commands/search.js +27 -13
  88. package/dist/commands/search.js.map +1 -1
  89. package/dist/commands/seo.js +16 -8
  90. package/dist/commands/seo.js.map +1 -1
  91. package/dist/commands/sessions.d.ts +6 -0
  92. package/dist/commands/sessions.js +109 -0
  93. package/dist/commands/sessions.js.map +1 -0
  94. package/dist/commands/social-data.d.ts +2 -0
  95. package/dist/commands/social-data.js +245 -0
  96. package/dist/commands/social-data.js.map +1 -0
  97. package/dist/commands/social.js +9 -7
  98. package/dist/commands/social.js.map +1 -1
  99. package/dist/commands/tasks.js +9 -0
  100. package/dist/commands/tasks.js.map +1 -1
  101. package/dist/commands/teams.d.ts +69 -0
  102. package/dist/commands/teams.js +503 -0
  103. package/dist/commands/teams.js.map +1 -0
  104. package/dist/commands/up.d.ts +150 -0
  105. package/dist/commands/up.js +465 -15
  106. package/dist/commands/up.js.map +1 -1
  107. package/dist/commands/usage.js +15 -4
  108. package/dist/commands/usage.js.map +1 -1
  109. package/dist/commands/use.d.ts +9 -0
  110. package/dist/commands/use.js +76 -11
  111. package/dist/commands/use.js.map +1 -1
  112. package/dist/commands/users.d.ts +8 -0
  113. package/dist/commands/users.js +28 -9
  114. package/dist/commands/users.js.map +1 -1
  115. package/dist/commands/vault.js +31 -1
  116. package/dist/commands/vault.js.map +1 -1
  117. package/dist/commands/verification.js +1 -1
  118. package/dist/commands/verification.js.map +1 -1
  119. package/dist/commands/video.js +118 -19
  120. package/dist/commands/video.js.map +1 -1
  121. package/dist/commands/wallet.js +3 -3
  122. package/dist/commands/wallet.js.map +1 -1
  123. package/dist/commands/whoami.js +17 -1
  124. package/dist/commands/whoami.js.map +1 -1
  125. package/dist/config.d.ts +16 -1
  126. package/dist/config.js +15 -1
  127. package/dist/config.js.map +1 -1
  128. package/dist/index.d.ts +2 -1
  129. package/dist/index.js +250 -24
  130. package/dist/index.js.map +1 -1
  131. package/dist/lib/brain-select.d.ts +193 -0
  132. package/dist/lib/brain-select.js +403 -0
  133. package/dist/lib/brain-select.js.map +1 -0
  134. package/dist/lib/cli-validation.d.ts +12 -0
  135. package/dist/lib/cli-validation.js +46 -0
  136. package/dist/lib/cli-validation.js.map +1 -0
  137. package/dist/lib/deprecation.d.ts +158 -0
  138. package/dist/lib/deprecation.js +140 -0
  139. package/dist/lib/deprecation.js.map +1 -0
  140. package/dist/lib/duration.d.ts +8 -0
  141. package/dist/lib/duration.js +11 -0
  142. package/dist/lib/duration.js.map +1 -0
  143. package/dist/lib/http-response.d.ts +11 -0
  144. package/dist/lib/http-response.js +96 -0
  145. package/dist/lib/http-response.js.map +1 -0
  146. package/dist/lib/pricing.d.ts +132 -0
  147. package/dist/lib/pricing.js +148 -0
  148. package/dist/lib/pricing.js.map +1 -0
  149. package/dist/lib/stream-frames.d.ts +114 -0
  150. package/dist/lib/stream-frames.js +169 -0
  151. package/dist/lib/stream-frames.js.map +1 -0
  152. package/dist/lib/teams-catalog.d.ts +141 -0
  153. package/dist/lib/teams-catalog.js +765 -0
  154. package/dist/lib/teams-catalog.js.map +1 -0
  155. package/dist/lib/unknown-command.d.ts +55 -1
  156. package/dist/lib/unknown-command.js +113 -0
  157. package/dist/lib/unknown-command.js.map +1 -1
  158. package/dist/output.d.ts +127 -5
  159. package/dist/output.js +189 -12
  160. package/dist/output.js.map +1 -1
  161. package/package.json +3 -3
  162. package/dist/commands/link.d.ts +0 -3
  163. package/dist/commands/link.js +0 -91
  164. package/dist/commands/link.js.map +0 -1
@@ -1,3 +1,153 @@
1
1
  import { Command } from "commander";
2
+ import { type NextStep } from "../output.js";
3
+ /** What the API reports about the brains `company.brains` declared. */
4
+ interface BrainsResult {
5
+ declared_in?: string | null;
6
+ created?: Array<{
7
+ name: string;
8
+ }>;
9
+ converged?: Array<{
10
+ name: string;
11
+ }>;
12
+ default?: {
13
+ name?: string | null;
14
+ changed?: boolean;
15
+ };
16
+ retained_undeclared?: string[];
17
+ /**
18
+ * Declared brain policy with no column to land in, per brain.
19
+ * `brain_knowledge_bases` has columns for name, is_default, scope, status and
20
+ * provider ids and nothing else, so `retention`, `partitions`, `writes`,
21
+ * `recall`, `lanes`, `visibility` and `bounds` are accepted and not stored.
22
+ */
23
+ unpersisted?: Record<string, string[]>;
24
+ /** The server's own prose for the same, plus the retained-undeclared note. */
25
+ notes?: string[];
26
+ }
27
+ /**
28
+ * The brain half of the report, or undefined when the config declared none.
29
+ *
30
+ * Exported for the same reason it exists: `naive up` printed `applied: true` and
31
+ * said NOTHING about brains, so a config that declared two of them looked
32
+ * identical to a config that declared none. `--plan` showed them (it prints the
33
+ * whole plan); apply did not. A provisioned thing that is not reported is the
34
+ * same silence as an unprovisioned one, one level up.
35
+ *
36
+ * ๐Ÿ”ด AND `unpersisted` IS PART OF THE REPORT, NOT AN EXTRA. The apply path
37
+ * computed the accept-and-drop list and this projection threw it away, so
38
+ * `naive up --plan` told the user which declared brain keys have no column and
39
+ * plain `naive up` โ€” the command people actually run โ€” did not. That is the same
40
+ * defect one level down: `packages/api/src/services/deployment-brains.ts`'s own
41
+ * header calls accept-and-drop "the exact defect this file exists to remove", and
42
+ * a report only the dry run prints is a report most operators never see.
43
+ */
44
+ export declare function brainReport(brains: BrainsResult | undefined): {
45
+ declared_in: string | null;
46
+ created: string[];
47
+ converged: string[];
48
+ default: string | null;
49
+ retained: string[];
50
+ unpersisted?: Record<string, string[]>;
51
+ notes?: string[];
52
+ } | undefined;
53
+ /** What the plan reports per declared team, whichever runtime it asked for. */
54
+ interface TeamPlanEntry {
55
+ name: string;
56
+ runtime: string;
57
+ roles?: string[];
58
+ lead_role?: string;
59
+ /** Role โ†’ runtime, present only for a MIXED team. See `role_runtimes` on the API. */
60
+ role_runtimes?: Record<string, string>;
61
+ placement?: {
62
+ status: string;
63
+ code?: string;
64
+ message?: string;
65
+ };
66
+ /** Keys this team declared that NOTHING on the control plane reads. */
67
+ unconsumed?: string[];
68
+ }
69
+ /**
70
+ * The per-team accept-and-drop warning, one line per team that declared any.
71
+ *
72
+ * The data has been on the wire the whole time (`plan.teams[].unconsumed`,
73
+ * computed by `unconsumedTeamKeys` in packages/api) and `naive up` printed none
74
+ * of it โ€” `team({ governance: {โ€ฆ} })` applied green and enforced nothing, with
75
+ * nothing anywhere for the author to notice. Printed on the PLAN and on the
76
+ * APPLY, because a report only the dry run shows is a report most operators
77
+ * never see.
78
+ */
79
+ export declare function unconsumedWarnings(teams: readonly TeamPlanEntry[]): string[];
80
+ /**
81
+ * ONE deprecation line when the config still uses the legacy ECS surface โ€”
82
+ * `runtime.pool()` declarations, an agent-level `runtime: "<pool>"` string, or
83
+ * `systems:`. All three keep working indefinitely; the line names what was
84
+ * found and where new configs should author instead.
85
+ */
86
+ export declare function legacyDeprecationNotice(config: Record<string, unknown>): string | null;
87
+ /**
88
+ * ONE rename line when the config declares `agents:`. Separate from the legacy
89
+ * line above on purpose: `runtime.pool()` / `systems:` are a deprecated
90
+ * SURFACE, while `agents:` is a deprecated SPELLING โ€” the block compiles to
91
+ * byte-for-byte what `kits:` compiles to, so the honest notice is "rename",
92
+ * not "migrate". A notice, never a refusal, on both entrypoints.
93
+ */
94
+ export declare function agentsRenameNotice(config: Record<string, unknown>): string | null;
95
+ /**
96
+ * The operator credential the DURABLE RUNTIME issued, read from the ENVIRONMENT.
97
+ *
98
+ * Never from `naive.config.ts`, and that is the whole point rather than a style
99
+ * choice. The config is committed, so a credential in it is a credential in git โ€”
100
+ * and, more importantly, the config is the one thing that must not by itself be
101
+ * able to change where a tenant runs. Pointing a tenant at the durable runtime
102
+ * overwrites its `sidecar_url` and `container_auth_token` and nulls its
103
+ * `instance_id`, none of which is stashed anywhere. Requiring a second, separate
104
+ * act means an edit alone can never do it.
105
+ *
106
+ * `NAIVE_DURABLE_CREDENTIAL_<TEAM>` names one team; `NAIVE_DURABLE_CREDENTIAL`
107
+ * covers them all. Neither is ever printed, and the API never echoes it back.
108
+ */
109
+ export declare function durableCredentialEnvVar(team: string): string;
110
+ /**
111
+ * The recovery for ONE refused team โ€” a command that EXISTS, or none.
112
+ *
113
+ * ๐Ÿ”ด `naive runtime migrate` IS NOT A COMMAND, AND THIS USED TO PRINT IT.
114
+ * Every refusal here used to emit
115
+ * `naive runtime migrate --tenant โ€ฆ --to durable --credential-from <file>`.
116
+ * Measured on the built CLI: `naive runtime migrate --tenant <id> --to hermes`
117
+ * answers
118
+ * `{"code":"cli_outdated","message":"Unknown command 'runtime'. Your naive CLI
119
+ * is v0.12.4; this command may exist in a newer version."}` โ€” and it exists in
120
+ * NO version: `packages/cli/src/index.ts` registers no `runtime` group at all.
121
+ * So an operator whose apply was refused was handed a command that tells them to
122
+ * upgrade, forever. A next_step that cannot be run is worse than none, because it
123
+ * ends the search.
124
+ *
125
+ * The two cases are genuinely different and are answered differently:
126
+ *
127
+ * ยท `runtime_credential_required` โ€” there IS a procedure, it works today, and
128
+ * it is the one this command already implements: put the operator credential
129
+ * the durable runtime issued in the environment and re-run. Never in
130
+ * `naive.config.ts`, which is committed.
131
+ * ยท everything else (`runtime_migration_requires_explicit_opt_in`,
132
+ * `runtime_claim_in_flight`, `runtime_placement_lost_race`,
133
+ * `runtime_not_configured`, `runtime_state_unknown`) โ€” there is NO self-serve
134
+ * command on this build. Moving an existing tenant between runtimes
135
+ * overwrites `sidecar_url` and `container_auth_token` and nulls `instance_id`
136
+ * with nothing stashed, so the control plane refuses it and no client can do
137
+ * it either. Say that, and print the server's own message, rather than
138
+ * inventing a command to carry the blame.
139
+ *
140
+ * The API writes the same vapour into `details.migrate_command`
141
+ * (packages/api/src/services/placement.ts MIGRATE_COMMAND). That string is not
142
+ * this package's to change and is reported as a follow-up; this function is why
143
+ * `naive up` no longer repeats it.
144
+ */
145
+ export declare function refusalNextStep(t: {
146
+ name: string;
147
+ placement?: {
148
+ code?: string;
149
+ };
150
+ }): NextStep | null;
2
151
  export declare const upCmd: Command;
3
152
  export declare const downCmd: Command;
153
+ export {};