studiograph 1.3.48-next.236 → 1.3.48-next.237
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/cli/commands/admin/migrate-asset-owners.d.ts +4 -3
- package/dist/cli/commands/admin/migrate-asset-owners.js +4 -3
- package/dist/cli/commands/admin/migrate-asset-owners.js.map +1 -1
- package/dist/core/graph.d.ts +11 -28
- package/dist/core/graph.js +18 -46
- package/dist/core/graph.js.map +1 -1
- package/dist/core/workspace-manager.d.ts +5 -0
- package/dist/core/workspace-manager.js +7 -0
- package/dist/core/workspace-manager.js.map +1 -1
- package/dist/mcp/tools.js +2 -2
- package/dist/mcp/tools.js.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/asset-api.d.ts +7 -1
- package/dist/server/routes/asset-api.js +107 -31
- package/dist/server/routes/asset-api.js.map +1 -1
- package/dist/server/routes/chat-sessions-api.js +2 -0
- package/dist/server/routes/chat-sessions-api.js.map +1 -1
- package/dist/server/routes/chat.js +2 -0
- package/dist/server/routes/chat.js.map +1 -1
- package/dist/server/routes/git-http.js +1 -0
- package/dist/server/routes/git-http.js.map +1 -1
- package/dist/server/routes/graph-api.js +21 -15
- package/dist/server/routes/graph-api.js.map +1 -1
- package/dist/server/ws-hub.d.ts +13 -0
- package/dist/server/ws-hub.js.map +1 -1
- package/dist/services/asset-delete-authz.d.ts +3 -2
- package/dist/services/asset-delete-authz.js +3 -2
- package/dist/services/asset-delete-authz.js.map +1 -1
- package/dist/services/asset-delete-impact.d.ts +63 -0
- package/dist/services/asset-delete-impact.js +184 -0
- package/dist/services/asset-delete-impact.js.map +1 -0
- package/dist/services/asset-import-service.d.ts +2 -2
- package/dist/services/asset-import-service.js +8 -8
- package/dist/services/asset-import-service.js.map +1 -1
- package/dist/services/asset-listing.d.ts +2 -1
- package/dist/services/asset-listing.js +8 -30
- package/dist/services/asset-listing.js.map +1 -1
- package/dist/services/asset-presign-service.d.ts +0 -6
- package/dist/services/asset-presign-service.js +5 -3
- package/dist/services/asset-presign-service.js.map +1 -1
- package/dist/services/assets/asset-index-service.d.ts +2 -2
- package/dist/services/assets/asset-index-service.js +2 -2
- package/dist/services/assets/asset-index-service.js.map +1 -1
- package/dist/web/_app/immutable/assets/{0.CA25jFwH.css → 0.CbwnbgGB.css} +1 -1
- package/dist/web/_app/immutable/assets/4.CdxzP04G.css +1 -0
- package/dist/web/_app/immutable/assets/{6.Dsyv62EW.css → 6.CJM9gaf9.css} +1 -1
- package/dist/web/_app/immutable/assets/Link.sbZLqnki.css +1 -0
- package/dist/web/_app/immutable/chunks/{D8BnezyQ.js → 0PnZwgWn.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DFGCIkrn.js → 1rby9kmc.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B1Yv3YkO.js → 2eVtOz9o.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BID6RR6x.js → 2lP0otoc.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BRvQi6Em.js → 3HNH6GR3.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BW-sf0N4.js → 3mkRcVr2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CNZ4WbQZ2.js → AyylXGSv2.js} +2 -2
- package/dist/web/_app/immutable/chunks/{CkUlbgAA.js → B-RJDnQx.js} +2 -2
- package/dist/web/_app/immutable/chunks/{DiI1jBja.js → B-gUYquP2.js} +1 -1
- package/dist/web/_app/immutable/chunks/B-vWtmR7.js +1 -0
- package/dist/web/_app/immutable/chunks/{D1gGgXQm.js → B0d8HR61.js} +1 -1
- package/dist/web/_app/immutable/chunks/B29EhrOv2.js +1 -0
- package/dist/web/_app/immutable/chunks/{BXHOsgSc2.js → B44DTjoO2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DGZnT3Ll2.js → B4p_LX9w2.js} +1 -1
- package/dist/web/_app/immutable/chunks/B9UyjBos2.js +1 -0
- package/dist/web/_app/immutable/chunks/BHdkxQJT.js +1 -0
- package/dist/web/_app/immutable/chunks/{BTem_tOH.js → BME5JXHO.js} +1 -1
- package/dist/web/_app/immutable/chunks/BRoraic8.js +2 -0
- package/dist/web/_app/immutable/chunks/BSBfdnem.js +1 -0
- package/dist/web/_app/immutable/chunks/{OXT03PoL.js → BSQ1QNW32.js} +1 -1
- package/dist/web/_app/immutable/chunks/BUT2UiIX.js +1 -0
- package/dist/web/_app/immutable/chunks/{BJlxhEoD.js → BVUtKMul.js} +1 -1
- package/dist/web/_app/immutable/chunks/{RFTfNbDP2.js → BWIgIymm2.js} +1 -1
- package/dist/web/_app/immutable/chunks/BYA7Rrzt.js +6 -0
- package/dist/web/_app/immutable/chunks/{Y1ENS0GB.js → BaCR2693.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B8DJdurC.js → BcK0Ez95.js} +1 -1
- package/dist/web/_app/immutable/chunks/BjHTv1l72.js +2 -0
- package/dist/web/_app/immutable/chunks/BjuJM6rX.js +1 -0
- package/dist/web/_app/immutable/chunks/BrnN_HSo2.js +1 -0
- package/dist/web/_app/immutable/chunks/C-tNFk92.js +1 -0
- package/dist/web/_app/immutable/chunks/{DkChpwez.js → C0mi618o.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Bm641JMK.js → C18dD2J-.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CTnH7lHd.js → C1EvrL_7.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BqDOI35W.js → C1QKRCU-.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Ck3GnGJR.js → C3iXOzlc.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D7LMBsC4.js → C3m2Uq4g.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DkgJCMcD.js → CMYkbOHH.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DA1iSzCa.js → COIwtD-v.js} +2 -2
- package/dist/web/_app/immutable/chunks/CUXamJaA.js +1 -0
- package/dist/web/_app/immutable/chunks/{4_3KsHpG.js → CVLnsfaP.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BIzLVcn2.js → CWFuFysO.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BFyVYKoE2.js → Cb8T8f2g2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{hjrUOIh12.js → CkCX2Cbp2.js} +1 -1
- package/dist/web/_app/immutable/chunks/CrZvYR5P2.js +2 -0
- package/dist/web/_app/immutable/chunks/{BjSY-Vbx.js → CypyklLr.js} +1 -1
- package/dist/web/_app/immutable/chunks/D0tmF18U2.js +7 -0
- package/dist/web/_app/immutable/chunks/{UvTU7nBa2.js → D2KDjtf9.js} +1 -1
- package/dist/web/_app/immutable/chunks/{C6uQGeGq.js → D4KwPRah.js} +2 -2
- package/dist/web/_app/immutable/chunks/{CxgxxYMb.js → D4WDOSTI.js} +1 -1
- package/dist/web/_app/immutable/chunks/D5Nx6OBM.js +1 -0
- package/dist/web/_app/immutable/chunks/{DpCSnFt52.js → DCrXivaw2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CbIhWL_u2.js → DFjGiEbx2.js} +2 -2
- package/dist/web/_app/immutable/chunks/{C6cZM_XT.js → DSXnCWGk.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B8_f95Bi.js → DUAqDJxa.js} +1 -1
- package/dist/web/_app/immutable/chunks/DXSotRNL.js +2 -0
- package/dist/web/_app/immutable/chunks/{BTL1Tz77.js → Dd7bkVml.js} +2 -2
- package/dist/web/_app/immutable/chunks/DhUOgfgR.js +2 -0
- package/dist/web/_app/immutable/chunks/DjmCCRoK.js +1 -0
- package/dist/web/_app/immutable/chunks/{DgsJh7pb.js → DmfQFTnb.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DodsVHxu.js → DtCrXNDU.js} +1 -1
- package/dist/web/_app/immutable/chunks/J9wzmy3l2.js +1 -0
- package/dist/web/_app/immutable/chunks/{BpAhYe_M.js → LCa8e6zu.js} +1 -1
- package/dist/web/_app/immutable/chunks/MXBsawC4.js +1 -0
- package/dist/web/_app/immutable/chunks/{CGLbxVZP.js → Pc5_42cj.js} +3 -3
- package/dist/web/_app/immutable/chunks/UZu_W1XF.js +1 -0
- package/dist/web/_app/immutable/chunks/{DRLDVcUj.js → _wW4T6R2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DKG0oyDG.js → cg9eVoLO.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BrPVmIe-.js → cuN5XjUH.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DOUwBclM.js → d2Yb968P.js} +1 -1
- package/dist/web/_app/immutable/chunks/elDMEPuQ.js +1 -0
- package/dist/web/_app/immutable/chunks/{7-fazrJY2.js → iZ7-Tw7U2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BGHjcdpb.js → n2xzKaVS.js} +1 -1
- package/dist/web/_app/immutable/chunks/sj-wNjc-.js +2 -0
- package/dist/web/_app/immutable/chunks/sjKLWCue.js +8 -0
- package/dist/web/_app/immutable/chunks/uBQcaK0U.js +1 -0
- package/dist/web/_app/immutable/chunks/{BzadW_Cg2.js → yywLqG5W2.js} +1 -1
- package/dist/web/_app/immutable/chunks/zWel6LHH.js +1 -0
- package/dist/web/_app/immutable/entry/app.CdqoThtw.js +2 -0
- package/dist/web/_app/immutable/entry/start.Fm1pGXR-.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.BSCKSJCx.js → 0.CDrYGZrF.js} +2 -2
- package/dist/web/_app/immutable/nodes/{1.-YsTb9ZY.js → 1.Db3GKNa_.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.DP53ihDD.js → 10.BxX5374d.js} +1 -1
- package/dist/web/_app/immutable/nodes/{11.f-o_uzfd.js → 11.CaRo9tsl.js} +1 -1
- package/dist/web/_app/immutable/nodes/{12.MsYMXeTb.js → 12.BEE3skpI.js} +1 -1
- package/dist/web/_app/immutable/nodes/{13.HaEvtp-z.js → 13.Dzr1VXUT.js} +1 -1
- package/dist/web/_app/immutable/nodes/{15.ftCgl2f9.js → 15.DyByLaAI.js} +1 -1
- package/dist/web/_app/immutable/nodes/{16.BF-Ijg6M.js → 16.CQ1g-7fy.js} +1 -1
- package/dist/web/_app/immutable/nodes/{17.C4Ogd1RT.js → 17.BbE6Ymxb.js} +1 -1
- package/dist/web/_app/immutable/nodes/{18.Bi1OIr6S.js → 18.M8tlcB7i.js} +1 -1
- package/dist/web/_app/immutable/nodes/2.D5mBiTdK.js +123 -0
- package/dist/web/_app/immutable/nodes/3.DpkHByUG.js +6 -0
- package/dist/web/_app/immutable/nodes/4.CED6FDPc.js +11 -0
- package/dist/web/_app/immutable/nodes/{5.DRoLBlnR.js → 5.h64blRxn.js} +1 -1
- package/dist/web/_app/immutable/nodes/6.BvvpiAqF.js +6 -0
- package/dist/web/_app/immutable/nodes/{7.BTXFLEub.js → 7.DqvXtdXA.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.DWIq4aZz.js → 8.BsTKfXV8.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.CQ5wxWL3.js → 9.BZqNZnO6.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +17 -17
- package/package.json +1 -1
- package/dist/web/_app/immutable/assets/4.Djblzx96.css +0 -1
- package/dist/web/_app/immutable/assets/Link.1qdkQHCf.css +0 -1
- package/dist/web/_app/immutable/chunks/4ickW77P2.js +0 -1
- package/dist/web/_app/immutable/chunks/6x24K_x8.js +0 -6
- package/dist/web/_app/immutable/chunks/B5rijxAP.js +0 -1
- package/dist/web/_app/immutable/chunks/B7doQgAK.js +0 -1
- package/dist/web/_app/immutable/chunks/BDQLTskj.js +0 -1
- package/dist/web/_app/immutable/chunks/BKMupfbM.js +0 -1
- package/dist/web/_app/immutable/chunks/BVQQTlFf2.js +0 -1
- package/dist/web/_app/immutable/chunks/Bi-1YZX9.js +0 -1
- package/dist/web/_app/immutable/chunks/BnfhBFjQ2.js +0 -1
- package/dist/web/_app/immutable/chunks/C3TbjmW_.js +0 -1
- package/dist/web/_app/immutable/chunks/CEhbe5gE2.js +0 -1
- package/dist/web/_app/immutable/chunks/CUNgLXBy.js +0 -2
- package/dist/web/_app/immutable/chunks/CWnxG-aY2.js +0 -1
- package/dist/web/_app/immutable/chunks/CZUEBpI1.js +0 -8
- package/dist/web/_app/immutable/chunks/Ca8AGdcM.js +0 -1
- package/dist/web/_app/immutable/chunks/CaUuI0qw.js +0 -2
- package/dist/web/_app/immutable/chunks/CrwD95qi.js +0 -1
- package/dist/web/_app/immutable/chunks/DBNEWhmh2.js +0 -7
- package/dist/web/_app/immutable/chunks/DBkvT8Or.js +0 -2
- package/dist/web/_app/immutable/chunks/DOPRSg8K.js +0 -1
- package/dist/web/_app/immutable/chunks/DTTUpmx3.js +0 -1
- package/dist/web/_app/immutable/chunks/DqmkIxBb2.js +0 -2
- package/dist/web/_app/immutable/chunks/Dv03G3ns.js +0 -1
- package/dist/web/_app/immutable/chunks/DxMLkFRk.js +0 -2
- package/dist/web/_app/immutable/chunks/FuiJnZG0.js +0 -1
- package/dist/web/_app/immutable/chunks/Iv2tLcWB2.js +0 -2
- package/dist/web/_app/immutable/chunks/anMAD2SC.js +0 -1
- package/dist/web/_app/immutable/chunks/vYSZoUpd2.js +0 -1
- package/dist/web/_app/immutable/entry/app.BB_9aYKP.js +0 -2
- package/dist/web/_app/immutable/entry/start.Dz2pBAjp.js +0 -1
- package/dist/web/_app/immutable/nodes/2.Bp6_GcT-.js +0 -123
- package/dist/web/_app/immutable/nodes/3.BJNAxlVS.js +0 -6
- package/dist/web/_app/immutable/nodes/4.fVMGSPSv.js +0 -11
- package/dist/web/_app/immutable/nodes/6.CMh8y6Rg.js +0 -6
- /package/dist/web/_app/immutable/chunks/{CWKmhwV0.js → CWKmhwV02.js} +0 -0
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
* - Orphan-owner rows (owner entity already deleted) home to the repo like
|
|
18
18
|
* any other row — they surface as library assets, never deleted.
|
|
19
19
|
* - Verification: COUNT(*) of remaining entity-owned rows must be 0 after a
|
|
20
|
-
* real run; a non-zero count exits 1.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* real run; a non-zero count exits 1. (This query originally gated the
|
|
21
|
+
* P1.5 dead-code delete, which has landed — uploads now structurally
|
|
22
|
+
* refuse entity owners, so this command is the one-time repair for rows
|
|
23
|
+
* that predate P1.)
|
|
23
24
|
*
|
|
24
25
|
* Per-workspace: run on each serving instance (assets.db is volume-local),
|
|
25
26
|
* like `admin migrate-assets`.
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
* - Orphan-owner rows (owner entity already deleted) home to the repo like
|
|
18
18
|
* any other row — they surface as library assets, never deleted.
|
|
19
19
|
* - Verification: COUNT(*) of remaining entity-owned rows must be 0 after a
|
|
20
|
-
* real run; a non-zero count exits 1.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* real run; a non-zero count exits 1. (This query originally gated the
|
|
21
|
+
* P1.5 dead-code delete, which has landed — uploads now structurally
|
|
22
|
+
* refuse entity owners, so this command is the one-time repair for rows
|
|
23
|
+
* that predate P1.)
|
|
23
24
|
*
|
|
24
25
|
* Per-workspace: run on each serving instance (assets.db is volume-local),
|
|
25
26
|
* like `admin migrate-assets`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-asset-owners.js","sourceRoot":"","sources":["../../../../src/cli/commands/admin/migrate-asset-owners.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"migrate-asset-owners.js","sourceRoot":"","sources":["../../../../src/cli/commands/admin/migrate-asset-owners.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AA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CAAC,EAAE,CACjE,CAAC;IACJ,CAAC;IACD,GAAG,CAAC,IAAI,CACN,4BAA4B,MAAM,CAAC,WAAW,IAAI;QAClD,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,yBAAyB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI;QAC9H,8DAA8D,MAAM,CAAC,SAAS,EAAE,CACjF,CAAC;IAEF,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,KAAK,CAAC,EAAE,CAAC;QAC3C,KAAK,CAAC,wBAAwB,MAAM,CAAC,SAAS,mEAAmE,CAAC,CAAC;QACnH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChB,OAAO;IACT,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,MAAM;QACf,CAAC,CAAC,wCAAwC;QAC1C,CAAC,CAAC,wBAAwB,MAAM,CAAC,SAAS,oDAAoD,CAAC,CAAC;AACpG,CAAC,CAAC,CAAC"}
|
package/dist/core/graph.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { GitService, GitUser } from '../services/git.js';
|
|
|
8
8
|
import { MarkdownDocument } from '../services/markdown.js';
|
|
9
9
|
import type { BodyWriteCoordinator, BodyWriteResult } from '../server/body-write-coordinator.js';
|
|
10
10
|
import { AssetService, AssetInfo, AssetRecord, AssetConfig, type AssetUploadResult } from '../services/assets/index.js';
|
|
11
|
-
import type
|
|
11
|
+
import { type AssetIndexService } from '../services/assets/asset-index-service.js';
|
|
12
12
|
import { EntityType, type EntityData, type DatasetRow } from './validation.js';
|
|
13
13
|
import { SchemaRegistry } from './schema-registry.js';
|
|
14
14
|
import { type DatasetFilter } from '../services/csv-service.js';
|
|
@@ -518,9 +518,7 @@ export declare class BaseGraphManager {
|
|
|
518
518
|
}): Promise<{
|
|
519
519
|
committed: boolean;
|
|
520
520
|
}>;
|
|
521
|
-
delete(entityType: EntityType, entityId: string, commitMessage?: string, user?: GitUser
|
|
522
|
-
keepAssets?: boolean;
|
|
523
|
-
}): Promise<void>;
|
|
521
|
+
delete(entityType: EntityType, entityId: string, commitMessage?: string, user?: GitUser): Promise<void>;
|
|
524
522
|
/**
|
|
525
523
|
* Rename an entity (change its ID). Preserves all data, content, and source_ref.
|
|
526
524
|
* Uses git mv for clean history. Updates entity_id in frontmatter.
|
|
@@ -847,17 +845,11 @@ export declare class BaseGraphManager {
|
|
|
847
845
|
opts?: {
|
|
848
846
|
uploaderUserId?: string | null;
|
|
849
847
|
/**
|
|
850
|
-
* The recorded owner
|
|
851
|
-
* assets
|
|
852
|
-
*
|
|
853
|
-
*
|
|
854
|
-
* `
|
|
855
|
-
* `(entityType, entityId)` are ignored for ownership.
|
|
856
|
-
*
|
|
857
|
-
* The legacy default (omit `owner` → entity-owned row keyed on the
|
|
858
|
-
* args above) survives ONLY for transitional tests of pre-migration
|
|
859
|
-
* rows; no production path may rely on it. Flip the default to
|
|
860
|
-
* folder-homing in P1.5 when the entity-owned machinery is deleted.
|
|
848
|
+
* The recorded owner. MUST be free-standing (`owner_type ∈ {folder,
|
|
849
|
+
* workspace}`) — assets are library citizens; entries only reference
|
|
850
|
+
* them via the immutable URL, never own them. Defaults to this graph's
|
|
851
|
+
* folder (`{ type: 'folder', id: repo }`); a non-free-standing owner
|
|
852
|
+
* throws. `(entityType, entityId)` are never used for ownership.
|
|
861
853
|
*/
|
|
862
854
|
owner?: {
|
|
863
855
|
type: string;
|
|
@@ -872,20 +864,11 @@ export declare class BaseGraphManager {
|
|
|
872
864
|
setAssetIndex(index: AssetIndexService | undefined): void;
|
|
873
865
|
/** The asset ownership index, if wired. */
|
|
874
866
|
getAssetIndex(): AssetIndexService | undefined;
|
|
875
|
-
/**
|
|
876
|
-
* Remove every immutable-keyed asset owned by (entityType, entityId): the
|
|
877
|
-
* blob + its index row. TRANSITIONAL (assets-referenced-not-owned P1):
|
|
878
|
-
* entry deletion keeps assets, so this runs only on an explicit
|
|
879
|
-
* `keepAssets: false`, which no caller passes. Deleted in P1.5 once the
|
|
880
|
-
* owner migration verifies zero entity-owned rows. Blob errors are
|
|
881
|
-
* non-fatal (markdown is the system of record). No-op without an index.
|
|
882
|
-
*/
|
|
883
|
-
private cleanupOwnedAssets;
|
|
884
867
|
/** Delete a single index-tracked asset by its immutable id: blob + index row.
|
|
885
|
-
*
|
|
886
|
-
* assets,
|
|
887
|
-
*
|
|
888
|
-
*
|
|
868
|
+
* THE asset delete path (assets-referenced-not-owned: deleting an entry
|
|
869
|
+
* never deletes assets, so deliberate asset deletion is always by-id).
|
|
870
|
+
* Blob errors are non-fatal (the index row is the manager's source of
|
|
871
|
+
* truth). No-op without an index/service. */
|
|
889
872
|
deleteAssetById(assetId: string, filename: string): Promise<void>;
|
|
890
873
|
/** Re-point the owning coordinates of every asset owned by an entity, with
|
|
891
874
|
* no blob movement (keys are immutable). Used by rename (ownerId),
|
package/dist/core/graph.js
CHANGED
|
@@ -10,6 +10,7 @@ import { createHash, randomUUID } from 'node:crypto';
|
|
|
10
10
|
import { GitService } from '../services/git.js';
|
|
11
11
|
import { MarkdownService } from '../services/markdown.js';
|
|
12
12
|
import { AssetService, publicUrlFor, publicUrlForAssetId } from '../services/assets/index.js';
|
|
13
|
+
import { FREE_STANDING_OWNER_TYPES } from '../services/assets/asset-index-service.js';
|
|
13
14
|
import { ENTITY_SCHEMAS, EntityBaseSchema, PLURAL_TO_SINGULAR, RESERVED_ENTITY_TYPES, assertValidTaskDates } from './validation.js';
|
|
14
15
|
import { isInternalField } from './schema-registry.js';
|
|
15
16
|
import { CSVService } from '../services/csv-service.js';
|
|
@@ -1041,7 +1042,7 @@ export class BaseGraphManager {
|
|
|
1041
1042
|
await transaction.commit(options.user ?? this.gitUser, options.commitMessage);
|
|
1042
1043
|
return { committed: true };
|
|
1043
1044
|
}
|
|
1044
|
-
async delete(entityType, entityId, commitMessage, user
|
|
1045
|
+
async delete(entityType, entityId, commitMessage, user) {
|
|
1045
1046
|
// Verify entity exists
|
|
1046
1047
|
const existing = this.get(entityType, entityId);
|
|
1047
1048
|
// Delete the flat entity file
|
|
@@ -1071,17 +1072,9 @@ export class BaseGraphManager {
|
|
|
1071
1072
|
const message = commitMessage || commitMsg.deleted(this.commitRef(entityType, entityId, existing.data?.name));
|
|
1072
1073
|
await transaction.commit(user ?? this.gitUser, message);
|
|
1073
1074
|
}
|
|
1074
|
-
// Assets
|
|
1075
|
-
//
|
|
1076
|
-
//
|
|
1077
|
-
// now defaults ON — cleanup runs only on an explicit `keepAssets: false`,
|
|
1078
|
-
// which no caller passes; the flag + cleanupOwnedAssets stay as a
|
|
1079
|
-
// transitional net and are deleted in P1.5 once the owner migration
|
|
1080
|
-
// verifies zero entity-owned rows across workspaces.
|
|
1081
|
-
if (opts?.keepAssets === false) {
|
|
1082
|
-
// Immutable-keyed assets owned by this entity (any type) via the index.
|
|
1083
|
-
await this.cleanupOwnedAssets(entityType, entityId);
|
|
1084
|
-
}
|
|
1075
|
+
// Assets are never deleted here: assets are library citizens (folder/
|
|
1076
|
+
// workspace-homed) that entries only REFERENCE, so entry deletion never
|
|
1077
|
+
// destroys binaries. Deliberate asset deletion is by-id (deleteAssetById).
|
|
1085
1078
|
// Remove from vector index (fire-and-forget, non-fatal). Tracked on
|
|
1086
1079
|
// the service so a leaking error stream is visible at /api/health.
|
|
1087
1080
|
if (this.vectorService) {
|
|
@@ -2622,19 +2615,23 @@ export class BaseGraphManager {
|
|
|
2622
2615
|
}
|
|
2623
2616
|
// Immutable-key path: generate a permanent assetId, store under
|
|
2624
2617
|
// {assetId}/{filename}, and record authoritative ownership in the index.
|
|
2625
|
-
// The
|
|
2618
|
+
// The (entityType, entityId) args never shape ownership — renaming or
|
|
2626
2619
|
// retyping the entity never moves the blob. `keyPrefix` is irrelevant here
|
|
2627
2620
|
// (it only shaped the legacy {prefix}/{id} key).
|
|
2628
2621
|
if (this.assetIndex) {
|
|
2622
|
+
// The model invariant is structural: no caller can mint an entity-owned
|
|
2623
|
+
// row. Omitting `owner` homes the asset to this graph's folder.
|
|
2624
|
+
const owner = opts?.owner ?? { type: 'folder', id: this.repoName };
|
|
2625
|
+
if (!FREE_STANDING_OWNER_TYPES.has(owner.type)) {
|
|
2626
|
+
throw new Error(`Asset owner must be free-standing (folder or workspace), got "${owner.type}" — entries reference assets, they never own them.`);
|
|
2627
|
+
}
|
|
2629
2628
|
const assetId = randomUUID();
|
|
2630
2629
|
const info = await this.assetService.uploadByAssetId(assetId, filename, buffer);
|
|
2631
2630
|
this.assetIndex.put({
|
|
2632
2631
|
assetId,
|
|
2633
2632
|
repo: this.repoName,
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
ownerType: opts?.owner?.type ?? entityType,
|
|
2637
|
-
ownerId: opts?.owner?.id ?? entityId,
|
|
2633
|
+
ownerType: owner.type,
|
|
2634
|
+
ownerId: owner.id,
|
|
2638
2635
|
filename: info.filename,
|
|
2639
2636
|
contentType: info.contentType,
|
|
2640
2637
|
mediaType: info.mediaType,
|
|
@@ -2667,36 +2664,11 @@ export class BaseGraphManager {
|
|
|
2667
2664
|
getAssetIndex() {
|
|
2668
2665
|
return this.assetIndex;
|
|
2669
2666
|
}
|
|
2670
|
-
/**
|
|
2671
|
-
* Remove every immutable-keyed asset owned by (entityType, entityId): the
|
|
2672
|
-
* blob + its index row. TRANSITIONAL (assets-referenced-not-owned P1):
|
|
2673
|
-
* entry deletion keeps assets, so this runs only on an explicit
|
|
2674
|
-
* `keepAssets: false`, which no caller passes. Deleted in P1.5 once the
|
|
2675
|
-
* owner migration verifies zero entity-owned rows. Blob errors are
|
|
2676
|
-
* non-fatal (markdown is the system of record). No-op without an index.
|
|
2677
|
-
*/
|
|
2678
|
-
async cleanupOwnedAssets(entityType, entityId) {
|
|
2679
|
-
if (!this.assetIndex || !this.assetService)
|
|
2680
|
-
return;
|
|
2681
|
-
for (const row of this.assetIndex.listByOwner(this.repoName, entityType, entityId)) {
|
|
2682
|
-
try {
|
|
2683
|
-
await this.assetService.deleteByAssetId(row.assetId, row.filename);
|
|
2684
|
-
}
|
|
2685
|
-
catch (err) {
|
|
2686
|
-
console.warn(`[asset] delete blob ${row.assetId} failed: ${err?.message ?? err}`);
|
|
2687
|
-
}
|
|
2688
|
-
this.assetIndex.delete(row.assetId);
|
|
2689
|
-
// Reap the caption index-state row too (assetId-keyed). Without this an
|
|
2690
|
-
// entity-owned image's state row outlives its blob + assets.db row and
|
|
2691
|
-
// accumulates in the LanceDB side table (read in full on every sweep).
|
|
2692
|
-
void this.vectorService?.deleteIndexStateSafe(row.assetId);
|
|
2693
|
-
}
|
|
2694
|
-
}
|
|
2695
2667
|
/** Delete a single index-tracked asset by its immutable id: blob + index row.
|
|
2696
|
-
*
|
|
2697
|
-
* assets,
|
|
2698
|
-
*
|
|
2699
|
-
*
|
|
2668
|
+
* THE asset delete path (assets-referenced-not-owned: deleting an entry
|
|
2669
|
+
* never deletes assets, so deliberate asset deletion is always by-id).
|
|
2670
|
+
* Blob errors are non-fatal (the index row is the manager's source of
|
|
2671
|
+
* truth). No-op without an index/service. */
|
|
2700
2672
|
async deleteAssetById(assetId, filename) {
|
|
2701
2673
|
if (!this.assetIndex || !this.assetService)
|
|
2702
2674
|
return;
|