superuser.app 0.0.0 → 0.0.1

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 CHANGED
@@ -1,67 +1,67 @@
1
1
  # Superuser Package Manager
2
2
  ## Extend AI agents with tools, instantly
3
3
 
4
- `ibot` is the official CLI for publishing [Superuser](https://instant.chat) packages.
5
- You can use this utility to publish new packages to the Superuser package registry,
6
- available at [instant.chat/packages](https://instant.chat/packages).
4
+ `sutr` is the official CLI for publishing [Superuser](https://superuser.app) packages.
5
+ You can use this utility to publish new packages to the Superuser toolkit registry,
6
+ available at [superuser.app/packages](https://superuser.app/packages).
7
7
 
8
- [Superuser](https://instant.chat) enables you to rapidly build custom
8
+ [Superuser](https://superuser.app) enables you to rapidly build custom
9
9
  chatbots and AI agents that can be extended with custom tools. It provides four
10
10
  major features;
11
11
 
12
12
  1. Chat with and develop your agent in real time from the web
13
- 2. Extend your agent with [hosted tool packages](https://instant.chat/packages)
13
+ 2. Extend your agent with [hosted tool packages](https://superuser.app/packages)
14
14
  3. Write your own private tool packages for your agents
15
15
  4. Deploy your agent to third-party services like Discord and Slack
16
16
 
17
- ## What is the Superuser Package Registry?
17
+ ## What is the Superuser toolkit registry?
18
18
 
19
- The Superuser Package Registry is a **serverless hosting platform and registry** for
19
+ The Superuser toolkit registry is a **serverless hosting platform and registry** for
20
20
  building tools that extend AI chatbots and agents.
21
21
 
22
- **Superuser packages are just REST API servers.**
22
+ **Superuser toolkits are just REST API servers.**
23
23
  Every package is an [Instant API](https://github.com/instant-dev/api) project,
24
24
  which is a simple way to export and auto-document JavaScript functions as REST endpoints
25
25
  that can be called via any HTTP client.
26
26
 
27
27
  Authentication to your published packages are handled via **API keychains** which
28
- are delegated via [Superuser](https://instant.chat).
28
+ are delegated via [Superuser](https://superuser.app).
29
29
 
30
30
  **NOTE:** While in beta, only Superuser agents can use your published tools.
31
31
  We'll be opening up the gateway to programmatic access in the coming months.
32
32
 
33
33
  ## Superuser Package vs. MCP
34
34
 
35
- Reminder, **Superuser packages are just REST API servers.**
35
+ Reminder, **Superuser toolkits are just REST API servers.**
36
36
 
37
37
  MCP, or Model Context Protocol, is a standard for passing tool and prompt context
38
- between AI models and service providers. Superuser packages are **not**
38
+ between AI models and service providers. Superuser toolkits are **not**
39
39
  MCP compatible out of the box, as they are simply REST APIs. However, it is our goal to add
40
40
  MCP bindings to the [Instant API](https://github.com/instant-dev/api) framework which
41
- powers all Superuser packages. When formalized, this will allow you to use
42
- Superuser packages with any MCP-compatible client or service provider.
41
+ powers all Superuser toolkits. When formalized, this will allow you to use
42
+ Superuser toolkits with any MCP-compatible client or service provider.
43
43
  Contributors welcome!
44
44
 
45
45
  ## Quickstart
46
46
 
47
- Visit [instant.chat/signup](https://instant.chat/signup) to register.
47
+ Visit [superuser.app/signup](https://superuser.app/signup) to register.
48
48
  Creating a new bot is easy, you can then use this CLI to develop
49
49
  and publish custom packages to extend your bots.
50
50
 
51
51
  ```shell
52
- $ npm i ibot -g
52
+ $ npm i superuser.app -g
53
53
  $ mkdir new-project
54
54
  $ cd new-project
55
- $ ibot init # initialize project in this directory
56
- $ ibot login # log in to Superuser Package Registry with your Superuser account
57
- $ ibot serve # run your tool package on a local server to test
58
- $ ibot run / # test a single endpoint (like curl)
59
- $ ibot up # publish to development environment
60
- $ ibot up --env staging # publish to staging environment
61
- $ ibot up --env production # publish to production environment
55
+ $ sutr init # initialize project in this directory
56
+ $ sutr login # log in to Superuser toolkit registry with your Superuser account
57
+ $ sutr serve # run your tool package on a local server to test
58
+ $ sutr run / # test a single endpoint (like curl)
59
+ $ sutr publish # publish to development environment
60
+ $ sutr publish --env staging # publish to staging environment
61
+ $ sutr publish --env production # publish to production environment
62
62
  ```
63
63
 
64
- You can run `ibot help` at any time to see available commands.
64
+ You can run `sutr help` at any time to see available commands.
65
65
 
66
66
  # Table of contents
67
67
 
@@ -90,7 +90,7 @@ Tool packages are REST APIs that can be used by your agent. You can publish tool
90
90
  for use by your agent and others or keep them private.
91
91
 
92
92
  When you ask your agent a question that requires a tool call, Superuser will
93
- automatically route the request to the appropriate tool from the Superuser Package Registry
93
+ automatically route the request to the appropriate tool from the Superuser toolkit registry
94
94
  and call the tool on your behalf.
95
95
 
96
96
  ## How is hosting billed?
@@ -100,7 +100,7 @@ for development purposes, you can use our lowest-tier model indefinitely in rate
100
100
  on the free tier **but only while on the web interface**.
101
101
 
102
102
  Tools cost money to run, and are billed as serverless functions
103
- at a rate of [$0.50 of credits per 1,000 GB-s](https://instant.chat/pricing) of usage.
103
+ at a rate of [$0.50 of credits per 1,000 GB-s](https://superuser.app/pricing) of usage.
104
104
  Credits are prepaid, and during our beta period all users get a one-time bonus of $1.00
105
105
  in free usage credits.
106
106
 
@@ -112,33 +112,33 @@ For example, a function with 512 MB (0.5 GB) of RAM running for 200ms would use:
112
112
 
113
113
  # Building custom packages for your bots
114
114
 
115
- Building bots on [Superuser](https://instant.chat) is straightforward. Extending
115
+ Building bots on [Superuser](https://superuser.app) is straightforward. Extending
116
116
  with custom tool packages can be done online via the web interface, or if you prefer
117
117
  working with your own editor, you can use this CLI.
118
118
 
119
119
  ## Initialize a project
120
120
 
121
- To initialize a new Superuser package:
121
+ To initialize a new Superuser toolkit:
122
122
 
123
123
  ```shell
124
- $ npm i ibot -g
124
+ $ npm i sutr -g
125
125
  $ mkdir new-project
126
126
  $ cd new-project
127
- $ ibot init
127
+ $ sutr init
128
128
  ```
129
129
 
130
- You'll be walked through the process. The `ibot` CLI will automatically check for
130
+ You'll be walked through the process. The `sutr` CLI will automatically check for
131
131
  updates to core packages, so make sure you update when available. To play around with your
132
- Superuser package locally;
132
+ Superuser toolkit locally;
133
133
 
134
134
  ```shell
135
- $ ibot serve
135
+ $ sutr serve
136
136
  ```
137
137
 
138
138
  Will start an HTTP server. To execute a standalone endpoint / tool:
139
139
 
140
140
  ```shell
141
- $ ibot run /
141
+ $ sutr run /
142
142
  ```
143
143
 
144
144
  ### Defining tools aka endpoints
@@ -147,9 +147,9 @@ Defining custom tools is easy. You'll find the terms **tool** and
147
147
  **endpoint** used interchangeably as they all refer
148
148
  to the same thing: your bot executing custom code in the cloud.
149
149
 
150
- A **tool** is just an **endpoint** hosted by the Superuser Package Registry.
150
+ A **tool** is just an **endpoint** hosted by the Superuser toolkit registry.
151
151
 
152
- All endpoints for Superuser packages live in the `functions/` directory.
152
+ All endpoints for Superuser toolkits live in the `functions/` directory.
153
153
  Each file name maps to the endpoint route e.g. `functions/hello.js`
154
154
  routes to `localhost:8000/hello`. You can export custom `GET`, `POST`, `PUT`
155
155
  and `DELETE` functions from every file. Here's an example "hello world" endpoint:
@@ -173,7 +173,7 @@ your tool package.
173
173
  ### Endpoint name, description, types
174
174
 
175
175
  Using the comment block above every exported method (e.g. GET) you can
176
- define your endpoint. Superuser packages use an open source specification called
176
+ define your endpoint. Superuser toolkits use an open source specification called
177
177
  [Instant API](https://github.com/instant-dev/api) to export JavaScript
178
178
  functions as type safe web APIs. You can learn more about how to properly
179
179
  define and document the shape (parameters) of your API there.
@@ -197,14 +197,14 @@ they will be billed from their balance.
197
197
  To deploy a public project to a `development` environment, you can use:
198
198
 
199
199
  ```shell
200
- $ ibot up
200
+ $ sutr publish
201
201
  ```
202
202
 
203
203
  You can also publish to `staging` and `production` using:
204
204
 
205
205
  ```shell
206
- $ ibot up --env staging
207
- $ ibot up --env production
206
+ $ sutr publish --env staging
207
+ $ sutr publish --env production
208
208
  ```
209
209
 
210
210
  ### Private packages
@@ -233,15 +233,15 @@ There are a few additional utilities you may find useful with this package;
233
233
 
234
234
  ```shell
235
235
  # generates functions/my-endpoint/example.js
236
- $ ibot g:endpoint my-endpoint/example
236
+ $ sutr g:endpoint my-endpoint/example
237
237
  ```
238
238
 
239
239
  ## Generate tests
240
240
 
241
241
  ```shell
242
242
  # Generate blank tests or ones for an endpoint
243
- $ ibot g:test my_test # OR ...
244
- $ ibot g:test --endpoint my-endpoint/example
243
+ $ sutr g:test my_test # OR ...
244
+ $ sutr g:test --endpoint my-endpoint/example
245
245
  ```
246
246
 
247
247
  ## Run tests
@@ -249,7 +249,7 @@ $ ibot g:test --endpoint my-endpoint/example
249
249
  You can write tests for your tools to verify they work. Simply run;
250
250
 
251
251
  ```shell
252
- $ ibot test
252
+ $ sutr test
253
253
  ```
254
254
 
255
255
  And voila!
@@ -273,7 +273,7 @@ to another user of the platform.
273
273
 
274
274
  # Roadmap
275
275
 
276
- There's a lot to build! [Superuser](https://instant.chat) is still in early beta. Coming soon;
276
+ There's a lot to build! [Superuser](https://superuser.app) is still in early beta. Coming soon;
277
277
 
278
278
  - Deploy to Slack
279
279
  - Uploading image support
@@ -289,7 +289,7 @@ but feel free to bookmark all of these links.
289
289
 
290
290
  | Destination | Link |
291
291
  | ----------- | ---- |
292
- | Superuser | [instant.chat](https://instant.chat) |
292
+ | Superuser | [superuser.app](https://superuser.app) |
293
293
  | GitHub | [github.com/instantbots](https://github.com/instantbots) |
294
294
  | Discord | [discord.gg/instant](https://discord.gg/instant) |
295
295
  | X / instantbots | [x.com/instantbots](https://x.com/instantbots) |
package/commands/init.js CHANGED
@@ -88,7 +88,7 @@ class InitCommand extends Command {
88
88
  if ((pkgExists || functExists) && !force) {
89
89
  throw new Error(
90
90
  `You already have a project initialized here.\n` +
91
- `If you want to overwrite it, use \`$ ibot init --force\``
91
+ `If you want to overwrite it, use \`$ sup init --force\``
92
92
  );
93
93
  } else {
94
94
  console.log(`✨ We've detected you're starting from scratch`);
@@ -195,12 +195,12 @@ class InitCommand extends Command {
195
195
  `Here are some helpful commands to get started:`,
196
196
  ``,
197
197
  `(1) Create a set of endpoints for a path (create, read, update, destroy):`,
198
- colors.grey.bold(` $ ibot g:endpoint path/to/endpoint\n`),
198
+ colors.grey.bold(` $ sup g:endpoint path/to/endpoint\n`),
199
199
  `(2) Run your dev server:`,
200
- colors.grey.bold(` $ ibot serve`),
200
+ colors.grey.bold(` $ sup serve`),
201
201
  ``,
202
202
  `For more information about ${colors.bold(`Superuser`)}:`,
203
- ` Home => ${colors.bold.underline.blue('https://instant.chat')}`,
203
+ ` Home => ${colors.bold.underline.blue('https://superuser.app')}`,
204
204
  ` GitHub => ${colors.bold.underline.blue('https://github.com/instantbots')}`,
205
205
  ` Discord => ${colors.bold.underline.blue('https://discord.gg/instant')}`,
206
206
  ` X => ${colors.bold.underline.blue('https://x.com/instantbots')}`,
package/commands/login.js CHANGED
@@ -14,7 +14,7 @@ class LoginCommand extends Command {
14
14
 
15
15
  help () {
16
16
  return {
17
- description: 'Login to the Superuser Package Registry',
17
+ description: 'Login to the Superuser toolkit registry',
18
18
  args: [],
19
19
  flags: {},
20
20
  vflags: {
@@ -101,7 +101,10 @@ class LoginCommand extends Command {
101
101
  console.log(colors.bold(`${colors.cyan(`Logged in`)} to ${colors.green('Superuser')} successfully!`));
102
102
  console.log(`${colors.bold(`email`)}: ${user.email}`);
103
103
  if (user.memberships && user.memberships.length) {
104
- console.log(`${colors.bold(`username`)}: ${user.memberships[0].organization.name}`);
104
+ const membership = user.memberships.find(m => m.organization?.is_user_primary);
105
+ if (membership) {
106
+ console.log(`${colors.bold(`username`)}: ${membership.organization.name}`);
107
+ }
105
108
  }
106
109
  console.log(`${colors.bold(`login at`)}: ${token.created_at}`);
107
110
  console.log();
@@ -19,7 +19,7 @@ const DEFAULT_IGNORE = [
19
19
  '.git', // do not deploy git history
20
20
  '.DS_Store', // do not deploy macOS files
21
21
  'package-lock.json', // deps installed from package.json
22
- 'serve.instant.js' // not used by Superuser Package Registry; irrelevant
22
+ 'serve.instant.js' // not used by Superuser toolkit registry; irrelevant
23
23
  ];
24
24
 
25
25
  function formatSize (size) {
@@ -76,12 +76,12 @@ function readFiles (base, properties, dir, data) {
76
76
  class UpCommand extends Command {
77
77
 
78
78
  constructor() {
79
- super('up');
79
+ super('publish');
80
80
  }
81
81
 
82
82
  help () {
83
83
  return {
84
- description: 'Deploys your project to the Superuser Package Registry',
84
+ description: 'Deploys your toolkit to the Superuser toolkit registry',
85
85
  args: [],
86
86
  flags: {
87
87
  v: 'Verbose mode; print full details of packaging'
@@ -130,9 +130,9 @@ class UpCommand extends Command {
130
130
  console.log();
131
131
 
132
132
  !fs.existsSync('/tmp') && fs.mkdirSync('/tmp');
133
- !fs.existsSync('/tmp/ibot') && fs.mkdirSync('/tmp/ibot', 0o777);
133
+ !fs.existsSync('/tmp/sutr') && fs.mkdirSync('/tmp/sutr', 0o777);
134
134
  const tmpName = name.replace(/\//g, '.');
135
- const tmpPath = `/tmp/ibot/${tmpName}.${new Date().valueOf()}.tar.gz`;
135
+ const tmpPath = `/tmp/sutr/${tmpName}.${new Date().valueOf()}.tar.gz`;
136
136
 
137
137
  const t0 = new Date().valueOf();
138
138
 
@@ -140,9 +140,9 @@ class UpCommand extends Command {
140
140
  const pack = tar.pack();
141
141
 
142
142
  let ignore = DEFAULT_IGNORE.slice();
143
- if (fs.existsSync(path.join(process.cwd(), '.ibotignore'))) {
143
+ if (fs.existsSync(path.join(process.cwd(), '.sutrignore'))) {
144
144
  ignore = ignore.concat(
145
- fs.readFileSync(path.join(process.cwd(), '.ibotignore')).toString()
145
+ fs.readFileSync(path.join(process.cwd(), '.sutrignore')).toString()
146
146
  .split('\n')
147
147
  .map(line => line.trim())
148
148
  .filter(line => !!line && !line.trim().startsWith('#'))
@@ -204,20 +204,18 @@ class UpCommand extends Command {
204
204
  {
205
205
  name: name,
206
206
  environment: env,
207
- timeout: Math.max(1, Math.min(parseInt(functJSON.timeout) || 0), 900),
208
207
  tarball: {_base64: result.toString('base64')},
209
208
  _stream: true
210
209
  },
211
210
  ({event, data, id}) => {
212
211
  if (event === '@response') {
213
- let json;
212
+ let result = data;
214
213
  try {
215
- json = JSON.parse(data.body);
216
- data.data = json;
214
+ result.data = JSON.parse(data.body);
217
215
  } catch (e) {
218
216
  // do nothing;
219
217
  }
220
- resolve(data);
218
+ resolve(result);
221
219
  } else if (event === 'log') {
222
220
  console.log(`${colors.bold.grey(`Deploy:`)} ${data}`);
223
221
  }
@@ -241,11 +239,15 @@ class UpCommand extends Command {
241
239
  }
242
240
 
243
241
  const url = upResult.data.version_urls[env];
242
+ const registryUrl = upResult.data.registry_urls?.[env];
244
243
  const time = new Date().valueOf() - t0;
245
244
 
246
245
  console.log();
247
246
  console.log(`${colors.bold.green('Success:')} ${colors.bold(name)} deployed to ${colors.bold.grey(env)} in ${time} ms!`);
248
- console.log(` => ${colors.bold.blue(url)}`);
247
+ if (registryUrl) {
248
+ console.log(` Registry URL => ${colors.bold.blue(registryUrl)}`);
249
+ }
250
+ console.log(` Web URL => ${colors.bold.blue(url)}`);
249
251
  console.log();
250
252
 
251
253
  return void 0;
@@ -15,7 +15,7 @@ class RegisterCommand extends Command {
15
15
 
16
16
  help () {
17
17
  return {
18
- description: 'Registers a new user account with the Superuser Package Registry',
18
+ description: 'Registers a new user account with the Superuser toolkit registry',
19
19
  args: [],
20
20
  flags: {},
21
21
  vflags: {}
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- BASE_URL: 'https://api.instant.chat'
2
+ BASE_URL: 'https://api.superuser.app'
3
3
  };
@@ -16,7 +16,7 @@ module.exports = async (params = null, validate = false) => {
16
16
  if (validate) {
17
17
  throw new Error(
18
18
  `No "superuser.json" in this directory. Are you sure you meant to do this?\n` +
19
- `Run \`$ ibot init\` to initialize a project here if you are.`
19
+ `Run \`$ sup init\` to initialize a project here if you are.`
20
20
  );
21
21
  }
22
22
  } else {
@@ -2,7 +2,7 @@ const os = require('os');
2
2
  const fs = require('fs');
3
3
  const path = require('path');
4
4
 
5
- const SETTINGS_FILENAME = '~/.ibotrc';
5
+ const SETTINGS_FILENAME = '~/.surc';
6
6
 
7
7
  const parsePathname = (pathname) => {
8
8
  if (!pathname) {
@@ -61,7 +61,7 @@ function readSettings (validate = false) {
61
61
  i++;
62
62
  }
63
63
  if (validate && !profileList[0]) {
64
- throw new Error(`You are not logged in. Try \`ibot login\` to log in first.`);
64
+ throw new Error(`You are not logged in. Try \`sup login\` to log in first.`);
65
65
  }
66
66
  return {
67
67
  activeProfile: profileList[0],
@@ -17,13 +17,13 @@ module.exports = async (print = false) => {
17
17
  }
18
18
  const packages = [
19
19
  {
20
- title: 'Superuser Package CLI',
20
+ title: 'Superuser toolkit registry',
21
21
  name: pkgs.self.name,
22
22
  version: pkgs.self.version,
23
23
  global: true
24
24
  },
25
25
  {
26
- title: 'Superuser Package Gateway (Instant API)',
26
+ title: 'Superuser toolkit gateway (Instant API)',
27
27
  name: pkgs.api ? pkgs.api.name : null,
28
28
  version: pkgs.api ? pkgs.api.version : null,
29
29
  dev: true
@@ -63,7 +63,7 @@ module.exports = async (print = false) => {
63
63
  drawBox.center(
64
64
  `yellow`,
65
65
  ``,
66
- `Updates are available for ${colors.bold('ibot')}:`,
66
+ `Updates are available for ${colors.bold('sutr')}:`,
67
67
  ``,
68
68
  ...updatePackages.map(pkg => {
69
69
  return [
@@ -74,7 +74,7 @@ module.exports = async (print = false) => {
74
74
  ].join('\n')
75
75
  }),
76
76
  `Install all with:`,
77
- `${colors.bold.grey(`ibot update`)}`,
77
+ `${colors.bold.grey(`sup update`)}`,
78
78
  ``
79
79
  )
80
80
  );
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { CommandLineInterface } = require('cmnd');
4
- const CLI = new CommandLineInterface('Superuser Package CLI');
4
+ const CLI = new CommandLineInterface('Superuser toolkit registry');
5
5
 
6
6
  CLI.load(__dirname, './commands');
7
7
  CLI.run(process.argv.slice(2));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "superuser.app",
3
- "version": "0.0.0",
4
- "description": "Superuser package manager: command line interface for building toolkits for your agents",
3
+ "version": "0.0.1",
4
+ "description": "Superuser toolkit registry: command line interface for building toolkits for your agents",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "/commands",
@@ -12,7 +12,7 @@
12
12
  "test": "echo \"Error: no test specified\" && exit 1"
13
13
  },
14
14
  "bin": {
15
- "sup": "index.js"
15
+ "sutr": "index.js"
16
16
  },
17
17
  "author": "Keith Horwood",
18
18
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "colors": "^1.4.0",
22
22
  "i": "^0.3.7",
23
23
  "inquirer": "^8.2.6",
24
- "io": "^1.5.0",
24
+ "io": "^1.5.8",
25
25
  "minimatch": "^9.0.4",
26
26
  "semver": "^7.5.4",
27
27
  "tar-stream": "^3.1.7",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file is ** NOT ** used in production on the Superuser Package Registry
2
+ * This file is ** NOT ** used in production on the Superuser toolkit registry
3
3
  * Any code you change here ** WILL NOT ** run when hosted with Superuser Package
4
4
  *
5
5
  * However, it used for local development and allows you to ship your Superuser Package