@madewithremy/admin 0.1.10 → 0.1.12

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/prod.js CHANGED
@@ -3306,7 +3306,8 @@ function approve(ctx, params) {
3306
3306
  return call(
3307
3307
  ctx,
3308
3308
  "POST",
3309
- `${base2(ctx.appId)}/${encodeURIComponent(params.id)}/approve`
3309
+ `${base2(ctx.appId)}/${encodeURIComponent(params.id)}/approve`,
3310
+ params.concurrency !== void 0 ? { concurrency: params.concurrency } : void 0
3310
3311
  );
3311
3312
  }
3312
3313
  function pause(ctx, params) {
@@ -3320,7 +3321,8 @@ function resume(ctx, params) {
3320
3321
  return call(
3321
3322
  ctx,
3322
3323
  "POST",
3323
- `${base2(ctx.appId)}/${encodeURIComponent(params.id)}/resume`
3324
+ `${base2(ctx.appId)}/${encodeURIComponent(params.id)}/resume`,
3325
+ params.concurrency !== void 0 ? { concurrency: params.concurrency } : void 0
3324
3326
  );
3325
3327
  }
3326
3328
  function cancel(ctx, params) {
@@ -3337,7 +3339,7 @@ function waitForJob(ctx, params) {
3337
3339
  return settle(
3338
3340
  ctx,
3339
3341
  params,
3340
- (job) => !["planning", "planned", "running"].includes(job.state) || job.state === "planned" && (job.error !== null || !job.autoApprove)
3342
+ (job) => !["planning", "planned", "running", "paused"].includes(job.state) || job.state === "planned" && (job.error !== null || !job.autoApprove) || job.state === "paused" && !job.autoResumeAt
3341
3343
  );
3342
3344
  }
3343
3345
  async function settle(ctx, params, isSettled) {
@@ -3659,6 +3661,14 @@ function hydrate(ctx, params) {
3659
3661
  { slug: params.slug }
3660
3662
  );
3661
3663
  }
3664
+ function reindex(ctx, params) {
3665
+ return call(
3666
+ ctx,
3667
+ "POST",
3668
+ `${base4(ctx.appId)}/reindex`,
3669
+ { slug: params.slug }
3670
+ );
3671
+ }
3662
3672
  async function waitForHydration(ctx, params) {
3663
3673
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS3;
3664
3674
  const outcome = await pollUntil(
@@ -3869,6 +3879,14 @@ var dataSourceEvalsSpecs = {
3869
3879
  timeout: { type: "string" }
3870
3880
  }
3871
3881
  },
3882
+ "datasources reindex": {
3883
+ usage: "Usage: remy-admin datasources reindex [--source <slug>] [--wait] [--timeout <sec>]",
3884
+ flags: {
3885
+ source: { type: "string" },
3886
+ wait: { type: "boolean" },
3887
+ timeout: { type: "string" }
3888
+ }
3889
+ },
3872
3890
  "datasources sample": {
3873
3891
  usage: "Usage: remy-admin datasources sample --source <slug> --size <n> [--as <slug>] [--filter <k=v,...|json>] [--stratify <metadata-key>] [--placement <resource-id|shared>] [--wait] [--timeout <sec>]",
3874
3892
  flags: {
@@ -4046,6 +4064,25 @@ async function hydrate2(ctx, a) {
4046
4064
  out({ dataSource: slug, action: "hydrate", ...result });
4047
4065
  failOnWait(result);
4048
4066
  }
4067
+ async function reindex2(ctx, a) {
4068
+ const slug = a.str("source") || DEFAULT_SOURCE;
4069
+ const started = await reindex(ctx, { slug });
4070
+ if (!a.bool("wait")) {
4071
+ out({
4072
+ dataSource: slug,
4073
+ ...started,
4074
+ note: "The collection was recreated and is refilling from stored vectors in the background. `datasources list` shows progress; re-run with --wait to block."
4075
+ });
4076
+ return;
4077
+ }
4078
+ const result = await waitForHydration(ctx, {
4079
+ slug,
4080
+ ...timeoutOf(a),
4081
+ onProgress: progress
4082
+ });
4083
+ out({ dataSource: slug, action: "reindex", ...result });
4084
+ failOnWait(result);
4085
+ }
4049
4086
  async function sampleCmd(ctx, a) {
4050
4087
  const slug = a.str("source");
4051
4088
  if (!slug) {
@@ -4286,6 +4323,7 @@ async function evalCompare(ctx, a) {
4286
4323
  }
4287
4324
  var dataSourceEvalsHandlers = {
4288
4325
  "datasources hydrate": hydrate2,
4326
+ "datasources reindex": reindex2,
4289
4327
  "datasources sample": sampleCmd,
4290
4328
  "datasources eval create": evalCreate,
4291
4329
  "datasources eval list": evalList,
@@ -4402,18 +4440,26 @@ var dataSourceJobsSpecs = {
4402
4440
  flags: { wait: { type: "boolean" }, timeout: { type: "string" } }
4403
4441
  },
4404
4442
  "datasources jobs approve": {
4405
- usage: "Usage: remy-admin datasources jobs approve <id> [--wait] [--timeout <sec>]",
4443
+ usage: "Usage: remy-admin datasources jobs approve <id> [--concurrency <n>] [--wait] [--timeout <sec>]",
4406
4444
  positionals: [{ name: "id", required: true }],
4407
- flags: { wait: { type: "boolean" }, timeout: { type: "string" } }
4445
+ flags: {
4446
+ concurrency: { type: "number", min: 1 },
4447
+ wait: { type: "boolean" },
4448
+ timeout: { type: "string" }
4449
+ }
4408
4450
  },
4409
4451
  "datasources jobs pause": {
4410
4452
  usage: "Usage: remy-admin datasources jobs pause <id>",
4411
4453
  positionals: [{ name: "id", required: true }]
4412
4454
  },
4413
4455
  "datasources jobs resume": {
4414
- usage: "Usage: remy-admin datasources jobs resume <id> [--wait] [--timeout <sec>]",
4456
+ usage: "Usage: remy-admin datasources jobs resume <id> [--concurrency <n>] [--wait] [--timeout <sec>]",
4415
4457
  positionals: [{ name: "id", required: true }],
4416
- flags: { wait: { type: "boolean" }, timeout: { type: "string" } }
4458
+ flags: {
4459
+ concurrency: { type: "number", min: 1 },
4460
+ wait: { type: "boolean" },
4461
+ timeout: { type: "string" }
4462
+ }
4417
4463
  },
4418
4464
  "datasources jobs cancel": {
4419
4465
  usage: "Usage: remy-admin datasources jobs cancel <id>",
@@ -4490,7 +4536,11 @@ async function jobsStatus(ctx, a) {
4490
4536
  }
4491
4537
  async function jobsApprove(ctx, a) {
4492
4538
  const id = a.req("id");
4493
- const { job } = await approve(ctx, { id });
4539
+ const concurrency = a.num("concurrency");
4540
+ const { job } = await approve(ctx, {
4541
+ id,
4542
+ ...concurrency !== void 0 ? { concurrency } : {}
4543
+ });
4494
4544
  if (!a.bool("wait")) {
4495
4545
  out({
4496
4546
  job,
@@ -4505,7 +4555,11 @@ async function jobsPause(ctx, a) {
4505
4555
  }
4506
4556
  async function jobsResume(ctx, a) {
4507
4557
  const id = a.req("id");
4508
- const { job } = await resume(ctx, { id });
4558
+ const concurrency = a.num("concurrency");
4559
+ const { job } = await resume(ctx, {
4560
+ id,
4561
+ ...concurrency !== void 0 ? { concurrency } : {}
4562
+ });
4509
4563
  if (!a.bool("wait")) {
4510
4564
  out({ job });
4511
4565
  return;
@@ -4554,6 +4608,8 @@ Bulk ingestion (jobs):
4554
4608
  --concurrency <n> Batches in flight at once (default 64, max 128)
4555
4609
  --limit <n> Only the first N objects: a cheap sample of the corpus
4556
4610
  --wait Block until the plan is ready (or, with --approve, until done)
4611
+ On approve and resume:
4612
+ --concurrency <n> Batches in flight from here on (max 128); a plan made at 8 can run at 64
4557
4613
 
4558
4614
  While running, documents are read in batches of fifty with one embedding
4559
4615
  call per batch. Unchanged documents are skipped by content hash, so re-running
@@ -5500,6 +5556,7 @@ Subcommands:
5500
5556
  map deploy Make a build's compiled mapper the source's active one (a branch build will do)
5501
5557
  remap Re-apply the active mapper to every raw copy the source holds
5502
5558
  hydrate Reload an evicted index ahead of the first search
5559
+ reindex Recreate a dedicated source's collection with the current shape, refilled from stored vectors
5503
5560
  sample Draw a sample of a source into a new one with the same config
5504
5561
  eval Query sets and runs: measure recall, MRR and latency, compare versions
5505
5562
  revectorize Rebuild a corpus under new settings, alongside the live one
@@ -5518,7 +5575,7 @@ Usage:
5518
5575
  remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--wait] [--timeout <sec>]
5519
5576
  remy-admin datasources jobs start|list|status|approve|pause|resume|cancel \u2026 (see below)
5520
5577
  remy-admin datasources connect|sync|connector|disconnect \u2026 (see below)
5521
- remy-admin datasources hydrate|sample \u2026 (see below)
5578
+ remy-admin datasources hydrate|reindex|sample \u2026 (see below)
5522
5579
  remy-admin datasources eval create|list|get|add|import|queries|rm|delete|run|runs|result|compare \u2026 (see below)
5523
5580
  remy-admin datasources revectorize [--source <slug>] [settings...] [--wait]
5524
5581
  remy-admin datasources promote [--source <slug>] [--force]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madewithremy/admin",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",