@gizmo-ai/client 0.2.2
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/__tests__/client.test.d.ts +2 -0
- package/dist/__tests__/client.test.d.ts.map +1 -0
- package/dist/__tests__/subscribe.test.d.ts +2 -0
- package/dist/__tests__/subscribe.test.d.ts.map +1 -0
- package/dist/client.d.ts +15 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +835 -0
- package/dist/subscribe.d.ts +18 -0
- package/dist/subscribe.d.ts.map +1 -0
- package/dist/types.d.ts +218 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +33 -0
- package/src/__tests__/client.test.ts +412 -0
- package/src/__tests__/subscribe.test.ts +333 -0
- package/src/client.ts +214 -0
- package/src/errors.ts +16 -0
- package/src/index.ts +63 -0
- package/src/subscribe.ts +87 -0
- package/src/types.ts +271 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/client.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribe.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/subscribe.test.ts"],"names":[],"mappings":""}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createClient — factory for the typed Gizmo agent SDK
|
|
3
|
+
*
|
|
4
|
+
* One dependency, one createClient(url) call, every operation becomes a
|
|
5
|
+
* thin typed wrapper over the HTTP/SSE API.
|
|
6
|
+
*/
|
|
7
|
+
import type { ClientOptions, GizmoClient } from "./types.ts";
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed client for a Gizmo agent.
|
|
10
|
+
*
|
|
11
|
+
* @param baseUrl - The agent's base URL (e.g., "http://localhost:3001")
|
|
12
|
+
* @param options - Optional fetch implementation and default headers
|
|
13
|
+
*/
|
|
14
|
+
export declare function createClient(baseUrl: string, options?: ClientOptions): GizmoClient;
|
|
15
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAmBV,aAAa,EACb,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,aAAa,GACtB,WAAW,CA+Ib"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GizmoClientError
|
|
3
|
+
*
|
|
4
|
+
* Thrown when the server returns a non-OK HTTP response.
|
|
5
|
+
*/
|
|
6
|
+
export declare class GizmoClientError extends Error {
|
|
7
|
+
readonly status: number;
|
|
8
|
+
readonly body?: unknown;
|
|
9
|
+
constructor(status: number, message: string, body?: unknown);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;gBAEZ,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO;CAM5D"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @gizmo-ai/client
|
|
3
|
+
*
|
|
4
|
+
* Typed SDK for Gizmo agents — discover, invoke, subscribe, and manage runs.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { createClient } from "@gizmo-ai/client";
|
|
9
|
+
*
|
|
10
|
+
* const client = createClient("http://localhost:3001");
|
|
11
|
+
*
|
|
12
|
+
* const manifest = await client.discover();
|
|
13
|
+
* const { executionId } = await client.invoke("Hello!");
|
|
14
|
+
* const unsub = client.subscribe(({ slices, event }) => {
|
|
15
|
+
* console.log(event.type, slices);
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export { createClient } from "./client.ts";
|
|
20
|
+
export { GizmoClientError } from "./errors.ts";
|
|
21
|
+
export type { GizmoClient, ClientOptions, GizmoManifest, SSEEvent, InitialStateEvent, StateUpdateEvent, ExecutionStatusEvent, HeartbeatEvent, CustomEvent, InvokeResponse, AbortResponse, RunSummary, RunDetails, RunsResponse, RunListParams, HydrateOptions, HydrateResponse, HealthResponse, DispatchRequest, ApprovalStatus, Approval, ApprovalsListResponse, ApprovalResponse, HistoryResponse, StateSnapshot, SubscribeCallback, SubscribeOptions, Unsubscribe, } from "./types.ts";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,YAAY,EAEV,WAAW,EACX,aAAa,EAGb,aAAa,EAGb,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,WAAW,EAGX,cAAc,EACd,aAAa,EACb,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EAGf,cAAc,EACd,QAAQ,EACR,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EAGf,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,GACZ,MAAM,YAAY,CAAC"}
|