@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.
- package/CHANGELOG.md +17 -0
- package/README.md +481 -278
- package/dist/commands/cicd/cloud/commit.js +7 -2
- package/dist/commands/cicd/extension/create.js +53 -0
- package/dist/commands/cicd/extension/install.js +127 -0
- package/dist/commands/cicd/extension/package.js +35 -0
- package/dist/commands/cicd/extension/publish.js +61 -0
- package/dist/commands/cicd/extension/uninstall.js +99 -0
- package/dist/commands/cicd/extension/validate.js +47 -0
- package/dist/commands/cicd/work/get.js +18 -2
- package/dist/commands/setup/skills/create.js +1 -1
- package/dist/commands/setup/skills/update.js +1 -1
- package/dist/commands/setup.js +1 -1
- package/dist/lib/extension/assets.js +4 -0
- package/dist/lib/extension/create.js +3 -0
- package/dist/lib/extension/git.js +17 -0
- package/dist/lib/extension/index.js +27 -0
- package/dist/lib/extension/install.js +4 -0
- package/dist/lib/extension/manifest.js +21 -0
- package/dist/lib/extension/package.js +3 -0
- package/dist/lib/extension/paths.js +5 -0
- package/dist/lib/extension/publish.js +3 -0
- package/dist/lib/extension/sf-deploy.js +8 -0
- package/dist/lib/extension/source.js +7 -0
- package/dist/lib/extension/uninstall.js +3 -0
- package/dist/lib/function-types.js +3 -1
- package/dist/lib/mcp/work-tools.js +19 -6
- package/dist/lib/project-setup.js +5 -4
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/setup-skills.js +4 -1
- package/dist/lib/setup-templates.js +1 -4
- package/dist/lib/template-types.js +3 -1
- package/dist/lib/work-committed-metadata.js +4 -0
- package/dist/lib/work-get.js +2 -1
- package/oclif.manifest.json +414 -7
- package/package.json +1 -1
- package/templates/rules/cursor/agentia.mdc +29 -0
- package/templates/skills/agentia/SKILL.md +29 -0
- package/templates/skills/agentia-cicd/SKILL.md +3 -1
- package/templates/skills/agentia-cicd/references/extensions.md +49 -0
- package/templates/skills/agentia-cicd/references/work.md +6 -4
- 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};
|
|
@@ -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 {
|
|
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
|
|
130
|
-
|
|
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
|
|
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.
|
|
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
|
-
|
|
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};
|