@mars-sea/dsh-commandcode-provider 0.11.9 → 0.11.10

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/lib/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { Context } from "@deepseek-ai/cordis";
7
7
  import { AttachmentStore, ImageAttachmentRef } from "@deepseek-ai/dsh-attachment";
8
8
  import { CommandDefinition } from "@deepseek-ai/dsh-commands";
9
9
  //#region src/adapter.d.ts
10
- declare const COMMAND_CODE_CLI_VERSION = "1.62.0";
10
+ declare const COMMAND_CODE_CLI_VERSION = "1.64.0";
11
11
  declare const DEFAULT_API_BASE = "https://api.commandcode.ai";
12
12
  declare const DEFAULT_GENERATE_MAX_TOKENS = 64000;
13
13
  declare const DEFAULT_MAX_OUTPUT_TOKENS = 65536;
@@ -93,6 +93,16 @@ interface CommandCodeConnectionOptions {
93
93
  * the plugin's user settings schema.
94
94
  */
95
95
  protocol?: 'auto' | CommandCodeProtocol;
96
+ /**
97
+ * Whether requests enforce zero data retention by sending the
98
+ * `x-cmd-zdr: 1` header (the same opt-in the official CLI exposes as
99
+ * `CMD_ZDR=1`). Default false. Every chat request carries the header when
100
+ * enabled. The provider refuses a model without a ZDR-capable upstream with
101
+ * 422 `cmd_zdr_no_providers`; never retry that request without the header.
102
+ * The decision endpoint (`/provider/v1/systemone`) is deliberately never
103
+ * reached through this connection option — see `./systemone.ts`.
104
+ */
105
+ zdr?: boolean;
96
106
  }
97
107
  /**
98
108
  * Resolve the durable attachment service, or undefined when the host does not
@@ -777,6 +787,46 @@ declare const KNOWN_EFFORTS: Readonly<Record<string, readonly string[]>>;
777
787
  * dsh-commandcode-upstream skill).
778
788
  */
779
789
  declare const KNOWN_IMAGE_MODELS: ReadonlySet<string>;
790
+ /**
791
+ * Models WITHOUT a zero-data-retention upstream, per the official CLI's own
792
+ * registry (`command-code@1.64.0` `dist/cli.mjs`: `modelSupportsZdr(id)` is
793
+ * exactly `!nonZdrSet.has(canonicalize(id))`, and `knownModelSupportsZdr`
794
+ * carries the same membership in the sibling route table — the union is this
795
+ * set). The official docs (commandcode.ai/docs/resources/zdr) put it in prose
796
+ * — "99% of our models have ZDR-capable upstreams … only a small handful of
797
+ * models are affected" — so the CLI's exclusion list is the only per-model
798
+ * evidence there is; a ZDR request naming one of these fails with HTTP 422
799
+ * `cmd_zdr_no_providers` instead of routing through a provider that retains.
800
+ *
801
+ * Why a NEGATIVE set, and why "not listed" answers TRUE: 99% of the catalog is
802
+ * covered, so the maintained difference is the exception list. This helper is
803
+ * informational; the adapter sends the ZDR header for EVERY request when the
804
+ * switch is on. The provider remains the routing authority and refuses an
805
+ * unsupported model rather than silently dropping the privacy guarantee.
806
+ *
807
+ * `minimax/minimax-m3-free` is the one entry the public catalog
808
+ * (`/provider/v1/models`) does not serve (it is CLI/pricing-visible and hidden
809
+ * from the picker); it stays listed because the CLI carries it and a Go-plan
810
+ * request can still name it.
811
+ *
812
+ * Keep in sync via the dsh-commandcode-upstream skill: the CLI's registry data
813
+ * (its `zdr:{only:[…]}` provider routes and the per-provider `zdr`/`noTraining`
814
+ * flags) is upstream-internal routing, not a per-model contract, so this table
815
+ * is the snapshot of the exclusion set and nothing more. The 1.62.0 → 1.64.0
816
+ * diff of that union is EMPTY: both anchors were extracted from both bundles
817
+ * during the 2026-09-23 check and each carries the same 20 members — which is
818
+ * how rare a change here is expected to be. `meituan/LongCat-2.0` is the one
819
+ * member the two anchors disagree about (it is in `modelSupportsZdr`'s set in
820
+ * both releases and in neither `knownModelSupportsZdr` set), so the union is
821
+ * what this table follows; reading only the sibling route table would drop it.
822
+ */
823
+ declare const KNOWN_NON_ZDR_MODELS: ReadonlySet<string>;
824
+ /**
825
+ * Whether the CLI snapshot lists a ZDR-capable upstream for `modelId`. This is
826
+ * informational, never a reason to omit the header when ZDR is enabled: the
827
+ * provider may add coverage or lack capacity after this snapshot was taken.
828
+ */
829
+ declare function supportsZeroDataRetention(modelId: string): boolean;
780
830
  /**
781
831
  * Models the official CLI's model table (command-code@1.53.0) marks
782
832
  * `reasoning:!0` but defines no selectable `reasoning_effort` levels — they
@@ -1872,6 +1922,44 @@ interface Config {
1872
1922
  * the toggle is on. Read by the browser client; the adapter ignores it.
1873
1923
  */
1874
1924
  showSidebarQuota?: boolean;
1925
+ /**
1926
+ * Whether the Command Code decision model (`typesafe/jev`) may auto-approve
1927
+ * shell commands that dsh was about to ask about. Defaults to FALSE: the
1928
+ * guard turns a model's opinion into a one-shot approval grant, so it is
1929
+ * opt-in, and the command text (plus the agent's own description of it) is
1930
+ * sent to Command Code to judge. Only commands a policy already wanted a
1931
+ * human to look at are ever judged, and only a confident "safe" verdict
1932
+ * (`commandGuardThreshold`) skips the prompt — every other outcome, including
1933
+ * any failure of the decision call itself, delegates to the normal approval
1934
+ * flow. See `./command-guard.ts`.
1935
+ */
1936
+ commandGuard?: boolean;
1937
+ /**
1938
+ * Minimum probability of "safe" that lets the guard skip the approval prompt;
1939
+ * defaults to 0.9. Lowering it approves more, on less evidence.
1940
+ */
1941
+ commandGuardThreshold?: number;
1942
+ /**
1943
+ * Milliseconds the guard waits for a decision before falling back to the
1944
+ * human prompt; defaults to 1500. This is a latency budget for an interactive
1945
+ * approval, not a request timeout — a decision that arrives late is useless,
1946
+ * because the user is staring at a prompt.
1947
+ */
1948
+ commandGuardTimeoutMs?: number;
1949
+ /**
1950
+ * Whether requests enforce zero data retention: the provider then routes
1951
+ * them only through upstreams that keep no prompts/completions and never
1952
+ * train on them (its own opt-in, `CMD_ZDR=1` in the CLI / `x-cmd-zdr: 1` on
1953
+ * the Provider API). Defaults to FALSE: `zdr` changes WHERE a request is
1954
+ * served. Every chat request carries the header when enabled; a model with
1955
+ * no ZDR-capable upstream fails with 422 `cmd_zdr_no_providers` instead of
1956
+ * being routed through an upstream that retains data. ZDR capacity is
1957
+ * priced pass-through and usually costs more, and the price readout keeps
1958
+ * quoting the ordinary catalog rates (the real per-request price shows in
1959
+ * Command Code's Studio). The decision endpoint behind the command guard is
1960
+ * never ZDR-enforced — see `./systemone.ts`.
1961
+ */
1962
+ zdr?: boolean;
1875
1963
  /**
1876
1964
  * Language override for the `/commandcode` Host-side command's user-facing
1877
1965
  * copy. Host commands cannot read the client's `ctx.locale`, so this is
@@ -1927,5 +2015,5 @@ interface ResolvedCommandCodeOptions extends CommandCodeConnectionOptions {
1927
2015
  declare function resolveAdapterOptions(config: Config): ResolvedCommandCodeOptions;
1928
2016
  declare function apply(ctx: Context, config: Config): void;
1929
2017
  //#endregion
1930
- export { ACTIVE_ACCOUNT_AUTO, type ApiKeyValidation, BILLING_ACCESS_TTL_MS, COMMANDCODE_SEARCH_PROVIDER_ID, COMMAND_CODE_CLI_VERSION, type CommandCodeAccountConfig, CommandCodeAccountPool, type CommandCodeAccountSlot, type CommandCodeAccountState, type CommandCodeAccountUsage, type CommandCodeAccountsReport, CommandCodeAdapter, type CommandCodeAdapterDeps, type CommandCodeBillingAccess, type CommandCodeCommandDeps, type CommandCodeConnectionOptions, type CommandCodeLoginCredentials, type CommandCodeLoginFailureReason, CommandCodeLoginFlow, type CommandCodeLoginFlowDeps, type CommandCodeLoginStatus, type CommandCodeModelAccountRule, CommandCodeSearchProvider, type CommandCodeSearchProviderDeps, type CommandCodeSearchSelection, type CommandCodeTuiSettingsDeps, type CommandCodeUsageDeps, type CommandCodeUsageReport, CommandCodeUsageService, Config, DEFAULT_API_BASE, DEFAULT_GENERATE_MAX_TOKENS, DEFAULT_MAX_OUTPUT_TOKENS, DEFAULT_MODELS_CACHE_PATH, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_WEB_SEARCH_PROVIDER_ID, KNOWN_DEALS, KNOWN_EFFORTS, KNOWN_IMAGE_MODELS, KNOWN_PEAK_PRICING, KNOWN_PLANS, KNOWN_SUBSCRIPTION_PLANS, KNOWN_THINKING_MODELS, LANG_AUTO, LOGIN_ALLOWED_ORIGINS, LOGIN_BEGIN_ENDPOINT, LOGIN_BODY_LIMIT_BYTES, LOGIN_CANCEL_ENDPOINT, LOGIN_MAX_PORT_ATTEMPTS, LOGIN_START_PORT, LOGIN_STATUS_ENDPOINT, LOGIN_TIMEOUT_MS, LegacySettingsSchema, type LoginFlowFacade, PLAN_LABELS, PLAN_ORDER, PROVIDER, type ResolveAttachments, ResolvedCommandCodeOptions, type TuiSettingsField, type TuiSettingsFieldOption, type TuiSettingsFieldWrite, type TuiSettingsGroup, type TuiSettingsSection, type TuiSettingsSectionsService, USAGE_REPORT_ENDPOINT, accountUsable, apply, applyCommandCodeSearchSelection, applyCommandCodeTuiSettings, applyCommands, applyUsageRemote, buildCommandAuthUrl, buildCommandCodeTuiSection, capabilityDescription, commandCodeSearchSelection, commandDefinition, compareByPlan, dealLabel, formatContext, inject, loginStatusSchema, matchModelRule, modelVisibleInPlan, name, parseLoginStatus, peakPricingLabel, peakPricingState, planLabel, projectSlugFromPath, resolveAdapterOptions, resolveAuthFileApiKey, selectAccountForModel, selectActiveAccount, selectCommandCodeSearchProvider, studioBaseForApiBase, subscriptionPlanInfo, usageReportSchema, validateCommandApiKey };
2018
+ export { ACTIVE_ACCOUNT_AUTO, type ApiKeyValidation, BILLING_ACCESS_TTL_MS, COMMANDCODE_SEARCH_PROVIDER_ID, COMMAND_CODE_CLI_VERSION, type CommandCodeAccountConfig, CommandCodeAccountPool, type CommandCodeAccountSlot, type CommandCodeAccountState, type CommandCodeAccountUsage, type CommandCodeAccountsReport, CommandCodeAdapter, type CommandCodeAdapterDeps, type CommandCodeBillingAccess, type CommandCodeCommandDeps, type CommandCodeConnectionOptions, type CommandCodeLoginCredentials, type CommandCodeLoginFailureReason, CommandCodeLoginFlow, type CommandCodeLoginFlowDeps, type CommandCodeLoginStatus, type CommandCodeModelAccountRule, CommandCodeSearchProvider, type CommandCodeSearchProviderDeps, type CommandCodeSearchSelection, type CommandCodeTuiSettingsDeps, type CommandCodeUsageDeps, type CommandCodeUsageReport, CommandCodeUsageService, Config, DEFAULT_API_BASE, DEFAULT_GENERATE_MAX_TOKENS, DEFAULT_MAX_OUTPUT_TOKENS, DEFAULT_MODELS_CACHE_PATH, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_WEB_SEARCH_PROVIDER_ID, KNOWN_DEALS, KNOWN_EFFORTS, KNOWN_IMAGE_MODELS, KNOWN_NON_ZDR_MODELS, KNOWN_PEAK_PRICING, KNOWN_PLANS, KNOWN_SUBSCRIPTION_PLANS, KNOWN_THINKING_MODELS, LANG_AUTO, LOGIN_ALLOWED_ORIGINS, LOGIN_BEGIN_ENDPOINT, LOGIN_BODY_LIMIT_BYTES, LOGIN_CANCEL_ENDPOINT, LOGIN_MAX_PORT_ATTEMPTS, LOGIN_START_PORT, LOGIN_STATUS_ENDPOINT, LOGIN_TIMEOUT_MS, LegacySettingsSchema, type LoginFlowFacade, PLAN_LABELS, PLAN_ORDER, PROVIDER, type ResolveAttachments, ResolvedCommandCodeOptions, type TuiSettingsField, type TuiSettingsFieldOption, type TuiSettingsFieldWrite, type TuiSettingsGroup, type TuiSettingsSection, type TuiSettingsSectionsService, USAGE_REPORT_ENDPOINT, accountUsable, apply, applyCommandCodeSearchSelection, applyCommandCodeTuiSettings, applyCommands, applyUsageRemote, buildCommandAuthUrl, buildCommandCodeTuiSection, capabilityDescription, commandCodeSearchSelection, commandDefinition, compareByPlan, dealLabel, formatContext, inject, loginStatusSchema, matchModelRule, modelVisibleInPlan, name, parseLoginStatus, peakPricingLabel, peakPricingState, planLabel, projectSlugFromPath, resolveAdapterOptions, resolveAuthFileApiKey, selectAccountForModel, selectActiveAccount, selectCommandCodeSearchProvider, studioBaseForApiBase, subscriptionPlanInfo, supportsZeroDataRetention, usageReportSchema, validateCommandApiKey };
1931
2019
  //# sourceMappingURL=index.d.ts.map