deepline 0.3.510 → 0.3.512

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.
Files changed (151) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +159 -0
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +39 -3
  4. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +2 -0
  5. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +9 -3
  6. package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +35 -3
  7. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +4 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +241 -34
  9. package/dist/cli/artifacts-5IGM3EYP.js +268 -0
  10. package/dist/cli/artifacts-YSYWQFQQ.mjs +268 -0
  11. package/dist/cli/{auth-USS2W3UV.mjs → auth-4MVWCUXS.mjs} +5 -5
  12. package/dist/cli/auth-M3AJBJ3O.js +43 -0
  13. package/dist/cli/{billing-LQQHU443.js → billing-OYYHWNVS.js} +82 -82
  14. package/dist/cli/{billing-JCUWM5XB.mjs → billing-SZXRENPC.mjs} +7 -7
  15. package/dist/cli/{chunk-RHKFNEV2.mjs → chunk-2BS6BRGH.mjs} +2 -2
  16. package/dist/cli/{chunk-WAOLTP6R.mjs → chunk-2R6M62UO.mjs} +2 -2
  17. package/dist/cli/{chunk-YYUVOUEH.mjs → chunk-32UMZXCZ.mjs} +5 -5
  18. package/dist/cli/{chunk-7BF4R26M.mjs → chunk-3INAN6EK.mjs} +3 -3
  19. package/dist/cli/{chunk-BPGFNVH2.js → chunk-4DSRBHN6.js} +44 -44
  20. package/dist/cli/{chunk-EEQ2QQOH.js → chunk-4QR64X2S.js} +10 -10
  21. package/dist/cli/{chunk-JY73USD7.js → chunk-4ZDHGAE6.js} +2 -2
  22. package/dist/cli/{chunk-KXSOZYCS.mjs → chunk-5XLU47DG.mjs} +1 -1
  23. package/dist/cli/{chunk-ZRACZKEE.mjs → chunk-77DPQI6W.mjs} +62 -0
  24. package/dist/cli/{chunk-YDALHHUC.js → chunk-7U3WY2F3.js} +53 -53
  25. package/dist/cli/{chunk-DMF56C6D.mjs → chunk-AATUAFD2.mjs} +2 -2
  26. package/dist/cli/{chunk-XJZU7KO4.js → chunk-AVYI522S.js} +5 -5
  27. package/dist/cli/{chunk-LF3FF2B2.js → chunk-BP4XEO6Z.js} +1 -1
  28. package/dist/cli/{chunk-7VT7RMZ2.mjs → chunk-DJ4FD5DR.mjs} +2 -2
  29. package/dist/cli/{chunk-CLV4T5FN.mjs → chunk-EQAKPIGI.mjs} +2 -2
  30. package/dist/cli/{chunk-XK3AJFYQ.js → chunk-FF25PDQ2.js} +62 -0
  31. package/dist/cli/{chunk-B6Q6BHSY.mjs → chunk-FJPJ6SO3.mjs} +2 -2
  32. package/dist/cli/{chunk-UV524JZ5.mjs → chunk-GJMIW4Q6.mjs} +1 -1
  33. package/dist/cli/{chunk-5MYXW6M6.mjs → chunk-HA5NSCTH.mjs} +2 -2
  34. package/dist/cli/{chunk-63DHG7BM.js → chunk-HCMFRAYT.js} +26 -26
  35. package/dist/cli/{chunk-FND6GZZ4.mjs → chunk-I6OK54YK.mjs} +5 -5
  36. package/dist/cli/{chunk-F6IXWFPF.js → chunk-IMC2HQ6V.js} +6 -6
  37. package/dist/cli/{chunk-DEPBCRKG.mjs → chunk-JDD6OLWN.mjs} +3 -3
  38. package/dist/cli/{chunk-EJ57CA2L.mjs → chunk-JH7JISQ2.mjs} +1 -1
  39. package/dist/cli/{chunk-XRLE2FPE.js → chunk-JKLFRDQ6.js} +6 -6
  40. package/dist/cli/{chunk-7VQKU6MS.js → chunk-JU35QU3Z.js} +270 -199
  41. package/dist/cli/{chunk-ZCYV6MZH.js → chunk-KBM5T6UV.js} +5 -5
  42. package/dist/cli/{chunk-VPJSQMWQ.js → chunk-L7CAOWHY.js} +3 -3
  43. package/dist/cli/{chunk-B2U3LVSO.mjs → chunk-LYOWQKGN.mjs} +1 -1
  44. package/dist/cli/{chunk-HOKOJGQW.mjs → chunk-MQ5GBB7V.mjs} +1 -1
  45. package/dist/cli/{chunk-OEG6VCK4.mjs → chunk-MTSHUN2R.mjs} +72 -1
  46. package/dist/cli/{chunk-ASBWPRBN.js → chunk-O24VWLOY.js} +16 -16
  47. package/dist/cli/{chunk-HC27PYJM.js → chunk-OU6AK63V.js} +2 -2
  48. package/dist/cli/{chunk-563HM4D2.mjs → chunk-P3RYPSOQ.mjs} +6 -6
  49. package/dist/cli/{chunk-6AL2VF3E.js → chunk-PJCPFF7J.js} +14 -14
  50. package/dist/cli/{chunk-4ZIIS6KG.js → chunk-Q72Q3ZWB.js} +9 -9
  51. package/dist/cli/{chunk-JNECQ5QF.js → chunk-RR6G6ZCT.js} +11 -11
  52. package/dist/cli/{chunk-Q5EJO4TE.mjs → chunk-RXZRZEW7.mjs} +5 -5
  53. package/dist/cli/{chunk-WC5754QJ.mjs → chunk-T3SUWKUT.mjs} +5 -5
  54. package/dist/cli/{chunk-QRQBKLOM.js → chunk-TKN2TRW5.js} +3 -3
  55. package/dist/cli/{chunk-PQ56GE55.mjs → chunk-TNQ5MF6K.mjs} +1 -1
  56. package/dist/cli/{chunk-B2T7PBS6.js → chunk-V6FQRUPJ.js} +41 -41
  57. package/dist/cli/{chunk-3LXU22UZ.js → chunk-VGCNLFER.js} +2 -2
  58. package/dist/cli/{chunk-XL4FFVWL.js → chunk-VZN6D23P.js} +7 -7
  59. package/dist/cli/{chunk-5N2HFB3G.js → chunk-W7DAWILZ.js} +16 -16
  60. package/dist/cli/{chunk-2JXEZAJF.js → chunk-WDCOUJQ5.js} +21 -21
  61. package/dist/cli/{chunk-FFPLCSTZ.mjs → chunk-XKFWY4IK.mjs} +10 -10
  62. package/dist/cli/{chunk-V6DLYRSO.mjs → chunk-YJN55ZWG.mjs} +1 -1
  63. package/dist/cli/{chunk-JVEU6MXD.mjs → chunk-YNMHIJC5.mjs} +1 -1
  64. package/dist/cli/{chunk-N7FV7OM3.js → chunk-ZLHIQU2G.js} +96 -96
  65. package/dist/cli/{chunk-5DU7RXDW.mjs → chunk-ZVYMGTZ7.mjs} +4 -4
  66. package/dist/cli/{chunk-4NJK6P5T.js → chunk-ZZ7SVWKR.js} +4 -4
  67. package/dist/cli/command-docs.js +2 -2
  68. package/dist/cli/command-docs.mjs +1 -1
  69. package/dist/cli/{csv-MTFVEDPU.mjs → csv-AY4KT3NZ.mjs} +4 -4
  70. package/dist/cli/{csv-UXFQZLZM.js → csv-YR2E5HNM.js} +13 -13
  71. package/dist/cli/{db-3WPUYCCI.mjs → db-IMYD3OCM.mjs} +6 -6
  72. package/dist/cli/{db-RGWT6B7K.js → db-YKV6564I.js} +27 -27
  73. package/dist/cli/{describe-XJY5654F.mjs → describe-72GI2Q6T.mjs} +18 -18
  74. package/dist/cli/describe-UFGHQBM7.js +50 -0
  75. package/dist/cli/describe-core.d.mts +2 -2
  76. package/dist/cli/describe-core.d.ts +2 -2
  77. package/dist/cli/{executions-PDE4V5YH.mjs → executions-2YO6KIP3.mjs} +6 -6
  78. package/dist/cli/{executions-IWTALFNB.js → executions-OSNL5CSU.js} +8 -8
  79. package/dist/cli/{feedback-BMOVTPC4.mjs → feedback-SYDNAT62.mjs} +5 -5
  80. package/dist/cli/{feedback-I72P4XZS.js → feedback-WSA7YTKS.js} +10 -10
  81. package/dist/cli/{git-QJG3EF4P.mjs → git-WBH7N3EF.mjs} +5 -5
  82. package/dist/cli/git-YYOW4CYQ.js +25 -0
  83. package/dist/cli/index.js +148 -144
  84. package/dist/cli/index.mjs +47 -43
  85. package/dist/cli/{legacy-noops-5P75CQC7.js → legacy-noops-BZPLWY5C.js} +9 -9
  86. package/dist/cli/{legacy-noops-MZ45GDMK.mjs → legacy-noops-USZM4ZXF.mjs} +6 -6
  87. package/dist/cli/{monitors-VIOBUG2X.mjs → monitors-6HOZMLEV.mjs} +7 -7
  88. package/dist/cli/{monitors-5PHQZDZM.js → monitors-XHXAMMYC.js} +100 -100
  89. package/dist/cli/{org-B5LDVP2P.js → org-BAAOAZF3.js} +72 -72
  90. package/dist/cli/{org-D5RTFJNY.mjs → org-LT3DICB4.mjs} +6 -6
  91. package/dist/cli/{pages-BUJYG3JL.js → pages-7NP4PKLA.js} +18 -18
  92. package/dist/cli/{pages-XWZL3YV2.mjs → pages-MOCSTZZQ.mjs} +6 -6
  93. package/dist/cli/{play-SEC3EE7H.js → play-CGUL22GL.js} +317 -317
  94. package/dist/cli/{play-OSXLGCLZ.mjs → play-MGJ7B7RL.mjs} +18 -18
  95. package/dist/cli/{providers-RQPUASLI.js → providers-5LCUHKX2.js} +9 -9
  96. package/dist/cli/{providers-ENSURIW6.mjs → providers-AOWBHJ24.mjs} +6 -6
  97. package/dist/cli/{quickstart-XDTU4MAT.js → quickstart-7YZUT7GO.js} +6 -6
  98. package/dist/cli/{quickstart-HJTK6XWI.mjs → quickstart-Z6NA2CCM.mjs} +4 -4
  99. package/dist/cli/{run-ZMWSQAR2.mjs → run-7QGBNUKE.mjs} +23 -23
  100. package/dist/cli/{run-GX2SU5AT.js → run-M66ILCWL.js} +41 -41
  101. package/dist/cli/search-OZQH5VMI.js +33 -0
  102. package/dist/cli/{search-DZHZBHWT.mjs → search-Z2T3B4V4.mjs} +8 -8
  103. package/dist/cli/{search-output-3JVZERNV.js → search-output-6OHPSJGK.js} +6 -6
  104. package/dist/cli/{search-output-MNHAR754.mjs → search-output-MLHVBRIR.mjs} +4 -4
  105. package/dist/cli/{secrets-WO2LMDQ2.js → secrets-T7MW2DMK.js} +15 -15
  106. package/dist/cli/{secrets-VALVNVXB.mjs → secrets-VBSILT5H.mjs} +6 -6
  107. package/dist/cli/{sessions-EPYCH3AY.mjs → sessions-KNITGDLS.mjs} +6 -6
  108. package/dist/cli/sessions-XKEIBOTP.js +18 -0
  109. package/dist/cli/{settings-W2ABZUD4.mjs → settings-NBZRRKZS.mjs} +13 -13
  110. package/dist/cli/{settings-OSF4O5HM.js → settings-OSEBDBKR.js} +86 -86
  111. package/dist/cli/{setup-DCXNQG6R.js → setup-7DZPC6FC.js} +50 -50
  112. package/dist/cli/{setup-XI2ERSMQ.mjs → setup-WTEQPZ5I.mjs} +10 -10
  113. package/dist/cli/{skills-ZO4AH2YR.mjs → skills-JMD2MNJZ.mjs} +8 -8
  114. package/dist/cli/skills-R6RO6MQF.js +37 -0
  115. package/dist/cli/{tools-FTECXZYA.mjs → tools-LK5BM2Z7.mjs} +17 -17
  116. package/dist/cli/tools-NBBDUNPR.js +57 -0
  117. package/dist/cli/update-BI2ABPGX.js +35 -0
  118. package/dist/cli/{update-WPFZO2JE.mjs → update-IVUSIA2E.mjs} +10 -10
  119. package/dist/cli/{workflow-7X75IP3D.mjs → workflow-4QP6G54M.mjs} +7 -7
  120. package/dist/cli/{workflow-PKMU33LV.js → workflow-GY374FMJ.js} +17 -17
  121. package/dist/{client-DMpsMNH9.d.mts → client-By7bUS8h.d.mts} +1 -1
  122. package/dist/{client-BlwD-G4v.d.ts → client-CmlKSBXd.d.ts} +1 -1
  123. package/dist/{client-core-DwBLuEkm.d.ts → client-core-BM0mKhgp.d.ts} +93 -1
  124. package/dist/{client-core-CITtRTbB.d.mts → client-core-BZ3tpY_J.d.mts} +93 -1
  125. package/dist/index.d.mts +3 -3
  126. package/dist/index.d.ts +3 -3
  127. package/dist/index.js +9 -9
  128. package/dist/index.mjs +6 -6
  129. package/dist/install-integrity.json +110 -108
  130. package/dist/plays/play-description.d.mts +1 -1
  131. package/dist/plays/play-description.d.ts +1 -1
  132. package/dist/plays/run-request.d.mts +1 -1
  133. package/dist/plays/run-request.d.ts +1 -1
  134. package/dist/release.d.mts +1 -1
  135. package/dist/release.d.ts +1 -1
  136. package/dist/release.js +2 -2
  137. package/dist/release.mjs +1 -1
  138. package/dist/server.d.mts +2 -2
  139. package/dist/server.d.ts +2 -2
  140. package/dist/server.js +5 -5
  141. package/dist/server.mjs +3 -3
  142. package/dist/viewer/viewer.js +16 -7
  143. package/package.json +1 -1
  144. package/dist/cli/auth-S2Z5YMU3.js +0 -43
  145. package/dist/cli/describe-LNCLA2LA.js +0 -50
  146. package/dist/cli/git-QWH7SPGF.js +0 -25
  147. package/dist/cli/search-7WPABWYO.js +0 -33
  148. package/dist/cli/sessions-2IA2DGWO.js +0 -18
  149. package/dist/cli/skills-QMD2WARJ.js +0 -37
  150. package/dist/cli/tools-53E6GBQU.js +0 -57
  151. package/dist/cli/update-PPPNR6J5.js +0 -35
@@ -0,0 +1,268 @@
1
+ import {
2
+ DeeplineClient
3
+ } from "./chunk-HA5NSCTH.mjs";
4
+ import "./chunk-MTSHUN2R.mjs";
5
+ import "./chunk-L2VKAASU.mjs";
6
+ import "./chunk-N4TR6QRI.mjs";
7
+ import "./chunk-S3A4IXBQ.mjs";
8
+ import "./chunk-BMCRTI6Z.mjs";
9
+ import {
10
+ printCommandEnvelope
11
+ } from "./chunk-AATUAFD2.mjs";
12
+ import {
13
+ cliFeatureEnabled
14
+ } from "./chunk-MQ5GBB7V.mjs";
15
+ import "./chunk-TNQ5MF6K.mjs";
16
+ import "./chunk-4QF2K7TM.mjs";
17
+ import "./chunk-DLIRSHV6.mjs";
18
+ import "./chunk-HBL4PM5Q.mjs";
19
+ import "./chunk-YJN55ZWG.mjs";
20
+ import "./chunk-WZYKRD7T.mjs";
21
+ import "./chunk-KRD6H754.mjs";
22
+
23
+ // src/cli/commands/artifacts.ts
24
+ import { readFile } from "fs/promises";
25
+ var ARTIFACTS_FEATURE = "artifacts";
26
+ function print(command, json, data, lines) {
27
+ printCommandEnvelope(
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 readFile(value.slice(1), "utf8") : value;
44
+ try {
45
+ return JSON.parse(text);
46
+ } catch {
47
+ throw new Error(`${flag} takes JSON, or @path to a JSON file.`);
48
+ }
49
+ }
50
+ function artifactLines(artifact) {
51
+ return [
52
+ artifact.name,
53
+ ` ${artifact.url}`,
54
+ ` id ${artifact.id} \xB7 Play ${artifact.play} \xB7 ${artifact.access === "public" ? "public" : "workspace members"}`,
55
+ ...artifact.description ? [` ${artifact.description}`] : []
56
+ ];
57
+ }
58
+ function registerArtifactsCommands(program) {
59
+ const artifacts = program.command("artifacts", { hidden: !cliFeatureEnabled(ARTIFACTS_FEATURE) }).description(
60
+ "Show what a Play returns at a fixed URL on artifacts.deepline.com."
61
+ ).addHelpText(
62
+ "after",
63
+ `
64
+ Examples:
65
+ deepline artifacts create --name "Pipeline" --play score-accounts
66
+ deepline artifacts refresh <id>
67
+ deepline artifacts set-access <id> public
68
+ `
69
+ );
70
+ artifacts.command("list").description("List this workspace's artifacts.").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 DeeplineClient().listArtifacts({
73
+ cursor: options.cursor,
74
+ limit: options.limit
75
+ });
76
+ print("artifacts list", options.json, result, [
77
+ ...result.artifacts.length === 0 ? [
78
+ "No artifacts yet. Create one: deepline artifacts create --name <name> --play <play>"
79
+ ] : [],
80
+ ...result.artifacts.flatMap(artifactLines),
81
+ ...result.next_cursor ? [`More: --cursor ${result.next_cursor}`] : []
82
+ ]);
83
+ })
84
+ );
85
+ artifacts.command("get <id>").description("Show one artifact and what you may do with it.").option("--json", "Emit raw JSON response").action(
86
+ async (id, options) => run(async () => {
87
+ const artifact = await new DeeplineClient().getArtifact(id);
88
+ print("artifacts get", options.json, artifact, [
89
+ ...artifactLines(artifact),
90
+ ` saved input ${JSON.stringify(artifact.input)}`
91
+ ]);
92
+ })
93
+ );
94
+ artifacts.command("create").description("Create an artifact that shows a Play's runs at a fixed URL.").requiredOption("--name <name>", "Artifact 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 artifact is").option("--json", "Emit raw JSON response").addHelpText(
101
+ "after",
102
+ `
103
+ Examples:
104
+ deepline artifacts create --name "Pipeline" --play score-accounts
105
+ deepline artifacts create --name "Brief" --play meeting-brief --input '{"team":"Growth"}'
106
+ `
107
+ ).action(
108
+ async (options) => run(async () => {
109
+ const artifact = await new DeeplineClient().createArtifact({
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("artifacts create", options.json, artifact, [
121
+ `Created ${artifact.name}`,
122
+ ...artifactLines(artifact)
123
+ ]);
124
+ })
125
+ );
126
+ artifacts.command("edit <id>").description(
127
+ "Change an artifact'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 artifact 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 artifacts edit --help"
147
+ );
148
+ }
149
+ const artifact = await new DeeplineClient().updateArtifact(id, fields);
150
+ print(
151
+ "artifacts edit",
152
+ options.json,
153
+ artifact,
154
+ artifactLines(artifact)
155
+ );
156
+ })
157
+ );
158
+ artifacts.command("runs <id>").description("List runs of the artifact'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 DeeplineClient().listArtifactRuns(id, {
161
+ limit: options.limit
162
+ });
163
+ print("artifacts runs", options.json, result, [
164
+ ...result.runs.length === 0 ? ["No runs yet. Run: deepline artifacts refresh " + id] : [],
165
+ ...result.runs.map(
166
+ (r) => `${r.run_id} ${r.status} ${new Date(r.finished_at ?? r.created_at).toISOString()}`
167
+ )
168
+ ]);
169
+ })
170
+ );
171
+ artifacts.command("refresh <id>").description(
172
+ "Run the artifact's Play. The artifact shows the run when it finishes."
173
+ ).option(
174
+ "--input <json>",
175
+ "Input for this run instead of the artifact'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 DeeplineClient().refreshArtifact(id, input);
180
+ print("artifacts refresh", options.json, started, [
181
+ `Started run ${started.workflowId}.`,
182
+ `Watch it: deepline runs get ${started.workflowId}`
183
+ ]);
184
+ })
185
+ );
186
+ artifacts.command("set-access <id> <access>").description("Choose who can open an artifact: workspace or public.").option("--json", "Emit raw JSON response").action(
187
+ async (id, access, options) => run(async () => {
188
+ if (access !== "workspace" && access !== "public") {
189
+ throw new Error("Access is workspace or public.");
190
+ }
191
+ const artifact = await new DeeplineClient().setArtifactAccess(
192
+ id,
193
+ access
194
+ );
195
+ print(
196
+ "artifacts set-access",
197
+ options.json,
198
+ artifact,
199
+ artifactLines(artifact)
200
+ );
201
+ })
202
+ );
203
+ artifacts.command("delete <id>").description("Delete an artifact. Its Play and runs are not touched.").option("--json", "Emit raw JSON response").action(
204
+ async (id, options) => run(async () => {
205
+ const result = await new DeeplineClient().deleteArtifact(id);
206
+ print("artifacts delete", options.json, result, [
207
+ `Deleted artifact ${id}.`
208
+ ]);
209
+ })
210
+ );
211
+ const permissions = artifacts.command("permissions").description(
212
+ "Show or change who may create, edit, delete, publish, and refresh artifacts."
213
+ );
214
+ permissions.command("get", { isDefault: true }).description("Show the workspace's artifact rules and what you may do.").option("--json", "Emit raw JSON response").action(
215
+ async (options) => run(async () => {
216
+ const result = await new DeeplineClient().getArtifactPermissions();
217
+ print("artifacts permissions", options.json, result, [
218
+ ...Object.entries(result.rules).map(
219
+ ([verb, level]) => `${verb}: ${level}`
220
+ ),
221
+ ...result.can ? [
222
+ `you may: ${Object.entries(result.can).filter(([, ok]) => ok).map(([verb]) => verb).join(", ") || "view only"}`
223
+ ] : []
224
+ ]);
225
+ })
226
+ );
227
+ const verbs = [
228
+ "create",
229
+ "edit",
230
+ "delete",
231
+ "setAccess",
232
+ "refresh"
233
+ ];
234
+ permissions.command("set").description(
235
+ "Change artifact rules (admins only). Each is members or admins."
236
+ ).option("--create <level>", "Create artifacts").option("--edit <level>", "Edit artifacts").option("--delete <level>", "Delete artifacts").option("--set-access <level>", "Make artifacts public or workspace-only").option("--refresh <level>", "Refresh artifacts and start Plays from them").option("--json", "Emit raw JSON response").action(
237
+ async (options) => run(async () => {
238
+ const rules = {};
239
+ for (const verb of verbs) {
240
+ const value = options[verb];
241
+ if (value === void 0) continue;
242
+ if (value !== "members" && value !== "admins") {
243
+ throw new Error(
244
+ `--${verb === "setAccess" ? "set-access" : verb} is members or admins.`
245
+ );
246
+ }
247
+ rules[verb] = value;
248
+ }
249
+ if (Object.keys(rules).length === 0) {
250
+ throw new Error(
251
+ "Pass at least one rule. See: deepline artifacts permissions set --help"
252
+ );
253
+ }
254
+ const result = await new DeeplineClient().setArtifactPermissions(rules);
255
+ print(
256
+ "artifacts permissions set",
257
+ options.json,
258
+ result,
259
+ Object.entries(result.rules).map(
260
+ ([verb, level]) => `${verb}: ${level}`
261
+ )
262
+ );
263
+ })
264
+ );
265
+ }
266
+ export {
267
+ registerArtifactsCommands
268
+ };
@@ -14,14 +14,14 @@ import {
14
14
  reportSetupCompleted,
15
15
  resolvePendingAuthClaimForResume,
16
16
  statusBannerLine
17
- } from "./chunk-7BF4R26M.mjs";
18
- import "./chunk-DMF56C6D.mjs";
19
- import "./chunk-HOKOJGQW.mjs";
20
- import "./chunk-PQ56GE55.mjs";
17
+ } from "./chunk-3INAN6EK.mjs";
18
+ import "./chunk-AATUAFD2.mjs";
19
+ import "./chunk-MQ5GBB7V.mjs";
20
+ import "./chunk-TNQ5MF6K.mjs";
21
21
  import "./chunk-4QF2K7TM.mjs";
22
22
  import "./chunk-DLIRSHV6.mjs";
23
23
  import "./chunk-HBL4PM5Q.mjs";
24
- import "./chunk-V6DLYRSO.mjs";
24
+ import "./chunk-YJN55ZWG.mjs";
25
25
  import "./chunk-WZYKRD7T.mjs";
26
26
  import "./chunk-KRD6H754.mjs";
27
27
  export {
@@ -0,0 +1,43 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ var _chunk7U3WY2F3js = require('./chunk-7U3WY2F3.js');
18
+ require('./chunk-VZN6D23P.js');
19
+ require('./chunk-L7CAOWHY.js');
20
+ require('./chunk-ZZ7SVWKR.js');
21
+ require('./chunk-ALJJRZNJ.js');
22
+ require('./chunk-XNYIZMNQ.js');
23
+ require('./chunk-DIAWYWT5.js');
24
+ require('./chunk-BP4XEO6Z.js');
25
+ require('./chunk-OG64RBAC.js');
26
+ require('./chunk-COGTRVWW.js');
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+ exports.EXIT_WORKSPACE_MISMATCH = _chunk7U3WY2F3js.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunk7U3WY2F3js.authStatusLine; exports.clearPendingClaim = _chunk7U3WY2F3js.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunk7U3WY2F3js.clearSatisfiedPendingClaim; exports.handleRegister = _chunk7U3WY2F3js.handleRegister; exports.handleStatus = _chunk7U3WY2F3js.handleStatus; exports.handleWait = _chunk7U3WY2F3js.handleWait; exports.httpJson = _chunk7U3WY2F3js.httpJson; exports.readPendingAuthClaim = _chunk7U3WY2F3js.readPendingAuthClaim; exports.readStatusBanner = _chunk7U3WY2F3js.readStatusBanner; exports.registerAuthCommands = _chunk7U3WY2F3js.registerAuthCommands; exports.reportApprovalLinkShown = _chunk7U3WY2F3js.reportApprovalLinkShown; exports.reportSetupCompleted = _chunk7U3WY2F3js.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunk7U3WY2F3js.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunk7U3WY2F3js.statusBannerLine;