apcore-cli 0.8.1 → 0.9.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/CHANGELOG.md +70 -0
- package/README.md +16 -12
- package/dist/bin/apcore-cli.js +173 -81
- package/dist/bin/apcore-cli.js.map +1 -1
- package/dist/index.d.ts +56 -6
- package/dist/index.js +174 -81
- package/dist/index.js.map +1 -1
- package/package.json +3 -8
package/dist/index.d.ts
CHANGED
|
@@ -69,6 +69,13 @@ type ApcliConfig = boolean | {
|
|
|
69
69
|
exclude?: string[];
|
|
70
70
|
disableEnv?: boolean;
|
|
71
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* Default name of the built-in command group. Overridable per ApcliGroup
|
|
74
|
+
* instance via the `name` constructor option, or via createCli's
|
|
75
|
+
* `builtinGroupName` option. Cross-SDK parity with Python
|
|
76
|
+
* `DEFAULT_BUILTIN_GROUP_NAME` (2026-05-08).
|
|
77
|
+
*/
|
|
78
|
+
declare const DEFAULT_BUILTIN_GROUP_NAME = "apcli";
|
|
72
79
|
/**
|
|
73
80
|
* Set of group names reserved by apcore-cli when no rename is configured.
|
|
74
81
|
* Default mirrors {@link DEFAULT_BUILTIN_GROUP_NAME}; when `builtinGroupName`
|
|
@@ -76,6 +83,16 @@ type ApcliConfig = boolean | {
|
|
|
76
83
|
* is applied per-instance during the cli.ts collision check.
|
|
77
84
|
*/
|
|
78
85
|
declare const RESERVED_GROUP_NAMES: ReadonlySet<string>;
|
|
86
|
+
/**
|
|
87
|
+
* Canonical set of apcli subcommand names.
|
|
88
|
+
*
|
|
89
|
+
* Declarative mirror of the registration TABLE in `src/main.ts`
|
|
90
|
+
* (`_registerApcliSubcommands`). Used by `_normalizeList` to warn on
|
|
91
|
+
* unknown entries in include/exclude lists (spec §7 error table / T-APCLI-25).
|
|
92
|
+
*
|
|
93
|
+
* Keep in sync with main.ts TABLE if subcommands are added or removed.
|
|
94
|
+
*/
|
|
95
|
+
declare const APCLI_SUBCOMMAND_NAMES: ReadonlySet<string>;
|
|
79
96
|
/**
|
|
80
97
|
* Visibility configuration for the built-in `apcli` command group.
|
|
81
98
|
*
|
|
@@ -178,7 +195,7 @@ declare class ApcliGroup {
|
|
|
178
195
|
* Protocol spec: CLI command structure & lazy loading
|
|
179
196
|
*/
|
|
180
197
|
|
|
181
|
-
/**
|
|
198
|
+
/** CLI-internal Registry shim (see D9-W2 note above). */
|
|
182
199
|
interface Registry {
|
|
183
200
|
listModules(): ModuleDescriptor[];
|
|
184
201
|
getModule(moduleId: string): ModuleDescriptor | null;
|
|
@@ -375,7 +392,9 @@ declare class GroupedModuleGroup extends LazyModuleGroup {
|
|
|
375
392
|
*/
|
|
376
393
|
declare function validateModuleId(moduleId: string): void;
|
|
377
394
|
|
|
378
|
-
/** Set the
|
|
395
|
+
/** Set the all-options help flag. When false, built-in options are hidden from help. */
|
|
396
|
+
declare function setAllOptionsHelp(allOptions: boolean): void;
|
|
397
|
+
/** @deprecated Use {@link setAllOptionsHelp} instead. Kept for backward compatibility. */
|
|
379
398
|
declare function setVerboseHelp(verbose: boolean): void;
|
|
380
399
|
/**
|
|
381
400
|
* Set the base URL for online documentation links shown in help and man pages.
|
|
@@ -417,6 +436,12 @@ interface APCore {
|
|
|
417
436
|
interface CreateCliOptions {
|
|
418
437
|
extensionsDir?: string;
|
|
419
438
|
progName?: string;
|
|
439
|
+
/**
|
|
440
|
+
* Show all options in help output (controls `--all-options` behaviour;
|
|
441
|
+
* parameter was named `verbose` prior to v0.9.0).
|
|
442
|
+
*/
|
|
443
|
+
allOptions?: boolean;
|
|
444
|
+
/** @deprecated Use {@link allOptions} instead. Kept for backward compatibility with pre-v0.9.0 callers. */
|
|
420
445
|
verbose?: boolean;
|
|
421
446
|
/**
|
|
422
447
|
* APCore unified client instance (apcore-js >= 0.18.0).
|
|
@@ -493,9 +518,10 @@ interface CreateCliOptions {
|
|
|
493
518
|
*
|
|
494
519
|
* @param extensionsDirOrOpts Path to extensions directory, or a CreateCliOptions object.
|
|
495
520
|
* @param progName Program name shown in help (default: apcore-cli)
|
|
496
|
-
* @param
|
|
521
|
+
* @param allOptions Show all options in help output (controls `--all-options` behaviour;
|
|
522
|
+
* parameter was named `verbose` prior to v0.9.0)
|
|
497
523
|
*/
|
|
498
|
-
declare function createCli(extensionsDirOrOpts?: string | CreateCliOptions, progName?: string,
|
|
524
|
+
declare function createCli(extensionsDirOrOpts?: string | CreateCliOptions, progName?: string, allOptions?: boolean): Command;
|
|
499
525
|
/** Options bag for {@link applyToolkitIntegration}. */
|
|
500
526
|
interface ApplyToolkitIntegrationOptions {
|
|
501
527
|
/**
|
|
@@ -824,6 +850,19 @@ declare class ApprovalDeniedError extends Error {
|
|
|
824
850
|
}
|
|
825
851
|
/** Thrown when schema validation fails. */
|
|
826
852
|
declare class SchemaValidationError extends Error {
|
|
853
|
+
readonly code = "SCHEMA_VALIDATION_ERROR";
|
|
854
|
+
constructor(message?: string);
|
|
855
|
+
}
|
|
856
|
+
/** Thrown when $ref resolution depth exceeds the configured maximum. */
|
|
857
|
+
declare class MaxDepthExceededError extends Error {
|
|
858
|
+
constructor(message?: string);
|
|
859
|
+
}
|
|
860
|
+
/** Thrown when a circular $ref is detected during schema resolution. */
|
|
861
|
+
declare class CircularRefError extends Error {
|
|
862
|
+
constructor(message?: string);
|
|
863
|
+
}
|
|
864
|
+
/** Thrown when a $ref target cannot be found in $defs/definitions. */
|
|
865
|
+
declare class UnresolvableRefError extends Error {
|
|
827
866
|
constructor(message?: string);
|
|
828
867
|
}
|
|
829
868
|
/** Thrown when a module is not found. */
|
|
@@ -950,8 +989,19 @@ declare class ConfigEncryptor {
|
|
|
950
989
|
*/
|
|
951
990
|
declare class AuthProvider {
|
|
952
991
|
private readonly config;
|
|
953
|
-
private readonly
|
|
992
|
+
private readonly _encryptor?;
|
|
954
993
|
constructor(config: ConfigResolver, encryptor?: ConfigEncryptor);
|
|
994
|
+
/**
|
|
995
|
+
* Resolve the active ConfigEncryptor instance.
|
|
996
|
+
*
|
|
997
|
+
* D11-005 (2026-05-12): three-tier fallback chain matching Python's
|
|
998
|
+
* `_get_encryptor` (auth.py:33): explicit constructor arg > peer attribute
|
|
999
|
+
* `config.encryptor` (set by embedders injecting forced-AES test fixtures
|
|
1000
|
+
* or shared instances) > fresh `new ConfigEncryptor()`. Previously TS
|
|
1001
|
+
* skipped the peer-attribute tier, silently giving embedders a different
|
|
1002
|
+
* encryptor than the one they wired on the config.
|
|
1003
|
+
*/
|
|
1004
|
+
private getEncryptor;
|
|
955
1005
|
/**
|
|
956
1006
|
* Retrieve the API key from the configured sources.
|
|
957
1007
|
* Handles keyring: and enc: prefixes via ConfigEncryptor.
|
|
@@ -1027,4 +1077,4 @@ declare class Sandbox {
|
|
|
1027
1077
|
private _sandboxedExecute;
|
|
1028
1078
|
}
|
|
1029
1079
|
|
|
1030
|
-
export { type APCore, type ApcliConfig, ApcliGroup, ApcliGroupError, type ApcliMode, type ApplyToolkitIntegrationOptions, ApprovalDeniedError, ApprovalTimeoutError, AuditLogger, AuthProvider, AuthenticationError, CliApprovalHandler, ConfigDecryptionError, ConfigEncryptor, ConfigResolver, type CreateCliOptions, DEFAULTS, EXIT_CODES, type Executor, type ExitCode, ExposureFilter, GroupedModuleGroup, LazyGroup, LazyModuleGroup, type ModuleDescriptor, ModuleExecutionError, ModuleNotFoundError, type OptionConfig, type PipelineTrace, type PipelineTraceStep, type PreflightCheck, type PreflightResult, RESERVED_GROUP_NAMES, type Registry, Sandbox, SchemaValidationError, type StrategyInfo, type StrategyStep, applyToolkitIntegration, buildModuleCommand, checkApproval, collectInput, configureManHelp, createCli, exitCodeForError, formatExecResult, formatModuleDetail, formatModuleList, getAuditLogger, getLogLevel, main, reconvertEnumValues, registerCompletionCommand, registerConfigCommand, registerConfigNamespace, registerDescribeCommand, registerDisableCommand, registerEnableCommand, registerExecCommand, registerHealthCommand, registerInitCommand, registerListCommand, registerPipelineCommand, registerReloadCommand, registerUsageCommand, registerValidateCommand, resolveFormat, resolveRefs, schemaToCliOptions, setAuditLogger, setDocsUrl, setLogLevel, setVerboseHelp, validateModuleId };
|
|
1080
|
+
export { APCLI_SUBCOMMAND_NAMES, type APCore, type ApcliConfig, ApcliGroup, ApcliGroupError, type ApcliMode, type ApplyToolkitIntegrationOptions, ApprovalDeniedError, ApprovalTimeoutError, AuditLogger, AuthProvider, AuthenticationError, CircularRefError, CliApprovalHandler, ConfigDecryptionError, ConfigEncryptor, ConfigResolver, type CreateCliOptions, DEFAULTS, DEFAULT_BUILTIN_GROUP_NAME, EXIT_CODES, type Executor, type ExitCode, ExposureFilter, GroupedModuleGroup, LazyGroup, LazyModuleGroup, MaxDepthExceededError, type ModuleDescriptor, ModuleExecutionError, ModuleNotFoundError, type OptionConfig, type PipelineTrace, type PipelineTraceStep, type PreflightCheck, type PreflightResult, RESERVED_GROUP_NAMES, type Registry, Sandbox, SchemaValidationError, type StrategyInfo, type StrategyStep, UnresolvableRefError, applyToolkitIntegration, buildModuleCommand, checkApproval, collectInput, configureManHelp, createCli, exitCodeForError, formatExecResult, formatModuleDetail, formatModuleList, getAuditLogger, getLogLevel, main, reconvertEnumValues, registerCompletionCommand, registerConfigCommand, registerConfigNamespace, registerDescribeCommand, registerDisableCommand, registerEnableCommand, registerExecCommand, registerHealthCommand, registerInitCommand, registerListCommand, registerPipelineCommand, registerReloadCommand, registerUsageCommand, registerValidateCommand, resolveFormat, resolveRefs, schemaToCliOptions, setAllOptionsHelp, setAuditLogger, setDocsUrl, setLogLevel, setVerboseHelp, validateModuleId };
|