@percena/weft 0.4.0-next.3 → 0.4.0-next.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.
- package/dist/action-bridge.cjs +172 -6
- package/dist/action-bridge.d.cts +112 -13
- package/dist/action-bridge.d.ts +112 -13
- package/dist/action-bridge.js +166 -4
- package/dist/chat.cjs +982 -3
- package/dist/chat.d.cts +30 -1
- package/dist/chat.d.ts +30 -1
- package/dist/chat.js +981 -2
- package/dist/index.cjs +341 -1616
- package/dist/index.d.cts +4 -274
- package/dist/index.d.ts +4 -274
- package/dist/index.js +174 -1408
- package/dist/styles/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/styles/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/styles/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/styles/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/styles/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/package.json +2 -30
- package/dist/local-runtime.cjs +0 -1387
- package/dist/local-runtime.d.cts +0 -3314
- package/dist/local-runtime.d.ts +0 -3314
- package/dist/local-runtime.js +0 -1345
- package/dist/skills-browser.cjs +0 -118
- package/dist/skills-browser.d.cts +0 -105
- package/dist/skills-browser.d.ts +0 -105
- package/dist/skills-browser.js +0 -88
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export { AgentCommandSink, AgentEventStream, AgentRuntime, AgentRuntimeKind, AgentRuntimeState, AgentRuntimeStatus, AgentTimelineStream,
|
|
2
|
-
export {
|
|
3
|
-
export { AgentSession, UseAgentSessionOptions, useAgentSession } from '
|
|
1
|
+
export { AgentCommandSink, AgentEventStream, AgentRuntime, AgentRuntimeKind, AgentRuntimeState, AgentRuntimeStatus, AgentTimelineStream, SendMessageOptions };
|
|
2
|
+
export { TimelineCursor, TimelineEnvelope, TimelineFetchRequest, TimelineFetchResult, TimelineItem, TimelinePermissionRequest, TimelinePermissionResolution };
|
|
3
|
+
export { AgentSession, UseAgentSessionOptions, useAgentSession } from './chat.cjs';
|
|
4
4
|
export { CreateFlitroEmbedRuntimeOptions, createFlitroEmbedRuntime };
|
|
5
5
|
export { AgentChatPanel, TimelineAgentChatPanel, useAgentChatSession, useTimelineAgentChatSession };
|
|
6
6
|
export { EN_FALLBACK };
|
|
7
|
+
import '@weft/ui';
|
|
7
8
|
|
|
8
9
|
// ── inlined from @weft/core ──
|
|
9
10
|
// -- @weft/core/index.d.ts --
|
|
@@ -3096,277 +3097,6 @@ declare function createRuntimeCapabilityReport(options: CreateRuntimeCapabilityR
|
|
|
3096
3097
|
|
|
3097
3098
|
export { type AgentCommandSink, type AgentEventStream, type AgentRuntime, type AgentRuntimeKind, type AgentRuntimeOptions, type AgentRuntimeState, type AgentRuntimeStatus, type AgentTimelineStream, type BrowserActionReceipt, type BrowserActionRequest, type CodexPermissionParams, type CommandOrigin, type CommandReceipt, type CreateRuntimeCapabilityReportOptions, type CreateSkillRequest, type CreateSkillResult, type CreateSourceRequest, type CreateSourceResult, type DeleteSkillRequest, type DeleteSkillResult, type DeleteSourceRequest, type DeleteSourceResult, type GetAutomationsConfigRequest, type GetAutomationsConfigResult, type GetSkillRequest, type GetSkillResult, type GetSourceRequest, type GetSourceResult, type InterSessionMessageRequest, type InvokeSessionToolOptions, type ListSchedulesRequest, type ListSchedulesResult, type ListSkillsRequest, type ListSkillsResult, type ListSourcesRequest, type ListSourcesResult, type LlmToolRequest, type LlmToolResult, type ProviderAuthDetection, type ProviderAuthMode, type ProviderSourceCredentialRef, type ProviderSourceToolDescriptor, RUNTIME_KINDS, type RuntimeAction, type RuntimeAuthDetection, type RuntimeAutomationCapabilities, type RuntimeCandidate, type RuntimeCapabilityReport, type RuntimeExtensionCapabilities, type RuntimeExtensionContext, type RuntimeFeatureCapabilities, type RuntimeHostServices, type RuntimeHostToolCapabilities, type RuntimePermissionScope, type RuntimePermissionScopeInput, type RuntimePolicyCapabilities, type RuntimePolicyExtension, type RuntimePolicyHook, type RuntimeSelection, type RuntimeSelectionOptions, type RuntimeSkillCapabilities, type RuntimeSourceCapabilities, type RuntimeToolIntent, type ScheduleSummary, type SendMessageOptions, type SessionListRequest, type SessionListResult, type SessionMetadataPatch, type SessionMetadataSnapshot, type SessionToolBridge, type SessionToolInvocationReceipt, type SessionToolName, type SessionToolRequest, type SessionToolTimelineRef, type SkillSelection, type SkillSummary, type SourceActivationReceipt, type SourceActivationRequest, type SourceAuthReceipt, type SourceAuthRequest, type SourceSelection, type SourceSummary, type SpawnSessionReceipt, type SpawnSessionRequest, type StartScheduleRequest, type StartScheduleResult, type StopScheduleRequest, type StopScheduleResult, type SubmitPlanReceipt, type SubmitPlanRequest, type ToolPolicyDecision, type ToolPolicyRequest, type UpdateAutomationsConfigRequest, type UpdateAutomationsConfigResult, type UpdateSkillRequest, type UpdateSkillResult, type UpdateSourceRequest, type UpdateSourceResult, createRuntimeCapabilityReport, createRuntimeExtensionContext, initialRuntimeState, invokeSessionTool, mapCodexSandboxModeToSandboxPolicy, mapPermissionModeToCodexParams, reduceRuntimeState, sanitizeProviderSourceTools, selectRuntimeCandidate };
|
|
3098
3099
|
|
|
3099
|
-
// ── inlined from @weft/policy ──
|
|
3100
|
-
// -- @weft/policy/index.d.ts --
|
|
3101
|
-
|
|
3102
|
-
type ToolPolicyDecision = {
|
|
3103
|
-
decision: 'allow';
|
|
3104
|
-
} | {
|
|
3105
|
-
decision: 'ask';
|
|
3106
|
-
reason: string;
|
|
3107
|
-
} | {
|
|
3108
|
-
decision: 'deny';
|
|
3109
|
-
reason: string;
|
|
3110
|
-
};
|
|
3111
|
-
type ToolIntent = {
|
|
3112
|
-
kind: 'bash';
|
|
3113
|
-
command: string;
|
|
3114
|
-
baseCommand: string;
|
|
3115
|
-
} | {
|
|
3116
|
-
kind: 'file_write';
|
|
3117
|
-
path: string;
|
|
3118
|
-
toolName: string;
|
|
3119
|
-
} | {
|
|
3120
|
-
kind: 'mcp';
|
|
3121
|
-
name: string;
|
|
3122
|
-
} | {
|
|
3123
|
-
kind: 'api';
|
|
3124
|
-
method: string;
|
|
3125
|
-
path: string;
|
|
3126
|
-
url?: string;
|
|
3127
|
-
} | {
|
|
3128
|
-
kind: 'unknown';
|
|
3129
|
-
toolName: string;
|
|
3130
|
-
};
|
|
3131
|
-
interface PolicyRuleMatch {
|
|
3132
|
-
layerId: string;
|
|
3133
|
-
ruleType: 'bash-pattern' | 'mcp-pattern' | 'api-endpoint' | 'write-path' | 'blocked-command-hint';
|
|
3134
|
-
pattern: string;
|
|
3135
|
-
}
|
|
3136
|
-
type ToolPolicyExplanation = ToolPolicyDecision & {
|
|
3137
|
-
intent: ToolIntent;
|
|
3138
|
-
matchedRule?: PolicyRuleMatch;
|
|
3139
|
-
hint?: string;
|
|
3140
|
-
tryInstead?: string[];
|
|
3141
|
-
hintContext?: string;
|
|
3142
|
-
};
|
|
3143
|
-
/**
|
|
3144
|
-
* Policy decision receipt — a full audit record for every allow/ask/deny decision.
|
|
3145
|
-
*
|
|
3146
|
-
* Required by §11.8.2: each policy decision must produce a machine-readable receipt
|
|
3147
|
-
* with requestId, matchedRule, scope, origin, ttl, and explain, plus timelineRef
|
|
3148
|
-
* for cross-referencing with the canonical timeline.
|
|
3149
|
-
*/
|
|
3150
|
-
interface PolicyDecisionReceipt {
|
|
3151
|
-
/** Unique request identifier for audit trail */
|
|
3152
|
-
requestId: string;
|
|
3153
|
-
/** The policy decision (allow/ask/deny) */
|
|
3154
|
-
decision: ToolPolicyDecision;
|
|
3155
|
-
/** Full explain output used to derive the receipt */
|
|
3156
|
-
explain: ToolPolicyExplanation;
|
|
3157
|
-
/** The tool intent that was evaluated */
|
|
3158
|
-
intent: ToolIntent;
|
|
3159
|
-
/** Which rule matched (if any) */
|
|
3160
|
-
matchedRule?: PolicyRuleMatch;
|
|
3161
|
-
/** The scope in which the decision applies */
|
|
3162
|
-
scope?: PermissionScopeInput;
|
|
3163
|
-
/** Who or what originated the request */
|
|
3164
|
-
origin?: PermissionApprovalOrigin;
|
|
3165
|
-
/** How long the allow decision is valid (ms since epoch), if applicable */
|
|
3166
|
-
ttl?: number;
|
|
3167
|
-
/** Blocked command hint for deny decisions */
|
|
3168
|
-
hint?: string;
|
|
3169
|
-
/** Timeline envelope references for audit cross-referencing */
|
|
3170
|
-
timelineRefs?: Array<{
|
|
3171
|
-
epoch: string;
|
|
3172
|
-
seq: number;
|
|
3173
|
-
}>;
|
|
3174
|
-
}
|
|
3175
|
-
interface CreatePolicyDecisionReceiptOptions {
|
|
3176
|
-
requestId: string;
|
|
3177
|
-
policy: PermissionPolicy;
|
|
3178
|
-
request: ToolPolicyRequest;
|
|
3179
|
-
origin?: PermissionApprovalOrigin;
|
|
3180
|
-
ttl?: number;
|
|
3181
|
-
timelineRefs?: Array<{
|
|
3182
|
-
epoch: string;
|
|
3183
|
-
seq: number;
|
|
3184
|
-
}>;
|
|
3185
|
-
}
|
|
3186
|
-
type PermissionScope = {
|
|
3187
|
-
type: 'session';
|
|
3188
|
-
sessionId: string;
|
|
3189
|
-
} | {
|
|
3190
|
-
type: 'workspace';
|
|
3191
|
-
workspaceId: string;
|
|
3192
|
-
} | {
|
|
3193
|
-
type: 'source';
|
|
3194
|
-
sourceSlug: string;
|
|
3195
|
-
} | {
|
|
3196
|
-
type: 'skill';
|
|
3197
|
-
skillSlug: string;
|
|
3198
|
-
} | {
|
|
3199
|
-
type: 'automation';
|
|
3200
|
-
automationId: string;
|
|
3201
|
-
} | {
|
|
3202
|
-
type: 'tool-call';
|
|
3203
|
-
callId: string;
|
|
3204
|
-
};
|
|
3205
|
-
type PermissionScopeInput = string | PermissionScope;
|
|
3206
|
-
type PermissionApprovalOrigin = {
|
|
3207
|
-
type: 'user';
|
|
3208
|
-
id?: string;
|
|
3209
|
-
} | {
|
|
3210
|
-
type: 'automation';
|
|
3211
|
-
id: string;
|
|
3212
|
-
} | {
|
|
3213
|
-
type: 'system';
|
|
3214
|
-
id?: string;
|
|
3215
|
-
};
|
|
3216
|
-
interface AlwaysAllowRule {
|
|
3217
|
-
toolName: string;
|
|
3218
|
-
scope?: PermissionScopeInput;
|
|
3219
|
-
}
|
|
3220
|
-
interface ApiEndpointRule {
|
|
3221
|
-
method: string;
|
|
3222
|
-
pattern: string;
|
|
3223
|
-
}
|
|
3224
|
-
interface BlockedCommandHintRule {
|
|
3225
|
-
command: string;
|
|
3226
|
-
reason: string;
|
|
3227
|
-
whenNotMatching?: string;
|
|
3228
|
-
tryInstead?: string[];
|
|
3229
|
-
context?: string;
|
|
3230
|
-
}
|
|
3231
|
-
interface PolicyRuleSet {
|
|
3232
|
-
allowedBashPatterns?: string[];
|
|
3233
|
-
allowedMcpPatterns?: string[];
|
|
3234
|
-
allowedApiEndpoints?: ApiEndpointRule[];
|
|
3235
|
-
allowedWritePaths?: string[];
|
|
3236
|
-
blockedCommandHints?: BlockedCommandHintRule[];
|
|
3237
|
-
}
|
|
3238
|
-
interface PolicyLayer {
|
|
3239
|
-
id: string;
|
|
3240
|
-
rules: PolicyRuleSet;
|
|
3241
|
-
scope?: PermissionScopeInput;
|
|
3242
|
-
}
|
|
3243
|
-
interface PermissionApproval {
|
|
3244
|
-
id: string;
|
|
3245
|
-
toolName: string;
|
|
3246
|
-
scope: PermissionScope;
|
|
3247
|
-
origin: PermissionApprovalOrigin;
|
|
3248
|
-
createdAt?: number;
|
|
3249
|
-
expiresAt?: number;
|
|
3250
|
-
}
|
|
3251
|
-
interface PermissionApprovalStore {
|
|
3252
|
-
remember(approval: PermissionApproval): void;
|
|
3253
|
-
revoke(id: string): void;
|
|
3254
|
-
snapshot(): PermissionApproval[];
|
|
3255
|
-
}
|
|
3256
|
-
interface PermissionPolicy {
|
|
3257
|
-
mode: PermissionMode;
|
|
3258
|
-
alwaysAllow: AlwaysAllowRule[];
|
|
3259
|
-
approvals: PermissionApproval[];
|
|
3260
|
-
layers: PolicyLayer[];
|
|
3261
|
-
}
|
|
3262
|
-
interface CreatePermissionPolicyOptions {
|
|
3263
|
-
mode?: PermissionMode;
|
|
3264
|
-
alwaysAllow?: AlwaysAllowRule[];
|
|
3265
|
-
approvals?: PermissionApproval[];
|
|
3266
|
-
layers?: PolicyLayer[];
|
|
3267
|
-
}
|
|
3268
|
-
interface CreateSourcePolicyLayerOptions {
|
|
3269
|
-
sourceSlug: string;
|
|
3270
|
-
rules: PolicyRuleSet;
|
|
3271
|
-
id?: string;
|
|
3272
|
-
}
|
|
3273
|
-
interface PolicyConfigLayer {
|
|
3274
|
-
id: string;
|
|
3275
|
-
sourceSlug?: string;
|
|
3276
|
-
scope?: PermissionScopeInput;
|
|
3277
|
-
rules: PolicyRuleSet;
|
|
3278
|
-
}
|
|
3279
|
-
interface PolicyConfigFile {
|
|
3280
|
-
mode?: PermissionMode;
|
|
3281
|
-
alwaysAllow?: AlwaysAllowRule[];
|
|
3282
|
-
approvals?: PermissionApproval[];
|
|
3283
|
-
layers?: PolicyConfigLayer[];
|
|
3284
|
-
}
|
|
3285
|
-
interface PolicyConfigIssue {
|
|
3286
|
-
path: string;
|
|
3287
|
-
message: string;
|
|
3288
|
-
suggestion?: string;
|
|
3289
|
-
}
|
|
3290
|
-
interface PolicyConfigValidationResult {
|
|
3291
|
-
valid: boolean;
|
|
3292
|
-
errors: PolicyConfigIssue[];
|
|
3293
|
-
warnings: PolicyConfigIssue[];
|
|
3294
|
-
}
|
|
3295
|
-
interface CreatePermissionPolicyFromConfigResult {
|
|
3296
|
-
validation: PolicyConfigValidationResult;
|
|
3297
|
-
policy?: PermissionPolicy;
|
|
3298
|
-
}
|
|
3299
|
-
interface ToolPolicyRequest {
|
|
3300
|
-
toolName: string;
|
|
3301
|
-
input?: Record<string, unknown>;
|
|
3302
|
-
toolIntent?: ToolIntent;
|
|
3303
|
-
scope?: PermissionScopeInput;
|
|
3304
|
-
}
|
|
3305
|
-
interface CreateApprovalStoreOptions {
|
|
3306
|
-
now?: () => number;
|
|
3307
|
-
}
|
|
3308
|
-
declare function createPermissionPolicy(options?: CreatePermissionPolicyOptions): PermissionPolicy;
|
|
3309
|
-
declare function createSourcePolicyLayer(options: CreateSourcePolicyLayerOptions): PolicyLayer;
|
|
3310
|
-
declare function validatePolicyConfig(input: unknown): PolicyConfigValidationResult;
|
|
3311
|
-
declare function createPermissionPolicyFromConfig(input: unknown): CreatePermissionPolicyFromConfigResult;
|
|
3312
|
-
declare function evaluateToolPolicy(policy: PermissionPolicy, request: ToolPolicyRequest): ToolPolicyDecision;
|
|
3313
|
-
declare function createPolicyDecisionReceipt(options: CreatePolicyDecisionReceiptOptions): PolicyDecisionReceipt;
|
|
3314
|
-
declare function explainToolPolicy(policy: PermissionPolicy, request: ToolPolicyRequest): ToolPolicyExplanation;
|
|
3315
|
-
declare function createInMemoryApprovalStore(options?: CreateApprovalStoreOptions): PermissionApprovalStore;
|
|
3316
|
-
interface BlockedCommandHintResult {
|
|
3317
|
-
reason: string;
|
|
3318
|
-
match: PolicyRuleMatch;
|
|
3319
|
-
tryInstead?: string[];
|
|
3320
|
-
context?: string;
|
|
3321
|
-
}
|
|
3322
|
-
|
|
3323
|
-
export { type AlwaysAllowRule, type ApiEndpointRule, type BlockedCommandHintResult, type BlockedCommandHintRule, type CreateApprovalStoreOptions, type CreatePermissionPolicyFromConfigResult, type CreatePermissionPolicyOptions, type CreatePolicyDecisionReceiptOptions, type CreateSourcePolicyLayerOptions, type PermissionApproval, type PermissionApprovalOrigin, type PermissionApprovalStore, type PermissionPolicy, type PermissionScope, type PermissionScopeInput, type PolicyConfigFile, type PolicyConfigIssue, type PolicyConfigLayer, type PolicyConfigValidationResult, type PolicyDecisionReceipt, type PolicyLayer, type PolicyRuleMatch, type PolicyRuleSet, type ToolIntent, type ToolPolicyDecision, type ToolPolicyExplanation, type ToolPolicyRequest, createInMemoryApprovalStore, createPermissionPolicy, createPermissionPolicyFromConfig, createPolicyDecisionReceipt, createSourcePolicyLayer, evaluateToolPolicy, explainToolPolicy, validatePolicyConfig };
|
|
3324
|
-
|
|
3325
|
-
// -- @weft/policy/loader.d.ts --
|
|
3326
|
-
import '@weft/core';
|
|
3327
|
-
|
|
3328
|
-
interface PolicyFileContents {
|
|
3329
|
-
allowedBashPatterns?: string[];
|
|
3330
|
-
allowedMcpPatterns?: string[];
|
|
3331
|
-
allowedApiEndpoints?: ApiEndpointRule[];
|
|
3332
|
-
allowedWritePaths?: string[];
|
|
3333
|
-
blockedCommandHints?: BlockedCommandHintRule[];
|
|
3334
|
-
}
|
|
3335
|
-
interface PolicyFileLoadResult {
|
|
3336
|
-
rules: PolicyRuleSet;
|
|
3337
|
-
path: string;
|
|
3338
|
-
errors: string[];
|
|
3339
|
-
}
|
|
3340
|
-
interface LoadPolicyLayersOptions {
|
|
3341
|
-
globalPath?: string;
|
|
3342
|
-
workspacePath?: string;
|
|
3343
|
-
}
|
|
3344
|
-
declare function loadPolicyFile(filePath: string): Promise<PolicyFileLoadResult>;
|
|
3345
|
-
declare function loadPolicyLayers(options?: LoadPolicyLayersOptions): Promise<{
|
|
3346
|
-
layers: PolicyLayer[];
|
|
3347
|
-
errors: string[];
|
|
3348
|
-
}>;
|
|
3349
|
-
|
|
3350
|
-
export { type LoadPolicyLayersOptions, type PolicyFileContents, type PolicyFileLoadResult, loadPolicyFile, loadPolicyLayers };
|
|
3351
|
-
|
|
3352
|
-
// -- @weft/policy/merge.d.ts --
|
|
3353
|
-
import '@weft/core';
|
|
3354
|
-
|
|
3355
|
-
/**
|
|
3356
|
-
* Merge multiple PolicyRuleSets into one. Later entries take precedence
|
|
3357
|
-
* for blockedCommandHints (last hint per command wins), while array fields
|
|
3358
|
-
* (patterns, paths, endpoints) are concatenated and deduplicated.
|
|
3359
|
-
*/
|
|
3360
|
-
declare function mergePolicyRuleSets(...sets: PolicyRuleSet[]): PolicyRuleSet;
|
|
3361
|
-
/**
|
|
3362
|
-
* Merge multiple PolicyLayers into a single flat layer. Used when
|
|
3363
|
-
* combining global + workspace file-based layers into one layer
|
|
3364
|
-
* before appending to a policy's existing layers.
|
|
3365
|
-
*/
|
|
3366
|
-
declare function mergePolicyLayers(layers: PolicyLayer[], id: string): PolicyLayer | undefined;
|
|
3367
|
-
|
|
3368
|
-
export { mergePolicyLayers, mergePolicyRuleSets };
|
|
3369
|
-
|
|
3370
3100
|
// ── inlined from @percena/weft-client ──
|
|
3371
3101
|
// -- @percena/weft-client/index.d.ts --
|
|
3372
3102
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export { AgentCommandSink, AgentEventStream, AgentRuntime, AgentRuntimeKind, AgentRuntimeState, AgentRuntimeStatus, AgentTimelineStream,
|
|
2
|
-
export {
|
|
3
|
-
export { AgentSession, UseAgentSessionOptions, useAgentSession } from '
|
|
1
|
+
export { AgentCommandSink, AgentEventStream, AgentRuntime, AgentRuntimeKind, AgentRuntimeState, AgentRuntimeStatus, AgentTimelineStream, SendMessageOptions };
|
|
2
|
+
export { TimelineCursor, TimelineEnvelope, TimelineFetchRequest, TimelineFetchResult, TimelineItem, TimelinePermissionRequest, TimelinePermissionResolution };
|
|
3
|
+
export { AgentSession, UseAgentSessionOptions, useAgentSession } from './chat.js';
|
|
4
4
|
export { CreateFlitroEmbedRuntimeOptions, createFlitroEmbedRuntime };
|
|
5
5
|
export { AgentChatPanel, TimelineAgentChatPanel, useAgentChatSession, useTimelineAgentChatSession };
|
|
6
6
|
export { EN_FALLBACK };
|
|
7
|
+
import '@weft/ui';
|
|
7
8
|
|
|
8
9
|
// ── inlined from @weft/core ──
|
|
9
10
|
// -- @weft/core/index.d.ts --
|
|
@@ -3096,277 +3097,6 @@ declare function createRuntimeCapabilityReport(options: CreateRuntimeCapabilityR
|
|
|
3096
3097
|
|
|
3097
3098
|
export { type AgentCommandSink, type AgentEventStream, type AgentRuntime, type AgentRuntimeKind, type AgentRuntimeOptions, type AgentRuntimeState, type AgentRuntimeStatus, type AgentTimelineStream, type BrowserActionReceipt, type BrowserActionRequest, type CodexPermissionParams, type CommandOrigin, type CommandReceipt, type CreateRuntimeCapabilityReportOptions, type CreateSkillRequest, type CreateSkillResult, type CreateSourceRequest, type CreateSourceResult, type DeleteSkillRequest, type DeleteSkillResult, type DeleteSourceRequest, type DeleteSourceResult, type GetAutomationsConfigRequest, type GetAutomationsConfigResult, type GetSkillRequest, type GetSkillResult, type GetSourceRequest, type GetSourceResult, type InterSessionMessageRequest, type InvokeSessionToolOptions, type ListSchedulesRequest, type ListSchedulesResult, type ListSkillsRequest, type ListSkillsResult, type ListSourcesRequest, type ListSourcesResult, type LlmToolRequest, type LlmToolResult, type ProviderAuthDetection, type ProviderAuthMode, type ProviderSourceCredentialRef, type ProviderSourceToolDescriptor, RUNTIME_KINDS, type RuntimeAction, type RuntimeAuthDetection, type RuntimeAutomationCapabilities, type RuntimeCandidate, type RuntimeCapabilityReport, type RuntimeExtensionCapabilities, type RuntimeExtensionContext, type RuntimeFeatureCapabilities, type RuntimeHostServices, type RuntimeHostToolCapabilities, type RuntimePermissionScope, type RuntimePermissionScopeInput, type RuntimePolicyCapabilities, type RuntimePolicyExtension, type RuntimePolicyHook, type RuntimeSelection, type RuntimeSelectionOptions, type RuntimeSkillCapabilities, type RuntimeSourceCapabilities, type RuntimeToolIntent, type ScheduleSummary, type SendMessageOptions, type SessionListRequest, type SessionListResult, type SessionMetadataPatch, type SessionMetadataSnapshot, type SessionToolBridge, type SessionToolInvocationReceipt, type SessionToolName, type SessionToolRequest, type SessionToolTimelineRef, type SkillSelection, type SkillSummary, type SourceActivationReceipt, type SourceActivationRequest, type SourceAuthReceipt, type SourceAuthRequest, type SourceSelection, type SourceSummary, type SpawnSessionReceipt, type SpawnSessionRequest, type StartScheduleRequest, type StartScheduleResult, type StopScheduleRequest, type StopScheduleResult, type SubmitPlanReceipt, type SubmitPlanRequest, type ToolPolicyDecision, type ToolPolicyRequest, type UpdateAutomationsConfigRequest, type UpdateAutomationsConfigResult, type UpdateSkillRequest, type UpdateSkillResult, type UpdateSourceRequest, type UpdateSourceResult, createRuntimeCapabilityReport, createRuntimeExtensionContext, initialRuntimeState, invokeSessionTool, mapCodexSandboxModeToSandboxPolicy, mapPermissionModeToCodexParams, reduceRuntimeState, sanitizeProviderSourceTools, selectRuntimeCandidate };
|
|
3098
3099
|
|
|
3099
|
-
// ── inlined from @weft/policy ──
|
|
3100
|
-
// -- @weft/policy/index.d.ts --
|
|
3101
|
-
|
|
3102
|
-
type ToolPolicyDecision = {
|
|
3103
|
-
decision: 'allow';
|
|
3104
|
-
} | {
|
|
3105
|
-
decision: 'ask';
|
|
3106
|
-
reason: string;
|
|
3107
|
-
} | {
|
|
3108
|
-
decision: 'deny';
|
|
3109
|
-
reason: string;
|
|
3110
|
-
};
|
|
3111
|
-
type ToolIntent = {
|
|
3112
|
-
kind: 'bash';
|
|
3113
|
-
command: string;
|
|
3114
|
-
baseCommand: string;
|
|
3115
|
-
} | {
|
|
3116
|
-
kind: 'file_write';
|
|
3117
|
-
path: string;
|
|
3118
|
-
toolName: string;
|
|
3119
|
-
} | {
|
|
3120
|
-
kind: 'mcp';
|
|
3121
|
-
name: string;
|
|
3122
|
-
} | {
|
|
3123
|
-
kind: 'api';
|
|
3124
|
-
method: string;
|
|
3125
|
-
path: string;
|
|
3126
|
-
url?: string;
|
|
3127
|
-
} | {
|
|
3128
|
-
kind: 'unknown';
|
|
3129
|
-
toolName: string;
|
|
3130
|
-
};
|
|
3131
|
-
interface PolicyRuleMatch {
|
|
3132
|
-
layerId: string;
|
|
3133
|
-
ruleType: 'bash-pattern' | 'mcp-pattern' | 'api-endpoint' | 'write-path' | 'blocked-command-hint';
|
|
3134
|
-
pattern: string;
|
|
3135
|
-
}
|
|
3136
|
-
type ToolPolicyExplanation = ToolPolicyDecision & {
|
|
3137
|
-
intent: ToolIntent;
|
|
3138
|
-
matchedRule?: PolicyRuleMatch;
|
|
3139
|
-
hint?: string;
|
|
3140
|
-
tryInstead?: string[];
|
|
3141
|
-
hintContext?: string;
|
|
3142
|
-
};
|
|
3143
|
-
/**
|
|
3144
|
-
* Policy decision receipt — a full audit record for every allow/ask/deny decision.
|
|
3145
|
-
*
|
|
3146
|
-
* Required by §11.8.2: each policy decision must produce a machine-readable receipt
|
|
3147
|
-
* with requestId, matchedRule, scope, origin, ttl, and explain, plus timelineRef
|
|
3148
|
-
* for cross-referencing with the canonical timeline.
|
|
3149
|
-
*/
|
|
3150
|
-
interface PolicyDecisionReceipt {
|
|
3151
|
-
/** Unique request identifier for audit trail */
|
|
3152
|
-
requestId: string;
|
|
3153
|
-
/** The policy decision (allow/ask/deny) */
|
|
3154
|
-
decision: ToolPolicyDecision;
|
|
3155
|
-
/** Full explain output used to derive the receipt */
|
|
3156
|
-
explain: ToolPolicyExplanation;
|
|
3157
|
-
/** The tool intent that was evaluated */
|
|
3158
|
-
intent: ToolIntent;
|
|
3159
|
-
/** Which rule matched (if any) */
|
|
3160
|
-
matchedRule?: PolicyRuleMatch;
|
|
3161
|
-
/** The scope in which the decision applies */
|
|
3162
|
-
scope?: PermissionScopeInput;
|
|
3163
|
-
/** Who or what originated the request */
|
|
3164
|
-
origin?: PermissionApprovalOrigin;
|
|
3165
|
-
/** How long the allow decision is valid (ms since epoch), if applicable */
|
|
3166
|
-
ttl?: number;
|
|
3167
|
-
/** Blocked command hint for deny decisions */
|
|
3168
|
-
hint?: string;
|
|
3169
|
-
/** Timeline envelope references for audit cross-referencing */
|
|
3170
|
-
timelineRefs?: Array<{
|
|
3171
|
-
epoch: string;
|
|
3172
|
-
seq: number;
|
|
3173
|
-
}>;
|
|
3174
|
-
}
|
|
3175
|
-
interface CreatePolicyDecisionReceiptOptions {
|
|
3176
|
-
requestId: string;
|
|
3177
|
-
policy: PermissionPolicy;
|
|
3178
|
-
request: ToolPolicyRequest;
|
|
3179
|
-
origin?: PermissionApprovalOrigin;
|
|
3180
|
-
ttl?: number;
|
|
3181
|
-
timelineRefs?: Array<{
|
|
3182
|
-
epoch: string;
|
|
3183
|
-
seq: number;
|
|
3184
|
-
}>;
|
|
3185
|
-
}
|
|
3186
|
-
type PermissionScope = {
|
|
3187
|
-
type: 'session';
|
|
3188
|
-
sessionId: string;
|
|
3189
|
-
} | {
|
|
3190
|
-
type: 'workspace';
|
|
3191
|
-
workspaceId: string;
|
|
3192
|
-
} | {
|
|
3193
|
-
type: 'source';
|
|
3194
|
-
sourceSlug: string;
|
|
3195
|
-
} | {
|
|
3196
|
-
type: 'skill';
|
|
3197
|
-
skillSlug: string;
|
|
3198
|
-
} | {
|
|
3199
|
-
type: 'automation';
|
|
3200
|
-
automationId: string;
|
|
3201
|
-
} | {
|
|
3202
|
-
type: 'tool-call';
|
|
3203
|
-
callId: string;
|
|
3204
|
-
};
|
|
3205
|
-
type PermissionScopeInput = string | PermissionScope;
|
|
3206
|
-
type PermissionApprovalOrigin = {
|
|
3207
|
-
type: 'user';
|
|
3208
|
-
id?: string;
|
|
3209
|
-
} | {
|
|
3210
|
-
type: 'automation';
|
|
3211
|
-
id: string;
|
|
3212
|
-
} | {
|
|
3213
|
-
type: 'system';
|
|
3214
|
-
id?: string;
|
|
3215
|
-
};
|
|
3216
|
-
interface AlwaysAllowRule {
|
|
3217
|
-
toolName: string;
|
|
3218
|
-
scope?: PermissionScopeInput;
|
|
3219
|
-
}
|
|
3220
|
-
interface ApiEndpointRule {
|
|
3221
|
-
method: string;
|
|
3222
|
-
pattern: string;
|
|
3223
|
-
}
|
|
3224
|
-
interface BlockedCommandHintRule {
|
|
3225
|
-
command: string;
|
|
3226
|
-
reason: string;
|
|
3227
|
-
whenNotMatching?: string;
|
|
3228
|
-
tryInstead?: string[];
|
|
3229
|
-
context?: string;
|
|
3230
|
-
}
|
|
3231
|
-
interface PolicyRuleSet {
|
|
3232
|
-
allowedBashPatterns?: string[];
|
|
3233
|
-
allowedMcpPatterns?: string[];
|
|
3234
|
-
allowedApiEndpoints?: ApiEndpointRule[];
|
|
3235
|
-
allowedWritePaths?: string[];
|
|
3236
|
-
blockedCommandHints?: BlockedCommandHintRule[];
|
|
3237
|
-
}
|
|
3238
|
-
interface PolicyLayer {
|
|
3239
|
-
id: string;
|
|
3240
|
-
rules: PolicyRuleSet;
|
|
3241
|
-
scope?: PermissionScopeInput;
|
|
3242
|
-
}
|
|
3243
|
-
interface PermissionApproval {
|
|
3244
|
-
id: string;
|
|
3245
|
-
toolName: string;
|
|
3246
|
-
scope: PermissionScope;
|
|
3247
|
-
origin: PermissionApprovalOrigin;
|
|
3248
|
-
createdAt?: number;
|
|
3249
|
-
expiresAt?: number;
|
|
3250
|
-
}
|
|
3251
|
-
interface PermissionApprovalStore {
|
|
3252
|
-
remember(approval: PermissionApproval): void;
|
|
3253
|
-
revoke(id: string): void;
|
|
3254
|
-
snapshot(): PermissionApproval[];
|
|
3255
|
-
}
|
|
3256
|
-
interface PermissionPolicy {
|
|
3257
|
-
mode: PermissionMode;
|
|
3258
|
-
alwaysAllow: AlwaysAllowRule[];
|
|
3259
|
-
approvals: PermissionApproval[];
|
|
3260
|
-
layers: PolicyLayer[];
|
|
3261
|
-
}
|
|
3262
|
-
interface CreatePermissionPolicyOptions {
|
|
3263
|
-
mode?: PermissionMode;
|
|
3264
|
-
alwaysAllow?: AlwaysAllowRule[];
|
|
3265
|
-
approvals?: PermissionApproval[];
|
|
3266
|
-
layers?: PolicyLayer[];
|
|
3267
|
-
}
|
|
3268
|
-
interface CreateSourcePolicyLayerOptions {
|
|
3269
|
-
sourceSlug: string;
|
|
3270
|
-
rules: PolicyRuleSet;
|
|
3271
|
-
id?: string;
|
|
3272
|
-
}
|
|
3273
|
-
interface PolicyConfigLayer {
|
|
3274
|
-
id: string;
|
|
3275
|
-
sourceSlug?: string;
|
|
3276
|
-
scope?: PermissionScopeInput;
|
|
3277
|
-
rules: PolicyRuleSet;
|
|
3278
|
-
}
|
|
3279
|
-
interface PolicyConfigFile {
|
|
3280
|
-
mode?: PermissionMode;
|
|
3281
|
-
alwaysAllow?: AlwaysAllowRule[];
|
|
3282
|
-
approvals?: PermissionApproval[];
|
|
3283
|
-
layers?: PolicyConfigLayer[];
|
|
3284
|
-
}
|
|
3285
|
-
interface PolicyConfigIssue {
|
|
3286
|
-
path: string;
|
|
3287
|
-
message: string;
|
|
3288
|
-
suggestion?: string;
|
|
3289
|
-
}
|
|
3290
|
-
interface PolicyConfigValidationResult {
|
|
3291
|
-
valid: boolean;
|
|
3292
|
-
errors: PolicyConfigIssue[];
|
|
3293
|
-
warnings: PolicyConfigIssue[];
|
|
3294
|
-
}
|
|
3295
|
-
interface CreatePermissionPolicyFromConfigResult {
|
|
3296
|
-
validation: PolicyConfigValidationResult;
|
|
3297
|
-
policy?: PermissionPolicy;
|
|
3298
|
-
}
|
|
3299
|
-
interface ToolPolicyRequest {
|
|
3300
|
-
toolName: string;
|
|
3301
|
-
input?: Record<string, unknown>;
|
|
3302
|
-
toolIntent?: ToolIntent;
|
|
3303
|
-
scope?: PermissionScopeInput;
|
|
3304
|
-
}
|
|
3305
|
-
interface CreateApprovalStoreOptions {
|
|
3306
|
-
now?: () => number;
|
|
3307
|
-
}
|
|
3308
|
-
declare function createPermissionPolicy(options?: CreatePermissionPolicyOptions): PermissionPolicy;
|
|
3309
|
-
declare function createSourcePolicyLayer(options: CreateSourcePolicyLayerOptions): PolicyLayer;
|
|
3310
|
-
declare function validatePolicyConfig(input: unknown): PolicyConfigValidationResult;
|
|
3311
|
-
declare function createPermissionPolicyFromConfig(input: unknown): CreatePermissionPolicyFromConfigResult;
|
|
3312
|
-
declare function evaluateToolPolicy(policy: PermissionPolicy, request: ToolPolicyRequest): ToolPolicyDecision;
|
|
3313
|
-
declare function createPolicyDecisionReceipt(options: CreatePolicyDecisionReceiptOptions): PolicyDecisionReceipt;
|
|
3314
|
-
declare function explainToolPolicy(policy: PermissionPolicy, request: ToolPolicyRequest): ToolPolicyExplanation;
|
|
3315
|
-
declare function createInMemoryApprovalStore(options?: CreateApprovalStoreOptions): PermissionApprovalStore;
|
|
3316
|
-
interface BlockedCommandHintResult {
|
|
3317
|
-
reason: string;
|
|
3318
|
-
match: PolicyRuleMatch;
|
|
3319
|
-
tryInstead?: string[];
|
|
3320
|
-
context?: string;
|
|
3321
|
-
}
|
|
3322
|
-
|
|
3323
|
-
export { type AlwaysAllowRule, type ApiEndpointRule, type BlockedCommandHintResult, type BlockedCommandHintRule, type CreateApprovalStoreOptions, type CreatePermissionPolicyFromConfigResult, type CreatePermissionPolicyOptions, type CreatePolicyDecisionReceiptOptions, type CreateSourcePolicyLayerOptions, type PermissionApproval, type PermissionApprovalOrigin, type PermissionApprovalStore, type PermissionPolicy, type PermissionScope, type PermissionScopeInput, type PolicyConfigFile, type PolicyConfigIssue, type PolicyConfigLayer, type PolicyConfigValidationResult, type PolicyDecisionReceipt, type PolicyLayer, type PolicyRuleMatch, type PolicyRuleSet, type ToolIntent, type ToolPolicyDecision, type ToolPolicyExplanation, type ToolPolicyRequest, createInMemoryApprovalStore, createPermissionPolicy, createPermissionPolicyFromConfig, createPolicyDecisionReceipt, createSourcePolicyLayer, evaluateToolPolicy, explainToolPolicy, validatePolicyConfig };
|
|
3324
|
-
|
|
3325
|
-
// -- @weft/policy/loader.d.ts --
|
|
3326
|
-
import '@weft/core';
|
|
3327
|
-
|
|
3328
|
-
interface PolicyFileContents {
|
|
3329
|
-
allowedBashPatterns?: string[];
|
|
3330
|
-
allowedMcpPatterns?: string[];
|
|
3331
|
-
allowedApiEndpoints?: ApiEndpointRule[];
|
|
3332
|
-
allowedWritePaths?: string[];
|
|
3333
|
-
blockedCommandHints?: BlockedCommandHintRule[];
|
|
3334
|
-
}
|
|
3335
|
-
interface PolicyFileLoadResult {
|
|
3336
|
-
rules: PolicyRuleSet;
|
|
3337
|
-
path: string;
|
|
3338
|
-
errors: string[];
|
|
3339
|
-
}
|
|
3340
|
-
interface LoadPolicyLayersOptions {
|
|
3341
|
-
globalPath?: string;
|
|
3342
|
-
workspacePath?: string;
|
|
3343
|
-
}
|
|
3344
|
-
declare function loadPolicyFile(filePath: string): Promise<PolicyFileLoadResult>;
|
|
3345
|
-
declare function loadPolicyLayers(options?: LoadPolicyLayersOptions): Promise<{
|
|
3346
|
-
layers: PolicyLayer[];
|
|
3347
|
-
errors: string[];
|
|
3348
|
-
}>;
|
|
3349
|
-
|
|
3350
|
-
export { type LoadPolicyLayersOptions, type PolicyFileContents, type PolicyFileLoadResult, loadPolicyFile, loadPolicyLayers };
|
|
3351
|
-
|
|
3352
|
-
// -- @weft/policy/merge.d.ts --
|
|
3353
|
-
import '@weft/core';
|
|
3354
|
-
|
|
3355
|
-
/**
|
|
3356
|
-
* Merge multiple PolicyRuleSets into one. Later entries take precedence
|
|
3357
|
-
* for blockedCommandHints (last hint per command wins), while array fields
|
|
3358
|
-
* (patterns, paths, endpoints) are concatenated and deduplicated.
|
|
3359
|
-
*/
|
|
3360
|
-
declare function mergePolicyRuleSets(...sets: PolicyRuleSet[]): PolicyRuleSet;
|
|
3361
|
-
/**
|
|
3362
|
-
* Merge multiple PolicyLayers into a single flat layer. Used when
|
|
3363
|
-
* combining global + workspace file-based layers into one layer
|
|
3364
|
-
* before appending to a policy's existing layers.
|
|
3365
|
-
*/
|
|
3366
|
-
declare function mergePolicyLayers(layers: PolicyLayer[], id: string): PolicyLayer | undefined;
|
|
3367
|
-
|
|
3368
|
-
export { mergePolicyLayers, mergePolicyRuleSets };
|
|
3369
|
-
|
|
3370
3100
|
// ── inlined from @percena/weft-client ──
|
|
3371
3101
|
// -- @percena/weft-client/index.d.ts --
|
|
3372
3102
|
/**
|