@docyrus/docyrus 0.0.19 → 0.0.20
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/agent-loader.js +5 -2
- package/agent-loader.js.map +2 -2
- package/main.js +185 -31
- package/main.js.map +2 -2
- package/package.json +3 -3
- package/resources/pi-agent/prompts/coder-system.md +106 -0
- package/resources/pi-agent/skills/docyrus-platform/SKILL.md +71 -0
- package/resources/pi-agent/skills/docyrus-platform/references/ai-capabilities.md +43 -0
- package/resources/pi-agent/skills/docyrus-platform/references/auth-and-multi-tenancy.md +35 -0
- package/resources/pi-agent/skills/docyrus-platform/references/automation-and-workflows.md +30 -0
- package/resources/pi-agent/skills/docyrus-platform/references/core-building-blocks.md +53 -0
- package/resources/pi-agent/skills/{docyrus-api-dev → docyrus-platform}/references/data-source-query-guide.md +32 -28
- package/resources/pi-agent/skills/docyrus-platform/references/developer-tools.md +28 -0
- package/resources/pi-agent/skills/docyrus-platform/references/docyrus-cli-usage.md +503 -0
- package/resources/pi-agent/skills/{docyrus-api-dev → docyrus-platform}/references/formula-design-guide-llm.md +15 -23
- package/resources/pi-agent/skills/docyrus-platform/references/integrations-and-events.md +60 -0
- package/resources/pi-agent/skills/docyrus-platform/references/platform-services.md +58 -0
- package/resources/pi-agent/skills/docyrus-platform/references/querying-and-data-operations.md +27 -0
- package/resources/pi-agent/prompts/coder-append-system.md +0 -19
- package/resources/pi-agent/skills/docyrus-ai/SKILL.md +0 -28
- package/resources/pi-agent/skills/docyrus-api-dev/SKILL.md +0 -161
- package/resources/pi-agent/skills/docyrus-api-dev/references/api-client.md +0 -349
- package/resources/pi-agent/skills/docyrus-api-dev/references/authentication.md +0 -238
- package/resources/pi-agent/skills/docyrus-api-dev/references/query-and-formulas.md +0 -592
- package/resources/pi-agent/skills/docyrus-api-doctor/SKILL.md +0 -70
- package/resources/pi-agent/skills/docyrus-api-doctor/references/checklist-details.md +0 -588
- package/resources/pi-agent/skills/docyrus-app-dev/SKILL.md +0 -159
- package/resources/pi-agent/skills/docyrus-app-dev/references/api-client-and-auth.md +0 -275
- package/resources/pi-agent/skills/docyrus-app-dev/references/collections-and-patterns.md +0 -352
- package/resources/pi-agent/skills/docyrus-app-dev/references/data-source-query-guide.md +0 -2059
- package/resources/pi-agent/skills/docyrus-app-dev/references/formula-design-guide-llm.md +0 -320
- package/resources/pi-agent/skills/docyrus-app-dev/references/query-guide.md +0 -525
- package/resources/pi-agent/skills/docyrus-app-ui-design/SKILL.md +0 -466
- package/resources/pi-agent/skills/docyrus-app-ui-design/references/component-selection-guide.md +0 -602
- package/resources/pi-agent/skills/docyrus-app-ui-design/references/icon-usage-guide.md +0 -463
- package/resources/pi-agent/skills/docyrus-app-ui-design/references/preferred-components-catalog.md +0 -242
- package/resources/pi-agent/skills/docyrus-apps/SKILL.md +0 -54
- package/resources/pi-agent/skills/docyrus-architect/SKILL.md +0 -174
- package/resources/pi-agent/skills/docyrus-architect/references/custom-query-guide.md +0 -410
- package/resources/pi-agent/skills/docyrus-architect/references/data-source-query-guide.md +0 -2059
- package/resources/pi-agent/skills/docyrus-architect/references/formula-design-guide-llm.md +0 -320
- package/resources/pi-agent/skills/docyrus-architect/references/formula-reference.md +0 -145
- package/resources/pi-agent/skills/docyrus-auth/SKILL.md +0 -100
- package/resources/pi-agent/skills/docyrus-cli-app/SKILL.md +0 -279
- package/resources/pi-agent/skills/docyrus-cli-app/references/cli-manifest.md +0 -532
- package/resources/pi-agent/skills/docyrus-cli-app/references/list-query-examples.md +0 -248
- package/resources/pi-agent/skills/docyrus-curl/SKILL.md +0 -32
- package/resources/pi-agent/skills/docyrus-discover/SKILL.md +0 -63
- package/resources/pi-agent/skills/docyrus-ds/SKILL.md +0 -95
- package/resources/pi-agent/skills/docyrus-env/SKILL.md +0 -21
- package/resources/pi-agent/skills/docyrus-studio/SKILL.md +0 -369
- package/resources/pi-agent/skills/docyrus-tui/SKILL.md +0 -15
package/main.js
CHANGED
|
@@ -124678,7 +124678,7 @@ function buildInputSchema(args, env2, options2) {
|
|
|
124678
124678
|
// package.json
|
|
124679
124679
|
var package_default = {
|
|
124680
124680
|
name: "@docyrus/docyrus",
|
|
124681
|
-
version: "0.0.
|
|
124681
|
+
version: "0.0.20",
|
|
124682
124682
|
private: false,
|
|
124683
124683
|
description: "Docyrus API CLI",
|
|
124684
124684
|
main: "./main.js",
|
|
@@ -124687,8 +124687,8 @@ var package_default = {
|
|
|
124687
124687
|
},
|
|
124688
124688
|
dependencies: {
|
|
124689
124689
|
"@clack/prompts": "^0.11.0",
|
|
124690
|
-
"@mariozechner/pi-ai": "0.
|
|
124691
|
-
"@mariozechner/pi-coding-agent": "0.
|
|
124690
|
+
"@mariozechner/pi-ai": "0.61.0",
|
|
124691
|
+
"@mariozechner/pi-coding-agent": "0.61.0",
|
|
124692
124692
|
"@opentui/core": "^0.1.85",
|
|
124693
124693
|
"@opentui/react": "^0.1.85",
|
|
124694
124694
|
incur: "^0.1.6",
|
|
@@ -125956,6 +125956,20 @@ var BULK_OPERATION_LIMIT = 50;
|
|
|
125956
125956
|
function isRecord(value) {
|
|
125957
125957
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
125958
125958
|
}
|
|
125959
|
+
function normalizeOptionalString(value) {
|
|
125960
|
+
const trimmed = value?.trim();
|
|
125961
|
+
return trimmed && trimmed.length > 0 ? trimmed : void 0;
|
|
125962
|
+
}
|
|
125963
|
+
function normalizeJsonLikeQueryValue(value, flag) {
|
|
125964
|
+
const trimmed = normalizeOptionalString(value);
|
|
125965
|
+
if (!trimmed) {
|
|
125966
|
+
return void 0;
|
|
125967
|
+
}
|
|
125968
|
+
if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
|
|
125969
|
+
return JSON.stringify(parseJsonData(trimmed, flag));
|
|
125970
|
+
}
|
|
125971
|
+
return trimmed;
|
|
125972
|
+
}
|
|
125959
125973
|
function toBulkPayload(payload, mode) {
|
|
125960
125974
|
if (!Array.isArray(payload)) {
|
|
125961
125975
|
return null;
|
|
@@ -126004,7 +126018,10 @@ function createDsCli(dependencies) {
|
|
|
126004
126018
|
const apiClient = dependencies.createApiClient(apiBaseUrl);
|
|
126005
126019
|
const response = await apiClient.request({
|
|
126006
126020
|
method: "GET",
|
|
126007
|
-
path: `/apps/${context.args.appSlug}/data-sources/${context.args.dataSourceSlug}
|
|
126021
|
+
path: `/apps/${context.args.appSlug}/data-sources/${context.args.dataSourceSlug}`,
|
|
126022
|
+
query: {
|
|
126023
|
+
expand: "fields"
|
|
126024
|
+
}
|
|
126008
126025
|
});
|
|
126009
126026
|
return await injectContext({
|
|
126010
126027
|
apiBaseUrl,
|
|
@@ -126020,31 +126037,44 @@ function createDsCli(dependencies) {
|
|
|
126020
126037
|
dataSourceSlug: external_exports.string().min(1)
|
|
126021
126038
|
}),
|
|
126022
126039
|
options: external_exports.object({
|
|
126023
|
-
|
|
126024
|
-
|
|
126040
|
+
collapseRows: external_exports.boolean().optional().describe("Collapse rows into a single aggregated array"),
|
|
126041
|
+
columns: external_exports.string().optional().describe("Columns to select; comma-separated or JSON array"),
|
|
126042
|
+
distinctColumns: external_exports.string().optional().describe("Distinct columns; comma-separated or JSON array"),
|
|
126043
|
+
formulas: external_exports.string().optional().describe("JSON formulas object"),
|
|
126044
|
+
calculations: external_exports.string().optional().describe("JSON calculations array"),
|
|
126045
|
+
filters: external_exports.string().optional().describe("JSON filter group"),
|
|
126046
|
+
filterKeyword: external_exports.string().optional().describe("Keyword filter"),
|
|
126025
126047
|
limit: external_exports.number().optional(),
|
|
126026
126048
|
offset: external_exports.number().optional(),
|
|
126027
|
-
orderBy: external_exports.string().optional(),
|
|
126028
|
-
|
|
126049
|
+
orderBy: external_exports.string().optional().describe("Sort order string or JSON object/array"),
|
|
126050
|
+
groupSummaries: external_exports.boolean().optional().describe("Return per-group summaries when calculations are used"),
|
|
126051
|
+
fullCount: external_exports.boolean().optional(),
|
|
126052
|
+
expand: external_exports.string().optional().describe("Expand columns; comma-separated or JSON array"),
|
|
126053
|
+
pivot: external_exports.string().optional().describe("JSON pivot configuration"),
|
|
126054
|
+
childQueries: external_exports.string().optional().describe("JSON child query array")
|
|
126029
126055
|
}),
|
|
126030
126056
|
run: async (context) => {
|
|
126031
126057
|
const apiBaseUrl = await dependencies.environmentConfigService.getActiveApiBaseUrl();
|
|
126032
126058
|
const apiClient = dependencies.createApiClient(apiBaseUrl);
|
|
126033
|
-
let serializedFilters;
|
|
126034
|
-
if (context.options.filters) {
|
|
126035
|
-
const parsedFilters = parseJsonData(context.options.filters, "--filters");
|
|
126036
|
-
serializedFilters = JSON.stringify(parsedFilters);
|
|
126037
|
-
}
|
|
126038
126059
|
const response = await apiClient.request({
|
|
126039
126060
|
method: "GET",
|
|
126040
126061
|
path: `/apps/${context.args.appSlug}/data-sources/${context.args.dataSourceSlug}/items`,
|
|
126041
126062
|
query: {
|
|
126042
|
-
|
|
126043
|
-
|
|
126063
|
+
collapseRows: context.options.collapseRows,
|
|
126064
|
+
columns: normalizeJsonLikeQueryValue(context.options.columns, "--columns"),
|
|
126065
|
+
distinctColumns: normalizeJsonLikeQueryValue(context.options.distinctColumns, "--distinctColumns"),
|
|
126066
|
+
formulas: normalizeJsonLikeQueryValue(context.options.formulas, "--formulas"),
|
|
126067
|
+
calculations: normalizeJsonLikeQueryValue(context.options.calculations, "--calculations"),
|
|
126068
|
+
filters: normalizeJsonLikeQueryValue(context.options.filters, "--filters"),
|
|
126069
|
+
filterKeyword: normalizeOptionalString(context.options.filterKeyword),
|
|
126044
126070
|
limit: context.options.limit,
|
|
126045
126071
|
offset: context.options.offset,
|
|
126046
|
-
orderBy: context.options.orderBy,
|
|
126047
|
-
|
|
126072
|
+
orderBy: normalizeJsonLikeQueryValue(context.options.orderBy, "--orderBy"),
|
|
126073
|
+
groupSummaries: context.options.groupSummaries,
|
|
126074
|
+
fullCount: context.options.fullCount,
|
|
126075
|
+
expand: normalizeJsonLikeQueryValue(context.options.expand, "--expand"),
|
|
126076
|
+
pivot: normalizeJsonLikeQueryValue(context.options.pivot, "--pivot"),
|
|
126077
|
+
childQueries: normalizeJsonLikeQueryValue(context.options.childQueries, "--childQueries")
|
|
126048
126078
|
}
|
|
126049
126079
|
});
|
|
126050
126080
|
return await injectContext({
|
|
@@ -126920,25 +126950,13 @@ function createStudioCli(dependencies) {
|
|
|
126920
126950
|
studioCli.command("get-data-source", {
|
|
126921
126951
|
description: "Get a single data source",
|
|
126922
126952
|
options: external_exports.object({
|
|
126923
|
-
|
|
126924
|
-
appSlug: external_exports.string().optional().describe("App slug"),
|
|
126925
|
-
dataSourceId: external_exports.string().optional().describe("Data source ID"),
|
|
126926
|
-
dataSourceSlug: external_exports.string().optional().describe("Data source slug")
|
|
126953
|
+
dataSourceId: external_exports.string().min(1).describe("Data source ID")
|
|
126927
126954
|
}),
|
|
126928
126955
|
run: async (context) => {
|
|
126929
126956
|
const studio = await getStudioRunContext(dependencies);
|
|
126930
|
-
const appId = await studio.resolver.resolveAppId({
|
|
126931
|
-
appId: context.options.appId,
|
|
126932
|
-
appSlug: context.options.appSlug
|
|
126933
|
-
});
|
|
126934
|
-
const dataSourceId = await studio.resolver.resolveDataSourceId({
|
|
126935
|
-
appId,
|
|
126936
|
-
dataSourceId: context.options.dataSourceId,
|
|
126937
|
-
dataSourceSlug: context.options.dataSourceSlug
|
|
126938
|
-
});
|
|
126939
126957
|
const response = await studio.apiClient.request({
|
|
126940
126958
|
method: "GET",
|
|
126941
|
-
path: `/dev/
|
|
126959
|
+
path: `/dev/data-sources/${context.options.dataSourceId}`
|
|
126942
126960
|
});
|
|
126943
126961
|
return await wrapStudioPayload(studio.apiBaseUrl, dependencies, response.data);
|
|
126944
126962
|
}
|
|
@@ -128918,6 +128936,23 @@ var import_node_child_process3 = require("node:child_process");
|
|
|
128918
128936
|
var import_node_fs4 = require("node:fs");
|
|
128919
128937
|
var import_promises7 = require("node:fs/promises");
|
|
128920
128938
|
var import_node_path9 = require("node:path");
|
|
128939
|
+
var DOCYRUS_EXTERNAL_SKILL_SOURCE = "docyrus/agent-skills";
|
|
128940
|
+
var DOCYRUS_PACKAGED_PLATFORM_SKILL_NAME = "docyrus-platform";
|
|
128941
|
+
var DOCYRUS_MIGRATED_SKILL_NAMES = [
|
|
128942
|
+
"docyrus-app-dev",
|
|
128943
|
+
"docyrus-api-dev",
|
|
128944
|
+
"docyrus-cli-app"
|
|
128945
|
+
];
|
|
128946
|
+
var DOCYRUS_EXTERNAL_SKILL_AGENT_IDS = [
|
|
128947
|
+
"pi",
|
|
128948
|
+
"claude-code",
|
|
128949
|
+
"codex",
|
|
128950
|
+
"github-copilot",
|
|
128951
|
+
"gemini-cli",
|
|
128952
|
+
"antigravity",
|
|
128953
|
+
"windsurf"
|
|
128954
|
+
];
|
|
128955
|
+
var DOCYRUS_EXTERNAL_SKILL_MARKER_FILE = ".docyrus-external-skills-installed.json";
|
|
128921
128956
|
function summarizeFailure2(result) {
|
|
128922
128957
|
const stderr = result.stderr?.toString().trim();
|
|
128923
128958
|
if (stderr && stderr.length > 0) {
|
|
@@ -129074,6 +129109,12 @@ async function syncPackagedSkills(params) {
|
|
|
129074
129109
|
const entries = await (0, import_promises7.readdir)(sourceSkillsRoot, {
|
|
129075
129110
|
withFileTypes: true
|
|
129076
129111
|
});
|
|
129112
|
+
await Promise.all(DOCYRUS_MIGRATED_SKILL_NAMES.map(async (skillName) => {
|
|
129113
|
+
await (0, import_promises7.rm)((0, import_node_path9.join)(targetSkillsRoot, skillName), {
|
|
129114
|
+
recursive: true,
|
|
129115
|
+
force: true
|
|
129116
|
+
});
|
|
129117
|
+
}));
|
|
129077
129118
|
await Promise.all(entries.map(async (entry) => {
|
|
129078
129119
|
await (0, import_promises7.cp)((0, import_node_path9.join)(sourceSkillsRoot, entry.name), (0, import_node_path9.join)(targetSkillsRoot, entry.name), {
|
|
129079
129120
|
recursive: true,
|
|
@@ -129093,6 +129134,107 @@ async function writeRuntimeSkill(params) {
|
|
|
129093
129134
|
mode: 384
|
|
129094
129135
|
});
|
|
129095
129136
|
}
|
|
129137
|
+
function resolveNpxCommand() {
|
|
129138
|
+
return process.platform === "win32" ? "npx.cmd" : "npx";
|
|
129139
|
+
}
|
|
129140
|
+
function createDocyrusSkillsInstallArgs(scope) {
|
|
129141
|
+
const args = [
|
|
129142
|
+
"skills",
|
|
129143
|
+
"add",
|
|
129144
|
+
DOCYRUS_EXTERNAL_SKILL_SOURCE
|
|
129145
|
+
];
|
|
129146
|
+
if (scope === "global") {
|
|
129147
|
+
args.push("--global");
|
|
129148
|
+
}
|
|
129149
|
+
args.push(
|
|
129150
|
+
"--skill",
|
|
129151
|
+
...DOCYRUS_MIGRATED_SKILL_NAMES,
|
|
129152
|
+
"--agent",
|
|
129153
|
+
...DOCYRUS_EXTERNAL_SKILL_AGENT_IDS,
|
|
129154
|
+
"--yes"
|
|
129155
|
+
);
|
|
129156
|
+
return args;
|
|
129157
|
+
}
|
|
129158
|
+
function createPackagedDocyrusPlatformInstallArgs(params) {
|
|
129159
|
+
const args = [
|
|
129160
|
+
"skills",
|
|
129161
|
+
"add",
|
|
129162
|
+
params.skillSourcePath
|
|
129163
|
+
];
|
|
129164
|
+
if (params.scope === "global") {
|
|
129165
|
+
args.push("--global");
|
|
129166
|
+
}
|
|
129167
|
+
args.push(
|
|
129168
|
+
"--agent",
|
|
129169
|
+
...DOCYRUS_EXTERNAL_SKILL_AGENT_IDS,
|
|
129170
|
+
"--copy",
|
|
129171
|
+
"--yes"
|
|
129172
|
+
);
|
|
129173
|
+
return args;
|
|
129174
|
+
}
|
|
129175
|
+
async function installExternalDocyrusSkillsOnce(params) {
|
|
129176
|
+
const markerPath = (0, import_node_path9.join)(params.agentRootPath, DOCYRUS_EXTERNAL_SKILL_MARKER_FILE);
|
|
129177
|
+
if ((0, import_node_fs4.existsSync)(markerPath)) {
|
|
129178
|
+
return;
|
|
129179
|
+
}
|
|
129180
|
+
const result = params.spawnCommand(resolveNpxCommand(), createDocyrusSkillsInstallArgs(params.scope), {
|
|
129181
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
129182
|
+
encoding: "utf8",
|
|
129183
|
+
cwd: params.cwd,
|
|
129184
|
+
env: {
|
|
129185
|
+
...process.env
|
|
129186
|
+
}
|
|
129187
|
+
});
|
|
129188
|
+
if (result.error || result.status !== 0) {
|
|
129189
|
+
process.stderr.write(
|
|
129190
|
+
`[docyrus] Automatic Docyrus skill install failed. Continuing without it: ${result.error?.message || summarizeFailure2(result)}
|
|
129191
|
+
`
|
|
129192
|
+
);
|
|
129193
|
+
return;
|
|
129194
|
+
}
|
|
129195
|
+
await (0, import_promises7.writeFile)(markerPath, `${JSON.stringify({
|
|
129196
|
+
source: DOCYRUS_EXTERNAL_SKILL_SOURCE,
|
|
129197
|
+
skills: DOCYRUS_MIGRATED_SKILL_NAMES,
|
|
129198
|
+
agents: DOCYRUS_EXTERNAL_SKILL_AGENT_IDS,
|
|
129199
|
+
scope: params.scope,
|
|
129200
|
+
installedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
129201
|
+
}, null, 2)}
|
|
129202
|
+
`, {
|
|
129203
|
+
encoding: "utf8",
|
|
129204
|
+
mode: 384
|
|
129205
|
+
});
|
|
129206
|
+
}
|
|
129207
|
+
function resolvePackagedDocyrusPlatformSkillPath(resourceRoot) {
|
|
129208
|
+
return (0, import_node_path9.join)(resourceRoot, "skills", DOCYRUS_PACKAGED_PLATFORM_SKILL_NAME);
|
|
129209
|
+
}
|
|
129210
|
+
function installPackagedDocyrusPlatformSkill(params) {
|
|
129211
|
+
const skillSourcePath = resolvePackagedDocyrusPlatformSkillPath(params.resourceRoot);
|
|
129212
|
+
if (!(0, import_node_fs4.existsSync)(skillSourcePath)) {
|
|
129213
|
+
process.stderr.write("[docyrus] Packaged docyrus-platform skill is missing. Continuing without agent sync.\n");
|
|
129214
|
+
return;
|
|
129215
|
+
}
|
|
129216
|
+
const result = params.spawnCommand(
|
|
129217
|
+
resolveNpxCommand(),
|
|
129218
|
+
createPackagedDocyrusPlatformInstallArgs({
|
|
129219
|
+
scope: params.scope,
|
|
129220
|
+
skillSourcePath
|
|
129221
|
+
}),
|
|
129222
|
+
{
|
|
129223
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
129224
|
+
encoding: "utf8",
|
|
129225
|
+
cwd: params.cwd,
|
|
129226
|
+
env: {
|
|
129227
|
+
...process.env
|
|
129228
|
+
}
|
|
129229
|
+
}
|
|
129230
|
+
);
|
|
129231
|
+
if (result.error || result.status !== 0) {
|
|
129232
|
+
process.stderr.write(
|
|
129233
|
+
`[docyrus] Automatic docyrus-platform skill sync failed. Continuing without it: ${result.error?.message || summarizeFailure2(result)}
|
|
129234
|
+
`
|
|
129235
|
+
);
|
|
129236
|
+
}
|
|
129237
|
+
}
|
|
129096
129238
|
function validatePiAgentLaunchRequest(params) {
|
|
129097
129239
|
if (params.request.mode && !params.request.print && params.stdinIsTTY) {
|
|
129098
129240
|
throw new UserInputError("`--mode` requires `--print` when stdin is interactive.");
|
|
@@ -129133,6 +129275,18 @@ function createPiAgentLauncher(options2) {
|
|
|
129133
129275
|
settingsRootPath
|
|
129134
129276
|
})
|
|
129135
129277
|
});
|
|
129278
|
+
await installExternalDocyrusSkillsOnce({
|
|
129279
|
+
agentRootPath,
|
|
129280
|
+
cwd,
|
|
129281
|
+
scope: options2.settingsPaths.scope,
|
|
129282
|
+
spawnCommand
|
|
129283
|
+
});
|
|
129284
|
+
installPackagedDocyrusPlatformSkill({
|
|
129285
|
+
resourceRoot,
|
|
129286
|
+
cwd,
|
|
129287
|
+
scope: options2.settingsPaths.scope,
|
|
129288
|
+
spawnCommand
|
|
129289
|
+
});
|
|
129136
129290
|
const loaderEntryPath = resolveLoaderPath({ cwd });
|
|
129137
129291
|
const piPackageRoot = resolvePiPackageRoot({ cwd });
|
|
129138
129292
|
const result = spawnCommand(processExecPath, [loaderEntryPath], {
|