@yadurajfleetos/cli 0.10.1 → 0.10.2

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.
@@ -465,14 +465,22 @@ async function theOnlyNode(flags) {
465
465
  async function reviewed(draft, flags) {
466
466
  const { repoMap } = await import('../repomap.js');
467
467
  const fleetId = await requireFleet(typeof flags.fleet === 'string' ? flags.fleet : undefined);
468
- const review = (map, answers) => task(answers ? 'applying your answers' : 'reading the repository for a second opinion', async () => request('POST', `/fleets/${fleetId}/manifest/assist`, {
469
- body: { draft, repoMap: map, ...(answers ? { answers } : {}) },
468
+ // The second pass is a different, smaller question.
469
+ //
470
+ // It used to resend the original draft and the whole repository map, which
471
+ // on this project meant ~6,000 tokens seconds after the first call had spent
472
+ // ~3,000 — straight through a per-minute budget, and the answer the user had
473
+ // just given was discarded. Applying an answer needs the manifest it applies
474
+ // to and the answer, not the evidence that produced it: the model has
475
+ // already read the repository and written its conclusions down.
476
+ const review = (base, map, answers) => task(answers ? 'applying your answers' : 'reading the repository for a second opinion', async () => request('POST', `/fleets/${fleetId}/manifest/assist`, {
477
+ body: { draft: base, repoMap: map, ...(answers ? { answers } : {}) },
470
478
  }), { done: () => (answers ? 'done' : 'reviewed') });
471
479
  let map;
472
480
  let out;
473
481
  try {
474
482
  map = await repoMap();
475
- out = (await review(map)).body;
483
+ out = (await review(draft, map)).body;
476
484
  }
477
485
  catch (err) {
478
486
  console.log(`${glyph.warn} ${c.yellow('review skipped')} ${err instanceof Error ? err.message : 'the control plane could not be reached'}`);
@@ -506,7 +514,9 @@ async function reviewed(draft, flags) {
506
514
  const answered = await answerQuestions(out.questions, flags);
507
515
  if (answered) {
508
516
  try {
509
- const second = (await review(map, answered)).body;
517
+ // The reviewed manifest is what the answer applies to, and the tree
518
+ // alone is enough context to keep names straight.
519
+ const second = (await review(out.manifest, map.split('\n## ')[0] ?? map, answered)).body;
510
520
  if (second.status === 'ok') {
511
521
  for (const note of second.notes)
512
522
  console.log(c.dim(` · ${note}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yadurajfleetos/cli",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Fleet OS command-line interface for deploying and orchestrating services on user-owned hardware",
5
5
  "type": "module",
6
6
  "license": "MIT",