@whittlelabs/sifter 0.5.1 → 0.7.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @whittlelabs/sifter
2
2
 
3
- The Whittle Sifter is a paired AI reviewer for [Whittle Sift](https://sift.stage.whittlelabs.com). It runs on your machine, executes review prompts against your own AI credentials (Claude Code, Anthropic API key, etc.), and submits the results back to Sift. Token spend stays on your account.
3
+ The Whittle Sifter is a paired AI reviewer for [Whittle Sift](https://sift.whittlelabs.com). It runs on your machine, executes review prompts against your own AI credentials (Claude Code, Anthropic API key, etc.), and submits the results back to Sift. Token spend stays on your account.
4
4
 
5
5
  ## Install
6
6
 
@@ -21,11 +21,11 @@ Visit Sift's **Settings → Pair a Sifter**. Sift will display a pairing code an
21
21
  whittle-sifter init --pairing-code=ABCD-1234
22
22
  ```
23
23
 
24
- The Sifter defaults to the stage Keep instance (`https://keep.stage.whittlelabs.com`). To pair against a different environment, pass `--keep-url`:
24
+ The Sifter defaults to production (`https://keep.whittlelabs.com`). To pair against stage, test, or any other environment, pass `--keep-url`:
25
25
 
26
26
  ```bash
27
27
  whittle-sifter init \
28
- --keep-url=https://keep.test.whittlelabs.com \
28
+ --keep-url=https://keep.stage.whittlelabs.com \
29
29
  --pairing-code=ABCD-1234
30
30
  ```
31
31
 
package/bin.js CHANGED
@@ -15340,7 +15340,8 @@ var require_client = __commonJS({
15340
15340
  if (filters?.name)
15341
15341
  params.set("name", filters.name);
15342
15342
  const qs = params.toString();
15343
- return this.request("GET", `/api/job-pools${qs ? `?${qs}` : ""}`);
15343
+ const { pools } = await this.request("GET", `/api/job-pools${qs ? `?${qs}` : ""}`);
15344
+ return pools;
15344
15345
  }
15345
15346
  async getJobPool(poolId) {
15346
15347
  return this.request("GET", `/api/job-pools/${poolId}`);
@@ -15362,7 +15363,8 @@ var require_client = __commonJS({
15362
15363
  // A subscriber joins a pool by registering as a member of it. These
15363
15364
  // map to the server's `/api/job-pools/:poolId/members` routes.
15364
15365
  async listMembers(poolId) {
15365
- return this.request("GET", `/api/job-pools/${poolId}/members`);
15366
+ const { members } = await this.request("GET", `/api/job-pools/${poolId}/members`);
15367
+ return members;
15366
15368
  }
15367
15369
  async registerMember(poolId, options) {
15368
15370
  return this.request("POST", `/api/job-pools/${poolId}/members`, options);
@@ -15401,7 +15403,15 @@ var require_client = __commonJS({
15401
15403
  }
15402
15404
  // ── Outputs ──────────────────────────────────────────────────────
15403
15405
  async listOutputs(jobId) {
15404
- return this.request("GET", `/api/jobs/${jobId}/output`);
15406
+ const all = [];
15407
+ const pageSize = 100;
15408
+ for (let offset = 0; ; offset += pageSize) {
15409
+ const { outputs, total } = await this.request("GET", `/api/jobs/${jobId}/output?limit=${pageSize}&offset=${offset}`);
15410
+ all.push(...outputs);
15411
+ if (outputs.length === 0 || all.length >= total)
15412
+ break;
15413
+ }
15414
+ return all;
15405
15415
  }
15406
15416
  async createOutput(jobId, options) {
15407
15417
  return this.request("POST", `/api/jobs/${jobId}/output`, options);
@@ -15436,7 +15446,11 @@ var require_client = __commonJS({
15436
15446
  if (options?.sort)
15437
15447
  params.set("sort", options.sort);
15438
15448
  const qs = params.toString();
15439
- return this.requestPaginated("GET", `/api/my/jobs${qs ? `?${qs}` : ""}`);
15449
+ const { jobs, total } = await this.request("GET", `/api/my/jobs${qs ? `?${qs}` : ""}`);
15450
+ return {
15451
+ data: jobs,
15452
+ pagination: { total, limit: options?.limit ?? 25, offset: options?.offset ?? 0 }
15453
+ };
15440
15454
  }
15441
15455
  // ── HTTP plumbing ────────────────────────────────────────────────
15442
15456
  async request(method, path, body) {
@@ -15452,19 +15466,6 @@ var require_client = __commonJS({
15452
15466
  }
15453
15467
  return json.data;
15454
15468
  }
15455
- async requestPaginated(method, path) {
15456
- const url = `${this.baseUrl}${path}`;
15457
- const response = await this.fetchWithAuthRetry(method, url);
15458
- const json = await response.json();
15459
- if (!response.ok || !json.success) {
15460
- const errorMessage = json.error?.message ?? `Request failed with status ${response.status}`;
15461
- const error = new Error(errorMessage);
15462
- error.code = json.error?.code;
15463
- error.statusCode = response.status;
15464
- throw error;
15465
- }
15466
- return { data: json.data, pagination: json.pagination };
15467
- }
15468
15469
  };
15469
15470
  exports2.JobsClient = JobsClient;
15470
15471
  }
@@ -18313,7 +18314,8 @@ var require_client2 = __commonJS({
18313
18314
  }
18314
18315
  // ── Organizations ───────────────────────────────────────────────
18315
18316
  async listOrganizations() {
18316
- return this.request("GET", "/api/organizations");
18317
+ const { organizations } = await this.request("GET", "/api/organizations");
18318
+ return organizations;
18317
18319
  }
18318
18320
  async getOrganization(orgId) {
18319
18321
  return this.request("GET", `/api/organizations/${orgId}`);
@@ -20715,7 +20717,7 @@ var import_shuttle = __toESM(require_dist5());
20715
20717
  // package.json
20716
20718
  var package_default = {
20717
20719
  name: "@whittlelabs/sifter",
20718
- version: "0.5.1",
20720
+ version: "0.7.0",
20719
20721
  description: "Whittle Sifter: paired AI reviewer for Whittle Sift job pools.",
20720
20722
  bin: {
20721
20723
  "whittle-sifter": "./dist/bin.js"
@@ -20775,8 +20777,8 @@ var sifterBrand = {
20775
20777
  },
20776
20778
  executorAllowlist: ["claude-code", "anthropic-api", "http-api", "webhook", "custom-script"],
20777
20779
  keepRegistration: {
20778
- keepApiUrl: process.env.KEEP_API_URL ?? "https://keep.stage.whittlelabs.com",
20779
- jobsApiUrl: process.env.JOBS_API_URL ?? "https://jobs.stage.whittlelabs.com",
20780
+ keepApiUrl: process.env.KEEP_API_URL ?? "https://keep.whittlelabs.com",
20781
+ jobsApiUrl: process.env.JOBS_API_URL ?? "https://jobs.whittlelabs.com",
20780
20782
  oauthClientId: process.env.SIFTER_OAUTH_CLIENT_ID ?? "sifter",
20781
20783
  orgSlug: "whittle-labs",
20782
20784
  roleSlug: "sift-sifter",