blink 0.1.12 → 0.1.14
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 -1
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +1 -0
- package/dist/api/test.d.ts +15 -0
- package/dist/api/test.js +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +462 -0
- package/dist/cli/lydell-node-pty-darwin-arm64.node +0 -0
- package/dist/cli/lydell-node-pty-darwin-x64.node +0 -0
- package/dist/cli/lydell-node-pty-linux-arm64.node +0 -0
- package/dist/cli/lydell-node-pty-linux-x64.node +0 -0
- package/dist/common.d.ts +207 -0
- package/dist/runtime.wasm +0 -0
- package/dist/wasm.js +61 -0
- package/package.json +30 -23
- package/dist/main.cjs +0 -57
package/README.md
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AgentOptions, Chat, CreateChatOptions, Message, MessageOptions, Options, ReadDirectoryEntry, ReadFileResult, Runtime, StreamTextOptions, StreamTextResult, WaitProcess, __unsafe_internal, agent, chat, compute } from "../common.js";
|
|
2
|
+
export { AgentOptions, Chat, CreateChatOptions, Message, MessageOptions, Options, ReadDirectoryEntry, ReadFileResult, Runtime, StreamTextOptions, StreamTextResult, WaitProcess, __unsafe_internal, agent, chat, compute };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return{name:e.name,description:e.description,streamText:e.streamText,webhook:e.webhook}}const t=__blink_unsafe_internal,n=Object.freeze({async execute(e,n){if(!t.computeExecute)throw Error(`Executing processes is not supported by this Blink runtime implementation.`);return t.computeExecute({instanceID:n?.instance,command:e,args:n?.args,env:n?.env,cwd:n?.cwd,abortSignal:n?.abortSignal})},async writeProcessInput(e,n,r){if(!t.writeProcessInput)throw Error(`Process send input is not supported by this Blink runtime.`);return t.writeProcessInput({instanceID:r?.instance,pid:e,input:n,abortSignal:r?.abortSignal})},async waitProcess(e,n){if(!t.waitProcess)throw Error(`Process wait is not supported by this Blink runtime.`);return t.waitProcess({instanceID:n?.instance,pid:e,onOutput:n?.onOutput,idleOutputTimeoutMs:n?.idleOutputTimeoutMs,timeoutMs:n?.timeoutMs,abortSignal:n?.abortSignal})},async readProcessOutput(e,n){if(!t.readProcessOutput)throw Error(`Process read output is not supported by this Blink runtime.`);return t.readProcessOutput({instanceID:n?.instance,pid:e,mode:n?.mode,abortSignal:n?.abortSignal})},async killProcess(e,n,r){if(!t.killProcess)throw Error(`Process kill is not supported by this Blink runtime.`);return t.killProcess({instanceID:r?.instance,pid:e,signal:n,abortSignal:r?.abortSignal})},async readFile(e,n){if(!t.computeReadFile)throw Error(`Machine read file is not supported by this Blink runtime.`);return t.computeReadFile({instanceID:n?.instance,path:e,lineStart:n?.lineStart,lineEnd:n?.lineEnd,abortSignal:n?.abortSignal})},async writeFile(e,n,r){if(!t.computeWriteFile)throw Error(`Machine write file is not supported by this Blink runtime.`);return t.computeWriteFile({instanceID:r?.instance,path:e,content:n,abortSignal:r?.abortSignal})},async readDirectory(e,n){if(!t.computeReadDirectory)throw Error(`Machine read directory is not supported by this Blink runtime.`);return t.computeReadDirectory({instanceID:n?.instance,path:e,abortSignal:n?.abortSignal})}}),r=Object.freeze({find(e){if(!t.findChat)throw Error(`The Blink runtime is not configured with the ability to find chats.`);return t.findChat(e)},create(e){if(!t.createChat)throw Error(`The Blink runtime is not configured with the ability to create chats.`);return t.createChat(e)},message(e,n,r){if(!t.messageChat)throw Error(`The Blink runtime is not configured with the ability to message chats.`);return t.messageChat(e,n,r)}});export{t as __unsafe_internal,e as agent,r as chat,n as compute};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Runtime } from "../common.js";
|
|
2
|
+
|
|
3
|
+
//#region src/api/test.d.ts
|
|
4
|
+
interface SpawnOptions {
|
|
5
|
+
readonly entrypoint?: string;
|
|
6
|
+
readonly cwd?: string;
|
|
7
|
+
readonly console?: Partial<typeof globalThis.console>;
|
|
8
|
+
readonly fetch?: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
9
|
+
readonly process?: {
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare function spawn(options?: SpawnOptions): Promise<Runtime>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { SpawnOptions, spawn };
|
package/dist/api/test.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{build as e,loadRuntimeWASM as t,newRuntime as n,resolveEntrypoint as r}from"../wasm.js";async function i(i){let a=i?.entrypoint??await r(i?.cwd??process.cwd());if(!a)throw Error(`Unable to locate the entrypoint of the agent. Please specify it manually.`);let o=await e(a),s=await t();return n({code:o,wasm:s,internal:{async findChat(e){return{id:`test`}},async createChat(e){return{id:`test`}},async messageChat(e,t,n){}},console:i?.console,fetch:i?.fetch,process:i?.process})}export{i as spawn};
|