@madewithremy/admin 0.1.2 → 0.1.4
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.d.ts +245 -1
- package/dist/index.js +55 -10
- package/dist/index.js.map +1 -1
- package/dist/prod.js +300 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,145 @@ interface AdminContext {
|
|
|
15
15
|
baseUrl: string;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Response types for the v2 agent-chat thread log.
|
|
20
|
+
*
|
|
21
|
+
* Transcribed from youai-api:
|
|
22
|
+
* src/http/routes/V2Apps/manage/agentThreads.ts — routes
|
|
23
|
+
* src/http/routes/V2Apps/manage/_helpers/projectAgentMessages.ts — transcript shape
|
|
24
|
+
* src/common/Db/v2Apps/V2AgentThreadsDao.ts — list row shape
|
|
25
|
+
*/
|
|
26
|
+
/** One tool the assistant asked for, with the arguments it chose. */
|
|
27
|
+
interface AgentToolCall {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
input: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
/** A platform/model failure that ended a turn instead of a reply. */
|
|
33
|
+
interface AgentTurnError {
|
|
34
|
+
message: string;
|
|
35
|
+
code?: string;
|
|
36
|
+
/** Milliseconds since epoch. */
|
|
37
|
+
at: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One message in a thread transcript.
|
|
41
|
+
*
|
|
42
|
+
* Roles are the stored conversation's own: `user` for a person's message AND
|
|
43
|
+
* for a tool result (which carries `toolCallId`), `assistant` for the agent.
|
|
44
|
+
*/
|
|
45
|
+
interface AgentTranscriptMessage {
|
|
46
|
+
role: string;
|
|
47
|
+
content: string;
|
|
48
|
+
/** CDN URLs the user attached (user messages only). */
|
|
49
|
+
attachments?: string[];
|
|
50
|
+
/** Present on an assistant message that requested tools. */
|
|
51
|
+
toolCalls?: AgentToolCall[];
|
|
52
|
+
/** Present on a tool result — matches the `toolCalls[].id` it answers. */
|
|
53
|
+
toolCallId?: string;
|
|
54
|
+
/** The tool reported a failure. */
|
|
55
|
+
isToolError?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Request-log id for a method tool call — `requests get <id>` for its input,
|
|
58
|
+
* output, stdout and error. Absent on client-tool results, which run in the
|
|
59
|
+
* browser and never reach the backend.
|
|
60
|
+
*/
|
|
61
|
+
requestId?: string;
|
|
62
|
+
/** The turn ended in a platform/model failure rather than a reply. */
|
|
63
|
+
turnError?: AgentTurnError;
|
|
64
|
+
/**
|
|
65
|
+
* The model saw extracted document text from an attachment on top of
|
|
66
|
+
* `content`. Only its presence is reported — the text can run to megabytes.
|
|
67
|
+
*/
|
|
68
|
+
hasProcessedContent?: true;
|
|
69
|
+
}
|
|
70
|
+
/** One item in the thread list (transcript excluded). */
|
|
71
|
+
interface AgentThreadListItem {
|
|
72
|
+
id: string;
|
|
73
|
+
/** Auto-generated from the first user message, or renamed by the user. */
|
|
74
|
+
title: string | null;
|
|
75
|
+
userId: string | null;
|
|
76
|
+
userName: string | null;
|
|
77
|
+
userEmail: string | null;
|
|
78
|
+
/** Browser identity — the only id an anonymous conversation has. */
|
|
79
|
+
visitorId: string | null;
|
|
80
|
+
/** True identifies a builder test conversation through the dev tunnel. */
|
|
81
|
+
devSession: boolean;
|
|
82
|
+
messageCount: number;
|
|
83
|
+
/** Tool results reported as failures — the conversations worth opening. */
|
|
84
|
+
toolErrorCount: number;
|
|
85
|
+
/** A turn broke (model error, rate limit, credits) rather than replying. */
|
|
86
|
+
hasTurnError: boolean;
|
|
87
|
+
/** ISO timestamp. */
|
|
88
|
+
dateCreated: string;
|
|
89
|
+
dateUpdated: string;
|
|
90
|
+
}
|
|
91
|
+
/** Full thread with transcript (single-thread GET). */
|
|
92
|
+
interface AgentThreadDetail {
|
|
93
|
+
id: string;
|
|
94
|
+
title: string | null;
|
|
95
|
+
userId: string | null;
|
|
96
|
+
userName: string | null;
|
|
97
|
+
userEmail: string | null;
|
|
98
|
+
visitorId: string | null;
|
|
99
|
+
devSession: boolean;
|
|
100
|
+
messageCount: number;
|
|
101
|
+
/** ISO timestamp. */
|
|
102
|
+
dateCreated: string;
|
|
103
|
+
dateUpdated: string;
|
|
104
|
+
messages: AgentTranscriptMessage[];
|
|
105
|
+
}
|
|
106
|
+
/** GET /_internal/v2/apps/:appId/agent-threads */
|
|
107
|
+
interface AgentThreadsListResult {
|
|
108
|
+
threads: AgentThreadListItem[];
|
|
109
|
+
nextCursor: string | null;
|
|
110
|
+
}
|
|
111
|
+
/** GET /_internal/v2/apps/:appId/agent-threads/:threadId */
|
|
112
|
+
type AgentThreadsGetResult = AgentThreadDetail;
|
|
113
|
+
|
|
114
|
+
interface ThreadsListParams {
|
|
115
|
+
/** Max threads per page (default 20, server clamps to 100). */
|
|
116
|
+
limit?: number;
|
|
117
|
+
/** Pagination cursor from a prior page's `nextCursor`. */
|
|
118
|
+
cursor?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Every conversation the app's agent has had, newest activity first.
|
|
122
|
+
*
|
|
123
|
+
* Returns cursored pages; pass `nextCursor` from one page as `cursor` for the
|
|
124
|
+
* next. Transcripts are not included — fetch a thread with `threadsGet`.
|
|
125
|
+
*
|
|
126
|
+
* `toolErrorCount` and `hasTurnError` are how you find the conversations worth
|
|
127
|
+
* reading, and `devSession` separates your own test threads from real traffic.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* const { threads } = await admin.agent.threadsList({ limit: 20 });
|
|
131
|
+
* const broken = threads.filter((t) => t.toolErrorCount > 0 || t.hasTurnError);
|
|
132
|
+
*/
|
|
133
|
+
declare function threadsList(ctx: AdminContext, params?: ThreadsListParams): Promise<AgentThreadsListResult>;
|
|
134
|
+
/**
|
|
135
|
+
* One thread with its full transcript: what the user said, what the agent
|
|
136
|
+
* replied, which tools it called with which arguments, and what came back.
|
|
137
|
+
*
|
|
138
|
+
* This is the primary tool for iterating on an agent's system prompt and tool
|
|
139
|
+
* descriptions — read what actually happened rather than guessing. Each method
|
|
140
|
+
* tool call carries a `requestId`; pass it to `requests.get()` for that call's
|
|
141
|
+
* input, output, stdout and error.
|
|
142
|
+
*
|
|
143
|
+
* @throws AdminApiError `thread_not_found` (404).
|
|
144
|
+
* @example
|
|
145
|
+
* const thread = await admin.agent.threadsGet('4f6c…');
|
|
146
|
+
* console.log(thread.messages);
|
|
147
|
+
*/
|
|
148
|
+
declare function threadsGet(ctx: AdminContext, threadId: string): Promise<AgentThreadDetail>;
|
|
149
|
+
|
|
150
|
+
type agent_ThreadsListParams = ThreadsListParams;
|
|
151
|
+
declare const agent_threadsGet: typeof threadsGet;
|
|
152
|
+
declare const agent_threadsList: typeof threadsList;
|
|
153
|
+
declare namespace agent {
|
|
154
|
+
export { type agent_ThreadsListParams as ThreadsListParams, agent_threadsGet as threadsGet, agent_threadsList as threadsList };
|
|
155
|
+
}
|
|
156
|
+
|
|
18
157
|
/**
|
|
19
158
|
* Response types for the v2 analytics (insights) endpoints.
|
|
20
159
|
*
|
|
@@ -419,6 +558,109 @@ declare namespace analytics {
|
|
|
419
558
|
export { type analytics_AiSourcesParams as AiSourcesParams, type analytics_CrawlersParams as CrawlersParams, type analytics_MapParams as MapParams, type analytics_SourcesParams as SourcesParams, analytics_aiSources as aiSources, analytics_batch as batch, analytics_crawlers as crawlers, analytics_live as live, analytics_map as map, query$1 as query, analytics_sources as sources };
|
|
420
559
|
}
|
|
421
560
|
|
|
561
|
+
/**
|
|
562
|
+
* Response types for the v2 app-events observability endpoints.
|
|
563
|
+
*
|
|
564
|
+
* Transcribed from youai-api:
|
|
565
|
+
* src/http/routes/V2Apps/manage/appEvents.ts — routes
|
|
566
|
+
* src/http/routes/V2Apps/serve/events/registry.ts — ChannelActivityRow
|
|
567
|
+
* src/http/routes/V2Apps/serve/events/publish.ts — delivered semantics
|
|
568
|
+
*/
|
|
569
|
+
/** One channel's recent activity, from the channels view. */
|
|
570
|
+
interface EventChannelActivity {
|
|
571
|
+
channel: string;
|
|
572
|
+
/** Last publish naming this channel (ms since epoch), if any in 24h. */
|
|
573
|
+
lastPublishAt?: number;
|
|
574
|
+
/** Last subscription naming this channel (ms since epoch), if any in 24h. */
|
|
575
|
+
lastSubscribeAt?: number;
|
|
576
|
+
/** Live subscriber connections right now. */
|
|
577
|
+
subscribers: number;
|
|
578
|
+
}
|
|
579
|
+
/** GET /_internal/v2/apps/:appId/events/channels */
|
|
580
|
+
interface EventsChannelsListResult {
|
|
581
|
+
/** The environment scope inspected: `live` | `preview:<id>` | `dev:<id>`. */
|
|
582
|
+
scope: string;
|
|
583
|
+
/** Recency-sorted, capped at 200 rows, 24h window. */
|
|
584
|
+
channels: EventChannelActivity[];
|
|
585
|
+
}
|
|
586
|
+
/** POST /_internal/v2/apps/:appId/events/publish */
|
|
587
|
+
interface EventsPublishResult {
|
|
588
|
+
/**
|
|
589
|
+
* Live subscriber connections counted across the published channels.
|
|
590
|
+
* `0` means nobody is listening right now — normal for a nudge, not an
|
|
591
|
+
* error.
|
|
592
|
+
*/
|
|
593
|
+
delivered: number;
|
|
594
|
+
scope: string;
|
|
595
|
+
}
|
|
596
|
+
/** One frame printed by `events tail` (also the subscribe stream's shape). */
|
|
597
|
+
interface EventsTailFrame {
|
|
598
|
+
channel: string;
|
|
599
|
+
data: unknown;
|
|
600
|
+
/** Publish time, ms since epoch. */
|
|
601
|
+
ts: number;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* App-events observability operations.
|
|
606
|
+
*
|
|
607
|
+
* Ops are pure: (ctx, params) → typed result, throwing AdminApiError /
|
|
608
|
+
* AdminTimeoutError. The live tail is CLI-only (src/cliStream.ts) — the
|
|
609
|
+
* import layer stays non-streaming by design.
|
|
610
|
+
*/
|
|
611
|
+
|
|
612
|
+
interface EventsScopeParams {
|
|
613
|
+
/**
|
|
614
|
+
* Environment scope to inspect: `live` (default), `preview:<releaseId>`,
|
|
615
|
+
* or `dev:<sessionId>` — publishes and subscriptions never cross scopes,
|
|
616
|
+
* so a tunnel session's events are visible only under its `dev:` scope.
|
|
617
|
+
*/
|
|
618
|
+
scope?: string;
|
|
619
|
+
}
|
|
620
|
+
interface EventsPublishParams extends EventsScopeParams {
|
|
621
|
+
/** Exact channel name(s) — no wildcards anywhere in app events. */
|
|
622
|
+
channels: string | string[];
|
|
623
|
+
/** The payload subscribers receive (≤32k serialized characters). */
|
|
624
|
+
data: unknown;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Channels with a publish or a subscription in the last 24h, with live
|
|
628
|
+
* subscriber counts — recency-sorted, capped at 200.
|
|
629
|
+
*
|
|
630
|
+
* The debugging read: a channel with subscribers but no publishes (or the
|
|
631
|
+
* reverse) usually means the frontend and backend spell the channel
|
|
632
|
+
* differently.
|
|
633
|
+
*
|
|
634
|
+
* @example
|
|
635
|
+
* const { channels } = await admin.events.channelsList();
|
|
636
|
+
* const mismatch = channels.filter((c) => c.subscribers > 0 && !c.lastPublishAt);
|
|
637
|
+
*/
|
|
638
|
+
declare function channelsList(ctx: AdminContext, params?: EventsScopeParams): Promise<EventsChannelsListResult>;
|
|
639
|
+
/**
|
|
640
|
+
* Publish a test event, exactly as the app's own `events.publish` would —
|
|
641
|
+
* same validation, same delivery, same metering. Lets a frontend subscriber
|
|
642
|
+
* be verified before the backend trigger exists.
|
|
643
|
+
*
|
|
644
|
+
* `delivered` counts live subscriber connections per published channel;
|
|
645
|
+
* `0` is normal (nobody listening), never an error.
|
|
646
|
+
*
|
|
647
|
+
* @throws AdminApiError `invalid_channels` / `payload_too_large` (400).
|
|
648
|
+
* @example
|
|
649
|
+
* const { delivered } = await admin.events.publish({
|
|
650
|
+
* channels: 'jobs:usr_123',
|
|
651
|
+
* data: { type: 'ping' },
|
|
652
|
+
* });
|
|
653
|
+
*/
|
|
654
|
+
declare function publish(ctx: AdminContext, params: EventsPublishParams): Promise<EventsPublishResult>;
|
|
655
|
+
|
|
656
|
+
type appEvents_EventsPublishParams = EventsPublishParams;
|
|
657
|
+
type appEvents_EventsScopeParams = EventsScopeParams;
|
|
658
|
+
declare const appEvents_channelsList: typeof channelsList;
|
|
659
|
+
declare const appEvents_publish: typeof publish;
|
|
660
|
+
declare namespace appEvents {
|
|
661
|
+
export { type appEvents_EventsPublishParams as EventsPublishParams, type appEvents_EventsScopeParams as EventsScopeParams, appEvents_channelsList as channelsList, appEvents_publish as publish };
|
|
662
|
+
}
|
|
663
|
+
|
|
422
664
|
/**
|
|
423
665
|
* Response types for src/commands/crashes.ts.
|
|
424
666
|
* Transcribed from:
|
|
@@ -5070,7 +5312,9 @@ declare function buildClient(ctx: AdminContext): {
|
|
|
5070
5312
|
context: Readonly<AdminContext>;
|
|
5071
5313
|
/** A sibling client for another app, sharing credentials. */
|
|
5072
5314
|
forApp(appId: string): /*elided*/ any;
|
|
5315
|
+
agent: BoundOps<typeof agent>;
|
|
5073
5316
|
analytics: BoundOps<typeof analytics>;
|
|
5317
|
+
events: BoundOps<typeof appEvents>;
|
|
5074
5318
|
crashes: BoundOps<typeof crashes>;
|
|
5075
5319
|
cron: BoundOps<typeof cron>;
|
|
5076
5320
|
data: BoundOps<typeof data>;
|
|
@@ -5150,4 +5394,4 @@ declare class AdminTimeoutError extends Error {
|
|
|
5150
5394
|
|
|
5151
5395
|
declare const admin: AdminClient;
|
|
5152
5396
|
|
|
5153
|
-
export { AdminApiError, type AdminClient, type AdminClientOptions, type AdminContext, AdminTimeoutError, type AnalyticsAiHostRow, type AnalyticsAiSourcesResult, type AnalyticsAiVendorRow, type AnalyticsBatchResult, type AnalyticsCrawlersOverviewResult, type AnalyticsCrawlersRecentResult, type AnalyticsCrawlersRecentRow, type AnalyticsCrawlersResult, type AnalyticsCrawlersTimeseriesBucket, type AnalyticsCrawlersTimeseriesResult, type AnalyticsLiveResult, type AnalyticsMapPoint, type AnalyticsMapResult, type AnalyticsMetric, type AnalyticsQueryResult, type AnalyticsQueryResultRow, type AnalyticsSourceRow, type AnalyticsSourcesResult, type AppCronJobStatus, type AppCronJobStatusReason, type AppCronRunState, type AppEmailSuppression, type AppSecretRow, type CrashGroup, type CrashOccurrenceRow, type CrashesGetResult, type CrashesListResult, type CrashesOccurrencesResult, type CrashesStatsBucket, type CrashesStatsResult, type CronJobDecorated, type CronOverviewResult, type CronRunResult, type CronRunSummary, type DashboardLiveRelease, type DashboardReleaseMethod, type DashboardResult, type DataLiftFromDevResult, type DataLiftFromLiveResult, type DataSourcesBuildProgress, type DataSourcesChunkingConfig, type DataSourcesConfigResult, type DataSourcesConfigUpdateResult, type DataSourcesDeleteResult, type DataSourcesDocument, type DataSourcesDocumentConfirmResult, type DataSourcesDocumentDeleteResult, type DataSourcesDocumentStatus, type DataSourcesDocumentsResult, type DataSourcesDropResult, type DataSourcesIngestConfig, type DataSourcesIngestUpdate, type DataSourcesListEntry, type DataSourcesListResult, type DataSourcesPromoteResult, type DataSourcesRetrievalConfig, type DataSourcesRetrievalUpdate, type DataSourcesRevectorizeResult, type DataSourcesSearchCitation, type DataSourcesSearchResult, type DataSourcesSearchResultItem, type DataSourcesUploadTokenResult, type DatasetFile, type DbQueryResult, type DiagnosticsAuditEnvironment, type DiagnosticsDashboardResult, type DiagnosticsFinding, type DiagnosticsLighthouseScores, type DiagnosticsPayload, type DiagnosticsReleaseResult, type DiagnosticsRuntimeFindings, type DomainsCheckResult, type DomainsCustomAddResult, type DomainsCustomCheckResult, type DomainsCustomHostnameUiStatus, type DomainsCustomHostnameView, type DomainsCustomListResult, type DomainsCustomRemoveResult, type DomainsCustomRetryResult, type DomainsDnsInstructions, type DomainsGetResult, type DomainsSetResult, type EmailBatchLifecycle, type EmailBatchResult, type EmailBatchSummary, type EmailBatchesResult, type EmailDomainBase, type EmailEffectiveSender, type EmailInboxResult, type EmailListResult, type EmailMessageKind, type EmailMessageResult, type EmailMessageStatus, type EmailSenderTier, type EmailSendingStatusResult, type EmailStatsResult, type EmailSummary, type EmailSuppressResult, type EmailSuppressionsResult, type EmailUnsuppressResult, type FilesDeleteResult, type FilesFileMeta, type FilesListEntry, type FilesListResult, type FilesLsResult, type FilesScanBadge, type FilesScanFlagged, type FilesScanStore, type FilesStatResult, type FilesStoreSummaryEntry, type FilesUploadUrlResult, type FilesUrlResult, type FrontendErrorType, type InboundDnsInstructions, type InboundEmailDomainAddResult, type InboundEmailDomainCheckResult, type InboundEmailDomainDeleteResult, type InboundEmailDomainUiStatus, type InboundEmailDomainVerifyResult, type InboundEmailDomainView, type InboundEmailDomainsListResult, type InboxEmailPreview, type IssueAuthorKind, type IssueCommentRow, type IssueEventType, type IssueKind, type IssueRow, type IssueStatus, type IssuesCommentResult, type IssuesCreateResult, type IssuesDeleteResult, type IssuesGetResult, type IssuesListResult, type IssuesUpdateResult, type JewelPairRow, type JewelPairSummaryRow, type JewelVerdict, type JewelsDatasetSummary, type JewelsDryrunResult, type JewelsExportResult, type JewelsGradeResult, type JewelsGrading, type JewelsOverviewResult, type JewelsPairResult, type JewelsPairsResult, type JewelsQueueResult, type JewelsResolveResult, type JewelsRunResult, type JewelsRunsResult, type JewelsTimeseriesBucket, type JewelsTimeseriesResult, type JewelsTrainResult, type LiftedDatabase, type MethodsInvokeResult, type OutboundDnsInstructions, type OutboundEmailDomainAddResult, type OutboundEmailDomainCheckResult, type OutboundEmailDomainDeleteResult, type OutboundEmailDomainUiStatus, type OutboundEmailDomainVerifyResult, type OutboundEmailDomainView, type OutboundEmailDomainsListResult, type PlatformSuppression, type PrerenderGetResult, type PrerenderInvalidateResult, type PrerenderPage, type PrerenderPagesResult, type PrerenderViewResult, type ReleaseFragment, type ReleasesByCommitResult, type ReleasesGetResult, type ReleasesListResult, type RequestsGetResult, type RequestsListResult, type RequestsListRow, type RequestsStatsMethodBucket, type RequestsStatsMethodResult, type RequestsStatsSummaryBucket, type RequestsStatsSummaryResult, type SecretsDeleteResult, type SecretsGetResult, type SecretsListResult, type SecretsSetResult, type SettingsResult, type SuppressionSource, type TrainingLogEntry, type TrainingRunRow, type TrainingRunStatus, type UserAuthProvider, type UserListItem, type UserRecord, type UsersCreateApiKeyResult, type UsersListResult, type UsersRevokeApiKeyResult, type UsersSetRoleResult, type V2AppSettings, type V2BuildLogEntry, type V2BuildStats, type V2CommitInfo, type V2EmailMessage, type V2ReleaseStatus, type VoiceAvailableNumber, type VoiceNumbersBuyResult, type VoiceNumbersListResult, type VoiceNumbersReleaseResult, type VoiceNumbersSearchResult, type VoiceNumbersSetNameResult, type VoicePhoneNumberStatus, type VoicePhoneNumberView, type VoiceResolvedPolicy, type VoiceSessionChannel, type VoiceSessionCost, type VoiceSessionCostLine, type VoiceSessionDetail, type VoiceSessionGetResult, type VoiceSessionListItem, type VoiceSessionSip, type VoiceSessionSpeechEntry, type VoiceSessionStatus, type VoiceSessionToolEntry, type VoiceSessionTranscriptEntry, type VoiceSessionsListResult, type VoiceSettingsCeilings, type VoiceSettingsGetResult, type VoiceSettingsOverrides, type VoiceSettingsSetResult, admin, createAdminClient, admin as default };
|
|
5397
|
+
export { AdminApiError, type AdminClient, type AdminClientOptions, type AdminContext, AdminTimeoutError, type AgentThreadDetail, type AgentThreadListItem, type AgentThreadsGetResult, type AgentThreadsListResult, type AgentToolCall, type AgentTranscriptMessage, type AgentTurnError, type AnalyticsAiHostRow, type AnalyticsAiSourcesResult, type AnalyticsAiVendorRow, type AnalyticsBatchResult, type AnalyticsCrawlersOverviewResult, type AnalyticsCrawlersRecentResult, type AnalyticsCrawlersRecentRow, type AnalyticsCrawlersResult, type AnalyticsCrawlersTimeseriesBucket, type AnalyticsCrawlersTimeseriesResult, type AnalyticsLiveResult, type AnalyticsMapPoint, type AnalyticsMapResult, type AnalyticsMetric, type AnalyticsQueryResult, type AnalyticsQueryResultRow, type AnalyticsSourceRow, type AnalyticsSourcesResult, type AppCronJobStatus, type AppCronJobStatusReason, type AppCronRunState, type AppEmailSuppression, type AppSecretRow, type CrashGroup, type CrashOccurrenceRow, type CrashesGetResult, type CrashesListResult, type CrashesOccurrencesResult, type CrashesStatsBucket, type CrashesStatsResult, type CronJobDecorated, type CronOverviewResult, type CronRunResult, type CronRunSummary, type DashboardLiveRelease, type DashboardReleaseMethod, type DashboardResult, type DataLiftFromDevResult, type DataLiftFromLiveResult, type DataSourcesBuildProgress, type DataSourcesChunkingConfig, type DataSourcesConfigResult, type DataSourcesConfigUpdateResult, type DataSourcesDeleteResult, type DataSourcesDocument, type DataSourcesDocumentConfirmResult, type DataSourcesDocumentDeleteResult, type DataSourcesDocumentStatus, type DataSourcesDocumentsResult, type DataSourcesDropResult, type DataSourcesIngestConfig, type DataSourcesIngestUpdate, type DataSourcesListEntry, type DataSourcesListResult, type DataSourcesPromoteResult, type DataSourcesRetrievalConfig, type DataSourcesRetrievalUpdate, type DataSourcesRevectorizeResult, type DataSourcesSearchCitation, type DataSourcesSearchResult, type DataSourcesSearchResultItem, type DataSourcesUploadTokenResult, type DatasetFile, type DbQueryResult, type DiagnosticsAuditEnvironment, type DiagnosticsDashboardResult, type DiagnosticsFinding, type DiagnosticsLighthouseScores, type DiagnosticsPayload, type DiagnosticsReleaseResult, type DiagnosticsRuntimeFindings, type DomainsCheckResult, type DomainsCustomAddResult, type DomainsCustomCheckResult, type DomainsCustomHostnameUiStatus, type DomainsCustomHostnameView, type DomainsCustomListResult, type DomainsCustomRemoveResult, type DomainsCustomRetryResult, type DomainsDnsInstructions, type DomainsGetResult, type DomainsSetResult, type EmailBatchLifecycle, type EmailBatchResult, type EmailBatchSummary, type EmailBatchesResult, type EmailDomainBase, type EmailEffectiveSender, type EmailInboxResult, type EmailListResult, type EmailMessageKind, type EmailMessageResult, type EmailMessageStatus, type EmailSenderTier, type EmailSendingStatusResult, type EmailStatsResult, type EmailSummary, type EmailSuppressResult, type EmailSuppressionsResult, type EmailUnsuppressResult, type EventChannelActivity, type EventsChannelsListResult, type EventsPublishResult, type EventsTailFrame, type FilesDeleteResult, type FilesFileMeta, type FilesListEntry, type FilesListResult, type FilesLsResult, type FilesScanBadge, type FilesScanFlagged, type FilesScanStore, type FilesStatResult, type FilesStoreSummaryEntry, type FilesUploadUrlResult, type FilesUrlResult, type FrontendErrorType, type InboundDnsInstructions, type InboundEmailDomainAddResult, type InboundEmailDomainCheckResult, type InboundEmailDomainDeleteResult, type InboundEmailDomainUiStatus, type InboundEmailDomainVerifyResult, type InboundEmailDomainView, type InboundEmailDomainsListResult, type InboxEmailPreview, type IssueAuthorKind, type IssueCommentRow, type IssueEventType, type IssueKind, type IssueRow, type IssueStatus, type IssuesCommentResult, type IssuesCreateResult, type IssuesDeleteResult, type IssuesGetResult, type IssuesListResult, type IssuesUpdateResult, type JewelPairRow, type JewelPairSummaryRow, type JewelVerdict, type JewelsDatasetSummary, type JewelsDryrunResult, type JewelsExportResult, type JewelsGradeResult, type JewelsGrading, type JewelsOverviewResult, type JewelsPairResult, type JewelsPairsResult, type JewelsQueueResult, type JewelsResolveResult, type JewelsRunResult, type JewelsRunsResult, type JewelsTimeseriesBucket, type JewelsTimeseriesResult, type JewelsTrainResult, type LiftedDatabase, type MethodsInvokeResult, type OutboundDnsInstructions, type OutboundEmailDomainAddResult, type OutboundEmailDomainCheckResult, type OutboundEmailDomainDeleteResult, type OutboundEmailDomainUiStatus, type OutboundEmailDomainVerifyResult, type OutboundEmailDomainView, type OutboundEmailDomainsListResult, type PlatformSuppression, type PrerenderGetResult, type PrerenderInvalidateResult, type PrerenderPage, type PrerenderPagesResult, type PrerenderViewResult, type ReleaseFragment, type ReleasesByCommitResult, type ReleasesGetResult, type ReleasesListResult, type RequestsGetResult, type RequestsListResult, type RequestsListRow, type RequestsStatsMethodBucket, type RequestsStatsMethodResult, type RequestsStatsSummaryBucket, type RequestsStatsSummaryResult, type SecretsDeleteResult, type SecretsGetResult, type SecretsListResult, type SecretsSetResult, type SettingsResult, type SuppressionSource, type TrainingLogEntry, type TrainingRunRow, type TrainingRunStatus, type UserAuthProvider, type UserListItem, type UserRecord, type UsersCreateApiKeyResult, type UsersListResult, type UsersRevokeApiKeyResult, type UsersSetRoleResult, type V2AppSettings, type V2BuildLogEntry, type V2BuildStats, type V2CommitInfo, type V2EmailMessage, type V2ReleaseStatus, type VoiceAvailableNumber, type VoiceNumbersBuyResult, type VoiceNumbersListResult, type VoiceNumbersReleaseResult, type VoiceNumbersSearchResult, type VoiceNumbersSetNameResult, type VoicePhoneNumberStatus, type VoicePhoneNumberView, type VoiceResolvedPolicy, type VoiceSessionChannel, type VoiceSessionCost, type VoiceSessionCostLine, type VoiceSessionDetail, type VoiceSessionGetResult, type VoiceSessionListItem, type VoiceSessionSip, type VoiceSessionSpeechEntry, type VoiceSessionStatus, type VoiceSessionToolEntry, type VoiceSessionTranscriptEntry, type VoiceSessionsListResult, type VoiceSettingsCeilings, type VoiceSettingsGetResult, type VoiceSettingsOverrides, type VoiceSettingsSetResult, admin, createAdminClient, admin as default };
|
package/dist/index.js
CHANGED
|
@@ -58,16 +58,11 @@ function loadWorkspaceAppId(workspaceDir = WORKSPACE_DIR) {
|
|
|
58
58
|
return result.value.appId;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
// src/ops/
|
|
62
|
-
var
|
|
63
|
-
__export(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
crawlers: () => crawlers,
|
|
67
|
-
live: () => live,
|
|
68
|
-
map: () => map,
|
|
69
|
-
query: () => query,
|
|
70
|
-
sources: () => sources
|
|
61
|
+
// src/ops/agent.ts
|
|
62
|
+
var agent_exports = {};
|
|
63
|
+
__export(agent_exports, {
|
|
64
|
+
threadsGet: () => threadsGet,
|
|
65
|
+
threadsList: () => threadsList
|
|
71
66
|
});
|
|
72
67
|
|
|
73
68
|
// src/errors.ts
|
|
@@ -168,7 +163,33 @@ async function tryCall(ctx, method, apiPath) {
|
|
|
168
163
|
return { ok: res.ok, status: res.status, body: await readBody(res) };
|
|
169
164
|
}
|
|
170
165
|
|
|
166
|
+
// src/ops/agent.ts
|
|
167
|
+
function threadsList(ctx, params = {}) {
|
|
168
|
+
return call(
|
|
169
|
+
ctx,
|
|
170
|
+
"GET",
|
|
171
|
+
`/_internal/v2/apps/${ctx.appId}/agent-threads${qs(params)}`
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
function threadsGet(ctx, threadId) {
|
|
175
|
+
return call(
|
|
176
|
+
ctx,
|
|
177
|
+
"GET",
|
|
178
|
+
`/_internal/v2/apps/${ctx.appId}/agent-threads/${seg(threadId)}`
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
171
182
|
// src/ops/analytics.ts
|
|
183
|
+
var analytics_exports = {};
|
|
184
|
+
__export(analytics_exports, {
|
|
185
|
+
aiSources: () => aiSources,
|
|
186
|
+
batch: () => batch,
|
|
187
|
+
crawlers: () => crawlers,
|
|
188
|
+
live: () => live,
|
|
189
|
+
map: () => map,
|
|
190
|
+
query: () => query,
|
|
191
|
+
sources: () => sources
|
|
192
|
+
});
|
|
172
193
|
function query(ctx, body) {
|
|
173
194
|
return call(
|
|
174
195
|
ctx,
|
|
@@ -222,6 +243,28 @@ function crawlers(ctx, params) {
|
|
|
222
243
|
);
|
|
223
244
|
}
|
|
224
245
|
|
|
246
|
+
// src/ops/events.ts
|
|
247
|
+
var events_exports = {};
|
|
248
|
+
__export(events_exports, {
|
|
249
|
+
channelsList: () => channelsList,
|
|
250
|
+
publish: () => publish
|
|
251
|
+
});
|
|
252
|
+
function channelsList(ctx, params = {}) {
|
|
253
|
+
return call(
|
|
254
|
+
ctx,
|
|
255
|
+
"GET",
|
|
256
|
+
`/_internal/v2/apps/${ctx.appId}/events/channels${qs(params)}`
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
function publish(ctx, params) {
|
|
260
|
+
return call(
|
|
261
|
+
ctx,
|
|
262
|
+
"POST",
|
|
263
|
+
`/_internal/v2/apps/${ctx.appId}/events/publish`,
|
|
264
|
+
{ channels: params.channels, data: params.data, scope: params.scope }
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
225
268
|
// src/ops/crashes.ts
|
|
226
269
|
var crashes_exports = {};
|
|
227
270
|
__export(crashes_exports, {
|
|
@@ -1626,7 +1669,9 @@ function buildClient(ctx) {
|
|
|
1626
1669
|
forApp(appId) {
|
|
1627
1670
|
return buildClient({ ...ctx, appId });
|
|
1628
1671
|
},
|
|
1672
|
+
agent: bindOps(agent_exports, ctx),
|
|
1629
1673
|
analytics: bindOps(analytics_exports, ctx),
|
|
1674
|
+
events: bindOps(events_exports, ctx),
|
|
1630
1675
|
crashes: bindOps(crashes_exports, ctx),
|
|
1631
1676
|
cron: bindOps(cron_exports, ctx),
|
|
1632
1677
|
data: bindOps(data_exports, ctx),
|