hubify 0.1.1 → 0.2.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/.hubify/skills/vercel-labs-vercel-deployment/.hubify.yaml +29 -0
- package/.hubify/skills/vercel-labs-vercel-deployment/SKILL.md +52 -0
- package/.turbo/turbo-build.log +15 -0
- package/.turbo/turbo-typecheck.log +4 -0
- package/dist/chunk-FW7BS3MW.js +40 -0
- package/dist/convex-MXZDQPMB.js +10 -0
- package/dist/index.js +20532 -0
- package/package.json +48 -30
- package/.npmignore +0 -2
- package/LICENSE +0 -7
- package/README.md +0 -3
- package/lib/commands.js +0 -280
- package/lib/hubify.js +0 -63
package/package.json
CHANGED
|
@@ -1,32 +1,50 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
"name": "hubify",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "The living intelligence layer for Agent Skills",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"hubify": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsup",
|
|
12
|
+
"dev": "tsup --watch",
|
|
13
|
+
"typecheck": "tsc --noEmit",
|
|
14
|
+
"clean": "rm -rf dist",
|
|
15
|
+
"prepublishOnly": "pnpm run build"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@anthropic-ai/sdk": "^0.72.1",
|
|
19
|
+
"@hubify/shared": "workspace:*",
|
|
20
|
+
"chalk": "^5.3.0",
|
|
21
|
+
"commander": "^12.1.0",
|
|
22
|
+
"convex": "^1.17.4",
|
|
23
|
+
"dotenv": "^16.4.7",
|
|
24
|
+
"ora": "^8.1.1",
|
|
25
|
+
"yaml": "^2.6.1"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^22.10.5",
|
|
29
|
+
"tsup": "^8.3.5",
|
|
30
|
+
"tsx": "^4.19.2",
|
|
31
|
+
"typescript": "^5.7.2"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"agent",
|
|
35
|
+
"skills",
|
|
36
|
+
"ai",
|
|
37
|
+
"cli",
|
|
38
|
+
"hubify"
|
|
39
|
+
],
|
|
40
|
+
"author": "Houston",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "https://github.com/hubify/hubify.git"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://hubify.com",
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=20"
|
|
49
|
+
}
|
|
32
50
|
}
|
package/.npmignore
DELETED
package/LICENSE
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2012 Chorus Technologies, Inc. (Hubify)
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
-
|
|
5
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
DELETED
package/lib/commands.js
DELETED
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
var _ = require('underscore'),
|
|
2
|
-
async = require('async'),
|
|
3
|
-
http = require('http'),
|
|
4
|
-
url = require('url'),
|
|
5
|
-
util = require('util');
|
|
6
|
-
|
|
7
|
-
function basicAuthHeader(username, apiKey) {
|
|
8
|
-
return {
|
|
9
|
-
'Authorization': 'apikey ' + new Buffer(username + ':' + apiKey).toString('base64')
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* BaseCommand: An abstract base class for commands to implement.
|
|
15
|
-
*/
|
|
16
|
-
function BaseCommand() {}
|
|
17
|
-
|
|
18
|
-
_.extend(BaseCommand.prototype, {
|
|
19
|
-
help: function () {},
|
|
20
|
-
run: function (nconf, argv, callback) {
|
|
21
|
-
console.error('Not implemented.');
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* PrivilegedCommand: Abstract base class for commands that access protected
|
|
28
|
-
* Hubify APIs.
|
|
29
|
-
*/
|
|
30
|
-
function PrivilegedCommand() {
|
|
31
|
-
BaseCommand.call(this);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
util.inherits(PrivilegedCommand, BaseCommand);
|
|
35
|
-
|
|
36
|
-
_.extend(PrivilegedCommand.prototype, {
|
|
37
|
-
checkCredentialsExist: function(nconf) {
|
|
38
|
-
if (!nconf.get('username')) {
|
|
39
|
-
throw new Error('Missing username! Specify it using --username argument or run `hubify init`.');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (!nconf.get('apiKey')) {
|
|
43
|
-
throw new Error('Missing API key! Specify it using --apiKey argument or run `hubify init`.');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Creates a new hub script.
|
|
51
|
-
*/
|
|
52
|
-
function CreateCommand() {
|
|
53
|
-
PrivilegedCommand.call(this);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
util.inherits(CreateCommand, BaseCommand);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Deploys a hub script.
|
|
61
|
-
*/
|
|
62
|
-
function DeployCommand() {
|
|
63
|
-
PrivilegedCommand.call(this);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
util.inherits(DeployCommand, PrivilegedCommand);
|
|
67
|
-
|
|
68
|
-
_.extend(DeployCommand.prototype, {
|
|
69
|
-
help: function() {
|
|
70
|
-
console.log('\nUsage: hubify deploy [-f filename] hub-name\n' +
|
|
71
|
-
'\n' +
|
|
72
|
-
'Deploys a hubscript to hubify. Unless -f option is ' +
|
|
73
|
-
'provided will look for a script of the same name as the ' +
|
|
74
|
-
'hub ending in .js in the current directory.\n' +
|
|
75
|
-
'\nWhere:\n' +
|
|
76
|
-
' -f\tFilename of the file to deploy.\n' +
|
|
77
|
-
'\nNote: deployed scripts take immediate effect.\n');
|
|
78
|
-
},
|
|
79
|
-
run: function (nconf, argv, callback) {
|
|
80
|
-
try {
|
|
81
|
-
this.checkCredentialsExist(nconf);
|
|
82
|
-
} catch (err) {
|
|
83
|
-
return callback(err);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (argv._.length < 2) {
|
|
87
|
-
return callback(new Error('Missing argument: hub-name.'));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
var filename,
|
|
91
|
-
fs = require('fs'),
|
|
92
|
-
hubName = argv._[1];
|
|
93
|
-
|
|
94
|
-
if (argv.f) {
|
|
95
|
-
filename = argv.f;
|
|
96
|
-
} else {
|
|
97
|
-
// TODO support other file types
|
|
98
|
-
filename = hubName + '.js';
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
var host = nconf.get('host')
|
|
102
|
-
username = nconf.get('username'),
|
|
103
|
-
apiKey = nconf.get('apiKey');
|
|
104
|
-
|
|
105
|
-
async.waterfall([
|
|
106
|
-
function (callback) {
|
|
107
|
-
// Read hub script in from local file
|
|
108
|
-
fs.readFile(filename, function (err, data) {
|
|
109
|
-
if (err) { return callback(err); }
|
|
110
|
-
|
|
111
|
-
callback(null, data.toString());
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
function (script, callback) {
|
|
115
|
-
// Lookup hub ID/details via username and slug
|
|
116
|
-
var options = url.parse('http://' + host + '/api/v1/hub/?owner__username=' + username + '&slug=' + hubName);
|
|
117
|
-
options.headers = basicAuthHeader(username, apiKey);
|
|
118
|
-
|
|
119
|
-
var req = http.request(options, function (res) {
|
|
120
|
-
if (res.statusCode == 401 || res.statusCode === 403) {
|
|
121
|
-
return callback(new Error('Unable to complete your request. Invalid credentials supplied.'));
|
|
122
|
-
} else if (res.statusCode >= 400) {
|
|
123
|
-
return callback(new Error('Unable to complete your request. Server returned ' + res.statusCode));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
var body = '';
|
|
127
|
-
res.on('data', function (chunk) {
|
|
128
|
-
body += chunk;
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
res.on('end', function () {
|
|
132
|
-
var responseData = JSON.parse(body);
|
|
133
|
-
if (responseData.total === 0) {
|
|
134
|
-
return callback(new Error('Deployment failed. Hub `' + hubName + '` does not exist.'));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
var hub = responseData.results[0];
|
|
138
|
-
fs.writeFileSync(filename + '.bak', hub.definition);
|
|
139
|
-
|
|
140
|
-
callback(null, script, hub);
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
req.on('error', function (err) {
|
|
145
|
-
callback(err);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
req.end();
|
|
149
|
-
}, function (script, hub, callback) {
|
|
150
|
-
var payload = JSON.stringify({ definition: script }),
|
|
151
|
-
options = url.parse('http://' + host + '/api/v1/hub/' + hub.id + '/');
|
|
152
|
-
options.method = 'PUT';
|
|
153
|
-
options.headers = basicAuthHeader(username, apiKey);
|
|
154
|
-
options.headers['Content-Type'] = 'application/json';
|
|
155
|
-
options.headers['Content-Length'] = payload.length;
|
|
156
|
-
|
|
157
|
-
var req = http.request(options, function (res) {
|
|
158
|
-
if (res.statusCode == 401 || res.statusCode === 403) {
|
|
159
|
-
return callback(new Error('Unable to complete your request. Invalid credentials supplied.'));
|
|
160
|
-
} else if (res.statusCode >= 400) {
|
|
161
|
-
return callback(new Error('Unable to complete your request. Server returned ' + res.statusCode));
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
callback(null, 'Deployed.');
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
req.on('error', function (err) {
|
|
168
|
-
callback(err);
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
req.write(payload);
|
|
172
|
-
req.end();
|
|
173
|
-
}
|
|
174
|
-
], function (err, result) {
|
|
175
|
-
if (err) { return callback(err); }
|
|
176
|
-
|
|
177
|
-
callback(null, result);
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Initialises a hubify development environment in the current directory.
|
|
184
|
-
*/
|
|
185
|
-
function InitCommand() {
|
|
186
|
-
BaseCommand.call(this);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
util.inherits(InitCommand, BaseCommand);
|
|
190
|
-
|
|
191
|
-
_.extend(InitCommand.prototype, {
|
|
192
|
-
deps: ['async', 'cheerio', 'jsdom', 'underscore', 'underscore.string', 'hubstack'],
|
|
193
|
-
help: function() {
|
|
194
|
-
console.log('\nUsage: hubify init\n' +
|
|
195
|
-
'\n' +
|
|
196
|
-
'Initialises a hubify development environment in the ' +
|
|
197
|
-
'current directory.');
|
|
198
|
-
},
|
|
199
|
-
run: function(nconf, argv, callback) {
|
|
200
|
-
var self = this,
|
|
201
|
-
npm = require('npm'),
|
|
202
|
-
prompt = require('prompt'),
|
|
203
|
-
properties = [{
|
|
204
|
-
name: 'username',
|
|
205
|
-
description: 'Enter your Hubify username:'.white,
|
|
206
|
-
message: 'Username cannot be blank.',
|
|
207
|
-
required: true
|
|
208
|
-
},{
|
|
209
|
-
name: 'apiKey',
|
|
210
|
-
description: 'Enter your Hubify API key:'.white,
|
|
211
|
-
message: 'API key cannot be blank.',
|
|
212
|
-
required: true
|
|
213
|
-
}];
|
|
214
|
-
|
|
215
|
-
prompt.message = '';
|
|
216
|
-
prompt.delimiter = '';
|
|
217
|
-
|
|
218
|
-
prompt.start();
|
|
219
|
-
|
|
220
|
-
prompt.get(properties, function (err, result) {
|
|
221
|
-
if (err) { return handleErr(err, self); }
|
|
222
|
-
|
|
223
|
-
async.series([
|
|
224
|
-
function (callback) {
|
|
225
|
-
nconf.set('username', result.username);
|
|
226
|
-
nconf.set('apiKey', result.apiKey);
|
|
227
|
-
|
|
228
|
-
nconf.save(function (err) {
|
|
229
|
-
if (err) { callback(err); }
|
|
230
|
-
callback(null);
|
|
231
|
-
});
|
|
232
|
-
},
|
|
233
|
-
function (callback) {
|
|
234
|
-
npm.load(function () {
|
|
235
|
-
npm.commands.install(self.deps, function (err) {
|
|
236
|
-
callback(err);
|
|
237
|
-
})
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
], function (err, result) {
|
|
241
|
-
if (err) { return callback(err); }
|
|
242
|
-
|
|
243
|
-
callback(null, 'Initialized.')
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Creates a new hub script.
|
|
252
|
-
*/
|
|
253
|
-
function RollbackCommand() {
|
|
254
|
-
PrivilegedCommand.call(this);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
util.inherits(RollbackCommand, BaseCommand);
|
|
258
|
-
|
|
259
|
-
_.extend(RollbackCommand.prototype, {
|
|
260
|
-
help: function() {
|
|
261
|
-
console.log('\nUsage: hubify rollback [-f filename] hub-name\n' +
|
|
262
|
-
'\n' +
|
|
263
|
-
'Rolls back to previous version of hubscript. Unless -f option is ' +
|
|
264
|
-
'provided will look for a script of the same name as the ' +
|
|
265
|
-
'hub ending in .bak in the current directory.\n' +
|
|
266
|
-
'\nWhere:\n' +
|
|
267
|
-
' -f\tFilename of the file to deploy.\n' +
|
|
268
|
-
'\nNote: deployed scripts take immediate effect.\n');
|
|
269
|
-
},
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
module.exports = {
|
|
274
|
-
create: CreateCommand,
|
|
275
|
-
delete: BaseCommand,
|
|
276
|
-
deploy: DeployCommand,
|
|
277
|
-
init: InitCommand,
|
|
278
|
-
run: BaseCommand,
|
|
279
|
-
rollback: BaseCommand
|
|
280
|
-
};
|
package/lib/hubify.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* External imports
|
|
5
|
-
*/
|
|
6
|
-
var argv = require('optimist').argv,
|
|
7
|
-
_ = require('underscore'),
|
|
8
|
-
http = require('http'),
|
|
9
|
-
nconf = require('nconf');
|
|
10
|
-
|
|
11
|
-
/*
|
|
12
|
-
* Internal imports
|
|
13
|
-
*/
|
|
14
|
-
var commands = require('./commands');
|
|
15
|
-
|
|
16
|
-
function getUserHome() {
|
|
17
|
-
return process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function handleErr(err, command) {
|
|
21
|
-
console.error(err.message);
|
|
22
|
-
//command.help();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function usage() {
|
|
26
|
-
console.log('\nUsage: hubify <command>');
|
|
27
|
-
console.log('');
|
|
28
|
-
console.log('where command is one of:\n');
|
|
29
|
-
console.log('\tcreate, delete, deploy, init, run, rollback');
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function main() {
|
|
34
|
-
var config, command;
|
|
35
|
-
|
|
36
|
-
nconf.argv()
|
|
37
|
-
.env()
|
|
38
|
-
.file(process.cwd() + '/.hubify')
|
|
39
|
-
.file('user', getUserHome() + '/.hubify')
|
|
40
|
-
.defaults({ host: 'hubify.com' });
|
|
41
|
-
|
|
42
|
-
if (argv._.length === 0) {
|
|
43
|
-
usage();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
command = argv._[0]
|
|
47
|
-
if (_.has(commands, command)) {
|
|
48
|
-
command = new commands[command]();
|
|
49
|
-
if (argv._.length > 1 && argv._[1] === 'help') {
|
|
50
|
-
command.help();
|
|
51
|
-
} else {
|
|
52
|
-
command.run(nconf, argv, function(err, result) {
|
|
53
|
-
if (err) { return handleErr(err, command); }
|
|
54
|
-
console.log(result);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
console.error('Unknown command: ' + command);
|
|
59
|
-
usage();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
main();
|