offwatch 0.5.12 → 0.5.14
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 +132 -178
- package/bin/offwatch.js +6 -7
- package/lib/downloader.js +112 -0
- package/package.json +18 -11
- package/postinstall.js +18 -0
- package/src/__tests__/agent-jwt-env.test.ts +0 -79
- package/src/__tests__/allowed-hostname.test.ts +0 -80
- package/src/__tests__/auth-command-registration.test.ts +0 -16
- package/src/__tests__/board-auth.test.ts +0 -53
- package/src/__tests__/common.test.ts +0 -98
- package/src/__tests__/company-delete.test.ts +0 -95
- package/src/__tests__/company-import-export-e2e.test.ts +0 -502
- package/src/__tests__/company-import-url.test.ts +0 -74
- package/src/__tests__/company-import-zip.test.ts +0 -44
- package/src/__tests__/company.test.ts +0 -599
- package/src/__tests__/context.test.ts +0 -70
- package/src/__tests__/data-dir.test.ts +0 -79
- package/src/__tests__/doctor.test.ts +0 -102
- package/src/__tests__/feedback.test.ts +0 -177
- package/src/__tests__/helpers/embedded-postgres.ts +0 -6
- package/src/__tests__/helpers/zip.ts +0 -87
- package/src/__tests__/home-paths.test.ts +0 -44
- package/src/__tests__/http.test.ts +0 -106
- package/src/__tests__/network-bind.test.ts +0 -62
- package/src/__tests__/onboard.test.ts +0 -166
- package/src/__tests__/routines.test.ts +0 -249
- package/src/__tests__/telemetry.test.ts +0 -117
- package/src/__tests__/worktree-merge-history.test.ts +0 -492
- package/src/__tests__/worktree.test.ts +0 -982
- package/src/adapters/http/format-event.ts +0 -4
- package/src/adapters/http/index.ts +0 -7
- package/src/adapters/index.ts +0 -2
- package/src/adapters/process/format-event.ts +0 -4
- package/src/adapters/process/index.ts +0 -7
- package/src/adapters/registry.ts +0 -63
- package/src/checks/agent-jwt-secret-check.ts +0 -40
- package/src/checks/config-check.ts +0 -33
- package/src/checks/database-check.ts +0 -59
- package/src/checks/deployment-auth-check.ts +0 -88
- package/src/checks/index.ts +0 -18
- package/src/checks/llm-check.ts +0 -82
- package/src/checks/log-check.ts +0 -30
- package/src/checks/path-resolver.ts +0 -1
- package/src/checks/port-check.ts +0 -24
- package/src/checks/secrets-check.ts +0 -146
- package/src/checks/storage-check.ts +0 -51
- package/src/client/board-auth.ts +0 -282
- package/src/client/command-label.ts +0 -4
- package/src/client/context.ts +0 -175
- package/src/client/http.ts +0 -255
- package/src/commands/allowed-hostname.ts +0 -40
- package/src/commands/auth-bootstrap-ceo.ts +0 -138
- package/src/commands/client/activity.ts +0 -71
- package/src/commands/client/agent.ts +0 -315
- package/src/commands/client/approval.ts +0 -259
- package/src/commands/client/auth.ts +0 -113
- package/src/commands/client/common.ts +0 -221
- package/src/commands/client/company.ts +0 -1578
- package/src/commands/client/context.ts +0 -125
- package/src/commands/client/dashboard.ts +0 -34
- package/src/commands/client/feedback.ts +0 -645
- package/src/commands/client/issue.ts +0 -411
- package/src/commands/client/plugin.ts +0 -374
- package/src/commands/client/zip.ts +0 -129
- package/src/commands/configure.ts +0 -201
- package/src/commands/db-backup.ts +0 -102
- package/src/commands/doctor.ts +0 -203
- package/src/commands/env.ts +0 -411
- package/src/commands/heartbeat-run.ts +0 -344
- package/src/commands/onboard.ts +0 -692
- package/src/commands/routines.ts +0 -352
- package/src/commands/run.ts +0 -216
- package/src/commands/worktree-lib.ts +0 -279
- package/src/commands/worktree-merge-history-lib.ts +0 -764
- package/src/commands/worktree.ts +0 -2876
- package/src/config/data-dir.ts +0 -48
- package/src/config/env.ts +0 -125
- package/src/config/home.ts +0 -80
- package/src/config/hostnames.ts +0 -26
- package/src/config/schema.ts +0 -30
- package/src/config/secrets-key.ts +0 -48
- package/src/config/server-bind.ts +0 -183
- package/src/config/store.ts +0 -120
- package/src/index.ts +0 -182
- package/src/prompts/database.ts +0 -157
- package/src/prompts/llm.ts +0 -43
- package/src/prompts/logging.ts +0 -37
- package/src/prompts/secrets.ts +0 -99
- package/src/prompts/server.ts +0 -221
- package/src/prompts/storage.ts +0 -146
- package/src/telemetry.ts +0 -49
- package/src/utils/banner.ts +0 -24
- package/src/utils/net.ts +0 -18
- package/src/utils/path-resolver.ts +0 -25
- package/src/version.ts +0 -10
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
import pc from "picocolors";
|
|
3
|
-
import {
|
|
4
|
-
readContext,
|
|
5
|
-
resolveContextPath,
|
|
6
|
-
resolveProfile,
|
|
7
|
-
setCurrentProfile,
|
|
8
|
-
upsertProfile,
|
|
9
|
-
} from "../../client/context.js";
|
|
10
|
-
import { printOutput } from "./common.js";
|
|
11
|
-
|
|
12
|
-
interface ContextOptions {
|
|
13
|
-
dataDir?: string;
|
|
14
|
-
context?: string;
|
|
15
|
-
profile?: string;
|
|
16
|
-
json?: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface ContextSetOptions extends ContextOptions {
|
|
20
|
-
apiBase?: string;
|
|
21
|
-
companyId?: string;
|
|
22
|
-
apiKeyEnvVarName?: string;
|
|
23
|
-
use?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function registerContextCommands(program: Command): void {
|
|
27
|
-
const context = program.command("context").description("Manage CLI client context profiles");
|
|
28
|
-
|
|
29
|
-
context
|
|
30
|
-
.command("show")
|
|
31
|
-
.description("Show current context and active profile")
|
|
32
|
-
.option("-d, --data-dir <path>", "Paperclip data directory root (isolates state from ~/.paperclip)")
|
|
33
|
-
.option("--context <path>", "Path to CLI context file")
|
|
34
|
-
.option("--profile <name>", "Profile to inspect")
|
|
35
|
-
.option("--json", "Output raw JSON")
|
|
36
|
-
.action((opts: ContextOptions) => {
|
|
37
|
-
const contextPath = resolveContextPath(opts.context);
|
|
38
|
-
const store = readContext(opts.context);
|
|
39
|
-
const resolved = resolveProfile(store, opts.profile);
|
|
40
|
-
const payload = {
|
|
41
|
-
contextPath,
|
|
42
|
-
currentProfile: store.currentProfile,
|
|
43
|
-
profileName: resolved.name,
|
|
44
|
-
profile: resolved.profile,
|
|
45
|
-
profiles: store.profiles,
|
|
46
|
-
};
|
|
47
|
-
printOutput(payload, { json: opts.json });
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
context
|
|
51
|
-
.command("list")
|
|
52
|
-
.description("List available context profiles")
|
|
53
|
-
.option("-d, --data-dir <path>", "Paperclip data directory root (isolates state from ~/.paperclip)")
|
|
54
|
-
.option("--context <path>", "Path to CLI context file")
|
|
55
|
-
.option("--json", "Output raw JSON")
|
|
56
|
-
.action((opts: ContextOptions) => {
|
|
57
|
-
const store = readContext(opts.context);
|
|
58
|
-
const rows = Object.entries(store.profiles).map(([name, profile]) => ({
|
|
59
|
-
name,
|
|
60
|
-
current: name === store.currentProfile,
|
|
61
|
-
apiBase: profile.apiBase ?? null,
|
|
62
|
-
companyId: profile.companyId ?? null,
|
|
63
|
-
apiKeyEnvVarName: profile.apiKeyEnvVarName ?? null,
|
|
64
|
-
}));
|
|
65
|
-
printOutput(rows, { json: opts.json });
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
context
|
|
69
|
-
.command("use")
|
|
70
|
-
.description("Set active context profile")
|
|
71
|
-
.argument("<profile>", "Profile name")
|
|
72
|
-
.option("-d, --data-dir <path>", "Paperclip data directory root (isolates state from ~/.paperclip)")
|
|
73
|
-
.option("--context <path>", "Path to CLI context file")
|
|
74
|
-
.action((profile: string, opts: ContextOptions) => {
|
|
75
|
-
setCurrentProfile(profile, opts.context);
|
|
76
|
-
console.log(pc.green(`Active profile set to '${profile}'.`));
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
context
|
|
80
|
-
.command("set")
|
|
81
|
-
.description("Set values on a profile")
|
|
82
|
-
.option("-d, --data-dir <path>", "Paperclip data directory root (isolates state from ~/.paperclip)")
|
|
83
|
-
.option("--context <path>", "Path to CLI context file")
|
|
84
|
-
.option("--profile <name>", "Profile name (default: current profile)")
|
|
85
|
-
.option("--api-base <url>", "Default API base URL")
|
|
86
|
-
.option("--company-id <id>", "Default company ID")
|
|
87
|
-
.option("--api-key-env-var-name <name>", "Env var containing API key (recommended)")
|
|
88
|
-
.option("--use", "Set this profile as active")
|
|
89
|
-
.option("--json", "Output raw JSON")
|
|
90
|
-
.action((opts: ContextSetOptions) => {
|
|
91
|
-
const existing = readContext(opts.context);
|
|
92
|
-
const targetProfile = opts.profile?.trim() || existing.currentProfile || "default";
|
|
93
|
-
|
|
94
|
-
upsertProfile(
|
|
95
|
-
targetProfile,
|
|
96
|
-
{
|
|
97
|
-
apiBase: opts.apiBase,
|
|
98
|
-
companyId: opts.companyId,
|
|
99
|
-
apiKeyEnvVarName: opts.apiKeyEnvVarName,
|
|
100
|
-
},
|
|
101
|
-
opts.context,
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
if (opts.use) {
|
|
105
|
-
setCurrentProfile(targetProfile, opts.context);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const updated = readContext(opts.context);
|
|
109
|
-
const resolved = resolveProfile(updated, targetProfile);
|
|
110
|
-
const payload = {
|
|
111
|
-
contextPath: resolveContextPath(opts.context),
|
|
112
|
-
currentProfile: updated.currentProfile,
|
|
113
|
-
profileName: resolved.name,
|
|
114
|
-
profile: resolved.profile,
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
if (!opts.json) {
|
|
118
|
-
console.log(pc.green(`Updated profile '${targetProfile}'.`));
|
|
119
|
-
if (opts.use) {
|
|
120
|
-
console.log(pc.green(`Set '${targetProfile}' as active profile.`));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
printOutput(payload, { json: opts.json });
|
|
124
|
-
});
|
|
125
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
import type { DashboardSummary } from "@paperclipai/shared";
|
|
3
|
-
import {
|
|
4
|
-
addCommonClientOptions,
|
|
5
|
-
handleCommandError,
|
|
6
|
-
printOutput,
|
|
7
|
-
resolveCommandContext,
|
|
8
|
-
type BaseClientOptions,
|
|
9
|
-
} from "./common.js";
|
|
10
|
-
|
|
11
|
-
interface DashboardGetOptions extends BaseClientOptions {
|
|
12
|
-
companyId?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function registerDashboardCommands(program: Command): void {
|
|
16
|
-
const dashboard = program.command("dashboard").description("Dashboard summary operations");
|
|
17
|
-
|
|
18
|
-
addCommonClientOptions(
|
|
19
|
-
dashboard
|
|
20
|
-
.command("get")
|
|
21
|
-
.description("Get dashboard summary for a company")
|
|
22
|
-
.requiredOption("-C, --company-id <id>", "Company ID")
|
|
23
|
-
.action(async (opts: DashboardGetOptions) => {
|
|
24
|
-
try {
|
|
25
|
-
const ctx = resolveCommandContext(opts, { requireCompany: true });
|
|
26
|
-
const row = await ctx.api.get<DashboardSummary>(`/api/companies/${ctx.companyId}/dashboard`);
|
|
27
|
-
printOutput(row, { json: ctx.json });
|
|
28
|
-
} catch (err) {
|
|
29
|
-
handleCommandError(err);
|
|
30
|
-
}
|
|
31
|
-
}),
|
|
32
|
-
{ includeCompany: false },
|
|
33
|
-
);
|
|
34
|
-
}
|