@codelia/runtime 0.1.86 → 0.1.89
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/{chunk-RJV3XRDN.js → chunk-LNUGYGST.js} +1071 -481
- package/dist/{chunk-ZFXISMDO.js → chunk-NPCH2IMV.js} +927 -400
- package/dist/index.cjs +2065 -1025
- package/dist/index.js +2 -2
- package/dist/sdk.cjs +2202 -1158
- package/dist/sdk.d.cts +38 -30
- package/dist/sdk.d.ts +38 -30
- package/dist/sdk.js +8 -2
- package/dist/subagents/child-entry.cjs +680 -291
- package/dist/subagents/child-entry.js +1 -1
- package/package.json +10 -10
package/dist/sdk.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TaskResult, TaskState, TaskRecord, TaskKind, TaskWorkspaceMode, TaskRegistryStore, AttachmentStore } from '@codelia/storage';
|
|
1
|
+
import { TaskResult, TaskState, TaskRecord, TaskKind, TaskWorkspaceMode, TaskRegistryStore, ProviderAuth, AttachmentStore, McpBoundServerAuth, McpServerAuthBinding } from '@codelia/storage';
|
|
2
2
|
export { AttachmentStore, StoredAttachment } from '@codelia/storage';
|
|
3
3
|
import { ChildProcessByStdio } from 'node:child_process';
|
|
4
4
|
import { Writable, Readable } from 'node:stream';
|
|
@@ -154,6 +154,8 @@ type ShellProtection = Readonly<{
|
|
|
154
154
|
protectedPaths: readonly string[];
|
|
155
155
|
/** Visible to readers, with writes denied independently of writeRoots. */
|
|
156
156
|
readOnlyPaths?: readonly string[];
|
|
157
|
+
/** Deny writes to immediate hidden home entries and their descendants, including future names. */
|
|
158
|
+
homeDotDirectory?: string;
|
|
157
159
|
/** Read-only names whose existing inode aliases also require validation. */
|
|
158
160
|
readOnlyAliasPaths?: readonly string[];
|
|
159
161
|
/** Local macOS admission only. Direct path restrictions still apply. */
|
|
@@ -168,6 +170,7 @@ type ShellProtection = Readonly<{
|
|
|
168
170
|
type ProtectedShellBackend = {
|
|
169
171
|
/** Explicit opt-in to enforcing readOnlyPaths, including their aliases. */
|
|
170
172
|
supportsReadOnlyPaths?: true;
|
|
173
|
+
supportsHomeDotProtection?: true;
|
|
171
174
|
/**
|
|
172
175
|
* Opt in only if direct argv uses the resolved executable and fixed Bash
|
|
173
176
|
* sources use protection.cwd and binPaths with host-equivalent executable
|
|
@@ -330,34 +333,6 @@ type ShellAuthority = Readonly<{
|
|
|
330
333
|
extraWriteCeiling?: readonly string[];
|
|
331
334
|
}>;
|
|
332
335
|
|
|
333
|
-
type ToolAuthority = Readonly<{
|
|
334
|
-
ceiling: readonly Resource[];
|
|
335
|
-
granted: readonly Resource[];
|
|
336
|
-
launchRule?: string;
|
|
337
|
-
}>;
|
|
338
|
-
type ToolEffect = Readonly<{
|
|
339
|
-
resources: readonly Resource[];
|
|
340
|
-
kind: "external_update" | "dependency_read";
|
|
341
|
-
}>;
|
|
342
|
-
|
|
343
|
-
type OAuthTokens = {
|
|
344
|
-
access_token: string;
|
|
345
|
-
refresh_token: string;
|
|
346
|
-
expires_at: number;
|
|
347
|
-
account_id?: string;
|
|
348
|
-
};
|
|
349
|
-
type ProviderAuth = {
|
|
350
|
-
method: "api_key";
|
|
351
|
-
api_key: string;
|
|
352
|
-
/** The built-in API base at credential acquisition, when known. */
|
|
353
|
-
api_base?: string;
|
|
354
|
-
} | {
|
|
355
|
-
method: "oauth";
|
|
356
|
-
oauth: OAuthTokens;
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
type SupportedProvider = string;
|
|
360
|
-
|
|
361
336
|
type ResolvedModelConfig = {
|
|
362
337
|
providers?: _codelia_config.CodeliaConfig["providers"];
|
|
363
338
|
provider?: string;
|
|
@@ -424,6 +399,18 @@ type WriteTarget = {
|
|
|
424
399
|
path: string;
|
|
425
400
|
};
|
|
426
401
|
|
|
402
|
+
type ToolAuthority = Readonly<{
|
|
403
|
+
ceiling: readonly Resource[];
|
|
404
|
+
granted: readonly Resource[];
|
|
405
|
+
launchRule?: string;
|
|
406
|
+
}>;
|
|
407
|
+
type ToolEffect = Readonly<{
|
|
408
|
+
resources: readonly Resource[];
|
|
409
|
+
kind: "external_update" | "dependency_read";
|
|
410
|
+
}>;
|
|
411
|
+
|
|
412
|
+
type SupportedProvider = string;
|
|
413
|
+
|
|
427
414
|
type TerminalTaskState = Extract<TaskState, "completed" | "failed" | "cancelled">;
|
|
428
415
|
type TaskSpawnInput = {
|
|
429
416
|
subagent?: TaskRecord["subagent"];
|
|
@@ -734,6 +721,27 @@ type RuntimeOptions = {
|
|
|
734
721
|
adapters?: RuntimeHostAdapters;
|
|
735
722
|
};
|
|
736
723
|
|
|
724
|
+
type DiscoveredOAuthConfig = {
|
|
725
|
+
issuer?: string;
|
|
726
|
+
authorization_url?: string;
|
|
727
|
+
token_url?: string;
|
|
728
|
+
registration_url?: string;
|
|
729
|
+
resource?: string;
|
|
730
|
+
scope?: string;
|
|
731
|
+
code_challenge_methods_supported?: string[];
|
|
732
|
+
};
|
|
733
|
+
declare const fetchDiscoveredOAuthConfig: (serverUrl: string, signal?: AbortSignal) => Promise<DiscoveredOAuthConfig>;
|
|
734
|
+
type BindingOAuth = Pick<DiscoveredOAuthConfig, "issuer" | "authorization_url" | "token_url"> & {
|
|
735
|
+
client_id?: string;
|
|
736
|
+
};
|
|
737
|
+
type BindingServer = {
|
|
738
|
+
url?: string;
|
|
739
|
+
oauth?: BindingOAuth;
|
|
740
|
+
};
|
|
741
|
+
/** The HTTP destination owns the credential. The advertised OAuth resource is a grant parameter. */
|
|
742
|
+
declare const resolveMcpServerBinding: (server: BindingServer, oauth?: BindingOAuth) => McpServerAuthBinding | null;
|
|
743
|
+
declare const mcpEntryMatchesServer: (entry: McpBoundServerAuth, server: BindingServer, oauth?: BindingOAuth) => boolean;
|
|
744
|
+
|
|
737
745
|
type McpRequestOptions = {
|
|
738
746
|
timeoutMs: number;
|
|
739
747
|
signal?: AbortSignal;
|
|
@@ -825,4 +833,4 @@ declare const createPublicApprovalReviewer: (options: PublicApprovalReviewerOpti
|
|
|
825
833
|
|
|
826
834
|
declare const startRuntime: (options?: RuntimeOptions) => Promise<void>;
|
|
827
835
|
|
|
828
|
-
export { type ApprovalAudit, type ApprovalService, type AttachmentUploadPolicy, type BrokeredMutation, type BrokeredMutationAdapter, type BrokeredMutationOutcome, type Confirmation, type CredentialProvider, LaunchRuleStore, type PreparedTaskExecution, type ProtectedShellBackend, type PublicApprovalReviewerOptions, type ReviewAdapter, type RuntimeConfigProvider, type RuntimeEnvironmentContract, type RuntimeEnvironmentInput, type RuntimeEnvironmentPreset, type RuntimeEventSink, type RuntimeHostAdapters, type RuntimeOptions, type RuntimeStores, type ShellAuthority, type ShellInvocation, type ShellProtection, type SubagentChannel, type SubagentExecutorFactory, type SubagentLaunchInput, type SystemPromptProvider, type ToolAuthority, type ToolEffect, type ToolProvider, createLocalMcpStdioProbeClient, createMacMxcShellBackend, createPublicApprovalReviewer, runBrokeredMutation, startRuntime };
|
|
836
|
+
export { type ApprovalAudit, type ApprovalService, type AttachmentUploadPolicy, type BrokeredMutation, type BrokeredMutationAdapter, type BrokeredMutationOutcome, type Confirmation, type CredentialProvider, LaunchRuleStore, type PreparedTaskExecution, type ProtectedShellBackend, type PublicApprovalReviewerOptions, type ReviewAdapter, type RuntimeConfigProvider, type RuntimeEnvironmentContract, type RuntimeEnvironmentInput, type RuntimeEnvironmentPreset, type RuntimeEventSink, type RuntimeHostAdapters, type RuntimeOptions, type RuntimeStores, type ShellAuthority, type ShellInvocation, type ShellProtection, type SubagentChannel, type SubagentExecutorFactory, type SubagentLaunchInput, type SystemPromptProvider, type ToolAuthority, type ToolEffect, type ToolProvider, createLocalMcpStdioProbeClient, createMacMxcShellBackend, createPublicApprovalReviewer, fetchDiscoveredOAuthConfig, mcpEntryMatchesServer, resolveMcpServerBinding, runBrokeredMutation, startRuntime };
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TaskResult, TaskState, TaskRecord, TaskKind, TaskWorkspaceMode, TaskRegistryStore, AttachmentStore } from '@codelia/storage';
|
|
1
|
+
import { TaskResult, TaskState, TaskRecord, TaskKind, TaskWorkspaceMode, TaskRegistryStore, ProviderAuth, AttachmentStore, McpBoundServerAuth, McpServerAuthBinding } from '@codelia/storage';
|
|
2
2
|
export { AttachmentStore, StoredAttachment } from '@codelia/storage';
|
|
3
3
|
import { ChildProcessByStdio } from 'node:child_process';
|
|
4
4
|
import { Writable, Readable } from 'node:stream';
|
|
@@ -154,6 +154,8 @@ type ShellProtection = Readonly<{
|
|
|
154
154
|
protectedPaths: readonly string[];
|
|
155
155
|
/** Visible to readers, with writes denied independently of writeRoots. */
|
|
156
156
|
readOnlyPaths?: readonly string[];
|
|
157
|
+
/** Deny writes to immediate hidden home entries and their descendants, including future names. */
|
|
158
|
+
homeDotDirectory?: string;
|
|
157
159
|
/** Read-only names whose existing inode aliases also require validation. */
|
|
158
160
|
readOnlyAliasPaths?: readonly string[];
|
|
159
161
|
/** Local macOS admission only. Direct path restrictions still apply. */
|
|
@@ -168,6 +170,7 @@ type ShellProtection = Readonly<{
|
|
|
168
170
|
type ProtectedShellBackend = {
|
|
169
171
|
/** Explicit opt-in to enforcing readOnlyPaths, including their aliases. */
|
|
170
172
|
supportsReadOnlyPaths?: true;
|
|
173
|
+
supportsHomeDotProtection?: true;
|
|
171
174
|
/**
|
|
172
175
|
* Opt in only if direct argv uses the resolved executable and fixed Bash
|
|
173
176
|
* sources use protection.cwd and binPaths with host-equivalent executable
|
|
@@ -330,34 +333,6 @@ type ShellAuthority = Readonly<{
|
|
|
330
333
|
extraWriteCeiling?: readonly string[];
|
|
331
334
|
}>;
|
|
332
335
|
|
|
333
|
-
type ToolAuthority = Readonly<{
|
|
334
|
-
ceiling: readonly Resource[];
|
|
335
|
-
granted: readonly Resource[];
|
|
336
|
-
launchRule?: string;
|
|
337
|
-
}>;
|
|
338
|
-
type ToolEffect = Readonly<{
|
|
339
|
-
resources: readonly Resource[];
|
|
340
|
-
kind: "external_update" | "dependency_read";
|
|
341
|
-
}>;
|
|
342
|
-
|
|
343
|
-
type OAuthTokens = {
|
|
344
|
-
access_token: string;
|
|
345
|
-
refresh_token: string;
|
|
346
|
-
expires_at: number;
|
|
347
|
-
account_id?: string;
|
|
348
|
-
};
|
|
349
|
-
type ProviderAuth = {
|
|
350
|
-
method: "api_key";
|
|
351
|
-
api_key: string;
|
|
352
|
-
/** The built-in API base at credential acquisition, when known. */
|
|
353
|
-
api_base?: string;
|
|
354
|
-
} | {
|
|
355
|
-
method: "oauth";
|
|
356
|
-
oauth: OAuthTokens;
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
type SupportedProvider = string;
|
|
360
|
-
|
|
361
336
|
type ResolvedModelConfig = {
|
|
362
337
|
providers?: _codelia_config.CodeliaConfig["providers"];
|
|
363
338
|
provider?: string;
|
|
@@ -424,6 +399,18 @@ type WriteTarget = {
|
|
|
424
399
|
path: string;
|
|
425
400
|
};
|
|
426
401
|
|
|
402
|
+
type ToolAuthority = Readonly<{
|
|
403
|
+
ceiling: readonly Resource[];
|
|
404
|
+
granted: readonly Resource[];
|
|
405
|
+
launchRule?: string;
|
|
406
|
+
}>;
|
|
407
|
+
type ToolEffect = Readonly<{
|
|
408
|
+
resources: readonly Resource[];
|
|
409
|
+
kind: "external_update" | "dependency_read";
|
|
410
|
+
}>;
|
|
411
|
+
|
|
412
|
+
type SupportedProvider = string;
|
|
413
|
+
|
|
427
414
|
type TerminalTaskState = Extract<TaskState, "completed" | "failed" | "cancelled">;
|
|
428
415
|
type TaskSpawnInput = {
|
|
429
416
|
subagent?: TaskRecord["subagent"];
|
|
@@ -734,6 +721,27 @@ type RuntimeOptions = {
|
|
|
734
721
|
adapters?: RuntimeHostAdapters;
|
|
735
722
|
};
|
|
736
723
|
|
|
724
|
+
type DiscoveredOAuthConfig = {
|
|
725
|
+
issuer?: string;
|
|
726
|
+
authorization_url?: string;
|
|
727
|
+
token_url?: string;
|
|
728
|
+
registration_url?: string;
|
|
729
|
+
resource?: string;
|
|
730
|
+
scope?: string;
|
|
731
|
+
code_challenge_methods_supported?: string[];
|
|
732
|
+
};
|
|
733
|
+
declare const fetchDiscoveredOAuthConfig: (serverUrl: string, signal?: AbortSignal) => Promise<DiscoveredOAuthConfig>;
|
|
734
|
+
type BindingOAuth = Pick<DiscoveredOAuthConfig, "issuer" | "authorization_url" | "token_url"> & {
|
|
735
|
+
client_id?: string;
|
|
736
|
+
};
|
|
737
|
+
type BindingServer = {
|
|
738
|
+
url?: string;
|
|
739
|
+
oauth?: BindingOAuth;
|
|
740
|
+
};
|
|
741
|
+
/** The HTTP destination owns the credential. The advertised OAuth resource is a grant parameter. */
|
|
742
|
+
declare const resolveMcpServerBinding: (server: BindingServer, oauth?: BindingOAuth) => McpServerAuthBinding | null;
|
|
743
|
+
declare const mcpEntryMatchesServer: (entry: McpBoundServerAuth, server: BindingServer, oauth?: BindingOAuth) => boolean;
|
|
744
|
+
|
|
737
745
|
type McpRequestOptions = {
|
|
738
746
|
timeoutMs: number;
|
|
739
747
|
signal?: AbortSignal;
|
|
@@ -825,4 +833,4 @@ declare const createPublicApprovalReviewer: (options: PublicApprovalReviewerOpti
|
|
|
825
833
|
|
|
826
834
|
declare const startRuntime: (options?: RuntimeOptions) => Promise<void>;
|
|
827
835
|
|
|
828
|
-
export { type ApprovalAudit, type ApprovalService, type AttachmentUploadPolicy, type BrokeredMutation, type BrokeredMutationAdapter, type BrokeredMutationOutcome, type Confirmation, type CredentialProvider, LaunchRuleStore, type PreparedTaskExecution, type ProtectedShellBackend, type PublicApprovalReviewerOptions, type ReviewAdapter, type RuntimeConfigProvider, type RuntimeEnvironmentContract, type RuntimeEnvironmentInput, type RuntimeEnvironmentPreset, type RuntimeEventSink, type RuntimeHostAdapters, type RuntimeOptions, type RuntimeStores, type ShellAuthority, type ShellInvocation, type ShellProtection, type SubagentChannel, type SubagentExecutorFactory, type SubagentLaunchInput, type SystemPromptProvider, type ToolAuthority, type ToolEffect, type ToolProvider, createLocalMcpStdioProbeClient, createMacMxcShellBackend, createPublicApprovalReviewer, runBrokeredMutation, startRuntime };
|
|
836
|
+
export { type ApprovalAudit, type ApprovalService, type AttachmentUploadPolicy, type BrokeredMutation, type BrokeredMutationAdapter, type BrokeredMutationOutcome, type Confirmation, type CredentialProvider, LaunchRuleStore, type PreparedTaskExecution, type ProtectedShellBackend, type PublicApprovalReviewerOptions, type ReviewAdapter, type RuntimeConfigProvider, type RuntimeEnvironmentContract, type RuntimeEnvironmentInput, type RuntimeEnvironmentPreset, type RuntimeEventSink, type RuntimeHostAdapters, type RuntimeOptions, type RuntimeStores, type ShellAuthority, type ShellInvocation, type ShellProtection, type SubagentChannel, type SubagentExecutorFactory, type SubagentLaunchInput, type SystemPromptProvider, type ToolAuthority, type ToolEffect, type ToolProvider, createLocalMcpStdioProbeClient, createMacMxcShellBackend, createPublicApprovalReviewer, fetchDiscoveredOAuthConfig, mcpEntryMatchesServer, resolveMcpServerBinding, runBrokeredMutation, startRuntime };
|
package/dist/sdk.js
CHANGED
|
@@ -2,11 +2,14 @@ import {
|
|
|
2
2
|
LaunchRuleStore,
|
|
3
3
|
createLocalMcpStdioProbeClient,
|
|
4
4
|
createPublicApprovalReviewer,
|
|
5
|
+
fetchDiscoveredOAuthConfig,
|
|
6
|
+
mcpEntryMatchesServer,
|
|
7
|
+
resolveMcpServerBinding,
|
|
5
8
|
startRuntime
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LNUGYGST.js";
|
|
7
10
|
import {
|
|
8
11
|
createMacMxcShellBackend
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NPCH2IMV.js";
|
|
10
13
|
|
|
11
14
|
// src/permissions/brokered-mutation.ts
|
|
12
15
|
var runBrokeredMutation = async (request, adapter, signal) => {
|
|
@@ -32,6 +35,9 @@ export {
|
|
|
32
35
|
createLocalMcpStdioProbeClient,
|
|
33
36
|
createMacMxcShellBackend,
|
|
34
37
|
createPublicApprovalReviewer,
|
|
38
|
+
fetchDiscoveredOAuthConfig,
|
|
39
|
+
mcpEntryMatchesServer,
|
|
40
|
+
resolveMcpServerBinding,
|
|
35
41
|
runBrokeredMutation,
|
|
36
42
|
startRuntime
|
|
37
43
|
};
|