@copado/agentia-cli 1.0.0 → 1.1.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 (42) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +481 -278
  3. package/dist/commands/cicd/cloud/commit.js +7 -2
  4. package/dist/commands/cicd/extension/create.js +53 -0
  5. package/dist/commands/cicd/extension/install.js +127 -0
  6. package/dist/commands/cicd/extension/package.js +35 -0
  7. package/dist/commands/cicd/extension/publish.js +61 -0
  8. package/dist/commands/cicd/extension/uninstall.js +99 -0
  9. package/dist/commands/cicd/extension/validate.js +47 -0
  10. package/dist/commands/cicd/work/get.js +18 -2
  11. package/dist/commands/setup/skills/create.js +1 -1
  12. package/dist/commands/setup/skills/update.js +1 -1
  13. package/dist/commands/setup.js +1 -1
  14. package/dist/lib/extension/assets.js +4 -0
  15. package/dist/lib/extension/create.js +3 -0
  16. package/dist/lib/extension/git.js +17 -0
  17. package/dist/lib/extension/index.js +27 -0
  18. package/dist/lib/extension/install.js +4 -0
  19. package/dist/lib/extension/manifest.js +21 -0
  20. package/dist/lib/extension/package.js +3 -0
  21. package/dist/lib/extension/paths.js +5 -0
  22. package/dist/lib/extension/publish.js +3 -0
  23. package/dist/lib/extension/sf-deploy.js +8 -0
  24. package/dist/lib/extension/source.js +7 -0
  25. package/dist/lib/extension/uninstall.js +3 -0
  26. package/dist/lib/function-types.js +3 -1
  27. package/dist/lib/mcp/work-tools.js +19 -6
  28. package/dist/lib/project-setup.js +5 -4
  29. package/dist/lib/runtime.js +1 -1
  30. package/dist/lib/setup-skills.js +4 -1
  31. package/dist/lib/setup-templates.js +1 -4
  32. package/dist/lib/template-types.js +3 -1
  33. package/dist/lib/work-committed-metadata.js +4 -0
  34. package/dist/lib/work-get.js +2 -1
  35. package/oclif.manifest.json +414 -7
  36. package/package.json +1 -1
  37. package/templates/rules/cursor/agentia.mdc +29 -0
  38. package/templates/skills/agentia/SKILL.md +29 -0
  39. package/templates/skills/agentia-cicd/SKILL.md +3 -1
  40. package/templates/skills/agentia-cicd/references/extensions.md +49 -0
  41. package/templates/skills/agentia-cicd/references/work.md +6 -4
  42. package/templates/AGENTS.md +0 -24
@@ -0,0 +1,8 @@
1
+ import {modules} from '../runtime.js';
2
+ const assertSafeSfAlias = modules["extension/sf-deploy.js"]["assertSafeSfAlias"]
3
+ const deployExtensionSalesforceSource = modules["extension/sf-deploy.js"]["deployExtensionSalesforceSource"]
4
+ const extensionSourceDeployArgs = modules["extension/sf-deploy.js"]["extensionSourceDeployArgs"]
5
+ const resetExtensionSfDeployExecForTests = modules["extension/sf-deploy.js"]["resetExtensionSfDeployExecForTests"]
6
+ const sanitizeDeployOutput = modules["extension/sf-deploy.js"]["sanitizeDeployOutput"]
7
+ const setExtensionSfDeployExecForTests = modules["extension/sf-deploy.js"]["setExtensionSfDeployExecForTests"]
8
+ export {assertSafeSfAlias, deployExtensionSalesforceSource, extensionSourceDeployArgs, resetExtensionSfDeployExecForTests, sanitizeDeployOutput, setExtensionSfDeployExecForTests};
@@ -0,0 +1,7 @@
1
+ import {modules} from '../runtime.js';
2
+ const assertSafeGitUrl = modules["extension/source.js"]["assertSafeGitUrl"]
3
+ const localPathAsFileUrl = modules["extension/source.js"]["localPathAsFileUrl"]
4
+ const materializeExtensionSource = modules["extension/source.js"]["materializeExtensionSource"]
5
+ const normalizeRemoteGitUrl = modules["extension/source.js"]["normalizeRemoteGitUrl"]
6
+ const resolveLocalExtensionPath = modules["extension/source.js"]["resolveLocalExtensionPath"]
7
+ export {assertSafeGitUrl, localPathAsFileUrl, materializeExtensionSource, normalizeRemoteGitUrl, resolveLocalExtensionPath};
@@ -0,0 +1,3 @@
1
+ import {modules} from '../runtime.js';
2
+ const uninstallExtension = modules["extension/uninstall.js"]["uninstallExtension"]
3
+ export {uninstallExtension};
@@ -1,8 +1,10 @@
1
1
  import {modules} from './runtime.js';
2
+ const FUNCTION_DISK_DIR = modules["function-types.js"]["FUNCTION_DISK_DIR"]
2
3
  const FUNCTION_EXTENSIONS = modules["function-types.js"]["FUNCTION_EXTENSIONS"]
3
4
  const FUNCTION_LIST_TYPES = modules["function-types.js"]["FUNCTION_LIST_TYPES"]
4
5
  const FUNCTION_RUNTIMES = modules["function-types.js"]["FUNCTION_RUNTIMES"]
5
6
  const FUNCTION_RUNTIME_EXTENSION = modules["function-types.js"]["FUNCTION_RUNTIME_EXTENSION"]
7
+ const FUNCTION_UPSERT_RESPONSE_ONLY_KEYS = modules["function-types.js"]["FUNCTION_UPSERT_RESPONSE_ONLY_KEYS"]
6
8
  const formatFunctionDetail = modules["function-types.js"]["formatFunctionDetail"]
7
9
  const formatFunctionResultStatus = modules["function-types.js"]["formatFunctionResultStatus"]
8
10
  const formatFunctionRunResult = modules["function-types.js"]["formatFunctionRunResult"]
@@ -19,4 +21,4 @@ const normalizeFunctionUpsertPayload = modules["function-types.js"]["normalizeFu
19
21
  const normalizeFunctionsList = modules["function-types.js"]["normalizeFunctionsList"]
20
22
  const normalizeFunctionsListPage = modules["function-types.js"]["normalizeFunctionsListPage"]
21
23
  const parseParameterAssignments = modules["function-types.js"]["parseParameterAssignments"]
22
- export {FUNCTION_EXTENSIONS, FUNCTION_LIST_TYPES, FUNCTION_RUNTIMES, FUNCTION_RUNTIME_EXTENSION, formatFunctionDetail, formatFunctionResultStatus, formatFunctionRunResult, formatFunctionTable, functionEndpoint, functionResultEndpoint, functionResultLogEndpoint, functionRunEndpoint, functionsEndpoint, normalizeFunction, normalizeFunctionResultStatus, normalizeFunctionRunResult, normalizeFunctionUpsertPayload, normalizeFunctionsList, normalizeFunctionsListPage, parseParameterAssignments};
24
+ export {FUNCTION_DISK_DIR, FUNCTION_EXTENSIONS, FUNCTION_LIST_TYPES, FUNCTION_RUNTIMES, FUNCTION_RUNTIME_EXTENSION, FUNCTION_UPSERT_RESPONSE_ONLY_KEYS, formatFunctionDetail, formatFunctionResultStatus, formatFunctionRunResult, formatFunctionTable, functionEndpoint, functionResultEndpoint, functionResultLogEndpoint, functionRunEndpoint, functionsEndpoint, normalizeFunction, normalizeFunctionResultStatus, normalizeFunctionRunResult, normalizeFunctionUpsertPayload, normalizeFunctionsList, normalizeFunctionsListPage, parseParameterAssignments};
@@ -18,7 +18,7 @@ import { DEFAULT_APEX_TEST_WAIT_MINUTES, parseApexTestClassNames, runWorkApexTes
18
18
  import { buildWorkCommitRequest, normalizeWorkCommitInput, performWorkCommit, resolveWorkCommitPlatformExperience, WORK_COMMIT_ACTIONS, WORK_COMMIT_CHANGES_HELP, WORK_COMMIT_DEFAULT_TIMEOUT_SECONDS, WORK_COMMIT_METADATA_CATEGORY_HELP, } from '../work-commit.js';
19
19
  import { buildWorkCreatePayload } from '../work-defaults.js';
20
20
  import { validateWorkMutationPayload, WORK_LONG_TEXT_MAX_LENGTH, WORK_SHORT_TEXT_MAX_LENGTH, } from '../work-flags.js';
21
- import { fetchWorkItem, fetchWorkItems } from '../work-get.js';
21
+ import { fetchWorkItems, fetchWorkItemWithOptions } from '../work-get.js';
22
22
  import { performWorkLocalCommit } from '../work-local-commit.js';
23
23
  import { reportLocalQualityGatesFailure, reportLocalQualityGatesOutcome, } from '../work-local-run-tests.js';
24
24
  import { capturingWorkPushHooks, performWorkPush, resolveActiveFeatureWorkItem, resolveWorkPushContext, resolveWorkPushNeed, uploadCapturedPublishLogsBestEffort, } from '../work-push.js';
@@ -126,8 +126,13 @@ async function workList(args = {}) {
126
126
  return mcpPaginatedListPayload('userStories', await fetchWorkItems(filters));
127
127
  }
128
128
  async function workGet(args = {}) {
129
- const userStory = await fetchWorkItem(args.id);
130
- return { userStory };
129
+ const { committedMetadata, userStory } = await fetchWorkItemWithOptions(args.id, {
130
+ committedMetadata: args.committedMetadata === true,
131
+ });
132
+ return {
133
+ userStory,
134
+ ...(committedMetadata === undefined ? {} : { committedMetadata }),
135
+ };
131
136
  }
132
137
  async function workCreate(args = {}) {
133
138
  const explicitPayload = buildWorkMutationPayloadFromArgs(args);
@@ -522,7 +527,11 @@ async function cloudCommit(args = {}) {
522
527
  throw new Error('Use changes or simple metadata fields, not both.');
523
528
  }
524
529
  if (args.changes === undefined && !hasMcpSimpleCommitArgs(args)) {
525
- throw new Error('Requires simple metadata fields such as metadataName and metadataType, or changes input.');
530
+ throw new Error('Requires simple metadata fields such as metadataName, metadataType, and metadataCategory, or changes input.');
531
+ }
532
+ if (args.changes === undefined &&
533
+ (args.metadataCategory === undefined || args.metadataCategory.trim().length === 0)) {
534
+ throw new Error('metadataCategory is required.');
526
535
  }
527
536
  const workItemId = await resolveWorkItemId(args.id);
528
537
  const request = buildWorkCommitRequest(buildMcpWorkCommitInput(args), {
@@ -657,8 +666,12 @@ export function registerAgentiaMcpWorkTools(server) {
657
666
  title: 'Agentia Work List',
658
667
  }, (args) => safelyHandleTool(() => workList(args || {})));
659
668
  server.registerTool('agentia_work_get', {
660
- description: 'Get a Copado user story by Id via the CICD gateway. Omit Id to use the active work item from work set.',
669
+ description: 'Get a Copado user story by Id via the CICD gateway. Omit Id to use the active work item from work set. Set committedMetadata=true to also include the Story committed metadata list.',
661
670
  inputSchema: {
671
+ committedMetadata: z
672
+ .boolean()
673
+ .optional()
674
+ .describe('When true, also include the Story committed metadata list as committedMetadata in the result.'),
662
675
  id: z.string().optional().describe('User story Id. Defaults to the active work item from work set.'),
663
676
  },
664
677
  title: 'Agentia Work Get',
@@ -782,7 +795,7 @@ export function registerAgentiaMcpWorkTools(server) {
782
795
  .describe(`Maximum total wait in seconds. Defaults to ${PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS}.`),
783
796
  };
784
797
  server.registerTool('agentia_cloud_commit', {
785
- description: 'Create a Copado cloud metadata commit. Preflights the user story, submits POST /release/commit, and optionally waits for the job. Use simple metadata fields for one change or changes for multi-change requests. For Salesforce metadata, set metadataCategory to SFDX (or c: "SFDX" on each changes entry); Copado SFDX deploy skips entries that omit that field. For local Git work, use git commit then agentia_work_publish; pass permissions and fullMetadata on agentia_work_publish.',
798
+ description: 'Create a Copado cloud metadata commit. Preflights the user story, submits POST /release/commit, and optionally waits for the job. Use simple metadata fields for one change or changes for multi-change requests. metadataCategory is required for simple input; each changes entry requires c (or category). For Salesforce metadata, set metadataCategory/c to SFDX; Copado SFDX deploy skips entries that omit that field. For local Git work, use git commit then agentia_work_publish; pass permissions and fullMetadata on agentia_work_publish.',
786
799
  inputSchema: cloudCommitInputSchema,
787
800
  title: 'Agentia Cloud Commit',
788
801
  }, (args) => safelyHandleTool(() => cloudCommit(args || {})));
@@ -1,13 +1,14 @@
1
1
  import {modules} from './runtime.js';
2
+ const LEGACY_AGENTIA_AGENTS_END_MARKER = modules["project-setup.js"]["LEGACY_AGENTIA_AGENTS_END_MARKER"]
3
+ const LEGACY_AGENTIA_AGENTS_START_MARKER = modules["project-setup.js"]["LEGACY_AGENTIA_AGENTS_START_MARKER"]
2
4
  const createLocalQualityGateScripts = modules["project-setup.js"]["createLocalQualityGateScripts"]
3
5
  const ensureAgentiaGitignore = modules["project-setup.js"]["ensureAgentiaGitignore"]
4
- const findAgentsMd = modules["project-setup.js"]["findAgentsMd"]
5
6
  const findLocalQualityGateScripts = modules["project-setup.js"]["findLocalQualityGateScripts"]
6
7
  const gitignoreHasAgentiaEntry = modules["project-setup.js"]["gitignoreHasAgentiaEntry"]
8
+ const legacyAgentiaSectionRemovalMessage = modules["project-setup.js"]["legacyAgentiaSectionRemovalMessage"]
9
+ const removeLegacyAgentiaSection = modules["project-setup.js"]["removeLegacyAgentiaSection"]
7
10
  const resetProjectSetupDepsForTests = modules["project-setup.js"]["resetProjectSetupDepsForTests"]
8
- const resolveAgentsMdContent = modules["project-setup.js"]["resolveAgentsMdContent"]
9
11
  const resolveProjectContext = modules["project-setup.js"]["resolveProjectContext"]
10
12
  const runProjectSetup = modules["project-setup.js"]["runProjectSetup"]
11
13
  const setProjectSetupDepsForTests = modules["project-setup.js"]["setProjectSetupDepsForTests"]
12
- const writeAgentsMd = modules["project-setup.js"]["writeAgentsMd"]
13
- export {createLocalQualityGateScripts, ensureAgentiaGitignore, findAgentsMd, findLocalQualityGateScripts, gitignoreHasAgentiaEntry, resetProjectSetupDepsForTests, resolveAgentsMdContent, resolveProjectContext, runProjectSetup, setProjectSetupDepsForTests, writeAgentsMd};
14
+ export {LEGACY_AGENTIA_AGENTS_END_MARKER, LEGACY_AGENTIA_AGENTS_START_MARKER, createLocalQualityGateScripts, ensureAgentiaGitignore, findLocalQualityGateScripts, gitignoreHasAgentiaEntry, legacyAgentiaSectionRemovalMessage, removeLegacyAgentiaSection, resetProjectSetupDepsForTests, resolveProjectContext, runProjectSetup, setProjectSetupDepsForTests};