@flue/client 0.0.25 → 0.0.26
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/README.md +12 -13
- package/dist/proxies/index.mjs +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,14 +14,15 @@ pnpm install @flue/client
|
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
// .flue/workflows/issue-triage.ts
|
|
17
|
-
import type {
|
|
17
|
+
import type { FlueClient } from '@flue/client';
|
|
18
18
|
|
|
19
|
-
export default async function triage(flue:
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
19
|
+
export default async function triage(flue: FlueClient, args: { issueNumber: number }) {
|
|
20
|
+
const issue = await flue.shell(`gh issue view ${args.issueNumber} --json title,body`);
|
|
21
|
+
const result = await flue.skill('triage/diagnose.md', {
|
|
22
|
+
args: { issueNumber: args.issueNumber },
|
|
23
|
+
});
|
|
23
24
|
const comment = await flue.prompt(`Summarize the triage for: ${issue.stdout}`);
|
|
24
|
-
await flue.shell(`gh issue comment ${issueNumber} --body-file -`, { stdin: comment });
|
|
25
|
+
await flue.shell(`gh issue comment ${args.issueNumber} --body-file -`, { stdin: comment });
|
|
25
26
|
}
|
|
26
27
|
```
|
|
27
28
|
|
|
@@ -29,11 +30,10 @@ export default async function triage(flue: Flue) {
|
|
|
29
30
|
|
|
30
31
|
### `flue.shell(command, options?)`
|
|
31
32
|
|
|
32
|
-
Run a shell command. Returns `{ stdout, stderr, exitCode }`.
|
|
33
|
+
Run a shell command in the target environment. Returns `{ stdout, stderr, exitCode }`.
|
|
33
34
|
|
|
34
35
|
```ts
|
|
35
36
|
const result = await flue.shell('pnpm test');
|
|
36
|
-
const result = await flue.shell('gh issue view 123', { env: { GH_TOKEN: '...' } });
|
|
37
37
|
const result = await flue.shell('cat -', { stdin: 'hello' });
|
|
38
38
|
```
|
|
39
39
|
|
|
@@ -78,14 +78,13 @@ Flue ships with built-in presets for popular services. Every proxy supports an a
|
|
|
78
78
|
```ts
|
|
79
79
|
import { anthropic, github } from '@flue/client/proxies';
|
|
80
80
|
|
|
81
|
-
export const proxies =
|
|
82
|
-
anthropic(),
|
|
83
|
-
github({
|
|
84
|
-
token: process.env.GH_TOKEN!,
|
|
81
|
+
export const proxies = {
|
|
82
|
+
anthropic: anthropic(),
|
|
83
|
+
github: github({
|
|
85
84
|
policy: {
|
|
86
85
|
base: 'allow-read',
|
|
87
86
|
allow: [{ method: 'POST', path: '/repos/withastro/astro/issues/*/comments', limit: 1 }],
|
|
88
87
|
},
|
|
89
88
|
}),
|
|
90
|
-
|
|
89
|
+
};
|
|
91
90
|
```
|
package/dist/proxies/index.mjs
CHANGED
|
@@ -79,7 +79,10 @@ function github(opts) {
|
|
|
79
79
|
},
|
|
80
80
|
policy: resolvedPolicy,
|
|
81
81
|
socket: true,
|
|
82
|
-
env: {
|
|
82
|
+
env: {
|
|
83
|
+
GH_TOKEN: "proxy-placeholder",
|
|
84
|
+
GH_HOST: "github.com"
|
|
85
|
+
},
|
|
83
86
|
setup: ["gh config set http_unix_socket {{socketPath}} 2>/dev/null || true"],
|
|
84
87
|
instructions: ["The `gh` CLI is pre-configured with authentication.", "For GitHub API calls, prefer `gh api` over raw `curl`."].join(" "),
|
|
85
88
|
denyResponse
|