@alan-ai-hq/agent-manager-linux-arm64 0.1.199 → 0.1.200
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/alan-agent.cjs +8885 -5214
- package/alan-holder.cjs +5364 -3401
- package/alan-lease.cjs +808 -200
- package/builtin-skills/agent-desktop/SKILL.md +94 -0
- package/builtin-skills/alan-artifact/SKILL.md +128 -0
- package/builtin-skills/alan-artifact/examples/interactive-diagram.md +50 -0
- package/builtin-skills/alan-artifact/examples/prototype.md +53 -0
- package/builtin-skills/alan-artifact/examples/test-report.md +55 -0
- package/builtin-skills/alan-artifact/references/design.md +39 -0
- package/builtin-skills/alan-artifact/references/diagrams.md +20 -0
- package/builtin-skills/alan-deck/SKILL.md +189 -0
- package/builtin-skills/alan-diagrams/SKILL.md +105 -0
- package/builtin-skills/alan-diagrams/references/diagram-catalogue.md +847 -0
- package/builtin-skills/alan-docs/SKILL.md +143 -0
- package/builtin-skills/alan-docs/references/administration/members-and-teams.md +48 -0
- package/builtin-skills/alan-docs/references/administration/org-dashboard.md +19 -0
- package/builtin-skills/alan-docs/references/administration/organisation-settings.md +41 -0
- package/builtin-skills/alan-docs/references/agents-and-sessions/code-context.md +60 -0
- package/builtin-skills/alan-docs/references/agents-and-sessions/coding-agents-and-models.md +78 -0
- package/builtin-skills/alan-docs/references/agents-and-sessions/session-lifecycle.md +62 -0
- package/builtin-skills/alan-docs/references/agents-and-sessions/start-a-session.md +110 -0
- package/builtin-skills/alan-docs/references/automations/automation-runs.md +69 -0
- package/builtin-skills/alan-docs/references/automations/create-an-automation.md +143 -0
- package/builtin-skills/alan-docs/references/automations/overview.md +77 -0
- package/builtin-skills/alan-docs/references/cloud-and-local/cloud-images.md +64 -0
- package/builtin-skills/alan-docs/references/cloud-and-local/cloud-sessions-and-execution.md +89 -0
- package/builtin-skills/alan-docs/references/cloud-and-local/cloud-setup.md +128 -0
- package/builtin-skills/alan-docs/references/cloud-and-local/codex-cli-connector.md +92 -0
- package/builtin-skills/alan-docs/references/cloud-and-local/local-execution.md +213 -0
- package/builtin-skills/alan-docs/references/cloud-and-local/runtime-recovery.md +60 -0
- package/builtin-skills/alan-docs/references/cloud-and-local/sandboxes.md +74 -0
- package/builtin-skills/alan-docs/references/cloud-and-local/troubleshooting-and-faq.md +102 -0
- package/builtin-skills/alan-docs/references/get-started/connect-azure-devops.md +89 -0
- package/builtin-skills/alan-docs/references/get-started/connect-bitbucket.md +86 -0
- package/builtin-skills/alan-docs/references/get-started/connect-github.md +114 -0
- package/builtin-skills/alan-docs/references/get-started/join-a-team.md +114 -0
- package/builtin-skills/alan-docs/references/get-started/product-map.md +96 -0
- package/builtin-skills/alan-docs/references/get-started/quickstart.md +158 -0
- package/builtin-skills/alan-docs/references/get-started/set-up-your-team.md +200 -0
- package/builtin-skills/alan-docs/references/get-started/sign-in.md +104 -0
- package/builtin-skills/alan-docs/references/get-started/welcome.md +39 -0
- package/builtin-skills/alan-docs/references/integrations/connect-microsoft-teams.md +116 -0
- package/builtin-skills/alan-docs/references/integrations/connect-slack.md +164 -0
- package/builtin-skills/alan-docs/references/integrations/import-from-linear.md +172 -0
- package/builtin-skills/alan-docs/references/plans-and-billing/plans-and-limits.md +115 -0
- package/builtin-skills/alan-docs/references/plans-and-billing/usage-and-credits.md +47 -0
- package/builtin-skills/alan-docs/references/reference/documents-and-artifacts.md +52 -0
- package/builtin-skills/alan-docs/references/reference/faq.md +89 -0
- package/builtin-skills/alan-docs/references/reference/feature-catalog.md +89 -0
- package/builtin-skills/alan-docs/references/reference/glossary.md +96 -0
- package/builtin-skills/alan-docs/references/reference/links-and-ids.md +80 -0
- package/builtin-skills/alan-docs/references/reference/roles-and-permissions.md +64 -0
- package/builtin-skills/alan-docs/references/reference/statuses.md +86 -0
- package/builtin-skills/alan-docs/references/reviews-testing-deploys/deployments.md +28 -0
- package/builtin-skills/alan-docs/references/reviews-testing-deploys/pull-requests.md +85 -0
- package/builtin-skills/alan-docs/references/reviews-testing-deploys/review-work.md +55 -0
- package/builtin-skills/alan-docs/references/reviews-testing-deploys/testing-evidence.md +52 -0
- package/builtin-skills/alan-docs/references/skills/plugins-and-mcp.md +24 -0
- package/builtin-skills/alan-docs/references/skills/skills.md +103 -0
- package/builtin-skills/alan-docs/references/tasks/complete-a-task.md +79 -0
- package/builtin-skills/alan-docs/references/tasks/create-a-task.md +67 -0
- package/builtin-skills/alan-docs/references/tasks/subtasks-and-status.md +55 -0
- package/builtin-skills/alan-docs/references/tasks/task-artifacts.md +56 -0
- package/builtin-skills/alan-docs/references/tasks/task-detail.md +65 -0
- package/builtin-skills/alan-docs/references/teams-and-planning/cycles.md +93 -0
- package/builtin-skills/alan-docs/references/teams-and-planning/documents.md +66 -0
- package/builtin-skills/alan-docs/references/teams-and-planning/epics.md +95 -0
- package/builtin-skills/alan-docs/references/teams-and-planning/whiteboard.md +52 -0
- package/builtin-skills/alan-docs/references/troubleshooting/agent-blocked.md +38 -0
- package/builtin-skills/alan-docs/references/troubleshooting/common-problems.md +118 -0
- package/builtin-skills/alan-docs/references/troubleshooting/github-access.md +41 -0
- package/builtin-skills/alan-docs/references/troubleshooting/missing-artifact.md +47 -0
- package/builtin-skills/alan-docs/references/troubleshooting/report-an-issue.md +74 -0
- package/builtin-skills/alan-docs/references/troubleshooting/runtime-unavailable.md +49 -0
- package/builtin-skills/alan-docs/scripts/generate-references.mjs +363 -0
- package/builtin-skills/alan-environment-setup/SKILL.md +320 -0
- package/builtin-skills/alan-environment-setup/references/android.md +118 -0
- package/builtin-skills/alan-environment-setup/references/troubleshooting.md +33 -0
- package/builtin-skills/alan-skill-authoring/SKILL.md +83 -0
- package/builtin-skills/alan-tasks/SKILL.md +195 -0
- package/builtin-skills/alan-test-android/SKILL.md +224 -0
- package/builtin-skills/alan-test-android/scripts/android-up.sh +227 -0
- package/builtin-skills/alan-test-android/scripts/install-launch.sh +38 -0
- package/builtin-skills/alan-test-android/scripts/record.sh +64 -0
- package/builtin-skills/alan-test-android/scripts/ui.py +367 -0
- package/builtin-skills/alan-test-desktop/SKILL.md +107 -0
- package/builtin-skills/alan-test-desktop/references/linux-recording.md +31 -0
- package/builtin-skills/alan-test-feature/SKILL.md +243 -0
- package/builtin-skills/alan-test-mobile/SKILL.md +65 -0
- package/builtin-skills/alan-test-web/SKILL.md +113 -0
- package/builtin-skills/alan-walkthrough/SKILL.md +152 -0
- package/builtin-skills/alan-walkthrough/scripts/mark-changes.js +419 -0
- package/builtin-skills/alan-walkthrough/scripts/publish-capture.mjs +288 -0
- package/builtin-skills/alan-workflows/SKILL.md +235 -0
- package/builtin-skills/manifest.json +19 -0
- package/package.json +3 -2
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { mkdtempSync, readFileSync, statSync } from "node:fs";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { basename, extname, join } from "node:path";
|
|
6
|
+
|
|
7
|
+
const MIME_BY_EXTENSION = new Map([
|
|
8
|
+
["png", "image/png"],
|
|
9
|
+
["jpg", "image/jpeg"],
|
|
10
|
+
["jpeg", "image/jpeg"],
|
|
11
|
+
["gif", "image/gif"],
|
|
12
|
+
["webp", "image/webp"],
|
|
13
|
+
["mp4", "video/mp4"],
|
|
14
|
+
["webm", "video/webm"],
|
|
15
|
+
["mov", "video/quicktime"],
|
|
16
|
+
]);
|
|
17
|
+
const LIMIT_BY_KIND = { screenshot: 20 * 1024 * 1024, recording: 100 * 1024 * 1024 };
|
|
18
|
+
const UPLOAD_ATTEMPTS = 3;
|
|
19
|
+
|
|
20
|
+
class PublishError extends Error {
|
|
21
|
+
constructor(code, message) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.code = code;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function parseArgs(argv) {
|
|
28
|
+
const args = { file: undefined, caption: undefined, kind: undefined, chat: false };
|
|
29
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
30
|
+
const value = argv[index];
|
|
31
|
+
if (value === "--caption") args.caption = argv[++index];
|
|
32
|
+
else if (value === "--kind") args.kind = argv[++index];
|
|
33
|
+
else if (value === "--chat") args.chat = true;
|
|
34
|
+
else if (!args.file && !value.startsWith("--")) args.file = value;
|
|
35
|
+
else throw new PublishError("usage", `Unexpected argument: ${value}`);
|
|
36
|
+
}
|
|
37
|
+
if (!args.file || (args.chat ? args.caption !== undefined : !args.caption)) {
|
|
38
|
+
throw new PublishError(
|
|
39
|
+
"usage",
|
|
40
|
+
'Usage: publish-capture.mjs <file> (--chat | --caption "<what it proves>") [--kind screenshot|recording]'
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return args;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function describe(file, requestedKind) {
|
|
47
|
+
let stats;
|
|
48
|
+
try {
|
|
49
|
+
stats = statSync(file);
|
|
50
|
+
} catch {
|
|
51
|
+
throw new PublishError("not_found", `No file at ${file}.`);
|
|
52
|
+
}
|
|
53
|
+
if (!stats.isFile()) throw new PublishError("not_found", `${file} is not a file.`);
|
|
54
|
+
if (stats.size === 0) throw new PublishError("empty", `${file} is empty; retake the capture.`);
|
|
55
|
+
const extension = extname(file).slice(1).toLowerCase();
|
|
56
|
+
const mimeType = MIME_BY_EXTENSION.get(extension);
|
|
57
|
+
if (!mimeType) {
|
|
58
|
+
throw new PublishError(
|
|
59
|
+
"unsupported_type",
|
|
60
|
+
`Unsupported .${extension}. Screenshots: png, jpg, gif, webp. Recordings: mp4, webm, mov.`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
const kind = mimeType.startsWith("video/") ? "recording" : "screenshot";
|
|
64
|
+
if (requestedKind && requestedKind !== kind) {
|
|
65
|
+
throw new PublishError(
|
|
66
|
+
"unsupported_type",
|
|
67
|
+
`A .${extension} file is a ${kind}, not a ${requestedKind}.`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
if (stats.size > LIMIT_BY_KIND[kind]) {
|
|
71
|
+
throw new PublishError(
|
|
72
|
+
"too_large",
|
|
73
|
+
`${file} is ${stats.size} bytes; the ${kind} limit is ${LIMIT_BY_KIND[kind] / 1024 / 1024} MB. Trim or split it.`
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return { kind, extension, mimeType };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// agent-browser writes WebM with an unknown duration, so players show 0:00.
|
|
80
|
+
// A stream-copy remux writes the duration header without re-encoding.
|
|
81
|
+
function repairRecording(file, extension) {
|
|
82
|
+
if (extension !== "webm") return { file, repaired: false };
|
|
83
|
+
const probe = spawnSync("ffmpeg", ["-version"], { stdio: "ignore" });
|
|
84
|
+
if (probe.status !== 0)
|
|
85
|
+
return { file, repaired: false, note: "ffmpeg unavailable; duration not repaired" };
|
|
86
|
+
const output = join(mkdtempSync(join(tmpdir(), "alan-capture-")), basename(file));
|
|
87
|
+
const remux = spawnSync(
|
|
88
|
+
"ffmpeg",
|
|
89
|
+
["-y", "-loglevel", "error", "-i", file, "-c", "copy", output],
|
|
90
|
+
{
|
|
91
|
+
encoding: "utf8",
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
if (remux.status !== 0)
|
|
95
|
+
return { file, repaired: false, note: "ffmpeg remux failed; published original" };
|
|
96
|
+
return { file: output, repaired: true };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function mcpEndpoint(chat) {
|
|
100
|
+
const fallback = chat
|
|
101
|
+
? "If the attachment tool is available, use create_chat_media_upload, PUT exact bytes, then complete_chat_media_upload."
|
|
102
|
+
: "Call publish_capture directly: op=begin, PUT the bytes with uploadHeaders, then op=complete.";
|
|
103
|
+
const credentialPath = process.env.ALAN_MCP_CREDENTIAL_FILE;
|
|
104
|
+
if (credentialPath) {
|
|
105
|
+
try {
|
|
106
|
+
const stats = statSync(credentialPath);
|
|
107
|
+
if (!stats.isFile() || (process.platform !== "win32" && (stats.mode & 0o077) !== 0)) {
|
|
108
|
+
throw new Error("Credential file must be private");
|
|
109
|
+
}
|
|
110
|
+
const credential = JSON.parse(readFileSync(credentialPath, "utf8"));
|
|
111
|
+
if (
|
|
112
|
+
!credential ||
|
|
113
|
+
typeof credential.url !== "string" ||
|
|
114
|
+
typeof credential.authorization !== "string" ||
|
|
115
|
+
!credential.authorization.startsWith("Bearer ") ||
|
|
116
|
+
typeof credential.conversationId !== "string" ||
|
|
117
|
+
!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
|
118
|
+
credential.conversationId
|
|
119
|
+
)
|
|
120
|
+
)
|
|
121
|
+
throw new Error("Invalid credential file");
|
|
122
|
+
const url = new URL(credential.url);
|
|
123
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password) {
|
|
124
|
+
throw new Error("Invalid MCP endpoint");
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
url: url.href,
|
|
128
|
+
headers: {
|
|
129
|
+
Authorization: credential.authorization,
|
|
130
|
+
"x-alan-conversation-id": credential.conversationId,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
} catch {
|
|
134
|
+
throw new PublishError(
|
|
135
|
+
"no_runtime_credentials",
|
|
136
|
+
`The private Alan MCP credential file is missing, invalid, or not private. ${fallback}`
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const url =
|
|
141
|
+
process.env.ALAN_MCP_URL ||
|
|
142
|
+
(process.env.ALAN_API_URL ? new URL("/mcp", process.env.ALAN_API_URL).toString() : "");
|
|
143
|
+
const authorization =
|
|
144
|
+
process.env.ALAN_MCP_AUTHORIZATION ||
|
|
145
|
+
(process.env.ALAN_MCP_BEARER_TOKEN ? `Bearer ${process.env.ALAN_MCP_BEARER_TOKEN}` : "");
|
|
146
|
+
const runId = process.env.ALAN_RUN_ID || "";
|
|
147
|
+
if (!url || !authorization || !runId) {
|
|
148
|
+
throw new PublishError(
|
|
149
|
+
"no_runtime_credentials",
|
|
150
|
+
`This shell has no Alan session credentials. ${fallback}`
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
return { url, headers: { Authorization: authorization, "x-alan-run-id": runId } };
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function tryParseJson(text) {
|
|
157
|
+
try {
|
|
158
|
+
return JSON.parse(text);
|
|
159
|
+
} catch {
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function parseRpcBody(text) {
|
|
165
|
+
const trimmed = text.trim();
|
|
166
|
+
const direct = tryParseJson(trimmed);
|
|
167
|
+
if (direct !== undefined) return direct;
|
|
168
|
+
// Streamable HTTP may answer as a single SSE event.
|
|
169
|
+
const data = trimmed
|
|
170
|
+
.split("\n")
|
|
171
|
+
.filter((line) => line.startsWith("data:"))
|
|
172
|
+
.map((line) => line.slice(5).trim())
|
|
173
|
+
.join("");
|
|
174
|
+
return JSON.parse(data);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async function callTool(endpoint, name, args) {
|
|
178
|
+
const response = await fetch(endpoint.url, {
|
|
179
|
+
method: "POST",
|
|
180
|
+
redirect: "error",
|
|
181
|
+
headers: {
|
|
182
|
+
...endpoint.headers,
|
|
183
|
+
"Content-Type": "application/json",
|
|
184
|
+
Accept: "application/json, text/event-stream",
|
|
185
|
+
},
|
|
186
|
+
body: JSON.stringify({
|
|
187
|
+
jsonrpc: "2.0",
|
|
188
|
+
id: Date.now(),
|
|
189
|
+
method: "tools/call",
|
|
190
|
+
params: { name, arguments: args },
|
|
191
|
+
}),
|
|
192
|
+
});
|
|
193
|
+
if (!response.ok) {
|
|
194
|
+
throw new PublishError("mcp_unavailable", `Alan MCP answered ${response.status}.`);
|
|
195
|
+
}
|
|
196
|
+
const message = parseRpcBody(await response.text());
|
|
197
|
+
if (message.error) throw new PublishError("mcp_error", message.error.message ?? "MCP error");
|
|
198
|
+
const content = message.result?.content?.[0]?.text ?? "";
|
|
199
|
+
if (message.result?.isError) throw new PublishError("rejected", content);
|
|
200
|
+
return JSON.parse(content);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
async function upload(uploadUrl, headers, bytes) {
|
|
204
|
+
let lastError = "";
|
|
205
|
+
for (let attempt = 1; attempt <= UPLOAD_ATTEMPTS; attempt += 1) {
|
|
206
|
+
try {
|
|
207
|
+
const response = await fetch(uploadUrl, {
|
|
208
|
+
method: "PUT",
|
|
209
|
+
redirect: "error",
|
|
210
|
+
headers,
|
|
211
|
+
body: bytes,
|
|
212
|
+
});
|
|
213
|
+
if (response.ok) return;
|
|
214
|
+
lastError = `storage answered ${response.status}`;
|
|
215
|
+
// 4xx other than throttling will not improve on retry.
|
|
216
|
+
if (response.status < 500 && response.status !== 429) break;
|
|
217
|
+
} catch {
|
|
218
|
+
lastError = "storage connection failed";
|
|
219
|
+
}
|
|
220
|
+
await new Promise((resolve) => setTimeout(resolve, 500 * 2 ** (attempt - 1)));
|
|
221
|
+
}
|
|
222
|
+
throw new PublishError("upload_failed", `Upload failed after retries: ${lastError}`);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
async function publishChatMedia(endpoint, filename, mimeType, bytes) {
|
|
226
|
+
const { mediaId, uploadUrl } = await callTool(endpoint, "attachment", {
|
|
227
|
+
op: "create_chat_media_upload",
|
|
228
|
+
filename,
|
|
229
|
+
mimeType,
|
|
230
|
+
size: bytes.byteLength,
|
|
231
|
+
});
|
|
232
|
+
await upload(uploadUrl, { "Content-Type": mimeType }, bytes);
|
|
233
|
+
const completed = await callTool(endpoint, "attachment", {
|
|
234
|
+
op: "complete_chat_media_upload",
|
|
235
|
+
mediaId,
|
|
236
|
+
});
|
|
237
|
+
if (completed.status !== "ready" || completed.mediaId !== mediaId) {
|
|
238
|
+
throw new PublishError("not_ready", "Alan did not confirm the chat media is ready.");
|
|
239
|
+
}
|
|
240
|
+
return { mediaId, status: completed.status };
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
async function main() {
|
|
244
|
+
const args = parseArgs(process.argv.slice(2));
|
|
245
|
+
const { kind, extension, mimeType } = describe(args.file, args.kind);
|
|
246
|
+
const endpoint = mcpEndpoint(args.chat);
|
|
247
|
+
const prepared =
|
|
248
|
+
kind === "recording"
|
|
249
|
+
? repairRecording(args.file, extension)
|
|
250
|
+
: { file: args.file, repaired: false };
|
|
251
|
+
const bytes = readFileSync(prepared.file);
|
|
252
|
+
const filename = basename(args.file);
|
|
253
|
+
if (args.chat) {
|
|
254
|
+
const receipt = await publishChatMedia(endpoint, filename, mimeType, bytes);
|
|
255
|
+
process.stdout.write(`${JSON.stringify(receipt)}\n`);
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const begun = await callTool(endpoint, "publish_capture", {
|
|
259
|
+
op: "begin",
|
|
260
|
+
filename,
|
|
261
|
+
kind,
|
|
262
|
+
size: bytes.byteLength,
|
|
263
|
+
});
|
|
264
|
+
await upload(begun.uploadUrl, begun.uploadHeaders, bytes);
|
|
265
|
+
const completed = await callTool(endpoint, "publish_capture", {
|
|
266
|
+
op: "complete",
|
|
267
|
+
captureId: begun.captureId,
|
|
268
|
+
size: bytes.byteLength,
|
|
269
|
+
caption: args.caption,
|
|
270
|
+
});
|
|
271
|
+
process.stdout.write(
|
|
272
|
+
`${JSON.stringify({
|
|
273
|
+
ref: completed.ref,
|
|
274
|
+
markdown: completed.markdown,
|
|
275
|
+
kind,
|
|
276
|
+
source: args.file,
|
|
277
|
+
repaired: prepared.repaired,
|
|
278
|
+
...(prepared.note ? { note: prepared.note } : {}),
|
|
279
|
+
})}\n`
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
main().catch((error) => {
|
|
284
|
+
const code = error instanceof PublishError ? error.code : "unexpected";
|
|
285
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
286
|
+
process.stderr.write(`${JSON.stringify({ error: code, message })}\n`);
|
|
287
|
+
process.exit(1);
|
|
288
|
+
});
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: alan-workflows
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Turn a repeated procedure into a scheduled or event-triggered Alan workflow. Use when the user asks to automate recurring work, create or edit a workflow, set up a cron schedule, react to app events such as task_created, task_status_changed, subtask_status_changed, document_created or artifact_commented, or connect GitHub or Bitbucket triggers, or post to Slack, and when you must choose the trigger, tools, execution target and visibility before calling `workflow` op `create`. Do not use for work that runs once, for authoring a Skill (use alan-skill-authoring), or for composing a plan, artifact or test report.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Alan workflows
|
|
8
|
+
|
|
9
|
+
A workflow is a durable automation: one or more triggers, an agent instruction,
|
|
10
|
+
and a tool list that Alan runs unattended on a schedule or an app event. Build
|
|
11
|
+
one when the work recurs or must react to something happening, and when the
|
|
12
|
+
steps are stable enough to write down once. A single request is a chat turn,
|
|
13
|
+
not a workflow.
|
|
14
|
+
|
|
15
|
+
The workflow agent runs with only the `instructions` you write and the tools
|
|
16
|
+
you attach, with no memory of this conversation. Write the instruction as a
|
|
17
|
+
complete brief, and attach every tool it needs to finish.
|
|
18
|
+
|
|
19
|
+
## Trigger
|
|
20
|
+
|
|
21
|
+
Use this skill when the user asks to automate recurring work, set up or change a
|
|
22
|
+
schedule, react to an app event, connect a GitHub or Bitbucket trigger, post to
|
|
23
|
+
Slack, or create, update, run, or inspect a workflow. It owns the whole path
|
|
24
|
+
from a described procedure to a verified, running workflow.
|
|
25
|
+
|
|
26
|
+
Do not use it to:
|
|
27
|
+
|
|
28
|
+
- run a one-off request that will not repeat — do that directly;
|
|
29
|
+
- author or update a Skill — that is `alan-skill-authoring`;
|
|
30
|
+
- compose a plan, artifact, or test report — those are their own skills;
|
|
31
|
+
- pick a trigger or tools from memory. Every id and config shape comes from the
|
|
32
|
+
catalogue, read in the same session.
|
|
33
|
+
|
|
34
|
+
## Preconditions
|
|
35
|
+
|
|
36
|
+
- Before the discovery calls below, if the request names an unsupported trigger
|
|
37
|
+
(`webhook` or `slack`), say so and offer `schedule`, `app_event`, `github`, or
|
|
38
|
+
`bitbucket` before anything else.
|
|
39
|
+
- If the request does not name the procedure, the trigger, the team, the
|
|
40
|
+
existing workflow (for an edit), the repository (for a GitHub or Bitbucket
|
|
41
|
+
trigger), the Slack destination, or the execution target and visibility, ask a
|
|
42
|
+
compact clarification and stop. Do not call the catalogue or invent a value.
|
|
43
|
+
- The caller has the personal workflow-execute capability. If `workflow` op `create`
|
|
44
|
+
or `workflow_execution` op `execute` is unavailable, report the missing capability; do not
|
|
45
|
+
fake the workflow with a recurring chat or a local cron.
|
|
46
|
+
- Resolve the team before creating anything: call
|
|
47
|
+
`get_workflow_context({ taskId })` with the active task when you have one. Use
|
|
48
|
+
the returned `teamId`. The tool's note says to fall back to `list_teams` when
|
|
49
|
+
it is missing; do not pick a team silently. Ask the user which team (or use
|
|
50
|
+
the team they name). `list_teams` also returns each team's `taskStatuses`,
|
|
51
|
+
which you need before writing a status condition.
|
|
52
|
+
- Read the catalogue in the same session, never from memory:
|
|
53
|
+
- `list_workflow_catalogue({ kind: "triggers" })` for trigger kinds, config
|
|
54
|
+
shapes, app events, the condition fields each event can evaluate, and the
|
|
55
|
+
presets;
|
|
56
|
+
- `list_workflow_catalogue({ kind: "tools", teamId })` for the `entries`
|
|
57
|
+
list, the Slack config shape, and the Slack channels the workflow may post
|
|
58
|
+
to.
|
|
59
|
+
|
|
60
|
+
## Find an existing workflow first
|
|
61
|
+
|
|
62
|
+
Do not create a duplicate. Search by name or topic with
|
|
63
|
+
`find_records({ query, kinds: ["workflow"] })`; if the user gives no name or
|
|
64
|
+
topic, skip the search and ask for the procedure instead. Use `list_workflows({ teamId })`
|
|
65
|
+
only to browse a team's board, and `get_workflow({ workflowId })` once you have
|
|
66
|
+
the id. When a match exists, change it with `workflow` op `update` instead of adding
|
|
67
|
+
a second one.
|
|
68
|
+
|
|
69
|
+
## Choose the trigger
|
|
70
|
+
|
|
71
|
+
Pass `triggers` as an array with at least one entry. Each entry is
|
|
72
|
+
`{ type, config }`. Use the shapes below. The catalogue's `configShapes` returns
|
|
73
|
+
`schedule`, `app_event`, and `github`; `bitbucket` is a trigger kind with
|
|
74
|
+
presets but has no `configShape`, so use the same `{ event, repo?, branch? }`
|
|
75
|
+
shape as `github`.
|
|
76
|
+
|
|
77
|
+
| `type` | `config` | Notes |
|
|
78
|
+
| --- | --- | --- |
|
|
79
|
+
| `schedule` | `{ cron, timezone? }` | Five-field cron. Cloud runs must be at least 5 minutes apart, local runs 1. `timezone` is an IANA name, default `UTC`; if the user says "morning" or "evening" without an hour or timezone, ask for both and set them explicitly. |
|
|
80
|
+
| `app_event` | `{ event, conditions? }` | `event` is one of the app events the catalogue lists. |
|
|
81
|
+
| `github` | `{ event, repo?, branch?, conditions? }` | `event` is a GitHub event such as `pr_opened`, `pr_merged`, `push`, or an issue event (`issue_opened`, `issue_comment`, `issue_labeled`). `repo` is `owner/name`; resolve it with `list_repositories({ scope: "team", teamId })` and confirm a GitHub connection. |
|
|
82
|
+
| `bitbucket` | `{ event, repo?, branch? }` | Same shape as `github`, but the catalogue returns no bitbucket `conditionFields`; add no conditions. |
|
|
83
|
+
| `webhook` | — | Not a supported trigger. The catalogue does not list it and both `workflow` op `create` and `workflow` op `update` reject it. Do not use it; offer `schedule`, `app_event`, `github`, or `bitbucket` instead. |
|
|
84
|
+
|
|
85
|
+
App events include `task_created`, `task_status_changed`, `task_priority_changed`,
|
|
86
|
+
`task_assigned`, `task_archived`, `task_labels_changed`, `subtask_status_changed`,
|
|
87
|
+
`all_subtasks_completed`, `document_created`, `document_updated`,
|
|
88
|
+
`conversation_created`, `agent_created`, `task_commented`, `document_commented`,
|
|
89
|
+
`artifact_commented`, and `mention_alan`. Read the catalogue for the current
|
|
90
|
+
list; do not hardcode a name it does not return. Use the catalogue's `appEvents`
|
|
91
|
+
list: `presets` marked `comingSoon` are not accepted by `workflow` op `create`.
|
|
92
|
+
|
|
93
|
+
## Conditions
|
|
94
|
+
|
|
95
|
+
A trigger may carry `conditions`: an array of `{ field, op, value }`. Every
|
|
96
|
+
condition must match for the trigger to fire (AND); to express OR, add a second
|
|
97
|
+
trigger. Operators are `eq`, `neq`, `in`, `notIn`, `hasAny`, `hasAll`,
|
|
98
|
+
`matches`, `gte`, `lte`, `exists`. String comparison is case-insensitive, globs
|
|
99
|
+
(`*`, `?`) work in `matches` and in `hasAny`/`hasAll` values, and a condition on
|
|
100
|
+
a field the event does not carry never matches.
|
|
101
|
+
|
|
102
|
+
A `field` must be one the catalogue lists under `conditionFields` for that
|
|
103
|
+
trigger event, and its `op` must be in that field's `ops` list — the global
|
|
104
|
+
operator list is not per-field. A typo or an unsupported field is rejected at
|
|
105
|
+
save time, not at first run — check the catalogue rather than guessing. Use
|
|
106
|
+
`conditions`; do not use the legacy `filters` map. Status values are team-scoped
|
|
107
|
+
ids from `taskStatuses`; resolve the team first. When the team has several
|
|
108
|
+
statuses in one group (for example `to_be_deployed`, `prod_testing`, and `done`
|
|
109
|
+
in group `done`), list every id with `in`; the condition fields have no group
|
|
110
|
+
field. `github` issue events and
|
|
111
|
+
`bitbucket` expose no `conditionFields`, so filter inside the instructions
|
|
112
|
+
instead.
|
|
113
|
+
|
|
114
|
+
## Choose the tools
|
|
115
|
+
|
|
116
|
+
Pass `tools` as an array of `{ type, id, name, config? }`. Every `id` comes from
|
|
117
|
+
the `entries` list of `list_workflow_catalogue({ kind: "tools", teamId })`;
|
|
118
|
+
`type` is `builtin`, `integration`, or `mcp`. Attach the fewest tools the
|
|
119
|
+
instruction needs: each one widens what an unattended agent can do.
|
|
120
|
+
|
|
121
|
+
Slack tools take `channelId` (required) and `slackTeamId` when the destination
|
|
122
|
+
supplies it, from `availableSlackDestinations` in the same catalogue response.
|
|
123
|
+
Save the channel id, never the channel name; `channelName` is display-only.
|
|
124
|
+
Public channels Alan is not in are joined when the workflow is saved; a private
|
|
125
|
+
channel appears only after someone runs `/invite @Alan` there. The MCP tool's
|
|
126
|
+
input schema lists a `slack` trigger, but the API route rejects it and the
|
|
127
|
+
catalogue does not expose it; do not create one. Post through a Slack tool.
|
|
128
|
+
|
|
129
|
+
## Choose the target and visibility
|
|
130
|
+
|
|
131
|
+
`executionTarget` and `visibility` are enforced by the API, so get them right
|
|
132
|
+
before calling. Team visibility requires `cloud`: `local` is always `private`,
|
|
133
|
+
so a team-shared workflow cannot run on a local machine, and a team-shared
|
|
134
|
+
schedule therefore cannot run more often than every 5 minutes. For an event
|
|
135
|
+
trigger, prefer `cloud`; a local workflow runs only while that computer is
|
|
136
|
+
online. If the user asks for an impossible combination (for example a 1-minute
|
|
137
|
+
cloud workflow shared with the team), explain the conflict and offer the valid
|
|
138
|
+
alternatives instead of silently changing it.
|
|
139
|
+
|
|
140
|
+
| `executionTarget` | `visibility` | Machine field | Notes |
|
|
141
|
+
| --- | --- | --- | --- |
|
|
142
|
+
| `local` | always `private` | `runtimeId` required | Runs on the caller's own computer. `visibility: "team"` is rejected. |
|
|
143
|
+
| `cloud` | `team` by default, or `private` | `machineId` required unless `enabled: false` | Needs a configured cloud machine. |
|
|
144
|
+
| omitted | — | — | `local` + `private` when the caller has an online runtime, otherwise `cloud` + `team` for Pro organizations. |
|
|
145
|
+
|
|
146
|
+
For `local`, call `list_runtimes` and pick a machine from the response's
|
|
147
|
+
`machines` array with `isOnline: true`. For `cloud`, call
|
|
148
|
+
`list_cloud_machines`, filter to the workflow's `teamId`, and prefer that
|
|
149
|
+
team's `isTeamDefault` machine; never use another team's machine. If the team
|
|
150
|
+
has no cloud machine, report that instead of defaulting to `cloud`. Cloud and
|
|
151
|
+
local machine ids are not interchangeable.
|
|
152
|
+
|
|
153
|
+
## Create and verify
|
|
154
|
+
|
|
155
|
+
Before step 1, if the trigger, the procedure, the team, the existing workflow
|
|
156
|
+
(for an edit), the repository (for a GitHub or Bitbucket trigger), the Slack
|
|
157
|
+
destination, or the execution target/visibility is not named, ask a compact
|
|
158
|
+
clarification covering the missing pieces and stop. Do not invent a schedule,
|
|
159
|
+
event, tool list, team, or destination. If an existing workflow matches, report
|
|
160
|
+
it with its team and ask whether to update it or create one in the user's team;
|
|
161
|
+
never create a duplicate.
|
|
162
|
+
|
|
163
|
+
1. Write `instructions` as the full brief the workflow agent receives each run:
|
|
164
|
+
the goal, the inputs, the tools to use, and what a finished run produces.
|
|
165
|
+
Automatic fires supply the trigger event's variables; when you run it
|
|
166
|
+
manually and the instructions reference those variables, pass them through
|
|
167
|
+
`workflow_execution` op `execute`'s `triggerPayload`.
|
|
168
|
+
2. Call `workflow` op `create` with `teamId` (the API requires it even though the
|
|
169
|
+
tool signature shows it optional), `name`, `instructions`, `triggers`, and
|
|
170
|
+
the rest: `tools`, `enabled`, `maxRetries`, `timeoutMinutes`,
|
|
171
|
+
`executionTarget`, `visibility`, `machineId`, `runtimeId`, and
|
|
172
|
+
`catchupPolicy`. `selectedModel`, `selectedProviderId`, and
|
|
173
|
+
`selectedCredentialId` are optional; omit them unless a discovery tool gave
|
|
174
|
+
you a valid id. `catchupPolicy`
|
|
175
|
+
is `{ mode: "latest_only" | "all" | "none", maxAgeMinutes }` and decides what
|
|
176
|
+
happens to schedule fires missed while the workflow was off.
|
|
177
|
+
3. Read it back with `get_workflow({ workflowId })` and confirm the triggers,
|
|
178
|
+
tools, target, and visibility are what you intended. A create that returns
|
|
179
|
+
an id has not yet proved the automation is correct.
|
|
180
|
+
4. Run it once with `execute_workflow({ workflowId })` and confirm a real run
|
|
181
|
+
reaches a terminal status. Read runs with
|
|
182
|
+
`workflow_execution({ op: "get", executionId })` or
|
|
183
|
+
`workflow_execution({ op: "list", workflowId })`.
|
|
184
|
+
|
|
185
|
+
## Update and control
|
|
186
|
+
|
|
187
|
+
- `update_workflow({ workflowId, ... })` patches fields. `triggers` and `tools`
|
|
188
|
+
are replaced wholesale: always pass the complete new array, not a delta. Read
|
|
189
|
+
the existing workflow first and resend every tool it already has; an existing
|
|
190
|
+
built-in id (for example `search`) may not appear in the current catalogue,
|
|
191
|
+
and dropping it silently changes the workflow.
|
|
192
|
+
- `change_workflow_visibility({ action, workflowId })` moves a workflow with
|
|
193
|
+
`publish` (private cloud to team), `make_private`, or `fork` (copy a team
|
|
194
|
+
workflow into the caller's private space, arriving disabled).
|
|
195
|
+
- `delete_workflow({ workflowId })` soft-deletes the workflow and its schedule.
|
|
196
|
+
|
|
197
|
+
## Failure handling
|
|
198
|
+
|
|
199
|
+
- **Create rejected on a field**: fix the field it names and retry once; do not
|
|
200
|
+
loop. The usual causes are an empty `triggers`, a missing `teamId`, a missing
|
|
201
|
+
`runtimeId` for a local target, a missing `machineId` for an enabled cloud
|
|
202
|
+
target, `visibility: "team"` with a local target, a cron interval under the
|
|
203
|
+
minimum, or a condition on a field the event does not carry.
|
|
204
|
+
- **A workflow already exists**: stop and `workflow` op `update` the existing one.
|
|
205
|
+
- **`workflow_execution` op `execute` cannot dispatch**: a local runtime is offline. Re-run
|
|
206
|
+
`list_runtimes`, pick an online machine, and patch `runtimeId`.
|
|
207
|
+
- **A run failed**: read it with `workflow_execution({ op: "get" })` and its
|
|
208
|
+
`status`, `error`, and `errorKind`; correct `instructions` or `tools` with
|
|
209
|
+
`workflow` op `update` rather than creating a replacement.
|
|
210
|
+
- **A trigger type is rejected**: the MCP tool's input schema lists `slack`,
|
|
211
|
+
but the API route rejects it; `webhook` is rejected by both. Post to Slack
|
|
212
|
+
with a Slack tool, and choose `schedule`, `app_event`, `github`, or
|
|
213
|
+
`bitbucket`.
|
|
214
|
+
- **A team has no cloud machine**: `list_cloud_machines` may return no machine
|
|
215
|
+
for the workflow's team. Report that and offer a local + private workflow or
|
|
216
|
+
ask the user to provision a cloud machine; do not use another team's machine.
|
|
217
|
+
- **A Slack destination is missing**: re-read
|
|
218
|
+
`list_workflow_catalogue({ kind: "tools", teamId })`; for a private channel,
|
|
219
|
+
tell the user to run `/invite @Alan` there first.
|
|
220
|
+
|
|
221
|
+
## Validation
|
|
222
|
+
|
|
223
|
+
Success requires all of the following:
|
|
224
|
+
|
|
225
|
+
- `workflow` op `create` (or `workflow` op `update`) returned a `workflowId` without error;
|
|
226
|
+
- `workflow` op `get` shows the triggers, tools, target, and visibility you intended;
|
|
227
|
+
- once the procedure is named, `find_records` shows a single workflow for it,
|
|
228
|
+
not a duplicate;
|
|
229
|
+
- a manual `workflow_execution` op `execute` run reached a terminal status whose output matches
|
|
230
|
+
the instruction, or the failure is reported with its `errorKind`.
|
|
231
|
+
|
|
232
|
+
## Artifact policy
|
|
233
|
+
|
|
234
|
+
This skill creates no plan, test report, or document. The durable output is the
|
|
235
|
+
workflow record itself; report its name and link when you are done.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skills": {
|
|
3
|
+
"agent-desktop": "sha256:09ab1f75da01ce72b77fa0e4d1890355ed0e5817be6a8cbdae7d4ba1df1821b3",
|
|
4
|
+
"alan-artifact": "sha256:ed9997cb41538630d6c3f8f297e9de79c63d9523bc8c7d0903919b5a9d8c9a5d",
|
|
5
|
+
"alan-deck": "sha256:c28976074cdb5c7c3c9d3358f14aa926fd3bd9efe4c49ca932ba9355f92bfa32",
|
|
6
|
+
"alan-diagrams": "sha256:0c5db2370042ca6dbcee86a29cb2107f11287ada66f60936889e2af938db204a",
|
|
7
|
+
"alan-docs": "sha256:79712b68cc3427fee9ffe90a4de23e39ba364323537127ac71915d6578d32016",
|
|
8
|
+
"alan-environment-setup": "sha256:c1391dc846761cf25133c2f538a943338ef38432da69d1d9404479e973eed637",
|
|
9
|
+
"alan-skill-authoring": "sha256:328d4e9fff80fd376bf7737e820305e708c9da102710a61131d3baf2b93aaa99",
|
|
10
|
+
"alan-tasks": "sha256:0c325cbc20f71d93354919b3f870386b54ab6dd0207a63eff485f83e28c4547e",
|
|
11
|
+
"alan-test-android": "sha256:637a0174d024270d5fd462c7dc790b34566e01fa2c3085e9dfe5856683e97b03",
|
|
12
|
+
"alan-test-desktop": "sha256:260e985f7084535b5eb3ae56e9643b60423cc9f5340f106206d6d8ae86aa4e1f",
|
|
13
|
+
"alan-test-feature": "sha256:97f6bda099ee8d9bb6ba88f3017b14049dcc9ee00602e2ab7bfa0e6e1b76d9a0",
|
|
14
|
+
"alan-test-mobile": "sha256:bd8a1f60bd297c1ec6cf93d2a3dc44ec375e8d2a4b07c184efd5c68ca78110f6",
|
|
15
|
+
"alan-test-web": "sha256:7469c718e6e559fb43dce6a7eeb258f6ef2548e58ff17ef6a9c47e2ace845705",
|
|
16
|
+
"alan-walkthrough": "sha256:ad4dc51a23e466d010250684a26a4a3b6389231b01c91562a9bf73356777afb4",
|
|
17
|
+
"alan-workflows": "sha256:ff571df9ced11a9d23970b0534d9b4cec8de89ff203f15cb6baf885d47142c08"
|
|
18
|
+
}
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alan-ai-hq/agent-manager-linux-arm64",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.200",
|
|
4
4
|
"description": "Alan machine runtime (alan-agent) for one platform: the official Node.js binary, the runtime bundle and its launcher. Installed by @alan-ai-hq/agent-manager.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"homepage": "https://tryalan.ai",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"alan-lease.cjs",
|
|
27
27
|
"claude-sdk.mjs",
|
|
28
28
|
"watcher.node",
|
|
29
|
-
"alan-agent"
|
|
29
|
+
"alan-agent",
|
|
30
|
+
"builtin-skills"
|
|
30
31
|
],
|
|
31
32
|
"alanRuntime": {
|
|
32
33
|
"holderProtocol": 5,
|