@backifydev/cli 0.3.16 → 0.3.17
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 +45 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35339,6 +35339,8 @@ function parseApplicationManifest(source) {
|
|
|
35339
35339
|
throw new Error("Capabilities must be an explicit mapping");
|
|
35340
35340
|
const capabilities = {};
|
|
35341
35341
|
for (const [name2, settings] of Object.entries(value.capabilities)) {
|
|
35342
|
+
if (name2 === "audit")
|
|
35343
|
+
throw new Error("The audit capability was removed. Record application events with events.track and declare the events capability instead.");
|
|
35342
35344
|
if (!Object.hasOwn(CAPABILITY_REGISTRY, name2))
|
|
35343
35345
|
throw new Error("Unknown capability: " + name2);
|
|
35344
35346
|
if (!object(settings))
|
|
@@ -35412,12 +35414,12 @@ function manifestDiagnostics(manifest, used, authentication) {
|
|
|
35412
35414
|
// ../platform/dist/delivery.js
|
|
35413
35415
|
var deliveryInstructions = `# Backify application delivery and prompt history
|
|
35414
35416
|
|
|
35415
|
-
Instruction version:
|
|
35416
|
-
Versioned guide: https://agent.backify.dev/
|
|
35417
|
+
Instruction version: 12
|
|
35418
|
+
Versioned guide: https://agent.backify.dev/v12/delivery.md
|
|
35417
35419
|
|
|
35418
35420
|
## Environment and documentation prerequisites
|
|
35419
35421
|
|
|
35420
|
-
Before installation or connection, read https://agent.backify.dev/
|
|
35422
|
+
Before installation or connection, read https://agent.backify.dev/v12 for execution capability checks, required endpoints (including https://docs.backify.dev), native permission requests, verified retries and fallback guidance. Follow the current tool's supported approval mechanism; never bypass restrictions. Read relevant capability documentation before implementation. Local validation must not depend on cloud deployment.
|
|
35421
35423
|
|
|
35422
35424
|
Before application implementation, all required setup checks and connected status must be verified OK. If any required check fails or remains unverified after supported recovery, stop setup and implementation; do not build a local website, minimal shell, placeholder, dependency-free fallback, or downloadable application archive. Report the blockers and recommend running the setup prompt in an AI coding tool such as Codex, Claude Code, or VS Code with GitHub Copilot agent mode, with terminal access, a persistent writable workspace, package installation, outbound HTTPS/DNS, and test execution enabled. Tool names alone do not guarantee readiness. Do not ask the application requirements question while setup is blocked. Later preview approval or deployment failures do not invalidate an already verified setup gate.
|
|
35423
35425
|
|
|
@@ -35437,7 +35439,7 @@ Initialize using App Id from the copied prompt and the current tool selection:
|
|
|
35437
35439
|
|
|
35438
35440
|
npx @backifydev/cli@latest init --app <app-id> --agent <current-tool>
|
|
35439
35441
|
|
|
35440
|
-
For a tool without a built-in preset, replace --agent <current-tool> with --instruction-file <relative-path>. Read BACKIFY.md and the instruction file used by the current AI coding tool before changing application code. Create or update only instruction files used by that tool; never create files for other coding tools. Use --agent for a built-in tool preset or --instruction-file <relative-path> for the current tool's native instruction file, as described in the setup guide. Initialization installs this workflow alongside the persistent SDK instructions. Follow https://agent.backify.dev/
|
|
35442
|
+
For a tool without a built-in preset, replace --agent <current-tool> with --instruction-file <relative-path>. Read BACKIFY.md and the instruction file used by the current AI coding tool before changing application code. Create or update only instruction files used by that tool; never create files for other coding tools. Use --agent for a built-in tool preset or --instruction-file <relative-path> for the current tool's native instruction file, as described in the setup guide. Initialization installs this workflow alongside the persistent SDK instructions. Follow https://agent.backify.dev/v12 for instruction version 12; use the guide matching backify.json in an existing application. Do not silently upgrade its managed instruction version or overwrite instructions outside the managed block.
|
|
35441
35443
|
|
|
35442
35444
|
Run the following to discover the connected hosting target, repository, branch, reports, releases, and deployment failures:
|
|
35443
35445
|
|
|
@@ -35519,7 +35521,7 @@ These instructions are an explicit agent workflow, not a universal chat intercep
|
|
|
35519
35521
|
`;
|
|
35520
35522
|
|
|
35521
35523
|
// ../platform/dist/index.js
|
|
35522
|
-
var INSTRUCTION_VERSION =
|
|
35524
|
+
var INSTRUCTION_VERSION = 12;
|
|
35523
35525
|
var SDK_PACKAGE = "@backifydev/sdk";
|
|
35524
35526
|
var DOCS_URL = "https://docs.backify.dev";
|
|
35525
35527
|
var MAIL_LIMITS = Object.freeze({
|
|
@@ -35550,12 +35552,11 @@ var CAPABILITIES = [
|
|
|
35550
35552
|
capability("integrations", "integrations", "Approved, versioned API contracts and environment-scoped operation grants", true),
|
|
35551
35553
|
capability("http", "http", "Governed outbound HTTP"),
|
|
35552
35554
|
capability("ai", "ai", "Server-only ai.generate, ai.extract, ai.classify and ai.embed. Declare capabilities.ai in backify.yaml; optional models may use default, fast, smart or foundry- IDs from the application's location-aware AI catalog, within its allowed-model policy. Backify provisions isolated Azure Foundry model deployments and supplies scoped runtime credentials automatically. Do not add Azure/OpenAI credentials to application code."),
|
|
35553
|
-
capability("audit", "audit", "Structured audit records"),
|
|
35554
35555
|
capability("logs", "logs", "Structured application logging"),
|
|
35555
35556
|
capability("config", "config", "Non-secret application configuration")
|
|
35556
35557
|
];
|
|
35557
35558
|
var CAPABILITY_REGISTRY = Object.fromEntries(CAPABILITIES.map((x) => [x.name, x]));
|
|
35558
|
-
var SDK_IMPORT_CAPABILITIES = { integrations: "integrations", defineJob: "jobs", database: "database", auth: "auth", db: "database", storage: "storage", functions: "functions", defineFunction: "functions", jobs: "jobs", mail: "mail", webhooks: "events", events: "events", secrets: "secrets", http: "http", ai: "ai",
|
|
35559
|
+
var SDK_IMPORT_CAPABILITIES = { integrations: "integrations", defineJob: "jobs", database: "database", auth: "auth", db: "database", storage: "storage", functions: "functions", defineFunction: "functions", jobs: "jobs", mail: "mail", webhooks: "events", events: "events", secrets: "secrets", http: "http", ai: "ai", logs: "logs", logging: "logs", config: "config" };
|
|
35559
35560
|
var MANAGED_START = "<!-- BACKIFY:MANAGED:START -->";
|
|
35560
35561
|
var MANAGED_END = "<!-- BACKIFY:MANAGED:END -->";
|
|
35561
35562
|
function managedInstructions() {
|
|
@@ -35578,8 +35579,8 @@ Before dependent setup operations, follow the environment checks and permission
|
|
|
35578
35579
|
- Authentication and authorization: \`auth\`.
|
|
35579
35580
|
- Persistent data and files: \`db\` and \`storage\`.
|
|
35580
35581
|
- Server functions: \`defineFunction\`; background work and schedules: \`jobs\` and \`jobs.schedule\`.
|
|
35581
|
-
- Events, outbound HTTP, and AI: \`events
|
|
35582
|
-
- Server-side secrets, configuration,
|
|
35582
|
+
- Events and event tracking, outbound HTTP, and AI: \`events\` (\`events.track\` records application events), \`http.fetch\`, and \`ai\`.
|
|
35583
|
+
- Server-side secrets, configuration, and logs: \`secrets\`, \`config\`, and \`logs\`.
|
|
35583
35584
|
|
|
35584
35585
|
Verify API signatures against the installed SDK types and the relevant guide at ${DOCS_URL}/capabilities/. Never invent SDK methods. Use \`@backifydev/sdk/local\` for tests and local development; \`@backifydev/sdk/runtime\` is for runtime hosts, not application code.
|
|
35585
35586
|
|
|
@@ -35845,7 +35846,7 @@ import { hostname, platform, release, arch } from "node:os";
|
|
|
35845
35846
|
// package.json
|
|
35846
35847
|
var package_default = {
|
|
35847
35848
|
name: "@backifydev/cli",
|
|
35848
|
-
version: "0.3.
|
|
35849
|
+
version: "0.3.17",
|
|
35849
35850
|
description: "Command-line setup and diagnostics for Backify applications",
|
|
35850
35851
|
type: "module",
|
|
35851
35852
|
bin: {
|
|
@@ -37916,7 +37917,15 @@ function createHcrEventsProvider(options) {
|
|
|
37916
37917
|
throw new Error("Invalid event binding name");
|
|
37917
37918
|
const route = base.toString().replace(/\/$/, "") + "/v1/events/" + binding;
|
|
37918
37919
|
const transport = options.fetch ?? globalThis.fetch;
|
|
37919
|
-
const
|
|
37920
|
+
const validateId = (id) => {
|
|
37921
|
+
if (typeof id !== "string" || !/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(id) || id.length !== 36 || id === "00000000-0000-0000-0000-000000000000")
|
|
37922
|
+
throw new Error("Invalid event delivery id");
|
|
37923
|
+
};
|
|
37924
|
+
const validateReceipt = (receipt) => {
|
|
37925
|
+
if (typeof receipt !== "string" || !/^[a-f0-9]{64}$/.test(receipt) || receipt.length !== 64)
|
|
37926
|
+
throw new Error("Invalid event delivery receipt");
|
|
37927
|
+
};
|
|
37928
|
+
const request = async (path, body, deliveries = false, metadata = false, maximumBytes3 = metadata ? 131072 : 5242880) => {
|
|
37920
37929
|
serverOnly();
|
|
37921
37930
|
let token;
|
|
37922
37931
|
try {
|
|
@@ -37963,7 +37972,7 @@ function createHcrEventsProvider(options) {
|
|
|
37963
37972
|
if (part.done)
|
|
37964
37973
|
break;
|
|
37965
37974
|
length += part.value.length;
|
|
37966
|
-
if (length >
|
|
37975
|
+
if (length > maximumBytes3)
|
|
37967
37976
|
throw new Error("Event response exceeds its bound");
|
|
37968
37977
|
chunks.push(part.value);
|
|
37969
37978
|
}
|
|
@@ -38051,10 +38060,31 @@ function createHcrEventsProvider(options) {
|
|
|
38051
38060
|
}
|
|
38052
38061
|
return value;
|
|
38053
38062
|
},
|
|
38054
|
-
async complete(id, receipt, retry) {
|
|
38055
|
-
|
|
38063
|
+
async complete(id, receipt, retry, completeOptions) {
|
|
38064
|
+
try {
|
|
38065
|
+
validateId(id);
|
|
38066
|
+
validateReceipt(receipt);
|
|
38067
|
+
} catch {
|
|
38056
38068
|
throw new Error("Invalid event delivery receipt");
|
|
38057
|
-
|
|
38069
|
+
}
|
|
38070
|
+
if (retry !== void 0 && typeof retry !== "boolean")
|
|
38071
|
+
throw new Error("Invalid event delivery receipt");
|
|
38072
|
+
const delay = completeOptions?.retryDelaySeconds;
|
|
38073
|
+
if (delay !== void 0 && (!Number.isInteger(delay) || delay < 0 || delay > 3600 || !retry && delay !== 0))
|
|
38074
|
+
throw new Error("Invalid event retry delay");
|
|
38075
|
+
await request("/" + id + "/complete", { receipt, retry: retry ?? false, ...delay === void 0 ? {} : { retryDelaySeconds: delay } });
|
|
38076
|
+
},
|
|
38077
|
+
async renew(id, receipt) {
|
|
38078
|
+
validateId(id);
|
|
38079
|
+
validateReceipt(receipt);
|
|
38080
|
+
const value = await request("/" + id + "/renew", { receipt }, true, false, 1024);
|
|
38081
|
+
if (!value || typeof value !== "object" || Object.keys(value).join(",") !== "leaseExpiresAt" || typeof value.leaseExpiresAt !== "string" || !Number.isFinite(Date.parse(value.leaseExpiresAt)))
|
|
38082
|
+
throw new Error("HCR events returned an invalid lease");
|
|
38083
|
+
return value;
|
|
38084
|
+
},
|
|
38085
|
+
async replay(id) {
|
|
38086
|
+
validateId(id);
|
|
38087
|
+
await request("/" + id + "/replay", {});
|
|
38058
38088
|
}
|
|
38059
38089
|
};
|
|
38060
38090
|
}
|