@thallylabs/cli 0.5.6 → 0.6.0

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.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/dist/index.js +107 -56
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -30,6 +30,10 @@ stays invisible.
30
30
  | `thally translate --locale <code>` | Translate content into a locale |
31
31
  | `thally mcp` | Start the Model Context Protocol server (stdio) |
32
32
 
33
+ `thally migrate` asks which platform currently hosts the docs and dispatches to
34
+ the Mintlify or Docusaurus adapter. Non-interactive callers can pass
35
+ `--platform mintlify`, `--platform docusaurus`, or `--platform auto`.
36
+
33
37
  Run `thally` with no arguments for the full help.
34
38
 
35
39
  ## How it works
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var COMMANDS = [
9
9
  { name: "deploy", summary: "Build and deploy to a live URL", usage: "thally deploy [--prod] [--cloudflare]" },
10
10
  { name: "check", summary: "Lint content + Agent Readiness Score", usage: "thally check [--agents] [--fix] [--ci] [--drift]" },
11
11
  { name: "new", summary: "Create a new page and register it in docs.json", usage: 'thally new <page-id> [--title "..."]' },
12
- { name: "migrate", summary: "Migrate docs from a GitHub URL", usage: "thally migrate <github-url> [dir]" },
12
+ { name: "migrate", summary: "Migrate a docs repository or public site", usage: "thally migrate <github-or-docs-url> [dir] [--platform <mintlify|docusaurus|auto>]" },
13
13
  { name: "translate", summary: "Translate content into a locale", usage: "thally translate --locale <code>" },
14
14
  { name: "mcp", summary: "Start the Model Context Protocol server (stdio)", usage: "thally mcp" },
15
15
  { name: "agent", summary: "Draft docs from a task (PR, diff, or instruction) as a reviewed PR", usage: 'thally agent "<instruction>" [--diff <ref>] [--from-pr <url>] [--context-file <path>] [--dry-run] [--pr]' },
@@ -278,7 +278,7 @@ async function runDeploy(args) {
278
278
  import { readFileSync as readFileSync3 } from "fs";
279
279
  import Anthropic from "@anthropic-ai/sdk";
280
280
 
281
- // ../../../thally-migration-content-fidelity/packages/agent/dist/chunk-7RSLSWEK.js
281
+ // ../agent/dist/chunk-MZM56AWR.js
282
282
  import fs from "fs";
283
283
  import path3 from "path";
284
284
  import { AGENT_BRANCH_PREFIX, DOCS_PREVIEW_LABEL, buildTrackInstruction } from "@thallylabs/mcp/track";
@@ -289,14 +289,14 @@ function nonEmptyModel(value) {
289
289
  function resolveAgentModel(explicitModel, configuredModel = process.env.THALLY_AGENT_MODEL, legacyModel = process.env.DOX_AGENT_MODEL) {
290
290
  return nonEmptyModel(explicitModel) ?? nonEmptyModel(configuredModel) ?? nonEmptyModel(legacyModel) ?? DEFAULT_AGENT_MODEL;
291
291
  }
292
- var DOCS_AGENT_WORKFLOW_CONTRACT = "thally-track/v3";
292
+ var DOCS_AGENT_WORKFLOW_CONTRACT = "thally-track/v4";
293
293
  var DOCS_AGENT_WORKFLOW_TEMPLATE = `# Contract: ${DOCS_AGENT_WORKFLOW_CONTRACT}
294
294
  name: Thally docs agent
295
295
 
296
296
  on:
297
297
  # A product repo dispatches a docs task here (see the sender workflow).
298
298
  repository_dispatch:
299
- types: [thally-document]
299
+ types: [thally-document, thally-readiness]
300
300
  # Run it by hand from the Actions tab.
301
301
  workflow_dispatch:
302
302
  inputs:
@@ -314,12 +314,15 @@ on:
314
314
  - cron: '0 6 * * 1'
315
315
 
316
316
  permissions:
317
- contents: write
318
- pull-requests: write
317
+ contents: read
319
318
 
320
319
  jobs:
321
320
  document:
322
321
  if: github.event_name != 'schedule'
322
+ permissions:
323
+ contents: write
324
+ pull-requests: write
325
+ id-token: write
323
326
  runs-on: ubuntu-latest
324
327
  steps:
325
328
  - uses: actions/checkout@v4
@@ -349,7 +352,13 @@ jobs:
349
352
  FROM_PR: \${{ github.event.client_payload.from_pr || inputs.from_pr }}
350
353
  TRACK_CONTEXT: \${{ github.event.client_payload.context || inputs.context }}
351
354
  REQUESTER: \${{ github.event.client_payload.requester }}
355
+ THALLY_PR_GRANT: \${{ github.event.client_payload.thally_pr_grant }}
356
+ THALLY_PR_BRANCH: \${{ github.event.client_payload.thally_pr_branch }}
357
+ THALLY_PR_BROKER_URL: \${{ github.event.client_payload.thally_pr_broker_url || 'https://app.thally.io/api/github/readiness-pr' }}
352
358
  run: |
359
+ if [ -n "\${THALLY_PR_GRANT:-}" ]; then
360
+ echo "::add-mask::$THALLY_PR_GRANT"
361
+ fi
353
362
  run_thally() {
354
363
  if [ -x node_modules/.bin/thally ]; then
355
364
  # Existing sites may pin an older CLI that cannot consume the
@@ -366,14 +375,49 @@ jobs:
366
375
  if [ -n "$REQUESTER" ]; then
367
376
  REQUESTER_ARGS=(--requester "$REQUESTER")
368
377
  fi
378
+ OUTPUT_ARGS=(--pr)
379
+ if [ -n "\${THALLY_PR_GRANT:-}" ]; then
380
+ # A readiness repair leaves its validated changes staged. The
381
+ # workflow pushes the pre-granted branch, then asks Cloud to open
382
+ # the PR as the Thally App after GitHub OIDC authentication.
383
+ OUTPUT_ARGS=()
384
+ fi
369
385
  if [ -n "$TRACK_CONTEXT" ]; then
370
386
  CONTEXT_FILE="$RUNNER_TEMP/thally-track-context.md"
371
387
  printf '%s' "$TRACK_CONTEXT" > "$CONTEXT_FILE"
372
- run_thally agent "$INSTRUCTION" --from-pr "$FROM_PR" --context-file "$CONTEXT_FILE" "\${REQUESTER_ARGS[@]}" --pr
388
+ run_thally agent "$INSTRUCTION" --from-pr "$FROM_PR" --context-file "$CONTEXT_FILE" "\${REQUESTER_ARGS[@]}" "\${OUTPUT_ARGS[@]}"
373
389
  elif [ -n "$FROM_PR" ]; then
374
- run_thally agent "$INSTRUCTION" --from-pr "$FROM_PR" "\${REQUESTER_ARGS[@]}" --pr
390
+ run_thally agent "$INSTRUCTION" --from-pr "$FROM_PR" "\${REQUESTER_ARGS[@]}" "\${OUTPUT_ARGS[@]}"
375
391
  else
376
- run_thally agent "$INSTRUCTION" "\${REQUESTER_ARGS[@]}" --pr
392
+ run_thally agent "$INSTRUCTION" "\${REQUESTER_ARGS[@]}" "\${OUTPUT_ARGS[@]}"
393
+ fi
394
+ if [ -n "\${THALLY_PR_GRANT:-}" ]; then
395
+ GENERATED_BRANCH="$(git branch --show-current)"
396
+ if [[ "$GENERATED_BRANCH" != thally/agent-* ]]; then
397
+ echo "No documentation changes were needed."
398
+ exit 0
399
+ fi
400
+ if [[ ! "$THALLY_PR_BRANCH" =~ ^thally/agent-readiness-[a-f0-9]{16}$ ]]; then
401
+ echo "The readiness PR branch grant is invalid." >&2
402
+ exit 1
403
+ fi
404
+ git branch -m "$THALLY_PR_BRANCH"
405
+ git commit -m "docs: improve Thally Agent Readiness"
406
+ git push -u origin "$THALLY_PR_BRANCH"
407
+
408
+ node -e 'const url = new URL(process.env.THALLY_PR_BROKER_URL); const isProduction = url.origin === "https://app.thally.io"; const isPreview = /^deploy-preview-[0-9]+--thally-cloud\\.netlify\\.app$/.test(url.hostname); if (url.pathname !== "/api/github/readiness-pr" || (!isProduction && !isPreview)) process.exit(1)'
409
+
410
+ OIDC_RESPONSE="$(curl --silent --show-error --fail-with-body -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "\${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=thally-readiness-pr")"
411
+ export OIDC_RESPONSE
412
+ OIDC_TOKEN="$(node -e 'const body = JSON.parse(process.env.OIDC_RESPONSE); if (typeof body.value !== "string") process.exit(1); process.stdout.write(body.value)')"
413
+ unset OIDC_RESPONSE
414
+ echo "::add-mask::$OIDC_TOKEN"
415
+ REQUEST_FILE="$RUNNER_TEMP/thally-readiness-pr-request.json"
416
+ RESPONSE_FILE="$RUNNER_TEMP/thally-readiness-pr-response.json"
417
+ node -e 'require("node:fs").writeFileSync(process.argv[1], JSON.stringify({ grant: process.env.THALLY_PR_GRANT }))' "$REQUEST_FILE"
418
+ curl --silent --show-error --fail-with-body --output "$RESPONSE_FILE" -H "Authorization: Bearer $OIDC_TOKEN" -H "Content-Type: application/json" --data-binary "@$REQUEST_FILE" "$THALLY_PR_BROKER_URL"
419
+ unset OIDC_TOKEN
420
+ node -e 'const body = JSON.parse(require("node:fs").readFileSync(process.argv[1], "utf8")); if (typeof body.pull_request_url !== "string") process.exit(1); process.stdout.write("Pull request: " + body.pull_request_url + "\\n")' "$RESPONSE_FILE"
377
421
  fi
378
422
 
379
423
  drift-sweep:
@@ -529,11 +573,11 @@ function scaffoldAgentWorkflow(projectDir, docsRepo = "<owner>/<docs-repo>") {
529
573
  return { written, senderSnippet: mentionSenderWorkflow(docsRepo) };
530
574
  }
531
575
 
532
- // ../../../thally-migration-content-fidelity/packages/agent/dist/index.js
576
+ // ../agent/dist/index.js
533
577
  import { execFileSync as execFileSync2 } from "child_process";
534
578
  import { execFileSync } from "child_process";
535
579
 
536
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/Options.js
580
+ // ../../node_modules/zod-to-json-schema/dist/esm/Options.js
537
581
  var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use");
538
582
  var defaultOptions = {
539
583
  name: void 0,
@@ -567,7 +611,7 @@ var getDefaultOptions = (options) => typeof options === "string" ? {
567
611
  ...options
568
612
  };
569
613
 
570
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/Refs.js
614
+ // ../../node_modules/zod-to-json-schema/dist/esm/Refs.js
571
615
  var getRefs = (options) => {
572
616
  const _options = getDefaultOptions(options);
573
617
  const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
@@ -588,7 +632,7 @@ var getRefs = (options) => {
588
632
  };
589
633
  };
590
634
 
591
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
635
+ // ../../node_modules/zod-to-json-schema/dist/esm/errorMessages.js
592
636
  function addErrorMessage(res, key, errorMessage, refs) {
593
637
  if (!refs?.errorMessages)
594
638
  return;
@@ -604,7 +648,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
604
648
  addErrorMessage(res, key, errorMessage, refs);
605
649
  }
606
650
 
607
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
651
+ // ../../node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
608
652
  var getRelativePath = (pathA, pathB) => {
609
653
  let i = 0;
610
654
  for (; i < pathA.length && i < pathB.length; i++) {
@@ -614,7 +658,7 @@ var getRelativePath = (pathA, pathB) => {
614
658
  return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
615
659
  };
616
660
 
617
- // ../../../thally-migration-content-fidelity/node_modules/zod/v3/helpers/util.js
661
+ // ../../node_modules/zod/v3/helpers/util.js
618
662
  var util;
619
663
  (function(util2) {
620
664
  util2.assertEqual = (_) => {
@@ -748,7 +792,7 @@ var getParsedType = (data) => {
748
792
  }
749
793
  };
750
794
 
751
- // ../../../thally-migration-content-fidelity/node_modules/zod/v3/ZodError.js
795
+ // ../../node_modules/zod/v3/ZodError.js
752
796
  var ZodIssueCode = util.arrayToEnum([
753
797
  "invalid_type",
754
798
  "invalid_literal",
@@ -862,7 +906,7 @@ ZodError.create = (issues) => {
862
906
  return error;
863
907
  };
864
908
 
865
- // ../../../thally-migration-content-fidelity/node_modules/zod/v3/locales/en.js
909
+ // ../../node_modules/zod/v3/locales/en.js
866
910
  var errorMap = (issue, _ctx) => {
867
911
  let message;
868
912
  switch (issue.code) {
@@ -965,13 +1009,13 @@ var errorMap = (issue, _ctx) => {
965
1009
  };
966
1010
  var en_default = errorMap;
967
1011
 
968
- // ../../../thally-migration-content-fidelity/node_modules/zod/v3/errors.js
1012
+ // ../../node_modules/zod/v3/errors.js
969
1013
  var overrideErrorMap = en_default;
970
1014
  function getErrorMap() {
971
1015
  return overrideErrorMap;
972
1016
  }
973
1017
 
974
- // ../../../thally-migration-content-fidelity/node_modules/zod/v3/helpers/parseUtil.js
1018
+ // ../../node_modules/zod/v3/helpers/parseUtil.js
975
1019
  var makeIssue = (params) => {
976
1020
  const { data, path: path5, errorMaps, issueData } = params;
977
1021
  const fullPath = [...path5, ...issueData.path || []];
@@ -1080,14 +1124,14 @@ var isDirty = (x) => x.status === "dirty";
1080
1124
  var isValid = (x) => x.status === "valid";
1081
1125
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
1082
1126
 
1083
- // ../../../thally-migration-content-fidelity/node_modules/zod/v3/helpers/errorUtil.js
1127
+ // ../../node_modules/zod/v3/helpers/errorUtil.js
1084
1128
  var errorUtil;
1085
1129
  (function(errorUtil2) {
1086
1130
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
1087
1131
  errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
1088
1132
  })(errorUtil || (errorUtil = {}));
1089
1133
 
1090
- // ../../../thally-migration-content-fidelity/node_modules/zod/v3/types.js
1134
+ // ../../node_modules/zod/v3/types.js
1091
1135
  var ParseInputLazyPath = class {
1092
1136
  constructor(parent, value, path5, key) {
1093
1137
  this._cachedPath = [];
@@ -4490,7 +4534,7 @@ var nullableType = ZodNullable.create;
4490
4534
  var preprocessType = ZodEffects.createWithPreprocess;
4491
4535
  var pipelineType = ZodPipeline.create;
4492
4536
 
4493
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
4537
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/any.js
4494
4538
  function parseAnyDef(refs) {
4495
4539
  if (refs.target !== "openAi") {
4496
4540
  return {};
@@ -4506,7 +4550,7 @@ function parseAnyDef(refs) {
4506
4550
  };
4507
4551
  }
4508
4552
 
4509
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
4553
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/array.js
4510
4554
  function parseArrayDef(def, refs) {
4511
4555
  const res = {
4512
4556
  type: "array"
@@ -4530,7 +4574,7 @@ function parseArrayDef(def, refs) {
4530
4574
  return res;
4531
4575
  }
4532
4576
 
4533
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
4577
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
4534
4578
  function parseBigintDef(def, refs) {
4535
4579
  const res = {
4536
4580
  type: "integer",
@@ -4576,24 +4620,24 @@ function parseBigintDef(def, refs) {
4576
4620
  return res;
4577
4621
  }
4578
4622
 
4579
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
4623
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
4580
4624
  function parseBooleanDef() {
4581
4625
  return {
4582
4626
  type: "boolean"
4583
4627
  };
4584
4628
  }
4585
4629
 
4586
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
4630
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
4587
4631
  function parseBrandedDef(_def, refs) {
4588
4632
  return parseDef(_def.type._def, refs);
4589
4633
  }
4590
4634
 
4591
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
4635
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
4592
4636
  var parseCatchDef = (def, refs) => {
4593
4637
  return parseDef(def.innerType._def, refs);
4594
4638
  };
4595
4639
 
4596
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
4640
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/date.js
4597
4641
  function parseDateDef(def, refs, overrideDateStrategy) {
4598
4642
  const strategy = overrideDateStrategy ?? refs.dateStrategy;
4599
4643
  if (Array.isArray(strategy)) {
@@ -4652,7 +4696,7 @@ var integerDateParser = (def, refs) => {
4652
4696
  return res;
4653
4697
  };
4654
4698
 
4655
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
4699
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/default.js
4656
4700
  function parseDefaultDef(_def, refs) {
4657
4701
  return {
4658
4702
  ...parseDef(_def.innerType._def, refs),
@@ -4660,12 +4704,12 @@ function parseDefaultDef(_def, refs) {
4660
4704
  };
4661
4705
  }
4662
4706
 
4663
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
4707
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
4664
4708
  function parseEffectsDef(_def, refs) {
4665
4709
  return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
4666
4710
  }
4667
4711
 
4668
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
4712
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
4669
4713
  function parseEnumDef(def) {
4670
4714
  return {
4671
4715
  type: "string",
@@ -4673,7 +4717,7 @@ function parseEnumDef(def) {
4673
4717
  };
4674
4718
  }
4675
4719
 
4676
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
4720
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
4677
4721
  var isJsonSchema7AllOfType = (type) => {
4678
4722
  if ("type" in type && type.type === "string")
4679
4723
  return false;
@@ -4715,7 +4759,7 @@ function parseIntersectionDef(def, refs) {
4715
4759
  } : void 0;
4716
4760
  }
4717
4761
 
4718
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
4762
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
4719
4763
  function parseLiteralDef(def, refs) {
4720
4764
  const parsedType = typeof def.value;
4721
4765
  if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
@@ -4735,7 +4779,7 @@ function parseLiteralDef(def, refs) {
4735
4779
  };
4736
4780
  }
4737
4781
 
4738
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
4782
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/string.js
4739
4783
  var emojiRegex2 = void 0;
4740
4784
  var zodPatterns = {
4741
4785
  /**
@@ -5060,7 +5104,7 @@ function stringifyRegExpWithFlags(regex, refs) {
5060
5104
  return pattern;
5061
5105
  }
5062
5106
 
5063
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
5107
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/record.js
5064
5108
  function parseRecordDef(def, refs) {
5065
5109
  if (refs.target === "openAi") {
5066
5110
  console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
@@ -5112,7 +5156,7 @@ function parseRecordDef(def, refs) {
5112
5156
  return schema;
5113
5157
  }
5114
5158
 
5115
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
5159
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/map.js
5116
5160
  function parseMapDef(def, refs) {
5117
5161
  if (refs.mapStrategy === "record") {
5118
5162
  return parseRecordDef(def, refs);
@@ -5137,7 +5181,7 @@ function parseMapDef(def, refs) {
5137
5181
  };
5138
5182
  }
5139
5183
 
5140
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
5184
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
5141
5185
  function parseNativeEnumDef(def) {
5142
5186
  const object = def.values;
5143
5187
  const actualKeys = Object.keys(def.values).filter((key) => {
@@ -5151,7 +5195,7 @@ function parseNativeEnumDef(def) {
5151
5195
  };
5152
5196
  }
5153
5197
 
5154
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
5198
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/never.js
5155
5199
  function parseNeverDef(refs) {
5156
5200
  return refs.target === "openAi" ? void 0 : {
5157
5201
  not: parseAnyDef({
@@ -5161,7 +5205,7 @@ function parseNeverDef(refs) {
5161
5205
  };
5162
5206
  }
5163
5207
 
5164
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
5208
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/null.js
5165
5209
  function parseNullDef(refs) {
5166
5210
  return refs.target === "openApi3" ? {
5167
5211
  enum: ["null"],
@@ -5171,7 +5215,7 @@ function parseNullDef(refs) {
5171
5215
  };
5172
5216
  }
5173
5217
 
5174
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
5218
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/union.js
5175
5219
  var primitiveMappings = {
5176
5220
  ZodString: "string",
5177
5221
  ZodNumber: "number",
@@ -5239,7 +5283,7 @@ var asAnyOf = (def, refs) => {
5239
5283
  return anyOf.length ? { anyOf } : void 0;
5240
5284
  };
5241
5285
 
5242
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
5286
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
5243
5287
  function parseNullableDef(def, refs) {
5244
5288
  if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
5245
5289
  if (refs.target === "openApi3") {
@@ -5271,7 +5315,7 @@ function parseNullableDef(def, refs) {
5271
5315
  return base && { anyOf: [base, { type: "null" }] };
5272
5316
  }
5273
5317
 
5274
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
5318
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/number.js
5275
5319
  function parseNumberDef(def, refs) {
5276
5320
  const res = {
5277
5321
  type: "number"
@@ -5320,7 +5364,7 @@ function parseNumberDef(def, refs) {
5320
5364
  return res;
5321
5365
  }
5322
5366
 
5323
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
5367
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/object.js
5324
5368
  function parseObjectDef(def, refs) {
5325
5369
  const forceOptionalIntoNullable = refs.target === "openAi";
5326
5370
  const result = {
@@ -5390,7 +5434,7 @@ function safeIsOptional(schema) {
5390
5434
  }
5391
5435
  }
5392
5436
 
5393
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
5437
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
5394
5438
  var parseOptionalDef = (def, refs) => {
5395
5439
  if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
5396
5440
  return parseDef(def.innerType._def, refs);
@@ -5409,7 +5453,7 @@ var parseOptionalDef = (def, refs) => {
5409
5453
  } : parseAnyDef(refs);
5410
5454
  };
5411
5455
 
5412
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
5456
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
5413
5457
  var parsePipelineDef = (def, refs) => {
5414
5458
  if (refs.pipeStrategy === "input") {
5415
5459
  return parseDef(def.in._def, refs);
@@ -5429,12 +5473,12 @@ var parsePipelineDef = (def, refs) => {
5429
5473
  };
5430
5474
  };
5431
5475
 
5432
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
5476
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
5433
5477
  function parsePromiseDef(def, refs) {
5434
5478
  return parseDef(def.type._def, refs);
5435
5479
  }
5436
5480
 
5437
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
5481
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/set.js
5438
5482
  function parseSetDef(def, refs) {
5439
5483
  const items = parseDef(def.valueType._def, {
5440
5484
  ...refs,
@@ -5454,7 +5498,7 @@ function parseSetDef(def, refs) {
5454
5498
  return schema;
5455
5499
  }
5456
5500
 
5457
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
5501
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
5458
5502
  function parseTupleDef(def, refs) {
5459
5503
  if (def.rest) {
5460
5504
  return {
@@ -5482,24 +5526,24 @@ function parseTupleDef(def, refs) {
5482
5526
  }
5483
5527
  }
5484
5528
 
5485
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
5529
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
5486
5530
  function parseUndefinedDef(refs) {
5487
5531
  return {
5488
5532
  not: parseAnyDef(refs)
5489
5533
  };
5490
5534
  }
5491
5535
 
5492
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
5536
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
5493
5537
  function parseUnknownDef(refs) {
5494
5538
  return parseAnyDef(refs);
5495
5539
  }
5496
5540
 
5497
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
5541
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
5498
5542
  var parseReadonlyDef = (def, refs) => {
5499
5543
  return parseDef(def.innerType._def, refs);
5500
5544
  };
5501
5545
 
5502
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/selectParser.js
5546
+ // ../../node_modules/zod-to-json-schema/dist/esm/selectParser.js
5503
5547
  var selectParser = (def, typeName, refs) => {
5504
5548
  switch (typeName) {
5505
5549
  case ZodFirstPartyTypeKind.ZodString:
@@ -5575,7 +5619,7 @@ var selectParser = (def, typeName, refs) => {
5575
5619
  }
5576
5620
  };
5577
5621
 
5578
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/parseDef.js
5622
+ // ../../node_modules/zod-to-json-schema/dist/esm/parseDef.js
5579
5623
  function parseDef(def, refs, forceResolution = false) {
5580
5624
  const seenItem = refs.seen.get(def);
5581
5625
  if (refs.override) {
@@ -5631,7 +5675,7 @@ var addMeta = (def, refs, jsonSchema) => {
5631
5675
  return jsonSchema;
5632
5676
  };
5633
5677
 
5634
- // ../../../thally-migration-content-fidelity/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
5678
+ // ../../node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
5635
5679
  var zodToJsonSchema = (schema, options) => {
5636
5680
  const refs = getRefs(options);
5637
5681
  let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
@@ -5693,7 +5737,7 @@ var zodToJsonSchema = (schema, options) => {
5693
5737
  return combined;
5694
5738
  };
5695
5739
 
5696
- // ../../../thally-migration-content-fidelity/packages/agent/dist/index.js
5740
+ // ../agent/dist/index.js
5697
5741
  import { tools as mcpTools, getTool } from "@thallylabs/mcp/tools";
5698
5742
  import { spawnSync } from "child_process";
5699
5743
  import { createRequire as createRequire2 } from "module";
@@ -5906,6 +5950,13 @@ function buildRepairPrompt(errors) {
5906
5950
  function buildPullRequestCreateArgs(title, body, branch, baseBranch) {
5907
5951
  return ["pr", "create", "--title", title, "--body", body, "--head", branch, "--base", baseBranch];
5908
5952
  }
5953
+ function buildPullRequestTitle(instruction) {
5954
+ const normalizedInstruction = instruction.replace(/\s+/g, " ").trim();
5955
+ if (!normalizedInstruction) return "docs: update documentation";
5956
+ const maxSummaryLength = 65;
5957
+ const summary = normalizedInstruction.length > maxSummaryLength ? `${normalizedInstruction.slice(0, maxSummaryLength).trimEnd()}\u2026` : normalizedInstruction;
5958
+ return `docs: ${summary}`;
5959
+ }
5909
5960
  async function runAgent(client, task, options) {
5910
5961
  const { projectDir, mode } = options;
5911
5962
  const model = resolveAgentModel(options.model);
@@ -5973,7 +6024,7 @@ async function runAgent(client, task, options) {
5973
6024
  return { branch, summary, steps, diff, validation, noChanges: false };
5974
6025
  }
5975
6026
  if (mode === "pr") {
5976
- const title = `docs: ${task.instruction.slice(0, 60)}`;
6027
+ const title = buildPullRequestTitle(task.instruction);
5977
6028
  const body = `${summary}
5978
6029
 
5979
6030
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thallylabs/cli",
3
- "version": "0.5.6",
3
+ "version": "0.6.0",
4
4
  "description": "The unified thally CLI — author content + config; the framework stays a hidden runtime",
5
5
  "type": "module",
6
6
  "engines": {
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@anthropic-ai/sdk": "^0.78.0",
27
- "@thallylabs/mcp": "0.7.4",
28
- "create-thally-docs": "0.7.8"
27
+ "@thallylabs/mcp": "0.8.0",
28
+ "create-thally-docs": "0.8.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@thallylabs/agent": "*",