ugcinc 4.1.135 → 4.2.0
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/accounts.d.ts +3 -2
- package/dist/billing.d.ts +97 -0
- package/dist/billing.js +57 -0
- package/dist/client.d.ts +5 -0
- package/dist/client.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -2
- package/dist/skills.js +65 -0
- package/dist/tools/billing.d.ts +2 -0
- package/dist/tools/billing.js +72 -0
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.js +4 -1
- package/package.json +1 -1
package/dist/accounts.d.ts
CHANGED
|
@@ -20,8 +20,9 @@ export interface Account {
|
|
|
20
20
|
niches: string | null;
|
|
21
21
|
age_range: string | null;
|
|
22
22
|
sex: string | null;
|
|
23
|
-
status: 'uninitialized' | 'pending' | 'initialized' | 'setup' | 'warming' | 'warmed' | 'needs_replacement' | 'replacing' | 'failed' | 'deleted';
|
|
23
|
+
status: 'uninitialized' | 'pending' | 'initialized' | 'setup' | 'warming' | 'warmed' | 'needs_replacement' | 'replacing' | 'failed' | 'deleted' | 'reclaimed';
|
|
24
24
|
phone_type: 'physical_iphone' | 'physical_android' | 'emulated_android' | 'social_api' | 'tracking' | null;
|
|
25
|
+
replacement_count: number;
|
|
25
26
|
oneup_social_network_id?: string | null;
|
|
26
27
|
oneup_category_id?: string | null;
|
|
27
28
|
metadata?: {
|
|
@@ -69,7 +70,7 @@ export interface GetAccountsParams {
|
|
|
69
70
|
tag?: string;
|
|
70
71
|
org_group?: string;
|
|
71
72
|
user_group?: string;
|
|
72
|
-
status?: 'uninitialized' | 'pending' | 'initialized' | 'setup' | 'warming' | 'warmed' | 'needs_replacement' | 'replacing' | 'failed' | 'deleted';
|
|
73
|
+
status?: 'uninitialized' | 'pending' | 'initialized' | 'setup' | 'warming' | 'warmed' | 'needs_replacement' | 'replacing' | 'failed' | 'deleted' | 'reclaimed';
|
|
73
74
|
}
|
|
74
75
|
export interface GetAccountStatsParams {
|
|
75
76
|
accountIds?: string[];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { BaseClient } from './base';
|
|
2
|
+
import type { ApiResponse } from './types';
|
|
3
|
+
export interface BillingInfo {
|
|
4
|
+
billing_id: string;
|
|
5
|
+
subscription: {
|
|
6
|
+
status: string;
|
|
7
|
+
cancel_at_period_end: boolean;
|
|
8
|
+
current_period_start: string;
|
|
9
|
+
current_period_end: string;
|
|
10
|
+
slots: {
|
|
11
|
+
basic: number;
|
|
12
|
+
premium: number;
|
|
13
|
+
};
|
|
14
|
+
} | null;
|
|
15
|
+
orgs: Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
name: string | null;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export interface CancelSubscriptionResponse {
|
|
21
|
+
message: string;
|
|
22
|
+
}
|
|
23
|
+
export interface PortalUrlResponse {
|
|
24
|
+
url: string;
|
|
25
|
+
}
|
|
26
|
+
export interface DeactivateAccountParams {
|
|
27
|
+
account_id: string;
|
|
28
|
+
}
|
|
29
|
+
export interface DeactivateAccountResponse {
|
|
30
|
+
message: string;
|
|
31
|
+
account_id: string;
|
|
32
|
+
}
|
|
33
|
+
export interface RequestReplacementParams {
|
|
34
|
+
account_id: string;
|
|
35
|
+
reason?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface RequestReplacementResponse {
|
|
38
|
+
message: string;
|
|
39
|
+
request: BillingRequestInfo | null;
|
|
40
|
+
new_account_id: string | null;
|
|
41
|
+
}
|
|
42
|
+
export interface RequestRefundParams {
|
|
43
|
+
account_id: string;
|
|
44
|
+
reason?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface RequestRefundResponse {
|
|
47
|
+
message: string;
|
|
48
|
+
request: BillingRequestInfo | null;
|
|
49
|
+
}
|
|
50
|
+
export interface BillingRequestInfo {
|
|
51
|
+
id: string;
|
|
52
|
+
org_id: string;
|
|
53
|
+
account_id: string;
|
|
54
|
+
type: 'replacement' | 'refund';
|
|
55
|
+
status: 'pending' | 'approved' | 'denied';
|
|
56
|
+
reason: string | null;
|
|
57
|
+
created_at: string;
|
|
58
|
+
resolved_at: string | null;
|
|
59
|
+
}
|
|
60
|
+
export interface PortalParams {
|
|
61
|
+
return_url?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Client for billing and subscription management
|
|
65
|
+
*/
|
|
66
|
+
export declare class BillingClient extends BaseClient {
|
|
67
|
+
/**
|
|
68
|
+
* Get billing information including subscription details and linked orgs
|
|
69
|
+
*/
|
|
70
|
+
getBilling(): Promise<ApiResponse<BillingInfo>>;
|
|
71
|
+
/**
|
|
72
|
+
* Cancel subscription at the end of the current billing period
|
|
73
|
+
*/
|
|
74
|
+
cancelSubscription(): Promise<ApiResponse<CancelSubscriptionResponse>>;
|
|
75
|
+
/**
|
|
76
|
+
* Get a Stripe billing portal URL for managing payment methods
|
|
77
|
+
*/
|
|
78
|
+
getPortalUrl(params?: PortalParams): Promise<ApiResponse<PortalUrlResponse>>;
|
|
79
|
+
/**
|
|
80
|
+
* Deactivate an account slot, removing it from your subscription
|
|
81
|
+
* The account is reclaimed and billing is adjusted (no proration)
|
|
82
|
+
*/
|
|
83
|
+
deactivateAccount(params: DeactivateAccountParams): Promise<ApiResponse<DeactivateAccountResponse>>;
|
|
84
|
+
/**
|
|
85
|
+
* Request a replacement for an account
|
|
86
|
+
* First replacement is auto-approved; subsequent requests require manual review
|
|
87
|
+
*/
|
|
88
|
+
requestReplacement(params: RequestReplacementParams): Promise<ApiResponse<RequestReplacementResponse>>;
|
|
89
|
+
/**
|
|
90
|
+
* Request a refund for an account (requires manual review)
|
|
91
|
+
*/
|
|
92
|
+
requestRefund(params: RequestRefundParams): Promise<ApiResponse<RequestRefundResponse>>;
|
|
93
|
+
/**
|
|
94
|
+
* Get all billing requests for your account
|
|
95
|
+
*/
|
|
96
|
+
getRequests(): Promise<ApiResponse<BillingRequestInfo[]>>;
|
|
97
|
+
}
|
package/dist/billing.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingClient = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// Billing Client
|
|
7
|
+
// =============================================================================
|
|
8
|
+
/**
|
|
9
|
+
* Client for billing and subscription management
|
|
10
|
+
*/
|
|
11
|
+
class BillingClient extends base_1.BaseClient {
|
|
12
|
+
/**
|
|
13
|
+
* Get billing information including subscription details and linked orgs
|
|
14
|
+
*/
|
|
15
|
+
async getBilling() {
|
|
16
|
+
return this.get('/billing');
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Cancel subscription at the end of the current billing period
|
|
20
|
+
*/
|
|
21
|
+
async cancelSubscription() {
|
|
22
|
+
return this.post('/billing/cancel');
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get a Stripe billing portal URL for managing payment methods
|
|
26
|
+
*/
|
|
27
|
+
async getPortalUrl(params) {
|
|
28
|
+
return this.post('/billing/portal', params ?? {});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Deactivate an account slot, removing it from your subscription
|
|
32
|
+
* The account is reclaimed and billing is adjusted (no proration)
|
|
33
|
+
*/
|
|
34
|
+
async deactivateAccount(params) {
|
|
35
|
+
return this.post('/billing/deactivate', params);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Request a replacement for an account
|
|
39
|
+
* First replacement is auto-approved; subsequent requests require manual review
|
|
40
|
+
*/
|
|
41
|
+
async requestReplacement(params) {
|
|
42
|
+
return this.post('/billing/request-replacement', params);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Request a refund for an account (requires manual review)
|
|
46
|
+
*/
|
|
47
|
+
async requestRefund(params) {
|
|
48
|
+
return this.post('/billing/request-refund', params);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get all billing requests for your account
|
|
52
|
+
*/
|
|
53
|
+
async getRequests() {
|
|
54
|
+
return this.get('/billing/requests');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.BillingClient = BillingClient;
|
package/dist/client.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { OrganizationClient } from './org';
|
|
|
6
6
|
import { AutomationsClient } from './automations';
|
|
7
7
|
import { MediaClient } from './media';
|
|
8
8
|
import { CommentsClient } from './comments';
|
|
9
|
+
import { BillingClient } from './billing';
|
|
9
10
|
import type { ClientConfig } from './base';
|
|
10
11
|
/**
|
|
11
12
|
* Main UGC Inc API Client
|
|
@@ -65,5 +66,9 @@ export declare class UGCClient {
|
|
|
65
66
|
* Client for comment operations
|
|
66
67
|
*/
|
|
67
68
|
comments: CommentsClient;
|
|
69
|
+
/**
|
|
70
|
+
* Client for billing and subscription management
|
|
71
|
+
*/
|
|
72
|
+
billing: BillingClient;
|
|
68
73
|
constructor(config: ClientConfig);
|
|
69
74
|
}
|
package/dist/client.js
CHANGED
|
@@ -9,6 +9,7 @@ const org_1 = require("./org");
|
|
|
9
9
|
const automations_1 = require("./automations");
|
|
10
10
|
const media_1 = require("./media");
|
|
11
11
|
const comments_1 = require("./comments");
|
|
12
|
+
const billing_1 = require("./billing");
|
|
12
13
|
/**
|
|
13
14
|
* Main UGC Inc API Client
|
|
14
15
|
*
|
|
@@ -44,6 +45,7 @@ class UGCClient {
|
|
|
44
45
|
this.automations = new automations_1.AutomationsClient(config);
|
|
45
46
|
this.media = new media_1.MediaClient(config);
|
|
46
47
|
this.comments = new comments_1.CommentsClient(config);
|
|
48
|
+
this.billing = new billing_1.BillingClient(config);
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
exports.UGCClient = UGCClient;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { OrganizationClient } from './org';
|
|
|
12
12
|
export { AutomationsClient } from './automations';
|
|
13
13
|
export { MediaClient } from './media';
|
|
14
14
|
export { CommentsClient } from './comments';
|
|
15
|
+
export { BillingClient } from './billing';
|
|
15
16
|
export { submitImageRenderJob, submitVideoRenderJob, getRenderJobStatus, submitDeduplicationJob, submitScreenshotAnimationRenderJob, submitAutoCaptionRenderJob, submitInstagramDmRenderJob, submitIMessageDmRenderJob, } from './render';
|
|
16
17
|
export { areTypesCompatible, computePortsForNode, computePortsWithPreviews, computeAllNodePorts, computeAllNodePortsWithPreviews, getInputPreviewValue, getAllNodes, getNodeByType, getOutputSchema, createNode, deriveConnections, addConnection, removeConnection, removeNodeConnections, cleanupStaleConnections, getConnectedSource, getForEachContext, checkCrossContextViolation, getDownstreamNodes, getNodesDownstreamOfSet, getCapturedNodes, validateWorkflow, getErrorNodeIds, getPortErrorsForNode, hasMissingTriggerError, hasMissingTerminalError, getWorkflowOutputSchema, resolveNodePreview, computeAllNodePreviews, computePreviewMap, updatePreviewMapForConnection, removePreviewForConnection, getPreviewValue, shuffleNodePreview, type PreviewMap, type NodePreviewOutputs, type Connection, generateNodeName, extractWorkflowConfig, type WorkflowTemplateData, } from './automations/graph-controller';
|
|
17
18
|
export { nodeDefinitions, internalNodeTypes, isAsyncExecutor, formatPortType, isPortType } from './automations/types';
|
|
@@ -31,6 +32,7 @@ export type { RefreshStatsParams, RefreshStatsError, RefreshStatsResponse, Daily
|
|
|
31
32
|
export type { ApiKey, DeleteApiKeyParams, EditApiKeyParams, IntegrationKey, IntegrationProvider, UpsertIntegrationKeyParams, DeleteIntegrationKeyParams } from './org';
|
|
32
33
|
export type { UserMedia, MediaUse, SocialAudio, Media, GetMediaParams, GetSocialAudioParams, UploadMediaParams, UploadMediaResponse, MediaTagUpdate, UpdateMediaTagsParams, MediaTagUpdateResult, UpdateMediaTagsResponse, UpdateMediaTagParams, UpdateMediaNameParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, ImportTextParams, ImportTextResponse, CreateMediaFromUrlParams, GetMediaUseParams, GetMediaUseResponse, FilterMediaParams, FilterMediaResponse, GetUploadTokenParams, UploadTokenResponse, } from './media';
|
|
33
34
|
export type { CommentStatus, Comment, CreateCommentParams, CreateCommentResponse, GetCommentsParams, } from './comments';
|
|
35
|
+
export type { BillingInfo, CancelSubscriptionResponse, PortalUrlResponse, DeactivateAccountParams, DeactivateAccountResponse, RequestReplacementParams, RequestReplacementResponse, RequestRefundParams, RequestRefundResponse, BillingRequestInfo, PortalParams, } from './billing';
|
|
34
36
|
export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, SubmitVideoRenderJobParams, SubmitScreenshotAnimationRenderJobParams, SubmitAutoCaptionRenderJobParams, SubmitInstagramDmRenderJobParams, SubmitIMessageDmRenderJobParams, IgDmMessage, ImDmMessage, RenderVideoEditorConfig, } from './render';
|
|
35
37
|
export type { VideoEditorNodeConfig, VideoEditorChannel, VideoEditorSegment, VideoEditorVideoSegment, VideoEditorAudioSegment, VideoEditorImageSegment, VideoEditorTextSegment, VideoEditorImageSequenceSegment, VideoEditorVideoSequenceSegment, TimeValue, TimeMode, SegmentTimelinePosition, DeduplicationLevel, DeduplicationInput, ImageEditorElement, DimensionPresetKey, } from './render/types';
|
|
36
38
|
export type { ImageEditorNodeConfig, ImageComposerNodeConfig, ImageComposerRenderInput } from './automations/nodes/image-composer';
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Official TypeScript/JavaScript client for the UGC Inc API
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
9
|
-
exports.prepareVideoComposerInput = exports.formatDateTag = exports.outputFieldsToZod = exports.outputFieldToZod = exports.LLMProviders = exports.applyLogicOperator = exports.IfLogicOperators = exports.resolvePath = exports.indexExpressionToString = exports.indexExpressionToIndexes = exports.resolveUnknownPath = exports.getOutputTypeFromCategory = exports.parseOpenAPIOutputPath = exports.parseOpenAPIInputs = exports.mapOpenAPIType = exports.nodeConfigToCaptionStyle = exports.prepareImageComposerInput = exports.substituteVariables = exports.processTemplate = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.getModelDurations = exports.getModelAspectRatios = exports.ALL_VIDEO_MODELS = exports.isImageToVideoModel = exports.IMAGE_ASPECT_RATIOS = exports.ALL_IMAGE_MODELS = exports.isEditModel = exports.getCapturedSourceNodeTypes = exports.getFlowControlNodeTypes = exports.getNodeDefinition = exports.isPortType = exports.formatPortType = exports.isAsyncExecutor = exports.internalNodeTypes = exports.nodeDefinitions = exports.extractWorkflowConfig = exports.generateNodeName = exports.shuffleNodePreview = void 0;
|
|
8
|
+
exports.removePreviewForConnection = exports.updatePreviewMapForConnection = exports.computePreviewMap = exports.computeAllNodePreviews = exports.resolveNodePreview = exports.getWorkflowOutputSchema = exports.hasMissingTerminalError = exports.hasMissingTriggerError = exports.getPortErrorsForNode = exports.getErrorNodeIds = exports.validateWorkflow = exports.getCapturedNodes = exports.getNodesDownstreamOfSet = exports.getDownstreamNodes = exports.checkCrossContextViolation = exports.getForEachContext = exports.getConnectedSource = exports.cleanupStaleConnections = exports.removeNodeConnections = exports.removeConnection = exports.addConnection = exports.deriveConnections = exports.createNode = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.getInputPreviewValue = exports.computeAllNodePortsWithPreviews = exports.computeAllNodePorts = exports.computePortsWithPreviews = exports.computePortsForNode = exports.areTypesCompatible = exports.submitIMessageDmRenderJob = exports.submitInstagramDmRenderJob = exports.submitAutoCaptionRenderJob = exports.submitScreenshotAnimationRenderJob = exports.submitDeduplicationJob = exports.getRenderJobStatus = exports.submitVideoRenderJob = exports.submitImageRenderJob = exports.BillingClient = exports.CommentsClient = exports.MediaClient = exports.AutomationsClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
|
|
9
|
+
exports.prepareVideoComposerInput = exports.formatDateTag = exports.outputFieldsToZod = exports.outputFieldToZod = exports.LLMProviders = exports.applyLogicOperator = exports.IfLogicOperators = exports.resolvePath = exports.indexExpressionToString = exports.indexExpressionToIndexes = exports.resolveUnknownPath = exports.getOutputTypeFromCategory = exports.parseOpenAPIOutputPath = exports.parseOpenAPIInputs = exports.mapOpenAPIType = exports.nodeConfigToCaptionStyle = exports.prepareImageComposerInput = exports.substituteVariables = exports.processTemplate = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.getModelDurations = exports.getModelAspectRatios = exports.ALL_VIDEO_MODELS = exports.isImageToVideoModel = exports.IMAGE_ASPECT_RATIOS = exports.ALL_IMAGE_MODELS = exports.isEditModel = exports.getCapturedSourceNodeTypes = exports.getFlowControlNodeTypes = exports.getNodeDefinition = exports.isPortType = exports.formatPortType = exports.isAsyncExecutor = exports.internalNodeTypes = exports.nodeDefinitions = exports.extractWorkflowConfig = exports.generateNodeName = exports.shuffleNodePreview = exports.getPreviewValue = void 0;
|
|
10
10
|
// =============================================================================
|
|
11
11
|
// Client Exports
|
|
12
12
|
// =============================================================================
|
|
@@ -28,6 +28,8 @@ var media_1 = require("./media");
|
|
|
28
28
|
Object.defineProperty(exports, "MediaClient", { enumerable: true, get: function () { return media_1.MediaClient; } });
|
|
29
29
|
var comments_1 = require("./comments");
|
|
30
30
|
Object.defineProperty(exports, "CommentsClient", { enumerable: true, get: function () { return comments_1.CommentsClient; } });
|
|
31
|
+
var billing_1 = require("./billing");
|
|
32
|
+
Object.defineProperty(exports, "BillingClient", { enumerable: true, get: function () { return billing_1.BillingClient; } });
|
|
31
33
|
// Render functions
|
|
32
34
|
var render_1 = require("./render");
|
|
33
35
|
Object.defineProperty(exports, "submitImageRenderJob", { enumerable: true, get: function () { return render_1.submitImageRenderJob; } });
|
package/dist/skills.js
CHANGED
|
@@ -297,6 +297,71 @@ ${run} get_automation_logs '{"runId":"id"}'
|
|
|
297
297
|
- For recurring automations, check \`publish_automation\` / \`unpublish_automation\`
|
|
298
298
|
- Summarize run status: show completed/total nodes, any failures
|
|
299
299
|
- If $ARGUMENTS is provided, interpret it as a natural language request
|
|
300
|
+
`,
|
|
301
|
+
'billing/SKILL.md': `---
|
|
302
|
+
name: billing
|
|
303
|
+
description: Manage UGC Inc billing - view subscription, deactivate accounts, request replacements/refunds, cancel subscription. Use when the user wants to manage their billing or subscription.
|
|
304
|
+
allowed-tools: Bash, Read
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
You manage UGC Inc billing through the CLI. Run tools with:
|
|
308
|
+
\`\`\`bash
|
|
309
|
+
${run} <tool_name> '<json_params>'
|
|
310
|
+
\`\`\`
|
|
311
|
+
|
|
312
|
+
Auth: \`npx ugcinc auth <api_key> [--admin]\`. Only needed once. Use \`--admin\` for admin keys.
|
|
313
|
+
|
|
314
|
+
## Tools
|
|
315
|
+
|
|
316
|
+
### get_billing
|
|
317
|
+
Get billing info including subscription status, slot counts, and linked orgs.
|
|
318
|
+
\`\`\`bash
|
|
319
|
+
${run} get_billing
|
|
320
|
+
\`\`\`
|
|
321
|
+
|
|
322
|
+
### cancel_subscription
|
|
323
|
+
Cancel subscription at the end of the current billing period.
|
|
324
|
+
\`\`\`bash
|
|
325
|
+
${run} cancel_subscription
|
|
326
|
+
\`\`\`
|
|
327
|
+
|
|
328
|
+
### get_billing_portal
|
|
329
|
+
Get a Stripe billing portal URL for managing payment methods.
|
|
330
|
+
\`\`\`bash
|
|
331
|
+
${run} get_billing_portal
|
|
332
|
+
${run} get_billing_portal '{"return_url":"https://myapp.com"}'
|
|
333
|
+
\`\`\`
|
|
334
|
+
|
|
335
|
+
### deactivate_account
|
|
336
|
+
Deactivate an account slot. Removes from subscription (no proration).
|
|
337
|
+
\`\`\`bash
|
|
338
|
+
${run} deactivate_account '{"account_id":"id"}'
|
|
339
|
+
\`\`\`
|
|
340
|
+
|
|
341
|
+
### request_replacement
|
|
342
|
+
Request a replacement for an account. First replacement is auto-approved.
|
|
343
|
+
\`\`\`bash
|
|
344
|
+
${run} request_replacement '{"account_id":"id","reason":"Account was banned"}'
|
|
345
|
+
\`\`\`
|
|
346
|
+
|
|
347
|
+
### request_refund
|
|
348
|
+
Request a refund for an account (requires manual review).
|
|
349
|
+
\`\`\`bash
|
|
350
|
+
${run} request_refund '{"account_id":"id","reason":"Not satisfied with service"}'
|
|
351
|
+
\`\`\`
|
|
352
|
+
|
|
353
|
+
### get_billing_requests
|
|
354
|
+
Get all billing requests with their status.
|
|
355
|
+
\`\`\`bash
|
|
356
|
+
${run} get_billing_requests
|
|
357
|
+
\`\`\`
|
|
358
|
+
|
|
359
|
+
## Workflow tips
|
|
360
|
+
- Start with \`get_billing\` to see current subscription state
|
|
361
|
+
- First account replacement is auto-approved; subsequent ones need admin review
|
|
362
|
+
- Deactivation removes the account immediately and adjusts billing
|
|
363
|
+
- Cancellation keeps the subscription active until the period ends
|
|
364
|
+
- If $ARGUMENTS is provided, interpret it as a natural language request
|
|
300
365
|
`,
|
|
301
366
|
'stats/SKILL.md': `---
|
|
302
367
|
name: stats
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.billingTools = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.billingTools = [
|
|
6
|
+
{
|
|
7
|
+
name: 'get_billing',
|
|
8
|
+
description: 'Get billing information including subscription status, slot counts, and linked organizations.',
|
|
9
|
+
schema: zod_1.z.object({}).optional(),
|
|
10
|
+
execute: async (client) => {
|
|
11
|
+
return client.billing.getBilling();
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'cancel_subscription',
|
|
16
|
+
description: 'Cancel subscription at the end of the current billing period. The subscription remains active until the period ends.',
|
|
17
|
+
schema: zod_1.z.object({}).optional(),
|
|
18
|
+
execute: async (client) => {
|
|
19
|
+
return client.billing.cancelSubscription();
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'get_billing_portal',
|
|
24
|
+
description: 'Get a Stripe billing portal URL for managing payment methods and invoices.',
|
|
25
|
+
schema: zod_1.z.object({
|
|
26
|
+
return_url: zod_1.z.string().optional().describe('URL to return to after portal session'),
|
|
27
|
+
}).optional(),
|
|
28
|
+
execute: async (client, params) => {
|
|
29
|
+
return client.billing.getPortalUrl(params ?? undefined);
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'deactivate_account',
|
|
34
|
+
description: 'Deactivate an account slot. Removes it from your subscription (no proration) and reclaims the account.',
|
|
35
|
+
schema: zod_1.z.object({
|
|
36
|
+
account_id: zod_1.z.string().describe('ID of the account to deactivate'),
|
|
37
|
+
}),
|
|
38
|
+
execute: async (client, params) => {
|
|
39
|
+
return client.billing.deactivateAccount(params);
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'request_replacement',
|
|
44
|
+
description: 'Request a replacement for an account. First replacement is auto-approved; subsequent requests require manual review.',
|
|
45
|
+
schema: zod_1.z.object({
|
|
46
|
+
account_id: zod_1.z.string().describe('ID of the account to replace'),
|
|
47
|
+
reason: zod_1.z.string().optional().describe('Reason for replacement'),
|
|
48
|
+
}),
|
|
49
|
+
execute: async (client, params) => {
|
|
50
|
+
return client.billing.requestReplacement(params);
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'request_refund',
|
|
55
|
+
description: 'Request a refund for an account. All refund requests require manual review.',
|
|
56
|
+
schema: zod_1.z.object({
|
|
57
|
+
account_id: zod_1.z.string().describe('ID of the account for refund'),
|
|
58
|
+
reason: zod_1.z.string().optional().describe('Reason for refund'),
|
|
59
|
+
}),
|
|
60
|
+
execute: async (client, params) => {
|
|
61
|
+
return client.billing.requestRefund(params);
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'get_billing_requests',
|
|
66
|
+
description: 'Get all billing requests (replacements and refunds) with their status.',
|
|
67
|
+
schema: zod_1.z.object({}).optional(),
|
|
68
|
+
execute: async (client) => {
|
|
69
|
+
return client.billing.getRequests();
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
];
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import { statsTools } from './stats';
|
|
|
7
7
|
import { taskTools } from './tasks';
|
|
8
8
|
import { commentTools } from './comments';
|
|
9
9
|
import { orgTools } from './org';
|
|
10
|
+
import { billingTools } from './billing';
|
|
10
11
|
export type { ToolDefinition } from './types';
|
|
11
12
|
export declare const allTools: ToolDefinition[];
|
|
12
13
|
export declare const toolRegistry: Record<string, ToolDefinition>;
|
|
13
|
-
export { accountTools, postTools, mediaTools, automationTools, statsTools, taskTools, commentTools, orgTools, };
|
|
14
|
+
export { accountTools, postTools, mediaTools, automationTools, statsTools, taskTools, commentTools, orgTools, billingTools, };
|
package/dist/tools/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.orgTools = exports.commentTools = exports.taskTools = exports.statsTools = exports.automationTools = exports.mediaTools = exports.postTools = exports.accountTools = exports.toolRegistry = exports.allTools = void 0;
|
|
3
|
+
exports.billingTools = exports.orgTools = exports.commentTools = exports.taskTools = exports.statsTools = exports.automationTools = exports.mediaTools = exports.postTools = exports.accountTools = exports.toolRegistry = exports.allTools = void 0;
|
|
4
4
|
const accounts_1 = require("./accounts");
|
|
5
5
|
Object.defineProperty(exports, "accountTools", { enumerable: true, get: function () { return accounts_1.accountTools; } });
|
|
6
6
|
const posts_1 = require("./posts");
|
|
@@ -17,6 +17,8 @@ const comments_1 = require("./comments");
|
|
|
17
17
|
Object.defineProperty(exports, "commentTools", { enumerable: true, get: function () { return comments_1.commentTools; } });
|
|
18
18
|
const org_1 = require("./org");
|
|
19
19
|
Object.defineProperty(exports, "orgTools", { enumerable: true, get: function () { return org_1.orgTools; } });
|
|
20
|
+
const billing_1 = require("./billing");
|
|
21
|
+
Object.defineProperty(exports, "billingTools", { enumerable: true, get: function () { return billing_1.billingTools; } });
|
|
20
22
|
exports.allTools = [
|
|
21
23
|
...accounts_1.accountTools,
|
|
22
24
|
...posts_1.postTools,
|
|
@@ -26,6 +28,7 @@ exports.allTools = [
|
|
|
26
28
|
...tasks_1.taskTools,
|
|
27
29
|
...comments_1.commentTools,
|
|
28
30
|
...org_1.orgTools,
|
|
31
|
+
...billing_1.billingTools,
|
|
29
32
|
];
|
|
30
33
|
exports.toolRegistry = {};
|
|
31
34
|
for (const tool of exports.allTools) {
|