@distributionos/cli 0.1.7 → 0.1.9

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
@@ -6,7 +6,7 @@ Installer for connecting an app repo to DistributionOS.
6
6
  npx @distributionos/cli setup --app <appId>
7
7
  ```
8
8
 
9
- Default setup opens the DistributionOS MCP OAuth approval flow when needed, then prints a plan first. In an interactive terminal, approve the plan to apply the managed setup changes. In non-interactive agent runs, use `--apply` only after reviewing the dry-run output.
9
+ Default setup opens the DistributionOS MCP OAuth approval flow when needed, then prints a setup review first. In an interactive terminal, approve the plan to apply the managed setup changes. In non-interactive agent runs, use `--apply` only after reviewing the setup output.
10
10
 
11
11
  Agents that support installable skills can also load the public DistributionOS agent skill before using the CLI:
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distributionos/cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "DistributionOS repo setup CLI for agent onboarding and first-party analytics.",
5
5
  "homepage": "https://distributionos.dev",
6
6
  "repository": {
package/src/cli.js CHANGED
@@ -226,8 +226,8 @@ export async function runCli(argv, runtime) {
226
226
  : null;
227
227
 
228
228
  stdout.write(args.json
229
- ? `${JSON.stringify({ plan, changes, initialization, validation, inspection }, null, 2)}\n`
230
- : formatApplyResult(plan, changes, initialization, validation, inspection, args.skipValidate));
229
+ ? `${JSON.stringify({ plan, changes, initialization, validation, inspection }, null, 2)}\n`
230
+ : formatApplyResult(plan, changes, initialization, validation, inspection, args.skipValidate, args.apiBase ?? DEFAULT_API_BASE));
231
231
  return hasBlockingApplyFailure(validation, inspection) ? 1 : 0;
232
232
  } catch (error) {
233
233
  stderr.write(`${error instanceof Error ? error.message : 'Setup apply failed'}\n`);
@@ -449,10 +449,13 @@ function formatReportResult(result) {
449
449
  return `${lines.join('\n')}\n`;
450
450
  }
451
451
 
452
- function formatApplyResult(plan, changes, initialization, validation, inspection, skipValidate) {
453
- const lines = [
454
- formatPlanText({ ...plan, mode: 'apply' }).trimEnd(),
455
- '',
452
+ function formatApplyResult(plan, changes, initialization, validation, inspection, skipValidate, apiBase = DEFAULT_API_BASE) {
453
+ const reviewUrl = initialization?.reviewUrl
454
+ ? absoluteDistributionOsUrl(initialization.reviewUrl, apiBase)
455
+ : null;
456
+ const lines = [
457
+ formatPlanText({ ...plan, mode: 'apply' }).trimEnd(),
458
+ '',
456
459
  'Applied changes',
457
460
  ];
458
461
 
@@ -466,9 +469,9 @@ function formatApplyResult(plan, changes, initialization, validation, inspection
466
469
  }
467
470
  }
468
471
 
469
- lines.push(initialization?.reviewUrl
470
- ? `- Initialization submitted. Review URL: ${initialization.reviewUrl}`
471
- : '- Initialization was not submitted because no auth token was available.');
472
+ lines.push(reviewUrl
473
+ ? `- Initialization submitted. Review URL: ${reviewUrl}`
474
+ : '- Initialization was not submitted because no auth token was available.');
472
475
 
473
476
  lines.push('', 'Validation');
474
477
  if (skipValidate) {
@@ -497,11 +500,33 @@ function formatApplyResult(plan, changes, initialization, validation, inspection
497
500
  for (const result of inspection) {
498
501
  lines.push(`- ${result.name}: ${result.status} - ${result.message}`);
499
502
  }
500
- }
501
- lines.push('- Nothing was committed, pushed, or deployed.');
502
- return `${lines.join('\n')}\n`;
503
- }
504
-
505
- function oneLine(value) {
506
- return String(value).split(/\r?\n/).filter(Boolean).slice(-1)[0]?.slice(0, 240) ?? '';
507
- }
503
+ }
504
+ lines.push('- Nothing was committed, pushed, or deployed.');
505
+ lines.push('', 'Next step');
506
+ if (reviewUrl) {
507
+ lines.push(
508
+ '- Open this DistributionOS review page now:',
509
+ ` ${reviewUrl}`,
510
+ '- Review the generated Brain Doc and Brain Vault context before asking your agent to keep working.',
511
+ '- After review, come back to this repo and inspect git diff before committing, pushing, or deploying.',
512
+ );
513
+ } else {
514
+ lines.push(
515
+ '- Reconnect DistributionOS OAuth or provide an app-scoped token, then rerun setup so initialization can be submitted.',
516
+ '- No DistributionOS review page is ready yet.',
517
+ );
518
+ }
519
+ return `${lines.join('\n')}\n`;
520
+ }
521
+
522
+ function oneLine(value) {
523
+ return String(value).split(/\r?\n/).filter(Boolean).slice(-1)[0]?.slice(0, 240) ?? '';
524
+ }
525
+
526
+ function absoluteDistributionOsUrl(pathOrUrl, apiBase) {
527
+ try {
528
+ return new URL(pathOrUrl, apiBase || DEFAULT_API_BASE).toString();
529
+ } catch {
530
+ return String(pathOrUrl);
531
+ }
532
+ }
package/src/constants.js CHANGED
@@ -48,9 +48,11 @@ export const PRIVATE_ROUTE_PATTERNS = [
48
48
  '/products/**',
49
49
  '/project/**',
50
50
  '/projects/**',
51
- '/workspace/**',
52
- '/workspaces/**',
53
- '/customer/**',
51
+ '/workspace/**',
52
+ '/workspaces/**',
53
+ '/workflow/**',
54
+ '/workflows/**',
55
+ '/customer/**',
54
56
  '/customers/**',
55
57
  '/client/**',
56
58
  '/clients/**',
package/src/plan.js CHANGED
@@ -39,7 +39,7 @@ export async function createSetupPlan(options) {
39
39
  return {
40
40
  appId,
41
41
  cwd,
42
- mode: options.apply ? 'apply' : 'dry-run',
42
+ mode: options.apply ? 'apply' : 'review',
43
43
  packageName: CLI_PACKAGE_NAME,
44
44
  futureCommand: buildSetupCommand(appId),
45
45
  localCommand: `npm run cli:setup -- --app ${appId}`,