@getmagical/cli 0.3.0 → 0.3.1
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/dist/index.js +126 -63
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14592,8 +14592,8 @@ var automationRunStartConfigSchema = automationRunConfigBaseSchema.omit({
|
|
|
14592
14592
|
});
|
|
14593
14593
|
|
|
14594
14594
|
// ../common/dist/src/utils/custom-instructions-command.util.js
|
|
14595
|
-
var MAX_CUSTOM_COMMAND_COUNT =
|
|
14596
|
-
var MAX_CUSTOM_INSTRUCTIONS_LENGTH =
|
|
14595
|
+
var MAX_CUSTOM_COMMAND_COUNT = 3;
|
|
14596
|
+
var MAX_CUSTOM_INSTRUCTIONS_LENGTH = 560;
|
|
14597
14597
|
var STANDARD_COMMAND_NAMES = [
|
|
14598
14598
|
"callSpecializedAgent",
|
|
14599
14599
|
"checkpoint",
|
|
@@ -14633,22 +14633,20 @@ function assertCustomInstructionsCommand({ commands, path: path9 }) {
|
|
|
14633
14633
|
return;
|
|
14634
14634
|
}
|
|
14635
14635
|
if (customCommands.length > MAX_CUSTOM_COMMAND_COUNT) {
|
|
14636
|
-
throw createInvalidValueError(`${path9} contains ${customCommands.length.toString()} custom commands. Use at most
|
|
14636
|
+
throw createInvalidValueError(`${path9} contains ${customCommands.length.toString()} custom commands. Use at most ${MAX_CUSTOM_COMMAND_COUNT.toString()} short custom commands per agent. Split policy, decision, outreach, and multi-step work into catalog commands or child agents instead.`);
|
|
14637
14637
|
}
|
|
14638
|
-
const
|
|
14639
|
-
|
|
14640
|
-
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
|
|
14645
|
-
|
|
14646
|
-
|
|
14647
|
-
|
|
14648
|
-
|
|
14649
|
-
|
|
14650
|
-
if (mentionedCommand !== null) {
|
|
14651
|
-
throw createInvalidValueError(`${customCommand.path}.arguments.instructions mentions "${mentionedCommand}". Use the "${mentionedCommand}" catalog command directly instead of wrapping it in custom prose.`);
|
|
14638
|
+
for (const customCommand of customCommands) {
|
|
14639
|
+
const instructions = getCustomInstructions(customCommand.command);
|
|
14640
|
+
if (instructions.length === 0) {
|
|
14641
|
+
throw createInvalidValueError(`${customCommand.path}.arguments.instructions must be a non-empty string for custom commands.`);
|
|
14642
|
+
}
|
|
14643
|
+
if (instructions.length > MAX_CUSTOM_INSTRUCTIONS_LENGTH) {
|
|
14644
|
+
throw createInvalidValueError(`${customCommand.path}.arguments.instructions is ${instructions.length.toString()} characters. Custom commands must be short single-action instructions (max ${MAX_CUSTOM_INSTRUCTIONS_LENGTH.toString()} chars). Move policy/template/context text into description, inputSchema, or child agents, and express executable work with catalog commands.`);
|
|
14645
|
+
}
|
|
14646
|
+
const mentionedCommand = getMentionedStandardCommand(instructions);
|
|
14647
|
+
if (mentionedCommand !== null) {
|
|
14648
|
+
throw createInvalidValueError(`${customCommand.path}.arguments.instructions mentions "${mentionedCommand}". Use the "${mentionedCommand}" catalog command directly instead of wrapping it in custom prose.`);
|
|
14649
|
+
}
|
|
14652
14650
|
}
|
|
14653
14651
|
}
|
|
14654
14652
|
|
|
@@ -14997,6 +14995,60 @@ var agentLimitationsSelection = ` limitations {
|
|
|
14997
14995
|
maxToolCalls
|
|
14998
14996
|
allowedUrlRegexes
|
|
14999
14997
|
}`;
|
|
14998
|
+
var automationRunsInputSchema = z27.object({
|
|
14999
|
+
automationId: z27.string().min(1).optional(),
|
|
15000
|
+
from: z27.string().min(1).optional(),
|
|
15001
|
+
status: z27.array(z27.string().min(1)).optional(),
|
|
15002
|
+
invocationType: z27.array(z27.string().min(1)).optional(),
|
|
15003
|
+
limit: z27.number().int().positive().optional(),
|
|
15004
|
+
orderBy: z27.enum(["createdAtAsc", "createdAtDesc", "random"]).optional(),
|
|
15005
|
+
page: z27.number().int().nonnegative().optional(),
|
|
15006
|
+
to: z27.string().min(1).optional()
|
|
15007
|
+
}).refine(({ orderBy, page }) => orderBy !== "random" || (page ?? 0) === 0, {
|
|
15008
|
+
message: "Random ordering reshuffles on every call, so --page cannot be combined with --order-by random."
|
|
15009
|
+
});
|
|
15010
|
+
var automationRunsCliOptions = [
|
|
15011
|
+
stringOption({
|
|
15012
|
+
inputKey: "automationId",
|
|
15013
|
+
flagName: "automation-id",
|
|
15014
|
+
description: "Optional automation ID."
|
|
15015
|
+
}),
|
|
15016
|
+
stringOption({
|
|
15017
|
+
inputKey: "from",
|
|
15018
|
+
flagName: "from",
|
|
15019
|
+
description: "Optional inclusive createdAt lower bound ISO timestamp."
|
|
15020
|
+
}),
|
|
15021
|
+
stringArrayOption({
|
|
15022
|
+
inputKey: "status",
|
|
15023
|
+
flagName: "status",
|
|
15024
|
+
description: "Optional run statuses."
|
|
15025
|
+
}),
|
|
15026
|
+
stringArrayOption({
|
|
15027
|
+
inputKey: "invocationType",
|
|
15028
|
+
flagName: "invocation-type",
|
|
15029
|
+
description: "Optional invocation types."
|
|
15030
|
+
}),
|
|
15031
|
+
numberOption({
|
|
15032
|
+
inputKey: "limit",
|
|
15033
|
+
flagName: "limit",
|
|
15034
|
+
description: "Maximum number of runs to return."
|
|
15035
|
+
}),
|
|
15036
|
+
stringOption({
|
|
15037
|
+
inputKey: "orderBy",
|
|
15038
|
+
flagName: "order-by",
|
|
15039
|
+
description: "Run ordering. Use random for sampling; it reshuffles on every call."
|
|
15040
|
+
}),
|
|
15041
|
+
numberOption({
|
|
15042
|
+
inputKey: "page",
|
|
15043
|
+
flagName: "page",
|
|
15044
|
+
description: "Zero-based page number."
|
|
15045
|
+
}),
|
|
15046
|
+
stringOption({
|
|
15047
|
+
inputKey: "to",
|
|
15048
|
+
flagName: "to",
|
|
15049
|
+
description: "Optional inclusive createdAt upper bound ISO timestamp."
|
|
15050
|
+
})
|
|
15051
|
+
];
|
|
15000
15052
|
var operationSpecs = [
|
|
15001
15053
|
createOperationSpec({
|
|
15002
15054
|
operationName: "GetCaptureContext",
|
|
@@ -15686,57 +15738,13 @@ query InspectPausedAutomationStep($runId: ID!) {
|
|
|
15686
15738
|
createOperationSpec({
|
|
15687
15739
|
operationName: "GetAutomationRuns",
|
|
15688
15740
|
kind: "query",
|
|
15689
|
-
inputSchema:
|
|
15690
|
-
automationId: z27.string().min(1).optional(),
|
|
15691
|
-
from: z27.string().min(1).optional(),
|
|
15692
|
-
status: z27.array(z27.string().min(1)).optional(),
|
|
15693
|
-
invocationType: z27.array(z27.string().min(1)).optional(),
|
|
15694
|
-
limit: z27.number().int().positive().optional(),
|
|
15695
|
-
page: z27.number().int().nonnegative().optional(),
|
|
15696
|
-
to: z27.string().min(1).optional()
|
|
15697
|
-
}),
|
|
15741
|
+
inputSchema: automationRunsInputSchema,
|
|
15698
15742
|
cli: {
|
|
15699
15743
|
name: "get-automation-runs",
|
|
15700
15744
|
path: ["automation-runs", "list"],
|
|
15701
15745
|
description: "Fetch automation run history.",
|
|
15702
15746
|
resultKey: "automationRuns",
|
|
15703
|
-
options:
|
|
15704
|
-
stringOption({
|
|
15705
|
-
inputKey: "automationId",
|
|
15706
|
-
flagName: "automation-id",
|
|
15707
|
-
description: "Optional automation ID."
|
|
15708
|
-
}),
|
|
15709
|
-
stringOption({
|
|
15710
|
-
inputKey: "from",
|
|
15711
|
-
flagName: "from",
|
|
15712
|
-
description: "Optional inclusive createdAt lower bound ISO timestamp."
|
|
15713
|
-
}),
|
|
15714
|
-
stringArrayOption({
|
|
15715
|
-
inputKey: "status",
|
|
15716
|
-
flagName: "status",
|
|
15717
|
-
description: "Optional run statuses."
|
|
15718
|
-
}),
|
|
15719
|
-
stringArrayOption({
|
|
15720
|
-
inputKey: "invocationType",
|
|
15721
|
-
flagName: "invocation-type",
|
|
15722
|
-
description: "Optional invocation types."
|
|
15723
|
-
}),
|
|
15724
|
-
numberOption({
|
|
15725
|
-
inputKey: "limit",
|
|
15726
|
-
flagName: "limit",
|
|
15727
|
-
description: "Maximum number of runs to return."
|
|
15728
|
-
}),
|
|
15729
|
-
numberOption({
|
|
15730
|
-
inputKey: "page",
|
|
15731
|
-
flagName: "page",
|
|
15732
|
-
description: "Zero-based page number."
|
|
15733
|
-
}),
|
|
15734
|
-
stringOption({
|
|
15735
|
-
inputKey: "to",
|
|
15736
|
-
flagName: "to",
|
|
15737
|
-
description: "Optional inclusive createdAt upper bound ISO timestamp."
|
|
15738
|
-
})
|
|
15739
|
-
]
|
|
15747
|
+
options: automationRunsCliOptions
|
|
15740
15748
|
},
|
|
15741
15749
|
mcp: { fileName: "automationRuns.graphql" },
|
|
15742
15750
|
document: `# Query automation run history with optional automation and time-window filters
|
|
@@ -15746,6 +15754,7 @@ query GetAutomationRuns(
|
|
|
15746
15754
|
$status: [RunStatus!]
|
|
15747
15755
|
$invocationType: [InvocationType!]
|
|
15748
15756
|
$limit: Int
|
|
15757
|
+
$orderBy: AutomationRunOrderBy
|
|
15749
15758
|
$page: Int
|
|
15750
15759
|
$to: String
|
|
15751
15760
|
) {
|
|
@@ -15755,6 +15764,7 @@ query GetAutomationRuns(
|
|
|
15755
15764
|
status: $status
|
|
15756
15765
|
invocationType: $invocationType
|
|
15757
15766
|
limit: $limit
|
|
15767
|
+
orderBy: $orderBy
|
|
15758
15768
|
page: $page
|
|
15759
15769
|
to: $to
|
|
15760
15770
|
) {
|
|
@@ -15770,6 +15780,59 @@ query GetAutomationRuns(
|
|
|
15770
15780
|
pausedAt
|
|
15771
15781
|
finishedAt
|
|
15772
15782
|
}
|
|
15783
|
+
}`
|
|
15784
|
+
}),
|
|
15785
|
+
createOperationSpec({
|
|
15786
|
+
operationName: "GetAutomationRunsPage",
|
|
15787
|
+
kind: "query",
|
|
15788
|
+
inputSchema: automationRunsInputSchema,
|
|
15789
|
+
cli: {
|
|
15790
|
+
name: "get-automation-runs-page",
|
|
15791
|
+
path: ["automation-runs", "list-page"],
|
|
15792
|
+
description: "Fetch automation run history with bounded total metadata. When isTotalTruncated is true, total is a lower bound.",
|
|
15793
|
+
resultKey: "automationRunsPage",
|
|
15794
|
+
options: automationRunsCliOptions
|
|
15795
|
+
},
|
|
15796
|
+
mcp: { fileName: "automationRunsPage.graphql" },
|
|
15797
|
+
document: `# Query automation run history with optional filters and a bounded total
|
|
15798
|
+
query GetAutomationRunsPage(
|
|
15799
|
+
$automationId: ID
|
|
15800
|
+
$from: String
|
|
15801
|
+
$status: [RunStatus!]
|
|
15802
|
+
$invocationType: [InvocationType!]
|
|
15803
|
+
$limit: Int
|
|
15804
|
+
$orderBy: AutomationRunOrderBy
|
|
15805
|
+
$page: Int
|
|
15806
|
+
$to: String
|
|
15807
|
+
) {
|
|
15808
|
+
automationRunsPage(
|
|
15809
|
+
automationId: $automationId
|
|
15810
|
+
from: $from
|
|
15811
|
+
status: $status
|
|
15812
|
+
invocationType: $invocationType
|
|
15813
|
+
limit: $limit
|
|
15814
|
+
orderBy: $orderBy
|
|
15815
|
+
page: $page
|
|
15816
|
+
to: $to
|
|
15817
|
+
) {
|
|
15818
|
+
items {
|
|
15819
|
+
id
|
|
15820
|
+
automationId
|
|
15821
|
+
parentAutomationRunId
|
|
15822
|
+
status
|
|
15823
|
+
statusDetail
|
|
15824
|
+
invocationType
|
|
15825
|
+
summary
|
|
15826
|
+
createdAt
|
|
15827
|
+
startedAt
|
|
15828
|
+
pausedAt
|
|
15829
|
+
finishedAt
|
|
15830
|
+
}
|
|
15831
|
+
total
|
|
15832
|
+
page
|
|
15833
|
+
pageSize
|
|
15834
|
+
isTotalTruncated
|
|
15835
|
+
}
|
|
15773
15836
|
}`
|
|
15774
15837
|
}),
|
|
15775
15838
|
createOperationSpec({
|