qlogicagent 2.10.37 → 2.10.39
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/cli.js +280 -266
- package/dist/index.js +278 -264
- package/dist/protocol.js +1 -1
- package/dist/types/agent/types.d.ts +2 -0
- package/dist/types/assistants/assistant-registry.d.ts +4 -0
- package/dist/types/assistants/assistant-store.d.ts +23 -0
- package/dist/types/assistants/assistant-turn-context.d.ts +20 -0
- package/dist/types/assistants/assistant-types.d.ts +38 -0
- package/dist/types/assistants/plugin-assistant-registry.d.ts +16 -0
- package/dist/types/cli/community-resource-installer.d.ts +29 -0
- package/dist/types/cli/dream-host-adapter.d.ts +1 -0
- package/dist/types/cli/handlers/assistants-handler.d.ts +13 -0
- package/dist/types/cli/handlers/community-handler.d.ts +1 -0
- package/dist/types/cli/handlers/dream-handler.d.ts +1 -0
- package/dist/types/cli/idle-dream-coordinator.d.ts +1 -1
- package/dist/types/cli/permission-runtime-service.d.ts +2 -2
- package/dist/types/cli/permission-settings-store.d.ts +1 -2
- package/dist/types/cli/plugin-bootstrap.d.ts +1 -0
- package/dist/types/cli/skill-meta-subturn-service.d.ts +4 -0
- package/dist/types/cli/turn-permission-sync.d.ts +2 -2
- package/dist/types/permissions.d.ts +1 -1
- package/dist/types/protocol/methods.d.ts +47 -7
- package/dist/types/protocol/wire/agent-rpc.d.ts +0 -7
- package/dist/types/protocol/wire/gateway-rpc.d.ts +112 -0
- package/dist/types/runtime/community/community-consent-client.d.ts +1 -0
- package/dist/types/runtime/community/community-discovery-cache.d.ts +24 -0
- package/dist/types/runtime/community/community-discovery-coordinator.d.ts +33 -0
- package/dist/types/runtime/community/community-pet-publisher.d.ts +30 -0
- package/dist/types/runtime/community/community-signal-reporter.d.ts +33 -0
- package/dist/types/runtime/execution/dream-agent.d.ts +1 -0
- package/dist/types/runtime/hooks/skill-recall-hooks.d.ts +3 -0
- package/dist/types/runtime/infra/agent-paths.d.ts +2 -0
- package/dist/types/runtime/infra/default-path-service.d.ts +2 -0
- package/dist/types/runtime/infra/index.d.ts +1 -1
- package/dist/types/runtime/infra/llmrouter-catalog.d.ts +2 -0
- package/dist/types/runtime/pet/pet-community-assets.d.ts +13 -0
- package/dist/types/runtime/ports/index.d.ts +1 -1
- package/dist/types/runtime/ports/path-service.d.ts +2 -0
- package/dist/types/runtime/ports/permission-contracts.d.ts +2 -9
- package/dist/types/runtime/sandbox/index.d.ts +2 -0
- package/dist/types/runtime/sandbox/skill-sandbox.d.ts +53 -0
- package/dist/types/runtime/sandbox/windows-skill-sandbox.d.ts +78 -0
- package/dist/types/runtime/session/session-persistence.d.ts +8 -0
- package/dist/types/skills/permissions/community-sandbox-red-team.d.ts +2 -0
- package/dist/types/skills/permissions/hook-runner.d.ts +2 -4
- package/dist/types/skills/permissions/index.d.ts +1 -1
- package/dist/types/skills/permissions/rule-engine.d.ts +5 -9
- package/dist/types/skills/permissions/types.d.ts +1 -1
- package/dist/types/skills/plugins/plugin-api.d.ts +1 -0
- package/dist/types/skills/plugins/plugin-loader.d.ts +4 -0
- package/dist/types/skills/skill-system/skill-lifecycle.d.ts +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CommunityRegistryMatchResult } from "./community-consent-client.js";
|
|
2
|
+
export interface CommunityDiscoveryCacheEntry {
|
|
3
|
+
intentKey: string;
|
|
4
|
+
resourceId: string;
|
|
5
|
+
type: string;
|
|
6
|
+
title: string;
|
|
7
|
+
summary: string;
|
|
8
|
+
sourceTier: string;
|
|
9
|
+
trustStage: string;
|
|
10
|
+
effectiveRiskTier: string;
|
|
11
|
+
latestVersion: string | null;
|
|
12
|
+
cachedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CommunityDiscoveryCacheOptions {
|
|
15
|
+
ownerUserId?: string;
|
|
16
|
+
filePath?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class CommunityDiscoveryCache {
|
|
19
|
+
private readonly filePath;
|
|
20
|
+
constructor(options?: CommunityDiscoveryCacheOptions);
|
|
21
|
+
readAll(): CommunityDiscoveryCacheEntry[];
|
|
22
|
+
find(intentKey: string): CommunityDiscoveryCacheEntry | undefined;
|
|
23
|
+
writeMatch(intentKey: string, match: CommunityRegistryMatchResult, now?: Date): CommunityDiscoveryCacheEntry;
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CommunityConsentClient, CommunityRegistryMatchResult } from "./community-consent-client.js";
|
|
2
|
+
import { CommunityDiscoveryCache, type CommunityDiscoveryCacheEntry } from "./community-discovery-cache.js";
|
|
3
|
+
export interface LocalCommunityResourceIndex {
|
|
4
|
+
findInstalled(intentKey: string): CommunityRegistryMatchResult | undefined;
|
|
5
|
+
}
|
|
6
|
+
export type CommunityDiscoveryStatus = "matched" | "local" | "cached" | "miss" | "disabled" | "unavailable";
|
|
7
|
+
export interface CommunityDiscoveryResult {
|
|
8
|
+
status: CommunityDiscoveryStatus;
|
|
9
|
+
intentKey: string;
|
|
10
|
+
match?: CommunityRegistryMatchResult;
|
|
11
|
+
cacheEntry?: CommunityDiscoveryCacheEntry;
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CommunityDiscoveryCoordinatorOptions {
|
|
15
|
+
client: Pick<CommunityConsentClient, "getConsent" | "matchRegistry"> | null;
|
|
16
|
+
cache?: CommunityDiscoveryCache;
|
|
17
|
+
localIndex?: LocalCommunityResourceIndex;
|
|
18
|
+
topK?: number;
|
|
19
|
+
now?: () => Date;
|
|
20
|
+
}
|
|
21
|
+
export declare class CommunityDiscoveryCoordinator {
|
|
22
|
+
private readonly client;
|
|
23
|
+
private readonly cache;
|
|
24
|
+
private readonly localIndex?;
|
|
25
|
+
private readonly topK;
|
|
26
|
+
private readonly now;
|
|
27
|
+
private readonly inMemory;
|
|
28
|
+
constructor(options: CommunityDiscoveryCoordinatorOptions);
|
|
29
|
+
matchForTurn(intent: string): Promise<CommunityDiscoveryResult>;
|
|
30
|
+
prefetchIdle(intents: string[]): Promise<CommunityDiscoveryResult[]>;
|
|
31
|
+
private memo;
|
|
32
|
+
}
|
|
33
|
+
export declare function normalizeDiscoveryIntent(intent: string): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CommunityConsentClient, CommunityPublishSkillResult } from "./community-consent-client.js";
|
|
2
|
+
export interface CommunityPetPublishInput {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
summary: string;
|
|
6
|
+
persona: string;
|
|
7
|
+
traits?: string[];
|
|
8
|
+
assets?: Array<{
|
|
9
|
+
kind: string;
|
|
10
|
+
path: string;
|
|
11
|
+
}>;
|
|
12
|
+
visibility?: "public" | "private";
|
|
13
|
+
tags?: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare function packageCommunityPetAsset(input: CommunityPetPublishInput): {
|
|
16
|
+
manifest: {
|
|
17
|
+
schema_version: number;
|
|
18
|
+
kind: string;
|
|
19
|
+
name: string;
|
|
20
|
+
summary: string;
|
|
21
|
+
persona: string;
|
|
22
|
+
traits: string[];
|
|
23
|
+
assets: {
|
|
24
|
+
kind: string;
|
|
25
|
+
path: string;
|
|
26
|
+
}[];
|
|
27
|
+
tags: string[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare function publishCommunityPetAsset(client: Pick<CommunityConsentClient, "getConsent" | "publishPet">, input: CommunityPetPublishInput): Promise<CommunityPublishSkillResult>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CommunityConsentClient, CommunityRecordSignalInput, CommunitySignalEvent } from "./community-consent-client.js";
|
|
2
|
+
export interface CommunitySkillLifecycleRecord {
|
|
3
|
+
name: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
lastUsedAt?: string;
|
|
6
|
+
source?: string;
|
|
7
|
+
registryResourceId?: string;
|
|
8
|
+
registryVersion?: string;
|
|
9
|
+
registrySourceTier?: string;
|
|
10
|
+
registryRiskTier?: string;
|
|
11
|
+
registryEffectiveRiskTier?: string;
|
|
12
|
+
registryKeptSignalAt?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CommunitySkillLifecycleStore {
|
|
15
|
+
version?: number;
|
|
16
|
+
records: Record<string, CommunitySkillLifecycleRecord>;
|
|
17
|
+
}
|
|
18
|
+
export interface CommunitySignalReporter {
|
|
19
|
+
record(input: CommunityRecordSignalInput): Promise<"recorded" | "disabled" | "skipped" | "failed">;
|
|
20
|
+
recordSkillUsage(record: CommunitySkillLifecycleRecord | undefined, outcome: CommunitySkillUsageOutcome): Promise<"recorded" | "disabled" | "skipped" | "failed">;
|
|
21
|
+
recordSkillLifecycle(record: CommunitySkillLifecycleRecord | undefined, event: Extract<CommunitySignalEvent, "kept" | "uninstalled" | "endorse">): Promise<"recorded" | "disabled" | "skipped" | "failed">;
|
|
22
|
+
recordKeptSignals(store: CommunitySkillLifecycleStore, options?: RecordKeptSignalsOptions): Promise<Array<{
|
|
23
|
+
skillName: string;
|
|
24
|
+
status: "recorded" | "disabled" | "skipped" | "failed";
|
|
25
|
+
}>>;
|
|
26
|
+
}
|
|
27
|
+
export type CommunitySkillUsageOutcome = "success" | "fail" | "error" | "neutral";
|
|
28
|
+
export interface RecordKeptSignalsOptions {
|
|
29
|
+
now?: Date;
|
|
30
|
+
retentionMs?: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function createCommunitySignalReporter(client: Pick<CommunityConsentClient, "getConsent" | "recordSignal"> | null): CommunitySignalReporter;
|
|
33
|
+
export declare function createDefaultCommunitySignalReporter(): CommunitySignalReporter | null;
|
|
@@ -83,6 +83,7 @@ export declare function buildConsolidationPrompt(memoryRoot: string, transcriptD
|
|
|
83
83
|
categoryContext?: string;
|
|
84
84
|
temporalContext?: string;
|
|
85
85
|
profileContext?: string;
|
|
86
|
+
sessionDigest?: string;
|
|
86
87
|
}): string;
|
|
87
88
|
/**
|
|
88
89
|
* Check whether dream consolidation should run.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HookRegistry } from "../../contracts/hooks.js";
|
|
2
|
+
import type { CommunityDiscoveryCoordinator } from "../community/community-discovery-coordinator.js";
|
|
2
3
|
export declare const SKILL_RECALL_CONFIG: {
|
|
3
4
|
readonly MAX_RECALLED_SKILLS: 3;
|
|
4
5
|
readonly MAX_SKILL_CONTENT_CHARS: 800;
|
|
@@ -13,6 +14,8 @@ export declare function detectRetrospectiveTrigger(message: string): string[] |
|
|
|
13
14
|
export interface SkillRecallHooksDeps {
|
|
14
15
|
/** Current project cwd (to exclude from cross-project search). */
|
|
15
16
|
currentCwd?: string;
|
|
17
|
+
/** Optional online community discovery coordinator. */
|
|
18
|
+
communityDiscovery?: CommunityDiscoveryCoordinator | null;
|
|
16
19
|
/** Logger. */
|
|
17
20
|
log: {
|
|
18
21
|
debug(msg: string): void;
|
|
@@ -37,6 +37,8 @@ export declare function getUserPluginCacheDir(): string;
|
|
|
37
37
|
export declare function getUserMcpConfigPath(): string;
|
|
38
38
|
/** `~/.qlogicagent/profiles/<owner>/marketplace.json` */
|
|
39
39
|
export declare function getUserMarketplaceConfigPath(): string;
|
|
40
|
+
/** `~/.qlogicagent/profiles/<owner>/assistant-presets.json` */
|
|
41
|
+
export declare function getUserAssistantPresetsPath(): string;
|
|
40
42
|
/** `~/.qlogicagent/profiles/<owner>/workflows/` */
|
|
41
43
|
export declare function getUserWorkflowsDir(): string;
|
|
42
44
|
/** `~/.qlogicagent/profiles/<owner>/INSTRUCTIONS.md` */
|
|
@@ -20,10 +20,12 @@ export declare class DefaultPathService implements PathService {
|
|
|
20
20
|
getUserMcpConfigPath(): string;
|
|
21
21
|
getUserPluginCacheDir(): string;
|
|
22
22
|
getUserMarketplaceConfigPath(): string;
|
|
23
|
+
getUserAssistantPresetsPath(): string;
|
|
23
24
|
getProjectAgentDir(projectRoot?: string): string;
|
|
24
25
|
getProjectSettingsPath(projectRoot?: string): string;
|
|
25
26
|
getProjectInstructionsPath(projectRoot?: string): string;
|
|
26
27
|
getProjectSkillsDir(projectRoot?: string): string;
|
|
28
|
+
getProjectPluginsDir(projectRoot?: string): string;
|
|
27
29
|
getProjectRulesDir(projectRoot?: string): string;
|
|
28
30
|
getProjectSessionsRoot(projectRoot?: string): string;
|
|
29
31
|
getKnownProjectDirs(projectDirs: string[], excludeCwd?: string): string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AGENT_DOT_DIR, getUserAgentHome, getUserCredentialsPath, getUserPluginsDir, getUserSkillsDir, getUserSettingsPath, getUserCacheDir, getUserDebugLogsDir, getUserPluginCacheDir, getUserMcpConfigPath, getUserMarketplaceConfigPath, getUserWorkflowsDir, getProjectAgentDir, getProjectWorkflowsDir, getProjectPluginsDir, getProjectSkillsDir, getProjectSettingsPath, getProjectInstructionsPath, getProjectRulesDir, getGitRootHooksDir, getKnownProjectDirs, getAllProjectSkillDirs, } from "./agent-paths.js";
|
|
1
|
+
export { AGENT_DOT_DIR, getUserAgentHome, getUserCredentialsPath, getUserPluginsDir, getUserSkillsDir, getUserSettingsPath, getUserCacheDir, getUserDebugLogsDir, getUserPluginCacheDir, getUserMcpConfigPath, getUserMarketplaceConfigPath, getUserAssistantPresetsPath, getUserWorkflowsDir, getProjectAgentDir, getProjectWorkflowsDir, getProjectPluginsDir, getProjectSkillsDir, getProjectSettingsPath, getProjectInstructionsPath, getProjectRulesDir, getGitRootHooksDir, getKnownProjectDirs, getAllProjectSkillDirs, } from "./agent-paths.js";
|
|
2
2
|
export { getBudgetContinuationMessage } from "./token-budget.js";
|
|
3
3
|
export { type SecureStorage, saveApiKey, loadApiKey } from "./secure-storage.js";
|
|
4
4
|
export { ProjectInstructionsStore, type InstructionFile } from "./project-instructions-store.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CommunityInstallResolution } from "../community/community-consent-client.js";
|
|
2
|
+
export interface InstalledCommunityPetResource {
|
|
3
|
+
kind: "pet";
|
|
4
|
+
status: "installed";
|
|
5
|
+
resourceId: string;
|
|
6
|
+
version: string;
|
|
7
|
+
checksum: string;
|
|
8
|
+
installDir: string;
|
|
9
|
+
name: string;
|
|
10
|
+
sanitized: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function installCommunityPetResource(install: CommunityInstallResolution): Promise<InstalledCommunityPetResource>;
|
|
13
|
+
export declare function assertPetInstall(install: CommunityInstallResolution): void;
|
|
@@ -5,7 +5,7 @@ export type { PathService } from "./path-service.js";
|
|
|
5
5
|
export type { ConfigPort } from "./config-port.js";
|
|
6
6
|
export { createRecordConfigPort } from "./config-port.js";
|
|
7
7
|
export { PERMISSION_MODES, } from "./permission-contracts.js";
|
|
8
|
-
export type { ApprovalRequest, ApprovalResponse, PermissionApprovalResolver, PermissionBehavior, PermissionConfig, PermissionDecisionReason, PermissionMetadataResolver, PermissionMode, PermissionRiskLevel, PermissionResult, PermissionRuleEnginePort, PermissionRuleEntry,
|
|
8
|
+
export type { ApprovalRequest, ApprovalResponse, PermissionApprovalResolver, PermissionBehavior, PermissionConfig, PermissionDecisionReason, PermissionEngineConfig, PermissionMetadataResolver, PermissionMode, PermissionRiskLevel, PermissionResult, PermissionRuleEnginePort, PermissionRuleEntry, ToolPermissionCheckInput, } from "./permission-contracts.js";
|
|
9
9
|
export type { ProjectMemoryFileInfo, ProjectMemoryResult, ProjectMemoryStore, ProjectMemoryStoreFactory, } from "./project-memory-store.js";
|
|
10
10
|
export type { RuntimeToolContract, ToolBootstrap, ToolBootstrapConfig, ToolBootstrapProvider, ToolBootstrapProviderContext, ToolBootstrapProgress, ToolCatalog, ToolRegistrationModule, ToolRegistrationModuleKind, } from "./tool-contracts.js";
|
|
11
11
|
export { defineToolRegistrationModule } from "./tool-contracts.js";
|
|
@@ -12,10 +12,12 @@ export interface PathService {
|
|
|
12
12
|
getUserMcpConfigPath(): string;
|
|
13
13
|
getUserPluginCacheDir(): string;
|
|
14
14
|
getUserMarketplaceConfigPath(): string;
|
|
15
|
+
getUserAssistantPresetsPath(): string;
|
|
15
16
|
getProjectAgentDir(projectRoot?: string): string;
|
|
16
17
|
getProjectSettingsPath(projectRoot?: string): string;
|
|
17
18
|
getProjectInstructionsPath(projectRoot?: string): string;
|
|
18
19
|
getProjectSkillsDir(projectRoot?: string): string;
|
|
20
|
+
getProjectPluginsDir(projectRoot?: string): string;
|
|
19
21
|
getProjectRulesDir(projectRoot?: string): string;
|
|
20
22
|
getProjectSessionsRoot(projectRoot?: string): string;
|
|
21
23
|
getKnownProjectDirs(projectDirs: string[], excludeCwd?: string): string[];
|
|
@@ -45,7 +45,6 @@ export interface PermissionAskResult {
|
|
|
45
45
|
message: string;
|
|
46
46
|
toolName: string;
|
|
47
47
|
input?: Record<string, unknown>;
|
|
48
|
-
suggestions?: PermissionUpdate[];
|
|
49
48
|
decisionReason?: PermissionDecisionReason;
|
|
50
49
|
}
|
|
51
50
|
export interface PermissionDenyResult {
|
|
@@ -54,14 +53,10 @@ export interface PermissionDenyResult {
|
|
|
54
53
|
decisionReason: PermissionDecisionReason;
|
|
55
54
|
}
|
|
56
55
|
export type PermissionResult = PermissionAllowResult | PermissionAskResult | PermissionDenyResult;
|
|
57
|
-
export interface PermissionUpdate {
|
|
58
|
-
pattern: string;
|
|
59
|
-
behavior: PermissionBehavior;
|
|
60
|
-
scope?: "session" | "persistent";
|
|
61
|
-
description?: string;
|
|
62
|
-
}
|
|
63
56
|
export interface PermissionConfig {
|
|
64
57
|
mode: PermissionMode;
|
|
58
|
+
}
|
|
59
|
+
export interface PermissionEngineConfig extends PermissionConfig {
|
|
65
60
|
rules: PermissionRuleEntry[];
|
|
66
61
|
defaultBehavior: PermissionBehavior;
|
|
67
62
|
}
|
|
@@ -82,13 +77,11 @@ export interface ApprovalRequest {
|
|
|
82
77
|
toolName: string;
|
|
83
78
|
arguments?: Record<string, unknown>;
|
|
84
79
|
message: string;
|
|
85
|
-
suggestions?: PermissionUpdate[];
|
|
86
80
|
}
|
|
87
81
|
export interface ApprovalResponse {
|
|
88
82
|
approvalId: string;
|
|
89
83
|
decision: "allow" | "deny";
|
|
90
84
|
updatedInput?: Record<string, unknown>;
|
|
91
|
-
permissionUpdate?: PermissionUpdate;
|
|
92
85
|
}
|
|
93
86
|
export interface PermissionRuleEnginePort {
|
|
94
87
|
getMode(): PermissionMode;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { buildWindowsProcessTreeLauncherAuditEnvelope, type WindowsSkillSandboxAvailability } from "./windows-skill-sandbox.js";
|
|
2
|
+
export type SkillSandboxOrigin = "community" | "first-party" | "official";
|
|
3
|
+
export type SkillSandboxRiskTier = "R0" | "R1" | "R2" | "R3" | "unknown";
|
|
4
|
+
export type SkillSandboxDecisionReason = "first-party-action" | "community-low-risk" | "manual-run" | "l0-available" | "l0-unavailable" | "launcher-required" | "launcher-unavailable";
|
|
5
|
+
export interface SkillSandboxAvailability extends WindowsSkillSandboxAvailability {
|
|
6
|
+
}
|
|
7
|
+
export interface SkillSandboxRunRequest {
|
|
8
|
+
origin: SkillSandboxOrigin;
|
|
9
|
+
official?: boolean;
|
|
10
|
+
riskTier?: SkillSandboxRiskTier;
|
|
11
|
+
autoRun?: boolean;
|
|
12
|
+
executable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface SkillSandboxLauncherDecisionMetadata {
|
|
15
|
+
level: "L0";
|
|
16
|
+
mode: "os-native-launcher";
|
|
17
|
+
defaultHostAccess: true;
|
|
18
|
+
noFsNetworkRestriction: true;
|
|
19
|
+
audit: {
|
|
20
|
+
envelope: "l0-launcher-audit-v1";
|
|
21
|
+
subject: {
|
|
22
|
+
origin: SkillSandboxOrigin;
|
|
23
|
+
official: boolean;
|
|
24
|
+
executable: boolean;
|
|
25
|
+
autoRun: boolean;
|
|
26
|
+
};
|
|
27
|
+
decision: "allowed" | "blocked";
|
|
28
|
+
reason: "launcher-required" | "launcher-unavailable";
|
|
29
|
+
};
|
|
30
|
+
windows?: ReturnType<typeof buildWindowsProcessTreeLauncherAuditEnvelope>;
|
|
31
|
+
}
|
|
32
|
+
export interface SkillSandboxDecision {
|
|
33
|
+
allowed: boolean;
|
|
34
|
+
spawnAllowed: boolean;
|
|
35
|
+
launcherRequired: boolean;
|
|
36
|
+
reason: SkillSandboxDecisionReason;
|
|
37
|
+
backend: "first-party" | "community-l1-l2" | "community-l0" | "community-l0-launcher";
|
|
38
|
+
l0: SkillSandboxAvailability;
|
|
39
|
+
launcher?: SkillSandboxLauncherDecisionMetadata;
|
|
40
|
+
}
|
|
41
|
+
export interface SkillSandbox {
|
|
42
|
+
getAvailability(): SkillSandboxAvailability;
|
|
43
|
+
decide(request: SkillSandboxRunRequest): SkillSandboxDecision;
|
|
44
|
+
}
|
|
45
|
+
export interface SkillSandboxOptions {
|
|
46
|
+
availability?: SkillSandboxAvailability;
|
|
47
|
+
platform?: string;
|
|
48
|
+
appContainerAvailable?: boolean;
|
|
49
|
+
jobObjectAvailable?: boolean;
|
|
50
|
+
processTreeLauncherAvailable?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare function createSkillSandbox(options?: SkillSandboxOptions): SkillSandbox;
|
|
53
|
+
export declare function createDefaultSkillSandbox(): SkillSandbox;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export type WindowsSkillSandboxBackend = "windows-process-tree-launcher";
|
|
2
|
+
export type WindowsProcessTreeLauncherAuditEvent = "launch-requested" | "process-started" | "process-exited" | "tree-kill-requested" | "launch-failed";
|
|
3
|
+
export interface WindowsSkillSandboxAvailabilityOptions {
|
|
4
|
+
platform?: string;
|
|
5
|
+
appContainerAvailable?: boolean;
|
|
6
|
+
jobObjectAvailable?: boolean;
|
|
7
|
+
processTreeLauncherAvailable?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface WindowsSkillSandboxAvailability {
|
|
10
|
+
level: "L0";
|
|
11
|
+
available: boolean;
|
|
12
|
+
backend: WindowsSkillSandboxBackend | "unsupported-platform" | "unavailable";
|
|
13
|
+
platform: string;
|
|
14
|
+
reason?: "unsupported-platform" | "windows-l0-not-provisioned";
|
|
15
|
+
}
|
|
16
|
+
export interface WindowsSandboxLaunchMetadata {
|
|
17
|
+
backend: WindowsSkillSandboxBackend;
|
|
18
|
+
command: string;
|
|
19
|
+
args: string[];
|
|
20
|
+
elevated: false;
|
|
21
|
+
defaultHostAccess: true;
|
|
22
|
+
noFsNetworkRestriction: true;
|
|
23
|
+
jobObject: {
|
|
24
|
+
implemented: false;
|
|
25
|
+
ready: true;
|
|
26
|
+
};
|
|
27
|
+
processTree: {
|
|
28
|
+
killOnClose: true;
|
|
29
|
+
trackChildren: true;
|
|
30
|
+
terminateOnLauncherClose: true;
|
|
31
|
+
};
|
|
32
|
+
audit: {
|
|
33
|
+
envelope: "l0-launcher-audit-v1";
|
|
34
|
+
lifecycle: WindowsProcessTreeLauncherAuditEvent[];
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface WindowsProcessTreeLauncherAuditEnvelope {
|
|
38
|
+
envelope: "l0-launcher-audit-v1";
|
|
39
|
+
backend: WindowsSkillSandboxBackend;
|
|
40
|
+
defaultHostAccess: true;
|
|
41
|
+
noFsNetworkRestriction: true;
|
|
42
|
+
processTree: {
|
|
43
|
+
killOnClose: true;
|
|
44
|
+
trackChildren: true;
|
|
45
|
+
};
|
|
46
|
+
jobObject: {
|
|
47
|
+
implemented: false;
|
|
48
|
+
ready: true;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface WindowsProcessTreeChild {
|
|
52
|
+
pid?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface WindowsProcessTreeLauncherDependencies {
|
|
55
|
+
spawn?: (command: string, args: string[]) => WindowsProcessTreeChild;
|
|
56
|
+
killProcessTree?: (pid: number) => Promise<void> | void;
|
|
57
|
+
}
|
|
58
|
+
export interface WindowsProcessTreeLaunchRequest {
|
|
59
|
+
command: string;
|
|
60
|
+
args?: string[];
|
|
61
|
+
}
|
|
62
|
+
export interface WindowsProcessTreeLaunchHandle {
|
|
63
|
+
pid: number;
|
|
64
|
+
metadata: WindowsSandboxLaunchMetadata;
|
|
65
|
+
auditEvents: WindowsProcessTreeLauncherAuditEvent[];
|
|
66
|
+
close(): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
export interface WindowsProcessTreeLauncher {
|
|
69
|
+
auditEvents: WindowsProcessTreeLauncherAuditEvent[];
|
|
70
|
+
launch(request: WindowsProcessTreeLaunchRequest): WindowsProcessTreeLaunchHandle;
|
|
71
|
+
}
|
|
72
|
+
export declare function getWindowsSkillSandboxAvailability(options?: WindowsSkillSandboxAvailabilityOptions): WindowsSkillSandboxAvailability;
|
|
73
|
+
export declare function buildWindowsSandboxLaunchMetadata(input: {
|
|
74
|
+
command: string;
|
|
75
|
+
args?: string[];
|
|
76
|
+
}): WindowsSandboxLaunchMetadata;
|
|
77
|
+
export declare function buildWindowsProcessTreeLauncherAuditEnvelope(): WindowsProcessTreeLauncherAuditEnvelope;
|
|
78
|
+
export declare function createWindowsProcessTreeLauncher(dependencies?: WindowsProcessTreeLauncherDependencies): WindowsProcessTreeLauncher;
|
|
@@ -39,6 +39,14 @@ export interface SessionMetadata {
|
|
|
39
39
|
groupKey?: string;
|
|
40
40
|
groupName?: string;
|
|
41
41
|
groupPlatform?: string;
|
|
42
|
+
assistant?: {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
source: "builtin" | "user" | "plugin";
|
|
46
|
+
contextHash: string;
|
|
47
|
+
enabledSkills: string[];
|
|
48
|
+
disabledBuiltinSkills: string[];
|
|
49
|
+
};
|
|
42
50
|
totalInputTokens?: number;
|
|
43
51
|
totalOutputTokens?: number;
|
|
44
52
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SkillSandboxAvailability } from "../../runtime/sandbox/skill-sandbox.js";
|
|
1
2
|
export type CommunitySandboxRedTeamFinding = "community-sandbox:shell-exec" | "community-sandbox:file-read" | "community-sandbox:file-write" | "community-sandbox:network-egress" | "community-sandbox:mcp-call" | "community-sandbox:host-side-effect" | "community-sandbox:data-egress" | "community-sandbox:provider-prompt-egress" | "community-sandbox:provider-media-egress";
|
|
2
3
|
export interface CommunitySandboxRedTeamCase {
|
|
3
4
|
id: string;
|
|
@@ -13,6 +14,7 @@ export interface CommunitySandboxRedTeamReport {
|
|
|
13
14
|
failures: number;
|
|
14
15
|
telemetryEvents: number;
|
|
15
16
|
approvalRequests: number;
|
|
17
|
+
l0: SkillSandboxAvailability;
|
|
16
18
|
breakdown: Record<CommunitySandboxRedTeamFinding, {
|
|
17
19
|
cases: number;
|
|
18
20
|
failures: number;
|
|
@@ -2,7 +2,7 @@ import type { HookRegistry } from "../../contracts/hooks.js";
|
|
|
2
2
|
import type { ChatMessage } from "../../protocol/wire/index.js";
|
|
3
3
|
import type { ToolDefinition } from "../../protocol/wire/index.js";
|
|
4
4
|
import { PermissionRuleEngine } from "./rule-engine.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { ApprovalRequest, ApprovalResponse } from "./types.js";
|
|
6
6
|
import { type ClassifierLLMCall } from "./permission-classifier.js";
|
|
7
7
|
import { DenialAuditLogger } from "./denial-audit-log.js";
|
|
8
8
|
export type PermissionRole = "interactive" | "coordinator" | "worker";
|
|
@@ -15,8 +15,6 @@ export interface PermissionCheckerDeps {
|
|
|
15
15
|
* If the host does not support approval, this should reject or return deny.
|
|
16
16
|
*/
|
|
17
17
|
onRequestApproval: (request: ApprovalRequest) => Promise<ApprovalResponse>;
|
|
18
|
-
/** Called when a persistent permission update is returned from the approval dialog */
|
|
19
|
-
onPermissionUpdate?: (update: PermissionUpdate) => void;
|
|
20
18
|
/** Called when a tool is denied (for logging/observability) */
|
|
21
19
|
onDenied?: (toolName: string, message: string) => void;
|
|
22
20
|
/**
|
|
@@ -55,7 +53,6 @@ export declare class PermissionChecker {
|
|
|
55
53
|
private readonly ruleEngine;
|
|
56
54
|
private readonly hookRegistry;
|
|
57
55
|
private readonly onRequestApproval;
|
|
58
|
-
private readonly onPermissionUpdate;
|
|
59
56
|
private readonly onDenied;
|
|
60
57
|
private readonly classifierLLMCall;
|
|
61
58
|
private readonly getRecentMessages;
|
|
@@ -93,6 +90,7 @@ export declare class PermissionChecker {
|
|
|
93
90
|
/** Fire permission.denied hook + onDenied callback + audit log */
|
|
94
91
|
private fireDenied;
|
|
95
92
|
private handleResult;
|
|
93
|
+
private toConfirmationRequest;
|
|
96
94
|
private handleInteractiveApproval;
|
|
97
95
|
/**
|
|
98
96
|
* Worker/coordinator "ask" handler: classifier-only, no approval dialog.
|
|
@@ -10,4 +10,4 @@ export type { CachedClassification } from "./classifier-cache.js";
|
|
|
10
10
|
export { watchSettings, loadInitialSettings } from "./settings-watcher.js";
|
|
11
11
|
export type { SettingsFile, SettingsWatcherDeps } from "./settings-watcher.js";
|
|
12
12
|
export { getGroupSecurityRules, isGroupSensitivePath } from "./group-security-policy.js";
|
|
13
|
-
export type { PermissionMode, PermissionBehavior, PermissionResult, PermissionRuleEntry, PermissionConfig,
|
|
13
|
+
export type { PermissionMode, PermissionBehavior, PermissionResult, PermissionRuleEntry, PermissionConfig, PermissionDecisionReason, ToolPermissionCheckInput, ApprovalRequest, ApprovalResponse, } from "./types.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { PermissionMode, PermissionBehavior, PermissionResult, PermissionRuleEntry,
|
|
1
|
+
import type { PermissionMode, PermissionBehavior, PermissionResult, PermissionRuleEntry, PermissionEngineConfig, ToolPermissionCheckInput } from "./types.js";
|
|
2
2
|
export declare class PermissionRuleEngine {
|
|
3
3
|
private mode;
|
|
4
4
|
private rules;
|
|
5
5
|
private defaultBehavior;
|
|
6
6
|
private compiledPatterns;
|
|
7
|
-
constructor(config:
|
|
7
|
+
constructor(config: PermissionEngineConfig);
|
|
8
8
|
getMode(): PermissionMode;
|
|
9
9
|
setMode(mode: PermissionMode): void;
|
|
10
10
|
getRules(): readonly PermissionRuleEntry[];
|
|
@@ -14,10 +14,6 @@ export declare class PermissionRuleEngine {
|
|
|
14
14
|
/** Update the default behavior (for settings hot-reload). */
|
|
15
15
|
setDefaultBehavior(behavior: PermissionBehavior): void;
|
|
16
16
|
addRule(rule: PermissionRuleEntry): void;
|
|
17
|
-
/**
|
|
18
|
-
* Apply a persistent permission update (e.g. from approval dialog "always allow").
|
|
19
|
-
*/
|
|
20
|
-
applyUpdate(update: PermissionUpdate): void;
|
|
21
17
|
/**
|
|
22
18
|
* 4-layer permission check (cc hasPermissionsToUseTool parity).
|
|
23
19
|
*
|
|
@@ -32,7 +28,7 @@ export declare class PermissionRuleEngine {
|
|
|
32
28
|
/**
|
|
33
29
|
* Parse permission config from Gateway-injected or local settings.
|
|
34
30
|
*
|
|
35
|
-
* Accepts only the
|
|
36
|
-
*
|
|
31
|
+
* Accepts only the user-facing permission mode. Historical rules/defaultBehavior
|
|
32
|
+
* fields are ignored so old config cannot create a fourth user permission mode.
|
|
37
33
|
*/
|
|
38
|
-
export declare function parsePermissionConfig(raw: unknown):
|
|
34
|
+
export declare function parsePermissionConfig(raw: unknown): PermissionEngineConfig;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { PERMISSION_MODES, } from "../../runtime/ports/permission-contracts.js";
|
|
2
|
-
export type { ApprovalRequest, ApprovalResponse, PermissionAllowResult, PermissionAskResult, PermissionBehavior, PermissionConfig, PermissionDecisionReason, PermissionDenyResult, PermissionMode, PermissionRiskLevel, PermissionResult, PermissionRuleEntry,
|
|
2
|
+
export type { ApprovalRequest, ApprovalResponse, PermissionAllowResult, PermissionAskResult, PermissionBehavior, PermissionConfig, PermissionDecisionReason, PermissionDenyResult, PermissionEngineConfig, PermissionMode, PermissionRiskLevel, PermissionResult, PermissionRuleEntry, ToolPermissionCheckInput, } from "../../runtime/ports/permission-contracts.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PortableTool } from "../portable-tool.js";
|
|
2
2
|
import type { HookRegistry } from "../../contracts/hooks.js";
|
|
3
|
+
import type { AssistantPreset } from "../../assistants/assistant-types.js";
|
|
3
4
|
import type { WorkspaceSkill } from "../skill-system/skill-types.js";
|
|
4
5
|
import { type LoadedPlugin } from "./plugin-api.js";
|
|
5
6
|
interface PluginToolRegistry {
|
|
@@ -23,6 +24,7 @@ export declare class PluginLoader {
|
|
|
23
24
|
private config;
|
|
24
25
|
private loaded;
|
|
25
26
|
private pluginSkills;
|
|
27
|
+
private pluginAssistants;
|
|
26
28
|
private activations;
|
|
27
29
|
private log;
|
|
28
30
|
constructor(config: PluginLoaderConfig);
|
|
@@ -35,6 +37,7 @@ export declare class PluginLoader {
|
|
|
35
37
|
* Get all skills registered by plugins.
|
|
36
38
|
*/
|
|
37
39
|
getPluginSkills(): WorkspaceSkill[];
|
|
40
|
+
getPluginAssistants(): AssistantPreset[];
|
|
38
41
|
/**
|
|
39
42
|
* Get list of all loaded plugins.
|
|
40
43
|
*/
|
|
@@ -51,6 +54,7 @@ export declare class PluginLoader {
|
|
|
51
54
|
*/
|
|
52
55
|
refreshActivations(): Promise<void>;
|
|
53
56
|
private loadPlugin;
|
|
57
|
+
private loadAssistantManifest;
|
|
54
58
|
private addRegisteredTool;
|
|
55
59
|
private removeRegisteredTool;
|
|
56
60
|
}
|
|
@@ -11,11 +11,18 @@ export interface SkillLifecycleRecord {
|
|
|
11
11
|
pinned: boolean;
|
|
12
12
|
useCount: number;
|
|
13
13
|
source: "learned" | "created" | "installed" | "promoted";
|
|
14
|
+
resourceType?: string;
|
|
15
|
+
launcherRequired?: boolean;
|
|
16
|
+
manualReviewRequired?: boolean;
|
|
17
|
+
sourceTier?: "official" | "community";
|
|
18
|
+
riskTier?: "R0" | "R1" | "R2" | "R3";
|
|
19
|
+
artifactDigest?: string;
|
|
14
20
|
registryResourceId?: string;
|
|
15
21
|
registryVersion?: string;
|
|
16
22
|
registrySourceTier?: "official" | "community";
|
|
17
23
|
registryRiskTier?: "R0" | "R1" | "R2" | "R3";
|
|
18
24
|
registryEffectiveRiskTier?: "R0" | "R1" | "R2" | "R3";
|
|
25
|
+
registryKeptSignalAt?: string;
|
|
19
26
|
}
|
|
20
27
|
export interface SkillLifecycleStore {
|
|
21
28
|
version: 1;
|