@llm4ts/runner 2.54.1 → 3.0.0
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/package.json +3 -5
- package/dist/CoderPolicy.d.ts +0 -12
- package/dist/CoderPolicy.d.ts.map +0 -1
- package/dist/CoderPolicy.js +0 -59
- package/dist/CoderPolicy.js.map +0 -1
- package/dist/NodeRuntime.d.ts +0 -4
- package/dist/NodeRuntime.d.ts.map +0 -1
- package/dist/NodeRuntime.js +0 -11
- package/dist/NodeRuntime.js.map +0 -1
- package/src/CoderPolicy.ts +0 -82
- package/src/NodeRuntime.ts +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llm4ts/runner",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Node runner, CLI, terminal, and MCP composition for llm4ts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"./Cli": "./dist/Cli.js",
|
|
18
18
|
"./AgentTree": "./dist/AgentTree.js",
|
|
19
19
|
"./AgentTreeSurface": "./dist/AgentTreeSurface.js",
|
|
20
|
-
"./CoderPolicy": "./dist/CoderPolicy.js",
|
|
21
20
|
"./Connectors": "./dist/Connectors.js",
|
|
22
21
|
"./Costs": "./dist/Costs.js",
|
|
23
22
|
"./Doctor": "./dist/Doctor.js",
|
|
@@ -37,7 +36,6 @@
|
|
|
37
36
|
"./NodeTemporaryFiles": "./dist/NodeTemporaryFiles.js",
|
|
38
37
|
"./NodeWorkspace": "./dist/NodeWorkspace.js",
|
|
39
38
|
"./Otel": "./dist/Otel.js",
|
|
40
|
-
"./NodeRuntime": "./dist/NodeRuntime.js",
|
|
41
39
|
"./Packs": "./dist/Packs.js",
|
|
42
40
|
"./Profile": "./dist/Profile.js",
|
|
43
41
|
"./PiModels": "./dist/PiModels.js",
|
|
@@ -75,8 +73,8 @@
|
|
|
75
73
|
"typescript"
|
|
76
74
|
],
|
|
77
75
|
"dependencies": {
|
|
78
|
-
"@llm4ts/core": "
|
|
79
|
-
"@llm4ts/flow": "
|
|
76
|
+
"@llm4ts/core": "3.0.0",
|
|
77
|
+
"@llm4ts/flow": "3.0.0"
|
|
80
78
|
},
|
|
81
79
|
"peerDependencies": {
|
|
82
80
|
"effect": "4.0.0"
|
package/dist/CoderPolicy.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import type { Grants } from "@llm4ts/core/Capability";
|
|
3
|
-
import { CliConnectorConfig } from "@llm4ts/core/ConnectorConfig";
|
|
4
|
-
declare const AppliedCoderPolicy_base: Schema.Class<AppliedCoderPolicy, Schema.Struct<{
|
|
5
|
-
readonly config: typeof CliConnectorConfig;
|
|
6
|
-
readonly unenforceable: Schema.$Array<Schema.String>;
|
|
7
|
-
}>, {}>;
|
|
8
|
-
export declare class AppliedCoderPolicy extends AppliedCoderPolicy_base {
|
|
9
|
-
}
|
|
10
|
-
export declare const applyCoderPolicy: (config: CliConnectorConfig, grants: Grants) => AppliedCoderPolicy;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=CoderPolicy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CoderPolicy.d.ts","sourceRoot":"","sources":["../src/CoderPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;;;;AAGjE,qBAAa,kBAAmB,SAAQ,uBAGtC;CAAG;AAgDL,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,kBAAkB,EAC1B,QAAQ,MAAM,KACb,kBAqBF,CAAA"}
|
package/dist/CoderPolicy.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { Capabilities, allows } from "@llm4ts/core/Capability";
|
|
3
|
-
import { CliConnectorConfig } from "@llm4ts/core/ConnectorConfig";
|
|
4
|
-
import { ConnectorIds } from "@llm4ts/core/Models";
|
|
5
|
-
export class AppliedCoderPolicy extends Schema.Class("AppliedCoderPolicy")({
|
|
6
|
-
config: CliConnectorConfig,
|
|
7
|
-
unenforceable: Schema.Array(Schema.String)
|
|
8
|
-
}) {
|
|
9
|
-
}
|
|
10
|
-
const patterns = [
|
|
11
|
-
{
|
|
12
|
-
capability: Capabilities.GitPush,
|
|
13
|
-
pattern: "Bash(git push:*)"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
capability: Capabilities.GitWrite,
|
|
17
|
-
pattern: "Bash(git commit:*),Bash(git add:*),Bash(git checkout:*)"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
capability: Capabilities.GhWrite,
|
|
21
|
-
pattern: "Bash(gh pr:*),Bash(gh issue:*),Bash(gh api:*)"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
capability: Capabilities.AdoWrite,
|
|
25
|
-
pattern: "Bash(az repos:*),Bash(az boards:*)"
|
|
26
|
-
}
|
|
27
|
-
];
|
|
28
|
-
const capabilityName = (capability) => capability._tag === "Exec" ? `Exec(${capability.command})` : capability._tag;
|
|
29
|
-
const withDisallowed = (config, denied) => {
|
|
30
|
-
const existing = config.flags["disallowed-tools"];
|
|
31
|
-
const values = [
|
|
32
|
-
...(existing === undefined || existing.length === 0 ? [] : [existing]),
|
|
33
|
-
...denied.map(({ pattern }) => pattern)
|
|
34
|
-
];
|
|
35
|
-
return new CliConnectorConfig({
|
|
36
|
-
...config,
|
|
37
|
-
flags: {
|
|
38
|
-
...config.flags,
|
|
39
|
-
"disallowed-tools": values.join(",")
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
export const applyCoderPolicy = (config, grants) => {
|
|
44
|
-
const denied = patterns.filter(({ capability }) => !allows(grants, capability));
|
|
45
|
-
if (denied.length === 0) {
|
|
46
|
-
return new AppliedCoderPolicy({ config, unenforceable: [] });
|
|
47
|
-
}
|
|
48
|
-
if (config.connectorId.value === ConnectorIds.ClaudeCli.value) {
|
|
49
|
-
return new AppliedCoderPolicy({
|
|
50
|
-
config: withDisallowed(config, denied),
|
|
51
|
-
unenforceable: []
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return new AppliedCoderPolicy({
|
|
55
|
-
config,
|
|
56
|
-
unenforceable: denied.map(({ capability }) => `${config.connectorId.value} cannot enforce the missing ${capabilityName(capability)} restriction on the coder`)
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=CoderPolicy.js.map
|
package/dist/CoderPolicy.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CoderPolicy.js","sourceRoot":"","sources":["../src/CoderPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,YAAY,EAAmB,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,MAAM,OAAO,kBAAmB,SAAQ,MAAM,CAAC,KAAK,CAAqB,oBAAoB,CAAC,CAAC;IAC7F,MAAM,EAAE,kBAAkB;IAC1B,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;CAC3C,CAAC;CAAG;AAOL,MAAM,QAAQ,GAAiC;IAC7C;QACE,UAAU,EAAE,YAAY,CAAC,OAAO;QAChC,OAAO,EAAE,kBAAkB;KAC5B;IACD;QACE,UAAU,EAAE,YAAY,CAAC,QAAQ;QACjC,OAAO,EAAE,yDAAyD;KACnE;IACD;QACE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E,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAA;IAC9D,CAAC;IAED,IAAI,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK,YAAY,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QAC9D,OAAO,IAAI,kBAAkB,CAAC;YAC5B,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC;YACtC,aAAa,EAAE,EAAE;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,IAAI,kBAAkB,CAAC;QAC5B,MAAM;QACN,aAAa,EAAE,MAAM,CAAC,GAAG,CACvB,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CACjB,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,+BAA+B,cAAc,CAAC,UAAU,CAAC,2BAA2B,CAClH;KACF,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
package/dist/NodeRuntime.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as Layer from "effect/Layer";
|
|
2
|
-
export declare const NodeBoundaryLayers: Layer.Layer<import("@llm4ts/core/HttpClient.ts").HttpClient | import("@llm4ts/core/ProcessExecutor.ts").ProcessExecutor | import("@llm4ts/core/TemporaryFiles.ts").TemporaryFiles | import("@llm4ts/core/providers/GeminiCliProvider.ts").GeminiCliExecutor | import("@llm4ts/flow/Persistence.ts").PlainFileStore, never, never>;
|
|
3
|
-
export declare const NodeRuntimeLive: Layer.Layer<import("@llm4ts/core/HttpClient.ts").HttpClient | import("@llm4ts/core/ProcessExecutor.ts").ProcessExecutor | import("@llm4ts/core/TemporaryFiles.ts").TemporaryFiles | import("@llm4ts/core/providers/GeminiCliProvider.ts").GeminiCliExecutor | import("@llm4ts/flow/Persistence.ts").PlainFileStore | import("@llm4ts/core/ConnectorRegistry.ts").ConnectorRegistry, never, never>;
|
|
4
|
-
//# sourceMappingURL=NodeRuntime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRuntime.d.ts","sourceRoot":"","sources":["../src/NodeRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAQrC,eAAO,MAAM,kBAAkB,mUAM9B,CAAA;AAID,eAAO,MAAM,eAAe,mYAA6D,CAAA"}
|
package/dist/NodeRuntime.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as Layer from "effect/Layer";
|
|
2
|
-
import { ConnectorRegistryLive } from "@llm4ts/core/providers/ConnectorFactories";
|
|
3
|
-
import { NodeHttpClientLive } from "./NodeHttpClient.js";
|
|
4
|
-
import { NodeGeminiCliExecutorLive } from "./NodeGeminiCliExecutor.js";
|
|
5
|
-
import { NodePlainFileStoreLive } from "./NodePlainFileStore.js";
|
|
6
|
-
import { NodeProcessExecutorLive } from "./NodeProcessExecutor.js";
|
|
7
|
-
import { NodeTemporaryFilesLive } from "./NodeTemporaryFiles.js";
|
|
8
|
-
export const NodeBoundaryLayers = Layer.mergeAll(NodeHttpClientLive, NodeProcessExecutorLive, NodeTemporaryFilesLive, NodeGeminiCliExecutorLive, NodePlainFileStoreLive);
|
|
9
|
-
const NodeConnectorRegistryLive = ConnectorRegistryLive.pipe(Layer.provide(NodeBoundaryLayers));
|
|
10
|
-
export const NodeRuntimeLive = Layer.merge(NodeBoundaryLayers, NodeConnectorRegistryLive);
|
|
11
|
-
//# sourceMappingURL=NodeRuntime.js.map
|
package/dist/NodeRuntime.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRuntime.js","sourceRoot":"","sources":["../src/NodeRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAA;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAC9C,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,CACvB,CAAA;AAED,MAAM,yBAAyB,GAAG,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAE/F,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,KAAK,CAAC,kBAAkB,EAAE,yBAAyB,CAAC,CAAA"}
|
package/src/CoderPolicy.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema"
|
|
2
|
-
import { Capabilities, type Capability, allows } from "@llm4ts/core/Capability"
|
|
3
|
-
import type { Grants } from "@llm4ts/core/Capability"
|
|
4
|
-
import { CliConnectorConfig } from "@llm4ts/core/ConnectorConfig"
|
|
5
|
-
import { ConnectorIds } from "@llm4ts/core/Models"
|
|
6
|
-
|
|
7
|
-
export class AppliedCoderPolicy extends Schema.Class<AppliedCoderPolicy>("AppliedCoderPolicy")({
|
|
8
|
-
config: CliConnectorConfig,
|
|
9
|
-
unenforceable: Schema.Array(Schema.String)
|
|
10
|
-
}) {}
|
|
11
|
-
|
|
12
|
-
interface DeniedPattern {
|
|
13
|
-
readonly capability: Capability
|
|
14
|
-
readonly pattern: string
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const patterns: ReadonlyArray<DeniedPattern> = [
|
|
18
|
-
{
|
|
19
|
-
capability: Capabilities.GitPush,
|
|
20
|
-
pattern: "Bash(git push:*)"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
capability: Capabilities.GitWrite,
|
|
24
|
-
pattern: "Bash(git commit:*),Bash(git add:*),Bash(git checkout:*)"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
capability: Capabilities.GhWrite,
|
|
28
|
-
pattern: "Bash(gh pr:*),Bash(gh issue:*),Bash(gh api:*)"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
capability: Capabilities.AdoWrite,
|
|
32
|
-
pattern: "Bash(az repos:*),Bash(az boards:*)"
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
|
|
36
|
-
const capabilityName = (capability: Capability): string =>
|
|
37
|
-
capability._tag === "Exec" ? `Exec(${capability.command})` : capability._tag
|
|
38
|
-
|
|
39
|
-
const withDisallowed = (
|
|
40
|
-
config: CliConnectorConfig,
|
|
41
|
-
denied: ReadonlyArray<DeniedPattern>
|
|
42
|
-
): CliConnectorConfig => {
|
|
43
|
-
const existing = config.flags["disallowed-tools"]
|
|
44
|
-
const values = [
|
|
45
|
-
...(existing === undefined || existing.length === 0 ? [] : [existing]),
|
|
46
|
-
...denied.map(({ pattern }) => pattern)
|
|
47
|
-
]
|
|
48
|
-
|
|
49
|
-
return new CliConnectorConfig({
|
|
50
|
-
...config,
|
|
51
|
-
flags: {
|
|
52
|
-
...config.flags,
|
|
53
|
-
"disallowed-tools": values.join(",")
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const applyCoderPolicy = (
|
|
59
|
-
config: CliConnectorConfig,
|
|
60
|
-
grants: Grants
|
|
61
|
-
): AppliedCoderPolicy => {
|
|
62
|
-
const denied = patterns.filter(({ capability }) => !allows(grants, capability))
|
|
63
|
-
|
|
64
|
-
if (denied.length === 0) {
|
|
65
|
-
return new AppliedCoderPolicy({ config, unenforceable: [] })
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (config.connectorId.value === ConnectorIds.ClaudeCli.value) {
|
|
69
|
-
return new AppliedCoderPolicy({
|
|
70
|
-
config: withDisallowed(config, denied),
|
|
71
|
-
unenforceable: []
|
|
72
|
-
})
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return new AppliedCoderPolicy({
|
|
76
|
-
config,
|
|
77
|
-
unenforceable: denied.map(
|
|
78
|
-
({ capability }) =>
|
|
79
|
-
`${config.connectorId.value} cannot enforce the missing ${capabilityName(capability)} restriction on the coder`
|
|
80
|
-
)
|
|
81
|
-
})
|
|
82
|
-
}
|
package/src/NodeRuntime.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as Layer from "effect/Layer"
|
|
2
|
-
import { ConnectorRegistryLive } from "@llm4ts/core/providers/ConnectorFactories"
|
|
3
|
-
import { NodeHttpClientLive } from "./NodeHttpClient.ts"
|
|
4
|
-
import { NodeGeminiCliExecutorLive } from "./NodeGeminiCliExecutor.ts"
|
|
5
|
-
import { NodePlainFileStoreLive } from "./NodePlainFileStore.ts"
|
|
6
|
-
import { NodeProcessExecutorLive } from "./NodeProcessExecutor.ts"
|
|
7
|
-
import { NodeTemporaryFilesLive } from "./NodeTemporaryFiles.ts"
|
|
8
|
-
|
|
9
|
-
export const NodeBoundaryLayers = Layer.mergeAll(
|
|
10
|
-
NodeHttpClientLive,
|
|
11
|
-
NodeProcessExecutorLive,
|
|
12
|
-
NodeTemporaryFilesLive,
|
|
13
|
-
NodeGeminiCliExecutorLive,
|
|
14
|
-
NodePlainFileStoreLive
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
const NodeConnectorRegistryLive = ConnectorRegistryLive.pipe(Layer.provide(NodeBoundaryLayers))
|
|
18
|
-
|
|
19
|
-
export const NodeRuntimeLive = Layer.merge(NodeBoundaryLayers, NodeConnectorRegistryLive)
|