qlogicagent 2.11.4 → 2.11.5

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.
@@ -12,6 +12,8 @@ export interface SandboxPermissionSnapshot {
12
12
  mode: PermissionMode;
13
13
  workdir: string;
14
14
  allowedDirs: string[];
15
+ /** cut7c: current turn is an untrusted community-skill turn → tighten the sandbox. */
16
+ communityTurn: boolean;
15
17
  }
16
18
  /** Wire the OS-sandbox permission source (live rule-engine snapshot), or null to clear. */
17
19
  export declare function setSandboxPermissionSource(source: (() => SandboxPermissionSnapshot | undefined) | null): void;
@@ -1,3 +1,4 @@
1
+ import { type ReasoningMode } from "./provider-catalog-adapter.js";
1
2
  import { type KeyConfig, type KeyHandle, type LoadBalanceStrategy, type PoolStatus, type ProviderPoolConfig } from "./key-pool.js";
2
3
  export type RegistryChangeCallback = () => void;
3
4
  export type ModelPurpose = "textGeneration" | "smallModel" | "stt" | "tts" | "imageGeneration" | "imageUnderstanding" | "videoGeneration" | "videoUnderstanding" | "threeDGeneration" | "embedding" | "voiceClone" | "musicGeneration" | "realtimeAudio" | "realtimeVideo";
@@ -34,6 +35,8 @@ export interface ModelEntry {
34
35
  streamRequired?: boolean;
35
36
  capabilities?: string[];
36
37
  pricing?: Record<string, unknown>;
38
+ /** Thinking-strength control class for the UI (see ReasoningMode). */
39
+ reasoningMode?: ReasoningMode;
37
40
  }
38
41
  export type PurposeBindings = Partial<Record<ModelPurpose, string>>;
39
42
  export interface ModelRegistryConfig {
@@ -1,5 +1,17 @@
1
1
  import { type ProviderVariantCapability } from "@xiaozhiclaw/provider-core";
2
2
  export type RuntimeProviderVariantCapability = ProviderVariantCapability;
3
+ /**
4
+ * How a model's thinking depth can be controlled, derived from provider-core
5
+ * capabilities + quirks. The UI maps each mode to a different effort option set:
6
+ * - none : model has no reasoning/thinking → hide the strength control
7
+ * - adaptive : model self-regulates depth natively (Anthropic Opus/Sonnet
8
+ * type:"adaptive") → only "智能"
9
+ * - collapsed : provider collapses effort levels (DeepSeek: low/medium→high,
10
+ * high/xhigh→max) → "标准 / 最大" only
11
+ * - effort : full granular control honored (o-series/Kimi reasoning_effort,
12
+ * Anthropic budget thinking) → full 5 options
13
+ */
14
+ export type ReasoningMode = "none" | "adaptive" | "collapsed" | "effort";
3
15
  export interface RuntimeProviderCatalogProvider {
4
16
  id: string;
5
17
  name: string;
@@ -24,6 +36,8 @@ export interface RuntimeProviderCatalogModel {
24
36
  costCacheRead?: number;
25
37
  costCacheWrite?: number;
26
38
  pricing?: Record<string, unknown>;
39
+ /** Derived control class for thinking strength (see ReasoningMode). */
40
+ reasoningMode?: ReasoningMode;
27
41
  }
28
42
  export interface RuntimeProviderVariantResolutionInput {
29
43
  publicModel: string;
@@ -9,6 +9,12 @@ export interface PermissionRuleEntry {
9
9
  behavior: PermissionBehavior;
10
10
  reason?: string;
11
11
  source?: string;
12
+ /**
13
+ * When set, the rule only matches if this operation-classification flag is true
14
+ * (in addition to pattern/pathPrefix). Lets a rule target an operation property
15
+ * (e.g. a shell command that performs network egress) rather than just a tool name.
16
+ */
17
+ requireOp?: "commandNetworkEgress";
12
18
  }
13
19
  export type PermissionDecisionReason = {
14
20
  type: "rule";
@@ -1,3 +1,3 @@
1
1
  import type { PermissionRuleEntry } from "./types.js";
2
2
  export type CommunitySandboxRuleId = "community-l1-shell" | "community-l1-file-read" | "community-l1-file-write" | "community-l1-network" | "community-l1-mcp" | "community-l1-host-control" | "community-l2-host-side-effect" | "community-l2-data-egress" | "community-l2-provider-prompt-egress" | "community-l2-provider-media-egress";
3
- export declare function createCommunityL1SandboxRules(): PermissionRuleEntry[];
3
+ export declare function createCommunitySandboxScopedRules(): PermissionRuleEntry[];
@@ -66,7 +66,13 @@ export declare class PermissionChecker {
66
66
  private readonly getTurnId;
67
67
  private readonly communityTelemetryRecorder;
68
68
  private readonly communitySandboxTurnIds;
69
- private readonly communitySandboxRuleEngine;
69
+ /**
70
+ * cut7c — community-skill (untrusted) scoped deny/ask rules, passed per-call as
71
+ * `ruleEngine.check(..., { extraRules })` for community turns. NOT a second engine:
72
+ * the single rule engine evaluates these alongside the base rules. FS/exec tools are
73
+ * absent here → they flow through the unified pipeline (workspace + prompt + OS sandbox).
74
+ */
75
+ private readonly communityScopedRules;
70
76
  private unregisterHook;
71
77
  /** Tool meta cache — populated from ToolDefinition[] at agent creation */
72
78
  private toolMetaCache;
@@ -89,7 +95,12 @@ export declare class PermissionChecker {
89
95
  */
90
96
  setToolMeta(tools: ToolDefinition[]): void;
91
97
  get ruleEngineRef(): PermissionRuleEngine;
92
- private checkCommunitySandboxThenBase;
98
+ /**
99
+ * cut7c — whether the CURRENT turn is a community-skill (untrusted) turn. Consumed by
100
+ * the OS-sandbox builder to tighten community execs (netPolicy=deny: no outbound network
101
+ * from the sandboxed child) as defense-in-depth on POSIX.
102
+ */
103
+ isCommunitySandboxTurn(): boolean;
93
104
  /** Fire permission.denied hook + onDenied callback + audit log */
94
105
  private fireDenied;
95
106
  private handleResult;
@@ -14,6 +14,13 @@ export interface OperationClassification {
14
14
  isEgress: boolean;
15
15
  egressCarriesData: boolean;
16
16
  isDestructive: boolean;
17
+ /**
18
+ * Shell command performs network egress (curl/wget/nc/scp/...). Used to gate
19
+ * untrusted community-skill shell commands (which would otherwise bypass the
20
+ * web_fetch/web_search deny via raw shell). Best-effort detection; the OS sandbox
21
+ * (netPolicy=deny on community turns) is the robust second layer on POSIX.
22
+ */
23
+ commandNetworkEgress: boolean;
17
24
  }
18
25
  export interface ClassifyContext {
19
26
  workspaceRoot: string;
@@ -26,9 +26,18 @@ export declare class PermissionRuleEngine {
26
26
  * `op` is optional and defaults to an all-false classification so callers
27
27
  * that have not yet been wired to the classifier keep compiling.
28
28
  */
29
- check(input: ToolPermissionCheckInput, op?: OperationClassification): PermissionResult;
29
+ check(input: ToolPermissionCheckInput, op?: OperationClassification, ctx?: {
30
+ extraRules?: readonly PermissionRuleEntry[];
31
+ }): PermissionResult;
30
32
  /** Rebuild compiledPatterns: [persistent-deny] → [session] → [persistent non-deny]. */
31
33
  private recompile;
34
+ /**
35
+ * Match a caller-supplied rule set (deny-first) against this call, using the SAME
36
+ * matching semantics as the base rules (pathPrefix prefix-match, else toolName glob).
37
+ * Returns the first hit's result, or null if none match. Used for per-call scoped
38
+ * rules (community-skill turns) so trust-level restrictions stay in the one engine.
39
+ */
40
+ private matchRuleSet;
32
41
  }
33
42
  /**
34
43
  * Parse permission config from Gateway-injected or local settings.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.11.4",
3
+ "version": "2.11.5",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",