needle-cloud 2.3.2 → 2.3.4

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/cli.esm.js CHANGED
@@ -1 +1 @@
1
- import"node-fetch";import"@web-std/file";import"node:crypto";import"@caporal/core";import"fs";export{p as program}from"./cli-17ec2e09.js";import"dotenv";import"ora";import"open";import"crypto";import"buffer";import"path";import"node:fs";import"node:fs/promises";import"node:os";import"node:path";import"util";import"stream";import"http";import"https";import"url";import"assert";import"tty";import"os";import"zlib";import"events";import"node:readline/promises";import"@logto/node";import"node:readline";import"node:stream";import"node:zlib";import"express";import"ws";import"child_process";import"minimatch";import"body-parser";import"node:child_process";
1
+ import"node-fetch";import"@web-std/file";import"node:crypto";import"@caporal/core";import"fs";export{p as program}from"./cli-6821596f.js";import"dotenv";import"ora";import"open";import"crypto";import"buffer";import"path";import"node:fs";import"node:fs/promises";import"node:os";import"node:path";import"util";import"stream";import"http";import"https";import"url";import"assert";import"tty";import"os";import"zlib";import"events";import"node:readline/promises";import"@logto/node";import"node:readline";import"node:stream";import"node:zlib";import"express";import"ws";import"child_process";import"minimatch";import"body-parser";import"node:child_process";
@@ -1 +1 @@
1
- import{existsSync as o}from"node:fs";import{g as t}from"./cli-17ec2e09.js";import"node-fetch";import"@web-std/file";import"node:crypto";import"@caporal/core";import"fs";import"open";import"crypto";import"buffer";import"path";import"ora";import"node:fs/promises";import"node:os";import"node:path";import"util";import"stream";import"http";import"https";import"url";import"assert";import"tty";import"os";import"zlib";import"events";import"node:readline/promises";import"dotenv";import"@logto/node";import"node:readline";import"node:stream";import"node:zlib";import"express";import"ws";import"child_process";import"minimatch";import"body-parser";import"node:child_process";function r(){var r;let i;try{i=t()}catch{return null}const p=null==(r=i)||null==(r=r.entries)?void 0:r[0];return p&&p.log_location?"unity"!==p.editor&&"blender"!==p.editor?null:o(p.log_location)?{editor:p.editor,path:p.log_location}:null:null}export{r as findActiveEditorLog};
1
+ import{existsSync as o}from"node:fs";import{g as t}from"./cli-6821596f.js";import"node-fetch";import"@web-std/file";import"node:crypto";import"@caporal/core";import"fs";import"open";import"crypto";import"buffer";import"path";import"ora";import"node:fs/promises";import"node:os";import"node:path";import"util";import"stream";import"http";import"https";import"url";import"assert";import"tty";import"os";import"zlib";import"events";import"node:readline/promises";import"dotenv";import"@logto/node";import"node:readline";import"node:stream";import"node:zlib";import"express";import"ws";import"child_process";import"minimatch";import"body-parser";import"node:child_process";function r(){var r;let i;try{i=t()}catch{return null}const p=null==(r=i)||null==(r=r.entries)?void 0:r[0];return p&&p.log_location?"unity"!==p.editor&&"blender"!==p.editor?null:o(p.log_location)?{editor:p.editor,path:p.log_location}:null:null}export{r as findActiveEditorLog};
package/dist/index.d.ts CHANGED
@@ -2,6 +2,18 @@ import * as _logto_browser from '@logto/browser';
2
2
  import { UserScope } from '@logto/browser';
3
3
  import Stripe from 'stripe';
4
4
 
5
+ /**
6
+ * Self-selected user role/persona. Optional everywhere — a user may have none.
7
+ * Used to lightly tailor AI responses. See PERSONA_OPTIONS for the value→label map.
8
+ */
9
+ type PersonaRole =
10
+ | "generalist"
11
+ | "developer"
12
+ | "technical_artist"
13
+ | "designer"
14
+ | "manager"
15
+ | "agency";
16
+
5
17
  type LogtoUserCustomData$1 = {
6
18
  default_org?: string;
7
19
  machines?: Array<{ id: string, name: string, first_login_at: string, login_expiration_time?: string }>;
@@ -11,6 +23,8 @@ type LogtoUserCustomData$1 = {
11
23
  ai?: {
12
24
  cli_tools?: "bypass_permissions" | "disabled";
13
25
  }
26
+ /** Self-selected role/persona. Optional — undefined means the user has not chosen one. */
27
+ persona?: PersonaRole;
14
28
  }
15
29
 
16
30
  declare namespace Auth {
@@ -174,6 +188,18 @@ type ChatMessage = {
174
188
  is_partial?: boolean,
175
189
  /** True when the user stopped generation mid-stream. */
176
190
  interrupted?: boolean,
191
+ /**
192
+ * Set on a user message that answered an elicitation by picking an option (not free
193
+ * text) — render it as a clear multiple-choice selection rather than typed text.
194
+ * `label` is the option's display label; `value` is the chosen value.
195
+ */
196
+ selection?: {
197
+ question: string,
198
+ label: string,
199
+ value: string,
200
+ /** All options offered, so the UI can show the unchosen ones (dimmed). */
201
+ options?: Array<{ label: string, value: string, description?: string }>,
202
+ },
177
203
  } | null,
178
204
  }
179
205
  type AIChatGETResponse = {
@@ -184,6 +210,20 @@ type AIChatGETResponse = {
184
210
  cli_tools_enabled?: boolean,
185
211
  /** Full URL to view this chat on the Needle Cloud frontend. */
186
212
  chat_url?: string,
213
+ /**
214
+ * An interactive question / action confirmation still awaiting the user's reply, if
215
+ * any. Present when the chat was left with an unanswered elicitation — render the form
216
+ * (the same way you would for an `elicitation` stream event) and reply via
217
+ * `sendElicitationResponse` carrying `action_id`. Absent when nothing is pending.
218
+ */
219
+ pending_elicitation?: {
220
+ action_id: string,
221
+ kind: "ask" | "confirm_action",
222
+ message: string,
223
+ note?: string,
224
+ options?: ElicitationOption[],
225
+ text_input?: ElicitationField,
226
+ },
187
227
  }
188
228
 
189
229
  /** Response type when using stream: false in the request body. */
@@ -238,8 +278,46 @@ type ChatStreamEvent = { /** SSE event id for position tracking. */ id?: number
238
278
  | { type: "done", token_usage: AiTokenUsageInfo, /** Full URL to view this chat on the Needle Cloud frontend. */ chat_url?: string }
239
279
  /** Server-assigned chat ID (emitted when a new chat is created on the first message). */
240
280
  | { type: "chat_id", chat_id: string }
281
+ /**
282
+ * The AI is asking the user something before continuing. Render a card with
283
+ * `options` as buttons and/or a free-text field when `text_input` is present.
284
+ * Respond by sending an elicitation_response (see `sendElicitationResponse`)
285
+ * carrying this `action_id`. `kind: "confirm_action"` is a confirmation gate for
286
+ * a write action (e.g. generating a material) that the server runs only on
287
+ * authorization; `kind: "ask"` is a plain question whose answer feeds back to the AI.
288
+ */
289
+ | {
290
+ type: "elicitation",
291
+ action_id: string,
292
+ kind: "ask" | "confirm_action",
293
+ message: string,
294
+ /** Secondary caveat shown smaller/muted under the question (e.g. usage note). */
295
+ note?: string,
296
+ options?: ElicitationOption[],
297
+ text_input?: ElicitationField,
298
+ }
241
299
  )
242
300
 
301
+ /** A selectable option in an elicitation request. */
302
+ type ElicitationOption = {
303
+ /** Button label shown to the user. */
304
+ label: string,
305
+ /** Value sent back in the elicitation_response when this option is chosen. */
306
+ value: string,
307
+ /** Optional helper text. */
308
+ description?: string,
309
+ /** Visual hint for the UI (e.g. a destructive/cancel action). */
310
+ style?: "primary" | "default" | "danger",
311
+ }
312
+
313
+ /** An optional free-text input offered alongside (or instead of) options. */
314
+ type ElicitationField = {
315
+ /** Placeholder text for the input. */
316
+ placeholder?: string,
317
+ /** Whether the input should allow multiple lines. */
318
+ multiline?: boolean,
319
+ }
320
+
243
321
 
244
322
  // ─── WebSocket Tool Connection Types ────────────────────────────────
245
323