superceo 0.3.5 → 0.3.7
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/dist/index.js +21 -21
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -56423,9 +56423,9 @@ var init_organizations2 = __esm({
|
|
|
56423
56423
|
}
|
|
56424
56424
|
});
|
|
56425
56425
|
|
|
56426
|
-
// ../server/src/services/
|
|
56427
|
-
function
|
|
56428
|
-
const base = source === "local" ? process.env.
|
|
56426
|
+
// ../server/src/services/lead-product-api.ts
|
|
56427
|
+
function resolveLeadProductUserSummaryUrlTemplate(source) {
|
|
56428
|
+
const base = source === "local" ? process.env.LEAD_PRODUCT_API_BASE_URL_LOCAL?.trim() : source === "staging" ? process.env.LEAD_PRODUCT_API_BASE_URL_STAGING?.trim() : process.env.LEAD_PRODUCT_API_BASE_URL_PRODUCTION?.trim();
|
|
56429
56429
|
if (!base) return void 0;
|
|
56430
56430
|
const root = base.replace(/\/+$/, "");
|
|
56431
56431
|
return `${root}/v1/internal/paperclip/users/{userId}/summary`;
|
|
@@ -56568,9 +56568,9 @@ function parseProductPayload(obj) {
|
|
|
56568
56568
|
tables: tables.length > 0 ? tables : void 0
|
|
56569
56569
|
};
|
|
56570
56570
|
}
|
|
56571
|
-
function
|
|
56571
|
+
function parseLeadProductFromRemoteJson(json) {
|
|
56572
56572
|
if (!isRecord4(json)) return null;
|
|
56573
|
-
const nested = json.product
|
|
56573
|
+
const nested = json.product;
|
|
56574
56574
|
if (isRecord4(nested)) {
|
|
56575
56575
|
const parsed = parseProductPayload(nested);
|
|
56576
56576
|
if (parsed) return parsed;
|
|
@@ -56578,8 +56578,8 @@ function parseCutjamProductFromRemoteJson(json) {
|
|
|
56578
56578
|
return parseProductPayload(json);
|
|
56579
56579
|
}
|
|
56580
56580
|
var SURFACE_ROLES, SURFACE_STATES, MAX_NAMED_TABLES, MAX_ROWS_PER_TABLE;
|
|
56581
|
-
var
|
|
56582
|
-
"../server/src/services/
|
|
56581
|
+
var init_lead_product_api = __esm({
|
|
56582
|
+
"../server/src/services/lead-product-api.ts"() {
|
|
56583
56583
|
"use strict";
|
|
56584
56584
|
SURFACE_ROLES = /* @__PURE__ */ new Set(["editor", "brand", "customer_brand", "creator"]);
|
|
56585
56585
|
SURFACE_STATES = /* @__PURE__ */ new Set(["active", "inactive", "none", "pending"]);
|
|
@@ -57817,9 +57817,9 @@ ${lines.join("\n")}`;
|
|
|
57817
57817
|
},
|
|
57818
57818
|
/**
|
|
57819
57819
|
* High-level + tabular snapshot for the linked product user.
|
|
57820
|
-
* Without per-source `
|
|
57820
|
+
* Without per-source `LEAD_PRODUCT_API_BASE_URL_*`, returns lead-only facts. With it, GETs
|
|
57821
57821
|
* `/v1/internal/paperclip/users/{userId}/summary` and merges JSON
|
|
57822
|
-
* (legacy `headline` / `facts` / `table` or versioned `product`
|
|
57822
|
+
* (legacy `headline` / `facts` / `table` or versioned `product` block).
|
|
57823
57823
|
* Optional API key: env `VEM_API_KEY` or company secret of the same name.
|
|
57824
57824
|
*/
|
|
57825
57825
|
productSummary: async (companyId, leadId, options2) => {
|
|
@@ -57841,7 +57841,7 @@ ${lines.join("\n")}`;
|
|
|
57841
57841
|
leadFacts.push({ label: "Social", value: handleLine });
|
|
57842
57842
|
}
|
|
57843
57843
|
if (signedUp) leadFacts.push({ label: "Converted at", value: signedUp });
|
|
57844
|
-
const urlTemplate =
|
|
57844
|
+
const urlTemplate = resolveLeadProductUserSummaryUrlTemplate(options2?.productSource);
|
|
57845
57845
|
const remoteConfigured = Boolean(urlTemplate);
|
|
57846
57846
|
let headline = null;
|
|
57847
57847
|
let avatarUrl = null;
|
|
@@ -57852,7 +57852,7 @@ ${lines.join("\n")}`;
|
|
|
57852
57852
|
if (urlTemplate) {
|
|
57853
57853
|
const url = urlTemplate.replace(/\{userId\}/gi, encodeURIComponent(productUserId));
|
|
57854
57854
|
const headers = { Accept: "application/json" };
|
|
57855
|
-
const keySource = options2?.
|
|
57855
|
+
const keySource = options2?.productSource ?? "production";
|
|
57856
57856
|
const sourceUpper = keySource.toUpperCase();
|
|
57857
57857
|
let apiKey = process.env[`VEM_${sourceUpper}_API_KEY`]?.trim() || process.env.VEM_API_KEY?.trim() || "";
|
|
57858
57858
|
if (!apiKey) {
|
|
@@ -57893,7 +57893,7 @@ ${lines.join("\n")}`;
|
|
|
57893
57893
|
remoteFacts = [{ label: "Bio", value: json.bio.trim() }];
|
|
57894
57894
|
}
|
|
57895
57895
|
table = parseRemoteTable(json.table);
|
|
57896
|
-
product =
|
|
57896
|
+
product = parseLeadProductFromRemoteJson(json);
|
|
57897
57897
|
if (product) {
|
|
57898
57898
|
if (product.avatarUrl) avatarUrl = product.avatarUrl;
|
|
57899
57899
|
if (product.displayName) headline = product.displayName;
|
|
@@ -58002,7 +58002,7 @@ var init_leads2 = __esm({
|
|
|
58002
58002
|
init_issues2();
|
|
58003
58003
|
init_organizations2();
|
|
58004
58004
|
init_secrets2();
|
|
58005
|
-
|
|
58005
|
+
init_lead_product_api();
|
|
58006
58006
|
init_errors();
|
|
58007
58007
|
SUPPORTED_LEAD_KINDS = ["editor", "brand", "journalist", "partner", "investor", "other"];
|
|
58008
58008
|
SUPPORTED_STATUSES = ["drafted", "contacted", "replied", "signed_up", "dead"];
|
|
@@ -62235,9 +62235,9 @@ function leadRoutes(db) {
|
|
|
62235
62235
|
router.get("/companies/:companyId/leads/:leadId/product-summary", async (req, res) => {
|
|
62236
62236
|
const { companyId, leadId } = req.params;
|
|
62237
62237
|
assertCompanyAccess(req, companyId);
|
|
62238
|
-
const raw = req.query.
|
|
62239
|
-
const
|
|
62240
|
-
const summary = await svc.productSummary(companyId, leadId, {
|
|
62238
|
+
const raw = req.query.productSource;
|
|
62239
|
+
const productSource = raw === "local" || raw === "staging" || raw === "production" ? raw : void 0;
|
|
62240
|
+
const summary = await svc.productSummary(companyId, leadId, { productSource });
|
|
62241
62241
|
res.json(summary);
|
|
62242
62242
|
});
|
|
62243
62243
|
router.get("/companies/:companyId/leads/:leadId", async (req, res) => {
|
|
@@ -67262,7 +67262,7 @@ ${message}`);
|
|
|
67262
67262
|
toolUseSystemBase,
|
|
67263
67263
|
"",
|
|
67264
67264
|
"TOOL USE IS ENABLED. You have live access to the Paperclip API via the Bash tool plus the bundled `paperclip` skill (loaded from .claude/skills). Use `curl` against the local API at $PAPERCLIP_API_URL to read or write any resource the operator references \u2014 issues, comments, leads, documents, goals, agents, plugins, approvals. Do NOT say you lack access; you have it.",
|
|
67265
|
-
'Plugin tools (e.g.
|
|
67265
|
+
'Plugin tools (e.g. `<vendor>.<plugin>:<tool>`) are agent-callable: POST /api/plugins/tools/execute with Authorization: Bearer $PAPERCLIP_API_KEY, and a runContext where agentId === $PAPERCLIP_AGENT_ID and companyId === $PAPERCLIP_COMPANY_ID (projectId must be a non-empty string like "none"). If a plugin route returns 403, that\'s an auth-shape issue (wrong Bearer, mismatched runContext.agentId, or you hit a board-only admin route) \u2014 diagnose and retry. Do NOT fall back to WebSearch and do NOT claim the plugin is unavailable; the plugin tool surface is yours to use.',
|
|
67266
67266
|
"When tool results contain two or more issues, leads, agents, or comparable rows, summarize them in the final JSON `reply` using the same markdown table rules as the main system prompt (no paragraph-only ID lists).",
|
|
67267
67267
|
"",
|
|
67268
67268
|
`${writeAttribution} If the operator hasn't clearly asked for a write, prefer reading first or proposing it back via the JSON proposals field rather than executing.`
|
|
@@ -91584,8 +91584,8 @@ var init_src2 = __esm({
|
|
|
91584
91584
|
loadPaperclipEnvFile(options2.config);
|
|
91585
91585
|
initTelemetryFromConfigFile(options2.config);
|
|
91586
91586
|
});
|
|
91587
|
-
program.command("onboard").description("Interactive first-run setup wizard").option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).option("-y, --yes", "Accept defaults (quickstart + start immediately)", false).option("--run",
|
|
91588
|
-
program.command("doctor").description(
|
|
91587
|
+
program.command("onboard").description("Interactive first-run setup wizard").option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).option("-y, --yes", "Accept defaults (quickstart + start immediately)", false).option("--run", `Start ${brand.name} immediately after saving config`, false).action(onboard);
|
|
91588
|
+
program.command("doctor").description(`Run diagnostic checks on your ${brand.name} setup`).option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).option("--repair", "Attempt to repair issues automatically").alias("--fix").option("-y, --yes", "Skip repair confirmation prompts").action(async (opts) => {
|
|
91589
91589
|
await doctor(opts);
|
|
91590
91590
|
});
|
|
91591
91591
|
program.command("env").description("Print environment variables for deployment").option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).action(envCommand);
|
|
@@ -91594,9 +91594,9 @@ var init_src2 = __esm({
|
|
|
91594
91594
|
await dbBackupCommand(opts);
|
|
91595
91595
|
});
|
|
91596
91596
|
program.command("allowed-hostname").description("Allow a hostname for authenticated/private mode access").argument("<host>", "Hostname to allow (for example dotta-macbook-pro)").option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).action(addAllowedHostname);
|
|
91597
|
-
program.command("run").description(
|
|
91597
|
+
program.command("run").description(`Bootstrap local setup (onboard + doctor) and run ${brand.name}`).option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).option("-i, --instance <id>", "Local instance id (default: default)").option("--repair", "Attempt automatic repairs during doctor", true).option("--no-repair", "Disable automatic repairs during doctor").action(runCommand);
|
|
91598
91598
|
heartbeat = program.command("heartbeat").description("Heartbeat utilities");
|
|
91599
|
-
heartbeat.command("run").description("Run one agent heartbeat and stream live logs").requiredOption("-a, --agent-id <agentId>", "Agent ID to invoke").option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).option("--context <path>", "Path to CLI context file").option("--profile <name>", "CLI context profile name").option("--api-base <url>",
|
|
91599
|
+
heartbeat.command("run").description("Run one agent heartbeat and stream live logs").requiredOption("-a, --agent-id <agentId>", "Agent ID to invoke").option("-c, --config <path>", "Path to config file").option("-d, --data-dir <path>", DATA_DIR_OPTION_HELP).option("--context <path>", "Path to CLI context file").option("--profile <name>", "CLI context profile name").option("--api-base <url>", `Base URL for the ${brand.name} server API`).option("--api-key <token>", "Bearer token for agent-authenticated calls").option(
|
|
91600
91600
|
"--source <source>",
|
|
91601
91601
|
"Invocation source (timer | assignment | on_demand | automation)",
|
|
91602
91602
|
"on_demand"
|