@haneinfo/instance-analytics 0.0.0-stage → 0.3.1

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/package.json CHANGED
@@ -1,6 +1,74 @@
1
1
  {
2
2
  "name": "@haneinfo/instance-analytics",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.3.1",
4
+ "private": false,
5
+ "description": "Permission-filtered live aggregates and state durations over state-machine instances, with private or shared saved reports.",
6
+ "files": [
7
+ "dist",
8
+ "prisma",
9
+ "agent-guide.md",
10
+ "haneinfo.plugin.json",
11
+ "plugin.js",
12
+ "plugin.d.ts",
13
+ "README.md"
14
+ ],
15
+ "type": "commonjs",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "default": "./dist/index.js"
22
+ },
23
+ "./plugin": {
24
+ "types": "./dist/plugin.d.ts",
25
+ "default": "./dist/plugin.js"
26
+ },
27
+ "./haneinfo.plugin.json": "./haneinfo.plugin.json",
28
+ "./agent-guide.md": "./agent-guide.md",
29
+ "./package.json": "./package.json",
30
+ "./prisma/reports.prisma": "./prisma/reports.prisma",
31
+ "./prisma/reports.sql": "./prisma/reports.sql"
32
+ },
33
+ "dependencies": {
34
+ "@haneinfo/plugin-api": "1.28.0"
35
+ },
36
+ "peerDependencies": {
37
+ "@haneinfo/common": "^0.3.4 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0",
38
+ "@haneinfo/plugin-host-nest": "^2.1.0",
39
+ "@nestjs/common": "^11.0.0 || ^12.0.0",
40
+ "@nestjs/core": "^11.0.0 || ^12.0.0",
41
+ "@prisma/client": "^6.19.0 || ^7.10.1",
42
+ "zod": "^4.4.0",
43
+ "@haneinfo/plugin-api": "^1.20.0",
44
+ "@haneinfo/state-machine": "^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0",
45
+ "@haneinfo/list-view": "^0.9.0 || ^0.10.0"
46
+ },
47
+ "devDependencies": {
48
+ "@nestjs/common": "^12.3.2",
49
+ "@nestjs/core": "^12.3.2",
50
+ "@prisma/client": "^7.10.1",
51
+ "@types/node": "^24.13.0",
52
+ "typescript": "^5.9.3",
53
+ "vitest": "^4.1.11",
54
+ "zod": "^4.4.0",
55
+ "@haneinfo/definition-registry": "0.2.10",
56
+ "@haneinfo/common": "0.7.0",
57
+ "@haneinfo/plugin-testkit": "2.3.1",
58
+ "@haneinfo/form": "0.6.2",
59
+ "@haneinfo/state-machine": "0.25.3",
60
+ "@haneinfo/list-view": "0.10.3",
61
+ "@haneinfo/plugin-host-nest": "2.1.2"
62
+ },
63
+ "license": "UNLICENSED",
64
+ "publishConfig": {
65
+ "registry": "https://registry.npmjs.org/",
66
+ "access": "public"
67
+ },
68
+ "scripts": {
69
+ "build": "tsc -p tsconfig.build.json",
70
+ "dev": "tsc -p tsconfig.build.json --watch",
71
+ "test": "vitest run",
72
+ "typecheck": "tsc --noEmit"
73
+ }
6
74
  }
package/plugin.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/plugin';
package/plugin.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/plugin.js');
@@ -0,0 +1,17 @@
1
+ /// Saved report: one query plus a minimal display hint. Private unless an administrator shares it;
2
+ /// visibility never grants instance access, every run re-checks declarations and readership. @internal
3
+ model Report {
4
+ id String @id @default(cuid())
5
+ name String
6
+ machineCode String @map("machine_code")
7
+ definition Json
8
+ createdBy String @map("created_by")
9
+ visibility String @default("PRIVATE")
10
+ roles String[] @default([])
11
+ createdAt DateTime @default(now()) @map("created_at")
12
+ updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
13
+
14
+ @@index([createdBy, createdAt])
15
+ @@index([visibility])
16
+ @@map("reports")
17
+ }
@@ -0,0 +1,17 @@
1
+ -- @haneinfo/reports: saved reports. Aggregation reads state_machine_instances and
2
+ -- state_machine_transitions with the existing indexes; no other table is created.
3
+ CREATE TABLE reports (
4
+ id TEXT NOT NULL,
5
+ name TEXT NOT NULL,
6
+ machine_code TEXT NOT NULL,
7
+ definition JSONB NOT NULL,
8
+ created_by TEXT NOT NULL,
9
+ visibility TEXT NOT NULL DEFAULT 'PRIVATE',
10
+ roles TEXT[] DEFAULT ARRAY[]::TEXT[],
11
+ created_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
12
+ updated_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
13
+ CONSTRAINT reports_pkey PRIMARY KEY (id),
14
+ CONSTRAINT reports_visibility_check CHECK (visibility IN ('PRIVATE', 'ALL', 'ROLES'))
15
+ );
16
+ CREATE INDEX reports_created_by_created_at_idx ON reports (created_by, created_at);
17
+ CREATE INDEX reports_visibility_idx ON reports (visibility);