@hyperscale0/hsx 1.0.342 → 1.0.347
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/README.md +1 -1
- package/bases/cards.hsx +0 -1
- package/bases/collections.hsx +0 -2
- package/bases/escrow.hsx +0 -1
- package/bases/financing.hsx +0 -1
- package/bases/insurance.hsx +0 -1
- package/bases/lending.hsx +0 -3
- package/bases/marketplace.hsx +0 -2
- package/bases/money.hsx +0 -1
- package/bases/reporting.hsx +0 -2
- package/bases/savings.hsx +0 -1
- package/bases/wallet.hsx +0 -1
- package/dist/src/ast.d.ts +57 -7
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/ast.js.map +1 -1
- package/dist/src/bases-bundle.js +11 -11
- package/dist/src/bases-bundle.js.map +1 -1
- package/dist/src/catalog-program.d.ts +1 -1
- package/dist/src/catalog-program.d.ts.map +1 -1
- package/dist/src/catalog-program.js +0 -13
- package/dist/src/catalog-program.js.map +1 -1
- package/dist/src/checks.d.ts +60 -0
- package/dist/src/checks.d.ts.map +1 -0
- package/dist/src/checks.js +240 -0
- package/dist/src/checks.js.map +1 -0
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +6 -25
- package/dist/src/cli.js.map +1 -1
- package/dist/src/compile.d.ts +29 -12
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +414 -316
- package/dist/src/compile.js.map +1 -1
- package/dist/src/diagnostics.d.ts +14 -1
- package/dist/src/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics.js +31 -0
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/examples-bundle.js +15 -15
- package/dist/src/examples-bundle.js.map +1 -1
- package/dist/src/header-source.d.ts +30 -0
- package/dist/src/header-source.d.ts.map +1 -1
- package/dist/src/header-source.js +120 -9
- package/dist/src/header-source.js.map +1 -1
- package/dist/src/headers.d.ts +9 -18
- package/dist/src/headers.d.ts.map +1 -1
- package/dist/src/headers.js +25 -23
- package/dist/src/headers.js.map +1 -1
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/keywords.d.ts +2 -4
- package/dist/src/keywords.d.ts.map +1 -1
- package/dist/src/keywords.js +6 -5
- package/dist/src/keywords.js.map +1 -1
- package/dist/src/language.d.ts +3 -4
- package/dist/src/language.d.ts.map +1 -1
- package/dist/src/language.js +123 -60
- package/dist/src/language.js.map +1 -1
- package/dist/src/lex.d.ts +1 -1
- package/dist/src/lex.d.ts.map +1 -1
- package/dist/src/lex.js +3 -5
- package/dist/src/lex.js.map +1 -1
- package/dist/src/parse.d.ts +3 -1
- package/dist/src/parse.d.ts.map +1 -1
- package/dist/src/parse.js +234 -22
- package/dist/src/parse.js.map +1 -1
- package/dist/src/std-bundle.d.ts +2 -1
- package/dist/src/std-bundle.d.ts.map +1 -1
- package/dist/src/std-bundle.js +16 -15
- package/dist/src/std-bundle.js.map +1 -1
- package/dist/src/template-guide.d.ts +3 -9
- package/dist/src/template-guide.d.ts.map +1 -1
- package/dist/src/template-guide.js +16 -23
- package/dist/src/template-guide.js.map +1 -1
- package/dist/src/toolchain.d.ts +23 -0
- package/dist/src/toolchain.d.ts.map +1 -0
- package/dist/src/toolchain.js +29 -0
- package/dist/src/toolchain.js.map +1 -0
- package/docs/README.md +69 -28
- package/examples/camera-rental.hsx +0 -1
- package/examples/cards.hsx +0 -1
- package/examples/collections.hsx +0 -2
- package/examples/escrow.hsx +0 -1
- package/examples/financing.hsx +0 -1
- package/examples/insurance.hsx +0 -2
- package/examples/lending.hsx +0 -3
- package/examples/library.hsx +0 -3
- package/examples/marketplace.hsx +0 -2
- package/examples/money.hsx +0 -1
- package/examples/rental-hire.hsx +0 -1
- package/examples/reporting.hsx +0 -2
- package/examples/savings.hsx +0 -1
- package/examples/serviced.hsx +0 -4
- package/examples/wallet.hsx +0 -1
- package/package.json +4 -4
- package/src/ast.ts +56 -3
- package/src/bases-bundle.ts +11 -11
- package/src/catalog-program.ts +0 -13
- package/src/checks.ts +386 -0
- package/src/cli.ts +6 -25
- package/src/compile.ts +583 -438
- package/src/diagnostics.ts +49 -1
- package/src/examples-bundle.ts +15 -15
- package/src/header-source.ts +187 -11
- package/src/headers.ts +31 -32
- package/src/index.ts +10 -4
- package/src/keywords.ts +6 -5
- package/src/language.ts +153 -68
- package/src/lex.ts +3 -5
- package/src/parse.ts +216 -24
- package/src/std-bundle.ts +17 -15
- package/src/template-guide.ts +17 -34
- package/src/toolchain.ts +51 -0
- package/std/booking.hsx +14 -1
- package/std/collections.hsx +12 -2
- package/std/financing.hsx +10 -16
- package/std/money.hsx +2 -3
- package/std/reporting.hsx +10 -1
- package/dist/src/binding-contract.d.ts +0 -22
- package/dist/src/binding-contract.d.ts.map +0 -1
- package/dist/src/binding-contract.js +0 -80
- package/dist/src/binding-contract.js.map +0 -1
- package/dist/src/std-library.d.ts +0 -5
- package/dist/src/std-library.d.ts.map +0 -1
- package/dist/src/std-library.js +0 -5
- package/dist/src/std-library.js.map +0 -1
- package/src/binding-contract.ts +0 -111
- package/src/std-library.ts +0 -7
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ const hover = describe(source, source.indexOf("program"));
|
|
|
70
70
|
|
|
71
71
|
Both functions accept incomplete source and need no Node or editor framework.
|
|
72
72
|
Spans use half-open UTF-16 offsets. Whitespace has no span; unknown hover targets
|
|
73
|
-
return `null`. Pass a `
|
|
73
|
+
return `null`. Pass a `Toolchain` as the last argument for custom headers.
|
|
74
74
|
Header signatures and bounds come from compiler metadata. Bounds use minor
|
|
75
75
|
currency units, basis points and milliseconds.
|
|
76
76
|
|
package/bases/cards.hsx
CHANGED
package/bases/collections.hsx
CHANGED
package/bases/escrow.hsx
CHANGED
package/bases/financing.hsx
CHANGED
package/bases/insurance.hsx
CHANGED
package/bases/lending.hsx
CHANGED
package/bases/marketplace.hsx
CHANGED
package/bases/money.hsx
CHANGED
package/bases/reporting.hsx
CHANGED
package/bases/savings.hsx
CHANGED
package/bases/wallet.hsx
CHANGED
package/dist/src/ast.d.ts
CHANGED
|
@@ -89,26 +89,76 @@ export type Decl = InstrumentDecl | AssignmentDecl | ObjectDecl | {
|
|
|
89
89
|
partyKind: string;
|
|
90
90
|
role?: string;
|
|
91
91
|
span: Span;
|
|
92
|
-
} | {
|
|
93
|
-
kind: "use";
|
|
94
|
-
name: string;
|
|
95
|
-
span: Span;
|
|
96
92
|
} | {
|
|
97
93
|
kind: "expose";
|
|
98
94
|
target: string;
|
|
99
95
|
name: string;
|
|
100
96
|
span: Span;
|
|
97
|
+
};
|
|
98
|
+
/** A name as written, so a check diagnostic points at it. */
|
|
99
|
+
export interface Named {
|
|
100
|
+
name: string;
|
|
101
|
+
span: Span;
|
|
102
|
+
}
|
|
103
|
+
/** One statement of a `check` block. Every step may end with `balances { }`. */
|
|
104
|
+
export type CheckStatement = {
|
|
105
|
+
span: Span;
|
|
106
|
+
balances?: BlockExpr;
|
|
107
|
+
} & ({
|
|
108
|
+
kind: "customer";
|
|
109
|
+
id: Named;
|
|
110
|
+
title: string;
|
|
111
|
+
organization: boolean;
|
|
112
|
+
fund?: Expr;
|
|
113
|
+
binds: Named[];
|
|
101
114
|
} | {
|
|
102
|
-
kind: "
|
|
103
|
-
|
|
115
|
+
kind: "clock";
|
|
116
|
+
at: Expr;
|
|
117
|
+
until?: {
|
|
118
|
+
object: Named;
|
|
119
|
+
attachment?: Named;
|
|
120
|
+
recordPath?: string;
|
|
121
|
+
state: Named;
|
|
122
|
+
};
|
|
123
|
+
} | {
|
|
124
|
+
kind: "object";
|
|
125
|
+
id: Named;
|
|
126
|
+
objectKind: Named;
|
|
127
|
+
owner: Named;
|
|
128
|
+
fields?: BlockExpr;
|
|
129
|
+
} | {
|
|
130
|
+
kind: "action";
|
|
131
|
+
actor?: Named;
|
|
132
|
+
object: Named;
|
|
133
|
+
action: Named;
|
|
134
|
+
input?: BlockExpr;
|
|
135
|
+
fields?: BlockExpr;
|
|
136
|
+
instance?: Named;
|
|
137
|
+
remember?: Named;
|
|
138
|
+
state?: Named;
|
|
139
|
+
status?: Expr;
|
|
140
|
+
code?: string;
|
|
141
|
+
} | {
|
|
142
|
+
kind: "close";
|
|
143
|
+
customer: Named;
|
|
144
|
+
} | {
|
|
145
|
+
kind: "expect";
|
|
146
|
+
held?: Expr;
|
|
147
|
+
pending?: BlockExpr;
|
|
148
|
+
});
|
|
149
|
+
export interface CheckDecl {
|
|
150
|
+
name: string;
|
|
151
|
+
statements: CheckStatement[];
|
|
104
152
|
span: Span;
|
|
105
|
-
}
|
|
153
|
+
}
|
|
106
154
|
export interface Program {
|
|
107
155
|
name: string;
|
|
108
156
|
title: string;
|
|
109
157
|
currency: string;
|
|
110
158
|
header: boolean;
|
|
111
159
|
decls: Decl[];
|
|
160
|
+
/** Build data beside the document; compile never lowers them into it. */
|
|
161
|
+
checks: CheckDecl[];
|
|
112
162
|
span: Span;
|
|
113
163
|
}
|
|
114
164
|
export declare const lineColAt: (source: string, offset: number) => {
|
package/dist/src/ast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;CACZ;AACD,MAAM,MAAM,IAAI,GACZ;IACE,IAAI,EACA,MAAM,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GAClC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAAE,CACvD,CAAC;AACF,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,IAAI,EAAE,IAAI,CAAC;CACZ;AACD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,yEAAyE;IACzE,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;CACZ;AACD,eAAO,MAAM,SAAS,WAAY,MAAM,UAAU,MAAM;IAGpD,IAAI;IACJ,MAAM;CAET,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC"}
|
package/dist/src/ast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAkJA,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,EAAE;IAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACvC,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM;QAC/B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KAC1C,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/src/bases-bundle.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export const bases = [
|
|
2
|
-
{ "id": "cards", "title": "Control card spending", "summary": "Reserve a card payment within its spending limit before capture.", "headers": ["cards"], "source": "// Reserve a card payment within its spending limit before capture.\nprogram cards_base \"Control card spending\"\
|
|
3
|
-
{ "id": "collections", "title": "Follow up overdue payments", "summary": "Refer overdue instalments for collection and limit contact attempts.", "headers": ["
|
|
4
|
-
{ "id": "escrow", "title": "Hold payment until delivery", "summary": "Hold a buyer’s payment until delivery is accepted.", "headers": ["escrow"], "source": "// Hold a buyer’s payment until delivery is accepted.\nprogram escrow_base \"Hold payment until delivery\"\
|
|
5
|
-
{ "id": "financing", "title": "Split a purchase into instalments", "summary": "Fund a purchase and collect its scheduled repayments.", "headers": ["financing"], "source": "// Fund a purchase and collect its scheduled repayments.\nprogram financing_base \"Split a purchase into instalments\"\
|
|
6
|
-
{ "id": "insurance", "title": "Protect a purchase", "summary": "Collect cover premiums and reserve approved claims for payment.", "headers": ["insurance"], "source": "// Collect cover premiums and reserve approved claims for payment.\nprogram insurance_base \"Protect a purchase\"\
|
|
7
|
-
{ "id": "lending", "title": "Pool funds for lending", "summary": "Pool member commitments to fund a loan and distribute repayments or losses.", "headers": ["
|
|
8
|
-
{ "id": "marketplace", "title": "Connect buyers and sellers", "summary": "Turn a seller’s offer into an order with payment held until acceptance.", "headers": ["marketplace", "escrow"], "source": "// Turn a seller’s offer into an order with payment held until acceptance.\nprogram marketplace_base \"Connect buyers and sellers\"\
|
|
9
|
-
{ "id": "money", "title": "Collect a payment", "summary": "Collect a payment from a customer.", "headers": ["money"], "source": "// Collect a payment from a customer.\nprogram money_base \"Collect a payment\"\
|
|
10
|
-
{ "id": "reporting", "title": "Track repayments", "summary": "Report outstanding balances and overdue repayments on financed purchases.", "headers": ["reporting", "
|
|
11
|
-
{ "id": "savings", "title": "Save as a group", "summary": "Collect contributions into a shared pot and pay each member in turn.", "headers": ["savings"], "source": "// Collect contributions into a shared pot and pay each member in turn.\nprogram savings_base \"Save as a group\"\
|
|
12
|
-
{ "id": "wallet", "title": "Offer prepaid credit", "summary": "Let a customer add funds and reserve each spend before payment.", "headers": ["wallet"], "source": "// Let a customer add funds and reserve each spend before payment.\nprogram wallet_base \"Offer prepaid credit\"\
|
|
2
|
+
{ "id": "cards", "title": "Control card spending", "summary": "Reserve a card payment within its spending limit before capture.", "headers": ["cards"], "source": "// Reserve a card payment within its spending limit before capture.\nprogram cards_base \"Control card spending\"\nparty seller: business\n\nobject card \"Card\" {\n attach holder = cards.cardholder {\n holder: owner\n expose create as create_holder\n expose activate as activate_holder\n expose suspend as suspend_holder\n expose resume as resume_holder\n expose close as close_holder\n }\n attach card = cards.card {\n holder: holder, person: owner, issuer: operator, spend_limit: runtime\n expose create as create_card\n expose activate as activate_card\n expose freeze as freeze_card\n expose unfreeze as unfreeze_card\n expose issuer_freeze as issuer_freeze_card\n expose issuer_unfreeze as issuer_unfreeze_card\n expose cancel as cancel_card\n }\n attach payment = cards.authorization {\n card: card, merchant: seller, issuer: operator\n expose create as create\n expose approve as approve\n expose decline as decline\n expose capture as capture\n expose reverse as reverse\n }\n attach receipt = cards.transaction {\n authorization: payment\n expose create as record_payment\n expose refund as refund\n }\n}\n" },
|
|
3
|
+
{ "id": "collections", "title": "Follow up overdue payments", "summary": "Refer overdue instalments for collection and limit contact attempts.", "headers": ["financing", "collections"], "source": "// Refer overdue instalments for collection and limit contact attempts.\nprogram collections_base \"Follow up overdue payments\"\nparty collector: business\n\nobject plan \"Plan\" {\n fields { price: money }\n attach allowance = financing.limits {\n borrower: owner, per_borrower: runtime\n expose create as request_limit\n expose approve as approve_limit\n }\n attach budget = financing.portfolio_limit {\n limit: runtime\n expose create as create_budget\n expose approve as approve_budget\n }\n // Architect sets the placeholder profit rate during tailoring.\n attach plan = financing.installments {\n borrower: owner, capital: operator\n months: 2, pricing: flat_total, profit_rate: 0%\n disburse_to: borrower, limits: allowance, portfolio: budget\n expose create as quote\n expose sign as sign\n expose disburse as fund\n expose cancel as cancel_quote\n expose void as cancel_plan\n expose payoff as repay_early\n expose complete as complete\n }\n attach recovery = collections.case {\n on: plan, agency: collector, capital: operator\n expose create as refer\n expose assign as assign\n expose recover as recover\n expose recall as recall\n expose return_uncollected as return_uncollected\n }\n attach contact = collections.contact {\n case: recovery, agency: collector\n expose create as record_contact\n }\n}\n\nexpose plan.plan.payment.create as record_payment\nexpose plan.plan.payment.pay as pay_instalment\nexpose plan.plan.payment.refund as refund_payment\nexpose plan.plan.payoff_quote.create as quote_payoff\n\nexpose plan.contact.outcome.create as record_contact_outcome\n" },
|
|
4
|
+
{ "id": "escrow", "title": "Hold payment until delivery", "summary": "Hold a buyer’s payment until delivery is accepted.", "headers": ["escrow"], "source": "// Hold a buyer’s payment until delivery is accepted.\nprogram escrow_base \"Hold payment until delivery\"\nparty seller: business\n\nobject order \"Order\" {\n fields { price: money }\n attach payment = escrow.hold {\n payer: owner, payee: seller\n expose create as create\n expose fund as fund\n expose deliver as deliver\n expose accept as accept\n expose dispute as dispute\n expose verify_return as verify_return\n expose refund as refund\n expose refund_undelivered as refund_undelivered\n expose settle_release as settle_release\n expose settle_return as settle_return\n expose settle_refund as settle_refund\n expose cancel as cancel\n }\n}\n" },
|
|
5
|
+
{ "id": "financing", "title": "Split a purchase into instalments", "summary": "Fund a purchase and collect its scheduled repayments.", "headers": ["financing", "purchase"], "source": "// Fund a purchase and collect its scheduled repayments.\nprogram financing_base \"Split a purchase into instalments\"\nparty seller: business\n\nobject purchase \"Purchase\" {\n fields { price: money }\n attach allowance = financing.limits {\n borrower: owner, per_borrower: runtime\n expose create as request_limit\n expose approve as approve_limit\n }\n attach budget = financing.portfolio_limit {\n limit: runtime\n expose create as create_budget\n expose approve as approve_budget\n }\n // Architect sets the placeholder profit rate during tailoring.\n attach plan = financing.installments {\n borrower: owner, capital: operator\n months: 2, pricing: flat_total, profit_rate: 0%\n disburse_to: seller, seller: seller, limits: allowance, portfolio: budget\n expose create as quote\n expose sign as sign\n expose disburse as fund\n expose cancel as cancel_quote\n expose void as cancel_plan\n expose payoff as repay_early\n expose complete as complete\n }\n}\n\nexpose purchase.plan.payment.create as record_payment\nexpose purchase.plan.payment.pay as pay_instalment\nexpose purchase.plan.payment.refund as refund_payment\nexpose purchase.plan.payoff_quote.create as quote_payoff\n" },
|
|
6
|
+
{ "id": "insurance", "title": "Protect a purchase", "summary": "Collect cover premiums and reserve approved claims for payment.", "headers": ["insurance", "purchase"], "source": "// Collect cover premiums and reserve approved claims for payment.\nprogram insurance_base \"Protect a purchase\"\n\nobject purchase \"Purchase\" {\n attach cover = insurance.cover {\n holder: owner, adapter: \"conformance_boundary\"\n expose create as create_cover\n expose activate as activate_cover\n expose cancel as cancel_cover\n }\n attach claim = insurance.claim {\n cover: cover, inspector: operator\n expose create as create_claim\n expose approve as approve_claim\n expose deny as deny_claim\n expose pay as pay_claim\n }\n}\n\nexpose purchase.cover.slice.create as create_period\nexpose purchase.cover.slice.collect as collect_premium\n" },
|
|
7
|
+
{ "id": "lending", "title": "Pool funds for lending", "summary": "Pool member commitments to fund a loan and distribute repayments or losses.", "headers": ["financing", "wallet", "lending"], "source": "// Pool member commitments to fund a loan and distribute repayments or losses.\nprogram lending_base \"Pool funds for lending\"\n\nobject plan \"Plan\" {\n fields { price: money }\n attach allowance = financing.limits {\n borrower: owner, per_borrower: runtime\n expose create as request_limit\n expose approve as approve_limit\n }\n attach budget = financing.portfolio_limit {\n limit: runtime\n expose create as create_budget\n expose approve as approve_budget\n }\n // Architect sets the placeholder profit rate during tailoring.\n attach plan = financing.installments {\n borrower: owner, capital: operator\n months: 2, pricing: flat_total, profit_rate: 0%\n disburse_to: borrower, limits: allowance, portfolio: budget\n expose create as quote\n expose sign as sign\n expose disburse as fund\n expose cancel as cancel_quote\n expose void as cancel_plan\n expose payoff as repay_early\n expose complete as complete\n }\n attach balance = wallet.balance {\n holder: actor\n expose create as create_balance\n expose activate as activate_balance\n expose topup as add_funds\n expose withdraw as withdraw_funds\n }\n attach round = lending.round {\n borrower: owner, plan: plan\n expose create as open_round\n expose close as close_round\n }\n attach commitment = lending.commitment {\n round: round, wallet: balance, investor: actor\n expose create as commit\n expose withdraw as withdraw_commitment\n }\n attach returns = lending.distribution {\n round: round, receipt: plan.settlement\n expose create as record_settlement\n expose prepare_cash as prepare_returns\n expose distribute_cash as distribute_returns\n }\n attach losses = lending.distribution {\n round: round, receipt: plan.settlement, mode: loss\n expose create as record_loss\n expose prepare_loss as prepare_losses\n expose distribute_loss as distribute_losses\n }\n}\n\nexpose plan.plan.payment.create as record_payment\nexpose plan.plan.payment.pay as pay_instalment\nexpose plan.plan.payment.refund as refund_payment\nexpose plan.plan.payoff_quote.create as quote_payoff\n\nexpose plan.returns.share.create as create_return_share\nexpose plan.losses.share.create as create_loss_share\nexpose plan.plan.write_off_request.create as request_write_off\nexpose plan.plan.write_off_request.apply as apply_write_off\nexpose plan.plan.write_off_request.cancel as cancel_write_off\n" },
|
|
8
|
+
{ "id": "marketplace", "title": "Connect buyers and sellers", "summary": "Turn a seller’s offer into an order with payment held until acceptance.", "headers": ["marketplace", "escrow"], "source": "// Turn a seller’s offer into an order with payment held until acceptance.\nprogram marketplace_base \"Connect buyers and sellers\"\nparty seller: business\n\nobject order \"Order\" {\n fields { price: money }\n attach offer = marketplace.listing {\n seller: seller\n expose create as create_offer\n expose publish as publish_offer\n expose withdraw as withdraw_offer\n expose sell as sell_offer\n }\n attach order = marketplace.order {\n listing: offer, buyer: owner, fulfiller: seller\n expose create as create_order\n expose commit as commit_order\n expose fulfill as fulfill_order\n expose cancel as cancel_order\n }\n attach payment = escrow.hold {\n payer: owner, payee: seller\n expose create as create\n expose fund as fund\n expose deliver as deliver\n expose accept as accept\n expose dispute as dispute\n expose verify_return as verify_return\n expose refund as refund\n expose refund_undelivered as refund_undelivered\n expose settle_release as settle_release\n expose settle_return as settle_return\n expose settle_refund as settle_refund\n expose cancel as cancel\n }\n}\n" },
|
|
9
|
+
{ "id": "money", "title": "Collect a payment", "summary": "Collect a payment from a customer.", "headers": ["money"], "source": "// Collect a payment from a customer.\nprogram money_base \"Collect a payment\"\n\nobject purchase \"Purchase\" {\n attach payment = money.transfer {\n payer: owner, payee: operator\n expose create as create\n expose pay as pay\n expose cancel as cancel\n }\n}\n" },
|
|
10
|
+
{ "id": "reporting", "title": "Track repayments", "summary": "Report outstanding balances and overdue repayments on financed purchases.", "headers": ["financing", "reporting", "purchase"], "source": "// Report outstanding balances and overdue repayments on financed purchases.\nprogram reporting_base \"Track repayments\"\n\nobject purchase \"Purchase\" {\n fields { price: money }\n attach allowance = financing.limits {\n borrower: owner, per_borrower: runtime\n expose create as request_limit\n expose approve as approve_limit\n }\n attach budget = financing.portfolio_limit {\n limit: runtime\n expose create as create_budget\n expose approve as approve_budget\n }\n // Architect sets the placeholder profit rate during tailoring.\n attach plan = financing.installments {\n borrower: owner, capital: operator\n months: 2, pricing: flat_total, profit_rate: 0%\n disburse_to: borrower, limits: allowance, portfolio: budget\n expose create as quote\n expose sign as sign\n expose disburse as fund\n expose cancel as cancel_quote\n expose void as cancel_plan\n expose payoff as repay_early\n expose complete as complete\n }\n attach reports = reporting.portfolio {\n on: plan\n expose create as create_reports\n }\n}\n\nexpose purchase.plan.payment.create as record_payment\nexpose purchase.plan.payment.pay as pay_instalment\nexpose purchase.plan.payment.refund as refund_payment\nexpose purchase.plan.payoff_quote.create as quote_payoff\n" },
|
|
11
|
+
{ "id": "savings", "title": "Save as a group", "summary": "Collect contributions into a shared pot and pay each member in turn.", "headers": ["savings"], "source": "// Collect contributions into a shared pot and pay each member in turn.\nprogram savings_base \"Save as a group\"\n\nobject pot \"Pot\" {\n attach circle = savings.circle {\n contribution: runtime, members: 2, starts: runtime\n expose create as create_circle\n expose disband as disband_circle\n expose close as close_circle\n }\n attach membership = savings.membership {\n circle: circle, member: actor\n expose create as join\n expose activate as activate_membership\n expose withdraw as withdraw\n }\n}\n\nexpose pot.membership.contribution.create as schedule_contribution\n" },
|
|
12
|
+
{ "id": "wallet", "title": "Offer prepaid credit", "summary": "Let a customer add funds and reserve each spend before payment.", "headers": ["wallet"], "source": "// Let a customer add funds and reserve each spend before payment.\nprogram wallet_base \"Offer prepaid credit\"\n\nobject balance \"Balance\" {\n attach balance = wallet.balance {\n holder: owner\n expose create as create_balance\n expose activate as activate_balance\n expose topup as add_funds\n expose withdraw as withdraw_funds\n expose freeze as freeze_balance\n expose unfreeze as unfreeze_balance\n }\n attach spend = wallet.spend {\n wallet: balance, payee: operator, holder: owner\n expose create as create\n expose reserve as reserve\n expose pay as pay\n expose cancel as cancel\n }\n}\n" },
|
|
13
13
|
];
|
|
14
14
|
//# sourceMappingURL=bases-bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bases-bundle.js","sourceRoot":"","sources":["../../src/bases-bundle.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAc;IAC9B,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,uBAAuB,EAAC,SAAS,EAAC,kEAAkE,EAAC,SAAS,EAAC,CAAC,OAAO,CAAC,EAAC,QAAQ,EAAC,
|
|
1
|
+
{"version":3,"file":"bases-bundle.js","sourceRoot":"","sources":["../../src/bases-bundle.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAc;IAC9B,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,uBAAuB,EAAC,SAAS,EAAC,kEAAkE,EAAC,SAAS,EAAC,CAAC,OAAO,CAAC,EAAC,QAAQ,EAAC,2qCAA2qC,EAAC;IACp0C,EAAC,IAAI,EAAC,aAAa,EAAC,OAAO,EAAC,4BAA4B,EAAC,SAAS,EAAC,sEAAsE,EAAC,SAAS,EAAC,CAAC,WAAW,EAAC,aAAa,CAAC,EAAC,QAAQ,EAAC,woDAAwoD,EAAC;IACl0D,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,6BAA6B,EAAC,SAAS,E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AC,QAAQ,EAAC,+lBAA+lB,EAAC;IAC1vB,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,sBAAsB,EAAC,SAAS,EAAC,iEAAiE,EAAC,SAAS,EAAC,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAC,ioBAAioB,EAAC;CAC3xB,CAAC"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* compiler admits. Each template guide takes its example from here, and
|
|
4
4
|
* std-headers.spec proves the whole program compiles.
|
|
5
5
|
*/
|
|
6
|
-
export declare const catalogProgramSource = "program catalog \"Template catalog\"\
|
|
6
|
+
export declare const catalogProgramSource = "program catalog \"Template catalog\"\nparty supplier: business\nparty inspector: staff role claim_inspector\nparty investor: business\nobject item \"Item\" {\n attach transfer = money.transfer { payer: actor, payee: owner, amount: 750 SAR }\n attach hold = money.hold { payer: actor, payee: owner, amount: 750 SAR }\n attach split = money.split { payer: actor, amount: 750 SAR }\n attach schedule = money.schedule { payer: owner, payee: operator, amount: 250 SAR, every: 1 month }\n attach pool = money.pool { payer: actor, payee: owner, target: 1000 SAR, closes: 2027-01-01 }\n attach swap = money.swap { first: actor, second: owner, first_amount: 100 SAR, second_amount: 200 SAR, expires: 2027-01-01 }\n attach payout = money.payout { payer: actor, payee: owner, adapter: \"conformance_boundary\" }\n attach mandate = money.mandate { payer: actor, payee: owner }\n attach metered = money.metered { payer: actor, payee: owner, unit_price: 10 SAR }\n attach late_fee = money.late_fee { payer: actor, payee: owner, amount: 50 SAR, cap: 500 SAR }\n attach policy = insurance.cover { holder: actor, adapter: \"conformance_boundary\" }\n attach claim = insurance.claim { cover: policy, inspector: inspector }\n attach cov = insurance.cover { holder: actor, broker: supplier, adapter: \"conformance_boundary\", covers: sale }\n attach deposit = escrow.hold { payer: actor, payee: owner }\n attach sale = escrow.hold { funding: { controllers: [checkout], reference: \"funds\", blocking_states: [active] }, payer: actor, payee: owner }\n attach trip = booking.reservation { customer: actor, operator: owner }\n attach limits = financing.limits { borrower: actor, per_borrower: 60000 SAR }\n attach ceiling = financing.portfolio_limit { limit: 1500000 SAR }\n attach checkout = purchase.checkout { plans: plan, funds: sale, borrower: actor, capital: operator }\n attach plan = financing.installments { borrower: actor, capital: operator, months: 3, pricing: flat_total, profit_rate: 2.5%, down_payment: 20%, funds: checkout, limits: limits, portfolio: ceiling }\n attach late = financing.late_charge { on: plan, borrower: actor }\n attach line = financing.credit_line { borrower: operator, adapter: \"conformance_boundary\", limit: 100000 SAR, expires: 2027-01-01 }\n attach advance = financing.advance { line: line }\n attach case = collections.case { on: plan, agency: supplier }\n attach contact = collections.contact { case: case, agency: supplier }\n attach reminder = collections.reminder { on: plan }\n attach wallet = wallet.balance { holder: investor }\n attach spend = wallet.spend { wallet: wallet, payee: supplier, holder: investor }\n attach round = lending.round { borrower: actor, plan: plan, minimum_ticket: 100 SAR, investor_cap: 100% }\n attach commitment = lending.commitment { round: round, wallet: wallet, investor: investor }\n attach distribution = lending.distribution { round: round, receipt: plan.settlement }\n attach cardholder = cards.cardholder { holder: actor }\n attach card = cards.card { holder: cardholder, person: actor, spend_limit: 5000 SAR }\n attach authorization = cards.authorization { card: card, merchant: supplier }\n attach transaction = cards.transaction { authorization: authorization }\n attach dispute = cards.dispute { transaction: transaction }\n attach listing = marketplace.listing { seller: owner }\n attach order = marketplace.order { listing: listing, buyer: actor }\n attach reservation = marketplace.reservation { listing: listing, funds: sale, converters: checkout, buyer: actor, seller: owner }\n attach circle = savings.circle { contribution: 300 SAR, members: 8, starts: 2027-01-01 }\n attach membership = savings.membership { circle: circle, member: actor }\n attach reports = reporting.portfolio { on: plan }\n}";
|
|
7
7
|
//# sourceMappingURL=catalog-program.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-program.d.ts","sourceRoot":"","sources":["../../src/catalog-program.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"catalog-program.d.ts","sourceRoot":"","sources":["../../src/catalog-program.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,6rHA+C/B,CAAC"}
|
|
@@ -4,19 +4,6 @@
|
|
|
4
4
|
* std-headers.spec proves the whole program compiles.
|
|
5
5
|
*/
|
|
6
6
|
export const catalogProgramSource = `program catalog "Template catalog"
|
|
7
|
-
use money
|
|
8
|
-
use escrow
|
|
9
|
-
use purchase
|
|
10
|
-
use booking
|
|
11
|
-
use marketplace
|
|
12
|
-
use financing
|
|
13
|
-
use insurance
|
|
14
|
-
use lending
|
|
15
|
-
use wallet
|
|
16
|
-
use cards
|
|
17
|
-
use collections
|
|
18
|
-
use savings
|
|
19
|
-
use reporting
|
|
20
7
|
party supplier: business
|
|
21
8
|
party inspector: staff role claim_inspector
|
|
22
9
|
party investor: business
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-program.js","sourceRoot":"","sources":["../../src/catalog-program.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG
|
|
1
|
+
{"version":3,"file":"catalog-program.js","sourceRoot":"","sources":["../../src/catalog-program.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+ClC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { UdlDocument } from "@hyperscale0/udl";
|
|
2
|
+
import type { CheckDecl, Expr } from "./ast.ts";
|
|
3
|
+
type Balances = Record<string, string>;
|
|
4
|
+
type Values = Record<string, unknown>;
|
|
5
|
+
type Expected = {
|
|
6
|
+
expected?: Balances;
|
|
7
|
+
};
|
|
8
|
+
export type CompiledCheckStep = Expected & ({
|
|
9
|
+
kind: "clock";
|
|
10
|
+
at: string;
|
|
11
|
+
waitFor?: {
|
|
12
|
+
object: string;
|
|
13
|
+
state: string;
|
|
14
|
+
attachment?: string;
|
|
15
|
+
recordPath?: string;
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
kind: "object";
|
|
19
|
+
id: string;
|
|
20
|
+
objectKind: string;
|
|
21
|
+
owner: string;
|
|
22
|
+
fields?: Values;
|
|
23
|
+
} | {
|
|
24
|
+
kind: "action";
|
|
25
|
+
object: string;
|
|
26
|
+
action: string;
|
|
27
|
+
actor?: string;
|
|
28
|
+
input?: Values;
|
|
29
|
+
fields?: Values;
|
|
30
|
+
state?: string;
|
|
31
|
+
status?: number | "absent";
|
|
32
|
+
code?: string;
|
|
33
|
+
remember?: string;
|
|
34
|
+
instance?: string;
|
|
35
|
+
} | {
|
|
36
|
+
kind: "close";
|
|
37
|
+
customer: string;
|
|
38
|
+
});
|
|
39
|
+
/** A check as the Build carries it; `buildCheckSchema` in contracts parses it. */
|
|
40
|
+
export interface CompiledCheck {
|
|
41
|
+
name: string;
|
|
42
|
+
customers: {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
kind?: "organization";
|
|
46
|
+
fund?: string;
|
|
47
|
+
}[];
|
|
48
|
+
bindings?: Record<string, string>;
|
|
49
|
+
steps: CompiledCheckStep[];
|
|
50
|
+
expected: Balances;
|
|
51
|
+
expectedHeld?: string;
|
|
52
|
+
pending?: Record<string, Balances>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Lowers every check against the compiled document. A name the document does
|
|
56
|
+
* not declare fails at the step that wrote it.
|
|
57
|
+
*/
|
|
58
|
+
export declare function lowerChecks(checks: readonly CheckDecl[], document: UdlDocument, literal: (expr: Expr) => string | number | boolean): CompiledCheck[];
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../src/checks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBA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