@camerontaylor/paseo-cli 0.8.0-fork.1
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/bin/paseo +3 -0
- package/dist/classify.d.ts +19 -0
- package/dist/classify.js +49 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +135 -0
- package/dist/commands/agent/archive.d.ts +18 -0
- package/dist/commands/agent/archive.js +102 -0
- package/dist/commands/agent/attach.d.ts +11 -0
- package/dist/commands/agent/attach.js +161 -0
- package/dist/commands/agent/delete.d.ts +15 -0
- package/dist/commands/agent/delete.js +107 -0
- package/dist/commands/agent/detach.d.ts +9 -0
- package/dist/commands/agent/detach.js +38 -0
- package/dist/commands/agent/import.d.ts +14 -0
- package/dist/commands/agent/import.js +122 -0
- package/dist/commands/agent/index.d.ts +3 -0
- package/dist/commands/agent/index.js +56 -0
- package/dist/commands/agent/inspect.d.ts +15 -0
- package/dist/commands/agent/inspect.js +209 -0
- package/dist/commands/agent/logs.d.ts +19 -0
- package/dist/commands/agent/logs.js +180 -0
- package/dist/commands/agent/ls.d.ts +44 -0
- package/dist/commands/agent/ls.js +212 -0
- package/dist/commands/agent/mode.d.ts +18 -0
- package/dist/commands/agent/mode.js +100 -0
- package/dist/commands/agent/open.d.ts +11 -0
- package/dist/commands/agent/open.js +61 -0
- package/dist/commands/agent/reload.d.ts +15 -0
- package/dist/commands/agent/reload.js +75 -0
- package/dist/commands/agent/run.d.ts +78 -0
- package/dist/commands/agent/run.js +554 -0
- package/dist/commands/agent/send.d.ts +19 -0
- package/dist/commands/agent/send.js +187 -0
- package/dist/commands/agent/stop.d.ts +17 -0
- package/dist/commands/agent/stop.js +115 -0
- package/dist/commands/agent/update.d.ts +51 -0
- package/dist/commands/agent/update.js +186 -0
- package/dist/commands/agent/wait.d.ts +17 -0
- package/dist/commands/agent/wait.js +158 -0
- package/dist/commands/clone.d.ts +17 -0
- package/dist/commands/clone.js +65 -0
- package/dist/commands/daemon/index.d.ts +3 -0
- package/dist/commands/daemon/index.js +60 -0
- package/dist/commands/daemon/local-daemon.d.ts +78 -0
- package/dist/commands/daemon/local-daemon.js +547 -0
- package/dist/commands/daemon/pair.d.ts +35 -0
- package/dist/commands/daemon/pair.js +167 -0
- package/dist/commands/daemon/reload.d.ts +10 -0
- package/dist/commands/daemon/reload.js +36 -0
- package/dist/commands/daemon/restart.d.ts +12 -0
- package/dist/commands/daemon/restart.js +99 -0
- package/dist/commands/daemon/runtime-toolchain.d.ts +6 -0
- package/dist/commands/daemon/runtime-toolchain.js +87 -0
- package/dist/commands/daemon/set-password.d.ts +17 -0
- package/dist/commands/daemon/set-password.js +82 -0
- package/dist/commands/daemon/start.d.ts +6 -0
- package/dist/commands/daemon/start.js +57 -0
- package/dist/commands/daemon/status.d.ts +21 -0
- package/dist/commands/daemon/status.js +363 -0
- package/dist/commands/daemon/stop.d.ts +15 -0
- package/dist/commands/daemon/stop.js +60 -0
- package/dist/commands/heartbeat/index.d.ts +3 -0
- package/dist/commands/heartbeat/index.js +139 -0
- package/dist/commands/hooks.d.ts +19 -0
- package/dist/commands/hooks.js +89 -0
- package/dist/commands/hub/authority.d.ts +17 -0
- package/dist/commands/hub/authority.js +18 -0
- package/dist/commands/hub/connect.d.ts +23 -0
- package/dist/commands/hub/connect.js +44 -0
- package/dist/commands/hub/credentials.d.ts +21 -0
- package/dist/commands/hub/credentials.js +143 -0
- package/dist/commands/hub/daemon-client.d.ts +40 -0
- package/dist/commands/hub/daemon-client.js +14 -0
- package/dist/commands/hub/deploy-bundle.d.ts +16 -0
- package/dist/commands/hub/deploy-bundle.js +248 -0
- package/dist/commands/hub/deploy-triggers.d.ts +6 -0
- package/dist/commands/hub/deploy-triggers.js +116 -0
- package/dist/commands/hub/deploy.d.ts +50 -0
- package/dist/commands/hub/deploy.js +159 -0
- package/dist/commands/hub/disconnect.d.ts +16 -0
- package/dist/commands/hub/disconnect.js +24 -0
- package/dist/commands/hub/error.d.ts +6 -0
- package/dist/commands/hub/error.js +9 -0
- package/dist/commands/hub/export.d.ts +28 -0
- package/dist/commands/hub/export.js +80 -0
- package/dist/commands/hub/help.d.ts +3 -0
- package/dist/commands/hub/help.js +5 -0
- package/dist/commands/hub/hub-client/index.d.ts +22 -0
- package/dist/commands/hub/hub-client/index.js +135 -0
- package/dist/commands/hub/hub-client/internal/contracts.d.ts +126 -0
- package/dist/commands/hub/hub-client/internal/contracts.js +85 -0
- package/dist/commands/hub/hub-client/internal/problem.d.ts +3 -0
- package/dist/commands/hub/hub-client/internal/problem.js +85 -0
- package/dist/commands/hub/hub-client/internal/transport.d.ts +15 -0
- package/dist/commands/hub/hub-client/internal/transport.js +30 -0
- package/dist/commands/hub/index.d.ts +20 -0
- package/dist/commands/hub/index.js +94 -0
- package/dist/commands/hub/init-plan.d.ts +33 -0
- package/dist/commands/hub/init-plan.js +94 -0
- package/dist/commands/hub/init.d.ts +35 -0
- package/dist/commands/hub/init.js +524 -0
- package/dist/commands/hub/login-flow.d.ts +34 -0
- package/dist/commands/hub/login-flow.js +78 -0
- package/dist/commands/hub/login.d.ts +23 -0
- package/dist/commands/hub/login.js +40 -0
- package/dist/commands/hub/logout.d.ts +32 -0
- package/dist/commands/hub/logout.js +71 -0
- package/dist/commands/hub/origin.d.ts +2 -0
- package/dist/commands/hub/origin.js +27 -0
- package/dist/commands/hub/permissions.d.ts +21 -0
- package/dist/commands/hub/permissions.js +61 -0
- package/dist/commands/hub/projects.d.ts +24 -0
- package/dist/commands/hub/projects.js +49 -0
- package/dist/commands/hub/reporter.d.ts +10 -0
- package/dist/commands/hub/reporter.js +11 -0
- package/dist/commands/hub/starter-agent-runtime.d.ts +37 -0
- package/dist/commands/hub/starter-agent-runtime.js +49 -0
- package/dist/commands/hub/starter-trigger.d.ts +10 -0
- package/dist/commands/hub/starter-trigger.js +30 -0
- package/dist/commands/hub/status-output.d.ts +13 -0
- package/dist/commands/hub/status-output.js +30 -0
- package/dist/commands/onboard.d.ts +10 -0
- package/dist/commands/onboard.js +400 -0
- package/dist/commands/open.d.ts +4 -0
- package/dist/commands/open.js +89 -0
- package/dist/commands/permit/allow.d.ts +20 -0
- package/dist/commands/permit/allow.js +133 -0
- package/dist/commands/permit/deny.d.ts +12 -0
- package/dist/commands/permit/deny.js +105 -0
- package/dist/commands/permit/index.d.ts +3 -0
- package/dist/commands/permit/index.js +27 -0
- package/dist/commands/permit/ls.d.ts +18 -0
- package/dist/commands/permit/ls.js +66 -0
- package/dist/commands/plugin/index.d.ts +17 -0
- package/dist/commands/plugin/index.js +138 -0
- package/dist/commands/plugin/scaffold.d.ts +6 -0
- package/dist/commands/plugin/scaffold.js +162 -0
- package/dist/commands/plugin/shared.d.ts +5 -0
- package/dist/commands/plugin/shared.js +30 -0
- package/dist/commands/project/create.d.ts +10 -0
- package/dist/commands/project/create.js +41 -0
- package/dist/commands/project/delete.d.ts +9 -0
- package/dist/commands/project/delete.js +33 -0
- package/dist/commands/project/index.d.ts +3 -0
- package/dist/commands/project/index.js +28 -0
- package/dist/commands/project/ls.d.ts +5 -0
- package/dist/commands/project/ls.js +19 -0
- package/dist/commands/project/rename.d.ts +15 -0
- package/dist/commands/project/rename.js +50 -0
- package/dist/commands/project/shared.d.ts +11 -0
- package/dist/commands/project/shared.js +18 -0
- package/dist/commands/provider/add.d.ts +30 -0
- package/dist/commands/provider/add.js +123 -0
- package/dist/commands/provider/diagnostic.d.ts +12 -0
- package/dist/commands/provider/diagnostic.js +31 -0
- package/dist/commands/provider/index.d.ts +3 -0
- package/dist/commands/provider/index.js +38 -0
- package/dist/commands/provider/ls.d.ts +20 -0
- package/dist/commands/provider/ls.js +76 -0
- package/dist/commands/provider/models.d.ts +20 -0
- package/dist/commands/provider/models.js +53 -0
- package/dist/commands/provider/rm.d.ts +10 -0
- package/dist/commands/provider/rm.js +45 -0
- package/dist/commands/provider/shared.d.ts +7 -0
- package/dist/commands/provider/shared.js +10 -0
- package/dist/commands/schedule/create.d.ts +19 -0
- package/dist/commands/schedule/create.js +41 -0
- package/dist/commands/schedule/delete.d.ts +10 -0
- package/dist/commands/schedule/delete.js +32 -0
- package/dist/commands/schedule/index.d.ts +3 -0
- package/dist/commands/schedule/index.js +66 -0
- package/dist/commands/schedule/inspect.d.ts +6 -0
- package/dist/commands/schedule/inspect.js +27 -0
- package/dist/commands/schedule/logs.d.ts +6 -0
- package/dist/commands/schedule/logs.js +24 -0
- package/dist/commands/schedule/ls.d.ts +5 -0
- package/dist/commands/schedule/ls.js +25 -0
- package/dist/commands/schedule/pause.d.ts +5 -0
- package/dist/commands/schedule/pause.js +24 -0
- package/dist/commands/schedule/resume.d.ts +5 -0
- package/dist/commands/schedule/resume.js +24 -0
- package/dist/commands/schedule/run-once.d.ts +5 -0
- package/dist/commands/schedule/run-once.js +24 -0
- package/dist/commands/schedule/schema.d.ts +21 -0
- package/dist/commands/schedule/schema.js +67 -0
- package/dist/commands/schedule/shared.d.ts +59 -0
- package/dist/commands/schedule/shared.js +358 -0
- package/dist/commands/schedule/types.d.ts +165 -0
- package/dist/commands/schedule/types.js +2 -0
- package/dist/commands/schedule/update.d.ts +21 -0
- package/dist/commands/schedule/update.js +40 -0
- package/dist/commands/script/index.d.ts +3 -0
- package/dist/commands/script/index.js +19 -0
- package/dist/commands/script/ls.d.ts +6 -0
- package/dist/commands/script/ls.js +20 -0
- package/dist/commands/script/schema.d.ts +5 -0
- package/dist/commands/script/schema.js +13 -0
- package/dist/commands/script/shared.d.ts +11 -0
- package/dist/commands/script/shared.js +59 -0
- package/dist/commands/script/start.d.ts +6 -0
- package/dist/commands/script/start.js +23 -0
- package/dist/commands/script/stop.d.ts +6 -0
- package/dist/commands/script/stop.js +23 -0
- package/dist/commands/speech/index.d.ts +3 -0
- package/dist/commands/speech/index.js +5 -0
- package/dist/commands/terminal/capture.d.ts +10 -0
- package/dist/commands/terminal/capture.js +68 -0
- package/dist/commands/terminal/create.d.ts +11 -0
- package/dist/commands/terminal/create.js +29 -0
- package/dist/commands/terminal/index.d.ts +3 -0
- package/dist/commands/terminal/index.js +45 -0
- package/dist/commands/terminal/kill.d.ts +6 -0
- package/dist/commands/terminal/kill.js +36 -0
- package/dist/commands/terminal/ls.d.ts +11 -0
- package/dist/commands/terminal/ls.js +21 -0
- package/dist/commands/terminal/schema.d.ts +10 -0
- package/dist/commands/terminal/schema.js +17 -0
- package/dist/commands/terminal/send-keys.d.ts +7 -0
- package/dist/commands/terminal/send-keys.js +45 -0
- package/dist/commands/terminal/shared.d.ts +12 -0
- package/dist/commands/terminal/shared.js +62 -0
- package/dist/commands/workspace/archive.d.ts +12 -0
- package/dist/commands/workspace/archive.js +41 -0
- package/dist/commands/workspace/create.d.ts +49 -0
- package/dist/commands/workspace/create.js +114 -0
- package/dist/commands/workspace/index.d.ts +3 -0
- package/dist/commands/workspace/index.js +45 -0
- package/dist/commands/workspace/ls.d.ts +7 -0
- package/dist/commands/workspace/ls.js +28 -0
- package/dist/commands/workspace/rename.d.ts +22 -0
- package/dist/commands/workspace/rename.js +61 -0
- package/dist/commands/workspace/setup.d.ts +11 -0
- package/dist/commands/workspace/setup.js +41 -0
- package/dist/commands/workspace/shared.d.ts +12 -0
- package/dist/commands/workspace/shared.js +20 -0
- package/dist/commands/worktree/archive.d.ts +20 -0
- package/dist/commands/worktree/archive.js +104 -0
- package/dist/commands/worktree/create-input.d.ts +15 -0
- package/dist/commands/worktree/create-input.js +56 -0
- package/dist/commands/worktree/create.d.ts +11 -0
- package/dist/commands/worktree/create.js +58 -0
- package/dist/commands/worktree/index.d.ts +3 -0
- package/dist/commands/worktree/index.js +25 -0
- package/dist/commands/worktree/ls.d.ts +19 -0
- package/dist/commands/worktree/ls.js +97 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/output/index.d.ts +45 -0
- package/dist/output/index.js +47 -0
- package/dist/output/json.d.ts +11 -0
- package/dist/output/json.js +37 -0
- package/dist/output/pairing.d.ts +8 -0
- package/dist/output/pairing.js +24 -0
- package/dist/output/quiet.d.ts +9 -0
- package/dist/output/quiet.js +22 -0
- package/dist/output/render.d.ts +15 -0
- package/dist/output/render.js +84 -0
- package/dist/output/table.d.ts +13 -0
- package/dist/output/table.js +135 -0
- package/dist/output/types.d.ts +73 -0
- package/dist/output/types.js +8 -0
- package/dist/output/with-output.d.ts +41 -0
- package/dist/output/with-output.js +85 -0
- package/dist/output/yaml.d.ts +11 -0
- package/dist/output/yaml.js +38 -0
- package/dist/run.d.ts +14 -0
- package/dist/run.js +40 -0
- package/dist/ssh/ssh-tunnel.d.ts +9 -0
- package/dist/ssh/ssh-tunnel.js +79 -0
- package/dist/utils/client-id.d.ts +2 -0
- package/dist/utils/client-id.js +37 -0
- package/dist/utils/client.d.ts +54 -0
- package/dist/utils/client.js +363 -0
- package/dist/utils/command-options.d.ts +7 -0
- package/dist/utils/command-options.js +25 -0
- package/dist/utils/duration.d.ts +7 -0
- package/dist/utils/duration.js +39 -0
- package/dist/utils/errors.d.ts +5 -0
- package/dist/utils/errors.js +10 -0
- package/dist/utils/paths.d.ts +12 -0
- package/dist/utils/paths.js +22 -0
- package/dist/utils/provider-model.d.ts +11 -0
- package/dist/utils/provider-model.js +49 -0
- package/dist/utils/timeline.d.ts +11 -0
- package/dist/utils/timeline.js +11 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +10 -0
- package/package.json +50 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const authorizationSchema: z.ZodObject<{
|
|
3
|
+
deviceCode: z.ZodString;
|
|
4
|
+
userCode: z.ZodString;
|
|
5
|
+
verificationUri: z.ZodURL;
|
|
6
|
+
verificationUriComplete: z.ZodURL;
|
|
7
|
+
expiresAt: z.ZodString;
|
|
8
|
+
interval: z.ZodNumber;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export declare const authorizationPollSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
status: z.ZodLiteral<"pending">;
|
|
12
|
+
interval: z.ZodNumber;
|
|
13
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
14
|
+
status: z.ZodLiteral<"slow_down">;
|
|
15
|
+
interval: z.ZodNumber;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
status: z.ZodLiteral<"authorized">;
|
|
18
|
+
interval: z.ZodNumber;
|
|
19
|
+
credential: z.ZodString;
|
|
20
|
+
organizationId: z.ZodString;
|
|
21
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
22
|
+
status: z.ZodLiteral<"denied">;
|
|
23
|
+
interval: z.ZodNumber;
|
|
24
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
25
|
+
status: z.ZodLiteral<"expired">;
|
|
26
|
+
interval: z.ZodNumber;
|
|
27
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
28
|
+
status: z.ZodLiteral<"disclosed">;
|
|
29
|
+
interval: z.ZodNumber;
|
|
30
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
+
status: z.ZodLiteral<"retry_later">;
|
|
32
|
+
}, z.core.$strict>], "status">;
|
|
33
|
+
declare const projectSchema: z.ZodObject<{
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
slug: z.ZodString;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export declare const projectsResponseSchema: z.ZodObject<{
|
|
39
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
slug: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
}, z.core.$strict>>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
declare const triggerSchema: z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
name: z.ZodString;
|
|
48
|
+
enabled: z.ZodBoolean;
|
|
49
|
+
format: z.ZodEnum<{
|
|
50
|
+
single_run: "single_run";
|
|
51
|
+
legacy_multistep: "legacy_multistep";
|
|
52
|
+
}>;
|
|
53
|
+
yaml: z.ZodString;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
export declare const triggersResponseSchema: z.ZodObject<{
|
|
56
|
+
triggers: z.ZodArray<z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
enabled: z.ZodBoolean;
|
|
60
|
+
format: z.ZodEnum<{
|
|
61
|
+
single_run: "single_run";
|
|
62
|
+
legacy_multistep: "legacy_multistep";
|
|
63
|
+
}>;
|
|
64
|
+
yaml: z.ZodString;
|
|
65
|
+
}, z.core.$strict>>;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
export declare const triggerValidationResponseSchema: z.ZodObject<{
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
valid: z.ZodLiteral<true>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
export declare const triggerInstallationResponseSchema: z.ZodObject<{
|
|
72
|
+
triggerId: z.ZodString;
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
revisionId: z.ZodString;
|
|
75
|
+
version: z.ZodNumber;
|
|
76
|
+
active: z.ZodLiteral<true>;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
export declare const configurationResourcesSchema: z.ZodObject<{
|
|
79
|
+
daemons: z.ZodArray<z.ZodObject<{
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
slug: z.ZodString;
|
|
82
|
+
}, z.core.$strict>>;
|
|
83
|
+
github: z.ZodArray<z.ZodObject<{
|
|
84
|
+
slug: z.ZodString;
|
|
85
|
+
accountLogin: z.ZodString;
|
|
86
|
+
accountType: z.ZodString;
|
|
87
|
+
repositories: z.ZodArray<z.ZodString>;
|
|
88
|
+
}, z.core.$strict>>;
|
|
89
|
+
discord: z.ZodArray<z.ZodObject<{
|
|
90
|
+
slug: z.ZodString;
|
|
91
|
+
guildName: z.ZodString;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
slack: z.ZodArray<z.ZodObject<{
|
|
94
|
+
slug: z.ZodString;
|
|
95
|
+
teamName: z.ZodString;
|
|
96
|
+
}, z.core.$strict>>;
|
|
97
|
+
linear: z.ZodArray<z.ZodObject<{
|
|
98
|
+
slug: z.ZodString;
|
|
99
|
+
organizationName: z.ZodString;
|
|
100
|
+
}, z.core.$strict>>;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
export declare const installResponseSchema: z.ZodObject<{
|
|
103
|
+
projectSlug: z.ZodString;
|
|
104
|
+
version: z.ZodNumber;
|
|
105
|
+
versionId: z.ZodString;
|
|
106
|
+
active: z.ZodLiteral<true>;
|
|
107
|
+
}, z.core.$strict>;
|
|
108
|
+
export declare const validationResponseSchema: z.ZodObject<{
|
|
109
|
+
projectSlug: z.ZodString;
|
|
110
|
+
valid: z.ZodLiteral<true>;
|
|
111
|
+
}, z.core.$strict>;
|
|
112
|
+
export declare const enrollmentTokenSchema: z.ZodObject<{
|
|
113
|
+
token: z.ZodString;
|
|
114
|
+
expiresAt: z.ZodString;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
export type CliAuthorization = z.infer<typeof authorizationSchema>;
|
|
117
|
+
export type CliAuthorizationPoll = z.infer<typeof authorizationPollSchema>;
|
|
118
|
+
export type HubProject = z.infer<typeof projectSchema>;
|
|
119
|
+
export type HubTrigger = z.infer<typeof triggerSchema>;
|
|
120
|
+
export type HubTriggerValidationResult = z.infer<typeof triggerValidationResponseSchema>;
|
|
121
|
+
export type HubTriggerInstallationResult = z.infer<typeof triggerInstallationResponseSchema>;
|
|
122
|
+
export type HubConfigurationResources = z.infer<typeof configurationResourcesSchema>;
|
|
123
|
+
export type HubInstallResult = z.infer<typeof installResponseSchema>;
|
|
124
|
+
export type HubValidationResult = z.infer<typeof validationResponseSchema>;
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const activationUrlSchema = z.url({ protocol: /^https?$/u });
|
|
3
|
+
export const authorizationSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
deviceCode: z.string().min(32),
|
|
6
|
+
userCode: z.string().min(1),
|
|
7
|
+
verificationUri: activationUrlSchema,
|
|
8
|
+
verificationUriComplete: activationUrlSchema,
|
|
9
|
+
expiresAt: z.string().datetime(),
|
|
10
|
+
interval: z.number().int().min(1),
|
|
11
|
+
})
|
|
12
|
+
.strict();
|
|
13
|
+
export const authorizationPollSchema = z.discriminatedUnion("status", [
|
|
14
|
+
z.object({ status: z.literal("pending"), interval: z.number().int().min(1) }).strict(),
|
|
15
|
+
z.object({ status: z.literal("slow_down"), interval: z.number().int().min(1) }).strict(),
|
|
16
|
+
z
|
|
17
|
+
.object({
|
|
18
|
+
status: z.literal("authorized"),
|
|
19
|
+
interval: z.number().int().min(1),
|
|
20
|
+
credential: z.string().min(32),
|
|
21
|
+
organizationId: z.string().min(1),
|
|
22
|
+
})
|
|
23
|
+
.strict(),
|
|
24
|
+
z.object({ status: z.literal("denied"), interval: z.number().int().min(1) }).strict(),
|
|
25
|
+
z.object({ status: z.literal("expired"), interval: z.number().int().min(1) }).strict(),
|
|
26
|
+
z.object({ status: z.literal("disclosed"), interval: z.number().int().min(1) }).strict(),
|
|
27
|
+
z.object({ status: z.literal("retry_later") }).strict(),
|
|
28
|
+
]);
|
|
29
|
+
const projectSchema = z
|
|
30
|
+
.object({ id: z.string().uuid(), slug: z.string().min(1), name: z.string().min(1) })
|
|
31
|
+
.strict();
|
|
32
|
+
export const projectsResponseSchema = z.object({ projects: z.array(projectSchema) }).strict();
|
|
33
|
+
const triggerSchema = z
|
|
34
|
+
.object({
|
|
35
|
+
id: z.string().uuid(),
|
|
36
|
+
name: z.string().regex(/^[a-z][a-z0-9_-]*$/u),
|
|
37
|
+
enabled: z.boolean(),
|
|
38
|
+
format: z.enum(["single_run", "legacy_multistep"]),
|
|
39
|
+
yaml: z.string(),
|
|
40
|
+
})
|
|
41
|
+
.strict();
|
|
42
|
+
export const triggersResponseSchema = z.object({ triggers: z.array(triggerSchema) }).strict();
|
|
43
|
+
export const triggerValidationResponseSchema = z
|
|
44
|
+
.object({ name: z.string().regex(/^[a-z][a-z0-9_-]*$/u), valid: z.literal(true) })
|
|
45
|
+
.strict();
|
|
46
|
+
export const triggerInstallationResponseSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
triggerId: z.string().uuid(),
|
|
49
|
+
name: z.string().regex(/^[a-z][a-z0-9_-]*$/u),
|
|
50
|
+
revisionId: z.string().uuid(),
|
|
51
|
+
version: z.number().int().positive(),
|
|
52
|
+
active: z.literal(true),
|
|
53
|
+
})
|
|
54
|
+
.strict();
|
|
55
|
+
export const configurationResourcesSchema = z
|
|
56
|
+
.object({
|
|
57
|
+
daemons: z.array(z.object({ id: z.string().uuid(), slug: z.string().min(1) }).strict()),
|
|
58
|
+
github: z.array(z
|
|
59
|
+
.object({
|
|
60
|
+
slug: z.string().min(1),
|
|
61
|
+
accountLogin: z.string().min(1),
|
|
62
|
+
accountType: z.string().min(1),
|
|
63
|
+
repositories: z.array(z.string().min(1)),
|
|
64
|
+
})
|
|
65
|
+
.strict()),
|
|
66
|
+
discord: z.array(z.object({ slug: z.string().min(1), guildName: z.string().min(1) }).strict()),
|
|
67
|
+
slack: z.array(z.object({ slug: z.string().min(1), teamName: z.string().min(1) }).strict()),
|
|
68
|
+
linear: z.array(z.object({ slug: z.string().min(1), organizationName: z.string().min(1) }).strict()),
|
|
69
|
+
})
|
|
70
|
+
.strict();
|
|
71
|
+
export const installResponseSchema = z
|
|
72
|
+
.object({
|
|
73
|
+
projectSlug: z.string().min(1),
|
|
74
|
+
version: z.number().int().positive(),
|
|
75
|
+
versionId: z.string().uuid(),
|
|
76
|
+
active: z.literal(true),
|
|
77
|
+
})
|
|
78
|
+
.strict();
|
|
79
|
+
export const validationResponseSchema = z
|
|
80
|
+
.object({ projectSlug: z.string().min(1), valid: z.literal(true) })
|
|
81
|
+
.strict();
|
|
82
|
+
export const enrollmentTokenSchema = z
|
|
83
|
+
.object({ token: z.string().min(32), expiresAt: z.string().datetime() })
|
|
84
|
+
.strict();
|
|
85
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { HubCommandError } from "../../error.js";
|
|
3
|
+
const issuePathSchema = z.union([z.string(), z.array(z.union([z.string(), z.number()]))]);
|
|
4
|
+
const fieldIssueSchema = z.object({
|
|
5
|
+
field: z.string().optional(),
|
|
6
|
+
path: issuePathSchema.optional(),
|
|
7
|
+
message: z.string(),
|
|
8
|
+
});
|
|
9
|
+
const problemSchema = z.object({
|
|
10
|
+
type: z.string().optional(),
|
|
11
|
+
title: z.string().optional(),
|
|
12
|
+
status: z.number().int().optional(),
|
|
13
|
+
detail: z.string().optional(),
|
|
14
|
+
instance: z.string().optional(),
|
|
15
|
+
errors: z
|
|
16
|
+
.union([z.array(fieldIssueSchema), z.record(z.string(), z.array(z.string()))])
|
|
17
|
+
.optional(),
|
|
18
|
+
issues: z.array(fieldIssueSchema).optional(),
|
|
19
|
+
});
|
|
20
|
+
export async function hubRequestFailure(response, failureMessage, apiKey) {
|
|
21
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
22
|
+
if (!contentType.toLowerCase().includes("application/problem+json")) {
|
|
23
|
+
return new HubCommandError("HUB_REQUEST_FAILED", `${failureMessage} with HTTP ${response.status}.`);
|
|
24
|
+
}
|
|
25
|
+
let body;
|
|
26
|
+
try {
|
|
27
|
+
body = await response.json();
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return new HubCommandError("HUB_INVALID_RESPONSE", `Hub returned malformed problem details for HTTP ${response.status}.`);
|
|
31
|
+
}
|
|
32
|
+
const parsed = problemSchema.safeParse(body);
|
|
33
|
+
if (!parsed.success ||
|
|
34
|
+
(parsed.data.status !== undefined && parsed.data.status !== response.status)) {
|
|
35
|
+
return new HubCommandError("HUB_INVALID_RESPONSE", `Hub returned nonconforming problem details for HTTP ${response.status}.`);
|
|
36
|
+
}
|
|
37
|
+
const title = parsed.data.title ?? `${failureMessage} with HTTP ${response.status}`;
|
|
38
|
+
const details = formatFieldIssues(parsed.data.errors, parsed.data.issues);
|
|
39
|
+
const message = details !== undefined || parsed.data.detail === undefined
|
|
40
|
+
? title
|
|
41
|
+
: `${title}: ${parsed.data.detail}`;
|
|
42
|
+
let code = "HUB_REQUEST_FAILED";
|
|
43
|
+
if (response.status === 422)
|
|
44
|
+
code = "HUB_VALIDATION_FAILED";
|
|
45
|
+
if (response.status === 404)
|
|
46
|
+
code = "HUB_NOT_FOUND";
|
|
47
|
+
return new HubCommandError(code, redactSecret(message, apiKey), details === undefined ? undefined : redactSecret(details, apiKey));
|
|
48
|
+
}
|
|
49
|
+
function formatFieldIssues(errors, issues) {
|
|
50
|
+
const fieldIssues = Array.isArray(errors) ? errors : issues;
|
|
51
|
+
if (fieldIssues !== undefined) {
|
|
52
|
+
const lines = fieldIssues.map((issue) => {
|
|
53
|
+
const field = issue.field ?? formatIssuePath(issue.path);
|
|
54
|
+
return field === undefined ? issue.message : `${field}: ${issue.message}`;
|
|
55
|
+
});
|
|
56
|
+
return lines.length === 0 ? undefined : lines.join("\n");
|
|
57
|
+
}
|
|
58
|
+
if (errors === undefined)
|
|
59
|
+
return undefined;
|
|
60
|
+
const lines = Object.entries(errors).flatMap(([field, messages]) => messages.map((message) => `${field}: ${message}`));
|
|
61
|
+
return lines.length === 0 ? undefined : lines.join("\n");
|
|
62
|
+
}
|
|
63
|
+
function formatIssuePath(path) {
|
|
64
|
+
if (path === undefined || typeof path === "string")
|
|
65
|
+
return path;
|
|
66
|
+
const [file, ...fieldPath] = path;
|
|
67
|
+
if (typeof file === "string" && file.startsWith(".paseo/") && fieldPath.length > 0) {
|
|
68
|
+
return `${file}: ${formatPathSegments(fieldPath)}`;
|
|
69
|
+
}
|
|
70
|
+
return formatPathSegments(path) || undefined;
|
|
71
|
+
}
|
|
72
|
+
function formatPathSegments(path) {
|
|
73
|
+
let formatted = "";
|
|
74
|
+
for (const segment of path) {
|
|
75
|
+
if (typeof segment === "number")
|
|
76
|
+
formatted += `[${segment}]`;
|
|
77
|
+
else
|
|
78
|
+
formatted += formatted.length === 0 ? segment : `.${segment}`;
|
|
79
|
+
}
|
|
80
|
+
return formatted;
|
|
81
|
+
}
|
|
82
|
+
function redactSecret(value, secret) {
|
|
83
|
+
return secret === undefined ? value : value.split(secret).join("[redacted]");
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=problem.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
interface HubRequest<T> {
|
|
3
|
+
origin: string;
|
|
4
|
+
path: string;
|
|
5
|
+
method: "GET" | "POST";
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
body?: unknown;
|
|
8
|
+
successStatus: number;
|
|
9
|
+
schema: z.ZodType<T>;
|
|
10
|
+
timeoutMilliseconds?: number;
|
|
11
|
+
failureMessage: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function requestHub<T>(input: HubRequest<T>): Promise<T>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HubCommandError } from "../../error.js";
|
|
2
|
+
import { hubRequestFailure } from "./problem.js";
|
|
3
|
+
export async function requestHub(input) {
|
|
4
|
+
const signal = AbortSignal.timeout(input.timeoutMilliseconds ?? 15000);
|
|
5
|
+
let response;
|
|
6
|
+
try {
|
|
7
|
+
response = await fetch(`${input.origin}${input.path}`, {
|
|
8
|
+
method: input.method,
|
|
9
|
+
headers: {
|
|
10
|
+
...(input.apiKey === undefined ? {} : { authorization: `Bearer ${input.apiKey}` }),
|
|
11
|
+
...(input.body === undefined ? {} : { "content-type": "application/json" }),
|
|
12
|
+
},
|
|
13
|
+
...(input.body === undefined ? {} : { body: JSON.stringify(input.body) }),
|
|
14
|
+
signal,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
throw new HubCommandError("HUB_NETWORK_ERROR", `Could not reach Paseo Hub at ${input.origin}. Check the Hub URL and network connection.`);
|
|
19
|
+
}
|
|
20
|
+
if (response.status !== input.successStatus) {
|
|
21
|
+
throw await hubRequestFailure(response, input.failureMessage, input.apiKey);
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
return input.schema.parse(await response.json());
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
throw new HubCommandError("HUB_INVALID_RESPONSE", "Hub returned a malformed response.");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { HubHttpClient } from "./hub-client/index.js";
|
|
3
|
+
import { type HubCredentialStore } from "./credentials.js";
|
|
4
|
+
import { type HubDaemonConnection } from "./daemon-client.js";
|
|
5
|
+
import { type CliLoginFlow } from "./login-flow.js";
|
|
6
|
+
import { type HubReporter } from "./reporter.js";
|
|
7
|
+
interface HubCommandEnvironment {
|
|
8
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
9
|
+
credentials: HubCredentialStore;
|
|
10
|
+
hub: HubHttpClient;
|
|
11
|
+
login: Pick<CliLoginFlow, "authorize">;
|
|
12
|
+
daemon: HubDaemonConnection;
|
|
13
|
+
isInteractive(): boolean;
|
|
14
|
+
confirmDisconnect(origin: string): Promise<boolean>;
|
|
15
|
+
reporter: HubReporter;
|
|
16
|
+
cwd(): string;
|
|
17
|
+
}
|
|
18
|
+
export declare function createHubCommand(overrides?: Partial<HubCommandEnvironment>): Command;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { withOutput } from "../../output/index.js";
|
|
3
|
+
import { addJsonAndDaemonHostOptions } from "../../utils/command-options.js";
|
|
4
|
+
import { HubHttpClient } from "./hub-client/index.js";
|
|
5
|
+
import { addHubConnectCommand } from "./connect.js";
|
|
6
|
+
import { PrivateHubCredentialStore } from "./credentials.js";
|
|
7
|
+
import { productionHubDaemonConnection, withHubDaemon, } from "./daemon-client.js";
|
|
8
|
+
import { addHubDeployCommand } from "./deploy.js";
|
|
9
|
+
import { addHubDisconnectCommand } from "./disconnect.js";
|
|
10
|
+
import { createCliLoginFlow } from "./login-flow.js";
|
|
11
|
+
import { addHubLoginCommand } from "./login.js";
|
|
12
|
+
import { addHubLogoutCommand, productionLogoutPrompt } from "./logout.js";
|
|
13
|
+
import { addHubProjectsCommand } from "./projects.js";
|
|
14
|
+
import { addHubExportCommand } from "./export.js";
|
|
15
|
+
import { processHubReporter } from "./reporter.js";
|
|
16
|
+
import { hubStatusResult } from "./status-output.js";
|
|
17
|
+
import { addHubResolutionHelp } from "./help.js";
|
|
18
|
+
import { addHubInitCommand, continueHubGuidedSetup } from "./init.js";
|
|
19
|
+
import { addHubPermissionsCommand } from "./permissions.js";
|
|
20
|
+
function productionEnvironment() {
|
|
21
|
+
const env = process.env;
|
|
22
|
+
const hub = new HubHttpClient();
|
|
23
|
+
return {
|
|
24
|
+
env,
|
|
25
|
+
credentials: new PrivateHubCredentialStore(env),
|
|
26
|
+
hub,
|
|
27
|
+
login: createCliLoginFlow(hub),
|
|
28
|
+
daemon: productionHubDaemonConnection,
|
|
29
|
+
reporter: processHubReporter,
|
|
30
|
+
cwd: () => process.cwd(),
|
|
31
|
+
...productionLogoutPrompt,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function createHubCommand(overrides = {}) {
|
|
35
|
+
const environment = { ...productionEnvironment(), ...overrides };
|
|
36
|
+
const hub = addHubResolutionHelp(new Command("hub").description("Manage Paseo Hub"));
|
|
37
|
+
addHubLoginCommand(hub, {
|
|
38
|
+
env: environment.env,
|
|
39
|
+
credentials: environment.credentials,
|
|
40
|
+
flow: environment.login,
|
|
41
|
+
reporter: environment.reporter,
|
|
42
|
+
isInteractive: environment.isInteractive,
|
|
43
|
+
continueGuidedSetup: (origin) => continueHubGuidedSetup(origin, environment),
|
|
44
|
+
});
|
|
45
|
+
addHubInitCommand(hub, environment);
|
|
46
|
+
addHubConnectCommand(hub, {
|
|
47
|
+
env: environment.env,
|
|
48
|
+
credentials: environment.credentials,
|
|
49
|
+
hub: environment.hub,
|
|
50
|
+
daemon: environment.daemon,
|
|
51
|
+
reporter: environment.reporter,
|
|
52
|
+
});
|
|
53
|
+
addJsonAndDaemonHostOptions(hub.command("status")).action(withOutput(async (...args) => {
|
|
54
|
+
const options = args.at(-2);
|
|
55
|
+
return withHubDaemon(environment.daemon, options.host, async (client) => hubStatusResult((await client.getHubStatus()).status));
|
|
56
|
+
}));
|
|
57
|
+
addHubDisconnectCommand(hub, {
|
|
58
|
+
daemon: environment.daemon,
|
|
59
|
+
reporter: environment.reporter,
|
|
60
|
+
});
|
|
61
|
+
addHubPermissionsCommand(hub, {
|
|
62
|
+
daemon: environment.daemon,
|
|
63
|
+
reporter: environment.reporter,
|
|
64
|
+
});
|
|
65
|
+
addHubProjectsCommand(hub, {
|
|
66
|
+
env: environment.env,
|
|
67
|
+
credentials: environment.credentials,
|
|
68
|
+
hub: environment.hub,
|
|
69
|
+
reporter: environment.reporter,
|
|
70
|
+
});
|
|
71
|
+
addHubExportCommand(hub, {
|
|
72
|
+
env: environment.env,
|
|
73
|
+
credentials: environment.credentials,
|
|
74
|
+
hub: environment.hub,
|
|
75
|
+
reporter: environment.reporter,
|
|
76
|
+
cwd: environment.cwd,
|
|
77
|
+
});
|
|
78
|
+
addHubDeployCommand(hub, {
|
|
79
|
+
env: environment.env,
|
|
80
|
+
credentials: environment.credentials,
|
|
81
|
+
hub: environment.hub,
|
|
82
|
+
reporter: environment.reporter,
|
|
83
|
+
cwd: environment.cwd,
|
|
84
|
+
});
|
|
85
|
+
addHubLogoutCommand(hub, {
|
|
86
|
+
credentials: environment.credentials,
|
|
87
|
+
daemon: environment.daemon,
|
|
88
|
+
isInteractive: environment.isInteractive,
|
|
89
|
+
confirmDisconnect: environment.confirmDisconnect,
|
|
90
|
+
reporter: environment.reporter,
|
|
91
|
+
});
|
|
92
|
+
return hub;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { HubStatus } from "./daemon-client.js";
|
|
2
|
+
import type { HubStarterAgentRuntime } from "./starter-agent-runtime.js";
|
|
3
|
+
export type HubInitProvider = "github" | "slack" | "discord";
|
|
4
|
+
export type HubInitConnectionResolution = {
|
|
5
|
+
kind: "connected";
|
|
6
|
+
daemonId: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "pending";
|
|
9
|
+
state: "connecting" | "reconnecting";
|
|
10
|
+
} | {
|
|
11
|
+
kind: "connect";
|
|
12
|
+
} | {
|
|
13
|
+
kind: "conflict";
|
|
14
|
+
origin: string;
|
|
15
|
+
};
|
|
16
|
+
export interface HubInitScaffoldInput {
|
|
17
|
+
cwd: string;
|
|
18
|
+
daemonSlug: string;
|
|
19
|
+
agent: HubStarterAgentRuntime & {
|
|
20
|
+
mode: string;
|
|
21
|
+
};
|
|
22
|
+
provider: HubInitProvider;
|
|
23
|
+
providerFilters: Readonly<Record<string, string>>;
|
|
24
|
+
}
|
|
25
|
+
export interface HubInitScaffold {
|
|
26
|
+
triggerPath: string;
|
|
27
|
+
trigger: string;
|
|
28
|
+
testAction: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function hubLoginResumeCommand(step: "connect" | "init", origin: string): string;
|
|
31
|
+
export declare function resolveHubInitConnection(status: HubStatus, origin: string): HubInitConnectionResolution;
|
|
32
|
+
export declare function createHubInitScaffold(input: HubInitScaffoldInput): HubInitScaffold;
|
|
33
|
+
//# sourceMappingURL=init-plan.d.ts.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import YAML from "yaml";
|
|
3
|
+
export function hubLoginResumeCommand(step, origin) {
|
|
4
|
+
return step === "connect" ? `paseo hub connect ${origin}` : "paseo hub init";
|
|
5
|
+
}
|
|
6
|
+
export function resolveHubInitConnection(status, origin) {
|
|
7
|
+
if (status.state === "connected" && status.hubOrigin === origin && status.daemonId !== null) {
|
|
8
|
+
return { kind: "connected", daemonId: status.daemonId };
|
|
9
|
+
}
|
|
10
|
+
if ((status.state === "connecting" || status.state === "reconnecting") &&
|
|
11
|
+
status.hubOrigin === origin) {
|
|
12
|
+
return { kind: "pending", state: status.state };
|
|
13
|
+
}
|
|
14
|
+
if (status.hubOrigin !== null && status.state !== "not_connected" && status.state !== "revoked") {
|
|
15
|
+
return { kind: "conflict", origin: status.hubOrigin };
|
|
16
|
+
}
|
|
17
|
+
return { kind: "connect" };
|
|
18
|
+
}
|
|
19
|
+
export function createHubInitScaffold(input) {
|
|
20
|
+
const provider = providerScaffold(input.provider, input.providerFilters);
|
|
21
|
+
return {
|
|
22
|
+
triggerPath: `.paseo/triggers/${input.provider}-help.yml`,
|
|
23
|
+
trigger: YAML.stringify(triggerDocument({
|
|
24
|
+
...provider,
|
|
25
|
+
target: { daemon: input.daemonSlug, cwd: path.resolve(input.cwd) },
|
|
26
|
+
agent: {
|
|
27
|
+
provider: input.agent.provider,
|
|
28
|
+
model: input.agent.model,
|
|
29
|
+
mode: input.agent.mode,
|
|
30
|
+
},
|
|
31
|
+
}), { lineWidth: 0 }),
|
|
32
|
+
testAction: provider.testAction,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function providerScaffold(provider, filters) {
|
|
36
|
+
const connection = requireFilter(filters, "connection");
|
|
37
|
+
if (provider === "github") {
|
|
38
|
+
const repo = requireFilter(filters, "repo");
|
|
39
|
+
const user = requireFilter(filters, "user");
|
|
40
|
+
return {
|
|
41
|
+
name: "github-help",
|
|
42
|
+
event: "github.issue_comment",
|
|
43
|
+
connection,
|
|
44
|
+
filters: { repo, contains: "@paseo", from_users: [user] },
|
|
45
|
+
testAction: `Comment \`@paseo have a look\` on ${repo}.`,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const user = requireFilter(filters, "user");
|
|
49
|
+
if (provider === "slack") {
|
|
50
|
+
return {
|
|
51
|
+
name: "slack-help",
|
|
52
|
+
event: "slack.mention",
|
|
53
|
+
connection,
|
|
54
|
+
filters: { from_users: [user] },
|
|
55
|
+
reply: "slack.reply",
|
|
56
|
+
testAction: "Mention `@Paseo have a look` in Slack.",
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
name: "discord-help",
|
|
61
|
+
event: "discord.mention",
|
|
62
|
+
connection,
|
|
63
|
+
filters: { from_users: [user] },
|
|
64
|
+
reply: "discord.reply",
|
|
65
|
+
testAction: "Mention `@Paseo have a look` in Discord.",
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function triggerDocument(input) {
|
|
69
|
+
const replyInstruction = input.reply === undefined ? "" : "Answer with hub.reply, then ";
|
|
70
|
+
return {
|
|
71
|
+
name: input.name,
|
|
72
|
+
enabled: true,
|
|
73
|
+
on: { [input.event]: { connection: input.connection, filters: input.filters } },
|
|
74
|
+
max_runtime: "2h",
|
|
75
|
+
run: {
|
|
76
|
+
target: input.target,
|
|
77
|
+
agent: input.agent,
|
|
78
|
+
continuation: { mode: "conversation" },
|
|
79
|
+
max_runtime: "90m",
|
|
80
|
+
idle_timeout: "10m",
|
|
81
|
+
prompt: `${replyInstruction}complete this request and call hub.finish_execution when done.\n\n<user-prompt>\n\${{ paseo.prompt }}\n</user-prompt>\n`,
|
|
82
|
+
...(input.reply === undefined
|
|
83
|
+
? {}
|
|
84
|
+
: { outputs: { [input.reply]: { max: 1, required: true } } }),
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function requireFilter(filters, name) {
|
|
89
|
+
const value = filters[name]?.trim();
|
|
90
|
+
if (!value)
|
|
91
|
+
throw new Error(`${name} is required for this provider`);
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=init-plan.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { select, text } from "@clack/prompts";
|
|
2
|
+
import type { Command } from "commander";
|
|
3
|
+
import type { HubCredentialStore } from "./credentials.js";
|
|
4
|
+
import type { HubDaemonConnection } from "./daemon-client.js";
|
|
5
|
+
import type { HubHttpClient } from "./hub-client/index.js";
|
|
6
|
+
import type { CliLoginFlow } from "./login-flow.js";
|
|
7
|
+
import type { HubReporter } from "./reporter.js";
|
|
8
|
+
export interface HubGuidedSetupEnvironment {
|
|
9
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
10
|
+
credentials: HubCredentialStore;
|
|
11
|
+
hub: HubHttpClient;
|
|
12
|
+
login: Pick<CliLoginFlow, "authorize">;
|
|
13
|
+
daemon: HubDaemonConnection;
|
|
14
|
+
reporter: HubReporter;
|
|
15
|
+
cwd(): string;
|
|
16
|
+
isInteractive?(): boolean;
|
|
17
|
+
prompts?: {
|
|
18
|
+
confirm(message: string, initialValue: boolean): Promise<boolean>;
|
|
19
|
+
select(options: Parameters<typeof select<string>>[0]): Promise<string>;
|
|
20
|
+
text(options: Parameters<typeof text>[0]): Promise<string>;
|
|
21
|
+
message(value: string): void;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
interface HubGuidedSetupState {
|
|
25
|
+
origin?: string;
|
|
26
|
+
daemonId?: string;
|
|
27
|
+
deploy?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function addHubInitCommand(parent: Command, environment: HubGuidedSetupEnvironment): void;
|
|
30
|
+
export declare function runHubInit(environment: HubGuidedSetupEnvironment): Promise<void>;
|
|
31
|
+
export declare function runHubGuidedSetup(environment: HubGuidedSetupEnvironment, state?: HubGuidedSetupState): Promise<void>;
|
|
32
|
+
export declare function continueHubGuidedSetup(origin: string, environment: HubGuidedSetupEnvironment): Promise<void>;
|
|
33
|
+
export declare function githubRepositoryFromRemote(remote: string): string | undefined;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=init.d.ts.map
|