@docyrus/docyrus 0.2.0 → 0.2.2
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/main.js +132 -68
- package/main.js.map +4 -4
- package/package.json +1 -1
- package/resources/pi-agent/skills/docyrus-platform/references/automation-and-workflows.md +49 -26
- package/resources/pi-agent/skills/docyrus-platform/references/developer-tools.md +1 -1
- package/resources/pi-agent/skills/docyrus-platform/references/docyrus-cli-usage.md +223 -0
- package/resources/pi-agent/skills/docyrus-platform/references/integrations-and-events.md +3 -0
package/main.js
CHANGED
|
@@ -139453,7 +139453,7 @@ function buildInputSchema(args2, env2, options2) {
|
|
|
139453
139453
|
// package.json
|
|
139454
139454
|
var package_default = {
|
|
139455
139455
|
name: "@docyrus/docyrus",
|
|
139456
|
-
version: "0.2.
|
|
139456
|
+
version: "0.2.2",
|
|
139457
139457
|
private: false,
|
|
139458
139458
|
description: "Docyrus API CLI",
|
|
139459
139459
|
main: "./main.js",
|
|
@@ -142300,7 +142300,8 @@ var ACTION_NODE_TYPES = [
|
|
|
142300
142300
|
"generate-document",
|
|
142301
142301
|
"ai-prompt",
|
|
142302
142302
|
"ai-agent",
|
|
142303
|
-
"execute-script"
|
|
142303
|
+
"execute-script",
|
|
142304
|
+
"wait-for"
|
|
142304
142305
|
];
|
|
142305
142306
|
var HTTP_REQUEST_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
142306
142307
|
async function getAutomationRunContext(dependencies) {
|
|
@@ -142507,6 +142508,7 @@ function nodeFlags(type, options2) {
|
|
|
142507
142508
|
case "ai-prompt":
|
|
142508
142509
|
case "ai-agent":
|
|
142509
142510
|
case "execute-script":
|
|
142511
|
+
case "wait-for":
|
|
142510
142512
|
return base;
|
|
142511
142513
|
}
|
|
142512
142514
|
}
|
|
@@ -152423,6 +152425,124 @@ function createKnowledgeCli(dependencies) {
|
|
|
152423
152425
|
return knowledgeCli;
|
|
152424
152426
|
}
|
|
152425
152427
|
|
|
152428
|
+
// src/commands/messagingCommands.ts
|
|
152429
|
+
function parseCsvFlag2(raw) {
|
|
152430
|
+
if (raw === void 0) {
|
|
152431
|
+
return void 0;
|
|
152432
|
+
}
|
|
152433
|
+
const items = raw.split(",").map((item) => item.trim()).filter((item) => item.length > 0);
|
|
152434
|
+
return items.length > 0 ? items : void 0;
|
|
152435
|
+
}
|
|
152436
|
+
function requireCsvFlag(raw, flag) {
|
|
152437
|
+
const items = parseCsvFlag2(raw);
|
|
152438
|
+
if (!items || items.length === 0) {
|
|
152439
|
+
throw new UserInputError(`Provide ${flag}.`);
|
|
152440
|
+
}
|
|
152441
|
+
return items;
|
|
152442
|
+
}
|
|
152443
|
+
function createMessagingCli(dependencies) {
|
|
152444
|
+
const messagingCli = Cli_exports.create("messaging", {
|
|
152445
|
+
description: "Messaging commands",
|
|
152446
|
+
env: EnvSchema
|
|
152447
|
+
});
|
|
152448
|
+
messagingCli.command("accounts", {
|
|
152449
|
+
description: "List tenant email accounts (non-credential info)",
|
|
152450
|
+
run: async () => {
|
|
152451
|
+
const apiBaseUrl = await dependencies.environmentConfigService.getActiveApiBaseUrl();
|
|
152452
|
+
const apiClient = dependencies.createApiClient(apiBaseUrl);
|
|
152453
|
+
const response = await apiClient.request({
|
|
152454
|
+
method: "GET",
|
|
152455
|
+
path: "/messaging/email/accounts"
|
|
152456
|
+
});
|
|
152457
|
+
return await injectContext({
|
|
152458
|
+
apiBaseUrl,
|
|
152459
|
+
authStore: dependencies.authStore,
|
|
152460
|
+
payload: response.data
|
|
152461
|
+
});
|
|
152462
|
+
}
|
|
152463
|
+
});
|
|
152464
|
+
const emailCli = Cli_exports.create("email", {
|
|
152465
|
+
description: "Email commands",
|
|
152466
|
+
env: EnvSchema
|
|
152467
|
+
});
|
|
152468
|
+
emailCli.command("send", {
|
|
152469
|
+
description: "Send an email through a tenant email account",
|
|
152470
|
+
options: external_exports.object({
|
|
152471
|
+
accountId: external_exports.string().min(1).describe("Tenant email account UUID"),
|
|
152472
|
+
to: external_exports.string().optional().describe("Comma-separated recipient addresses"),
|
|
152473
|
+
cc: external_exports.string().optional().describe("Comma-separated CC addresses"),
|
|
152474
|
+
bcc: external_exports.string().optional().describe("Comma-separated BCC addresses"),
|
|
152475
|
+
replyTo: external_exports.string().optional().describe("Comma-separated reply-to addresses"),
|
|
152476
|
+
subject: external_exports.string().optional().describe("Email subject"),
|
|
152477
|
+
body: external_exports.string().optional().describe("Email body (HTML or text)"),
|
|
152478
|
+
sendAsUser: external_exports.boolean().optional().describe("Send using the authenticated user's identity when allowed"),
|
|
152479
|
+
data: external_exports.string().optional().describe("Full JSON payload; overrides individual flags when set"),
|
|
152480
|
+
fromFile: external_exports.string().optional().describe("Read full JSON payload from a file")
|
|
152481
|
+
}),
|
|
152482
|
+
run: async (context) => {
|
|
152483
|
+
const apiBaseUrl = await dependencies.environmentConfigService.getActiveApiBaseUrl();
|
|
152484
|
+
const apiClient = dependencies.createApiClient(apiBaseUrl);
|
|
152485
|
+
const accountId = context.options.accountId.trim();
|
|
152486
|
+
if (!accountId) {
|
|
152487
|
+
throw new UserInputError("Provide --accountId.");
|
|
152488
|
+
}
|
|
152489
|
+
let body2;
|
|
152490
|
+
if (context.options.data || context.options.fromFile) {
|
|
152491
|
+
const parsed = await readDataInput({
|
|
152492
|
+
data: context.options.data,
|
|
152493
|
+
fromFile: context.options.fromFile
|
|
152494
|
+
});
|
|
152495
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
152496
|
+
throw new UserInputError("Send email payload must be a JSON object.");
|
|
152497
|
+
}
|
|
152498
|
+
body2 = parsed;
|
|
152499
|
+
} else {
|
|
152500
|
+
const to = requireCsvFlag(context.options.to, "--to");
|
|
152501
|
+
const subject = context.options.subject?.trim();
|
|
152502
|
+
const emailBody = context.options.body;
|
|
152503
|
+
if (!subject) {
|
|
152504
|
+
throw new UserInputError("Provide --subject.");
|
|
152505
|
+
}
|
|
152506
|
+
if (emailBody === void 0 || emailBody.length === 0) {
|
|
152507
|
+
throw new UserInputError("Provide --body.");
|
|
152508
|
+
}
|
|
152509
|
+
body2 = {
|
|
152510
|
+
to,
|
|
152511
|
+
subject,
|
|
152512
|
+
body: emailBody
|
|
152513
|
+
};
|
|
152514
|
+
const cc = parseCsvFlag2(context.options.cc);
|
|
152515
|
+
if (cc) {
|
|
152516
|
+
body2.cc = cc;
|
|
152517
|
+
}
|
|
152518
|
+
const bcc = parseCsvFlag2(context.options.bcc);
|
|
152519
|
+
if (bcc) {
|
|
152520
|
+
body2.bcc = bcc;
|
|
152521
|
+
}
|
|
152522
|
+
const replyTo = parseCsvFlag2(context.options.replyTo);
|
|
152523
|
+
if (replyTo) {
|
|
152524
|
+
body2.replyTo = replyTo;
|
|
152525
|
+
}
|
|
152526
|
+
if (context.options.sendAsUser !== void 0) {
|
|
152527
|
+
body2.sendAsUser = context.options.sendAsUser;
|
|
152528
|
+
}
|
|
152529
|
+
}
|
|
152530
|
+
const response = await apiClient.request({
|
|
152531
|
+
method: "POST",
|
|
152532
|
+
path: `/messaging/email/accounts/${encodeURIComponent(accountId)}/send`,
|
|
152533
|
+
body: body2
|
|
152534
|
+
});
|
|
152535
|
+
return await injectContext({
|
|
152536
|
+
apiBaseUrl,
|
|
152537
|
+
authStore: dependencies.authStore,
|
|
152538
|
+
payload: response.data
|
|
152539
|
+
});
|
|
152540
|
+
}
|
|
152541
|
+
});
|
|
152542
|
+
messagingCli.command(emailCli);
|
|
152543
|
+
return messagingCli;
|
|
152544
|
+
}
|
|
152545
|
+
|
|
152426
152546
|
// src/commands/projectPlanCommands.ts
|
|
152427
152547
|
init_graph2();
|
|
152428
152548
|
init_localTodos();
|
|
@@ -157066,11 +157186,11 @@ function createSpinner(message) {
|
|
|
157066
157186
|
|
|
157067
157187
|
// src/services/piAgentLauncher.ts
|
|
157068
157188
|
var DOCYRUS_EXTERNAL_SKILL_SOURCE = "docyrus/agent-skills";
|
|
157069
|
-
var DOCYRUS_PACKAGED_PLATFORM_SKILL_NAME = "docyrus-platform";
|
|
157070
157189
|
var DOCYRUS_MIGRATED_SKILL_NAMES = [
|
|
157071
157190
|
"docyrus-app-dev",
|
|
157072
157191
|
"docyrus-api-dev",
|
|
157073
|
-
"docyrus-cli-app"
|
|
157192
|
+
"docyrus-cli-app",
|
|
157193
|
+
"docyrus-platform"
|
|
157074
157194
|
];
|
|
157075
157195
|
var DOCYRUS_EXTERNAL_SKILL_AGENT_IDS = [
|
|
157076
157196
|
"claude-code",
|
|
@@ -157303,10 +157423,7 @@ async function syncTrackedSkills(params) {
|
|
|
157303
157423
|
}));
|
|
157304
157424
|
}
|
|
157305
157425
|
async function cleanupLegacyDocyrusPiSkills(params) {
|
|
157306
|
-
const docyrusOwned = [
|
|
157307
|
-
...DOCYRUS_MIGRATED_SKILL_NAMES,
|
|
157308
|
-
DOCYRUS_PACKAGED_PLATFORM_SKILL_NAME
|
|
157309
|
-
];
|
|
157426
|
+
const docyrusOwned = [...DOCYRUS_MIGRATED_SKILL_NAMES];
|
|
157310
157427
|
const candidateRoots = [
|
|
157311
157428
|
(0, import_node_path30.join)(params.cwd, ".pi", "skills"),
|
|
157312
157429
|
(0, import_node_path30.join)(params.cwd, ".agents", "skills")
|
|
@@ -157371,23 +157488,6 @@ function createDocyrusSkillsInstallArgs(scope) {
|
|
|
157371
157488
|
);
|
|
157372
157489
|
return args2;
|
|
157373
157490
|
}
|
|
157374
|
-
function createPackagedDocyrusPlatformInstallArgs(params) {
|
|
157375
|
-
const args2 = [
|
|
157376
|
-
"skills",
|
|
157377
|
-
"add",
|
|
157378
|
-
params.skillSourcePath
|
|
157379
|
-
];
|
|
157380
|
-
if (params.scope === "global") {
|
|
157381
|
-
args2.push("--global");
|
|
157382
|
-
}
|
|
157383
|
-
args2.push(
|
|
157384
|
-
"--agent",
|
|
157385
|
-
...DOCYRUS_EXTERNAL_SKILL_AGENT_IDS,
|
|
157386
|
-
"--copy",
|
|
157387
|
-
"--yes"
|
|
157388
|
-
);
|
|
157389
|
-
return args2;
|
|
157390
|
-
}
|
|
157391
157491
|
async function installExternalDocyrusSkillsOnce(params) {
|
|
157392
157492
|
const markerPath = (0, import_node_path30.join)(params.agentRootPath, DOCYRUS_EXTERNAL_SKILL_MARKER_FILE);
|
|
157393
157493
|
if ((0, import_node_fs17.existsSync)(markerPath)) {
|
|
@@ -157460,9 +157560,6 @@ async function ensureManagedDiffityInstalled(params) {
|
|
|
157460
157560
|
binDir
|
|
157461
157561
|
};
|
|
157462
157562
|
}
|
|
157463
|
-
function resolvePackagedDocyrusPlatformSkillPath(resourceRoot) {
|
|
157464
|
-
return (0, import_node_path30.join)(resourceRoot, "skills", DOCYRUS_PACKAGED_PLATFORM_SKILL_NAME);
|
|
157465
|
-
}
|
|
157466
157563
|
function resolvePackagedOfficeCliRootPath(resourceRoot) {
|
|
157467
157564
|
return (0, import_node_path30.join)((0, import_node_path30.resolve)(resourceRoot, ".."), "officecli");
|
|
157468
157565
|
}
|
|
@@ -157654,34 +157751,6 @@ async function ensureManagedOfficeCliInstalled(params) {
|
|
|
157654
157751
|
};
|
|
157655
157752
|
}
|
|
157656
157753
|
}
|
|
157657
|
-
function installPackagedDocyrusPlatformSkill(params) {
|
|
157658
|
-
const skillSourcePath = resolvePackagedDocyrusPlatformSkillPath(params.resourceRoot);
|
|
157659
|
-
if (!(0, import_node_fs17.existsSync)(skillSourcePath)) {
|
|
157660
|
-
process.stderr.write("[docyrus] Packaged docyrus-platform skill is missing. Continuing without agent sync.\n");
|
|
157661
|
-
return;
|
|
157662
|
-
}
|
|
157663
|
-
const result = params.spawnCommand(
|
|
157664
|
-
resolveNpxCommand(),
|
|
157665
|
-
createPackagedDocyrusPlatformInstallArgs({
|
|
157666
|
-
scope: params.scope,
|
|
157667
|
-
skillSourcePath
|
|
157668
|
-
}),
|
|
157669
|
-
{
|
|
157670
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
157671
|
-
encoding: "utf8",
|
|
157672
|
-
cwd: params.cwd,
|
|
157673
|
-
env: {
|
|
157674
|
-
...process.env
|
|
157675
|
-
}
|
|
157676
|
-
}
|
|
157677
|
-
);
|
|
157678
|
-
if (result.error || result.status !== 0) {
|
|
157679
|
-
process.stderr.write(
|
|
157680
|
-
`[docyrus] Automatic docyrus-platform skill sync failed. Continuing without it: ${result.error?.message || summarizeFailure3(result, "npx skills add")}
|
|
157681
|
-
`
|
|
157682
|
-
);
|
|
157683
|
-
}
|
|
157684
|
-
}
|
|
157685
157754
|
function validatePiAgentLaunchRequest(params) {
|
|
157686
157755
|
if (params.request.mode && !params.request.print && params.stdinIsTTY) {
|
|
157687
157756
|
throw new UserInputError("`--mode` requires `--print` when stdin is interactive.");
|
|
@@ -157753,12 +157822,6 @@ function createPiAgentLauncher(options2) {
|
|
|
157753
157822
|
scope: options2.settingsPaths.scope,
|
|
157754
157823
|
spawnCommand
|
|
157755
157824
|
});
|
|
157756
|
-
installPackagedDocyrusPlatformSkill({
|
|
157757
|
-
resourceRoot,
|
|
157758
|
-
cwd,
|
|
157759
|
-
scope: options2.settingsPaths.scope,
|
|
157760
|
-
spawnCommand
|
|
157761
|
-
});
|
|
157762
157825
|
spinner.update("Checking project plan...");
|
|
157763
157826
|
const { resolveProjectPlanGraphPath: resolveProjectPlanGraphPath2, ensureProjectPlanGraph: ensureProjectPlanGraph2 } = await Promise.resolve().then(() => (init_graph2(), graph_exports2));
|
|
157764
157827
|
const projectPlanGraphPath = resolveProjectPlanGraphPath2(cwd);
|
|
@@ -157919,12 +157982,6 @@ function createPiAgentServerLauncher(options2) {
|
|
|
157919
157982
|
scope: options2.settingsPaths.scope,
|
|
157920
157983
|
spawnCommand: import_node_child_process10.spawnSync
|
|
157921
157984
|
});
|
|
157922
|
-
installPackagedDocyrusPlatformSkill({
|
|
157923
|
-
resourceRoot,
|
|
157924
|
-
cwd,
|
|
157925
|
-
scope: options2.settingsPaths.scope,
|
|
157926
|
-
spawnCommand: import_node_child_process10.spawnSync
|
|
157927
|
-
});
|
|
157928
157985
|
spinner.update("Installing tools...");
|
|
157929
157986
|
const officeCli = await ensureManagedOfficeCliInstalled({
|
|
157930
157987
|
agentRootPath,
|
|
@@ -158186,6 +158243,8 @@ var ROOT_HELP_COMMANDS = [
|
|
|
158186
158243
|
{ command: "studio list-data-sources --appSlug <slug>", description: "List studio data sources" },
|
|
158187
158244
|
{ command: "automation list --appSlug <slug>", description: "List automations for an app" },
|
|
158188
158245
|
{ command: "automation create-trigger --automationId <id> --type <type>", description: "Add a typed trigger to an automation" },
|
|
158246
|
+
{ command: "messaging accounts", description: "List tenant email accounts (non-credential info)" },
|
|
158247
|
+
{ command: "messaging email send --accountId <id>", description: "Send an email through a tenant email account" },
|
|
158189
158248
|
{ command: "tui", description: "Launch terminal UI (OpenTUI, requires Bun)" },
|
|
158190
158249
|
{ command: "curl <path>", description: "Send arbitrary API requests" }
|
|
158191
158250
|
];
|
|
@@ -158321,6 +158380,11 @@ function createDocyrusCli(params) {
|
|
|
158321
158380
|
environmentConfigService,
|
|
158322
158381
|
authStore
|
|
158323
158382
|
}));
|
|
158383
|
+
cli2.command(createMessagingCli({
|
|
158384
|
+
createApiClient,
|
|
158385
|
+
environmentConfigService,
|
|
158386
|
+
authStore
|
|
158387
|
+
}));
|
|
158324
158388
|
if (includeTui) {
|
|
158325
158389
|
cli2.command(createTuiCli({
|
|
158326
158390
|
version: package_default.version
|