0101-agents 0.1.1 → 0.1.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.
Files changed (2) hide show
  1. package/bin/cli.js +25 -5
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -135,9 +135,11 @@ function unzipInto(zipPath, destDir, { skipPrefix } = {}) {
135
135
  // Use the system unzip binary. Available everywhere except bare Windows.
136
136
  mkdirSync(destDir, { recursive: true })
137
137
  if (skipPrefix) {
138
- // unzip with -x excludes paths matching glob patterns.
138
+ // unzip's -x excludes paths matching glob patterns. `<prefix>/*` catches
139
+ // every file under the directory; the bare directory entry (e.g. `data/`)
140
+ // is harmless to re-extract because it just re-creates the dir shell.
139
141
  execSync(
140
- `unzip -q -o "${zipPath}" -d "${destDir}" -x "${skipPrefix}/*" "${skipPrefix}"`,
142
+ `unzip -q -o "${zipPath}" -d "${destDir}" -x "${skipPrefix}/*"`,
141
143
  { stdio: 'inherit' },
142
144
  )
143
145
  } else {
@@ -247,6 +249,7 @@ async function cmdUpdate(args) {
247
249
  return
248
250
  }
249
251
 
252
+ console.log(dim('Your data/ folder is preserved (memory, projects, custom files).'))
250
253
  const ans = await prompt(`Update ${agent} ${current ?? '?'} → ${manifest.latest}? [Y/n] `)
251
254
  if (ans && !/^y(es)?$/i.test(ans)) {
252
255
  info('Cancelled.')
@@ -309,8 +312,22 @@ async function cmdStart(args) {
309
312
  // 0101-agents start marketer --resume
310
313
  // 0101-agents start marketer -- --resume (explicit separator)
311
314
  // The `--` is optional; if present, we drop it.
312
- let claudeArgs = args.slice(1)
313
- if (claudeArgs[0] === '--') claudeArgs = claudeArgs.slice(1)
315
+ let rest = args.slice(1)
316
+ if (rest[0] === '--') rest = rest.slice(1)
317
+
318
+ // --tg expands to the flags needed to run as a Telegram channel bot.
319
+ // Keeping this in the CLI (not in shell wrappers) means flag changes
320
+ // ship via 'npm i -g 0101-agents@latest' instead of per-server re-installs.
321
+ const tgIndex = rest.indexOf('--tg')
322
+ let claudeArgs = rest
323
+ if (tgIndex !== -1) {
324
+ claudeArgs = [
325
+ ...rest.slice(0, tgIndex),
326
+ '--channels', 'plugin:telegram@claude-plugins-official',
327
+ '--dangerously-skip-permissions',
328
+ ...rest.slice(tgIndex + 1),
329
+ ]
330
+ }
314
331
 
315
332
  // Hand the terminal over to `claude` with cwd set to the agent dir. When
316
333
  // claude exits, the user returns to their original shell location.
@@ -333,12 +350,15 @@ Commands:
333
350
  ${bold('whoami')} Show current license
334
351
  ${bold('install')} <agent> [--force] Install an agent
335
352
  ${bold('update')} <agent> Update an installed agent (preserves data/)
336
- ${bold('start')} <agent> [-- args] Open the agent (runs claude inside its dir)
353
+ ${bold('start')} <agent> [--tg] [-- args] Open the agent (runs claude in its dir)
354
+ --tg adds the right flags to run as a
355
+ Telegram channel bot.
337
356
  ${bold('list')} List installed agents
338
357
  ${bold('help')} Show this message
339
358
 
340
359
  Examples:
341
360
  0101-agents start marketer
361
+ 0101-agents start marketer --tg
342
362
  0101-agents start marketer --resume
343
363
  0101-agents start marketer -- -p "audit https://example.com"
344
364
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0101-agents",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "0101-agents": "./bin/cli.js"