@finalai/computers 0.1.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.
Potentially problematic release.
This version of @finalai/computers might be problematic. Click here for more details.
- package/README.md +16 -0
- package/dist/modules/browser-access.d.mts +18 -0
- package/dist/modules/browser-access.mjs +22 -0
- package/dist/modules/browser-access.mjs.map +7 -0
- package/dist/modules/client.d.mts +5 -0
- package/dist/modules/client.mjs +764 -0
- package/dist/modules/client.mjs.map +7 -0
- package/dist/modules/file-snapshots.d.mts +69 -0
- package/dist/modules/file-snapshots.mjs +64 -0
- package/dist/modules/file-snapshots.mjs.map +7 -0
- package/dist/modules/index.d.mts +11 -0
- package/dist/modules/index.mjs +63 -0
- package/dist/modules/index.mjs.map +7 -0
- package/dist/modules/json.d.mts +5 -0
- package/dist/modules/json.mjs +8 -0
- package/dist/modules/json.mjs.map +7 -0
- package/dist/modules/normalize.d.mts +7 -0
- package/dist/modules/normalize.mjs +210 -0
- package/dist/modules/normalize.mjs.map +7 -0
- package/dist/modules/result.d.mts +13 -0
- package/dist/modules/result.mjs +14 -0
- package/dist/modules/result.mjs.map +7 -0
- package/dist/modules/screen.d.mts +41 -0
- package/dist/modules/screen.mjs +37 -0
- package/dist/modules/screen.mjs.map +7 -0
- package/dist/modules/shell.d.mts +1 -0
- package/dist/modules/shell.mjs +5 -0
- package/dist/modules/shell.mjs.map +7 -0
- package/dist/modules/transport-api.d.mts +2 -0
- package/dist/modules/transport-api.mjs +7 -0
- package/dist/modules/transport-api.mjs.map +7 -0
- package/dist/modules/transport.d.mts +15 -0
- package/dist/modules/transport.mjs +67 -0
- package/dist/modules/transport.mjs.map +7 -0
- package/dist/modules/types.d.mts +467 -0
- package/dist/modules/types.mjs +69 -0
- package/dist/modules/types.mjs.map +7 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @finalai/computers
|
|
2
|
+
|
|
3
|
+
Client for the Final Computers public `/v1` API, authenticated with an API key.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { createComputerClient, orThrow } from '@finalai/computers';
|
|
7
|
+
const client = createComputerClient({
|
|
8
|
+
baseUrl: 'https://computer-api.final.ai',
|
|
9
|
+
auth: { apiKey: 'your-api-key' },
|
|
10
|
+
});
|
|
11
|
+
const computers = orThrow(await client.listComputers());
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Calls return `ResultIface<T>`. Transport configuration accepts injected `fetch`, a
|
|
15
|
+
request timeout, and cancellation. `/transport` exposes reusable transport/client
|
|
16
|
+
adapter seams. Node 26 is required for file operations that use Buffer.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export declare const computerBrowserAccessSchema: z.ZodObject<{
|
|
3
|
+
tokenId: z.ZodString;
|
|
4
|
+
url: z.ZodString;
|
|
5
|
+
token: z.ZodString;
|
|
6
|
+
expiresAt: z.ZodString;
|
|
7
|
+
returnTo: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type ComputerBrowserAccessIface = z.infer<typeof computerBrowserAccessSchema>;
|
|
10
|
+
export interface ComputerBrowserAccessOptionsIface {
|
|
11
|
+
port: number;
|
|
12
|
+
/** Local application path, including query parameters. Never an external URL. */
|
|
13
|
+
returnTo?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const computerBrowserAccessRequestSchema: z.ZodObject<{
|
|
16
|
+
port: z.ZodNumber;
|
|
17
|
+
returnTo: z.ZodDefault<z.ZodString>;
|
|
18
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
const computerBrowserAccessSchema = z.object({
|
|
3
|
+
tokenId: z.string(),
|
|
4
|
+
url: z.string().url(),
|
|
5
|
+
token: z.string(),
|
|
6
|
+
expiresAt: z.string(),
|
|
7
|
+
returnTo: z.string()
|
|
8
|
+
});
|
|
9
|
+
const computerBrowserAccessRequestSchema = z.strictObject({
|
|
10
|
+
port: z.number().int().min(3e3).max(9999),
|
|
11
|
+
returnTo: z.string().max(4096).default("/").refine(
|
|
12
|
+
(path) => path.startsWith("/") && !path.startsWith("//") && !Array.from(path).some(
|
|
13
|
+
(character) => character === "\\" || character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127
|
|
14
|
+
),
|
|
15
|
+
"returnTo must be a local application path"
|
|
16
|
+
)
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
computerBrowserAccessRequestSchema,
|
|
20
|
+
computerBrowserAccessSchema
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=browser-access.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/browser-access.ts"],
|
|
4
|
+
"sourcesContent": ["import * as z from 'zod';\n\nexport const computerBrowserAccessSchema = z.object({\n tokenId: z.string(),\n url: z.string().url(),\n token: z.string(),\n expiresAt: z.string(),\n returnTo: z.string(),\n});\nexport type ComputerBrowserAccessIface = z.infer<typeof computerBrowserAccessSchema>;\n\nexport interface ComputerBrowserAccessOptionsIface {\n port: number;\n /** Local application path, including query parameters. Never an external URL. */\n returnTo?: string;\n}\n\nexport const computerBrowserAccessRequestSchema = z.strictObject({\n port: z.number().int().min(3000).max(9999),\n returnTo: z\n .string()\n .max(4096)\n .default('/')\n .refine(\n (path) =>\n path.startsWith('/') &&\n !path.startsWith('//') &&\n !Array.from(path).some(\n (character) =>\n character === '\\\\' || character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127,\n ),\n 'returnTo must be a local application path',\n ),\n});\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,OAAO;AAEZ,MAAM,8BAA8B,EAAE,OAAO;AAAA,EAClD,SAAS,EAAE,OAAO;AAAA,EAClB,KAAK,EAAE,OAAO,EAAE,IAAI;AAAA,EACpB,OAAO,EAAE,OAAO;AAAA,EAChB,WAAW,EAAE,OAAO;AAAA,EACpB,UAAU,EAAE,OAAO;AACrB,CAAC;AASM,MAAM,qCAAqC,EAAE,aAAa;AAAA,EAC/D,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAI,EAAE,IAAI,IAAI;AAAA,EACzC,UAAU,EACP,OAAO,EACP,IAAI,IAAI,EACR,QAAQ,GAAG,EACX;AAAA,IACC,CAAC,SACC,KAAK,WAAW,GAAG,KACnB,CAAC,KAAK,WAAW,IAAI,KACrB,CAAC,MAAM,KAAK,IAAI,EAAE;AAAA,MAChB,CAAC,cACC,cAAc,QAAQ,UAAU,WAAW,CAAC,IAAI,MAAM,UAAU,WAAW,CAAC,MAAM;AAAA,IACtF;AAAA,IACF;AAAA,EACF;AACJ,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type TransportIface } from "./transport.mjs";
|
|
2
|
+
import { type ComputerClientIface, type ComputerHandleIface, type ComputerInfoIface, type CreateComputerClientArgsIface } from "./types.mjs";
|
|
3
|
+
export declare const createComputerHandle: (transport: TransportIface, initialInfo: ComputerInfoIface) => ComputerHandleIface;
|
|
4
|
+
export declare const createComputerClientWithTransport: (transport: TransportIface) => ComputerClientIface;
|
|
5
|
+
export declare const createComputerClient: (args: CreateComputerClientArgsIface) => ComputerClientIface;
|