glitch-javascript-sdk 3.2.9 → 3.2.12
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/cjs/index.js +310 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Agents.d.ts +4 -0
- package/dist/esm/api/Mcp.d.ts +73 -0
- package/dist/esm/api/PrDirectory.d.ts +386 -0
- package/dist/esm/api/Users.d.ts +8 -0
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +310 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/user.d.ts +10 -0
- package/dist/esm/routes/McpRoute.d.ts +15 -0
- package/dist/esm/routes/PrDirectoryRoutes.d.ts +15 -0
- package/dist/esm/util/Requests.d.ts +7 -0
- package/dist/index.d.ts +476 -0
- package/package.json +1 -1
- package/src/api/Agents.ts +7 -0
- package/src/api/Mcp.ts +150 -0
- package/src/api/PrDirectory.ts +440 -0
- package/src/api/Users.ts +13 -1
- package/src/api/index.ts +4 -0
- package/src/index.ts +4 -0
- package/src/models/user.ts +10 -1
- package/src/routes/AgentsRoute.ts +1 -0
- package/src/routes/McpRoute.ts +38 -0
- package/src/routes/PrDirectoryRoutes.ts +25 -0
- package/src/routes/UserRoutes.ts +2 -1
- package/src/util/Requests.ts +29 -0
|
@@ -23,6 +23,16 @@ interface User {
|
|
|
23
23
|
twitch_handle?: string;
|
|
24
24
|
youtube_handle?: string;
|
|
25
25
|
paetron_handle?: string;
|
|
26
|
+
gmail_oauth_token?: string;
|
|
27
|
+
gmail_refresh_token?: string;
|
|
28
|
+
gmail_token_expiration?: number;
|
|
29
|
+
gmail_token_expires_at?: string;
|
|
30
|
+
gmail_id?: string;
|
|
31
|
+
gmail_name?: string;
|
|
32
|
+
gmail_email?: string;
|
|
33
|
+
gmail_avatar?: string;
|
|
34
|
+
gmail_scopes?: string[];
|
|
35
|
+
gmail_connected_at?: string;
|
|
26
36
|
created_at?: string;
|
|
27
37
|
updated_at?: string;
|
|
28
38
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
/**
|
|
3
|
+
* Glitch MCP paid facade (/mcp/v1).
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the routes served by McpAgentController. These endpoints authenticate
|
|
6
|
+
* with either a Glitch user JWT or a title-scoped MCP token and keep all planner,
|
|
7
|
+
* billing, and executor logic server-side. The public @glitch/mcp adapter calls
|
|
8
|
+
* the same endpoints; this SDK surface lets first-party TypeScript clients reuse them.
|
|
9
|
+
*/
|
|
10
|
+
declare class McpRoute {
|
|
11
|
+
static routes: {
|
|
12
|
+
[key: string]: Route;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default McpRoute;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
/**
|
|
3
|
+
* Route declarations for the PR Directory API.
|
|
4
|
+
*
|
|
5
|
+
* These mirror the Laravel routes under `/api/pr/*` and the title-scoped
|
|
6
|
+
* matcher route under `/api/titles/{title_id}/pr/matches`. Keeping the URL
|
|
7
|
+
* templates in one place lets the SDK methods stay small and consistent with
|
|
8
|
+
* the rest of the package's route-wrapper pattern.
|
|
9
|
+
*/
|
|
10
|
+
declare class PrDirectoryRoutes {
|
|
11
|
+
static routes: {
|
|
12
|
+
[key: string]: Route;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default PrDirectoryRoutes;
|
|
@@ -11,6 +11,13 @@ declare class Requests {
|
|
|
11
11
|
static setBaseUrl(url: string): void;
|
|
12
12
|
static setAuthToken(token: string): void;
|
|
13
13
|
static setCommunityID(community_id: string | undefined): void;
|
|
14
|
+
/**
|
|
15
|
+
* Build an absolute API URL using the currently configured base URL.
|
|
16
|
+
*
|
|
17
|
+
* This is useful for browser primitives such as EventSource that need a URL
|
|
18
|
+
* string instead of an Axios request wrapper.
|
|
19
|
+
*/
|
|
20
|
+
static buildUrl(url: string, params?: Record<string, any>): string;
|
|
14
21
|
private static request;
|
|
15
22
|
static get<T>(url: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
16
23
|
static post<T>(url: string, data: any, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2060,6 +2060,14 @@ declare class Users {
|
|
|
2060
2060
|
* @returns promise
|
|
2061
2061
|
*/
|
|
2062
2062
|
static clearGoogleAuth<T>(): AxiosPromise<Response<T>>;
|
|
2063
|
+
/**
|
|
2064
|
+
* Clear Gmail Workspace authentication information from the current user.
|
|
2065
|
+
*
|
|
2066
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/clearGmailAuth
|
|
2067
|
+
*
|
|
2068
|
+
* @returns promise
|
|
2069
|
+
*/
|
|
2070
|
+
static clearGmailAuth<T>(): AxiosPromise<Response<T>>;
|
|
2063
2071
|
/**
|
|
2064
2072
|
* Clear Stripe authentication information from the current user.
|
|
2065
2073
|
*
|
|
@@ -9305,6 +9313,10 @@ declare class Agents {
|
|
|
9305
9313
|
* Answer a guidance request and write structured agent memory.
|
|
9306
9314
|
*/
|
|
9307
9315
|
static answerGuidance<T>(title_id: string, guidance_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9316
|
+
/**
|
|
9317
|
+
* Rewrite an editable agent draft for review without executing the parent action.
|
|
9318
|
+
*/
|
|
9319
|
+
static rewriteAgentDraft<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9308
9320
|
/**
|
|
9309
9321
|
* List structured agent memories for a title.
|
|
9310
9322
|
*/
|
|
@@ -9349,6 +9361,461 @@ declare class Agents {
|
|
|
9349
9361
|
static agencyInbox<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9350
9362
|
}
|
|
9351
9363
|
|
|
9364
|
+
interface McpStartRunRequest {
|
|
9365
|
+
agent_id?: string | null;
|
|
9366
|
+
initial_message?: string | null;
|
|
9367
|
+
prompt?: string | null;
|
|
9368
|
+
run_type?: string;
|
|
9369
|
+
trigger_source?: string;
|
|
9370
|
+
background?: boolean;
|
|
9371
|
+
live_mode?: boolean;
|
|
9372
|
+
attachment_ids?: string[];
|
|
9373
|
+
[key: string]: any;
|
|
9374
|
+
}
|
|
9375
|
+
/**
|
|
9376
|
+
* Client for the Glitch MCP paid facade (/mcp/v1).
|
|
9377
|
+
*
|
|
9378
|
+
* Authenticate with a Glitch user JWT or a title-scoped MCP token. The facade
|
|
9379
|
+
* enforces subscription, title permissions, scope, and approval guardrails on
|
|
9380
|
+
* every call; this client only forwards requests.
|
|
9381
|
+
*/
|
|
9382
|
+
declare class Mcp {
|
|
9383
|
+
/** Health/auth probe. Returns authenticated=false (200) when no credential is set. */
|
|
9384
|
+
static authStatus<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9385
|
+
/** List titles visible to the current user token or title-scoped MCP token. */
|
|
9386
|
+
static listTitles<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9387
|
+
/** Fetch safe, subscription-gated workspace context for a title. */
|
|
9388
|
+
static titleContext<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9389
|
+
/** Check subscription, trial, plan, and credit state for a title. */
|
|
9390
|
+
static billing<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9391
|
+
/** Start a paid Glitch Agent run for a title. */
|
|
9392
|
+
static startRun<T>(title_id: string, data?: McpStartRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9393
|
+
/** Fetch a durable run with status, actions, guidance, events, files, and report. */
|
|
9394
|
+
static viewRun<T>(title_id: string, run_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9395
|
+
/** List user-visible timeline events for a run. */
|
|
9396
|
+
static runEvents<T>(title_id: string, run_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9397
|
+
/** Fetch the human-friendly final or partial report for a run. */
|
|
9398
|
+
static finalReport<T>(title_id: string, run_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9399
|
+
/**
|
|
9400
|
+
* Server-Sent Events URL for a run's live event stream.
|
|
9401
|
+
*
|
|
9402
|
+
* Returns the absolute URL to open with an EventSource/fetch reader; the
|
|
9403
|
+
* endpoint emits `status`, `run_event`, and a terminal `settled`/`timeout` event.
|
|
9404
|
+
*/
|
|
9405
|
+
static runStreamUrl(title_id: string, run_id: string, params?: Record<string, any>): string;
|
|
9406
|
+
/** List downloadable files and hosted report artifacts for a run. */
|
|
9407
|
+
static artifacts<T>(title_id: string, run_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9408
|
+
/** List proposed/guidance/approval/executed actions for a title. */
|
|
9409
|
+
static listActions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9410
|
+
/** Approve a reviewable action. Execution remains guarded server-side. */
|
|
9411
|
+
static approveAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9412
|
+
/** Reject a proposed or approval-needed action. */
|
|
9413
|
+
static rejectAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9414
|
+
/** Execute an approved action. Public/paid/creator-facing work stays guarded. */
|
|
9415
|
+
static executeAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9416
|
+
/** List open or answered guidance requests for a title or run. */
|
|
9417
|
+
static listGuidance<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9418
|
+
/** Answer a guidance request and resume the server-side workflow when possible. */
|
|
9419
|
+
static answerGuidance<T>(title_id: string, guidance_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9420
|
+
/** Get instructions for uploading a file (points at uploadFile below). */
|
|
9421
|
+
static createUpload<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9422
|
+
/**
|
|
9423
|
+
* Upload a file (image, video, or document) to a title or run as multipart/form-data.
|
|
9424
|
+
* The facade re-checks the title scope, subscription, and allowed mime types.
|
|
9425
|
+
*/
|
|
9426
|
+
static uploadFile<T>(title_id: string, file: File | Blob, data?: object, params?: Record<string, any>, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise<Response<T>>;
|
|
9427
|
+
/** List MCP title tokens (user JWT only). */
|
|
9428
|
+
static listTokens<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9429
|
+
/** Create a revocable title-scoped MCP token (user JWT only). */
|
|
9430
|
+
static createToken<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9431
|
+
/** Revoke a title-scoped MCP token (user JWT only). */
|
|
9432
|
+
static revokeToken<T>(title_id: string, token_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9433
|
+
}
|
|
9434
|
+
|
|
9435
|
+
/**
|
|
9436
|
+
* Allowed outlet types in the PR directory.
|
|
9437
|
+
*/
|
|
9438
|
+
type PrPublicationType = "blog" | "podcast" | "publication";
|
|
9439
|
+
/**
|
|
9440
|
+
* Eligibility state for a PR outlet.
|
|
9441
|
+
*/
|
|
9442
|
+
type PrEligibilityStatus = "eligible" | "ineligible" | "needs_review" | "duplicate" | "archived";
|
|
9443
|
+
/**
|
|
9444
|
+
* Verification state used by PR outlets, people, links, and contact points.
|
|
9445
|
+
*/
|
|
9446
|
+
type PrVerificationStatus = "unverified" | "verified" | "stale" | "blocked" | "failed" | "needs_review";
|
|
9447
|
+
/**
|
|
9448
|
+
* Email health status stored on the outlet-level PR email field.
|
|
9449
|
+
*/
|
|
9450
|
+
type PrEmailStatus = "unknown" | "verified" | "bounced" | "missing" | "needs_review";
|
|
9451
|
+
/**
|
|
9452
|
+
* Contact verification state for normalized contact points.
|
|
9453
|
+
*/
|
|
9454
|
+
type PrContactVerificationStatus = "unverified" | "verified" | "stale" | "bounced" | "invalid" | "blocked" | "needs_review";
|
|
9455
|
+
/**
|
|
9456
|
+
* Link refresh status for evidence URLs.
|
|
9457
|
+
*/
|
|
9458
|
+
type PrLinkStatus = "unverified" | "ok" | "redirected" | "broken" | "blocked" | "failed" | "stale";
|
|
9459
|
+
/**
|
|
9460
|
+
* Filters accepted by `/pr/publications` and `/pr/report`.
|
|
9461
|
+
*
|
|
9462
|
+
* Tag filters are human-readable slugs from `/pr/tags`. The backend accepts
|
|
9463
|
+
* format, genre, platform, and audience as namespace-specific tag filters so
|
|
9464
|
+
* frontend screens can expose simple controls without knowing pivot table
|
|
9465
|
+
* details.
|
|
9466
|
+
*/
|
|
9467
|
+
interface PrPublicationSearchParams {
|
|
9468
|
+
q?: string;
|
|
9469
|
+
type?: PrPublicationType;
|
|
9470
|
+
eligibility_status?: PrEligibilityStatus;
|
|
9471
|
+
verification_status?: PrVerificationStatus;
|
|
9472
|
+
dedicated_to_gaming?: boolean;
|
|
9473
|
+
has_email?: boolean;
|
|
9474
|
+
country?: string;
|
|
9475
|
+
language?: string;
|
|
9476
|
+
canonical_domain?: string;
|
|
9477
|
+
tag?: string;
|
|
9478
|
+
format?: string;
|
|
9479
|
+
genre?: string;
|
|
9480
|
+
platform?: string;
|
|
9481
|
+
audience?: string;
|
|
9482
|
+
sort?: "name" | "-name" | "type" | "-type" | "eligibility_status" | "-eligibility_status" | "verification_status" | "-verification_status" | "last_verified_at" | "-last_verified_at" | "updated_at" | "-updated_at" | string;
|
|
9483
|
+
page?: number;
|
|
9484
|
+
per_page?: number;
|
|
9485
|
+
}
|
|
9486
|
+
/**
|
|
9487
|
+
* Filters accepted by `/pr/people`.
|
|
9488
|
+
*/
|
|
9489
|
+
interface PrPeopleSearchParams {
|
|
9490
|
+
q?: string;
|
|
9491
|
+
publication_id?: string;
|
|
9492
|
+
role_category?: string;
|
|
9493
|
+
is_active?: boolean;
|
|
9494
|
+
verification_status?: PrVerificationStatus;
|
|
9495
|
+
has_email?: boolean;
|
|
9496
|
+
tag?: string;
|
|
9497
|
+
role?: string;
|
|
9498
|
+
sort?: "name" | "-name" | "verification_status" | "-verification_status" | "last_verified_at" | "-last_verified_at" | "updated_at" | "-updated_at" | string;
|
|
9499
|
+
page?: number;
|
|
9500
|
+
per_page?: number;
|
|
9501
|
+
}
|
|
9502
|
+
/**
|
|
9503
|
+
* Filters accepted by `/pr/tags`.
|
|
9504
|
+
*/
|
|
9505
|
+
interface PrTagSearchParams {
|
|
9506
|
+
namespace?: string;
|
|
9507
|
+
q?: string;
|
|
9508
|
+
}
|
|
9509
|
+
/**
|
|
9510
|
+
* Query parameters accepted by `/titles/{title_id}/pr/matches`.
|
|
9511
|
+
*
|
|
9512
|
+
* The title matcher uses the title profile plus optional human-readable search
|
|
9513
|
+
* context to rank eligible outlets and explain why each outlet is a fit.
|
|
9514
|
+
*/
|
|
9515
|
+
interface PrTitleMatchParams extends PrPublicationSearchParams {
|
|
9516
|
+
genres?: string[];
|
|
9517
|
+
platforms?: string[];
|
|
9518
|
+
audiences?: string[];
|
|
9519
|
+
limit?: number;
|
|
9520
|
+
}
|
|
9521
|
+
/**
|
|
9522
|
+
* Request body accepted by `/admin/pr/verification/queue`.
|
|
9523
|
+
*/
|
|
9524
|
+
interface PrQueueVerificationRequest {
|
|
9525
|
+
due?: boolean;
|
|
9526
|
+
limit?: number;
|
|
9527
|
+
link_ids?: string[];
|
|
9528
|
+
}
|
|
9529
|
+
/**
|
|
9530
|
+
* A normalized metadata tag used to filter and match PR outlets, people, and
|
|
9531
|
+
* roles.
|
|
9532
|
+
*/
|
|
9533
|
+
interface PrTag {
|
|
9534
|
+
id: string;
|
|
9535
|
+
namespace: string;
|
|
9536
|
+
slug: string;
|
|
9537
|
+
label: string;
|
|
9538
|
+
description?: string | null;
|
|
9539
|
+
pivot?: {
|
|
9540
|
+
confidence?: number | null;
|
|
9541
|
+
source?: string | null;
|
|
9542
|
+
source_link_id?: string | null;
|
|
9543
|
+
verified_at?: string | null;
|
|
9544
|
+
metadata?: Record<string, any> | null;
|
|
9545
|
+
};
|
|
9546
|
+
metadata?: Record<string, any>;
|
|
9547
|
+
created_at?: string | null;
|
|
9548
|
+
updated_at?: string | null;
|
|
9549
|
+
}
|
|
9550
|
+
/**
|
|
9551
|
+
* A refreshable evidence URL that supports an outlet, person, role, or contact
|
|
9552
|
+
* point.
|
|
9553
|
+
*/
|
|
9554
|
+
interface PrLink {
|
|
9555
|
+
id: string;
|
|
9556
|
+
linkable_type?: string | null;
|
|
9557
|
+
linkable_id?: string | null;
|
|
9558
|
+
link_type: string;
|
|
9559
|
+
url: string;
|
|
9560
|
+
canonical_url?: string | null;
|
|
9561
|
+
final_url?: string | null;
|
|
9562
|
+
domain?: string | null;
|
|
9563
|
+
priority: number;
|
|
9564
|
+
http_status?: number | null;
|
|
9565
|
+
status: PrLinkStatus;
|
|
9566
|
+
content_type?: string | null;
|
|
9567
|
+
content_hash?: string | null;
|
|
9568
|
+
etag?: string | null;
|
|
9569
|
+
last_modified_at?: string | null;
|
|
9570
|
+
last_checked_at?: string | null;
|
|
9571
|
+
next_check_at?: string | null;
|
|
9572
|
+
last_error?: string | null;
|
|
9573
|
+
is_source_of_truth: boolean;
|
|
9574
|
+
metadata?: Record<string, any>;
|
|
9575
|
+
created_at?: string | null;
|
|
9576
|
+
updated_at?: string | null;
|
|
9577
|
+
}
|
|
9578
|
+
/**
|
|
9579
|
+
* A normalized way to reach an outlet, person, or publication role.
|
|
9580
|
+
*/
|
|
9581
|
+
interface PrContactPoint {
|
|
9582
|
+
id: string;
|
|
9583
|
+
contactable_type: string;
|
|
9584
|
+
contactable_id: string;
|
|
9585
|
+
pr_link_id?: string | null;
|
|
9586
|
+
contact_type: "email" | "linkedin" | "x" | "bluesky" | "contact_form" | string;
|
|
9587
|
+
label?: string | null;
|
|
9588
|
+
value: string;
|
|
9589
|
+
normalized_value: string;
|
|
9590
|
+
verification_status: PrContactVerificationStatus;
|
|
9591
|
+
confidence?: number | null;
|
|
9592
|
+
is_primary: boolean;
|
|
9593
|
+
first_seen_at?: string | null;
|
|
9594
|
+
last_seen_at?: string | null;
|
|
9595
|
+
source_link?: PrLink | null;
|
|
9596
|
+
metadata?: Record<string, any>;
|
|
9597
|
+
created_at?: string | null;
|
|
9598
|
+
updated_at?: string | null;
|
|
9599
|
+
}
|
|
9600
|
+
/**
|
|
9601
|
+
* The role a PR person has at one publication, blog, or podcast.
|
|
9602
|
+
*/
|
|
9603
|
+
interface PublicationPerson {
|
|
9604
|
+
id: string;
|
|
9605
|
+
publication_id: string;
|
|
9606
|
+
pr_person_id: string;
|
|
9607
|
+
source_link_id?: string | null;
|
|
9608
|
+
role_title?: string | null;
|
|
9609
|
+
role_category?: string | null;
|
|
9610
|
+
email?: string | null;
|
|
9611
|
+
email_status: "unknown" | "verified" | "bounced" | "invalid" | "needs_review";
|
|
9612
|
+
is_primary_contact: boolean;
|
|
9613
|
+
is_current: boolean;
|
|
9614
|
+
confidence?: number | null;
|
|
9615
|
+
started_at?: string | null;
|
|
9616
|
+
ended_at?: string | null;
|
|
9617
|
+
last_verified_at?: string | null;
|
|
9618
|
+
source_notes?: string | null;
|
|
9619
|
+
person?: PrPerson | null;
|
|
9620
|
+
publication?: PrPublication | null;
|
|
9621
|
+
source_link?: PrLink | null;
|
|
9622
|
+
contact_points?: PrContactPoint[];
|
|
9623
|
+
tags?: PrTag[];
|
|
9624
|
+
metadata?: Record<string, any>;
|
|
9625
|
+
created_at?: string | null;
|
|
9626
|
+
updated_at?: string | null;
|
|
9627
|
+
}
|
|
9628
|
+
/**
|
|
9629
|
+
* A gaming-focused publication, independent blog, or podcast in the PR
|
|
9630
|
+
* directory.
|
|
9631
|
+
*/
|
|
9632
|
+
interface PrPublication {
|
|
9633
|
+
id: string;
|
|
9634
|
+
name: string;
|
|
9635
|
+
slug?: string | null;
|
|
9636
|
+
type: PrPublicationType;
|
|
9637
|
+
url?: string | null;
|
|
9638
|
+
canonical_domain?: string | null;
|
|
9639
|
+
description?: string | null;
|
|
9640
|
+
main_pr_email?: string | null;
|
|
9641
|
+
main_pr_email_status: PrEmailStatus;
|
|
9642
|
+
dedicated_to_gaming: boolean;
|
|
9643
|
+
eligibility_status: PrEligibilityStatus;
|
|
9644
|
+
exclusion_reason?: string | null;
|
|
9645
|
+
language?: string | null;
|
|
9646
|
+
country?: string | null;
|
|
9647
|
+
network_or_owner?: string | null;
|
|
9648
|
+
verification_status: PrVerificationStatus;
|
|
9649
|
+
last_verified_at?: string | null;
|
|
9650
|
+
next_verification_at?: string | null;
|
|
9651
|
+
source_imported_at?: string | null;
|
|
9652
|
+
people_count?: number;
|
|
9653
|
+
contact_points_count?: number;
|
|
9654
|
+
links_count?: number;
|
|
9655
|
+
people?: PublicationPerson[];
|
|
9656
|
+
contact_points?: PrContactPoint[];
|
|
9657
|
+
links?: PrLink[];
|
|
9658
|
+
tags?: PrTag[];
|
|
9659
|
+
metadata?: Record<string, any>;
|
|
9660
|
+
created_at?: string | null;
|
|
9661
|
+
updated_at?: string | null;
|
|
9662
|
+
}
|
|
9663
|
+
/**
|
|
9664
|
+
* A journalist, editor, podcast host, producer, contributor, or other PR
|
|
9665
|
+
* contact associated with one or more gaming-focused outlets.
|
|
9666
|
+
*/
|
|
9667
|
+
interface PrPerson {
|
|
9668
|
+
id: string;
|
|
9669
|
+
name: string;
|
|
9670
|
+
slug?: string | null;
|
|
9671
|
+
bio?: string | null;
|
|
9672
|
+
location?: string | null;
|
|
9673
|
+
linkedin_url?: string | null;
|
|
9674
|
+
x_url?: string | null;
|
|
9675
|
+
bluesky_url?: string | null;
|
|
9676
|
+
website_url?: string | null;
|
|
9677
|
+
is_active: boolean;
|
|
9678
|
+
verification_status: PrVerificationStatus;
|
|
9679
|
+
last_verified_at?: string | null;
|
|
9680
|
+
next_verification_at?: string | null;
|
|
9681
|
+
roles_count?: number;
|
|
9682
|
+
contact_points_count?: number;
|
|
9683
|
+
links_count?: number;
|
|
9684
|
+
roles?: PublicationPerson[];
|
|
9685
|
+
contact_points?: PrContactPoint[];
|
|
9686
|
+
links?: PrLink[];
|
|
9687
|
+
tags?: PrTag[];
|
|
9688
|
+
metadata?: Record<string, any>;
|
|
9689
|
+
created_at?: string | null;
|
|
9690
|
+
updated_at?: string | null;
|
|
9691
|
+
}
|
|
9692
|
+
/**
|
|
9693
|
+
* Aggregate PR directory health metrics returned by `/pr/report`.
|
|
9694
|
+
*/
|
|
9695
|
+
interface PrDirectoryReport {
|
|
9696
|
+
generated_at: string;
|
|
9697
|
+
publications: {
|
|
9698
|
+
total: number;
|
|
9699
|
+
by_type: Record<string, number>;
|
|
9700
|
+
by_eligibility_status: Record<string, number>;
|
|
9701
|
+
by_verification_status: Record<string, number>;
|
|
9702
|
+
dedicated_to_gaming: number;
|
|
9703
|
+
with_email: number;
|
|
9704
|
+
due_for_verification: number;
|
|
9705
|
+
};
|
|
9706
|
+
people: {
|
|
9707
|
+
total: number;
|
|
9708
|
+
active: number;
|
|
9709
|
+
with_email: number;
|
|
9710
|
+
by_verification_status: Record<string, number>;
|
|
9711
|
+
};
|
|
9712
|
+
links: {
|
|
9713
|
+
total: number;
|
|
9714
|
+
by_type: Record<string, number>;
|
|
9715
|
+
by_status: Record<string, number>;
|
|
9716
|
+
due_for_check: number;
|
|
9717
|
+
};
|
|
9718
|
+
contacts: {
|
|
9719
|
+
total: number;
|
|
9720
|
+
by_type: Record<string, number>;
|
|
9721
|
+
by_status: Record<string, number>;
|
|
9722
|
+
};
|
|
9723
|
+
tags: {
|
|
9724
|
+
total: number;
|
|
9725
|
+
by_namespace: Record<string, number>;
|
|
9726
|
+
};
|
|
9727
|
+
}
|
|
9728
|
+
/**
|
|
9729
|
+
* A ranked title-to-outlet match with evidence, contact route, and plain-English
|
|
9730
|
+
* explanation.
|
|
9731
|
+
*/
|
|
9732
|
+
interface PrTitleMatch {
|
|
9733
|
+
publication: PrPublication;
|
|
9734
|
+
score: number;
|
|
9735
|
+
matched_tags: string[];
|
|
9736
|
+
best_contact_path?: Record<string, any> | null;
|
|
9737
|
+
why: string[];
|
|
9738
|
+
risks: string[];
|
|
9739
|
+
evidence_links: PrLink[];
|
|
9740
|
+
}
|
|
9741
|
+
/**
|
|
9742
|
+
* Response body returned after queueing PR verification jobs.
|
|
9743
|
+
*/
|
|
9744
|
+
interface PrQueueVerificationResponse {
|
|
9745
|
+
queued: number;
|
|
9746
|
+
}
|
|
9747
|
+
/**
|
|
9748
|
+
* SDK wrapper for the PR Directory API.
|
|
9749
|
+
*
|
|
9750
|
+
* The PR directory is read-friendly by default: public endpoints expose
|
|
9751
|
+
* searchable publications, people, tags, and reporting metrics. Authenticated
|
|
9752
|
+
* title admins can request title-specific PR matches, and site admins can queue
|
|
9753
|
+
* monthly-style verification jobs.
|
|
9754
|
+
*/
|
|
9755
|
+
declare class PrDirectory {
|
|
9756
|
+
/**
|
|
9757
|
+
* Search gaming-focused PR publications, independent blogs, and podcasts.
|
|
9758
|
+
*
|
|
9759
|
+
* @example
|
|
9760
|
+
* ```ts
|
|
9761
|
+
* Glitch.api.PrDirectory.listPublications({
|
|
9762
|
+
* q: "indie RPG",
|
|
9763
|
+
* has_email: true,
|
|
9764
|
+
* eligibility_status: "eligible",
|
|
9765
|
+
* sort: "-last_verified_at",
|
|
9766
|
+
* });
|
|
9767
|
+
* ```
|
|
9768
|
+
*/
|
|
9769
|
+
static listPublications<T = PrPublication[]>(params?: PrPublicationSearchParams): AxiosPromise<Response<T>>;
|
|
9770
|
+
/**
|
|
9771
|
+
* Retrieve one PR publication profile with loaded people, contact points,
|
|
9772
|
+
* evidence links, and tags.
|
|
9773
|
+
*/
|
|
9774
|
+
static viewPublication<T = PrPublication>(publication_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9775
|
+
/**
|
|
9776
|
+
* Search PR people and roles across all known publications.
|
|
9777
|
+
*
|
|
9778
|
+
* @example
|
|
9779
|
+
* ```ts
|
|
9780
|
+
* Glitch.api.PrDirectory.listPeople({
|
|
9781
|
+
* q: "reviews editor",
|
|
9782
|
+
* has_email: true,
|
|
9783
|
+
* role_category: "editor",
|
|
9784
|
+
* });
|
|
9785
|
+
* ```
|
|
9786
|
+
*/
|
|
9787
|
+
static listPeople<T = PrPerson[]>(params?: PrPeopleSearchParams): AxiosPromise<Response<T>>;
|
|
9788
|
+
/**
|
|
9789
|
+
* Retrieve one PR person profile with their outlet roles, profile links,
|
|
9790
|
+
* contact points, and metadata tags.
|
|
9791
|
+
*/
|
|
9792
|
+
static viewPerson<T = PrPerson>(person_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9793
|
+
/**
|
|
9794
|
+
* List the normalized tag vocabulary used for PR search, filters, matching,
|
|
9795
|
+
* and reporting.
|
|
9796
|
+
*/
|
|
9797
|
+
static listTags<T = PrTag[]>(params?: PrTagSearchParams): AxiosPromise<Response<T>>;
|
|
9798
|
+
/**
|
|
9799
|
+
* Get aggregate PR directory reporting metrics. Publication filters can be
|
|
9800
|
+
* supplied to scope the outlet portion of the report.
|
|
9801
|
+
*/
|
|
9802
|
+
static report<T = PrDirectoryReport>(params?: PrPublicationSearchParams): AxiosPromise<Response<T>>;
|
|
9803
|
+
/**
|
|
9804
|
+
* Match a registered game title to PR outlets. Requires an auth token for a
|
|
9805
|
+
* user who can administer the requested title.
|
|
9806
|
+
*/
|
|
9807
|
+
static titleMatches<T = PrTitleMatch[]>(title_id: string, params?: PrTitleMatchParams): AxiosPromise<Response<T>>;
|
|
9808
|
+
/**
|
|
9809
|
+
* Queue PR verification jobs. Requires a site-admin auth token.
|
|
9810
|
+
*
|
|
9811
|
+
* @example
|
|
9812
|
+
* ```ts
|
|
9813
|
+
* Glitch.api.PrDirectory.queueVerification({ due: true, limit: 250 });
|
|
9814
|
+
* ```
|
|
9815
|
+
*/
|
|
9816
|
+
static queueVerification<T = PrQueueVerificationResponse>(data?: PrQueueVerificationRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9817
|
+
}
|
|
9818
|
+
|
|
9352
9819
|
interface Route {
|
|
9353
9820
|
url: string;
|
|
9354
9821
|
method: string;
|
|
@@ -9363,6 +9830,13 @@ declare class Requests {
|
|
|
9363
9830
|
static setBaseUrl(url: string): void;
|
|
9364
9831
|
static setAuthToken(token: string): void;
|
|
9365
9832
|
static setCommunityID(community_id: string | undefined): void;
|
|
9833
|
+
/**
|
|
9834
|
+
* Build an absolute API URL using the currently configured base URL.
|
|
9835
|
+
*
|
|
9836
|
+
* This is useful for browser primitives such as EventSource that need a URL
|
|
9837
|
+
* string instead of an Axios request wrapper.
|
|
9838
|
+
*/
|
|
9839
|
+
static buildUrl(url: string, params?: Record<string, any>): string;
|
|
9366
9840
|
private static request;
|
|
9367
9841
|
static get<T>(url: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9368
9842
|
static post<T>(url: string, data: any, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
@@ -9705,6 +10179,8 @@ declare class Glitch {
|
|
|
9705
10179
|
Multiplayer: typeof Multiplayer;
|
|
9706
10180
|
ServerOperations: typeof ServerOperations;
|
|
9707
10181
|
Agents: typeof Agents;
|
|
10182
|
+
Mcp: typeof Mcp;
|
|
10183
|
+
PrDirectory: typeof PrDirectory;
|
|
9708
10184
|
};
|
|
9709
10185
|
static util: {
|
|
9710
10186
|
Requests: typeof Requests;
|
package/package.json
CHANGED
package/src/api/Agents.ts
CHANGED
|
@@ -196,6 +196,13 @@ class Agents {
|
|
|
196
196
|
return Requests.processRoute(AgentsRoute.routes.answerGuidance, data, { title_id, guidance_id }, params);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Rewrite an editable agent draft for review without executing the parent action.
|
|
201
|
+
*/
|
|
202
|
+
public static rewriteAgentDraft<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
203
|
+
return Requests.processRoute(AgentsRoute.routes.rewriteAgentDraft, data, { title_id }, params);
|
|
204
|
+
}
|
|
205
|
+
|
|
199
206
|
/**
|
|
200
207
|
* List structured agent memories for a title.
|
|
201
208
|
*/
|