chatroom-cli 1.7.1 → 1.8.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/dist/index.js +123 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13100,13 +13100,102 @@ function resolveContent(content, filePath, optionName) {
|
|
|
13100
13100
|
}
|
|
13101
13101
|
var init_file_content = () => {};
|
|
13102
13102
|
|
|
13103
|
+
// src/commands/skill/index.ts
|
|
13104
|
+
var exports_skill = {};
|
|
13105
|
+
__export(exports_skill, {
|
|
13106
|
+
listSkills: () => listSkills,
|
|
13107
|
+
activateSkill: () => activateSkill
|
|
13108
|
+
});
|
|
13109
|
+
async function createDefaultDeps11() {
|
|
13110
|
+
const client2 = await getConvexClient();
|
|
13111
|
+
return {
|
|
13112
|
+
backend: {
|
|
13113
|
+
mutation: (endpoint, args) => client2.mutation(endpoint, args),
|
|
13114
|
+
query: (endpoint, args) => client2.query(endpoint, args)
|
|
13115
|
+
},
|
|
13116
|
+
session: {
|
|
13117
|
+
getSessionId,
|
|
13118
|
+
getConvexUrl,
|
|
13119
|
+
getOtherSessionUrls
|
|
13120
|
+
}
|
|
13121
|
+
};
|
|
13122
|
+
}
|
|
13123
|
+
function requireAuth3(d) {
|
|
13124
|
+
const sessionId = d.session.getSessionId();
|
|
13125
|
+
if (!sessionId) {
|
|
13126
|
+
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
13127
|
+
process.exit(1);
|
|
13128
|
+
}
|
|
13129
|
+
return sessionId;
|
|
13130
|
+
}
|
|
13131
|
+
async function listSkills(chatroomId, options, deps) {
|
|
13132
|
+
const d = deps ?? await createDefaultDeps11();
|
|
13133
|
+
const sessionId = requireAuth3(d);
|
|
13134
|
+
try {
|
|
13135
|
+
const skills = await d.backend.query(api.skills.list, {
|
|
13136
|
+
sessionId,
|
|
13137
|
+
chatroomId
|
|
13138
|
+
});
|
|
13139
|
+
if (!skills || skills.length === 0) {
|
|
13140
|
+
console.log("No skills available.");
|
|
13141
|
+
return;
|
|
13142
|
+
}
|
|
13143
|
+
const maxSkillIdLen = Math.max(...skills.map((s) => s.skillId.length));
|
|
13144
|
+
console.log("Available skills:");
|
|
13145
|
+
for (const skill of skills) {
|
|
13146
|
+
const padded = skill.skillId.padEnd(maxSkillIdLen);
|
|
13147
|
+
console.log(` ${padded} ${skill.description}`);
|
|
13148
|
+
}
|
|
13149
|
+
} catch (error) {
|
|
13150
|
+
if (error instanceof ConvexError) {
|
|
13151
|
+
const msg = typeof error.data === "string" ? error.data : error.data.message ?? String(error.data);
|
|
13152
|
+
console.error(`❌ ${msg}`);
|
|
13153
|
+
} else {
|
|
13154
|
+
console.error(`❌ Failed to list skills: ${error.message}`);
|
|
13155
|
+
}
|
|
13156
|
+
process.exit(1);
|
|
13157
|
+
}
|
|
13158
|
+
}
|
|
13159
|
+
async function activateSkill(chatroomId, skillId, options, deps) {
|
|
13160
|
+
const d = deps ?? await createDefaultDeps11();
|
|
13161
|
+
const sessionId = requireAuth3(d);
|
|
13162
|
+
try {
|
|
13163
|
+
const convexUrl = d.session.getConvexUrl();
|
|
13164
|
+
const result = await d.backend.mutation(api.skills.activate, {
|
|
13165
|
+
sessionId,
|
|
13166
|
+
chatroomId,
|
|
13167
|
+
skillId,
|
|
13168
|
+
role: options.role,
|
|
13169
|
+
convexUrl: convexUrl ?? undefined
|
|
13170
|
+
});
|
|
13171
|
+
console.log("");
|
|
13172
|
+
console.log(`✅ Skill "${result.skill.skillId}" activated.`);
|
|
13173
|
+
console.log(` The agent will now: ${result.skill.description}`);
|
|
13174
|
+
console.log("");
|
|
13175
|
+
} catch (error) {
|
|
13176
|
+
if (error instanceof ConvexError) {
|
|
13177
|
+
const msg = typeof error.data === "string" ? error.data : error.data.message ?? String(error.data);
|
|
13178
|
+
console.error(`❌ ${msg}`);
|
|
13179
|
+
} else {
|
|
13180
|
+
console.error(`❌ Failed to activate skill: ${error.message}`);
|
|
13181
|
+
}
|
|
13182
|
+
process.exit(1);
|
|
13183
|
+
}
|
|
13184
|
+
}
|
|
13185
|
+
var init_skill = __esm(() => {
|
|
13186
|
+
init_values();
|
|
13187
|
+
init_api3();
|
|
13188
|
+
init_storage();
|
|
13189
|
+
init_client2();
|
|
13190
|
+
});
|
|
13191
|
+
|
|
13103
13192
|
// src/commands/messages/index.ts
|
|
13104
13193
|
var exports_messages = {};
|
|
13105
13194
|
__export(exports_messages, {
|
|
13106
13195
|
listSinceMessage: () => listSinceMessage,
|
|
13107
13196
|
listBySenderRole: () => listBySenderRole
|
|
13108
13197
|
});
|
|
13109
|
-
async function
|
|
13198
|
+
async function createDefaultDeps12() {
|
|
13110
13199
|
const client2 = await getConvexClient();
|
|
13111
13200
|
return {
|
|
13112
13201
|
backend: {
|
|
@@ -13121,7 +13210,7 @@ async function createDefaultDeps11() {
|
|
|
13121
13210
|
};
|
|
13122
13211
|
}
|
|
13123
13212
|
async function listBySenderRole(chatroomId, options, deps) {
|
|
13124
|
-
const d = deps ?? await
|
|
13213
|
+
const d = deps ?? await createDefaultDeps12();
|
|
13125
13214
|
const sessionId = d.session.getSessionId();
|
|
13126
13215
|
if (!sessionId) {
|
|
13127
13216
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13186,7 +13275,7 @@ ${content.split(`
|
|
|
13186
13275
|
}
|
|
13187
13276
|
}
|
|
13188
13277
|
async function listSinceMessage(chatroomId, options, deps) {
|
|
13189
|
-
const d = deps ?? await
|
|
13278
|
+
const d = deps ?? await createDefaultDeps12();
|
|
13190
13279
|
const sessionId = d.session.getSessionId();
|
|
13191
13280
|
if (!sessionId) {
|
|
13192
13281
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13262,7 +13351,7 @@ __export(exports_context, {
|
|
|
13262
13351
|
listContexts: () => listContexts,
|
|
13263
13352
|
inspectContext: () => inspectContext
|
|
13264
13353
|
});
|
|
13265
|
-
async function
|
|
13354
|
+
async function createDefaultDeps13() {
|
|
13266
13355
|
const client2 = await getConvexClient();
|
|
13267
13356
|
return {
|
|
13268
13357
|
backend: {
|
|
@@ -13277,7 +13366,7 @@ async function createDefaultDeps12() {
|
|
|
13277
13366
|
};
|
|
13278
13367
|
}
|
|
13279
13368
|
async function readContext(chatroomId, options, deps) {
|
|
13280
|
-
const d = deps ?? await
|
|
13369
|
+
const d = deps ?? await createDefaultDeps13();
|
|
13281
13370
|
const sessionId = d.session.getSessionId();
|
|
13282
13371
|
if (!sessionId) {
|
|
13283
13372
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13392,7 +13481,7 @@ async function readContext(chatroomId, options, deps) {
|
|
|
13392
13481
|
}
|
|
13393
13482
|
}
|
|
13394
13483
|
async function newContext(chatroomId, options, deps) {
|
|
13395
|
-
const d = deps ?? await
|
|
13484
|
+
const d = deps ?? await createDefaultDeps13();
|
|
13396
13485
|
const sessionId = d.session.getSessionId();
|
|
13397
13486
|
if (!sessionId) {
|
|
13398
13487
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13444,7 +13533,7 @@ async function newContext(chatroomId, options, deps) {
|
|
|
13444
13533
|
}
|
|
13445
13534
|
}
|
|
13446
13535
|
async function listContexts(chatroomId, options, deps) {
|
|
13447
|
-
const d = deps ?? await
|
|
13536
|
+
const d = deps ?? await createDefaultDeps13();
|
|
13448
13537
|
const sessionId = d.session.getSessionId();
|
|
13449
13538
|
if (!sessionId) {
|
|
13450
13539
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13496,7 +13585,7 @@ async function listContexts(chatroomId, options, deps) {
|
|
|
13496
13585
|
}
|
|
13497
13586
|
}
|
|
13498
13587
|
async function inspectContext(chatroomId, options, deps) {
|
|
13499
|
-
const d = deps ?? await
|
|
13588
|
+
const d = deps ?? await createDefaultDeps13();
|
|
13500
13589
|
const sessionId = d.session.getSessionId();
|
|
13501
13590
|
if (!sessionId) {
|
|
13502
13591
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13556,7 +13645,7 @@ __export(exports_guidelines, {
|
|
|
13556
13645
|
viewGuidelines: () => viewGuidelines,
|
|
13557
13646
|
listGuidelineTypes: () => listGuidelineTypes
|
|
13558
13647
|
});
|
|
13559
|
-
async function
|
|
13648
|
+
async function createDefaultDeps14() {
|
|
13560
13649
|
const client2 = await getConvexClient();
|
|
13561
13650
|
return {
|
|
13562
13651
|
backend: {
|
|
@@ -13571,7 +13660,7 @@ async function createDefaultDeps13() {
|
|
|
13571
13660
|
};
|
|
13572
13661
|
}
|
|
13573
13662
|
async function viewGuidelines(options, deps) {
|
|
13574
|
-
const d = deps ?? await
|
|
13663
|
+
const d = deps ?? await createDefaultDeps14();
|
|
13575
13664
|
const { type } = options;
|
|
13576
13665
|
if (!VALID_TYPES.includes(type)) {
|
|
13577
13666
|
console.error(`❌ Invalid guideline type: "${type}"`);
|
|
@@ -13606,7 +13695,7 @@ ${"═".repeat(60)}
|
|
|
13606
13695
|
}
|
|
13607
13696
|
}
|
|
13608
13697
|
async function listGuidelineTypes(deps) {
|
|
13609
|
-
const d = deps ?? await
|
|
13698
|
+
const d = deps ?? await createDefaultDeps14();
|
|
13610
13699
|
const sessionId = d.session.getSessionId();
|
|
13611
13700
|
if (!sessionId) {
|
|
13612
13701
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13648,7 +13737,7 @@ __export(exports_artifact, {
|
|
|
13648
13737
|
viewArtifact: () => viewArtifact,
|
|
13649
13738
|
createArtifact: () => createArtifact
|
|
13650
13739
|
});
|
|
13651
|
-
async function
|
|
13740
|
+
async function createDefaultDeps15() {
|
|
13652
13741
|
const client2 = await getConvexClient();
|
|
13653
13742
|
return {
|
|
13654
13743
|
backend: {
|
|
@@ -13663,7 +13752,7 @@ async function createDefaultDeps14() {
|
|
|
13663
13752
|
};
|
|
13664
13753
|
}
|
|
13665
13754
|
async function createArtifact(chatroomId, options, deps) {
|
|
13666
|
-
const d = deps ?? await
|
|
13755
|
+
const d = deps ?? await createDefaultDeps15();
|
|
13667
13756
|
const sessionId = d.session.getSessionId();
|
|
13668
13757
|
if (!sessionId) {
|
|
13669
13758
|
formatAuthError(d.session.getConvexUrl(), d.session.getOtherSessionUrls());
|
|
@@ -13717,7 +13806,7 @@ async function createArtifact(chatroomId, options, deps) {
|
|
|
13717
13806
|
}
|
|
13718
13807
|
}
|
|
13719
13808
|
async function viewArtifact(chatroomId, options, deps) {
|
|
13720
|
-
const d = deps ?? await
|
|
13809
|
+
const d = deps ?? await createDefaultDeps15();
|
|
13721
13810
|
const sessionId = d.session.getSessionId();
|
|
13722
13811
|
if (!sessionId) {
|
|
13723
13812
|
formatAuthError(d.session.getConvexUrl(), d.session.getOtherSessionUrls());
|
|
@@ -13761,7 +13850,7 @@ async function viewArtifact(chatroomId, options, deps) {
|
|
|
13761
13850
|
}
|
|
13762
13851
|
}
|
|
13763
13852
|
async function viewManyArtifacts(chatroomId, options, deps) {
|
|
13764
|
-
const d = deps ?? await
|
|
13853
|
+
const d = deps ?? await createDefaultDeps15();
|
|
13765
13854
|
const sessionId = d.session.getSessionId();
|
|
13766
13855
|
if (!sessionId) {
|
|
13767
13856
|
formatAuthError(d.session.getConvexUrl(), d.session.getOtherSessionUrls());
|
|
@@ -13827,7 +13916,7 @@ var exports_get_system_prompt = {};
|
|
|
13827
13916
|
__export(exports_get_system_prompt, {
|
|
13828
13917
|
getSystemPrompt: () => getSystemPrompt
|
|
13829
13918
|
});
|
|
13830
|
-
async function
|
|
13919
|
+
async function createDefaultDeps16() {
|
|
13831
13920
|
const client2 = await getConvexClient();
|
|
13832
13921
|
return {
|
|
13833
13922
|
backend: {
|
|
@@ -13842,7 +13931,7 @@ async function createDefaultDeps15() {
|
|
|
13842
13931
|
};
|
|
13843
13932
|
}
|
|
13844
13933
|
async function getSystemPrompt(chatroomId, options, deps) {
|
|
13845
|
-
const d = deps ?? await
|
|
13934
|
+
const d = deps ?? await createDefaultDeps16();
|
|
13846
13935
|
const { role } = options;
|
|
13847
13936
|
const sessionId = d.session.getSessionId();
|
|
13848
13937
|
if (!sessionId) {
|
|
@@ -14364,7 +14453,7 @@ async function discoverModels(agentServices) {
|
|
|
14364
14453
|
}
|
|
14365
14454
|
return results;
|
|
14366
14455
|
}
|
|
14367
|
-
function
|
|
14456
|
+
function createDefaultDeps17() {
|
|
14368
14457
|
return {
|
|
14369
14458
|
backend: {
|
|
14370
14459
|
mutation: async () => {
|
|
@@ -14502,7 +14591,7 @@ async function initDaemon() {
|
|
|
14502
14591
|
const agentServices = new Map(getAllHarnesses().map((s) => [s.id, s]));
|
|
14503
14592
|
const availableModels = await registerCapabilities(client2, typedSessionId, config3, agentServices);
|
|
14504
14593
|
await connectDaemon(client2, typedSessionId, machineId, convexUrl);
|
|
14505
|
-
const deps =
|
|
14594
|
+
const deps = createDefaultDeps17();
|
|
14506
14595
|
deps.backend.mutation = (endpoint, args) => client2.mutation(endpoint, args);
|
|
14507
14596
|
deps.backend.query = (endpoint, args) => client2.query(endpoint, args);
|
|
14508
14597
|
const events = new DaemonEventBus;
|
|
@@ -15568,7 +15657,7 @@ async function isChatroomInstalledDefault() {
|
|
|
15568
15657
|
return false;
|
|
15569
15658
|
}
|
|
15570
15659
|
}
|
|
15571
|
-
async function
|
|
15660
|
+
async function createDefaultDeps18() {
|
|
15572
15661
|
const client2 = await getConvexClient();
|
|
15573
15662
|
const fs = await import("fs/promises");
|
|
15574
15663
|
return {
|
|
@@ -15596,7 +15685,7 @@ async function createDefaultDeps17() {
|
|
|
15596
15685
|
};
|
|
15597
15686
|
}
|
|
15598
15687
|
async function installTool(options = {}, deps) {
|
|
15599
|
-
const d = deps ?? await
|
|
15688
|
+
const d = deps ?? await createDefaultDeps18();
|
|
15600
15689
|
const { checkExisting = true } = options;
|
|
15601
15690
|
const os = await import("os");
|
|
15602
15691
|
const path2 = await import("path");
|
|
@@ -16057,8 +16146,8 @@ async function maybeRequireAuth() {
|
|
|
16057
16146
|
console.log("⚠️ Skipping authentication (--skip-auth flag)");
|
|
16058
16147
|
return;
|
|
16059
16148
|
}
|
|
16060
|
-
const { requireAuth:
|
|
16061
|
-
await
|
|
16149
|
+
const { requireAuth: requireAuth4 } = await Promise.resolve().then(() => (init_middleware(), exports_middleware));
|
|
16150
|
+
await requireAuth4();
|
|
16062
16151
|
}
|
|
16063
16152
|
var authCommand = program2.command("auth").description("Manage CLI authentication");
|
|
16064
16153
|
authCommand.command("login").description("Authenticate the CLI via browser").option("-f, --force", "Re-authenticate even if already logged in").action(async (options) => {
|
|
@@ -16262,6 +16351,17 @@ backlogCommand.command("mark-for-review").description("Mark a backlog task as re
|
|
|
16262
16351
|
const { markForReviewBacklog: markForReviewBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
|
|
16263
16352
|
await markForReviewBacklog2(options.chatroomId, options);
|
|
16264
16353
|
});
|
|
16354
|
+
var skillCommand = program2.command("skill").description("Manage and activate chatroom skills");
|
|
16355
|
+
skillCommand.command("list").description("List available skills for a chatroom").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").action(async (options) => {
|
|
16356
|
+
await maybeRequireAuth();
|
|
16357
|
+
const { listSkills: listSkills2 } = await Promise.resolve().then(() => (init_skill(), exports_skill));
|
|
16358
|
+
await listSkills2(options.chatroomId, { role: options.role });
|
|
16359
|
+
});
|
|
16360
|
+
skillCommand.command("activate <skill-name>").description("Activate a named skill in the chatroom").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").action(async (skillName, options) => {
|
|
16361
|
+
await maybeRequireAuth();
|
|
16362
|
+
const { activateSkill: activateSkill2 } = await Promise.resolve().then(() => (init_skill(), exports_skill));
|
|
16363
|
+
await activateSkill2(options.chatroomId, skillName, { role: options.role });
|
|
16364
|
+
});
|
|
16265
16365
|
var messagesCommand = program2.command("messages").description("List and filter chatroom messages");
|
|
16266
16366
|
messagesCommand.command("list").description("List messages by sender role or since a specific message").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").option("--sender-role <senderRole>", "Filter by sender role (e.g., user, builder, reviewer)").option("--since-message-id <messageId>", "Get all messages since this message ID (inclusive)").option("--limit <n>", "Maximum number of messages to show").option("--full", "Show full message content without truncation").action(async (options) => {
|
|
16267
16367
|
if (!options.senderRole && !options.sinceMessageId) {
|