@alook/cli 0.0.31 → 0.0.33
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 +20 -2
- package/dist/session-runner.js +38 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14153,7 +14153,8 @@ var EmailNotifyRequestSchema = exports_external.object({
|
|
|
14153
14153
|
messageId: exports_external.string().optional().default(""),
|
|
14154
14154
|
inReplyTo: exports_external.string().optional().default(""),
|
|
14155
14155
|
references: exports_external.string().optional().default(""),
|
|
14156
|
-
meetingInfo: MeetingInfoSchema.nullable().optional()
|
|
14156
|
+
meetingInfo: MeetingInfoSchema.nullable().optional(),
|
|
14157
|
+
attachments: exports_external.string().optional()
|
|
14157
14158
|
});
|
|
14158
14159
|
var CreateEmailAccountSchema = exports_external.object({
|
|
14159
14160
|
emailAddress: exports_external.string().email("valid email required"),
|
|
@@ -15697,7 +15698,8 @@ var agentPin = sqliteTable("agent_pin", {
|
|
|
15697
15698
|
agentId: text("agent_id").notNull(),
|
|
15698
15699
|
workspaceId: text("workspace_id").notNull(),
|
|
15699
15700
|
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
15700
|
-
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
15701
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
15702
|
+
position: integer2("position").notNull().default(0)
|
|
15701
15703
|
}, (t) => [
|
|
15702
15704
|
unique("agent_pin_agent_ws_user").on(t.agentId, t.workspaceId, t.userId),
|
|
15703
15705
|
index("idx_agent_pin_ws_user").on(t.workspaceId, t.userId),
|
|
@@ -15706,6 +15708,20 @@ var agentPin = sqliteTable("agent_pin", {
|
|
|
15706
15708
|
foreignColumns: [agent.id, agent.workspaceId]
|
|
15707
15709
|
}).onDelete("cascade")
|
|
15708
15710
|
]);
|
|
15711
|
+
var agentSidebarOrder = sqliteTable("agent_sidebar_order", {
|
|
15712
|
+
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
15713
|
+
agentId: text("agent_id").notNull(),
|
|
15714
|
+
workspaceId: text("workspace_id").notNull(),
|
|
15715
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
15716
|
+
position: integer2("position").notNull().default(0)
|
|
15717
|
+
}, (t) => [
|
|
15718
|
+
unique("agent_sidebar_order_agent_ws_user").on(t.agentId, t.workspaceId, t.userId),
|
|
15719
|
+
index("idx_agent_sidebar_order_ws_user").on(t.workspaceId, t.userId),
|
|
15720
|
+
foreignKey({
|
|
15721
|
+
columns: [t.agentId, t.workspaceId],
|
|
15722
|
+
foreignColumns: [agent.id, agent.workspaceId]
|
|
15723
|
+
}).onDelete("cascade")
|
|
15724
|
+
]);
|
|
15709
15725
|
var machine = sqliteTable("machine", {
|
|
15710
15726
|
daemonId: text("daemon_id").notNull(),
|
|
15711
15727
|
workspaceId: text("workspace_id").notNull().references(() => workspace.id, { onDelete: "cascade" }),
|
|
@@ -15781,6 +15797,7 @@ var conversation = sqliteTable("conversation", {
|
|
|
15781
15797
|
channel: text("channel").notNull().default("default"),
|
|
15782
15798
|
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
15783
15799
|
}, (t) => [
|
|
15800
|
+
index("idx_conversation_agent_lookup").on(t.workspaceId, t.agentId, t.userId, t.type, t.channel, t.createdAt),
|
|
15784
15801
|
foreignKey({
|
|
15785
15802
|
columns: [t.agentId, t.workspaceId],
|
|
15786
15803
|
foreignColumns: [agent.id, agent.workspaceId]
|
|
@@ -15821,6 +15838,7 @@ var agentTaskQueue = sqliteTable("agent_task_queue", {
|
|
|
15821
15838
|
index("idx_task_queue_pending").on(t.agentId, t.status).where(sql`status IN ('queued', 'dispatched')`),
|
|
15822
15839
|
index("idx_task_queue_workspace_active").on(t.workspaceId, t.status, t.agentId).where(sql`status IN ('queued', 'dispatched', 'running')`),
|
|
15823
15840
|
index("idx_task_queue_agent_history").on(t.agentId, t.workspaceId, t.createdAt),
|
|
15841
|
+
index("idx_task_queue_conversation_status").on(t.conversationId, t.status),
|
|
15824
15842
|
foreignKey({
|
|
15825
15843
|
columns: [t.agentId, t.workspaceId],
|
|
15826
15844
|
foreignColumns: [agent.id, agent.workspaceId]
|
package/dist/session-runner.js
CHANGED
|
@@ -13870,7 +13870,8 @@ var EmailNotifyRequestSchema = exports_external.object({
|
|
|
13870
13870
|
messageId: exports_external.string().optional().default(""),
|
|
13871
13871
|
inReplyTo: exports_external.string().optional().default(""),
|
|
13872
13872
|
references: exports_external.string().optional().default(""),
|
|
13873
|
-
meetingInfo: MeetingInfoSchema.nullable().optional()
|
|
13873
|
+
meetingInfo: MeetingInfoSchema.nullable().optional(),
|
|
13874
|
+
attachments: exports_external.string().optional()
|
|
13874
13875
|
});
|
|
13875
13876
|
var CreateEmailAccountSchema = exports_external.object({
|
|
13876
13877
|
emailAddress: exports_external.string().email("valid email required"),
|
|
@@ -15414,7 +15415,8 @@ var agentPin = sqliteTable("agent_pin", {
|
|
|
15414
15415
|
agentId: text("agent_id").notNull(),
|
|
15415
15416
|
workspaceId: text("workspace_id").notNull(),
|
|
15416
15417
|
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
15417
|
-
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
15418
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
15419
|
+
position: integer2("position").notNull().default(0)
|
|
15418
15420
|
}, (t) => [
|
|
15419
15421
|
unique("agent_pin_agent_ws_user").on(t.agentId, t.workspaceId, t.userId),
|
|
15420
15422
|
index("idx_agent_pin_ws_user").on(t.workspaceId, t.userId),
|
|
@@ -15423,6 +15425,20 @@ var agentPin = sqliteTable("agent_pin", {
|
|
|
15423
15425
|
foreignColumns: [agent.id, agent.workspaceId]
|
|
15424
15426
|
}).onDelete("cascade")
|
|
15425
15427
|
]);
|
|
15428
|
+
var agentSidebarOrder = sqliteTable("agent_sidebar_order", {
|
|
15429
|
+
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
15430
|
+
agentId: text("agent_id").notNull(),
|
|
15431
|
+
workspaceId: text("workspace_id").notNull(),
|
|
15432
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
15433
|
+
position: integer2("position").notNull().default(0)
|
|
15434
|
+
}, (t) => [
|
|
15435
|
+
unique("agent_sidebar_order_agent_ws_user").on(t.agentId, t.workspaceId, t.userId),
|
|
15436
|
+
index("idx_agent_sidebar_order_ws_user").on(t.workspaceId, t.userId),
|
|
15437
|
+
foreignKey({
|
|
15438
|
+
columns: [t.agentId, t.workspaceId],
|
|
15439
|
+
foreignColumns: [agent.id, agent.workspaceId]
|
|
15440
|
+
}).onDelete("cascade")
|
|
15441
|
+
]);
|
|
15426
15442
|
var machine = sqliteTable("machine", {
|
|
15427
15443
|
daemonId: text("daemon_id").notNull(),
|
|
15428
15444
|
workspaceId: text("workspace_id").notNull().references(() => workspace.id, { onDelete: "cascade" }),
|
|
@@ -15498,6 +15514,7 @@ var conversation = sqliteTable("conversation", {
|
|
|
15498
15514
|
channel: text("channel").notNull().default("default"),
|
|
15499
15515
|
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
15500
15516
|
}, (t) => [
|
|
15517
|
+
index("idx_conversation_agent_lookup").on(t.workspaceId, t.agentId, t.userId, t.type, t.channel, t.createdAt),
|
|
15501
15518
|
foreignKey({
|
|
15502
15519
|
columns: [t.agentId, t.workspaceId],
|
|
15503
15520
|
foreignColumns: [agent.id, agent.workspaceId]
|
|
@@ -15538,6 +15555,7 @@ var agentTaskQueue = sqliteTable("agent_task_queue", {
|
|
|
15538
15555
|
index("idx_task_queue_pending").on(t.agentId, t.status).where(sql`status IN ('queued', 'dispatched')`),
|
|
15539
15556
|
index("idx_task_queue_workspace_active").on(t.workspaceId, t.status, t.agentId).where(sql`status IN ('queued', 'dispatched', 'running')`),
|
|
15540
15557
|
index("idx_task_queue_agent_history").on(t.agentId, t.workspaceId, t.createdAt),
|
|
15558
|
+
index("idx_task_queue_conversation_status").on(t.conversationId, t.status),
|
|
15541
15559
|
foreignKey({
|
|
15542
15560
|
columns: [t.agentId, t.workspaceId],
|
|
15543
15561
|
foreignColumns: [agent.id, agent.workspaceId]
|
|
@@ -16130,7 +16148,7 @@ class CodexBackend {
|
|
|
16130
16148
|
this.cliPath = cliPath;
|
|
16131
16149
|
}
|
|
16132
16150
|
execute(prompt, options) {
|
|
16133
|
-
const proc = spawn2(this.cliPath, ["app-server", "--listen", "stdio://"
|
|
16151
|
+
const proc = spawn2(this.cliPath, ["app-server", "--listen", "stdio://"], {
|
|
16134
16152
|
cwd: options.cwd,
|
|
16135
16153
|
stdio: ["pipe", "pipe", "pipe"],
|
|
16136
16154
|
env: { ...process.env, ...options.env }
|
|
@@ -16488,7 +16506,7 @@ class CodexBackend {
|
|
|
16488
16506
|
} else {
|
|
16489
16507
|
const threadParams = {
|
|
16490
16508
|
cwd: options.cwd,
|
|
16491
|
-
sandbox: "
|
|
16509
|
+
sandbox: "danger-full-access",
|
|
16492
16510
|
persistExtendedHistory: true,
|
|
16493
16511
|
experimentalRawEvents: false
|
|
16494
16512
|
};
|
|
@@ -16880,12 +16898,23 @@ those json are sorted by datetime in asc order.
|
|
|
16880
16898
|
## RULES
|
|
16881
16899
|
- DM task prompts include a \`sender\` object with the workspace member's name, email, and whether they are the agent owner (\`is_owner\`). Use this to personalize your responses.
|
|
16882
16900
|
- Read @memory.md(if exists) before your action.
|
|
16883
|
-
- When you start a new task, read the last ~10 lines of today's timeline to understand what has been asked and done recently.
|
|
16884
|
-
- if you don't know the current datetime, obtain the current datetime first.
|
|
16885
16901
|
- When user ask you something you don't have in your current context, try to read the timeline jsonl files for answer (today or previous days).
|
|
16886
16902
|
- Use grep tool to search in the context timeline jsonls if you have clean and focus keywords to recall.
|
|
16903
|
+
- if you don't know the current datetime, obtain the current datetime first.
|
|
16887
16904
|
- When access other local projects, make sure you read the CLAUDE.md/AGENTS.md file under the project root dir to understand the requirements.
|
|
16888
16905
|
`;
|
|
16906
|
+
function resolveInstruction(text2, selfAgentId) {
|
|
16907
|
+
let result = text2;
|
|
16908
|
+
result = result.replace(/\[@ id="([^"]*)" label="([^"]*)"\]/g, (_, id, label) => id === selfAgentId ? "YOU" : `@${label}`);
|
|
16909
|
+
result = result.replace(/<span[^>]*data-id="([^"]*)"[^>]*data-label="([^"]*)"[^>]*>[^<]*<\/span>/gi, (_, id, label) => id === selfAgentId ? "YOU" : `@${label ?? "unknown"}`);
|
|
16910
|
+
result = result.replace(/<\/p>\s*<p[^>]*>/gi, `
|
|
16911
|
+
`);
|
|
16912
|
+
result = result.replace(/<[^>]+>/g, "");
|
|
16913
|
+
result = result.replace(/\n{3,}/g, `
|
|
16914
|
+
|
|
16915
|
+
`).trim();
|
|
16916
|
+
return result;
|
|
16917
|
+
}
|
|
16889
16918
|
function buildInstructionContent(task) {
|
|
16890
16919
|
const displayName = task.agent?.name || "Alook Agent";
|
|
16891
16920
|
const alookAddr = task.agent?.emailHandle ? toAlookAddress(task.agent.emailHandle) : null;
|
|
@@ -16910,8 +16939,8 @@ ${task.agent.instructions}
|
|
|
16910
16939
|
## Your Colleagues
|
|
16911
16940
|
Below are your direct colleagues. You can reach them via email.
|
|
16912
16941
|
|
|
16913
|
-
**Important:**
|
|
16914
|
-
|
|
16942
|
+
**Important:**
|
|
16943
|
+
- When communicating with a colleague on the previous topics, 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. For a new topic, you can just start a new email.
|
|
16915
16944
|
`;
|
|
16916
16945
|
for (let i = 0;i < task.agent.colleagues.length; i++) {
|
|
16917
16946
|
const c = task.agent.colleagues[i];
|
|
@@ -16921,7 +16950,7 @@ Below are your direct colleagues. You can reach them via email.
|
|
|
16921
16950
|
content += `${c.description}
|
|
16922
16951
|
`;
|
|
16923
16952
|
if (c.instruction)
|
|
16924
|
-
content += `**
|
|
16953
|
+
content += `**When to involve:** ${resolveInstruction(c.instruction, task.agentId)}
|
|
16925
16954
|
`;
|
|
16926
16955
|
if (i < task.agent.colleagues.length - 1)
|
|
16927
16956
|
content += `
|