@flue/client 0.0.21 → 0.0.22

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.
@@ -10,6 +10,7 @@ import { i as ProxyService, n as ProxyPolicy, r as ProxyPresetResult, t as Polic
10
10
  */
11
11
  declare function anthropic(opts?: {
12
12
  apiKey?: string;
13
+ policy?: string | ProxyPolicy;
13
14
  }): ProxyService;
14
15
  //#endregion
15
16
  //#region src/proxies/github.d.ts
@@ -26,7 +26,7 @@ function anthropic(opts) {
26
26
  filtered["x-api-key"] = apiKey;
27
27
  return { headers: filtered };
28
28
  },
29
- policy: "allow-all",
29
+ policy: opts?.policy ?? "allow-all",
30
30
  isModelProvider: true,
31
31
  providerConfig: {
32
32
  providerKey: "anthropic",
@@ -95,17 +95,32 @@ function github(opts) {
95
95
  function resolveGitHubPolicy(policy) {
96
96
  if (typeof policy !== "string") return policy;
97
97
  switch (policy) {
98
- case "read-only": return { default: "deny-non-safe" };
99
- case "read-only+clone": return {
98
+ case "read-only": return {
100
99
  default: "deny-non-safe",
101
100
  allow: [{
102
101
  method: "POST",
103
- path: "/*/git-upload-pack"
104
- }, {
105
- method: "GET",
106
- path: "/*/info/refs"
102
+ path: "/graphql",
103
+ body: githubBody.graphql()
107
104
  }]
108
105
  };
106
+ case "read-only+clone": return {
107
+ default: "deny-non-safe",
108
+ allow: [
109
+ {
110
+ method: "POST",
111
+ path: "/graphql",
112
+ body: githubBody.graphql()
113
+ },
114
+ {
115
+ method: "POST",
116
+ path: "/*/git-upload-pack"
117
+ },
118
+ {
119
+ method: "GET",
120
+ path: "/*/info/refs"
121
+ }
122
+ ]
123
+ };
109
124
  case "allow-all": return { default: "allow-all" };
110
125
  default: throw new Error(`Unknown github() policy level: '${policy}'`);
111
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flue/client",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {