@madewithremy/admin 0.1.18 → 0.1.20

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
@@ -420,11 +420,11 @@ function describeEta(eta, now = Date.now()) {
420
420
  return `about ${hours} h left`;
421
421
  }
422
422
  function renderProgress(p, start2, extra) {
423
- const count = p.total !== null ? `${p.done.toLocaleString()}/${p.total.toLocaleString()} ${p.unit}` : p.done > 0 ? `${p.done.toLocaleString()} ${p.unit}` : null;
423
+ const count2 = p.total !== null ? `${p.done.toLocaleString()}/${p.total.toLocaleString()} ${p.unit}` : p.done > 0 ? `${p.done.toLocaleString()} ${p.unit}` : null;
424
424
  const rate = p.ratePerMinute !== null && p.ratePerMinute > 0 ? `${Math.round(p.ratePerMinute).toLocaleString()}/min` : null;
425
425
  const parts = [
426
426
  `${p.phase}\u2026`,
427
- count,
427
+ count2,
428
428
  rate,
429
429
  describeEta(p.etaAt),
430
430
  extra ?? null,
@@ -3169,6 +3169,14 @@ function search(ctx, params) {
3169
3169
  }
3170
3170
  );
3171
3171
  }
3172
+ function count(ctx, params) {
3173
+ const { slug, filter, candidate } = params;
3174
+ return call(ctx, "POST", `${base(ctx.appId)}/count`, {
3175
+ slug,
3176
+ ...filter ? { filter } : {},
3177
+ ...candidate ? { candidate: true } : {}
3178
+ });
3179
+ }
3172
3180
  function configGet(ctx, slug) {
3173
3181
  return call(
3174
3182
  ctx,
@@ -3203,7 +3211,8 @@ function move(ctx, params) {
3203
3211
  return call(ctx, "POST", `${base(ctx.appId)}/move`, {
3204
3212
  slug: params.slug,
3205
3213
  placement: params.placement,
3206
- ...params.restart ? { restart: true } : {}
3214
+ ...params.restart ? { restart: true } : {},
3215
+ ...params.chains !== void 0 ? { chains: params.chains } : {}
3207
3216
  });
3208
3217
  }
3209
3218
  async function waitForMove(ctx, params) {
@@ -5231,11 +5240,22 @@ var dataSourcesSpecs = {
5231
5240
  ...CONFIG_FLAGS
5232
5241
  }
5233
5242
  },
5243
+ "datasources count": {
5244
+ usage: "Usage: remy-admin datasources count [--source <slug>] [--filter <k=v,...|json>] [--contains <words>] [--phrase <text>] [--candidate]",
5245
+ flags: {
5246
+ source: { type: "string" },
5247
+ filter: { type: "string" },
5248
+ contains: { type: "string" },
5249
+ phrase: { type: "string" },
5250
+ candidate: { type: "boolean" }
5251
+ }
5252
+ },
5234
5253
  "datasources move": {
5235
- usage: "Usage: remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--restart] [--wait] [--timeout <sec>]",
5254
+ usage: "Usage: remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--chains <n>] [--restart] [--wait] [--timeout <sec>]",
5236
5255
  flags: {
5237
5256
  source: { type: "string" },
5238
5257
  to: { type: "string" },
5258
+ chains: { type: "number", min: 1 },
5239
5259
  restart: { type: "boolean" },
5240
5260
  wait: { type: "boolean" },
5241
5261
  timeout: { type: "string" }
@@ -5426,6 +5446,16 @@ async function dataSourcesSearch(ctx, a) {
5426
5446
  })
5427
5447
  );
5428
5448
  }
5449
+ async function dataSourcesCount(ctx, a) {
5450
+ const filter = filterFromFlags(a);
5451
+ out(
5452
+ await count(ctx, {
5453
+ slug: sourceOf(a),
5454
+ ...filter ? { filter } : {},
5455
+ ...a.bool("candidate") ? { candidate: true } : {}
5456
+ })
5457
+ );
5458
+ }
5429
5459
  function filterFromFlags(a) {
5430
5460
  let filter = {};
5431
5461
  const raw = a.str("filter");
@@ -5600,10 +5630,12 @@ async function dataSourcesMove(ctx, a) {
5600
5630
  const slug = sourceOf(a);
5601
5631
  const to = a.str("to");
5602
5632
  const placement = to === "shared" ? "shared" : { resourceId: to };
5633
+ const chains = a.num("chains");
5603
5634
  const started = await move(ctx, {
5604
5635
  slug,
5605
5636
  placement,
5606
- ...a.bool("restart") ? { restart: true } : {}
5637
+ ...a.bool("restart") ? { restart: true } : {},
5638
+ ...chains !== void 0 ? { chains } : {}
5607
5639
  });
5608
5640
  if (!started.migration || !a.bool("wait")) {
5609
5641
  out({
@@ -5691,6 +5723,7 @@ var dataSourcesHandlers = {
5691
5723
  "datasources search": dataSourcesSearch,
5692
5724
  "datasources create": dataSourcesCreate,
5693
5725
  "datasources config": dataSourcesConfig,
5726
+ "datasources count": dataSourcesCount,
5694
5727
  "datasources move": dataSourcesMove,
5695
5728
  "datasources revectorize": dataSourcesRevectorize,
5696
5729
  "datasources promote": dataSourcesPromote,
@@ -5735,10 +5768,11 @@ Usage:
5735
5768
  remy-admin datasources status [--source <slug>] [--status error] [--all]
5736
5769
  remy-admin datasources rm [--source <slug>] (--document <id> | --filter <k=v,...|json>)
5737
5770
  remy-admin datasources search [--source <slug>] [search options] <query>
5771
+ remy-admin datasources count [--source <slug>] [--filter <k=v,...|json>] [--contains <words>] [--phrase <text>] [--candidate]
5738
5772
  remy-admin datasources create --source <slug> [--name <name>] [--placement <resource-id|shared>] [rebuild settings...]
5739
5773
  remy-admin datasources config [--source <slug>] [--placement <resource-id|shared>] [settings...]
5740
- remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--wait] [--timeout <sec>]
5741
- remy-admin datasources jobs start|list|status|approve|pause|resume|cancel \u2026 (see below)
5774
+ remy-admin datasources move [--source <slug>] --to <resource-id|shared> [--chains <n>] [--restart] [--wait] [--timeout <sec>]
5775
+ remy-admin datasources jobs start|list|status|approve|pause|resume|retry|cancel \u2026 (see below)
5742
5776
  remy-admin datasources connect|sync|connector|disconnect \u2026 (see below)
5743
5777
  remy-admin datasources hydrate|reindex|sample \u2026 (see below)
5744
5778
  remy-admin datasources eval create|list|get|add|import|queries|rm|delete|run|runs|result|compare \u2026 (see below)
@@ -5747,6 +5781,14 @@ Usage:
5747
5781
  remy-admin datasources drop [--source <slug>] [--version <n>]
5748
5782
  remy-admin datasources delete --source <slug>
5749
5783
 
5784
+ Count:
5785
+ \`count\` answers how many chunks match a filter, exactly, over the whole
5786
+ corpus, in the same grammar search narrows by: --contains for passages that
5787
+ hold all the words, --phrase for an exact sequence, --filter for metadata. No
5788
+ flags counts the whole corpus. It is a containment count, not a relevance
5789
+ count (none exists), and not the set search returns. The SDK's
5790
+ \`Source.count(filter)\` is the same call for an app.
5791
+
5750
5792
  Search options:
5751
5793
  --top-k <n> Results to return (default 5, max 50)
5752
5794
  --mode <m> hybrid (default) | semantic | lexical. Lexical is
@@ -5824,9 +5866,16 @@ Placement (shared pool vs dedicated capacity, see \`infra --help\`):
5824
5866
  \`move --wait\` blocks on it (exits ${EXIT.buildFailed} if the move failed,
5825
5867
  ${EXIT.timeout} on timeout). Moving to \`shared\` is how a source leaves a
5826
5868
  resource you mean to destroy.
5827
- A move is refused while documents are still building or a candidate version
5828
- exists (data_source_busy), when the target is not active
5869
+ A move is refused while documents are being built right now or a candidate
5870
+ version exists (data_source_busy), when the target is not active
5829
5871
  (capacity_<phase>), or when it would not fit (capacity_exceeded).
5872
+ The copy runs as parallel chains, each a window of the corpus; the target
5873
+ size sets the default (XL 32, Large 16, Medium 8, Small 4) and --chains <n>
5874
+ overrides it, up to 128. Eight chains run per worker, so this is the worker
5875
+ count times eight; the --wait line's documents/min shows what it bought.
5876
+ Re-running \`move\` to the same target resumes a failed or running copy from
5877
+ its chains' cursors; --restart cuts fresh windows instead (the count takes
5878
+ effect then), discarding progress so far.
5830
5879
 
5831
5880
  Notes:
5832
5881
  --wait blocks until processing finishes, so you can search immediately after.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madewithremy/admin",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",