# Class: PackDefinitionBuilder

Defined in: [builder.ts:58](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L58)

A class that assists in constructing a pack definition. Use [newPack](../../functions/newPack/) to create one.

## Implements

- [`BasicPackDefinition`](../../type-aliases/BasicPackDefinition/)

## Constructors

### Constructor

> **new PackDefinitionBuilder**(`definition?`): `PackDefinitionBuilder`

Defined in: [builder.ts:132](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L132)

Constructs a PackDefinitionBuilder. However, `sdk.newPack()` should be used instead rather than constructing a builder directly.

#### Parameters

| Parameter | Type | | --- | --- | | `definition?` | `Partial`\<[`PackVersionDefinition`](../../interfaces/PackVersionDefinition/)> |

#### Returns

`PackDefinitionBuilder`

## Properties

### defaultAuthentication?

> `optional` **defaultAuthentication**: [`Authentication`](../../type-aliases/Authentication/)

Defined in: [builder.ts:107](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L107)

See [PackVersionDefinition.defaultAuthentication](../../interfaces/PackVersionDefinition/#defaultauthentication).

#### Implementation of

[`PackDefinition`](../../interfaces/PackDefinition/).[`defaultAuthentication`](../../interfaces/PackDefinition/#defaultauthentication)

______________________________________________________________________

### formats

> **formats**: [`Format`](../../interfaces/Format/)[]

Defined in: [builder.ts:66](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L66)

See [PackVersionDefinition.formats](../../interfaces/PackVersionDefinition/#formats).

#### Implementation of

[`PackDefinition`](../../interfaces/PackDefinition/).[`formats`](../../interfaces/PackDefinition/#formats)

______________________________________________________________________

### ~~formulaNamespace?~~

> `optional` **formulaNamespace**: `string`

Defined in: [builder.ts:124](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L124)

#### Deprecated

#### Implementation of

[`PackDefinition`](../../interfaces/PackDefinition/).[`formulaNamespace`](../../interfaces/PackDefinition/#formulanamespace)

______________________________________________________________________

### formulas

> **formulas**: [`Formula`](../../type-aliases/Formula/)[]

Defined in: [builder.ts:62](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L62)

See [PackVersionDefinition.formulas](../../interfaces/PackVersionDefinition/#formulas).

#### Implementation of

[`PackDefinition`](../../interfaces/PackDefinition/).[`formulas`](../../interfaces/PackDefinition/#formulas)

______________________________________________________________________

### networkDomains

> **networkDomains**: `string`[]

Defined in: [builder.ts:97](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L97)

See [PackVersionDefinition.networkDomains](../../interfaces/PackVersionDefinition/#networkdomains).

#### Implementation of

[`PackDefinition`](../../interfaces/PackDefinition/).[`networkDomains`](../../interfaces/PackDefinition/#networkdomains)

______________________________________________________________________

### skillEntrypoints?

> `optional` **skillEntrypoints**: [`SkillEntrypoints`](../../interfaces/SkillEntrypoints/)

Defined in: [builder.ts:78](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L78)

See [PackVersionDefinition.skillEntrypoints](../../interfaces/PackVersionDefinition/#skillentrypoints).

#### Implementation of

[`PackDefinition`](../../interfaces/PackDefinition/).[`skillEntrypoints`](../../interfaces/PackDefinition/#skillentrypoints)

______________________________________________________________________

### skills

> **skills**: [`Skill`](../../interfaces/Skill/)[]

Defined in: [builder.ts:74](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L74)

See [PackVersionDefinition.skills](../../interfaces/PackVersionDefinition/#skills).

#### Implementation of

[`PackDefinition`](../../interfaces/PackDefinition/).[`skills`](../../interfaces/PackDefinition/#skills)

______________________________________________________________________

### syncTables

> **syncTables**: [`SyncTable`](../../type-aliases/SyncTable/)[]

Defined in: [builder.ts:70](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L70)

See [PackVersionDefinition.syncTables](../../interfaces/PackVersionDefinition/#synctables).

#### Implementation of

[`PackDefinition`](../../interfaces/PackDefinition/).[`syncTables`](../../interfaces/PackDefinition/#synctables)

______________________________________________________________________

### systemConnectionAuthentication?

> `optional` **systemConnectionAuthentication**: [`SystemAuthentication`](../../type-aliases/SystemAuthentication/)

Defined in: [builder.ts:111](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L111)

See [PackVersionDefinition.systemConnectionAuthentication](../../interfaces/PackVersionDefinition/#systemconnectionauthentication).

#### Implementation of

[`PackDefinition`](../../interfaces/PackDefinition/).[`systemConnectionAuthentication`](../../interfaces/PackDefinition/#systemconnectionauthentication)

______________________________________________________________________

### version?

> `optional` **version**: `string`

Defined in: [builder.ts:122](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L122)

See [PackVersionDefinition.version](../../interfaces/PackVersionDefinition/#version).

## Methods

### addColumnFormat()

> **addColumnFormat**(`format`): `this`

Defined in: [builder.ts:286](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L286)

Adds a column format definition to this pack.

In the web editor, the `/ColumnFormat` shortcut will insert a snippet of a skeleton format.

#### Example

```
pack.addColumnFormat({
  name: 'MyColumn',
  formulaName: 'MyFormula',
});
```

#### Parameters

| Parameter | Type | | --- | --- | | `format` | [`Format`](../../interfaces/Format/) |

#### Returns

`this`

______________________________________________________________________

### addDynamicSyncTable()

> **addDynamicSyncTable**\<`K`, `L`, `ParamDefsT`, `SchemaT`, `ContextT`, `PermissionsContextT`>(`definition`): `this`

Defined in: [builder.ts:257](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L257)

Adds a dynamic sync table definition to this pack.

In the web editor, the `/DynamicSyncTable` shortcut will insert a snippet of a skeleton sync table.

#### Example

```
pack.addDynamicSyncTable({
  name: "MySyncTable",
  getName: async funciton (context) => {
    const response = await context.fetcher.fetch({method: "GET", url: context.sync.dynamicUrl});
    return response.body.name;
  },
  getName: async function (context) => {
    const response = await context.fetcher.fetch({method: "GET", url: context.sync.dynamicUrl});
    return response.body.browserLink;
  },
  ...
});
```

#### Type Parameters

| Type Parameter | | --- | | `K` *extends* `string` | | `L` *extends* `string` | | `ParamDefsT` *extends* [`ParamDefs`](../../type-aliases/ParamDefs/) | | `SchemaT` *extends* [`ObjectSchemaDefinition`](../../interfaces/ObjectSchemaDefinition/)\<`K`, `L`> | | `ContextT` *extends* [`SyncExecutionContext`](../../interfaces/SyncExecutionContext/)\<`any`, `any`, `any`> | | `PermissionsContextT` *extends* `SyncPassthroughData` |

#### Parameters

| Parameter | Type | | --- | --- | | `definition` | [`DynamicSyncTableOptions`](../../interfaces/DynamicSyncTableOptions/)\<`K`, `L`, `ParamDefsT`, `SchemaT`, `ContextT`, `PermissionsContextT`> |

#### Returns

`this`

______________________________________________________________________

### addFormula()

> **addFormula**\<`ParamDefsT`, `ResultT`, `SchemaT`>(`definition`): `this`

Defined in: [builder.ts:189](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L189)

Adds a formula definition to this pack.

In the web editor, the `/Formula` shortcut will insert a snippet of a skeleton formula.

#### Example

```
pack.addFormula({
  resultType: ValueType.String,
   name: 'MyFormula',
   description: 'My description.',
   parameters: [
     makeParameter({
       type: ParameterType.String,
       name: 'myParam',
       description: 'My param description.',
     }),
   ],
   execute: async ([param]) => {
     return `Hello ${param}`;
   },
});
```

#### Type Parameters

| Type Parameter | | --- | | `ParamDefsT` *extends* [`ParamDefs`](../../type-aliases/ParamDefs/) | | `ResultT` *extends* [`ValueType`](../../enumerations/ValueType/) | | `SchemaT` *extends* [`Schema`](../../type-aliases/Schema/) |

#### Parameters

| Parameter | Type | | --- | --- | | `definition` | `object` & [`FormulaDefinitionOptions`](../../type-aliases/FormulaDefinitionOptions/)\<`ParamDefsT`, `ResultT`, `SchemaT`> |

#### Returns

`this`

______________________________________________________________________

### addMCPServer()

> **addMCPServer**(`server`): `this`

Defined in: [builder.ts:322](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L322)

Adds an MCP server to this pack.

#### Example

```
pack.addMCPServer({name: 'MyMCPServer', endpointUrl: 'https://my-mcp-server.com'});
```

#### Parameters

| Parameter | Type | | --- | --- | | `server` | [`MCPServer`](../../interfaces/MCPServer/) |

#### Returns

`this`

______________________________________________________________________

### addNetworkDomain()

> **addNetworkDomain**(...`domain`): `this`

Defined in: [builder.ts:527](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L527)

Adds the domain that this pack makes HTTP requests to. For example, if your pack makes HTTP requests to "api.example.com", use "example.com" as your network domain.

If your pack make HTTP requests, it must declare a network domain, for security purposes. The platform enforces that your pack cannot make requests to any undeclared domains.

You are allowed one network domain per pack by default. If your pack needs to connect to multiple domains, contact Superhuman for approval.

#### Example

```
pack.addNetworkDomain('example.com');
```

#### Parameters

| Parameter | Type | | --- | --- | | ...`domain` | `string`[] |

#### Returns

`this`

______________________________________________________________________

### addSkill()

> **addSkill**(`skill`): `this`

Defined in: [builder.ts:309](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L309)

Adds an agent skill definition to this pack.

In the web editor, the `/Skill` shortcut will insert a snippet of a skeleton skill.

#### Example

```
pack.addSkill({
  name: "MySkill",
  displayName: "My Display Name",
  description: "My description.",
  prompt: `My prompt.`,
  tools: [
    { type: sdk.ToolType.Pack },
  ],
});
```

#### Parameters

| Parameter | Type | | --- | --- | | `skill` | [`Skill`](../../interfaces/Skill/) |

#### Returns

`this`

______________________________________________________________________

### addSuggestedPrompt()

> **addSuggestedPrompt**(`prompt`): `this`

Defined in: [builder.ts:412](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L412)

Adds a suggested prompt that appears as a button when the agent is opened in chat.

#### Example

```
pack.addSuggestedPrompt({
  name: "TicketStatus",
  displayName: "Check ticket status",
  prompt: `
    Show me the status of all open support tickets.
  `,
});
```

#### Parameters

| Parameter | Type | | --- | --- | | `prompt` | `SuggestedPrompt` |

#### Returns

`this`

______________________________________________________________________

### addSyncTable()

> **addSyncTable**\<`K`, `L`, `ParamDefsT`, `SchemaT`, `ContextT`, `PermissionsContextT`>(`definition`): `this`

Defined in: [builder.ts:219](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L219)

Adds a sync table definition to this pack.

In the web editor, the `/SyncTable` shortcut will insert a snippet of a skeleton sync table.

#### Example

```
pack.addSyncTable({
  name: 'MySyncTable',
  identityName: 'EntityName',
  schema: sdk.makeObjectSchema({
    ...
  }),
  formula: {
    ...
  },
});
```

#### Type Parameters

| Type Parameter | | --- | | `K` *extends* `string` | | `L` *extends* `string` | | `ParamDefsT` *extends* [`ParamDefs`](../../type-aliases/ParamDefs/) | | `SchemaT` *extends* `ObjectSchema`\<`K`, `L`> | | `ContextT` *extends* [`SyncExecutionContext`](../../interfaces/SyncExecutionContext/)\<`any`, `any`, `any`> | | `PermissionsContextT` *extends* `SyncPassthroughData` |

#### Parameters

| Parameter | Type | | --- | --- | | `definition` | [`SyncTableOptions`](../../interfaces/SyncTableOptions/)\<`K`, `L`, `ParamDefsT`, `SchemaT`, `ContextT`, `PermissionsContextT`> |

#### Returns

`this`

______________________________________________________________________

### setBenchInitializationSkill()

> **setBenchInitializationSkill**(`skill`): `this`

Defined in: [builder.ts:376](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L376)

Sets the skill used when the agent is first opened in the agent bench. All fields are optional - omitted fields will use defaults at runtime.

#### Example

```
pack.setBenchInitializationSkill({
  prompt: `
    Say hello to the user, referencing the time of day and a friendly nickname.
    For example: 10AM, Kramer => "Good morning K-man!"
  `,
  tools: [],
});
```

#### Parameters

| Parameter | Type | | --- | --- | | `skill` | [`PartialSkillDef`](../../type-aliases/PartialSkillDef/) |

#### Returns

`this`

______________________________________________________________________

### setChatSkill()

> **setChatSkill**(`skill`): `this`

Defined in: [builder.ts:356](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L356)

Sets the chat skill for this pack's agent.

The chat skill controls the behavior when users chat with the pack agent. It defines the prompts, available tools, and optionally the model to use.

All fields are optional — omitted fields use defaults at runtime. When `tools` is omitted, the agent automatically gets:

- [ToolType.Pack](../../enumerations/ToolType/#pack) — the pack's own formulas
- [ToolType.Knowledge](../../enumerations/ToolType/#knowledge) — search over the pack's sync table data (when sync tables exist)

Specifying `tools` replaces these defaults entirely.

#### Example

```
// Override just the prompt — default tools are preserved
pack.setChatSkill({
  prompt: "End every reply with 'Moo!'",
});

// Override tools — replaces the defaults
pack.setChatSkill({
  tools: [
    { type: sdk.ToolType.Pack },
    { type: sdk.ToolType.ContactResolution },
  ],
});
```

#### Parameters

| Parameter | Type | | --- | --- | | `skill` | [`PartialSkillDef`](../../type-aliases/PartialSkillDef/) |

#### Returns

`this`

______________________________________________________________________

### ~~setSkillEntrypoints()~~

> **setSkillEntrypoints**(`entrypoints`): `this`

Defined in: [builder.ts:393](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L393)

Maps agent entrypoints to skills in the Pack.

#### Example

```
pack.setSkillEntrypoints({
  defaultChat: { skillName: "MySkill" },
});
```

#### Deprecated

Use [PackDefinitionBuilder.setChatSkill](#setchatskill) instead.

#### Parameters

| Parameter | Type | | --- | --- | | `entrypoints` | [`SkillEntrypoints`](../../interfaces/SkillEntrypoints/) |

#### Returns

`this`

______________________________________________________________________

### setSystemAuthentication()

> **setSystemAuthentication**(`systemAuthentication`): `this`

Defined in: [builder.ts:487](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L487)

Sets this pack to use authentication provided by you as the maker of this pack.

You will need to register credentials to use with this pack. When users use the pack, their requests will be authenticated with those system credentials, they need not register their own account.

In the web editor, the `/SystemAuthentication` shortcut will insert a snippet of a skeleton authentication definition.

#### Example

```
pack.setSystemAuthentication({
  type: AuthenticationType.HeaderBearerToken,
});
```

#### Parameters

| Parameter | Type | | --- | --- | | `systemAuthentication` | [`SystemAuthenticationDef`](../../type-aliases/SystemAuthenticationDef/) |

#### Returns

`this`

______________________________________________________________________

### setUserAuthentication()

> **setUserAuthentication**(`authDef`): `this`

Defined in: [builder.ts:455](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L455)

Sets this pack to use authentication for individual users, using the authentication method is the given definition.

Each user will need to register an account in order to use this pack.

In the web editor, the `/UserAuthentication` shortcut will insert a snippet of a skeleton authentication definition.

By default, this will set a default connection (account) requirement, making a user account required to invoke all formulas in this pack unless you specify differently on a particular formula. To change the default, you can pass a `defaultConnectionRequirement` option into this method.

#### Example

```
pack.setUserAuthentication({
  type: AuthenticationType.HeaderBearerToken,
});
```

#### Parameters

| Parameter | Type | | --- | --- | | `authDef` | [`UserAuthenticationDef`](../../type-aliases/UserAuthenticationDef/) |

#### Returns

`this`

______________________________________________________________________

### setVersion()

> **setVersion**(`version`): `this`

Defined in: [builder.ts:545](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/builder.ts#L545)

Sets the semantic version of this pack version, e.g. `'1.2.3'`.

This is optional, and you only need to provide a version if you are manually doing semantic versioning, or using the CLI. If using the web editor, you can omit this and the web editor will automatically provide an appropriate semantic version each time you build a version.

#### Example

```
pack.setVersion('1.2.3');
```

#### Parameters

| Parameter | Type | | --- | --- | | `version` | `string` |

#### Returns

`this`
