sim 2.1.7 → 2.1.8-dev.94.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/README.md +1 -18
- package/dist/auth/device-flow.d.ts +38 -0
- package/dist/commands/auth.d.ts +5 -0
- package/dist/commands/configure.d.ts +2 -0
- package/dist/commands/credentials.d.ts +3 -0
- package/dist/commands/protocol/chat.d.ts +11 -0
- package/dist/commands/protocol/files-get.d.ts +25 -0
- package/dist/commands/protocol/files-upload.d.ts +2 -0
- package/dist/commands/protocol/index.d.ts +3 -0
- package/dist/commands/protocol/knowledge-document-upload.d.ts +2 -0
- package/dist/commands/protocol/logs-follow.d.ts +39 -0
- package/dist/commands/protocol/resource-directory.d.ts +24 -0
- package/dist/commands/protocol/result.d.ts +2 -0
- package/dist/commands/protocol/tables-import.d.ts +2 -0
- package/dist/commands/protocol/workflow-run-follow.d.ts +56 -0
- package/dist/commands/protocol/workflow-run-get.d.ts +15 -0
- package/dist/commands/protocol/workflow-run-wait.d.ts +3 -0
- package/dist/commands/secrets.d.ts +3 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/ini.d.ts +111 -0
- package/dist/config/paths.d.ts +10 -0
- package/dist/config/profile.d.ts +158 -0
- package/dist/context.d.ts +21 -0
- package/dist/contract/commands.d.ts +14 -0
- package/dist/contract/types.d.ts +292 -0
- package/dist/embed-context.d.ts +83 -0
- package/dist/embed-output.d.ts +15 -0
- package/dist/generated/v2-api.d.ts +12969 -0
- package/dist/helpers.d.ts +9 -0
- package/dist/http/client.d.ts +166 -0
- package/dist/http/environment.d.ts +32 -0
- package/dist/index.js +895 -1115
- package/dist/output/presentation.d.ts +4 -0
- package/dist/output/render.d.ts +60 -0
- package/dist/output/terminal-text.d.ts +17 -0
- package/dist/output/trace.d.ts +3 -0
- package/dist/program.d.ts +21 -0
- package/dist/runtime/build.d.ts +38 -0
- package/dist/runtime/derive.d.ts +20 -0
- package/dist/runtime/execute.d.ts +30 -0
- package/dist/runtime/naming.d.ts +25 -0
- package/dist/runtime/options.d.ts +7 -0
- package/dist/runtime/renamed.d.ts +20 -0
- package/dist/runtime/request.d.ts +109 -0
- package/dist/runtime/result.d.ts +50 -0
- package/dist/runtime/types.d.ts +23 -0
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.js +16832 -0
- package/dist/terminal/secret-input.d.ts +15 -0
- package/dist/terminal.d.ts +6 -0
- package/dist/transfer/local-file.d.ts +16 -0
- package/dist/transfer/streaming-upload.d.ts +16 -0
- package/dist/transfer/upload-session.d.ts +18 -0
- package/dist/version.d.ts +10 -0
- package/package.json +15 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReadStream } from 'node:tty';
|
|
2
|
+
import { SimApiError } from '../http/client';
|
|
3
|
+
/**
|
|
4
|
+
* Raised when the user abandons the prompt with Ctrl-C or Ctrl-D, so the caller
|
|
5
|
+
* can exit 130 rather than folding an abort into the generic failure code.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SecretInputCancelledError extends SimApiError {
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
|
10
|
+
interface SecretOutput {
|
|
11
|
+
write(value: string): unknown;
|
|
12
|
+
}
|
|
13
|
+
/** Reads a secret from a TTY while rendering one mask character per entered character. */
|
|
14
|
+
export declare function promptSecret(input?: ReadStream, output?: SecretOutput): Promise<string>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anything the CLI can explain prints as one line and exits 1. An unexpected
|
|
3
|
+
* error keeps its stack trace — that is a bug in the CLI, and hiding it behind a
|
|
4
|
+
* friendly message would make it unreportable.
|
|
5
|
+
*/
|
|
6
|
+
export declare function runTerminalCli(program?: import("commander").Command): Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type EmbedContext } from '../embed-context';
|
|
2
|
+
/** Both positional file spellings address the caller's same path. */
|
|
3
|
+
export declare function embeddedFileKey(path: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* An embedded run executes in-process on the hosting server, so a positional path must
|
|
6
|
+
* never reach the server's filesystem. Only the caller-provided file reader may
|
|
7
|
+
* resolve it; missing capabilities and read failures stay explicit.
|
|
8
|
+
*/
|
|
9
|
+
export declare function embeddedFileContent(embedded: EmbedContext, path: string): Promise<string | Uint8Array<ArrayBuffer>>;
|
|
10
|
+
export declare function contentTypeFor(name: string): string;
|
|
11
|
+
export interface LocalFile {
|
|
12
|
+
name: string;
|
|
13
|
+
size: number;
|
|
14
|
+
}
|
|
15
|
+
/** Validates the size and name shared by every local-file transfer. */
|
|
16
|
+
export declare function localFile(path: string, override?: string): Promise<LocalFile>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** One forward-only file stream shared by a PUT or successive multipart requests. */
|
|
2
|
+
export declare class StreamingUpload {
|
|
3
|
+
private readonly size;
|
|
4
|
+
private position;
|
|
5
|
+
private pending;
|
|
6
|
+
private closed;
|
|
7
|
+
private readonly reader;
|
|
8
|
+
private readonly onAbort;
|
|
9
|
+
private readonly stopped;
|
|
10
|
+
readonly signal: AbortSignal;
|
|
11
|
+
constructor(stream: ReadableStream<Uint8Array>, size: number, signal?: AbortSignal);
|
|
12
|
+
slice(start: number, end: number): ReadableStream<Uint8Array>;
|
|
13
|
+
assertConsumed(end: number): void;
|
|
14
|
+
verifyComplete(): Promise<void>;
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SimClient } from '../http/client';
|
|
2
|
+
export type UploadTransfer = {
|
|
3
|
+
method: 'put';
|
|
4
|
+
url: string;
|
|
5
|
+
headers: Record<string, string>;
|
|
6
|
+
} | {
|
|
7
|
+
method: 'multipart';
|
|
8
|
+
partSize: number;
|
|
9
|
+
partCount: number;
|
|
10
|
+
};
|
|
11
|
+
export interface UploadSession {
|
|
12
|
+
basePath: string;
|
|
13
|
+
uploadToken: string;
|
|
14
|
+
transfer: UploadTransfer;
|
|
15
|
+
size: number;
|
|
16
|
+
}
|
|
17
|
+
/** Uploads and completes a signed transfer, aborting its session if the transfer fails. */
|
|
18
|
+
export declare function finishUploadSession<T>(client: SimClient, workspaceId: string, session: UploadSession, path: string): Promise<T>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function cliVersion(): string;
|
|
2
|
+
/**
|
|
3
|
+
* Identifies the CLI to the API, the way every other terminal client does.
|
|
4
|
+
*
|
|
5
|
+
* Without it a CLI request is indistinguishable from any other API traffic, so
|
|
6
|
+
* a bug that only reproduces on one CLI version cannot be found in the server's
|
|
7
|
+
* own logs. The runtime and platform ride along for the same reason: they are
|
|
8
|
+
* the first things asked about a transport failure that only some users see.
|
|
9
|
+
*/
|
|
10
|
+
export declare function userAgent(): string;
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sim",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.8-dev.94.1",
|
|
4
4
|
"description": "Sim CLI - talk to the Sim API from your terminal",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"imports": {
|
|
7
|
+
"#cli/*": "./src/*.ts"
|
|
8
|
+
},
|
|
6
9
|
"bin": {
|
|
7
10
|
"sim": "dist/index.js"
|
|
8
11
|
},
|
|
9
12
|
"scripts": {
|
|
10
13
|
"prebuild": "bun run clean",
|
|
11
|
-
"build": "bun build src/index.ts --target=node --format=esm --packages=bundle --reject-unresolved --
|
|
14
|
+
"build": "bun build src/index.ts src/runtime.ts --target=node --format=esm --packages=bundle --reject-unresolved --outdir=dist && tsc -p tsconfig.types.json",
|
|
12
15
|
"clean": "bun -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\"",
|
|
13
16
|
"type-check": "tsc --noEmit",
|
|
14
17
|
"lint": "biome check --write --unsafe .",
|
|
@@ -57,5 +60,15 @@
|
|
|
57
60
|
"@types/node": "24.2.1",
|
|
58
61
|
"typescript": "^7.0.2",
|
|
59
62
|
"vitest": "^4.1.0"
|
|
63
|
+
},
|
|
64
|
+
"exports": {
|
|
65
|
+
"./embed": {
|
|
66
|
+
"types": "./src/embed.ts",
|
|
67
|
+
"default": "./src/embed.ts"
|
|
68
|
+
},
|
|
69
|
+
"./runtime": {
|
|
70
|
+
"types": "./dist/runtime.d.ts",
|
|
71
|
+
"default": "./dist/runtime.js"
|
|
72
|
+
}
|
|
60
73
|
}
|
|
61
74
|
}
|