@clawnify/agents 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.
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # @clawnify/agents
2
+
3
+ Server-side client for Clawnify's agent API. The app owns its business data and
4
+ run results; the selected agent owns execution and its native scheduler.
5
+
6
+ ```ts
7
+ import { createAgents } from "@clawnify/agents";
8
+
9
+ const agents = createAgents(env);
10
+ const { servers, page } = await agents.list({ limit: 25 });
11
+ // Populate a dropdown from servers; follow page.has_more for further pages.
12
+
13
+ await agents.dispatch({
14
+ server_id: selectedServerId,
15
+ instruction: "Read the saved search from the app, find matching prospects, and save evidence. Do not send outreach.",
16
+ payload: { search_id: savedSearch.id },
17
+ idempotency_key: savedRun.id,
18
+ });
19
+
20
+ // Call only after the user enables recurring work. Persist the creation key
21
+ // BEFORE sending, and persist the returned server/schedule IDs in the app.
22
+ const { schedule } = await agents.schedules.create(selectedServerId, {
23
+ name: "Daily prospect signals",
24
+ trigger: { kind: "cron", expr: "0 9 * * 1-5", tz: "Europe/Amsterdam" },
25
+ text: "Read the saved search from the app, collect evidence, and save results. Do not send outreach.",
26
+ }, { idempotencyKey: savedSearch.scheduleCreationKey });
27
+
28
+ await agents.schedules.pause(selectedServerId, schedule.id);
29
+ await agents.schedules.resume(selectedServerId, schedule.id);
30
+ await agents.schedules.update(selectedServerId, schedule.id, { name: "Renamed scan" });
31
+ await agents.schedules.run(selectedServerId, schedule.id, { idempotencyKey: savedRun.id });
32
+ const { runs } = await agents.schedules.runs(selectedServerId, schedule.id);
33
+ await agents.schedules.delete(selectedServerId, schedule.id);
34
+ ```
35
+
36
+ ## Configuration and authority
37
+
38
+ `CLAWNIFY_TOKEN` is required. Clawnify injects it into deployed apps. Never
39
+ expose it in browser code. An OAuth bearer also works, with optional
40
+ `CLAWNIFY_ORG_ID` to select the active organization. `CLAWNIFY_API_URL` overrides
41
+ the HTTPS **origin**, not a route; localhost HTTP is supported for development.
42
+
43
+ The existing service token is organization-scoped and shared by its apps.
44
+ This package does **not** provide app-to-app credential isolation. Schedule
45
+ operations only expose schedules created through this API, not manually
46
+ created native schedules. The existing agent Schedule page remains available
47
+ for native administration.
48
+
49
+ Agent selection means a server's `main` agent; sub-agent selection is not
50
+ supported. Agent secrets, browser sessions, and native WebSocket details stay
51
+ behind the platform API.
52
+
53
+ ## Schedules and retries
54
+
55
+ - Triggers: five-field cron, intervals in whole minutes (`every_ms`), or a
56
+ future ISO timestamp with timezone (`at`). Hermes only supports its server's
57
+ configured timezone; unsupported combinations return an error.
58
+ - App-created schedules use isolated sessions and silent notification delivery.
59
+ **Silent is not a tool restriction**: the app's instruction/skill must define
60
+ allowed actions, access rules, evidence handling, and work limits.
61
+ - Native schedules need an updated hook advertising `schedules.receipts`.
62
+ Older hooks return `agent_schedule_upgrade_required` before dispatch. This
63
+ package does not upgrade an agent or install app skills automatically.
64
+ - Create and run require a persisted `idempotencyKey`, scoped to organization,
65
+ server, and operation. Reusing a key with different input returns a conflict.
66
+ Completed calls replay their original response, not current schedule state.
67
+ Use `schedules.get()` to refresh current state.
68
+ - No automatic retries. Catch `ClawnifyAgentsError` and inspect `code`, `status`,
69
+ `outcomeUnknown`, and optional `retryAfterSeconds`.
70
+ - If `outcomeUnknown` is true, reuse the same key to check for a recorded
71
+ completion. **Never generate a replacement key automatically**: native create
72
+ is not idempotent, and the agent may already have accepted the work. If the
73
+ outcome stays unknown, inspect the native Schedule page before recovery.
74
+ Pending receipts do not expire or redispatch themselves.
75
+ - One-off `dispatch()` uses the existing 24-hour dedupe window, not the stronger
76
+ schedule receipt mechanism. Concurrent identical dispatches may both run.
77
+
78
+ List methods return `{ page: { limit, offset, has_more } }`, defaulting to 25
79
+ items, with a maximum of 100. Schedule listing reflects native state; the
80
+ receipt store records identity and request outcomes, not another clock.
81
+
82
+ Apps must provide their own consent, saved-search instructions, result storage,
83
+ and lifecycle handling (including disabling/removing schedules before switching
84
+ agents or uninstalling). Manifest-declared schedules and skill synchronization
85
+ are not implemented by this client.
@@ -0,0 +1,146 @@
1
+ /** API types, not a dependency on the agent harness or its WebSocket client. */
2
+ interface AgentServer {
3
+ id: string;
4
+ name: string | null;
5
+ status: string | null;
6
+ }
7
+ interface PageOptions {
8
+ limit?: number;
9
+ offset?: number;
10
+ }
11
+ interface Page {
12
+ limit: number;
13
+ offset: number;
14
+ has_more: boolean;
15
+ }
16
+ interface DispatchInput {
17
+ instruction: string;
18
+ server_id?: string;
19
+ payload?: unknown;
20
+ /** Existing dispatch dedupe lasts 24h; it does not serialize simultaneous calls. */
21
+ idempotency_key?: string;
22
+ }
23
+ interface DispatchResult {
24
+ task_id: string;
25
+ server_id: string;
26
+ agent: string;
27
+ status: "queued" | "duplicate";
28
+ }
29
+ type ScheduleTrigger = {
30
+ kind: "cron";
31
+ expr: string;
32
+ tz?: string;
33
+ } | {
34
+ kind: "every";
35
+ every_ms: number;
36
+ } | {
37
+ kind: "at";
38
+ at: string;
39
+ };
40
+ interface Schedule {
41
+ id: string;
42
+ agent_id: string;
43
+ name: string;
44
+ enabled: boolean;
45
+ trigger: ScheduleTrigger;
46
+ text: string;
47
+ target: "main" | "isolated";
48
+ delivery: {
49
+ mode: "silent" | "deliver";
50
+ channel?: string;
51
+ to?: string;
52
+ };
53
+ delete_after_run: boolean;
54
+ model?: string | null;
55
+ state: {
56
+ next_run_at: string | null;
57
+ last_run_at: string | null;
58
+ last_status: "ok" | "error" | "skipped" | null;
59
+ last_error: string | null;
60
+ running: boolean;
61
+ };
62
+ delivery_preview?: {
63
+ label?: string;
64
+ detail?: string;
65
+ will_fail?: boolean;
66
+ } | null;
67
+ }
68
+ /** App-created work is isolated and silent. Agent selection is the server ID. */
69
+ interface CreateScheduleInput {
70
+ name: string;
71
+ trigger: ScheduleTrigger;
72
+ text: string;
73
+ delete_after_run?: boolean;
74
+ }
75
+ type SchedulePatch = Partial<CreateScheduleInput> & {
76
+ enabled?: boolean;
77
+ };
78
+ interface ScheduleRun {
79
+ id: string;
80
+ ts: string;
81
+ status: "ok" | "error" | "skipped" | "running" | null;
82
+ error?: string;
83
+ summary?: string;
84
+ duration_ms?: number;
85
+ session_id?: string;
86
+ }
87
+ interface MutationOptions {
88
+ /** Persist this with the work item; reuse it after a timeout. Never auto-rotate it. */
89
+ idempotencyKey: string;
90
+ }
91
+
92
+ interface AgentsEnv {
93
+ CLAWNIFY_TOKEN?: string;
94
+ CLAWNIFY_ORG_ID?: string;
95
+ /** API origin, not the /v1/agents path. Only HTTPS (or local HTTP) is accepted. */
96
+ CLAWNIFY_API_URL?: string;
97
+ }
98
+ declare class ClawnifyAgentsError extends Error {
99
+ readonly code: string;
100
+ readonly status?: number | undefined;
101
+ readonly outcomeUnknown: boolean;
102
+ readonly retryAfterSeconds?: number | undefined;
103
+ constructor(message: string, code: string, status?: number | undefined, outcomeUnknown?: boolean, retryAfterSeconds?: number | undefined);
104
+ }
105
+ /** Server-side only: never put an org service token in browser code. No automatic retries. */
106
+ declare function createAgents(env: AgentsEnv): {
107
+ list: (options?: PageOptions) => Promise<{
108
+ servers: AgentServer[];
109
+ page: Page;
110
+ }>;
111
+ dispatch: (input: DispatchInput) => Promise<DispatchResult>;
112
+ schedules: {
113
+ list: (serverId: string, options?: PageOptions) => Promise<{
114
+ schedules: Schedule[];
115
+ page: Page;
116
+ }>;
117
+ get: (serverId: string, id: string) => Promise<{
118
+ schedule: Schedule;
119
+ }>;
120
+ create: (serverId: string, input: CreateScheduleInput, options: MutationOptions) => Promise<{
121
+ schedule: Schedule;
122
+ replayed: boolean;
123
+ }>;
124
+ update: (serverId: string, id: string, patch: SchedulePatch) => Promise<{
125
+ schedule: Schedule;
126
+ }>;
127
+ pause: (serverId: string, id: string) => Promise<{
128
+ schedule: Schedule;
129
+ }>;
130
+ resume: (serverId: string, id: string) => Promise<{
131
+ schedule: Schedule;
132
+ }>;
133
+ delete: (serverId: string, id: string) => Promise<void>;
134
+ run: (serverId: string, id: string, options: MutationOptions) => Promise<{
135
+ accepted: true;
136
+ replayed: boolean;
137
+ }>;
138
+ runs: (serverId: string, id: string, options?: {
139
+ limit?: number;
140
+ }) => Promise<{
141
+ runs: ScheduleRun[];
142
+ }>;
143
+ };
144
+ };
145
+
146
+ export { type AgentServer, type AgentsEnv, ClawnifyAgentsError, type CreateScheduleInput, type DispatchInput, type DispatchResult, type MutationOptions, type Page, type PageOptions, type Schedule, type SchedulePatch, type ScheduleRun, type ScheduleTrigger, createAgents };
package/dist/index.js ADDED
@@ -0,0 +1,104 @@
1
+ // src/index.ts
2
+ var ClawnifyAgentsError = class extends Error {
3
+ constructor(message, code, status, outcomeUnknown = false, retryAfterSeconds) {
4
+ super(message);
5
+ this.code = code;
6
+ this.status = status;
7
+ this.outcomeUnknown = outcomeUnknown;
8
+ this.retryAfterSeconds = retryAfterSeconds;
9
+ this.name = "ClawnifyAgentsError";
10
+ }
11
+ };
12
+ function segment(value) {
13
+ if (!/^[a-zA-Z0-9_-]{1,200}$/.test(value)) {
14
+ throw new ClawnifyAgentsError("Invalid agent or schedule ID", "invalid_id");
15
+ }
16
+ return encodeURIComponent(value);
17
+ }
18
+ function pageQuery(options = {}) {
19
+ const limit = options.limit ?? 25;
20
+ const offset = options.offset ?? 0;
21
+ if (!Number.isInteger(limit) || limit < 1 || limit > 100 || !Number.isSafeInteger(offset) || offset < 0 || offset > 1e6) {
22
+ throw new ClawnifyAgentsError("limit must be 1\u2013100 and offset a nonnegative integer", "invalid_page");
23
+ }
24
+ return new URLSearchParams({ limit: String(limit), offset: String(offset) }).toString();
25
+ }
26
+ function mutationHeaders(options) {
27
+ if (!options?.idempotencyKey || !/^[\x21-\x7e]{1,200}$/.test(options.idempotencyKey)) {
28
+ throw new ClawnifyAgentsError("A stable Idempotency-Key (1\u2013200 printable ASCII characters) is required", "invalid_idempotency_key");
29
+ }
30
+ return { "Idempotency-Key": options.idempotencyKey };
31
+ }
32
+ function createAgents(env) {
33
+ async function request(path, method = "GET", body, headers) {
34
+ if (!env.CLAWNIFY_TOKEN) throw new ClawnifyAgentsError("CLAWNIFY_TOKEN is not configured", "not_configured");
35
+ let base;
36
+ try {
37
+ base = new URL(env.CLAWNIFY_API_URL ?? "https://provision.clawnify.com");
38
+ } catch {
39
+ throw new ClawnifyAgentsError("CLAWNIFY_API_URL must be an HTTPS origin", "invalid_base_url");
40
+ }
41
+ if (base.username || base.password || base.search || base.hash || base.pathname !== "/" || base.protocol !== "https:" && !(base.protocol === "http:" && ["localhost", "127.0.0.1", "[::1]"].includes(base.hostname))) {
42
+ throw new ClawnifyAgentsError("CLAWNIFY_API_URL must be an HTTPS origin (local HTTP is allowed)", "invalid_base_url");
43
+ }
44
+ const serialized = body === void 0 ? void 0 : JSON.stringify(body);
45
+ let response;
46
+ try {
47
+ response = await fetch(`${base.origin}/v1/agents${path}`, {
48
+ method,
49
+ body: serialized,
50
+ redirect: "error",
51
+ signal: AbortSignal.timeout(3e4),
52
+ headers: {
53
+ Authorization: `Bearer ${env.CLAWNIFY_TOKEN}`,
54
+ "Content-Type": "application/json",
55
+ ...env.CLAWNIFY_ORG_ID ? { "x-org-id": env.CLAWNIFY_ORG_ID } : {},
56
+ ...headers
57
+ }
58
+ });
59
+ } catch {
60
+ throw new ClawnifyAgentsError("Unable to reach the agents API", "network_error", void 0, method !== "GET");
61
+ }
62
+ if (response.status === 204 && method === "DELETE") return void 0;
63
+ let data;
64
+ try {
65
+ data = await response.json();
66
+ if (!data || typeof data !== "object" || Array.isArray(data)) throw new Error("not an object");
67
+ } catch {
68
+ throw new ClawnifyAgentsError("The agents API returned an invalid response", "invalid_response", response.status, method !== "GET");
69
+ }
70
+ if (!response.ok) {
71
+ const seconds = Number(response.headers.get("retry-after"));
72
+ throw new ClawnifyAgentsError(
73
+ typeof data.detail === "string" ? data.detail : typeof data.error === "string" ? data.error : `Agents API HTTP ${response.status}`,
74
+ typeof data.error === "string" ? data.error : "api_error",
75
+ response.status,
76
+ typeof data.outcome_unknown === "boolean" ? data.outcome_unknown : method !== "GET" && response.status >= 500,
77
+ response.headers.has("retry-after") && Number.isFinite(seconds) ? seconds : void 0
78
+ );
79
+ }
80
+ return data;
81
+ }
82
+ const schedulesPath = (serverId) => `/servers/${segment(serverId)}/schedules`;
83
+ const schedulePath = (serverId, id) => `${schedulesPath(serverId)}/${segment(id)}`;
84
+ return {
85
+ list: (options) => request(`/servers?${pageQuery(options)}`),
86
+ dispatch: (input) => request("/tasks", "POST", input),
87
+ schedules: {
88
+ list: (serverId, options) => request(`${schedulesPath(serverId)}?${pageQuery(options)}`),
89
+ get: (serverId, id) => request(schedulePath(serverId, id)),
90
+ create: (serverId, input, options) => request(schedulesPath(serverId), "POST", input, mutationHeaders(options)),
91
+ update: (serverId, id, patch) => request(schedulePath(serverId, id), "PATCH", patch),
92
+ pause: (serverId, id) => request(schedulePath(serverId, id), "PATCH", { enabled: false }),
93
+ resume: (serverId, id) => request(schedulePath(serverId, id), "PATCH", { enabled: true }),
94
+ delete: (serverId, id) => request(schedulePath(serverId, id), "DELETE"),
95
+ run: (serverId, id, options) => request(`${schedulePath(serverId, id)}/run`, "POST", {}, mutationHeaders(options)),
96
+ runs: (serverId, id, options = {}) => request(`${schedulePath(serverId, id)}/runs?${pageQuery(options)}`)
97
+ }
98
+ };
99
+ }
100
+ export {
101
+ ClawnifyAgentsError,
102
+ createAgents
103
+ };
104
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { AgentServer, CreateScheduleInput, DispatchInput, DispatchResult, MutationOptions, Page, PageOptions, Schedule, SchedulePatch, ScheduleRun } from \"./types\";\nexport type * from \"./types\";\n\nexport interface AgentsEnv {\n CLAWNIFY_TOKEN?: string;\n CLAWNIFY_ORG_ID?: string;\n /** API origin, not the /v1/agents path. Only HTTPS (or local HTTP) is accepted. */\n CLAWNIFY_API_URL?: string;\n}\n\nexport class ClawnifyAgentsError extends Error {\n constructor(\n message: string,\n readonly code: string,\n readonly status?: number,\n readonly outcomeUnknown = false,\n readonly retryAfterSeconds?: number,\n ) {\n super(message);\n this.name = \"ClawnifyAgentsError\";\n }\n}\n\nfunction segment(value: string): string {\n if (!/^[a-zA-Z0-9_-]{1,200}$/.test(value)) {\n throw new ClawnifyAgentsError(\"Invalid agent or schedule ID\", \"invalid_id\");\n }\n return encodeURIComponent(value);\n}\n\nfunction pageQuery(options: PageOptions = {}): string {\n const limit = options.limit ?? 25;\n const offset = options.offset ?? 0;\n if (!Number.isInteger(limit) || limit < 1 || limit > 100 || !Number.isSafeInteger(offset) || offset < 0 || offset > 1_000_000) {\n throw new ClawnifyAgentsError(\"limit must be 1–100 and offset a nonnegative integer\", \"invalid_page\");\n }\n return new URLSearchParams({ limit: String(limit), offset: String(offset) }).toString();\n}\n\nfunction mutationHeaders(options: MutationOptions): Record<string, string> {\n if (!options?.idempotencyKey || !/^[\\x21-\\x7e]{1,200}$/.test(options.idempotencyKey)) {\n throw new ClawnifyAgentsError(\"A stable Idempotency-Key (1–200 printable ASCII characters) is required\", \"invalid_idempotency_key\");\n }\n return { \"Idempotency-Key\": options.idempotencyKey };\n}\n\n/** Server-side only: never put an org service token in browser code. No automatic retries. */\nexport function createAgents(env: AgentsEnv) {\n async function request<T>(path: string, method = \"GET\", body?: unknown, headers?: Record<string, string>): Promise<T> {\n if (!env.CLAWNIFY_TOKEN) throw new ClawnifyAgentsError(\"CLAWNIFY_TOKEN is not configured\", \"not_configured\");\n let base: URL;\n try { base = new URL(env.CLAWNIFY_API_URL ?? \"https://provision.clawnify.com\"); }\n catch { throw new ClawnifyAgentsError(\"CLAWNIFY_API_URL must be an HTTPS origin\", \"invalid_base_url\"); }\n if (base.username || base.password || base.search || base.hash || base.pathname !== \"/\" ||\n (base.protocol !== \"https:\" && !(base.protocol === \"http:\" && [\"localhost\", \"127.0.0.1\", \"[::1]\"].includes(base.hostname)))) {\n throw new ClawnifyAgentsError(\"CLAWNIFY_API_URL must be an HTTPS origin (local HTTP is allowed)\", \"invalid_base_url\");\n }\n // Serialize before issuing the request: local input errors cannot have executed remotely.\n const serialized = body === undefined ? undefined : JSON.stringify(body);\n let response: Response;\n try {\n response = await fetch(`${base.origin}/v1/agents${path}`, {\n method, body: serialized, redirect: \"error\", signal: AbortSignal.timeout(30_000),\n headers: {\n Authorization: `Bearer ${env.CLAWNIFY_TOKEN}`, \"Content-Type\": \"application/json\",\n ...(env.CLAWNIFY_ORG_ID ? { \"x-org-id\": env.CLAWNIFY_ORG_ID } : {}), ...headers,\n },\n });\n } catch {\n throw new ClawnifyAgentsError(\"Unable to reach the agents API\", \"network_error\", undefined, method !== \"GET\");\n }\n if (response.status === 204 && method === \"DELETE\") return undefined as T;\n let data: Record<string, unknown>;\n try {\n data = await response.json() as Record<string, unknown>;\n if (!data || typeof data !== \"object\" || Array.isArray(data)) throw new Error(\"not an object\");\n } catch {\n throw new ClawnifyAgentsError(\"The agents API returned an invalid response\", \"invalid_response\", response.status, method !== \"GET\");\n }\n if (!response.ok) {\n const seconds = Number(response.headers.get(\"retry-after\"));\n throw new ClawnifyAgentsError(\n typeof data.detail === \"string\" ? data.detail : typeof data.error === \"string\" ? data.error : `Agents API HTTP ${response.status}`,\n typeof data.error === \"string\" ? data.error : \"api_error\", response.status,\n typeof data.outcome_unknown === \"boolean\" ? data.outcome_unknown : method !== \"GET\" && response.status >= 500,\n response.headers.has(\"retry-after\") && Number.isFinite(seconds) ? seconds : undefined,\n );\n }\n return data as T;\n }\n\n const schedulesPath = (serverId: string) => `/servers/${segment(serverId)}/schedules`;\n const schedulePath = (serverId: string, id: string) => `${schedulesPath(serverId)}/${segment(id)}`;\n return {\n list: (options?: PageOptions) => request<{ servers: AgentServer[]; page: Page }>(`/servers?${pageQuery(options)}`),\n dispatch: (input: DispatchInput) => request<DispatchResult>(\"/tasks\", \"POST\", input),\n schedules: {\n list: (serverId: string, options?: PageOptions) => request<{ schedules: Schedule[]; page: Page }>(`${schedulesPath(serverId)}?${pageQuery(options)}`),\n get: (serverId: string, id: string) => request<{ schedule: Schedule }>(schedulePath(serverId, id)),\n create: (serverId: string, input: CreateScheduleInput, options: MutationOptions) =>\n request<{ schedule: Schedule; replayed: boolean }>(schedulesPath(serverId), \"POST\", input, mutationHeaders(options)),\n update: (serverId: string, id: string, patch: SchedulePatch) => request<{ schedule: Schedule }>(schedulePath(serverId, id), \"PATCH\", patch),\n pause: (serverId: string, id: string) => request<{ schedule: Schedule }>(schedulePath(serverId, id), \"PATCH\", { enabled: false }),\n resume: (serverId: string, id: string) => request<{ schedule: Schedule }>(schedulePath(serverId, id), \"PATCH\", { enabled: true }),\n delete: (serverId: string, id: string) => request<void>(schedulePath(serverId, id), \"DELETE\"),\n run: (serverId: string, id: string, options: MutationOptions) =>\n request<{ accepted: true; replayed: boolean }>(`${schedulePath(serverId, id)}/run`, \"POST\", {}, mutationHeaders(options)),\n runs: (serverId: string, id: string, options: { limit?: number } = {}) =>\n request<{ runs: ScheduleRun[] }>(`${schedulePath(serverId, id)}/runs?${pageQuery(options)}`),\n },\n };\n}\n"],"mappings":";AAUO,IAAM,sBAAN,cAAkC,MAAM;AAAA,EAC7C,YACE,SACS,MACA,QACA,iBAAiB,OACjB,mBACT;AACA,UAAM,OAAO;AALJ;AACA;AACA;AACA;AAGT,SAAK,OAAO;AAAA,EACd;AACF;AAEA,SAAS,QAAQ,OAAuB;AACtC,MAAI,CAAC,yBAAyB,KAAK,KAAK,GAAG;AACzC,UAAM,IAAI,oBAAoB,gCAAgC,YAAY;AAAA,EAC5E;AACA,SAAO,mBAAmB,KAAK;AACjC;AAEA,SAAS,UAAU,UAAuB,CAAC,GAAW;AACpD,QAAM,QAAQ,QAAQ,SAAS;AAC/B,QAAM,SAAS,QAAQ,UAAU;AACjC,MAAI,CAAC,OAAO,UAAU,KAAK,KAAK,QAAQ,KAAK,QAAQ,OAAO,CAAC,OAAO,cAAc,MAAM,KAAK,SAAS,KAAK,SAAS,KAAW;AAC7H,UAAM,IAAI,oBAAoB,6DAAwD,cAAc;AAAA,EACtG;AACA,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c,QAAQ,CAAC,IAAI,UAAU,OAAO,CAAC,EAAE;AAAA,MACpJ,KAAK,CAAC,UAAkB,OAAe,QAAgC,aAAa,UAAU,EAAE,CAAC;AAAA,MACjG,QAAQ,CAAC,UAAkB,OAA4B,YACrD,QAAmD,cAAc,QAAQ,GAAG,QAAQ,OAAO,gBAAgB,OAAO,CAAC;AAAA,MACrH,QAAQ,CAAC,UAAkB,IAAY,UAAyB,QAAgC,aAAa,UAAU,EAAE,GAAG,SAAS,KAAK;AAAA,MAC1I,OAAO,CAAC,UAAkB,OAAe,QAAgC,aAAa,UAAU,EAAE,GAAG,SAAS,EAAE,SAAS,MAAM,CAAC;AAAA,MAChI,QAAQ,CAAC,UAAkB,OAAe,QAAgC,aAAa,UAAU,EAAE,GAAG,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,MAChI,QAAQ,CAAC,UAAkB,OAAe,QAAc,aAAa,UAAU,EAAE,GAAG,QAAQ;AAAA,MAC5F,KAAK,CAAC,UAAkB,IAAY,YAClC,QAA+C,GAAG,aAAa,UAAU,EAAE,CAAC,QAAQ,QAAQ,CAAC,GAAG,gBAAgB,OAAO,CAAC;AAAA,MAC1H,MAAM,CAAC,UAAkB,IAAY,UAA8B,CAAC,MAClE,QAAiC,GAAG,aAAa,UAAU,EAAE,CAAC,SAAS,UAAU,OAAO,CAAC,EAAE;AAAA,IAC/F;AAAA,EACF;AACF;","names":[]}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@clawnify/agents",
3
+ "version": "0.1.0",
4
+ "description": "Typed server-side client for the Clawnify agents API.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "devDependencies": {
21
+ "tsup": "^8.0.0",
22
+ "typescript": "^5.7.0",
23
+ "vitest": "^4.1.10"
24
+ },
25
+ "scripts": {
26
+ "build": "tsup",
27
+ "test": "vitest run",
28
+ "typecheck": "tsc --noEmit"
29
+ }
30
+ }