@alook/cli 0.0.28 → 0.0.29
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/dist/index.js +66 -14
- package/dist/session-runner.js +68 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13902,6 +13902,12 @@ var ClaimedTaskRowSchema = exports_external.object({
|
|
|
13902
13902
|
completedAt: exports_external.coerce.date().nullable(),
|
|
13903
13903
|
error: exports_external.string().nullable()
|
|
13904
13904
|
});
|
|
13905
|
+
var ColleagueDataApiSchema = exports_external.object({
|
|
13906
|
+
name: exports_external.string(),
|
|
13907
|
+
email: exports_external.string(),
|
|
13908
|
+
description: exports_external.string(),
|
|
13909
|
+
instruction: exports_external.string()
|
|
13910
|
+
});
|
|
13905
13911
|
var TaskAgentDataApiSchema = exports_external.object({
|
|
13906
13912
|
instructions: exports_external.string(),
|
|
13907
13913
|
name: exports_external.string(),
|
|
@@ -13909,7 +13915,8 @@ var TaskAgentDataApiSchema = exports_external.object({
|
|
|
13909
13915
|
email_handle: exports_external.string().nullable().optional(),
|
|
13910
13916
|
email_addresses: exports_external.array(exports_external.string()).default([]),
|
|
13911
13917
|
user_email: exports_external.string().nullable().optional(),
|
|
13912
|
-
user_name: exports_external.string().nullable().optional()
|
|
13918
|
+
user_name: exports_external.string().nullable().optional(),
|
|
13919
|
+
colleagues: exports_external.array(ColleagueDataApiSchema).default([])
|
|
13913
13920
|
});
|
|
13914
13921
|
var TaskApiBaseSchema = exports_external.object({
|
|
13915
13922
|
id: exports_external.string(),
|
|
@@ -14065,6 +14072,14 @@ var CalendarEventApiSchema = exports_external.object({
|
|
|
14065
14072
|
created_at: exports_external.string(),
|
|
14066
14073
|
updated_at: exports_external.string()
|
|
14067
14074
|
});
|
|
14075
|
+
var CreateAgentLinkRequestSchema = exports_external.object({
|
|
14076
|
+
source_agent_id: exports_external.string().min(1, "source_agent_id is required"),
|
|
14077
|
+
target_agent_id: exports_external.string().min(1, "target_agent_id is required"),
|
|
14078
|
+
instruction: exports_external.string().optional().default("")
|
|
14079
|
+
});
|
|
14080
|
+
var UpdateAgentLinkRequestSchema = exports_external.object({
|
|
14081
|
+
instruction: exports_external.string()
|
|
14082
|
+
});
|
|
14068
14083
|
var AddWhitelistRequestSchema = exports_external.object({
|
|
14069
14084
|
email: exports_external.string().email()
|
|
14070
14085
|
});
|
|
@@ -14076,7 +14091,8 @@ var CreateAgentRequestSchema = exports_external.object({
|
|
|
14076
14091
|
runtime_id: exports_external.string().min(1, "runtime_id is required"),
|
|
14077
14092
|
runtime_config: RuntimeConfigSchema,
|
|
14078
14093
|
max_concurrent_tasks: exports_external.number().int().optional(),
|
|
14079
|
-
email_handle: exports_external.string().optional()
|
|
14094
|
+
email_handle: exports_external.string().optional(),
|
|
14095
|
+
avatar_url: exports_external.string().max(2000).nullable().optional()
|
|
14080
14096
|
});
|
|
14081
14097
|
var UpdateAgentRequestSchema = exports_external.object({
|
|
14082
14098
|
name: exports_external.string().min(1).optional(),
|
|
@@ -14084,8 +14100,9 @@ var UpdateAgentRequestSchema = exports_external.object({
|
|
|
14084
14100
|
instructions: exports_external.string().optional(),
|
|
14085
14101
|
runtime_id: exports_external.string().min(1).optional(),
|
|
14086
14102
|
runtime_config: RuntimeConfigSchema,
|
|
14087
|
-
visibility: exports_external.enum(["public", "private"]).optional()
|
|
14088
|
-
|
|
14103
|
+
visibility: exports_external.enum(["public", "private"]).optional(),
|
|
14104
|
+
avatar_url: exports_external.string().max(2000).nullable().optional()
|
|
14105
|
+
}).refine((v) => v.name !== undefined || v.description !== undefined || v.instructions !== undefined || v.runtime_id !== undefined || v.runtime_config !== undefined || v.visibility !== undefined || v.avatar_url !== undefined, { message: "at least one field is required" });
|
|
14089
14106
|
var CreateConversationRequestSchema = exports_external.object({
|
|
14090
14107
|
agent_id: exports_external.string().min(1, "agent_id is required"),
|
|
14091
14108
|
channel: exports_external.string().optional()
|
|
@@ -15719,13 +15736,13 @@ var agent = sqliteTable("agent", {
|
|
|
15719
15736
|
description: text("description").notNull().default(""),
|
|
15720
15737
|
instructions: text("instructions").notNull().default(""),
|
|
15721
15738
|
avatarUrl: text("avatar_url"),
|
|
15722
|
-
runtimeId: text("runtime_id").
|
|
15739
|
+
runtimeId: text("runtime_id").references(() => agentRuntime.id),
|
|
15723
15740
|
runtimeMode: text("runtime_mode").notNull().default("local"),
|
|
15724
15741
|
runtimeConfig: text("runtime_config", { mode: "json" }),
|
|
15725
15742
|
visibility: text("visibility").notNull().default("private"),
|
|
15726
15743
|
status: text("status").notNull().default("idle"),
|
|
15727
15744
|
maxConcurrentTasks: integer2("max_concurrent_tasks").notNull().default(6),
|
|
15728
|
-
ownerId: text("owner_id").references(() => user.id
|
|
15745
|
+
ownerId: text("owner_id").references(() => user.id),
|
|
15729
15746
|
tools: text("tools", { mode: "json" }),
|
|
15730
15747
|
triggers: text("triggers", { mode: "json" }),
|
|
15731
15748
|
emailHandle: text("email_handle").unique(),
|
|
@@ -15961,6 +15978,26 @@ var conversationMap = sqliteTable("conversation_map", {
|
|
|
15961
15978
|
}, (t) => [
|
|
15962
15979
|
unique("conversation_map_key_workspace").on(t.key, t.workspaceId)
|
|
15963
15980
|
]);
|
|
15981
|
+
var agentLink = sqliteTable("agent_link", {
|
|
15982
|
+
id: text("id").primaryKey().$defaultFn(() => "al_" + nanoid3()),
|
|
15983
|
+
workspaceId: text("workspace_id").notNull(),
|
|
15984
|
+
sourceAgentId: text("source_agent_id").notNull(),
|
|
15985
|
+
targetAgentId: text("target_agent_id").notNull(),
|
|
15986
|
+
instruction: text("instruction").notNull().default(""),
|
|
15987
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
15988
|
+
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
15989
|
+
}, (t) => [
|
|
15990
|
+
unique("agent_link_ws_source_target").on(t.workspaceId, t.sourceAgentId, t.targetAgentId),
|
|
15991
|
+
index("idx_agent_link_workspace").on(t.workspaceId),
|
|
15992
|
+
foreignKey({
|
|
15993
|
+
columns: [t.sourceAgentId, t.workspaceId],
|
|
15994
|
+
foreignColumns: [agent.id, agent.workspaceId]
|
|
15995
|
+
}).onDelete("cascade"),
|
|
15996
|
+
foreignKey({
|
|
15997
|
+
columns: [t.targetAgentId, t.workspaceId],
|
|
15998
|
+
foreignColumns: [agent.id, agent.workspaceId]
|
|
15999
|
+
}).onDelete("cascade")
|
|
16000
|
+
]);
|
|
15964
16001
|
var workspaceFileRequest = sqliteTable("workspace_file_request", {
|
|
15965
16002
|
id: text("id").primaryKey().$defaultFn(() => "wfr_" + nanoid3()),
|
|
15966
16003
|
workspaceId: text("workspace_id").notNull().references(() => workspace.id, { onDelete: "cascade" }),
|
|
@@ -15972,11 +16009,7 @@ var workspaceFileRequest = sqliteTable("workspace_file_request", {
|
|
|
15972
16009
|
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
15973
16010
|
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
15974
16011
|
}, (t) => [
|
|
15975
|
-
index("idx_wfr_workspace_status").on(t.workspaceId, t.status)
|
|
15976
|
-
foreignKey({
|
|
15977
|
-
columns: [t.agentId, t.workspaceId],
|
|
15978
|
-
foreignColumns: [agent.id, agent.workspaceId]
|
|
15979
|
-
}).onDelete("cascade")
|
|
16012
|
+
index("idx_wfr_workspace_status").on(t.workspaceId, t.status)
|
|
15980
16013
|
]);
|
|
15981
16014
|
// ../shared/src/db/queries/task.ts
|
|
15982
16015
|
var DEFAULT_STALE_SECONDS = Number(process.env.ALOOK_STALE_DISPATCH_TIMEOUT_S) || 20;
|
|
@@ -16293,7 +16326,21 @@ function fromApiTask(api2) {
|
|
|
16293
16326
|
type: api2.type,
|
|
16294
16327
|
contextKey: api2.context_key ?? null,
|
|
16295
16328
|
context: api2.context ?? undefined,
|
|
16296
|
-
agent: api2.agent ? {
|
|
16329
|
+
agent: api2.agent ? {
|
|
16330
|
+
name: api2.agent.name,
|
|
16331
|
+
instructions: api2.agent.instructions,
|
|
16332
|
+
emailHandle: api2.agent.email_handle ?? undefined,
|
|
16333
|
+
emailAddresses: api2.agent.email_addresses ?? [],
|
|
16334
|
+
userEmail: api2.agent.user_email ?? undefined,
|
|
16335
|
+
userName: api2.agent.user_name ?? undefined,
|
|
16336
|
+
runtimeConfig: api2.agent.runtime_config ?? undefined,
|
|
16337
|
+
colleagues: api2.agent.colleagues?.map((c) => ({
|
|
16338
|
+
name: c.name,
|
|
16339
|
+
email: c.email,
|
|
16340
|
+
description: c.description,
|
|
16341
|
+
instruction: c.instruction
|
|
16342
|
+
})) ?? []
|
|
16343
|
+
} : undefined,
|
|
16297
16344
|
sender: api2.sender ? { name: api2.sender.name, email: api2.sender.email, isOwner: api2.sender.is_owner } : undefined,
|
|
16298
16345
|
repos: undefined,
|
|
16299
16346
|
createdAt: api2.created_at
|
|
@@ -16735,10 +16782,15 @@ async function readDirectoryTree(dirPath, basePath) {
|
|
|
16735
16782
|
});
|
|
16736
16783
|
const results = [];
|
|
16737
16784
|
for (const entry of entries) {
|
|
16738
|
-
if (entry.name.startsWith(".")
|
|
16785
|
+
if (entry.name.startsWith("."))
|
|
16739
16786
|
continue;
|
|
16740
16787
|
if (SKIP_DIRS.has(entry.name))
|
|
16741
16788
|
continue;
|
|
16789
|
+
if (!entry.isDirectory()) {
|
|
16790
|
+
const ext = extname(entry.name).toLowerCase();
|
|
16791
|
+
if (ext !== "" && !TEXT_EXTENSIONS.has(ext))
|
|
16792
|
+
continue;
|
|
16793
|
+
}
|
|
16742
16794
|
const fullPath = join6(dirPath, entry.name);
|
|
16743
16795
|
let info;
|
|
16744
16796
|
try {
|
|
@@ -16794,7 +16846,7 @@ function resolveLoginShellEnv() {
|
|
|
16794
16846
|
}
|
|
16795
16847
|
const shell = process.env.SHELL || "/bin/zsh";
|
|
16796
16848
|
try {
|
|
16797
|
-
const output = execSync3(`${shell} -
|
|
16849
|
+
const output = execSync3(`${shell} -ilc 'env'`, {
|
|
16798
16850
|
encoding: "utf-8",
|
|
16799
16851
|
timeout: 5000,
|
|
16800
16852
|
stdio: ["ignore", "pipe", "ignore"]
|
package/dist/session-runner.js
CHANGED
|
@@ -13619,6 +13619,12 @@ var ClaimedTaskRowSchema = exports_external.object({
|
|
|
13619
13619
|
completedAt: exports_external.coerce.date().nullable(),
|
|
13620
13620
|
error: exports_external.string().nullable()
|
|
13621
13621
|
});
|
|
13622
|
+
var ColleagueDataApiSchema = exports_external.object({
|
|
13623
|
+
name: exports_external.string(),
|
|
13624
|
+
email: exports_external.string(),
|
|
13625
|
+
description: exports_external.string(),
|
|
13626
|
+
instruction: exports_external.string()
|
|
13627
|
+
});
|
|
13622
13628
|
var TaskAgentDataApiSchema = exports_external.object({
|
|
13623
13629
|
instructions: exports_external.string(),
|
|
13624
13630
|
name: exports_external.string(),
|
|
@@ -13626,7 +13632,8 @@ var TaskAgentDataApiSchema = exports_external.object({
|
|
|
13626
13632
|
email_handle: exports_external.string().nullable().optional(),
|
|
13627
13633
|
email_addresses: exports_external.array(exports_external.string()).default([]),
|
|
13628
13634
|
user_email: exports_external.string().nullable().optional(),
|
|
13629
|
-
user_name: exports_external.string().nullable().optional()
|
|
13635
|
+
user_name: exports_external.string().nullable().optional(),
|
|
13636
|
+
colleagues: exports_external.array(ColleagueDataApiSchema).default([])
|
|
13630
13637
|
});
|
|
13631
13638
|
var TaskApiBaseSchema = exports_external.object({
|
|
13632
13639
|
id: exports_external.string(),
|
|
@@ -13782,6 +13789,14 @@ var CalendarEventApiSchema = exports_external.object({
|
|
|
13782
13789
|
created_at: exports_external.string(),
|
|
13783
13790
|
updated_at: exports_external.string()
|
|
13784
13791
|
});
|
|
13792
|
+
var CreateAgentLinkRequestSchema = exports_external.object({
|
|
13793
|
+
source_agent_id: exports_external.string().min(1, "source_agent_id is required"),
|
|
13794
|
+
target_agent_id: exports_external.string().min(1, "target_agent_id is required"),
|
|
13795
|
+
instruction: exports_external.string().optional().default("")
|
|
13796
|
+
});
|
|
13797
|
+
var UpdateAgentLinkRequestSchema = exports_external.object({
|
|
13798
|
+
instruction: exports_external.string()
|
|
13799
|
+
});
|
|
13785
13800
|
var AddWhitelistRequestSchema = exports_external.object({
|
|
13786
13801
|
email: exports_external.string().email()
|
|
13787
13802
|
});
|
|
@@ -13793,7 +13808,8 @@ var CreateAgentRequestSchema = exports_external.object({
|
|
|
13793
13808
|
runtime_id: exports_external.string().min(1, "runtime_id is required"),
|
|
13794
13809
|
runtime_config: RuntimeConfigSchema,
|
|
13795
13810
|
max_concurrent_tasks: exports_external.number().int().optional(),
|
|
13796
|
-
email_handle: exports_external.string().optional()
|
|
13811
|
+
email_handle: exports_external.string().optional(),
|
|
13812
|
+
avatar_url: exports_external.string().max(2000).nullable().optional()
|
|
13797
13813
|
});
|
|
13798
13814
|
var UpdateAgentRequestSchema = exports_external.object({
|
|
13799
13815
|
name: exports_external.string().min(1).optional(),
|
|
@@ -13801,8 +13817,9 @@ var UpdateAgentRequestSchema = exports_external.object({
|
|
|
13801
13817
|
instructions: exports_external.string().optional(),
|
|
13802
13818
|
runtime_id: exports_external.string().min(1).optional(),
|
|
13803
13819
|
runtime_config: RuntimeConfigSchema,
|
|
13804
|
-
visibility: exports_external.enum(["public", "private"]).optional()
|
|
13805
|
-
|
|
13820
|
+
visibility: exports_external.enum(["public", "private"]).optional(),
|
|
13821
|
+
avatar_url: exports_external.string().max(2000).nullable().optional()
|
|
13822
|
+
}).refine((v) => v.name !== undefined || v.description !== undefined || v.instructions !== undefined || v.runtime_id !== undefined || v.runtime_config !== undefined || v.visibility !== undefined || v.avatar_url !== undefined, { message: "at least one field is required" });
|
|
13806
13823
|
var CreateConversationRequestSchema = exports_external.object({
|
|
13807
13824
|
agent_id: exports_external.string().min(1, "agent_id is required"),
|
|
13808
13825
|
channel: exports_external.string().optional()
|
|
@@ -15436,13 +15453,13 @@ var agent = sqliteTable("agent", {
|
|
|
15436
15453
|
description: text("description").notNull().default(""),
|
|
15437
15454
|
instructions: text("instructions").notNull().default(""),
|
|
15438
15455
|
avatarUrl: text("avatar_url"),
|
|
15439
|
-
runtimeId: text("runtime_id").
|
|
15456
|
+
runtimeId: text("runtime_id").references(() => agentRuntime.id),
|
|
15440
15457
|
runtimeMode: text("runtime_mode").notNull().default("local"),
|
|
15441
15458
|
runtimeConfig: text("runtime_config", { mode: "json" }),
|
|
15442
15459
|
visibility: text("visibility").notNull().default("private"),
|
|
15443
15460
|
status: text("status").notNull().default("idle"),
|
|
15444
15461
|
maxConcurrentTasks: integer2("max_concurrent_tasks").notNull().default(6),
|
|
15445
|
-
ownerId: text("owner_id").references(() => user.id
|
|
15462
|
+
ownerId: text("owner_id").references(() => user.id),
|
|
15446
15463
|
tools: text("tools", { mode: "json" }),
|
|
15447
15464
|
triggers: text("triggers", { mode: "json" }),
|
|
15448
15465
|
emailHandle: text("email_handle").unique(),
|
|
@@ -15678,6 +15695,26 @@ var conversationMap = sqliteTable("conversation_map", {
|
|
|
15678
15695
|
}, (t) => [
|
|
15679
15696
|
unique("conversation_map_key_workspace").on(t.key, t.workspaceId)
|
|
15680
15697
|
]);
|
|
15698
|
+
var agentLink = sqliteTable("agent_link", {
|
|
15699
|
+
id: text("id").primaryKey().$defaultFn(() => "al_" + nanoid3()),
|
|
15700
|
+
workspaceId: text("workspace_id").notNull(),
|
|
15701
|
+
sourceAgentId: text("source_agent_id").notNull(),
|
|
15702
|
+
targetAgentId: text("target_agent_id").notNull(),
|
|
15703
|
+
instruction: text("instruction").notNull().default(""),
|
|
15704
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
15705
|
+
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
15706
|
+
}, (t) => [
|
|
15707
|
+
unique("agent_link_ws_source_target").on(t.workspaceId, t.sourceAgentId, t.targetAgentId),
|
|
15708
|
+
index("idx_agent_link_workspace").on(t.workspaceId),
|
|
15709
|
+
foreignKey({
|
|
15710
|
+
columns: [t.sourceAgentId, t.workspaceId],
|
|
15711
|
+
foreignColumns: [agent.id, agent.workspaceId]
|
|
15712
|
+
}).onDelete("cascade"),
|
|
15713
|
+
foreignKey({
|
|
15714
|
+
columns: [t.targetAgentId, t.workspaceId],
|
|
15715
|
+
foreignColumns: [agent.id, agent.workspaceId]
|
|
15716
|
+
}).onDelete("cascade")
|
|
15717
|
+
]);
|
|
15681
15718
|
var workspaceFileRequest = sqliteTable("workspace_file_request", {
|
|
15682
15719
|
id: text("id").primaryKey().$defaultFn(() => "wfr_" + nanoid3()),
|
|
15683
15720
|
workspaceId: text("workspace_id").notNull().references(() => workspace.id, { onDelete: "cascade" }),
|
|
@@ -15689,11 +15726,7 @@ var workspaceFileRequest = sqliteTable("workspace_file_request", {
|
|
|
15689
15726
|
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
15690
15727
|
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
15691
15728
|
}, (t) => [
|
|
15692
|
-
index("idx_wfr_workspace_status").on(t.workspaceId, t.status)
|
|
15693
|
-
foreignKey({
|
|
15694
|
-
columns: [t.agentId, t.workspaceId],
|
|
15695
|
-
foreignColumns: [agent.id, agent.workspaceId]
|
|
15696
|
-
}).onDelete("cascade")
|
|
15729
|
+
index("idx_wfr_workspace_status").on(t.workspaceId, t.status)
|
|
15697
15730
|
]);
|
|
15698
15731
|
// ../shared/src/db/queries/task.ts
|
|
15699
15732
|
var DEFAULT_STALE_SECONDS = Number(process.env.ALOOK_STALE_DISPATCH_TIMEOUT_S) || 20;
|
|
@@ -16555,7 +16588,7 @@ class OpenCodeBackend {
|
|
|
16555
16588
|
args.push(prompt);
|
|
16556
16589
|
const proc = spawn3(this.cliPath, args, {
|
|
16557
16590
|
cwd: options.cwd,
|
|
16558
|
-
stdio: ["
|
|
16591
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
16559
16592
|
env: { ...process.env, ...options.env, OPENCODE_PERMISSION: '{"*":"allow"}' }
|
|
16560
16593
|
});
|
|
16561
16594
|
let timedOut = false;
|
|
@@ -16580,9 +16613,6 @@ class OpenCodeBackend {
|
|
|
16580
16613
|
if (turnDoneTriggered)
|
|
16581
16614
|
return;
|
|
16582
16615
|
turnDoneTriggered = true;
|
|
16583
|
-
try {
|
|
16584
|
-
proc.stdin?.end();
|
|
16585
|
-
} catch {}
|
|
16586
16616
|
try {
|
|
16587
16617
|
proc.kill("SIGTERM");
|
|
16588
16618
|
} catch {}
|
|
@@ -16849,6 +16879,29 @@ ${task.agent.instructions}
|
|
|
16849
16879
|
---- big boss out ---
|
|
16850
16880
|
`;
|
|
16851
16881
|
}
|
|
16882
|
+
if (task.agent?.colleagues?.length) {
|
|
16883
|
+
content += `
|
|
16884
|
+
## Your Colleagues
|
|
16885
|
+
Below are your direct colleagues. You can reach them via email.
|
|
16886
|
+
|
|
16887
|
+
**Important:** When communicating with a colleague, always reply to the existing email thread instead of composing a new email. This keeps the full conversation context visible to your colleague so they can pick up where you left off.
|
|
16888
|
+
|
|
16889
|
+
`;
|
|
16890
|
+
for (let i = 0;i < task.agent.colleagues.length; i++) {
|
|
16891
|
+
const c = task.agent.colleagues[i];
|
|
16892
|
+
content += `### ${c.name}${c.email ? ` (${c.email})` : ""}
|
|
16893
|
+
`;
|
|
16894
|
+
if (c.description)
|
|
16895
|
+
content += `${c.description}
|
|
16896
|
+
`;
|
|
16897
|
+
if (c.instruction)
|
|
16898
|
+
content += `**Relationship:** ${c.instruction}
|
|
16899
|
+
`;
|
|
16900
|
+
if (i < task.agent.colleagues.length - 1)
|
|
16901
|
+
content += `
|
|
16902
|
+
`;
|
|
16903
|
+
}
|
|
16904
|
+
}
|
|
16852
16905
|
content += `
|
|
16853
16906
|
## Alook CLI Tools
|
|
16854
16907
|
You can communicate with the world through Alook CLI.
|