permdock 0.15.0 → 0.16.0

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 (48) hide show
  1. package/dist/{adoption-scan-DLel53Oa.js → adoption-scan-C2BCiUEG.js} +1 -1
  2. package/dist/{arazzo-CL8CZnpL.js → arazzo-CHoYnQXO.js} +1 -1
  3. package/dist/{arazzo-CHK9NT6u.js → arazzo-ClYz2Z0W.js} +1 -1
  4. package/dist/{casbin-iAEXjmca.js → casbin-C9EvElBb.js} +1 -1
  5. package/dist/{casbin-DRFwgVIP.js → casbin-D_rVQ31U.js} +1 -1
  6. package/dist/cli/bin.js +1 -1
  7. package/dist/cli/index.js +1 -1
  8. package/dist/{cloud-eOtmuonF.js → cloud-DdaJ7ILM.js} +1 -1
  9. package/dist/{codemod-D6NYu4AK.js → codemod-B1USJS7a.js} +2 -2
  10. package/dist/{codemod-KEDj_3zl.js → codemod-ammy6wv4.js} +1 -1
  11. package/dist/{completion-DCza8aQY.js → completion--Y4YItFZ.js} +1 -1
  12. package/dist/{config-BAM3a3z8.js → config-BQ77xMZk.js} +1 -1
  13. package/dist/{config-report-VZcQ0ZpS.js → config-report-DVMOLJ7F.js} +1 -1
  14. package/dist/{doctor-gIO9WTYo.js → doctor-CwYc2lJb.js} +2 -2
  15. package/dist/{doctor-CMqPKuN_.js → doctor-D1Xnmy6u.js} +7 -7
  16. package/dist/{import-DK_J8tVE.js → import-Dfe2unKO.js} +1 -1
  17. package/dist/{init-jLSyPMM7.js → init-BUo2G-FI.js} +1 -1
  18. package/dist/{init-Buibrl9h.js → init-C6cWP3xW.js} +3 -3
  19. package/dist/{login-CB55O4Gv.js → login-D1MHOomI.js} +1 -1
  20. package/dist/{login-VVpkkund.js → login-DCKE5pVy.js} +3 -3
  21. package/dist/{manifest-CbEyvPN2.js → manifest-Cft51TLK.js} +29 -29
  22. package/dist/{openapi-eHZ5hwUJ.js → openapi-BwWkHxvW.js} +2 -2
  23. package/dist/{openapi-CleDZYVf.js → openapi-DSzQN7Zu.js} +1 -1
  24. package/dist/{output-BVZpQDad.js → output-DlICTjBh.js} +1 -1
  25. package/dist/powersync-0QVP_DuR.js +1 -0
  26. package/dist/{powersync-uqYWxTjq.js → powersync-CBhTBhG2.js} +1 -1
  27. package/dist/{powersync-CFWILHjb.js → powersync-DAfo0EL5.js} +2 -2
  28. package/dist/pull-CCAChKuy.js +1 -0
  29. package/dist/{pull-BBmCxnqX.js → pull-CQCGy1gv.js} +1 -1
  30. package/dist/{rls-yK2nZUcm.js → rls-C5ZGzR_B.js} +1 -1
  31. package/dist/{rls-BwKXdVEW.js → rls-tHu7N_Pe.js} +4 -4
  32. package/dist/run-C5P3x1EI.js +1 -0
  33. package/dist/{run-D5WIJfs7.js → run-DUq1xU4K.js} +2 -2
  34. package/dist/{scan-CzdMtHnq.js → scan-C3HRH9Fs.js} +1 -1
  35. package/dist/{schema-BDGEVO4g.js → schema-DvXvxPhQ.js} +1 -1
  36. package/dist/{skills-BIsm1n26.js → skills-B2qTbaQa.js} +1 -1
  37. package/dist/{skills-BZxPQ_09.js → skills-Celu2W6v.js} +1 -1
  38. package/dist/{supautils-CGk4YpvC.js → supautils-SwE642N1.js} +9 -7
  39. package/dist/{usage-e6M1Mls1.js → usage-CPXeuAdT.js} +2 -2
  40. package/dist/{usage-DBNrpwoT.js → usage-CfZCQd0F.js} +1 -1
  41. package/dist/usage-DmmO_xjJ.js +1 -0
  42. package/dist/{verify-CgIpJRcG.js → verify-DfT0QYNh.js} +1 -1
  43. package/package.json +1 -1
  44. package/skills/permdock-data/references/queries-and-rls.md +1 -1
  45. package/dist/powersync-CnGzxvEl.js +0 -1
  46. package/dist/pull-D6dloyrc.js +0 -1
  47. package/dist/run-DlQYPtPv.js +0 -1
  48. package/dist/usage-D3KJyaNS.js +0 -1
@@ -1,5 +1,5 @@
1
1
  import { r as listSourceFiles } from "./files-BSjrtIHw.js";
2
- import { t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
2
+ import { t as DOCS_BASE } from "./manifest-Cft51TLK.js";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { relative } from "node:path";
5
5
  //#region src/cli/adoption-scan.ts
@@ -21,7 +21,7 @@ const check = defineLeaf({
21
21
  ...permissionsFlag
22
22
  },
23
23
  async run(ctx, { flags }) {
24
- return (await import("./arazzo-CHK9NT6u.js")).runArazzo({
24
+ return (await import("./arazzo-ClYz2Z0W.js")).runArazzo({
25
25
  cwd: ctx.cwd,
26
26
  config: ctx.config,
27
27
  doc: given(flags.doc),
@@ -3,7 +3,7 @@ import { c as missingInput } from "./errors-Vpu6rKHl.js";
3
3
  import { i as readJsonFile } from "./files-BSjrtIHw.js";
4
4
  import { t as ARAZZO_REPORT_SCHEMA } from "./version-DMQ0dnN5.js";
5
5
  import { a as loadModule, s as pickNamed, t as asPermissionTree } from "./load-DjSU5KXO.js";
6
- import { t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
6
+ import { t as DOCS_BASE } from "./manifest-Cft51TLK.js";
7
7
  import { existsSync } from "node:fs";
8
8
  import { resolve } from "node:path";
9
9
  //#region src/cli/arazzo.ts
@@ -1,4 +1,4 @@
1
- import { a as nonEmptyOr } from "./output-BVZpQDad.js";
1
+ import { a as nonEmptyOr } from "./output-DlICTjBh.js";
2
2
  import { t as applyFiles } from "./files-B3AA05f1.js";
3
3
  import { n as isIdentifier, t as emitPolicyModule } from "./policy-module-xym9fnSq.js";
4
4
  import { existsSync, readFileSync } from "node:fs";
@@ -16,7 +16,7 @@ const casbinImport = defineLeaf({
16
16
  ...outFlag
17
17
  },
18
18
  async run(ctx, { flags }) {
19
- const { runCasbinImport } = await import("./casbin-iAEXjmca.js");
19
+ const { runCasbinImport } = await import("./casbin-C9EvElBb.js");
20
20
  return runCasbinImport({
21
21
  cwd: ctx.cwd,
22
22
  model: given(flags.model),
package/dist/cli/bin.js CHANGED
@@ -11,7 +11,7 @@ if (argv.length === 1 && (argv[0] === "--version" || argv[0] === "-v")) {
11
11
  const [{ isCi }, { trapSignals }, { run }, { streamHasColors }] = await Promise.all([
12
12
  import("../env-DJZrPjRi.js"),
13
13
  import("../signals-B1vHR3fN.js"),
14
- import("../run-DlQYPtPv.js"),
14
+ import("../run-C5P3x1EI.js"),
15
15
  import("../style-DblOtSga.js")
16
16
  ]);
17
17
  const signals = trapSignals();
package/dist/cli/index.js CHANGED
@@ -2,7 +2,7 @@ import { t as catalogPath } from "../catalog-path-CnI0XTFK.js";
2
2
  import { t as defineConfig } from "../config-CcLlvEYW.js";
3
3
  import { n as parsePushedPolicy, r as pushedPolicy, t as PUSHED_POLICY_SCHEMA } from "../pushed-policy-CDuOL2de.js";
4
4
  import { c as parseGrantsMarker, l as parseHookMarker } from "../markers-BeHZ4x9Q.js";
5
- import { t as run } from "../run-D5WIJfs7.js";
5
+ import { t as run } from "../run-DUq1xU4K.js";
6
6
  //#region src/cli/token-schemas.ts
7
7
  const ID = {
8
8
  type: "string",
@@ -70,7 +70,7 @@ const pull = defineLeaf({
70
70
  },
71
71
  async run(ctx, { flags }) {
72
72
  const env = await withStdinSecret(ctx, "token", flags["token-stdin"], "PERMDOCK_CLOUD_TOKEN");
73
- return (await import("./pull-D6dloyrc.js")).runCloudPull({
73
+ return (await import("./pull-CCAChKuy.js")).runCloudPull({
74
74
  cwd: ctx.cwd,
75
75
  config: ctx.config,
76
76
  url: given(flags.url),
@@ -7,7 +7,7 @@ const codemod = defineLeaf({
7
7
  description: "The release to migrate to (0.5)",
8
8
  required: true,
9
9
  async complete() {
10
- return (await import("./codemod-KEDj_3zl.js")).codemodVersions();
10
+ return (await import("./codemod-ammy6wv4.js")).codemodVersions();
11
11
  }
12
12
  }, {
13
13
  name: "paths",
@@ -22,7 +22,7 @@ const codemod = defineLeaf({
22
22
  }
23
23
  },
24
24
  async run(ctx, { flags, args, rest }) {
25
- return (await import("./codemod-KEDj_3zl.js")).runCodemod({
25
+ return (await import("./codemod-ammy6wv4.js")).runCodemod({
26
26
  cwd: ctx.cwd,
27
27
  version: args["version"],
28
28
  paths: rest,
@@ -1,7 +1,7 @@
1
1
  import { n as CliError } from "./errors-Vpu6rKHl.js";
2
2
  import { a as rel } from "./files-BSjrtIHw.js";
3
3
  import { t as beforeFirst } from "./text-BMFRfBqc.js";
4
- import { n as ROOT } from "./manifest-CbEyvPN2.js";
4
+ import { n as ROOT } from "./manifest-Cft51TLK.js";
5
5
  import { i as renameMessage, n as DEFAULT_CHANGES, r as flagRename, t as COMMAND_MOVES } from "./renames-CGj7YwcQ.js";
6
6
  import { i as refuseDirty, t as applyFiles } from "./files-B3AA05f1.js";
7
7
  import { readFileSync, readdirSync, statSync } from "node:fs";
@@ -1,6 +1,6 @@
1
1
  import { n as CliError } from "./errors-Vpu6rKHl.js";
2
2
  import { a as suggestion, o as GLOBAL_FLAGS } from "./args-0FrVs5EH.js";
3
- import { a as resolve } from "./manifest-CbEyvPN2.js";
3
+ import { a as resolve } from "./manifest-Cft51TLK.js";
4
4
  import { t as defineLeaf } from "./command-L8EstFNm.js";
5
5
  //#region src/cli/core/completion.ts
6
6
  const SHELLS = [
@@ -10,7 +10,7 @@ const config = defineLeaf({
10
10
  ...failOnFlag
11
11
  },
12
12
  async run(ctx, { flags }) {
13
- const { runConfig } = await import("./config-report-VZcQ0ZpS.js");
13
+ const { runConfig } = await import("./config-report-DVMOLJ7F.js");
14
14
  return runConfig({
15
15
  cwd: ctx.cwd,
16
16
  config: ctx.config,
@@ -3,7 +3,7 @@ import { r as CONFIG_REPORT_SCHEMA } from "./version-DMQ0dnN5.js";
3
3
  import { t as catalogPath } from "./catalog-path-CnI0XTFK.js";
4
4
  import { n as guessPermissions, t as barrelFile } from "./collect-WCl8cJQV.js";
5
5
  import "./sources-C4vkzZJV.js";
6
- import { t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
6
+ import { t as DOCS_BASE } from "./manifest-Cft51TLK.js";
7
7
  import { n as MIGRATION_DIRS, t as DEFAULT_SENSITIVE_ACTIONS } from "./constants-DcJABbLW.js";
8
8
  //#region src/cli/config-report.ts
9
9
  function configReport(input) {
@@ -10,7 +10,7 @@ const doctor = defineLeaf({
10
10
  description: "Check codes or groups to run",
11
11
  valueHint: "code",
12
12
  async complete() {
13
- const { DOCTOR_CHECKS } = await import("./doctor-CMqPKuN_.js");
13
+ const { DOCTOR_CHECKS } = await import("./doctor-D1Xnmy6u.js");
14
14
  return [.../* @__PURE__ */ new Set([...DOCTOR_CHECKS.map(({ code }) => code), ...DOCTOR_CHECKS.flatMap(({ groups }) => groups)])];
15
15
  }
16
16
  },
@@ -27,7 +27,7 @@ const doctor = defineLeaf({
27
27
  if (answer === void 0) return CANCELLED;
28
28
  fix = answer;
29
29
  }
30
- return (await import("./doctor-CMqPKuN_.js")).runDoctor({
30
+ return (await import("./doctor-D1Xnmy6u.js")).runDoctor({
31
31
  cwd: ctx.cwd,
32
32
  config: ctx.config,
33
33
  only: flags.only,
@@ -25,10 +25,10 @@ import { t as parseCatalog } from "./parse-1_ZheTW5.js";
25
25
  import { n as activeTenantMismatch } from "./active-tenant-DVee32-T.js";
26
26
  import "./markers-BeHZ4x9Q.js";
27
27
  import { t as didYouMean } from "./args-0FrVs5EH.js";
28
- import { t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
28
+ import { t as DOCS_BASE } from "./manifest-Cft51TLK.js";
29
29
  import { t as createStyle } from "./style-Ds11Hmk4.js";
30
- import { a as nonEmptyOr, r as findingOf } from "./output-BVZpQDad.js";
31
- import { i as runSkillsInstall } from "./skills-BZxPQ_09.js";
30
+ import { a as nonEmptyOr, r as findingOf } from "./output-DlICTjBh.js";
31
+ import { i as runSkillsInstall } from "./skills-Celu2W6v.js";
32
32
  import { n as MIGRATION_DIRS, t as DEFAULT_SENSITIVE_ACTIONS } from "./constants-DcJABbLW.js";
33
33
  import { l as partPath } from "./output-files-BIQ_9pIs.js";
34
34
  import { _ as readSupabaseConfig, a as supabaseHookManifest, c as activeSource, d as resolveSchemas, g as pd074, h as pd045, l as pd039, m as attrsPlan, n as hookOut, v as supabaseConfig } from "./supabase-hook-HPgwYb9V.js";
@@ -38,10 +38,10 @@ import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
38
38
  import { i as group, n as membershipColumns, o as sqlStatements, r as tableKey } from "./deciding-columns-NB4wcyBf.js";
39
39
  import { t as FIELD_VIEWS } from "./fields-DI8s3cPl.js";
40
40
  import { t as resolveNames } from "./resolve-names-Y1Cb22cp.js";
41
- import { a as pd010, c as pd014, d as pd038, f as pd041, i as pd008, l as pd015, n as pd001, o as pd011, p as pd057, r as pd007, s as pd013, t as runUsage, u as pd036 } from "./usage-e6M1Mls1.js";
42
- import { d as rowConditionMessage, f as commandFor, m as tableFor, p as compileGrants, s as ROW_CONDITION_FIX, u as helperTablePolicies } from "./verify-CgIpJRcG.js";
43
- import { a as streamOf, i as scopeSourcesOf, r as staleFiles, t as powersyncFiles } from "./powersync-uqYWxTjq.js";
44
- import { a as buildContext, n as generateOptions, r as isRefusal, s as inheritTargets, t as supautilsRejections } from "./supautils-CGk4YpvC.js";
41
+ import { a as pd010, c as pd014, d as pd038, f as pd041, i as pd008, l as pd015, n as pd001, o as pd011, p as pd057, r as pd007, s as pd013, t as runUsage, u as pd036 } from "./usage-CPXeuAdT.js";
42
+ import { d as rowConditionMessage, f as commandFor, m as tableFor, p as compileGrants, s as ROW_CONDITION_FIX, u as helperTablePolicies } from "./verify-DfT0QYNh.js";
43
+ import { a as streamOf, i as scopeSourcesOf, r as staleFiles, t as powersyncFiles } from "./powersync-CBhTBhG2.js";
44
+ import { a as buildContext, n as generateOptions, r as isRefusal, s as inheritTargets, t as supautilsRejections } from "./supautils-SwE642N1.js";
45
45
  import { n as legacyHelperNames, r as retirePlan, t as legacyHelperCalls } from "./retire-B2xffQgY.js";
46
46
  import { basename, dirname, join, resolve } from "node:path";
47
47
  import { pathToFileURL } from "node:url";
@@ -4,7 +4,7 @@ import { i as readJsonFile } from "./files-BSjrtIHw.js";
4
4
  import { t as applyFiles } from "./files-B3AA05f1.js";
5
5
  import { n as httpRequest } from "./http-DOL33cO0.js";
6
6
  import { i as schemaExpression, t as emitPermissionsModule } from "./generate-CezbCaTI.js";
7
- import { t as validateOpenapi } from "./schema-BDGEVO4g.js";
7
+ import { t as validateOpenapi } from "./schema-DvXvxPhQ.js";
8
8
  import { existsSync, readFileSync } from "node:fs";
9
9
  import { resolve } from "node:path";
10
10
  //#region ../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/identity.js
@@ -1,6 +1,6 @@
1
1
  import { n as CliError } from "./errors-Vpu6rKHl.js";
2
2
  import { a as decodePreset, g as resolvePreset, i as presetFlags, n as generatePreset, o as encodePreset } from "./preset-BjLzeFpp.js";
3
- import { a as nonEmptyOr } from "./output-BVZpQDad.js";
3
+ import { a as nonEmptyOr } from "./output-DlICTjBh.js";
4
4
  import { t as addLine } from "./peer-Q0fuZ6hx.js";
5
5
  import { t as applyFiles } from "./files-B3AA05f1.js";
6
6
  import { existsSync } from "node:fs";
@@ -48,7 +48,7 @@ const init = defineLeaf({
48
48
  ...forceFlag
49
49
  },
50
50
  async run(ctx, { flags }) {
51
- const [{ runInit }, { packageManagerOf }] = await Promise.all([import("./init-jLSyPMM7.js"), import("./peer-C9LvBCcb.js")]);
51
+ const [{ runInit }, { packageManagerOf }] = await Promise.all([import("./init-BUo2G-FI.js"), import("./peer-C9LvBCcb.js")]);
52
52
  const agent = await packageManagerOf(ctx.cwd);
53
53
  const selection = {
54
54
  archetype: flags.archetype,
@@ -79,7 +79,7 @@ const presetDecode = defineLeaf({
79
79
  positionals: presetCode,
80
80
  flags: {},
81
81
  async run(_ctx, { args }) {
82
- const { runPreset } = await import("./init-jLSyPMM7.js");
82
+ const { runPreset } = await import("./init-BUo2G-FI.js");
83
83
  return runPreset("decode", args["code"] ?? "");
84
84
  }
85
85
  });
@@ -87,7 +87,7 @@ const presetUrl = defineLeaf({
87
87
  positionals: presetCode,
88
88
  flags: {},
89
89
  async run(_ctx, { args }) {
90
- const { runPreset } = await import("./init-jLSyPMM7.js");
90
+ const { runPreset } = await import("./init-BUo2G-FI.js");
91
91
  return runPreset("url", args["code"] ?? "");
92
92
  }
93
93
  });
@@ -3,7 +3,7 @@ import { n as CliError } from "./errors-Vpu6rKHl.js";
3
3
  import { i as postForm, r as parseToken, s as runDeviceFlow } from "./device-BwbJNmb2.js";
4
4
  import { i as writeCredentials, n as deleteCredentials, r as readCredentials, t as credentialsPath } from "./storage-C2bWdvJH.js";
5
5
  import { n as randomToken, t as pkce } from "./pkce-CnmmYqUZ.js";
6
- import { a as nonEmptyOr } from "./output-BVZpQDad.js";
6
+ import { a as nonEmptyOr } from "./output-DlICTjBh.js";
7
7
  import { n as httpRequest } from "./http-DOL33cO0.js";
8
8
  import { c as READ_SCOPES, d as issuerMetadata, i as credentialsInsideRepository, l as cloudUrl, n as cliRuntime, r as credentialStorage, s as CLI_CLIENT_ID, t as CREDENTIAL_SERVICE } from "./auth--yPyZNgr.js";
9
9
  import { spawn } from "node:child_process";
@@ -27,7 +27,7 @@ const login = defineLeaf({
27
27
  }
28
28
  },
29
29
  async run(ctx, { flags }) {
30
- const { runLogin } = await import("./login-CB55O4Gv.js");
30
+ const { runLogin } = await import("./login-D1MHOomI.js");
31
31
  return runLogin({
32
32
  cwd: ctx.cwd,
33
33
  url: given(flags.url),
@@ -43,7 +43,7 @@ const login = defineLeaf({
43
43
  const logout = defineLeaf({
44
44
  flags: { ...urlFlag },
45
45
  async run(ctx, { flags }) {
46
- const { runLogout } = await import("./login-CB55O4Gv.js");
46
+ const { runLogout } = await import("./login-D1MHOomI.js");
47
47
  return runLogout({
48
48
  url: given(flags.url),
49
49
  json: ctx.json,
@@ -55,7 +55,7 @@ const logout = defineLeaf({
55
55
  const whoami = defineLeaf({
56
56
  flags: { ...urlFlag },
57
57
  async run(ctx, { flags }) {
58
- const { runWhoami } = await import("./login-CB55O4Gv.js");
58
+ const { runWhoami } = await import("./login-D1MHOomI.js");
59
59
  return runWhoami({
60
60
  url: given(flags.url),
61
61
  json: ctx.json,
@@ -30,20 +30,20 @@ const SECTIONS = [
30
30
  docs: "init",
31
31
  effects: ["files"],
32
32
  config: false,
33
- load: async () => (await import("./init-Buibrl9h.js")).init
33
+ load: async () => (await import("./init-C6cWP3xW.js")).init
34
34
  }),
35
35
  group("preset", "Decode a preset code, or print its permdock.com/create link", "preset", [leaf("decode", "Print what a preset code holds", {
36
36
  examples: ["permdock preset decode p1AQIDBAc"],
37
37
  docs: "preset",
38
38
  effects: [],
39
39
  config: false,
40
- load: async () => (await import("./init-Buibrl9h.js")).presetDecode
40
+ load: async () => (await import("./init-C6cWP3xW.js")).presetDecode
41
41
  }), leaf("url", "Print the permdock.com/create link that opens a code", {
42
42
  examples: ["permdock preset url p1AQIDBAc"],
43
43
  docs: "preset",
44
44
  effects: [],
45
45
  config: false,
46
- load: async () => (await import("./init-Buibrl9h.js")).presetUrl
46
+ load: async () => (await import("./init-C6cWP3xW.js")).presetUrl
47
47
  })]),
48
48
  group("skills", "Install, update or list the PermDock Agent Skills", "skills", [
49
49
  leaf("install", "Copy the Agent Skills into the agent folders", {
@@ -55,21 +55,21 @@ const SECTIONS = [
55
55
  docs: "skills",
56
56
  effects: ["files"],
57
57
  config: false,
58
- load: async () => (await import("./skills-BIsm1n26.js")).install
58
+ load: async () => (await import("./skills-B2qTbaQa.js")).install
59
59
  }),
60
60
  leaf("update", "Replace installed skills with this version's", {
61
61
  examples: ["permdock skills update"],
62
62
  docs: "skills",
63
63
  effects: ["files"],
64
64
  config: false,
65
- load: async () => (await import("./skills-BIsm1n26.js")).update
65
+ load: async () => (await import("./skills-B2qTbaQa.js")).update
66
66
  }),
67
67
  leaf("list", "List the skills and where each is installed", {
68
68
  examples: ["permdock skills list"],
69
69
  docs: "skills",
70
70
  effects: [],
71
71
  config: false,
72
- load: async () => (await import("./skills-BIsm1n26.js")).list
72
+ load: async () => (await import("./skills-B2qTbaQa.js")).list
73
73
  })
74
74
  ]),
75
75
  leaf("doctor", "Check a PermDock installation and print a fix for each finding", {
@@ -82,7 +82,7 @@ const SECTIONS = [
82
82
  effects: ["files"],
83
83
  config: true,
84
84
  findings: true,
85
- load: async () => (await import("./doctor-gIO9WTYo.js")).doctor
85
+ load: async () => (await import("./doctor-CwYc2lJb.js")).doctor
86
86
  }),
87
87
  leaf("completion", "Print the shell completion script for bash, zsh or fish", {
88
88
  examples: ["permdock completion zsh > ~/.zfunc/_permdock", "eval \"$(permdock completion bash)\""],
@@ -90,7 +90,7 @@ const SECTIONS = [
90
90
  effects: [],
91
91
  config: false,
92
92
  shellOutput: true,
93
- load: async () => (await import("./completion-DCza8aQY.js")).completion
93
+ load: async () => (await import("./completion--Y4YItFZ.js")).completion
94
94
  })
95
95
  ]
96
96
  },
@@ -132,7 +132,7 @@ const SECTIONS = [
132
132
  effects: [],
133
133
  config: true,
134
134
  findings: true,
135
- load: async () => (await import("./usage-DBNrpwoT.js")).usage
135
+ load: async () => (await import("./usage-CfZCQd0F.js")).usage
136
136
  }),
137
137
  leaf("diff", "Compare two policies or catalogs; exit 1 on a breaking change", {
138
138
  examples: ["permdock diff main.catalog.json permissions.catalog.json", "permdock diff ./old-policy.ts ./src/policy.ts --impact"],
@@ -147,7 +147,7 @@ const SECTIONS = [
147
147
  effects: [],
148
148
  config: true,
149
149
  findings: true,
150
- load: async () => (await import("./config-BAM3a3z8.js")).config
150
+ load: async () => (await import("./config-BQ77xMZk.js")).config
151
151
  })
152
152
  ]
153
153
  },
@@ -164,14 +164,14 @@ const SECTIONS = [
164
164
  "network"
165
165
  ],
166
166
  config: true,
167
- load: async () => (await import("./rls-yK2nZUcm.js")).generate
167
+ load: async () => (await import("./rls-C5ZGzR_B.js")).generate
168
168
  }),
169
169
  leaf("import", "Turn existing RLS policies into a generated definition", {
170
170
  examples: ["permdock rls import --sql schema.sql --out src/permissions.generated.ts", "permdock rls import --db-url-stdin --out src/permissions.generated.ts"],
171
171
  docs: "rls",
172
172
  effects: ["files", "database:read"],
173
173
  config: true,
174
- load: async () => (await import("./rls-yK2nZUcm.js")).importPolicies
174
+ load: async () => (await import("./rls-C5ZGzR_B.js")).importPolicies
175
175
  }),
176
176
  leaf("verify", "Run the fixtures against the policies, or compare a live database", {
177
177
  examples: [
@@ -183,21 +183,21 @@ const SECTIONS = [
183
183
  effects: ["files", "database:read"],
184
184
  config: true,
185
185
  findings: true,
186
- load: async () => (await import("./rls-yK2nZUcm.js")).verify
186
+ load: async () => (await import("./rls-C5ZGzR_B.js")).verify
187
187
  }),
188
188
  leaf("migrate", "Rewrite hand-written policies onto the generated helpers", {
189
189
  examples: ["permdock rls migrate --sql supabase/migrations --dry-run", "permdock rls migrate --sql supabase/migrations"],
190
190
  docs: "rls",
191
191
  effects: ["rewrite", "files"],
192
192
  config: true,
193
- load: async () => (await import("./rls-yK2nZUcm.js")).migrate
193
+ load: async () => (await import("./rls-C5ZGzR_B.js")).migrate
194
194
  }),
195
195
  leaf("explain", "Show the tables, membership sources and triggers the SQL binds to", {
196
196
  examples: ["permdock rls explain", "permdock rls explain --db-url-stdin --json"],
197
197
  docs: "rls",
198
198
  effects: ["database:read"],
199
199
  config: true,
200
- load: async () => (await import("./rls-yK2nZUcm.js")).explain
200
+ load: async () => (await import("./rls-C5ZGzR_B.js")).explain
201
201
  })
202
202
  ]),
203
203
  group("supabase", "Generate the Supabase Custom Access Token Hook, or inspect its manifest", "supabase", [group("hook", "The Custom Access Token Hook", "supabase", [leaf("generate", "Compile the membership sources into the hook migration", {
@@ -218,13 +218,13 @@ const SECTIONS = [
218
218
  docs: "powersync",
219
219
  effects: ["files"],
220
220
  config: true,
221
- load: async () => (await import("./powersync-CFWILHjb.js")).generate
221
+ load: async () => (await import("./powersync-DAfo0EL5.js")).generate
222
222
  }), leaf("verify", "Fail on stale streams or a stream that syncs a denied row", {
223
223
  examples: ["permdock powersync verify", "permdock powersync verify --db-url-stdin"],
224
224
  docs: "powersync",
225
225
  effects: ["database:read"],
226
226
  config: true,
227
- load: async () => (await import("./powersync-CFWILHjb.js")).verify
227
+ load: async () => (await import("./powersync-DAfo0EL5.js")).verify
228
228
  })]),
229
229
  group("scim", "Generate the Postgres tables postgresDirectoryStore keeps a SCIM directory in", "scim", [leaf("generate", "Write the tenant-keyed users, groups and members tables", {
230
230
  examples: [
@@ -247,13 +247,13 @@ const SECTIONS = [
247
247
  docs: "openapi",
248
248
  effects: ["files"],
249
249
  config: true,
250
- load: async () => (await import("./openapi-eHZ5hwUJ.js")).emit
250
+ load: async () => (await import("./openapi-BwWkHxvW.js")).emit
251
251
  }), leaf("import", "Turn an OpenAPI document into a generated definition", {
252
252
  examples: ["permdock openapi import --doc openapi.yaml --out src/permissions.generated.ts"],
253
253
  docs: "openapi",
254
254
  effects: ["files", "network"],
255
255
  config: false,
256
- load: async () => (await import("./openapi-eHZ5hwUJ.js")).importDocument
256
+ load: async () => (await import("./openapi-BwWkHxvW.js")).importDocument
257
257
  })]),
258
258
  group("arazzo", "Check Arazzo workflows against the permissions", "arazzo", [leaf("check", "Resolve every Arazzo step to x-permdock-permissions", {
259
259
  examples: ["permdock arazzo check --doc arazzo.json --openapi openapi.json"],
@@ -261,7 +261,7 @@ const SECTIONS = [
261
261
  effects: [],
262
262
  config: true,
263
263
  findings: true,
264
- load: async () => (await import("./arazzo-CL8CZnpL.js")).check
264
+ load: async () => (await import("./arazzo-CHoYnQXO.js")).check
265
265
  })]),
266
266
  leaf("scan", "List authorization checks written without PermDock, to adopt it in an existing app", {
267
267
  examples: ["permdock scan", "permdock scan --src app,lib --pattern isBeta"],
@@ -269,7 +269,7 @@ const SECTIONS = [
269
269
  effects: [],
270
270
  config: true,
271
271
  findings: true,
272
- load: async () => (await import("./scan-CzdMtHnq.js")).scan
272
+ load: async () => (await import("./scan-C3HRH9Fs.js")).scan
273
273
  }),
274
274
  group("casl", "Import CASL rules into a generated module", "casl", [leaf("import", "Turn CASL rules per role into a permissions and policy module", {
275
275
  examples: ["permdock casl import --rules rules.json --out src/permissions.generated.ts"],
@@ -283,7 +283,7 @@ const SECTIONS = [
283
283
  docs: "casbin",
284
284
  effects: ["files"],
285
285
  config: false,
286
- load: async () => (await import("./casbin-DRFwgVIP.js")).casbinImport
286
+ load: async () => (await import("./casbin-D_rVQ31U.js")).casbinImport
287
287
  })])
288
288
  ]
289
289
  },
@@ -295,34 +295,34 @@ const SECTIONS = [
295
295
  docs: "login",
296
296
  effects: ["network", "files"],
297
297
  config: false,
298
- load: async () => (await import("./login-VVpkkund.js")).login
298
+ load: async () => (await import("./login-DCKE5pVy.js")).login
299
299
  }),
300
300
  leaf("logout", "Revoke and delete the stored PermDock Cloud login", {
301
301
  examples: ["permdock logout"],
302
302
  docs: "login",
303
303
  effects: ["network", "files"],
304
304
  config: false,
305
- load: async () => (await import("./login-VVpkkund.js")).logout
305
+ load: async () => (await import("./login-DCKE5pVy.js")).logout
306
306
  }),
307
307
  leaf("whoami", "Print the PermDock Cloud identity the CLI acts as", {
308
308
  examples: ["permdock whoami", "permdock whoami --json"],
309
309
  docs: "login",
310
310
  effects: [],
311
311
  config: false,
312
- load: async () => (await import("./login-VVpkkund.js")).whoami
312
+ load: async () => (await import("./login-DCKE5pVy.js")).whoami
313
313
  }),
314
314
  group("cloud", "Publish to or pull from a PermDock Cloud project", "cloud", [leaf("push", "Publish the catalog, policy and manifest to a Cloud project", {
315
315
  examples: ["permdock cloud push --dry-run", "permdock cloud push --project prj_123"],
316
316
  docs: "cloud",
317
317
  effects: ["network", "cloud:write"],
318
318
  config: true,
319
- load: async () => (await import("./cloud-eOtmuonF.js")).push
319
+ load: async () => (await import("./cloud-DdaJ7ILM.js")).push
320
320
  }), leaf("pull", "Write a Cloud project's published catalog and manifest", {
321
321
  examples: ["permdock cloud pull --project prj_123"],
322
322
  docs: "cloud",
323
323
  effects: ["network", "files"],
324
324
  config: true,
325
- load: async () => (await import("./cloud-eOtmuonF.js")).pull
325
+ load: async () => (await import("./cloud-DdaJ7ILM.js")).pull
326
326
  })])
327
327
  ]
328
328
  },
@@ -333,7 +333,7 @@ const SECTIONS = [
333
333
  docs: "codemod",
334
334
  effects: ["rewrite"],
335
335
  config: false,
336
- load: async () => (await import("./codemod-D6NYu4AK.js")).codemod
336
+ load: async () => (await import("./codemod-B1USJS7a.js")).codemod
337
337
  })]
338
338
  }
339
339
  ];
@@ -345,7 +345,7 @@ const COMPLETE_LEAF = leaf("__complete", "Print completion candidates for a part
345
345
  config: false,
346
346
  shellOutput: true,
347
347
  hidden: true,
348
- load: async () => (await import("./completion-DCza8aQY.js")).complete
348
+ load: async () => (await import("./completion--Y4YItFZ.js")).complete
349
349
  });
350
350
  const ROOT = group("permdock", "Collect, export, diff and check the permissions a PermDock policy declares", "", [...SECTIONS.flatMap((section) => section.entries), COMPLETE_LEAF]);
351
351
  /** Each leaf with its path from the root, in manifest order. */
@@ -80,7 +80,7 @@ const emit = defineLeaf({
80
80
  }
81
81
  },
82
82
  async run(ctx, { flags }) {
83
- return (await import("./openapi-CleDZYVf.js")).runOpenapi({
83
+ return (await import("./openapi-DSzQN7Zu.js")).runOpenapi({
84
84
  cwd: ctx.cwd,
85
85
  config: ctx.config,
86
86
  rest: ["emit"],
@@ -122,7 +122,7 @@ const importDocument = defineLeaf({
122
122
  async run(ctx, { flags }) {
123
123
  const doc = given(flags.doc);
124
124
  if (doc === void 0) throw missingInput("openapi import", ["--doc"], "the OpenAPI document to import");
125
- return (await import("./import-DK_J8tVE.js")).runOpenapiImport({
125
+ return (await import("./import-Dfe2unKO.js")).runOpenapiImport({
126
126
  cwd: ctx.cwd,
127
127
  doc,
128
128
  out: fileOut("openapi import", flags.out),
@@ -7,7 +7,7 @@ import { a as loadModule, n as asPolicy, s as pickNamed, t as asPermissionTree }
7
7
  import { t as shortDiff } from "./text-diff-BtfSmdUo.js";
8
8
  import { c as openapiVersion, o as createPermDock } from "./openapi-BOsx0xn9.js";
9
9
  import { i as fileDrift } from "./output-files-BIQ_9pIs.js";
10
- import { n as validateOverlay, t as validateOpenapi } from "./schema-BDGEVO4g.js";
10
+ import { n as validateOverlay, t as validateOpenapi } from "./schema-DvXvxPhQ.js";
11
11
  import { existsSync } from "node:fs";
12
12
  import { resolve } from "node:path";
13
13
  //#region src/cli/openapi/openapi.ts
@@ -1,5 +1,5 @@
1
1
  import { s as cliVersion } from "./version-DMQ0dnN5.js";
2
- import { t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
2
+ import { t as DOCS_BASE } from "./manifest-Cft51TLK.js";
3
3
  //#region src/cli/core/output.ts
4
4
  const CLI_RESULT_SCHEMA = "https://permdock.com/schemas/cli-result-v1.json";
5
5
  function envelope(input) {
@@ -0,0 +1 @@
1
+ export { n as runPowerSync } from "./powersync-CBhTBhG2.js";
@@ -19,7 +19,7 @@ import { n as tableNameOf, r as tableNames } from "./tables-DimBcVWY.js";
19
19
  import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, t as ownershipRules, u as roleNames } from "./ownership-qqBuGJXr.js";
20
20
  import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
21
21
  import { n as pgConnector } from "./pg-DQTqRrou.js";
22
- import { m as tableFor, t as canFixture } from "./verify-CgIpJRcG.js";
22
+ import { m as tableFor, t as canFixture } from "./verify-DfT0QYNh.js";
23
23
  import { resolve } from "node:path";
24
24
  //#region src/cli/powersync/names.ts
25
25
  function ident(name) {
@@ -14,7 +14,7 @@ const generate = defineLeaf({
14
14
  async run(ctx, { flags }) {
15
15
  const out = fileOut("powersync", flags.out);
16
16
  const from = given(flags.policy);
17
- const { runPowerSync } = await import("./powersync-CnGzxvEl.js");
17
+ const { runPowerSync } = await import("./powersync-0QVP_DuR.js");
18
18
  return runPowerSync({
19
19
  cwd: ctx.cwd,
20
20
  config: ctx.config,
@@ -45,7 +45,7 @@ const verify = defineLeaf({
45
45
  const db = await dbUrl(ctx, flags, { required: true });
46
46
  const fixtures = given(flags.fixtures);
47
47
  const from = given(flags.policy);
48
- const { runPowerSync } = await import("./powersync-CnGzxvEl.js");
48
+ const { runPowerSync } = await import("./powersync-0QVP_DuR.js");
49
49
  return runPowerSync({
50
50
  cwd: ctx.cwd,
51
51
  config: ctx.config,
@@ -0,0 +1 @@
1
+ export { n as runCloudPull } from "./pull-CQCGy1gv.js";
@@ -7,7 +7,7 @@ import { o as formatCatalogJson } from "./catalog-doc-DjMKzJp9.js";
7
7
  import { t as catalogPath } from "./catalog-path-CnI0XTFK.js";
8
8
  import { n as parseSupabaseManifest } from "./manifest-BXTbHNIV.js";
9
9
  import { t as parseCatalog } from "./parse-1_ZheTW5.js";
10
- import { a as nonEmptyOr } from "./output-BVZpQDad.js";
10
+ import { a as nonEmptyOr } from "./output-DlICTjBh.js";
11
11
  import { t as POLICY_NOT_PUBLISHED } from "./problem-types-DSsRfONQ.js";
12
12
  import { n as httpRequest, t as authFailure } from "./http-DOL33cO0.js";
13
13
  import { l as cloudUrl, n as cliRuntime, o as readAuth } from "./auth--yPyZNgr.js";
@@ -192,7 +192,7 @@ async function rlsInput(ctx, verb, shape, options) {
192
192
  };
193
193
  }
194
194
  async function runRls(input) {
195
- return (await import("./rls-BwKXdVEW.js")).runRls(input);
195
+ return (await import("./rls-tHu7N_Pe.js")).runRls(input);
196
196
  }
197
197
  const generate = defineLeaf({
198
198
  flags: {
@@ -11,10 +11,10 @@ import "./sources-C4vkzZJV.js";
11
11
  import { t as policyFromCatalog } from "./policy-from-catalog-CU3An8uP.js";
12
12
  import { t as beforeFirst } from "./text-BMFRfBqc.js";
13
13
  import { i as INDEXES_MARKER, n as GRANTS_MARKER, o as SEEDS_MARKER, t as BACKFILL_MARKER } from "./markers-BeHZ4x9Q.js";
14
- import { a as nonEmptyOr } from "./output-BVZpQDad.js";
14
+ import { a as nonEmptyOr } from "./output-DlICTjBh.js";
15
15
  import { i as requirePeer, n as packageManagerOf, t as addLine } from "./peer-Q0fuZ6hx.js";
16
16
  import { t as POLICY_NOT_PUBLISHED } from "./problem-types-DSsRfONQ.js";
17
- import { t as fetchProjectPolicy } from "./pull-BBmCxnqX.js";
17
+ import { t as fetchProjectPolicy } from "./pull-CQCGy1gv.js";
18
18
  import { n as MIGRATION_DIRS } from "./constants-DcJABbLW.js";
19
19
  import { a as isSeedsDirectory, c as parseSplit, d as seedsMigration, f as writeOutputFiles, l as partPath, n as dataMigrationFile, r as driftOf, u as pgDeltaPath } from "./output-files-BIQ_9pIs.js";
20
20
  import { b as rbacScaffold, d as resolveSchemas, f as schemasRefusal, o as supabaseHookSql, p as declarativeSql, s as approvalsSql, t as grantsLabel, u as isSupabaseSchemas, y as parseRbacAuthorize } from "./supabase-hook-HPgwYb9V.js";
@@ -25,8 +25,8 @@ import { a as splitUndiffed } from "./deciding-columns-NB4wcyBf.js";
25
25
  import { t as connectPgPool } from "./pg-DQTqRrou.js";
26
26
  import { a as fieldViewsSql, c as ACTOR_MAY_WRITE, f as readOnlyActorKinds, i as fieldViews, l as actorMayWriteSql, n as columnGrantSql, o as rowBranches, p as readOnlyActorPolicies, r as columnRevokeSql, u as assemblePolicies } from "./fields-DI8s3cPl.js";
27
27
  import { n as permissionHoldersSql } from "./resolve-names-Y1Cb22cp.js";
28
- import { _ as indexTargets, a as verifyResult, b as readTableIndexFacts, c as callsHelper, g as INDEX_COLUMNS_SQL, h as COLUMNS_SQL, i as verifyIgnores, l as helperCallKeys, m as tableFor, n as runRlsVerify, o as HELPER_TABLES, p as compileGrants, r as rlsFinding, v as indexesSql, y as pruneIndexTargets } from "./verify-CgIpJRcG.js";
29
- import { a as buildContext, c as levelKeys, d as rebuildPlan, i as splitsPart, l as rowHelpersSql, n as generateOptions, o as CANDIDATES, r as isRefusal, s as inheritTargets, t as supautilsRejections, u as DROPPED_LIST } from "./supautils-CGk4YpvC.js";
28
+ import { _ as indexTargets, a as verifyResult, b as readTableIndexFacts, c as callsHelper, g as INDEX_COLUMNS_SQL, h as COLUMNS_SQL, i as verifyIgnores, l as helperCallKeys, m as tableFor, n as runRlsVerify, o as HELPER_TABLES, p as compileGrants, r as rlsFinding, v as indexesSql, y as pruneIndexTargets } from "./verify-DfT0QYNh.js";
29
+ import { a as buildContext, c as levelKeys, d as rebuildPlan, i as splitsPart, l as rowHelpersSql, n as generateOptions, o as CANDIDATES, r as isRefusal, s as inheritTargets, t as supautilsRejections, u as DROPPED_LIST } from "./supautils-SwE642N1.js";
30
30
  import { readFileSync } from "node:fs";
31
31
  import { basename, delimiter, join } from "node:path";
32
32
  import { spawn } from "node:child_process";
@@ -0,0 +1 @@
1
+ export { t as run } from "./run-DUq1xU4K.js";
@@ -5,9 +5,9 @@ import { a as resolveCwd, i as readConfig } from "./config-CcLlvEYW.js";
5
5
  import { t as beforeFirst } from "./text-BMFRfBqc.js";
6
6
  import { a as suggestion, i as parseLeaf, n as flagSpellings, o as GLOBAL_FLAGS, r as parseFlags } from "./args-0FrVs5EH.js";
7
7
  import { r as progressReporter, t as redact } from "./credentials-CdDxp7jN.js";
8
- import { a as resolve, i as leaves, n as ROOT, r as SECTIONS, t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
8
+ import { a as resolve, i as leaves, n as ROOT, r as SECTIONS, t as DOCS_BASE } from "./manifest-Cft51TLK.js";
9
9
  import { t as createStyle } from "./style-Ds11Hmk4.js";
10
- import { i as githubAnnotations, n as envelope, o as sarifLog, t as dataOf } from "./output-BVZpQDad.js";
10
+ import { i as githubAnnotations, n as envelope, o as sarifLog, t as dataOf } from "./output-DlICTjBh.js";
11
11
  import { i as renameMessage, r as flagRename, t as COMMAND_MOVES } from "./renames-CGj7YwcQ.js";
12
12
  import { stripVTControlCharacters } from "node:util";
13
13
  import { existsSync, statSync } from "node:fs";
@@ -16,7 +16,7 @@ const scan = defineLeaf({
16
16
  }
17
17
  },
18
18
  async run(ctx, { flags }) {
19
- const { runAdoptionScan } = await import("./adoption-scan-DLel53Oa.js");
19
+ const { runAdoptionScan } = await import("./adoption-scan-C2BCiUEG.js");
20
20
  return runAdoptionScan({
21
21
  cwd: ctx.cwd,
22
22
  srcPath: flags.src.length > 0 ? flags.src : ctx.config.collect?.srcPath ?? ["src"],
@@ -1,7 +1,7 @@
1
1
  import { r as isRecord } from "./compact-CAf557ZB.js";
2
2
  import { l as packageRoot } from "./version-DMQ0dnN5.js";
3
3
  import { t as DRAFT_PINS } from "./pins-nqarl3oE.js";
4
- import { a as nonEmptyOr } from "./output-BVZpQDad.js";
4
+ import { a as nonEmptyOr } from "./output-DlICTjBh.js";
5
5
  import { t as require__2020 } from "./2020-CJbO8Bvz.js";
6
6
  import { readFileSync } from "node:fs";
7
7
  import { join } from "node:path";
@@ -1,7 +1,7 @@
1
1
  import { t as defineLeaf } from "./command-L8EstFNm.js";
2
2
  import { t as checkFlag } from "./flags-DXjoTVbS.js";
3
3
  import { r as pick, t as CANCELLED } from "./prompt-BYc6drYW.js";
4
- import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-BZxPQ_09.js";
4
+ import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-Celu2W6v.js";
5
5
  //#region src/cli/commands/skills.ts
6
6
  const forFlag = { for: {
7
7
  type: "string",
@@ -2,7 +2,7 @@ import { t as byCodePoint } from "./compare-DTfyUunF.js";
2
2
  import { i as readJsonFile } from "./files-BSjrtIHw.js";
3
3
  import { l as packageRoot } from "./version-DMQ0dnN5.js";
4
4
  import { t as didYouMean } from "./args-0FrVs5EH.js";
5
- import { a as nonEmptyOr } from "./output-BVZpQDad.js";
5
+ import { a as nonEmptyOr } from "./output-DlICTjBh.js";
6
6
  import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, writeFileSync } from "node:fs";
7
7
  import { basename, dirname, join, relative, resolve } from "node:path";
8
8
  import { pathToFileURL } from "node:url";
@@ -16,7 +16,7 @@ import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
16
16
  import { i as group, o as sqlStatements } from "./deciding-columns-NB4wcyBf.js";
17
17
  import { d as orSql, h as branchClauses } from "./fields-DI8s3cPl.js";
18
18
  import { t as resolveNames } from "./resolve-names-Y1Cb22cp.js";
19
- import { m as tableFor } from "./verify-CgIpJRcG.js";
19
+ import { m as tableFor } from "./verify-DfT0QYNh.js";
20
20
  //#region src/cli/rls/custom-role-rebuild.ts
21
21
  const PREFIX = "PermDock CLI";
22
22
  /** A column of the roles-table row `r`. */
@@ -400,10 +400,11 @@ function permissionCase(key, branches) {
400
400
  const granted = `coalesce((${allow}), false)`;
401
401
  return ` when ${quoteLiteral(key)} then ${deny === void 0 ? granted : `${granted} and (${deny}) is not true`}`;
402
402
  }
403
- function forUserSql(ctx, fn, helper) {
403
+ function forUserSql(ctx, fn, helper, ids) {
404
404
  const user = ctx.dialect === "supabase" ? "uuid" : "text";
405
- const signature = `${user}, text, jsonb`;
406
- const head = `create or replace function ${fn}(p_user ${user}, p_permission text, p_claims jsonb default '{}')
405
+ const signature = `${user}, text, ${ids ? "text[], " : ""}jsonb`;
406
+ const call = `${helper}(p_permission${ids ? ", p_ids" : ""})`;
407
+ const head = `create or replace function ${fn}(p_user ${user}, p_permission text, ${ids ? "p_ids text[], " : ""}p_claims jsonb default '{}')
407
408
  returns setof text
408
409
  language plpgsql
409
410
  volatile
@@ -420,7 +421,7 @@ begin
420
421
  (coalesce(p_claims, '{}'::jsonb) || pg_catalog.jsonb_build_object('sub', p_user::text, 'role', 'authenticated'))::text,
421
422
  true
422
423
  );
423
- return query select r.id from ${helper}(p_permission) r(id);
424
+ return query select r.id from ${call} r(id);
424
425
  perform pg_catalog.set_config('request.jwt.claims', coalesce(v_claims, ''), true);
425
426
  end
426
427
  $$;
@@ -440,7 +441,7 @@ begin
440
441
  v_saved := v_saved || pg_catalog.jsonb_build_object(v_key, coalesce(pg_catalog.current_setting(${quoteLiteral(`${prefix}.`)} || v_key, true), ''));
441
442
  perform pg_catalog.set_config(${quoteLiteral(`${prefix}.`)} || v_key, v_value, true);
442
443
  end loop;
443
- return query select r.id from ${helper}(p_permission) r(id);
444
+ return query select r.id from ${call} r(id);
444
445
  for v_key, v_value in select s.key, s.value from pg_catalog.jsonb_each_text(v_saved) s loop
445
446
  perform pg_catalog.set_config(${quoteLiteral(`${prefix}.`)} || v_key, v_value, true);
446
447
  end loop;
@@ -551,7 +552,8 @@ ${rowSql(ctx, name, table, near)}`;
551
552
  if (ctx.dialect === "neon") return rows;
552
553
  return `${rows}
553
554
  -- the same rows for a user the caller names, with claims it supplies; no client role may execute it
554
- ${forUserSql(ctx, qualified(ctx, `${name}_for`), fn)}`;
555
+ ${forUserSql(ctx, qualified(ctx, `${name}_for`), fn, false)}
556
+ ${forUserSql(ctx, qualified(ctx, `${name}_for`), fn, true)}`;
555
557
  }
556
558
  /**
557
559
  * `permitted_<resource>_rows(p_permission)` for each resource `select` names
@@ -6,8 +6,8 @@ import { c as jsonSchemaOf } from "./catalog-doc-DjMKzJp9.js";
6
6
  import { a as loadModule, n as asPolicy, s as pickNamed } from "./load-DjSU5KXO.js";
7
7
  import { r as runCollect } from "./collect-WCl8cJQV.js";
8
8
  import { t as beforeFirst } from "./text-BMFRfBqc.js";
9
- import { t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
10
- import { r as findingOf } from "./output-BVZpQDad.js";
9
+ import { t as DOCS_BASE } from "./manifest-Cft51TLK.js";
10
+ import { r as findingOf } from "./output-DlICTjBh.js";
11
11
  import { existsSync, readFileSync, realpathSync } from "node:fs";
12
12
  import { dirname, resolve } from "node:path";
13
13
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -16,7 +16,7 @@ const usage = defineLeaf({
16
16
  }
17
17
  },
18
18
  async run(ctx, { flags }) {
19
- return (await import("./usage-D3KJyaNS.js")).runUsage({
19
+ return (await import("./usage-DmmO_xjJ.js")).runUsage({
20
20
  cwd: ctx.cwd,
21
21
  config: ctx.config,
22
22
  ignore: flags.ignore,
@@ -0,0 +1 @@
1
+ export { t as runUsage } from "./usage-CPXeuAdT.js";
@@ -22,7 +22,7 @@ import { i as qualifySqlTable, n as defaultSqlCommand, t as SQL_IDENT } from "./
22
22
  import { a as scopeMembershipTable, i as scopeColumn } from "./compile-EzEMB-7v.js";
23
23
  import "./sources-C4vkzZJV.js";
24
24
  import { t as beforeFirst } from "./text-BMFRfBqc.js";
25
- import { t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
25
+ import { t as DOCS_BASE } from "./manifest-Cft51TLK.js";
26
26
  import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-Bm4_K1ke.js";
27
27
  import { A as quoteQualified, N as arrayColumnsOf, O as quoteIdent, P as columnTypesOf, _ as subjectClaimJsonSql, a as customRolesOn, j as quoteTable, k as quoteLiteral, r as HELPERS, v as subjectClaimSql } from "./shared-DrGLwM3s.js";
28
28
  import { C as accessSql, D as tokenScopeAllowsCall, S as requiresSql, ht as scopeTable, k as capabilityAccessSql, n as tableNameOf, o as graphPlan, q as apiKeyAllowsCall, r as tableNames } from "./tables-DimBcVWY.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "permdock",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Typed permissions for TypeScript apps, APIs, databases, and AI agents, with the permdock CLI and test runners.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -36,7 +36,7 @@ pnpm exec permdock rls verify --introspect
36
36
  ```
37
37
 
38
38
  - List the scope instances a permission reaches in process with `permdock.permittedIds(permission, scope, { within })`, never a loop of `can` over memberships with a made-up row.
39
- - Generated policies call `permdock_has('<key>')` and one `permitted_<scope>_ids('<key>')` per declared scope, which Postgres runs once per statement. Hand-written policies that only need membership (an organization switcher) call `member_<scope>_ids()` instead of inventing a permission key. A policy that passes a user id, such as better-supabase's team sharing, calls `member_team_ids_of(<user>)` on Supabase: it answers only when the id is the caller's. Trusted SQL that acts for a stored user (a job, a trigger, a deferred approval) calls `permdock_has_for(p_user, '<key>')` and `permitted_<scope>_ids_for(p_user, '<key>')` in `database` mode, or the generated `permitted_<resource>_rows_for`, never a hand-written function that rewrites `request.jwt.claims`. With `rls.rowHelpers`, a hand-written policy or function that needs the rows a permission reaches through the graph calls `permitted_<resource>_rows('<permission key>')` instead of restating closure walks, link hops and `includes`. A table's own `select` or `insert` policy calls the row-valued `permitted_<resource>_row(<table>, '<permission key>')` instead, so `insert ... returning` sees the new row. A function that checks a known set of rows (one tenant's, a page, a batch) calls `permitted_<resource>_rows('<permission key>', <text[] of ids>)`, which reads only those ids, instead of the one-argument form, which reads the whole table, or a `permitted_<resource>_row` call per row. Hand-written policies and functions that apply no row condition call `permitted_<scope>_ids_by_permission('<permission key>')` or `permdock_has_permission('<permission key>')` instead of spelling a positional `#n` grant key. A screen or RPC that checks many permissions on one organization calls `permitted_<scope>_permission_keys(<id>)` once (or `(<id>, array['<key>', ...])` for a few keys) instead of one helper call per key. A role editor or admin screen lists a role's keys with `permdock_role_permissions(p_role, p_scope, p_tenant, p_scope_id)` (declared roles, and custom roles of the caller's tenant in `database` mode) and the catalog with `permdock_permission_keys()` (`permdock_permission_keys('<scope>')` for the keys a role on that scope can hold), instead of joining `role_permissions` and the custom-role tables by hand; server code reads any tenant's roles with `permdock_trusted_role_permissions`, granted through `rls.trustedReaders`. Set `--tenant-type` (or `rls.scopeTypes`, keyed by scope name or `tenant` and `team`) to the scope columns' types.
39
+ - Generated policies call `permdock_has('<key>')` and one `permitted_<scope>_ids('<key>')` per declared scope, which Postgres runs once per statement. Hand-written policies that only need membership (an organization switcher) call `member_<scope>_ids()` instead of inventing a permission key. A policy that passes a user id, such as better-supabase's team sharing, calls `member_team_ids_of(<user>)` on Supabase: it answers only when the id is the caller's. Trusted SQL that acts for a stored user (a job, a trigger, a deferred approval) calls `permdock_has_for(p_user, '<key>')` and `permitted_<scope>_ids_for(p_user, '<key>')` in `database` mode, or the generated `permitted_<resource>_rows_for` (`permitted_<resource>_rows_for(p_user, '<key>', <text[] of ids>)` for a known set of rows, such as a share link checked against its creator's access), never a hand-written function that rewrites `request.jwt.claims`. With `rls.rowHelpers`, a hand-written policy or function that needs the rows a permission reaches through the graph calls `permitted_<resource>_rows('<permission key>')` instead of restating closure walks, link hops and `includes`. A table's own `select` or `insert` policy calls the row-valued `permitted_<resource>_row(<table>, '<permission key>')` instead, so `insert ... returning` sees the new row. A function that checks a known set of rows (one tenant's, a page, a batch) calls `permitted_<resource>_rows('<permission key>', <text[] of ids>)`, which reads only those ids, instead of the one-argument form, which reads the whole table, or a `permitted_<resource>_row` call per row. Hand-written policies and functions that apply no row condition call `permitted_<scope>_ids_by_permission('<permission key>')` or `permdock_has_permission('<permission key>')` instead of spelling a positional `#n` grant key. A screen or RPC that checks many permissions on one organization calls `permitted_<scope>_permission_keys(<id>)` once (or `(<id>, array['<key>', ...])` for a few keys) instead of one helper call per key. A role editor or admin screen lists a role's keys with `permdock_role_permissions(p_role, p_scope, p_tenant, p_scope_id)` (declared roles, and custom roles of the caller's tenant in `database` mode) and the catalog with `permdock_permission_keys()` (`permdock_permission_keys('<scope>')` for the keys a role on that scope can hold), instead of joining `role_permissions` and the custom-role tables by hand; server code reads any tenant's roles with `permdock_trusted_role_permissions`, granted through `rls.trustedReaders`. Set `--tenant-type` (or `rls.scopeTypes`, keyed by scope name or `tenant` and `team`) to the scope columns' types.
40
40
  - `--authorize database` (default) reads the membership tables per statement; map each under `rls.memberships.scopes.<scope>` with `columns` for its id and its ancestors', and `via` so roles with `for` apply: a column name, or `{ value: 'staff' }` when every row has that kind (never add a generated column for it). `--authorize jwt` reads token claims and stays stale until the token refreshes; keep the token lifetime at 3600 seconds or less (PD019).
41
41
  - When the role column holds values that are not role keys, give the membership source `role: { column, map: { value: 'role' } }`; a value mapped to `null` grants nothing. `permdock rls explain` prints the tables, membership sources, custom roles table and triggers a generate run binds to, without writing a file. `rls.seeds: 'function'` writes the `role_permissions` rows as `<schema>.seed()` instead of inserts; run `select <schema>.seed();` after each deploy, and PD054 checks the function body.
42
42
  - `rls verify --introspect` checks each `security definer` helper by its full signature, so every overload is checked on its own. A helper finding id names the signature (`helper-definer:permdock.permdock_has(text):helper`); write `rls.verify.ignore` entries with it.
@@ -1 +0,0 @@
1
- export { n as runPowerSync } from "./powersync-uqYWxTjq.js";
@@ -1 +0,0 @@
1
- export { n as runCloudPull } from "./pull-BBmCxnqX.js";
@@ -1 +0,0 @@
1
- export { t as run } from "./run-D5WIJfs7.js";
@@ -1 +0,0 @@
1
- export { t as runUsage } from "./usage-e6M1Mls1.js";