-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathobjectstack.config.ts
More file actions
137 lines (125 loc) · 6.64 KB
/
Copy pathobjectstack.config.ts
File metadata and controls
137 lines (125 loc) · 6.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import { defineStack } from '@objectstack/spec';
import * as objects from './src/objects/index.js';
import * as actions from './src/actions/index.js';
import * as dashboards from './src/dashboards/index.js';
import * as datasets from './src/datasets/index.js';
import * as reports from './src/reports/index.js';
import * as mappings from './src/mappings/index.js';
import { allFlows } from './src/flows/index.js';
import { allSkills } from './src/skills/index.js';
import * as profiles from './src/profiles/index.js';
import * as apps from './src/apps/index.js';
import * as views from './src/views/index.js';
import * as pages from './src/pages/index.js';
import * as translations from './src/translations/index.js';
import { CrmSeedData } from './src/data/index.js';
import {
AccountTeamSharingRule, TerritorySharingRules,
OpportunitySalesSharingRule, OpportunityExecutiveSharingRule,
CaseEscalationSharingRule, CaseDirectorSharingRule,
CampaignLeadershipSharingRules,
CrmPositions,
} from './src/sharing/index.js';
import { allHooks } from './src/hooks/index.js';
export default defineStack({
manifest: {
id: 'app.objectstack.hotcrm',
namespace: 'crm',
version: '2.2.2',
type: 'app',
name: 'HotCRM',
description: 'AI-Native CRM for the ObjectStack marketplace — Accounts, Contacts, Leads, Opportunities, Cases, Knowledge, Forecasts, Campaigns, Contracts.',
// ADR-0087 protocol handshake (ADR-0025 §3.2): the metadata/runtime
// protocol major this app's metadata is authored against. Only the major
// participates in the check — a runtime on a different major refuses the
// load with a structured OS_PROTOCOL_INCOMPATIBLE diagnostic (naming the
// `objectstack migrate meta` replay) instead of failing deep in a schema
// parse. Bump together with `specVersion` on every platform upgrade
// (docs/MAINTENANCE.md §3) — `test/docs-drift.test.ts` now enforces that
// pairing against `objectstack.manifest.json` instead of trusting this
// comment, because two platform upgrades in a row (rc.2, then rc.3) moved
// the manifest and left this line behind (#728).
engines: { protocol: '^17.0.0-rc.5' },
},
// ─── Platform capabilities this app needs ─────────────────────────
// The runtime resolves each capability name to a built-in service plugin
// and auto-loads it (with extras like Automation's node packs). No need
// to hand-instantiate plugins or pass `--preset` flags. See
// packages/cli/src/commands/serve.ts CAPABILITY_PROVIDERS for the
// complete map; explicit `plugins: [...]` always shadows the resolver.
// `auth` enables the auth/login surface (login/register) via @objectstack/plugin-auth.
// `ui` serves the unified Console shell and CRM apps under /_console/
// (login at /_console/login). ObjectStack 7.x replaced the legacy
// /_studio/ and /_account/ mounts with this single /_console/ surface.
// Both are required for a clickable login flow when running `objectstack start`
// off the compiled artifact.
// Note: the foundational slate (queue, job, cache, settings, email,
// storage) is auto-injected by the CLI for every non-`minimal`
// preset — see `ALWAYS_CAPS` in packages/cli/src/commands/serve.ts.
// Listed below only the *opt-in* capabilities this stack actually
// wants on top of that slate.
// `triggers` installs the record-change + schedule trigger providers that
// actually fire autolaunched flows (record_change & schedule types). Without
// it the `automation` engine registers flows but nothing ever launches them.
// Schedule triggers run via the job service (in the always-on slate).
//
// `ai` is deliberately NOT listed. ObjectStack 11.3.0 (ADR-0025 S2) removed
// `@objectstack/service-ai` from the open edition — the AI runtime now ships
// only in the closed cloud package, and the framework CLI does not depend on
// it. Under ObjectStack 16, `requires: ['ai']` is a *fail-fast* capability:
// the serve command hard-aborts boot when the package is absent, so keeping it
// here would break `objectstack start`/`dev` for this open-edition app (the AI
// block runs before every other capability resolves). The AI metadata is
// unaffected — the skills still validate, build into the artifact, and run
// wherever a runtime provides the `ai` tier (cloud's objectos-runtime). There
// are no app-authored agents: they were retired in #512 and the surface is
// skills-only (ADR-0063 §2); skills attach to a platform agent by `surface`.
// A local open-edition boot simply omits the AI service and hides its console
// surface. To run AI locally, declare `@objectstack/service-ai` (cloud) in
// package.json — its mere presence best-effort auto-loads it.
requires: ['automation', 'triggers', 'analytics', 'auth', 'ui', 'approvals', 'sharing'],
objects: Object.values(objects),
actions: Object.values(actions),
dashboards: Object.values(dashboards),
datasets: Object.values(datasets),
reports: Object.values(reports),
// Reusable import projections (#603). Referenced by name from the import
// endpoint — `mappingName: 'crm_account_import'` — so a customer's own
// spreadsheet loads without per-column mapping by hand. Templates:
// `assets/import-templates/`.
mappings: Object.values(mappings),
flows: allFlows,
skills: allSkills,
permissions: Object.values(profiles),
apps: Object.values(apps),
views: Object.values(views),
pages: Object.values(pages),
// Approvals are modeled as `record_change` flows with `approval` nodes
// (ADR-0019); see src/flows/opportunity-approval.flow.ts. The
// standalone `approvals` stack field was removed in ObjectStack 7.4.
// No `analyticsCubes`: datasets (ADR-0021) are the semantic layer — the
// analytics service compiles each dataset into its cube internally, and a
// second hand-written cube layer only duplicates and drifts.
hooks: allHooks,
data: CrmSeedData,
i18n: {
defaultLocale: 'en',
supportedLocales: ['en', 'zh-CN', 'ja-JP', 'es-ES'],
fallbackLocale: 'en',
},
translations: Object.values(translations),
sharingRules: [
AccountTeamSharingRule,
OpportunitySalesSharingRule,
OpportunityExecutiveSharingRule,
CaseEscalationSharingRule,
CaseDirectorSharingRule,
...TerritorySharingRules,
...CampaignLeadershipSharingRules,
],
// ADR-0090 D3: positions are flat capability-distribution groups — the v1
// role hierarchy's parent links are gone (hierarchy belongs to the
// business-unit tree, which this app does not model).
positions: CrmPositions,
});