opencode-swarm-plugin 0.59.5 → 0.60.0
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/README.md +14 -1
- package/bin/commands/doctor.test.ts +622 -0
- package/bin/commands/doctor.ts +658 -0
- package/bin/commands/status.test.ts +506 -0
- package/bin/commands/status.ts +520 -0
- package/bin/commands/tree.ts +39 -3
- package/bin/swarm.ts +19 -3
- package/claude-plugin/dist/index.js +290 -47
- package/claude-plugin/dist/schemas/cell.d.ts +2 -0
- package/claude-plugin/dist/schemas/cell.d.ts.map +1 -1
- package/claude-plugin/dist/utils/git-commit-info.d.ts +10 -0
- package/claude-plugin/dist/utils/git-commit-info.d.ts.map +1 -0
- package/claude-plugin/dist/utils/tree-renderer.d.ts +69 -13
- package/claude-plugin/dist/utils/tree-renderer.d.ts.map +1 -1
- package/dist/bin/swarm.js +1883 -386
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/hive.d.ts +8 -0
- package/dist/hive.d.ts.map +1 -1
- package/dist/hive.js +6 -4
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -16
- package/dist/marketplace/index.js +290 -47
- package/dist/plugin.js +61 -15
- package/dist/replay-tools.d.ts +5 -1
- package/dist/replay-tools.d.ts.map +1 -1
- package/dist/schemas/cell.d.ts +2 -0
- package/dist/schemas/cell.d.ts.map +1 -1
- package/dist/skills.d.ts +4 -0
- package/dist/skills.d.ts.map +1 -1
- package/dist/storage.d.ts +7 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/swarm-orchestrate.d.ts +12 -0
- package/dist/swarm-orchestrate.d.ts.map +1 -1
- package/dist/swarm-prompts.js +61 -15
- package/dist/swarm.d.ts +6 -0
- package/dist/swarm.d.ts.map +1 -1
- package/dist/test-utils/msw-server.d.ts +21 -0
- package/dist/test-utils/msw-server.d.ts.map +1 -0
- package/dist/utils/git-commit-info.d.ts +10 -0
- package/dist/utils/git-commit-info.d.ts.map +1 -0
- package/dist/utils/tree-renderer.d.ts +69 -13
- package/dist/utils/tree-renderer.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -23844,6 +23844,9 @@ class LibSQLAdapter {
|
|
|
23844
23844
|
async close() {
|
|
23845
23845
|
this.client.close();
|
|
23846
23846
|
}
|
|
23847
|
+
async checkpoint() {
|
|
23848
|
+
await this.client.execute("PRAGMA wal_checkpoint(TRUNCATE)");
|
|
23849
|
+
}
|
|
23847
23850
|
}
|
|
23848
23851
|
async function createLibSQLAdapter(config22) {
|
|
23849
23852
|
let url3 = config22.url;
|
|
@@ -23860,6 +23863,7 @@ async function createLibSQLAdapter(config22) {
|
|
|
23860
23863
|
await client.execute("PRAGMA foreign_keys = ON");
|
|
23861
23864
|
await client.execute("PRAGMA busy_timeout = 5000");
|
|
23862
23865
|
await client.execute("PRAGMA journal_mode = WAL");
|
|
23866
|
+
await client.execute("PRAGMA wal_checkpoint(TRUNCATE)");
|
|
23863
23867
|
return new LibSQLAdapter(client);
|
|
23864
23868
|
}
|
|
23865
23869
|
async function createLibSQLMemorySchema(db) {
|
|
@@ -27796,6 +27800,16 @@ function drizzle(...params) {
|
|
|
27796
27800
|
}
|
|
27797
27801
|
return construct(params[0], params[1]);
|
|
27798
27802
|
}
|
|
27803
|
+
function getEmbeddingDimension(model) {
|
|
27804
|
+
const envDim = process.env.OLLAMA_EMBED_DIM;
|
|
27805
|
+
if (envDim) {
|
|
27806
|
+
const parsed = Number.parseInt(envDim, 10);
|
|
27807
|
+
if (!Number.isNaN(parsed) && parsed > 0) {
|
|
27808
|
+
return parsed;
|
|
27809
|
+
}
|
|
27810
|
+
}
|
|
27811
|
+
return MODEL_DIMENSIONS[model] ?? 1024;
|
|
27812
|
+
}
|
|
27799
27813
|
function createDrizzleClient(client) {
|
|
27800
27814
|
return drizzle(client, { schema: exports_schema });
|
|
27801
27815
|
}
|
|
@@ -29495,6 +29509,9 @@ async function withTiming(operation, fn2) {
|
|
|
29495
29509
|
}
|
|
29496
29510
|
}
|
|
29497
29511
|
function getDatabasePath2(projectPath) {
|
|
29512
|
+
if (process.env.SWARM_DB_PATH) {
|
|
29513
|
+
return process.env.SWARM_DB_PATH;
|
|
29514
|
+
}
|
|
29498
29515
|
const globalDir = join12(homedir2(), ".config", "swarm-tools");
|
|
29499
29516
|
if (!existsSync4(globalDir)) {
|
|
29500
29517
|
mkdirSync(globalDir, { recursive: true });
|
|
@@ -30414,12 +30431,18 @@ async function handleCellStatusChangedDrizzle(db2, event) {
|
|
|
30414
30431
|
await db2.update(beads).set(updates).where(eq(beads.id, event.cell_id));
|
|
30415
30432
|
}
|
|
30416
30433
|
async function handleBeadClosedDrizzle(db2, event) {
|
|
30417
|
-
|
|
30434
|
+
const setFields = {
|
|
30418
30435
|
status: "closed",
|
|
30419
30436
|
closed_at: event.timestamp,
|
|
30420
30437
|
closed_reason: event.reason,
|
|
30421
30438
|
updated_at: event.timestamp
|
|
30422
|
-
}
|
|
30439
|
+
};
|
|
30440
|
+
const result = event.result;
|
|
30441
|
+
if (result) {
|
|
30442
|
+
setFields.result = result;
|
|
30443
|
+
setFields.result_at = event.timestamp;
|
|
30444
|
+
}
|
|
30445
|
+
await db2.update(beads).set(setFields).where(eq(beads.id, event.cell_id));
|
|
30423
30446
|
const { invalidateBlockedCacheDrizzle: invalidateBlockedCacheDrizzle2 } = await Promise.resolve().then(() => (init_dependencies_drizzle(), exports_dependencies_drizzle));
|
|
30424
30447
|
await invalidateBlockedCacheDrizzle2(db2, event.project_key, event.cell_id);
|
|
30425
30448
|
}
|
|
@@ -38031,10 +38054,44 @@ async function getRelationshipsForEntity(entityId, db2, direction = "both") {
|
|
|
38031
38054
|
createdAt: new Date(row.created_at)
|
|
38032
38055
|
}));
|
|
38033
38056
|
}
|
|
38057
|
+
function chunkText(text4, maxChars, overlap) {
|
|
38058
|
+
if (text4.length <= maxChars) {
|
|
38059
|
+
return [text4];
|
|
38060
|
+
}
|
|
38061
|
+
const chunks3 = [];
|
|
38062
|
+
let start5 = 0;
|
|
38063
|
+
while (start5 < text4.length) {
|
|
38064
|
+
const end7 = Math.min(start5 + maxChars, text4.length);
|
|
38065
|
+
chunks3.push(text4.slice(start5, end7));
|
|
38066
|
+
start5 += maxChars - overlap;
|
|
38067
|
+
}
|
|
38068
|
+
return chunks3;
|
|
38069
|
+
}
|
|
38034
38070
|
function createMemoryAdapter(db2, config3) {
|
|
38035
38071
|
const store = createMemoryStore(db2);
|
|
38036
38072
|
const ollamaLayer = makeOllamaLive(config3);
|
|
38037
38073
|
const generateEmbedding = async (text4) => {
|
|
38074
|
+
if (text4.length > MAX_CHARS_PER_CHUNK) {
|
|
38075
|
+
console.warn(`⚠️ Text length (${text4.length} chars) exceeds limit (${MAX_CHARS_PER_CHUNK} chars). Auto-chunking into smaller segments for embedding.`);
|
|
38076
|
+
const chunks3 = chunkText(text4, MAX_CHARS_PER_CHUNK, CHUNK_OVERLAP);
|
|
38077
|
+
const embeddings = [];
|
|
38078
|
+
for (const chunk7 of chunks3) {
|
|
38079
|
+
const program2 = exports_Effect.gen(function* () {
|
|
38080
|
+
const ollama = yield* Ollama;
|
|
38081
|
+
return yield* ollama.embed(chunk7);
|
|
38082
|
+
});
|
|
38083
|
+
const result2 = await exports_Effect.runPromise(program2.pipe(exports_Effect.provide(ollamaLayer), exports_Effect.either));
|
|
38084
|
+
if (result2._tag === "Left") {
|
|
38085
|
+
return null;
|
|
38086
|
+
}
|
|
38087
|
+
embeddings.push(result2.right);
|
|
38088
|
+
}
|
|
38089
|
+
const avgEmbedding = embeddings[0].map((_, i) => {
|
|
38090
|
+
const sum8 = embeddings.reduce((acc, emb) => acc + emb[i], 0);
|
|
38091
|
+
return sum8 / embeddings.length;
|
|
38092
|
+
});
|
|
38093
|
+
return avgEmbedding;
|
|
38094
|
+
}
|
|
38038
38095
|
const program = exports_Effect.gen(function* () {
|
|
38039
38096
|
const ollama = yield* Ollama;
|
|
38040
38097
|
return yield* ollama.embed(text4);
|
|
@@ -39666,7 +39723,8 @@ function createHiveAdapter(db2, projectKey) {
|
|
|
39666
39723
|
reason,
|
|
39667
39724
|
closed_by: options2?.closed_by || null,
|
|
39668
39725
|
files_touched: options2?.files_touched || null,
|
|
39669
|
-
duration_ms: options2?.duration_ms || null
|
|
39726
|
+
duration_ms: options2?.duration_ms || null,
|
|
39727
|
+
result: options2?.result || null
|
|
39670
39728
|
};
|
|
39671
39729
|
await appendCellEvent(event, projectPath, db2);
|
|
39672
39730
|
const updated = await getCell(db2, projectKeyParam, cellId);
|
|
@@ -40267,7 +40325,7 @@ async function importSingleCell(adapter5, projectKey, cellExport, options2, resu
|
|
|
40267
40325
|
const status3 = cellExport.status === "tombstone" ? "closed" : cellExport.status;
|
|
40268
40326
|
const isClosed = status3 === "closed";
|
|
40269
40327
|
const closedAt = isClosed ? cellExport.closed_at ? new Date(cellExport.closed_at).getTime() : new Date(cellExport.updated_at).getTime() : null;
|
|
40270
|
-
await db2.query(`INSERT INTO
|
|
40328
|
+
await db2.query(`INSERT INTO beads (
|
|
40271
40329
|
id, project_key, type, status, title, description, priority,
|
|
40272
40330
|
parent_id, assignee, created_at, updated_at, closed_at
|
|
40273
40331
|
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)`, [
|
|
@@ -40832,7 +40890,9 @@ async function findCellsByPartialIdDrizzle(adapter5, projectKey, partialId) {
|
|
|
40832
40890
|
deleted_at: row.deleted_at,
|
|
40833
40891
|
deleted_by: row.deleted_by,
|
|
40834
40892
|
delete_reason: row.delete_reason,
|
|
40835
|
-
created_by: row.created_by
|
|
40893
|
+
created_by: row.created_by,
|
|
40894
|
+
result: row.result ?? null,
|
|
40895
|
+
result_at: row.result_at ?? null
|
|
40836
40896
|
}));
|
|
40837
40897
|
}
|
|
40838
40898
|
async function resolvePartialIdDrizzle(adapter5, projectKey, partialHash) {
|
|
@@ -59951,17 +60011,7 @@ ${prefix}}`;
|
|
|
59951
60011
|
unionAll,
|
|
59952
60012
|
intersect: intersect7,
|
|
59953
60013
|
except
|
|
59954
|
-
}), union17, unionAll, intersect7, except, init_select2, QueryBuilder, init_query_builder2, SQLiteInsertBuilder, SQLiteInsertBase, init_insert, SQLiteUpdateBuilder, SQLiteUpdateBase, init_update, init_query_builders, SQLiteCountBuilder, init_count, RelationalQueryBuilder, SQLiteRelationalQuery, SQLiteSyncRelationalQuery, init_query2, SQLiteRaw, init_raw, BaseSQLiteDatabase, init_db, init_alias2 = () => {}, init_checks3 = () => {}, IndexBuilderOn, IndexBuilder, Index, init_indexes, PrimaryKeyBuilder2, PrimaryKey2, init_primary_keys2, ExecuteResultSync, SQLitePreparedQuery, SQLiteSession, SQLiteTransaction, init_session, init_utils2 = () => {}, init_view = () => {}, init_sqlite_core, LibSQLSession, LibSQLTransaction, LibSQLPreparedQuery, init_session2, LibSQLDatabase, init_driver_core, init_driver, init_libsql2,
|
|
59955
|
-
dataType() {
|
|
59956
|
-
return `F32_BLOB(${dimension})`;
|
|
59957
|
-
},
|
|
59958
|
-
toDriver(value10) {
|
|
59959
|
-
return Buffer.from(new Float32Array(value10).buffer);
|
|
59960
|
-
},
|
|
59961
|
-
fromDriver(value10) {
|
|
59962
|
-
return Array.from(new Float32Array(value10.buffer));
|
|
59963
|
-
}
|
|
59964
|
-
}), memories, memoryLinks, entities, relationships, memoryEntities, init_memory, init_expressions2, exports_drizzle_orm, init_drizzle_orm, exports_streams, eventsTable, agentsTable, messagesTable, messageRecipientsTable, reservationsTable, locksTable, cursorsTable, evalRecordsTable, swarmContextsTable, decisionTracesTable, entityLinksTable, init_streams, exports_hive, beads, cells, cellEvents, beadLabels, cellLabels, beadComments, cellComments, beadDependencies, cellDependencies, blockedBeadsCache, dirtyBeads, schemaVersion, init_hive, exports_schema, init_schema, init_drizzle, require_entity, require_logger, require_query_promise, require_column, require_column_builder, require_table_utils, require_foreign_keys, require_tracing_utils, require_unique_constraint, require_array, require_common2, require_enum, require_subquery, require_version, require_tracing, require_view_common, require_table, require_sql, require_alias, require_selection_proxy, require_utils, require_delete, require_casing, require_errors, require_int_common, require_bigint, require_bigserial, require_boolean, require_char, require_cidr, require_custom, require_date_common, require_date, require_double_precision, require_inet, require_integer, require_interval, require_json, require_jsonb, require_line, require_macaddr, require_macaddr8, require_numeric, require_point, require_utils2, require_geometry, require_real, require_serial, require_smallint, require_smallserial, require_text, require_time, require_timestamp, require_uuid, require_varchar, require_bit, require_halfvec, require_sparsevec, require_vector, require_columns, require_all, require_table2, require_primary_keys, require_conditions, require_select, require_expressions, require_relations, require_aggregate, require_vector2, require_functions, require_sql2, require_view_base, require_dialect, require_query_builder, require_select2, require_query_builder2, require_insert, require_refresh_materialized_view, require_select_types, require_update, require_query_builders, require_count, require_query, require_raw, require_db, require_alias2, require_checks, require_indexes, require_policies, require_roles, require_sequence, require_view_common2, require_view, require_schema, require_session, require_subquery2, require_utils3, require_utils4, require_pg_core, require_session2, require_driver, require_pglite, exports_libsql_convenience, instances, init_libsql_convenience, exports_lock, DurableLock, DurableLockLive, init_lock, exports_reservation_utils, init_reservation_utils, init_projections_drizzle, exports_store_drizzle, init_store_drizzle, exports_swarm_mail, MAX_INBOX_LIMIT = 5, DEFAULT_TTL_SECONDS = 3600, ADJECTIVES, NOUNS, init_swarm_mail, MAX_INBOX_LIMIT2 = 5, DEFAULT_TTL_SECONDS2 = 3600, ADJECTIVES2, NOUNS2, init_agent_mail, exports_migrations, beadsMigration, cellsViewMigration, cellsViewMigrationLibSQL, beadsMigrationLibSQL, beadsMigrations, hiveMigrations, sessionsMigrationLibSQL, hiveMigrationsLibSQL, init_migrations, memoryMigration, memoryMigrations, init_migrations2, exports_migrations2, migrations, init_migrations3, urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", POOL_SIZE_MULTIPLIER = 128, pool, poolOffset, init_nanoid = () => {}, init_decision_trace_store, ClientBuffer, init_client_buffer, exports_streams2, SLOW_QUERY_THRESHOLD_MS = 100, init_streams2, exports_store, adapterCache, TIMESTAMP_SAFE_UNTIL, init_store, init_adapter, exports_dependencies_drizzle, MAX_DEPENDENCY_DEPTH = 100, init_dependencies_drizzle, exports_projections_drizzle, init_projections_drizzle2, exports_dependencies, MAX_DEPENDENCY_DEPTH2 = 100, EMBEDDING_DIM2 = 1024, init_store2, OllamaError, Ollama, makeOllamaLive = (config22) => exports_Layer.succeed(Ollama, (() => {
|
|
60014
|
+
}), union17, unionAll, intersect7, except, init_select2, QueryBuilder, init_query_builder2, SQLiteInsertBuilder, SQLiteInsertBase, init_insert, SQLiteUpdateBuilder, SQLiteUpdateBase, init_update, init_query_builders, SQLiteCountBuilder, init_count, RelationalQueryBuilder, SQLiteRelationalQuery, SQLiteSyncRelationalQuery, init_query2, SQLiteRaw, init_raw, BaseSQLiteDatabase, init_db, init_alias2 = () => {}, init_checks3 = () => {}, IndexBuilderOn, IndexBuilder, Index, init_indexes, PrimaryKeyBuilder2, PrimaryKey2, init_primary_keys2, ExecuteResultSync, SQLitePreparedQuery, SQLiteSession, SQLiteTransaction, init_session, init_utils2 = () => {}, init_view = () => {}, init_sqlite_core, LibSQLSession, LibSQLTransaction, LibSQLPreparedQuery, init_session2, LibSQLDatabase, init_driver_core, init_driver, init_libsql2, MODEL_DIMENSIONS, EMBEDDING_DIM2, OllamaError, Ollama, makeOllamaLive = (config22) => exports_Layer.succeed(Ollama, (() => {
|
|
59965
60015
|
const embedSingle = (text3) => exports_Effect.gen(function* () {
|
|
59966
60016
|
const response = yield* exports_Effect.tryPromise({
|
|
59967
60017
|
try: () => fetch(`${config22.ollamaHost}/api/embeddings`, {
|
|
@@ -60015,7 +60065,17 @@ ${prefix}}`;
|
|
|
60015
60065
|
})()), getDefaultConfig = () => ({
|
|
60016
60066
|
ollamaHost: process.env.OLLAMA_HOST || "http://localhost:11434",
|
|
60017
60067
|
ollamaModel: process.env.OLLAMA_MODEL || "mxbai-embed-large"
|
|
60018
|
-
}), init_ollama,
|
|
60068
|
+
}), init_ollama, vector2 = (dimension) => customType({
|
|
60069
|
+
dataType() {
|
|
60070
|
+
return `F32_BLOB(${dimension})`;
|
|
60071
|
+
},
|
|
60072
|
+
toDriver(value10) {
|
|
60073
|
+
return Buffer.from(new Float32Array(value10).buffer);
|
|
60074
|
+
},
|
|
60075
|
+
fromDriver(value10) {
|
|
60076
|
+
return Array.from(new Float32Array(value10.buffer));
|
|
60077
|
+
}
|
|
60078
|
+
}), memories, memoryLinks, entities, relationships, memoryEntities, init_memory, init_expressions2, exports_drizzle_orm, init_drizzle_orm, exports_streams, eventsTable, agentsTable, messagesTable, messageRecipientsTable, reservationsTable, locksTable, cursorsTable, evalRecordsTable, swarmContextsTable, decisionTracesTable, entityLinksTable, init_streams, exports_hive, beads, cells, cellEvents, beadLabels, cellLabels, beadComments, cellComments, beadDependencies, cellDependencies, blockedBeadsCache, dirtyBeads, schemaVersion, init_hive, exports_schema, init_schema, init_drizzle, require_entity, require_logger, require_query_promise, require_column, require_column_builder, require_table_utils, require_foreign_keys, require_tracing_utils, require_unique_constraint, require_array, require_common2, require_enum, require_subquery, require_version, require_tracing, require_view_common, require_table, require_sql, require_alias, require_selection_proxy, require_utils, require_delete, require_casing, require_errors, require_int_common, require_bigint, require_bigserial, require_boolean, require_char, require_cidr, require_custom, require_date_common, require_date, require_double_precision, require_inet, require_integer, require_interval, require_json, require_jsonb, require_line, require_macaddr, require_macaddr8, require_numeric, require_point, require_utils2, require_geometry, require_real, require_serial, require_smallint, require_smallserial, require_text, require_time, require_timestamp, require_uuid, require_varchar, require_bit, require_halfvec, require_sparsevec, require_vector, require_columns, require_all, require_table2, require_primary_keys, require_conditions, require_select, require_expressions, require_relations, require_aggregate, require_vector2, require_functions, require_sql2, require_view_base, require_dialect, require_query_builder, require_select2, require_query_builder2, require_insert, require_refresh_materialized_view, require_select_types, require_update, require_query_builders, require_count, require_query, require_raw, require_db, require_alias2, require_checks, require_indexes, require_policies, require_roles, require_sequence, require_view_common2, require_view, require_schema, require_session, require_subquery2, require_utils3, require_utils4, require_pg_core, require_session2, require_driver, require_pglite, exports_libsql_convenience, instances, init_libsql_convenience, exports_lock, DurableLock, DurableLockLive, init_lock, exports_reservation_utils, init_reservation_utils, init_projections_drizzle, exports_store_drizzle, init_store_drizzle, exports_swarm_mail, MAX_INBOX_LIMIT = 5, DEFAULT_TTL_SECONDS = 3600, ADJECTIVES, NOUNS, init_swarm_mail, MAX_INBOX_LIMIT2 = 5, DEFAULT_TTL_SECONDS2 = 3600, ADJECTIVES2, NOUNS2, init_agent_mail, exports_migrations, beadsMigration, cellsViewMigration, cellsViewMigrationLibSQL, beadsMigrationLibSQL, beadsResultColumnsMigration, beadsResultColumnsMigrationLibSQL, beadsMigrations, hiveMigrations, sessionsMigrationLibSQL, hiveMigrationsLibSQL, init_migrations, memoryMigration, memoryMigrations, init_migrations2, exports_migrations2, migrations, init_migrations3, urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", POOL_SIZE_MULTIPLIER = 128, pool, poolOffset, init_nanoid = () => {}, init_decision_trace_store, ClientBuffer, init_client_buffer, exports_streams2, SLOW_QUERY_THRESHOLD_MS = 100, init_streams2, exports_store, adapterCache, TIMESTAMP_SAFE_UNTIL, init_store, init_adapter, exports_dependencies_drizzle, MAX_DEPENDENCY_DEPTH = 100, init_dependencies_drizzle, exports_projections_drizzle, init_projections_drizzle2, exports_dependencies, MAX_DEPENDENCY_DEPTH2 = 100, init_store2, FIELD_SETS, init_pagination, marker = "vercel.ai.error", symbol6, _a, _b, AISDKError, name2 = "AI_APICallError", marker2, symbol222, _a2, _b2, APICallError, name22 = "AI_EmptyResponseBodyError", marker3, symbol32, _a3, _b3, EmptyResponseBodyError, name3 = "AI_InvalidArgumentError", marker4, symbol42, _a4, _b4, InvalidArgumentError, name4 = "AI_InvalidPromptError", marker5, symbol52, _a5, _b5, InvalidPromptError, name5 = "AI_InvalidResponseDataError", marker6, symbol62, _a6, _b6, InvalidResponseDataError, name6 = "AI_JSONParseError", marker7, symbol7, _a7, _b7, JSONParseError, name7 = "AI_LoadAPIKeyError", marker8, symbol8, _a8, _b8, LoadAPIKeyError, name8 = "AI_LoadSettingError", marker9, symbol9, _a9, _b9, LoadSettingError, name9 = "AI_NoContentGeneratedError", marker10, symbol10, _a10, _b10, NoContentGeneratedError, name10 = "AI_NoSuchModelError", marker11, symbol11, _a11, _b11, NoSuchModelError, name11 = "AI_TooManyEmbeddingValuesForCallError", marker12, symbol12, _a12, _b12, TooManyEmbeddingValuesForCallError, name12 = "AI_TypeValidationError", marker13, symbol13, _a13, _b13, TypeValidationError, name13 = "AI_UnsupportedFunctionalityError", marker14, symbol14, _a14, _b14, UnsupportedFunctionalityError, init_dist3, NEVER22, $brand2, $ZodAsyncError2, globalConfig2, init_core32, exports_util2, captureStackTrace2, allowsEval2, getParsedType22 = (data) => {
|
|
60019
60079
|
const t = typeof data;
|
|
60020
60080
|
switch (t) {
|
|
60021
60081
|
case "undefined":
|
|
@@ -65787,7 +65847,7 @@ ${prefix}}`;
|
|
|
65787
65847
|
}
|
|
65788
65848
|
return this._output;
|
|
65789
65849
|
}
|
|
65790
|
-
}, JsonToSseTransformStream, uiMessageChunkSchema, originalGenerateId2, uiMessagesSchema, originalGenerateId3, originalGenerateId4, name142 = "AI_NoSuchProviderError", marker142, symbol142, _a142, init_dist6, exports_memory_operations, MemoryOperationSchema, init_memory_operations, exports_auto_tagger, AutoTagResultSchema, init_auto_tagger, exports_memory_linking, DEFAULT_CONFIG, init_memory_linking, exports_entity_extraction, EntitySchema, RelationshipSchema, ExtractionSchema, init_entity_extraction, init_adapter2, import_debug, log, CORS_HEADERS, HEARTBEAT_INTERVAL = 30000, checkpointFrequency, humanFeedback, recoverySuccess, scopeViolations, taskDuration, ANALYTICS_QUERIES, DEFAULT_TOMBSTONE_TTL_MS = 2592000000, MIN_TOMBSTONE_TTL_MS = 604800000, CLOCK_SKEW_GRACE_MS = 3600000, STATUS_TOMBSTONE = "tombstone", dbInstance, clientInstance, TABLE_COLUMNS, EntryTypes, defaultOptions2, RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR", NORMAL_FLOW_ERRORS, ALL_TYPES, DIR_TYPES, FILE_TYPES, isNormalFlowError = (error432) => NORMAL_FLOW_ERRORS.has(error432.code), wantBigintFsStats, emptyFn = (_entryInfo) => true, normalizeFilter = (filter28) => {
|
|
65850
|
+
}, JsonToSseTransformStream, uiMessageChunkSchema, originalGenerateId2, uiMessagesSchema, originalGenerateId3, originalGenerateId4, name142 = "AI_NoSuchProviderError", marker142, symbol142, _a142, init_dist6, exports_memory_operations, MemoryOperationSchema, init_memory_operations, exports_auto_tagger, AutoTagResultSchema, init_auto_tagger, exports_memory_linking, DEFAULT_CONFIG, init_memory_linking, exports_entity_extraction, EntitySchema, RelationshipSchema, ExtractionSchema, init_entity_extraction, MAX_CHARS_PER_CHUNK = 24000, CHUNK_OVERLAP = 200, init_adapter2, import_debug, log, CORS_HEADERS, HEARTBEAT_INTERVAL = 30000, checkpointFrequency, humanFeedback, recoverySuccess, scopeViolations, taskDuration, ANALYTICS_QUERIES, DEFAULT_TOMBSTONE_TTL_MS = 2592000000, MIN_TOMBSTONE_TTL_MS = 604800000, CLOCK_SKEW_GRACE_MS = 3600000, STATUS_TOMBSTONE = "tombstone", dbInstance, clientInstance, TABLE_COLUMNS, EntryTypes, defaultOptions2, RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR", NORMAL_FLOW_ERRORS, ALL_TYPES, DIR_TYPES, FILE_TYPES, isNormalFlowError = (error432) => NORMAL_FLOW_ERRORS.has(error432.code), wantBigintFsStats, emptyFn = (_entryInfo) => true, normalizeFilter = (filter28) => {
|
|
65791
65851
|
if (filter28 === undefined)
|
|
65792
65852
|
return emptyFn;
|
|
65793
65853
|
if (typeof filter28 === "function")
|
|
@@ -106825,7 +106885,12 @@ ${stack.split(`
|
|
|
106825
106885
|
retry_count: exports_external2.number().min(0).default(0),
|
|
106826
106886
|
success: exports_external2.boolean(),
|
|
106827
106887
|
scope_violation: exports_external2.boolean().optional(),
|
|
106828
|
-
violation_files: exports_external2.array(exports_external2.string()).optional()
|
|
106888
|
+
violation_files: exports_external2.array(exports_external2.string()).optional(),
|
|
106889
|
+
commit: exports_external2.object({
|
|
106890
|
+
sha: exports_external2.string().optional(),
|
|
106891
|
+
message: exports_external2.string().optional(),
|
|
106892
|
+
branch: exports_external2.string().optional()
|
|
106893
|
+
}).optional()
|
|
106829
106894
|
});
|
|
106830
106895
|
HumanFeedbackEventSchema = BaseEventSchema.extend({
|
|
106831
106896
|
type: exports_external2.literal("human_feedback"),
|
|
@@ -110630,8 +110695,24 @@ ${stack.split(`
|
|
|
110630
110695
|
init_driver();
|
|
110631
110696
|
init_session2();
|
|
110632
110697
|
});
|
|
110698
|
+
init_ollama = __esm2(() => {
|
|
110699
|
+
init_esm();
|
|
110700
|
+
init_esm();
|
|
110701
|
+
MODEL_DIMENSIONS = {
|
|
110702
|
+
"mxbai-embed-large": 1024,
|
|
110703
|
+
"nomic-embed-text": 768,
|
|
110704
|
+
"all-minilm": 384,
|
|
110705
|
+
"snowflake-arctic-embed": 1024
|
|
110706
|
+
};
|
|
110707
|
+
EMBEDDING_DIM2 = getEmbeddingDimension(process.env.OLLAMA_MODEL || "mxbai-embed-large");
|
|
110708
|
+
OllamaError = class OllamaError2 extends exports_Schema.TaggedError()("OllamaError", { reason: exports_Schema.String }) {
|
|
110709
|
+
};
|
|
110710
|
+
Ollama = class Ollama2 extends exports_Context.Tag("swarm-mail/Ollama")() {
|
|
110711
|
+
};
|
|
110712
|
+
});
|
|
110633
110713
|
init_memory = __esm2(() => {
|
|
110634
110714
|
init_sqlite_core();
|
|
110715
|
+
init_ollama();
|
|
110635
110716
|
memories = sqliteTable("memories", {
|
|
110636
110717
|
id: text("id").primaryKey(),
|
|
110637
110718
|
content: text("content").notNull(),
|
|
@@ -110641,7 +110722,7 @@ ${stack.split(`
|
|
|
110641
110722
|
created_at: text("created_at").default("(datetime('now'))"),
|
|
110642
110723
|
updated_at: text("updated_at").default("(datetime('now'))"),
|
|
110643
110724
|
decay_factor: real("decay_factor").default(1),
|
|
110644
|
-
embedding: vector2(
|
|
110725
|
+
embedding: vector2(EMBEDDING_DIM2)("embedding"),
|
|
110645
110726
|
valid_from: text("valid_from"),
|
|
110646
110727
|
valid_until: text("valid_until"),
|
|
110647
110728
|
superseded_by: text("superseded_by"),
|
|
@@ -111036,7 +111117,9 @@ ${stack.split(`
|
|
|
111036
111117
|
deleted_at: integer4("deleted_at"),
|
|
111037
111118
|
deleted_by: text("deleted_by"),
|
|
111038
111119
|
delete_reason: text("delete_reason"),
|
|
111039
|
-
created_by: text("created_by")
|
|
111120
|
+
created_by: text("created_by"),
|
|
111121
|
+
result: text("result"),
|
|
111122
|
+
result_at: integer4("result_at")
|
|
111040
111123
|
}, (table5) => ({
|
|
111041
111124
|
projectIdx: index("idx_beads_project").on(table5.project_key),
|
|
111042
111125
|
statusIdx: index("idx_beads_status").on(table5.status),
|
|
@@ -119868,6 +119951,8 @@ ${stack.split(`
|
|
|
119868
119951
|
hiveMigrations: () => hiveMigrations,
|
|
119869
119952
|
cellsViewMigrationLibSQL: () => cellsViewMigrationLibSQL,
|
|
119870
119953
|
cellsViewMigration: () => cellsViewMigration,
|
|
119954
|
+
beadsResultColumnsMigrationLibSQL: () => beadsResultColumnsMigrationLibSQL,
|
|
119955
|
+
beadsResultColumnsMigration: () => beadsResultColumnsMigration,
|
|
119871
119956
|
beadsMigrations: () => beadsMigrations,
|
|
119872
119957
|
beadsMigrationLibSQL: () => beadsMigrationLibSQL,
|
|
119873
119958
|
beadsMigration: () => beadsMigration
|
|
@@ -120254,10 +120339,128 @@ ${stack.split(`
|
|
|
120254
120339
|
DROP TABLE IF EXISTS bead_labels;
|
|
120255
120340
|
DROP TABLE IF EXISTS bead_dependencies;
|
|
120256
120341
|
DROP TABLE IF EXISTS beads;
|
|
120342
|
+
`
|
|
120343
|
+
};
|
|
120344
|
+
beadsResultColumnsMigration = {
|
|
120345
|
+
version: 10,
|
|
120346
|
+
description: "Add result and result_at columns to beads table",
|
|
120347
|
+
up: `
|
|
120348
|
+
ALTER TABLE beads ADD COLUMN result TEXT;
|
|
120349
|
+
ALTER TABLE beads ADD COLUMN result_at INTEGER;
|
|
120350
|
+
|
|
120351
|
+
-- Recreate cells view triggers to include new columns
|
|
120352
|
+
DROP TRIGGER IF EXISTS cells_insert;
|
|
120353
|
+
CREATE TRIGGER cells_insert
|
|
120354
|
+
INSTEAD OF INSERT ON cells
|
|
120355
|
+
FOR EACH ROW
|
|
120356
|
+
BEGIN
|
|
120357
|
+
INSERT INTO beads (id, project_key, type, status, title,
|
|
120358
|
+
description, priority, parent_id, assignee,
|
|
120359
|
+
created_at, updated_at, closed_at, closed_reason,
|
|
120360
|
+
deleted_at, deleted_by, delete_reason, created_by,
|
|
120361
|
+
result, result_at)
|
|
120362
|
+
VALUES (
|
|
120363
|
+
NEW.id, NEW.project_key, NEW.type, NEW.status, NEW.title,
|
|
120364
|
+
NEW.description, NEW.priority, NEW.parent_id, NEW.assignee,
|
|
120365
|
+
NEW.created_at, NEW.updated_at, NEW.closed_at, NEW.closed_reason,
|
|
120366
|
+
NEW.deleted_at, NEW.deleted_by, NEW.delete_reason, NEW.created_by,
|
|
120367
|
+
NEW.result, NEW.result_at
|
|
120368
|
+
);
|
|
120369
|
+
END;
|
|
120370
|
+
|
|
120371
|
+
DROP TRIGGER IF EXISTS cells_update;
|
|
120372
|
+
CREATE TRIGGER cells_update
|
|
120373
|
+
INSTEAD OF UPDATE ON cells
|
|
120374
|
+
FOR EACH ROW
|
|
120375
|
+
BEGIN
|
|
120376
|
+
UPDATE beads SET
|
|
120377
|
+
project_key = NEW.project_key,
|
|
120378
|
+
type = NEW.type,
|
|
120379
|
+
status = NEW.status,
|
|
120380
|
+
title = NEW.title,
|
|
120381
|
+
description = NEW.description,
|
|
120382
|
+
priority = NEW.priority,
|
|
120383
|
+
parent_id = NEW.parent_id,
|
|
120384
|
+
assignee = NEW.assignee,
|
|
120385
|
+
created_at = NEW.created_at,
|
|
120386
|
+
updated_at = NEW.updated_at,
|
|
120387
|
+
closed_at = NEW.closed_at,
|
|
120388
|
+
closed_reason = NEW.closed_reason,
|
|
120389
|
+
deleted_at = NEW.deleted_at,
|
|
120390
|
+
deleted_by = NEW.deleted_by,
|
|
120391
|
+
delete_reason = NEW.delete_reason,
|
|
120392
|
+
created_by = NEW.created_by,
|
|
120393
|
+
result = NEW.result,
|
|
120394
|
+
result_at = NEW.result_at
|
|
120395
|
+
WHERE id = NEW.id;
|
|
120396
|
+
END;
|
|
120397
|
+
`,
|
|
120398
|
+
down: `
|
|
120399
|
+
ALTER TABLE beads DROP COLUMN result;
|
|
120400
|
+
ALTER TABLE beads DROP COLUMN result_at;
|
|
120401
|
+
`
|
|
120402
|
+
};
|
|
120403
|
+
beadsResultColumnsMigrationLibSQL = {
|
|
120404
|
+
version: 10,
|
|
120405
|
+
description: "Add result and result_at columns to beads table (LibSQL)",
|
|
120406
|
+
up: `
|
|
120407
|
+
ALTER TABLE beads ADD COLUMN result TEXT;
|
|
120408
|
+
ALTER TABLE beads ADD COLUMN result_at INTEGER;
|
|
120409
|
+
|
|
120410
|
+
-- Recreate cells view triggers to include new columns
|
|
120411
|
+
DROP TRIGGER IF EXISTS cells_insert;
|
|
120412
|
+
CREATE TRIGGER cells_insert
|
|
120413
|
+
INSTEAD OF INSERT ON cells
|
|
120414
|
+
FOR EACH ROW
|
|
120415
|
+
BEGIN
|
|
120416
|
+
INSERT INTO beads (id, project_key, type, status, title,
|
|
120417
|
+
description, priority, parent_id, assignee,
|
|
120418
|
+
created_at, updated_at, closed_at, closed_reason,
|
|
120419
|
+
deleted_at, deleted_by, delete_reason, created_by,
|
|
120420
|
+
result, result_at)
|
|
120421
|
+
VALUES (
|
|
120422
|
+
NEW.id, NEW.project_key, NEW.type, NEW.status, NEW.title,
|
|
120423
|
+
NEW.description, NEW.priority, NEW.parent_id, NEW.assignee,
|
|
120424
|
+
NEW.created_at, NEW.updated_at, NEW.closed_at, NEW.closed_reason,
|
|
120425
|
+
NEW.deleted_at, NEW.deleted_by, NEW.delete_reason, NEW.created_by,
|
|
120426
|
+
NEW.result, NEW.result_at
|
|
120427
|
+
);
|
|
120428
|
+
END;
|
|
120429
|
+
|
|
120430
|
+
DROP TRIGGER IF EXISTS cells_update;
|
|
120431
|
+
CREATE TRIGGER cells_update
|
|
120432
|
+
INSTEAD OF UPDATE ON cells
|
|
120433
|
+
FOR EACH ROW
|
|
120434
|
+
BEGIN
|
|
120435
|
+
UPDATE beads SET
|
|
120436
|
+
project_key = NEW.project_key,
|
|
120437
|
+
type = NEW.type,
|
|
120438
|
+
status = NEW.status,
|
|
120439
|
+
title = NEW.title,
|
|
120440
|
+
description = NEW.description,
|
|
120441
|
+
priority = NEW.priority,
|
|
120442
|
+
parent_id = NEW.parent_id,
|
|
120443
|
+
assignee = NEW.assignee,
|
|
120444
|
+
created_at = NEW.created_at,
|
|
120445
|
+
updated_at = NEW.updated_at,
|
|
120446
|
+
closed_at = NEW.closed_at,
|
|
120447
|
+
closed_reason = NEW.closed_reason,
|
|
120448
|
+
deleted_at = NEW.deleted_at,
|
|
120449
|
+
deleted_by = NEW.deleted_by,
|
|
120450
|
+
delete_reason = NEW.delete_reason,
|
|
120451
|
+
created_by = NEW.created_by,
|
|
120452
|
+
result = NEW.result,
|
|
120453
|
+
result_at = NEW.result_at
|
|
120454
|
+
WHERE id = NEW.id;
|
|
120455
|
+
END;
|
|
120456
|
+
`,
|
|
120457
|
+
down: `
|
|
120458
|
+
-- SQLite doesn't support DROP COLUMN until 3.35.0
|
|
120459
|
+
-- Columns can be left as NULL if downgrade is needed
|
|
120257
120460
|
`
|
|
120258
120461
|
};
|
|
120259
120462
|
beadsMigrations = [beadsMigration];
|
|
120260
|
-
hiveMigrations = [beadsMigration, cellsViewMigration];
|
|
120463
|
+
hiveMigrations = [beadsMigration, cellsViewMigration, beadsResultColumnsMigration];
|
|
120261
120464
|
sessionsMigrationLibSQL = {
|
|
120262
120465
|
version: 9,
|
|
120263
120466
|
description: "Add sessions table for handoff notes (Chainlink pattern)",
|
|
@@ -120287,7 +120490,8 @@ ${stack.split(`
|
|
|
120287
120490
|
hiveMigrationsLibSQL = [
|
|
120288
120491
|
beadsMigrationLibSQL,
|
|
120289
120492
|
cellsViewMigrationLibSQL,
|
|
120290
|
-
sessionsMigrationLibSQL
|
|
120493
|
+
sessionsMigrationLibSQL,
|
|
120494
|
+
beadsResultColumnsMigrationLibSQL
|
|
120291
120495
|
];
|
|
120292
120496
|
});
|
|
120293
120497
|
init_migrations2 = __esm2(() => {
|
|
@@ -120956,14 +121160,7 @@ ${stack.split(`
|
|
|
120956
121160
|
init_store2 = __esm2(() => {
|
|
120957
121161
|
init_drizzle_orm();
|
|
120958
121162
|
init_memory();
|
|
120959
|
-
|
|
120960
|
-
init_ollama = __esm2(() => {
|
|
120961
|
-
init_esm();
|
|
120962
|
-
init_esm();
|
|
120963
|
-
OllamaError = class OllamaError2 extends exports_Schema.TaggedError()("OllamaError", { reason: exports_Schema.String }) {
|
|
120964
|
-
};
|
|
120965
|
-
Ollama = class Ollama2 extends exports_Context.Tag("swarm-mail/Ollama")() {
|
|
120966
|
-
};
|
|
121163
|
+
init_ollama();
|
|
120967
121164
|
});
|
|
120968
121165
|
init_pagination = __esm2(() => {
|
|
120969
121166
|
FIELD_SETS = {
|
|
@@ -144314,7 +144511,8 @@ Scripts run in the skill's directory with the project directory as an argument.`
|
|
|
144314
144511
|
args: {
|
|
144315
144512
|
skill: tool.schema.string().describe("Name of the skill"),
|
|
144316
144513
|
script: tool.schema.string().describe("Name of the script file to execute"),
|
|
144317
|
-
args: tool.schema.array(tool.schema.string()).optional().describe("Additional arguments to pass to the script")
|
|
144514
|
+
args: tool.schema.array(tool.schema.string()).optional().describe("Additional arguments to pass to the script"),
|
|
144515
|
+
timeout_ms: tool.schema.number().optional().describe("Timeout in milliseconds (default: 60000)")
|
|
144318
144516
|
},
|
|
144319
144517
|
async execute(args2, ctx) {
|
|
144320
144518
|
console.warn("[DEPRECATED] skills_execute is deprecated. OpenCode now provides native skills support. This tool will be removed in a future version.");
|
|
@@ -144327,7 +144525,7 @@ Scripts run in the skill's directory with the project directory as an argument.`
|
|
|
144327
144525
|
}
|
|
144328
144526
|
const scriptPath = join23(skill.directory, "scripts", args2.script);
|
|
144329
144527
|
const scriptArgs = args2.args || [];
|
|
144330
|
-
const TIMEOUT_MS = 60000;
|
|
144528
|
+
const TIMEOUT_MS = args2.timeout_ms ?? 60000;
|
|
144331
144529
|
const proc = Bun.spawn([scriptPath, skillsProjectDirectory, ...scriptArgs], {
|
|
144332
144530
|
cwd: skill.directory,
|
|
144333
144531
|
stdout: "pipe",
|
|
@@ -145230,6 +145428,7 @@ __export(exports_storage, {
|
|
|
145230
145428
|
resetStorage: () => resetStorage,
|
|
145231
145429
|
resetSessionStats: () => resetSessionStats,
|
|
145232
145430
|
resetCommandCache: () => resetCommandCache,
|
|
145431
|
+
resetAvailabilityCache: () => resetAvailabilityCache,
|
|
145233
145432
|
isSemanticMemoryAvailable: () => isSemanticMemoryAvailable,
|
|
145234
145433
|
getTestCollectionName: () => getTestCollectionName,
|
|
145235
145434
|
getStorage: () => getStorage,
|
|
@@ -145580,12 +145779,25 @@ function createStorage(config3 = {}) {
|
|
|
145580
145779
|
}
|
|
145581
145780
|
}
|
|
145582
145781
|
async function isSemanticMemoryAvailable() {
|
|
145583
|
-
|
|
145584
|
-
|
|
145585
|
-
|
|
145586
|
-
|
|
145587
|
-
|
|
145588
|
-
|
|
145782
|
+
if (_availabilityCache !== null)
|
|
145783
|
+
return _availabilityCache;
|
|
145784
|
+
if (_availabilityPromise)
|
|
145785
|
+
return _availabilityPromise;
|
|
145786
|
+
_availabilityPromise = (async () => {
|
|
145787
|
+
try {
|
|
145788
|
+
const result = await execSemanticMemory(["stats"]);
|
|
145789
|
+
_availabilityCache = result.exitCode === 0;
|
|
145790
|
+
} catch {
|
|
145791
|
+
_availabilityCache = false;
|
|
145792
|
+
}
|
|
145793
|
+
_availabilityPromise = null;
|
|
145794
|
+
return _availabilityCache;
|
|
145795
|
+
})();
|
|
145796
|
+
return _availabilityPromise;
|
|
145797
|
+
}
|
|
145798
|
+
function resetAvailabilityCache() {
|
|
145799
|
+
_availabilityCache = null;
|
|
145800
|
+
_availabilityPromise = null;
|
|
145589
145801
|
}
|
|
145590
145802
|
async function getResolvedCommand() {
|
|
145591
145803
|
return resolveSemanticMemoryCommand();
|
|
@@ -145621,7 +145833,7 @@ async function resetStorage() {
|
|
|
145621
145833
|
}
|
|
145622
145834
|
globalStoragePromise = null;
|
|
145623
145835
|
}
|
|
145624
|
-
var cachedCommand = null, DEFAULT_STORAGE_CONFIG, sessionStats, globalStorage = null, globalStoragePromise = null;
|
|
145836
|
+
var cachedCommand = null, DEFAULT_STORAGE_CONFIG, sessionStats, _availabilityCache = null, _availabilityPromise = null, globalStorage = null, globalStoragePromise = null;
|
|
145625
145837
|
var init_storage = __esm(() => {
|
|
145626
145838
|
init_learning();
|
|
145627
145839
|
init_anti_patterns();
|
|
@@ -174999,7 +175211,8 @@ var CellUpdateArgsSchema = exports_external.object({
|
|
|
174999
175211
|
});
|
|
175000
175212
|
var CellCloseArgsSchema = exports_external.object({
|
|
175001
175213
|
id: exports_external.string(),
|
|
175002
|
-
reason: exports_external.string().min(1, "Reason required")
|
|
175214
|
+
reason: exports_external.string().min(1, "Reason required"),
|
|
175215
|
+
result: exports_external.string().optional()
|
|
175003
175216
|
});
|
|
175004
175217
|
var CellQueryArgsSchema = exports_external.object({
|
|
175005
175218
|
status: CellStatusSchema.optional(),
|
|
@@ -175786,7 +175999,7 @@ async function importJsonlToPGLite(projectPath) {
|
|
|
175786
175999
|
const status3 = cellData.status === "tombstone" ? "closed" : cellData.status;
|
|
175787
176000
|
const isClosed = status3 === "closed";
|
|
175788
176001
|
const closedAt = isClosed ? cellData.closed_at ? new Date(cellData.closed_at).getTime() : new Date(cellData.updated_at).getTime() : null;
|
|
175789
|
-
await db.query(`INSERT INTO
|
|
176002
|
+
await db.query(`INSERT INTO beads (
|
|
175790
176003
|
id, project_key, type, status, title, description, priority,
|
|
175791
176004
|
parent_id, assignee, created_at, updated_at, closed_at
|
|
175792
176005
|
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)`, [
|
|
@@ -176204,7 +176417,8 @@ var hive_close = tool({
|
|
|
176204
176417
|
description: "Close a cell with reason",
|
|
176205
176418
|
args: {
|
|
176206
176419
|
id: tool.schema.string().describe("Cell ID or partial hash"),
|
|
176207
|
-
reason: tool.schema.string().describe("Completion reason")
|
|
176420
|
+
reason: tool.schema.string().describe("Completion reason"),
|
|
176421
|
+
result: tool.schema.string().optional().describe("Implementation summary - what was actually done (like a PR description)")
|
|
176208
176422
|
},
|
|
176209
176423
|
async execute(args2, ctx) {
|
|
176210
176424
|
const validated = CellCloseArgsSchema.parse(args2);
|
|
@@ -176214,7 +176428,7 @@ var hive_close = tool({
|
|
|
176214
176428
|
const cellId = await resolvePartialId(adapter5, projectKey, validated.id) || validated.id;
|
|
176215
176429
|
const cellBeforeClose = await adapter5.getCell(projectKey, cellId);
|
|
176216
176430
|
const isEpic = cellBeforeClose?.type === "epic";
|
|
176217
|
-
const cell = await adapter5.closeCell(projectKey, cellId, validated.reason);
|
|
176431
|
+
const cell = await adapter5.closeCell(projectKey, cellId, validated.reason, validated.result ? { result: validated.result } : undefined);
|
|
176218
176432
|
await adapter5.markDirty(projectKey, cellId);
|
|
176219
176433
|
if (isEpic && cellBeforeClose) {
|
|
176220
176434
|
try {
|
|
@@ -182369,6 +182583,20 @@ var reviewTools = {
|
|
|
182369
182583
|
swarm_review_feedback
|
|
182370
182584
|
};
|
|
182371
182585
|
|
|
182586
|
+
// src/utils/git-commit-info.ts
|
|
182587
|
+
import { execSync } from "child_process";
|
|
182588
|
+
function getGitCommitInfo(cwd) {
|
|
182589
|
+
try {
|
|
182590
|
+
const opts = { cwd, encoding: "utf-8", timeout: 5000 };
|
|
182591
|
+
const sha = execSync("git rev-parse HEAD", opts).trim();
|
|
182592
|
+
const message = execSync("git log -1 --format=%s", opts).trim();
|
|
182593
|
+
const branch = execSync("git rev-parse --abbrev-ref HEAD", opts).trim();
|
|
182594
|
+
return { sha, message, branch };
|
|
182595
|
+
} catch {
|
|
182596
|
+
return null;
|
|
182597
|
+
}
|
|
182598
|
+
}
|
|
182599
|
+
|
|
182372
182600
|
// src/swarm-orchestrate.ts
|
|
182373
182601
|
init_eval_capture();
|
|
182374
182602
|
|
|
@@ -183040,7 +183268,10 @@ var swarm_complete = tool({
|
|
|
183040
183268
|
start_time: tool.schema.number().describe("Task start timestamp (Unix ms) for duration calculation - REQUIRED for accurate analytics"),
|
|
183041
183269
|
error_count: tool.schema.number().optional().describe("Number of errors encountered during task"),
|
|
183042
183270
|
retry_count: tool.schema.number().optional().describe("Number of retry attempts during task"),
|
|
183043
|
-
skip_review: tool.schema.boolean().optional().describe("Skip review gate check (default: false). Use only for tasks that don't require coordinator review.")
|
|
183271
|
+
skip_review: tool.schema.boolean().optional().describe("Skip review gate check (default: false). Use only for tasks that don't require coordinator review."),
|
|
183272
|
+
commit_sha: tool.schema.string().optional().describe("Git commit SHA (auto-detected if not provided)"),
|
|
183273
|
+
commit_message: tool.schema.string().optional().describe("Commit message (auto-detected if not provided)"),
|
|
183274
|
+
commit_branch: tool.schema.string().optional().describe("Git branch (auto-detected if not provided)")
|
|
183044
183275
|
},
|
|
183045
183276
|
async execute(args2, _ctx) {
|
|
183046
183277
|
const missing = [];
|
|
@@ -183101,6 +183332,13 @@ var swarm_complete = tool({
|
|
|
183101
183332
|
}, null, 2);
|
|
183102
183333
|
}
|
|
183103
183334
|
}
|
|
183335
|
+
const gitInfo = getGitCommitInfo(args2.project_key) || {};
|
|
183336
|
+
const commitSha = args2.commit_sha || gitInfo.sha;
|
|
183337
|
+
const commitMessage = args2.commit_message || gitInfo.message;
|
|
183338
|
+
const commitBranch = args2.commit_branch || gitInfo.branch;
|
|
183339
|
+
const resultText = commitSha ? `${args2.summary}
|
|
183340
|
+
|
|
183341
|
+
Commit: ${commitSha.slice(0, 8)} (${commitBranch || "unknown"}) - ${commitMessage || "no message"}` : args2.summary;
|
|
183104
183342
|
try {
|
|
183105
183343
|
const adapter5 = await getHiveAdapter(args2.project_key);
|
|
183106
183344
|
const cell = await adapter5.getCell(args2.project_key, args2.bead_id);
|
|
@@ -183215,7 +183453,9 @@ This will be recorded as a negative learning signal.`;
|
|
|
183215
183453
|
}
|
|
183216
183454
|
}
|
|
183217
183455
|
try {
|
|
183218
|
-
await adapter5.closeCell(args2.project_key, args2.bead_id, args2.summary
|
|
183456
|
+
await adapter5.closeCell(args2.project_key, args2.bead_id, args2.summary, {
|
|
183457
|
+
result: resultText
|
|
183458
|
+
});
|
|
183219
183459
|
} catch (closeError) {
|
|
183220
183460
|
const errorMessage = closeError instanceof Error ? closeError.message : String(closeError);
|
|
183221
183461
|
return JSON.stringify({
|
|
@@ -183283,7 +183523,8 @@ This will be recorded as a negative learning signal.`;
|
|
|
183283
183523
|
retry_count: args2.retry_count || 0,
|
|
183284
183524
|
success: true,
|
|
183285
183525
|
scope_violation: contractValidation ? !contractValidation.valid : undefined,
|
|
183286
|
-
violation_files: contractValidation?.violations
|
|
183526
|
+
violation_files: contractValidation?.violations,
|
|
183527
|
+
commit: commitSha ? { sha: commitSha, message: commitMessage, branch: commitBranch } : undefined
|
|
183287
183528
|
});
|
|
183288
183529
|
const savedEvent = await appendEvent(event, args2.project_key);
|
|
183289
183530
|
outcomeEventId = savedEvent.id;
|
|
@@ -183468,6 +183709,8 @@ This will be recorded as a negative learning signal.`;
|
|
|
183468
183709
|
success: true,
|
|
183469
183710
|
bead_id: args2.bead_id,
|
|
183470
183711
|
closed: true,
|
|
183712
|
+
result: resultText,
|
|
183713
|
+
commit: commitSha ? { sha: commitSha, message: commitMessage, branch: commitBranch } : undefined,
|
|
183471
183714
|
reservations_released: reservationsReleased,
|
|
183472
183715
|
reservations_released_count: reservationsReleasedCount,
|
|
183473
183716
|
reservations_release_error: reservationsReleaseError,
|
|
@@ -112,6 +112,7 @@ export type CellUpdateArgs = z.infer<typeof CellUpdateArgsSchema>;
|
|
|
112
112
|
export declare const CellCloseArgsSchema: z.ZodObject<{
|
|
113
113
|
id: z.ZodString;
|
|
114
114
|
reason: z.ZodString;
|
|
115
|
+
result: z.ZodOptional<z.ZodString>;
|
|
115
116
|
}, z.core.$strip>;
|
|
116
117
|
export type CellCloseArgs = z.infer<typeof CellCloseArgsSchema>;
|
|
117
118
|
/** Arguments for querying cells */
|
|
@@ -364,6 +365,7 @@ export type BeadUpdateArgs = CellUpdateArgs;
|
|
|
364
365
|
export declare const BeadCloseArgsSchema: z.ZodObject<{
|
|
365
366
|
id: z.ZodString;
|
|
366
367
|
reason: z.ZodString;
|
|
368
|
+
result: z.ZodOptional<z.ZodString>;
|
|
367
369
|
}, z.core.$strip>;
|
|
368
370
|
/** @deprecated Use CellCloseArgs instead */
|
|
369
371
|
export type BeadCloseArgs = CellCloseArgs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../src/schemas/cell.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0BAA0B;AAC1B,eAAO,MAAM,gBAAgB;;;;;EAK3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,uBAAuB;AACvB,eAAO,MAAM,cAAc;;;;;;EAMzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,4CAA4C;AAC5C,eAAO,MAAM,oBAAoB;;;;;;;;iBAG/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEl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itCommitInfo {
|
|
2
|
+
sha: string;
|
|
3
|
+
message: string;
|
|
4
|
+
branch: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Get current git commit info. Returns null if not in a git repo or on error.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getGitCommitInfo(cwd?: string): GitCommitInfo | null;
|
|
10
|
+
//# sourceMappingURL=git-commit-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-commit-info.d.ts","sourceRoot":"","sources":["../../src/utils/git-commit-info.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAUnE"}
|