@anhlp/alp-paseo 0.0.0-beta.2 → 0.0.1-beta.4
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/NOTICE +9 -6
- package/README.md +86 -26
- package/client/library.tsx +22 -6
- package/package.json +21 -16
- package/paseo-plugin.json +1 -1
- package/server/dist/THIRD-PARTY-NOTICES.txt +2 -2
- package/server/dist/alpd.js +10897 -3514
- package/server/dist/compat.js +76 -0
- package/server/dist/index.js +23033 -6235
- package/server/dist/library.js +148 -42
- package/server/dist/main.js +12316 -2191
- package/server/dist/mapping.js +96 -44
- package/server/dist/panel/library.js +148 -42
- package/server/dist/panel/mapping.js +96 -44
- package/server/dist/panel/tasks.js +32 -2
- package/server/dist/panel/usage.js +38 -5
- package/server/dist/paseo/agents.js +9020 -335
- package/server/dist/paseo/checkout.js +111 -208
- package/server/dist/paseo/create-receipts.js +281 -0
- package/server/dist/paseo/files.js +137 -18
- package/server/dist/paseo/gateway.js +42 -6
- package/server/dist/paseo/git.js +375 -0
- package/server/dist/paseo/index.js +11737 -1821
- package/server/dist/paseo/plugins.js +173 -67
- package/server/dist/paseo/prompt-content.js +43 -0
- package/server/dist/paseo/providers.js +44 -3
- package/server/dist/paseo/quiet.js +1 -5
- package/server/dist/paseo/relay.js +3 -2
- package/server/dist/paseo/terminals.js +23618 -0
- package/server/dist/paseo/timeline-store.js +2 -2
- package/server/dist/paseo/uploads.js +22303 -0
- package/server/dist/paseo/workspaces.js +876 -192
- package/server/dist/provider-core.js +457 -9
- package/server/dist/provider-prompt.js +220 -0
- package/server/dist/provider.js +10495 -3016
- package/server/dist/remote/index.js +460 -19
- package/server/dist/remote/link.js +32 -2
- package/server/dist/remote/panels.js +51 -6
- package/server/dist/remote/provider.js +1219 -793
- package/server/dist/session-usage.js +15 -0
- package/server/dist/tasks.js +32 -2
- package/server/dist/upload-names.js +30 -0
- package/server/dist/uploads.js +84 -0
- package/server/dist/usage.js +38 -5
- package/server/dist/web.js +59 -102
- package/shared/library.ts +2 -0
- package/server/dist/web-app/NOTICE.txt +0 -18
- package/server/dist/web-app/THIRD-PARTY-NOTICES.txt +0 -5483
- package/server/dist/web-app/THIRD-PARTY-NOTICES.txt.br +0 -0
- package/server/dist/web-app/THIRD-PARTY-NOTICES.txt.gz +0 -0
- package/server/dist/web-app/_expo/static/css/xterm-3bb1704bf6cb0876640973dc0244b4cb.css +0 -1
- package/server/dist/web-app/_expo/static/css/xterm-3bb1704bf6cb0876640973dc0244b4cb.css.br +0 -0
- package/server/dist/web-app/_expo/static/css/xterm-3bb1704bf6cb0876640973dc0244b4cb.css.gz +0 -0
- package/server/dist/web-app/_expo/static/js/web/desktop-attachment-bridge-6af9b585f6d25fdb5938533f7aa5a167.js +0 -2
- package/server/dist/web-app/_expo/static/js/web/desktop-attachment-store-4ae9267243fd80b0b9605252601a21f3.js +0 -2
- package/server/dist/web-app/_expo/static/js/web/desktop-attachment-store-4ae9267243fd80b0b9605252601a21f3.js.br +0 -0
- package/server/dist/web-app/_expo/static/js/web/desktop-attachment-store-4ae9267243fd80b0b9605252601a21f3.js.gz +0 -0
- package/server/dist/web-app/_expo/static/js/web/index-c01174e6924afca25f226efae0b2a3ae.js +0 -18742
- package/server/dist/web-app/_expo/static/js/web/index-c01174e6924afca25f226efae0b2a3ae.js.br +0 -0
- package/server/dist/web-app/_expo/static/js/web/index-c01174e6924afca25f226efae0b2a3ae.js.gz +0 -0
- package/server/dist/web-app/_expo/static/js/web/indexeddb-attachment-store-5c75739712558f24273a6497f02f315b.js +0 -2
- package/server/dist/web-app/_expo/static/js/web/indexeddb-attachment-store-5c75739712558f24273a6497f02f315b.js.br +0 -0
- package/server/dist/web-app/_expo/static/js/web/indexeddb-attachment-store-5c75739712558f24273a6497f02f315b.js.gz +0 -0
- package/server/dist/web-app/_expo/static/js/web/native-file-attachment-store-e614dc34238b4482a273236cd9c323b6.js +0 -4
- package/server/dist/web-app/_expo/static/js/web/native-file-attachment-store-e614dc34238b4482a273236cd9c323b6.js.br +0 -0
- package/server/dist/web-app/_expo/static/js/web/native-file-attachment-store-e614dc34238b4482a273236cd9c323b6.js.gz +0 -0
- package/server/dist/web-app/alp-token.js +0 -12
- package/server/dist/web-app/alp-web-app.json +0 -26
- package/server/dist/web-app/apple-touch-icon.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png +0 -0
- package/server/dist/web-app/assets/__node_modules/@react-navigation/elements/lib/module/assets/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png +0 -0
- package/server/dist/web-app/assets/__node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png +0 -0
- package/server/dist/web-app/assets/__node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png +0 -0
- package/server/dist/web-app/assets/__node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png +0 -0
- package/server/dist/web-app/assets/__node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png +0 -0
- package/server/dist/web-app/assets/__node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png +0 -0
- package/server/dist/web-app/assets/__node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png +0 -0
- package/server/dist/web-app/assets/__node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png +0 -0
- package/server/dist/web-app/assets/assets/images/favicon-dark-attention.7b1f41432deecb841fbf71fe6fe81258.png +0 -0
- package/server/dist/web-app/assets/assets/images/favicon-dark-running.a4ee272abf692e713606fbcffb2eaadb.png +0 -0
- package/server/dist/web-app/assets/assets/images/favicon-dark.e781e045425270913385c8e26c706dc7.png +0 -0
- package/server/dist/web-app/assets/assets/images/favicon-light-attention.7b1f41432deecb841fbf71fe6fe81258.png +0 -0
- package/server/dist/web-app/assets/assets/images/favicon-light-running.a4ee272abf692e713606fbcffb2eaadb.png +0 -0
- package/server/dist/web-app/assets/assets/images/favicon-light.e781e045425270913385c8e26c706dc7.png +0 -0
- package/server/dist/web-app/assets/assets/images/notification-icon.3bf81d33ddbf380606bdd248ba83e158.png +0 -0
- package/server/dist/web-app/favicon.ico +0 -0
- package/server/dist/web-app/favicon.ico.br +0 -0
- package/server/dist/web-app/favicon.ico.gz +0 -0
- package/server/dist/web-app/index.html +0 -101
- package/server/dist/web-app/index.html.br +0 -0
- package/server/dist/web-app/index.html.gz +0 -0
- package/server/dist/web-app/manifest.json +0 -31
- package/server/dist/web-app/metadata.json +0 -1
- package/server/dist/web-app/pwa-icon-192.png +0 -0
- package/server/dist/web-app/pwa-icon-512.png +0 -0
- package/server/dist/web-app/robots.txt +0 -2
- /package/{server/dist/web-app/LICENSE.paseo.txt → LICENSE.paseo.txt} +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { createRequire as __alpRequire } from 'node:module'; const require = __alpRequire(typeof import.meta.url === 'string' ? import.meta.url : process.cwd() + '/__alp_require__.js');
|
|
2
|
+
|
|
3
|
+
// integrations/paseo/server/compat.ts
|
|
4
|
+
import {
|
|
5
|
+
PROVIDER_PROTOCOL_VERSION,
|
|
6
|
+
negotiateProviderCapabilities,
|
|
7
|
+
requireProviderCapabilities,
|
|
8
|
+
ProviderInputSchema,
|
|
9
|
+
ProviderEventSchema
|
|
10
|
+
} from "@getpaseo/plugin/server/provider";
|
|
11
|
+
|
|
12
|
+
// node_modules/@getpaseo/protocol/dist/forge-manifest.js
|
|
13
|
+
var FORGE_DEFINITIONS = [
|
|
14
|
+
{
|
|
15
|
+
id: "github",
|
|
16
|
+
displayName: "GitHub",
|
|
17
|
+
changeRequestAbbrev: "PR",
|
|
18
|
+
changeRequestNoun: "pull request",
|
|
19
|
+
changeRequestNumberPrefix: "#",
|
|
20
|
+
issueNumberPrefix: "#",
|
|
21
|
+
iconKind: "github",
|
|
22
|
+
signIn: { cli: "gh", command: "gh auth login" },
|
|
23
|
+
cloudHosts: ["github.com", "ssh.github.com"]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "gitlab",
|
|
27
|
+
displayName: "GitLab",
|
|
28
|
+
changeRequestAbbrev: "MR",
|
|
29
|
+
changeRequestNoun: "merge request",
|
|
30
|
+
changeRequestNumberPrefix: "!",
|
|
31
|
+
issueNumberPrefix: "#",
|
|
32
|
+
iconKind: "gitlab",
|
|
33
|
+
signIn: { cli: "glab", command: "glab auth login", hostnameFlag: "--hostname" },
|
|
34
|
+
cloudHosts: ["gitlab.com"]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "gitea",
|
|
38
|
+
displayName: "Gitea",
|
|
39
|
+
changeRequestAbbrev: "PR",
|
|
40
|
+
changeRequestNoun: "pull request",
|
|
41
|
+
changeRequestNumberPrefix: "#",
|
|
42
|
+
issueNumberPrefix: "#",
|
|
43
|
+
iconKind: "gitea",
|
|
44
|
+
signIn: { cli: "tea", command: "tea login add" },
|
|
45
|
+
cloudHosts: ["gitea.com"]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "forgejo",
|
|
49
|
+
displayName: "Forgejo",
|
|
50
|
+
changeRequestAbbrev: "PR",
|
|
51
|
+
changeRequestNoun: "pull request",
|
|
52
|
+
changeRequestNumberPrefix: "#",
|
|
53
|
+
issueNumberPrefix: "#",
|
|
54
|
+
iconKind: "forgejo",
|
|
55
|
+
signIn: { cli: "tea", command: "tea login add" }
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "codeberg",
|
|
59
|
+
displayName: "Codeberg",
|
|
60
|
+
changeRequestAbbrev: "PR",
|
|
61
|
+
changeRequestNoun: "pull request",
|
|
62
|
+
changeRequestNumberPrefix: "#",
|
|
63
|
+
issueNumberPrefix: "#",
|
|
64
|
+
iconKind: "codeberg",
|
|
65
|
+
signIn: { cli: "tea", command: "tea login add" },
|
|
66
|
+
cloudHosts: ["codeberg.org"]
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
var DEV_FORGE_DEFINITIONS = [];
|
|
70
|
+
var FORGE_IDS = FORGE_DEFINITIONS.map((definition) => definition.id);
|
|
71
|
+
function getForgeDefinition(id, definitions = [...FORGE_DEFINITIONS, ...DEV_FORGE_DEFINITIONS]) {
|
|
72
|
+
return definitions.find((definition) => definition.id === id) ?? null;
|
|
73
|
+
}
|
|
74
|
+
function getForgeDefinitionOrNeutral(id) {
|
|
75
|
+
return getForgeDefinition(id) ?? {
|
|
76
|
+
id,
|
|
77
|
+
displayName: id,
|
|
78
|
+
changeRequestAbbrev: "PR",
|
|
79
|
+
changeRequestNoun: "pull request",
|
|
80
|
+
changeRequestNumberPrefix: "#",
|
|
81
|
+
issueNumberPrefix: "#",
|
|
82
|
+
iconKind: "git",
|
|
83
|
+
signIn: null
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// integrations/paseo/server/provider-prompt.ts
|
|
88
|
+
var REVIEW_LINE_MARKERS = { add: "+", remove: "-", context: " " };
|
|
89
|
+
function userPromptPart(part) {
|
|
90
|
+
if (part.type === "image" || part.type === "uploaded_file") return part;
|
|
91
|
+
return { type: "text", text: renderPromptAttachmentAsText(part) };
|
|
92
|
+
}
|
|
93
|
+
function renderPromptAttachmentAsText(attachment) {
|
|
94
|
+
switch (attachment.type) {
|
|
95
|
+
case "forge_change_request": {
|
|
96
|
+
return renderChangeRequestAttachment({
|
|
97
|
+
forge: attachment.forge ?? "github",
|
|
98
|
+
number: attachment.number,
|
|
99
|
+
title: attachment.title,
|
|
100
|
+
url: attachment.url,
|
|
101
|
+
body: attachment.body,
|
|
102
|
+
projectPath: attachment.projectPath,
|
|
103
|
+
baseRefName: attachment.baseRefName,
|
|
104
|
+
headRefName: attachment.headRefName
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
// COMPAT(githubAttachmentKinds): render legacy wire attachments until
|
|
108
|
+
// 2027-01-17, when supported client and daemon floors are >= v0.2.0.
|
|
109
|
+
case "github_pr": {
|
|
110
|
+
return renderChangeRequestAttachment({
|
|
111
|
+
forge: "github",
|
|
112
|
+
number: attachment.number,
|
|
113
|
+
title: attachment.title,
|
|
114
|
+
url: attachment.url,
|
|
115
|
+
body: attachment.body,
|
|
116
|
+
baseRefName: attachment.baseRefName,
|
|
117
|
+
headRefName: attachment.headRefName
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
case "forge_issue": {
|
|
121
|
+
return renderIssueAttachment({
|
|
122
|
+
forge: attachment.forge ?? "github",
|
|
123
|
+
number: attachment.number,
|
|
124
|
+
title: attachment.title,
|
|
125
|
+
url: attachment.url,
|
|
126
|
+
body: attachment.body,
|
|
127
|
+
projectPath: attachment.projectPath
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
// COMPAT(githubAttachmentKinds): render legacy wire attachments until
|
|
131
|
+
// 2027-01-17, when supported client and daemon floors are >= v0.2.0.
|
|
132
|
+
case "github_issue": {
|
|
133
|
+
return renderIssueAttachment({
|
|
134
|
+
forge: "github",
|
|
135
|
+
number: attachment.number,
|
|
136
|
+
title: attachment.title,
|
|
137
|
+
url: attachment.url,
|
|
138
|
+
body: attachment.body
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
case "text": {
|
|
142
|
+
return attachment.text;
|
|
143
|
+
}
|
|
144
|
+
case "review": {
|
|
145
|
+
const lines = [`Paseo review attachment (${attachment.mode})`, `CWD: ${attachment.cwd}`];
|
|
146
|
+
if (attachment.baseRef) {
|
|
147
|
+
lines.push(`Base: ${attachment.baseRef}`);
|
|
148
|
+
}
|
|
149
|
+
attachment.comments.forEach((comment, index) => {
|
|
150
|
+
lines.push(
|
|
151
|
+
"",
|
|
152
|
+
`Comment ${index + 1}: ${comment.filePath}:${comment.side}:${comment.lineNumber}`,
|
|
153
|
+
comment.body,
|
|
154
|
+
comment.context.hunkHeader
|
|
155
|
+
);
|
|
156
|
+
const target = comment.context.targetLine;
|
|
157
|
+
for (const line of comment.context.lines) {
|
|
158
|
+
const isTarget = line.oldLineNumber === target.oldLineNumber && line.newLineNumber === target.newLineNumber && line.type === target.type && line.content === target.content;
|
|
159
|
+
const prefix = isTarget ? "> " : " ";
|
|
160
|
+
const oldLn = padLineNumber(line.oldLineNumber);
|
|
161
|
+
const newLn = padLineNumber(line.newLineNumber);
|
|
162
|
+
lines.push(`${prefix}${oldLn} ${newLn} ${REVIEW_LINE_MARKERS[line.type]}${line.content}`);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
return lines.join("\n");
|
|
166
|
+
}
|
|
167
|
+
default:
|
|
168
|
+
throw new Error("unreachable");
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function renderChangeRequestAttachment(input) {
|
|
172
|
+
const lines = [
|
|
173
|
+
`${formatForgeLabel(input.forge)} ${formatChangeRequestAbbrev(input.forge)} ${formatChangeRequestNumber(input.forge, input.number)}: ${input.title}`,
|
|
174
|
+
input.url
|
|
175
|
+
];
|
|
176
|
+
if (input.projectPath) {
|
|
177
|
+
lines.push(`Project: ${input.projectPath}`);
|
|
178
|
+
}
|
|
179
|
+
if (input.baseRefName) {
|
|
180
|
+
lines.push(`Base: ${input.baseRefName}`);
|
|
181
|
+
}
|
|
182
|
+
if (input.headRefName) {
|
|
183
|
+
lines.push(`Head: ${input.headRefName}`);
|
|
184
|
+
}
|
|
185
|
+
if (input.body) {
|
|
186
|
+
lines.push("", input.body);
|
|
187
|
+
}
|
|
188
|
+
return lines.join("\n");
|
|
189
|
+
}
|
|
190
|
+
function renderIssueAttachment(input) {
|
|
191
|
+
const lines = [
|
|
192
|
+
`${formatForgeLabel(input.forge)} Issue ${formatIssueNumber(input.forge, input.number)}: ${input.title}`,
|
|
193
|
+
input.url
|
|
194
|
+
];
|
|
195
|
+
if (input.projectPath) {
|
|
196
|
+
lines.push(`Project: ${input.projectPath}`);
|
|
197
|
+
}
|
|
198
|
+
if (input.body) {
|
|
199
|
+
lines.push("", input.body);
|
|
200
|
+
}
|
|
201
|
+
return lines.join("\n");
|
|
202
|
+
}
|
|
203
|
+
function formatForgeLabel(forge) {
|
|
204
|
+
return getForgeDefinitionOrNeutral(forge).displayName;
|
|
205
|
+
}
|
|
206
|
+
function formatChangeRequestAbbrev(forge) {
|
|
207
|
+
return getForgeDefinitionOrNeutral(forge).changeRequestAbbrev;
|
|
208
|
+
}
|
|
209
|
+
function formatChangeRequestNumber(forge, number) {
|
|
210
|
+
return `${getForgeDefinitionOrNeutral(forge).changeRequestNumberPrefix}${number}`;
|
|
211
|
+
}
|
|
212
|
+
function formatIssueNumber(forge, number) {
|
|
213
|
+
return `${getForgeDefinitionOrNeutral(forge).issueNumberPrefix}${number}`;
|
|
214
|
+
}
|
|
215
|
+
function padLineNumber(lineNumber) {
|
|
216
|
+
return (lineNumber?.toString() ?? "-").padStart(2);
|
|
217
|
+
}
|
|
218
|
+
export {
|
|
219
|
+
userPromptPart
|
|
220
|
+
};
|