@inceptionstack/roundhouse 0.4.2 → 0.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inceptionstack/roundhouse",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "type": "module",
5
5
  "description": "Multi-platform chat gateway that routes messages through a configured AI agent",
6
6
  "license": "MIT",
package/src/bundle.ts CHANGED
@@ -183,7 +183,7 @@ export function provisionMcporterConfig(opts: ProvisionOpts = {}): void {
183
183
  }
184
184
 
185
185
  /**
186
- * Provision all bundle dependencies (skills + CLI tools + config).
186
+ * Provision all bundle dependencies (skills + CLI tools + config + extensions).
187
187
  * Non-fatal — logs warnings on failure but never throws.
188
188
  */
189
189
  export function provisionBundle(opts: ProvisionOpts = {}): void {
@@ -192,4 +192,45 @@ export function provisionBundle(opts: ProvisionOpts = {}): void {
192
192
  provisionPlaywright(opts);
193
193
  provisionUvx(opts);
194
194
  provisionMcporterConfig(opts);
195
+ provisionExtensions(opts);
196
+ }
197
+
198
+ /**
199
+ * Ensure core extensions are listed in ~/.pi/agent/settings.json packages array.
200
+ */
201
+ export function provisionExtensions(opts: ProvisionOpts = {}): void {
202
+ const { log = defaultLog } = opts;
203
+ const settingsPath = resolve(homedir(), ".pi", "agent", "settings.json");
204
+
205
+ const coreExtensions = [
206
+ "npm:@inceptionstack/pi-hard-no",
207
+ "npm:@inceptionstack/pi-branch-enforcer",
208
+ ];
209
+
210
+ try {
211
+ let settings: Record<string, unknown> = {};
212
+ if (existsSync(settingsPath)) {
213
+ settings = JSON.parse(readFileSync(settingsPath, "utf8"));
214
+ }
215
+ if (!Array.isArray(settings.packages)) settings.packages = [];
216
+ const pkgs = settings.packages as string[];
217
+
218
+ let added = 0;
219
+ for (const ext of coreExtensions) {
220
+ if (!pkgs.includes(ext)) {
221
+ pkgs.push(ext);
222
+ added++;
223
+ }
224
+ }
225
+
226
+ if (added > 0) {
227
+ mkdirSync(dirname(settingsPath), { recursive: true });
228
+ writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
229
+ log.ok(`${added} extension(s) added to settings.json`);
230
+ } else {
231
+ log.ok("extensions (already configured)");
232
+ }
233
+ } catch (err: any) {
234
+ log.warn(`extensions provisioning failed: ${err.message}`);
235
+ }
195
236
  }
package/src/cli/setup.ts CHANGED
@@ -137,6 +137,15 @@ function resolveAgentForSetup(opts: SetupOptions): AgentDefinition {
137
137
  const pkgs = settings.packages as string[];
138
138
  if (!pkgs.includes(selfPkg)) pkgs.push(selfPkg);
139
139
 
140
+ // Add code review + branch protection extensions
141
+ const coreExtensions = [
142
+ "npm:@inceptionstack/pi-hard-no",
143
+ "npm:@inceptionstack/pi-branch-enforcer",
144
+ ];
145
+ for (const ext of coreExtensions) {
146
+ if (!pkgs.includes(ext)) pkgs.push(ext);
147
+ }
148
+
140
149
  // Add pi-psst if using psst
141
150
  if (ctx.psst) {
142
151
  const psstPkg = "npm:@miclivs/pi-psst";
package/src/gateway.ts CHANGED
@@ -639,6 +639,18 @@ export class Gateway {
639
639
  lines.push(`📝 Context: no usage data yet (${windowK}K window)`);
640
640
  }
641
641
 
642
+ // Extensions
643
+ const extensions = Array.isArray(info.extensions) ? info.extensions as string[] : [];
644
+ if (extensions.length > 0) {
645
+ lines.push(``);
646
+ lines.push(`🧩 Extensions (${extensions.length}):`);
647
+ for (const ext of extensions) {
648
+ // Show short name: strip npm: prefix and path noise
649
+ const short = ext.replace(/^.*node_modules\//, "").replace(/\/index\.[tj]s$/, "");
650
+ lines.push(` • ${short}`);
651
+ }
652
+ }
653
+
642
654
  await this.postWithFallback(thread, lines.join("\n"));
643
655
  console.log(`[roundhouse] /status for thread=${thread.id} agentThread=${agentThreadId}`);
644
656
  return;