deepline 0.3.522 → 0.3.524
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-core.ts +178 -60
- package/dist/bundling-sources/sdk/src/index.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +60 -14
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-delivery.ts +9 -3
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +406 -40
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/db-session-renewal.ts +209 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +16 -6
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +388 -13
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +38 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +92 -10
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +96 -25
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +29 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +139 -17
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/durable-run-sql.ts +26 -3
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +145 -5
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +190 -10
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +85 -5
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +21 -11
- package/dist/cli/auth-OKPHHMMP.js +43 -0
- package/dist/cli/{auth-YIBY5IKT.mjs → auth-QXJMVLPN.mjs} +5 -5
- package/dist/cli/{billing-UDKL53GI.js → billing-N5R4HTHT.js} +82 -82
- package/dist/cli/{billing-G3IX3SNY.mjs → billing-SNSIFM4B.mjs} +7 -7
- package/dist/cli/{chunk-EJBW7Y6Z.js → chunk-2ZWNIS54.js} +108 -96
- package/dist/cli/{chunk-3KMGVOBM.mjs → chunk-2ZX7XSAQ.mjs} +4 -4
- package/dist/cli/{chunk-4TUMKJZX.mjs → chunk-3WWTBQHC.mjs} +2 -2
- package/dist/cli/{chunk-MD524MRB.mjs → chunk-536TGWR6.mjs} +1 -1
- package/dist/cli/{chunk-37SXIFIU.js → chunk-66N76YZG.js} +44 -44
- package/dist/cli/{chunk-BZY335JP.js → chunk-7E6B7VMS.js} +5 -5
- package/dist/cli/{chunk-HYR34KFA.js → chunk-7OQGZBDG.js} +109 -24
- package/dist/cli/{chunk-GVKW3LCA.js → chunk-7QM6DNR4.js} +11 -11
- package/dist/cli/{chunk-DNJJ3ULJ.js → chunk-ANKD3AIR.js} +2 -2
- package/dist/cli/{chunk-4DFWDA2Q.js → chunk-ATATJNJ6.js} +9 -9
- package/dist/cli/{chunk-ZZ7U4YJS.mjs → chunk-BXIQD2IY.mjs} +1 -1
- package/dist/cli/{chunk-XT25FX6T.js → chunk-BXVYVIMB.js} +3 -3
- package/dist/cli/{chunk-XR6TN5DT.mjs → chunk-CH7JVSA7.mjs} +6 -6
- package/dist/cli/{chunk-RKE5YTHY.mjs → chunk-EO55Y4QW.mjs} +5 -5
- package/dist/cli/{chunk-RI672VNY.js → chunk-EQNAQENZ.js} +2 -2
- package/dist/cli/{chunk-LFSOBW7E.mjs → chunk-FXTV5B3D.mjs} +22 -10
- package/dist/cli/{chunk-C6WGMODR.mjs → chunk-GMO3JDZA.mjs} +2 -2
- package/dist/cli/{chunk-DRDZBRXV.js → chunk-GTGJBZVH.js} +7 -7
- package/dist/cli/{chunk-SFMCKB57.mjs → chunk-HLAFGQPV.mjs} +76 -34
- package/dist/cli/{chunk-534YYHIF.js → chunk-HTYT2OHB.js} +6 -6
- package/dist/cli/{chunk-ZZLZCO6Y.js → chunk-I75VRGQG.js} +22 -22
- package/dist/cli/{chunk-Y3LDRCMB.mjs → chunk-II3BJKCH.mjs} +2 -2
- package/dist/cli/{chunk-5BQPEHEP.js → chunk-JDIQBZ6O.js} +14 -14
- package/dist/cli/{chunk-ENWJFUWK.mjs → chunk-KKPBCB6D.mjs} +2 -2
- package/dist/cli/{chunk-BONXEWYF.mjs → chunk-KSQXBLRW.mjs} +3 -3
- package/dist/cli/{chunk-7JEN3FX4.js → chunk-LRWDZDBS.js} +5 -5
- package/dist/cli/{chunk-5477PEHL.mjs → chunk-MW3YMPD2.mjs} +1 -1
- package/dist/cli/{chunk-VFCVH2LV.mjs → chunk-NUC7ZVDG.mjs} +5 -5
- package/dist/cli/{chunk-DLDWAPA5.js → chunk-OCT4SUJA.js} +4 -4
- package/dist/cli/{chunk-FQQAAR3Q.mjs → chunk-OQ5G7RFQ.mjs} +1 -1
- package/dist/cli/{chunk-VIM6I7RC.js → chunk-PFKKZVFK.js} +41 -41
- package/dist/cli/{chunk-OAQIVJFY.mjs → chunk-PFKWKWUJ.mjs} +2 -2
- package/dist/cli/{chunk-52MHE7B4.mjs → chunk-R457IMHJ.mjs} +1 -1
- package/dist/cli/{chunk-UV6XCHOZ.mjs → chunk-RIX26ZJD.mjs} +1 -1
- package/dist/cli/{chunk-RDJTCW3I.mjs → chunk-RTDX5NNN.mjs} +3 -3
- package/dist/cli/{chunk-FNHUDCJE.js → chunk-RUULUCBP.js} +10 -10
- package/dist/cli/{chunk-GMYDVW7Z.js → chunk-SF4QJVBE.js} +3 -3
- package/dist/cli/{chunk-DARD7TJ7.js → chunk-SMWFOGUT.js} +53 -53
- package/dist/cli/{chunk-XXY4E57R.mjs → chunk-T43FF5PF.mjs} +2 -2
- package/dist/cli/{chunk-ZUAKRBZB.js → chunk-TZTWH53O.js} +1 -1
- package/dist/cli/{chunk-7J5PLHII.mjs → chunk-V2YIBBVT.mjs} +1 -1
- package/dist/cli/{chunk-6SJPZV5E.js → chunk-V4RJ57MA.js} +2 -2
- package/dist/cli/{chunk-4MF44THR.js → chunk-V7KUBDEB.js} +82 -40
- package/dist/cli/{chunk-ISUUSSS4.js → chunk-VHTVXS5A.js} +16 -16
- package/dist/cli/{chunk-NDNG3MAT.mjs → chunk-WCVIPZWX.mjs} +5 -5
- package/dist/cli/{chunk-F5D623KO.js → chunk-WOEPDSO3.js} +26 -26
- package/dist/cli/{chunk-VE6FHVXZ.mjs → chunk-XURWFEXM.mjs} +109 -24
- package/dist/cli/{chunk-G65FJ5JX.mjs → chunk-YCIXY66B.mjs} +2 -2
- package/dist/cli/{chunk-CFXERH7F.mjs → chunk-YGOI5ZE5.mjs} +1 -1
- package/dist/cli/{chunk-PDLRUZ42.mjs → chunk-YKFW3NNA.mjs} +5 -5
- package/dist/cli/{chunk-5H22VJPE.js → chunk-YXVYPYIP.js} +6 -6
- package/dist/cli/{chunk-KMBF3N2Z.js → chunk-Z4MOEQSY.js} +16 -16
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-PE35WGRO.mjs → csv-HT2JBCW2.mjs} +4 -4
- package/dist/cli/{csv-3HIE4VCO.js → csv-Q2LWKXAV.js} +13 -13
- package/dist/cli/{db-L7ZMMQKW.mjs → db-CS3XQ2LX.mjs} +6 -6
- package/dist/cli/{db-O2YRTTDO.js → db-XEV4WEE4.js} +27 -27
- package/dist/cli/describe-5G5NXO5E.js +50 -0
- package/dist/cli/{describe-NI324Y2M.mjs → describe-OUTXLDGZ.mjs} +18 -18
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/{executions-VH4DKLFI.js → executions-JCC34WAD.js} +8 -8
- package/dist/cli/{executions-T6KU2OKK.mjs → executions-L6XFG5MP.mjs} +6 -6
- package/dist/cli/{feedback-SCSJC3FX.mjs → feedback-AWBDO5I6.mjs} +5 -5
- package/dist/cli/{feedback-ZLC6G5OK.js → feedback-HV2M2G7N.js} +10 -10
- package/dist/cli/git-GDPTG52F.js +25 -0
- package/dist/cli/{git-I4LVQCID.mjs → git-S4LRXTRX.mjs} +5 -5
- package/dist/cli/index.js +146 -146
- package/dist/cli/index.mjs +45 -45
- package/dist/cli/{legacy-noops-44FQ2256.mjs → legacy-noops-7MOKBL4O.mjs} +6 -6
- package/dist/cli/{legacy-noops-UPFWEHPG.js → legacy-noops-RGSZUD6V.js} +9 -9
- package/dist/cli/{monitors-JN6IQGK6.js → monitors-JEFM2C5W.js} +100 -100
- package/dist/cli/{monitors-LMSASWXE.mjs → monitors-XQNXDZPQ.mjs} +7 -7
- package/dist/cli/{org-F7O3ZU5O.js → org-GYLA5V32.js} +235 -72
- package/dist/cli/{org-QYLVEE7A.mjs → org-KTMJZGTN.mjs} +169 -6
- package/dist/cli/{pages-KEL3Y4L4.js → pages-RY4U7OCL.js} +18 -18
- package/dist/cli/{pages-5XE4LBZN.mjs → pages-WOMU2T2O.mjs} +6 -6
- package/dist/cli/{play-OURHH6KV.js → play-2Q6MWJ3D.js} +363 -323
- package/dist/cli/{play-MWQG3G32.mjs → play-KOYGGNYS.mjs} +64 -24
- package/dist/cli/{providers-IQY7LUBB.mjs → providers-7YKDITJC.mjs} +6 -6
- package/dist/cli/{providers-ZCBWPE3C.js → providers-HOIRHMN2.js} +9 -9
- package/dist/cli/{quickstart-O53OXTN6.js → quickstart-OWCJOSQA.js} +6 -6
- package/dist/cli/{quickstart-L45NGRMI.mjs → quickstart-RDXHSMVX.mjs} +4 -4
- package/dist/cli/{run-W745Z3Z5.js → run-MT2ABKO5.js} +41 -41
- package/dist/cli/{run-VCSIWLEU.mjs → run-RT73NDP5.mjs} +23 -23
- package/dist/cli/search-7VBA6IGS.js +33 -0
- package/dist/cli/{search-THELKULN.mjs → search-CJPKIGSA.mjs} +8 -8
- package/dist/cli/{search-output-N7MJLYYD.mjs → search-output-AREMA544.mjs} +4 -4
- package/dist/cli/{search-output-SJW7LEOM.js → search-output-OSBZ7WK6.js} +6 -6
- package/dist/cli/{secrets-44ST3FJH.mjs → secrets-BTIY2FEJ.mjs} +6 -6
- package/dist/cli/{secrets-GDXPX3KB.js → secrets-OV6KH633.js} +15 -15
- package/dist/cli/{sessions-LYCBI77S.mjs → sessions-3CO3ZFOD.mjs} +6 -6
- package/dist/cli/sessions-B3WNEWRW.js +18 -0
- package/dist/cli/{settings-GXPDMJFG.mjs → settings-7BQIC7QN.mjs} +13 -13
- package/dist/cli/{settings-3WOFF642.js → settings-LBIECYDB.js} +86 -86
- package/dist/cli/{setup-YHLMBJP4.js → setup-QZE7QR3F.js} +50 -50
- package/dist/cli/{setup-YM6JEB64.mjs → setup-XPTSNNES.mjs} +10 -10
- package/dist/cli/{skills-WX4XWEAT.mjs → skills-TGGKIQLT.mjs} +8 -8
- package/dist/cli/skills-TXBRTWEV.js +37 -0
- package/dist/cli/{tools-K24VSQ7S.mjs → tools-MKIFX2TQ.mjs} +17 -17
- package/dist/cli/tools-RZJV4X3J.js +57 -0
- package/dist/cli/{update-PSSCF5AT.mjs → update-5R3D3WNH.mjs} +10 -10
- package/dist/cli/update-YWGGPWUA.js +35 -0
- package/dist/cli/{artifacts-RY2MK74N.mjs → views-VHKDHHUP.mjs} +76 -76
- package/dist/cli/views-VPWEINIA.js +270 -0
- package/dist/cli/{workflow-FPVI3NIA.js → workflow-7K2VEQ4V.js} +17 -17
- package/dist/cli/{workflow-DGOPYATO.mjs → workflow-D5DF65N6.mjs} +7 -7
- package/dist/{client-DA71-2_u.d.mts → client-C5_6W8yd.d.mts} +1 -1
- package/dist/{client-core-C0IzDKMJ.d.ts → client-core-B-GPfmaC.d.ts} +121 -44
- package/dist/{client-core-BXbds1cb.d.mts → client-core-Dob428Z4.d.mts} +121 -44
- package/dist/{client-B-2Am2y6.d.ts → client-iXW4TOat.d.ts} +1 -1
- package/dist/{compiler-manifest-B4mIIbw7.d.mts → compiler-manifest-DsxsQP-T.d.mts} +14 -7
- package/dist/{compiler-manifest-B4mIIbw7.d.ts → compiler-manifest-DsxsQP-T.d.ts} +14 -7
- package/dist/{errors-Gj9i5Rkd.d.ts → errors-Bk5h1D-C.d.ts} +1 -1
- package/dist/{errors-C2F4qzAq.d.mts → errors-qdJUVQ3g.d.mts} +1 -1
- package/dist/{index-5JZBufdF.d.mts → index-PaupwX1B.d.mts} +1 -1
- package/dist/{index-BXtSj8bv.d.ts → index-bL66eHYz.d.ts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +117 -116
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +7 -5
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- 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/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/artifacts-GIZZH5VA.js +0 -270
- package/dist/cli/auth-JSES2JOQ.js +0 -43
- package/dist/cli/describe-EB336DAO.js +0 -50
- package/dist/cli/git-23T7TXAH.js +0 -25
- package/dist/cli/search-R6K7ZAMU.js +0 -33
- package/dist/cli/sessions-2V5ZFOWL.js +0 -18
- package/dist/cli/skills-XNGADDO6.js +0 -37
- package/dist/cli/tools-ROUMCB7B.js +0 -57
- package/dist/cli/update-RXURGIRW.js +0 -35
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeeplineClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-YCIXY66B.mjs";
|
|
4
|
+
import "./chunk-HLAFGQPV.mjs";
|
|
5
5
|
import "./chunk-L2VKAASU.mjs";
|
|
6
6
|
import "./chunk-FKD3KL5Q.mjs";
|
|
7
7
|
import "./chunk-S3A4IXBQ.mjs";
|
|
8
8
|
import "./chunk-UBKA33KY.mjs";
|
|
9
9
|
import {
|
|
10
10
|
printCommandEnvelope
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3WWTBQHC.mjs";
|
|
12
12
|
import {
|
|
13
13
|
cliFeatureEnabled
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-MW3YMPD2.mjs";
|
|
15
|
+
import "./chunk-OQ5G7RFQ.mjs";
|
|
16
16
|
import "./chunk-QNHHZ63P.mjs";
|
|
17
17
|
import "./chunk-DLIRSHV6.mjs";
|
|
18
18
|
import "./chunk-ZPGGW27Q.mjs";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-RIX26ZJD.mjs";
|
|
20
20
|
import "./chunk-WZYKRD7T.mjs";
|
|
21
21
|
import "./chunk-KRD6H754.mjs";
|
|
22
22
|
|
|
23
|
-
// src/cli/commands/
|
|
23
|
+
// src/cli/commands/views.ts
|
|
24
24
|
import { readFile } from "fs/promises";
|
|
25
|
-
var
|
|
25
|
+
var VIEWS_FEATURE = "views";
|
|
26
26
|
function print(command, json, data, lines) {
|
|
27
27
|
printCommandEnvelope(
|
|
28
28
|
{ command, ...data, render: { sections: [{ title: command, lines }] } },
|
|
@@ -47,66 +47,66 @@ async function readJsonOption(value, flag) {
|
|
|
47
47
|
throw new Error(`${flag} takes JSON, or @path to a JSON file.`);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function viewLines(view) {
|
|
51
51
|
return [
|
|
52
|
-
|
|
53
|
-
` ${
|
|
54
|
-
` id ${
|
|
55
|
-
...
|
|
52
|
+
view.name,
|
|
53
|
+
` ${view.url}`,
|
|
54
|
+
` id ${view.id} \xB7 Play ${view.play} \xB7 ${view.access === "public" ? "public" : "workspace members"}`,
|
|
55
|
+
...view.description ? [` ${view.description}`] : []
|
|
56
56
|
];
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
const
|
|
60
|
-
"Show what a Play returns at a fixed URL on
|
|
58
|
+
function registerViewsCommands(program) {
|
|
59
|
+
const views = program.command("views", { hidden: !cliFeatureEnabled(VIEWS_FEATURE) }).description(
|
|
60
|
+
"Show what a Play returns at a fixed URL on views.deepline.com."
|
|
61
61
|
).addHelpText(
|
|
62
62
|
"after",
|
|
63
63
|
`
|
|
64
64
|
Examples:
|
|
65
|
-
deepline
|
|
66
|
-
deepline
|
|
67
|
-
deepline
|
|
65
|
+
deepline views create --name "Pipeline" --play score-accounts
|
|
66
|
+
deepline views refresh <id>
|
|
67
|
+
deepline views set-access <id> public
|
|
68
68
|
`
|
|
69
69
|
);
|
|
70
|
-
|
|
70
|
+
views.command("list").description("List this workspace's views.").option("--cursor <cursor>", "Continue from a previous page of results").option("--limit <n>", "Results per request, up to 100", Number).option("--json", "Emit raw JSON response").action(
|
|
71
71
|
async (options) => run(async () => {
|
|
72
|
-
const result = await new DeeplineClient().
|
|
72
|
+
const result = await new DeeplineClient().listViews({
|
|
73
73
|
cursor: options.cursor,
|
|
74
74
|
limit: options.limit
|
|
75
75
|
});
|
|
76
|
-
print("
|
|
77
|
-
...result.
|
|
78
|
-
"No
|
|
76
|
+
print("views list", options.json, result, [
|
|
77
|
+
...result.views.length === 0 ? [
|
|
78
|
+
"No views yet. Create one: deepline views create --name <name> --play <play>"
|
|
79
79
|
] : [],
|
|
80
|
-
...result.
|
|
80
|
+
...result.views.flatMap(viewLines),
|
|
81
81
|
...result.next_cursor ? [`More: --cursor ${result.next_cursor}`] : []
|
|
82
82
|
]);
|
|
83
83
|
})
|
|
84
84
|
);
|
|
85
|
-
|
|
85
|
+
views.command("get <id>").description("Show one view and what you may do with it.").option("--json", "Emit raw JSON response").action(
|
|
86
86
|
async (id, options) => run(async () => {
|
|
87
|
-
const
|
|
88
|
-
print("
|
|
89
|
-
...
|
|
90
|
-
` saved input ${JSON.stringify(
|
|
87
|
+
const view = await new DeeplineClient().getView(id);
|
|
88
|
+
print("views get", options.json, view, [
|
|
89
|
+
...viewLines(view),
|
|
90
|
+
` saved input ${JSON.stringify(view.input)}`
|
|
91
91
|
]);
|
|
92
92
|
})
|
|
93
93
|
);
|
|
94
|
-
|
|
94
|
+
views.command("create").description("Create a view that shows a Play's runs at a fixed URL.").requiredOption("--name <name>", "View name").requiredOption(
|
|
95
95
|
"--play <play>",
|
|
96
96
|
"Play in this workspace, or prebuilt/<name>"
|
|
97
97
|
).option(
|
|
98
98
|
"--input <json>",
|
|
99
99
|
"Saved input Refresh runs the Play with (JSON or @file)"
|
|
100
|
-
).option("--description <text>", "What the
|
|
100
|
+
).option("--description <text>", "What the view is").option("--json", "Emit raw JSON response").addHelpText(
|
|
101
101
|
"after",
|
|
102
102
|
`
|
|
103
103
|
Examples:
|
|
104
|
-
deepline
|
|
105
|
-
deepline
|
|
104
|
+
deepline views create --name "Pipeline" --play score-accounts
|
|
105
|
+
deepline views create --name "Brief" --play meeting-brief --input '{"team":"Growth"}'
|
|
106
106
|
`
|
|
107
107
|
).action(
|
|
108
108
|
async (options) => run(async () => {
|
|
109
|
-
const
|
|
109
|
+
const view = await new DeeplineClient().createView({
|
|
110
110
|
name: options.name,
|
|
111
111
|
play: options.play,
|
|
112
112
|
...options.input !== void 0 ? {
|
|
@@ -117,18 +117,18 @@ Examples:
|
|
|
117
117
|
} : {},
|
|
118
118
|
...options.description ? { description: options.description } : {}
|
|
119
119
|
});
|
|
120
|
-
print("
|
|
121
|
-
`Created ${
|
|
122
|
-
...
|
|
120
|
+
print("views create", options.json, view, [
|
|
121
|
+
`Created ${view.name}`,
|
|
122
|
+
...viewLines(view)
|
|
123
123
|
]);
|
|
124
124
|
})
|
|
125
125
|
);
|
|
126
|
-
|
|
127
|
-
"Change
|
|
126
|
+
views.command("edit <id>").description(
|
|
127
|
+
"Change a view's name, Play, saved input, or description."
|
|
128
128
|
).option("--name <name>", "New name").option("--play <play>", "Play in this workspace, or prebuilt/<name>").option(
|
|
129
129
|
"--input <json>",
|
|
130
130
|
"Saved input Refresh runs the Play with (JSON or @file)"
|
|
131
|
-
).option("--description <text>", "What the
|
|
131
|
+
).option("--description <text>", "What the view is").option("--json", "Emit raw JSON response").action(
|
|
132
132
|
async (id, options) => run(async () => {
|
|
133
133
|
const fields = {
|
|
134
134
|
...options.name !== void 0 ? { name: options.name } : {},
|
|
@@ -143,80 +143,80 @@ Examples:
|
|
|
143
143
|
};
|
|
144
144
|
if (Object.keys(fields).length === 0) {
|
|
145
145
|
throw new Error(
|
|
146
|
-
"Nothing to change. See: deepline
|
|
146
|
+
"Nothing to change. See: deepline views edit --help"
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const view = await new DeeplineClient().updateView(id, fields);
|
|
150
150
|
print(
|
|
151
|
-
"
|
|
151
|
+
"views edit",
|
|
152
152
|
options.json,
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
view,
|
|
154
|
+
viewLines(view)
|
|
155
155
|
);
|
|
156
156
|
})
|
|
157
157
|
);
|
|
158
|
-
|
|
158
|
+
views.command("runs <id>").description("List runs of the view's Play, newest first.").option("--limit <n>", "Runs to list, up to 100", Number).option("--json", "Emit raw JSON response").action(
|
|
159
159
|
async (id, options) => run(async () => {
|
|
160
|
-
const result = await new DeeplineClient().
|
|
160
|
+
const result = await new DeeplineClient().listViewRuns(id, {
|
|
161
161
|
limit: options.limit
|
|
162
162
|
});
|
|
163
|
-
print("
|
|
164
|
-
...result.runs.length === 0 ? ["No runs yet. Run: deepline
|
|
163
|
+
print("views runs", options.json, result, [
|
|
164
|
+
...result.runs.length === 0 ? ["No runs yet. Run: deepline views refresh " + id] : [],
|
|
165
165
|
...result.runs.map(
|
|
166
166
|
(r) => `${r.run_id} ${r.status} ${new Date(r.finished_at ?? r.created_at).toISOString()}`
|
|
167
167
|
)
|
|
168
168
|
]);
|
|
169
169
|
})
|
|
170
170
|
);
|
|
171
|
-
|
|
172
|
-
"Run the
|
|
171
|
+
views.command("refresh <id>").description(
|
|
172
|
+
"Run the view's Play. The view shows the run when it finishes."
|
|
173
173
|
).option(
|
|
174
174
|
"--input <json>",
|
|
175
|
-
"Input for this run instead of the
|
|
175
|
+
"Input for this run instead of the view's saved input"
|
|
176
176
|
).option("--json", "Emit raw JSON response").action(
|
|
177
177
|
async (id, options) => run(async () => {
|
|
178
178
|
const input = options.input !== void 0 ? await readJsonOption(options.input, "--input") : void 0;
|
|
179
|
-
const started = await new DeeplineClient().
|
|
180
|
-
print("
|
|
179
|
+
const started = await new DeeplineClient().refreshView(id, input);
|
|
180
|
+
print("views refresh", options.json, started, [
|
|
181
181
|
`Started run ${started.workflowId}.`,
|
|
182
182
|
`Watch it: deepline runs get ${started.workflowId}`
|
|
183
183
|
]);
|
|
184
184
|
})
|
|
185
185
|
);
|
|
186
|
-
|
|
187
|
-
"Choose who can open
|
|
186
|
+
views.command("set-access <id> <access>").description(
|
|
187
|
+
"Choose who can open a view: workspace or public. Public shows every run of its Play to anyone with the link."
|
|
188
188
|
).option("--json", "Emit raw JSON response").action(
|
|
189
189
|
async (id, access, options) => run(async () => {
|
|
190
190
|
if (access !== "workspace" && access !== "public") {
|
|
191
191
|
throw new Error("Access is workspace or public.");
|
|
192
192
|
}
|
|
193
|
-
const
|
|
193
|
+
const view = await new DeeplineClient().setViewAccess(
|
|
194
194
|
id,
|
|
195
195
|
access
|
|
196
196
|
);
|
|
197
197
|
print(
|
|
198
|
-
"
|
|
198
|
+
"views set-access",
|
|
199
199
|
options.json,
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
view,
|
|
201
|
+
viewLines(view)
|
|
202
202
|
);
|
|
203
203
|
})
|
|
204
204
|
);
|
|
205
|
-
|
|
205
|
+
views.command("delete <id>").description("Delete a view. Its Play and runs are not touched.").option("--json", "Emit raw JSON response").action(
|
|
206
206
|
async (id, options) => run(async () => {
|
|
207
|
-
const result = await new DeeplineClient().
|
|
208
|
-
print("
|
|
209
|
-
`Deleted
|
|
207
|
+
const result = await new DeeplineClient().deleteView(id);
|
|
208
|
+
print("views delete", options.json, result, [
|
|
209
|
+
`Deleted view ${id}.`
|
|
210
210
|
]);
|
|
211
211
|
})
|
|
212
212
|
);
|
|
213
|
-
const permissions =
|
|
214
|
-
"Show or change who may create, edit, delete, publish, and refresh
|
|
213
|
+
const permissions = views.command("permissions").description(
|
|
214
|
+
"Show or change who may create, edit, delete, publish, and refresh views."
|
|
215
215
|
);
|
|
216
|
-
permissions.command("get", { isDefault: true }).description("Show the workspace's
|
|
216
|
+
permissions.command("get", { isDefault: true }).description("Show the workspace's view rules and what you may do.").option("--json", "Emit raw JSON response").action(
|
|
217
217
|
async (options) => run(async () => {
|
|
218
|
-
const result = await new DeeplineClient().
|
|
219
|
-
print("
|
|
218
|
+
const result = await new DeeplineClient().getViewPermissions();
|
|
219
|
+
print("views permissions", options.json, result, [
|
|
220
220
|
...Object.entries(result.rules).map(
|
|
221
221
|
([verb, level]) => `${verb}: ${level}`
|
|
222
222
|
),
|
|
@@ -234,8 +234,8 @@ Examples:
|
|
|
234
234
|
"refresh"
|
|
235
235
|
];
|
|
236
236
|
permissions.command("set").description(
|
|
237
|
-
"Change
|
|
238
|
-
).option("--create <level>", "Create
|
|
237
|
+
"Change view rules (admins only). Each is members or admins."
|
|
238
|
+
).option("--create <level>", "Create views").option("--edit <level>", "Edit views").option("--delete <level>", "Delete views").option("--set-access <level>", "Make views public or workspace-only").option("--refresh <level>", "Refresh views and start Plays from them").option("--json", "Emit raw JSON response").action(
|
|
239
239
|
async (options) => run(async () => {
|
|
240
240
|
const rules = {};
|
|
241
241
|
for (const verb of verbs) {
|
|
@@ -250,12 +250,12 @@ Examples:
|
|
|
250
250
|
}
|
|
251
251
|
if (Object.keys(rules).length === 0) {
|
|
252
252
|
throw new Error(
|
|
253
|
-
"Pass at least one rule. See: deepline
|
|
253
|
+
"Pass at least one rule. See: deepline views permissions set --help"
|
|
254
254
|
);
|
|
255
255
|
}
|
|
256
|
-
const result = await new DeeplineClient().
|
|
256
|
+
const result = await new DeeplineClient().setViewPermissions(rules);
|
|
257
257
|
print(
|
|
258
|
-
"
|
|
258
|
+
"views permissions set",
|
|
259
259
|
options.json,
|
|
260
260
|
result,
|
|
261
261
|
Object.entries(result.rules).map(
|
|
@@ -266,5 +266,5 @@ Examples:
|
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
268
|
export {
|
|
269
|
-
|
|
269
|
+
registerViewsCommands
|
|
270
270
|
};
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _chunkLRWDZDBSjs = require('./chunk-LRWDZDBS.js');
|
|
4
|
+
require('./chunk-V7KUBDEB.js');
|
|
5
|
+
require('./chunk-E4CABWXL.js');
|
|
6
|
+
require('./chunk-2KHUFWTK.js');
|
|
7
|
+
require('./chunk-NMU3VR5U.js');
|
|
8
|
+
require('./chunk-XDVT3GOM.js');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkGTGJBZVHjs = require('./chunk-GTGJBZVH.js');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkSF4QJVBEjs = require('./chunk-SF4QJVBE.js');
|
|
15
|
+
require('./chunk-OCT4SUJA.js');
|
|
16
|
+
require('./chunk-T2N3B7IQ.js');
|
|
17
|
+
require('./chunk-XNYIZMNQ.js');
|
|
18
|
+
require('./chunk-SQWET4SL.js');
|
|
19
|
+
require('./chunk-TZTWH53O.js');
|
|
20
|
+
require('./chunk-OG64RBAC.js');
|
|
21
|
+
require('./chunk-COGTRVWW.js');
|
|
22
|
+
|
|
23
|
+
// src/cli/commands/views.ts
|
|
24
|
+
var _promises = require('fs/promises');
|
|
25
|
+
var VIEWS_FEATURE = "views";
|
|
26
|
+
function print(command, json, data, lines) {
|
|
27
|
+
_chunkGTGJBZVHjs.printCommandEnvelope.call(void 0,
|
|
28
|
+
{ command, ...data, render: { sections: [{ title: command, lines }] } },
|
|
29
|
+
{ json: Boolean(json), text: `${lines.join("\n")}
|
|
30
|
+
` }
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
async function run(action) {
|
|
34
|
+
try {
|
|
35
|
+
await action();
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
38
|
+
process.exitCode = 1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async function readJsonOption(value, flag) {
|
|
42
|
+
if (value === void 0) return void 0;
|
|
43
|
+
const text = value.startsWith("@") ? await _promises.readFile.call(void 0, value.slice(1), "utf8") : value;
|
|
44
|
+
try {
|
|
45
|
+
return JSON.parse(text);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
throw new Error(`${flag} takes JSON, or @path to a JSON file.`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function viewLines(view) {
|
|
51
|
+
return [
|
|
52
|
+
view.name,
|
|
53
|
+
` ${view.url}`,
|
|
54
|
+
` id ${view.id} \xB7 Play ${view.play} \xB7 ${view.access === "public" ? "public" : "workspace members"}`,
|
|
55
|
+
...view.description ? [` ${view.description}`] : []
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
function registerViewsCommands(program) {
|
|
59
|
+
const views = program.command("views", { hidden: !_chunkSF4QJVBEjs.cliFeatureEnabled.call(void 0, VIEWS_FEATURE) }).description(
|
|
60
|
+
"Show what a Play returns at a fixed URL on views.deepline.com."
|
|
61
|
+
).addHelpText(
|
|
62
|
+
"after",
|
|
63
|
+
`
|
|
64
|
+
Examples:
|
|
65
|
+
deepline views create --name "Pipeline" --play score-accounts
|
|
66
|
+
deepline views refresh <id>
|
|
67
|
+
deepline views set-access <id> public
|
|
68
|
+
`
|
|
69
|
+
);
|
|
70
|
+
views.command("list").description("List this workspace's views.").option("--cursor <cursor>", "Continue from a previous page of results").option("--limit <n>", "Results per request, up to 100", Number).option("--json", "Emit raw JSON response").action(
|
|
71
|
+
async (options) => run(async () => {
|
|
72
|
+
const result = await new (0, _chunkLRWDZDBSjs.DeeplineClient)().listViews({
|
|
73
|
+
cursor: options.cursor,
|
|
74
|
+
limit: options.limit
|
|
75
|
+
});
|
|
76
|
+
print("views list", options.json, result, [
|
|
77
|
+
...result.views.length === 0 ? [
|
|
78
|
+
"No views yet. Create one: deepline views create --name <name> --play <play>"
|
|
79
|
+
] : [],
|
|
80
|
+
...result.views.flatMap(viewLines),
|
|
81
|
+
...result.next_cursor ? [`More: --cursor ${result.next_cursor}`] : []
|
|
82
|
+
]);
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
views.command("get <id>").description("Show one view and what you may do with it.").option("--json", "Emit raw JSON response").action(
|
|
86
|
+
async (id, options) => run(async () => {
|
|
87
|
+
const view = await new (0, _chunkLRWDZDBSjs.DeeplineClient)().getView(id);
|
|
88
|
+
print("views get", options.json, view, [
|
|
89
|
+
...viewLines(view),
|
|
90
|
+
` saved input ${JSON.stringify(view.input)}`
|
|
91
|
+
]);
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
views.command("create").description("Create a view that shows a Play's runs at a fixed URL.").requiredOption("--name <name>", "View name").requiredOption(
|
|
95
|
+
"--play <play>",
|
|
96
|
+
"Play in this workspace, or prebuilt/<name>"
|
|
97
|
+
).option(
|
|
98
|
+
"--input <json>",
|
|
99
|
+
"Saved input Refresh runs the Play with (JSON or @file)"
|
|
100
|
+
).option("--description <text>", "What the view is").option("--json", "Emit raw JSON response").addHelpText(
|
|
101
|
+
"after",
|
|
102
|
+
`
|
|
103
|
+
Examples:
|
|
104
|
+
deepline views create --name "Pipeline" --play score-accounts
|
|
105
|
+
deepline views create --name "Brief" --play meeting-brief --input '{"team":"Growth"}'
|
|
106
|
+
`
|
|
107
|
+
).action(
|
|
108
|
+
async (options) => run(async () => {
|
|
109
|
+
const view = await new (0, _chunkLRWDZDBSjs.DeeplineClient)().createView({
|
|
110
|
+
name: options.name,
|
|
111
|
+
play: options.play,
|
|
112
|
+
...options.input !== void 0 ? {
|
|
113
|
+
input: await readJsonOption(
|
|
114
|
+
options.input,
|
|
115
|
+
"--input"
|
|
116
|
+
)
|
|
117
|
+
} : {},
|
|
118
|
+
...options.description ? { description: options.description } : {}
|
|
119
|
+
});
|
|
120
|
+
print("views create", options.json, view, [
|
|
121
|
+
`Created ${view.name}`,
|
|
122
|
+
...viewLines(view)
|
|
123
|
+
]);
|
|
124
|
+
})
|
|
125
|
+
);
|
|
126
|
+
views.command("edit <id>").description(
|
|
127
|
+
"Change a view's name, Play, saved input, or description."
|
|
128
|
+
).option("--name <name>", "New name").option("--play <play>", "Play in this workspace, or prebuilt/<name>").option(
|
|
129
|
+
"--input <json>",
|
|
130
|
+
"Saved input Refresh runs the Play with (JSON or @file)"
|
|
131
|
+
).option("--description <text>", "What the view is").option("--json", "Emit raw JSON response").action(
|
|
132
|
+
async (id, options) => run(async () => {
|
|
133
|
+
const fields = {
|
|
134
|
+
...options.name !== void 0 ? { name: options.name } : {},
|
|
135
|
+
...options.play !== void 0 ? { play: options.play } : {},
|
|
136
|
+
...options.description !== void 0 ? { description: options.description } : {},
|
|
137
|
+
...options.input !== void 0 ? {
|
|
138
|
+
input: await readJsonOption(
|
|
139
|
+
options.input,
|
|
140
|
+
"--input"
|
|
141
|
+
)
|
|
142
|
+
} : {}
|
|
143
|
+
};
|
|
144
|
+
if (Object.keys(fields).length === 0) {
|
|
145
|
+
throw new Error(
|
|
146
|
+
"Nothing to change. See: deepline views edit --help"
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
const view = await new (0, _chunkLRWDZDBSjs.DeeplineClient)().updateView(id, fields);
|
|
150
|
+
print(
|
|
151
|
+
"views edit",
|
|
152
|
+
options.json,
|
|
153
|
+
view,
|
|
154
|
+
viewLines(view)
|
|
155
|
+
);
|
|
156
|
+
})
|
|
157
|
+
);
|
|
158
|
+
views.command("runs <id>").description("List runs of the view's Play, newest first.").option("--limit <n>", "Runs to list, up to 100", Number).option("--json", "Emit raw JSON response").action(
|
|
159
|
+
async (id, options) => run(async () => {
|
|
160
|
+
const result = await new (0, _chunkLRWDZDBSjs.DeeplineClient)().listViewRuns(id, {
|
|
161
|
+
limit: options.limit
|
|
162
|
+
});
|
|
163
|
+
print("views runs", options.json, result, [
|
|
164
|
+
...result.runs.length === 0 ? ["No runs yet. Run: deepline views refresh " + id] : [],
|
|
165
|
+
...result.runs.map(
|
|
166
|
+
(r) => `${r.run_id} ${r.status} ${new Date(_nullishCoalesce(r.finished_at, () => ( r.created_at))).toISOString()}`
|
|
167
|
+
)
|
|
168
|
+
]);
|
|
169
|
+
})
|
|
170
|
+
);
|
|
171
|
+
views.command("refresh <id>").description(
|
|
172
|
+
"Run the view's Play. The view shows the run when it finishes."
|
|
173
|
+
).option(
|
|
174
|
+
"--input <json>",
|
|
175
|
+
"Input for this run instead of the view's saved input"
|
|
176
|
+
).option("--json", "Emit raw JSON response").action(
|
|
177
|
+
async (id, options) => run(async () => {
|
|
178
|
+
const input = options.input !== void 0 ? await readJsonOption(options.input, "--input") : void 0;
|
|
179
|
+
const started = await new (0, _chunkLRWDZDBSjs.DeeplineClient)().refreshView(id, input);
|
|
180
|
+
print("views refresh", options.json, started, [
|
|
181
|
+
`Started run ${started.workflowId}.`,
|
|
182
|
+
`Watch it: deepline runs get ${started.workflowId}`
|
|
183
|
+
]);
|
|
184
|
+
})
|
|
185
|
+
);
|
|
186
|
+
views.command("set-access <id> <access>").description(
|
|
187
|
+
"Choose who can open a view: workspace or public. Public shows every run of its Play to anyone with the link."
|
|
188
|
+
).option("--json", "Emit raw JSON response").action(
|
|
189
|
+
async (id, access, options) => run(async () => {
|
|
190
|
+
if (access !== "workspace" && access !== "public") {
|
|
191
|
+
throw new Error("Access is workspace or public.");
|
|
192
|
+
}
|
|
193
|
+
const view = await new (0, _chunkLRWDZDBSjs.DeeplineClient)().setViewAccess(
|
|
194
|
+
id,
|
|
195
|
+
access
|
|
196
|
+
);
|
|
197
|
+
print(
|
|
198
|
+
"views set-access",
|
|
199
|
+
options.json,
|
|
200
|
+
view,
|
|
201
|
+
viewLines(view)
|
|
202
|
+
);
|
|
203
|
+
})
|
|
204
|
+
);
|
|
205
|
+
views.command("delete <id>").description("Delete a view. Its Play and runs are not touched.").option("--json", "Emit raw JSON response").action(
|
|
206
|
+
async (id, options) => run(async () => {
|
|
207
|
+
const result = await new (0, _chunkLRWDZDBSjs.DeeplineClient)().deleteView(id);
|
|
208
|
+
print("views delete", options.json, result, [
|
|
209
|
+
`Deleted view ${id}.`
|
|
210
|
+
]);
|
|
211
|
+
})
|
|
212
|
+
);
|
|
213
|
+
const permissions = views.command("permissions").description(
|
|
214
|
+
"Show or change who may create, edit, delete, publish, and refresh views."
|
|
215
|
+
);
|
|
216
|
+
permissions.command("get", { isDefault: true }).description("Show the workspace's view rules and what you may do.").option("--json", "Emit raw JSON response").action(
|
|
217
|
+
async (options) => run(async () => {
|
|
218
|
+
const result = await new (0, _chunkLRWDZDBSjs.DeeplineClient)().getViewPermissions();
|
|
219
|
+
print("views permissions", options.json, result, [
|
|
220
|
+
...Object.entries(result.rules).map(
|
|
221
|
+
([verb, level]) => `${verb}: ${level}`
|
|
222
|
+
),
|
|
223
|
+
...result.can ? [
|
|
224
|
+
`you may: ${Object.entries(result.can).filter(([, ok]) => ok).map(([verb]) => verb).join(", ") || "view only"}`
|
|
225
|
+
] : []
|
|
226
|
+
]);
|
|
227
|
+
})
|
|
228
|
+
);
|
|
229
|
+
const verbs = [
|
|
230
|
+
"create",
|
|
231
|
+
"edit",
|
|
232
|
+
"delete",
|
|
233
|
+
"setAccess",
|
|
234
|
+
"refresh"
|
|
235
|
+
];
|
|
236
|
+
permissions.command("set").description(
|
|
237
|
+
"Change view rules (admins only). Each is members or admins."
|
|
238
|
+
).option("--create <level>", "Create views").option("--edit <level>", "Edit views").option("--delete <level>", "Delete views").option("--set-access <level>", "Make views public or workspace-only").option("--refresh <level>", "Refresh views and start Plays from them").option("--json", "Emit raw JSON response").action(
|
|
239
|
+
async (options) => run(async () => {
|
|
240
|
+
const rules = {};
|
|
241
|
+
for (const verb of verbs) {
|
|
242
|
+
const value = options[verb];
|
|
243
|
+
if (value === void 0) continue;
|
|
244
|
+
if (value !== "members" && value !== "admins") {
|
|
245
|
+
throw new Error(
|
|
246
|
+
`--${verb === "setAccess" ? "set-access" : verb} is members or admins.`
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
rules[verb] = value;
|
|
250
|
+
}
|
|
251
|
+
if (Object.keys(rules).length === 0) {
|
|
252
|
+
throw new Error(
|
|
253
|
+
"Pass at least one rule. See: deepline views permissions set --help"
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
const result = await new (0, _chunkLRWDZDBSjs.DeeplineClient)().setViewPermissions(rules);
|
|
257
|
+
print(
|
|
258
|
+
"views permissions set",
|
|
259
|
+
options.json,
|
|
260
|
+
result,
|
|
261
|
+
Object.entries(result.rules).map(
|
|
262
|
+
([verb, level]) => `${verb}: ${level}`
|
|
263
|
+
)
|
|
264
|
+
);
|
|
265
|
+
})
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
exports.registerViewsCommands = registerViewsCommands;
|