@xfey/tutti 0.1.5 → 0.1.6

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.
@@ -5,7 +5,7 @@ import { join } from "node:path";
5
5
  import { buildCodexAppServerProcessPlan } from "../codex-app-server.js";
6
6
  import { DEFAULT_OPENAI_MODEL } from "../model-config.js";
7
7
  import { CodexAppServerJsonRpcClient, CodexAppServerProtocolError, } from "./json-rpc.js";
8
- import { createReadOnlyPermissionProfile } from "./permission-profile.js";
8
+ import { createReadOnlySandboxPolicy } from "./sandbox-policy.js";
9
9
  import { buildCodexAppServerProviderConfigOverrides, resolveCodexAppServerModelProvider, } from "./provider-config.js";
10
10
  import { buildCodexAppServerTurnInput, resolveCodexAppServerContextRuntimeHint, resolveCodexAppServerSkillInputs, CodexAppServerSkillSelectionError, } from "./skills.js";
11
11
  import { containsKnownSecret, createCodexSpawnEnv, extractAgentText, extractServerRequestMethod, findJsonObjectCandidates, isApiKeyAccount, readThreadId, readTurnError, readTurnStatus, redactWithKnownValues, compactText, } from "./runtime-helpers.js";
@@ -166,9 +166,7 @@ export async function runCodexAppServerReadOnlyProcedure(options) {
166
166
  model,
167
167
  modelProvider,
168
168
  approvalPolicy: "never",
169
- permissionProfile: createReadOnlyPermissionProfile(readablePaths, {
170
- networkEnabled,
171
- }),
169
+ sandbox: "read-only",
172
170
  config: buildReadOnlyThreadConfig(options),
173
171
  ephemeral: true,
174
172
  experimentalRawEvents: false,
@@ -189,7 +187,7 @@ export async function runCodexAppServerReadOnlyProcedure(options) {
189
187
  }),
190
188
  cwd: appServerCwd,
191
189
  approvalPolicy: "never",
192
- permissionProfile: createReadOnlyPermissionProfile(readablePaths, {
190
+ sandboxPolicy: createReadOnlySandboxPolicy({
193
191
  networkEnabled,
194
192
  }),
195
193
  model,
@@ -0,0 +1,18 @@
1
+ export type ReadOnlySandboxPolicyOptions = {
2
+ networkEnabled?: boolean;
3
+ };
4
+ export type WorkspaceWriteSandboxPolicyOptions = {
5
+ networkEnabled?: boolean;
6
+ };
7
+ export declare function createReadOnlySandboxPolicy(options?: ReadOnlySandboxPolicyOptions): {
8
+ type: "readOnly";
9
+ networkAccess: boolean;
10
+ };
11
+ export declare function createWorkspaceWriteSandboxPolicy(writableRoot: string, options?: WorkspaceWriteSandboxPolicyOptions): {
12
+ type: "workspaceWrite";
13
+ writableRoots: string[];
14
+ networkAccess: boolean;
15
+ excludeTmpdirEnvVar: boolean;
16
+ excludeSlashTmp: boolean;
17
+ };
18
+ //# sourceMappingURL=sandbox-policy.d.ts.map
@@ -0,0 +1,16 @@
1
+ export function createReadOnlySandboxPolicy(options = {}) {
2
+ return {
3
+ type: "readOnly",
4
+ networkAccess: options.networkEnabled ?? true,
5
+ };
6
+ }
7
+ export function createWorkspaceWriteSandboxPolicy(writableRoot, options = {}) {
8
+ return {
9
+ type: "workspaceWrite",
10
+ writableRoots: [writableRoot],
11
+ networkAccess: options.networkEnabled ?? true,
12
+ excludeTmpdirEnvVar: false,
13
+ excludeSlashTmp: false,
14
+ };
15
+ }
16
+ //# sourceMappingURL=sandbox-policy.js.map
@@ -5,7 +5,7 @@ import { join } from "node:path";
5
5
  import { CODEX_APP_SERVER_COMMAND, CODEX_APP_SERVER_LISTEN_URL, buildCodexAppServerProcessPlan, } from "../codex-app-server.js";
6
6
  import { DEFAULT_OPENAI_MODEL } from "../model-config.js";
7
7
  import { CodexAppServerJsonRpcClient, CodexAppServerProtocolError, } from "./json-rpc.js";
8
- import { createReadOnlyPermissionProfile } from "./permission-profile.js";
8
+ import { createReadOnlySandboxPolicy } from "./sandbox-policy.js";
9
9
  import { buildCodexAppServerProviderConfigOverrides, resolveCodexAppServerModelProvider, } from "./provider-config.js";
10
10
  import { containsKnownSecret, countAvailableModels, createCodexSpawnEnv, createSmokeRepo, extractAgentText, extractNotificationMethod, isApiKeyAccount, modelListContains, readAccountType, readGitStatus, readThreadId, readTurnStatus, redactWithKnownValues, renderNoWriteSmokePrompt, } from "./smoke-helpers.js";
11
11
  import { resolveCodexAppServerSmokeProviderInput } from "./smoke-provider-input.js";
@@ -68,7 +68,7 @@ export async function runCodexAppServerNoWriteSmoke(options) {
68
68
  model,
69
69
  modelProvider,
70
70
  approvalPolicy: "never",
71
- permissionProfile: createReadOnlyPermissionProfile(repoRoot),
71
+ sandbox: "read-only",
72
72
  ephemeral: true,
73
73
  experimentalRawEvents: false,
74
74
  persistExtendedHistory: false,
@@ -88,7 +88,7 @@ export async function runCodexAppServerNoWriteSmoke(options) {
88
88
  ],
89
89
  cwd: repoRoot,
90
90
  approvalPolicy: "never",
91
- permissionProfile: createReadOnlyPermissionProfile(repoRoot),
91
+ sandboxPolicy: createReadOnlySandboxPolicy(),
92
92
  model,
93
93
  modelProvider,
94
94
  outputSchema: CODEX_APP_SERVER_READ_ONLY_SMOKE_OUTPUT_SCHEMA,
@@ -5,7 +5,7 @@ import { join } from "node:path";
5
5
  import { buildCodexAppServerProcessPlan } from "../codex-app-server.js";
6
6
  import { DEFAULT_OPENAI_MODEL } from "../model-config.js";
7
7
  import { CodexAppServerJsonRpcClient, CodexAppServerProtocolError, } from "./json-rpc.js";
8
- import { createWorkspaceWritePermissionProfile } from "./permission-profile.js";
8
+ import { createWorkspaceWriteSandboxPolicy } from "./sandbox-policy.js";
9
9
  import { buildCodexAppServerProviderConfigOverrides, resolveCodexAppServerModelProvider, } from "./provider-config.js";
10
10
  import { buildCodexAppServerTurnInput, resolveCodexAppServerContextRuntimeHint, resolveCodexAppServerSkillsListWarmup, resolveCodexAppServerSkillInputs, CodexAppServerSkillSelectionError, } from "./skills.js";
11
11
  import { compactText, containsKnownSecret, createCodexSpawnEnv, extractAgentText, extractServerRequestMethod, findJsonObjectCandidates, isApiKeyAccount, readThreadId, readTurnError, readTurnStatus, redactWithKnownValues, } from "./runtime-helpers.js";
@@ -248,9 +248,7 @@ export async function runCodexAppServerWorkspaceWriteRun(options) {
248
248
  modelProvider,
249
249
  approvalPolicy,
250
250
  approvalsReviewer,
251
- permissionProfile: createWorkspaceWritePermissionProfile(options.workspaceRoot, {
252
- networkEnabled,
253
- }),
251
+ sandbox: "workspace-write",
254
252
  config: buildWorkspaceWriteThreadConfig(options),
255
253
  ephemeral: true,
256
254
  experimentalRawEvents: false,
@@ -272,7 +270,7 @@ export async function runCodexAppServerWorkspaceWriteRun(options) {
272
270
  cwd: options.workspaceRoot,
273
271
  approvalPolicy,
274
272
  approvalsReviewer,
275
- permissionProfile: createWorkspaceWritePermissionProfile(options.workspaceRoot, {
273
+ sandboxPolicy: createWorkspaceWriteSandboxPolicy(options.workspaceRoot, {
276
274
  networkEnabled,
277
275
  }),
278
276
  model,
@@ -43,21 +43,12 @@ export type CodexAppServerThreadStartParams = {
43
43
  experimentalRawEvents: false;
44
44
  persistExtendedHistory: false;
45
45
  };
46
- export type CodexAppServerReadOnlyAccess = {
47
- type: "restricted";
48
- includePlatformDefaults: boolean;
49
- readableRoots: string[];
50
- } | {
51
- type: "fullAccess";
52
- };
53
46
  export type CodexAppServerSandboxPolicy = {
54
47
  type: "readOnly";
55
- access: CodexAppServerReadOnlyAccess;
56
48
  networkAccess: boolean;
57
49
  } | {
58
50
  type: "workspaceWrite";
59
51
  writableRoots: string[];
60
- readOnlyAccess: CodexAppServerReadOnlyAccess;
61
52
  networkAccess: boolean;
62
53
  excludeTmpdirEnvVar: boolean;
63
54
  excludeSlashTmp: boolean;
@@ -107,11 +107,6 @@ export function createCodexAppServerNoWriteSmokePlan(options) {
107
107
  approvalPolicy: "never",
108
108
  sandboxPolicy: {
109
109
  type: "readOnly",
110
- access: {
111
- type: "restricted",
112
- includePlatformDefaults: true,
113
- readableRoots: [options.workingDirectory],
114
- },
115
110
  networkAccess,
116
111
  },
117
112
  outputSchema: CODEX_NO_WRITE_SMOKE_OUTPUT_SCHEMA,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfey/tutti",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,64 +0,0 @@
1
- export type ReadOnlyPermissionProfileOptions = {
2
- networkEnabled?: boolean;
3
- };
4
- export type WorkspaceWritePermissionProfileOptions = {
5
- networkEnabled?: boolean;
6
- };
7
- export declare function createReadOnlyPermissionProfile(readablePaths: string | string[], options?: ReadOnlyPermissionProfileOptions): {
8
- type: "managed";
9
- network: {
10
- enabled: boolean;
11
- };
12
- fileSystem: {
13
- type: "restricted";
14
- entries: ({
15
- access: "read";
16
- path: {
17
- type: "path";
18
- path: string;
19
- };
20
- } | {
21
- access: "read";
22
- path: {
23
- type: "special";
24
- value: {
25
- kind: "minimal";
26
- };
27
- };
28
- })[];
29
- };
30
- };
31
- export declare function createWorkspaceWritePermissionProfile(writableRoot: string, options?: WorkspaceWritePermissionProfileOptions): {
32
- type: "managed";
33
- network: {
34
- enabled: boolean;
35
- };
36
- fileSystem: {
37
- type: "restricted";
38
- entries: ({
39
- access: "read";
40
- path: {
41
- type: "special";
42
- value: {
43
- kind: "minimal";
44
- };
45
- path?: never;
46
- };
47
- } | {
48
- access: "read";
49
- path: {
50
- type: "path";
51
- path: string;
52
- value?: never;
53
- };
54
- } | {
55
- access: "write";
56
- path: {
57
- type: "path";
58
- path: string;
59
- value?: never;
60
- };
61
- })[];
62
- };
63
- };
64
- //# sourceMappingURL=permission-profile.d.ts.map
@@ -1,67 +0,0 @@
1
- export function createReadOnlyPermissionProfile(readablePaths, options = {}) {
2
- const paths = Array.isArray(readablePaths) ? readablePaths : [readablePaths];
3
- return {
4
- type: "managed",
5
- network: {
6
- enabled: options.networkEnabled ?? true,
7
- },
8
- fileSystem: {
9
- type: "restricted",
10
- entries: [
11
- {
12
- access: "read",
13
- path: {
14
- type: "special",
15
- value: {
16
- kind: "minimal",
17
- },
18
- },
19
- },
20
- ...[...new Set(paths)].map((path) => ({
21
- access: "read",
22
- path: {
23
- type: "path",
24
- path,
25
- },
26
- })),
27
- ],
28
- },
29
- };
30
- }
31
- export function createWorkspaceWritePermissionProfile(writableRoot, options = {}) {
32
- return {
33
- type: "managed",
34
- network: {
35
- enabled: options.networkEnabled ?? true,
36
- },
37
- fileSystem: {
38
- type: "restricted",
39
- entries: [
40
- {
41
- access: "read",
42
- path: {
43
- type: "special",
44
- value: {
45
- kind: "minimal",
46
- },
47
- },
48
- },
49
- {
50
- access: "read",
51
- path: {
52
- type: "path",
53
- path: writableRoot,
54
- },
55
- },
56
- {
57
- access: "write",
58
- path: {
59
- type: "path",
60
- path: writableRoot,
61
- },
62
- },
63
- ],
64
- },
65
- };
66
- }
67
- //# sourceMappingURL=permission-profile.js.map