@openork/cli 0.1.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/bin/dev.js +3 -0
- package/bin/run.js +3 -0
- package/dist/commands/gateway/start.d.ts +14 -0
- package/dist/commands/gateway/start.d.ts.map +1 -0
- package/dist/commands/gateway/start.js +120 -0
- package/dist/commands/gateway/start.js.map +1 -0
- package/dist/commands/gateway/stop.d.ts +7 -0
- package/dist/commands/gateway/stop.d.ts.map +1 -0
- package/dist/commands/gateway/stop.js +33 -0
- package/dist/commands/gateway/stop.js.map +1 -0
- package/dist/commands/setup.d.ts +7 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +86 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/setup.spec.d.ts +2 -0
- package/dist/commands/setup.spec.d.ts.map +1 -0
- package/dist/commands/setup.spec.js +88 -0
- package/dist/commands/setup.spec.js.map +1 -0
- package/dist/commands/uninstall.d.ts +10 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +71 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/gateway.d.ts +19 -0
- package/dist/lib/gateway.d.ts.map +1 -0
- package/dist/lib/gateway.js +52 -0
- package/dist/lib/gateway.js.map +1 -0
- package/dist/lib/shell-profile.d.ts +10 -0
- package/dist/lib/shell-profile.d.ts.map +1 -0
- package/dist/lib/shell-profile.js +56 -0
- package/dist/lib/shell-profile.js.map +1 -0
- package/dist/migrations/0001-add-memory-enabled.js +42 -0
- package/dist/migrations/lib/helpers.js +78 -0
- package/dist/migrations/lib/template.js +8 -0
- package/dist/openapi.yml +5648 -0
- package/dist/prisma/migrations/20260318152538_add_trigger_type_and_source_workflow/migration.sql +79 -0
- package/dist/prisma/migrations/20260318154232_drop_skill_and_emit_from_action/migration.sql +25 -0
- package/dist/prisma/migrations/20260318160029_action_types_cli_bash_node_http/migration.sql +29 -0
- package/dist/prisma/migrations/migration_lock.toml +3 -0
- package/dist/prisma/schema.prisma +236 -0
- package/dist/server.js +182527 -0
- package/dist/server.js.map +1 -0
- package/dist/web/assets/activity-feed-D_eonDKG.js +1 -0
- package/dist/web/assets/agent-edit-CblZItU5.js +98 -0
- package/dist/web/assets/agent-sessions-COpCcffa.js +1 -0
- package/dist/web/assets/agent-use-F4pOt3KJ.js +1 -0
- package/dist/web/assets/agents-Av7w2wHE.js +1 -0
- package/dist/web/assets/api-docs-BQzn4-6U.js +1 -0
- package/dist/web/assets/arrow-down-XHN5PD1k.js +1 -0
- package/dist/web/assets/arrow-left-wtNmm6Le.js +1 -0
- package/dist/web/assets/bi-gM8sIAZV.js +1 -0
- package/dist/web/assets/chat-CQvfLy7Y.js +4 -0
- package/dist/web/assets/chat-input-BepRPV_L.js +2 -0
- package/dist/web/assets/chat-message-CbcDeDcb.js +37 -0
- package/dist/web/assets/chat-new-BOtDuYij.js +1 -0
- package/dist/web/assets/chat-sessions-CaCaK_PC.js +1 -0
- package/dist/web/assets/chats-64IReeGV.js +1 -0
- package/dist/web/assets/circle-alert-W8QX9LOG.js +1 -0
- package/dist/web/assets/circle-check-DLl9fl65.js +1 -0
- package/dist/web/assets/circle-x-D_8Tcgt1.js +1 -0
- package/dist/web/assets/code-Brz4KHlI.js +1 -0
- package/dist/web/assets/code-editor-x9L6nkh4.js +1 -0
- package/dist/web/assets/commands-DT9K8bae.js +8 -0
- package/dist/web/assets/copy-C87mjn_Y.js +1 -0
- package/dist/web/assets/credentials-DC-HOVxW.js +1 -0
- package/dist/web/assets/cron-COUPKvGu.js +1 -0
- package/dist/web/assets/crown-BJEsQkh4.js +1 -0
- package/dist/web/assets/dashboard-OfnNUjFX.js +1 -0
- package/dist/web/assets/database-BohjTljV.js +1 -0
- package/dist/web/assets/debug-Et9rgBM8.js +1 -0
- package/dist/web/assets/download-B2UOiYAS.js +1 -0
- package/dist/web/assets/eye-DN-Km5vf.js +1 -0
- package/dist/web/assets/file-plus-B8qWemgt.js +1 -0
- package/dist/web/assets/file-tree-DkLQ1z0I.js +1 -0
- package/dist/web/assets/folder-plus-DsmP6Mur.js +1 -0
- package/dist/web/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/dist/web/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/dist/web/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/dist/web/assets/globe-fwFSeXZn.js +1 -0
- package/dist/web/assets/grip-vertical-Djo-yR-o.js +1 -0
- package/dist/web/assets/history-CyBBboEp.js +1 -0
- package/dist/web/assets/index-YgjFlLLv.css +2 -0
- package/dist/web/assets/index-dc8HGqTp.js +2 -0
- package/dist/web/assets/layers-ephyCrDm.js +1 -0
- package/dist/web/assets/layout-grid-DCVGg8ZA.js +1 -0
- package/dist/web/assets/mcp-setup-BfMdYdsI.js +17 -0
- package/dist/web/assets/memory-DAQ474-p.js +1 -0
- package/dist/web/assets/new-chat-DtMw6FMg.js +1 -0
- package/dist/web/assets/play-DXJMtO-K.js +1 -0
- package/dist/web/assets/refresh-cw-RFYUf5GB.js +1 -0
- package/dist/web/assets/rolldown-runtime-Dw2cE7zH.js +1 -0
- package/dist/web/assets/save-Dewm93H6.js +1 -0
- package/dist/web/assets/search-Ww0msJQz.js +1 -0
- package/dist/web/assets/send-FWvygYFQ.js +1 -0
- package/dist/web/assets/settings-Auyn4Z5T.js +1 -0
- package/dist/web/assets/shield-check-Dt7sXtBF.js +1 -0
- package/dist/web/assets/shuffle-DjvBJ7XV.js +1 -0
- package/dist/web/assets/src-DUhGoAQb.js +24 -0
- package/dist/web/assets/team-edit-DO-RX3lC.js +1 -0
- package/dist/web/assets/team-sessions-DSw8MTtZ.js +1 -0
- package/dist/web/assets/team-use-BfNvsFcO.js +3 -0
- package/dist/web/assets/terminal-CIapYonS.js +1 -0
- package/dist/web/assets/timer-C9X20mTO.js +1 -0
- package/dist/web/assets/useMutation-BlOHt3MR.js +1 -0
- package/dist/web/assets/useQuery-DvovkaPT.js +1 -0
- package/dist/web/assets/utils-DHTPP40O.js +1 -0
- package/dist/web/assets/vendor-editor-BORFA-rZ.js +39 -0
- package/dist/web/assets/vendor-react-BJ8SIkmN.js +11 -0
- package/dist/web/assets/vendor-ui-CHpVij2M.css +1 -0
- package/dist/web/assets/vendor-ui-Dpw9mBc-.js +39 -0
- package/dist/web/assets/workflow-edit-D0FNyl64.js +4 -0
- package/dist/web/assets/workflow-runs-CPVvaVzN.js +1 -0
- package/dist/web/assets/workflows-C9jurJiE.js +1 -0
- package/dist/web/assets/wrench-DZBtSPP8.js +1 -0
- package/dist/web/assets/zap-CbT5plGA.js +1 -0
- package/dist/web/docs.html +242 -0
- package/dist/web/favicon.svg +13 -0
- package/dist/web/index.html +23 -0
- package/package.json +65 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import os from "node:os";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { readFileSync, writeFileSync, existsSync, appendFileSync, } from "node:fs";
|
|
4
|
+
export const MARKER = "# openork";
|
|
5
|
+
export function detectShellProfiles() {
|
|
6
|
+
const home = os.homedir();
|
|
7
|
+
const profiles = [];
|
|
8
|
+
// zsh — preferred on macOS and many Linux distros
|
|
9
|
+
const zshrc = path.join(home, ".zshrc");
|
|
10
|
+
if (existsSync(zshrc)) {
|
|
11
|
+
profiles.push({ shell: "zsh", path: zshrc });
|
|
12
|
+
}
|
|
13
|
+
// bash — check .bashrc first (Linux), then .bash_profile (macOS)
|
|
14
|
+
const bashrc = path.join(home, ".bashrc");
|
|
15
|
+
const bashProfile = path.join(home, ".bash_profile");
|
|
16
|
+
if (existsSync(bashrc)) {
|
|
17
|
+
profiles.push({ shell: "bash", path: bashrc });
|
|
18
|
+
}
|
|
19
|
+
else if (existsSync(bashProfile)) {
|
|
20
|
+
profiles.push({ shell: "bash", path: bashProfile });
|
|
21
|
+
}
|
|
22
|
+
return profiles;
|
|
23
|
+
}
|
|
24
|
+
export function profileAlreadyConfigured(profilePath) {
|
|
25
|
+
try {
|
|
26
|
+
return readFileSync(profilePath, "utf-8").includes(MARKER);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function appendToProfile(profilePath, openorkHome) {
|
|
33
|
+
const block = [
|
|
34
|
+
"",
|
|
35
|
+
`${MARKER}`,
|
|
36
|
+
`export OPENORK_HOME="${openorkHome}"`,
|
|
37
|
+
"",
|
|
38
|
+
].join("\n");
|
|
39
|
+
appendFileSync(profilePath, block);
|
|
40
|
+
}
|
|
41
|
+
export function removeFromProfile(profilePath) {
|
|
42
|
+
try {
|
|
43
|
+
const content = readFileSync(profilePath, "utf-8");
|
|
44
|
+
if (!content.includes(MARKER))
|
|
45
|
+
return false;
|
|
46
|
+
// Remove the openork block: blank line before marker, marker line,
|
|
47
|
+
// export line, and trailing blank line
|
|
48
|
+
const cleaned = content.replace(/\n?# openork\nexport OPENORK_HOME="[^"]*"\n?/g, "\n");
|
|
49
|
+
writeFileSync(profilePath, cleaned);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=shell-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-profile.js","sourceRoot":"","sources":["../../src/lib/shell-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAC;AAOlC,MAAM,UAAU,mBAAmB;IACjC,MAAM,IAAI,GAAG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,IAAI,CAAC,CAAC;IACb,cAAc,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,KAAK,CAAC;QAE5C,mEAAmE;QACnE,uCAAuC;QACvC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAC7B,+CAA+C,EAC/C,IAAI,CACL,CAAC;QAEF,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readAllAgentFiles,
|
|
3
|
+
writeAgentFile,
|
|
4
|
+
readAllTeamFiles,
|
|
5
|
+
writeTeamFile,
|
|
6
|
+
} from "./lib/helpers.js";
|
|
7
|
+
|
|
8
|
+
export async function up() {
|
|
9
|
+
const agents = await readAllAgentFiles();
|
|
10
|
+
for (const { slug, data } of agents) {
|
|
11
|
+
if (data.memoryEnabled === undefined) {
|
|
12
|
+
data.memoryEnabled = true;
|
|
13
|
+
await writeAgentFile(slug, data);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const teams = await readAllTeamFiles();
|
|
18
|
+
for (const { slug, data } of teams) {
|
|
19
|
+
if (data.memoryEnabled === undefined) {
|
|
20
|
+
data.memoryEnabled = true;
|
|
21
|
+
await writeTeamFile(slug, data);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function down() {
|
|
27
|
+
const agents = await readAllAgentFiles();
|
|
28
|
+
for (const { slug, data } of agents) {
|
|
29
|
+
if (data.memoryEnabled !== undefined) {
|
|
30
|
+
delete data.memoryEnabled;
|
|
31
|
+
await writeAgentFile(slug, data);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const teams = await readAllTeamFiles();
|
|
36
|
+
for (const { slug, data } of teams) {
|
|
37
|
+
if (data.memoryEnabled !== undefined) {
|
|
38
|
+
delete data.memoryEnabled;
|
|
39
|
+
await writeTeamFile(slug, data);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { readdir, readFile, writeFile, mkdir } from "node:fs/promises";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
|
|
6
|
+
function resolveWorkspace() {
|
|
7
|
+
if (process.env.OPENORK_DATA_ROOT) return process.env.OPENORK_DATA_ROOT;
|
|
8
|
+
const configDir = join(homedir(), ".openork");
|
|
9
|
+
try {
|
|
10
|
+
const raw = readFileSync(join(configDir, "openork-config.json"), "utf-8");
|
|
11
|
+
return JSON.parse(raw).workspace || configDir;
|
|
12
|
+
} catch {
|
|
13
|
+
return configDir;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const DATA_ROOT = resolveWorkspace();
|
|
18
|
+
|
|
19
|
+
export const AGENTS_DIR = join(DATA_ROOT, "agents");
|
|
20
|
+
export const TEAMS_DIR = join(DATA_ROOT, "teams");
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Read all agent.json files from .local/agents/
|
|
24
|
+
* Returns array of { slug, data, filePath }
|
|
25
|
+
*/
|
|
26
|
+
export async function readAllAgentFiles() {
|
|
27
|
+
await mkdir(AGENTS_DIR, { recursive: true });
|
|
28
|
+
const entries = await readdir(AGENTS_DIR, { withFileTypes: true });
|
|
29
|
+
const results = [];
|
|
30
|
+
for (const entry of entries) {
|
|
31
|
+
if (!entry.isDirectory()) continue;
|
|
32
|
+
try {
|
|
33
|
+
const filePath = join(AGENTS_DIR, entry.name, "agent.json");
|
|
34
|
+
const raw = await readFile(filePath, "utf-8");
|
|
35
|
+
results.push({ slug: entry.name, data: JSON.parse(raw), filePath });
|
|
36
|
+
} catch {
|
|
37
|
+
/* skip dirs without valid agent.json */
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return results;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Write agent.json for the given slug
|
|
45
|
+
*/
|
|
46
|
+
export async function writeAgentFile(slug, data) {
|
|
47
|
+
const filePath = join(AGENTS_DIR, slug, "agent.json");
|
|
48
|
+
await writeFile(filePath, JSON.stringify(data, null, 2));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Read all team.json files from .local/teams/
|
|
53
|
+
* Returns array of { slug, data, filePath }
|
|
54
|
+
*/
|
|
55
|
+
export async function readAllTeamFiles() {
|
|
56
|
+
await mkdir(TEAMS_DIR, { recursive: true });
|
|
57
|
+
const entries = await readdir(TEAMS_DIR, { withFileTypes: true });
|
|
58
|
+
const results = [];
|
|
59
|
+
for (const entry of entries) {
|
|
60
|
+
if (!entry.isDirectory()) continue;
|
|
61
|
+
try {
|
|
62
|
+
const filePath = join(TEAMS_DIR, entry.name, "team.json");
|
|
63
|
+
const raw = await readFile(filePath, "utf-8");
|
|
64
|
+
results.push({ slug: entry.name, data: JSON.parse(raw), filePath });
|
|
65
|
+
} catch {
|
|
66
|
+
/* skip dirs without valid team.json */
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return results;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Write team.json for the given slug
|
|
74
|
+
*/
|
|
75
|
+
export async function writeTeamFile(slug, data) {
|
|
76
|
+
const filePath = join(TEAMS_DIR, slug, "team.json");
|
|
77
|
+
await writeFile(filePath, JSON.stringify(data, null, 2));
|
|
78
|
+
}
|