@pxlabz/tasq-sdk 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Paul Cedrick Artigo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @pxlabz/tasq-sdk
2
+
3
+ Typed client for the [Tasq](https://github.com/pxlabz/tasq) API. Works for humans (user tokens) and for agents (agent API keys) with the same calls.
4
+
5
+ ```sh
6
+ npm install @pxlabz/tasq-sdk
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ ```ts
12
+ import { TasqClient } from "@pxlabz/tasq-sdk";
13
+
14
+ const tasq = new TasqClient({
15
+ baseUrl: "https://tasq.pxlabz.com",
16
+ auth: { agentKey: process.env.TASQ_API_KEY! }, // or { userToken: "tq_us_…" }
17
+ });
18
+
19
+ const tasks = await tasq.tasks.list("my-workspace", { status: "in-progress" });
20
+
21
+ const result = await tasq.dispatch("task.create", "my-workspace", {
22
+ teamIdentifier: "ENG",
23
+ title: "Investigate flaky login test",
24
+ });
25
+ ```
26
+
27
+ Reads live under `tasq.workspaces`, `tasq.tasks`, `tasq.projects`, `tasq.cycles`, `tasq.teams`, `tasq.labels`, `tasq.agents`, and `tasq.auth`. Every write goes through `tasq.dispatch(action, workspace, input)`; the action names and their inputs are typed, so an editor autocompletes both.
28
+
29
+ ## Errors
30
+
31
+ Failures throw a `TasqApiError` subclass you can narrow on:
32
+
33
+ - `TasqValidationError` — the input failed validation (400).
34
+ - `TasqPolicyDeniedError` — the agent's policy does not allow that action (403). The refusal is also logged in the workspace's agent activity.
35
+ - `TasqRateLimitError` — the key exhausted its read or write budget (429); `retryAfterSeconds` says when to try again.
36
+
37
+ An anonymous client (no `auth`) can only call `auth.requestMagicLink` and `auth.verifyCliCode`; everything else throws `NO_CREDENTIAL` before touching the network.
38
+
39
+ ## Runtime
40
+
41
+ ESM, Node 20 or newer, no runtime dependencies. Types are bundled.