@oxygen-agent/cli 1.1014.1451 → 1.1014.1464

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 CHANGED
@@ -34,4 +34,4 @@ oxygen update
34
34
 
35
35
  For product documentation, visit https://oxygen-agent.com/docs. For support, visit https://oxygen-agent.com.
36
36
 
37
- Version: 1.1014.1451
37
+ Version: 1.1014.1464
@@ -0,0 +1,7 @@
1
+ export type PublishingApprovalPolicy = {
2
+ mode: "workspace" | "owner";
3
+ owner_user_id?: string;
4
+ delegate_user_ids?: string[];
5
+ };
6
+ export declare function readPublishingApprovalPolicy(metadata: Record<string, unknown>): PublishingApprovalPolicy | null;
7
+ export declare function assertPublishingProfileApprover(policy: PublishingApprovalPolicy | null, actorUserId?: string | null): void;
@@ -0,0 +1,17 @@
1
+ import { OxygenError } from "./cli-result.js";
2
+ export function readPublishingApprovalPolicy(metadata) {
3
+ const value = metadata.publishing_approval;
4
+ if (!value || typeof value !== "object" || Array.isArray(value))
5
+ return null;
6
+ const policy = value;
7
+ return policy.mode === "owner" || policy.mode === "workspace" ? policy : null;
8
+ }
9
+ export function assertPublishingProfileApprover(policy, actorUserId) {
10
+ if (policy?.mode !== "owner")
11
+ return;
12
+ if (actorUserId && (actorUserId === policy.owner_user_id || policy.delegate_user_ids?.includes(actorUserId)))
13
+ return;
14
+ throw new OxygenError("publishing_profile_owner_approval_required", "Only the profile owner or a named delegate can approve posts on this profile.", {
15
+ details: { next_step: "Ask the profile owner or their delegate to review and approve this post." }, exitCode: 1,
16
+ });
17
+ }
@@ -1 +1 @@
1
- export declare const OXYGEN_BUILD_VERSION = "1.1014.1451";
1
+ export declare const OXYGEN_BUILD_VERSION = "1.1014.1464";
@@ -1,2 +1,2 @@
1
1
  // GENERATED by scripts/ci/version-stamp.mjs from VERSION + git history. Do not edit; do not commit.
2
- export const OXYGEN_BUILD_VERSION = "1.1014.1451";
2
+ export const OXYGEN_BUILD_VERSION = "1.1014.1464";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxygen-agent/cli",
3
- "version": "1.1014.1451",
3
+ "version": "1.1014.1464",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",