@alook/daemon 0.1.47 → 0.1.48
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/cli/index.js +70 -51
- package/dist/index.js +66 -46
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -23492,6 +23492,7 @@ __export(exports_community_schema, {
|
|
|
23492
23492
|
communityMessageTag: () => communityMessageTag,
|
|
23493
23493
|
communityMessageSeq: () => communityMessageSeq,
|
|
23494
23494
|
communityMessageMark: () => communityMessageMark,
|
|
23495
|
+
communityMessageAttachment: () => communityMessageAttachment,
|
|
23495
23496
|
communityMessage: () => communityMessage,
|
|
23496
23497
|
communityMention: () => communityMention,
|
|
23497
23498
|
communityFriendship: () => communityFriendship,
|
|
@@ -23667,11 +23668,7 @@ var communityReaction = sqliteTable("community_reaction", {
|
|
|
23667
23668
|
]);
|
|
23668
23669
|
var communityAttachment = sqliteTable("community_attachment", {
|
|
23669
23670
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
23670
|
-
messageId: text("message_id").references(() => communityMessage.id, {
|
|
23671
|
-
onDelete: "cascade"
|
|
23672
|
-
}),
|
|
23673
23671
|
uploaderId: text("uploader_id").notNull(),
|
|
23674
|
-
targetId: text("target_id").notNull(),
|
|
23675
23672
|
r2Key: text("r2_key").notNull(),
|
|
23676
23673
|
thumbnailR2Key: text("thumbnail_r2_key"),
|
|
23677
23674
|
filename: text("filename").notNull(),
|
|
@@ -23679,10 +23676,20 @@ var communityAttachment = sqliteTable("community_attachment", {
|
|
|
23679
23676
|
size: integer2("size"),
|
|
23680
23677
|
width: integer2("width"),
|
|
23681
23678
|
height: integer2("height"),
|
|
23682
|
-
position: integer2("position"),
|
|
23683
23679
|
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
23684
23680
|
}, (t) => [
|
|
23685
|
-
index("
|
|
23681
|
+
index("idx_attachment_uploader").on(t.uploaderId),
|
|
23682
|
+
index("idx_attachment_r2_key").on(t.r2Key),
|
|
23683
|
+
index("idx_attachment_thumbnail_r2_key").on(t.thumbnailR2Key)
|
|
23684
|
+
]);
|
|
23685
|
+
var communityMessageAttachment = sqliteTable("community_message_attachment", {
|
|
23686
|
+
messageId: text("message_id").notNull().references(() => communityMessage.id, { onDelete: "cascade" }),
|
|
23687
|
+
attachmentId: text("attachment_id").notNull().references(() => communityAttachment.id, { onDelete: "restrict" }),
|
|
23688
|
+
position: integer2("position").notNull()
|
|
23689
|
+
}, (t) => [
|
|
23690
|
+
primaryKey({ columns: [t.messageId, t.attachmentId] }),
|
|
23691
|
+
unique("uq_message_attachment_position").on(t.messageId, t.position),
|
|
23692
|
+
index("idx_message_attachment_file").on(t.attachmentId, t.messageId)
|
|
23686
23693
|
]);
|
|
23687
23694
|
var communityPin = sqliteTable("community_pin", {
|
|
23688
23695
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
@@ -23804,6 +23811,41 @@ var communityMessageTag = sqliteTable("community_message_tag", {
|
|
|
23804
23811
|
index("idx_message_tag_tag").on(t.tag, t.messageId)
|
|
23805
23812
|
]);
|
|
23806
23813
|
|
|
23814
|
+
// ../shared/src/db/queries/_chunk.ts
|
|
23815
|
+
var D1_MAX_BIND_PARAMS = 100;
|
|
23816
|
+
function maxInParams(fixedParams) {
|
|
23817
|
+
if (!Number.isInteger(fixedParams) || fixedParams < 0) {
|
|
23818
|
+
throw new Error("fixed params must be a non-negative integer");
|
|
23819
|
+
}
|
|
23820
|
+
if (fixedParams >= D1_MAX_BIND_PARAMS) {
|
|
23821
|
+
throw new Error("fixed params must leave room for at least one IN parameter");
|
|
23822
|
+
}
|
|
23823
|
+
return D1_MAX_BIND_PARAMS - fixedParams;
|
|
23824
|
+
}
|
|
23825
|
+
function maxRowsPerInsert(paramsPerRow) {
|
|
23826
|
+
if (paramsPerRow < 1)
|
|
23827
|
+
throw new Error("paramsPerRow must be >= 1");
|
|
23828
|
+
return Math.floor(D1_MAX_BIND_PARAMS / paramsPerRow);
|
|
23829
|
+
}
|
|
23830
|
+
|
|
23831
|
+
// ../shared/src/db/queries/community/channel.ts
|
|
23832
|
+
var CHANNEL_COLUMNS = {
|
|
23833
|
+
id: communityChannel.id,
|
|
23834
|
+
serverId: communityChannel.serverId,
|
|
23835
|
+
categoryId: communityChannel.categoryId,
|
|
23836
|
+
name: communityChannel.name,
|
|
23837
|
+
type: communityChannel.type,
|
|
23838
|
+
topic: communityChannel.topic,
|
|
23839
|
+
position: communityChannel.position,
|
|
23840
|
+
parentChannelId: communityChannel.parentChannelId,
|
|
23841
|
+
creatorId: communityChannel.creatorId,
|
|
23842
|
+
messageCount: communityChannel.messageCount,
|
|
23843
|
+
archived: communityChannel.archived,
|
|
23844
|
+
parentMessageId: communityChannel.parentMessageId,
|
|
23845
|
+
lastMessageAt: communityChannel.lastMessageAt,
|
|
23846
|
+
createdAt: communityChannel.createdAt
|
|
23847
|
+
};
|
|
23848
|
+
|
|
23807
23849
|
// ../shared/src/logger.ts
|
|
23808
23850
|
var LEVELS = {
|
|
23809
23851
|
debug: 0,
|
|
@@ -23884,23 +23926,6 @@ function createLogger(opts) {
|
|
|
23884
23926
|
return new Logger(opts);
|
|
23885
23927
|
}
|
|
23886
23928
|
|
|
23887
|
-
// ../shared/src/db/queries/_chunk.ts
|
|
23888
|
-
var D1_MAX_BIND_PARAMS = 100;
|
|
23889
|
-
function maxInParams(fixedParams) {
|
|
23890
|
-
if (!Number.isInteger(fixedParams) || fixedParams < 0) {
|
|
23891
|
-
throw new Error("fixed params must be a non-negative integer");
|
|
23892
|
-
}
|
|
23893
|
-
if (fixedParams >= D1_MAX_BIND_PARAMS) {
|
|
23894
|
-
throw new Error("fixed params must leave room for at least one IN parameter");
|
|
23895
|
-
}
|
|
23896
|
-
return D1_MAX_BIND_PARAMS - fixedParams;
|
|
23897
|
-
}
|
|
23898
|
-
function maxRowsPerInsert(paramsPerRow) {
|
|
23899
|
-
if (paramsPerRow < 1)
|
|
23900
|
-
throw new Error("paramsPerRow must be >= 1");
|
|
23901
|
-
return Math.floor(D1_MAX_BIND_PARAMS / paramsPerRow);
|
|
23902
|
-
}
|
|
23903
|
-
|
|
23904
23929
|
// ../shared/src/db/queries/community/message.ts
|
|
23905
23930
|
var log = createLogger({ service: "community-queries" });
|
|
23906
23931
|
var messageProjection = {
|
|
@@ -23999,24 +24024,6 @@ var userProductPlan = sqliteTable("user_product_plan", {
|
|
|
23999
24024
|
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
24000
24025
|
}, (t) => [index("idx_user_product_plan_plan").on(t.planId)]);
|
|
24001
24026
|
|
|
24002
|
-
// ../shared/src/db/queries/community/channel.ts
|
|
24003
|
-
var CHANNEL_COLUMNS = {
|
|
24004
|
-
id: communityChannel.id,
|
|
24005
|
-
serverId: communityChannel.serverId,
|
|
24006
|
-
categoryId: communityChannel.categoryId,
|
|
24007
|
-
name: communityChannel.name,
|
|
24008
|
-
type: communityChannel.type,
|
|
24009
|
-
topic: communityChannel.topic,
|
|
24010
|
-
position: communityChannel.position,
|
|
24011
|
-
parentChannelId: communityChannel.parentChannelId,
|
|
24012
|
-
creatorId: communityChannel.creatorId,
|
|
24013
|
-
messageCount: communityChannel.messageCount,
|
|
24014
|
-
archived: communityChannel.archived,
|
|
24015
|
-
parentMessageId: communityChannel.parentMessageId,
|
|
24016
|
-
lastMessageAt: communityChannel.lastMessageAt,
|
|
24017
|
-
createdAt: communityChannel.createdAt
|
|
24018
|
-
};
|
|
24019
|
-
|
|
24020
24027
|
// ../shared/src/db/queries/community/thread.ts
|
|
24021
24028
|
var NOTIFY_CONFLICT_TARGET = [
|
|
24022
24029
|
communityChannelMember.channelId,
|
|
@@ -25170,7 +25177,8 @@ function createProxyServerApi(config2) {
|
|
|
25170
25177
|
form.append("width", String(req.width));
|
|
25171
25178
|
if (req.height !== undefined)
|
|
25172
25179
|
form.append("height", String(req.height));
|
|
25173
|
-
const
|
|
25180
|
+
const query = req.target === undefined ? "" : `?target=${encodeURIComponent(req.target)}`;
|
|
25181
|
+
const url2 = `${base}/api/community/channels/${REF_PLACEHOLDER_ID}/attachments${query}`;
|
|
25174
25182
|
const res = await fetchImpl(url2, {
|
|
25175
25183
|
method: "POST",
|
|
25176
25184
|
headers: { authorization: `Bearer ${config2.voucher}` },
|
|
@@ -38494,9 +38502,9 @@ function cliCommandsSection() {
|
|
|
38494
38502
|
"### Messaging",
|
|
38495
38503
|
"",
|
|
38496
38504
|
`1. \`${CLI} inbox pull\` — fetch unread messages and advance their read waterlines.`,
|
|
38497
|
-
`2. \`${CLI} message send --target <ref> --remind-after <0|Nm|Nh> --stdin\` — send to a ` + `channel, DM, or thread. ` + `The body is required through \`--stdin\` and limited to 1 KiB of UTF-8. ` + `Attach
|
|
38498
|
-
`3. \`${CLI} message attachment upload --
|
|
38499
|
-
`4. \`${CLI} message attachment download --id <id> [--out <path>]\` — download
|
|
38505
|
+
`2. \`${CLI} message send --target <ref> --remind-after <0|Nm|Nh> --stdin\` — send to a ` + `channel, DM, or thread. ` + `The body is required through \`--stdin\` and limited to 1 KiB of UTF-8. ` + `Attach files with \`--attachment <id>\` (repeatable, order matters). ` + `\`--remind-after\` accepts \`0\`, or a whole-number duration from \`1m\` to \`24h\`.`,
|
|
38506
|
+
`3. \`${CLI} message attachment upload --file <path>\` — upload a local file and get a reusable attachment ID.`,
|
|
38507
|
+
`4. \`${CLI} message attachment download --id <id> [--out <path>]\` — download an attachment you can read, including your own unsent uploads.`,
|
|
38500
38508
|
`5. \`${CLI} message property set --target <full-message-ref> --json <json>\` — add a supported property value to a message.`,
|
|
38501
38509
|
`6. \`${CLI} message property list --target <full-message-ref>\` — list the message's current properties and supported capabilities.`,
|
|
38502
38510
|
`7. \`${CLI} message property remove --target <full-message-ref> --json <json>\` — remove a supported property value from a message.`,
|
|
@@ -38557,7 +38565,8 @@ function messagingSection() {
|
|
|
38557
38565
|
"#### Sending mechanics",
|
|
38558
38566
|
"",
|
|
38559
38567
|
`- Send body: use \`${CLI} message send --target <ref> --remind-after T --stdin\` with the ` + "quoted-heredoc form under *Message formatting*.",
|
|
38560
|
-
`- Long detail: upload it with \`${CLI} message attachment upload --
|
|
38568
|
+
`- Long detail: upload it with \`${CLI} message attachment upload --file <path>.md\`; ` + "add the returned id as `--attachment <id>` on the short stdin send.",
|
|
38569
|
+
"- Reuse files: to forward an attachment or send the same file again, pass its existing ID with `--attachment <id>`. " + "Do not download and upload it again. Reuse works across channels, DMs, and threads while you can still read the file. " + "Upload only a new or changed file.",
|
|
38561
38570
|
`- Cite a specific message: add \`--reply "#37"\` — \`--reply\` takes the \`#N\` seq ` + "(within `--target`) of the message you're answering.",
|
|
38562
38571
|
"",
|
|
38563
38572
|
"Reply where the message came from. Post results in the channel that owns the topic. " + "When uncertain, read history (below) or DM the relevant people.",
|
|
@@ -38673,7 +38682,19 @@ function utilsSection() {
|
|
|
38673
38682
|
"",
|
|
38674
38683
|
"### Join a new server",
|
|
38675
38684
|
"",
|
|
38676
|
-
`If a message contains a \`/c/invite/...\` link, just run \`${CLI} server join --invite <link>\`. ` + "The server enforces owner-only: it accepts only invites your owner created and rejects the " + "rest with a reason. Safe to attempt without reasoning about who sent it."
|
|
38685
|
+
`If a message contains a \`/c/invite/...\` link, just run \`${CLI} server join --invite <link>\`. ` + "The server enforces owner-only: it accepts only invites your owner created and rejects the " + "rest with a reason. Safe to attempt without reasoning about who sent it.",
|
|
38686
|
+
"",
|
|
38687
|
+
"### Answer questions about Alook itself",
|
|
38688
|
+
"",
|
|
38689
|
+
"Alook frontend source code: https://github.com/alookai/alook/tree/main/src/web/src",
|
|
38690
|
+
"",
|
|
38691
|
+
"Only when a user specifically asks for Alook product guidance or clarification about " + "the product, read the relevant frontend code before answering. " + "Check the page, visible labels, and interaction handlers to verify the steps.",
|
|
38692
|
+
"",
|
|
38693
|
+
"Give clear UI click instructions in the user's language. Start with the page they are on. " + "Use simple positions such as top-left or left sidebar, visible icons, and button labels " + "to identify exactly where to click. Explain each click in order and what appears next. " + "Keep frontend code names and layout terms out of the user's instructions.",
|
|
38694
|
+
"",
|
|
38695
|
+
'Bad: "Click thisReactButton, on the same layer as serverRailContainer."',
|
|
38696
|
+
"",
|
|
38697
|
+
'Good: "From the channel chat page in XX server, look at the top-left corner. Click the ' + "Home button with the Alook logo. After Home opens, click My Bots near the top-left " + 'of the left sidebar."'
|
|
38677
38698
|
].join(`
|
|
38678
38699
|
`);
|
|
38679
38700
|
}
|
|
@@ -47007,8 +47028,6 @@ async function cmdAttachmentUpload(opts) {
|
|
|
47007
47028
|
const agent2 = agentId(opts);
|
|
47008
47029
|
const target2 = opts.target;
|
|
47009
47030
|
const filePath = opts.file;
|
|
47010
|
-
if (!target2)
|
|
47011
|
-
throw new CliError("message attachment upload: --target <ref> is required");
|
|
47012
47031
|
if (!filePath)
|
|
47013
47032
|
throw new CliError("message attachment upload: --file <path> is required");
|
|
47014
47033
|
const fs13 = await import("fs/promises");
|
|
@@ -47045,7 +47064,7 @@ async function cmdAttachmentUpload(opts) {
|
|
|
47045
47064
|
}
|
|
47046
47065
|
const result = await api2.attachmentUpload({
|
|
47047
47066
|
agentId: agent2,
|
|
47048
|
-
target: target2,
|
|
47067
|
+
...target2 !== undefined ? { target: target2 } : {},
|
|
47049
47068
|
file: { data: new Uint8Array(bytes), filename, contentType },
|
|
47050
47069
|
...thumbnail ? { thumbnail } : {},
|
|
47051
47070
|
...width !== undefined ? { width } : {},
|
|
@@ -47329,7 +47348,7 @@ function buildProgram(stdin) {
|
|
|
47329
47348
|
});
|
|
47330
47349
|
const attachment = message2.command("attachment").description("attachment operations").exitOverride();
|
|
47331
47350
|
attachment.configureOutput({ writeOut: () => {}, writeErr: () => {} });
|
|
47332
|
-
attachment.command("upload").description("upload a local file
|
|
47351
|
+
attachment.command("upload").description("upload a local file and get its reusable attachment id").option("--target <ref>", "optional legacy target (channel, DM, or thread ref)").option("--file <path>", "local file to upload").exitOverride().configureOutput({ writeOut: () => {}, writeErr: () => {} }).action(async function() {
|
|
47333
47352
|
const localOpts = this.opts();
|
|
47334
47353
|
const globalOpts = program.opts();
|
|
47335
47354
|
const result = await cmdAttachmentUpload({ ...globalOpts, ...localOpts });
|
package/dist/index.js
CHANGED
|
@@ -12257,9 +12257,9 @@ function cliCommandsSection() {
|
|
|
12257
12257
|
"### Messaging",
|
|
12258
12258
|
"",
|
|
12259
12259
|
`1. \`${CLI} inbox pull\` — fetch unread messages and advance their read waterlines.`,
|
|
12260
|
-
`2. \`${CLI} message send --target <ref> --remind-after <0|Nm|Nh> --stdin\` — send to a ` + `channel, DM, or thread. ` + `The body is required through \`--stdin\` and limited to 1 KiB of UTF-8. ` + `Attach
|
|
12261
|
-
`3. \`${CLI} message attachment upload --
|
|
12262
|
-
`4. \`${CLI} message attachment download --id <id> [--out <path>]\` — download
|
|
12260
|
+
`2. \`${CLI} message send --target <ref> --remind-after <0|Nm|Nh> --stdin\` — send to a ` + `channel, DM, or thread. ` + `The body is required through \`--stdin\` and limited to 1 KiB of UTF-8. ` + `Attach files with \`--attachment <id>\` (repeatable, order matters). ` + `\`--remind-after\` accepts \`0\`, or a whole-number duration from \`1m\` to \`24h\`.`,
|
|
12261
|
+
`3. \`${CLI} message attachment upload --file <path>\` — upload a local file and get a reusable attachment ID.`,
|
|
12262
|
+
`4. \`${CLI} message attachment download --id <id> [--out <path>]\` — download an attachment you can read, including your own unsent uploads.`,
|
|
12263
12263
|
`5. \`${CLI} message property set --target <full-message-ref> --json <json>\` — add a supported property value to a message.`,
|
|
12264
12264
|
`6. \`${CLI} message property list --target <full-message-ref>\` — list the message's current properties and supported capabilities.`,
|
|
12265
12265
|
`7. \`${CLI} message property remove --target <full-message-ref> --json <json>\` — remove a supported property value from a message.`,
|
|
@@ -12320,7 +12320,8 @@ function messagingSection() {
|
|
|
12320
12320
|
"#### Sending mechanics",
|
|
12321
12321
|
"",
|
|
12322
12322
|
`- Send body: use \`${CLI} message send --target <ref> --remind-after T --stdin\` with the ` + "quoted-heredoc form under *Message formatting*.",
|
|
12323
|
-
`- Long detail: upload it with \`${CLI} message attachment upload --
|
|
12323
|
+
`- Long detail: upload it with \`${CLI} message attachment upload --file <path>.md\`; ` + "add the returned id as `--attachment <id>` on the short stdin send.",
|
|
12324
|
+
"- Reuse files: to forward an attachment or send the same file again, pass its existing ID with `--attachment <id>`. " + "Do not download and upload it again. Reuse works across channels, DMs, and threads while you can still read the file. " + "Upload only a new or changed file.",
|
|
12324
12325
|
`- Cite a specific message: add \`--reply "#37"\` — \`--reply\` takes the \`#N\` seq ` + "(within `--target`) of the message you're answering.",
|
|
12325
12326
|
"",
|
|
12326
12327
|
"Reply where the message came from. Post results in the channel that owns the topic. " + "When uncertain, read history (below) or DM the relevant people.",
|
|
@@ -12436,7 +12437,19 @@ function utilsSection() {
|
|
|
12436
12437
|
"",
|
|
12437
12438
|
"### Join a new server",
|
|
12438
12439
|
"",
|
|
12439
|
-
`If a message contains a \`/c/invite/...\` link, just run \`${CLI} server join --invite <link>\`. ` + "The server enforces owner-only: it accepts only invites your owner created and rejects the " + "rest with a reason. Safe to attempt without reasoning about who sent it."
|
|
12440
|
+
`If a message contains a \`/c/invite/...\` link, just run \`${CLI} server join --invite <link>\`. ` + "The server enforces owner-only: it accepts only invites your owner created and rejects the " + "rest with a reason. Safe to attempt without reasoning about who sent it.",
|
|
12441
|
+
"",
|
|
12442
|
+
"### Answer questions about Alook itself",
|
|
12443
|
+
"",
|
|
12444
|
+
"Alook frontend source code: https://github.com/alookai/alook/tree/main/src/web/src",
|
|
12445
|
+
"",
|
|
12446
|
+
"Only when a user specifically asks for Alook product guidance or clarification about " + "the product, read the relevant frontend code before answering. " + "Check the page, visible labels, and interaction handlers to verify the steps.",
|
|
12447
|
+
"",
|
|
12448
|
+
"Give clear UI click instructions in the user's language. Start with the page they are on. " + "Use simple positions such as top-left or left sidebar, visible icons, and button labels " + "to identify exactly where to click. Explain each click in order and what appears next. " + "Keep frontend code names and layout terms out of the user's instructions.",
|
|
12449
|
+
"",
|
|
12450
|
+
'Bad: "Click thisReactButton, on the same layer as serverRailContainer."',
|
|
12451
|
+
"",
|
|
12452
|
+
'Good: "From the channel chat page in XX server, look at the top-left corner. Click the ' + "Home button with the Alook logo. After Home opens, click My Bots near the top-left " + 'of the left sidebar."'
|
|
12440
12453
|
].join(`
|
|
12441
12454
|
`);
|
|
12442
12455
|
}
|
|
@@ -38912,6 +38925,7 @@ __export(exports_community_schema, {
|
|
|
38912
38925
|
communityMessageTag: () => communityMessageTag,
|
|
38913
38926
|
communityMessageSeq: () => communityMessageSeq,
|
|
38914
38927
|
communityMessageMark: () => communityMessageMark,
|
|
38928
|
+
communityMessageAttachment: () => communityMessageAttachment,
|
|
38915
38929
|
communityMessage: () => communityMessage,
|
|
38916
38930
|
communityMention: () => communityMention,
|
|
38917
38931
|
communityFriendship: () => communityFriendship,
|
|
@@ -39087,11 +39101,7 @@ var communityReaction = sqliteTable("community_reaction", {
|
|
|
39087
39101
|
]);
|
|
39088
39102
|
var communityAttachment = sqliteTable("community_attachment", {
|
|
39089
39103
|
id: text2("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
39090
|
-
messageId: text2("message_id").references(() => communityMessage.id, {
|
|
39091
|
-
onDelete: "cascade"
|
|
39092
|
-
}),
|
|
39093
39104
|
uploaderId: text2("uploader_id").notNull(),
|
|
39094
|
-
targetId: text2("target_id").notNull(),
|
|
39095
39105
|
r2Key: text2("r2_key").notNull(),
|
|
39096
39106
|
thumbnailR2Key: text2("thumbnail_r2_key"),
|
|
39097
39107
|
filename: text2("filename").notNull(),
|
|
@@ -39099,10 +39109,20 @@ var communityAttachment = sqliteTable("community_attachment", {
|
|
|
39099
39109
|
size: integer2("size"),
|
|
39100
39110
|
width: integer2("width"),
|
|
39101
39111
|
height: integer2("height"),
|
|
39102
|
-
position: integer2("position"),
|
|
39103
39112
|
createdAt: text2("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
39104
39113
|
}, (t) => [
|
|
39105
|
-
index("
|
|
39114
|
+
index("idx_attachment_uploader").on(t.uploaderId),
|
|
39115
|
+
index("idx_attachment_r2_key").on(t.r2Key),
|
|
39116
|
+
index("idx_attachment_thumbnail_r2_key").on(t.thumbnailR2Key)
|
|
39117
|
+
]);
|
|
39118
|
+
var communityMessageAttachment = sqliteTable("community_message_attachment", {
|
|
39119
|
+
messageId: text2("message_id").notNull().references(() => communityMessage.id, { onDelete: "cascade" }),
|
|
39120
|
+
attachmentId: text2("attachment_id").notNull().references(() => communityAttachment.id, { onDelete: "restrict" }),
|
|
39121
|
+
position: integer2("position").notNull()
|
|
39122
|
+
}, (t) => [
|
|
39123
|
+
primaryKey({ columns: [t.messageId, t.attachmentId] }),
|
|
39124
|
+
unique("uq_message_attachment_position").on(t.messageId, t.position),
|
|
39125
|
+
index("idx_message_attachment_file").on(t.attachmentId, t.messageId)
|
|
39106
39126
|
]);
|
|
39107
39127
|
var communityPin = sqliteTable("community_pin", {
|
|
39108
39128
|
id: text2("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
@@ -39224,6 +39244,41 @@ var communityMessageTag = sqliteTable("community_message_tag", {
|
|
|
39224
39244
|
index("idx_message_tag_tag").on(t.tag, t.messageId)
|
|
39225
39245
|
]);
|
|
39226
39246
|
|
|
39247
|
+
// ../shared/src/db/queries/_chunk.ts
|
|
39248
|
+
var D1_MAX_BIND_PARAMS = 100;
|
|
39249
|
+
function maxInParams(fixedParams) {
|
|
39250
|
+
if (!Number.isInteger(fixedParams) || fixedParams < 0) {
|
|
39251
|
+
throw new Error("fixed params must be a non-negative integer");
|
|
39252
|
+
}
|
|
39253
|
+
if (fixedParams >= D1_MAX_BIND_PARAMS) {
|
|
39254
|
+
throw new Error("fixed params must leave room for at least one IN parameter");
|
|
39255
|
+
}
|
|
39256
|
+
return D1_MAX_BIND_PARAMS - fixedParams;
|
|
39257
|
+
}
|
|
39258
|
+
function maxRowsPerInsert(paramsPerRow) {
|
|
39259
|
+
if (paramsPerRow < 1)
|
|
39260
|
+
throw new Error("paramsPerRow must be >= 1");
|
|
39261
|
+
return Math.floor(D1_MAX_BIND_PARAMS / paramsPerRow);
|
|
39262
|
+
}
|
|
39263
|
+
|
|
39264
|
+
// ../shared/src/db/queries/community/channel.ts
|
|
39265
|
+
var CHANNEL_COLUMNS = {
|
|
39266
|
+
id: communityChannel.id,
|
|
39267
|
+
serverId: communityChannel.serverId,
|
|
39268
|
+
categoryId: communityChannel.categoryId,
|
|
39269
|
+
name: communityChannel.name,
|
|
39270
|
+
type: communityChannel.type,
|
|
39271
|
+
topic: communityChannel.topic,
|
|
39272
|
+
position: communityChannel.position,
|
|
39273
|
+
parentChannelId: communityChannel.parentChannelId,
|
|
39274
|
+
creatorId: communityChannel.creatorId,
|
|
39275
|
+
messageCount: communityChannel.messageCount,
|
|
39276
|
+
archived: communityChannel.archived,
|
|
39277
|
+
parentMessageId: communityChannel.parentMessageId,
|
|
39278
|
+
lastMessageAt: communityChannel.lastMessageAt,
|
|
39279
|
+
createdAt: communityChannel.createdAt
|
|
39280
|
+
};
|
|
39281
|
+
|
|
39227
39282
|
// ../shared/src/logger.ts
|
|
39228
39283
|
var LEVELS = {
|
|
39229
39284
|
debug: 0,
|
|
@@ -39304,23 +39359,6 @@ function createLogger2(opts) {
|
|
|
39304
39359
|
return new Logger(opts);
|
|
39305
39360
|
}
|
|
39306
39361
|
|
|
39307
|
-
// ../shared/src/db/queries/_chunk.ts
|
|
39308
|
-
var D1_MAX_BIND_PARAMS = 100;
|
|
39309
|
-
function maxInParams(fixedParams) {
|
|
39310
|
-
if (!Number.isInteger(fixedParams) || fixedParams < 0) {
|
|
39311
|
-
throw new Error("fixed params must be a non-negative integer");
|
|
39312
|
-
}
|
|
39313
|
-
if (fixedParams >= D1_MAX_BIND_PARAMS) {
|
|
39314
|
-
throw new Error("fixed params must leave room for at least one IN parameter");
|
|
39315
|
-
}
|
|
39316
|
-
return D1_MAX_BIND_PARAMS - fixedParams;
|
|
39317
|
-
}
|
|
39318
|
-
function maxRowsPerInsert(paramsPerRow) {
|
|
39319
|
-
if (paramsPerRow < 1)
|
|
39320
|
-
throw new Error("paramsPerRow must be >= 1");
|
|
39321
|
-
return Math.floor(D1_MAX_BIND_PARAMS / paramsPerRow);
|
|
39322
|
-
}
|
|
39323
|
-
|
|
39324
39362
|
// ../shared/src/db/queries/community/message.ts
|
|
39325
39363
|
var log = createLogger2({ service: "community-queries" });
|
|
39326
39364
|
var messageProjection = {
|
|
@@ -39419,24 +39457,6 @@ var userProductPlan = sqliteTable("user_product_plan", {
|
|
|
39419
39457
|
updatedAt: text2("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
39420
39458
|
}, (t) => [index("idx_user_product_plan_plan").on(t.planId)]);
|
|
39421
39459
|
|
|
39422
|
-
// ../shared/src/db/queries/community/channel.ts
|
|
39423
|
-
var CHANNEL_COLUMNS = {
|
|
39424
|
-
id: communityChannel.id,
|
|
39425
|
-
serverId: communityChannel.serverId,
|
|
39426
|
-
categoryId: communityChannel.categoryId,
|
|
39427
|
-
name: communityChannel.name,
|
|
39428
|
-
type: communityChannel.type,
|
|
39429
|
-
topic: communityChannel.topic,
|
|
39430
|
-
position: communityChannel.position,
|
|
39431
|
-
parentChannelId: communityChannel.parentChannelId,
|
|
39432
|
-
creatorId: communityChannel.creatorId,
|
|
39433
|
-
messageCount: communityChannel.messageCount,
|
|
39434
|
-
archived: communityChannel.archived,
|
|
39435
|
-
parentMessageId: communityChannel.parentMessageId,
|
|
39436
|
-
lastMessageAt: communityChannel.lastMessageAt,
|
|
39437
|
-
createdAt: communityChannel.createdAt
|
|
39438
|
-
};
|
|
39439
|
-
|
|
39440
39460
|
// ../shared/src/db/queries/community/thread.ts
|
|
39441
39461
|
var NOTIFY_CONFLICT_TARGET = [
|
|
39442
39462
|
communityChannelMember.channelId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alook/daemon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.48",
|
|
4
4
|
"description": "Alook agent daemon — host-side runtime backend, process manager, credential proxy, and control plane.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/alookai/alook#readme",
|