deepline 0.3.394 → 0.3.396
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/bundling-sources/sdk/src/client.ts +30 -162
- package/dist/bundling-sources/sdk/src/index.ts +1 -0
- package/dist/bundling-sources/sdk/src/plays/play-description.ts +167 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
- package/dist/cli/{auth-OSXDAVCF.mjs → auth-3LTD62VL.mjs} +4 -4
- package/dist/cli/auth-562JPKOM.js +39 -0
- package/dist/cli/{billing-ZNNKX3UR.mjs → billing-DP7ZAJBO.mjs} +5 -4
- package/dist/cli/{billing-EKLYOXUY.js → billing-PA5OXEM5.js} +76 -75
- package/dist/cli/{chunk-BP33SIZF.mjs → chunk-23GAA3YO.mjs} +1 -1
- package/dist/cli/{chunk-KI635JN4.js → chunk-2VOLOWYZ.js} +1087 -1056
- package/dist/cli/{chunk-XXUDVEXK.mjs → chunk-3T4MCB5R.mjs} +1026 -995
- package/dist/cli/{chunk-VB6KECLU.mjs → chunk-5WNJF2T3.mjs} +102 -36
- package/dist/cli/{chunk-KIUMEOM5.js → chunk-772W2SAU.js} +8 -8
- package/dist/cli/{chunk-2MDDA7A4.js → chunk-7Z66NHUC.js} +26 -26
- package/dist/cli/{chunk-M57J2SK4.mjs → chunk-AUYXWELC.mjs} +2 -2
- package/dist/cli/{chunk-354JCXA2.js → chunk-AVHLATII.js} +50 -50
- package/dist/cli/{chunk-MLPU5SMZ.js → chunk-DC6LTULT.js} +2 -2
- package/dist/cli/chunk-EIMG75BT.mjs +130 -0
- package/dist/cli/{chunk-6YAUMG27.js → chunk-GNN4MY5X.js} +1 -1
- package/dist/cli/{chunk-UXFSWG3Q.mjs → chunk-I4T4XAA2.mjs} +4 -4
- package/dist/cli/{chunk-MFB2VKBO.mjs → chunk-JCN4DHF7.mjs} +2 -2
- package/dist/cli/{chunk-VK6FYZLP.js → chunk-KAEZNPUM.js} +23 -8
- package/dist/cli/chunk-KXMNM4AQ.js +130 -0
- package/dist/cli/{chunk-XRQ2AQL7.mjs → chunk-LOGGNW4H.mjs} +2 -2
- package/dist/cli/{chunk-RDXFGPJU.js → chunk-LWERJUKN.js} +218 -218
- package/dist/cli/{chunk-QIQBYKLB.js → chunk-ME6XRFLY.js} +15 -15
- package/dist/cli/{chunk-JHIJIHFB.mjs → chunk-MR6XCBQJ.mjs} +23 -131
- package/dist/cli/{chunk-TJI2EN6K.mjs → chunk-NHB5YUCS.mjs} +1 -1
- package/dist/cli/{chunk-ZMVJSS6N.js → chunk-NSOTASOP.js} +101 -35
- package/dist/cli/{chunk-ZYBGA4AR.mjs → chunk-QHGPA362.mjs} +18 -3
- package/dist/cli/{chunk-4P27AXEA.js → chunk-RMTASUAK.js} +65 -65
- package/dist/cli/{chunk-KGNTKMRG.js → chunk-RTO5QZWT.js} +6 -6
- package/dist/cli/{chunk-X63FDZJZ.mjs → chunk-TLQ3FZOC.mjs} +3 -3
- package/dist/cli/{chunk-CS6RAIVY.js → chunk-V7UP2F4U.js} +4 -4
- package/dist/cli/{chunk-FJGW5GXU.mjs → chunk-VE3U3SQC.mjs} +1 -1
- package/dist/cli/{chunk-E23BQ5SC.js → chunk-WQJJNIMQ.js} +241 -349
- package/dist/cli/{chunk-NR3DFKNF.mjs → chunk-XKZXO7D3.mjs} +1 -1
- package/dist/cli/{csv-5AXRB35H.mjs → csv-RLRR74RQ.mjs} +3 -3
- package/dist/cli/{csv-LU7O75WE.js → csv-TF576S77.js} +12 -12
- package/dist/cli/{db-F7YTFKVM.js → db-FDBJUTFO.js} +30 -29
- package/dist/cli/{db-7XP5UWEW.mjs → db-XORGNBIC.mjs} +5 -4
- package/dist/cli/{describe-K4ES5LIL.mjs → describe-6O2ENKTP.mjs} +86 -67
- package/dist/cli/{describe-FRH32RDV.js → describe-EFWNECHI.js} +100 -81
- package/dist/cli/{executions-RZV5XPT2.js → executions-SFYAXPF4.js} +7 -6
- package/dist/cli/{executions-IEHEHJUO.mjs → executions-YPP7WR77.mjs} +5 -4
- package/dist/cli/{feedback-3P65QTX3.js → feedback-5UZFYMGB.js} +7 -7
- package/dist/cli/{feedback-FPUVZBAN.mjs → feedback-RBGA5ARU.mjs} +3 -3
- package/dist/cli/git-5LDY5ZID.js +23 -0
- package/dist/cli/{git-GLVVP7TY.mjs → git-IRSAJEK2.mjs} +4 -4
- package/dist/cli/index.js +93 -93
- package/dist/cli/index.mjs +42 -42
- package/dist/cli/{legacy-noops-XKSGZR7Q.js → legacy-noops-CVAOQY2F.js} +7 -7
- package/dist/cli/{legacy-noops-3MOI6NBM.mjs → legacy-noops-NA7N6ZOU.mjs} +4 -4
- package/dist/cli/{monitors-NZ2DYNST.js → monitors-4OMRXCXP.js} +86 -85
- package/dist/cli/{monitors-FTBGNEFG.mjs → monitors-ILZ2XHYG.mjs} +5 -4
- package/dist/cli/{org-V2J5RBCN.mjs → org-QDDXAE3J.mjs} +5 -4
- package/dist/cli/{org-MCKDQXIV.js → org-YGNJDD2X.js} +65 -64
- package/dist/cli/{chunk-RBJYWRCF.js → play-L535H26U.js} +270 -325
- package/dist/cli/{chunk-5BB2RGAX.mjs → play-VT6OHB2D.mjs} +77 -132
- package/dist/cli/{providers-2JEZ2264.js → providers-GPZ6PQAL.js} +8 -7
- package/dist/cli/{providers-I6RQJZFZ.mjs → providers-KG4W5MPK.mjs} +5 -4
- package/dist/cli/{quickstart-BIDQDMO4.mjs → quickstart-2JDGTXIG.mjs} +3 -3
- package/dist/cli/{quickstart-GJ2RPDU3.js → quickstart-UI27S5LO.js} +5 -5
- package/dist/cli/search-MGWROZ33.js +28 -0
- package/dist/cli/{search-ELRXFWG5.mjs → search-PW3RAUX7.mjs} +6 -5
- package/dist/cli/{secrets-SQXGZXIC.mjs → secrets-HNOMK5A2.mjs} +5 -4
- package/dist/cli/{secrets-53IT6VXD.js → secrets-WFAXOUZE.js} +14 -13
- package/dist/cli/{sessions-CAV5M77Y.js → sessions-366KROUA.js} +5 -5
- package/dist/cli/{sessions-2X5QF7SL.mjs → sessions-XLX3E5UO.mjs} +4 -4
- package/dist/cli/{settings-532WNAZO.js → settings-GADAG2UK.js} +75 -74
- package/dist/cli/{settings-7P67VGCJ.mjs → settings-YNZ4YKCH.mjs} +8 -7
- package/dist/cli/{setup-QGGBV2LE.mjs → setup-PSEHIUXO.mjs} +6 -6
- package/dist/cli/{setup-6L2VSUWJ.js → setup-R5YO7GT6.js} +41 -41
- package/dist/cli/skills-JF2LPEGM.js +28 -0
- package/dist/cli/{skills-3FE62WBG.mjs → skills-LTQBP6CZ.mjs} +4 -4
- package/dist/cli/tools-CP2PEFRN.js +34 -0
- package/dist/cli/{tools-DMR25DEF.mjs → tools-UAXDWU63.mjs} +11 -18
- package/dist/cli/update-HZHZOU6C.js +28 -0
- package/dist/cli/{update-6RZMHJZP.mjs → update-SMNIBIMS.mjs} +6 -6
- package/dist/cli/{workflow-TX4F2PIX.js → workflow-AOQVZHMD.js} +16 -15
- package/dist/cli/{workflow-L2DQRE6R.mjs → workflow-IKGMBGF6.mjs} +6 -5
- package/dist/{client-C3O1Ipf3.d.ts → client-Bgis7F6-.d.ts} +22 -12
- package/dist/{client-BktIPdIj.d.mts → client-DiGl8ska.d.mts} +22 -12
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -10
- package/dist/index.mjs +9 -8
- package/dist/install-integrity.json +83 -78
- package/dist/plays/play-description.d.mts +6 -0
- package/dist/plays/play-description.d.ts +6 -0
- package/dist/plays/play-description.js +11 -0
- package/dist/plays/play-description.mjs +11 -0
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +6 -1
- package/dist/cli/auth-IHKISLJQ.js +0 -39
- package/dist/cli/git-MFFAWVVX.js +0 -23
- package/dist/cli/play-AJFGME3B.mjs +0 -158
- package/dist/cli/play-WLSN2EO2.js +0 -158
- package/dist/cli/search-5VN4YD4I.js +0 -27
- package/dist/cli/skills-S6NPZAN7.js +0 -28
- package/dist/cli/tools-647RLXQS.js +0 -41
- package/dist/cli/update-WVTSC3EM.js +0 -28
- package/dist/cli/{chunk-KZZC33PY.mjs → chunk-H5KLUGY7.mjs} +214 -214
|
@@ -13,9 +13,12 @@ import type {
|
|
|
13
13
|
// Value import from the dependency-free module: the client is bundled into
|
|
14
14
|
// authored Plays, where `zod` (the contract's schemas) cannot resolve.
|
|
15
15
|
import { playTriggerConfigPath } from '../../shared_libs/plays/trigger-config-route';
|
|
16
|
-
import { CSV_HEADER_MATCHING_NOTE } from './csv-header-matching';
|
|
17
16
|
import { iterateCursorPages } from './pagination';
|
|
18
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
describePlayDetail,
|
|
19
|
+
describePlayListItem,
|
|
20
|
+
type PlayDescriptionOptions,
|
|
21
|
+
} from './plays/play-description';
|
|
19
22
|
/**
|
|
20
23
|
* The main API client for interacting with the Deepline platform.
|
|
21
24
|
*
|
|
@@ -3101,161 +3104,6 @@ export class DeeplineClient {
|
|
|
3101
3104
|
return this.config.baseUrl;
|
|
3102
3105
|
}
|
|
3103
3106
|
|
|
3104
|
-
private compactSchema(schema: Record<string, unknown> | null | undefined) {
|
|
3105
|
-
if (!schema) return null;
|
|
3106
|
-
const fields = Array.isArray(schema.fields)
|
|
3107
|
-
? schema.fields
|
|
3108
|
-
.map((field) =>
|
|
3109
|
-
field && typeof field === 'object'
|
|
3110
|
-
? {
|
|
3111
|
-
name: String((field as Record<string, unknown>).name ?? ''),
|
|
3112
|
-
type: (field as Record<string, unknown>).type ?? undefined,
|
|
3113
|
-
required:
|
|
3114
|
-
(field as Record<string, unknown>).required ?? undefined,
|
|
3115
|
-
}
|
|
3116
|
-
: null,
|
|
3117
|
-
)
|
|
3118
|
-
.filter((field) => Boolean(field?.name))
|
|
3119
|
-
: [];
|
|
3120
|
-
return fields.length > 0 ? { fields } : schema;
|
|
3121
|
-
}
|
|
3122
|
-
|
|
3123
|
-
private schemaMetadata(
|
|
3124
|
-
schema: Record<string, unknown> | null | undefined,
|
|
3125
|
-
key: string,
|
|
3126
|
-
): Record<string, unknown> | null {
|
|
3127
|
-
if (!isRecord(schema)) return null;
|
|
3128
|
-
const value = schema[key];
|
|
3129
|
-
return isRecord(value) ? value : null;
|
|
3130
|
-
}
|
|
3131
|
-
|
|
3132
|
-
private playRunCommand(
|
|
3133
|
-
play: Pick<PlayListItem, 'name' | 'reference' | 'inputSchema'>,
|
|
3134
|
-
): string {
|
|
3135
|
-
const target = play.reference || play.name;
|
|
3136
|
-
return `deepline plays run ${target}${playInputExampleArgs(play.inputSchema)}`;
|
|
3137
|
-
}
|
|
3138
|
-
|
|
3139
|
-
private starterPlayPath(
|
|
3140
|
-
play: Pick<PlayListItem, 'name' | 'reference'>,
|
|
3141
|
-
): string {
|
|
3142
|
-
const target = play.reference || play.name;
|
|
3143
|
-
const unqualifiedName = target.split('/').pop() || play.name;
|
|
3144
|
-
const safeName = unqualifiedName
|
|
3145
|
-
.trim()
|
|
3146
|
-
.toLowerCase()
|
|
3147
|
-
.replace(/[^a-z0-9-]/g, '-')
|
|
3148
|
-
.replace(/-+/g, '-')
|
|
3149
|
-
.replace(/^-|-$/g, '');
|
|
3150
|
-
return `./${safeName || 'play'}.play.ts`;
|
|
3151
|
-
}
|
|
3152
|
-
|
|
3153
|
-
private playCloneEditStarter(
|
|
3154
|
-
play: Pick<
|
|
3155
|
-
PlayListItem,
|
|
3156
|
-
'name' | 'reference' | 'canClone' | 'canEdit' | 'origin' | 'ownerType'
|
|
3157
|
-
>,
|
|
3158
|
-
): PlayDescription['cloneEditStarter'] | undefined {
|
|
3159
|
-
const readonlyPrebuilt =
|
|
3160
|
-
(play.origin === 'prebuilt' || play.ownerType === 'deepline') &&
|
|
3161
|
-
!play.canEdit;
|
|
3162
|
-
if (!play.canClone && !readonlyPrebuilt) return undefined;
|
|
3163
|
-
const target = play.reference || play.name;
|
|
3164
|
-
const path = this.starterPlayPath(play);
|
|
3165
|
-
return {
|
|
3166
|
-
path,
|
|
3167
|
-
command: `deepline plays get ${target} --source --out ${path}`,
|
|
3168
|
-
checkCommand: `deepline plays check ${path}`,
|
|
3169
|
-
};
|
|
3170
|
-
}
|
|
3171
|
-
|
|
3172
|
-
private summarizePlayListItem(
|
|
3173
|
-
play: PlayListItem,
|
|
3174
|
-
options?: { compact?: boolean },
|
|
3175
|
-
): PlayDescription {
|
|
3176
|
-
const aliases = play.aliases?.length ? play.aliases : [play.name];
|
|
3177
|
-
const csvInput = this.schemaMetadata(play.inputSchema, 'csvInput');
|
|
3178
|
-
const rowOutputSchema = this.schemaMetadata(
|
|
3179
|
-
play.outputSchema,
|
|
3180
|
-
'rowOutputSchema',
|
|
3181
|
-
);
|
|
3182
|
-
const description =
|
|
3183
|
-
play.description?.trim() ||
|
|
3184
|
-
play.currentRevision?.description?.trim() ||
|
|
3185
|
-
play.liveRevision?.description?.trim() ||
|
|
3186
|
-
null;
|
|
3187
|
-
const runCommand = this.playRunCommand(play);
|
|
3188
|
-
const cloneEditStarter = this.playCloneEditStarter(play);
|
|
3189
|
-
return {
|
|
3190
|
-
name: play.name,
|
|
3191
|
-
// playKey and triggerStatus were projected away here, so `describe`
|
|
3192
|
-
// was strictly less informative than `plays list` for the same play — no
|
|
3193
|
-
// stable key, and no way to see that a cron was armed.
|
|
3194
|
-
...(play.playKey ? { playKey: play.playKey } : {}),
|
|
3195
|
-
...(play.reference ? { reference: play.reference } : {}),
|
|
3196
|
-
...(play.displayName ? { displayName: play.displayName } : {}),
|
|
3197
|
-
...(description ? { description } : {}),
|
|
3198
|
-
...(play.guidance ? { guidance: play.guidance } : {}),
|
|
3199
|
-
pinned: Boolean(play.pinned),
|
|
3200
|
-
toolCategories: play.toolCategories ?? [],
|
|
3201
|
-
origin: play.origin,
|
|
3202
|
-
ownerType: play.ownerType,
|
|
3203
|
-
canEdit: play.canEdit,
|
|
3204
|
-
canClone: play.canClone,
|
|
3205
|
-
aliases,
|
|
3206
|
-
inputSchema: options?.compact
|
|
3207
|
-
? this.compactSchema(play.inputSchema)
|
|
3208
|
-
: (play.inputSchema ?? null),
|
|
3209
|
-
outputSchema: options?.compact
|
|
3210
|
-
? this.compactSchema(play.outputSchema)
|
|
3211
|
-
: (play.outputSchema ?? null),
|
|
3212
|
-
staticPipeline: isRecord(play.staticPipeline)
|
|
3213
|
-
? play.staticPipeline
|
|
3214
|
-
: isRecord(play.currentRevision?.staticPipeline)
|
|
3215
|
-
? play.currentRevision.staticPipeline
|
|
3216
|
-
: isRecord(play.liveRevision?.staticPipeline)
|
|
3217
|
-
? play.liveRevision.staticPipeline
|
|
3218
|
-
: null,
|
|
3219
|
-
...(csvInput
|
|
3220
|
-
? {
|
|
3221
|
-
csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE },
|
|
3222
|
-
}
|
|
3223
|
-
: {}),
|
|
3224
|
-
...(rowOutputSchema ? { rowOutputSchema } : {}),
|
|
3225
|
-
runCommand,
|
|
3226
|
-
examples: [runCommand],
|
|
3227
|
-
...(cloneEditStarter ? { cloneEditStarter } : {}),
|
|
3228
|
-
currentPublishedVersion: play.currentPublishedVersion ?? null,
|
|
3229
|
-
// Read the live version off the live revision. It was previously only
|
|
3230
|
-
// ever written by the publish/live routes, so every list and describe
|
|
3231
|
-
// payload reported liveVersion: null even for an actively serving play.
|
|
3232
|
-
liveVersion: play.liveRevision?.version ?? null,
|
|
3233
|
-
...(play.triggerStatus ? { triggerStatus: play.triggerStatus } : {}),
|
|
3234
|
-
isDraftDirty: play.isDraftDirty,
|
|
3235
|
-
};
|
|
3236
|
-
}
|
|
3237
|
-
|
|
3238
|
-
private summarizePlayDetail(
|
|
3239
|
-
detail: PlayDetail,
|
|
3240
|
-
options?: { compact?: boolean },
|
|
3241
|
-
): PlayDescription {
|
|
3242
|
-
const play = detail.play;
|
|
3243
|
-
return {
|
|
3244
|
-
...this.summarizePlayListItem(play, options),
|
|
3245
|
-
currentPublishedVersion:
|
|
3246
|
-
play.currentPublishedVersion ?? play.liveRevision?.version ?? null,
|
|
3247
|
-
latestRunId: play.latestRunId ?? detail.latestRuns[0]?.workflowId ?? null,
|
|
3248
|
-
...(play.triggerMetadata
|
|
3249
|
-
? { triggerMetadata: play.triggerMetadata }
|
|
3250
|
-
: {}),
|
|
3251
|
-
...(play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {}),
|
|
3252
|
-
...(play.activeScheduledPlays
|
|
3253
|
-
? { activeScheduledPlays: play.activeScheduledPlays }
|
|
3254
|
-
: {}),
|
|
3255
|
-
...(play.observedCost ? { observedCost: play.observedCost } : {}),
|
|
3256
|
-
};
|
|
3257
|
-
}
|
|
3258
|
-
|
|
3259
3107
|
// ——————————————————————————————————————————————————————————
|
|
3260
3108
|
// Secrets
|
|
3261
3109
|
// ——————————————————————————————————————————————————————————
|
|
@@ -5862,7 +5710,7 @@ export class DeeplineClient {
|
|
|
5862
5710
|
},
|
|
5863
5711
|
);
|
|
5864
5712
|
const plays = (response.plays ?? []).map((play) =>
|
|
5865
|
-
|
|
5713
|
+
describePlayListItem(play, { ...options, pipeline: true }),
|
|
5866
5714
|
);
|
|
5867
5715
|
if (scope === 'prebuilt') {
|
|
5868
5716
|
return plays.filter(isPrebuiltPlayDescription);
|
|
@@ -5954,14 +5802,34 @@ export class DeeplineClient {
|
|
|
5954
5802
|
* Get a normalized play description suitable for agents and CLIs.
|
|
5955
5803
|
*
|
|
5956
5804
|
* The description includes runnable examples, input/output summaries, clone
|
|
5957
|
-
* guidance, revision state, and latest run metadata when available.
|
|
5805
|
+
* guidance, revision state, and latest run metadata when available. Pass
|
|
5806
|
+
* `{ pipeline: true }` to include the compiled pipeline, which can be
|
|
5807
|
+
* hundreds of kilobytes and is otherwise left out.
|
|
5958
5808
|
*/
|
|
5959
5809
|
async describePlay(
|
|
5960
5810
|
name: string,
|
|
5961
|
-
options
|
|
5811
|
+
options: PlayDescriptionOptions = {},
|
|
5962
5812
|
): Promise<PlayDescription> {
|
|
5963
|
-
|
|
5964
|
-
|
|
5813
|
+
if (options.pipeline) {
|
|
5814
|
+
return describePlayDetail(
|
|
5815
|
+
await this.getPlay(name, { guidance: true }),
|
|
5816
|
+
options,
|
|
5817
|
+
);
|
|
5818
|
+
}
|
|
5819
|
+
// The API describes the play itself, so only the description crosses
|
|
5820
|
+
// the wire; a definition carries source and pipelines on every revision.
|
|
5821
|
+
const params = new URLSearchParams({
|
|
5822
|
+
include: 'guidance',
|
|
5823
|
+
view: 'description',
|
|
5824
|
+
...(options.compact ? { compact: '1' } : {}),
|
|
5825
|
+
});
|
|
5826
|
+
const body = await this.http.get<
|
|
5827
|
+
PlayDetail | { description: PlayDescription }
|
|
5828
|
+
>(`/api/v2/plays/${encodeURIComponent(name)}?${params.toString()}`);
|
|
5829
|
+
// An API without the description view answers with the definition.
|
|
5830
|
+
return 'description' in body
|
|
5831
|
+
? body.description
|
|
5832
|
+
: describePlayDetail(body, options);
|
|
5965
5833
|
}
|
|
5966
5834
|
|
|
5967
5835
|
/**
|
|
@@ -89,6 +89,7 @@ export {
|
|
|
89
89
|
pinLocalPlayImports,
|
|
90
90
|
} from './plays/local-play-execution';
|
|
91
91
|
export type { LocalPlayGraph } from './plays/local-play-execution';
|
|
92
|
+
export type { PlayDescriptionOptions } from './plays/play-description';
|
|
92
93
|
export { CtxFetchHttpError } from './play';
|
|
93
94
|
export { RunObserveTransportUnavailableError } from './runs/observe-transport';
|
|
94
95
|
export { RunEventQueryInputError } from '../../shared_libs/play-runtime/run-event-query';
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { CSV_HEADER_MATCHING_NOTE } from '../csv-header-matching';
|
|
2
|
+
import type { PlayDescription, PlayDetail, PlayListItem } from '../types';
|
|
3
|
+
import { playInputExampleArgs } from './input-example';
|
|
4
|
+
|
|
5
|
+
export type { PlayDescription, PlayDetail } from '../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The description `deepline describe` and `plays describe` show for a Play,
|
|
9
|
+
* derived from its definition. The server computes it (`?view=description`)
|
|
10
|
+
* so a describe reads kilobytes; the SDK computes the same thing from a full
|
|
11
|
+
* definition when it asks for the compiled pipeline or talks to an older API.
|
|
12
|
+
*/
|
|
13
|
+
export type PlayDescriptionOptions = {
|
|
14
|
+
/** Field names only, in place of the full input and output schemas. */
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
/** Include the compiled pipeline. It can be hundreds of kilobytes. */
|
|
17
|
+
pipeline?: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
21
|
+
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function compactSchema(schema: Record<string, unknown> | null | undefined) {
|
|
25
|
+
if (!schema) return null;
|
|
26
|
+
const fields = Array.isArray(schema.fields)
|
|
27
|
+
? schema.fields
|
|
28
|
+
.map((field) =>
|
|
29
|
+
isRecord(field)
|
|
30
|
+
? {
|
|
31
|
+
name: String(field.name ?? ''),
|
|
32
|
+
type: field.type ?? undefined,
|
|
33
|
+
required: field.required ?? undefined,
|
|
34
|
+
}
|
|
35
|
+
: null,
|
|
36
|
+
)
|
|
37
|
+
.filter((field) => Boolean(field?.name))
|
|
38
|
+
: [];
|
|
39
|
+
return fields.length > 0 ? { fields } : schema;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function schemaMetadata(
|
|
43
|
+
schema: Record<string, unknown> | null | undefined,
|
|
44
|
+
key: string,
|
|
45
|
+
): Record<string, unknown> | null {
|
|
46
|
+
const value = isRecord(schema) ? schema[key] : null;
|
|
47
|
+
return isRecord(value) ? value : null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function starterPlayPath(
|
|
51
|
+
play: Pick<PlayListItem, 'name' | 'reference'>,
|
|
52
|
+
): string {
|
|
53
|
+
const target = play.reference || play.name;
|
|
54
|
+
const unqualifiedName = target.split('/').pop() || play.name;
|
|
55
|
+
const safeName = unqualifiedName
|
|
56
|
+
.trim()
|
|
57
|
+
.toLowerCase()
|
|
58
|
+
.replace(/[^a-z0-9-]/g, '-')
|
|
59
|
+
.replace(/-+/g, '-')
|
|
60
|
+
.replace(/^-|-$/g, '');
|
|
61
|
+
return `./${safeName || 'play'}.play.ts`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function cloneEditStarter(
|
|
65
|
+
play: Pick<
|
|
66
|
+
PlayListItem,
|
|
67
|
+
'name' | 'reference' | 'canClone' | 'canEdit' | 'origin' | 'ownerType'
|
|
68
|
+
>,
|
|
69
|
+
): PlayDescription['cloneEditStarter'] | undefined {
|
|
70
|
+
const readonlyPrebuilt =
|
|
71
|
+
(play.origin === 'prebuilt' || play.ownerType === 'deepline') &&
|
|
72
|
+
!play.canEdit;
|
|
73
|
+
if (!play.canClone && !readonlyPrebuilt) return undefined;
|
|
74
|
+
const target = play.reference || play.name;
|
|
75
|
+
const path = starterPlayPath(play);
|
|
76
|
+
return {
|
|
77
|
+
path,
|
|
78
|
+
command: `deepline plays get ${target} --source --out ${path}`,
|
|
79
|
+
checkCommand: `deepline plays check ${path}`,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function staticPipeline(play: PlayListItem): Record<string, unknown> | null {
|
|
84
|
+
return isRecord(play.staticPipeline)
|
|
85
|
+
? play.staticPipeline
|
|
86
|
+
: isRecord(play.currentRevision?.staticPipeline)
|
|
87
|
+
? play.currentRevision.staticPipeline
|
|
88
|
+
: isRecord(play.liveRevision?.staticPipeline)
|
|
89
|
+
? play.liveRevision.staticPipeline
|
|
90
|
+
: null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function describePlayListItem(
|
|
94
|
+
play: PlayListItem,
|
|
95
|
+
options: PlayDescriptionOptions = {},
|
|
96
|
+
): PlayDescription {
|
|
97
|
+
const aliases = play.aliases?.length ? play.aliases : [play.name];
|
|
98
|
+
const csvInput = schemaMetadata(play.inputSchema, 'csvInput');
|
|
99
|
+
const rowOutputSchema = schemaMetadata(play.outputSchema, 'rowOutputSchema');
|
|
100
|
+
const description =
|
|
101
|
+
play.description?.trim() ||
|
|
102
|
+
play.currentRevision?.description?.trim() ||
|
|
103
|
+
play.liveRevision?.description?.trim() ||
|
|
104
|
+
null;
|
|
105
|
+
const runCommand = `deepline plays run ${play.reference || play.name}${playInputExampleArgs(play.inputSchema)}`;
|
|
106
|
+
const starter = cloneEditStarter(play);
|
|
107
|
+
return {
|
|
108
|
+
name: play.name,
|
|
109
|
+
// playKey and triggerStatus were projected away here, so `describe`
|
|
110
|
+
// was strictly less informative than `plays list` for the same play — no
|
|
111
|
+
// stable key, and no way to see that a cron was armed.
|
|
112
|
+
...(play.playKey ? { playKey: play.playKey } : {}),
|
|
113
|
+
...(play.reference ? { reference: play.reference } : {}),
|
|
114
|
+
...(play.displayName ? { displayName: play.displayName } : {}),
|
|
115
|
+
...(description ? { description } : {}),
|
|
116
|
+
...(play.guidance ? { guidance: play.guidance } : {}),
|
|
117
|
+
pinned: Boolean(play.pinned),
|
|
118
|
+
toolCategories: play.toolCategories ?? [],
|
|
119
|
+
origin: play.origin,
|
|
120
|
+
ownerType: play.ownerType,
|
|
121
|
+
canEdit: play.canEdit,
|
|
122
|
+
canClone: play.canClone,
|
|
123
|
+
aliases,
|
|
124
|
+
inputSchema: options.compact
|
|
125
|
+
? compactSchema(play.inputSchema)
|
|
126
|
+
: (play.inputSchema ?? null),
|
|
127
|
+
outputSchema: options.compact
|
|
128
|
+
? compactSchema(play.outputSchema)
|
|
129
|
+
: (play.outputSchema ?? null),
|
|
130
|
+
...(options.pipeline ? { staticPipeline: staticPipeline(play) } : {}),
|
|
131
|
+
...(csvInput
|
|
132
|
+
? {
|
|
133
|
+
csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE },
|
|
134
|
+
}
|
|
135
|
+
: {}),
|
|
136
|
+
...(rowOutputSchema ? { rowOutputSchema } : {}),
|
|
137
|
+
runCommand,
|
|
138
|
+
examples: [runCommand],
|
|
139
|
+
...(starter ? { cloneEditStarter: starter } : {}),
|
|
140
|
+
currentPublishedVersion: play.currentPublishedVersion ?? null,
|
|
141
|
+
// Read the live version off the live revision. It was previously only
|
|
142
|
+
// ever written by the publish/live routes, so every list and describe
|
|
143
|
+
// payload reported liveVersion: null even for an actively serving play.
|
|
144
|
+
liveVersion: play.liveRevision?.version ?? null,
|
|
145
|
+
...(play.triggerStatus ? { triggerStatus: play.triggerStatus } : {}),
|
|
146
|
+
isDraftDirty: play.isDraftDirty,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function describePlayDetail(
|
|
151
|
+
detail: PlayDetail,
|
|
152
|
+
options: PlayDescriptionOptions = {},
|
|
153
|
+
): PlayDescription {
|
|
154
|
+
const play = detail.play;
|
|
155
|
+
return {
|
|
156
|
+
...describePlayListItem(play, options),
|
|
157
|
+
currentPublishedVersion:
|
|
158
|
+
play.currentPublishedVersion ?? play.liveRevision?.version ?? null,
|
|
159
|
+
latestRunId: play.latestRunId ?? detail.latestRuns[0]?.workflowId ?? null,
|
|
160
|
+
...(play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {}),
|
|
161
|
+
...(play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {}),
|
|
162
|
+
...(play.activeScheduledPlays
|
|
163
|
+
? { activeScheduledPlays: play.activeScheduledPlays }
|
|
164
|
+
: {}),
|
|
165
|
+
...(play.observedCost ? { observedCost: play.observedCost } : {}),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
@@ -202,7 +202,7 @@ export const SDK_RELEASE = {
|
|
|
202
202
|
// getters keep their established compatibility behavior.
|
|
203
203
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
204
204
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
205
|
-
version: '0.3.
|
|
205
|
+
version: '0.3.396',
|
|
206
206
|
updateSummary:
|
|
207
207
|
'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
|
|
208
208
|
packageCapabilities: {
|
|
@@ -1721,6 +1721,7 @@ export interface PlayDescription {
|
|
|
1721
1721
|
aliases: string[];
|
|
1722
1722
|
inputSchema?: Record<string, unknown> | null;
|
|
1723
1723
|
outputSchema?: Record<string, unknown> | null;
|
|
1724
|
+
/** The compiled pipeline; only when `describePlay(name, { pipeline: true })` asks. */
|
|
1724
1725
|
staticPipeline?: Record<string, unknown> | null;
|
|
1725
1726
|
csvInput?: Record<string, unknown> | null;
|
|
1726
1727
|
rowOutputSchema?: Record<string, unknown> | null;
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
"id": "github.fly-pr-preview-cleanup",
|
|
184
184
|
"name": "Reconcile Fly PR Preview Capacity",
|
|
185
185
|
"scheduler": "github_actions",
|
|
186
|
-
"cadence": "
|
|
186
|
+
"cadence": "*/30 * * * *",
|
|
187
187
|
"timezone": "UTC",
|
|
188
188
|
"source": ".github/workflows/fly-pr-preview-cleanup.yml",
|
|
189
189
|
"locator": "schedule:",
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
reportSetupCompleted,
|
|
14
14
|
resolvePendingAuthClaimForResume,
|
|
15
15
|
statusBannerLine
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-JCN4DHF7.mjs";
|
|
17
|
+
import "./chunk-XKZXO7D3.mjs";
|
|
18
|
+
import "./chunk-VE3U3SQC.mjs";
|
|
19
19
|
import "./chunk-DLIRSHV6.mjs";
|
|
20
20
|
import "./chunk-NXGCO4JB.mjs";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-NHB5YUCS.mjs";
|
|
22
22
|
import "./chunk-WZYKRD7T.mjs";
|
|
23
23
|
import "./chunk-KRD6H754.mjs";
|
|
24
24
|
export {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkAVHLATIIjs = require('./chunk-AVHLATII.js');
|
|
17
|
+
require('./chunk-RTO5QZWT.js');
|
|
18
|
+
require('./chunk-V7UP2F4U.js');
|
|
19
|
+
require('./chunk-XNYIZMNQ.js');
|
|
20
|
+
require('./chunk-7P5AA3SN.js');
|
|
21
|
+
require('./chunk-GNN4MY5X.js');
|
|
22
|
+
require('./chunk-OG64RBAC.js');
|
|
23
|
+
require('./chunk-COGTRVWW.js');
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkAVHLATIIjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkAVHLATIIjs.authStatusLine; exports.clearPendingClaim = _chunkAVHLATIIjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkAVHLATIIjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkAVHLATIIjs.handleRegister; exports.handleStatus = _chunkAVHLATIIjs.handleStatus; exports.handleWait = _chunkAVHLATIIjs.handleWait; exports.httpJson = _chunkAVHLATIIjs.httpJson; exports.readPendingAuthClaim = _chunkAVHLATIIjs.readPendingAuthClaim; exports.readStatusBanner = _chunkAVHLATIIjs.readStatusBanner; exports.registerAuthCommands = _chunkAVHLATIIjs.registerAuthCommands; exports.reportSetupCompleted = _chunkAVHLATIIjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkAVHLATIIjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkAVHLATIIjs.statusBannerLine;
|
|
@@ -2,9 +2,10 @@ import {
|
|
|
2
2
|
DeeplineClient,
|
|
3
3
|
iterateCursorPages,
|
|
4
4
|
requireBillingIdempotencyKey
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MR6XCBQJ.mjs";
|
|
6
6
|
import "./chunk-6IKARAYD.mjs";
|
|
7
7
|
import "./chunk-JI2B4RZP.mjs";
|
|
8
|
+
import "./chunk-EIMG75BT.mjs";
|
|
8
9
|
import "./chunk-UBKA33KY.mjs";
|
|
9
10
|
import {
|
|
10
11
|
createTimestampedName,
|
|
@@ -12,16 +13,16 @@ import {
|
|
|
12
13
|
openInBrowser,
|
|
13
14
|
printCommandEnvelope,
|
|
14
15
|
shouldEmitJson
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XKZXO7D3.mjs";
|
|
16
17
|
import {
|
|
17
18
|
AuthError,
|
|
18
19
|
ConfigError
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VE3U3SQC.mjs";
|
|
20
21
|
import "./chunk-DLIRSHV6.mjs";
|
|
21
22
|
import {
|
|
22
23
|
DeeplineError
|
|
23
24
|
} from "./chunk-NXGCO4JB.mjs";
|
|
24
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-NHB5YUCS.mjs";
|
|
25
26
|
import "./chunk-WZYKRD7T.mjs";
|
|
26
27
|
import "./chunk-KRD6H754.mjs";
|
|
27
28
|
|