@madewithremy/admin 0.1.11 → 0.1.13

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
@@ -3268,13 +3268,14 @@ function base2(appId) {
3268
3268
  return `/_internal/v2/apps/${appId}/datasources/jobs`;
3269
3269
  }
3270
3270
  function start(ctx, params) {
3271
- const { slug, source, approve: approve2, budgetDollars, concurrency, limit } = params;
3271
+ const { slug, source, approve: approve2, budgetDollars, concurrency, priority, limit } = params;
3272
3272
  return call(ctx, "POST", base2(ctx.appId), {
3273
3273
  slug,
3274
3274
  source,
3275
3275
  ...approve2 ? { approve: true } : {},
3276
3276
  ...budgetDollars !== void 0 ? { budgetDollars } : {},
3277
3277
  ...concurrency !== void 0 ? { concurrency } : {},
3278
+ ...priority ? { priority: true } : {},
3278
3279
  ...limit !== void 0 ? { limit } : {}
3279
3280
  });
3280
3281
  }
@@ -3307,9 +3308,16 @@ function approve(ctx, params) {
3307
3308
  ctx,
3308
3309
  "POST",
3309
3310
  `${base2(ctx.appId)}/${encodeURIComponent(params.id)}/approve`,
3310
- params.concurrency !== void 0 ? { concurrency: params.concurrency } : void 0
3311
+ controlBody(params)
3311
3312
  );
3312
3313
  }
3314
+ function controlBody(params) {
3315
+ const body = {
3316
+ ...params.concurrency !== void 0 ? { concurrency: params.concurrency } : {},
3317
+ ...params.priority !== void 0 ? { priority: params.priority } : {}
3318
+ };
3319
+ return Object.keys(body).length > 0 ? body : void 0;
3320
+ }
3313
3321
  function pause(ctx, params) {
3314
3322
  return call(
3315
3323
  ctx,
@@ -3322,7 +3330,7 @@ function resume(ctx, params) {
3322
3330
  ctx,
3323
3331
  "POST",
3324
3332
  `${base2(ctx.appId)}/${encodeURIComponent(params.id)}/resume`,
3325
- params.concurrency !== void 0 ? { concurrency: params.concurrency } : void 0
3333
+ controlBody(params)
3326
3334
  );
3327
3335
  }
3328
3336
  function cancel(ctx, params) {
@@ -3339,7 +3347,7 @@ function waitForJob(ctx, params) {
3339
3347
  return settle(
3340
3348
  ctx,
3341
3349
  params,
3342
- (job) => !["planning", "planned", "running"].includes(job.state) || job.state === "planned" && (job.error !== null || !job.autoApprove)
3350
+ (job) => !["planning", "planned", "running", "paused"].includes(job.state) || job.state === "planned" && (job.error !== null || !job.autoApprove) || job.state === "paused" && !job.autoResumeAt
3343
3351
  );
3344
3352
  }
3345
3353
  async function settle(ctx, params, isSettled) {
@@ -3477,7 +3485,8 @@ function sync(ctx, params) {
3477
3485
  slug: params.slug,
3478
3486
  ...params.budgetDollars !== void 0 ? { budgetDollars: params.budgetDollars } : {},
3479
3487
  ...params.limit !== void 0 ? { limit: params.limit } : {},
3480
- ...params.concurrency !== void 0 ? { concurrency: params.concurrency } : {}
3488
+ ...params.concurrency !== void 0 ? { concurrency: params.concurrency } : {},
3489
+ ...params.priority ? { priority: true } : {}
3481
3490
  });
3482
3491
  }
3483
3492
 
@@ -3506,12 +3515,13 @@ var dataSourceConnectorsSpecs = {
3506
3515
  flags: { source: { type: "string" } }
3507
3516
  },
3508
3517
  "datasources sync": {
3509
- usage: "Usage: remy-admin datasources sync [--source <slug>] [--budget <dollars>] [--limit <n>] [--concurrency <n>] [--wait] [--timeout <sec>]",
3518
+ usage: "Usage: remy-admin datasources sync [--source <slug>] [--budget <dollars>] [--limit <n>] [--concurrency <n>] [--priority] [--wait] [--timeout <sec>]",
3510
3519
  flags: {
3511
3520
  source: { type: "string" },
3512
3521
  budget: { type: "number", min: 0.01 },
3513
3522
  limit: { type: "number", min: 1 },
3514
3523
  concurrency: { type: "number", min: 1 },
3524
+ priority: { type: "boolean" },
3515
3525
  wait: { type: "boolean" },
3516
3526
  timeout: { type: "string" }
3517
3527
  }
@@ -3587,7 +3597,8 @@ async function sync2(ctx, a) {
3587
3597
  slug,
3588
3598
  ...budget !== void 0 ? { budgetDollars: budget } : {},
3589
3599
  ...limit !== void 0 ? { limit } : {},
3590
- ...concurrency !== void 0 ? { concurrency } : {}
3600
+ ...concurrency !== void 0 ? { concurrency } : {},
3601
+ ...a.bool("priority") ? { priority: true } : {}
3591
3602
  });
3592
3603
  if (!a.bool("wait")) {
3593
3604
  out({
@@ -3612,7 +3623,7 @@ var dataSourceConnectorsHelp = `
3612
3623
  Following an S3 bucket (connectors):
3613
3624
  remy-admin datasources connect --source <slug> --bucket <name> --region <aws-region> [--prefix <p>] --access-key-secret <NAME> --secret-key-secret <NAME> [--deletions mirror|keep] [--budget-per-sync <dollars>]
3614
3625
  remy-admin datasources connector [--source <slug>]
3615
- remy-admin datasources sync [--source <slug>] [--budget <dollars>] [--limit <n>] [--concurrency <n>] [--wait] [--timeout <sec>]
3626
+ remy-admin datasources sync [--source <slug>] [--budget <dollars>] [--limit <n>] [--concurrency <n>] [--priority] [--wait] [--timeout <sec>]
3616
3627
  remy-admin datasources disconnect --source <slug>
3617
3628
 
3618
3629
  A connector makes a bucket the customer owns the origin of a source. The
@@ -3661,6 +3672,14 @@ function hydrate(ctx, params) {
3661
3672
  { slug: params.slug }
3662
3673
  );
3663
3674
  }
3675
+ function reindex(ctx, params) {
3676
+ return call(
3677
+ ctx,
3678
+ "POST",
3679
+ `${base4(ctx.appId)}/reindex`,
3680
+ { slug: params.slug }
3681
+ );
3682
+ }
3664
3683
  async function waitForHydration(ctx, params) {
3665
3684
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS3;
3666
3685
  const outcome = await pollUntil(
@@ -3871,6 +3890,14 @@ var dataSourceEvalsSpecs = {
3871
3890
  timeout: { type: "string" }
3872
3891
  }
3873
3892
  },
3893
+ "datasources reindex": {
3894
+ usage: "Usage: remy-admin datasources reindex [--source <slug>] [--wait] [--timeout <sec>]",
3895
+ flags: {
3896
+ source: { type: "string" },
3897
+ wait: { type: "boolean" },
3898
+ timeout: { type: "string" }
3899
+ }
3900
+ },
3874
3901
  "datasources sample": {
3875
3902
  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>]",
3876
3903
  flags: {
@@ -4048,6 +4075,25 @@ async function hydrate2(ctx, a) {
4048
4075
  out({ dataSource: slug, action: "hydrate", ...result });
4049
4076
  failOnWait(result);
4050
4077
  }
4078
+ async function reindex2(ctx, a) {
4079
+ const slug = a.str("source") || DEFAULT_SOURCE;
4080
+ const started = await reindex(ctx, { slug });
4081
+ if (!a.bool("wait")) {
4082
+ out({
4083
+ dataSource: slug,
4084
+ ...started,
4085
+ note: "The collection was recreated and is refilling from stored vectors in the background. `datasources list` shows progress; re-run with --wait to block."
4086
+ });
4087
+ return;
4088
+ }
4089
+ const result = await waitForHydration(ctx, {
4090
+ slug,
4091
+ ...timeoutOf(a),
4092
+ onProgress: progress
4093
+ });
4094
+ out({ dataSource: slug, action: "reindex", ...result });
4095
+ failOnWait(result);
4096
+ }
4051
4097
  async function sampleCmd(ctx, a) {
4052
4098
  const slug = a.str("source");
4053
4099
  if (!slug) {
@@ -4288,6 +4334,7 @@ async function evalCompare(ctx, a) {
4288
4334
  }
4289
4335
  var dataSourceEvalsHandlers = {
4290
4336
  "datasources hydrate": hydrate2,
4337
+ "datasources reindex": reindex2,
4291
4338
  "datasources sample": sampleCmd,
4292
4339
  "datasources eval create": evalCreate,
4293
4340
  "datasources eval list": evalList,
@@ -4375,7 +4422,7 @@ import fs4 from "fs";
4375
4422
  import path4 from "path";
4376
4423
  var dataSourceJobsSpecs = {
4377
4424
  "datasources jobs start": {
4378
- usage: "Usage: remy-admin datasources jobs start [--source <slug>] (--store <name> [--access <private|public>] [--prefix <p>] | --manifest <file.jsonl>) [--limit <n>] [--budget <dollars>] [--concurrency <n>] [--approve] [--wait] [--timeout <sec>]",
4425
+ usage: "Usage: remy-admin datasources jobs start [--source <slug>] (--store <name> [--access <private|public>] [--prefix <p>] | --manifest <file.jsonl>) [--limit <n>] [--budget <dollars>] [--concurrency <n>] [--priority] [--approve] [--wait] [--timeout <sec>]",
4379
4426
  flags: {
4380
4427
  source: { type: "string" },
4381
4428
  store: { type: "string" },
@@ -4385,6 +4432,7 @@ var dataSourceJobsSpecs = {
4385
4432
  limit: { type: "number", min: 1 },
4386
4433
  budget: { type: "number", min: 0.01 },
4387
4434
  concurrency: { type: "number", min: 1 },
4435
+ priority: { type: "boolean" },
4388
4436
  approve: { type: "boolean" },
4389
4437
  wait: { type: "boolean" },
4390
4438
  timeout: { type: "string" }
@@ -4404,10 +4452,11 @@ var dataSourceJobsSpecs = {
4404
4452
  flags: { wait: { type: "boolean" }, timeout: { type: "string" } }
4405
4453
  },
4406
4454
  "datasources jobs approve": {
4407
- usage: "Usage: remy-admin datasources jobs approve <id> [--concurrency <n>] [--wait] [--timeout <sec>]",
4455
+ usage: "Usage: remy-admin datasources jobs approve <id> [--concurrency <n>] [--priority] [--wait] [--timeout <sec>]",
4408
4456
  positionals: [{ name: "id", required: true }],
4409
4457
  flags: {
4410
4458
  concurrency: { type: "number", min: 1 },
4459
+ priority: { type: "boolean" },
4411
4460
  wait: { type: "boolean" },
4412
4461
  timeout: { type: "string" }
4413
4462
  }
@@ -4417,10 +4466,11 @@ var dataSourceJobsSpecs = {
4417
4466
  positionals: [{ name: "id", required: true }]
4418
4467
  },
4419
4468
  "datasources jobs resume": {
4420
- usage: "Usage: remy-admin datasources jobs resume <id> [--concurrency <n>] [--wait] [--timeout <sec>]",
4469
+ usage: "Usage: remy-admin datasources jobs resume <id> [--concurrency <n>] [--priority] [--wait] [--timeout <sec>]",
4421
4470
  positionals: [{ name: "id", required: true }],
4422
4471
  flags: {
4423
4472
  concurrency: { type: "number", min: 1 },
4473
+ priority: { type: "boolean" },
4424
4474
  wait: { type: "boolean" },
4425
4475
  timeout: { type: "string" }
4426
4476
  }
@@ -4470,6 +4520,7 @@ async function jobsStart(ctx, a) {
4470
4520
  ...a.bool("approve") ? { approve: true } : {},
4471
4521
  ...budget !== void 0 ? { budgetDollars: budget } : {},
4472
4522
  ...concurrency !== void 0 ? { concurrency } : {},
4523
+ ...a.bool("priority") ? { priority: true } : {},
4473
4524
  ...limit !== void 0 ? { limit } : {}
4474
4525
  });
4475
4526
  if (!a.bool("wait")) {
@@ -4503,7 +4554,8 @@ async function jobsApprove(ctx, a) {
4503
4554
  const concurrency = a.num("concurrency");
4504
4555
  const { job } = await approve(ctx, {
4505
4556
  id,
4506
- ...concurrency !== void 0 ? { concurrency } : {}
4557
+ ...concurrency !== void 0 ? { concurrency } : {},
4558
+ ...a.bool("priority") ? { priority: true } : {}
4507
4559
  });
4508
4560
  if (!a.bool("wait")) {
4509
4561
  out({
@@ -4522,7 +4574,8 @@ async function jobsResume(ctx, a) {
4522
4574
  const concurrency = a.num("concurrency");
4523
4575
  const { job } = await resume(ctx, {
4524
4576
  id,
4525
- ...concurrency !== void 0 ? { concurrency } : {}
4577
+ ...concurrency !== void 0 ? { concurrency } : {},
4578
+ ...a.bool("priority") ? { priority: true } : {}
4526
4579
  });
4527
4580
  if (!a.bool("wait")) {
4528
4581
  out({ job });
@@ -4570,10 +4623,14 @@ Bulk ingestion (jobs):
4570
4623
  --approve Run as soon as the plan passes the gates, no separate approve
4571
4624
  --budget <dollars> Pause when estimated spend reaches this (default 1.5x the plan)
4572
4625
  --concurrency <n> Batches in flight at once (default 64, max 128)
4626
+ --priority Embed at the provider's priority tier: calls skip the
4627
+ provider's queue at 1.5x the embedding price. For the
4628
+ load where the clock matters more than the price.
4573
4629
  --limit <n> Only the first N objects: a cheap sample of the corpus
4574
4630
  --wait Block until the plan is ready (or, with --approve, until done)
4575
4631
  On approve and resume:
4576
4632
  --concurrency <n> Batches in flight from here on (max 128); a plan made at 8 can run at 64
4633
+ --priority Priority-tier embedding from here on (1.5x); pause and resume to change it
4577
4634
 
4578
4635
  While running, documents are read in batches of fifty with one embedding
4579
4636
  call per batch. Unchanged documents are skipped by content hash, so re-running
@@ -5520,6 +5577,7 @@ Subcommands:
5520
5577
  map deploy Make a build's compiled mapper the source's active one (a branch build will do)
5521
5578
  remap Re-apply the active mapper to every raw copy the source holds
5522
5579
  hydrate Reload an evicted index ahead of the first search
5580
+ reindex Recreate a dedicated source's collection with the current shape, refilled from stored vectors
5523
5581
  sample Draw a sample of a source into a new one with the same config
5524
5582
  eval Query sets and runs: measure recall, MRR and latency, compare versions
5525
5583
  revectorize Rebuild a corpus under new settings, alongside the live one
@@ -5538,7 +5596,7 @@ Usage:
5538
5596
  remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--wait] [--timeout <sec>]
5539
5597
  remy-admin datasources jobs start|list|status|approve|pause|resume|cancel \u2026 (see below)
5540
5598
  remy-admin datasources connect|sync|connector|disconnect \u2026 (see below)
5541
- remy-admin datasources hydrate|sample \u2026 (see below)
5599
+ remy-admin datasources hydrate|reindex|sample \u2026 (see below)
5542
5600
  remy-admin datasources eval create|list|get|add|import|queries|rm|delete|run|runs|result|compare \u2026 (see below)
5543
5601
  remy-admin datasources revectorize [--source <slug>] [settings...] [--wait]
5544
5602
  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.11",
3
+ "version": "0.1.13",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",