@alook/cli 0.0.4 → 0.0.6
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 +119 -50
- package/dist/session-runner.js +17017 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -296,7 +296,7 @@ function statusCommand() {
|
|
|
296
296
|
// commands/daemon.ts
|
|
297
297
|
import { Command as Command3 } from "commander";
|
|
298
298
|
import { spawn as spawn2 } from "child_process";
|
|
299
|
-
import { openSync, closeSync, mkdirSync as
|
|
299
|
+
import { openSync as openSync2, closeSync as closeSync2, mkdirSync as mkdirSync4 } from "fs";
|
|
300
300
|
import { dirname as dirname3 } from "path";
|
|
301
301
|
|
|
302
302
|
// ../shared/src/constants.ts
|
|
@@ -13986,6 +13986,12 @@ var UpdateCalendarEventRequestSchema = exports_external.object({
|
|
|
13986
13986
|
message: "occurrence_at must be a valid ISO datetime"
|
|
13987
13987
|
}).optional()
|
|
13988
13988
|
}).refine((v) => v.title !== undefined || v.description !== undefined || v.agent_id !== undefined || v.scheduled_at !== undefined || v.repeat_interval !== undefined || v.repeat_stop_date !== undefined, { message: "at least one field is required" });
|
|
13989
|
+
var DeleteCalendarEventRequestSchema = exports_external.object({
|
|
13990
|
+
scope: exports_external.enum(["this", "following"]).optional(),
|
|
13991
|
+
occurrence_at: exports_external.string().min(1).refine((s) => !Number.isNaN(Date.parse(s)), {
|
|
13992
|
+
message: "occurrence_at must be a valid ISO datetime"
|
|
13993
|
+
}).optional()
|
|
13994
|
+
});
|
|
13989
13995
|
var CalendarEventApiSchema = exports_external.object({
|
|
13990
13996
|
id: exports_external.string(),
|
|
13991
13997
|
agent_id: exports_external.string(),
|
|
@@ -14000,7 +14006,7 @@ var CalendarEventApiSchema = exports_external.object({
|
|
|
14000
14006
|
created_at: exports_external.string(),
|
|
14001
14007
|
updated_at: exports_external.string()
|
|
14002
14008
|
});
|
|
14003
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14009
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/entity.js
|
|
14004
14010
|
var entityKind = Symbol.for("drizzle:entityKind");
|
|
14005
14011
|
var hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
|
14006
14012
|
function is(value, type) {
|
|
@@ -14025,10 +14031,10 @@ function is(value, type) {
|
|
|
14025
14031
|
return false;
|
|
14026
14032
|
}
|
|
14027
14033
|
|
|
14028
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14034
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/table.utils.js
|
|
14029
14035
|
var TableName = Symbol.for("drizzle:Name");
|
|
14030
14036
|
|
|
14031
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14037
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/table.js
|
|
14032
14038
|
var Schema = Symbol.for("drizzle:Schema");
|
|
14033
14039
|
var Columns = Symbol.for("drizzle:Columns");
|
|
14034
14040
|
var ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
|
|
@@ -14066,7 +14072,7 @@ class Table {
|
|
|
14066
14072
|
}
|
|
14067
14073
|
}
|
|
14068
14074
|
|
|
14069
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14075
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/column.js
|
|
14070
14076
|
class Column {
|
|
14071
14077
|
constructor(table, config2) {
|
|
14072
14078
|
this.table = table;
|
|
@@ -14116,7 +14122,7 @@ class Column {
|
|
|
14116
14122
|
}
|
|
14117
14123
|
}
|
|
14118
14124
|
|
|
14119
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14125
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/column-builder.js
|
|
14120
14126
|
class ColumnBuilder {
|
|
14121
14127
|
static [entityKind] = "ColumnBuilder";
|
|
14122
14128
|
config;
|
|
@@ -14172,17 +14178,17 @@ class ColumnBuilder {
|
|
|
14172
14178
|
}
|
|
14173
14179
|
}
|
|
14174
14180
|
|
|
14175
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14181
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/tracing-utils.js
|
|
14176
14182
|
function iife(fn, ...args) {
|
|
14177
14183
|
return fn(...args);
|
|
14178
14184
|
}
|
|
14179
14185
|
|
|
14180
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14186
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/pg-core/unique-constraint.js
|
|
14181
14187
|
function uniqueKeyName(table, columns) {
|
|
14182
14188
|
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
14183
14189
|
}
|
|
14184
14190
|
|
|
14185
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14191
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/pg-core/columns/common.js
|
|
14186
14192
|
class PgColumn extends Column {
|
|
14187
14193
|
constructor(table, config2) {
|
|
14188
14194
|
if (!config2.uniqueName) {
|
|
@@ -14231,7 +14237,7 @@ class ExtraConfigColumn extends PgColumn {
|
|
|
14231
14237
|
}
|
|
14232
14238
|
}
|
|
14233
14239
|
|
|
14234
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14240
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/pg-core/columns/enum.js
|
|
14235
14241
|
class PgEnumObjectColumn extends PgColumn {
|
|
14236
14242
|
static [entityKind] = "PgEnumObjectColumn";
|
|
14237
14243
|
enum;
|
|
@@ -14261,7 +14267,7 @@ class PgEnumColumn extends PgColumn {
|
|
|
14261
14267
|
}
|
|
14262
14268
|
}
|
|
14263
14269
|
|
|
14264
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14270
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/subquery.js
|
|
14265
14271
|
class Subquery {
|
|
14266
14272
|
static [entityKind] = "Subquery";
|
|
14267
14273
|
constructor(sql, fields, alias, isWith = false, usedTables = []) {
|
|
@@ -14276,10 +14282,10 @@ class Subquery {
|
|
|
14276
14282
|
}
|
|
14277
14283
|
}
|
|
14278
14284
|
|
|
14279
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14285
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/version.js
|
|
14280
14286
|
var version2 = "0.45.2";
|
|
14281
14287
|
|
|
14282
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14288
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/tracing.js
|
|
14283
14289
|
var otel;
|
|
14284
14290
|
var rawTracer;
|
|
14285
14291
|
var tracer = {
|
|
@@ -14306,10 +14312,10 @@ var tracer = {
|
|
|
14306
14312
|
}
|
|
14307
14313
|
};
|
|
14308
14314
|
|
|
14309
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14315
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/view-common.js
|
|
14310
14316
|
var ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
|
|
14311
14317
|
|
|
14312
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14318
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sql/sql.js
|
|
14313
14319
|
function isSQLWrapper(value) {
|
|
14314
14320
|
return value !== null && value !== undefined && typeof value.getSQL === "function";
|
|
14315
14321
|
}
|
|
@@ -14669,7 +14675,7 @@ Subquery.prototype.getSQL = function() {
|
|
|
14669
14675
|
return new SQL([this]);
|
|
14670
14676
|
};
|
|
14671
14677
|
|
|
14672
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14678
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/utils.js
|
|
14673
14679
|
function getColumnNameAndConfig(a, b) {
|
|
14674
14680
|
return {
|
|
14675
14681
|
name: typeof a === "string" && a.length > 0 ? a : "",
|
|
@@ -14678,7 +14684,7 @@ function getColumnNameAndConfig(a, b) {
|
|
|
14678
14684
|
}
|
|
14679
14685
|
var textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder;
|
|
14680
14686
|
|
|
14681
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14687
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/foreign-keys.js
|
|
14682
14688
|
class ForeignKeyBuilder {
|
|
14683
14689
|
static [entityKind] = "SQLiteForeignKeyBuilder";
|
|
14684
14690
|
reference;
|
|
@@ -14746,7 +14752,7 @@ function foreignKey(config2) {
|
|
|
14746
14752
|
return new ForeignKeyBuilder(mappedConfig);
|
|
14747
14753
|
}
|
|
14748
14754
|
|
|
14749
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14755
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/unique-constraint.js
|
|
14750
14756
|
function uniqueKeyName2(table, columns) {
|
|
14751
14757
|
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
14752
14758
|
}
|
|
@@ -14791,7 +14797,7 @@ class UniqueConstraint {
|
|
|
14791
14797
|
}
|
|
14792
14798
|
}
|
|
14793
14799
|
|
|
14794
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14800
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/columns/common.js
|
|
14795
14801
|
class SQLiteColumnBuilder extends ColumnBuilder {
|
|
14796
14802
|
static [entityKind] = "SQLiteColumnBuilder";
|
|
14797
14803
|
foreignKeyConfigs = [];
|
|
@@ -14842,7 +14848,7 @@ class SQLiteColumn extends Column {
|
|
|
14842
14848
|
static [entityKind] = "SQLiteColumn";
|
|
14843
14849
|
}
|
|
14844
14850
|
|
|
14845
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14851
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/columns/blob.js
|
|
14846
14852
|
class SQLiteBigIntBuilder extends SQLiteColumnBuilder {
|
|
14847
14853
|
static [entityKind] = "SQLiteBigIntBuilder";
|
|
14848
14854
|
constructor(name) {
|
|
@@ -14930,7 +14936,7 @@ function blob(a, b) {
|
|
|
14930
14936
|
return new SQLiteBlobBufferBuilder(name);
|
|
14931
14937
|
}
|
|
14932
14938
|
|
|
14933
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14939
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/columns/custom.js
|
|
14934
14940
|
class SQLiteCustomColumnBuilder extends SQLiteColumnBuilder {
|
|
14935
14941
|
static [entityKind] = "SQLiteCustomColumnBuilder";
|
|
14936
14942
|
constructor(name, fieldConfig, customTypeParams) {
|
|
@@ -14971,7 +14977,7 @@ function customType(customTypeParams) {
|
|
|
14971
14977
|
};
|
|
14972
14978
|
}
|
|
14973
14979
|
|
|
14974
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
14980
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/columns/integer.js
|
|
14975
14981
|
class SQLiteBaseIntegerBuilder extends SQLiteColumnBuilder {
|
|
14976
14982
|
static [entityKind] = "SQLiteBaseIntegerBuilder";
|
|
14977
14983
|
constructor(name, dataType, columnType) {
|
|
@@ -15073,7 +15079,7 @@ function integer2(a, b) {
|
|
|
15073
15079
|
return new SQLiteIntegerBuilder(name);
|
|
15074
15080
|
}
|
|
15075
15081
|
|
|
15076
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
15082
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/columns/numeric.js
|
|
15077
15083
|
class SQLiteNumericBuilder extends SQLiteColumnBuilder {
|
|
15078
15084
|
static [entityKind] = "SQLiteNumericBuilder";
|
|
15079
15085
|
constructor(name) {
|
|
@@ -15143,7 +15149,7 @@ function numeric(a, b) {
|
|
|
15143
15149
|
return mode === "number" ? new SQLiteNumericNumberBuilder(name) : mode === "bigint" ? new SQLiteNumericBigIntBuilder(name) : new SQLiteNumericBuilder(name);
|
|
15144
15150
|
}
|
|
15145
15151
|
|
|
15146
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
15152
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/columns/real.js
|
|
15147
15153
|
class SQLiteRealBuilder extends SQLiteColumnBuilder {
|
|
15148
15154
|
static [entityKind] = "SQLiteRealBuilder";
|
|
15149
15155
|
constructor(name) {
|
|
@@ -15164,7 +15170,7 @@ function real(name) {
|
|
|
15164
15170
|
return new SQLiteRealBuilder(name ?? "");
|
|
15165
15171
|
}
|
|
15166
15172
|
|
|
15167
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
15173
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/columns/text.js
|
|
15168
15174
|
class SQLiteTextBuilder extends SQLiteColumnBuilder {
|
|
15169
15175
|
static [entityKind] = "SQLiteTextBuilder";
|
|
15170
15176
|
constructor(name, config2) {
|
|
@@ -15219,7 +15225,7 @@ function text(a, b = {}) {
|
|
|
15219
15225
|
return new SQLiteTextBuilder(name, config2);
|
|
15220
15226
|
}
|
|
15221
15227
|
|
|
15222
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
15228
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/columns/all.js
|
|
15223
15229
|
function getSQLiteColumnBuilders() {
|
|
15224
15230
|
return {
|
|
15225
15231
|
blob,
|
|
@@ -15231,7 +15237,7 @@ function getSQLiteColumnBuilders() {
|
|
|
15231
15237
|
};
|
|
15232
15238
|
}
|
|
15233
15239
|
|
|
15234
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
15240
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/table.js
|
|
15235
15241
|
var InlineForeignKeys = Symbol.for("drizzle:SQLiteInlineForeignKeys");
|
|
15236
15242
|
|
|
15237
15243
|
class SQLiteTable extends Table {
|
|
@@ -15265,7 +15271,7 @@ var sqliteTable = (name, columns, extraConfig) => {
|
|
|
15265
15271
|
return sqliteTableBase(name, columns, extraConfig);
|
|
15266
15272
|
};
|
|
15267
15273
|
|
|
15268
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
15274
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/indexes.js
|
|
15269
15275
|
class IndexBuilderOn {
|
|
15270
15276
|
constructor(name, unique2) {
|
|
15271
15277
|
this.name = name;
|
|
@@ -15308,7 +15314,7 @@ function index(name) {
|
|
|
15308
15314
|
return new IndexBuilderOn(name, false);
|
|
15309
15315
|
}
|
|
15310
15316
|
|
|
15311
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.
|
|
15317
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260418.1_@opentelemetry+api@1.9.1_bun-types@1.3.12_kysely@0.28.16/node_modules/drizzle-orm/sqlite-core/primary-keys.js
|
|
15312
15318
|
function primaryKey(...config2) {
|
|
15313
15319
|
if (config2[0].columns) {
|
|
15314
15320
|
return new PrimaryKeyBuilder(config2[0].columns, config2[0].name);
|
|
@@ -15343,13 +15349,13 @@ class PrimaryKey {
|
|
|
15343
15349
|
}
|
|
15344
15350
|
}
|
|
15345
15351
|
|
|
15346
|
-
// ../../node_modules/.pnpm/nanoid@5.1.
|
|
15352
|
+
// ../../node_modules/.pnpm/nanoid@5.1.9/node_modules/nanoid/index.js
|
|
15347
15353
|
import { webcrypto as crypto } from "node:crypto";
|
|
15348
15354
|
|
|
15349
|
-
// ../../node_modules/.pnpm/nanoid@5.1.
|
|
15355
|
+
// ../../node_modules/.pnpm/nanoid@5.1.9/node_modules/nanoid/url-alphabet/index.js
|
|
15350
15356
|
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
15351
15357
|
|
|
15352
|
-
// ../../node_modules/.pnpm/nanoid@5.1.
|
|
15358
|
+
// ../../node_modules/.pnpm/nanoid@5.1.9/node_modules/nanoid/index.js
|
|
15353
15359
|
var POOL_SIZE_MULTIPLIER = 128;
|
|
15354
15360
|
var pool;
|
|
15355
15361
|
var poolOffset;
|
|
@@ -15469,7 +15475,6 @@ var agent = sqliteTable("agent", {
|
|
|
15469
15475
|
tools: text("tools", { mode: "json" }),
|
|
15470
15476
|
triggers: text("triggers", { mode: "json" }),
|
|
15471
15477
|
emailHandle: text("email_handle").unique(),
|
|
15472
|
-
forwardToEmail: text("forward_to_email").default(""),
|
|
15473
15478
|
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
15474
15479
|
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
15475
15480
|
}, (t) => [primaryKey({ columns: [t.id, t.workspaceId] })]);
|
|
@@ -15555,6 +15560,9 @@ var emails = sqliteTable("emails", {
|
|
|
15555
15560
|
r2Key: text("r2_key").notNull(),
|
|
15556
15561
|
isWhitelisted: integer2("is_whitelisted", { mode: "boolean" }).notNull().default(false),
|
|
15557
15562
|
forwarded: integer2("forwarded", { mode: "boolean" }).notNull().default(false),
|
|
15563
|
+
messageId: text("message_id").notNull().default(""),
|
|
15564
|
+
inReplyTo: text("in_reply_to").notNull().default(""),
|
|
15565
|
+
references: text("references").notNull().default(""),
|
|
15558
15566
|
htmlBody: text("html_body").notNull().default(""),
|
|
15559
15567
|
attachments: text("attachments").notNull().default("[]"),
|
|
15560
15568
|
status: text("status").notNull().default("unread"),
|
|
@@ -15679,6 +15687,9 @@ function pidFilePath(profile) {
|
|
|
15679
15687
|
function daemonLogDir() {
|
|
15680
15688
|
return join2(configDir(), "daemon", "logs");
|
|
15681
15689
|
}
|
|
15690
|
+
function sessionRunnerLogDir() {
|
|
15691
|
+
return join2(configDir(), "daemon", "session-runners");
|
|
15692
|
+
}
|
|
15682
15693
|
function daemonLogFilePath(date5 = new Date) {
|
|
15683
15694
|
const y = date5.getFullYear();
|
|
15684
15695
|
const m = String(date5.getMonth() + 1).padStart(2, "0");
|
|
@@ -15782,7 +15793,8 @@ var RAW_DETECTION_METHODS = new Set([
|
|
|
15782
15793
|
"turn/completed",
|
|
15783
15794
|
"thread/started",
|
|
15784
15795
|
"item/started",
|
|
15785
|
-
"item/completed"
|
|
15796
|
+
"item/completed",
|
|
15797
|
+
"item/agentMessage/delta"
|
|
15786
15798
|
]);
|
|
15787
15799
|
|
|
15788
15800
|
// daemon/agent/index.ts
|
|
@@ -15807,7 +15819,7 @@ function fromApiTask(api2) {
|
|
|
15807
15819
|
status: api2.status,
|
|
15808
15820
|
priority: api2.priority,
|
|
15809
15821
|
type: api2.type,
|
|
15810
|
-
agent: api2.agent ? { name: api2.agent.name, instructions: api2.agent.instructions, emailHandle: api2.agent.email_handle ?? undefined, userEmail: api2.agent.user_email ?? undefined } : undefined,
|
|
15822
|
+
agent: api2.agent ? { name: api2.agent.name, instructions: api2.agent.instructions, emailHandle: api2.agent.email_handle ?? undefined, userEmail: api2.agent.user_email ?? undefined, runtimeConfig: api2.agent.runtime_config ?? undefined } : undefined,
|
|
15811
15823
|
repos: undefined,
|
|
15812
15824
|
createdAt: api2.created_at
|
|
15813
15825
|
};
|
|
@@ -15952,9 +15964,12 @@ function releaseDaemonPid(profile) {
|
|
|
15952
15964
|
}
|
|
15953
15965
|
|
|
15954
15966
|
// daemon/daemon.ts
|
|
15967
|
+
import { existsSync, mkdirSync as mkdirSync3, openSync, closeSync, renameSync, readdirSync, statSync, unlinkSync as unlinkSync2 } from "fs";
|
|
15955
15968
|
import { execSync as execSync3, spawn } from "child_process";
|
|
15956
15969
|
import { fileURLToPath } from "url";
|
|
15957
15970
|
import { dirname as dirname2, join as join3 } from "path";
|
|
15971
|
+
var _dir = dirname2(fileURLToPath(import.meta.url));
|
|
15972
|
+
var sessionRunnerPath = existsSync(join3(_dir, "session-runner.js")) ? join3(_dir, "session-runner.js") : join3(_dir, "session-runner.ts");
|
|
15958
15973
|
function isCommandAvailable2(cmd) {
|
|
15959
15974
|
try {
|
|
15960
15975
|
execSync3(`which ${cmd}`, { stdio: "ignore" });
|
|
@@ -15963,7 +15978,34 @@ function isCommandAvailable2(cmd) {
|
|
|
15963
15978
|
return false;
|
|
15964
15979
|
}
|
|
15965
15980
|
}
|
|
15981
|
+
var MAX_SESSION_RUNNER_LOGS = 50;
|
|
15982
|
+
function pruneSessionRunnerLogs() {
|
|
15983
|
+
const logDir = sessionRunnerLogDir();
|
|
15984
|
+
let entries;
|
|
15985
|
+
try {
|
|
15986
|
+
entries = readdirSync(logDir).filter((f) => f.endsWith(".log"));
|
|
15987
|
+
} catch {
|
|
15988
|
+
return;
|
|
15989
|
+
}
|
|
15990
|
+
if (entries.length <= MAX_SESSION_RUNNER_LOGS)
|
|
15991
|
+
return;
|
|
15992
|
+
const withMtime = entries.map((name) => {
|
|
15993
|
+
const full = join3(logDir, name);
|
|
15994
|
+
try {
|
|
15995
|
+
return { name, mtime: statSync(full).mtimeMs };
|
|
15996
|
+
} catch {
|
|
15997
|
+
return { name, mtime: 0 };
|
|
15998
|
+
}
|
|
15999
|
+
});
|
|
16000
|
+
withMtime.sort((a, b) => b.mtime - a.mtime);
|
|
16001
|
+
for (const entry of withMtime.slice(MAX_SESSION_RUNNER_LOGS)) {
|
|
16002
|
+
try {
|
|
16003
|
+
unlinkSync2(join3(logDir, entry.name));
|
|
16004
|
+
} catch {}
|
|
16005
|
+
}
|
|
16006
|
+
}
|
|
15966
16007
|
async function startDaemon(profile, serverUrl) {
|
|
16008
|
+
pruneSessionRunnerLogs();
|
|
15967
16009
|
if (!acquireDaemonPid(profile)) {
|
|
15968
16010
|
process.exit(1);
|
|
15969
16011
|
}
|
|
@@ -16126,14 +16168,22 @@ async function startDaemon(profile, serverUrl) {
|
|
|
16126
16168
|
process.on("SIGINT", shutdown);
|
|
16127
16169
|
await pollCycle();
|
|
16128
16170
|
}
|
|
16129
|
-
var SESSION_RUNNER_PATH = join3(dirname2(fileURLToPath(import.meta.url)), "session-runner.ts");
|
|
16130
16171
|
function spawnSessionRunner(input) {
|
|
16131
16172
|
const encoded = Buffer.from(JSON.stringify(input)).toString("base64");
|
|
16132
|
-
const
|
|
16173
|
+
const logDir = sessionRunnerLogDir();
|
|
16174
|
+
mkdirSync3(logDir, { recursive: true });
|
|
16175
|
+
const tmpLogPath = join3(logDir, `${input.task.id}.log`);
|
|
16176
|
+
const fd = openSync(tmpLogPath, "a");
|
|
16177
|
+
const child = spawn(process.execPath, [sessionRunnerPath, encoded], {
|
|
16133
16178
|
detached: true,
|
|
16134
|
-
stdio: "ignore"
|
|
16179
|
+
stdio: ["ignore", fd, fd]
|
|
16135
16180
|
});
|
|
16136
16181
|
child.unref();
|
|
16182
|
+
closeSync(fd);
|
|
16183
|
+
if (child.pid) {
|
|
16184
|
+
const pidLogPath = join3(logDir, `${child.pid}.log`);
|
|
16185
|
+
renameSync(tmpLogPath, pidLogPath);
|
|
16186
|
+
}
|
|
16137
16187
|
return child;
|
|
16138
16188
|
}
|
|
16139
16189
|
async function handleTask(client, config2, runtimeIndex, task, token, activeTasks) {
|
|
@@ -16153,7 +16203,9 @@ async function handleTask(client, config2, runtimeIndex, task, token, activeTask
|
|
|
16153
16203
|
}
|
|
16154
16204
|
const provider = runtimeData.provider;
|
|
16155
16205
|
const cliPath = provider === "claude" ? config2.claudePath : provider === "codex" ? config2.codexPath : config2.opencodePath;
|
|
16156
|
-
const
|
|
16206
|
+
const configModel = provider === "claude" ? config2.claudeModel : provider === "codex" ? config2.codexModel : config2.opencodeModel;
|
|
16207
|
+
const agentModel = task.agent?.runtimeConfig?.model;
|
|
16208
|
+
const model = typeof agentModel === "string" && agentModel ? agentModel : configModel;
|
|
16157
16209
|
const input = {
|
|
16158
16210
|
task,
|
|
16159
16211
|
provider,
|
|
@@ -16204,14 +16256,14 @@ async function startInBackground(profile, serverUrl) {
|
|
|
16204
16256
|
return;
|
|
16205
16257
|
}
|
|
16206
16258
|
const logPath = daemonLogFilePath();
|
|
16207
|
-
|
|
16208
|
-
const logFd =
|
|
16259
|
+
mkdirSync4(dirname3(logPath), { recursive: true, mode: 448 });
|
|
16260
|
+
const logFd = openSync2(logPath, "a", 384);
|
|
16209
16261
|
const child = spawn2(process.execPath, buildChildArgs(profile, serverUrl), {
|
|
16210
16262
|
detached: true,
|
|
16211
16263
|
stdio: ["ignore", logFd, logFd]
|
|
16212
16264
|
});
|
|
16213
16265
|
child.unref();
|
|
16214
|
-
|
|
16266
|
+
closeSync2(logFd);
|
|
16215
16267
|
const pid = await waitForPidFile(profile);
|
|
16216
16268
|
if (pid != null) {
|
|
16217
16269
|
console.log(`Daemon started (pid=${pid})`);
|
|
@@ -16314,7 +16366,7 @@ function configCommand() {
|
|
|
16314
16366
|
|
|
16315
16367
|
// commands/email.ts
|
|
16316
16368
|
import { Command as Command5 } from "commander";
|
|
16317
|
-
import { writeFileSync as writeFileSync3, mkdirSync as
|
|
16369
|
+
import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync5, readFileSync as readFileSync3, statSync as statSync2 } from "fs";
|
|
16318
16370
|
import { basename, join as join4 } from "path";
|
|
16319
16371
|
import PostalMime from "postal-mime";
|
|
16320
16372
|
var VALID_STATUSES = ["unread", "read", "archived"];
|
|
@@ -16388,18 +16440,21 @@ function emailCommand() {
|
|
|
16388
16440
|
printJSON(emails2);
|
|
16389
16441
|
return;
|
|
16390
16442
|
}
|
|
16391
|
-
|
|
16443
|
+
mkdirSync5(EMAIL_DIR, { recursive: true });
|
|
16392
16444
|
const downloadedPaths = [];
|
|
16393
16445
|
for (const email3 of emails2) {
|
|
16394
16446
|
const emailDir = join4(EMAIL_DIR, email3.id);
|
|
16395
|
-
|
|
16447
|
+
mkdirSync5(emailDir, { recursive: true });
|
|
16396
16448
|
const metadata = {
|
|
16397
16449
|
id: email3.id,
|
|
16398
16450
|
from: email3.from_email,
|
|
16399
16451
|
to: email3.to_email,
|
|
16400
16452
|
subject: email3.subject,
|
|
16401
16453
|
date: email3.created_at,
|
|
16402
|
-
status: email3.status
|
|
16454
|
+
status: email3.status,
|
|
16455
|
+
message_id: email3.message_id || "",
|
|
16456
|
+
in_reply_to: email3.in_reply_to || "",
|
|
16457
|
+
references: email3.references || ""
|
|
16403
16458
|
};
|
|
16404
16459
|
const metadataPath = join4(emailDir, "metadata.json");
|
|
16405
16460
|
writeFileSync3(metadataPath, JSON.stringify(metadata, null, 2));
|
|
@@ -16428,7 +16483,7 @@ function emailCommand() {
|
|
|
16428
16483
|
}
|
|
16429
16484
|
if (parsed.attachments && parsed.attachments.length > 0) {
|
|
16430
16485
|
const attDir = join4(emailDir, "attachments");
|
|
16431
|
-
|
|
16486
|
+
mkdirSync5(attDir, { recursive: true });
|
|
16432
16487
|
const usedFilenames = new Set;
|
|
16433
16488
|
for (let i = 0;i < parsed.attachments.length; i++) {
|
|
16434
16489
|
const att = parsed.attachments[i];
|
|
@@ -16478,7 +16533,7 @@ function emailCommand() {
|
|
|
16478
16533
|
process.exit(1);
|
|
16479
16534
|
}
|
|
16480
16535
|
});
|
|
16481
|
-
cmd.command("send").description("Send an email from the agent").requiredOption("--agent_id <id>", "Agent ID").requiredOption("--to <addr>", "Recipient email address").requiredOption("--subject <s>", "Subject line").requiredOption("--body-file <path>", "Path to HTML body file").option("--attachment <path>", "Path to a file to attach (repeatable)", collectRepeated, []).option("--workspace <id>", "Workspace ID").action(async (opts, command) => {
|
|
16536
|
+
cmd.command("send").description("Send an email from the agent").requiredOption("--agent_id <id>", "Agent ID").requiredOption("--to <addr>", "Recipient email address").requiredOption("--subject <s>", "Subject line").requiredOption("--body-file <path>", "Path to HTML body file").option("--in-reply-to <emailId>", "Email ID to reply to (sets threading headers)").option("--attachment <path>", "Path to a file to attach (repeatable)", collectRepeated, []).option("--workspace <id>", "Workspace ID").action(async (opts, command) => {
|
|
16482
16537
|
const { serverUrl, token, workspaceId } = resolveClientOpts(command, {
|
|
16483
16538
|
workspace: opts.workspace,
|
|
16484
16539
|
agentId: opts.agent_id
|
|
@@ -16503,7 +16558,7 @@ function emailCommand() {
|
|
|
16503
16558
|
let size;
|
|
16504
16559
|
try {
|
|
16505
16560
|
bytes = readFileSync3(path);
|
|
16506
|
-
size =
|
|
16561
|
+
size = statSync2(path).size;
|
|
16507
16562
|
} catch (err) {
|
|
16508
16563
|
console.error(`Error: cannot read attachment "${path}": ${err instanceof Error ? err.message : err}`);
|
|
16509
16564
|
process.exit(1);
|
|
@@ -16520,12 +16575,26 @@ function emailCommand() {
|
|
|
16520
16575
|
contentType: uploaded.contentType ?? contentType
|
|
16521
16576
|
});
|
|
16522
16577
|
}
|
|
16578
|
+
let inReplyTo;
|
|
16579
|
+
let references;
|
|
16580
|
+
if (opts.inReplyTo) {
|
|
16581
|
+
try {
|
|
16582
|
+
const parentEmail = await client.getJSON(`/api/email/${opts.inReplyTo}`);
|
|
16583
|
+
if (parentEmail.message_id) {
|
|
16584
|
+
inReplyTo = parentEmail.message_id;
|
|
16585
|
+
references = [parentEmail.references, parentEmail.message_id].filter(Boolean).join(" ").trim() || undefined;
|
|
16586
|
+
}
|
|
16587
|
+
} catch {
|
|
16588
|
+
console.warn(`Warning: could not fetch parent email ${opts.inReplyTo}, sending without threading`);
|
|
16589
|
+
}
|
|
16590
|
+
}
|
|
16523
16591
|
const res = await client.postJSON("/api/email/send", {
|
|
16524
16592
|
agentId: opts.agent_id,
|
|
16525
16593
|
to: opts.to,
|
|
16526
16594
|
subject: opts.subject,
|
|
16527
16595
|
htmlBody,
|
|
16528
|
-
attachments
|
|
16596
|
+
attachments,
|
|
16597
|
+
...inReplyTo ? { inReplyTo, references } : {}
|
|
16529
16598
|
});
|
|
16530
16599
|
console.log(`Sent email to ${res.to_email} (id: ${res.id})`);
|
|
16531
16600
|
} catch (err) {
|