@mytegroupinc/myte-core 0.0.52 → 0.0.53

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
@@ -106,6 +106,7 @@ Coding agents should treat `MYTE_API_KEY` as a project-scoped Project Assistant
106
106
  - Use `suggestions sync` only when you need to refresh mission review-thread state without refreshing the full board.
107
107
  - Use `query --with-diff` for project-scoped code review, planning, and implementation questions.
108
108
  - Use `create-prd` only with reviewed markdown files and `--confirm-write --approval-artifact <path>`. The markdown file body is the PRD document; `description` is only the short board/card summary.
109
+ - New PRDs are unassigned by default. Add `--assigned-user-id <id>` or `--assigned-user-email <exact-email>` to validate and assign an eligible project user in the same create request.
109
110
  - Use `create-prd --document-set` only when the explicit intent is one parent
110
111
  Feedback with one to three ordered documents; omitting it preserves
111
112
  independent multi-file creation.
package/cli.js CHANGED
@@ -235,8 +235,8 @@ function printHelp() {
235
235
  " myte feedback prd-diff --feedback-id <id> --version-id <id> [--compare-to <id>] [--document-id <id>] [--json]",
236
236
  " myte feedback validate --file ./MyteCommandCenter/reviews/feedback/<id>-status.yml [--json]",
237
237
  " myte feedback apply --file ./MyteCommandCenter/reviews/feedback/<id>-status.yml [--json]",
238
- " myte create-prd <file.md> [more.md ...] [--document-set] --confirm-write --approval-artifact <path> [--json] [--title \"...\"] [--description \"...\"]",
239
- " cat file.md | myte create-prd --stdin --confirm-write --approval-artifact <path> [--title \"...\"] [--description \"...\"]",
238
+ " myte create-prd <file.md> [more.md ...] [--document-set] [--assigned-user-id <id> | --assigned-user-email <email>] --confirm-write --approval-artifact <path> [--json] [--title \"...\"] [--description \"...\"]",
239
+ " cat file.md | myte create-prd --stdin [--assigned-user-id <id> | --assigned-user-email <email>] --confirm-write --approval-artifact <path> [--title \"...\"] [--description \"...\"]",
240
240
  " cat update.md | myte update-owner --stdin --subject \"Owner update\" --confirm-write --approval-artifact ./update.md",
241
241
  " cat update.md | myte update-client --stdin --subject \"Weekly client update\" --confirm-write --approval-artifact ./update.md",
242
242
  "",
@@ -305,7 +305,9 @@ function printHelp() {
305
305
  " - Add --document-set to create one feedback item containing up to three ordered markdown documents",
306
306
  " - Document-set source markdown is preserved exactly; canonical markdown is generated server-side for reading and DOCX rendering",
307
307
  " - Title source: myte-kanban.title, first # heading, or --title",
308
- " - Description source: myte-kanban.description or --description; this is a short feedback/card summary only",
308
+ " - Description source: myte-kanban.description or --description; this is a short feedback/card summary only",
309
+ " - New PRDs are unassigned unless --assigned-user-id or --assigned-user-email is provided",
310
+ " - Explicit assignees must be the project owner or an active assigned project collaborator",
309
311
  " - Never put the full PRD in description. The complete PRD must live in the markdown file body",
310
312
  " - Each item carries the full PRD markdown blob as prd_markdown/ticket_markdown",
311
313
  " - Backend stores that blob as the renderable PRD document source, mirrors it for PRD text search/sync, and generates a DOCX attachment",
@@ -402,6 +404,8 @@ function printHelp() {
402
404
  " --title <text> Override PRD title for raw markdown uploads",
403
405
  " --description <text> Set feedback description/card summary for raw markdown uploads",
404
406
  " --document-set Create one PRD feedback item containing one to three ordered markdown files",
407
+ " --assigned-user-id Assign a newly created PRD to an eligible project user ObjectId",
408
+ " --assigned-user-email Assign a newly created PRD to an eligible project user by exact email",
405
409
  " --content <text> Team update content for update-team",
406
410
  " --body <text> Feedback comment body for feedback comment",
407
411
  " --subject <text> Subject for update-owner or update-client",
@@ -424,10 +428,9 @@ function printHelp() {
424
428
  " --reason <text> Human review reason included in feedback refinement artifacts",
425
429
  " --status <value> Mission status target, feedback-sync filter, or feedback review state depending on command",
426
430
  " --source <value> Feedback source filter for feedback-sync",
427
- " --priority <value> Feedback review priority target: Low, Medium, or High",
428
- " --user-id <id> Feedback assignee user id for `myte feedback assign`",
429
- " --assigned-user-id Alias for --user-id in feedback assign",
430
- " --due-date <date> Feedback due date target for edit artifacts",
431
+ " --priority <value> Feedback review priority target: Low, Medium, or High",
432
+ " --user-id <id> Feedback assignee user id for `myte feedback assign`",
433
+ " --due-date <date> Feedback due date target for edit artifacts",
431
434
  " --review-note <text> Review note stored in feedback refinement history",
432
435
  " --with-prd-text Include extracted PRD text so local PRD files are materialized during feedback-sync (default: on)",
433
436
  " --no-with-prd-text Skip PRD and readable comment-attachment extraction; keep feedback/comment/attachment metadata",
@@ -477,7 +480,7 @@ function printHelp() {
477
480
  " myte suggestions revise --file ./suggestions/revise.yml --confirm-write --approval-artifact ./suggestions/revise.yml",
478
481
  " myte suggestions review",
479
482
  " myte update-client --subject \"Weekly client update\" --body-markdown \"## Progress\\n- Login complete\" --target-contact-ids 507f1f77bcf86cd799439011,507f1f77bcf86cd799439012 --confirm-write --approval-artifact ./updates/week-12.md",
480
- " myte create-prd ./drafts/auth-prd.md --description \"Short card summary\" --confirm-write --approval-artifact ./drafts/auth-prd.md",
483
+ " myte create-prd ./drafts/auth-prd.md --description \"Short card summary\" --assigned-user-email dev@example.com --confirm-write --approval-artifact ./drafts/auth-prd.md",
481
484
  " myte create-prd ./drafts/auth-prd.md ./drafts/billing-prd.md --confirm-write --approval-artifact ./drafts/prd-batch.md",
482
485
  " myte create-prd ./drafts/overview.md ./drafts/api.md ./drafts/web.md --document-set --title \"Platform PRD\" --confirm-write --approval-artifact ./drafts/platform-prd-approval.md",
483
486
  " cat ./drafts/auth-prd.md | myte create-prd --stdin --confirm-write --approval-artifact ./drafts/auth-prd.md",
@@ -5479,6 +5482,27 @@ async function runCreatePrd(args) {
5479
5482
  const documentSetMode = Boolean(
5480
5483
  args["document-set"] || args.documentSet || args.document_set
5481
5484
  );
5485
+ const assignedUserId = firstNonEmptyString(
5486
+ args["assigned-user-id"],
5487
+ args.assignedUserId,
5488
+ args.assigned_user_id
5489
+ );
5490
+ const assignedUserEmail = firstNonEmptyString(
5491
+ args["assigned-user-email"],
5492
+ args.assignedUserEmail,
5493
+ args.assigned_user_email
5494
+ );
5495
+
5496
+ if (assignedUserId && assignedUserEmail) {
5497
+ console.error("Use either --assigned-user-id or --assigned-user-email, not both.");
5498
+ process.exit(1);
5499
+ }
5500
+
5501
+ const applyCreatePrdAssignment = (payload) => {
5502
+ if (assignedUserId) payload.assigned_user_id = assignedUserId;
5503
+ if (assignedUserEmail) payload.assigned_user_email = assignedUserEmail;
5504
+ return payload;
5505
+ };
5482
5506
 
5483
5507
  if (useStdin && providedPaths.length) {
5484
5508
  console.error("Use either file paths or --stdin for create-prd, not both.");
@@ -5520,7 +5544,7 @@ async function runCreatePrd(args) {
5520
5544
  if (includeClientRef && filePath) {
5521
5545
  payload.client_ref = path.relative(process.cwd(), filePath) || path.basename(filePath);
5522
5546
  }
5523
- return payload;
5547
+ return applyCreatePrdAssignment(payload);
5524
5548
  };
5525
5549
 
5526
5550
  let payloads = [];
@@ -5596,7 +5620,7 @@ async function runCreatePrd(args) {
5596
5620
  if (priority) documentSetPayload.priority = priority;
5597
5621
  if (status) documentSetPayload.status = status;
5598
5622
  if (tags) documentSetPayload.tags = tags;
5599
- payloads = [documentSetPayload];
5623
+ payloads = [applyCreatePrdAssignment(documentSetPayload)];
5600
5624
  } else {
5601
5625
  payloads = resolvedFiles.map(({ absPath, sourceText }) =>
5602
5626
  buildCreatePrdPayload({
package/mytecody-cli.js CHANGED
@@ -634,12 +634,12 @@ function manifestWithoutSignature(manifest) {
634
634
  return clone;
635
635
  }
636
636
 
637
- function verifyManifestSignature(manifest) {
637
+ function verifyManifestSignature(manifest, { publicKeyPem } = {}) {
638
638
  const signature = manifest && manifest.signature;
639
639
  if (!signature || !signature.value) {
640
640
  return { status: "missing", verified: false };
641
641
  }
642
- const publicKey = builtInPublicKeyPem();
642
+ const publicKey = publicKeyPem || builtInPublicKeyPem();
643
643
  if (!publicKey) {
644
644
  return {
645
645
  status: "public-key-missing",
@@ -772,8 +772,8 @@ function artifactBytesForInstall(bytes, artifact) {
772
772
  throw new Error(`Unsupported MyteCody release artifact format: ${format}`);
773
773
  }
774
774
 
775
- function signatureAccepted(manifest, args = {}) {
776
- const signature = verifyManifestSignature(manifest);
775
+ function signatureAccepted(manifest, args = {}, { publicKeyPem } = {}) {
776
+ const signature = verifyManifestSignature(manifest, { publicKeyPem });
777
777
  if (signature.verified) return { ok: true, signature, trusted_unsigned: false };
778
778
  return { ok: false, signature, trusted_unsigned: false };
779
779
  }
@@ -1776,7 +1776,11 @@ async function runDoctor(args, envPath) {
1776
1776
  return 0;
1777
1777
  }
1778
1778
 
1779
- async function buildUpdatePayload(args, envPath, { dryRun = false, progress = null } = {}) {
1779
+ async function buildUpdatePayload(
1780
+ args,
1781
+ envPath,
1782
+ { dryRun = false, progress = null, publicKeyPem } = {},
1783
+ ) {
1780
1784
  const isDryRun = Boolean(dryRun);
1781
1785
  const source = manifestUrl(args);
1782
1786
  const manifestResult = await readManifest(source, {
@@ -1785,7 +1789,9 @@ async function buildUpdatePayload(args, envPath, { dryRun = false, progress = nu
1785
1789
  });
1786
1790
  const manifest = manifestResult.manifest;
1787
1791
  const artifact = manifest ? artifactForPlatform(manifest) : null;
1788
- const signature = manifest ? signatureAccepted(manifest, args) : { ok: false, signature: { status: "not-checked", verified: false } };
1792
+ const signature = manifest
1793
+ ? signatureAccepted(manifest, args, { publicKeyPem })
1794
+ : { ok: false, signature: { status: "not-checked", verified: false } };
1789
1795
  const artifactMetadata = manifest ? validateArtifactMetadata(artifact) : { status: "not-checked", ok: false };
1790
1796
  const releaseAssets = manifest ? releaseAssetsForPlatform(manifest, artifact) : [];
1791
1797
  const payload = {
@@ -1870,7 +1876,11 @@ function autoInstallEnabled(args = {}) {
1870
1876
  return true;
1871
1877
  }
1872
1878
 
1873
- async function ensureBrandedEngineInstalled(args = {}, envPath = null, { progress = null } = {}) {
1879
+ async function ensureBrandedEngineInstalled(
1880
+ args = {},
1881
+ envPath = null,
1882
+ { progress = null, publicKeyPem } = {},
1883
+ ) {
1874
1884
  const updateArgs = {
1875
1885
  ...args,
1876
1886
  "fetch-manifest": true,
@@ -1906,7 +1916,7 @@ async function ensureBrandedEngineInstalled(args = {}, envPath = null, { progres
1906
1916
  }
1907
1917
  return { ok: false, installed: false, reason: "manifest-unavailable", manifest_status: manifestResult.status };
1908
1918
  }
1909
- const signature = signatureAccepted(manifest, updateArgs);
1919
+ const signature = signatureAccepted(manifest, updateArgs, { publicKeyPem });
1910
1920
  if (!signature.ok) {
1911
1921
  return { ok: false, installed: false, reason: "manifest-untrusted", signature: signature.signature };
1912
1922
  }
@@ -1923,7 +1933,11 @@ async function ensureBrandedEngineInstalled(args = {}, envPath = null, { progres
1923
1933
  return { ok: false, installed: false, reason: "update-required-auto-install-disabled" };
1924
1934
  }
1925
1935
 
1926
- const payload = await buildUpdatePayload(updateArgs, envPath, { dryRun: false, progress });
1936
+ const payload = await buildUpdatePayload(updateArgs, envPath, {
1937
+ dryRun: false,
1938
+ progress,
1939
+ publicKeyPem,
1940
+ });
1927
1941
  return {
1928
1942
  ok: Boolean(payload.installed && payload.installed.ok),
1929
1943
  installed: Boolean(payload.installed && payload.installed.ok),
@@ -1932,11 +1946,12 @@ async function ensureBrandedEngineInstalled(args = {}, envPath = null, { progres
1932
1946
  };
1933
1947
  }
1934
1948
 
1935
- async function runUpdate(args, envPath) {
1949
+ async function runUpdate(args, envPath, { publicKeyPem } = {}) {
1936
1950
  const dryRun = Boolean(args["dry-run"]);
1937
1951
  const payload = await buildUpdatePayload(args, envPath, {
1938
1952
  dryRun,
1939
1953
  progress: args.json ? null : statusLine,
1954
+ publicKeyPem,
1940
1955
  });
1941
1956
 
1942
1957
  if (args.json) {
@@ -1964,7 +1979,7 @@ async function runUpdate(args, envPath) {
1964
1979
  return 0;
1965
1980
  }
1966
1981
 
1967
- async function run(argv = process.argv.slice(2)) {
1982
+ async function run(argv = process.argv.slice(2), { publicKeyPem } = {}) {
1968
1983
  const envPath = loadEnv();
1969
1984
  const parsed = parseArgs(argv);
1970
1985
  const command = argv[0] || "codex";
@@ -1975,7 +1990,7 @@ async function run(argv = process.argv.slice(2)) {
1975
1990
  return 0;
1976
1991
  }
1977
1992
  if (command === "doctor") return runDoctor(restArgs, envPath);
1978
- if (command === "update") return runUpdate(restArgs, envPath);
1993
+ if (command === "update") return runUpdate(restArgs, envPath, { publicKeyPem });
1979
1994
  if (command === "controller-sidecar") return runControllerSidecar();
1980
1995
  if (command === "version" || command === "--version" || command === "-v") {
1981
1996
  console.log(PACKAGE_VERSION);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mytegroupinc/myte-core",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "Myte CLI core implementation.",
5
5
  "type": "commonjs",
6
6
  "main": "cli.js",