needle-cloud 3.2.1 → 3.3.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/CHANGELOG.md +5 -0
- package/dist/{cli-b8d9cfb5.js → cli-51eba1aa.js} +2 -2
- package/dist/cli.esm.js +1 -1
- package/dist/{cli.send-logs.discovery-65942f5e.js → cli.send-logs.discovery-29fa4e4a.js} +1 -1
- package/dist/index.d.ts +114 -3
- package/dist/index.esm.js +1 -1
- package/dist/web/functions/chat.d.ts +6 -1
- package/dist/web/functions/index.d.ts +1 -0
- package/dist/web/functions/project-diagnostics.d.ts +22 -0
- package/package.json +1 -1
package/dist/cli.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node-fetch";import"@web-std/file";import"node:crypto";export{p as program}from"./cli-
|
|
1
|
+
import"node-fetch";import"@web-std/file";import"node:crypto";export{p as program}from"./cli-51eba1aa.js";import"fs";import"dotenv";import"ora";import"commander";import"child_process";import"open";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"crypto";import"net";import"tls";import"assert";import"tty";import"os";import"events";import"http2";import"zlib";import"node:console";import"node:readline/promises";import"node:util";import"@logto/node";import"node:readline";import"node:stream";import"node:zlib";import"express";import"ws";import"node:child_process";import"minimatch";import"node:url";import"node:timers/promises";import"body-parser";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as o,readdirSync as t,statSync as r}from"node:fs";import{dirname as i,join as e}from"node:path";import{g as n}from"./cli-
|
|
1
|
+
import{existsSync as o,readdirSync as t,statSync as r}from"node:fs";import{dirname as i,join as e}from"node:path";import{g as n}from"./cli-51eba1aa.js";import"node-fetch";import"@web-std/file";import"node:crypto";import"commander";import"fs";import"child_process";import"open";import"path";import"ora";import"node:fs/promises";import"node:os";import"util";import"stream";import"http";import"https";import"url";import"crypto";import"net";import"tls";import"assert";import"tty";import"os";import"events";import"http2";import"zlib";import"node:console";import"node:readline/promises";import"node:util";import"dotenv";import"@logto/node";import"node:readline";import"node:stream";import"node:zlib";import"express";import"ws";import"node:child_process";import"minimatch";import"node:url";import"node:timers/promises";import"body-parser";function p(){var p;let m;try{m=n()}catch{return null}const s=null==(p=m)||null==(p=p.entries)?void 0:p[0];if(!s)return null;if(!s.log_location)return null;if("unity"!==s.editor&&"blender"!==s.editor)return null;if(!o(s.log_location))return null;const l=s.log_location,d=function(o,i){const n=new Set([i]);try{for(const i of t(o)){if(!i.toLowerCase().endsWith(".log"))continue;const t=e(o,i);try{if(!r(t).isFile())continue}catch{continue}n.add(t)}}catch{}return[...n]}(i(l),l);return{editor:s.editor,path:l,paths:d}}export{p as findActiveEditorLog};
|
package/dist/index.d.ts
CHANGED
|
@@ -141,6 +141,54 @@ declare type AuthData$1 = {
|
|
|
141
141
|
roles_org?: Array<string>;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
/** A bounded part of a diagnostic record, retried with the same ID and content. */
|
|
145
|
+
type ProjectDiagnosticPart$1 = {
|
|
146
|
+
id: string;
|
|
147
|
+
session: string;
|
|
148
|
+
revision: number | null;
|
|
149
|
+
part: number;
|
|
150
|
+
parts: number;
|
|
151
|
+
totalBytes: number;
|
|
152
|
+
text: string;
|
|
153
|
+
firstTime: number;
|
|
154
|
+
lastTime: number;
|
|
155
|
+
build: string;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
type ProjectDiagnosticPolicy$1 = {
|
|
159
|
+
enabled: boolean;
|
|
160
|
+
canOptOut: boolean;
|
|
161
|
+
limits: {
|
|
162
|
+
projectBytes: number;
|
|
163
|
+
teamBytes: number;
|
|
164
|
+
batchBytes: number;
|
|
165
|
+
recordBytes: number;
|
|
166
|
+
reportsPerDay: number;
|
|
167
|
+
rollingDays: number;
|
|
168
|
+
reportDays: number;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
type ProjectBugReportRequest$1 = {
|
|
173
|
+
id: string;
|
|
174
|
+
description: string;
|
|
175
|
+
session: string;
|
|
176
|
+
revision: number | null;
|
|
177
|
+
build: string;
|
|
178
|
+
records: string[];
|
|
179
|
+
/** Capture cutoff in Unix milliseconds. Evidence attaches asynchronously when supplied. */
|
|
180
|
+
capturedAt?: number;
|
|
181
|
+
/** Optional local evidence attached only to this explicit report. */
|
|
182
|
+
evidence?: { text: string; incomplete: boolean };
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
type ProjectBugReportReceipt$1 = {
|
|
186
|
+
id: string;
|
|
187
|
+
status: 'collecting' | 'complete' | 'incomplete';
|
|
188
|
+
missingRecords: string[];
|
|
189
|
+
expiresAt: string;
|
|
190
|
+
};
|
|
191
|
+
|
|
144
192
|
type NeedleLicense = "basic" | "indie" | "pro" | "enterprise" | "edu"
|
|
145
193
|
|
|
146
194
|
type BaseLicense = {
|
|
@@ -639,6 +687,10 @@ type ElicitationField = {
|
|
|
639
687
|
|
|
640
688
|
/** Tool definition for registering tools via WebSocket. */
|
|
641
689
|
type ToolDefinition$1 = {
|
|
690
|
+
/** Optional result schema returned by discovery. */
|
|
691
|
+
outputSchema?: Record<string, unknown>,
|
|
692
|
+
/** Guidance and invocation route used by tool discovery. */
|
|
693
|
+
discovery?: ToolDiscoveryMetadata$1,
|
|
642
694
|
/** Applicability requirements (all-of), checked only when policy capabilities are supplied. */
|
|
643
695
|
requires?: string[],
|
|
644
696
|
/** Discovery hints; never permissions. */
|
|
@@ -664,6 +716,8 @@ type ToolDefinition$1 = {
|
|
|
664
716
|
* than one conversation needs this to attach the result to the right one.
|
|
665
717
|
*/
|
|
666
718
|
type ToolRequestMeta = {
|
|
719
|
+
/** SDK methods permitted for this execution; an empty array permits none. */
|
|
720
|
+
allowedSdkMethods?: string[],
|
|
667
721
|
/** The chat this request belongs to; `null` if the server did not identify one. */
|
|
668
722
|
chatId: string | null,
|
|
669
723
|
/** Id of this request, matching the result sent back for it. */
|
|
@@ -723,6 +777,8 @@ type ChatSessionOptions$1 = {
|
|
|
723
777
|
source?: string,
|
|
724
778
|
/** Tools to register via WebSocket. If empty/omitted, no WS connection is made. */
|
|
725
779
|
tools?: ToolDefinition$1[],
|
|
780
|
+
/** Full catalog used only when the server declares discovery support; tools remains the legacy fallback. */
|
|
781
|
+
toolCatalog?: ToolDefinition$1[],
|
|
726
782
|
/**
|
|
727
783
|
* Called when the server requests tool execution.
|
|
728
784
|
* Return `{ result: ... }` on success or `{ error: "..." }` on failure.
|
|
@@ -816,7 +872,7 @@ type ChatSessionHandle$1 = {
|
|
|
816
872
|
*/
|
|
817
873
|
newChat(): string,
|
|
818
874
|
/** Update the tools registered with the server. No-op if no WS connection. */
|
|
819
|
-
updateTools(tools: ToolDefinition$1[]): void,
|
|
875
|
+
updateTools(tools: ToolDefinition$1[], catalog?: ToolDefinition$1[]): void,
|
|
820
876
|
/** Most recent token usage info, auto-updated from `done` events. Null until first message completes. */
|
|
821
877
|
readonly usage: AiTokenUsageInfo | null,
|
|
822
878
|
/** Full URL to view the most recent chat on the Needle Cloud frontend. Auto-updated from `done` events and `readChat`. Null until first response. */
|
|
@@ -870,6 +926,33 @@ declare class AIChatError extends Error {
|
|
|
870
926
|
details: AIQuotaErrorData | null;
|
|
871
927
|
}
|
|
872
928
|
|
|
929
|
+
/** How to invoke a discovered tool. Discovery does not grant access. */
|
|
930
|
+
type ToolInvocation$1 = { kind: 'direct' } | { kind: 'sdk'; executor: string; method: string };
|
|
931
|
+
/** Search metadata supplied alongside a tool's existing definition. */
|
|
932
|
+
type ToolDiscoveryMetadata$1 = {
|
|
933
|
+
tags?: string[];
|
|
934
|
+
guidance?: string[];
|
|
935
|
+
invocation?: ToolInvocation$1;
|
|
936
|
+
};
|
|
937
|
+
type DiscoverableTool$1 = ToolDiscoveryMetadata$1 & {
|
|
938
|
+
name: string;
|
|
939
|
+
description: string;
|
|
940
|
+
inputSchema: Record<string, unknown>;
|
|
941
|
+
outputSchema?: Record<string, unknown>;
|
|
942
|
+
};
|
|
943
|
+
type ToolDiscoveryQuery$1 = { query?: string; limit?: number; offset?: number };
|
|
944
|
+
type ToolDiscoveryResult$1 = {
|
|
945
|
+
/** Shared instructions for the returned page, emitted once rather than per tool. */
|
|
946
|
+
guidance?: string[];
|
|
947
|
+
tools: DiscoverableTool$1[];
|
|
948
|
+
index?: Array<{ name: string; description: string }>;
|
|
949
|
+
totalMatched: number;
|
|
950
|
+
totalAvailable: number;
|
|
951
|
+
offset: number;
|
|
952
|
+
hasMore: boolean;
|
|
953
|
+
};
|
|
954
|
+
declare function discoverTools(catalog: readonly DiscoverableTool$1[], options?: ToolDiscoveryQuery$1): ToolDiscoveryResult$1;
|
|
955
|
+
|
|
873
956
|
type AssetVector3 = [number, number, number];
|
|
874
957
|
type AssetGeometryMetadata = {
|
|
875
958
|
meshes: number;
|
|
@@ -2466,6 +2549,11 @@ type ChatToolPreferences = ChatToolPreferences$1;
|
|
|
2466
2549
|
type ChatToolPreferenceUpdate = ChatToolPreferenceUpdate$1;
|
|
2467
2550
|
type ChatToolListItem = ChatToolListItem$1;
|
|
2468
2551
|
type ChatToolUnavailableReason = ChatToolUnavailableReason$1;
|
|
2552
|
+
type ToolInvocation = ToolInvocation$1;
|
|
2553
|
+
type ToolDiscoveryMetadata = ToolDiscoveryMetadata$1;
|
|
2554
|
+
type DiscoverableTool = DiscoverableTool$1;
|
|
2555
|
+
type ToolDiscoveryQuery = ToolDiscoveryQuery$1;
|
|
2556
|
+
type ToolDiscoveryResult = ToolDiscoveryResult$1;
|
|
2469
2557
|
|
|
2470
2558
|
/**
|
|
2471
2559
|
* List publicly discoverable content items on Needle Cloud.
|
|
@@ -2928,6 +3016,29 @@ declare function getProjectPromotions(project: string, opts?: {
|
|
|
2928
3016
|
}>;
|
|
2929
3017
|
}>;
|
|
2930
3018
|
|
|
3019
|
+
/** @param {string} project @param {Options} [opts] @returns {Promise<import('@needle-tools/cloud-sdk/types/api.project-diagnostics.js').ProjectDiagnosticPolicy>} */
|
|
3020
|
+
declare function getProjectDiagnosticPolicy(project: string, opts?: Options): Promise<ProjectDiagnosticPolicy$1>;
|
|
3021
|
+
/** @param {string} project @param {boolean} enabled @param {Options} [opts] @returns {Promise<import('@needle-tools/cloud-sdk/types/api.project-diagnostics.js').ProjectDiagnosticPolicy>} */
|
|
3022
|
+
declare function setProjectDiagnosticPolicy(project: string, enabled: boolean, opts?: Options): Promise<ProjectDiagnosticPolicy$1>;
|
|
3023
|
+
/** @param {string} project @param {import('@needle-tools/cloud-sdk/types/api.project-diagnostics.js').ProjectDiagnosticPart} part @param {Options} [opts]
|
|
3024
|
+
* @returns {Promise<{id: string, part: number, complete: boolean}>} */
|
|
3025
|
+
declare function uploadProjectDiagnosticPart(project: string, part: ProjectDiagnosticPart$1, opts?: Options): Promise<{
|
|
3026
|
+
id: string;
|
|
3027
|
+
part: number;
|
|
3028
|
+
complete: boolean;
|
|
3029
|
+
}>;
|
|
3030
|
+
/** @param {string} project @param {import('@needle-tools/cloud-sdk/types/api.project-diagnostics.js').ProjectBugReportRequest} report @param {Options} [opts]
|
|
3031
|
+
* @returns {Promise<import('@needle-tools/cloud-sdk/types/api.project-diagnostics.js').ProjectBugReportReceipt>} */
|
|
3032
|
+
declare function submitProjectBugReport(project: string, report: ProjectBugReportRequest$1, opts?: Options): Promise<ProjectBugReportReceipt$1>;
|
|
3033
|
+
type ProjectDiagnosticPart = ProjectDiagnosticPart$1;
|
|
3034
|
+
type ProjectDiagnosticPolicy = ProjectDiagnosticPolicy$1;
|
|
3035
|
+
type ProjectBugReportRequest = ProjectBugReportRequest$1;
|
|
3036
|
+
type ProjectBugReportReceipt = ProjectBugReportReceipt$1;
|
|
3037
|
+
type Options = {
|
|
3038
|
+
org?: string;
|
|
3039
|
+
authToken?: string;
|
|
3040
|
+
};
|
|
3041
|
+
|
|
2931
3042
|
/** Read a published runtime snapshot by its exact identifier. @param {string} hash */
|
|
2932
3043
|
declare function getRuntimeSnapshot(hash: string): Promise<RuntimeSnapshotInfo>;
|
|
2933
3044
|
/** Look up an exact published release. @param {string} runtime @param {string} version */
|
|
@@ -3040,5 +3151,5 @@ declare namespace AuthScopes {
|
|
|
3040
3151
|
let All: string[];
|
|
3041
3152
|
}
|
|
3042
3153
|
|
|
3043
|
-
export { AIChatError, Auth, AuthScopes, NeedleLoginButton, aiComplete, aiEvaluate, archiveProject, checkProjectBlobs, checkoutProduct, cloneProject, completeProjectBlobUpload, createChatSession, createProject, deleteContent, deleteProject, generate3dAsset, getContent, getDeployments, getProductInformation, getProjectDeployments, getProjectHead, getProjectPromotions, getPublicContent, getRuntimeRelease, getRuntimeSnapshot, getUserLicenses, listChats, listContent, listProjectRevisions, listProjects, listPublicContent, ownsProduct, promoteProjectAsset, pullProjectRevision, pushProjectRevision, recordProjectDeployment, requestProjectBlobDownload, requestProjectBlobUpload, restoreProject, startCheckoutSession, unarchiveProject, updateContent, updateInlineChatParts, updateProject, updateProjectRevision, uploadFiles };
|
|
3044
|
-
export type { AIEvaluationAnswer, AIEvaluationOptions, AIEvaluationQuestion, AIEvaluationQuestions, AIEvaluationResponse, AIEvaluationState, AuthData, AuthInitOpts, ChatAuthOpts, ChatClientCapabilities, ChatInlinePart, ChatRequestDiagnostics, ChatSessionHandle, ChatSessionOptions, ChatSessionSendOptions, ChatToolListItem, ChatToolPolicy, ChatToolPreferenceUpdate, ChatToolPreferences, ChatToolUnavailableReason, ChatToolsResponse, Deployment, Filelike, LogtoUserCustomData, RecentChatsResponse, ResourceUrl, ToolDefinition, UserInfoResponse };
|
|
3154
|
+
export { AIChatError, Auth, AuthScopes, NeedleLoginButton, aiComplete, aiEvaluate, archiveProject, checkProjectBlobs, checkoutProduct, cloneProject, completeProjectBlobUpload, createChatSession, createProject, deleteContent, deleteProject, discoverTools, generate3dAsset, getContent, getDeployments, getProductInformation, getProjectDeployments, getProjectDiagnosticPolicy, getProjectHead, getProjectPromotions, getPublicContent, getRuntimeRelease, getRuntimeSnapshot, getUserLicenses, listChats, listContent, listProjectRevisions, listProjects, listPublicContent, ownsProduct, promoteProjectAsset, pullProjectRevision, pushProjectRevision, recordProjectDeployment, requestProjectBlobDownload, requestProjectBlobUpload, restoreProject, setProjectDiagnosticPolicy, startCheckoutSession, submitProjectBugReport, unarchiveProject, updateContent, updateInlineChatParts, updateProject, updateProjectRevision, uploadFiles, uploadProjectDiagnosticPart };
|
|
3155
|
+
export type { AIEvaluationAnswer, AIEvaluationOptions, AIEvaluationQuestion, AIEvaluationQuestions, AIEvaluationResponse, AIEvaluationState, AuthData, AuthInitOpts, ChatAuthOpts, ChatClientCapabilities, ChatInlinePart, ChatRequestDiagnostics, ChatSessionHandle, ChatSessionOptions, ChatSessionSendOptions, ChatToolListItem, ChatToolPolicy, ChatToolPreferenceUpdate, ChatToolPreferences, ChatToolUnavailableReason, ChatToolsResponse, Deployment, DiscoverableTool, Filelike, LogtoUserCustomData, Options, ProjectBugReportReceipt, ProjectBugReportRequest, ProjectDiagnosticPart, ProjectDiagnosticPolicy, RecentChatsResponse, ResourceUrl, ToolDefinition, ToolDiscoveryMetadata, ToolDiscoveryQuery, ToolDiscoveryResult, ToolInvocation, UserInfoResponse };
|